Skip to content
Permalink
Browse files

Added ALNP Pro Preview

  • Loading branch information...
seb86 committed May 12, 2019
1 parent 7bf0caa commit 7174140d89f2261de2d8378ba14998fd1878f3a7
@@ -0,0 +1,55 @@
/* global alnp_pro_preview_params */
( function( $, params ) {

$('.nav-tab-wrapper a').on('click', function(e) {
var href = $(this).attr('href'),
tab = $(this).data('tab'),
jc;

if ( href == '#' ) {
e.preventDefault();

jc = $.dialog({
icon: 'dashicons dashicons-info',
title: params.i18n_coming_soon,
content: '<p>' + params.i18n_coming_soon_content + '</p>',
rtl: params.is_rtl,
type: 'blue',
draggable: false,
boxWidth: '500px',
useBootstrap: false,
});

if ( tab == 'comments' ) {
setTimeout(function () {
jc.setContentAppend( '<p>' + params.i18n_comments_content + '</p>' );
}, 100);
}

if ( tab == 'load-and-scroll' ) {
setTimeout(function () {
jc.setContentAppend( '<p>' + params.i18n_load_scroll_content + '</p>' );
}, 100);
}

if ( tab == 'restrictions' ) {
setTimeout(function () {
jc.setContentAppend( '<p>' + params.i18n_restrictions_content + '</p>' );
}, 100);
}

if ( tab == 'query' ) {
setTimeout(function () {
jc.setContentAppend( '<p>' + params.i18n_query_content + '</p>' );
}, 100);
}

if ( tab == 'license' ) {
setTimeout(function () {
jc.setContentAppend( '<p>' + params.i18n_license_content + '</p>' );
}, 100);
}
}
});

})( jQuery, alnp_pro_preview_params );
@@ -118,8 +118,14 @@ public function admin_scripts() {
// Variables for Pro Preview JavaScript.
wp_localize_script( AUTO_LOAD_NEXT_POST_SLUG . '_pro_preview', 'alnp_pro_preview_params', array(
'is_rtl' => is_rtl() ? true : false,
'i18n_coming_soon' => esc_html__( 'Coming Soon', 'auto-load-next-post' ),
'is_rtl' => is_rtl() ? true : false,
'i18n_coming_soon' => esc_html__( 'Coming Soon', 'auto-load-next-post' ),
'i18n_coming_soon_content' => sprintf( esc_html__( '%1$s%3$s%2$s coming soon with more features. Sign up in the sidebar to be notified!', 'auto-load-next-post' ), '<strong>', '</strong>', esc_html__( 'Auto Load Next Post Pro', 'auto-load-next-post' ) ),
'i18n_comments_content' => sprintf( esc_html__( '%1$sComments:%2$s More control on how comments should interact when each post loads.', 'auto-load-next-post' ), '<strong>', '</strong>' ),
'i18n_load_scroll_content' => sprintf( esc_html__( '%1$sLoad and Scroll:%2$s Choose what loads next, enable to load split posts, scroll transistion and scroll speed.', 'auto-load-next-post' ), '<strong>', '</strong>' ),
'i18n_restrictions_content' => sprintf( esc_html__( '%1$sRestrictions:%2$s Manage which post types Auto Load Next Post should load on, how many posts to load per session and which user roles and users are excluded from loading posts.', 'auto-load-next-post' ), '<strong>', '</strong>' ),
'i18n_query_content' => sprintf( esc_html__( '%1$sQuery:%2$s Customise the query of posts before Auto Load Next Post loads them including excluded posts and post formats.', 'auto-load-next-post' ), '<strong>', '</strong>' ),
'i18n_license_content' => esc_html__( 'License is managed here for support and remote plugin updates.', 'auto-load-next-post' )
) );
// Load plugin settings.
@@ -0,0 +1,80 @@
<?php
/**
* Auto Load Next Post Pro Preview class
*
* Adds a preview of the options coming to the Pro release.
*
* @since 1.6.0
* @author Sébastien Dumont
* @category Classes
* @package Auto Load Next Post/Classes/Pro Preview
* @license GPL-2.0+
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'ALNP_Pro_Preview' ) ) {
class ALNP_Pro_Preview {
/**
* Initialize.
*
* @access public
*/
public function __construct() {
add_filter( 'alnp_settings_tabs_array', array( $this, 'add_pro_tabs' ), 99 );
add_filter( 'alnp_settings_tab_url', array( $this, 'hash'), 0, 2 );
} // END __construct()
/**
* Adds the settings tabs that will be available in Pro.
*
* @access public
* @param array $pages
* @return array $pages
*/
public function add_pro_tabs( $pages ) {
$pro_pages = array(
'comments' => __( 'Comments', 'auto-load-next-post' ),
'load-and-scroll' => __( 'Load & Scroll', 'auto-load-next-post' ),
'restrictions' => __( 'Restrictions', 'auto-load-next-post' ),
'query' => __( 'Query', 'auto-load-next-post' ),
'license' => __( 'License', 'auto-load-next-post' ),
);
$pages = array_merge( $pages, $pro_pages );
return $pages;
} // END add_pro_tabs()
/**
* Overrides the link used for the tab.
*
* @access public
* @param string $url
* @param string $slug
* @return string
*/
public function hash( $url, $slug ) {
if ( ! in_array( $slug, array(
'comments',
'load-and-scroll',
'restrictions',
'query',
'license'
) ) ) {
return $url;
}
return '#';
} // END hash()
} // END class
} // END if class
return new ALNP_Pro_Preview();
@@ -42,21 +42,25 @@ public function __construct() {
* @version 1.6.0
*/
public function includes() {
include( dirname( __FILE__ ) . '/class-alnp-action-links.php' ); // Action Links
include( dirname( __FILE__ ) . '/class-alnp-admin-assets.php' ); // Admin Assets
include( dirname( __FILE__ ) . '/class-alnp-admin-notices.php' ); // Plugin Notices
include( dirname( __FILE__ ) . '/class-alnp-action-links.php' ); // Action Links
include( dirname( __FILE__ ) . '/class-alnp-admin-assets.php' ); // Admin Assets
include( dirname( __FILE__ ) . '/class-alnp-admin-notices.php' ); // Plugin Notices
if ( apply_filters( 'alnp_enable_admin_help_tab', true ) ) {
include( dirname( __FILE__ ) . '/class-alnp-admin-help.php' ); // Plugin Help Tab
include( dirname( __FILE__ ) . '/class-alnp-admin-help.php' ); // Plugin Help Tab
}
include_once( dirname( __FILE__ ) . '/class-alnp-getting-started.php'); // Getting Started.
include_once( dirname( __FILE__ ) . '/class-alnp-setup-wizard.php'); // Setup Wizard.
include_once( dirname( __FILE__ ) . '/class-alnp-extensions.php'); // Extensions.
include_once( dirname( __FILE__ ) . '/class-alnp-getting-started.php'); // Getting Started.
include_once( dirname( __FILE__ ) . '/class-alnp-setup-wizard.php'); // Setup Wizard.
include_once( dirname( __FILE__ ) . '/class-alnp-extensions.php'); // Extensions.
include( dirname( __FILE__ ) . '/class-alnp-sidebar.php' ); // Sidebar
include( dirname( __FILE__ ) . '/class-alnp-admin-footer.php' ); // Admin Footer
include( dirname( __FILE__ ) . '/class-alnp-privacy.php' ); // Plugin Privacy
if ( ! is_alnp_pro_version_installed() ) {
include_once( dirname( __FILE__ ) . '/class-alnp-admin-pro-preview.php'); // Pro Preview.
}
include( dirname( __FILE__ ) . '/class-alnp-sidebar.php' ); // Sidebar
include( dirname( __FILE__ ) . '/class-alnp-admin-footer.php' ); // Admin Footer
include( dirname( __FILE__ ) . '/class-alnp-privacy.php' ); // Plugin Privacy
} // END includes()
/**

0 comments on commit 7174140

Please sign in to comment.
You can’t perform that action at this time.