Version Description
- Added a slider preview feature to the slider edit page - pressing the 'Preview' button displays the slider within a popup window.
=
Download this release
Release Info
Developer | simonpedge |
Plugin | Slide Anything – Responsive Content / HTML Slider and Carousel |
Version | 1.1 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.1
- css/slide-anything-admin.css +58 -5
- js/slide-anything-admin.js +22 -0
- php/slide-anything-admin.php +19 -3
- readme.txt +7 -1
- slide-anything.php +1 -1
- trunk/css/slide-anything-admin.css +58 -5
- trunk/js/slide-anything-admin.js +22 -0
- trunk/php/slide-anything-admin.php +19 -3
- trunk/readme.txt +8 -2
- trunk/slide-anything.php +1 -1
css/slide-anything-admin.css
CHANGED
@@ -252,6 +252,10 @@
|
|
252 |
cursor:default;
|
253 |
}
|
254 |
#sa_shortcode_copy {
|
|
|
|
|
|
|
|
|
255 |
float:right;
|
256 |
margin:10px 0px 0px;
|
257 |
}
|
@@ -472,29 +476,78 @@
|
|
472 |
background:transparent url('../images/icon_info.png') no-repeat top left;
|
473 |
}
|
474 |
|
475 |
-
/* ### JQUERY UI - DIALOG
|
476 |
-
|
|
|
|
|
|
|
477 |
padding:7px 12px !important;
|
478 |
line-height:22px !important;
|
479 |
height:22px !important;
|
480 |
}
|
481 |
-
.ui-dialog .ui-dialog-titlebar .ui-dialog-title {
|
482 |
color:#333333 !important;
|
483 |
font-family:Arial, Helvetica, sans-serif !important;
|
484 |
font-weight:bold !important;
|
485 |
font-size:16px !important;
|
486 |
line-height:22px !important;
|
487 |
}
|
488 |
-
.ui-dialog .ui-dialog-titlebar button:before {
|
489 |
font-size:16px !important;
|
490 |
line-height:16px !important;
|
491 |
height:16px !important;
|
492 |
width:16px !important;
|
493 |
}
|
494 |
-
.ui-dialog #sa_dialog_box {
|
495 |
padding:15px 10px 10px !important;
|
496 |
}
|
497 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
498 |
/* ### JQUERY UI - SPINNER ### */
|
499 |
.ui-state-default .ui-icon {
|
500 |
background-image:url('../images/ui-icons_777777_256x240.png') !important;
|
252 |
cursor:default;
|
253 |
}
|
254 |
#sa_shortcode_copy {
|
255 |
+
float:left;
|
256 |
+
margin:10px 0px 0px;
|
257 |
+
}
|
258 |
+
#sa_preview_slider {
|
259 |
float:right;
|
260 |
margin:10px 0px 0px;
|
261 |
}
|
476 |
background:transparent url('../images/icon_info.png') no-repeat top left;
|
477 |
}
|
478 |
|
479 |
+
/* ### JQUERY UI - CONFIRMATION DIALOG BOXES ### */
|
480 |
+
#sa_dialog_box {
|
481 |
+
display:none;
|
482 |
+
}
|
483 |
+
.ui-dialog[aria-describedby='sa_dialog_box'] .ui-dialog-titlebar {
|
484 |
padding:7px 12px !important;
|
485 |
line-height:22px !important;
|
486 |
height:22px !important;
|
487 |
}
|
488 |
+
.ui-dialog[aria-describedby='sa_dialog_box'] .ui-dialog-titlebar .ui-dialog-title {
|
489 |
color:#333333 !important;
|
490 |
font-family:Arial, Helvetica, sans-serif !important;
|
491 |
font-weight:bold !important;
|
492 |
font-size:16px !important;
|
493 |
line-height:22px !important;
|
494 |
}
|
495 |
+
.ui-dialog[aria-describedby='sa_dialog_box'] .ui-dialog-titlebar button:before {
|
496 |
font-size:16px !important;
|
497 |
line-height:16px !important;
|
498 |
height:16px !important;
|
499 |
width:16px !important;
|
500 |
}
|
501 |
+
.ui-dialog[aria-describedby='sa_dialog_box'] #sa_dialog_box {
|
502 |
padding:15px 10px 10px !important;
|
503 |
}
|
504 |
|
505 |
+
/* ### JQUERY UI - PREVIEW SLIDER DIALOG BOX ### */
|
506 |
+
#sa_preview_box {
|
507 |
+
display:none;
|
508 |
+
}
|
509 |
+
.ui-dialog[aria-describedby='sa_preview_box'] {
|
510 |
+
position:fixed !important;
|
511 |
+
width:90% !important;
|
512 |
+
top:60px !important;
|
513 |
+
z-index:9999 !important;
|
514 |
+
}
|
515 |
+
.ui-dialog[aria-describedby='sa_preview_box'] .ui-dialog-titlebar {
|
516 |
+
padding:7px 12px !important;
|
517 |
+
line-height:22px !important;
|
518 |
+
height:22px !important;
|
519 |
+
}
|
520 |
+
.ui-dialog[aria-describedby='sa_preview_box'] .ui-dialog-titlebar .ui-dialog-title {
|
521 |
+
color:#333333 !important;
|
522 |
+
font-family:Arial, Helvetica, sans-serif !important;
|
523 |
+
font-weight:bold !important;
|
524 |
+
font-size:16px !important;
|
525 |
+
line-height:22px !important;
|
526 |
+
}
|
527 |
+
.ui-dialog[aria-describedby='sa_preview_box'] .ui-dialog-titlebar button:before {
|
528 |
+
font-size:16px !important;
|
529 |
+
line-height:16px !important;
|
530 |
+
height:16px !important;
|
531 |
+
width:16px !important;
|
532 |
+
}
|
533 |
+
.ui-dialog[aria-describedby='sa_preview_box'] #sa_preview_box {
|
534 |
+
padding:20px 15px 15px !important;
|
535 |
+
}
|
536 |
+
.ui-dialog[aria-describedby='sa_preview_box'] #sa_preview_box #sa_preview_note {
|
537 |
+
padding-top:20px;
|
538 |
+
font-size:13px;
|
539 |
+
line-height:20px;
|
540 |
+
color:#a0a0a0;
|
541 |
+
}
|
542 |
+
.ui-widget-overlay {
|
543 |
+
background-color:rgba(0,0,0,0.7) !important;
|
544 |
+
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
545 |
+
filter:alpha(opacity=100);
|
546 |
+
-moz-opacity:1.0;
|
547 |
+
-khtml-opacity:1.0;
|
548 |
+
opacity:1.0;
|
549 |
+
}
|
550 |
+
|
551 |
/* ### JQUERY UI - SPINNER ### */
|
552 |
.ui-state-default .ui-icon {
|
553 |
background-image:url('../images/ui-icons_777777_256x240.png') !important;
|
js/slide-anything-admin.js
CHANGED
@@ -517,3 +517,25 @@ function move_slide_up(slide_no) {
|
|
517 |
jQuery("#sa_dialog_box").dialog("open");
|
518 |
})
|
519 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
517 |
jQuery("#sa_dialog_box").dialog("open");
|
518 |
})
|
519 |
}
|
520 |
+
|
521 |
+
|
522 |
+
function preview_slider() {
|
523 |
+
jQuery(function() {
|
524 |
+
var preview_box = document.getElementById('sa_preview_box');
|
525 |
+
jQuery("#sa_preview_box").dialog({
|
526 |
+
title: 'PREVIEW SLIDER',
|
527 |
+
modal: true,
|
528 |
+
closeOnEscape: true,
|
529 |
+
resizable: false,
|
530 |
+
draggable: false
|
531 |
+
});
|
532 |
+
jQuery("#sa_preview_box").dialog({
|
533 |
+
buttons: {
|
534 |
+
Close: function() {
|
535 |
+
jQuery(this).dialog("close");
|
536 |
+
}
|
537 |
+
}
|
538 |
+
});
|
539 |
+
jQuery("#sa_preview_box").dialog("open");
|
540 |
+
})
|
541 |
+
}
|
php/slide-anything-admin.php
CHANGED
@@ -112,6 +112,8 @@ function cpt_register_admin_scripts() {
|
|
112 |
wp_enqueue_script('sa-slider-admin-script');
|
113 |
wp_register_style('sa-slider-admin-css', PLUGIN_PATH.'css/slide-anything-admin.css');
|
114 |
wp_enqueue_style('sa-slider-admin-css');
|
|
|
|
|
115 |
}
|
116 |
}
|
117 |
|
@@ -238,7 +240,7 @@ function cpt_slider_add_meta_boxes() {
|
|
238 |
}
|
239 |
add_meta_box('cpt_slider_settings', __('Slider Settings'), 'cpt_slider_settings_content', 'sa_slider', 'normal', 'high');
|
240 |
add_meta_box('cpt_slider_slides', __('Slides'), 'cpt_slider_slides_content', 'sa_slider', 'normal', 'high');
|
241 |
-
add_meta_box('cpt_slider_shortcode', __('
|
242 |
add_meta_box('cpt_slider_items', __('Items Displayed'), 'cpt_slider_items_content', 'sa_slider', 'side', 'default');
|
243 |
add_meta_box('cpt_slider_style', __('Slider Style'), 'cpt_slider_style_content', 'sa_slider', 'side', 'default');
|
244 |
}
|
@@ -578,9 +580,10 @@ function cpt_slider_slides_content($post) {
|
|
578 |
// ADD SLIDE BUTTON
|
579 |
if ($num_slides < 50) {
|
580 |
// a maximum of 50 slides allowed
|
581 |
-
echo "<div id='sa_add_slide' class='button button-primary button-large' title='Add a new slide'>Add Slide</
|
582 |
}
|
583 |
-
|
|
|
584 |
echo "<div id='sa_dialog_box'></div>\n";
|
585 |
}
|
586 |
|
@@ -590,6 +593,19 @@ function cpt_slider_slides_content($post) {
|
|
590 |
function cpt_slider_shortcode_content($post) {
|
591 |
$shortcode = "[slide-anything id='".$post->ID."']";
|
592 |
echo "<div id='sa_slider_shortcode'>".esc_html($shortcode)."</div>\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
593 |
echo "<div id='sa_shortcode_copy' class='button button-secondary'>Copy to Clipboard</div>\n";
|
594 |
echo "<div style='clear:both; width:100%; height:1px;'></div>\n";
|
595 |
}
|
112 |
wp_enqueue_script('sa-slider-admin-script');
|
113 |
wp_register_style('sa-slider-admin-css', PLUGIN_PATH.'css/slide-anything-admin.css');
|
114 |
wp_enqueue_style('sa-slider-admin-css');
|
115 |
+
// DISABLE AUTOSAVE FOR THIS CUSTOM POST TYPE (causes issues with preview modal popup)
|
116 |
+
wp_dequeue_script('autosave');
|
117 |
}
|
118 |
}
|
119 |
|
240 |
}
|
241 |
add_meta_box('cpt_slider_settings', __('Slider Settings'), 'cpt_slider_settings_content', 'sa_slider', 'normal', 'high');
|
242 |
add_meta_box('cpt_slider_slides', __('Slides'), 'cpt_slider_slides_content', 'sa_slider', 'normal', 'high');
|
243 |
+
add_meta_box('cpt_slider_shortcode', __('Shortcode / Preview'), 'cpt_slider_shortcode_content', 'sa_slider', 'side', 'high');
|
244 |
add_meta_box('cpt_slider_items', __('Items Displayed'), 'cpt_slider_items_content', 'sa_slider', 'side', 'default');
|
245 |
add_meta_box('cpt_slider_style', __('Slider Style'), 'cpt_slider_style_content', 'sa_slider', 'side', 'default');
|
246 |
}
|
580 |
// ADD SLIDE BUTTON
|
581 |
if ($num_slides < 50) {
|
582 |
// a maximum of 50 slides allowed
|
583 |
+
echo "<div id='sa_add_slide' class='button button-primary button-large' title='Add a new slide'>Add Slide</div>\n";
|
584 |
}
|
585 |
+
|
586 |
+
// JQUERY-UI DIALOG BOX DIV - FOR CONFIRMATION DIALOG BOXES
|
587 |
echo "<div id='sa_dialog_box'></div>\n";
|
588 |
}
|
589 |
|
593 |
function cpt_slider_shortcode_content($post) {
|
594 |
$shortcode = "[slide-anything id='".$post->ID."']";
|
595 |
echo "<div id='sa_slider_shortcode'>".esc_html($shortcode)."</div>\n";
|
596 |
+
|
597 |
+
$metadata = get_metadata('post', $post->ID);
|
598 |
+
if (count($metadata) != 0) {
|
599 |
+
// PREVIEW SLIDER BUTTON
|
600 |
+
echo "<div id='sa_preview_slider' class='button button-secondary button-large' title='Preview the current saved version of this slider' ";
|
601 |
+
echo "onClick='preview_slider();'>Preview</div>\n";
|
602 |
+
|
603 |
+
// JQUERY-UI DIALOG BOX DIV - FOR PREVIEW POPUP BOX
|
604 |
+
$shortcode = "[slide-anything id='".$post->ID."']";
|
605 |
+
echo "<div id='sa_preview_box'>".do_shortcode($shortcode);
|
606 |
+
echo "<div id='sa_preview_note'><strong>NOTE:</strong> The typography and fonts of this preview may differ from what you see on the front-end website.";
|
607 |
+
echo "<br/>Each WordPress Theme defines its own style for fonts and typography which may differ from what you see within the WordPress Dashboard.</div></div>\n";
|
608 |
+
}
|
609 |
echo "<div id='sa_shortcode_copy' class='button button-secondary'>Copy to Clipboard</div>\n";
|
610 |
echo "<div style='clear:both; width:100%; height:1px;'></div>\n";
|
611 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: carousel, content slider, owl carousel, responsive, html slider
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.4
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -54,7 +54,13 @@ When these are set to values greater than `1`, a carousel will be displayed, for
|
|
54 |
= 1.0 =
|
55 |
* Initial release of this plugin.
|
56 |
|
|
|
|
|
|
|
57 |
== Upgrade Notice ==
|
58 |
|
59 |
= 1.0 =
|
60 |
* Initial release of this plugin.
|
|
|
|
|
|
4 |
Tags: carousel, content slider, owl carousel, responsive, html slider
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.4
|
7 |
+
Stable tag: 1.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
54 |
= 1.0 =
|
55 |
* Initial release of this plugin.
|
56 |
|
57 |
+
= 1.1 =
|
58 |
+
* Added a slider preview feature to the slider edit page - pressing the 'Preview' button displays the slider within a popup window.
|
59 |
+
|
60 |
== Upgrade Notice ==
|
61 |
|
62 |
= 1.0 =
|
63 |
* Initial release of this plugin.
|
64 |
+
|
65 |
+
= 1.1 =
|
66 |
+
* Preview sliders created within the WordPress Dashboard.
|
slide-anything.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin URI: https://wordpress.org/support/plugin/slide-anything
|
5 |
* Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders.
|
6 |
* Author: Simon Edge
|
7 |
-
* Version: 1.
|
8 |
* License: GPLv2 or later
|
9 |
*/
|
10 |
|
4 |
* Plugin URI: https://wordpress.org/support/plugin/slide-anything
|
5 |
* Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders.
|
6 |
* Author: Simon Edge
|
7 |
+
* Version: 1.1
|
8 |
* License: GPLv2 or later
|
9 |
*/
|
10 |
|
trunk/css/slide-anything-admin.css
CHANGED
@@ -252,6 +252,10 @@
|
|
252 |
cursor:default;
|
253 |
}
|
254 |
#sa_shortcode_copy {
|
|
|
|
|
|
|
|
|
255 |
float:right;
|
256 |
margin:10px 0px 0px;
|
257 |
}
|
@@ -472,29 +476,78 @@
|
|
472 |
background:transparent url('../images/icon_info.png') no-repeat top left;
|
473 |
}
|
474 |
|
475 |
-
/* ### JQUERY UI - DIALOG
|
476 |
-
|
|
|
|
|
|
|
477 |
padding:7px 12px !important;
|
478 |
line-height:22px !important;
|
479 |
height:22px !important;
|
480 |
}
|
481 |
-
.ui-dialog .ui-dialog-titlebar .ui-dialog-title {
|
482 |
color:#333333 !important;
|
483 |
font-family:Arial, Helvetica, sans-serif !important;
|
484 |
font-weight:bold !important;
|
485 |
font-size:16px !important;
|
486 |
line-height:22px !important;
|
487 |
}
|
488 |
-
.ui-dialog .ui-dialog-titlebar button:before {
|
489 |
font-size:16px !important;
|
490 |
line-height:16px !important;
|
491 |
height:16px !important;
|
492 |
width:16px !important;
|
493 |
}
|
494 |
-
.ui-dialog #sa_dialog_box {
|
495 |
padding:15px 10px 10px !important;
|
496 |
}
|
497 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
498 |
/* ### JQUERY UI - SPINNER ### */
|
499 |
.ui-state-default .ui-icon {
|
500 |
background-image:url('../images/ui-icons_777777_256x240.png') !important;
|
252 |
cursor:default;
|
253 |
}
|
254 |
#sa_shortcode_copy {
|
255 |
+
float:left;
|
256 |
+
margin:10px 0px 0px;
|
257 |
+
}
|
258 |
+
#sa_preview_slider {
|
259 |
float:right;
|
260 |
margin:10px 0px 0px;
|
261 |
}
|
476 |
background:transparent url('../images/icon_info.png') no-repeat top left;
|
477 |
}
|
478 |
|
479 |
+
/* ### JQUERY UI - CONFIRMATION DIALOG BOXES ### */
|
480 |
+
#sa_dialog_box {
|
481 |
+
display:none;
|
482 |
+
}
|
483 |
+
.ui-dialog[aria-describedby='sa_dialog_box'] .ui-dialog-titlebar {
|
484 |
padding:7px 12px !important;
|
485 |
line-height:22px !important;
|
486 |
height:22px !important;
|
487 |
}
|
488 |
+
.ui-dialog[aria-describedby='sa_dialog_box'] .ui-dialog-titlebar .ui-dialog-title {
|
489 |
color:#333333 !important;
|
490 |
font-family:Arial, Helvetica, sans-serif !important;
|
491 |
font-weight:bold !important;
|
492 |
font-size:16px !important;
|
493 |
line-height:22px !important;
|
494 |
}
|
495 |
+
.ui-dialog[aria-describedby='sa_dialog_box'] .ui-dialog-titlebar button:before {
|
496 |
font-size:16px !important;
|
497 |
line-height:16px !important;
|
498 |
height:16px !important;
|
499 |
width:16px !important;
|
500 |
}
|
501 |
+
.ui-dialog[aria-describedby='sa_dialog_box'] #sa_dialog_box {
|
502 |
padding:15px 10px 10px !important;
|
503 |
}
|
504 |
|
505 |
+
/* ### JQUERY UI - PREVIEW SLIDER DIALOG BOX ### */
|
506 |
+
#sa_preview_box {
|
507 |
+
display:none;
|
508 |
+
}
|
509 |
+
.ui-dialog[aria-describedby='sa_preview_box'] {
|
510 |
+
position:fixed !important;
|
511 |
+
width:90% !important;
|
512 |
+
top:60px !important;
|
513 |
+
z-index:9999 !important;
|
514 |
+
}
|
515 |
+
.ui-dialog[aria-describedby='sa_preview_box'] .ui-dialog-titlebar {
|
516 |
+
padding:7px 12px !important;
|
517 |
+
line-height:22px !important;
|
518 |
+
height:22px !important;
|
519 |
+
}
|
520 |
+
.ui-dialog[aria-describedby='sa_preview_box'] .ui-dialog-titlebar .ui-dialog-title {
|
521 |
+
color:#333333 !important;
|
522 |
+
font-family:Arial, Helvetica, sans-serif !important;
|
523 |
+
font-weight:bold !important;
|
524 |
+
font-size:16px !important;
|
525 |
+
line-height:22px !important;
|
526 |
+
}
|
527 |
+
.ui-dialog[aria-describedby='sa_preview_box'] .ui-dialog-titlebar button:before {
|
528 |
+
font-size:16px !important;
|
529 |
+
line-height:16px !important;
|
530 |
+
height:16px !important;
|
531 |
+
width:16px !important;
|
532 |
+
}
|
533 |
+
.ui-dialog[aria-describedby='sa_preview_box'] #sa_preview_box {
|
534 |
+
padding:20px 15px 15px !important;
|
535 |
+
}
|
536 |
+
.ui-dialog[aria-describedby='sa_preview_box'] #sa_preview_box #sa_preview_note {
|
537 |
+
padding-top:20px;
|
538 |
+
font-size:13px;
|
539 |
+
line-height:20px;
|
540 |
+
color:#a0a0a0;
|
541 |
+
}
|
542 |
+
.ui-widget-overlay {
|
543 |
+
background-color:rgba(0,0,0,0.7) !important;
|
544 |
+
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
545 |
+
filter:alpha(opacity=100);
|
546 |
+
-moz-opacity:1.0;
|
547 |
+
-khtml-opacity:1.0;
|
548 |
+
opacity:1.0;
|
549 |
+
}
|
550 |
+
|
551 |
/* ### JQUERY UI - SPINNER ### */
|
552 |
.ui-state-default .ui-icon {
|
553 |
background-image:url('../images/ui-icons_777777_256x240.png') !important;
|
trunk/js/slide-anything-admin.js
CHANGED
@@ -517,3 +517,25 @@ function move_slide_up(slide_no) {
|
|
517 |
jQuery("#sa_dialog_box").dialog("open");
|
518 |
})
|
519 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
517 |
jQuery("#sa_dialog_box").dialog("open");
|
518 |
})
|
519 |
}
|
520 |
+
|
521 |
+
|
522 |
+
function preview_slider() {
|
523 |
+
jQuery(function() {
|
524 |
+
var preview_box = document.getElementById('sa_preview_box');
|
525 |
+
jQuery("#sa_preview_box").dialog({
|
526 |
+
title: 'PREVIEW SLIDER',
|
527 |
+
modal: true,
|
528 |
+
closeOnEscape: true,
|
529 |
+
resizable: false,
|
530 |
+
draggable: false
|
531 |
+
});
|
532 |
+
jQuery("#sa_preview_box").dialog({
|
533 |
+
buttons: {
|
534 |
+
Close: function() {
|
535 |
+
jQuery(this).dialog("close");
|
536 |
+
}
|
537 |
+
}
|
538 |
+
});
|
539 |
+
jQuery("#sa_preview_box").dialog("open");
|
540 |
+
})
|
541 |
+
}
|
trunk/php/slide-anything-admin.php
CHANGED
@@ -112,6 +112,8 @@ function cpt_register_admin_scripts() {
|
|
112 |
wp_enqueue_script('sa-slider-admin-script');
|
113 |
wp_register_style('sa-slider-admin-css', PLUGIN_PATH.'css/slide-anything-admin.css');
|
114 |
wp_enqueue_style('sa-slider-admin-css');
|
|
|
|
|
115 |
}
|
116 |
}
|
117 |
|
@@ -238,7 +240,7 @@ function cpt_slider_add_meta_boxes() {
|
|
238 |
}
|
239 |
add_meta_box('cpt_slider_settings', __('Slider Settings'), 'cpt_slider_settings_content', 'sa_slider', 'normal', 'high');
|
240 |
add_meta_box('cpt_slider_slides', __('Slides'), 'cpt_slider_slides_content', 'sa_slider', 'normal', 'high');
|
241 |
-
add_meta_box('cpt_slider_shortcode', __('
|
242 |
add_meta_box('cpt_slider_items', __('Items Displayed'), 'cpt_slider_items_content', 'sa_slider', 'side', 'default');
|
243 |
add_meta_box('cpt_slider_style', __('Slider Style'), 'cpt_slider_style_content', 'sa_slider', 'side', 'default');
|
244 |
}
|
@@ -578,9 +580,10 @@ function cpt_slider_slides_content($post) {
|
|
578 |
// ADD SLIDE BUTTON
|
579 |
if ($num_slides < 50) {
|
580 |
// a maximum of 50 slides allowed
|
581 |
-
echo "<div id='sa_add_slide' class='button button-primary button-large' title='Add a new slide'>Add Slide</
|
582 |
}
|
583 |
-
|
|
|
584 |
echo "<div id='sa_dialog_box'></div>\n";
|
585 |
}
|
586 |
|
@@ -590,6 +593,19 @@ function cpt_slider_slides_content($post) {
|
|
590 |
function cpt_slider_shortcode_content($post) {
|
591 |
$shortcode = "[slide-anything id='".$post->ID."']";
|
592 |
echo "<div id='sa_slider_shortcode'>".esc_html($shortcode)."</div>\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
593 |
echo "<div id='sa_shortcode_copy' class='button button-secondary'>Copy to Clipboard</div>\n";
|
594 |
echo "<div style='clear:both; width:100%; height:1px;'></div>\n";
|
595 |
}
|
112 |
wp_enqueue_script('sa-slider-admin-script');
|
113 |
wp_register_style('sa-slider-admin-css', PLUGIN_PATH.'css/slide-anything-admin.css');
|
114 |
wp_enqueue_style('sa-slider-admin-css');
|
115 |
+
// DISABLE AUTOSAVE FOR THIS CUSTOM POST TYPE (causes issues with preview modal popup)
|
116 |
+
wp_dequeue_script('autosave');
|
117 |
}
|
118 |
}
|
119 |
|
240 |
}
|
241 |
add_meta_box('cpt_slider_settings', __('Slider Settings'), 'cpt_slider_settings_content', 'sa_slider', 'normal', 'high');
|
242 |
add_meta_box('cpt_slider_slides', __('Slides'), 'cpt_slider_slides_content', 'sa_slider', 'normal', 'high');
|
243 |
+
add_meta_box('cpt_slider_shortcode', __('Shortcode / Preview'), 'cpt_slider_shortcode_content', 'sa_slider', 'side', 'high');
|
244 |
add_meta_box('cpt_slider_items', __('Items Displayed'), 'cpt_slider_items_content', 'sa_slider', 'side', 'default');
|
245 |
add_meta_box('cpt_slider_style', __('Slider Style'), 'cpt_slider_style_content', 'sa_slider', 'side', 'default');
|
246 |
}
|
580 |
// ADD SLIDE BUTTON
|
581 |
if ($num_slides < 50) {
|
582 |
// a maximum of 50 slides allowed
|
583 |
+
echo "<div id='sa_add_slide' class='button button-primary button-large' title='Add a new slide'>Add Slide</div>\n";
|
584 |
}
|
585 |
+
|
586 |
+
// JQUERY-UI DIALOG BOX DIV - FOR CONFIRMATION DIALOG BOXES
|
587 |
echo "<div id='sa_dialog_box'></div>\n";
|
588 |
}
|
589 |
|
593 |
function cpt_slider_shortcode_content($post) {
|
594 |
$shortcode = "[slide-anything id='".$post->ID."']";
|
595 |
echo "<div id='sa_slider_shortcode'>".esc_html($shortcode)."</div>\n";
|
596 |
+
|
597 |
+
$metadata = get_metadata('post', $post->ID);
|
598 |
+
if (count($metadata) != 0) {
|
599 |
+
// PREVIEW SLIDER BUTTON
|
600 |
+
echo "<div id='sa_preview_slider' class='button button-secondary button-large' title='Preview the current saved version of this slider' ";
|
601 |
+
echo "onClick='preview_slider();'>Preview</div>\n";
|
602 |
+
|
603 |
+
// JQUERY-UI DIALOG BOX DIV - FOR PREVIEW POPUP BOX
|
604 |
+
$shortcode = "[slide-anything id='".$post->ID."']";
|
605 |
+
echo "<div id='sa_preview_box'>".do_shortcode($shortcode);
|
606 |
+
echo "<div id='sa_preview_note'><strong>NOTE:</strong> The typography and fonts of this preview may differ from what you see on the front-end website.";
|
607 |
+
echo "<br/>Each WordPress Theme defines its own style for fonts and typography which may differ from what you see within the WordPress Dashboard.</div></div>\n";
|
608 |
+
}
|
609 |
echo "<div id='sa_shortcode_copy' class='button button-secondary'>Copy to Clipboard</div>\n";
|
610 |
echo "<div style='clear:both; width:100%; height:1px;'></div>\n";
|
611 |
}
|
trunk/readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: carousel, content slider, owl carousel, responsive, html slider
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.4
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -47,14 +47,20 @@ When these are set to values greater than `1`, a carousel will be displayed, for
|
|
47 |
== Screenshots ==
|
48 |
|
49 |
1. The Create/Edit slider page within the WordPress Dashboard - this is where you define the settings and create the slides for your `Slide Anything` slider or carousel.
|
50 |
-
2. How a carousel created using `Slide Anything` appears within
|
51 |
|
52 |
== Changelog ==
|
53 |
|
54 |
= 1.0 =
|
55 |
* Initial release of this plugin.
|
56 |
|
|
|
|
|
|
|
57 |
== Upgrade Notice ==
|
58 |
|
59 |
= 1.0 =
|
60 |
* Initial release of this plugin.
|
|
|
|
|
|
4 |
Tags: carousel, content slider, owl carousel, responsive, html slider
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.4
|
7 |
+
Stable tag: 1.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
47 |
== Screenshots ==
|
48 |
|
49 |
1. The Create/Edit slider page within the WordPress Dashboard - this is where you define the settings and create the slides for your `Slide Anything` slider or carousel.
|
50 |
+
2. How a carousel created using `Slide Anything` appears within the slider preview popup.
|
51 |
|
52 |
== Changelog ==
|
53 |
|
54 |
= 1.0 =
|
55 |
* Initial release of this plugin.
|
56 |
|
57 |
+
= 1.1 =
|
58 |
+
* Added a slider preview feature to the slider edit page - pressing the 'Preview' button displays the slider within a popup window.
|
59 |
+
|
60 |
== Upgrade Notice ==
|
61 |
|
62 |
= 1.0 =
|
63 |
* Initial release of this plugin.
|
64 |
+
|
65 |
+
= 1.1 =
|
66 |
+
* Preview sliders created within the WordPress Dashboard.
|
trunk/slide-anything.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin URI: https://wordpress.org/support/plugin/slide-anything
|
5 |
* Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders.
|
6 |
* Author: Simon Edge
|
7 |
-
* Version: 1.
|
8 |
* License: GPLv2 or later
|
9 |
*/
|
10 |
|
4 |
* Plugin URI: https://wordpress.org/support/plugin/slide-anything
|
5 |
* Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders.
|
6 |
* Author: Simon Edge
|
7 |
+
* Version: 1.1
|
8 |
* License: GPLv2 or later
|
9 |
*/
|
10 |
|