Version Description
- Refactored the slideshow plugin's backend codebase to prepare for a larger backend rewrite.
- Removed backwards compatibility on inserting images with pre-3.5 versions of WordPress.
- Slideshows now work on infinite scroll and single page websites through the "Enable lazy loading" option.
- Fixed: YouTube thumbnail image disappeared after clicking the slideshow's navigation buttons.
Download this release
Release Info
Developer | stefanboonstra |
Plugin | Slideshow |
Version | 2.3.0 |
Comparing to | |
See all releases |
Code changes from version 2.2.25 to 2.3.0
- classes/SlideshowPlugin.php +30 -27
- classes/SlideshowPluginAJAX.php +0 -3
- classes/SlideshowPluginGeneralSettings.php +17 -3
- classes/SlideshowPluginPostType.php +14 -59
- classes/SlideshowPluginShortcode.php +3 -4
- classes/SlideshowPluginSlideInserter.php +0 -255
- classes/SlideshowPluginSlideshowSettingsHandler.php +1 -68
- classes/SlideshowPluginSlideshowSlide.php +0 -192
- classes/SlideshowPluginSlideshowView.php +0 -110
- classes/SlideshowPluginWidget.php +6 -1
- css/all.backend.css +0 -38
- images/SlideshowPluginSlideInserter/close.png +0 -0
- js/min/all.backend.min.js +1 -1
- js/min/all.frontend.min.js +3 -3
- readme.txt +7 -1
- slideshow.php +70 -4
- views/SlideshowPlugin/slideshow.php +47 -26
- views/SlideshowPluginGeneralSettings/custom-styles-tab.php +153 -150
- views/SlideshowPluginGeneralSettings/default-slideshow-settings-tab.php +80 -77
- views/SlideshowPluginGeneralSettings/general-settings-tab.php +67 -56
- views/SlideshowPluginGeneralSettings/general-settings.php +29 -26
- views/SlideshowPluginPostType/information.php +11 -7
- views/SlideshowPluginPostType/settings.php +30 -28
- views/SlideshowPluginPostType/slides.php +34 -283
- views/SlideshowPluginPostType/style-settings.php +25 -23
- views/SlideshowPluginPostType/support-plugin.php +34 -32
- views/SlideshowPluginShortcode/shortcode-inserter.php +79 -76
- views/SlideshowPluginSlideInserter/insert-image-button.php +0 -5
- views/SlideshowPluginSlideInserter/insert-text-button.php +0 -2
- views/SlideshowPluginSlideInserter/insert-video-button.php +0 -2
- views/SlideshowPluginSlideInserter/search-popup.php +0 -14
- views/SlideshowPluginSlideshowSlide/backend_attachment.php +148 -143
- views/SlideshowPluginSlideshowSlide/backend_templates.php +143 -141
- views/SlideshowPluginSlideshowSlide/backend_text.php +107 -102
- views/SlideshowPluginSlideshowSlide/backend_video.php +42 -37
- views/SlideshowPluginSlideshowSlide/frontend_attachment.php +101 -96
- views/SlideshowPluginSlideshowSlide/frontend_text.php +88 -83
- views/SlideshowPluginSlideshowSlide/frontend_video.php +31 -26
- views/SlideshowPluginUpload/upload-button.php +0 -1
- views/SlideshowPluginWidget/form.php +19 -15
classes/SlideshowPlugin.php
CHANGED
@@ -8,9 +8,6 @@
|
|
8 |
*/
|
9 |
class SlideshowPlugin
|
10 |
{
|
11 |
-
/** int $sessionCounter */
|
12 |
-
public static $sessionCounter = 0;
|
13 |
-
|
14 |
/**
|
15 |
* Function deploy prints out the prepared html
|
16 |
*
|
@@ -87,16 +84,16 @@ class SlideshowPlugin
|
|
87 |
return '<!-- WordPress Slideshow - No slideshows available -->';
|
88 |
}
|
89 |
|
90 |
-
// Log slideshow's
|
91 |
$log = array();
|
92 |
|
93 |
-
// Get
|
94 |
-
$
|
95 |
|
96 |
-
if (!is_array($
|
97 |
-
count($
|
98 |
{
|
99 |
-
$log[] = 'No
|
100 |
}
|
101 |
|
102 |
// Get settings
|
@@ -117,11 +114,16 @@ class SlideshowPlugin
|
|
117 |
// Check if requested style is available. If not, use the default
|
118 |
list($styleName, $styleVersion) = SlideshowPluginSlideshowStylesheet::enqueueStylesheet($styleSettings['style']);
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
// Include output file to store output in $output.
|
121 |
-
$output = '';
|
122 |
-
ob_start();
|
123 |
-
include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/slideshow.php');
|
124 |
-
$output .= ob_get_clean();
|
125 |
|
126 |
// Enqueue slideshow script
|
127 |
wp_enqueue_script(
|
@@ -160,21 +162,22 @@ class SlideshowPlugin
|
|
160 |
}
|
161 |
}
|
162 |
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
wp_localize_script(
|
172 |
-
'slideshow-jquery-image-gallery-script',
|
173 |
-
'slideshow_jquery_image_gallery_script_adminURL',
|
174 |
-
admin_url()
|
175 |
-
);
|
176 |
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
|
179 |
// Return output
|
180 |
return $output;
|
8 |
*/
|
9 |
class SlideshowPlugin
|
10 |
{
|
|
|
|
|
|
|
11 |
/**
|
12 |
* Function deploy prints out the prepared html
|
13 |
*
|
84 |
return '<!-- WordPress Slideshow - No slideshows available -->';
|
85 |
}
|
86 |
|
87 |
+
// Log slideshow's problems to be able to track them on the page.
|
88 |
$log = array();
|
89 |
|
90 |
+
// Get slides
|
91 |
+
$slides = SlideshowPluginSlideshowSettingsHandler::getSlides($post->ID);
|
92 |
|
93 |
+
if (!is_array($slides) ||
|
94 |
+
count($slides) <= 0)
|
95 |
{
|
96 |
+
$log[] = 'No slides were found';
|
97 |
}
|
98 |
|
99 |
// Get settings
|
114 |
// Check if requested style is available. If not, use the default
|
115 |
list($styleName, $styleVersion) = SlideshowPluginSlideshowStylesheet::enqueueStylesheet($styleSettings['style']);
|
116 |
|
117 |
+
$data = new stdClass();
|
118 |
+
$data->log = $log;
|
119 |
+
$data->post = $post;
|
120 |
+
$data->slides = $slides;
|
121 |
+
$data->settings = $settings;
|
122 |
+
$data->styleName = $styleName;
|
123 |
+
$data->styleVersion = $styleVersion;
|
124 |
+
|
125 |
// Include output file to store output in $output.
|
126 |
+
$output = SlideshowPluginMain::getView(__CLASS__ . DIRECTORY_SEPARATOR . 'slideshow.php', $data);
|
|
|
|
|
|
|
127 |
|
128 |
// Enqueue slideshow script
|
129 |
wp_enqueue_script(
|
162 |
}
|
163 |
}
|
164 |
|
165 |
+
if (!SlideshowPluginGeneralSettings::getEnableLazyLoading())
|
166 |
+
{
|
167 |
+
// Include slideshow settings by localizing them
|
168 |
+
wp_localize_script(
|
169 |
+
'slideshow-jquery-image-gallery-script',
|
170 |
+
'SlideshowPluginSettings_' . $post->ID,
|
171 |
+
$settings
|
172 |
+
);
|
|
|
|
|
|
|
|
|
|
|
173 |
|
174 |
+
// Include the location of the admin-ajax.php file
|
175 |
+
wp_localize_script(
|
176 |
+
'slideshow-jquery-image-gallery-script',
|
177 |
+
'slideshow_jquery_image_gallery_script_adminURL',
|
178 |
+
admin_url()
|
179 |
+
);
|
180 |
+
}
|
181 |
|
182 |
// Return output
|
183 |
return $output;
|
classes/SlideshowPluginAJAX.php
CHANGED
@@ -16,9 +16,6 @@ class SlideshowPluginAJAX
|
|
16 |
*/
|
17 |
static function init()
|
18 |
{
|
19 |
-
// For the old pre-3.5 uploader
|
20 |
-
add_action('wp_ajax_slideshow_slide_inserter_search_query', array('SlideshowPluginSlideInserter', 'printSearchResults'));
|
21 |
-
|
22 |
add_action('wp_ajax_slideshow_jquery_image_gallery_load_stylesheet', array('SlideshowPluginSlideshowStylesheet', 'loadStylesheetByAJAX'));
|
23 |
add_action('wp_ajax_nopriv_slideshow_jquery_image_gallery_load_stylesheet', array('SlideshowPluginSlideshowStylesheet', 'loadStylesheetByAJAX'));
|
24 |
}
|
16 |
*/
|
17 |
static function init()
|
18 |
{
|
|
|
|
|
|
|
19 |
add_action('wp_ajax_slideshow_jquery_image_gallery_load_stylesheet', array('SlideshowPluginSlideshowStylesheet', 'loadStylesheetByAJAX'));
|
20 |
add_action('wp_ajax_nopriv_slideshow_jquery_image_gallery_load_stylesheet', array('SlideshowPluginSlideshowStylesheet', 'loadStylesheetByAJAX'));
|
21 |
}
|
classes/SlideshowPluginGeneralSettings.php
CHANGED
@@ -14,9 +14,12 @@ class SlideshowPluginGeneralSettings
|
|
14 |
/** @var string $settingsGroup Settings group */
|
15 |
static $settingsGroup = 'slideshow-jquery-image-gallery-general-settings';
|
16 |
|
17 |
-
/** @var string $stylesheetLocation
|
18 |
static $stylesheetLocation = 'slideshow-jquery-image-gallery-stylesheet-location';
|
19 |
|
|
|
|
|
|
|
20 |
/** @var array $capabilities User capability settings */
|
21 |
static $capabilities = array(
|
22 |
'addSlideshows' => 'slideshow-jquery-image-gallery-add-slideshows',
|
@@ -94,8 +97,7 @@ class SlideshowPluginGeneralSettings
|
|
94 |
*/
|
95 |
static function generalSettings()
|
96 |
{
|
97 |
-
|
98 |
-
include SlideshowPluginMain::getPluginPath() . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . __CLASS__ . DIRECTORY_SEPARATOR . 'general-settings.php';
|
99 |
}
|
100 |
|
101 |
/**
|
@@ -116,6 +118,7 @@ class SlideshowPluginGeneralSettings
|
|
116 |
|
117 |
// Register general settings
|
118 |
register_setting(self::$settingsGroup, self::$stylesheetLocation);
|
|
|
119 |
|
120 |
// Register user capability settings, saving capabilities only has to be called once.
|
121 |
register_setting(self::$settingsGroup, self::$capabilities['addSlideshows']);
|
@@ -165,6 +168,17 @@ class SlideshowPluginGeneralSettings
|
|
165 |
return get_option(SlideshowPluginGeneralSettings::$stylesheetLocation, 'footer');
|
166 |
}
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
/**
|
169 |
* Returns an array of stylesheets with its keys and respective names.
|
170 |
*
|
14 |
/** @var string $settingsGroup Settings group */
|
15 |
static $settingsGroup = 'slideshow-jquery-image-gallery-general-settings';
|
16 |
|
17 |
+
/** @var string $stylesheetLocation Stylesheet location setting */
|
18 |
static $stylesheetLocation = 'slideshow-jquery-image-gallery-stylesheet-location';
|
19 |
|
20 |
+
/** @var string $enableLazyLoading Lazy loading setting */
|
21 |
+
static $enableLazyLoading = 'slideshow-jquery-image-gallery-enable-lazy-loading';
|
22 |
+
|
23 |
/** @var array $capabilities User capability settings */
|
24 |
static $capabilities = array(
|
25 |
'addSlideshows' => 'slideshow-jquery-image-gallery-add-slideshows',
|
97 |
*/
|
98 |
static function generalSettings()
|
99 |
{
|
100 |
+
SlideshowPluginMain::outputView(__CLASS__ . DIRECTORY_SEPARATOR . 'general-settings.php');
|
|
|
101 |
}
|
102 |
|
103 |
/**
|
118 |
|
119 |
// Register general settings
|
120 |
register_setting(self::$settingsGroup, self::$stylesheetLocation);
|
121 |
+
register_setting(self::$settingsGroup, self::$enableLazyLoading);
|
122 |
|
123 |
// Register user capability settings, saving capabilities only has to be called once.
|
124 |
register_setting(self::$settingsGroup, self::$capabilities['addSlideshows']);
|
168 |
return get_option(SlideshowPluginGeneralSettings::$stylesheetLocation, 'footer');
|
169 |
}
|
170 |
|
171 |
+
/**
|
172 |
+
* Returns the lazy loading setting, which is disabled (false) by default.
|
173 |
+
*
|
174 |
+
* @since 2.3.0
|
175 |
+
* @return boolean $enableLazyLoading
|
176 |
+
*/
|
177 |
+
public static function getEnableLazyLoading()
|
178 |
+
{
|
179 |
+
return get_option(self::$enableLazyLoading, false) === "true";
|
180 |
+
}
|
181 |
+
|
182 |
/**
|
183 |
* Returns an array of stylesheets with its keys and respective names.
|
184 |
*
|
classes/SlideshowPluginPostType.php
CHANGED
@@ -187,7 +187,7 @@ class SlideshowPluginPostType
|
|
187 |
*/
|
188 |
static function supportPluginMessage()
|
189 |
{
|
190 |
-
|
191 |
}
|
192 |
|
193 |
/**
|
@@ -199,69 +199,26 @@ class SlideshowPluginPostType
|
|
199 |
{
|
200 |
global $post;
|
201 |
|
202 |
-
$
|
203 |
-
$
|
|
|
204 |
|
205 |
-
|
206 |
}
|
207 |
|
208 |
/**
|
209 |
* Shows slides currently in slideshow
|
210 |
*
|
211 |
-
* TODO Tidy up, it's probably best to move all to 'slides.php'
|
212 |
-
*
|
213 |
* @since 1.0.0
|
214 |
*/
|
215 |
static function slidesMetaBox()
|
216 |
{
|
217 |
global $post;
|
218 |
|
219 |
-
|
220 |
-
$
|
221 |
-
|
222 |
-
// Insert slide buttons
|
223 |
-
echo '<p style="text-align: center;">
|
224 |
-
<i>' . __('Insert', 'slideshow-jquery-image-gallery') . ':</i><br/>' .
|
225 |
-
SlideshowPluginSlideInserter::getImageSlideInsertButton() .
|
226 |
-
SlideshowPluginSlideInserter::getTextSlideInsertButton() .
|
227 |
-
SlideshowPluginSlideInserter::getVideoSlideInsertButton() .
|
228 |
-
'</p>';
|
229 |
-
|
230 |
-
// Toggle slides open/closed
|
231 |
-
echo '<p style="text-align: center;">
|
232 |
-
<a href="#" class="open-slides-button">' . __( 'Open all', 'slideshow-jquery-image-gallery' ) . '</a>
|
233 |
-
|
|
234 |
-
<a href="#" class="close-slides-button">' . __( 'Close all', 'slideshow-jquery-image-gallery' ) . '</a>
|
235 |
-
</p>';
|
236 |
-
|
237 |
-
// No views/slides message
|
238 |
-
if (count($views) <= 0)
|
239 |
-
{
|
240 |
-
echo '<p>' . __('Add slides to this slideshow by using one of the buttons above.', 'slideshow-jquery-image-gallery') . '</p>';
|
241 |
-
}
|
242 |
-
|
243 |
-
// Start list
|
244 |
-
echo '<div class="sortable-slides-list">';
|
245 |
-
|
246 |
-
// Print views
|
247 |
-
if (is_array($views))
|
248 |
-
{
|
249 |
-
foreach($views as $view)
|
250 |
-
{
|
251 |
-
if (!($view instanceof SlideshowPluginSlideshowView))
|
252 |
-
{
|
253 |
-
continue;
|
254 |
-
}
|
255 |
-
|
256 |
-
echo $view->toBackEndHTML();
|
257 |
-
}
|
258 |
-
}
|
259 |
-
|
260 |
-
// End list
|
261 |
-
echo '</div>';
|
262 |
|
263 |
-
|
264 |
-
SlideshowPluginSlideshowSlide::getBackEndTemplates(false);
|
265 |
}
|
266 |
|
267 |
/**
|
@@ -273,11 +230,10 @@ class SlideshowPluginPostType
|
|
273 |
{
|
274 |
global $post;
|
275 |
|
276 |
-
|
277 |
-
$settings = SlideshowPluginSlideshowSettingsHandler::getStyleSettings($post->ID, true);
|
278 |
|
279 |
-
|
280 |
-
include SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/style-settings.php';
|
281 |
}
|
282 |
|
283 |
/**
|
@@ -292,11 +248,10 @@ class SlideshowPluginPostType
|
|
292 |
// Nonce
|
293 |
wp_nonce_field(SlideshowPluginSlideshowSettingsHandler::$nonceAction, SlideshowPluginSlideshowSettingsHandler::$nonceName);
|
294 |
|
295 |
-
|
296 |
-
$settings = SlideshowPluginSlideshowSettingsHandler::getSettings($post->ID, true);
|
297 |
|
298 |
-
|
299 |
-
include SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/settings.php';
|
300 |
}
|
301 |
|
302 |
/**
|
187 |
*/
|
188 |
static function supportPluginMessage()
|
189 |
{
|
190 |
+
SlideshowPluginMain::outputView(__CLASS__ . DIRECTORY_SEPARATOR . 'support-plugin.php');
|
191 |
}
|
192 |
|
193 |
/**
|
199 |
{
|
200 |
global $post;
|
201 |
|
202 |
+
$data = new stdClass();
|
203 |
+
$data->snippet = htmlentities(sprintf('<?php do_action(\'slideshow_deploy\', \'%s\'); ?>', $post->ID));
|
204 |
+
$data->shortCode = htmlentities(sprintf('[' . SlideshowPluginShortcode::$shortCode . ' id=\'%s\']', $post->ID));
|
205 |
|
206 |
+
SlideshowPluginMain::outputView(__CLASS__ . DIRECTORY_SEPARATOR . 'information.php', $data);
|
207 |
}
|
208 |
|
209 |
/**
|
210 |
* Shows slides currently in slideshow
|
211 |
*
|
|
|
|
|
212 |
* @since 1.0.0
|
213 |
*/
|
214 |
static function slidesMetaBox()
|
215 |
{
|
216 |
global $post;
|
217 |
|
218 |
+
$data = new stdClass();
|
219 |
+
$data->slides = SlideshowPluginSlideshowSettingsHandler::getSlides($post->ID);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
|
221 |
+
SlideshowPluginMain::outputView(__CLASS__ . DIRECTORY_SEPARATOR . 'slides.php', $data);
|
|
|
222 |
}
|
223 |
|
224 |
/**
|
230 |
{
|
231 |
global $post;
|
232 |
|
233 |
+
$data = new stdClass();
|
234 |
+
$data->settings = SlideshowPluginSlideshowSettingsHandler::getStyleSettings($post->ID, true);
|
235 |
|
236 |
+
SlideshowPluginMain::outputView(__CLASS__ . DIRECTORY_SEPARATOR . 'style-settings.php', $data);
|
|
|
237 |
}
|
238 |
|
239 |
/**
|
248 |
// Nonce
|
249 |
wp_nonce_field(SlideshowPluginSlideshowSettingsHandler::$nonceAction, SlideshowPluginSlideshowSettingsHandler::$nonceName);
|
250 |
|
251 |
+
$data = new stdClass();
|
252 |
+
$data->settings = SlideshowPluginSlideshowSettingsHandler::getSettings($post->ID, true);
|
253 |
|
254 |
+
SlideshowPluginMain::outputView(__CLASS__ . DIRECTORY_SEPARATOR . 'settings.php', $data);
|
|
|
255 |
}
|
256 |
|
257 |
/**
|
classes/SlideshowPluginShortcode.php
CHANGED
@@ -59,7 +59,6 @@ class SlideshowPluginShortcode
|
|
59 |
$postId = $attributes['id'];
|
60 |
}
|
61 |
|
62 |
-
$output = '';
|
63 |
$settings = SlideshowPluginSlideshowSettingsHandler::getSettings($postId);
|
64 |
|
65 |
if ($settings['avoidFilter'] == 'true' &&
|
@@ -122,15 +121,15 @@ class SlideshowPluginShortcode
|
|
122 |
*/
|
123 |
static function shortcodeInserter()
|
124 |
{
|
125 |
-
|
126 |
-
$slideshows = new WP_Query(array(
|
127 |
'post_type' => SlideshowPluginPostType::$postType,
|
128 |
'orderby' => 'post_date',
|
129 |
'posts_per_page' => -1,
|
130 |
'order' => 'DESC'
|
131 |
));
|
132 |
|
133 |
-
|
134 |
}
|
135 |
|
136 |
/**
|
59 |
$postId = $attributes['id'];
|
60 |
}
|
61 |
|
|
|
62 |
$settings = SlideshowPluginSlideshowSettingsHandler::getSettings($postId);
|
63 |
|
64 |
if ($settings['avoidFilter'] == 'true' &&
|
121 |
*/
|
122 |
static function shortcodeInserter()
|
123 |
{
|
124 |
+
$data = new stdClass();
|
125 |
+
$data->slideshows = new WP_Query(array(
|
126 |
'post_type' => SlideshowPluginPostType::$postType,
|
127 |
'orderby' => 'post_date',
|
128 |
'posts_per_page' => -1,
|
129 |
'order' => 'DESC'
|
130 |
));
|
131 |
|
132 |
+
SlideshowPluginMain::outputView(__CLASS__ . DIRECTORY_SEPARATOR . 'shortcode-inserter.php', $data);
|
133 |
}
|
134 |
|
135 |
/**
|
classes/SlideshowPluginSlideInserter.php
CHANGED
@@ -2,59 +2,11 @@
|
|
2 |
/**
|
3 |
* Class SlideshowPluginSlideInserter
|
4 |
*
|
5 |
-
* TODO This class will probably need to be renamed to SlideshowPluginSlideHandler to explain more functionality
|
6 |
-
* TODO than just inserting slides.
|
7 |
-
*
|
8 |
* @since 2.0.0
|
9 |
* @author Stefan Boonstra
|
10 |
*/
|
11 |
class SlideshowPluginSlideInserter
|
12 |
{
|
13 |
-
/**
|
14 |
-
* Returns the html for showing the image insert button.
|
15 |
-
*
|
16 |
-
* @since 2.0.0
|
17 |
-
* @return String $button
|
18 |
-
*/
|
19 |
-
static function getImageSlideInsertButton()
|
20 |
-
{
|
21 |
-
// Put popup html in footer
|
22 |
-
add_action('admin_footer', array(__CLASS__, 'includePopup'));
|
23 |
-
|
24 |
-
// Return button html
|
25 |
-
ob_start();
|
26 |
-
include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/insert-image-button.php');
|
27 |
-
return ob_get_clean();
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Returns the html for showing the text insert button.
|
32 |
-
*
|
33 |
-
* @since 2.0.0
|
34 |
-
* @return String $button
|
35 |
-
*/
|
36 |
-
static function getTextSlideInsertButton()
|
37 |
-
{
|
38 |
-
// Return button html
|
39 |
-
ob_start();
|
40 |
-
include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/insert-text-button.php');
|
41 |
-
return ob_get_clean();
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Returns the html for showing the video insert button.
|
46 |
-
*
|
47 |
-
* @since 2.1.0
|
48 |
-
* @return String $button
|
49 |
-
*/
|
50 |
-
static function getVideoSlideInsertButton()
|
51 |
-
{
|
52 |
-
// Return button html
|
53 |
-
ob_start();
|
54 |
-
include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/insert-video-button.php');
|
55 |
-
return ob_get_clean();
|
56 |
-
}
|
57 |
-
|
58 |
/**
|
59 |
* Returns a list of element tags, without special characters.
|
60 |
*
|
@@ -95,213 +47,6 @@ class SlideshowPluginSlideInserter
|
|
95 |
return reset($elementTags);
|
96 |
}
|
97 |
|
98 |
-
/**
|
99 |
-
* This function is registered in the SlideshowPluginAjax class
|
100 |
-
* and prints the results from the search query.
|
101 |
-
*
|
102 |
-
* @since 2.0.0
|
103 |
-
*/
|
104 |
-
static function printSearchResults()
|
105 |
-
{
|
106 |
-
global $wpdb;
|
107 |
-
|
108 |
-
// Numberposts and offset
|
109 |
-
$numberPosts = 10;
|
110 |
-
$offset = 0;
|
111 |
-
|
112 |
-
if (isset($_POST['offset']) &&
|
113 |
-
is_numeric($_POST['offset']))
|
114 |
-
{
|
115 |
-
$offset = $_POST['offset'];
|
116 |
-
}
|
117 |
-
|
118 |
-
$attachmentIDs = array();
|
119 |
-
|
120 |
-
if (isset($_POST['attachmentIDs']))
|
121 |
-
{
|
122 |
-
$attachmentIDs = array_filter($_POST['attachmentIDs'], 'ctype_digit');
|
123 |
-
}
|
124 |
-
|
125 |
-
// Get attachments with a title alike the search string, needs to be filtered
|
126 |
-
add_filter('posts_where', array(__CLASS__, 'printSearchResultsWhereFilter'));
|
127 |
-
$query = new WP_Query(array(
|
128 |
-
'post_type' => 'attachment',
|
129 |
-
'post_status' => 'inherit',
|
130 |
-
'offset' => $offset,
|
131 |
-
'posts_per_page' => $numberPosts + 1,
|
132 |
-
'orderby' => 'date',
|
133 |
-
'order' => 'DESC'
|
134 |
-
));
|
135 |
-
$attachments = $query->get_posts();
|
136 |
-
remove_filter('posts_where', array(__CLASS__, 'printSearchResultsWhereFilter'));
|
137 |
-
|
138 |
-
// Look for images by their file's name when not enough matching results were found
|
139 |
-
if (count($attachments) < $numberPosts)
|
140 |
-
{
|
141 |
-
$searchString = esc_sql($_POST['search']);
|
142 |
-
|
143 |
-
// Add results found with the previous query to the $attachmentIDs array to exclude them as well
|
144 |
-
foreach ($attachments as $attachment)
|
145 |
-
{
|
146 |
-
$attachmentIDs[] = $attachment->ID;
|
147 |
-
}
|
148 |
-
|
149 |
-
// Search by file name
|
150 |
-
$fileNameQuery = new WP_Query(array(
|
151 |
-
'post_type' => 'attachment',
|
152 |
-
'post_status' => 'inherit',
|
153 |
-
'posts_per_page' => $numberPosts - count($attachments),
|
154 |
-
'post__not_in' => $attachmentIDs,
|
155 |
-
'meta_query' => array(
|
156 |
-
array(
|
157 |
-
'key' => '_wp_attached_file',
|
158 |
-
'value' => $searchString,
|
159 |
-
'compare' => 'LIKE'
|
160 |
-
)
|
161 |
-
)
|
162 |
-
));
|
163 |
-
|
164 |
-
// Put found results in attachments array
|
165 |
-
$fileNameQueryAttachments = $fileNameQuery->get_posts();
|
166 |
-
|
167 |
-
if (is_array($fileNameQueryAttachments) &&
|
168 |
-
count($fileNameQueryAttachments) > 0)
|
169 |
-
{
|
170 |
-
foreach ($fileNameQueryAttachments as $fileNameQueryAttachment)
|
171 |
-
{
|
172 |
-
$attachments[] = $fileNameQueryAttachment;
|
173 |
-
}
|
174 |
-
}
|
175 |
-
}
|
176 |
-
|
177 |
-
// Check if there are enough attachments to print a 'Load more images' button
|
178 |
-
$loadMoreResults = false;
|
179 |
-
|
180 |
-
if (count($attachments) > $numberPosts)
|
181 |
-
{
|
182 |
-
array_pop($attachments);
|
183 |
-
|
184 |
-
$loadMoreResults = true;
|
185 |
-
}
|
186 |
-
|
187 |
-
// Print results to the screen
|
188 |
-
if (count($attachments) > 0)
|
189 |
-
{
|
190 |
-
if ($offset > 0)
|
191 |
-
{
|
192 |
-
echo '<tr valign="top">
|
193 |
-
<td colspan="3" style="text-align: center;">
|
194 |
-
<b>' . count($attachments) . ' ' . __('More results loaded', 'slideshow-jquery-image-gallery') . '<b>
|
195 |
-
</td>
|
196 |
-
</tr>';
|
197 |
-
}
|
198 |
-
|
199 |
-
foreach ($attachments as $attachment)
|
200 |
-
{
|
201 |
-
$image = wp_get_attachment_image_src($attachment->ID);
|
202 |
-
|
203 |
-
if (!is_array($image) ||
|
204 |
-
!$image)
|
205 |
-
{
|
206 |
-
if (!empty($attachment->guid))
|
207 |
-
{
|
208 |
-
$imageSrc = $attachment->guid;
|
209 |
-
}
|
210 |
-
else
|
211 |
-
{
|
212 |
-
continue;
|
213 |
-
}
|
214 |
-
}
|
215 |
-
else
|
216 |
-
{
|
217 |
-
$imageSrc = $image[0];
|
218 |
-
}
|
219 |
-
|
220 |
-
if (!$imageSrc ||
|
221 |
-
empty($imageSrc))
|
222 |
-
{
|
223 |
-
$imageSrc = SlideshowPluginMain::getPluginUrl() . '/images/SlideshowPluginPostType/no-img.png';
|
224 |
-
}
|
225 |
-
|
226 |
-
echo '<tr valign="top" data-attachment-Id="' . $attachment->ID . '" class="result-table-row">
|
227 |
-
<td class="image">
|
228 |
-
<img width="60" height="60" src="' . $imageSrc . '" class="attachment" alt="' . $attachment->post_title . '" title="' . $attachment->post_title . '">
|
229 |
-
</td>
|
230 |
-
<td class="column-title">
|
231 |
-
<strong class="title">' . $attachment->post_title . '</strong>
|
232 |
-
<p class="description">' . $attachment->post_content . '</p>
|
233 |
-
</td>
|
234 |
-
<td class="insert-button">
|
235 |
-
<input
|
236 |
-
type="button"
|
237 |
-
class="insert-attachment button-secondary"
|
238 |
-
value="' . __('Insert', 'slideshow-jquery-image-gallery') . '"
|
239 |
-
/>
|
240 |
-
</td>
|
241 |
-
</tr>';
|
242 |
-
}
|
243 |
-
|
244 |
-
if ($loadMoreResults)
|
245 |
-
{
|
246 |
-
echo '<tr>
|
247 |
-
<td colspan="3" style="text-align: center;">
|
248 |
-
<button class="button-secondary load-more-results" data-offset="' . ($offset + $numberPosts) . '">
|
249 |
-
' . __('Load more results', 'slideshow-jquery-image-gallery') . '
|
250 |
-
</button>
|
251 |
-
</td>
|
252 |
-
</tr>';
|
253 |
-
}
|
254 |
-
}
|
255 |
-
else
|
256 |
-
{
|
257 |
-
echo '<tr>
|
258 |
-
<td colspan="3" style="text-align: center;">
|
259 |
-
<a href="' . admin_url() . 'media-new.php" target="_blank">
|
260 |
-
' . __('No images were found, click here to upload some.', 'slideshow-jquery-image-gallery') . '
|
261 |
-
</a>
|
262 |
-
</td>
|
263 |
-
</tr>';
|
264 |
-
}
|
265 |
-
|
266 |
-
die;
|
267 |
-
}
|
268 |
-
|
269 |
-
/**
|
270 |
-
* Applies a where clause on the get_posts call from self::printSearchResults()
|
271 |
-
*
|
272 |
-
* @since 2.0.0
|
273 |
-
* @param string $where
|
274 |
-
* @return string $where
|
275 |
-
*/
|
276 |
-
static function printSearchResultsWhereFilter($where)
|
277 |
-
{
|
278 |
-
global $wpdb;
|
279 |
-
|
280 |
-
$searchString = $_POST['search'];
|
281 |
-
$searchString = esc_sql($searchString);
|
282 |
-
|
283 |
-
if (isset($_POST['search']))
|
284 |
-
{
|
285 |
-
$where .= $wpdb->prepare(
|
286 |
-
" AND (post_title LIKE '%%%s%%' OR ID LIKE '%%%s%%') ",
|
287 |
-
$searchString,
|
288 |
-
$searchString
|
289 |
-
);
|
290 |
-
}
|
291 |
-
|
292 |
-
return $where;
|
293 |
-
}
|
294 |
-
|
295 |
-
/**
|
296 |
-
* Include popup, needs to be called in the footer
|
297 |
-
*
|
298 |
-
* @since 2.0.0
|
299 |
-
*/
|
300 |
-
static function includePopup()
|
301 |
-
{
|
302 |
-
include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/search-popup.php');
|
303 |
-
}
|
304 |
-
|
305 |
/**
|
306 |
* Enqueues styles and scripts necessary for the media upload button.
|
307 |
*
|
2 |
/**
|
3 |
* Class SlideshowPluginSlideInserter
|
4 |
*
|
|
|
|
|
|
|
5 |
* @since 2.0.0
|
6 |
* @author Stefan Boonstra
|
7 |
*/
|
8 |
class SlideshowPluginSlideInserter
|
9 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
/**
|
11 |
* Returns a list of element tags, without special characters.
|
12 |
*
|
47 |
return reset($elementTags);
|
48 |
}
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
/**
|
51 |
* Enqueues styles and scripts necessary for the media upload button.
|
52 |
*
|
classes/SlideshowPluginSlideshowSettingsHandler.php
CHANGED
@@ -292,74 +292,7 @@ class SlideshowPluginSlideshowSettingsHandler
|
|
292 |
}
|
293 |
|
294 |
// Return
|
295 |
-
return $slides;
|
296 |
-
}
|
297 |
-
|
298 |
-
/**
|
299 |
-
* Returns an array of SlideshowPluginSlideshowView objects if $returnAsObjects is true, otherwise returns an array
|
300 |
-
* of view arrays that contain slide properties.
|
301 |
-
*
|
302 |
-
* To prevent the result from being cached set $enableCache to false. It's set to true by default.
|
303 |
-
*
|
304 |
-
* @since 2.2.0
|
305 |
-
* @param int $slideshowId
|
306 |
-
* @param bool $returnAsObjects (optional, defaults to true)
|
307 |
-
* @param bool $enableCache (optional, defaults to true)
|
308 |
-
* @return mixed $views
|
309 |
-
*/
|
310 |
-
static function getViews($slideshowId, $returnAsObjects = true, $enableCache = true)
|
311 |
-
{
|
312 |
-
// Get slides
|
313 |
-
$slides = self::getSlides($slideshowId, $enableCache);
|
314 |
-
|
315 |
-
// Get settings. Since in version 2.2.X slides aren't put into views yet, this has to be done manually
|
316 |
-
$settings = SlideshowPluginSlideshowSettingsHandler::getSettings($slideshowId, false, $enableCache);
|
317 |
-
$slidesPerView = 1;
|
318 |
-
|
319 |
-
if(isset($settings['slidesPerView']))
|
320 |
-
{
|
321 |
-
$slidesPerView = $settings['slidesPerView'];
|
322 |
-
}
|
323 |
-
|
324 |
-
// Loop through slides, forcing them into views
|
325 |
-
$i = 0;
|
326 |
-
$viewId = -1;
|
327 |
-
$views = array();
|
328 |
-
|
329 |
-
if (is_array($slides))
|
330 |
-
{
|
331 |
-
foreach ($slides as $slide)
|
332 |
-
{
|
333 |
-
// Create new view when view is full or not yet created
|
334 |
-
if ($i % $slidesPerView == 0)
|
335 |
-
{
|
336 |
-
$viewId++;
|
337 |
-
|
338 |
-
if ($returnAsObjects)
|
339 |
-
{
|
340 |
-
$views[$viewId] = new SlideshowPluginSlideshowView();
|
341 |
-
}
|
342 |
-
else
|
343 |
-
{
|
344 |
-
$views[$viewId] = array();
|
345 |
-
}
|
346 |
-
}
|
347 |
-
|
348 |
-
// Add slide to view
|
349 |
-
if ($returnAsObjects)
|
350 |
-
{
|
351 |
-
$views[$viewId]->addSlide($slide);
|
352 |
-
}
|
353 |
-
else
|
354 |
-
{
|
355 |
-
$views[$viewId][] = $slide;
|
356 |
-
}
|
357 |
-
|
358 |
-
$i++;
|
359 |
-
}
|
360 |
-
}
|
361 |
-
|
362 |
-
return $views;
|
363 |
}
|
364 |
|
365 |
/**
|
292 |
}
|
293 |
|
294 |
// Return
|
295 |
+
return array_values($slides);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
}
|
297 |
|
298 |
/**
|
classes/SlideshowPluginSlideshowSlide.php
DELETED
@@ -1,192 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* SlideshowPluginSlideshowSlide provides functions for outputting a slide for back-end as well as front-end display.
|
4 |
-
* It also provides all slide templates.
|
5 |
-
*
|
6 |
-
* Every slide needs to pass their slide type in the properties array. A slide type can be one of the following:
|
7 |
-
* - text
|
8 |
-
* - attachment
|
9 |
-
* - video
|
10 |
-
*
|
11 |
-
* A text slide can consist of the following properties:
|
12 |
-
* - title
|
13 |
-
* - titleElementTag
|
14 |
-
* - description
|
15 |
-
* - descriptionElementTag
|
16 |
-
* - textColor
|
17 |
-
* - color
|
18 |
-
* - url
|
19 |
-
* - urlTarget
|
20 |
-
* - noFollow
|
21 |
-
* - type (required)
|
22 |
-
*
|
23 |
-
* An attachment slide can consist of the following properties:
|
24 |
-
* - title
|
25 |
-
* - titleElementTag
|
26 |
-
* - description
|
27 |
-
* - descriptionElementTag
|
28 |
-
* - url
|
29 |
-
* - urlTarget
|
30 |
-
* - noFollow
|
31 |
-
* - alternativeText
|
32 |
-
* - type (required)
|
33 |
-
* - postId (required)
|
34 |
-
*
|
35 |
-
* A video slide can consist of the following properties:
|
36 |
-
* - videoId (required)
|
37 |
-
* - showRelatedVideos
|
38 |
-
* - type (required)
|
39 |
-
*
|
40 |
-
* @since 2.2.0
|
41 |
-
* @author Stefan Boonstra
|
42 |
-
*/
|
43 |
-
class SlideshowPluginSlideshowSlide
|
44 |
-
{
|
45 |
-
/** @var array $properties */
|
46 |
-
private $properties;
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Creates a slide object with the parsed properties. For information on how to build the properties array, view
|
50 |
-
* the class' description.
|
51 |
-
*
|
52 |
-
* @since 2.2.0
|
53 |
-
* @param array $properties
|
54 |
-
*/
|
55 |
-
function __construct($properties)
|
56 |
-
{
|
57 |
-
if (is_array($properties))
|
58 |
-
{
|
59 |
-
$this->properties = $properties;
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Build slide for front-end use.
|
65 |
-
*
|
66 |
-
* Returns when $return is true, prints when $return is false.
|
67 |
-
*
|
68 |
-
* @since 2.2.0
|
69 |
-
* @param boolean $return (optional, defaults to true)
|
70 |
-
* @return String $frontEndHTML
|
71 |
-
*/
|
72 |
-
function toFrontEndHTML($return = true)
|
73 |
-
{
|
74 |
-
// Exit when no slide type has been set or is empty
|
75 |
-
if (!isset($this->properties['type']) ||
|
76 |
-
empty($this->properties['type']))
|
77 |
-
{
|
78 |
-
return '';
|
79 |
-
}
|
80 |
-
|
81 |
-
$properties = $this->properties;
|
82 |
-
|
83 |
-
// Build file path
|
84 |
-
$file = SlideshowPluginMain::getPluginPath() . DIRECTORY_SEPARATOR .
|
85 |
-
'views' . DIRECTORY_SEPARATOR .
|
86 |
-
__CLASS__ . DIRECTORY_SEPARATOR .
|
87 |
-
'frontend_' . $this->properties['type'] . '.php';
|
88 |
-
|
89 |
-
// Include file path
|
90 |
-
if (!file_exists($file))
|
91 |
-
{
|
92 |
-
return '';
|
93 |
-
}
|
94 |
-
|
95 |
-
// Start output buffering if output needs to be returned
|
96 |
-
if ($return)
|
97 |
-
{
|
98 |
-
ob_start();
|
99 |
-
}
|
100 |
-
|
101 |
-
include $file;
|
102 |
-
|
103 |
-
// Return output
|
104 |
-
if ($return)
|
105 |
-
{
|
106 |
-
return ob_get_clean();
|
107 |
-
}
|
108 |
-
|
109 |
-
return '';
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Build slide for back-end use.
|
114 |
-
*
|
115 |
-
* Returns when $return is true, prints when $return is false.
|
116 |
-
*
|
117 |
-
* @since 2.2.0
|
118 |
-
* @param boolean $return (optional, defaults to true)
|
119 |
-
* @return String $backEndHTML
|
120 |
-
*/
|
121 |
-
function toBackEndHTML($return = true)
|
122 |
-
{
|
123 |
-
// Exit when no slide type has been set or is empty
|
124 |
-
if (!isset($this->properties['type']) ||
|
125 |
-
empty($this->properties['type']))
|
126 |
-
{
|
127 |
-
return '';
|
128 |
-
}
|
129 |
-
|
130 |
-
// Make properties array available to included file
|
131 |
-
$properties = $this->properties;
|
132 |
-
|
133 |
-
// The name is used to prefix a setting name with. Although the ID's are set on load, set a random one to be sure
|
134 |
-
$name = SlideshowPluginSlideshowSettingsHandler::$slidesKey . '[' . rand() . ']';
|
135 |
-
|
136 |
-
// Build file path
|
137 |
-
$file = SlideshowPluginMain::getPluginPath() . DIRECTORY_SEPARATOR .
|
138 |
-
'views' . DIRECTORY_SEPARATOR .
|
139 |
-
__CLASS__ . DIRECTORY_SEPARATOR .
|
140 |
-
'backend_' . $this->properties['type'] . '.php';
|
141 |
-
|
142 |
-
// Include file path
|
143 |
-
if (!file_exists($file))
|
144 |
-
{
|
145 |
-
return '';
|
146 |
-
}
|
147 |
-
|
148 |
-
// Start output buffering if output needs to be returned
|
149 |
-
if ($return)
|
150 |
-
{
|
151 |
-
ob_start();
|
152 |
-
}
|
153 |
-
|
154 |
-
include $file;
|
155 |
-
|
156 |
-
// Return output
|
157 |
-
if ($return)
|
158 |
-
{
|
159 |
-
return ob_get_clean();
|
160 |
-
}
|
161 |
-
|
162 |
-
return '';
|
163 |
-
}
|
164 |
-
|
165 |
-
/**
|
166 |
-
* Build templates for back-end slides.
|
167 |
-
*
|
168 |
-
* Returns when $return is true, prints when $return is false.
|
169 |
-
*
|
170 |
-
* @since 2.2.0
|
171 |
-
* @param boolean $return (optional, defaults to true)
|
172 |
-
* @return String $backEndTemplates
|
173 |
-
*/
|
174 |
-
static function getBackEndTemplates($return = true)
|
175 |
-
{
|
176 |
-
// Start output buffering if output needs to be returned
|
177 |
-
if ($return)
|
178 |
-
{
|
179 |
-
ob_start();
|
180 |
-
}
|
181 |
-
|
182 |
-
include SlideshowPluginMain::getPluginPath() . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . __CLASS__ . DIRECTORY_SEPARATOR . 'backend_templates.php';
|
183 |
-
|
184 |
-
// Return output
|
185 |
-
if($return)
|
186 |
-
{
|
187 |
-
return ob_get_clean();
|
188 |
-
}
|
189 |
-
|
190 |
-
return '';
|
191 |
-
}
|
192 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/SlideshowPluginSlideshowView.php
DELETED
@@ -1,110 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* SlideshowPluginSlideshowView provides functions for outputting a view with all its slides for back-end as well as
|
4 |
-
* front-end display.
|
5 |
-
*
|
6 |
-
* @since 2.2.0
|
7 |
-
* @author Stefan Boonstra
|
8 |
-
*/
|
9 |
-
class SlideshowPluginSlideshowView
|
10 |
-
{
|
11 |
-
/** @var SlideshowPluginSlideshowSlide $slides */
|
12 |
-
private $slides = array();
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Pass an array of slideProperties to create slides from.
|
16 |
-
*
|
17 |
-
* See SlideshowPluginSlideshowSlide's class description for the properties needed to build a slide.
|
18 |
-
*
|
19 |
-
* @since 2.2.0
|
20 |
-
* @param array $slidesProperties (optional)
|
21 |
-
*/
|
22 |
-
function __construct($slidesProperties = array())
|
23 |
-
{
|
24 |
-
if (is_array($slidesProperties))
|
25 |
-
{
|
26 |
-
foreach ($slidesProperties as $slideProperties)
|
27 |
-
{
|
28 |
-
$this->slides[] = new SlideshowPluginSlideshowSlide($slideProperties);
|
29 |
-
}
|
30 |
-
}
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Creates a new slide object and adds it to the view.
|
35 |
-
*
|
36 |
-
* See SlideshowPluginSlideshowSlide's class description for the properties needed to build a slide.
|
37 |
-
*
|
38 |
-
* @since 2.2.0
|
39 |
-
* @param array $slideProperties
|
40 |
-
*/
|
41 |
-
function addSlide($slideProperties)
|
42 |
-
{
|
43 |
-
if (is_array($slideProperties))
|
44 |
-
{
|
45 |
-
$this->slides[] = new SlideshowPluginSlideshowSlide($slideProperties);
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Build view for front-end use.
|
51 |
-
*
|
52 |
-
* Returns when $return is true, prints when $return is false.
|
53 |
-
*
|
54 |
-
* @since 2.2.0
|
55 |
-
* @param boolean $return (optional, defaults to true)
|
56 |
-
* @return String $frontEndHTML
|
57 |
-
*/
|
58 |
-
function toFrontEndHTML($return = true)
|
59 |
-
{
|
60 |
-
$frontEndHTML = '<div class="slideshow_view">';
|
61 |
-
|
62 |
-
foreach ($this->slides as $slide)
|
63 |
-
{
|
64 |
-
$frontEndHTML .= $slide->toFrontEndHTML();
|
65 |
-
}
|
66 |
-
|
67 |
-
$frontEndHTML .= '<div style="clear: both;"></div></div>';
|
68 |
-
|
69 |
-
if ($return)
|
70 |
-
{
|
71 |
-
return $frontEndHTML;
|
72 |
-
}
|
73 |
-
|
74 |
-
echo $frontEndHTML;
|
75 |
-
|
76 |
-
return "";
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Build view for back-end use.
|
81 |
-
*
|
82 |
-
* Returns when $return is true, prints when $return is false.
|
83 |
-
*
|
84 |
-
* @since 2.2.0
|
85 |
-
* @param boolean $return (optional, defaults to true)
|
86 |
-
* @return String $backEndHTML
|
87 |
-
*/
|
88 |
-
function toBackEndHTML($return = true)
|
89 |
-
{
|
90 |
-
$backEndHTML = '';
|
91 |
-
foreach ($this->slides as $slide)
|
92 |
-
{
|
93 |
-
if (!($slide instanceof SlideshowPluginSlideshowSlide))
|
94 |
-
{
|
95 |
-
continue;
|
96 |
-
}
|
97 |
-
|
98 |
-
$backEndHTML .= $slide->toBackEndHTML();
|
99 |
-
}
|
100 |
-
|
101 |
-
if ($return)
|
102 |
-
{
|
103 |
-
return $backEndHTML;
|
104 |
-
}
|
105 |
-
|
106 |
-
echo $backEndHTML;
|
107 |
-
|
108 |
-
return "";
|
109 |
-
}
|
110 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/SlideshowPluginWidget.php
CHANGED
@@ -107,8 +107,13 @@ class SlideshowPluginWidget extends WP_Widget
|
|
107 |
'post_type' => SlideshowPluginPostType::$postType
|
108 |
));
|
109 |
|
|
|
|
|
|
|
|
|
|
|
110 |
// Include form
|
111 |
-
|
112 |
}
|
113 |
|
114 |
/**
|
107 |
'post_type' => SlideshowPluginPostType::$postType
|
108 |
));
|
109 |
|
110 |
+
$data = new stdClass();
|
111 |
+
$data->widget = $this;
|
112 |
+
$data->instance = $instance;
|
113 |
+
$data->slideshows = $slideshows;
|
114 |
+
|
115 |
// Include form
|
116 |
+
SlideshowPluginMain::outputView(__CLASS__ . DIRECTORY_SEPARATOR . 'form.php', $data);
|
117 |
}
|
118 |
|
119 |
/**
|
css/all.backend.css
CHANGED
@@ -53,44 +53,6 @@
|
|
53 |
.sortable-slides-list .sortable-slides-list-item div.inside.widefat {
|
54 |
border-color: #dfdfdf;
|
55 |
}
|
56 |
-
#slideshow-slide-inserter-popup-background {
|
57 |
-
background: #000;
|
58 |
-
display: none;
|
59 |
-
position: absolute;
|
60 |
-
top: 0;
|
61 |
-
left: 0;
|
62 |
-
width: 100%;
|
63 |
-
z-index: 10000;
|
64 |
-
zoom: 1;
|
65 |
-
filter: alpha(opacity = 50);
|
66 |
-
opacity: 0.5;
|
67 |
-
}
|
68 |
-
#slideshow-slide-inserter-popup {
|
69 |
-
background: #fff;
|
70 |
-
display: none;
|
71 |
-
position: absolute;
|
72 |
-
padding: 20px;
|
73 |
-
line-height: 23px;
|
74 |
-
z-index: 10001;
|
75 |
-
width: 600px;
|
76 |
-
}
|
77 |
-
#slideshow-slide-inserter-popup #search {
|
78 |
-
float: left;
|
79 |
-
width: 200px;
|
80 |
-
}
|
81 |
-
#slideshow-slide-inserter-popup #close {
|
82 |
-
float: right;
|
83 |
-
width: 32px;
|
84 |
-
height: 32px;
|
85 |
-
background: url('../images/SlideshowPluginSlideInserter/close.png') no-repeat;
|
86 |
-
}
|
87 |
-
#slideshow-slide-inserter-popup #close:hover {
|
88 |
-
cursor: pointer;
|
89 |
-
}
|
90 |
-
#slideshow-slide-inserter-popup #search-results {
|
91 |
-
height: 400px;
|
92 |
-
overflow-y: scroll;
|
93 |
-
}
|
94 |
.feature-filter {
|
95 |
padding: 0 10px 10px;
|
96 |
margin: 10px;
|
53 |
.sortable-slides-list .sortable-slides-list-item div.inside.widefat {
|
54 |
border-color: #dfdfdf;
|
55 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
.feature-filter {
|
57 |
padding: 0 10px 10px;
|
58 |
margin: 10px;
|
images/SlideshowPluginSlideInserter/close.png
DELETED
Binary file
|
js/min/all.backend.min.js
CHANGED
@@ -3,5 +3,5 @@ slideshow_jquery_image_gallery_backend_script.generalSettings=function(){var e=j
|
|
3 |
slideshow_jquery_image_gallery_backend_script.generalSettings.customStyles=function(){var e=jQuery,t={};return t.init=function(){slideshow_jquery_image_gallery_backend_script.generalSettings.isCurrentPage&&t.activateNavigation()},t.activateNavigation=function(){e(".nav-tab").click(function(t){var a,i=e(t.currentTarget),r=e(".nav-tab-active");r.removeClass("nav-tab-active"),i.addClass("nav-tab-active"),e(r.attr("href").replace("#",".")).hide(),e(i.attr("href").replace("#",".")).show(),a=e("input[name=_wp_http_referer]"),a.attr("value",a.attr("value").split("#").shift()+i.attr("href"))}),e('a[href="#'+document.URL.split("#").pop()+'"]').trigger("click")},e(document).bind("slideshowBackendReady",t.init),t}();
|
4 |
slideshow_jquery_image_gallery_backend_script.generalSettings.customStyles=function(){var t=jQuery,e={};return e.init=function(){slideshow_jquery_image_gallery_backend_script.generalSettings.isCurrentPage&&(e.activateActionButtons(),e.activateDeleteButtons())},e.activateActionButtons=function(){t(".custom-styles-tab .styles-list .style-action.style-default").click(function(s){var l,i,o,n,a,c=t(s.currentTarget),y=c.closest("li").find(".style-title").html(),u=c.closest("li").find(".style-content").html(),r=window.slideshow_jquery_image_gallery_backend_script_generalSettings,m="slideshow-jquery-image-gallery-custom-styles";"string"!=typeof u||u.length<=0||("object"==typeof r&&("object"==typeof r.localization&&void 0!==r.localization.newCustomizationPrefix&&r.localization.newCustomizationPrefix.length>0&&(y=r.localization.newCustomizationPrefix+" - "+y),"object"==typeof r.data&&void 0!==r.data.customStylesKey&&r.data.customStylesKey.length>0&&(m=r.data.customStylesKey)),l=m+"_"+(e.getHighestCustomStyleID()+1),n=t(".custom-styles-tab .custom-style-templates"),i=n.find(".style-editor").clone(),i.addClass(l),i.find(".new-custom-style-title").attr("value",y),i.find(".new-custom-style-content").html(u),i.find(".new-custom-style-title").attr("name",m+"["+l+"][title]"),i.find(".new-custom-style-content").attr("name",m+"["+l+"][style]"),t(".custom-styles-tab .style-editors").append(i),setTimeout(function(){i.fadeIn(200)},200),o=n.find(".custom-styles-list-item").clone(!0),o.removeClass("custom-styles-list-item"),o.find(".style-title").html(y),o.find(".style-action").addClass(l),o.find(".style-delete").addClass(l),a=t(".custom-styles-tab .styles-list .custom-styles-list"),a.find(".no-custom-styles-found").remove(),a.append(o))}),t(".custom-styles-tab .styles-list .style-action, .custom-styles-tab .custom-style-templates .custom-styles-list-item .style-action").click(function(e){var s=t(e.currentTarget).attr("class").split(" ")[1];void 0!==s&&(t(".custom-styles-tab .style-editors .style-editor").each(function(e,s){t(s).fadeOut(200)}),setTimeout(function(){t(".style-editor."+s).fadeIn(200)},200))})},e.activateDeleteButtons=function(){t(".custom-styles-tab .styles-list .style-delete, .custom-styles-tab .custom-style-templates .custom-styles-list-item .style-delete").click(function(e){var s=t(e.currentTarget),l=s.attr("class").split(" ")[1],i=window.slideshow_jquery_image_gallery_backend_script_generalSettings,o="Are you sure you want to delete this custom style?";void 0!==l&&("object"==typeof i&&"object"==typeof i.localization&&void 0!==i.localization.confirmDeleteMessage&&i.localization.confirmDeleteMessage.length>0&&(o=i.localization.confirmDeleteMessage),confirm(o)&&(t(".custom-styles-tab .style-editors .style-editor."+l).remove(),s.closest("li").remove()))})},e.getHighestCustomStyleID=function(){var e=0;return t(".custom-styles-tab .style-editors .style-editor").each(function(s,l){var i=parseInt(t(l).attr("class").split("_").pop(),10);i>e&&(e=i)}),parseInt(e,10)},t(document).bind("slideshowBackendReady",e.init),e}();
|
5 |
slideshow_jquery_image_gallery_backend_script.editSlideshow=function(){var i=jQuery,e={};return e.isCurrentPage=!1,e.init=function(){"slideshow"===window.pagenow&&(e.isCurrentPage=!0,e.activateSettingsVisibilityDependency())},e.activateSettingsVisibilityDependency=function(){i(".depends-on-field-value").each(function(t,n){var s=i(n),a=s.attr("class").split(" "),o=s.closest("tr");i('input[name="'+a[1]+'"]:checked').val()==a[2]?o.show():o.hide(),i('input[name="'+a[1]+'"]').change(a,function(t){var n=i("."+a[3]).closest("tr");i(t.currentTarget).val()==a[2]?e.animateElementVisibility(n,!0):e.animateElementVisibility(n,!1)})})},e.animateElementVisibility=function(e,t){var n=i(e);void 0===t&&(n.stop(!0,!0),t=!n.is(":visible")),t?(n.stop(!0,!0).show().css("background-color","#c0dd52"),setTimeout(function(){n.stop(!0,!0).animate({"background-color":"transparent"},1500)},500)):(n.stop(!0,!0).css("background-color","#d44f6e"),setTimeout(function(){n.stop(!0,!0).hide(1500,function(){n.css("background-color","transparent")})},500))},i(document).bind("slideshowBackendReady",e.init),e}();
|
6 |
-
slideshow_jquery_image_gallery_backend_script.editSlideshow.slideManager=function(){var e=jQuery,
|
7 |
slideshow_jquery_image_gallery_backend_script.shortcode=function(){var e=jQuery,o={};return o.init=function(){o.activateShortcodeInserter()},o.activateShortcodeInserter=function(){e(".insertSlideshowShortcodeSlideshowInsertButton").click(function(){var o="No slideshow selected.",t="slideshow_deploy",i=parseInt(e("#insertSlideshowShortcodeSlideshowSelect").val(),10),d=window.slideshow_jquery_image_gallery_backend_script_shortcode;return"object"==typeof d&&("object"==typeof d.data&&void 0!==d.data.shortcode&&d.data.shortcode.length>0&&(t=d.data.shortcode),"object"==typeof d.localization&&void 0!==d.localization.undefinedSlideshow&&d.localization.undefinedSlideshow.length>0&&(o=d.localization.undefinedSlideshow)),isNaN(i)?(alert(o),!1):(send_to_editor("["+t+" id='"+i+"']"),tb_remove(),!0)}),e(".insertSlideshowShortcodeCancelButton").click(function(){return tb_remove(),!1})},e(document).bind("slideshowBackendReady",o.init),o}();
|
3 |
slideshow_jquery_image_gallery_backend_script.generalSettings.customStyles=function(){var e=jQuery,t={};return t.init=function(){slideshow_jquery_image_gallery_backend_script.generalSettings.isCurrentPage&&t.activateNavigation()},t.activateNavigation=function(){e(".nav-tab").click(function(t){var a,i=e(t.currentTarget),r=e(".nav-tab-active");r.removeClass("nav-tab-active"),i.addClass("nav-tab-active"),e(r.attr("href").replace("#",".")).hide(),e(i.attr("href").replace("#",".")).show(),a=e("input[name=_wp_http_referer]"),a.attr("value",a.attr("value").split("#").shift()+i.attr("href"))}),e('a[href="#'+document.URL.split("#").pop()+'"]').trigger("click")},e(document).bind("slideshowBackendReady",t.init),t}();
|
4 |
slideshow_jquery_image_gallery_backend_script.generalSettings.customStyles=function(){var t=jQuery,e={};return e.init=function(){slideshow_jquery_image_gallery_backend_script.generalSettings.isCurrentPage&&(e.activateActionButtons(),e.activateDeleteButtons())},e.activateActionButtons=function(){t(".custom-styles-tab .styles-list .style-action.style-default").click(function(s){var l,i,o,n,a,c=t(s.currentTarget),y=c.closest("li").find(".style-title").html(),u=c.closest("li").find(".style-content").html(),r=window.slideshow_jquery_image_gallery_backend_script_generalSettings,m="slideshow-jquery-image-gallery-custom-styles";"string"!=typeof u||u.length<=0||("object"==typeof r&&("object"==typeof r.localization&&void 0!==r.localization.newCustomizationPrefix&&r.localization.newCustomizationPrefix.length>0&&(y=r.localization.newCustomizationPrefix+" - "+y),"object"==typeof r.data&&void 0!==r.data.customStylesKey&&r.data.customStylesKey.length>0&&(m=r.data.customStylesKey)),l=m+"_"+(e.getHighestCustomStyleID()+1),n=t(".custom-styles-tab .custom-style-templates"),i=n.find(".style-editor").clone(),i.addClass(l),i.find(".new-custom-style-title").attr("value",y),i.find(".new-custom-style-content").html(u),i.find(".new-custom-style-title").attr("name",m+"["+l+"][title]"),i.find(".new-custom-style-content").attr("name",m+"["+l+"][style]"),t(".custom-styles-tab .style-editors").append(i),setTimeout(function(){i.fadeIn(200)},200),o=n.find(".custom-styles-list-item").clone(!0),o.removeClass("custom-styles-list-item"),o.find(".style-title").html(y),o.find(".style-action").addClass(l),o.find(".style-delete").addClass(l),a=t(".custom-styles-tab .styles-list .custom-styles-list"),a.find(".no-custom-styles-found").remove(),a.append(o))}),t(".custom-styles-tab .styles-list .style-action, .custom-styles-tab .custom-style-templates .custom-styles-list-item .style-action").click(function(e){var s=t(e.currentTarget).attr("class").split(" ")[1];void 0!==s&&(t(".custom-styles-tab .style-editors .style-editor").each(function(e,s){t(s).fadeOut(200)}),setTimeout(function(){t(".style-editor."+s).fadeIn(200)},200))})},e.activateDeleteButtons=function(){t(".custom-styles-tab .styles-list .style-delete, .custom-styles-tab .custom-style-templates .custom-styles-list-item .style-delete").click(function(e){var s=t(e.currentTarget),l=s.attr("class").split(" ")[1],i=window.slideshow_jquery_image_gallery_backend_script_generalSettings,o="Are you sure you want to delete this custom style?";void 0!==l&&("object"==typeof i&&"object"==typeof i.localization&&void 0!==i.localization.confirmDeleteMessage&&i.localization.confirmDeleteMessage.length>0&&(o=i.localization.confirmDeleteMessage),confirm(o)&&(t(".custom-styles-tab .style-editors .style-editor."+l).remove(),s.closest("li").remove()))})},e.getHighestCustomStyleID=function(){var e=0;return t(".custom-styles-tab .style-editors .style-editor").each(function(s,l){var i=parseInt(t(l).attr("class").split("_").pop(),10);i>e&&(e=i)}),parseInt(e,10)},t(document).bind("slideshowBackendReady",e.init),e}();
|
5 |
slideshow_jquery_image_gallery_backend_script.editSlideshow=function(){var i=jQuery,e={};return e.isCurrentPage=!1,e.init=function(){"slideshow"===window.pagenow&&(e.isCurrentPage=!0,e.activateSettingsVisibilityDependency())},e.activateSettingsVisibilityDependency=function(){i(".depends-on-field-value").each(function(t,n){var s=i(n),a=s.attr("class").split(" "),o=s.closest("tr");i('input[name="'+a[1]+'"]:checked').val()==a[2]?o.show():o.hide(),i('input[name="'+a[1]+'"]').change(a,function(t){var n=i("."+a[3]).closest("tr");i(t.currentTarget).val()==a[2]?e.animateElementVisibility(n,!0):e.animateElementVisibility(n,!1)})})},e.animateElementVisibility=function(e,t){var n=i(e);void 0===t&&(n.stop(!0,!0),t=!n.is(":visible")),t?(n.stop(!0,!0).show().css("background-color","#c0dd52"),setTimeout(function(){n.stop(!0,!0).animate({"background-color":"transparent"},1500)},500)):(n.stop(!0,!0).css("background-color","#d44f6e"),setTimeout(function(){n.stop(!0,!0).hide(1500,function(){n.css("background-color","transparent")})},500))},i(document).bind("slideshowBackendReady",e.init),e}();
|
6 |
+
slideshow_jquery_image_gallery_backend_script.editSlideshow.slideManager=function(){var e=jQuery,i={};return i.uploader=null,i.init=function(){slideshow_jquery_image_gallery_backend_script.editSlideshow.isCurrentPage&&i.activate()},i.activate=function(){i.indexSlidesOrder(),e(".sortable-slides-list").sortable({revert:!0,placeholder:"sortable-placeholder",forcePlaceholderSize:!0,stop:function(){i.indexSlidesOrder()},cancel:"input, select, textarea"}),e(".wp-color-picker-field").wpColorPicker({width:234}),e(".open-slides-button").on("click",function(i){i.preventDefault(),e(".sortable-slides-list .sortable-slides-list-item").each(function(i,t){var l=e(t);l.find(".inside").is(":visible")||l.find(".handlediv").trigger("click")})}),e(".close-slides-button").on("click",function(i){i.preventDefault(),e(".sortable-slides-list .sortable-slides-list-item").each(function(i,t){var l=e(t);l.find(".inside").is(":visible")&&l.find(".handlediv").trigger("click")})}),e("#slideshow-insert-text-slide").on("click",i.insertTextSlide),e("#slideshow-insert-video-slide").on("click",i.insertVideoSlide),e(".slideshow-insert-image-slide").on("click",i.mediaUploader),e(".slideshow-delete-slide").on("click",function(t){i.deleteSlide(e(t.currentTarget).closest(".sortable-slides-list-item"))})},i.deleteSlide=function(e){var i="Are you sure you want to delete this slide?",t=window.slideshow_jquery_image_gallery_backend_script_editSlideshow;"object"==typeof t&&"object"==typeof t.localization&&void 0!==t.localization.confirm&&t.localization.confirm.length>0&&(i=t.localization.confirm),confirm(i)&&e.remove()},i.indexSlidesOrder=function(){e(".sortable-slides-list .sortable-slides-list-item").each(function(i,t){e.each(e(t).find("input, select, textarea"),function(t,l){var d=e(l),n=d.attr("name");void 0===n||n.length<=0||(n=n.replace(/[\[\]']+/g," ").split(" "),d.attr("name",n[0]+"["+(i+1)+"]["+n[2]+"]"))})})},i.mediaUploader=function(e){e.preventDefault();var t,l;return i.uploader?(i.uploader.open(),void 0):(l=window.slideshow_jquery_image_gallery_backend_script_editSlideshow,t="","object"==typeof l&&"object"==typeof l.localization&&void 0!==l.localization.uploaderTitle&&l.localization.uploaderTitle.length>0&&(t=l.localization.uploaderTitle),i.uploader=wp.media.frames.slideshow_jquery_image_galler_uploader=wp.media({frame:"select",title:t,multiple:!0,library:{type:"image"}}),i.uploader.on("select",function(){var e,t,l=i.uploader.state().get("selection").toJSON();for(t in l)l.hasOwnProperty(t)&&(e=l[t],i.insertImageSlide(e.id,e.title,e.description,e.url,e.alt))}),i.uploader.open(),void 0)},i.insertImageSlide=function(t,l,d,n,a){var s=e(".image-slide-template").find(".sortable-slides-list-item").clone(!0,!0);s.find(".attachment").attr("src",n),s.find(".attachment").attr("title",l),s.find(".attachment").attr("alt",a),s.find(".title").attr("value",l),s.find(".description").html(d),s.find(".alternativeText").attr("value",a),s.find(".postId").attr("value",t),s.find(".title").attr("name","slides[0][title]"),s.find(".titleElementTagID").attr("name","slides[0][titleElementTagID]"),s.find(".description").attr("name","slides[0][description]"),s.find(".descriptionElementTagID").attr("name","slides[0][descriptionElementTagID]"),s.find(".url").attr("name","slides[0][url]"),s.find(".urlTarget").attr("name","slides[0][urlTarget]"),s.find(".alternativeText").attr("name","slides[0][alternativeText]"),s.find(".noFollow").attr("name","slides[0][noFollow]"),s.find(".type").attr("name","slides[0][type]"),s.find(".postId").attr("name","slides[0][postId]"),e(".sortable-slides-list").prepend(s),i.indexSlidesOrder()},i.insertTextSlide=function(){var t=e(".text-slide-template").find(".sortable-slides-list-item").clone(!0,!0);t.find(".title").attr("name","slides[0][title]"),t.find(".titleElementTagID").attr("name","slides[0][titleElementTagID]"),t.find(".description").attr("name","slides[0][description]"),t.find(".descriptionElementTagID").attr("name","slides[0][descriptionElementTagID]"),t.find(".textColor").attr("name","slides[0][textColor]"),t.find(".color").attr("name","slides[0][color]"),t.find(".url").attr("name","slides[0][url]"),t.find(".urlTarget").attr("name","slides[0][urlTarget]"),t.find(".noFollow").attr("name","slides[0][noFollow]"),t.find(".type").attr("name","slides[0][type]"),t.find(".color, .textColor").wpColorPicker(),e(".sortable-slides-list").prepend(t),i.indexSlidesOrder()},i.insertVideoSlide=function(){var t=e(".video-slide-template").find(".sortable-slides-list-item").clone(!0,!0);t.find(".videoId").attr("name","slides[0][videoId]"),t.find(".showRelatedVideos").attr("name","slides[0][showRelatedVideos]"),t.find(".type").attr("name","slides[0][type]"),e(".sortable-slides-list").prepend(t),i.indexSlidesOrder()},e(document).bind("slideshowBackendReady",i.init),i}();
|
7 |
slideshow_jquery_image_gallery_backend_script.shortcode=function(){var e=jQuery,o={};return o.init=function(){o.activateShortcodeInserter()},o.activateShortcodeInserter=function(){e(".insertSlideshowShortcodeSlideshowInsertButton").click(function(){var o="No slideshow selected.",t="slideshow_deploy",i=parseInt(e("#insertSlideshowShortcodeSlideshowSelect").val(),10),d=window.slideshow_jquery_image_gallery_backend_script_shortcode;return"object"==typeof d&&("object"==typeof d.data&&void 0!==d.data.shortcode&&d.data.shortcode.length>0&&(t=d.data.shortcode),"object"==typeof d.localization&&void 0!==d.localization.undefinedSlideshow&&d.localization.undefinedSlideshow.length>0&&(o=d.localization.undefinedSlideshow)),isNaN(i)?(alert(o),!1):(send_to_editor("["+t+" id='"+i+"']"),tb_remove(),!0)}),e(".insertSlideshowShortcodeCancelButton").click(function(){return tb_remove(),!1})},e(document).bind("slideshowBackendReady",o.init),o}();
|
js/min/all.frontend.min.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
function onYouTubeIframeAPIReady(){slideshow_jquery_image_gallery_script.youTubeAPIReady=!0}slideshow_jquery_image_gallery_backend_script_scriptsloadedFlag=!1,slideshow_jquery_image_gallery_script=function(){var e=jQuery,i={};return i.slideshowInstances={},i.initialized=!1,i.youTubeAPIReady=!1,i.init=function(){slideshow_jquery_image_gallery_backend_script_scriptsloadedFlag!==!0||i.initialized||(i.initialized=!0,e(document).trigger("slideshow_jquery_image_gallery_script_ready"),i.
|
2 |
|
3 |
-
!function(){var i=jQuery,t=slideshow_jquery_image_gallery_script;t.Slideshow=function(s){if(s instanceof i&&(this.$container=s,this.$content=this.$container.find(".slideshow_content"),this.$views=this.$container.find(".slideshow_view"),this.$slides=this.$container.find(".slideshow_slide"),this.$controlPanel=this.$container.find(".slideshow_controlPanel"),this.$togglePlayButton=this.$controlPanel.find(".slideshow_togglePlay"),this.$nextButton=this.$container.find(".slideshow_next"),this.$previousButton=this.$container.find(".slideshow_previous"),this.$pagination=this.$container.find(".slideshow_pagination"),this.$loadingIcon=this.$container.find(".slideshow_loading_icon"),this.ID=this.getSlideshowID(),!isNaN(parseInt(this.ID,10)))){if(this.settings=window["SlideshowPluginSettings_"+this.ID],!this.settings)return t.log("Slideshow (ID: "+this.ID+") could not find its settings."),void 0
|
4 |
-
!function(){var t=jQuery,i=slideshow_jquery_image_gallery_script;i.Slideshow.prototype.start=function(){this.activateDescriptions(),this.activateControlPanel(),this.activateNavigationButtons(),this.activatePagination(),this.activatePauseOnHover(),this.$loadingIcon.length>0&&this.$loadingIcon.remove(),this.$content.show(),this.recalculateViews(),this.settings.enableResponsiveness&&t(window).resize(t.proxy(function(){this.recalculate(!0)},this)),this.playState=this.PlayStates.PAUSED,this.$container.trigger("slideshowPlayStateChange",[this.playState]),this.settings.play&&this.play()},i.Slideshow.prototype.play=function(){this.interval||(this.playState=this.PlayStates.PLAYING,this.$container.trigger("slideshowPlayStateChange",[this.playState]),this.interval=setInterval(t.proxy(function i(e,s){void 0===s&&(s=this),void 0===e&&(e=s.getNextViewID()),s.isViewLoaded(e)?(s.animateTo(e,1),s.play()):(s.pause(this.PlayStates.TEMPORARILY_PAUSED),setTimeout(t.proxy(function(){i(e,s)},s),100))},this),1e3*this.settings.intervalSpeed))},i.Slideshow.prototype.pause=function(t){clearInterval(this.interval),this.interval=!1,t!==this.PlayStates.PAUSED&&t!==this.PlayStates.TEMPORARILY_PAUSED&&(t=this.PlayStates.PAUSED),this.playState=t,this.$container.trigger("slideshowPlayStateChange",[this.playState])},i.Slideshow.prototype.next=function(){this.playState===this.PlayStates.PLAYING&&(this.pause(this.PlayStates.TEMPORARILY_PAUSED),this.play()),this.animateTo(this.getNextViewID(),1)},i.Slideshow.prototype.previous=function(){this.playState===this.PlayStates.PLAYING&&(this.pause(this.PlayStates.TEMPORARILY_PAUSED),this.play()),this.animateTo(this.getPreviousViewID(),-1)},i.Slideshow.prototype.isVideoPlaying=function(){for(var t in this.videoPlayers)if(this.videoPlayers.hasOwnProperty(t)){var i=this.videoPlayers[t].state;if(1==i||3==i)return!0}return!1},i.Slideshow.prototype.pauseAllVideos=function(){for(var t in this.videoPlayers)if(this.videoPlayers.hasOwnProperty(t)){var i=this.videoPlayers[t].player;null!=i&&"function"==typeof i.pauseVideo&&(this.videoPlayers[t].state=2,i.pauseVideo())}},i.Slideshow.prototype.isViewLoaded=function(i){var e=!0;return isNaN(parseInt(i,10))?!1:(t.each(this.viewData[i],t.proxy(function(t,i){0==i.loaded&&(e=!1)},this)),e)},i.Slideshow.prototype.getNaturalImageSize=function(i,e,s){return i.length<=0||!(i instanceof t)||"string"!=typeof i.attr("src")?(e(-1,-1,s),void 0):(this.onImageLoad(i,t.proxy(function(t,i){e(i.width,i.height,s)},this)),void 0)},i.Slideshow.prototype.onImageLoad=function(i,e,s){var a=new Image;return i.length<=0||!(i instanceof t)||"string"!=typeof i.attr("src")?(e(!1,a,s),void 0):(a.onload=t.proxy(function(){e(!0,a,s)},this),a.src=i.attr("src"),void 0)},i.Slideshow.prototype.getNextViewID=function(){var t=this.currentViewID;if(this.settings.random){var i=t;if(t=this.getNextRandomViewID(),t!=i)return t}return isNaN(parseInt(t,10))?0:t>=this.$views.length-1?this.settings.loop?0:this.currentViewID:t+1},i.Slideshow.prototype.getPreviousViewID=function(){var t=this.currentViewID;if(isNaN(parseInt(t,10))&&(t=0),this.settings.random){var i=t;if(t=this.getPreviousRandomViewID(),t!=i)return t}return 0>=t?this.settings.loop?t=this.$views.length-1:this.currentViewID:t-=1},i.Slideshow.prototype.getNextRandomViewID=function(){if(isNaN(parseInt(this.currentViewID,10))||this.randomPreviousHistoryViewIDs.push(this.currentViewID),this.randomPreviousHistoryViewIDs.length>2*this.viewIDs.length&&this.randomPreviousHistoryViewIDs.shift(),this.randomNextHistoryViewIDs.length>0)return this.randomNextHistoryViewIDs.pop();if(void 0===this.randomAvailableViewIDs||this.randomAvailableViewIDs.length<=0){this.randomAvailableViewIDs=t.extend(!0,[],this.viewIDs);var i=t.inArray(this.currentViewID,this.randomAvailableViewIDs);i>=0&&this.randomAvailableViewIDs.splice(i,1)}return this.randomAvailableViewIDs.splice(Math.floor(Math.random()*this.randomAvailableViewIDs.length),1).pop()},i.Slideshow.prototype.getPreviousRandomViewID=function(){return isNaN(parseInt(this.currentViewID,10))||this.randomNextHistoryViewIDs.push(this.currentViewID),this.randomNextHistoryViewIDs.length>2*this.viewIDs.length&&this.randomNextHistoryViewIDs.shift(),this.randomPreviousHistoryViewIDs.length>0?this.randomPreviousHistoryViewIDs.pop():this.viewIDs[Math.floor(Math.random()*this.viewIDs.length)]},i.Slideshow.prototype.getSlideshowID=function(){var t=this.$container.data("slideshowId");return isNaN(parseInt(t,10))&&(t=this.$container.attr("data-slideshow-id")),t},i.Slideshow.prototype.bindSubmitListener=function(i){i.keypress(t.proxy(function(i){var e=i.keyCode||i.which;13===e&&(i.preventDefault(),t(i.currentTarget).click())},this))}}();
|
5 |
!function(){var e=jQuery,t=slideshow_jquery_image_gallery_script;t.Slideshow.prototype.animateTo=function(t,s){if(!(this.isVideoPlaying()||0>t||t>=this.$views.length||t==this.currentViewID)){if(this.currentlyAnimating===!0)return this.$container.one("slideshowAnimationEnd",e.proxy(function(){this.playState===this.PlayStates.PLAYING&&(this.pause(this.PlayStates.TEMPORARILY_PAUSED),this.play()),this.animateTo(t,s)},this)),void 0;this.currentlyAnimating=!0,(isNaN(parseInt(s,10))||0==s)&&(s=t<this.currentViewID?-1:1),this.visibleViews=[this.currentViewID,t];var i=this.settings.animation,n=["slide","slideRight","slideUp","slideDown","fade","directFade"];"random"==i&&(i=n[Math.floor(Math.random()*n.length)]);var o={slide:"slideRight",slideRight:"slide",slideUp:"slideDown",slideDown:"slideUp",fade:"fade",directFade:"directFade",crossFade:"crossFade"};0>s&&(i=o[i]);var d=e(this.$views[this.currentViewID]),a=e(this.$views[t]);switch(d.stop(!0,!0),a.stop(!0,!0),a.addClass("slideshow_nextView"),this.recalculateVisibleViews(),this.currentViewID=t,this.$container.trigger("slideshowAnimationStart",[t,i,s]),i){case"slide":a.css({top:0,left:this.$content.width()}),d.animate({left:-d.outerWidth(!0)},1e3*this.settings.slideSpeed),a.animate({left:0},1e3*this.settings.slideSpeed),setTimeout(e.proxy(function(){d.stop(!0,!0).css("top",this.$container.outerHeight(!0))},this),1e3*this.settings.slideSpeed);break;case"slideRight":a.css({top:0,left:-this.$content.width()}),d.animate({left:d.outerWidth(!0)},1e3*this.settings.slideSpeed),a.animate({left:0},1e3*this.settings.slideSpeed),setTimeout(e.proxy(function(){d.stop(!0,!0).css("top",this.$container.outerHeight(!0))},this),1e3*this.settings.slideSpeed);break;case"slideUp":a.css({top:this.$content.height(),left:0}),d.animate({top:-d.outerHeight(!0)},1e3*this.settings.slideSpeed),a.animate({top:0},1e3*this.settings.slideSpeed),setTimeout(e.proxy(function(){d.stop(!0,!0).css("top",this.$container.outerHeight(!0))},this),1e3*this.settings.slideSpeed);break;case"slideDown":a.css({top:-this.$content.height(),left:0}),d.animate({top:d.outerHeight(!0)},1e3*this.settings.slideSpeed),a.animate({top:0},1e3*this.settings.slideSpeed),setTimeout(e.proxy(function(){d.stop(!0,!0).css("top",this.$container.outerHeight(!0))},this),1e3*this.settings.slideSpeed);break;case"fade":a.css({top:0,left:0,display:"none"}),d.fadeOut(1e3*this.settings.slideSpeed/2),setTimeout(e.proxy(function(){a.fadeIn(1e3*this.settings.slideSpeed/2),d.stop(!0,!0).css({top:this.$container.outerHeight(!0),display:"block"})},this),1e3*this.settings.slideSpeed/2);break;case"directFade":a.css({top:0,left:0,"z-index":0,display:"none"}),d.css({"z-index":1}),a.stop(!0,!0).fadeIn(1e3*this.settings.slideSpeed),d.stop(!0,!0).fadeOut(1e3*this.settings.slideSpeed),setTimeout(e.proxy(function(){a.stop(!0,!0).css({"z-index":0}),d.stop(!0,!0).css({top:this.$container.outerHeight(!0),display:"block","z-index":0})},this),1e3*this.settings.slideSpeed);break;case"crossFade":a.css({top:0,left:0,"z-index":1,display:"none"}),d.css({"z-index":0}),a.stop(!0,!0).fadeIn(1e3*this.settings.slideSpeed),setTimeout(e.proxy(function(){d.css({top:this.$container.outerHeight(!0)}),a.css({"z-index":1})},this),1e3*this.settings.slideSpeed)}setTimeout(e.proxy(function(){d.removeClass("slideshow_currentView").find("a").attr("tabindex","-1"),a.removeClass("slideshow_nextView"),a.addClass("slideshow_currentView").find("a").attr("tabindex","0"),this.visibleViews=[t],this.currentlyAnimating=!1,this.$container.trigger("slideshowAnimationEnd")},this),1e3*this.settings.slideSpeed)}}}();
|
6 |
!function(){var t=jQuery,i=slideshow_jquery_image_gallery_script;i.Slideshow.prototype.recalculate=function(i){if(!this.$container.is(":visible"))return setTimeout(t.proxy(function(){this.recalculate(i)},this),500),void 0;for(var e=this.$parentElement,h=0;e.width()<=0&&(e=e.parent(),!(h>50));h++);if(this.currentWidth!=e.width()){this.currentWidth=e.width();var s=e.width()-(this.$container.outerWidth()-this.$container.width());if(parseInt(this.settings.maxWidth,10)>0&&parseInt(this.settings.maxWidth,10)<s&&(s=parseInt(this.settings.maxWidth,10)),this.$container.css("width",Math.round(s)),this.$content.css("width",Math.round(s)-(this.$content.outerWidth(!0)-this.$content.width())),this.settings.preserveSlideshowDimensions){var r=s*this.settings.dimensionHeight/this.settings.dimensionWidth;this.$container.css("height",Math.round(r)),this.$content.css("height",Math.round(r)-(this.$content.outerHeight(!0)-this.$content.height()))}else this.$container.css("height",Math.round(this.settings.height)),this.$content.css("height",Math.round(this.settings.height));this.$views.each(t.proxy(function(i,e){t.inArray(i,this.visibleViews)<0&&t(e).css("top",this.$container.outerHeight(!0))},this)),this.$container.trigger("slideshowResize"),(i||"boolean"!=typeof i)&&this.recalculateVisibleViews()}},i.Slideshow.prototype.recalculateViews=function(){t.each(this.$views,t.proxy(function(t){this.recalculateView(t,!1)},this))},i.Slideshow.prototype.recalculateVisibleViews=function(){t.each(this.visibleViews,t.proxy(function(t,i){this.recalculateView(i,!1)},this))},i.Slideshow.prototype.recalculateView=function(e,h){if(this.$content.width()<=0||this.$content.height()<=0)return setTimeout(t.proxy(function(){this.recalculateView(e,h)},this),500),void 0;var s=t(this.$views[e]);if("boolean"==typeof h&&h||this.$content.width()!=s.outerWidth(!0)){var r=s.find(".slideshow_slide");if(!(r.length<=0)){var a=this.$content.width()-(s.outerWidth(!0)-s.width()),o=this.$content.height()-(s.outerHeight(!0)-s.height()),n=Math.floor(a/r.length),d=o,l=a%r.length,c=0;t(r[0]).css("margin-left",0),t(r[r.length-1]).css("margin-right",0),t.each(r,t.proxy(function(h,s){var a=t(s),o=a.outerWidth(!0)-a.width(),g=a.outerHeight(!0)-a.height();if(h==r.length-1?a.width(n-o+l):a.width(n-o),a.height(d-g),a.hasClass("slideshow_slide_text")){var u=a.find(".slideshow_background_anchor");if(u.length<=0)return;var w=a.width()-(u.outerWidth(!0)-u.width()),f=a.height()-(u.outerHeight(!0)-u.height());u.css({width:w,height:f})}else if(a.hasClass("slideshow_slide_image")){var v=a.find("img");if(v.length<=0)return;var p,m,y=v.outerWidth(),$=v.outerHeight();p=isNaN(parseInt(y,10))?0:y-v.width(),m=isNaN(parseInt($,10))?0:$-v.height();var _=a.width()-p,x=a.height()-m;"stretch"===this.settings.imageBehaviour?(v.css({width:_,height:x}),v.attr({width:_,height:x})):this.getNaturalImageSize(v,t.proxy(function(i,h){var s,r;return 0>=i||0>=h?(setTimeout(t.proxy(function(){this.recalculateView(e,!0)},this),500),void 0):(s=a.width()/a.height(),r=(i+p)/(h+m),r>=s?"natural"===this.settings.imageBehaviour?(v.css({margin:"0px",width:_,height:Math.round(_/r)}),v.attr({width:_,height:Math.round(_/r)})):"crop"===this.settings.imageBehaviour&&(v.css({"margin-top":"0px","margin-left":-Math.floor((x*r-_)/2),height:x,width:Math.floor(x*r)}),v.attr({width:Math.floor(x*r),height:x})):"natural"===this.settings.imageBehaviour?(v.css({"margin-left":"auto","margin-right":"auto",display:"block",width:Math.round(x*r),height:x}),v.attr({width:Math.round(x*r),height:x})):"crop"===this.settings.imageBehaviour&&(v.css({"margin-top":-Math.floor((_/r-x)/2),"margin-left":"0px",width:_,height:Math.floor(_/r)}),v.attr({width:_,height:Math.floor(_/r)})),void 0)},this))}else if(a.hasClass("slideshow_slide_video")){var M=a.find("iframe");if(M.length>0)M.attr({width:a.width(),height:a.height()});else var W=setInterval(t.proxy(function(){if(i.youTubeAPIReady){clearInterval(W);var e=a.find(".slideshow_slide_video_id");e.attr("id","slideshow_slide_video_"+Math.floor(1e6*Math.random())+"_"+e.text());var h=e.attr("data-show-related-videos"),s=new YT.Player(e.attr("id"),{width:a.width(),height:a.height(),videoId:e.text(),playerVars:{wmode:"opaque",rel:h},events:{onReady:function(){},onStateChange:t.proxy(function(t){this.videoPlayers[e.attr("id")].state=t.data},this)}}),r=t("#"+e.attr("id"));r.show(),r.attr("src",r.attr("src")+"&wmode=opaque"),this.videoPlayers[e.attr("id")]={player:s,state:-1}}},this),500)}c+=a.outerWidth(!0)},this)),s.css({width:a,height:o})}}}}();
|
7 |
!function(){var t=jQuery,i=slideshow_jquery_image_gallery_script;i.Slideshow.prototype.activateDescriptions=function(){this.settings.showDescription&&(t.each(this.$slides.find(".slideshow_description_box"),t.proxy(function(i,s){var e=t(s);e.show(),this.settings.hideDescription?e.css({position:"absolute",top:this.$container.outerHeight(!0)}):e.css({position:"absolute",bottom:0})},this)),this.settings.hideDescription&&(this.$container.bind("slideshowResize",t.proxy(function(){t.each(this.$container.find(".slideshow_description_box"),t.proxy(function(i,s){t(s).css("top",this.$container.outerHeight(!0))},this))},this)),this.$container.bind("slideshowAnimationStart",t.proxy(function(){void 0!=this.visibleViews[1]&&t.each(t(this.$views[this.visibleViews[1]]).find(".slideshow_description_box"),t.proxy(function(i,s){t(s).css("top",this.$container.outerHeight(!0))},this))},this)),this.$slides.mouseenter(t.proxy(function(i){var s=t(i.currentTarget).find(".slideshow_description_box");this.descriptionTimer=setTimeout(t.proxy(function(){this.descriptionTimer="",s.stop(!0,!1).animate({top:this.$container.outerHeight(!0)-s.outerHeight(!0)},parseInt(1e3*this.settings.descriptionSpeed,10))},this),200)},this)),this.$slides.mouseleave(t.proxy(function(i){this.descriptionTimer!==!1&&(clearInterval(this.descriptionTimer),this.descriptionTimer=!1),t(i.currentTarget).find(".slideshow_description_box").stop(!0,!1).animate({top:this.$container.outerHeight(!0)},parseInt(1e3*this.settings.descriptionSpeed,10))},this))))},i.Slideshow.prototype.activateNavigationButtons=function(){var i,s;this.settings.controllable&&(i=this.$nextButton.data("nextText"),s=this.$previousButton.data("previousText"),("string"!=typeof i||"string"!=typeof s||i.length<=0||s.length<=0)&&(i=this.$nextButton.attr("data-next-text"),s=this.$previousButton.attr("data-previous-text")),this.$nextButton.html('<span class="assistive-text hide-text">'+i+"</span>").attr({tabindex:"0",title:i}),this.$previousButton.html('<span class="assistive-text hide-text">'+s+"</span>").attr({tabindex:"0",title:s}),this.$nextButton.click(t.proxy(function(){this.currentlyAnimating||(this.pauseAllVideos(),this.playState===this.PlayStates.PLAYING&&(this.pause(this.PlayStates.TEMPORARILY_PAUSED),this.play()),this.animateTo(this.getNextViewID(),1))},this)),this.$previousButton.click(t.proxy(function(){this.currentlyAnimating||(this.pauseAllVideos(),this.playState===this.PlayStates.PLAYING&&(this.pause(this.PlayStates.TEMPORARILY_PAUSED),this.play()),this.animateTo(this.getPreviousViewID(),-1))},this)),this.bindSubmitListener(this.$nextButton),this.bindSubmitListener(this.$previousButton),this.settings.hideNavigationButtons?(this.$container.mouseenter(t.proxy(function(){this.$nextButton.stop(!0,!0).fadeIn(100)},this)),this.$container.mouseleave(t.proxy(function(){this.$nextButton.stop(!0,!0).fadeOut(500)},this)),this.$container.mouseenter(t.proxy(function(){this.$previousButton.stop(!0,!0).fadeIn(100)},this)),this.$container.mouseleave(t.proxy(function(){this.$previousButton.stop(!0,!0).fadeOut(500)},this))):(this.$nextButton.show(),this.$previousButton.show()))},i.Slideshow.prototype.activateControlPanel=function(){this.settings.controlPanel&&(this.$togglePlayButton.attr("tabindex","0"),this.$container.bind("slideshowPlayStateChange",t.proxy(function(t,i){var s,e;this.$togglePlayButton.attr("role","button"),s=this.$togglePlayButton.data("playText"),e=this.$togglePlayButton.data("pauseText"),("string"!=typeof s||"string"!=typeof e||s.length<=0||e.length<=0)&&(s=this.$nextButton.attr("data-play-text"),e=this.$previousButton.attr("data-pause-text")),i===this.PlayStates.PLAYING?this.$togglePlayButton.html('<span class="assistive-text hide-text">'+e+"</span>").attr({"class":"slideshow_pause",title:e}):i===this.PlayStates.PAUSED&&this.$togglePlayButton.html('<span class="assistive-text hide-text">'+s+"</span>").attr({"class":"slideshow_play",title:s})},this)),this.$togglePlayButton.click(t.proxy(function(i){var s=t(i.currentTarget);s.hasClass("slideshow_play")?this.play():this.pause(this.PlayStates.PAUSED)},this)),this.bindSubmitListener(this.$togglePlayButton),this.settings.hideControlPanel?(this.$container.mouseenter(t.proxy(function(){this.$controlPanel.stop(!0,!0).fadeIn(100)},this)),this.$container.mouseleave(t.proxy(function(){this.$controlPanel.stop(!0,!0).fadeOut(500)},this))):this.$controlPanel.show())},i.Slideshow.prototype.activatePagination=function(){if(this.settings.showPagination){this.$pagination.find(".slideshow_pagination_center").html("<ul></ul>");var i=this.$pagination.find("ul");i.html(""),this.$views.each(t.proxy(function(t){var s="",e=parseInt(t,10)+1,n=this.$pagination.data("goToText");("string"!=typeof n||n.length<=0)&&(n=this.$pagination.attr("data-go-to-text")),t==this.currentViewID&&(s="slideshow_currentView"),i.append('<li class="slideshow_transparent '+s+'" data-view-id="'+t+'" role="button" title="'+n+" "+e+'"><span class="assistive-text hide-text">'+n+" "+e+"</span></li>")},this)),this.$pagination.find("li").attr("tabindex","0").click(t.proxy(function(i){var s,e=t(i.currentTarget);this.currentlyAnimating||(s=e.data("viewId"),isNaN(parseInt(s,10))&&(s=e.attr("data-view-id"),isNaN(parseInt(s,10)))||(this.pauseAllVideos(),this.playState===this.PlayStates.PLAYING&&(this.pause(this.PlayStates.TEMPORARILY_PAUSED),this.play()),this.animateTo(parseInt(s,10),0)))},this)),this.bindSubmitListener(this.$pagination.find("li")),this.$container.bind("slideshowAnimationStart",t.proxy(function(){var i=this.$pagination.find("li");i.each(t.proxy(function(i,s){t(s).removeClass("slideshow_currentView")},this)),t(i[this.currentViewID]).addClass("slideshow_currentView")},this)),this.settings.hidePagination?(this.$container.mouseenter(t.proxy(function(){this.$pagination.stop(!0,!0).fadeIn(100)},this)),this.$container.mouseleave(t.proxy(function(){this.$pagination.stop(!0,!0).fadeOut(500)},this))):this.$pagination.show()}},i.Slideshow.prototype.activatePauseOnHover=function(){this.settings.pauseOnHover&&(this.$container.mouseenter(t.proxy(function(){clearTimeout(this.pauseOnHoverTimer),this.playState!==this.PlayStates.PAUSED&&(this.pauseOnHoverTimer=setTimeout(t.proxy(function(){this.pause(this.PlayStates.TEMPORARILY_PAUSED)},this),500))},this)),this.$container.mouseleave(t.proxy(function(){clearTimeout(this.pauseOnHoverTimer),this.playState!==this.PlayStates.PAUSED&&this.interval===!1&&this.play()},this)))}}();
|
1 |
+
function onYouTubeIframeAPIReady(){slideshow_jquery_image_gallery_script.youTubeAPIReady=!0}slideshow_jquery_image_gallery_backend_script_scriptsloadedFlag=!1,slideshow_jquery_image_gallery_script=function(){var e=jQuery,i={};return i.slideshowInstances={},i.initialized=!1,i.youTubeAPIReady=!1,i.sessionIDCounter=0,i.init=function(){slideshow_jquery_image_gallery_backend_script_scriptsloadedFlag!==!0||i.initialized||(i.initialized=!0,e(document).trigger("slideshow_jquery_image_gallery_script_ready"),i.repairStylesheetURLs(),i.activateSlideshows(),i.enableLazyLoading(),e(document).trigger("slideshow_jquery_image_gallery_slideshows_ready"))},i.getSlideshowInstance=function(t){if(isNaN(parseInt(t,10))){if(t instanceof e&&t.length>0)for(var s in i.slideshowInstances)if(i.slideshowInstances.hasOwnProperty(s)){var n=i.slideshowInstances[s];if(n instanceof i.Slideshow&&n.$container.get(0)===t.get(0))return n}}else if(i.slideshowInstances[t]instanceof i.Slideshow)return i.slideshowInstances[t];return new i.Slideshow},i.activateSlideshows=function(){e.each(e(".slideshow_container"),function(t,s){i.activateSlideshow(e(s))})},i.activateSlideshow=function(e){e.hasClass("slideshow_container")&&"1"!=e.attr("data-slideshow-active")&&(e.attr("data-slideshow-active","1"),i.slideshowInstances[i.sessionIDCounter]=new i.Slideshow(e),i.sessionIDCounter++)},i.enableLazyLoading=function(){var t;"function"==typeof MutationObserver?(t=new MutationObserver(function(t){t.forEach(function(t){var s;if(t.addedNodes)for(s=0;s<t.addedNodes.length;s++)e.each(e(t.addedNodes[s]).find(".slideshow_container").addBack(".slideshow_container"),function(t,s){i.activateSlideshow(e(s))})})}),t.observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1})):setInterval(function(){e.each(e(".slideshow_container:not([data-slideshow-active])"),function(t,s){i.activateSlideshow(e(s))})},2e3)},i.loadYouTubeAPI=function(){if(!i.loadYouTubeAPICalled){i.loadYouTubeAPICalled=!0;var e=document.createElement("script"),t=document.getElementsByTagName("script")[0];e.src="//www.youtube.com/iframe_api",t.parentNode.insertBefore(e,t)}},i.repairStylesheetURLs=function(){var i=e('[id*="slideshow-jquery-image-gallery-ajax-stylesheet_"]');e.each(i,function(i,t){var s,n,a,o=e(t),r=e(t).attr("href");void 0!==r&&""!==r&&(s=o.attr("id").split("_"),n=s.splice(1,s.length-1).join("_").slice(0,-4),a=r.split("?"),(void 0===a[1]||""===a[1]||a[1].toLowerCase().indexOf("style=")<0)&&(a[1]="action=slideshow_jquery_image_gallery_load_stylesheet&style="+n+"&ver="+Math.round((new Date).getTime()/1e3),r=a.join("?"),o.attr("href",r)))})},i.log=function(e){"object"==typeof console&&console.log("slideshow-jquery-image-gallery",e)},e(document).ready(function(){i.init()}),e(window).load(function(){i.init()}),e.fn.getSlideshowInstance=function(){return i.getSlideshowInstance(this)},i}();
|
2 |
|
3 |
+
!function(){var i=jQuery,t=slideshow_jquery_image_gallery_script;t.Slideshow=function(s){if(s instanceof i&&(this.$container=s,this.$content=this.$container.find(".slideshow_content"),this.$views=this.$container.find(".slideshow_view"),this.$slides=this.$container.find(".slideshow_slide"),this.$controlPanel=this.$container.find(".slideshow_controlPanel"),this.$togglePlayButton=this.$controlPanel.find(".slideshow_togglePlay"),this.$nextButton=this.$container.find(".slideshow_next"),this.$previousButton=this.$container.find(".slideshow_previous"),this.$pagination=this.$container.find(".slideshow_pagination"),this.$loadingIcon=this.$container.find(".slideshow_loading_icon"),this.ID=this.getSlideshowID(),!isNaN(parseInt(this.ID,10)))){if(this.settings=window["SlideshowPluginSettings_"+this.ID],!this.settings)try{if(this.settings=JSON.parse(this.$container.attr("data-settings")),"object"!=typeof this.settings)throw""}catch(e){return t.log("Slideshow (ID: "+this.ID+") could not find its settings."),void 0}i.each(this.settings,i.proxy(function(i,t){"true"==t?this.settings[i]=!0:"false"==t&&(this.settings[i]=!1)},this)),this.$parentElement=this.$container.parent(),this.viewData=[],this.viewIDs=[],this.currentlyAnimating=!1,this.currentViewID=void 0,this.currentWidth=0,this.visibleViews=[],this.videoPlayers=[],this.PlayStates={UNSTARTED:-2,PAUSED:-1,TEMPORARILY_PAUSED:0,PLAYING:1},this.playState=this.PlayStates.UNSTARTED,this.interval=!1,this.pauseOnHoverTimer=!1,this.descriptionTimer=!1,this.randomNextHistoryViewIDs=[],this.randomPreviousHistoryViewIDs=[],this.randomAvailableViewIDs=[],i.each(this.$views,i.proxy(function(i){this.viewIDs.push(i)},this)),this.currentViewID=this.getNextViewID(),this.visibleViews=[this.currentViewID],this.recalculate(!1);var n=i.proxy(function(t){(this.$container.width()<=0||this.$container.height()<=0)&&setTimeout(i.proxy(function(){t(t)},this),500),i.each(this.$views,i.proxy(function(t,s){var e=i(s);t!=this.visibleViews[0]?e.css("top",this.$container.outerHeight(!0)).find("a").attr("tabindex","-1"):e.addClass("slideshow_currentView")},this))},this);n(n);var h=!0;i.each(this.$views,i.proxy(function(t,s){var e=i(s);this.viewData[t]=[],i.each(e.find(".slideshow_slide"),i.proxy(function(s,e){var n=i(e);if(this.viewData[t][s]={},n.hasClass("slideshow_slide_image")){var a=n.find("img");a.length>0?a.get(0).complete?this.viewData[t][s].loaded=1:(t===this.currentViewID&&(h=!1),this.viewData[t][s].loaded=0,this.onImageLoad(a,i.proxy(function(i){this.viewData[t][s].loaded=i?1:2,this.settings.waitUntilLoaded&&t===this.currentViewID&&this.isViewLoaded(t)&&this.start()},this))):this.viewData[t][s].loaded=-1}else this.viewData[t][s].loaded=-1;n.hasClass("slideshow_slide_video")&&slideshow_jquery_image_gallery_script.loadYouTubeAPI()},this))},this)),i(window).load(i.proxy(function(){this.recalculate(!0)},this)),parseFloat(this.settings.intervalSpeed)<parseFloat(this.settings.slideSpeed)+.1&&(this.settings.intervalSpeed=parseFloat(this.settings.slideSpeed)+.1),(!this.settings.waitUntilLoaded||this.settings.waitUntilLoaded&&h)&&this.start()}}}();
|
4 |
+
!function(){var t=jQuery,i=slideshow_jquery_image_gallery_script;i.Slideshow.prototype.start=function(){this.activateDescriptions(),this.activateControlPanel(),this.activateNavigationButtons(),this.activatePagination(),this.activatePauseOnHover(),this.$loadingIcon.length>0&&this.$loadingIcon.remove(),this.$content.show(),this.recalculateViews(),this.settings.enableResponsiveness&&t(window).resize(t.proxy(function(){this.recalculate(!0)},this)),this.playState=this.PlayStates.PAUSED,this.$container.trigger("slideshowPlayStateChange",[this.playState]),this.settings.play&&this.play()},i.Slideshow.prototype.play=function(){this.interval||(this.playState=this.PlayStates.PLAYING,this.$container.trigger("slideshowPlayStateChange",[this.playState]),this.interval=setInterval(t.proxy(function i(e,s){void 0===s&&(s=this),void 0===e&&(e=s.getNextViewID()),s.isViewLoaded(e)?(s.animateTo(e,1),s.play()):(s.pause(this.PlayStates.TEMPORARILY_PAUSED),setTimeout(t.proxy(function(){i(e,s)},s),100))},this),1e3*this.settings.intervalSpeed))},i.Slideshow.prototype.pause=function(t){clearInterval(this.interval),this.interval=!1,t!==this.PlayStates.PAUSED&&t!==this.PlayStates.TEMPORARILY_PAUSED&&(t=this.PlayStates.PAUSED),this.playState=t,this.$container.trigger("slideshowPlayStateChange",[this.playState])},i.Slideshow.prototype.next=function(){this.playState===this.PlayStates.PLAYING&&(this.pause(this.PlayStates.TEMPORARILY_PAUSED),this.play()),this.animateTo(this.getNextViewID(),1)},i.Slideshow.prototype.previous=function(){this.playState===this.PlayStates.PLAYING&&(this.pause(this.PlayStates.TEMPORARILY_PAUSED),this.play()),this.animateTo(this.getPreviousViewID(),-1)},i.Slideshow.prototype.isVideoPlaying=function(){for(var t in this.videoPlayers)if(this.videoPlayers.hasOwnProperty(t)){var i=this.videoPlayers[t].state;if(1==i||3==i)return!0}return!1},i.Slideshow.prototype.pauseAllVideos=function(){for(var t in this.videoPlayers)if(this.videoPlayers.hasOwnProperty(t)){var i=this.videoPlayers[t].player;null!=i&&"function"==typeof i.pauseVideo&&-1!=this.videoPlayers[t].state&&(this.videoPlayers[t].state=2,i.pauseVideo())}},i.Slideshow.prototype.isViewLoaded=function(i){var e=!0;return isNaN(parseInt(i,10))?!1:(t.each(this.viewData[i],t.proxy(function(t,i){0==i.loaded&&(e=!1)},this)),e)},i.Slideshow.prototype.getNaturalImageSize=function(i,e,s){return i.length<=0||!(i instanceof t)||"string"!=typeof i.attr("src")?(e(-1,-1,s),void 0):(this.onImageLoad(i,t.proxy(function(t,i){e(i.width,i.height,s)},this)),void 0)},i.Slideshow.prototype.onImageLoad=function(i,e,s){var a=new Image;return i.length<=0||!(i instanceof t)||"string"!=typeof i.attr("src")?(e(!1,a,s),void 0):(a.onload=t.proxy(function(){e(!0,a,s)},this),a.src=i.attr("src"),void 0)},i.Slideshow.prototype.getNextViewID=function(){var t=this.currentViewID;if(this.settings.random){var i=t;if(t=this.getNextRandomViewID(),t!=i)return t}return isNaN(parseInt(t,10))?0:t>=this.$views.length-1?this.settings.loop?0:this.currentViewID:t+1},i.Slideshow.prototype.getPreviousViewID=function(){var t=this.currentViewID;if(isNaN(parseInt(t,10))&&(t=0),this.settings.random){var i=t;if(t=this.getPreviousRandomViewID(),t!=i)return t}return 0>=t?this.settings.loop?t=this.$views.length-1:this.currentViewID:t-=1},i.Slideshow.prototype.getNextRandomViewID=function(){if(isNaN(parseInt(this.currentViewID,10))||this.randomPreviousHistoryViewIDs.push(this.currentViewID),this.randomPreviousHistoryViewIDs.length>2*this.viewIDs.length&&this.randomPreviousHistoryViewIDs.shift(),this.randomNextHistoryViewIDs.length>0)return this.randomNextHistoryViewIDs.pop();if(void 0===this.randomAvailableViewIDs||this.randomAvailableViewIDs.length<=0){this.randomAvailableViewIDs=t.extend(!0,[],this.viewIDs);var i=t.inArray(this.currentViewID,this.randomAvailableViewIDs);i>=0&&this.randomAvailableViewIDs.splice(i,1)}return this.randomAvailableViewIDs.splice(Math.floor(Math.random()*this.randomAvailableViewIDs.length),1).pop()},i.Slideshow.prototype.getPreviousRandomViewID=function(){return isNaN(parseInt(this.currentViewID,10))||this.randomNextHistoryViewIDs.push(this.currentViewID),this.randomNextHistoryViewIDs.length>2*this.viewIDs.length&&this.randomNextHistoryViewIDs.shift(),this.randomPreviousHistoryViewIDs.length>0?this.randomPreviousHistoryViewIDs.pop():this.viewIDs[Math.floor(Math.random()*this.viewIDs.length)]},i.Slideshow.prototype.getSlideshowID=function(){var t=this.$container.data("slideshowId");return isNaN(parseInt(t,10))&&(t=this.$container.attr("data-slideshow-id")),t},i.Slideshow.prototype.bindSubmitListener=function(i){i.keypress(t.proxy(function(i){var e=i.keyCode||i.which;13===e&&(i.preventDefault(),t(i.currentTarget).click())},this))}}();
|
5 |
!function(){var e=jQuery,t=slideshow_jquery_image_gallery_script;t.Slideshow.prototype.animateTo=function(t,s){if(!(this.isVideoPlaying()||0>t||t>=this.$views.length||t==this.currentViewID)){if(this.currentlyAnimating===!0)return this.$container.one("slideshowAnimationEnd",e.proxy(function(){this.playState===this.PlayStates.PLAYING&&(this.pause(this.PlayStates.TEMPORARILY_PAUSED),this.play()),this.animateTo(t,s)},this)),void 0;this.currentlyAnimating=!0,(isNaN(parseInt(s,10))||0==s)&&(s=t<this.currentViewID?-1:1),this.visibleViews=[this.currentViewID,t];var i=this.settings.animation,n=["slide","slideRight","slideUp","slideDown","fade","directFade"];"random"==i&&(i=n[Math.floor(Math.random()*n.length)]);var o={slide:"slideRight",slideRight:"slide",slideUp:"slideDown",slideDown:"slideUp",fade:"fade",directFade:"directFade",crossFade:"crossFade"};0>s&&(i=o[i]);var d=e(this.$views[this.currentViewID]),a=e(this.$views[t]);switch(d.stop(!0,!0),a.stop(!0,!0),a.addClass("slideshow_nextView"),this.recalculateVisibleViews(),this.currentViewID=t,this.$container.trigger("slideshowAnimationStart",[t,i,s]),i){case"slide":a.css({top:0,left:this.$content.width()}),d.animate({left:-d.outerWidth(!0)},1e3*this.settings.slideSpeed),a.animate({left:0},1e3*this.settings.slideSpeed),setTimeout(e.proxy(function(){d.stop(!0,!0).css("top",this.$container.outerHeight(!0))},this),1e3*this.settings.slideSpeed);break;case"slideRight":a.css({top:0,left:-this.$content.width()}),d.animate({left:d.outerWidth(!0)},1e3*this.settings.slideSpeed),a.animate({left:0},1e3*this.settings.slideSpeed),setTimeout(e.proxy(function(){d.stop(!0,!0).css("top",this.$container.outerHeight(!0))},this),1e3*this.settings.slideSpeed);break;case"slideUp":a.css({top:this.$content.height(),left:0}),d.animate({top:-d.outerHeight(!0)},1e3*this.settings.slideSpeed),a.animate({top:0},1e3*this.settings.slideSpeed),setTimeout(e.proxy(function(){d.stop(!0,!0).css("top",this.$container.outerHeight(!0))},this),1e3*this.settings.slideSpeed);break;case"slideDown":a.css({top:-this.$content.height(),left:0}),d.animate({top:d.outerHeight(!0)},1e3*this.settings.slideSpeed),a.animate({top:0},1e3*this.settings.slideSpeed),setTimeout(e.proxy(function(){d.stop(!0,!0).css("top",this.$container.outerHeight(!0))},this),1e3*this.settings.slideSpeed);break;case"fade":a.css({top:0,left:0,display:"none"}),d.fadeOut(1e3*this.settings.slideSpeed/2),setTimeout(e.proxy(function(){a.fadeIn(1e3*this.settings.slideSpeed/2),d.stop(!0,!0).css({top:this.$container.outerHeight(!0),display:"block"})},this),1e3*this.settings.slideSpeed/2);break;case"directFade":a.css({top:0,left:0,"z-index":0,display:"none"}),d.css({"z-index":1}),a.stop(!0,!0).fadeIn(1e3*this.settings.slideSpeed),d.stop(!0,!0).fadeOut(1e3*this.settings.slideSpeed),setTimeout(e.proxy(function(){a.stop(!0,!0).css({"z-index":0}),d.stop(!0,!0).css({top:this.$container.outerHeight(!0),display:"block","z-index":0})},this),1e3*this.settings.slideSpeed);break;case"crossFade":a.css({top:0,left:0,"z-index":1,display:"none"}),d.css({"z-index":0}),a.stop(!0,!0).fadeIn(1e3*this.settings.slideSpeed),setTimeout(e.proxy(function(){d.css({top:this.$container.outerHeight(!0)}),a.css({"z-index":1})},this),1e3*this.settings.slideSpeed)}setTimeout(e.proxy(function(){d.removeClass("slideshow_currentView").find("a").attr("tabindex","-1"),a.removeClass("slideshow_nextView"),a.addClass("slideshow_currentView").find("a").attr("tabindex","0"),this.visibleViews=[t],this.currentlyAnimating=!1,this.$container.trigger("slideshowAnimationEnd")},this),1e3*this.settings.slideSpeed)}}}();
|
6 |
!function(){var t=jQuery,i=slideshow_jquery_image_gallery_script;i.Slideshow.prototype.recalculate=function(i){if(!this.$container.is(":visible"))return setTimeout(t.proxy(function(){this.recalculate(i)},this),500),void 0;for(var e=this.$parentElement,h=0;e.width()<=0&&(e=e.parent(),!(h>50));h++);if(this.currentWidth!=e.width()){this.currentWidth=e.width();var s=e.width()-(this.$container.outerWidth()-this.$container.width());if(parseInt(this.settings.maxWidth,10)>0&&parseInt(this.settings.maxWidth,10)<s&&(s=parseInt(this.settings.maxWidth,10)),this.$container.css("width",Math.round(s)),this.$content.css("width",Math.round(s)-(this.$content.outerWidth(!0)-this.$content.width())),this.settings.preserveSlideshowDimensions){var r=s*this.settings.dimensionHeight/this.settings.dimensionWidth;this.$container.css("height",Math.round(r)),this.$content.css("height",Math.round(r)-(this.$content.outerHeight(!0)-this.$content.height()))}else this.$container.css("height",Math.round(this.settings.height)),this.$content.css("height",Math.round(this.settings.height));this.$views.each(t.proxy(function(i,e){t.inArray(i,this.visibleViews)<0&&t(e).css("top",this.$container.outerHeight(!0))},this)),this.$container.trigger("slideshowResize"),(i||"boolean"!=typeof i)&&this.recalculateVisibleViews()}},i.Slideshow.prototype.recalculateViews=function(){t.each(this.$views,t.proxy(function(t){this.recalculateView(t,!1)},this))},i.Slideshow.prototype.recalculateVisibleViews=function(){t.each(this.visibleViews,t.proxy(function(t,i){this.recalculateView(i,!1)},this))},i.Slideshow.prototype.recalculateView=function(e,h){if(this.$content.width()<=0||this.$content.height()<=0)return setTimeout(t.proxy(function(){this.recalculateView(e,h)},this),500),void 0;var s=t(this.$views[e]);if("boolean"==typeof h&&h||this.$content.width()!=s.outerWidth(!0)){var r=s.find(".slideshow_slide");if(!(r.length<=0)){var a=this.$content.width()-(s.outerWidth(!0)-s.width()),o=this.$content.height()-(s.outerHeight(!0)-s.height()),n=Math.floor(a/r.length),d=o,l=a%r.length,c=0;t(r[0]).css("margin-left",0),t(r[r.length-1]).css("margin-right",0),t.each(r,t.proxy(function(h,s){var a=t(s),o=a.outerWidth(!0)-a.width(),g=a.outerHeight(!0)-a.height();if(h==r.length-1?a.width(n-o+l):a.width(n-o),a.height(d-g),a.hasClass("slideshow_slide_text")){var u=a.find(".slideshow_background_anchor");if(u.length<=0)return;var w=a.width()-(u.outerWidth(!0)-u.width()),f=a.height()-(u.outerHeight(!0)-u.height());u.css({width:w,height:f})}else if(a.hasClass("slideshow_slide_image")){var v=a.find("img");if(v.length<=0)return;var p,m,y=v.outerWidth(),$=v.outerHeight();p=isNaN(parseInt(y,10))?0:y-v.width(),m=isNaN(parseInt($,10))?0:$-v.height();var _=a.width()-p,x=a.height()-m;"stretch"===this.settings.imageBehaviour?(v.css({width:_,height:x}),v.attr({width:_,height:x})):this.getNaturalImageSize(v,t.proxy(function(i,h){var s,r;return 0>=i||0>=h?(setTimeout(t.proxy(function(){this.recalculateView(e,!0)},this),500),void 0):(s=a.width()/a.height(),r=(i+p)/(h+m),r>=s?"natural"===this.settings.imageBehaviour?(v.css({margin:"0px",width:_,height:Math.round(_/r)}),v.attr({width:_,height:Math.round(_/r)})):"crop"===this.settings.imageBehaviour&&(v.css({"margin-top":"0px","margin-left":-Math.floor((x*r-_)/2),height:x,width:Math.floor(x*r)}),v.attr({width:Math.floor(x*r),height:x})):"natural"===this.settings.imageBehaviour?(v.css({"margin-left":"auto","margin-right":"auto",display:"block",width:Math.round(x*r),height:x}),v.attr({width:Math.round(x*r),height:x})):"crop"===this.settings.imageBehaviour&&(v.css({"margin-top":-Math.floor((_/r-x)/2),"margin-left":"0px",width:_,height:Math.floor(_/r)}),v.attr({width:_,height:Math.floor(_/r)})),void 0)},this))}else if(a.hasClass("slideshow_slide_video")){var M=a.find("iframe");if(M.length>0)M.attr({width:a.width(),height:a.height()});else var W=setInterval(t.proxy(function(){if(i.youTubeAPIReady){clearInterval(W);var e=a.find(".slideshow_slide_video_id");e.attr("id","slideshow_slide_video_"+Math.floor(1e6*Math.random())+"_"+e.text());var h=e.attr("data-show-related-videos"),s=new YT.Player(e.attr("id"),{width:a.width(),height:a.height(),videoId:e.text(),playerVars:{wmode:"opaque",rel:h},events:{onReady:function(){},onStateChange:t.proxy(function(t){this.videoPlayers[e.attr("id")].state=t.data},this)}}),r=t("#"+e.attr("id"));r.show(),r.attr("src",r.attr("src")+"&wmode=opaque"),this.videoPlayers[e.attr("id")]={player:s,state:-1}}},this),500)}c+=a.outerWidth(!0)},this)),s.css({width:a,height:o})}}}}();
|
7 |
!function(){var t=jQuery,i=slideshow_jquery_image_gallery_script;i.Slideshow.prototype.activateDescriptions=function(){this.settings.showDescription&&(t.each(this.$slides.find(".slideshow_description_box"),t.proxy(function(i,s){var e=t(s);e.show(),this.settings.hideDescription?e.css({position:"absolute",top:this.$container.outerHeight(!0)}):e.css({position:"absolute",bottom:0})},this)),this.settings.hideDescription&&(this.$container.bind("slideshowResize",t.proxy(function(){t.each(this.$container.find(".slideshow_description_box"),t.proxy(function(i,s){t(s).css("top",this.$container.outerHeight(!0))},this))},this)),this.$container.bind("slideshowAnimationStart",t.proxy(function(){void 0!=this.visibleViews[1]&&t.each(t(this.$views[this.visibleViews[1]]).find(".slideshow_description_box"),t.proxy(function(i,s){t(s).css("top",this.$container.outerHeight(!0))},this))},this)),this.$slides.mouseenter(t.proxy(function(i){var s=t(i.currentTarget).find(".slideshow_description_box");this.descriptionTimer=setTimeout(t.proxy(function(){this.descriptionTimer="",s.stop(!0,!1).animate({top:this.$container.outerHeight(!0)-s.outerHeight(!0)},parseInt(1e3*this.settings.descriptionSpeed,10))},this),200)},this)),this.$slides.mouseleave(t.proxy(function(i){this.descriptionTimer!==!1&&(clearInterval(this.descriptionTimer),this.descriptionTimer=!1),t(i.currentTarget).find(".slideshow_description_box").stop(!0,!1).animate({top:this.$container.outerHeight(!0)},parseInt(1e3*this.settings.descriptionSpeed,10))},this))))},i.Slideshow.prototype.activateNavigationButtons=function(){var i,s;this.settings.controllable&&(i=this.$nextButton.data("nextText"),s=this.$previousButton.data("previousText"),("string"!=typeof i||"string"!=typeof s||i.length<=0||s.length<=0)&&(i=this.$nextButton.attr("data-next-text"),s=this.$previousButton.attr("data-previous-text")),this.$nextButton.html('<span class="assistive-text hide-text">'+i+"</span>").attr({tabindex:"0",title:i}),this.$previousButton.html('<span class="assistive-text hide-text">'+s+"</span>").attr({tabindex:"0",title:s}),this.$nextButton.click(t.proxy(function(){this.currentlyAnimating||(this.pauseAllVideos(),this.playState===this.PlayStates.PLAYING&&(this.pause(this.PlayStates.TEMPORARILY_PAUSED),this.play()),this.animateTo(this.getNextViewID(),1))},this)),this.$previousButton.click(t.proxy(function(){this.currentlyAnimating||(this.pauseAllVideos(),this.playState===this.PlayStates.PLAYING&&(this.pause(this.PlayStates.TEMPORARILY_PAUSED),this.play()),this.animateTo(this.getPreviousViewID(),-1))},this)),this.bindSubmitListener(this.$nextButton),this.bindSubmitListener(this.$previousButton),this.settings.hideNavigationButtons?(this.$container.mouseenter(t.proxy(function(){this.$nextButton.stop(!0,!0).fadeIn(100)},this)),this.$container.mouseleave(t.proxy(function(){this.$nextButton.stop(!0,!0).fadeOut(500)},this)),this.$container.mouseenter(t.proxy(function(){this.$previousButton.stop(!0,!0).fadeIn(100)},this)),this.$container.mouseleave(t.proxy(function(){this.$previousButton.stop(!0,!0).fadeOut(500)},this))):(this.$nextButton.show(),this.$previousButton.show()))},i.Slideshow.prototype.activateControlPanel=function(){this.settings.controlPanel&&(this.$togglePlayButton.attr("tabindex","0"),this.$container.bind("slideshowPlayStateChange",t.proxy(function(t,i){var s,e;this.$togglePlayButton.attr("role","button"),s=this.$togglePlayButton.data("playText"),e=this.$togglePlayButton.data("pauseText"),("string"!=typeof s||"string"!=typeof e||s.length<=0||e.length<=0)&&(s=this.$nextButton.attr("data-play-text"),e=this.$previousButton.attr("data-pause-text")),i===this.PlayStates.PLAYING?this.$togglePlayButton.html('<span class="assistive-text hide-text">'+e+"</span>").attr({"class":"slideshow_pause",title:e}):i===this.PlayStates.PAUSED&&this.$togglePlayButton.html('<span class="assistive-text hide-text">'+s+"</span>").attr({"class":"slideshow_play",title:s})},this)),this.$togglePlayButton.click(t.proxy(function(i){var s=t(i.currentTarget);s.hasClass("slideshow_play")?this.play():this.pause(this.PlayStates.PAUSED)},this)),this.bindSubmitListener(this.$togglePlayButton),this.settings.hideControlPanel?(this.$container.mouseenter(t.proxy(function(){this.$controlPanel.stop(!0,!0).fadeIn(100)},this)),this.$container.mouseleave(t.proxy(function(){this.$controlPanel.stop(!0,!0).fadeOut(500)},this))):this.$controlPanel.show())},i.Slideshow.prototype.activatePagination=function(){if(this.settings.showPagination){this.$pagination.find(".slideshow_pagination_center").html("<ul></ul>");var i=this.$pagination.find("ul");i.html(""),this.$views.each(t.proxy(function(t){var s="",e=parseInt(t,10)+1,n=this.$pagination.data("goToText");("string"!=typeof n||n.length<=0)&&(n=this.$pagination.attr("data-go-to-text")),t==this.currentViewID&&(s="slideshow_currentView"),i.append('<li class="slideshow_transparent '+s+'" data-view-id="'+t+'" role="button" title="'+n+" "+e+'"><span class="assistive-text hide-text">'+n+" "+e+"</span></li>")},this)),this.$pagination.find("li").attr("tabindex","0").click(t.proxy(function(i){var s,e=t(i.currentTarget);this.currentlyAnimating||(s=e.data("viewId"),isNaN(parseInt(s,10))&&(s=e.attr("data-view-id"),isNaN(parseInt(s,10)))||(this.pauseAllVideos(),this.playState===this.PlayStates.PLAYING&&(this.pause(this.PlayStates.TEMPORARILY_PAUSED),this.play()),this.animateTo(parseInt(s,10),0)))},this)),this.bindSubmitListener(this.$pagination.find("li")),this.$container.bind("slideshowAnimationStart",t.proxy(function(){var i=this.$pagination.find("li");i.each(t.proxy(function(i,s){t(s).removeClass("slideshow_currentView")},this)),t(i[this.currentViewID]).addClass("slideshow_currentView")},this)),this.settings.hidePagination?(this.$container.mouseenter(t.proxy(function(){this.$pagination.stop(!0,!0).fadeIn(100)},this)),this.$container.mouseleave(t.proxy(function(){this.$pagination.stop(!0,!0).fadeOut(500)},this))):this.$pagination.show()}},i.Slideshow.prototype.activatePauseOnHover=function(){this.settings.pauseOnHover&&(this.$container.mouseenter(t.proxy(function(){clearTimeout(this.pauseOnHoverTimer),this.playState!==this.PlayStates.PAUSED&&(this.pauseOnHoverTimer=setTimeout(t.proxy(function(){this.pause(this.PlayStates.TEMPORARILY_PAUSED)},this),500))},this)),this.$container.mouseleave(t.proxy(function(){clearTimeout(this.pauseOnHoverTimer),this.playState!==this.PlayStates.PAUSED&&this.interval===!1&&this.play()},this)))}}();
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Donate link: http://stefanboonstra.com/donate-to-slideshow/
|
|
5 |
Tags: responsive, slideshow, slider, slide show, images, image, photo, video, text, gallery, galleries, jquery, javascript
|
6 |
Requires at least: 3.5
|
7 |
Tested up to: 4.3
|
8 |
-
Stable tag: 2.
|
9 |
License: GPLv2
|
10 |
|
11 |
Integrate a fancy slideshow in just five steps. - Rainbows. Rainbows everywhere.
|
@@ -176,6 +176,12 @@ personal taste.
|
|
176 |
|
177 |
== Changelog ==
|
178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
= 2.2.25 =
|
180 |
* Changed localization domain to match the plugin's slug in order to support language packs.
|
181 |
|
5 |
Tags: responsive, slideshow, slider, slide show, images, image, photo, video, text, gallery, galleries, jquery, javascript
|
6 |
Requires at least: 3.5
|
7 |
Tested up to: 4.3
|
8 |
+
Stable tag: 2.3.0
|
9 |
License: GPLv2
|
10 |
|
11 |
Integrate a fancy slideshow in just five steps. - Rainbows. Rainbows everywhere.
|
176 |
|
177 |
== Changelog ==
|
178 |
|
179 |
+
= 2.3.0 =
|
180 |
+
* Refactored the slideshow plugin's backend codebase to prepare for a larger backend rewrite.
|
181 |
+
* Removed backwards compatibility on inserting images with pre-3.5 versions of WordPress.
|
182 |
+
* Slideshows now work on infinite scroll and single page websites through the "Enable lazy loading" option.
|
183 |
+
* Fixed: YouTube thumbnail image disappeared after clicking the slideshow's navigation buttons.
|
184 |
+
|
185 |
= 2.2.25 =
|
186 |
* Changed localization domain to match the plugin's slug in order to support language packs.
|
187 |
|
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: The slideshow plugin is easily deployable on your website. Add any image that has already been uploaded to add to your slideshow, add text slides, or even add a video. Options and styles are customizable for every single slideshow on your website.
|
6 |
-
Version: 2.
|
7 |
Requires at least: 3.5
|
8 |
Author: StefanBoonstra
|
9 |
Author URI: http://stefanboonstra.com/
|
@@ -22,7 +22,7 @@
|
|
22 |
class SlideshowPluginMain
|
23 |
{
|
24 |
/** @var string $version */
|
25 |
-
static $version = '2.
|
26 |
|
27 |
/**
|
28 |
* Bootstraps the application by assigning the right functions to
|
@@ -37,7 +37,8 @@ class SlideshowPluginMain
|
|
37 |
// Initialize localization on init
|
38 |
add_action('init', array(__CLASS__, 'localize'));
|
39 |
|
40 |
-
//
|
|
|
41 |
add_action('admin_enqueue_scripts', array(__CLASS__, 'enqueueBackendScripts'));
|
42 |
|
43 |
// Ajax requests
|
@@ -66,7 +67,34 @@ class SlideshowPluginMain
|
|
66 |
}
|
67 |
|
68 |
/**
|
69 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
*
|
71 |
* Should always be called on the admin_enqueue_scrips hook.
|
72 |
*
|
@@ -146,6 +174,44 @@ class SlideshowPluginMain
|
|
146 |
return dirname(__FILE__);
|
147 |
}
|
148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
/**
|
150 |
* This function will load classes automatically on-call.
|
151 |
*
|
3 |
Plugin Name: Slideshow
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/
|
5 |
Description: The slideshow plugin is easily deployable on your website. Add any image that has already been uploaded to add to your slideshow, add text slides, or even add a video. Options and styles are customizable for every single slideshow on your website.
|
6 |
+
Version: 2.3.0
|
7 |
Requires at least: 3.5
|
8 |
Author: StefanBoonstra
|
9 |
Author URI: http://stefanboonstra.com/
|
22 |
class SlideshowPluginMain
|
23 |
{
|
24 |
/** @var string $version */
|
25 |
+
static $version = '2.3.0';
|
26 |
|
27 |
/**
|
28 |
* Bootstraps the application by assigning the right functions to
|
37 |
// Initialize localization on init
|
38 |
add_action('init', array(__CLASS__, 'localize'));
|
39 |
|
40 |
+
// Enqueue hooks
|
41 |
+
add_action('wp_enqueue_scripts' , array(__CLASS__, 'enqueueFrontendScripts'));
|
42 |
add_action('admin_enqueue_scripts', array(__CLASS__, 'enqueueBackendScripts'));
|
43 |
|
44 |
// Ajax requests
|
67 |
}
|
68 |
|
69 |
/**
|
70 |
+
* Enqueues frontend scripts and styles.
|
71 |
+
*
|
72 |
+
* Should always be called on the wp_enqueue_scripts hook.
|
73 |
+
*
|
74 |
+
* @since 2.3.0
|
75 |
+
*/
|
76 |
+
static function enqueueFrontendScripts()
|
77 |
+
{
|
78 |
+
// Enqueue slideshow script if lazy loading is enabled
|
79 |
+
if (SlideshowPluginGeneralSettings::getEnableLazyLoading())
|
80 |
+
{
|
81 |
+
wp_enqueue_script(
|
82 |
+
'slideshow-jquery-image-gallery-script',
|
83 |
+
self::getPluginUrl() . '/js/min/all.frontend.min.js',
|
84 |
+
array('jquery'),
|
85 |
+
self::$version
|
86 |
+
);
|
87 |
+
|
88 |
+
wp_localize_script(
|
89 |
+
'slideshow-jquery-image-gallery-script',
|
90 |
+
'slideshow_jquery_image_gallery_script_adminURL',
|
91 |
+
admin_url()
|
92 |
+
);
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Enqueues backend scripts and styles.
|
98 |
*
|
99 |
* Should always be called on the admin_enqueue_scrips hook.
|
100 |
*
|
174 |
return dirname(__FILE__);
|
175 |
}
|
176 |
|
177 |
+
/**
|
178 |
+
* Outputs the passed view. It's good practice to pass an object like an stdClass to the $data variable, as it can
|
179 |
+
* be easily checked for validity in the view itself using "instanceof".
|
180 |
+
*
|
181 |
+
* @since 2.3.0
|
182 |
+
* @param string $view
|
183 |
+
* @param stdClass $data (Optional, defaults to stdClass)
|
184 |
+
*/
|
185 |
+
static function outputView($view, $data = null)
|
186 |
+
{
|
187 |
+
if (!($data instanceof stdClass))
|
188 |
+
{
|
189 |
+
$data = new stdClass();
|
190 |
+
}
|
191 |
+
|
192 |
+
$file = self::getPluginPath() . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . $view;
|
193 |
+
|
194 |
+
if (file_exists($file))
|
195 |
+
{
|
196 |
+
include $file;
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Uses self::outputView to render the passed view. Returns the rendered view instead of outputting it.
|
202 |
+
*
|
203 |
+
* @since 2.3.0
|
204 |
+
* @param string $view
|
205 |
+
* @param stdClass $data (Optional, defaults to null)
|
206 |
+
* @return string
|
207 |
+
*/
|
208 |
+
static function getView($view, $data = null)
|
209 |
+
{
|
210 |
+
ob_start();
|
211 |
+
self::outputView($view, $data);
|
212 |
+
return ob_get_clean();
|
213 |
+
}
|
214 |
+
|
215 |
/**
|
216 |
* This function will load classes automatically on-call.
|
217 |
*
|
views/SlideshowPlugin/slideshow.php
CHANGED
@@ -1,39 +1,60 @@
|
|
1 |
-
|
2 |
|
3 |
-
<?php
|
4 |
-
<div class="slideshow_loading_icon"></div>
|
5 |
-
<?php endif; ?>
|
6 |
|
7 |
-
|
|
|
|
|
8 |
|
9 |
-
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
{
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
17 |
-
}
|
18 |
|
19 |
-
|
20 |
|
21 |
-
|
22 |
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
|
28 |
-
|
29 |
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
-
|
33 |
-
<!-- Error log
|
34 |
-
<?php foreach($log as $logMessage): ?>
|
35 |
-
- <?php echo htmlspecialchars($logMessage); ?>
|
36 |
-
<?php endforeach; ?>
|
37 |
-
-->
|
38 |
-
<?php endif; ?>
|
39 |
-
</div>
|
1 |
+
<?php if ($data instanceof stdClass) : ?>
|
2 |
|
3 |
+
<div class="slideshow_container slideshow_container_<?php echo htmlspecialchars($data->styleName); ?>" style="<?php echo (isset($data->settings['preserveSlideshowDimensions']) && $data->settings['preserveSlideshowDimensions'] == 'false' && isset($data->settings['height']) && $data->settings['height'] > 0) ? 'height: ' . $data->settings['height'] . 'px;' : ''; ?> <?php echo (isset($data->settings['maxWidth']) && $data->settings['maxWidth'] > 0) ? 'max-width: ' . $data->settings['maxWidth'] . 'px;' : ''; ?>" data-slideshow-id="<?php echo htmlspecialchars($data->post->ID); ?>" data-style-name="<?php echo htmlspecialchars($data->styleName); ?>" data-style-version="<?php echo htmlspecialchars($data->styleVersion); ?>" <?php if (SlideshowPluginGeneralSettings::getEnableLazyLoading()) : ?>data-settings="<?php echo htmlspecialchars(json_encode($data->settings)); ?>"<?php endif; ?>>
|
|
|
|
|
4 |
|
5 |
+
<?php if(isset($data->settings['showLoadingIcon']) && $data->settings['showLoadingIcon'] === 'true'): ?>
|
6 |
+
<div class="slideshow_loading_icon"></div>
|
7 |
+
<?php endif; ?>
|
8 |
|
9 |
+
<div class="slideshow_content" style="display: none;">
|
10 |
|
11 |
+
<?php
|
12 |
+
|
13 |
+
if (is_array($data->slides) && count($data->slides) > 0)
|
14 |
{
|
15 |
+
$i = 0;
|
16 |
+
|
17 |
+
for ($i; $i < count($data->slides); $i++)
|
18 |
+
{
|
19 |
+
echo '<div class="slideshow_view">';
|
20 |
+
|
21 |
+
for ($i; $i < count($data->slides); $i++)
|
22 |
+
{
|
23 |
+
$slideData = new stdClass();
|
24 |
+
$slideData->properties = $data->slides[$i];
|
25 |
+
|
26 |
+
SlideshowPluginMain::outputView('SlideshowPluginSlideshowSlide' . DIRECTORY_SEPARATOR . 'frontend_' . $data->slides[$i]['type'] . '.php', $slideData);
|
27 |
+
|
28 |
+
if (($i + 1) % $data->settings['slidesPerView'] == 0)
|
29 |
+
{
|
30 |
+
break;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
echo '<div style="clear: both;"></div></div>';
|
35 |
+
}
|
36 |
}
|
|
|
37 |
|
38 |
+
?>
|
39 |
|
40 |
+
</div>
|
41 |
|
42 |
+
<div class="slideshow_controlPanel slideshow_transparent" style="display: none;"><ul><li class="slideshow_togglePlay" data-play-text="<?php _e('Play', 'slideshow-jquery-image-gallery'); ?>" data-pause-text="<?php _e('Pause', 'slideshow-jquery-image-gallery'); ?>"></li></ul></div>
|
43 |
|
44 |
+
<div class="slideshow_button slideshow_previous slideshow_transparent" role="button" data-previous-text="<?php _e('Previous', 'slideshow-jquery-image-gallery'); ?>" style="display: none;"></div>
|
45 |
+
<div class="slideshow_button slideshow_next slideshow_transparent" role="button" data-next-text="<?php _e('Next', 'slideshow-jquery-image-gallery'); ?>" style="display: none;"></div>
|
46 |
|
47 |
+
<div class="slideshow_pagination" style="display: none;" data-go-to-text="<?php _e('Go to slide', 'slideshow-jquery-image-gallery'); ?>"><div class="slideshow_pagination_center"></div></div>
|
48 |
|
49 |
+
<!-- WordPress Slideshow Version <?php echo SlideshowPluginMain::$version; ?> -->
|
50 |
+
|
51 |
+
<?php if(is_array($data->log) && count($data->log) > 0): ?>
|
52 |
+
<!-- Error log
|
53 |
+
<?php foreach($data->log as $logMessage): ?>
|
54 |
+
- <?php echo htmlspecialchars($logMessage); ?>
|
55 |
+
<?php endforeach; ?>
|
56 |
+
-->
|
57 |
+
<?php endif; ?>
|
58 |
+
</div>
|
59 |
|
60 |
+
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/SlideshowPluginGeneralSettings/custom-styles-tab.php
CHANGED
@@ -1,210 +1,213 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
)
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
{
|
16 |
-
|
|
|
|
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
24 |
}
|
25 |
-
}
|
26 |
|
27 |
-
// Get custom styles
|
28 |
-
$customStyleValues = array();
|
29 |
-
$customStyleKeys = get_option(SlideshowPluginGeneralSettings::$customStyles, array());
|
30 |
|
31 |
-
if (is_array($customStyleKeys))
|
32 |
-
{
|
33 |
-
foreach ($customStyleKeys as $customStyleKey => $customStyleKeyName)
|
34 |
{
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
37 |
}
|
38 |
-
}
|
39 |
|
40 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
<
|
43 |
-
<div class="styles-list">
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
</p>
|
48 |
|
49 |
-
|
50 |
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
-
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
-
|
66 |
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
</li>
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
<?php endforeach; ?>
|
71 |
<?php endif; ?>
|
72 |
|
73 |
-
</
|
74 |
-
|
75 |
-
<p>
|
76 |
-
<b><?php _e('Custom stylesheets', 'slideshow-jquery-image-gallery'); ?></b>
|
77 |
-
</p>
|
78 |
|
79 |
-
<
|
80 |
|
81 |
-
|
82 |
-
<?php foreach($customStyleKeys as $customStyleKey => $customStyleKeyName): ?>
|
83 |
|
84 |
-
|
85 |
-
|
86 |
|
87 |
<span
|
88 |
-
class="style-action
|
89 |
title="<?php _e('Edit this style', 'slideshow-jquery-image-gallery'); ?>"
|
90 |
>
|
91 |
<?php _e('Edit', 'slideshow-jquery-image-gallery'); ?> »
|
92 |
</span>
|
93 |
|
94 |
-
|
95 |
|
96 |
<span
|
97 |
-
class="style-delete
|
98 |
title="<?php _e('Delete this style', 'slideshow-jquery-image-gallery'); ?>"
|
99 |
>
|
100 |
<?php _e('Delete', 'slideshow-jquery-image-gallery'); ?>
|
101 |
</span>
|
102 |
|
103 |
-
|
104 |
-
</li>
|
105 |
-
|
106 |
-
<?php endforeach; ?>
|
107 |
-
<?php else: ?>
|
108 |
-
|
109 |
-
<li class="no-custom-styles-found">
|
110 |
-
<?php _e("Click 'Customize' to create a new custom stylesheet."); ?>
|
111 |
</li>
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
</ul>
|
116 |
-
|
117 |
-
</div>
|
118 |
-
</div>
|
119 |
-
|
120 |
-
<div style="clear: both;"></div>
|
121 |
-
|
122 |
-
<div class="custom-styles-tab feature-filter" style="display: none;">
|
123 |
-
<div class="style-editors">
|
124 |
-
|
125 |
-
<p>
|
126 |
-
<b><?php _e('Custom style editor', 'slideshow-jquery-image-gallery'); ?></b>
|
127 |
-
</p>
|
128 |
-
|
129 |
-
<p class="style-editor">
|
130 |
-
<?php _e('Select a stylesheet to start customizing it.', 'slideshow-jquery-image-gallery'); ?>
|
131 |
-
</p>
|
132 |
-
|
133 |
-
<?php if(is_array($customStyleValues)): ?>
|
134 |
-
<?php foreach($customStyleValues as $customStyleKey => $customStyleValue): ?>
|
135 |
-
|
136 |
-
<div class="style-editor <?php echo htmlspecialchars($customStyleKey); ?>" style="display: none;">
|
137 |
|
138 |
<p>
|
139 |
<i><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></i><br />
|
140 |
<input
|
141 |
type="text"
|
142 |
-
|
143 |
-
|
144 |
-
/>
|
145 |
</p>
|
146 |
|
147 |
<p>
|
148 |
<i><?php _e('Style', 'slideshow-jquery-image-gallery'); ?></i><br />
|
149 |
<textarea
|
150 |
-
|
151 |
rows="25"
|
152 |
cols=""
|
153 |
-
|
154 |
</p>
|
155 |
|
156 |
</div>
|
157 |
-
|
158 |
-
<?php endforeach; ?>
|
159 |
-
<?php endif; ?>
|
160 |
-
|
161 |
-
</div>
|
162 |
-
|
163 |
-
<div style="clear: both;"></div>
|
164 |
-
|
165 |
-
<div class="custom-style-templates" style="display: none;">
|
166 |
-
|
167 |
-
<li class="custom-styles-list-item">
|
168 |
-
<span class="style-title"></span>
|
169 |
-
|
170 |
-
<span
|
171 |
-
class="style-action"
|
172 |
-
title="<?php _e('Edit this style', 'slideshow-jquery-image-gallery'); ?>"
|
173 |
-
>
|
174 |
-
<?php _e('Edit', 'slideshow-jquery-image-gallery'); ?> »
|
175 |
-
</span>
|
176 |
-
|
177 |
-
<span style="float: right;">|</span>
|
178 |
-
|
179 |
-
<span
|
180 |
-
class="style-delete"
|
181 |
-
title="<?php _e('Delete this style', 'slideshow-jquery-image-gallery'); ?>"
|
182 |
-
>
|
183 |
-
<?php _e('Delete', 'slideshow-jquery-image-gallery'); ?>
|
184 |
-
</span>
|
185 |
-
|
186 |
-
<p style="clear: both;"></p>
|
187 |
-
</li>
|
188 |
-
|
189 |
-
<div class="style-editor" style="display: none;">
|
190 |
-
|
191 |
-
<p>
|
192 |
-
<i><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></i><br />
|
193 |
-
<input
|
194 |
-
type="text"
|
195 |
-
class="new-custom-style-title"
|
196 |
-
/>
|
197 |
-
</p>
|
198 |
-
|
199 |
-
<p>
|
200 |
-
<i><?php _e('Style', 'slideshow-jquery-image-gallery'); ?></i><br />
|
201 |
-
<textarea
|
202 |
-
class="new-custom-style-content"
|
203 |
-
rows="25"
|
204 |
-
cols=""
|
205 |
-
></textarea>
|
206 |
-
</p>
|
207 |
-
|
208 |
</div>
|
209 |
</div>
|
210 |
-
|
1 |
<?php
|
2 |
|
3 |
+
if ($data instanceof stdClass) :
|
4 |
+
|
5 |
+
// Get default stylesheets
|
6 |
+
$defaultStyles = array();
|
7 |
+
$defaultStylesheets = array(
|
8 |
+
'style-light.css' => __('Light', 'slideshow-jquery-image-gallery'),
|
9 |
+
'style-dark.css' => __('Dark', 'slideshow-jquery-image-gallery')
|
10 |
+
);
|
11 |
+
|
12 |
+
$stylesheetsFilePath = SlideshowPluginMain::getPluginPath() . DIRECTORY_SEPARATOR . 'style' . DIRECTORY_SEPARATOR . 'SlideshowPlugin';
|
13 |
+
|
14 |
+
foreach ($defaultStylesheets as $fileName => $name)
|
15 |
{
|
16 |
+
if (file_exists($stylesheetsFilePath . DIRECTORY_SEPARATOR . $fileName))
|
17 |
+
{
|
18 |
+
ob_start();
|
19 |
|
20 |
+
include $stylesheetsFilePath . DIRECTORY_SEPARATOR . $fileName;
|
21 |
|
22 |
+
$defaultStyles[$fileName] = array(
|
23 |
+
'name' => $name,
|
24 |
+
'style' => ob_get_clean()
|
25 |
+
);
|
26 |
+
}
|
27 |
}
|
|
|
28 |
|
29 |
+
// Get custom styles
|
30 |
+
$customStyleValues = array();
|
31 |
+
$customStyleKeys = get_option(SlideshowPluginGeneralSettings::$customStyles, array());
|
32 |
|
33 |
+
if (is_array($customStyleKeys))
|
|
|
|
|
34 |
{
|
35 |
+
foreach ($customStyleKeys as $customStyleKey => $customStyleKeyName)
|
36 |
+
{
|
37 |
+
// Get custom style value from custom style key
|
38 |
+
$customStyleValues[$customStyleKey] = get_option($customStyleKey);
|
39 |
+
}
|
40 |
}
|
|
|
41 |
|
42 |
+
?>
|
43 |
+
|
44 |
+
<div class="custom-styles-tab feature-filter" style="float: left; display: none;">
|
45 |
+
<div class="styles-list">
|
46 |
+
|
47 |
+
<p>
|
48 |
+
<b><?php _e('Default stylesheets', 'slideshow-jquery-image-gallery'); ?></b>
|
49 |
+
</p>
|
50 |
|
51 |
+
<ul class="default-styles-list">
|
|
|
52 |
|
53 |
+
<?php if(is_array($defaultStyles)): ?>
|
54 |
+
<?php foreach($defaultStyles as $defaultStyleKey => $defaultStyleValues): ?>
|
|
|
55 |
|
56 |
+
<?php if(!isset($defaultStyleValues['style']) || empty($defaultStyleValues['style'])) continue; // Continue if style is not set or empty ?>
|
57 |
|
58 |
+
<li>
|
59 |
+
<span class="style-title"><?php echo (isset($defaultStyleValues['name'])) ? htmlspecialchars($defaultStyleValues['name']) : __('Untitled'); ?></span>
|
60 |
+
<span
|
61 |
+
class="style-action style-default <?php htmlspecialchars($defaultStyleKey); ?>"
|
62 |
+
title="<?php _e('Create a new custom style from this style', 'slideshow-jquery-image-gallery'); ?>"
|
63 |
+
>
|
64 |
+
<?php _e('Customize', 'slideshow-jquery-image-gallery'); ?> »
|
65 |
+
</span>
|
66 |
|
67 |
+
<p style="clear: both;"></p>
|
68 |
|
69 |
+
<span class="style-content" style="display: none;"><?php echo htmlspecialchars($defaultStyleValues['style']); ?></span>
|
70 |
+
</li>
|
71 |
+
|
72 |
+
<?php endforeach; ?>
|
73 |
+
<?php endif; ?>
|
74 |
+
|
75 |
+
</ul>
|
76 |
+
|
77 |
+
<p>
|
78 |
+
<b><?php _e('Custom stylesheets', 'slideshow-jquery-image-gallery'); ?></b>
|
79 |
+
</p>
|
80 |
+
|
81 |
+
<ul class="custom-styles-list">
|
82 |
+
|
83 |
+
<?php if(is_array($customStyleKeys) && count($customStyleKeys) > 0): ?>
|
84 |
+
<?php foreach($customStyleKeys as $customStyleKey => $customStyleKeyName): ?>
|
85 |
+
|
86 |
+
<li>
|
87 |
+
<span class="style-title"><?php echo htmlspecialchars($customStyleKeyName); ?></span>
|
88 |
+
|
89 |
+
<span
|
90 |
+
class="style-action <?php echo htmlspecialchars($customStyleKey); ?>"
|
91 |
+
title="<?php _e('Edit this style', 'slideshow-jquery-image-gallery'); ?>"
|
92 |
+
>
|
93 |
+
<?php _e('Edit', 'slideshow-jquery-image-gallery'); ?> »
|
94 |
+
</span>
|
95 |
|
96 |
+
<span style="float: right;">|</span>
|
97 |
|
98 |
+
<span
|
99 |
+
class="style-delete <?php echo htmlspecialchars($customStyleKey); ?>"
|
100 |
+
title="<?php _e('Delete this style', 'slideshow-jquery-image-gallery'); ?>"
|
101 |
+
>
|
102 |
+
<?php _e('Delete', 'slideshow-jquery-image-gallery'); ?>
|
103 |
+
</span>
|
104 |
+
|
105 |
+
<p style="clear: both;"></p>
|
106 |
+
</li>
|
107 |
+
|
108 |
+
<?php endforeach; ?>
|
109 |
+
<?php else: ?>
|
110 |
+
|
111 |
+
<li class="no-custom-styles-found">
|
112 |
+
<?php _e("Click 'Customize' to create a new custom stylesheet."); ?>
|
113 |
</li>
|
114 |
|
115 |
+
<?php endif; ?>
|
116 |
+
|
117 |
+
</ul>
|
118 |
+
|
119 |
+
</div>
|
120 |
+
</div>
|
121 |
+
|
122 |
+
<div style="clear: both;"></div>
|
123 |
+
|
124 |
+
<div class="custom-styles-tab feature-filter" style="display: none;">
|
125 |
+
<div class="style-editors">
|
126 |
+
|
127 |
+
<p>
|
128 |
+
<b><?php _e('Custom style editor', 'slideshow-jquery-image-gallery'); ?></b>
|
129 |
+
</p>
|
130 |
+
|
131 |
+
<p class="style-editor">
|
132 |
+
<?php _e('Select a stylesheet to start customizing it.', 'slideshow-jquery-image-gallery'); ?>
|
133 |
+
</p>
|
134 |
+
|
135 |
+
<?php if(is_array($customStyleValues)): ?>
|
136 |
+
<?php foreach($customStyleValues as $customStyleKey => $customStyleValue): ?>
|
137 |
+
|
138 |
+
<div class="style-editor <?php echo htmlspecialchars($customStyleKey); ?>" style="display: none;">
|
139 |
+
|
140 |
+
<p>
|
141 |
+
<i><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></i><br />
|
142 |
+
<input
|
143 |
+
type="text"
|
144 |
+
name="<?php echo SlideshowPluginGeneralSettings::$customStyles; ?>[<?php echo htmlspecialchars($customStyleKey); ?>][title]"
|
145 |
+
value="<?php echo (isset($customStyleKeys[$customStyleKey]) && !empty($customStyleKeys[$customStyleKey])) ? $customStyleKeys[$customStyleKey] : __('Untitled', 'slideshow-jquery-image-gallery'); ?>"
|
146 |
+
/>
|
147 |
+
</p>
|
148 |
+
|
149 |
+
<p>
|
150 |
+
<i><?php _e('Style', 'slideshow-jquery-image-gallery'); ?></i><br />
|
151 |
+
<textarea
|
152 |
+
name="<?php echo SlideshowPluginGeneralSettings::$customStyles; ?>[<?php echo htmlspecialchars($customStyleKey); ?>][style]"
|
153 |
+
rows="25"
|
154 |
+
cols=""
|
155 |
+
><?php echo isset($customStyleValue) ? htmlspecialchars($customStyleValue) : ''; ?></textarea>
|
156 |
+
</p>
|
157 |
+
|
158 |
+
</div>
|
159 |
+
|
160 |
<?php endforeach; ?>
|
161 |
<?php endif; ?>
|
162 |
|
163 |
+
</div>
|
|
|
|
|
|
|
|
|
164 |
|
165 |
+
<div style="clear: both;"></div>
|
166 |
|
167 |
+
<div class="custom-style-templates" style="display: none;">
|
|
|
168 |
|
169 |
+
<li class="custom-styles-list-item">
|
170 |
+
<span class="style-title"></span>
|
171 |
|
172 |
<span
|
173 |
+
class="style-action"
|
174 |
title="<?php _e('Edit this style', 'slideshow-jquery-image-gallery'); ?>"
|
175 |
>
|
176 |
<?php _e('Edit', 'slideshow-jquery-image-gallery'); ?> »
|
177 |
</span>
|
178 |
|
179 |
+
<span style="float: right;">|</span>
|
180 |
|
181 |
<span
|
182 |
+
class="style-delete"
|
183 |
title="<?php _e('Delete this style', 'slideshow-jquery-image-gallery'); ?>"
|
184 |
>
|
185 |
<?php _e('Delete', 'slideshow-jquery-image-gallery'); ?>
|
186 |
</span>
|
187 |
|
188 |
+
<p style="clear: both;"></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
</li>
|
190 |
|
191 |
+
<div class="style-editor" style="display: none;">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
|
193 |
<p>
|
194 |
<i><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></i><br />
|
195 |
<input
|
196 |
type="text"
|
197 |
+
class="new-custom-style-title"
|
198 |
+
/>
|
|
|
199 |
</p>
|
200 |
|
201 |
<p>
|
202 |
<i><?php _e('Style', 'slideshow-jquery-image-gallery'); ?></i><br />
|
203 |
<textarea
|
204 |
+
class="new-custom-style-content"
|
205 |
rows="25"
|
206 |
cols=""
|
207 |
+
></textarea>
|
208 |
</p>
|
209 |
|
210 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
</div>
|
212 |
</div>
|
213 |
+
<?php endif; ?>
|
views/SlideshowPluginGeneralSettings/default-slideshow-settings-tab.php
CHANGED
@@ -1,106 +1,109 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
$defaultSettings = SlideshowPluginSlideshowSettingsHandler::getDefaultSettings(true);
|
5 |
-
$defaultStyleSettings = SlideshowPluginSlideshowSettingsHandler::getDefaultStyleSettings(true);
|
6 |
|
7 |
-
|
|
|
|
|
8 |
|
9 |
-
|
10 |
-
<p>
|
11 |
-
<strong><?php _e('Note', 'slideshow-jquery-image-gallery'); ?>:</strong>
|
12 |
-
</p>
|
13 |
|
14 |
-
<
|
15 |
-
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
'<a href="' . get_admin_url(null, 'edit.php?post_type=' . SlideshowPluginPostType::$postType) . '">',
|
20 |
-
'</a>'
|
21 |
-
);
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
26 |
|
27 |
-
|
|
|
|
|
28 |
|
29 |
-
<
|
30 |
|
31 |
-
|
32 |
|
33 |
-
|
34 |
-
<?php foreach($defaultSettings as $defaultSettingKey => $defaultSettingValue): ?>
|
35 |
|
36 |
-
|
|
|
37 |
|
38 |
-
|
39 |
-
<td colspan="3" style="border-bottom: 1px solid #dfdfdf; text-align: center;">
|
40 |
-
<span style="display: inline-block; position: relative; top: 14px; padding: 0 12px; background: #fff;">
|
41 |
-
<?php echo $defaultSettingValue['group']; ?> <?php _e('settings', 'slideshow-jquery-image-gallery'); ?>
|
42 |
-
</span>
|
43 |
-
</td>
|
44 |
-
</tr>
|
45 |
-
<tr>
|
46 |
-
<td colspan="3"></td>
|
47 |
-
</tr>
|
48 |
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
-
|
52 |
-
<td>
|
53 |
-
<?php echo $defaultSettingValue['description']; ?>
|
54 |
-
</td>
|
55 |
-
<td>
|
56 |
-
<?php
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
$
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
68 |
|
69 |
-
|
70 |
-
|
|
|
71 |
|
72 |
-
|
73 |
-
|
74 |
|
75 |
-
|
|
|
76 |
|
77 |
-
<
|
78 |
|
79 |
-
|
80 |
|
81 |
-
|
82 |
|
83 |
-
|
84 |
-
<td>
|
85 |
-
<?php echo $defaultStyleSettingValue['description']; ?>
|
86 |
-
</td>
|
87 |
-
<td>
|
88 |
-
<?php
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
$
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
|
97 |
-
|
98 |
-
|
99 |
-
|
|
|
|
|
|
|
100 |
|
101 |
-
|
|
|
|
|
102 |
|
103 |
-
|
104 |
-
</div>
|
105 |
|
106 |
-
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
|
3 |
+
if ($data instanceof stdClass) :
|
|
|
|
|
4 |
|
5 |
+
// Default settings
|
6 |
+
$defaultSettings = SlideshowPluginSlideshowSettingsHandler::getDefaultSettings(true);
|
7 |
+
$defaultStyleSettings = SlideshowPluginSlideshowSettingsHandler::getDefaultStyleSettings(true);
|
8 |
|
9 |
+
?>
|
|
|
|
|
|
|
10 |
|
11 |
+
<div class="default-slideshow-settings-tab" style="display: none; float: none;">
|
12 |
+
<p>
|
13 |
+
<strong><?php _e('Note', 'slideshow-jquery-image-gallery'); ?>:</strong>
|
14 |
+
</p>
|
15 |
|
16 |
+
<p style="width: 500px;">
|
17 |
+
<?php
|
|
|
|
|
|
|
18 |
|
19 |
+
echo sprintf(__(
|
20 |
+
'The settings set on this page apply only to newly created slideshows and therefore do not alter any existing ones. To adapt a slideshow\'s settings, %sclick here.%s', 'slideshow-jquery-image-gallery'),
|
21 |
+
'<a href="' . get_admin_url(null, 'edit.php?post_type=' . SlideshowPluginPostType::$postType) . '">',
|
22 |
+
'</a>'
|
23 |
+
);
|
24 |
|
25 |
+
?>
|
26 |
+
</p>
|
27 |
+
</div>
|
28 |
|
29 |
+
<div class="default-slideshow-settings-tab feature-filter" style="display: none;">
|
30 |
|
31 |
+
<h4><?php _e('Default Slideshow Settings', 'slideshow-jquery-image-gallery'); ?></h4>
|
32 |
|
33 |
+
<table>
|
|
|
34 |
|
35 |
+
<?php $groups = array(); ?>
|
36 |
+
<?php foreach($defaultSettings as $defaultSettingKey => $defaultSettingValue): ?>
|
37 |
|
38 |
+
<?php if(!empty($defaultSettingValue['group']) && !isset($groups[$defaultSettingValue['group']])): $groups[$defaultSettingValue['group']] = true; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
+
<tr>
|
41 |
+
<td colspan="3" style="border-bottom: 1px solid #dfdfdf; text-align: center;">
|
42 |
+
<span style="display: inline-block; position: relative; top: 14px; padding: 0 12px; background: #fff;">
|
43 |
+
<?php echo $defaultSettingValue['group']; ?> <?php _e('settings', 'slideshow-jquery-image-gallery'); ?>
|
44 |
+
</span>
|
45 |
+
</td>
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
<td colspan="3"></td>
|
49 |
+
</tr>
|
50 |
|
51 |
+
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
+
<tr>
|
54 |
+
<td>
|
55 |
+
<?php echo $defaultSettingValue['description']; ?>
|
56 |
+
</td>
|
57 |
+
<td>
|
58 |
+
<?php
|
59 |
|
60 |
+
echo SlideshowPluginSlideshowSettingsHandler::getInputField(
|
61 |
+
SlideshowPluginGeneralSettings::$defaultSettings,
|
62 |
+
$defaultSettingKey,
|
63 |
+
$defaultSettingValue,
|
64 |
+
/* hideDependentValues = */ false
|
65 |
+
);
|
66 |
|
67 |
+
?>
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
|
71 |
+
<?php endforeach; ?>
|
72 |
+
<?php unset($groups); ?>
|
73 |
|
74 |
+
</table>
|
75 |
+
</div>
|
76 |
|
77 |
+
<div class="default-slideshow-settings-tab feature-filter" style="display: none;">
|
78 |
|
79 |
+
<h4><?php _e('Default Slideshow Stylesheet', 'slideshow-jquery-image-gallery'); ?></h4>
|
80 |
|
81 |
+
<table>
|
82 |
|
83 |
+
<?php foreach($defaultStyleSettings as $defaultStyleSettingKey => $defaultStyleSettingValue): ?>
|
|
|
|
|
|
|
|
|
|
|
84 |
|
85 |
+
<tr>
|
86 |
+
<td>
|
87 |
+
<?php echo $defaultStyleSettingValue['description']; ?>
|
88 |
+
</td>
|
89 |
+
<td>
|
90 |
+
<?php
|
91 |
|
92 |
+
echo SlideshowPluginSlideshowSettingsHandler::getInputField(
|
93 |
+
SlideshowPluginGeneralSettings::$defaultStyleSettings,
|
94 |
+
$defaultStyleSettingKey,
|
95 |
+
$defaultStyleSettingValue,
|
96 |
+
/* hideDependentValues = */ false
|
97 |
+
);
|
98 |
|
99 |
+
?>
|
100 |
+
</td>
|
101 |
+
</tr>
|
102 |
|
103 |
+
<?php endforeach; ?>
|
|
|
104 |
|
105 |
+
</table>
|
106 |
+
</div>
|
107 |
+
|
108 |
+
<div style="clear: both;"></div>
|
109 |
+
<?php endif; ?>
|
views/SlideshowPluginGeneralSettings/general-settings-tab.php
CHANGED
@@ -1,79 +1,90 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
$stylesheetLocation = SlideshowPluginGeneralSettings::getStylesheetLocation();
|
5 |
|
6 |
-
//
|
7 |
-
|
|
|
8 |
|
9 |
-
//
|
10 |
-
$
|
11 |
-
SlideshowPluginGeneralSettings::$capabilities['addSlideshows'] => __('Add slideshows', 'slideshow-jquery-image-gallery'),
|
12 |
-
SlideshowPluginGeneralSettings::$capabilities['editSlideshows'] => __('Edit slideshows', 'slideshow-jquery-image-gallery'),
|
13 |
-
SlideshowPluginGeneralSettings::$capabilities['deleteSlideshows'] => __('Delete slideshows', 'slideshow-jquery-image-gallery')
|
14 |
-
);
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
|
19 |
|
20 |
-
<
|
21 |
|
22 |
-
|
23 |
|
24 |
-
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
<th><?php echo $capabilityName; ?></th>
|
30 |
-
<td>
|
31 |
-
<?php
|
32 |
|
33 |
-
|
34 |
-
|
|
|
|
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
$name = (isset($values['name'])) ? htmlspecialchars($values['name']) : __('Untitled role', 'slideshow-jquery-image-gallery');
|
39 |
|
40 |
-
|
|
|
|
|
41 |
|
42 |
-
|
43 |
-
type="checkbox"
|
44 |
-
name="<?php echo htmlspecialchars($capability); ?>[<?php echo htmlspecialchars($roleSlug); ?>]"
|
45 |
-
id="<?php echo htmlspecialchars($capability . '_' . $roleSlug); ?>"
|
46 |
-
<?php echo $disabled; ?>
|
47 |
-
<?php echo $checked; ?>
|
48 |
-
/>
|
49 |
-
<label for="<?php echo htmlspecialchars($capability . '_' . $roleSlug); ?>"><?php echo $name; ?></label>
|
50 |
-
<br />
|
51 |
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
57 |
|
58 |
-
|
|
|
59 |
|
60 |
-
|
61 |
-
</div>
|
62 |
|
63 |
-
|
|
|
64 |
|
65 |
-
<
|
66 |
|
67 |
-
|
68 |
-
<tr>
|
69 |
-
<td><?php _e('Stylesheet location', 'slideshow-jquery-image-gallery'); ?></td>
|
70 |
-
<td>
|
71 |
-
<select name="<?php echo SlideshowPluginGeneralSettings::$stylesheetLocation; ?>">
|
72 |
-
<option value="head" <?php selected('head', $stylesheetLocation); ?>>Head (<?php _e('top', 'slideshow-jquery-image-gallery'); ?>)</option>
|
73 |
-
<option value="footer" <?php selected('footer', $stylesheetLocation); ?>>Footer (<?php _e('bottom', 'slideshow-jquery-image-gallery'); ?>)</option>
|
74 |
-
</select>
|
75 |
-
</td>
|
76 |
-
</tr>
|
77 |
-
</table>
|
78 |
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
|
3 |
+
if ($data instanceof stdClass) :
|
|
|
4 |
|
5 |
+
// General settings
|
6 |
+
$stylesheetLocation = SlideshowPluginGeneralSettings::getStylesheetLocation();
|
7 |
+
$enableLazyLoading = SlideshowPluginGeneralSettings::getEnableLazyLoading();
|
8 |
|
9 |
+
// Roles
|
10 |
+
global $wp_roles;
|
|
|
|
|
|
|
|
|
11 |
|
12 |
+
// Capabilities
|
13 |
+
$capabilities = array(
|
14 |
+
SlideshowPluginGeneralSettings::$capabilities['addSlideshows'] => __('Add slideshows', 'slideshow-jquery-image-gallery'),
|
15 |
+
SlideshowPluginGeneralSettings::$capabilities['editSlideshows'] => __('Edit slideshows', 'slideshow-jquery-image-gallery'),
|
16 |
+
SlideshowPluginGeneralSettings::$capabilities['deleteSlideshows'] => __('Delete slideshows', 'slideshow-jquery-image-gallery')
|
17 |
+
);
|
18 |
|
19 |
+
?>
|
20 |
|
21 |
+
<div class="general-settings-tab feature-filter">
|
22 |
|
23 |
+
<h4><?php _e('User Capabilities', 'slideshow-jquery-image-gallery'); ?></h4>
|
24 |
|
25 |
+
<p><?php _e('Select the user roles that will able to perform certain actions.', 'slideshow-jquery-image-gallery'); ?></p>
|
26 |
|
27 |
+
<table>
|
28 |
|
29 |
+
<?php foreach($capabilities as $capability => $capabilityName): ?>
|
|
|
|
|
|
|
30 |
|
31 |
+
<tr valign="top">
|
32 |
+
<th><?php echo $capabilityName; ?></th>
|
33 |
+
<td>
|
34 |
+
<?php
|
35 |
|
36 |
+
if(isset($wp_roles->roles) && is_array($wp_roles->roles)):
|
37 |
+
foreach($wp_roles->roles as $roleSlug => $values):
|
|
|
38 |
|
39 |
+
$disabled = ($roleSlug == 'administrator') ? 'disabled="disabled"' : '';
|
40 |
+
$checked = ((isset($values['capabilities']) && array_key_exists($capability, $values['capabilities']) && $values['capabilities'][$capability] == true) || $roleSlug == 'administrator') ? 'checked="checked"' : '';
|
41 |
+
$name = (isset($values['name'])) ? htmlspecialchars($values['name']) : __('Untitled role', 'slideshow-jquery-image-gallery');
|
42 |
|
43 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
+
<input
|
46 |
+
type="checkbox"
|
47 |
+
name="<?php echo htmlspecialchars($capability); ?>[<?php echo htmlspecialchars($roleSlug); ?>]"
|
48 |
+
id="<?php echo htmlspecialchars($capability . '_' . $roleSlug); ?>"
|
49 |
+
<?php echo $disabled; ?>
|
50 |
+
<?php echo $checked; ?>
|
51 |
+
/>
|
52 |
+
<label for="<?php echo htmlspecialchars($capability . '_' . $roleSlug); ?>"><?php echo $name; ?></label>
|
53 |
+
<br />
|
54 |
|
55 |
+
<?php endforeach; ?>
|
56 |
+
<?php endif; ?>
|
57 |
|
58 |
+
</td>
|
59 |
+
</tr>
|
60 |
|
61 |
+
<?php endforeach; ?>
|
|
|
62 |
|
63 |
+
</table>
|
64 |
+
</div>
|
65 |
|
66 |
+
<div class="general-settings-tab feature-filter">
|
67 |
|
68 |
+
<h4><?php _e('Settings', 'slideshow-jquery-image-gallery'); ?></h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
+
<table>
|
71 |
+
<tr>
|
72 |
+
<td><?php _e('Stylesheet location', 'slideshow-jquery-image-gallery'); ?></td>
|
73 |
+
<td>
|
74 |
+
<select name="<?php echo SlideshowPluginGeneralSettings::$stylesheetLocation; ?>">
|
75 |
+
<option value="head" <?php selected('head', $stylesheetLocation); ?>>Head (<?php _e('top', 'slideshow-jquery-image-gallery'); ?>)</option>
|
76 |
+
<option value="footer" <?php selected('footer', $stylesheetLocation); ?>>Footer (<?php _e('bottom', 'slideshow-jquery-image-gallery'); ?>)</option>
|
77 |
+
</select>
|
78 |
+
</td>
|
79 |
+
</tr>
|
80 |
+
<tr>
|
81 |
+
<td><?php _e('Enable lazy loading', 'slideshow-jquery-image-gallery'); ?></td>
|
82 |
+
<td>
|
83 |
+
<input type="radio" name="<?php echo SlideshowPluginGeneralSettings::$enableLazyLoading; ?>" <?php checked(true, $enableLazyLoading); ?> value="true" /> <?php _e('Yes', 'slideshow-jquery-image-gallery'); ?>
|
84 |
+
<input type="radio" name="<?php echo SlideshowPluginGeneralSettings::$enableLazyLoading; ?>" <?php checked(false, $enableLazyLoading); ?> value="false" /> <?php _e('No', 'slideshow-jquery-image-gallery'); ?>
|
85 |
+
</td>
|
86 |
+
</tr>
|
87 |
+
</table>
|
88 |
+
|
89 |
+
</div>
|
90 |
+
<?php endif; ?>
|
views/SlideshowPluginGeneralSettings/general-settings.php
CHANGED
@@ -1,38 +1,41 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
$generalSettingsViewsPath = SlideshowPluginMain::getPluginPath() . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'SlideshowPluginGeneralSettings' . DIRECTORY_SEPARATOR;
|
5 |
|
6 |
-
|
|
|
7 |
|
8 |
-
|
9 |
-
<form method="post" action="options.php">
|
10 |
-
<?php settings_fields(SlideshowPluginGeneralSettings::$settingsGroup); ?>
|
11 |
|
12 |
-
|
13 |
-
<
|
14 |
-
|
15 |
-
<a href="#default-slideshow-settings-tab" class="nav-tab"><?php _e('Default Slideshow Settings', 'slideshow-jquery-image-gallery'); ?></a>
|
16 |
-
<a href="#custom-styles-tab" class="nav-tab"><?php _e('Custom Styles', 'slideshow-jquery-image-gallery'); ?></a>
|
17 |
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
20 |
|
21 |
-
|
|
|
22 |
|
23 |
-
|
24 |
-
include $generalSettingsViewsPath . 'general-settings-tab.php';
|
25 |
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
|
31 |
|
32 |
-
|
|
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
</
|
|
|
|
|
|
1 |
<?php
|
2 |
|
3 |
+
if ($data instanceof stdClass) :
|
|
|
4 |
|
5 |
+
// Path to the General Settings' views folder
|
6 |
+
$generalSettingsViewsPath = SlideshowPluginMain::getPluginPath() . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'SlideshowPluginGeneralSettings' . DIRECTORY_SEPARATOR;
|
7 |
|
8 |
+
?>
|
|
|
|
|
9 |
|
10 |
+
<div class="wrap">
|
11 |
+
<form method="post" action="options.php">
|
12 |
+
<?php settings_fields(SlideshowPluginGeneralSettings::$settingsGroup); ?>
|
|
|
|
|
13 |
|
14 |
+
<div class="icon32" style="background: url('<?php echo SlideshowPluginMain::getPluginUrl() . '/images/SlideshowPluginPostType/adminIcon32.png'; ?>');"></div>
|
15 |
+
<h2 class="nav-tab-wrapper">
|
16 |
+
<a href="#general-settings-tab" class="nav-tab nav-tab-active"><?php _e('General Settings', 'slideshow-jquery-image-gallery'); ?></a>
|
17 |
+
<a href="#default-slideshow-settings-tab" class="nav-tab"><?php _e('Default Slideshow Settings', 'slideshow-jquery-image-gallery'); ?></a>
|
18 |
+
<a href="#custom-styles-tab" class="nav-tab"><?php _e('Custom Styles', 'slideshow-jquery-image-gallery'); ?></a>
|
19 |
|
20 |
+
<?php submit_button(null, 'primary', null, false, 'style="float: right;"'); ?>
|
21 |
+
</h2>
|
22 |
|
23 |
+
<?php
|
|
|
24 |
|
25 |
+
// General Settings
|
26 |
+
SlideshowPluginMain::outputView('SlideshowPluginGeneralSettings' . DIRECTORY_SEPARATOR . 'general-settings-tab.php');
|
27 |
|
28 |
+
// Default slideshow settings
|
29 |
+
SlideshowPluginMain::outputView('SlideshowPluginGeneralSettings' . DIRECTORY_SEPARATOR . 'default-slideshow-settings-tab.php');
|
30 |
|
31 |
+
// Custom styles
|
32 |
+
SlideshowPluginMain::outputView('SlideshowPluginGeneralSettings' . DIRECTORY_SEPARATOR . 'custom-styles-tab.php');
|
33 |
|
34 |
+
?>
|
35 |
+
|
36 |
+
<p>
|
37 |
+
<?php submit_button(null, 'primary', null, false); ?>
|
38 |
+
</p>
|
39 |
+
</form>
|
40 |
+
</div>
|
41 |
+
<?php endif; ?>
|
views/SlideshowPluginPostType/information.php
CHANGED
@@ -1,9 +1,13 @@
|
|
1 |
-
|
2 |
-
<p><i><?php echo $shortCode; ?></i></p>
|
3 |
|
4 |
-
|
5 |
-
<p><?php
|
6 |
-
<p><i><?php echo $snippet; ?></i></p>
|
7 |
-
<?php endif; ?>
|
8 |
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ($data instanceof stdClass) : ?>
|
|
|
2 |
|
3 |
+
<p><?php _e('To use this slideshow in your website either add this piece of shortcode to your posts or pages', 'slideshow-jquery-image-gallery'); ?>:</p>
|
4 |
+
<p style="font-style: italic;"><?php echo $data->shortCode; ?></p>
|
|
|
|
|
5 |
|
6 |
+
<?php if(current_user_can('edit_themes')): ?>
|
7 |
+
<p><?php _e('Or add this piece of code to where ever in your website you want to place the slideshow', 'slideshow-jquery-image-gallery'); ?>:</p>
|
8 |
+
<p style="font-style: italic;"><?php echo $data->snippet; ?></p>
|
9 |
+
<?php endif; ?>
|
10 |
+
|
11 |
+
<p><?php echo sprintf(__('Or go to the %swidgets page%s and show the slideshow as a widget.', 'slideshow-jquery-image-gallery'), '<a href="' . get_admin_url(null, 'widgets.php') . '" target="_blank">', '</a>'); ?></p>
|
12 |
+
|
13 |
+
<?php endif; ?>
|
views/SlideshowPluginPostType/settings.php
CHANGED
@@ -1,31 +1,33 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
|
|
5 |
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
</table>
|
|
1 |
+
<?php if ($data instanceof stdClass) : ?>
|
2 |
+
<table>
|
3 |
+
<?php $groups = array(); ?>
|
4 |
+
<?php if(count($data->settings) > 0): ?>
|
5 |
+
<?php foreach($data->settings as $key => $value): ?>
|
6 |
|
7 |
+
<?php if( !isset($value, $value['type'], $value['default'], $value['description']) || !is_array($value)) continue; ?>
|
8 |
|
9 |
+
<?php if(!empty($value['group']) && !isset($groups[$value['group']])): $groups[$value['group']] = true; ?>
|
10 |
+
<tr>
|
11 |
+
<td colspan="3" style="border-bottom: 1px solid #e5e5e5; text-align: center;">
|
12 |
+
<span style="display: inline-block; position: relative; top: 14px; padding: 0 12px; background: #fff;">
|
13 |
+
<?php echo $value['group']; ?> <?php _e('settings', 'slideshow-jquery-image-gallery'); ?>
|
14 |
+
</span>
|
15 |
+
</td>
|
16 |
+
</tr>
|
17 |
+
<tr>
|
18 |
+
<td colspan="3"></td>
|
19 |
+
</tr>
|
20 |
+
<?php endif; ?>
|
21 |
+
<tr
|
22 |
+
<?php echo !empty($value['group'])? 'class="group-' . strtolower(str_replace(' ', '-', $value['group'])) . '"': ''; ?>
|
23 |
+
<?php echo !empty($value['dependsOn'])? 'style="display:none;"': ''; ?>
|
24 |
+
>
|
25 |
+
<td><?php echo $value['description']; ?></td>
|
26 |
+
<td><?php echo SlideshowPluginSlideshowSettingsHandler::getInputField(SlideshowPluginSlideshowSettingsHandler::$settingsKey, htmlspecialchars($key), $value); ?></td>
|
27 |
+
<td><?php _e('Default', 'slideshow-jquery-image-gallery'); ?>: '<?php echo (isset($value['options']))? $value['options'][$value['default']]: $value['default']; ?>'</td>
|
28 |
+
</tr>
|
29 |
|
30 |
+
<?php endforeach; ?>
|
31 |
+
<?php endif; ?>
|
32 |
+
</table>
|
33 |
+
<?php endif; ?>
|
views/SlideshowPluginPostType/slides.php
CHANGED
@@ -1,294 +1,45 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
<p
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
.sortable-slide-placeholder {
|
19 |
-
border: 1px solid #f00;
|
20 |
-
}
|
21 |
-
</style>
|
22 |
-
|
23 |
-
<ul class="sortable-slides-list">
|
24 |
-
<?php if(count($slides) > 0): ?>
|
25 |
-
<?php foreach($slides as $key => $slide):
|
26 |
-
// General values
|
27 |
-
$url = $target = $order = '';
|
28 |
-
if(isset($slide['url']))
|
29 |
-
$url = $slide['url'];
|
30 |
-
if(isset($slide['urlTarget']))
|
31 |
-
$target = $slide['urlTarget'];
|
32 |
-
if(isset($slide['order']))
|
33 |
-
$order = $slide['order'];
|
34 |
-
|
35 |
-
// The name is used to prefix a setting name with
|
36 |
-
$name = SlideshowPluginSlideshowSettingsHandler::$slidesKey . '[' . $key . ']';
|
37 |
-
?>
|
38 |
-
|
39 |
-
<li class="widefat sortable-slides-list-item" style="margin: 10px 0; width: auto; background-color: #fafafa;">
|
40 |
-
<?php if($slide['type'] == 'text'):
|
41 |
-
|
42 |
-
// Type specific values
|
43 |
-
$title = $description = $color = '';
|
44 |
-
if(isset($slide['title']))
|
45 |
-
$title = $slide['title'];
|
46 |
-
if(isset($slide['description']))
|
47 |
-
$description = $slide['description'];
|
48 |
-
if(isset($slide['color']))
|
49 |
-
$color = $slide['color'];
|
50 |
-
?>
|
51 |
-
|
52 |
-
<h3 class="hndle">
|
53 |
-
<span style="font-size: 0.8em;">
|
54 |
-
<?php _e('Text slide', 'slideshow-jquery-image-gallery'); ?>
|
55 |
-
</span>
|
56 |
-
</h3>
|
57 |
-
|
58 |
-
<p style="margin: 5px 15px 5px 5px;">
|
59 |
-
<i><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></i><br />
|
60 |
-
<input type="text" name="<?php echo $name; ?>[title]" value="<?php echo $title; ?>" /><br />
|
61 |
-
<i><?php _e('Description', 'slideshow-jquery-image-gallery'); ?></i><br />
|
62 |
-
<textarea name="<?php echo $name; ?>[description]" rows="7" cols="" style="width: 100%;"><?php echo $description; ?></textarea><br />
|
63 |
-
<i><?php _e('Background color', 'slideshow-jquery-image-gallery'); ?></i><br />
|
64 |
-
<input type="text" name="<?php echo $name; ?>[color]" value="<?php echo $color; ?>" class="color {required:false}" />
|
65 |
-
</p>
|
66 |
-
|
67 |
-
<p style="margin: 5px 15px 5px 5px;">
|
68 |
-
<i><?php _e('URL', 'slideshow-jquery-image-gallery'); ?></i><br />
|
69 |
-
<input type="text" name="<?php echo $name; ?>[url]" value="<?php echo $url; ?>" /><br />
|
70 |
-
<i><?php _e('Open URL in', 'slideshow-jquery-image-gallery'); ?></i>
|
71 |
-
<select name="<?php echo $name; ?>[urlTarget]">
|
72 |
-
<option value="_self" <?php selected('_self', $target); ?>><?php _e('Same window', 'slideshow-jquery-image-gallery'); ?></option>
|
73 |
-
<option value="_blank" <?php selected('_blank', $target); ?>><?php _e('New window', 'slideshow-jquery-image-gallery'); ?></option>
|
74 |
-
</select>
|
75 |
-
</p>
|
76 |
-
|
77 |
-
<input type="hidden" name="<?php echo $name; ?>[type]" value="text" />
|
78 |
-
<input type="hidden" name="<?php echo $name; ?>[order]" value="<?php echo $order; ?>" class="slide_order" />
|
79 |
-
|
80 |
-
<?php elseif($slide['type'] == 'video'):
|
81 |
-
|
82 |
-
// Type specific values
|
83 |
-
$videoId = '';
|
84 |
-
if(isset($slide['videoId']))
|
85 |
-
$videoId = $slide['videoId'];
|
86 |
-
?>
|
87 |
-
|
88 |
-
<h3 class="hndle">
|
89 |
-
<span style="font-size: 0.8em;">
|
90 |
-
<?php _e('Video slide', 'slideshow-jquery-image-gallery'); ?>
|
91 |
-
</span>
|
92 |
-
</h3>
|
93 |
-
|
94 |
-
<p style="margin: 5px 15px 5px 5px;">
|
95 |
-
<i><?php _e('Youtube Video ID', 'slideshow-jquery-image-gallery'); ?></i><br />
|
96 |
-
<input type="text" name="<?php echo $name; ?>[videoId]" value="<?php echo $videoId; ?>" />
|
97 |
-
</p>
|
98 |
-
|
99 |
-
<input type="hidden" name="<?php echo $name; ?>[type]" value="video" />
|
100 |
-
<input type="hidden" name="<?php echo $name; ?>[order]" value="<?php echo $order; ?>" class="slide_order" />
|
101 |
-
|
102 |
-
<?php elseif($slide['type'] == 'attachment'):
|
103 |
-
|
104 |
-
// The attachment should always be there
|
105 |
-
$attachment = get_post($slide['postId']);
|
106 |
-
if(!isset($attachment))
|
107 |
-
continue;
|
108 |
-
|
109 |
-
// Title and description
|
110 |
-
$title = $description = '';
|
111 |
-
if(isset($slide['title']))
|
112 |
-
$title = $slide['title'];
|
113 |
-
if(isset($slide['description']))
|
114 |
-
$description = $slide['description'];
|
115 |
-
|
116 |
-
// Prepare image
|
117 |
-
$image = wp_get_attachment_image_src($attachment->ID);
|
118 |
-
$imageSrc = '';
|
119 |
-
if(!is_array($image) || !$image){
|
120 |
-
if(!empty($attachment->guid))
|
121 |
-
$imageSrc = $attachment->guid;
|
122 |
-
else
|
123 |
-
continue;
|
124 |
-
}else{
|
125 |
-
$imageSrc = $image[0];
|
126 |
-
}
|
127 |
-
if(!$imageSrc || empty($imageSrc)) $imageSrc = $noPreviewIcon;
|
128 |
-
|
129 |
-
$editUrl = admin_url() . '/media.php?attachment_id=' . $attachment->ID . '&action=edit'; ?>
|
130 |
-
|
131 |
-
<h3 class="hndle">
|
132 |
-
<span style="font-size: 0.8em;">
|
133 |
-
<?php _e('Image slide', 'slideshow-jquery-image-gallery'); ?>
|
134 |
-
</span>
|
135 |
-
</h3>
|
136 |
-
|
137 |
-
<p style="float: left; margin: 5px;">
|
138 |
-
<a href="<?php echo $editUrl; ?>" title="<?php _e('Edit', 'slideshow-jquery-image-gallery'); ?> "<?php echo $attachment->post_title; ?>"">
|
139 |
-
<img width="80" height="60" src="<?php echo $imageSrc; ?>" class="attachment-80x60" alt="<?php echo $attachment->post_title; ?>" title="<?php echo $attachment->post_title; ?>" />
|
140 |
-
</a>
|
141 |
-
</p>
|
142 |
-
|
143 |
-
<p style="float: left; margin: 5px 15px 5px 5px;">
|
144 |
-
<i><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></i><br />
|
145 |
-
<input type="text" name="<?php echo $name; ?>[title]" value="<?php echo $title; ?>" />
|
146 |
-
</p>
|
147 |
-
<p style="clear: both"></p>
|
148 |
-
|
149 |
-
<p style="margin: 5px 15px 5px 5px;">
|
150 |
-
<i><?php _e('Description', 'slideshow-jquery-image-gallery'); ?></i><br />
|
151 |
-
<textarea name="<?php echo $name; ?>[description]" rows="3" cols="" style="width: 100%;"><?php echo $description; ?></textarea><br />
|
152 |
-
</p>
|
153 |
-
|
154 |
-
<p style="margin: 5px 15px 5px 5px;">
|
155 |
-
<i><?php _e('URL', 'slideshow-jquery-image-gallery'); ?></i><br />
|
156 |
-
<input type="text" name="<?php echo $name; ?>[url]" value="<?php echo $url; ?>" /><br />
|
157 |
-
<i><?php _e('Open URL in', 'slideshow-jquery-image-gallery'); ?></i>
|
158 |
-
<select name="<?php echo $name; ?>[urlTarget]">
|
159 |
-
<option value="_self" <?php selected('_self', $target); ?>><?php _e('Same window', 'slideshow-jquery-image-gallery'); ?></option>
|
160 |
-
<option value="_blank" <?php selected('_blank', $target); ?>><?php _e('New window', 'slideshow-jquery-image-gallery'); ?></option>
|
161 |
-
</select>
|
162 |
-
</p>
|
163 |
-
|
164 |
-
<input type="hidden" name="<?php echo $name; ?>[type]" value="attachment" />
|
165 |
-
<input type="hidden" name="<?php echo $name; ?>[postId]" value="<?php echo $attachment->ID; ?>" />
|
166 |
-
<input type="hidden" name="<?php echo $name; ?>[order]" value="<?php echo $order; ?>" class="slide_order" />
|
167 |
-
|
168 |
-
<?php else: ?>
|
169 |
-
|
170 |
-
<p style="margin: 5px 15px 5px 5px;">
|
171 |
-
<?php _e('An error occurred while loading this slide, and it will not be present in the slideshow', 'slideshow-jquery-image-gallery'); ?>
|
172 |
-
</p>
|
173 |
-
|
174 |
-
<?php endif; ?>
|
175 |
-
|
176 |
-
<p style="margin: 5px 15px 5px 5px; color: red; cursor: pointer;" class="slideshow-delete-slide">
|
177 |
-
<span><?php _e('Delete slide', 'slideshow-jquery-image-gallery'); ?></span>
|
178 |
-
<span style="display: none;" class="<?php echo $id; ?>"></span>
|
179 |
-
</p>
|
180 |
-
|
181 |
-
</li>
|
182 |
-
<?php endforeach; ?>
|
183 |
<?php endif; ?>
|
184 |
-
</ul>
|
185 |
-
|
186 |
-
<div class="text-slide-template" style="display: none;">
|
187 |
-
<li class="widefat sortable-slides-list-item" style="margin: 10px 0; width: auto; background-color: #fafafa;">
|
188 |
-
|
189 |
-
<h3 class="hndle">
|
190 |
-
<span style="font-size: 0.8em;">
|
191 |
-
<?php _e('Text slide', 'slideshow-jquery-image-gallery'); ?>
|
192 |
-
</span>
|
193 |
-
</h3>
|
194 |
|
195 |
-
|
196 |
-
<i><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></i><br />
|
197 |
-
<input type="text" class="title" /><br />
|
198 |
-
<i><?php _e('Description', 'slideshow-jquery-image-gallery'); ?></i><br />
|
199 |
-
<textarea class="description" cols="" rows="7" style="width: 100%;"></textarea><br />
|
200 |
-
<i><?php _e('Background color', 'slideshow-jquery-image-gallery'); ?></i><br />
|
201 |
-
<input type="text" class="color {required:false}" />
|
202 |
-
</p>
|
203 |
|
204 |
-
|
205 |
-
<i><?php _e('URL', 'slideshow-jquery-image-gallery'); ?></i><br />
|
206 |
-
<input type="text" class="url" value="" /><br />
|
207 |
-
<i><?php _e('Open URL in', 'slideshow-jquery-image-gallery'); ?></i>
|
208 |
-
<select class="urlTarget">
|
209 |
-
<option value="_self"><?php _e('Same window', 'slideshow-jquery-image-gallery'); ?></option>
|
210 |
-
<option value="_blank"><?php _e('New window', 'slideshow-jquery-image-gallery'); ?></option>
|
211 |
-
</select>
|
212 |
-
</p>
|
213 |
|
214 |
-
|
215 |
-
|
|
|
216 |
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
|
|
221 |
|
222 |
-
|
223 |
-
</div>
|
224 |
|
225 |
-
|
226 |
-
|
|
|
227 |
|
228 |
-
|
229 |
-
<span style="font-size: 0.8em;">
|
230 |
-
<?php _e('Video slide', 'slideshow-jquery-image-gallery'); ?>
|
231 |
-
</span>
|
232 |
-
</h3>
|
233 |
-
|
234 |
-
<p style="margin: 5px 15px 5px 5px;">
|
235 |
-
<i><?php _e('Youtube Video ID', 'slideshow-jquery-image-gallery'); ?></i><br />
|
236 |
-
<input type="text" class="videoId" />
|
237 |
-
</p>
|
238 |
-
|
239 |
-
<input type="hidden" class="type" value="video" />
|
240 |
-
<input type="hidden" class="slide_order" />
|
241 |
-
|
242 |
-
<p style="margin: 5px 15px 5px 5px; color: red; cursor: pointer;" class="slideshow-delete-new-slide">
|
243 |
-
<span><?php _e('Delete slide', 'slideshow-jquery-image-gallery'); ?></span>
|
244 |
-
<span style="display: none;" class="<?php echo $id; ?>"></span>
|
245 |
-
</p>
|
246 |
-
|
247 |
-
</li>
|
248 |
-
</div>
|
249 |
-
|
250 |
-
<div class="image-slide-template" style="display: none;">
|
251 |
-
<li class="widefat sortable-slides-list-item" style="margin: 10px 0; width: auto; background-color: #fafafa;">
|
252 |
-
|
253 |
-
<h3 class="hndle">
|
254 |
-
<span style="font-size: 0.8em;">
|
255 |
-
<?php _e('Image slide', 'slideshow-jquery-image-gallery'); ?>
|
256 |
-
</span>
|
257 |
-
</h3>
|
258 |
-
|
259 |
-
<p style="float: left; margin: 5px;">
|
260 |
-
<img width="80" height="60" src="" class="attachment attachment-80x60" alt="" title="" />
|
261 |
-
</p>
|
262 |
-
|
263 |
-
<p style="float: left; margin: 5px 15px 5px 5px;">
|
264 |
-
<i><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></i><br />
|
265 |
-
<input type="text" class="title" />
|
266 |
-
</p>
|
267 |
-
<p style="clear: both"></p>
|
268 |
-
|
269 |
-
<p style="margin: 5px 15px 5px 5px;">
|
270 |
-
<i><?php _e('Description', 'slideshow-jquery-image-gallery'); ?></i><br />
|
271 |
-
<textarea class="description" rows="3" cols="" style="width: 100%;"></textarea><br />
|
272 |
-
</p>
|
273 |
-
|
274 |
-
<p style="margin: 5px 15px 5px 5px;">
|
275 |
-
<i><?php _e('URL', 'slideshow-jquery-image-gallery'); ?></i><br />
|
276 |
-
<input type="text" class="url" value="" /><br />
|
277 |
-
<i><?php _e('Open URL in', 'slideshow-jquery-image-gallery'); ?></i>
|
278 |
-
<select class="urlTarget">
|
279 |
-
<option value="_self"><?php _e('Same window', 'slideshow-jquery-image-gallery'); ?></option>
|
280 |
-
<option value="_blank"><?php _e('New window', 'slideshow-jquery-image-gallery'); ?></option>
|
281 |
-
</select>
|
282 |
-
</p>
|
283 |
|
284 |
-
|
285 |
-
<input type="hidden" class="postId" value="" />
|
286 |
-
<input type="hidden" value="" class="slide_order" />
|
287 |
|
288 |
-
|
289 |
-
<span><?php _e('Delete slide', 'slideshow-jquery-image-gallery'); ?></span>
|
290 |
-
<span style="display: none;" class="<?php echo $id; ?>"></span>
|
291 |
-
</p>
|
292 |
|
293 |
-
|
294 |
-
</div>
|
1 |
+
<?php if ($data instanceof stdClass) : ?>
|
2 |
+
|
3 |
+
<p style="text-align: center; font-style: italic"><?php _e('Insert', 'slideshow-jquery-image-gallery'); ?>:</p>
|
4 |
+
<p style="text-align: center;">
|
5 |
+
<input type="button" class="button slideshow-insert-image-slide" value="<?php _e('Image slide', 'slideshow-jquery-image-gallery'); ?>" />
|
6 |
+
<input type="button" class="button slideshow-insert-text-slide" value="<?php _e('Text slide', 'slideshow-jquery-image-gallery'); ?>" />
|
7 |
+
<input type="button" class="button slideshow-insert-video-slide" value="<?php _e('Video slide', 'slideshow-jquery-image-gallery'); ?>" />
|
8 |
+
</p>
|
9 |
+
|
10 |
+
<p style="text-align: center;">
|
11 |
+
<a href="#" class="open-slides-button"><?php _e('Open all', 'slideshow-jquery-image-gallery'); ?></a> |
|
12 |
+
<a href="#" class="close-slides-button"><?php _e('Close all', 'slideshow-jquery-image-gallery'); ?></a>
|
13 |
+
</p>
|
14 |
+
|
15 |
+
<?php if (count($data->slides) <= 0) : ?>
|
16 |
+
<p><?php _e('Add slides to this slideshow by using one of the buttons above.', 'slideshow-jquery-image-gallery'); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
+
<div class="sortable-slides-list">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
+
if (is_array($data->slides))
|
24 |
+
{
|
25 |
+
$i = 0;
|
26 |
|
27 |
+
foreach ($data->slides as $slide)
|
28 |
+
{
|
29 |
+
$data = new stdClass();
|
30 |
+
$data->name = SlideshowPluginSlideshowSettingsHandler::$slidesKey . '[' . $i . ']';
|
31 |
+
$data->properties = $slide;
|
32 |
|
33 |
+
SlideshowPluginMain::outputView('SlideshowPluginSlideshowSlide' . DIRECTORY_SEPARATOR . 'backend_' . $slide['type'] . '.php', $data);
|
|
|
34 |
|
35 |
+
$i++;
|
36 |
+
}
|
37 |
+
}
|
38 |
|
39 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
+
</div>
|
|
|
|
|
42 |
|
43 |
+
<?php SlideshowPluginMain::outputView('SlideshowPluginSlideshowSlide' . DIRECTORY_SEPARATOR . 'backend_templates.php'); ?>
|
|
|
|
|
|
|
44 |
|
45 |
+
<?php endif; ?>
|
|
views/SlideshowPluginPostType/style-settings.php
CHANGED
@@ -1,29 +1,31 @@
|
|
1 |
-
|
2 |
-
|
|
|
3 |
|
4 |
-
|
5 |
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
</table>
|
18 |
|
19 |
-
<p>
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
</p>
|
|
1 |
+
<?php if ($data instanceof stdClass) : ?>
|
2 |
+
<table>
|
3 |
+
<?php if(count($data->settings) > 0): $i = 0; ?>
|
4 |
|
5 |
+
<?php foreach($data->settings as $key => $value): ?>
|
6 |
|
7 |
+
<?php if( !isset($value, $value['type'], $value['default'], $value['description']) || !is_array($value)) continue; ?>
|
8 |
|
9 |
+
<tr <?php if(isset($value['dependsOn'])) echo 'style="display:none;"'; ?>>
|
10 |
+
<td><?php echo $value['description']; ?></td>
|
11 |
+
<td><?php echo SlideshowPluginSlideshowSettingsHandler::getInputField(htmlspecialchars(SlideshowPluginSlideshowSettingsHandler::$styleSettingsKey), $key, $value); ?></td>
|
12 |
+
<td><?php _e('Default', 'slideshow-jquery-image-gallery'); ?>: '<?php echo (isset($value['options']))? $value['options'][$value['default']]: $value['default']; ?>'</td>
|
13 |
+
</tr>
|
14 |
|
15 |
+
<?php endforeach; ?>
|
16 |
|
17 |
+
<?php endif; ?>
|
18 |
+
</table>
|
19 |
|
20 |
+
<p>
|
21 |
+
<?php
|
22 |
+
echo sprintf(__(
|
23 |
+
'Custom styles can be created and customized %shere%s.',
|
24 |
+
'slideshow-jquery-image-gallery'
|
25 |
+
),
|
26 |
+
'<a href="' . admin_url() . '/edit.php?post_type=slideshow&page=general_settings#custom-styles" target="_blank">',
|
27 |
+
'</a>'
|
28 |
+
);
|
29 |
+
?>
|
30 |
+
</p>
|
31 |
+
<?php endif; ?>
|
views/SlideshowPluginPostType/support-plugin.php
CHANGED
@@ -1,38 +1,40 @@
|
|
1 |
-
|
2 |
-
<div style="
|
3 |
-
<
|
|
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
<div style="float: right; width: 50%;">
|
11 |
-
<p>
|
12 |
-
<input
|
13 |
-
type="button"
|
14 |
-
class="button-secondary"
|
15 |
-
value="<?php _e('Rate on Wordpress.org', 'slideshow-jquery-image-gallery'); ?>"
|
16 |
-
onclick="window.open('http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/')"
|
17 |
-
/>
|
18 |
-
</p>
|
19 |
|
20 |
-
<
|
21 |
-
<
|
|
|
22 |
type="button"
|
23 |
class="button-secondary"
|
24 |
-
value="<?php _e('
|
25 |
-
onclick="window.open('http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
36 |
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ($data instanceof stdClass) : ?>
|
2 |
+
<div class="updated" style="background: #f7f7f7; border-color: #dfdfdf;">
|
3 |
+
<div style="float: left; width: 50%;">
|
4 |
+
<h3><?php _e('Help to keep this plugin free!', 'slideshow-jquery-image-gallery'); ?></h3>
|
5 |
|
6 |
+
<p>
|
7 |
+
<?php _e('In order to keep you provided with the newest features, updates and bug fixes, a lot of motivation is required. Therefore I\'m kindly asking you to consider making a small donation to the plugin or rating it as 5-stars on Wordpress.org. Thank you in advance!', 'slideshow-jquery-image-gallery'); ?>
|
8 |
+
</p>
|
9 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
<div style="float: right; width: 50%;">
|
12 |
+
<p>
|
13 |
+
<input
|
14 |
type="button"
|
15 |
class="button-secondary"
|
16 |
+
value="<?php _e('Rate on Wordpress.org', 'slideshow-jquery-image-gallery'); ?>"
|
17 |
+
onclick="window.open('http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/')"
|
18 |
+
/>
|
19 |
+
</p>
|
20 |
|
21 |
+
<p>
|
22 |
+
<input
|
23 |
+
type="button"
|
24 |
+
class="button-secondary"
|
25 |
+
value="<?php _e('Frequently Asked Questions (FAQ)', 'slideshow-jquery-image-gallery'); ?>"
|
26 |
+
onclick="window.open('http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/faq/')"
|
27 |
+
/>
|
28 |
+
</p>
|
29 |
|
30 |
+
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
|
31 |
+
<input type="hidden" name="cmd" value="_s-xclick" />
|
32 |
+
<input type="hidden" name="hosted_button_id" value="VWHWA99RBJZW8" />
|
33 |
+
<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online." />
|
34 |
+
<img alt="" border="0" src="https://www.paypalobjects.com/nl_NL/i/scr/pixel.gif" width="1" height="1" />
|
35 |
+
</form>
|
36 |
+
</div>
|
37 |
+
|
38 |
+
<div style="clear: both;"></div>
|
39 |
+
</div>
|
40 |
+
<?php endif; ?>
|
views/SlideshowPluginShortcode/shortcode-inserter.php
CHANGED
@@ -1,76 +1,79 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
<
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
<
|
28 |
-
|
29 |
-
<
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
<
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
|
|
|
1 |
+
<?php if ($data instanceof stdClass) : ?>
|
2 |
+
|
3 |
+
<a
|
4 |
+
href="#TB_inline?width=450&inlineId=insertSlideshowShortcode"
|
5 |
+
class="button thickbox"
|
6 |
+
title="<?php _e('Insert a Slideshow', 'slideshow-jquery-image-gallery'); ?>"
|
7 |
+
style="padding-left: .4em;"
|
8 |
+
>
|
9 |
+
<img
|
10 |
+
src="<?php echo SlideshowPluginMain::getPluginUrl() . '/images/SlideshowPluginPostType/adminIcon.png'; ?>"
|
11 |
+
alt="<?php _e('Insert a Slideshow', 'slideshow-jquery-image-gallery'); ?>"
|
12 |
+
style="vertical-align: text-top;"
|
13 |
+
/>
|
14 |
+
<?php _e('Insert Slideshow', 'slideshow-jquery-image-gallery'); ?>
|
15 |
+
</a>
|
16 |
+
|
17 |
+
<div id="insertSlideshowShortcode" style="display: none;">
|
18 |
+
|
19 |
+
<h3 style="padding: 10px 0; color: #5a5a5a;">
|
20 |
+
<?php _e('Insert a Slideshow', 'slideshow-jquery-image-gallery'); ?>
|
21 |
+
</h3>
|
22 |
+
|
23 |
+
<div style="border: 1px solid #ddd; padding: 10px; color: #5a5a5a;">
|
24 |
+
|
25 |
+
<?php if($data->slideshows instanceof WP_Query && count($data->slideshows->get_posts()) > 0): ?>
|
26 |
+
<table>
|
27 |
+
<tr>
|
28 |
+
|
29 |
+
<td><?php _e('Select a slideshow', 'slideshow-jquery-image-gallery'); ?></td>
|
30 |
+
<td>
|
31 |
+
<select id="insertSlideshowShortcodeSlideshowSelect">
|
32 |
+
|
33 |
+
<?php foreach($data->slideshows->get_posts() as $slideshow): ?>
|
34 |
+
|
35 |
+
<?php if(!is_numeric($slideshow->ID)) continue; ?>
|
36 |
+
|
37 |
+
<option value="<?php echo $slideshow->ID; ?>">
|
38 |
+
<?php echo (!empty($slideshow->post_title)) ? htmlspecialchars($slideshow->post_title) : __('Untitled slideshow', 'slideshow-jquery-image-gallery'); ?>
|
39 |
+
</option>
|
40 |
+
|
41 |
+
<?php endforeach; ?>
|
42 |
+
|
43 |
+
</select>
|
44 |
+
</td>
|
45 |
+
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
|
49 |
+
<td>
|
50 |
+
<input
|
51 |
+
type="button"
|
52 |
+
class="button-primary insertSlideshowShortcodeSlideshowInsertButton"
|
53 |
+
value="<?php _e('Insert Slideshow', 'slideshow-jquery-image-gallery'); ?>"
|
54 |
+
/>
|
55 |
+
<input
|
56 |
+
type="button"
|
57 |
+
class="button insertSlideshowShortcodeCancelButton"
|
58 |
+
value="<?php _e('Cancel', 'slideshow-jquery-image-gallery'); ?>"
|
59 |
+
/>
|
60 |
+
</td>
|
61 |
+
|
62 |
+
</tr>
|
63 |
+
</table>
|
64 |
+
|
65 |
+
<?php else: ?>
|
66 |
+
|
67 |
+
<p>
|
68 |
+
<?php echo sprintf(
|
69 |
+
__('It seems you haven\'t created any slideshows yet. %sYou can create a slideshow here!%s', 'slideshow-jquery-image-gallery'),
|
70 |
+
'<a href="' . admin_url('post-new.php?post_type=' . SlideshowPluginPostType::$postType) . '" target="_blank">',
|
71 |
+
'</a>'
|
72 |
+
); ?>
|
73 |
+
</p>
|
74 |
+
|
75 |
+
<?php endif; ?>
|
76 |
+
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
<?php endif; ?>
|
views/SlideshowPluginSlideInserter/insert-image-button.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php if (function_exists('wp_enqueue_media')): ?>
|
2 |
-
<input type="button" class="button slideshow-insert-image-slide" value="<?php _e('Image slide', 'slideshow-jquery-image-gallery'); ?>" />
|
3 |
-
<?php else: ?>
|
4 |
-
<input type="button" id="slideshow-insert-image-slide" class="button" value="<?php _e('Image slide', 'slideshow-jquery-image-gallery'); ?>" />
|
5 |
-
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
views/SlideshowPluginSlideInserter/insert-text-button.php
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
|
2 |
-
<input type="button" id="slideshow-insert-text-slide" class="button" value="<?php _e('Text slide', 'slideshow-jquery-image-gallery'); ?>" />
|
|
|
|
views/SlideshowPluginSlideInserter/insert-video-button.php
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
|
2 |
-
<input type="button" id="slideshow-insert-video-slide" class="button" value="<?php _e('Video slide', 'slideshow-jquery-image-gallery'); ?>" />
|
|
|
|
views/SlideshowPluginSlideInserter/search-popup.php
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
<div id="slideshow-slide-inserter-popup-background"></div>
|
2 |
-
<div id="slideshow-slide-inserter-popup">
|
3 |
-
<div id="close"></div>
|
4 |
-
<div>
|
5 |
-
<input type="text" id="search" />
|
6 |
-
<?php submit_button(__('Search', 'slideshow-jquery-image-gallery'), 'primary', 'search-submit', false); ?>
|
7 |
-
<i><?php _e('Search images by title or ID', 'slideshow-jquery-image-gallery'); ?></i>
|
8 |
-
</div>
|
9 |
-
<div style="clear: both;"></div>
|
10 |
-
|
11 |
-
<div id="search-results">
|
12 |
-
<table id="results" class="widefat"></table>
|
13 |
-
</div>
|
14 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/SlideshowPluginSlideshowSlide/backend_attachment.php
CHANGED
@@ -1,187 +1,192 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
$
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
if (isset($properties['noFollow']))
|
45 |
-
{
|
46 |
-
$noFollow = true;
|
47 |
-
}
|
48 |
-
|
49 |
-
if (isset($properties['alternativeText']))
|
50 |
-
{
|
51 |
-
$alternativeText = htmlspecialchars($properties['alternativeText']);
|
52 |
-
}
|
53 |
-
else
|
54 |
-
{
|
55 |
-
$alternativeText = $title;
|
56 |
-
}
|
57 |
-
|
58 |
-
// Prepare image
|
59 |
-
$image = wp_get_attachment_image_src($attachment->ID);
|
60 |
-
$imageSrc = '';
|
61 |
-
$displaySlide = true;
|
62 |
-
|
63 |
-
if (!is_array($image) ||
|
64 |
-
!$image)
|
65 |
-
{
|
66 |
-
if (!empty($attachment->guid))
|
67 |
{
|
68 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
else
|
71 |
{
|
72 |
-
$
|
73 |
}
|
74 |
-
}
|
75 |
-
else
|
76 |
-
{
|
77 |
-
$imageSrc = $image[0];
|
78 |
-
}
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
$
|
84 |
-
}
|
85 |
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
-
|
89 |
|
90 |
-
|
91 |
|
92 |
-
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
|
99 |
-
|
100 |
|
101 |
-
|
102 |
|
103 |
-
|
104 |
|
105 |
-
|
|
|
|
|
106 |
</div>
|
107 |
-
<div class="clear"></div>
|
108 |
-
</div>
|
109 |
|
110 |
-
|
111 |
|
112 |
-
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
|
118 |
-
|
119 |
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
-
<div class="slideshow-left slideshow-label"><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></div>
|
123 |
-
<div class="slideshow-right">
|
124 |
-
<select name="<?php echo $name; ?>[titleElementTagID]">
|
125 |
-
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
126 |
-
<option value="<?php echo $elementTagID; ?>" <?php selected($titleElementTagID, $elementTagID); ?>><?php echo $elementTag; ?></option>
|
127 |
-
<?php endforeach; ?>
|
128 |
-
</select>
|
129 |
</div>
|
130 |
-
<div class="clear"></div>
|
131 |
-
<input type="text" name="<?php echo $name; ?>[title]" value="<?php echo $title; ?>" style="width: 100%;" />
|
132 |
|
133 |
-
|
134 |
|
135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
-
<div class="slideshow-left slideshow-label"><?php _e('Description', 'slideshow-jquery-image-gallery'); ?></div>
|
138 |
-
<div class="slideshow-right">
|
139 |
-
<select name="<?php echo $name; ?>[descriptionElementTagID]">
|
140 |
-
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
141 |
-
<option value="<?php echo $elementTagID; ?>" <?php selected($descriptionElementTagID, $elementTagID); ?>><?php echo $elementTag; ?></option>
|
142 |
-
<?php endforeach; ?>
|
143 |
-
</select>
|
144 |
</div>
|
145 |
-
<div clear="clear"></div>
|
146 |
-
<textarea name="<?php echo $name; ?>[description]" rows="3" cols="" style="width: 100%;"><?php echo $description; ?></textarea>
|
147 |
|
148 |
-
|
149 |
|
150 |
-
|
|
|
151 |
|
152 |
-
|
153 |
-
|
|
|
|
|
|
|
|
|
154 |
|
155 |
-
|
156 |
-
|
157 |
-
<
|
158 |
-
<option value="_blank" <?php selected('_blank', $target); ?>><?php _e('New window', 'slideshow-jquery-image-gallery'); ?></option>
|
159 |
-
</select>
|
160 |
-
<div class="clear"></div>
|
161 |
|
162 |
-
|
163 |
-
<input type="checkbox" name="<?php echo $name; ?>[noFollow]" value="" <?php checked($noFollow); ?> class="slideshow-right" />
|
164 |
-
<div class="clear"></div>
|
165 |
|
166 |
-
|
167 |
|
168 |
-
|
|
|
169 |
|
170 |
-
|
171 |
-
<input type="text" name="<?php echo $name; ?>[alternativeText]" value="<?php echo $alternativeText; ?>" style="width: 100%;" />
|
172 |
|
173 |
-
|
|
|
|
|
174 |
|
175 |
-
|
176 |
-
<
|
177 |
-
</div>
|
178 |
|
179 |
-
|
180 |
-
<input type="hidden" name="<?php echo $name; ?>[postId]" value="<?php echo $attachment->ID; ?>" />
|
181 |
|
182 |
</div>
|
183 |
|
184 |
-
|
185 |
-
|
186 |
<?php endif; ?>
|
187 |
-
<?php endif; ?>
|
1 |
<?php
|
2 |
|
3 |
+
if ($data instanceof stdClass) :
|
4 |
+
|
5 |
+
$properties = $data->properties;
|
6 |
+
|
7 |
+
// The attachment should always be there
|
8 |
+
$attachment = get_post($properties['postId']);
|
9 |
+
|
10 |
+
if (isset($attachment)):
|
11 |
+
|
12 |
+
$name = htmlspecialchars($data->name);
|
13 |
+
|
14 |
+
$title = $titleElementTagID = $description = $descriptionElementTagID = $url = $target = $alternativeText = '';
|
15 |
+
|
16 |
+
$noFollow = false;
|
17 |
+
|
18 |
+
if (isset($properties['title']))
|
19 |
+
{
|
20 |
+
$title = SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['title']);
|
21 |
+
}
|
22 |
+
|
23 |
+
if (isset($properties['titleElementTagID']))
|
24 |
+
{
|
25 |
+
$titleElementTagID = $properties['titleElementTagID'];
|
26 |
+
}
|
27 |
+
|
28 |
+
if (isset($properties['description']))
|
29 |
+
{
|
30 |
+
$description = SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['description']);
|
31 |
+
}
|
32 |
+
|
33 |
+
if (isset($properties['descriptionElementTagID']))
|
34 |
+
{
|
35 |
+
$descriptionElementTagID = $properties['descriptionElementTagID'];
|
36 |
+
}
|
37 |
+
|
38 |
+
if (isset($properties['url']))
|
39 |
+
{
|
40 |
+
$url = $properties['url'];
|
41 |
+
}
|
42 |
+
|
43 |
+
if (isset($properties['urlTarget']))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
{
|
45 |
+
$target = $properties['urlTarget'];
|
46 |
+
}
|
47 |
+
|
48 |
+
if (isset($properties['noFollow']))
|
49 |
+
{
|
50 |
+
$noFollow = true;
|
51 |
+
}
|
52 |
+
|
53 |
+
if (isset($properties['alternativeText']))
|
54 |
+
{
|
55 |
+
$alternativeText = htmlspecialchars($properties['alternativeText']);
|
56 |
}
|
57 |
else
|
58 |
{
|
59 |
+
$alternativeText = $title;
|
60 |
}
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
+
// Prepare image
|
63 |
+
$image = wp_get_attachment_image_src($attachment->ID);
|
64 |
+
$imageSrc = '';
|
65 |
+
$displaySlide = true;
|
|
|
66 |
|
67 |
+
if (!is_array($image) ||
|
68 |
+
!$image)
|
69 |
+
{
|
70 |
+
if (!empty($attachment->guid))
|
71 |
+
{
|
72 |
+
$imageSrc = $attachment->guid;
|
73 |
+
}
|
74 |
+
else
|
75 |
+
{
|
76 |
+
$displaySlide = false;
|
77 |
+
}
|
78 |
+
}
|
79 |
+
else
|
80 |
+
{
|
81 |
+
$imageSrc = $image[0];
|
82 |
+
}
|
83 |
+
|
84 |
+
if (!$imageSrc ||
|
85 |
+
empty($imageSrc))
|
86 |
+
{
|
87 |
+
$imageSrc = SlideshowPluginMain::getPluginUrl() . '/images/' . __CLASS__ . '/no-img.png';
|
88 |
+
}
|
89 |
+
|
90 |
+
$editUrl = admin_url() . '/media.php?attachment_id=' . $attachment->ID . '&action=edit';
|
91 |
|
92 |
+
if ($displaySlide): ?>
|
93 |
|
94 |
+
<div id="" class="widefat sortable-slides-list-item postbox">
|
95 |
|
96 |
+
<div class="handlediv" title="<?php _e('Click to toggle'); ?>"><br></div>
|
97 |
|
98 |
+
<div class="hndle">
|
99 |
+
<div class="slide-icon image-slide-icon"></div>
|
100 |
+
<div class="slide-title">
|
101 |
+
<?php if (strlen($title) > 0) : ?>
|
102 |
|
103 |
+
<?php echo $title; ?>
|
104 |
|
105 |
+
<?php else : ?>
|
106 |
|
107 |
+
<?php _e('Image slide', 'slideshow-jquery-image-gallery'); ?>
|
108 |
|
109 |
+
<?php endif; ?>
|
110 |
+
</div>
|
111 |
+
<div class="clear"></div>
|
112 |
</div>
|
|
|
|
|
113 |
|
114 |
+
<div class="inside">
|
115 |
|
116 |
+
<div class="slideshow-group">
|
117 |
|
118 |
+
<a href="<?php echo $editUrl; ?>" title="<?php _e('Edit', 'slideshow-jquery-image-gallery'); ?> "<?php echo $attachment->post_title; ?>"">
|
119 |
+
<img width="80" height="60" src="<?php echo $imageSrc; ?>" class="attachment-80x60" alt="<?php echo $attachment->post_title; ?>" title="<?php echo $attachment->post_title; ?>" />
|
120 |
+
</a>
|
121 |
|
122 |
+
</div>
|
123 |
|
124 |
+
<div class="slideshow-group">
|
125 |
+
|
126 |
+
<div class="slideshow-left slideshow-label"><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></div>
|
127 |
+
<div class="slideshow-right">
|
128 |
+
<select name="<?php echo $name; ?>[titleElementTagID]">
|
129 |
+
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
130 |
+
<option value="<?php echo $elementTagID; ?>" <?php selected($titleElementTagID, $elementTagID); ?>><?php echo $elementTag; ?></option>
|
131 |
+
<?php endforeach; ?>
|
132 |
+
</select>
|
133 |
+
</div>
|
134 |
+
<div class="clear"></div>
|
135 |
+
<input type="text" name="<?php echo $name; ?>[title]" value="<?php echo $title; ?>" style="width: 100%;" />
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
</div>
|
|
|
|
|
138 |
|
139 |
+
<div class="slideshow-group">
|
140 |
|
141 |
+
<div class="slideshow-left slideshow-label"><?php _e('Description', 'slideshow-jquery-image-gallery'); ?></div>
|
142 |
+
<div class="slideshow-right">
|
143 |
+
<select name="<?php echo $name; ?>[descriptionElementTagID]">
|
144 |
+
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
145 |
+
<option value="<?php echo $elementTagID; ?>" <?php selected($descriptionElementTagID, $elementTagID); ?>><?php echo $elementTag; ?></option>
|
146 |
+
<?php endforeach; ?>
|
147 |
+
</select>
|
148 |
+
</div>
|
149 |
+
<div clear="clear"></div>
|
150 |
+
<textarea name="<?php echo $name; ?>[description]" rows="3" cols="" style="width: 100%;"><?php echo $description; ?></textarea>
|
151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
</div>
|
|
|
|
|
153 |
|
154 |
+
<div class="slideshow-group">
|
155 |
|
156 |
+
<div class="slideshow-label"><?php _e('URL', 'slideshow-jquery-image-gallery'); ?></div>
|
157 |
+
<input type="text" name="<?php echo $name; ?>[url]" value="<?php echo $url; ?>" style="width: 100%;" />
|
158 |
|
159 |
+
<div class="slideshow-label slideshow-left"><?php _e('Open URL in', 'slideshow-jquery-image-gallery'); ?></div>
|
160 |
+
<select name="<?php echo $name; ?>[urlTarget]" class="slideshow-right">
|
161 |
+
<option value="_self" <?php selected('_self', $target); ?>><?php _e('Same window', 'slideshow-jquery-image-gallery'); ?></option>
|
162 |
+
<option value="_blank" <?php selected('_blank', $target); ?>><?php _e('New window', 'slideshow-jquery-image-gallery'); ?></option>
|
163 |
+
</select>
|
164 |
+
<div class="clear"></div>
|
165 |
|
166 |
+
<div class="slideshow-label slideshow-left"><?php _e('Don\'t let search engines follow link', 'slideshow-jquery-image-gallery'); ?></div>
|
167 |
+
<input type="checkbox" name="<?php echo $name; ?>[noFollow]" value="" <?php checked($noFollow); ?> class="slideshow-right" />
|
168 |
+
<div class="clear"></div>
|
|
|
|
|
|
|
169 |
|
170 |
+
</div>
|
|
|
|
|
171 |
|
172 |
+
<div class="slideshow-group">
|
173 |
|
174 |
+
<div class="slideshow-label"><?php _e('Alternative text', 'slideshow-jquery-image-gallery'); ?></div>
|
175 |
+
<input type="text" name="<?php echo $name; ?>[alternativeText]" value="<?php echo $alternativeText; ?>" style="width: 100%;" />
|
176 |
|
177 |
+
</div>
|
|
|
178 |
|
179 |
+
<div class="slideshow-group slideshow-delete-slide">
|
180 |
+
<span><?php _e('Delete slide', 'slideshow-jquery-image-gallery'); ?></span>
|
181 |
+
</div>
|
182 |
|
183 |
+
<input type="hidden" name="<?php echo $name; ?>[type]" value="attachment" />
|
184 |
+
<input type="hidden" name="<?php echo $name; ?>[postId]" value="<?php echo $attachment->ID; ?>" />
|
|
|
185 |
|
186 |
+
</div>
|
|
|
187 |
|
188 |
</div>
|
189 |
|
190 |
+
<?php endif; ?>
|
|
|
191 |
<?php endif; ?>
|
192 |
+
<?php endif; ?>
|
views/SlideshowPluginSlideshowSlide/backend_templates.php
CHANGED
@@ -1,212 +1,214 @@
|
|
1 |
-
|
2 |
-
<div class="
|
|
|
3 |
|
4 |
-
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
10 |
</div>
|
11 |
-
<div class="clear"></div>
|
12 |
-
</div>
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
<div class="slideshow-left slideshow-label"><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></div>
|
19 |
-
<div class="slideshow-right">
|
20 |
-
<select class="titleElementTagID">
|
21 |
-
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
22 |
-
<option value="<?php echo $elementTagID; ?>"><?php echo $elementTag; ?></option>
|
23 |
-
<?php endforeach; ?>
|
24 |
-
</select>
|
25 |
</div>
|
26 |
-
<div class="clear"></div>
|
27 |
-
<input type="text" class="title" style="width: 100%;" />
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
<div class="slideshow-left slideshow-label"><?php _e('Description', 'slideshow-jquery-image-gallery'); ?></div>
|
34 |
-
<div class="slideshow-right">
|
35 |
-
<select class="descriptionElementTagID">
|
36 |
-
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
37 |
-
<option value="<?php echo $elementTagID; ?>"><?php echo $elementTag; ?></option>
|
38 |
-
<?php endforeach; ?>
|
39 |
-
</select>
|
40 |
</div>
|
41 |
-
<div clear="clear"></div>
|
42 |
-
<textarea class="description" cols="" rows="7" style="width: 100%;"></textarea>
|
43 |
|
44 |
-
|
45 |
|
46 |
-
|
|
|
47 |
|
48 |
-
|
49 |
-
|
|
|
50 |
|
51 |
-
|
52 |
-
<input type="text" class="color" value="FFFFFF" />
|
53 |
-
<div style="font-style: italic;"><?php _e('(Leave empty for a transparent background)', 'slideshow-jquery-image-gallery'); ?></div>
|
54 |
|
55 |
-
|
56 |
|
57 |
-
|
|
|
58 |
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
<
|
65 |
-
<option value="_blank"><?php _e('New window', 'slideshow-jquery-image-gallery'); ?></option>
|
66 |
-
</select>
|
67 |
-
<div class="clear"></div>
|
68 |
|
69 |
-
|
70 |
-
<input type="checkbox" class="noFollow slideshow-right" />
|
71 |
-
<div class="clear"></div>
|
72 |
|
73 |
-
|
|
|
|
|
74 |
|
75 |
-
|
76 |
-
<span><?php _e('Delete slide', 'slideshow-jquery-image-gallery'); ?></span>
|
77 |
-
</div>
|
78 |
|
79 |
-
|
80 |
|
81 |
</div>
|
82 |
-
|
83 |
</div>
|
84 |
-
</div>
|
85 |
|
86 |
-
<div class="video-slide-template" style="display: none;">
|
87 |
-
|
88 |
|
89 |
-
|
90 |
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
|
|
95 |
</div>
|
96 |
-
<div class="clear"></div>
|
97 |
-
</div>
|
98 |
|
99 |
-
|
100 |
|
101 |
-
|
102 |
|
103 |
-
|
104 |
-
|
105 |
|
106 |
-
|
107 |
|
108 |
-
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
|
114 |
-
|
115 |
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
|
120 |
-
|
121 |
|
122 |
-
|
123 |
|
|
|
124 |
</div>
|
125 |
-
</div>
|
126 |
|
127 |
-
<div class="image-slide-template" style="display: none;">
|
128 |
-
|
129 |
|
130 |
-
|
131 |
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
|
|
|
|
136 |
</div>
|
137 |
-
<div class="clear"></div>
|
138 |
-
</div>
|
139 |
|
140 |
-
|
141 |
|
142 |
-
|
143 |
|
144 |
-
|
145 |
|
146 |
-
|
147 |
|
148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
|
150 |
-
<div class="slideshow-left slideshow-label"><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></div>
|
151 |
-
<div class="slideshow-right">
|
152 |
-
<select class="titleElementTagID">
|
153 |
-
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
154 |
-
<option value="<?php echo $elementTagID; ?>"><?php echo $elementTag; ?></option>
|
155 |
-
<?php endforeach; ?>
|
156 |
-
</select>
|
157 |
</div>
|
158 |
-
<div class="clear"></div>
|
159 |
-
<input type="text" class="title" style="width: 100%;" />
|
160 |
|
161 |
-
|
162 |
|
163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
|
165 |
-
<div class="slideshow-left slideshow-label"><?php _e('Description', 'slideshow-jquery-image-gallery'); ?></div>
|
166 |
-
<div class="slideshow-right">
|
167 |
-
<select class="descriptionElementTagID">
|
168 |
-
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
169 |
-
<option value="<?php echo $elementTagID; ?>"><?php echo $elementTag; ?></option>
|
170 |
-
<?php endforeach; ?>
|
171 |
-
</select>
|
172 |
</div>
|
173 |
-
<div class="clear"></div>
|
174 |
-
<textarea class="description" rows="3" cols="" style="width: 100%;"></textarea><br />
|
175 |
|
176 |
-
|
177 |
|
178 |
-
|
|
|
179 |
|
180 |
-
|
181 |
-
|
|
|
|
|
|
|
|
|
182 |
|
183 |
-
|
184 |
-
|
185 |
-
<option value="_self"><?php _e('Same window', 'slideshow-jquery-image-gallery'); ?></option>
|
186 |
-
<option value="_blank"><?php _e('New window', 'slideshow-jquery-image-gallery'); ?></option>
|
187 |
-
</select>
|
188 |
-
<div class="clear"></div>
|
189 |
|
190 |
-
|
191 |
-
<input type="checkbox" class="noFollow slideshow-right" />
|
192 |
|
193 |
-
|
194 |
|
195 |
-
|
|
|
196 |
|
197 |
-
|
198 |
-
<input type="text" class="alternativeText" style="width: 100%;" />
|
199 |
|
200 |
-
|
|
|
|
|
201 |
|
202 |
-
|
203 |
-
<
|
204 |
-
</div>
|
205 |
|
206 |
-
|
207 |
-
<input type="hidden" class="postId" value="" />
|
208 |
|
209 |
</div>
|
210 |
-
|
211 |
</div>
|
212 |
-
|
1 |
+
<?php if ($data instanceof stdClass) : ?>
|
2 |
+
<div class="text-slide-template" style="display: none;">
|
3 |
+
<div class="widefat sortable-slides-list-item postbox">
|
4 |
|
5 |
+
<div class="handlediv" title="<?php _e('Click to toggle'); ?>"><br></div>
|
6 |
|
7 |
+
<div class="hndle">
|
8 |
+
<div class="slide-icon text-slide-icon"></div>
|
9 |
+
<div class="slide-title">
|
10 |
+
<?php _e('Text slide', 'slideshow-jquery-image-gallery'); ?>
|
11 |
+
</div>
|
12 |
+
<div class="clear"></div>
|
13 |
</div>
|
|
|
|
|
14 |
|
15 |
+
<div class="inside">
|
16 |
|
17 |
+
<div class="slideshow-group">
|
18 |
+
|
19 |
+
<div class="slideshow-left slideshow-label"><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></div>
|
20 |
+
<div class="slideshow-right">
|
21 |
+
<select class="titleElementTagID">
|
22 |
+
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
23 |
+
<option value="<?php echo $elementTagID; ?>"><?php echo $elementTag; ?></option>
|
24 |
+
<?php endforeach; ?>
|
25 |
+
</select>
|
26 |
+
</div>
|
27 |
+
<div class="clear"></div>
|
28 |
+
<input type="text" class="title" style="width: 100%;" />
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
</div>
|
|
|
|
|
31 |
|
32 |
+
<div class="slideshow-group">
|
33 |
|
34 |
+
<div class="slideshow-left slideshow-label"><?php _e('Description', 'slideshow-jquery-image-gallery'); ?></div>
|
35 |
+
<div class="slideshow-right">
|
36 |
+
<select class="descriptionElementTagID">
|
37 |
+
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
38 |
+
<option value="<?php echo $elementTagID; ?>"><?php echo $elementTag; ?></option>
|
39 |
+
<?php endforeach; ?>
|
40 |
+
</select>
|
41 |
+
</div>
|
42 |
+
<div clear="clear"></div>
|
43 |
+
<textarea class="description" cols="" rows="7" style="width: 100%;"></textarea>
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
</div>
|
|
|
|
|
46 |
|
47 |
+
<div class="slideshow-group">
|
48 |
|
49 |
+
<div class="slideshow-label"><?php _e('Text color', 'slideshow-jquery-image-gallery'); ?></div>
|
50 |
+
<input type="text" class="textColor" value="000000" />
|
51 |
|
52 |
+
<div class="slideshow-label"><?php _e('Background color', 'slideshow-jquery-image-gallery'); ?></div>
|
53 |
+
<input type="text" class="color" value="FFFFFF" />
|
54 |
+
<div style="font-style: italic;"><?php _e('(Leave empty for a transparent background)', 'slideshow-jquery-image-gallery'); ?></div>
|
55 |
|
56 |
+
</div>
|
|
|
|
|
57 |
|
58 |
+
<div class="slideshow-group">
|
59 |
|
60 |
+
<div class="slideshow-label"><?php _e('URL', 'slideshow-jquery-image-gallery'); ?></div>
|
61 |
+
<input type="text" class="url" value="" style="width: 100%;" />
|
62 |
|
63 |
+
<div class="slideshow-label slideshow-left"><?php _e('Open URL in', 'slideshow-jquery-image-gallery'); ?></div>
|
64 |
+
<select class="urlTarget slideshow-right">
|
65 |
+
<option value="_self"><?php _e('Same window', 'slideshow-jquery-image-gallery'); ?></option>
|
66 |
+
<option value="_blank"><?php _e('New window', 'slideshow-jquery-image-gallery'); ?></option>
|
67 |
+
</select>
|
68 |
+
<div class="clear"></div>
|
69 |
|
70 |
+
<div class="slideshow-label slideshow-left"><?php _e('Don\'t let search engines follow link', 'slideshow-jquery-image-gallery'); ?></div>
|
71 |
+
<input type="checkbox" class="noFollow slideshow-right" />
|
72 |
+
<div class="clear"></div>
|
|
|
|
|
|
|
73 |
|
74 |
+
</div>
|
|
|
|
|
75 |
|
76 |
+
<div class="slideshow-group slideshow-delete-slide">
|
77 |
+
<span><?php _e('Delete slide', 'slideshow-jquery-image-gallery'); ?></span>
|
78 |
+
</div>
|
79 |
|
80 |
+
<input type="hidden" class="type" value="text" />
|
|
|
|
|
81 |
|
82 |
+
</div>
|
83 |
|
84 |
</div>
|
|
|
85 |
</div>
|
|
|
86 |
|
87 |
+
<div class="video-slide-template" style="display: none;">
|
88 |
+
<div class="widefat sortable-slides-list-item postbox">
|
89 |
|
90 |
+
<div class="handlediv" title="<?php _e('Click to toggle'); ?>"><br></div>
|
91 |
|
92 |
+
<div class="hndle">
|
93 |
+
<div class="slide-icon video-slide-icon"></div>
|
94 |
+
<div class="slide-title">
|
95 |
+
<?php _e('Video slide', 'slideshow-jquery-image-gallery'); ?>
|
96 |
+
</div>
|
97 |
+
<div class="clear"></div>
|
98 |
</div>
|
|
|
|
|
99 |
|
100 |
+
<div class="inside">
|
101 |
|
102 |
+
<div class="slideshow-group">
|
103 |
|
104 |
+
<div class="slideshow-label"><?php _e('Youtube Video ID', 'slideshow-jquery-image-gallery'); ?></div>
|
105 |
+
<input type="text" class="videoId" style="width: 100%;" />
|
106 |
|
107 |
+
</div>
|
108 |
|
109 |
+
<div class="slideshow-group">
|
110 |
|
111 |
+
<div class="slideshow-label"><?php _e('Show related videos', 'slideshow-jquery-image-gallery'); ?></div>
|
112 |
+
<label><input type="radio" class="showRelatedVideos" value="true"><?php _e('Yes', 'slideshow-jquery-image-gallery'); ?></label>
|
113 |
+
<label><input type="radio" class="showRelatedVideos" value="false" checked="checked""><?php _e('No', 'slideshow-jquery-image-gallery'); ?></label>
|
114 |
|
115 |
+
</div>
|
116 |
|
117 |
+
<div class="slideshow-group slideshow-delete-slide">
|
118 |
+
<span><?php _e('Delete slide', 'slideshow-jquery-image-gallery'); ?></span>
|
119 |
+
</div>
|
120 |
|
121 |
+
<input type="hidden" class="type" value="video" />
|
122 |
|
123 |
+
</div>
|
124 |
|
125 |
+
</div>
|
126 |
</div>
|
|
|
127 |
|
128 |
+
<div class="image-slide-template" style="display: none;">
|
129 |
+
<div class="widefat sortable-slides-list-item postbox">
|
130 |
|
131 |
+
<div class="handlediv" title="<?php _e('Click to toggle'); ?>"><br></div>
|
132 |
|
133 |
+
<div class="hndle">
|
134 |
+
<div class="slide-icon image-slide-icon"></div>
|
135 |
+
<div class="slide-title">
|
136 |
+
<?php _e('Image slide', 'slideshow-jquery-image-gallery'); ?>
|
137 |
+
</div>
|
138 |
+
<div class="clear"></div>
|
139 |
</div>
|
|
|
|
|
140 |
|
141 |
+
<div class="inside">
|
142 |
|
143 |
+
<div class="slideshow-group">
|
144 |
|
145 |
+
<img width="80" height="60" src="" class="attachment attachment-80x60" alt="" title="" style="float: none; margin: 0; padding: 0;" />
|
146 |
|
147 |
+
</div>
|
148 |
|
149 |
+
<div class="slideshow-group">
|
150 |
+
|
151 |
+
<div class="slideshow-left slideshow-label"><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></div>
|
152 |
+
<div class="slideshow-right">
|
153 |
+
<select class="titleElementTagID">
|
154 |
+
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
155 |
+
<option value="<?php echo $elementTagID; ?>"><?php echo $elementTag; ?></option>
|
156 |
+
<?php endforeach; ?>
|
157 |
+
</select>
|
158 |
+
</div>
|
159 |
+
<div class="clear"></div>
|
160 |
+
<input type="text" class="title" style="width: 100%;" />
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
</div>
|
|
|
|
|
163 |
|
164 |
+
<div class="slideshow-group">
|
165 |
|
166 |
+
<div class="slideshow-left slideshow-label"><?php _e('Description', 'slideshow-jquery-image-gallery'); ?></div>
|
167 |
+
<div class="slideshow-right">
|
168 |
+
<select class="descriptionElementTagID">
|
169 |
+
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
170 |
+
<option value="<?php echo $elementTagID; ?>"><?php echo $elementTag; ?></option>
|
171 |
+
<?php endforeach; ?>
|
172 |
+
</select>
|
173 |
+
</div>
|
174 |
+
<div class="clear"></div>
|
175 |
+
<textarea class="description" rows="3" cols="" style="width: 100%;"></textarea><br />
|
176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
</div>
|
|
|
|
|
178 |
|
179 |
+
<div class="slideshow-group">
|
180 |
|
181 |
+
<div class="slideshow-label"><?php _e('URL', 'slideshow-jquery-image-gallery'); ?></div>
|
182 |
+
<input type="text" class="url" value="" style="width: 100%;" /><br />
|
183 |
|
184 |
+
<div class="slideshow-label slideshow-left"><?php _e('Open URL in', 'slideshow-jquery-image-gallery'); ?></div>
|
185 |
+
<select class="urlTarget slideshow-right">
|
186 |
+
<option value="_self"><?php _e('Same window', 'slideshow-jquery-image-gallery'); ?></option>
|
187 |
+
<option value="_blank"><?php _e('New window', 'slideshow-jquery-image-gallery'); ?></option>
|
188 |
+
</select>
|
189 |
+
<div class="clear"></div>
|
190 |
|
191 |
+
<div class="slideshow-label slideshow-left"><?php _e('Don\'t let search engines follow link', 'slideshow-jquery-image-gallery'); ?></div>
|
192 |
+
<input type="checkbox" class="noFollow slideshow-right" />
|
|
|
|
|
|
|
|
|
193 |
|
194 |
+
</div>
|
|
|
195 |
|
196 |
+
<div class="slideshow-group">
|
197 |
|
198 |
+
<div class="slideshow-label"><?php _e('Alternative text', 'slideshow-jquery-image-gallery'); ?></div>
|
199 |
+
<input type="text" class="alternativeText" style="width: 100%;" />
|
200 |
|
201 |
+
</div>
|
|
|
202 |
|
203 |
+
<div class="slideshow-group slideshow-delete-slide">
|
204 |
+
<span><?php _e('Delete slide', 'slideshow-jquery-image-gallery'); ?></span>
|
205 |
+
</div>
|
206 |
|
207 |
+
<input type="hidden" class="type" value="attachment" />
|
208 |
+
<input type="hidden" class="postId" value="" />
|
|
|
209 |
|
210 |
+
</div>
|
|
|
211 |
|
212 |
</div>
|
|
|
213 |
</div>
|
214 |
+
<?php endif; ?>
|
views/SlideshowPluginSlideshowSlide/backend_text.php
CHANGED
@@ -1,147 +1,152 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
$
|
4 |
|
5 |
-
$
|
6 |
|
7 |
-
$
|
8 |
|
9 |
-
$
|
10 |
|
11 |
-
|
12 |
-
{
|
13 |
-
$title = SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['title']);
|
14 |
-
}
|
15 |
|
16 |
-
|
17 |
-
{
|
18 |
-
$titleElementTag = $properties['titleElementTagID'];
|
19 |
-
}
|
20 |
|
21 |
-
if (isset($properties['
|
22 |
-
{
|
23 |
-
|
24 |
-
}
|
25 |
|
26 |
-
if (isset($properties['
|
27 |
-
{
|
28 |
-
|
29 |
-
}
|
30 |
|
31 |
-
if (isset($properties['
|
32 |
-
{
|
33 |
-
|
34 |
-
}
|
35 |
|
36 |
-
if (isset($properties['
|
37 |
-
{
|
38 |
-
|
39 |
-
}
|
40 |
|
41 |
-
if (isset($properties['
|
42 |
-
{
|
43 |
-
|
44 |
-
}
|
45 |
|
46 |
-
if (isset($properties['
|
47 |
-
{
|
48 |
-
|
49 |
-
}
|
50 |
|
51 |
-
if (isset($properties['
|
52 |
-
{
|
53 |
-
|
54 |
-
}
|
55 |
|
56 |
-
|
|
|
|
|
|
|
57 |
|
58 |
-
|
|
|
|
|
|
|
59 |
|
60 |
-
|
61 |
|
62 |
-
<div class="
|
63 |
-
<div class="slide-icon text-slide-icon"></div>
|
64 |
-
<div class="slide-title">
|
65 |
-
<?php if (strlen($title) > 0) : ?>
|
66 |
|
67 |
-
|
68 |
|
69 |
-
|
|
|
|
|
|
|
70 |
|
71 |
-
|
72 |
|
73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
</div>
|
75 |
-
<div class="clear"></div>
|
76 |
-
</div>
|
77 |
|
78 |
-
|
79 |
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
-
<div class="slideshow-left slideshow-label"><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></div>
|
83 |
-
<div class="slideshow-right">
|
84 |
-
<select name="<?php echo $name; ?>[titleElementTagID]">
|
85 |
-
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
86 |
-
<option value="<?php echo $elementTagID; ?>" <?php selected($titleElementTagID, $elementTagID); ?>><?php echo $elementTag; ?></option>
|
87 |
-
<?php endforeach; ?>
|
88 |
-
</select>
|
89 |
</div>
|
90 |
-
<div class="clear"></div>
|
91 |
-
<input type="text" name="<?php echo $name; ?>[title]" value="<?php echo $title; ?>" style="width: 100%;" /><br />
|
92 |
|
93 |
-
|
94 |
|
95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
-
<div class="slideshow-left slideshow-label"><?php _e('Description', 'slideshow-jquery-image-gallery'); ?></div>
|
98 |
-
<div class="slideshow-right">
|
99 |
-
<select name="<?php echo $name; ?>[descriptionElementTagID]">
|
100 |
-
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
101 |
-
<option value="<?php echo $elementTagID; ?>" <?php selected($descriptionElementTagID, $elementTagID); ?>><?php echo $elementTag; ?></option>
|
102 |
-
<?php endforeach; ?>
|
103 |
-
</select>
|
104 |
</div>
|
105 |
-
<div clear="clear"></div>
|
106 |
-
<textarea name="<?php echo $name; ?>[description]" rows="7" cols="" style="width: 100%;"><?php echo $description; ?></textarea><br />
|
107 |
|
108 |
-
|
109 |
|
110 |
-
|
|
|
111 |
|
112 |
-
|
113 |
-
|
|
|
114 |
|
115 |
-
|
116 |
-
<input type="text" name="<?php echo $name; ?>[color]" value="<?php echo $color; ?>" class="wp-color-picker-field" />
|
117 |
-
<div style="font-style: italic;"><?php _e('(Leave empty for a transparent background)', 'slideshow-jquery-image-gallery'); ?></div>
|
118 |
|
119 |
-
|
120 |
|
121 |
-
|
|
|
122 |
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
|
|
125 |
|
126 |
-
|
127 |
-
|
128 |
-
<
|
129 |
-
<option value="_blank" <?php selected('_blank', $target); ?>><?php _e('New window', 'slideshow-jquery-image-gallery'); ?></option>
|
130 |
-
</select>
|
131 |
-
<div class="clear"></div>
|
132 |
|
133 |
-
|
134 |
-
<input type="checkbox" name="<?php echo $name; ?>[noFollow]" value="" <?php checked($noFollow); ?> class="slideshow-right" />
|
135 |
-
<div class="clear"></div>
|
136 |
|
137 |
-
|
|
|
|
|
138 |
|
139 |
-
|
140 |
-
<span><?php _e('Delete slide', 'slideshow-jquery-image-gallery'); ?></span>
|
141 |
-
</div>
|
142 |
|
143 |
-
|
144 |
|
145 |
</div>
|
146 |
-
|
147 |
-
</div>
|
1 |
<?php
|
2 |
|
3 |
+
if ($data instanceof stdClass) :
|
4 |
|
5 |
+
$properties = $data->properties;
|
6 |
|
7 |
+
$name = htmlspecialchars($data->name);
|
8 |
|
9 |
+
$title = $description = $textColor = $color = $url = $target = '';
|
10 |
|
11 |
+
$titleElementTagID = $descriptionElementTagID = SlideshowPluginSlideInserter::getElementTag();
|
|
|
|
|
|
|
12 |
|
13 |
+
$noFollow = false;
|
|
|
|
|
|
|
14 |
|
15 |
+
if (isset($properties['title']))
|
16 |
+
{
|
17 |
+
$title = SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['title']);
|
18 |
+
}
|
19 |
|
20 |
+
if (isset($properties['titleElementTagID']))
|
21 |
+
{
|
22 |
+
$titleElementTag = $properties['titleElementTagID'];
|
23 |
+
}
|
24 |
|
25 |
+
if (isset($properties['description']))
|
26 |
+
{
|
27 |
+
$description = SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['description']);
|
28 |
+
}
|
29 |
|
30 |
+
if (isset($properties['descriptionElementTagID']))
|
31 |
+
{
|
32 |
+
$descriptionElementTag = $properties['descriptionElementTagID'];
|
33 |
+
}
|
34 |
|
35 |
+
if (isset($properties['textColor']))
|
36 |
+
{
|
37 |
+
$textColor = htmlspecialchars($properties['textColor']);
|
38 |
+
}
|
39 |
|
40 |
+
if (isset($properties['color']))
|
41 |
+
{
|
42 |
+
$color = htmlspecialchars($properties['color']);
|
43 |
+
}
|
44 |
|
45 |
+
if (isset($properties['url']))
|
46 |
+
{
|
47 |
+
$url = htmlspecialchars($properties['url']);
|
48 |
+
}
|
49 |
|
50 |
+
if (isset($properties['urlTarget']))
|
51 |
+
{
|
52 |
+
$target = $properties['urlTarget'];
|
53 |
+
}
|
54 |
|
55 |
+
if (isset($properties['noFollow']))
|
56 |
+
{
|
57 |
+
$noFollow = true;
|
58 |
+
}
|
59 |
|
60 |
+
?>
|
61 |
|
62 |
+
<div class="widefat sortable-slides-list-item postbox">
|
|
|
|
|
|
|
63 |
|
64 |
+
<div class="handlediv" title="<?php _e('Click to toggle'); ?>"><br></div>
|
65 |
|
66 |
+
<div class="hndle">
|
67 |
+
<div class="slide-icon text-slide-icon"></div>
|
68 |
+
<div class="slide-title">
|
69 |
+
<?php if (strlen($title) > 0) : ?>
|
70 |
|
71 |
+
<?php echo $title; ?>
|
72 |
|
73 |
+
<?php else : ?>
|
74 |
+
|
75 |
+
<?php _e('Text slide', 'slideshow-jquery-image-gallery'); ?>
|
76 |
+
|
77 |
+
<?php endif; ?>
|
78 |
+
</div>
|
79 |
+
<div class="clear"></div>
|
80 |
</div>
|
|
|
|
|
81 |
|
82 |
+
<div class="inside">
|
83 |
|
84 |
+
<div class="slideshow-group">
|
85 |
+
|
86 |
+
<div class="slideshow-left slideshow-label"><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></div>
|
87 |
+
<div class="slideshow-right">
|
88 |
+
<select name="<?php echo $name; ?>[titleElementTagID]">
|
89 |
+
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
90 |
+
<option value="<?php echo $elementTagID; ?>" <?php selected($titleElementTagID, $elementTagID); ?>><?php echo $elementTag; ?></option>
|
91 |
+
<?php endforeach; ?>
|
92 |
+
</select>
|
93 |
+
</div>
|
94 |
+
<div class="clear"></div>
|
95 |
+
<input type="text" name="<?php echo $name; ?>[title]" value="<?php echo $title; ?>" style="width: 100%;" /><br />
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
</div>
|
|
|
|
|
98 |
|
99 |
+
<div class="slideshow-group">
|
100 |
|
101 |
+
<div class="slideshow-left slideshow-label"><?php _e('Description', 'slideshow-jquery-image-gallery'); ?></div>
|
102 |
+
<div class="slideshow-right">
|
103 |
+
<select name="<?php echo $name; ?>[descriptionElementTagID]">
|
104 |
+
<?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag): ?>
|
105 |
+
<option value="<?php echo $elementTagID; ?>" <?php selected($descriptionElementTagID, $elementTagID); ?>><?php echo $elementTag; ?></option>
|
106 |
+
<?php endforeach; ?>
|
107 |
+
</select>
|
108 |
+
</div>
|
109 |
+
<div clear="clear"></div>
|
110 |
+
<textarea name="<?php echo $name; ?>[description]" rows="7" cols="" style="width: 100%;"><?php echo $description; ?></textarea><br />
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
</div>
|
|
|
|
|
113 |
|
114 |
+
<div class="slideshow-group">
|
115 |
|
116 |
+
<div class="slideshow-label"><?php _e('Text color', 'slideshow-jquery-image-gallery'); ?></div>
|
117 |
+
<input type="text" name="<?php echo $name; ?>[textColor]" value="<?php echo $textColor; ?>" class="wp-color-picker-field" />
|
118 |
|
119 |
+
<div class="slideshow-label"><?php _e('Background color', 'slideshow-jquery-image-gallery'); ?></div>
|
120 |
+
<input type="text" name="<?php echo $name; ?>[color]" value="<?php echo $color; ?>" class="wp-color-picker-field" />
|
121 |
+
<div style="font-style: italic;"><?php _e('(Leave empty for a transparent background)', 'slideshow-jquery-image-gallery'); ?></div>
|
122 |
|
123 |
+
</div>
|
|
|
|
|
124 |
|
125 |
+
<div class="slideshow-group">
|
126 |
|
127 |
+
<div class="slideshow-label"><?php _e('URL', 'slideshow-jquery-image-gallery'); ?></div>
|
128 |
+
<input type="text" name="<?php echo $name; ?>[url]" value="<?php echo $url; ?>" style="width: 100%;" />
|
129 |
|
130 |
+
<div class="slideshow-label slideshow-left"><?php _e('Open URL in', 'slideshow-jquery-image-gallery'); ?></div>
|
131 |
+
<select name="<?php echo $name; ?>[urlTarget]" class="slideshow-right">
|
132 |
+
<option value="_self" <?php selected('_self', $target); ?>><?php _e('Same window', 'slideshow-jquery-image-gallery'); ?></option>
|
133 |
+
<option value="_blank" <?php selected('_blank', $target); ?>><?php _e('New window', 'slideshow-jquery-image-gallery'); ?></option>
|
134 |
+
</select>
|
135 |
+
<div class="clear"></div>
|
136 |
|
137 |
+
<div class="slideshow-label slideshow-left"><?php _e('Don\'t let search engines follow link', 'slideshow-jquery-image-gallery'); ?></div>
|
138 |
+
<input type="checkbox" name="<?php echo $name; ?>[noFollow]" value="" <?php checked($noFollow); ?> class="slideshow-right" />
|
139 |
+
<div class="clear"></div>
|
|
|
|
|
|
|
140 |
|
141 |
+
</div>
|
|
|
|
|
142 |
|
143 |
+
<div class="slideshow-group slideshow-delete-slide">
|
144 |
+
<span><?php _e('Delete slide', 'slideshow-jquery-image-gallery'); ?></span>
|
145 |
+
</div>
|
146 |
|
147 |
+
<input type="hidden" name="<?php echo $name; ?>[type]" value="text" />
|
|
|
|
|
148 |
|
149 |
+
</div>
|
150 |
|
151 |
</div>
|
152 |
+
<?php endif; ?>
|
|
views/SlideshowPluginSlideshowSlide/backend_video.php
CHANGED
@@ -1,58 +1,63 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
$
|
4 |
|
5 |
-
$
|
6 |
-
$showRelatedVideos = 'false';
|
7 |
|
8 |
-
|
9 |
-
{
|
10 |
-
$videoId = htmlspecialchars($properties['videoId']);
|
11 |
-
}
|
12 |
|
13 |
-
|
14 |
-
$
|
15 |
-
{
|
16 |
-
$showRelatedVideos = 'true';
|
17 |
-
}
|
18 |
|
19 |
-
|
|
|
|
|
|
|
20 |
|
21 |
-
|
|
|
|
|
|
|
|
|
22 |
|
23 |
-
|
24 |
|
25 |
-
<div class="
|
26 |
-
|
27 |
-
<div class="
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
</div>
|
30 |
-
<div class="clear"></div>
|
31 |
-
</div>
|
32 |
|
33 |
-
|
34 |
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
|
48 |
-
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
|
54 |
-
|
55 |
|
56 |
-
|
57 |
|
58 |
-
</div>
|
|
1 |
<?php
|
2 |
|
3 |
+
if ($data instanceof stdClass) :
|
4 |
|
5 |
+
$properties = $data->properties;
|
|
|
6 |
|
7 |
+
$name = htmlspecialchars($data->name);
|
|
|
|
|
|
|
8 |
|
9 |
+
$videoId = '';
|
10 |
+
$showRelatedVideos = 'false';
|
|
|
|
|
|
|
11 |
|
12 |
+
if (isset($properties['videoId']))
|
13 |
+
{
|
14 |
+
$videoId = htmlspecialchars($properties['videoId']);
|
15 |
+
}
|
16 |
|
17 |
+
if (isset($properties['showRelatedVideos']) &&
|
18 |
+
$properties['showRelatedVideos'] === 'true')
|
19 |
+
{
|
20 |
+
$showRelatedVideos = 'true';
|
21 |
+
}
|
22 |
|
23 |
+
?>
|
24 |
|
25 |
+
<div class="widefat sortable-slides-list-item postbox">
|
26 |
+
|
27 |
+
<div class="handlediv" title="<?php _e('Click to toggle'); ?>"><br></div>
|
28 |
+
|
29 |
+
<div class="hndle">
|
30 |
+
<div class="slide-icon video-slide-icon"></div>
|
31 |
+
<div class="slide-title">
|
32 |
+
<?php _e('Video slide', 'slideshow-jquery-image-gallery'); ?>
|
33 |
+
</div>
|
34 |
+
<div class="clear"></div>
|
35 |
</div>
|
|
|
|
|
36 |
|
37 |
+
<div class="inside">
|
38 |
|
39 |
+
<div class="slideshow-group">
|
40 |
|
41 |
+
<div class="slideshow-label"><?php _e('Youtube Video ID', 'slideshow-jquery-image-gallery'); ?></div>
|
42 |
+
<input type="text" name="<?php echo $name; ?>[videoId]" value="<?php echo $videoId; ?>" style="width: 100%;" />
|
43 |
|
44 |
+
</div>
|
45 |
|
46 |
+
<div class="slideshow-group">
|
47 |
|
48 |
+
<div class="slideshow-label"><?php _e('Show related videos', 'slideshow-jquery-image-gallery'); ?></div>
|
49 |
+
<label><input type="radio" name="<?php echo $name; ?>[showRelatedVideos]" value="true" <?php checked('true', $showRelatedVideos); ?>><?php _e('Yes', 'slideshow-jquery-image-gallery'); ?></label>
|
50 |
+
<label><input type="radio" name="<?php echo $name; ?>[showRelatedVideos]" value="false" <?php checked('false', $showRelatedVideos); ?>><?php _e('No', 'slideshow-jquery-image-gallery'); ?></label>
|
51 |
|
52 |
+
</div>
|
53 |
|
54 |
+
<div class="slideshow-group slideshow-delete-slide">
|
55 |
+
<span><?php _e('Delete slide', 'slideshow-jquery-image-gallery'); ?></span>
|
56 |
+
</div>
|
57 |
|
58 |
+
<input type="hidden" name="<?php echo $name; ?>[type]" value="video" />
|
59 |
|
60 |
+
</div>
|
61 |
|
62 |
+
</div>
|
63 |
+
<?php endif; ?>
|
views/SlideshowPluginSlideshowSlide/frontend_attachment.php
CHANGED
@@ -1,134 +1,139 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
|
5 |
-
$
|
6 |
|
7 |
-
|
8 |
-
{
|
9 |
-
$title = trim(SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['title']));
|
10 |
-
}
|
11 |
|
12 |
-
|
13 |
-
{
|
14 |
-
$titleElementTag = SlideshowPluginSlideInserter::getElementTag($properties['titleElementTagID']);
|
15 |
-
}
|
16 |
|
17 |
-
if (isset($properties['
|
18 |
-
{
|
19 |
-
|
20 |
-
}
|
21 |
-
|
22 |
-
if (isset($properties['descriptionElementTagID']))
|
23 |
-
{
|
24 |
-
$descriptionElementTag = SlideshowPluginSlideInserter::getElementTag($properties['descriptionElementTagID']);
|
25 |
-
}
|
26 |
-
|
27 |
-
if (isset($properties['url']))
|
28 |
-
{
|
29 |
-
$url = htmlspecialchars($properties['url']);
|
30 |
-
}
|
31 |
|
32 |
-
if (isset($properties['
|
33 |
-
{
|
34 |
-
|
35 |
-
}
|
36 |
|
37 |
-
if (isset($properties['
|
38 |
-
{
|
39 |
-
|
40 |
-
}
|
41 |
|
42 |
-
if (isset($properties['
|
43 |
-
{
|
44 |
-
|
45 |
-
}
|
46 |
|
47 |
-
if (isset($properties['
|
48 |
-
{
|
49 |
-
|
50 |
-
}
|
51 |
|
52 |
-
|
53 |
-
|
|
|
|
|
54 |
|
55 |
-
|
|
|
|
|
|
|
56 |
|
57 |
-
if (
|
58 |
{
|
59 |
-
$
|
60 |
-
|
61 |
-
(strlen($urlTarget) > 0 ? 'target="' . $urlTarget . '" ' : '') .
|
62 |
-
$noFollow;
|
63 |
|
64 |
-
|
65 |
-
|
|
|
66 |
}
|
67 |
|
68 |
-
//
|
69 |
-
|
70 |
-
|
|
|
71 |
|
72 |
-
|
73 |
-
if (empty($alternativeText))
|
74 |
{
|
75 |
-
$
|
|
|
|
|
|
|
76 |
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
|
|
|
|
81 |
|
|
|
82 |
if (empty($alternativeText))
|
83 |
{
|
84 |
-
$alternativeText =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
}
|
86 |
-
}
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
{
|
99 |
-
if (!empty($attachment->guid))
|
100 |
{
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
}
|
103 |
else
|
104 |
{
|
105 |
-
$
|
106 |
-
}
|
107 |
-
}
|
108 |
-
else
|
109 |
-
{
|
110 |
-
$imageSrc = $image[0];
|
111 |
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
116 |
}
|
117 |
-
}
|
118 |
-
|
119 |
-
// If image is available
|
120 |
-
if ($imageAvailable): ?>
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
<?php echo
|
|
|
|
|
|
|
|
|
129 |
</div>
|
130 |
-
</div>
|
131 |
|
|
|
132 |
<?php endif; ?>
|
133 |
<?php endif; ?>
|
134 |
<?php endif; ?>
|
1 |
<?php
|
2 |
|
3 |
+
if ($data instanceof stdClass):
|
4 |
|
5 |
+
$properties = $data->properties;
|
6 |
|
7 |
+
$title = $description = $url = $urlTarget = $alternativeText = $noFollow = $postId = '';
|
|
|
|
|
|
|
8 |
|
9 |
+
$titleElementTag = $descriptionElementTag = SlideshowPluginSlideInserter::getElementTag();
|
|
|
|
|
|
|
10 |
|
11 |
+
if (isset($properties['title']))
|
12 |
+
{
|
13 |
+
$title = trim(SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['title']));
|
14 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
if (isset($properties['titleElementTagID']))
|
17 |
+
{
|
18 |
+
$titleElementTag = SlideshowPluginSlideInserter::getElementTag($properties['titleElementTagID']);
|
19 |
+
}
|
20 |
|
21 |
+
if (isset($properties['description']))
|
22 |
+
{
|
23 |
+
$description = trim(SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['description']));
|
24 |
+
}
|
25 |
|
26 |
+
if (isset($properties['descriptionElementTagID']))
|
27 |
+
{
|
28 |
+
$descriptionElementTag = SlideshowPluginSlideInserter::getElementTag($properties['descriptionElementTagID']);
|
29 |
+
}
|
30 |
|
31 |
+
if (isset($properties['url']))
|
32 |
+
{
|
33 |
+
$url = htmlspecialchars($properties['url']);
|
34 |
+
}
|
35 |
|
36 |
+
if (isset($properties['urlTarget']))
|
37 |
+
{
|
38 |
+
$urlTarget = htmlspecialchars($properties['urlTarget']);
|
39 |
+
}
|
40 |
|
41 |
+
if (isset($properties['alternativeText']))
|
42 |
+
{
|
43 |
+
$alternativeText = htmlspecialchars($properties['alternativeText']);
|
44 |
+
}
|
45 |
|
46 |
+
if (isset($properties['noFollow']))
|
47 |
{
|
48 |
+
$noFollow = ' rel="nofollow" ';
|
49 |
+
}
|
|
|
|
|
50 |
|
51 |
+
if (isset($properties['postId']))
|
52 |
+
{
|
53 |
+
$postId = $properties['postId'];
|
54 |
}
|
55 |
|
56 |
+
// Post ID should always be numeric
|
57 |
+
if (is_numeric($postId)):
|
58 |
+
|
59 |
+
$anchorTag = $endAnchorTag = $anchorTagAttributes = '';
|
60 |
|
61 |
+
if (strlen($url) > 0)
|
|
|
62 |
{
|
63 |
+
$anchorTagAttributes =
|
64 |
+
'href="' . $url . '" ' .
|
65 |
+
(strlen($urlTarget) > 0 ? 'target="' . $urlTarget . '" ' : '') .
|
66 |
+
$noFollow;
|
67 |
|
68 |
+
$anchorTag = '<a ' . $anchorTagAttributes . '>';
|
69 |
+
$endAnchorTag = '</a>';
|
70 |
+
}
|
71 |
+
|
72 |
+
// Get post from post id. Post should be able to load
|
73 |
+
$attachment = get_post($postId);
|
74 |
+
if (!empty($attachment)):
|
75 |
|
76 |
+
// If no alternative text is set, get the alt from the original image
|
77 |
if (empty($alternativeText))
|
78 |
{
|
79 |
+
$alternativeText = $title;
|
80 |
+
|
81 |
+
if (empty($alternativeText))
|
82 |
+
{
|
83 |
+
$alternativeText = htmlspecialchars($attachment->post_title);
|
84 |
+
}
|
85 |
+
|
86 |
+
if (empty($alternativeText))
|
87 |
+
{
|
88 |
+
$alternativeText = htmlspecialchars($attachment->post_content);
|
89 |
+
}
|
90 |
}
|
|
|
91 |
|
92 |
+
// Prepare image
|
93 |
+
$image = wp_get_attachment_image_src($attachment->ID, 'full');
|
94 |
+
$imageSrc = '';
|
95 |
+
$imageWidth = 0;
|
96 |
+
$imageHeight = 0;
|
97 |
+
$imageAvailable = true;
|
98 |
|
99 |
+
if (!is_array($image) ||
|
100 |
+
!$image ||
|
101 |
+
!isset($image[0]))
|
|
|
|
|
102 |
{
|
103 |
+
if (!empty($attachment->guid))
|
104 |
+
{
|
105 |
+
$imageSrc = $attachment->guid;
|
106 |
+
}
|
107 |
+
else
|
108 |
+
{
|
109 |
+
$imageAvailable = false;
|
110 |
+
}
|
111 |
}
|
112 |
else
|
113 |
{
|
114 |
+
$imageSrc = $image[0];
|
|
|
|
|
|
|
|
|
|
|
115 |
|
116 |
+
if (isset($image[1], $image[2]))
|
117 |
+
{
|
118 |
+
$imageWidth = $image[1];
|
119 |
+
$imageHeight = $image[2];
|
120 |
+
}
|
121 |
}
|
|
|
|
|
|
|
|
|
122 |
|
123 |
+
// If image is available
|
124 |
+
if ($imageAvailable): ?>
|
125 |
+
|
126 |
+
<div class="slideshow_slide slideshow_slide_image">
|
127 |
+
<?php echo $anchorTag; ?>
|
128 |
+
<img src="<?php echo htmlspecialchars($imageSrc); ?>" alt="<?php echo $alternativeText; ?>" <?php echo ($imageWidth > 0) ? 'width="' . $imageWidth . '"' : ''; ?> <?php echo ($imageHeight > 0) ? 'height="' . $imageHeight . '"' : ''; ?> />
|
129 |
+
<?php echo $endAnchorTag; ?>
|
130 |
+
<div class="slideshow_description_box slideshow_transparent">
|
131 |
+
<?php echo !empty($title) ? '<' . $titleElementTag . ' class="slideshow_title">' . $anchorTag . $title . $endAnchorTag . '</' . $titleElementTag . '>' : ''; ?>
|
132 |
+
<?php echo !empty($description) ? '<' . $descriptionElementTag . ' class="slideshow_description">' . $anchorTag . $description . $endAnchorTag . '</' . $descriptionElementTag . '>' : ''; ?>
|
133 |
+
</div>
|
134 |
</div>
|
|
|
135 |
|
136 |
+
<?php endif; ?>
|
137 |
<?php endif; ?>
|
138 |
<?php endif; ?>
|
139 |
<?php endif; ?>
|
views/SlideshowPluginSlideshowSlide/frontend_text.php
CHANGED
@@ -1,100 +1,105 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
|
5 |
-
$
|
6 |
|
7 |
-
|
8 |
-
{
|
9 |
-
$title = trim(SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['title']));
|
10 |
-
}
|
11 |
|
12 |
-
|
13 |
-
{
|
14 |
-
$titleElementTag = SlideshowPluginSlideInserter::getElementTag($properties['titleElementTagID']);
|
15 |
-
}
|
16 |
|
17 |
-
if (isset($properties['
|
18 |
-
{
|
19 |
-
|
20 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
-
if (
|
23 |
-
{
|
24 |
-
|
25 |
-
}
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
|
31 |
-
if (
|
32 |
{
|
33 |
-
$
|
34 |
}
|
35 |
|
36 |
-
|
37 |
-
|
|
|
|
|
38 |
|
39 |
-
|
40 |
-
{
|
41 |
-
$color = $properties['color'];
|
42 |
|
43 |
-
if (
|
44 |
{
|
45 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
if
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
$anchorTagAttributes =
|
71 |
-
'href="' . $url . '" ' .
|
72 |
-
(strlen($urlTarget) > 0 ? 'target="' . $urlTarget . '" ' : '') .
|
73 |
-
(strlen($textColor) > 0 ? 'style="color: ' . $textColor . '" ' : '') .
|
74 |
-
$noFollow;
|
75 |
-
|
76 |
-
$anchorTag = '<a ' . $anchorTagAttributes . '>';
|
77 |
-
$endAnchorTag = '</a>';
|
78 |
-
}
|
79 |
-
|
80 |
-
?>
|
81 |
-
|
82 |
-
<div class="slideshow_slide slideshow_slide_text" style="<?php echo strlen($color) > 0 ? 'background-color: ' . $color . ';' : '' ?>">
|
83 |
-
<?php if(strlen($title) > 0): ?>
|
84 |
-
<<?php echo $titleElementTag; ?> class="slideshow_title" style="<?php echo strlen($textColor) > 0 ? 'color: ' . $textColor . ';' : ''; ?>">
|
85 |
-
<?php echo $anchorTag; ?>
|
86 |
-
<?php echo $title; ?>
|
87 |
-
<?php echo $endAnchorTag; ?>
|
88 |
-
</<?php echo $titleElementTag; ?>>
|
89 |
-
<?php endif; ?>
|
90 |
-
|
91 |
-
<?php if(strlen($description) > 0): ?>
|
92 |
-
<<?php echo $descriptionElementTag; ?> class="slideshow_description" style="<?php echo strlen($textColor) > 0 ? 'color: ' . $textColor . ';' : ''; ?>">
|
93 |
-
<?php echo $anchorTag; ?>
|
94 |
-
<?php echo $description; ?>
|
95 |
-
<?php echo $endAnchorTag; ?>
|
96 |
-
</<?php echo $descriptionElementTag; ?>>
|
97 |
-
<?php endif; ?>
|
98 |
-
|
99 |
-
<a <?php echo $anchorTagAttributes ?> class="slideshow_background_anchor"></a>
|
100 |
-
</div>
|
1 |
<?php
|
2 |
|
3 |
+
if ($data instanceof stdClass) :
|
4 |
|
5 |
+
$properties = $data->properties;
|
6 |
|
7 |
+
$title = $description = $textColor = $color = $url = $urlTarget = $noFollow = '';
|
|
|
|
|
|
|
8 |
|
9 |
+
$titleElementTag = $descriptionElementTag = SlideshowPluginSlideInserter::getElementTag();
|
|
|
|
|
|
|
10 |
|
11 |
+
if (isset($properties['title']))
|
12 |
+
{
|
13 |
+
$title = trim(SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['title']));
|
14 |
+
}
|
15 |
+
|
16 |
+
if (isset($properties['titleElementTagID']))
|
17 |
+
{
|
18 |
+
$titleElementTag = SlideshowPluginSlideInserter::getElementTag($properties['titleElementTagID']);
|
19 |
+
}
|
20 |
+
|
21 |
+
if (isset($properties['description']))
|
22 |
+
{
|
23 |
+
$description = trim(SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['description']));
|
24 |
+
}
|
25 |
+
|
26 |
+
if (isset($properties['descriptionElementTagID']))
|
27 |
+
{
|
28 |
+
$descriptionElementTag = SlideshowPluginSlideInserter::getElementTag($properties['descriptionElementTagID']);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (isset($properties['textColor']))
|
32 |
+
{
|
33 |
+
$textColor = $properties['textColor'];
|
34 |
+
|
35 |
+
if (substr($textColor, 0, 1) != '#')
|
36 |
+
{
|
37 |
+
$textColor = '#' . $textColor;
|
38 |
+
}
|
39 |
+
|
40 |
+
$textColor = htmlspecialchars($textColor);
|
41 |
+
}
|
42 |
+
|
43 |
+
if (isset($properties['color']))
|
44 |
+
{
|
45 |
+
$color = $properties['color'];
|
46 |
|
47 |
+
if (substr($color, 0, 1) != '#')
|
48 |
+
{
|
49 |
+
$color = '#' . $color;
|
50 |
+
}
|
51 |
|
52 |
+
$color = htmlspecialchars($color);
|
53 |
+
}
|
54 |
+
|
55 |
+
if (isset($properties['url']))
|
56 |
+
{
|
57 |
+
$url = htmlspecialchars($properties['url']);
|
58 |
+
}
|
59 |
|
60 |
+
if (isset($properties['urlTarget']))
|
61 |
{
|
62 |
+
$urlTarget = htmlspecialchars($properties['urlTarget']);
|
63 |
}
|
64 |
|
65 |
+
if (isset($properties['noFollow']))
|
66 |
+
{
|
67 |
+
$noFollow = 'rel="nofollow"';
|
68 |
+
}
|
69 |
|
70 |
+
$anchorTag = $endAnchorTag = $anchorTagAttributes = '';
|
|
|
|
|
71 |
|
72 |
+
if (strlen($url) > 0)
|
73 |
{
|
74 |
+
$anchorTagAttributes =
|
75 |
+
'href="' . $url . '" ' .
|
76 |
+
(strlen($urlTarget) > 0 ? 'target="' . $urlTarget . '" ' : '') .
|
77 |
+
(strlen($textColor) > 0 ? 'style="color: ' . $textColor . '" ' : '') .
|
78 |
+
$noFollow;
|
79 |
+
|
80 |
+
$anchorTag = '<a ' . $anchorTagAttributes . '>';
|
81 |
+
$endAnchorTag = '</a>';
|
82 |
}
|
83 |
|
84 |
+
?>
|
85 |
+
|
86 |
+
<div class="slideshow_slide slideshow_slide_text" style="<?php echo strlen($color) > 0 ? 'background-color: ' . $color . ';' : '' ?>">
|
87 |
+
<?php if(strlen($title) > 0): ?>
|
88 |
+
<<?php echo $titleElementTag; ?> class="slideshow_title" style="<?php echo strlen($textColor) > 0 ? 'color: ' . $textColor . ';' : ''; ?>">
|
89 |
+
<?php echo $anchorTag; ?>
|
90 |
+
<?php echo $title; ?>
|
91 |
+
<?php echo $endAnchorTag; ?>
|
92 |
+
</<?php echo $titleElementTag; ?>>
|
93 |
+
<?php endif; ?>
|
94 |
+
|
95 |
+
<?php if(strlen($description) > 0): ?>
|
96 |
+
<<?php echo $descriptionElementTag; ?> class="slideshow_description" style="<?php echo strlen($textColor) > 0 ? 'color: ' . $textColor . ';' : ''; ?>">
|
97 |
+
<?php echo $anchorTag; ?>
|
98 |
+
<?php echo $description; ?>
|
99 |
+
<?php echo $endAnchorTag; ?>
|
100 |
+
</<?php echo $descriptionElementTag; ?>>
|
101 |
+
<?php endif; ?>
|
102 |
+
|
103 |
+
<a <?php echo $anchorTagAttributes ?> class="slideshow_background_anchor"></a>
|
104 |
+
</div>
|
105 |
+
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/SlideshowPluginSlideshowSlide/frontend_video.php
CHANGED
@@ -1,38 +1,43 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
$
|
4 |
-
$showRelatedVideos = 0;
|
5 |
|
6 |
-
|
7 |
-
{
|
8 |
-
$videoId = htmlspecialchars($properties['videoId']);
|
9 |
-
}
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
$showRelatedVideos = 1;
|
14 |
-
}
|
15 |
|
16 |
-
|
17 |
-
|
|
|
|
|
18 |
|
19 |
-
if (($
|
20 |
-
{
|
21 |
-
|
22 |
-
|
23 |
|
24 |
-
//
|
25 |
-
$
|
26 |
|
27 |
-
|
28 |
-
if (is_array($videoId) && isset($videoId[0]))
|
29 |
{
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
-
}
|
33 |
|
34 |
-
?>
|
35 |
|
36 |
-
<div class="slideshow_slide slideshow_slide_video">
|
37 |
-
|
38 |
-
</div>
|
|
1 |
<?php
|
2 |
|
3 |
+
if ($data instanceof stdClass) :
|
|
|
4 |
|
5 |
+
$properties = $data->properties;
|
|
|
|
|
|
|
6 |
|
7 |
+
$videoId = '';
|
8 |
+
$showRelatedVideos = 0;
|
|
|
|
|
9 |
|
10 |
+
if (isset($properties['videoId']))
|
11 |
+
{
|
12 |
+
$videoId = htmlspecialchars($properties['videoId']);
|
13 |
+
}
|
14 |
|
15 |
+
if (isset($properties['showRelatedVideos']) && $properties['showRelatedVideos'] === 'true')
|
16 |
+
{
|
17 |
+
$showRelatedVideos = 1;
|
18 |
+
}
|
19 |
|
20 |
+
// If the video ID contains 'v=', it means a URL has been passed. Retrieve the video ID.
|
21 |
+
$idPosition = null;
|
22 |
|
23 |
+
if (($idPosition = stripos($videoId, 'v=')) !== false)
|
|
|
24 |
{
|
25 |
+
// The video ID, which perhaps still has some arguments behind it.
|
26 |
+
$videoId = substr($videoId, $idPosition + 2);
|
27 |
+
|
28 |
+
// Explode on extra arguments (&).
|
29 |
+
$videoId = explode('&', $videoId);
|
30 |
+
|
31 |
+
// The first element is the video ID
|
32 |
+
if (is_array($videoId) && isset($videoId[0]))
|
33 |
+
{
|
34 |
+
$videoId = $videoId[0];
|
35 |
+
}
|
36 |
}
|
|
|
37 |
|
38 |
+
?>
|
39 |
|
40 |
+
<div class="slideshow_slide slideshow_slide_video">
|
41 |
+
<div class="slideshow_slide_video_id" style="display: none;" data-show-related-videos="<?php echo $showRelatedVideos; ?>"><?php echo $videoId; ?></div>
|
42 |
+
</div>
|
43 |
+
<?php endif; ?>
|
views/SlideshowPluginUpload/upload-button.php
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<input type="button" id="upload_image_button" class="button" value="<?php _e('Upload/Manage Images', 'slideshow-jquery-image-gallery'); ?>" />
|
|
views/SlideshowPluginWidget/form.php
CHANGED
@@ -1,16 +1,20 @@
|
|
1 |
-
|
2 |
-
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></label>
|
3 |
-
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo htmlspecialchars($instance['title']); ?>" style="width:100%" />
|
4 |
-
</p>
|
5 |
|
6 |
-
<p>
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
<?php
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ($data instanceof stdClass) : ?>
|
|
|
|
|
|
|
2 |
|
3 |
+
<p>
|
4 |
+
<label for="<?php echo $data->widget->get_field_id('title'); ?>"><?php _e('Title', 'slideshow-jquery-image-gallery'); ?></label>
|
5 |
+
<input class="widefat" id="<?php echo $data->widget->get_field_id('title'); ?>" name="<?php echo $data->widget->get_field_name('title'); ?>" value="<?php echo htmlspecialchars($data->instance['title']); ?>" style="width:100%" />
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<p>
|
9 |
+
<label for="<?php echo $data->widget->get_field_id('slideshowId'); ?>"><?php _e('Slideshow', 'slideshow-jquery-image-gallery'); ?></label>
|
10 |
+
<select class="widefat" id="<?php echo $data->widget->get_field_id('slideshowId'); ?>" name="<?php echo $data->widget->get_field_name('slideshowId'); ?>" value="<?php echo (is_numeric($data->instance['slideshowId']))? $data->instance['slideshowId'] : ''; ?>" style="width:100%">
|
11 |
+
<option value="-1" <?php selected($data->instance['slideshowId'], -1); ?>><?php _e('Random Slideshow', 'slideshow-jquery-image-gallery'); ?></option>
|
12 |
+
<?php if(count($data->slideshows) > 0): ?>
|
13 |
+
<?php foreach($data->slideshows as $slideshow): ?>
|
14 |
+
<option value="<?php echo $slideshow->ID ?>" <?php selected($data->instance['slideshowId'], $slideshow->ID); ?>><?php echo !empty($slideshow->post_title) ? $slideshow->post_title : __('Untitled slideshow', 'slideshow-jquery-image-gallery'); ?></option>
|
15 |
+
<?php endforeach; ?>
|
16 |
+
<?php endif; ?>
|
17 |
+
</select>
|
18 |
+
</p>
|
19 |
+
|
20 |
+
<?php endif; ?>
|