Commit d4518920 authored by Kevin Stover's avatar Kevin Stover

Merge branch 'develop'

parents 2a30433d 2f643e12
......@@ -4,7 +4,7 @@
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 4.5
Tested up to: 4.7
Stable tag: 3.1
Stable tag: 3.1.1
License: GPLv2 or later
With a simple drag and drop interface you can create contact forms, email subscription forms, order forms, payment forms, and any other type of form for your WordPress site.
......
......@@ -158,6 +158,8 @@ define( [], function() {
* @return void
*/
checkDec: function( dec, optionModel ) {
// If dec isn't defined, bail...
if( 'undefined' === typeof(dec) ) return false;
// Get our current errors, if any.
var errors = optionModel.get( 'errors' );
/**
......
......@@ -31,12 +31,14 @@ define( [
initialize: function(){
this.listenTo( nfRadio.channel( 'drawer' ), 'render:settingGroup', function(){
jQuery( '.merge-tags' ).off( 'click' );
jQuery( '.merge-tags' ).on( 'click', this.mergeTagsButtonClick );
});
this.listenTo( nfRadio.channel( 'app' ), 'after:appStart', this.afterAppStart );
this.listenTo( nfRadio.channel( 'app' ), 'before:renderSetting', this.beforeRenderSetting );
this.listenTo( nfRadio.channel( 'drawer' ), 'before:close', this.beforeDrawerClose );
this.listenTo( nfRadio.channel( 'drawer' ), 'opened', function(){
jQuery( '.merge-tags' ).on( 'click', this.mergeTagsButtonClick );
} );
var that = this;
nfRadio.channel( 'mergeTags' ).reply( 'set:caret', function( position ){
......@@ -65,13 +67,22 @@ define( [
jQuery( selector ).on( 'keyup', function( event ){
that.keyupCallback( event, selector, 'option-repeater' );
});
jQuery( selector ).siblings( '.merge-tags' ).on( 'click', this.mergeTagsButtonClick );
jQuery( selector ).siblings( '.nf-list-options .merge-tags' ).off( 'click' );
jQuery( selector ).siblings( '.nf-list-options .merge-tags' ).on( 'click', this.mergeTagsButtonClick );
} );
this.listenTo( nfRadio.channel( 'drawer' ), 'opened', function(){
jQuery( '.nf-list-options .merge-tags' ).off( 'click' );
jQuery( '.nf-list-options .merge-tags' ).on( 'click', this.mergeTagsButtonClick );
} );
/* CALCULATIONS */
this.listenTo( nfRadio.channel( 'setting-calculations-option' ), 'render:setting', this.renderSetting );
this.listenTo( nfRadio.channel( 'setting-calculations-option' ), 'render:setting', function( settingModel, dataModel, view ){
view.$el.find( '.merge-tags' ).on( 'click', this.mergeTagsButtonClick );
// this.listenTo( nfRadio.channel( 'setting-calculations-option' ), 'render:setting', function( settingModel, dataModel, view ){
// view.$el.find( '.merge-tags' ).on( 'click', this.mergeTagsButtonClick );
// } );
this.listenTo( nfRadio.channel( 'drawer' ), 'opened', function(){
jQuery( '.nf-list-options.calculations .merge-tags' ).off( 'click' );
jQuery( '.nf-list-options.calculations .merge-tags' ).on( 'click', this.mergeTagsButtonClick );
} );
/* SUMMERNOTE */
......@@ -84,6 +95,10 @@ define( [
this.listenTo( nfRadio.channel( 'summernote' ), 'keyup', function( e, selector ){
that.keyupCallback( e, selector, 'rte' );
} );
this.listenTo( nfRadio.channel( 'drawer' ), 'opened', function(){
jQuery( '.note-editor .merge-tags' ).off( 'click' );
jQuery( '.note-editor .merge-tags' ).on( 'click', this.mergeTagsButtonClick );
} );
jQuery( document ).on( 'keyup', function( event ){
if( 27 == event.keyCode ){
......@@ -141,6 +156,7 @@ define( [
renderSetting: function( settingModel, dataModel, view ){
view.$el.find( '.merge-tags' ).off( 'click' );
view.$el.find( '.merge-tags' ).on( 'click', this.mergeTagsButtonClick );
if( 0 == jQuery( '#merge-tags-box' ).length ) this.afterAppStart();
......@@ -210,7 +226,7 @@ define( [
var replace = tag;
var caretPos = nfRadio.channel( 'mergeTags' ).request( 'get:caret' );
var patt = /{([a-z0-9]|:|_|})*/g;
var patt = /{([a-z0-9]|:|_||-})*/g;
// Loop through matches to find insert/replace index range.
// Reference: http://codepen.io/kjohnson/pen/36c3a782644dfff40fe3c1f05f8739d9?editors=0012
......@@ -273,7 +289,9 @@ define( [
},
mergeTagsButtonClick: function( e ){
var $this = jQuery( this );
if( $this.siblings().hasClass( 'merge-tag-focus' ) ){
nfRadio.channel( 'mergeTags' ).request( 'insert:tag', '' );
jQuery( '#merge-tags-box' ).css( 'display', 'none' );
......@@ -283,11 +301,11 @@ define( [
return;
}
var $inputSetting = $this.siblings( '.setting' ).first();
if( 0 !== $this.closest( '.nf-setting, .nf-table-row' ).find( '.note-tools' ).length ){
var $inputSetting = $this.closest( '.note-editor' ).siblings( '.setting' ).first();
$this.closest( '.nf-setting' ).find( '.setting' ).summernote( 'insertText', '{' );
} else {
var $inputSetting = $this.siblings( '.setting' ).first();
var text = $inputSetting.val() || '';
$inputSetting.val( text + '{' ).change();
nfRadio.channel('mergeTags').request('set:caret', text.length + 1 );
......@@ -316,6 +334,7 @@ define( [
jQuery( '#merge-tags-box' ).css( 'display', 'block' );
nfRadio.channel( 'drawer' ).request( 'prevent:close' );
jQuery( '.merge-tag-focus-overlay' ).off( 'click' );
jQuery( '.merge-tag-focus-overlay' ).on( 'click', function( e ) {
if ( jQuery( e.target ).hasClass( 'note-editor' ) ) {
nfRadio.channel( 'mergeTags' ).request( 'insert:tag', '' );
......@@ -430,9 +449,9 @@ define( [
// Find merge tags.
if( 'rte' == type ) {
var mergetags = $this.summernote( 'code' ).match(new RegExp(/{([a-z0-9]|:|_|})*/g));
var mergetags = $this.summernote( 'code' ).match(new RegExp(/{([a-z0-9]|:|_|-|})*/g));
} else {
var mergetags = $this.val().match(new RegExp(/{([a-z0-9]|:|_|})*/g));
var mergetags = $this.val().match(new RegExp(/{([a-z0-9]|:|_|-|})*/g));
}
// Filter out closed merge tags.
......@@ -464,6 +483,7 @@ define( [
$overlayElement.addClass('merge-tag-focus-overlay');
}
$overlayElement.off( 'click' );
$overlayElement.on( 'click', function( event ){
var elementClasses = jQuery( event.target ).attr( 'class' ) || [];
if( -1 !== elementClasses.indexOf( 'merge-tag-focus-overlay' ) ){
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -265,7 +265,7 @@ class Ninja_Forms {
// Plugin version
if ( ! defined( 'NF_PLUGIN_VERSION' ) )
define( 'NF_PLUGIN_VERSION', '3.1' );
define( 'NF_PLUGIN_VERSION', '3.1.1' );
// Plugin Folder Path
if ( ! defined( 'NF_PLUGIN_DIR' ) )
......
......@@ -9,7 +9,6 @@ final class NF_Database_FormsController
{
global $wpdb;
$this->db = $wpdb;
$this->forms_data = $this->setFormsData();
}
public function setFormsData()
......@@ -29,6 +28,9 @@ final class NF_Database_FormsController
public function getFormsData()
{
if( empty( $this->forms_data ) ) {
$this->forms_data = $this->setFormsData();
}
return( array_values( $this->forms_data ) );
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
Plugin Name: Ninja Forms
Plugin URI: http://ninjaforms.com/
Description: Ninja Forms is a webform builder with unparalleled ease of use and features.
Version: 3.1
Version: 3.1.1
Author: The WP Ninjas
Author URI: http://ninjaforms.com
Text Domain: ninja-forms
......@@ -52,7 +52,7 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
/**
* @since 3.0
*/
const VERSION = '3.1';
const VERSION = '3.1.1';
/**
* @var Ninja_Forms
......
......@@ -3,7 +3,7 @@ Contributors: wpninjasllc, kstover, jameslaws, kbjohnson90, klhall1987, krmoorho
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 4.5
Tested up to: 4.7
Stable tag: 3.1
Stable tag: 3.1.1
License: GPLv2 or later
Drag and drop fields in an intuitive UI to create create contact forms, email subscription forms, order forms, payment forms, send emails and more!
......@@ -114,27 +114,20 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati
== Upgrade Notice ==
= 3.1 (02 May 2017) =
*Changes:*
* Added a dashboard view for forms, removing the "All Forms" and "Add New" submenus.
* All new Merge Tag UI for inserting Merge Tags into forms and actions.
* Refactored calculations, as well as adding an option to set calculation rounding.
* Updated the WordPress.org readme file.
* Opening the "new form" page should automatically open the drawer to add new fields.
= 3.1.1 (02 May 2017) =
*Bugs:*
* Fixed several bugs with calculations and locales that use non-American thousands and decimal separators.
* Products with a price over 999 should now render and calculate properly.
* Editing a submission and using a single quote should not break the submission editor.
* Fixed several PHP notices.
* After successful submission, the page should only scroll to the success message if it is not fully visible.
* Inline email validation should work properly for longer email domains, i.e. @liverpool.ac.uk
* Fixed bugs in the new Merge Tag UI that prevented it from being opened properly via clicks.
== Changelog ==
= 3.1.1 (02 May 2017) =
*Bugs:*
* Fixed bugs in the new Merge Tag UI that prevented it from being opened properly via clicks.
= 3.1 (02 May 2017) =
*Changes:*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment