Version Description
- Text slide descriptions are now displayed in text areas, making editing of long descriptions more convenient.
- Backgrounds of text slides can now be set to transparent by leaving the 'Background color' field empty.
- Settings are now loaded from a JavaScript variable, so (the major) search engines won't read them as actual content.
- Widget title's HTML tags are now discarded when no widget title is set.
Download this release
Release Info
Developer | stefanboonstra |
Plugin | Slideshow |
Version | 2.1.18 |
Comparing to | |
See all releases |
Code changes from version 2.1.17 to 2.1.18
- classes/SlideshowPlugin.php +16 -5
- classes/SlideshowPluginWidget.php +2 -2
- js/SlideshowPlugin/slideshow.js +1 -1
- readme.txt +6 -5
- slideshow.php +2 -2
- views/SlideshowPlugin/slideshow.php +2 -2
- views/SlideshowPluginPostType/slides.php +8 -8
classes/SlideshowPlugin.php
CHANGED
@@ -9,6 +9,9 @@
|
|
9 |
*/
|
10 |
class SlideshowPlugin {
|
11 |
|
|
|
|
|
|
|
12 |
/**
|
13 |
* Function deploy prints out the prepared html
|
14 |
*
|
@@ -57,7 +60,7 @@ class SlideshowPlugin {
|
|
57 |
}
|
58 |
|
59 |
// Exit on error
|
60 |
-
if(empty($post)){
|
61 |
return '<!-- Wordpress Slideshow - No slideshows available -->';
|
62 |
}
|
63 |
|
@@ -106,8 +109,8 @@ class SlideshowPlugin {
|
|
106 |
SlideshowPluginMain::getPluginUrl() . '/style/' . __CLASS__ . '/functional.css'
|
107 |
);
|
108 |
|
109 |
-
//
|
110 |
-
$
|
111 |
|
112 |
// Get stylesheet for printing
|
113 |
$style = '';
|
@@ -124,7 +127,7 @@ class SlideshowPlugin {
|
|
124 |
|
125 |
// Append the random ID to the slideshow container in the stylesheet, to identify multiple slideshows
|
126 |
if(!empty($style))
|
127 |
-
$style = str_replace('.slideshow_container', '.slideshow_container_' . $
|
128 |
|
129 |
// Filter settings to only contain settings, then remove prefix
|
130 |
$settings = array();
|
@@ -149,7 +152,15 @@ class SlideshowPlugin {
|
|
149 |
wp_enqueue_script(
|
150 |
'slideshow_script',
|
151 |
SlideshowPluginMain::getPluginUrl() . '/js/' . __CLASS__ . '/slideshow.js',
|
152 |
-
array('jquery')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
);
|
154 |
|
155 |
// Return output
|
9 |
*/
|
10 |
class SlideshowPlugin {
|
11 |
|
12 |
+
/** int $sessionCounter */
|
13 |
+
private static $sessionCounter = 0;
|
14 |
+
|
15 |
/**
|
16 |
* Function deploy prints out the prepared html
|
17 |
*
|
60 |
}
|
61 |
|
62 |
// Exit on error
|
63 |
+
if(empty($post)){
|
64 |
return '<!-- Wordpress Slideshow - No slideshows available -->';
|
65 |
}
|
66 |
|
109 |
SlideshowPluginMain::getPluginUrl() . '/style/' . __CLASS__ . '/functional.css'
|
110 |
);
|
111 |
|
112 |
+
// The slideshow's session ID, allows JavaScript and CSS to distinguish between multiple slideshows
|
113 |
+
$sessionID = self::$sessionCounter++;
|
114 |
|
115 |
// Get stylesheet for printing
|
116 |
$style = '';
|
127 |
|
128 |
// Append the random ID to the slideshow container in the stylesheet, to identify multiple slideshows
|
129 |
if(!empty($style))
|
130 |
+
$style = str_replace('.slideshow_container', '.slideshow_container_' . $sessionID, $style);
|
131 |
|
132 |
// Filter settings to only contain settings, then remove prefix
|
133 |
$settings = array();
|
152 |
wp_enqueue_script(
|
153 |
'slideshow_script',
|
154 |
SlideshowPluginMain::getPluginUrl() . '/js/' . __CLASS__ . '/slideshow.js',
|
155 |
+
array('jquery'),
|
156 |
+
SlideshowPluginMain::$version
|
157 |
+
);
|
158 |
+
|
159 |
+
// Include slideshow settings by localizing them
|
160 |
+
wp_localize_script(
|
161 |
+
'slideshow_script',
|
162 |
+
'SlideshowPluginSettings_' . $sessionID,
|
163 |
+
$settings
|
164 |
);
|
165 |
|
166 |
// Return output
|
classes/SlideshowPluginWidget.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
class SlideshowPluginWidget extends WP_Widget {
|
9 |
|
10 |
/** Variables */
|
11 |
-
static $widgetName = 'Slideshow
|
12 |
|
13 |
/**
|
14 |
* Initializes the widget
|
@@ -60,7 +60,7 @@ class SlideshowPluginWidget extends WP_Widget {
|
|
60 |
|
61 |
// Output widget
|
62 |
echo $beforeWidget .
|
63 |
-
$beforeTitle . $title . $afterTitle .
|
64 |
$output .
|
65 |
$afterWidget;
|
66 |
}
|
8 |
class SlideshowPluginWidget extends WP_Widget {
|
9 |
|
10 |
/** Variables */
|
11 |
+
static $widgetName = 'Slideshow';
|
12 |
|
13 |
/**
|
14 |
* Initializes the widget
|
60 |
|
61 |
// Output widget
|
62 |
echo $beforeWidget .
|
63 |
+
(!empty($title) ? $beforeTitle . $title . $afterTitle : '') .
|
64 |
$output .
|
65 |
$afterWidget;
|
66 |
}
|
js/SlideshowPlugin/slideshow.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery.fn.slideshow_script=function(){var $container=jQuery(this),$overflow=$container.find('.slideshow_overflow'),$controlPanel=$container.find('.controlPanel'),$togglePlayButton=$controlPanel.find('.togglePlay'),$nextButton=$container.find('.next'),$previousButton=$container.find('.previous'),$slideshow=$container.find('.slideshow'),$slides=$slideshow.find('.slide');var $settings=
|
1 |
+
jQuery.fn.slideshow_script=function(){var $container=jQuery(this),$overflow=$container.find('.slideshow_overflow'),$controlPanel=$container.find('.controlPanel'),$togglePlayButton=$controlPanel.find('.togglePlay'),$nextButton=$container.find('.next'),$previousButton=$container.find('.previous'),$slideshow=$container.find('.slideshow'),$slides=$slideshow.find('.slide'),$sessionID=getSessionID();var $settings=window['SlideshowPluginSettings_'+$sessionID];jQuery.each($settings,function(setting,value){if(value=='true')$settings[setting]=true;else if(value=='false')$settings[setting]=false});if($container.width()<=0){var parentElement=$container.parent();if(parentElement.width()<=0)$container.css('width',parentElement.closest('div').width());else $container.css('width',parentElement.width())}$overflow.css('width',$container.width());var $numberSlidesVisible=3,$buttonsActive=false,$interval='',$currentSlideId=0,$currentViewId=0,$slideWidth=$container.width()/$settings['slidesPerView'];init();function init(){var slidePosition=0;var totalWidth=100;jQuery.each($slides,function(key,slide){if(slidePosition<=0)jQuery(slide).css({'padding-left':0,'margin-left':0});if(slidePosition>=$settings['slidesPerView']-1)jQuery(slide).css({'padding-right':0,'margin-right':0});var slideWidth=$slideWidth-(jQuery(slide).outerWidth(true)-jQuery(slide).width());jQuery(slide).css({width:slideWidth});totalWidth+=jQuery(slide).outerWidth(true);var image=jQuery(slide).find('img');if(image.attr('src')!=undefined){if($settings['stretchImages']){image.attr({width:jQuery(slide).width(),height:jQuery(slide).height()})}else{image.css('width','auto')}}var description=jQuery(slide).find('.description');if($settings['showDescription']&&description.attr('class')!=undefined){if($settings['hideDescription'])description.css({marginBottom:'-'+description.outerHeight(true)+'px'});else description.css({height:$settings['descriptionHeight']});description.css({display:'block'})}var videoSlideIds=jQuery(slide).find('.videoId').text().split(' ');var videoId=videoSlideIds[0];var elementVideoId=videoSlideIds[1];if(videoId&&elementVideoId){swfobject.embedSWF('http://www.youtube.com/v/'+videoId+'?version=3&enablejsapi=1&playerapiid=player',elementVideoId,jQuery(slide).width(),jQuery(slide).height(),'9',null,null,{allowScriptAccess:'always',wmode:'opaque'},{id:elementVideoId})}slidePosition++;if(slidePosition>=$settings['slidesPerView'])slidePosition=0});$slideshow.css({width:totalWidth,float:'none',position:'absolute',top:0,left:0});if($settings['controlPanel']&&$settings['play'])togglePlay(true);resetInterval();if($settings['controllable']){setNextButtonVisible(true);setPreviousButtonVisible(true);$buttonsActive=true}}function gotoView(viewId,relative){if(relative)viewId=$currentViewId+viewId;if(viewId*$settings['slidesPerView']>=$slides.length){if($settings['loop']){viewId=0}else{viewId=Math.floor(($slides.length-1)/$settings['slidesPerView']);return}}else if(viewId<0){if($settings['loop']){viewId=Math.floor(($slides.length-1)/$settings['slidesPerView'])}else{viewId=0;return}}$currentViewId=viewId;var position=0;var slidePosition=$slideshow.find('.slide_'+(viewId*$settings['slidesPerView'])).position();if(slidePosition)position=slidePosition.left-Math.abs($slideshow.position().left);$buttonsActive=false;if($settings['animation']=='fade'){$slideshow.fadeOut(parseInt($settings['slideSpeed']*1000)/2);setTimeout(function(){$slideshow.animate({left:'-='+position},0);$slideshow.fadeIn(parseInt($settings['slideSpeed']*1000)/ 2)}, parseInt($settings['slideSpeed'] * 1000) /2)}else{$slideshow.animate({left:'-='+position},parseInt($settings['slideSpeed']*1000))}setTimeout(function(){$buttonsActive=true},parseInt($settings['slideSpeed']*1000))}$nextButton.click(function(){if($buttonsActive){resetInterval();gotoView(1,true)}});$previousButton.click(function(){if($buttonsActive){resetInterval();gotoView(-1,true)}});function setNextButtonVisible(visible){if(!$settings['controllable'])return;if(visible)$nextButton.stop(true,true).fadeIn($settings['slideSpeed']);else $nextButton.stop(true,true).fadeOut($settings['slideSpeed'])}function setPreviousButtonVisible(visible){if(!$settings['controllable'])return;if(visible)$previousButton.stop(true,true).fadeIn($settings['slideSpeed']);else $previousButton.stop(true,true).fadeOut($settings['slideSpeed'])}$togglePlayButton.click(function(){togglePlay()});function togglePlay(adaptButton){if(!adaptButton){$settings['play']=!$settings['play'];resetInterval()}if($settings['play'])$togglePlayButton.attr('class','pause');else $togglePlayButton.attr('class','play')}$container.mouseleave(function(){$controlPanel.stop(true,true).fadeOut('slow')});$container.mouseenter(function(){if($settings['controlPanel'])$controlPanel.stop(true,true).fadeIn('fast')});$slides.mouseenter(function(){if($settings['showDescription']&&$settings['hideDescription'])jQuery(this).find('.description').stop(true,true).animate({'margin-bottom':'0px'},parseInt($settings['descriptionSpeed']*1000))});$slides.mouseleave(function(){if($settings['showDescription']&&$settings['hideDescription']){var description=jQuery(this).find('.description');description.stop(true,true).animate({'margin-bottom':'-'+description.outerHeight(true)+'px'},parseInt($settings['descriptionSpeed']*1000))}});function resetInterval(){clearInterval($interval);if($settings['play'])$interval=setInterval(function(){gotoView(1,true)},$settings['intervalSpeed']*1000)}function getSessionID(){var splitClasses=$container.attr('class').split('_');return splitClasses[splitClasses.length-1]}jQuery(window).load(function(){jQuery.each($slides,function(key,slide){var image=jQuery(slide).find('img');if(image.attr('src')!=undefined){var imageWidth=jQuery(slide).width()-(image.outerWidth(true)-image.width());var imageHeight=jQuery(slide).height()-(image.outerHeight(true)-image.height());if($settings['stretchImages']){image.css({width:imageWidth,height:imageHeight})}else{if(image.outerWidth(true)>jQuery(slide).width()){image.css({width:imageWidth,height:'auto'})}else if(image.outerHeight(true)>jQuery(slide).height()){image.css({width:'auto',height:imageHeight})}else{image.css({width:'auto',height:'auto'})}}}})})};jQuery(document).ready(function(){jQuery.each(jQuery('.slideshow_container'),function(key,value){jQuery(value).slideshow_script()})});
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Donate link: http://stefanboonstra.com/donate-to-slideshow/
|
|
5 |
Tags: slideshow, slider, slide, slides, show, images, image, photo, gallery, galleries, jquery, javascript, video, text
|
6 |
Requires at least: 3.3
|
7 |
Tested up to: 3.4.2
|
8 |
-
Stable tag: 2.1.
|
9 |
License: GPLv2
|
10 |
|
11 |
Integrate a fancy slideshow in just five steps. - Rainbows. Rainbows everywhere.
|
@@ -107,10 +107,11 @@ slideshow may not be styled.
|
|
107 |
|
108 |
== Changelog ==
|
109 |
|
110 |
-
= 2.
|
111 |
-
*
|
112 |
-
*
|
113 |
-
*
|
|
|
114 |
|
115 |
= 2.1.17 =
|
116 |
* Fixed: Invalid argument being supplied for the foreach loop in SlideshowPluginPostType on line 352
|
5 |
Tags: slideshow, slider, slide, slides, show, images, image, photo, gallery, galleries, jquery, javascript, video, text
|
6 |
Requires at least: 3.3
|
7 |
Tested up to: 3.4.2
|
8 |
+
Stable tag: 2.1.18
|
9 |
License: GPLv2
|
10 |
|
11 |
Integrate a fancy slideshow in just five steps. - Rainbows. Rainbows everywhere.
|
107 |
|
108 |
== Changelog ==
|
109 |
|
110 |
+
= 2.1.18 =
|
111 |
+
* Text slide descriptions are now displayed in text areas, making editing of long descriptions more convenient.
|
112 |
+
* Backgrounds of text slides can now be set to transparent by leaving the 'Background color' field empty.
|
113 |
+
* Settings are now loaded from a JavaScript variable, so (the major) search engines won't read them as actual content.
|
114 |
+
* Widget title's HTML tags are now discarded when no widget title is set.
|
115 |
|
116 |
= 2.1.17 =
|
117 |
* Fixed: Invalid argument being supplied for the foreach loop in SlideshowPluginPostType on line 352
|
slideshow.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Slideshow
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/
|
5 |
Description: This plugin offers a slideshow that is easily deployable in your website. Add any image that has already been uploaded to add to your slideshow. Options and styles are customizable for every single slideshow on your website.
|
6 |
-
Version: 2.1.
|
7 |
Requires at least: 3.3
|
8 |
Author: StefanBoonstra
|
9 |
Author URI: http://stefanboonstra.com
|
@@ -21,7 +21,7 @@
|
|
21 |
class SlideshowPluginMain {
|
22 |
|
23 |
/** Variables */
|
24 |
-
static $version = '2.1.
|
25 |
|
26 |
/**
|
27 |
* Bootstraps the application by assigning the right functions to
|
3 |
Plugin Name: Slideshow
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/
|
5 |
Description: This plugin offers a slideshow that is easily deployable in your website. Add any image that has already been uploaded to add to your slideshow. Options and styles are customizable for every single slideshow on your website.
|
6 |
+
Version: 2.1.18
|
7 |
Requires at least: 3.3
|
8 |
Author: StefanBoonstra
|
9 |
Author URI: http://stefanboonstra.com
|
21 |
class SlideshowPluginMain {
|
22 |
|
23 |
/** Variables */
|
24 |
+
static $version = '2.1.18';
|
25 |
|
26 |
/**
|
27 |
* Bootstraps the application by assigning the right functions to
|
views/SlideshowPlugin/slideshow.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<div class="slideshow_container slideshow_container_<?php echo (is_numeric($
|
2 |
<div class="slideshow_overflow" style="width: <?php echo (is_numeric($settings['width']))? $settings['width'] : 0; ?>px; height: <?php echo (is_numeric($settings['height']))? $settings['height'] : 0; ?>px;">
|
3 |
<div class="slideshow">
|
4 |
<?php if(count($slides) > 0): ?>
|
@@ -115,7 +115,7 @@
|
|
115 |
<div class="button next transparent"></div>
|
116 |
</div>
|
117 |
|
118 |
-
|
119 |
|
120 |
<div class="manufacturer">
|
121 |
<a href="http://www.stefanboonstra.com/slideshow/">Wordpress Slideshow</a>
|
1 |
+
<div class="slideshow_container slideshow_container_<?php echo (is_numeric($sessionID)) ? $sessionID : 0; ?>" style="width: <?php echo (is_numeric($settings['width']))? $settings['width'] : 0; ?>px; height: <?php echo (is_numeric($settings['height']))? $settings['height'] : 0; ?>px;">
|
2 |
<div class="slideshow_overflow" style="width: <?php echo (is_numeric($settings['width']))? $settings['width'] : 0; ?>px; height: <?php echo (is_numeric($settings['height']))? $settings['height'] : 0; ?>px;">
|
3 |
<div class="slideshow">
|
4 |
<?php if(count($slides) > 0): ?>
|
115 |
<div class="button next transparent"></div>
|
116 |
</div>
|
117 |
|
118 |
+
<!--<div class="settings" style="display: none;"><?php echo json_encode($settings); ?></div>-->
|
119 |
|
120 |
<div class="manufacturer">
|
121 |
<a href="http://www.stefanboonstra.com/slideshow/">Wordpress Slideshow</a>
|
views/SlideshowPluginPostType/slides.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<p style="text-align: center;">
|
2 |
<i><?php _e('Insert', 'slideshow-plugin'); ?>:</i><br/>
|
3 |
<?php echo SlideshowPluginSlideInserter::getImageSlideInsertButton(); ?>
|
4 |
<?php echo SlideshowPluginSlideInserter::getTextSlideInsertButton(); ?>
|
@@ -46,10 +46,10 @@
|
|
46 |
$color = $slide['color'];
|
47 |
?>
|
48 |
|
49 |
-
<p style="padding: 0 5px;">
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
</p>
|
54 |
|
55 |
<p style="float: left; padding: 0 5px;">
|
@@ -141,10 +141,10 @@
|
|
141 |
|
142 |
<div class="text-slide-template" style="display: none;">
|
143 |
<li class="widefat sortable-slides-list-item">
|
144 |
-
<p style="padding: 0 5px;">
|
145 |
<input type="text" class="title" /><i><?php _e('Title', 'slideshow-plugin'); ?></i><br />
|
146 |
-
<
|
147 |
-
<input type="text" class="color" /><i><?php _e('Background color', 'slideshow-plugin'); ?></i><br />
|
148 |
</p>
|
149 |
|
150 |
<p style="float: left; padding: 0 5px;">
|
1 |
+
<p style="text-align: center;" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
|
2 |
<i><?php _e('Insert', 'slideshow-plugin'); ?>:</i><br/>
|
3 |
<?php echo SlideshowPluginSlideInserter::getImageSlideInsertButton(); ?>
|
4 |
<?php echo SlideshowPluginSlideInserter::getTextSlideInsertButton(); ?>
|
46 |
$color = $slide['color'];
|
47 |
?>
|
48 |
|
49 |
+
<p style="padding: 0 15px 0 5px;">
|
50 |
+
<input type="text" name="slide_<?php echo $id; ?>_title" value="<?php echo $title; ?>" /><i><?php _e('Title', 'slideshow-plugin'); ?></i><br />
|
51 |
+
<i><?php _e('Description', 'slideshow-plugin'); ?></i><textarea name="slide_<?php echo $id; ?>_description" rows="7" cols="" style="width: 100%;"><?php echo $description; ?></textarea><br />
|
52 |
+
<input type="text" name="slide_<?php echo $id; ?>_color" value="<?php echo $color; ?>" class="color {required:false}" /><i><?php _e('Background color', 'slideshow-plugin'); ?></i><br />
|
53 |
</p>
|
54 |
|
55 |
<p style="float: left; padding: 0 5px;">
|
141 |
|
142 |
<div class="text-slide-template" style="display: none;">
|
143 |
<li class="widefat sortable-slides-list-item">
|
144 |
+
<p style="padding: 0 15px 0 5px;">
|
145 |
<input type="text" class="title" /><i><?php _e('Title', 'slideshow-plugin'); ?></i><br />
|
146 |
+
<i><?php _e('Description', 'slideshow-plugin'); ?></i><textarea class="description" cols="" rows="7" style="width: 100%;"></textarea><br />
|
147 |
+
<input type="text" class="color {required:false}" /><i><?php _e('Background color', 'slideshow-plugin'); ?></i><br />
|
148 |
</p>
|
149 |
|
150 |
<p style="float: left; padding: 0 5px;">
|