Commit 792accb3 authored by Kenny Hall's avatar Kenny Hall

Fixed merge conflict

parents 112fa8df dfe13b71
......@@ -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.7
Tested up to: 4.9
Stable tag: 3.3.4
Stable tag: 3.3.7
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.
......
This diff is collapsed.
This diff is collapsed.
......@@ -3,6 +3,7 @@
.jBox-wrapper {
text-align: left;
z-index: 100000000 !important;
}
.jBox-wrapper,
......@@ -141,6 +142,11 @@
padding: 12px 15px;
}
.ninja-forms-settings #jBox-overlay .jBox-closeButton,
.ninja-forms-app #jBox-overlay .jBox-closeButton {
display: none;
}
/* jBox Confirm */
.jBox-Confirm .jBox-content {
......@@ -474,6 +480,7 @@
height: 100%;
background: #000;
background-color: rgba(0, 0, 0, .6);
z-index: 99999999 !important;
}
/* Block scrolling */
......@@ -568,3 +575,21 @@ body[class*=" jBox-blockScroll-"] {
font-size: 18px;
color: #888;
}
/* Progress Bar */
.jBox-content .nf-progress-bar {
height: 20px;
border-radius: 3px;
margin: 25px 0px;
border: 1px solid #1ea9ea;
position: relative;
overflow: hidden;
}
.jBox-content .nf-progress-bar-slider {
height: 20px;
width: 0%;
background-color: #1ea9ea;
transition: width 0.3s;
}
......@@ -72,7 +72,7 @@ define( [], function() {
* If the field has been saved, then we need to check for
* submission data for this field
*/
if( 'tmp' === modelID.substring( 0, 3 )
if( 'tmp' === modelID.toString().substring( 0, 3 )
|| -1 != jQuery.inArray( dataModel.get( 'type' ), nonSaveFields ) ) {
// not a saved field so proceed as normal
this.clickDelete( e, dataModel );
......@@ -114,94 +114,34 @@ define( [], function() {
*/
doDeleteFieldModal: function( e, dataModel ) {
// Build warning modal to warn user a losing all data related to field
var message, container, messageBox, deleteMsgs, buttons, confirm, cancel, lineBreak;
container = document.createElement( 'div' );
messageBox = document.createElement( 'p' );
buttons = document.createElement( 'div' );
buttons.style.marginTop = '10px';
buttons.style.backgroundColor = '#f4f5f6';
confirm = document.createElement( 'div' );
confirm.style.padding = '8px';
confirm.style.backgroundColor = '#d9534f';
confirm.style.borderColor = '#d9534f';
confirm.style.fontSize = '14pt';
confirm.style.fontWeight = 'bold';
confirm.style.color = '#ffffff';
confirm.style.borderRadius = '4px';
cancel = document.createElement( 'div' );
cancel.style.padding = '8px';
cancel.style.backgroundColor = '#5bc0de';
cancel.style.borderColor = '#5bc0de';
cancel.style.fontSize = '14pt';
cancel.style.fontWeight = 'bold';
cancel.style.color = '#ffffff';
cancel.style.borderRadius = '4px';
lineBreak = document.createElement( 'br' );
container.classList.add( 'message' );
messageBox.innerHTML += nfi18n.fieldDataDeleteMsg;
messageBox.appendChild( lineBreak );
container.appendChild( messageBox );
container.appendChild( lineBreak );
confirm.innerHTML = nfi18n.delete;
confirm.classList.add( 'confirm', 'nf-button', 'primary' );
confirm.style.float = 'left';
cancel.innerHTML = nfi18n.cancel;
cancel.classList.add( 'cancel', 'nf-button', 'secondary', 'cancel-delete-all' );
cancel.style.float = 'right';
buttons.appendChild( confirm );
buttons.appendChild( cancel );
buttons.classList.add( 'buttons' );
container.appendChild( buttons );
message = document.createElement( 'div' );
message.appendChild( container );
// set up delete model with all the elements created above
var deleteFieldModal = new jBox( 'Modal', {
width: 450,
addClass: 'dashboard-modal',
zIndex: 999999999,
overlay: true,
closeOnClick: false
} );
deleteFieldModal.setContent( message.innerHTML );
deleteFieldModal.setTitle( 'Delete Field?' );
var that = this;
// add event listener for cancel button
var btnCancel = deleteFieldModal.container[0].getElementsByClassName('cancel')[0];
btnCancel.addEventListener('click', function() {
// close and destroy modal
deleteFieldModal.close();
deleteFieldModal.destroy();
// set deleting to false so edit can work as normal
that.deleting = false;
} );
// add event listener for delete button
var btnDelete = deleteFieldModal.container[0].getElementsByClassName('confirm')[0];
btnDelete.addEventListener('click', function() {
// close and destroy modal.
deleteFieldModal.close();
deleteFieldModal.destroy();
// proceed as normal, data will be deleted in backend on publish
that.clickDelete( e, dataModel );
} );
deleteFieldModal.open();
var that = this;
var modalData = {
width: 400,
closeOnClick: false,
closeOnEsc: true,
content: nfi18n.fieldDataDeleteMsg,
btnPrimary: {
text: nfi18n.delete,
callback: function() {
// close and destory modal.
deleteModal.toggleModal( false );
deleteModal.destroy();
// proceed as normal, data will be deleted in backend on publish
that.clickDelete( e, dataModel );
}
},
btnSecondary: {
text: nfi18n.cancel,
callback: function() {
// close and destory modal
deleteModal.toggleModal( false );
deleteModal.destroy();
// set deleting to false so edit can work as normal
that.deleting = false;
}
}
};
var deleteModal = new NinjaModal( modalData );
},
/**
......
......@@ -76,7 +76,7 @@ define( ['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeat
nfRadio.channel( 'option-repeater' ).request( 'update:optionSortable', ui, this, that );
}
} );
that.setupTooltip();
that.maybeHideNew( that.collection );
......@@ -119,7 +119,7 @@ define( ['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeat
*/
setupTooltip: function() {
// For each .nf-help in the option repeater...
jQuery( this.el ).find('.nf-list-options').find( '.nf-help' ).each(function() {
jQuery( this.el ).find( '.nf-list-options' ).find( '.nf-help' ).each(function() {
// Get the content.
var content = jQuery(this).next('.nf-help-text');
// Declare the modal.
......@@ -135,11 +135,12 @@ define( ['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeat
templateHelpers: function () {
var that = this;
return {
renderHeaders: function() {
// If this is a Field...
// AND If the type includes 'list'...
if ( 'Field' == that.dataModel.get( 'objectType' ) && -1 !== that.dataModel.get( 'type' ).indexOf( 'list' ) ) {
if ( 'Field' == that.dataModel.get( 'objectType' ) && -1 !== that.dataModel.get( 'type' ).indexOf( 'list' ) ) {
// Declare help text.
var helpText, helpTextContainer, helpIcon, helpIconLink, helpTextWrapper;
......@@ -161,7 +162,9 @@ define( ['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeat
helpTextWrapper.appendChild( helpTextContainer );
// Append the help text to the 'value' header.
that.model.get('columns').value.header += helpTextWrapper.innerHTML;
if ( -1 == that.model.get('columns').value.header.indexOf( helpTextWrapper.innerHTML ) ) {
that.model.get('columns').value.header += helpTextWrapper.innerHTML;
}
}
var columns, beforeColumns, afterColumns;
......
......@@ -55,6 +55,14 @@ function NinjaModal ( data ) {
}
/**
* Function to destory the modal.
*/
NinjaModal.prototype.destroy = function () {
this.popup.destroy();
}
/**
* Function to increment the progress bar.
*
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -234,26 +234,6 @@ jBox
}
}
/*
Progress Bar
---------------------------------------------*/
.nf-progress-bar {
height: 20px;
border-radius: 3px;
margin: 25px 0px;
border: 1px solid #1ea9ea;
position: relative;
overflow: hidden;
.nf-progress-bar-slider {
height: 20px;
width: 0%;
background-color: #1ea9ea;
transition: width 0.3s;
}
}
/*
Loading Spinner
---------------------------------------------*/
......
......@@ -265,7 +265,7 @@ class Ninja_Forms {
// Plugin version
if ( ! defined( 'NF_PLUGIN_VERSION' ) )
define( 'NF_PLUGIN_VERSION', '3.3.4' );
define( 'NF_PLUGIN_VERSION', '3.3.7' );
// Plugin Folder Path
if ( ! defined( 'NF_PLUGIN_DIR' ) )
......
......@@ -70,11 +70,10 @@ final class NF_Actions_Save extends NF_Abstracts_Action
$expiration_value = $form_id . ',' . $action_settings[ 'subs_expire_time' ];
// Check for option value...
$option = get_option( 'nf_sub_expiration' );
$option = get_option( 'nf_sub_expiration', false );
// If option doesn't exist we know that we can just create the option.
if( ! $option ){
update_option( 'nf_sub_expiration', array( $expiration_value ) );
if( ! $option || empty( $option ) ){
return;
}
......
......@@ -221,6 +221,7 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
wp_enqueue_script( 'jquery-perfect-scrollbar', Ninja_Forms::$url . 'assets/js/lib/perfect-scrollbar.jquery.min.js', array( 'jquery' ) );
wp_enqueue_script( 'jquery-hotkeys-new', Ninja_Forms::$url . 'assets/js/lib/jquery.hotkeys.min.js' );
wp_enqueue_script( 'jBox', Ninja_Forms::$url . 'assets/js/lib/jBox.min.js' );
wp_enqueue_script( 'nf-ninjamodal', Ninja_Forms::$url . 'assets/js/lib/ninjaModal.js', array( 'jBox' ) );
wp_enqueue_script( 'nf-jquery-caret', Ninja_Forms::$url . 'assets/js/lib/jquery.caret.min.js' );
wp_enqueue_script( 'speakingurl', Ninja_Forms::$url . 'assets/js/lib/speakingurl.js' );
wp_enqueue_script( 'jquery-slugify', Ninja_Forms::$url . 'assets/js/lib/slugify.min.js', array( 'jquery', 'speakingurl' ) );
......
......@@ -60,7 +60,8 @@ return apply_filters( 'ninja_forms_action_email_settings', array(
'type' => 'toggle',
'group' => 'advanced',
'label' => __( 'Set Submissions to expire?', 'ninja-forms' ),
'value' => '',
'value' => 0,
'help' => __( 'Sets submissions to be trashes after a certain number of days, it affects all existing and new submissions', 'ninja-forms' ),
'width' => 'one-half',
),
......
......@@ -71,10 +71,12 @@ return apply_filters( 'ninja_forms_i18n_builder', array(
__( 'Fr', 'ninja-forms' ),
__( 'Sa', 'ninja-forms' )
),
'fieldDataDeleteMsg' => __( 'This will DELETE all data' .
' associated with this field. You will not be able to' .
' retrieve data for this field!' ),
'fieldDataDeleteMsg' => sprintf( __( '%sThis will also DELETE all submission data associated with this field.%sYou will not be able to retrieve this data later!%s' ), '<p>', '</p><p>', '</p><br />' ),
'delete' => __( 'Delete' ),
'cancel' => __( 'Cancel' ),
'valueChars' => __( 'In order to prevent errors, values may only contain a specific subset of characters.', 'ninja-forms' ),
'valueChars' => __( 'In order to prevent errors, values may only contain'
. ' a specific subset of characters ( a-z, 0-9, -, _, @, space ). You'
. ' can use the option label in your success message(s) or email action(s) by adding'
. ' the :label attribute to your list field merge tags. For example:'
. ' {field:key:label}', 'ninja-forms' ),
));
......@@ -10,7 +10,7 @@ final class NF_Database_SubmissionExpirationCron
public function __construct()
{
// Retrieves the option that contains all of our expiration data.
$options = get_option( 'nf_sub_expiration' );
$options = get_option( 'nf_sub_expiration', false );
// Schedules our CRON job.
if( ! wp_next_scheduled( 'nf_submission_expiration_cron' ) && ! empty( $options ) ) {
......@@ -29,10 +29,10 @@ final class NF_Database_SubmissionExpirationCron
*/
public function expired_submission_cron()
{
$options = get_option( 'nf_sub_expiration' );
$options = get_option( 'nf_sub_expiration', false );
// If options are empty bail..
if( ! $options ) return;
if( ! $options || ! is_array( $options ) ) return;
// Loop over our options and ...
foreach( $options as $option ) {
......@@ -99,7 +99,7 @@ final class NF_Database_SubmissionExpirationCron
foreach( $expired_subs as $subs ) {
foreach( $subs as $sub ) {
if( $i >= 100 ) break;
wp_delete_post( $sub );
wp_trash_post( $sub );
$i++;
}
}
......
This diff is collapsed.
......@@ -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.3.4
Version: 3.3.7
Author: The WP Ninjas
Author URI: http://ninjaforms.com
Text Domain: ninja-forms
......@@ -58,7 +58,7 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
/**
* @since 3.0
*/
const VERSION = '3.3.4';
const VERSION = '3.3.7';
const WP_MIN_VERSION = '4.7';
......@@ -213,6 +213,11 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
// If we have a recorded version...
// AND that version is less than our current version...
if ( $saved_version && version_compare( $saved_version, self::VERSION, '<' ) ) {
// *IMPORTANT: Filter to delete old bad data.
// Leave this here until at least 3.4.0.
if ( version_compare( $saved_version, '3.3.7', '<' ) && version_compare( $saved_version, '3.3.4', '>' ) ) {
delete_option( 'nf_sub_expiration' );
}
// We just upgraded the plugin.
$plugin_upgrade = true;
} else {
......
......@@ -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.7
Tested up to: 4.9
Stable tag: 3.3.4
Stable tag: 3.3.7
License: GPLv2 or later
Drag and drop fields in an intuitive UI to create contact forms, email subscription forms, order forms, payment forms, send emails and more!
......@@ -111,19 +111,41 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati
== Upgrade Notice ==
= 3.3.4 (11 June 2018) =
= 3.3.7 (21 June 2018) =
*Bugs:*
* Resolved an issue that was preventing placeholder text from appearing in paragraph text fields.
* Resolved an issue that sometimes caused the form builder to crash when deleting a field.
* Submissions removed by the expired submissions feature should now be moved to the trash instead of completely removed.
*Chnages:*
== Changelog ==
* Unlocked the services tab.
* (Beta) Ninja Forms Add-on Manager is now available.
* Ninja Mail - Transactional Email is now available.
= 3.3.7 (21 June 2018) =
== Changelog ==
*Bugs:*
* Submissions removed by the expired submissions feature should now be moved to the trash instead of completely removed.
= 3.3.6 (20 June 2018) =
*Bugs:*
* Resolved an issue that sometimes caused the form builder to crash when deleting a field.
= 3.3.5 (18 June 2018) =
*Bugs:*
* Made some performance updates to several of our popup modals.
* The agency remove marketing hook should now properly hide the new services tab.
*Changes:*
* Fields now display admin labels (if they exist) instead of labels in the store submission action settings.
* Added a tooltip to the value section of list fields, giving details about allowed characters.
* List field merge tags can now be configured to show labels instead of values by appending ":label" to the merge tag.
* The store submissions action can now be configured to remove submissions that exceed a defined timeframe.
* Added a confirm modal to field deletion to prevent accidental removal of data.
= 3.3.4 (11 June 2018) =
......
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