...
 
Commits (10)
......@@ -19,6 +19,7 @@ deploy-old.sh
tests/
vendor/
composer.lock
package-lock.json
*.sass-cache
*.scssc
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
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.
This diff is collapsed.
This diff is collapsed.
assets/img/add-ons/webhooks.png

8.27 KB | W: | H:

assets/img/add-ons/webhooks.png

19 KB | W: | H:

assets/img/add-ons/webhooks.png
assets/img/add-ons/webhooks.png
assets/img/add-ons/webhooks.png
assets/img/add-ons/webhooks.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
This diff is collapsed.
File mode changed from 100644 to 100755
File mode changed from 100755 to 100644
File mode changed from 100644 to 100755
......@@ -44,7 +44,7 @@ define( ['models/formModel'], function( FormModel ) {
messageBox = document.createElement( 'p' );
title = document.createElement( 'em' );
buttons = document.createElement( 'div' );
confirm = document.createElement( 'div' );
confirm = document.createElement( 'button' );
cancel = document.createElement( 'div' );
container.classList.add( 'message' );
......@@ -121,9 +121,10 @@ define( ['models/formModel'], function( FormModel ) {
} );
var btnConfirm = this.modal.container[0].getElementsByClassName('confirm')[0];
btnConfirm.addEventListener('click', function() {
btnConfirm.addEventListener('click', function( e ) {
e.preventDefault();
var deleteInputVal = document.getElementById( 'confirmDeleteFormInput' ).value;
if( 'DELETE' === deleteInputVal ) {
that.confirmDelete(view);
} else {
......
......@@ -10,7 +10,7 @@
},
{
"title":"MailChimp",
"image":"assets/img/add-ons/mailchimp-for-ninja-forms.png",
"image":"assets/img/add-ons/mail-chimp.png",
"content":"Quickly create newsletter signup forms for your MailChimp account.",
"link":"https://ninjaforms.com/extensions/mail-chimp/?utm_medium=plugin&utm_source=plugin-addons-page&utm_campaign=Ninja+Forms+Addons+Page&utm_content=MailChimp",
"plugin":"ninja-forms-mail-chimp/ninja-forms-mail-chimp.php",
......
......@@ -28,20 +28,31 @@ final class NF_Admin_Menus_Addons extends NF_Abstracts_Submenu
public function display()
{
//wp_enqueue_style( 'nf-admin-addons', Ninja_Forms::$url . 'assets/css/admin-addons.css' );
// $items = wp_remote_get( 'https://ninjaforms.com/?extend_feed=jlhrbgf89734go7387o4g3h' );
// $items = wp_remote_retrieve_body( $items );
$items = file_get_contents( Ninja_Forms::$dir . '/deprecated/addons-feed.json' );
$items = json_decode( $items, true );
// Fetch our marketing feed.
$saved = get_option( 'ninja_forms_addons_feed', false );
// If we got back nothing...
if ( ! $saved ) {
// Default to the in-app file.
$items = file_get_contents( Ninja_Forms::$dir . '/deprecated/addons-feed.json' );
$items = json_decode( $items, true );
} // Otherwise... (We did get something from the db.)
else {
// Use the data we fetched.
$items = json_decode( $saved, true );
}
//shuffle( $items );
$notices = array();
foreach ($items as $item) {
foreach ($items as &$item) {
$plugin_data = array();
if( !empty( $item['plugin'] ) && file_exists( WP_PLUGIN_DIR.'/'.$item['plugin'] ) ){
$plugin_data = get_plugin_data( WP_PLUGIN_DIR.'/'.$item['plugin'], false, true );
}
if ( ! file_exists( Ninja_Forms::$dir . '/' . $item[ 'image' ] ) ) {
$item[ 'image' ] = 'assets/img/add-ons/placeholder.png';
}
$version = isset ( $plugin_data['Version'] ) ? $plugin_data['Version'] : '';
......
......@@ -10,6 +10,8 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
public $position = '35.1337';
public $ver = Ninja_Forms::VERSION;
// Stores whether or not this form has a password field.
private $legacy_password = false;
......@@ -135,9 +137,9 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
wp_enqueue_script( 'backbone-radio', Ninja_Forms::$url . 'assets/js/lib/backbone.radio.min.js', array( 'jquery', 'backbone' ) );
wp_enqueue_script( 'backbone-marionette-3', Ninja_Forms::$url . 'assets/js/lib/backbone.marionette3.min.js', array( 'jquery', 'backbone' ) );
wp_enqueue_script( 'nf-jbox', Ninja_Forms::$url . 'assets/js/lib/jBox.min.js', array( 'jquery' ) );
wp_enqueue_script( 'nf-ninjamodal', Ninja_Forms::$url . 'assets/js/lib/ninjaModal.js', array( 'jquery' ) );
wp_enqueue_script( 'nf-ninjamodal', Ninja_Forms::$url . 'assets/js/lib/ninjaModal.js', array( 'jquery' ), $this->ver );
wp_enqueue_script( 'nf-moment', Ninja_Forms::$url . 'assets/js/lib/moment-with-locales.min.js', array( 'jquery', 'nf-dashboard' ) );
wp_enqueue_script( 'nf-dashboard', Ninja_Forms::$url . 'assets/js/min/dashboard.min.js', array( 'backbone-radio', 'backbone-marionette-3' ) );
wp_enqueue_script( 'nf-dashboard', Ninja_Forms::$url . 'assets/js/min/dashboard.min.js', array( 'backbone-radio', 'backbone-marionette-3' ), $this->ver );
$current_user = wp_get_current_user();
wp_localize_script( 'nf-dashboard', 'nfi18n', Ninja_Forms::config( 'i18nDashboard' ) );
......@@ -154,8 +156,8 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
'cleanup' == $_REQUEST[ 'action' ] ) ? 1 : 0,
) );
wp_enqueue_style( 'nf-builder', Ninja_Forms::$url . 'assets/css/builder.css' );
wp_enqueue_style( 'nf-dashboard', Ninja_Forms::$url . 'assets/css/dashboard.min.css' );
wp_enqueue_style( 'nf-builder', Ninja_Forms::$url . 'assets/css/builder.css', array(), $this->ver );
wp_enqueue_style( 'nf-dashboard', Ninja_Forms::$url . 'assets/css/dashboard.min.css', array(), $this->ver );
wp_enqueue_style( 'nf-jbox', Ninja_Forms::$url . 'assets/css/jBox.css' );
wp_enqueue_style( 'nf-font-awesome', Ninja_Forms::$url . 'assets/css/font-awesome.min.css' );
......@@ -201,7 +203,7 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
wp_enqueue_media();
wp_enqueue_style( 'nf-builder', Ninja_Forms::$url . 'assets/css/builder.css' );
wp_enqueue_style( 'nf-builder', Ninja_Forms::$url . 'assets/css/builder.css', array(), $this->ver );
wp_enqueue_style( 'nf-font-awesome', Ninja_Forms::$url . 'assets/css/font-awesome.min.css' );
/**
* CSS Libraries
......@@ -224,7 +226,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-ninjamodal', Ninja_Forms::$url . 'assets/js/lib/ninjaModal.js', array( 'jBox' ), $this->ver );
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' ) );
......@@ -242,7 +244,7 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
wp_enqueue_script( 'summernote', Ninja_Forms::$url . 'assets/js/lib/summernote.min.js', array( 'jquery', 'speakingurl' ) );
wp_enqueue_script( 'nf-builder', Ninja_Forms::$url . 'assets/js/min/builder.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-effects-bounce', 'wp-color-picker' ) );
wp_enqueue_script( 'nf-builder', Ninja_Forms::$url . 'assets/js/min/builder.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-effects-bounce', 'wp-color-picker' ), $this->ver );
wp_localize_script( 'nf-builder', 'nfi18n', Ninja_Forms::config( 'i18nBuilder' ) );
$home_url = parse_url( home_url() );
......
......@@ -9,7 +9,7 @@ return apply_filters( 'ninja_forms_available_actions', array(
'link' => 'https://ninjaforms.com/extensions/mail-chimp/?utm_medium=plugin&utm_source=plugin&utm_campaign=Ninja+Forms+Actions+Drawer&utm_content=MailChimp',
'plugin_path' => 'ninja-forms-mail-chimp/ninja-forms-mail-chimp.php',
'modal_content' => '<div class="available-action-modal">
<img src="' . Ninja_Forms::$url . 'assets/img/add-ons/mailchimp-for-ninja-forms.png"/>
<img src="' . Ninja_Forms::$url . 'assets/img/add-ons/mail-chimp.png"/>
<p>In order to use this action, you need MailChimp for Ninja Forms.</p>
<p>The MailChimp extension allows you to quickly create newsletter signup forms for your MailChimp account using the power and flexibility that Ninja Forms provides.</p>
<div class="actions">
......
......@@ -19,5 +19,17 @@ return apply_filters( 'ninja-forms-dashboard-promotions', array(
"
),
/*
|--------------------------------------------------------------------------
| Ninja Shop
|--------------------------------------------------------------------------
|
*/
'ninja-shop' => array(
'id' => 'ninja-shop',
'content' => '<a href="https://getninjashop.com/?utm_medium=dashboard_banner&utm_source=ninja-forms&utm_campaign=Awareness" target="_blank" style="color:#FFF !important;background:#5DA54B;"><span class="dashicons dashicons-cart"></span>' . __( 'Are you frustrated with complicated eCommerce solutions?', 'ninja-forms' ) . '<br /><span class="cta">' . __( 'Start Selling Today With Ninja Shop!', 'ninja-forms' ) . '</span></a>',
'script' => "",
),
));
......@@ -81,7 +81,7 @@ $ads = array(
'type' => 'ad',
'modal-title' => 'Get MailChimp for Ninja Forms',
'modal-content' => '<div class="modal-template">
<img src="' . Ninja_Forms::$url . 'assets/img/add-ons/mailchimp-for-ninja-forms.png"/>
<img src="' . Ninja_Forms::$url . 'assets/img/add-ons/mail-chimp.png"/>
<p>In order to use this template, you need MailChimp for Ninja Forms.</p>
<p>The MailChimp extension allows you to quickly create newsletter signup forms for your MailChimp account using the power and flexibility that Ninja Forms provides.</p>
<div class="actions">
......
......@@ -119,6 +119,10 @@
<!-- Section: Memberships -->
<script id="tmpl-nf-memberships" type="text/template">
<?php
$saved = get_option( 'ninja_forms_memberships_feed', false );
if ( ! $saved ) {
?>
<div class="widget widget-memberships">
<div class="pricing-container">
<div class="pricing-block widget">
......@@ -222,6 +226,11 @@
<div><em><?php _e( 'All plans include a 14 day money back guarantee.', 'ninja-forms' ); ?></em></div>
<div><?php _e( 'Requires a current active license and subject to our', 'ninja-forms' ); ?> <a target="_blank" href="https://ninjaforms.com/terms-conditions/?utm_medium=plugin&utm_source=plugin-dashboard&utm_campaign=Ninja+Forms+Memberships&utm_content=Terms+Conditions"><?php _e( 'Terms & Conditions', 'ninja-forms' ); ?></a>.</div>
</div>
<?php
} else {
echo( $saved );
}
?>
</script>
<!-- Widget: Forms -->
......
......@@ -974,12 +974,24 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
}
add_action( 'nf_optin_cron', 'nf_optin_update_environment_vars' );
// Custom Cron Recurrences
/**
* Function to register our Custom Cron Recurrences.
*
* @param $schedules (Array) The available cron recurrences.
* @return (Array) The filtered cron recurrences.
*
* @since
* @updated UPDATE_VERSION_ON_MERGE
*/
function nf_custom_cron_job_recurrence( $schedules ) {
$schedules[ 'nf-monthly' ] = array(
'display' => __( 'Once per month', 'ninja-forms' ),
'interval' => 2678400,
);
$schedules[ 'nf-weekly' ] = array(
'display' => __( 'Once per week', 'ninja-forms' ),
'interval' => 604800,
);
return $schedules;
}
add_filter( 'cron_schedules', 'nf_custom_cron_job_recurrence' );
......@@ -990,6 +1002,42 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
wp_schedule_event( current_time( 'timestamp' ), 'nf-monthly', 'nf_optin_cron' );
}
}
add_action( 'wp', 'nf_optin_send_admin_email_cron_job' );
/**
* Function called via weekly wp_cron to update our marketing feeds.
*
* @since UPDATE_VERSION_ON_MERGE
*/
function nf_update_marketing_feed() {
// Fetch our membership data.
$data = wp_remote_get( 'http://api.ninjaforms.com/feeds/?fetch=memberships' );
// If we got a valid response...
if ( 200 == $data[ 'response' ][ 'code' ] ) {
// Save the data to our option.
$data = wp_remote_retrieve_body( $data );
update_option( 'ninja_forms_memberships_feed', $data, false );
}
// Fetch our addon data.
$data = wp_remote_get( 'http://api.ninjaforms.com/feeds/?fetch=addons' );
// If we got a valid response...
if ( 200 == $data[ 'response' ][ 'code' ] ) {
// Save the data to our option.
$data = wp_remote_retrieve_body( $data );
update_option( 'ninja_forms_addons_feed', $data, false );
}
}
add_action( 'nf_marketing_feed_cron', 'nf_update_marketing_feed' );
/**
* Function called by our marketing feed cron.
*
* @since UPDATE_VERSION_ON_MERGE
*/
function nf_marketing_feed_cron_job() {
if ( ! wp_next_scheduled( 'nf_marketing_feed_cron' ) ) {
wp_schedule_event( current_time( 'timestamp' ), 'nf-weekly', 'nf_marketing_feed_cron' );
}
}
add_action( 'wp', 'nf_marketing_feed_cron_job' );
}