Slideshow - Version 2.1.4

Version Description

  • Fixed: Slideshows in posts are now longer broken by Wordpress inserted 'em' tags.
  • Fixed: Image borders no longer fall off-slide.
Download this release

Release Info

Developer stefanboonstra
Plugin Icon 128x128 Slideshow
Version 2.1.4
Comparing to
See all releases

Code changes from version 1.3.5 to 2.1.4

Files changed (53) hide show
  1. classes/SlideshowPlugin.php +63 -23
  2. classes/SlideshowPluginAjax.php +16 -0
  3. classes/SlideshowPluginFeedback.php +1 -1
  4. classes/SlideshowPluginPostType.php +288 -88
  5. classes/SlideshowPluginShortcode.php +1 -1
  6. classes/SlideshowPluginSlideInserter.php +201 -0
  7. classes/SlideshowPluginUpload.php +1 -1
  8. classes/SlideshowPluginWidget.php +2 -1
  9. images/SlideshowPlugin/dark-arrows.png +0 -0
  10. images/SlideshowPlugin/dark-controlpanel.png +0 -0
  11. images/SlideshowPlugin/light-arrows.png +0 -0
  12. images/SlideshowPlugin/light-controlpanel.png +0 -0
  13. images/SlideshowPluginPostType/adminIcon.png +0 -0
  14. images/SlideshowPluginPostType/delete.png +0 -0
  15. images/SlideshowPluginPostType/draggable.png +0 -0
  16. images/SlideshowPluginPostType/no-img.png +0 -0
  17. images/SlideshowPluginSlideInserter/close.png +0 -0
  18. js/SlideshowPlugin/slideshow.js +1 -303
  19. js/SlideshowPlugin/swfobject.js +4 -0
  20. js/SlideshowPluginPostType/jscolor/arrow.gif +0 -0
  21. js/SlideshowPluginPostType/jscolor/cross.gif +0 -0
  22. js/SlideshowPluginPostType/jscolor/hs.png +0 -0
  23. js/SlideshowPluginPostType/jscolor/hv.png +0 -0
  24. js/SlideshowPluginPostType/jscolor/jscolor.js +1 -0
  25. js/SlideshowPluginPostType/post-type-handler.js +39 -0
  26. js/SlideshowPluginPostType/style-settings.js +1 -1
  27. js/SlideshowPluginSlideInserter/slide-inserter.js +296 -0
  28. languages/slideshow-plugin-nl_NL.mo +0 -0
  29. languages/slideshow-plugin-nl_NL.po +292 -108
  30. readme.txt +103 -19
  31. screenshot-1.png +0 -0
  32. screenshot-2.png +0 -0
  33. screenshot-3.png +0 -0
  34. screenshot-4.png +0 -0
  35. screenshot-5.png +0 -0
  36. screenshot-6.png +0 -0
  37. slideshow.php +88 -7
  38. style/SlideshowPlugin/functional.css +1 -0
  39. style/SlideshowPlugin/style-custom.css +83 -0
  40. style/SlideshowPlugin/style-dark.css +61 -45
  41. style/SlideshowPlugin/style-light.css +80 -0
  42. style/SlideshowPluginSlideInserter/slide-inserter.css +49 -0
  43. views/SlideshowPlugin/slideshow.php +117 -9
  44. views/SlideshowPluginPostType/information.php +4 -10
  45. views/SlideshowPluginPostType/settings.php +24 -58
  46. views/SlideshowPluginPostType/slides.php +214 -45
  47. views/SlideshowPluginPostType/style-settings.php +9 -32
  48. views/SlideshowPluginPostType/support-plugin.php +38 -0
  49. views/SlideshowPluginSlideInserter/insert-image-button.php +1 -0
  50. views/SlideshowPluginSlideInserter/insert-text-button.php +1 -0
  51. views/SlideshowPluginSlideInserter/insert-video-button.php +1 -0
  52. views/SlideshowPluginSlideInserter/search-popup.php +14 -0
  53. views/SlideshowPluginWidget/widget.php +4 -2
classes/SlideshowPlugin.php CHANGED
@@ -3,8 +3,9 @@
3
  * Class SlideslowPlugin is called whenever a slideshow do_action tag is come across.
4
  * Responsible for outputting the slideshow's HTML, CSS and Javascript.
5
  *
 
6
  * @author: Stefan Boonstra
7
- * @version: 03-07-12
8
  */
9
  class SlideshowPlugin {
10
 
@@ -13,7 +14,7 @@ class SlideshowPlugin {
13
  *
14
  * @param int $postId
15
  */
16
- static function deploy($postId = ''){
17
  echo self::prepare($postId);
18
  }
19
 
@@ -27,7 +28,7 @@ class SlideshowPlugin {
27
  * @param int $postId
28
  * @return String $output
29
  */
30
- static function prepare($postId = ''){
31
  // Check if defined which Slideshow to use
32
  if(empty($postId) || !is_numeric($postId) || $postId < 0){
33
  $post = get_posts(array(
@@ -46,43 +47,82 @@ class SlideshowPlugin {
46
  return '';
47
 
48
  // Get settings
49
- $settings = SlideshowPluginPostType::getSettings($post->ID);
50
-
51
- // Load images into array
52
- $images = array();
53
- $imageObjects = SlideshowPluginPostType::getAttachments($post->ID);
54
- foreach($imageObjects as $key => $imageObject){
55
- $images[$key] = array(
56
- 'img' => $imageObject->guid,
57
- 'title' => $imageObject->post_title,
58
- 'description' => $imageObject->post_content,
59
- 'url' => $imageObject->guid
60
- );
61
  }
62
 
63
- // Check in what way the stylesheet needs to be loaded, .css can be enqueued, custom styles need to be printed.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  $printStyle = '';
65
- if($settings['style'] == 'custom-style') // Enqueue stylesheet
66
- $printStyle = $settings['custom-style'];
67
- else // Custom style, print it.
68
  wp_enqueue_style(
69
  'slideshow_style',
70
- SlideshowPluginMain::getPluginUrl() . '/style/' . __CLASS__ . '/' . $settings['style']
71
  );
72
 
 
 
 
 
 
 
 
 
 
73
  // Include output file that stores output in $output.
74
  $output = '';
75
  ob_start();
76
  include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/slideshow.php');
77
  $output .= ob_get_clean();
78
 
 
 
 
 
 
 
79
  // Enqueue slideshow script
80
  wp_enqueue_script(
81
  'slideshow_script',
82
  SlideshowPluginMain::getPluginUrl() . '/js/' . __CLASS__ . '/slideshow.js',
83
- array('jquery'),
84
- false,
85
- true
86
  );
87
 
88
  // Return output
3
  * Class SlideslowPlugin is called whenever a slideshow do_action tag is come across.
4
  * Responsible for outputting the slideshow's HTML, CSS and Javascript.
5
  *
6
+ * TODO Create a variable in which all slideshow html can be stored
7
  * @author: Stefan Boonstra
8
+ * @version: 15-09-12
9
  */
10
  class SlideshowPlugin {
11
 
14
  *
15
  * @param int $postId
16
  */
17
+ static function deploy($postId = null){
18
  echo self::prepare($postId);
19
  }
20
 
28
  * @param int $postId
29
  * @return String $output
30
  */
31
+ static function prepare($postId = null){
32
  // Check if defined which Slideshow to use
33
  if(empty($postId) || !is_numeric($postId) || $postId < 0){
34
  $post = get_posts(array(
47
  return '';
48
 
49
  // Get settings
50
+ $allSettings = SlideshowPluginPostType::getSimpleSettings($post->ID, null, false);
51
+
52
+ // Get stored slide settings and convert them to array([slide-key] => array([setting-name] => [value]));
53
+ $slidesPreOrder = array();
54
+ $slideSettings = SlideshowPluginPostType::getSettings($post->ID, SlideshowPluginPostType::$prefixes['slide-list'], false);
55
+ foreach($slideSettings as $key => $value){
56
+ $key = explode('_', $key);
57
+ if(is_numeric($key[1]))
58
+ $slidesPreOrder[$key[1]][$key[2]] = $value;
 
 
 
59
  }
60
 
61
+ // Create array ordered by the 'order' key of the slides array: array([order-key] => [slide-key]);
62
+ $slidesOrder = array();
63
+ foreach($slidesPreOrder as $key => $value)
64
+ if(isset($value['order']) && is_numeric($value['order']) && $value['order'] > 0)
65
+ $slidesOrder[$value['order']][] = $key;
66
+ ksort($slidesOrder);
67
+
68
+ // Order slides by the order key.
69
+ $slides = array();
70
+ foreach($slidesOrder as $value)
71
+ if(is_array($value))
72
+ foreach($value as $slideId){
73
+ $slides[] = $slidesPreOrder[$slideId];
74
+ unset($slidesPreOrder[$slideId]);
75
+ }
76
+
77
+ // Add remaining (unordered) slides to the end of the array.
78
+ $slides = array_merge($slides, $slidesPreOrder);
79
+
80
+ // Randomize if setting is true.
81
+ if(isset($allSettings['setting_random']) && $allSettings['setting_random'] == 'true')
82
+ shuffle($slides);
83
+
84
+ // Enqueue functional sheet
85
+ wp_enqueue_style(
86
+ 'slideshow_functional_style',
87
+ SlideshowPluginMain::getPluginUrl() . '/style/' . __CLASS__ . '/functional.css'
88
+ );
89
+
90
+ // Enqueue stylesheet for appearance
91
  $printStyle = '';
92
+ if($allSettings['style_style'] == 'custom' && isset($allSettings['style_custom']) && !empty($allSettings['style_custom'])) // Custom style
93
+ $printStyle = str_replace('%plugin-url%', SlideshowPluginMain::getPluginUrl(), $allSettings['style_custom']);
94
+ else // Enqueue stylesheet
95
  wp_enqueue_style(
96
  'slideshow_style',
97
+ SlideshowPluginMain::getPluginUrl() . '/style/' . __CLASS__ . '/style-' . $allSettings['style_style'] . '.css'
98
  );
99
 
100
+ // Filter settings to only contain settings, then remove prefix
101
+ $settings = array();
102
+ foreach($allSettings as $key => $value)
103
+ if(SlideshowPluginPostType::$prefixes['settings'] == substr($key, 0, strlen(SlideshowPluginPostType::$prefixes['settings'])))
104
+ $settings[substr($key, strlen(SlideshowPluginPostType::$prefixes['settings']))] = $value;
105
+
106
+ // Create a microtime timestamp to host multiple slideshows on a page
107
+ $id = rand();
108
+
109
  // Include output file that stores output in $output.
110
  $output = '';
111
  ob_start();
112
  include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/slideshow.php');
113
  $output .= ob_get_clean();
114
 
115
+ // Enqueue flash object creation script
116
+ wp_enqueue_script(
117
+ 'swfobject',
118
+ SlideshowPluginMain::getPluginUrl() . '/js/' . __CLASS__ . 'swfobject.js'
119
+ );
120
+
121
  // Enqueue slideshow script
122
  wp_enqueue_script(
123
  'slideshow_script',
124
  SlideshowPluginMain::getPluginUrl() . '/js/' . __CLASS__ . '/slideshow.js',
125
+ array('jquery')
 
 
126
  );
127
 
128
  // Return output
classes/SlideshowPluginAjax.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class SlideshowAjax is used to register ajax functions
4
+ * before as soon as possible, so ajax functions don't get
5
+ * exceedingly large.
6
+ *
7
+ * @author: Stefan Boonstra
8
+ * @version: 19-05-12
9
+ */
10
+ class SlideshowPluginAjax {
11
+
12
+ static function init() {
13
+ add_action('wp_ajax_slideshow_slide_inserter_search_query', array('SlideshowPluginSlideInserter', 'printSearchResults'));
14
+ add_action('wp_ajax_slideshow_delete_slide', array('SlideshowPluginSlideInserter', 'deleteSlide'));
15
+ }
16
+ }
classes/SlideshowPluginFeedback.php CHANGED
@@ -3,7 +3,7 @@
3
  * Class SlideshowPluginFeedback collects plugin feedback which helps resolving plugin-related issues faster.
4
  *
5
  * @author: Stefan Boonstra
6
- * @version: 03-07-12
7
  */
8
  class SlideshowPluginFeedback {
9
 
3
  * Class SlideshowPluginFeedback collects plugin feedback which helps resolving plugin-related issues faster.
4
  *
5
  * @author: Stefan Boonstra
6
+ * @version: 15-09-12
7
  */
8
  class SlideshowPluginFeedback {
9
 
classes/SlideshowPluginPostType.php CHANGED
@@ -4,30 +4,20 @@
4
  * slideshows and their individual settings
5
  *
6
  * @author: Stefan Boonstra
7
- * @version: 03-07-12
8
  */
9
  class SlideshowPluginPostType {
10
 
11
  /** Variables */
12
- private static $adminIcon = 'images/adminIcon.png';
13
  static $postType = 'slideshow';
14
- static $settings = null;
15
  static $settingsMetaKey = 'settings';
16
- static $defaultSettings = array(
17
- 'slideSpeed' => 1,
18
- 'descriptionSpeed' => 0.3,
19
- 'intervalSpeed' => 5,
20
- 'width' => 0,
21
- 'height' => 200,
22
- 'stretch' => 'false',
23
- 'controllable' => 'true',
24
- 'urlsActive' => 'false',
25
- 'showText' => 'true'
26
- );
27
- static $defaultStyleSettings = array(
28
- 'style' => 'style-dark.css',
29
- 'custom-style' => ''
30
  );
 
 
31
 
32
  /**
33
  * Initialize Slideshow post type.
@@ -66,11 +56,18 @@ class SlideshowPluginPostType {
66
  'has_archive' => true,
67
  'hierarchical' => false,
68
  'menu_position' => null,
69
- 'menu_icon' => SlideshowPluginMain::getPluginUrl() . '/' . self::$adminIcon,
70
  'supports' => array('title'),
71
  'register_meta_box_cb' => array(__CLASS__, 'registerMetaBoxes')
72
  )
73
  );
 
 
 
 
 
 
 
74
  }
75
 
76
  /**
@@ -112,6 +109,17 @@ class SlideshowPluginPostType {
112
  'normal',
113
  'low'
114
  );
 
 
 
 
 
 
 
 
 
 
 
115
  }
116
 
117
  /**
@@ -132,14 +140,55 @@ class SlideshowPluginPostType {
132
  static function slidesMetaBox(){
133
  global $post;
134
 
135
- // Media upload button
136
- $uploadButton = SlideshowPluginUpload::getUploadButton();
137
 
138
- // Get slideshow attachments
139
- $attachments = self::getAttachments($post->ID);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
 
141
  // Set url from which a substitute icon can be fetched
142
- $noPreviewIcon = SlideshowPluginMain::getPluginUrl() . '/images/no-img.png';
 
 
 
 
 
 
 
143
 
144
  // Include slides preview file
145
  include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/slides.php');
@@ -152,46 +201,17 @@ class SlideshowPluginPostType {
152
  global $post;
153
 
154
  // Get settings
155
- $defaultSettings = self::$defaultStyleSettings;
156
- $settings = self::getSettings($post->ID);
157
-
158
- // Get styles from style folder
159
- $styles = array();
160
- $cssExtension = '.css';
161
- if($handle = opendir(SlideshowPluginMain::getPluginPath() . '/style/SlideshowPlugin/'))
162
- while(($file = readdir($handle)) !== false)
163
- if(strlen($file) >= strlen($cssExtension) && substr($file, strlen($file) - strlen($cssExtension)) === $cssExtension)
164
- // Converts the css file's name (style-mystyle.css) and converts it to a user readable name by
165
- // cutting the style- prefix off, replacing hyphens with spaces and getting rid of the .css.
166
- // Then it capitalizes every word and saves it to the $styles array under the original $file name.
167
- $styles[$file] = ucwords(str_replace(
168
- '-',
169
- ' ',
170
- preg_replace(
171
- '/style-/',
172
- '',
173
- substr(
174
- $file,
175
- 0,
176
- '-' . strlen($cssExtension)),
177
- 1
178
- )));
179
 
180
  // Fill custom style with default css if empty
181
- if(empty($settings['custom-style'])){
182
  ob_start();
183
- include(SlideshowPluginMain::getPluginPath() . '/style/SlideshowPlugin/style-dark.css');
184
- $settings['custom-style'] = ob_get_clean();
185
  }
186
 
187
- // Enqueue associating script
188
- wp_enqueue_script(
189
- 'style-settings',
190
- SlideshowPluginMain::getPluginUrl() . '/js/' . __CLASS__ . '/style-settings.js',
191
- array('jquery'),
192
- false,
193
- true
194
- );
195
 
196
  // Include style settings file
197
  include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/style-settings.php');
@@ -204,8 +224,8 @@ class SlideshowPluginPostType {
204
  global $post;
205
 
206
  // Get settings
207
- $defaultSettings = self::$defaultSettings;
208
- $settings = self::getSettings($post->ID);
209
 
210
  // Include
211
  include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/settings.php');
@@ -224,39 +244,77 @@ class SlideshowPluginPostType {
224
  defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
225
  return $postId;
226
 
227
- // Get old settings
228
- $oldSettings = get_post_meta($postId, self::$settingsMetaKey, true);
229
- if(!is_array($oldSettings))
230
- $oldSettings = array();
231
 
232
- // Filter post results, otherwise we'd save all post variables like post_id and ping_status.
233
- $settings = array();
234
- $defaultSettings = array_merge(
235
- self::$defaultSettings,
236
- self::$defaultStyleSettings);
 
 
237
  foreach($_POST as $key => $value)
238
- if(isset($defaultSettings[$key]))
239
- $settings[$key] = $value;
 
240
 
241
  // Save settings
242
  update_post_meta(
243
  $postId,
244
  self::$settingsMetaKey,
245
  array_merge(
246
- self::$defaultSettings,
247
- self::$defaultStyleSettings,
248
- $oldSettings,
249
- $settings
250
  ));
 
 
251
  }
252
 
253
  /**
254
- * Gets settings for the slideshow with the settings meta key
 
 
255
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  * @return mixed $settings
257
  */
258
- static function getSettings($postId){
259
- if(!isset(self::$settings)){
 
 
 
 
 
 
260
  // Get settings
261
  $currentSettings = get_post_meta(
262
  $postId,
@@ -264,21 +322,89 @@ class SlideshowPluginPostType {
264
  true
265
  );
266
 
267
- if(empty($currentSettings))
268
- $currentSettings = array();
269
-
270
- // Merge settings
271
- self::$settings = $settings = array_merge(
272
- self::$defaultSettings,
273
- self::$defaultStyleSettings,
274
- $currentSettings
275
- );
276
- }else
 
 
 
 
 
 
277
  $settings = self::$settings;
 
 
 
 
 
 
278
 
279
  return $settings;
280
  }
281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  /**
283
  * Get all attachments attached to the parsed postId
284
  *
@@ -296,4 +422,78 @@ class SlideshowPluginPostType {
296
  'post_parent' => $postId
297
  ));
298
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  }
4
  * slideshows and their individual settings
5
  *
6
  * @author: Stefan Boonstra
7
+ * @version: 15-09-12
8
  */
9
  class SlideshowPluginPostType {
10
 
11
  /** Variables */
 
12
  static $postType = 'slideshow';
 
13
  static $settingsMetaKey = 'settings';
14
+ static $prefixes = array(
15
+ 'slide-list' => 'slide_',
16
+ 'style' => 'style_',
17
+ 'settings' => 'setting_',
 
 
 
 
 
 
 
 
 
 
18
  );
19
+ static $settings = null;
20
+ static $inputFields = null;
21
 
22
  /**
23
  * Initialize Slideshow post type.
56
  'has_archive' => true,
57
  'hierarchical' => false,
58
  'menu_position' => null,
59
+ 'menu_icon' => SlideshowPluginMain::getPluginUrl() . '/images/' . __CLASS__ . '/adminIcon.png',
60
  'supports' => array('title'),
61
  'register_meta_box_cb' => array(__CLASS__, 'registerMetaBoxes')
62
  )
63
  );
64
+
65
+ // Enqueue associating script
66
+ wp_enqueue_script(
67
+ 'post-type-handler',
68
+ SlideshowPluginMain::getPluginUrl() . '/js/' . __CLASS__ . '/post-type-handler.js',
69
+ array('jquery')
70
+ );
71
  }
72
 
73
  /**
109
  'normal',
110
  'low'
111
  );
112
+
113
+ // Add support plugin message on edit slideshow
114
+ if(isset($_GET['action']) && strtolower($_GET['action']) == strtolower('edit'))
115
+ add_action('admin_notices', array(__CLASS__, 'supportPluginMessage'));
116
+ }
117
+
118
+ /**
119
+ * Shows the support plugin message
120
+ */
121
+ static function supportPluginMessage(){
122
+ include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/support-plugin.php');
123
  }
124
 
125
  /**
140
  static function slidesMetaBox(){
141
  global $post;
142
 
143
+ // Stores highest slide id.
144
+ $highestSlideId = -1;
145
 
146
+ // Get stored slide settings and convert them to array([slide-key] => array([setting-name] => [value]));
147
+ $slidesPreOrder = array();
148
+ $settings = self::getSettings($post->ID, self::$prefixes['slide-list']);
149
+ foreach($settings as $key => $value){
150
+ $key = explode('_', $key);
151
+ if(is_numeric($key[1]))
152
+ $slidesPreOrder[$key[1]][$key[2]] = $value;
153
+ }
154
+
155
+ // Save slide keys from the $slidePreOrder array in the array itself for later use
156
+ foreach($slidesPreOrder as $key => $value){
157
+ $slidesPreOrder[$key]['id'] = $key;
158
+
159
+ // Save highest slide id
160
+ if($key > $highestSlideId)
161
+ $highestSlideId = $key;
162
+ }
163
+
164
+ // Create array ordered by the 'order' key of the slides array: array([order-key] => [slide-key]);
165
+ $slidesOrder = array();
166
+ foreach($slidesPreOrder as $key => $value)
167
+ if(isset($value['order']) && is_numeric($value['order']) && $value['order'] > 0)
168
+ $slidesOrder[$value['order']][] = $key;
169
+ ksort($slidesOrder);
170
+
171
+ // Order slides by the order key.
172
+ $slides = array();
173
+ foreach($slidesOrder as $value)
174
+ if(is_array($value))
175
+ foreach($value as $slideId){
176
+ $slides[] = $slidesPreOrder[$slideId];
177
+ unset($slidesPreOrder[$slideId]);
178
+ }
179
+
180
+ // Add remaining (unordered) slides to the end of the array.
181
+ $slides = array_merge($slides, $slidesPreOrder);
182
 
183
  // Set url from which a substitute icon can be fetched
184
+ $noPreviewIcon = SlideshowPluginMain::getPluginUrl() . '/images/' . __CLASS__ . '/no-img.png';
185
+
186
+ // Enqueue scripts required for sorting the slides list
187
+ wp_enqueue_script('jquery');
188
+ wp_enqueue_script('jquery-ui-sortable');
189
+
190
+ // Enqueue JSColor
191
+ wp_enqueue_script('jscolor-colorpicker', SlideshowPluginMain::getPluginUrl() . '/js/SlideshowPluginPostType/jscolor/jscolor.js');
192
 
193
  // Include slides preview file
194
  include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/slides.php');
201
  global $post;
202
 
203
  // Get settings
204
+ $settings = self::getSettings($post->ID, self::$prefixes['style']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
 
206
  // Fill custom style with default css if empty
207
+ if(isset($settings['style_custom']) && empty($settings['style_custom'][1])){
208
  ob_start();
209
+ include(SlideshowPluginMain::getPluginPath() . '/style/SlideshowPlugin/style-custom.css');
210
+ $settings['style_custom'][1] = ob_get_clean();
211
  }
212
 
213
+ // Build fields
214
+ $inputFields = self::getInputFields($settings, false);
 
 
 
 
 
 
215
 
216
  // Include style settings file
217
  include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/style-settings.php');
224
  global $post;
225
 
226
  // Get settings
227
+ $settings = self::getSettings($post->ID, self::$prefixes['settings']);
228
+ $inputFields = self::getInputFields($post->ID);
229
 
230
  // Include
231
  include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/settings.php');
244
  defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
245
  return $postId;
246
 
247
+ // Get defaults
248
+ $defaultData = self::getDefaultData(false);
 
 
249
 
250
+ // Get old data
251
+ $oldData = get_post_meta($postId, self::$settingsMetaKey, true);
252
+ if(!is_array(($oldData)))
253
+ $oldData = array();
254
+
255
+ // Filter new data from $_POST
256
+ $newData = array();
257
  foreach($_POST as $key => $value)
258
+ foreach(self::$prefixes as $prefix)
259
+ if($prefix == substr($key, 0, strlen($prefix)))
260
+ $newData[$key] = $value;
261
 
262
  // Save settings
263
  update_post_meta(
264
  $postId,
265
  self::$settingsMetaKey,
266
  array_merge(
267
+ $defaultData,
268
+ $oldData,
269
+ $newData
 
270
  ));
271
+
272
+ return $postId;
273
  }
274
 
275
  /**
276
+ * Get simplified settings. This means there won't be an array full of
277
+ * field information and data. There will simply be a key => value pair
278
+ * with the retrieved settings or, if that value is empty, the default setting
279
  *
280
+ * @param int $postId
281
+ * @param string $prefix (optional, defaults to null)
282
+ * @param bool $cacheEnabled (optional, defaults to true)
283
+ * @return mixed $simpleSettings
284
+ */
285
+ static function getSimpleSettings($postId, $prefix = null, $cacheEnabled = true){
286
+ $settings = self::getSettings($postId, $prefix, $cacheEnabled);
287
+
288
+ $simpleSettings = array();
289
+ foreach($settings as $key => $value){
290
+ if(!is_array($value))
291
+ continue;
292
+
293
+ if(empty($value[1]) && !is_numeric($value[1]))
294
+ $simpleSettings[$key] = $value[2];
295
+ else $simpleSettings[$key] = $value[1];
296
+ }
297
+
298
+ return $simpleSettings;
299
+ }
300
+
301
+ /**
302
+ * Gets settings for the slideshow with the parsed post id.
303
+ * When only the data with a particular prefix needs to be returned, pass the prefix as $prefix
304
+ *
305
+ * @param int $postId
306
+ * @param string $prefix (optional, defaults to null)
307
+ * @param bool $cacheEnabled (optional, defaults to true)
308
  * @return mixed $settings
309
  */
310
+ static function getSettings($postId, $prefix = null, $cacheEnabled = true){
311
+ if(!is_numeric($postId) || empty($postId))
312
+ return array();
313
+
314
+ if(!isset(self::$settings) || !$cacheEnabled){
315
+ // Get default data
316
+ $data = self::getDefaultData();
317
+
318
  // Get settings
319
  $currentSettings = get_post_meta(
320
  $postId,
322
  true
323
  );
324
 
325
+ // Fill data with settings
326
+ foreach($data as $key => $value)
327
+ if(isset($currentSettings[$key])){
328
+ $data[$key][1] = $currentSettings[$key];
329
+ unset($currentSettings[$key]);
330
+ }
331
+
332
+ // Load settings that are not there by default into data (slides in particular)
333
+ foreach($currentSettings as $key => $value)
334
+ if(!isset($data[$key]))
335
+ $data[$key] = $value;
336
+
337
+ $settings = $data;
338
+ if($cacheEnabled)
339
+ self::$settings = $data;
340
+ }else{
341
  $settings = self::$settings;
342
+ }
343
+
344
+ if(isset($prefix))
345
+ foreach($settings as $key => $value)
346
+ if($prefix != substr($key, 0, strlen($prefix)))
347
+ unset($settings[$key]);
348
 
349
  return $settings;
350
  }
351
 
352
+ /**
353
+ * Gets defdault data. If only default data (without field information) is needed, set fullDefinition to false.
354
+ *
355
+ * @param boolean $fullDefinition (optional, defaults to true)
356
+ * @return mixed $defaultData
357
+ */
358
+ static function getDefaultData($fullDefinition = true){
359
+ $data = array(
360
+ 'style_style' => 'light',
361
+ 'style_custom' => '',
362
+ 'setting_animation' => 'slide',
363
+ 'setting_slideSpeed' => '1',
364
+ 'setting_descriptionSpeed' => '0.4',
365
+ 'setting_intervalSpeed' => '5',
366
+ 'setting_play' => 'true',
367
+ 'setting_loop' => 'true',
368
+ 'setting_slidesPerView' => '1',
369
+ 'setting_width' => '0',
370
+ 'setting_height' => '200',
371
+ 'setting_descriptionHeight' => '50',
372
+ 'setting_stretchImages' => 'true',
373
+ 'setting_controllable' => 'true',
374
+ 'setting_controlPanel' => 'false',
375
+ 'setting_showDescription' => 'true',
376
+ 'setting_hideDescription' => 'true',
377
+ 'setting_random' => 'false'
378
+ );
379
+
380
+ if($fullDefinition){
381
+ $yes = __('Yes', 'slideshow-plugin');
382
+ $no = __('No', 'slideshow-plugin');
383
+ $data = array( // $data : array([prefix_settingName] => array([inputType], [value], [default], [description], array([options]), array([dependsOn], [onValue]), 'group' => [groupName]))
384
+ 'style_style' => array('select', '', $data['style_style'], __('The style used for this slideshow', 'slideshow-plugin'), array('light' => __('Light', 'slideshow-plugin'), 'dark' => __('Dark', 'slideshow-plugin'), 'custom' => __('Custom', 'slideshow-plugin'))),
385
+ 'style_custom' => array('textarea', '', $data['style_custom'], __('Custom style editor', 'slideshow-plugin'), null, array('style_style', 'custom')),
386
+ 'setting_animation' => array('select', '', $data['setting_animation'], __('Animation used for transition between slides', 'slideshow-plugin'), array('slide' => __('Slide', 'slideshow-plugin'), 'fade' => __('Fade', 'slideshow-plugin')), 'group' => __('Animation', 'slideshow-plugin')),
387
+ 'setting_slideSpeed' => array('text', '', $data['setting_slideSpeed'], __('Number of seconds the slide takes to slide in', 'slideshow-plugin'), 'group' => __('Animation', 'slideshow-plugin')),
388
+ 'setting_descriptionSpeed' => array('text', '', $data['setting_descriptionSpeed'], __('Number of seconds the description takes to slide in', 'slideshow-plugin'), 'group' => __('Animation', 'slideshow-plugin')),
389
+ 'setting_intervalSpeed' => array('text', '', $data['setting_intervalSpeed'], __('Seconds between changing slides', 'slideshow-plugin'), 'group' => __('Animation', 'slideshow-plugin')),
390
+ 'setting_slidesPerView' => array('text', '', $data['setting_slidesPerView'], __('Number of slides to fit into one slide', 'slideshow-plugin'), 'group' => __('Display', 'slideshow-plugin')),
391
+ 'setting_width' => array('text', '', $data['setting_width'], __('Width of the slideshow, set to parent&#39;s width on 0', 'slideshow-plugin'), 'group' => __('Display', 'slideshow-plugin')),
392
+ 'setting_height' => array('text', '', $data['setting_height'], __('Height of the slideshow', 'slideshow-plugin'), 'group' => __('Display', 'slideshow-plugin')),
393
+ 'setting_descriptionHeight' => array('text', '', $data['setting_descriptionHeight'], __('Height of the description boxes', 'slideshow-plugin'), 'group' => __('Display', 'slideshow-plugin')),
394
+ 'setting_stretchImages' => array('radio', '', $data['setting_stretchImages'], __('Fit image into slide (stretching it)', 'slideshow-plugin'), array('true' => $yes, 'false' => $no), 'group' => __('Display', 'slideshow-plugin')),
395
+ 'setting_showDescription' => array('radio', '', $data['setting_showDescription'], __('Show title and description', 'slideshow-plugin'), array('true' => $yes, 'false' => $no), 'group' => __('Display', 'slideshow-plugin')),
396
+ 'setting_hideDescription' => array('radio', '', $data['setting_hideDescription'], __('Hide description box, it will pop up when a mouse hovers over the slide', 'slideshow-plugin'), array('true' => $yes, 'false' => $no), array('setting_showDescription', 'true'), 'group' => __('Display', 'slideshow-plugin')),
397
+ 'setting_play' => array('radio', '', $data['setting_play'], __('Automatically slide to the next slide', 'slideshow-plugin'), array('true' => $yes, 'false' => $no), 'group' => __('Control', 'slideshow-plugin')),
398
+ 'setting_loop' => array('radio', '', $data['setting_loop'], __('Return to the beginning of the slideshow after last slide', 'slideshow-plugin'), array('true' => $yes, 'false' => $no), 'group' => __('Control', 'slideshow-plugin')),
399
+ 'setting_controllable' => array('radio', '', $data['setting_controllable'], __('Activate buttons (so the user can scroll through the slides)', 'slideshow-plugin'), array('true' => $yes, 'false' => $no), 'group' => __('Control', 'slideshow-plugin')),
400
+ 'setting_controlPanel' => array('radio', '', $data['setting_controlPanel'], __('Show control panel (play and pause button)', 'slideshow-plugin'), array('true' => $yes, 'false' => $no), 'group' => __('Control', 'slideshow-plugin')),
401
+ 'setting_random' => array('radio', '', $data['setting_random'], __('Randomize slides', 'slideshow-plugin'), array('true' => $yes, 'false' => $no), 'group' => __('Miscellaneous', 'slideshow-plugin'))
402
+ );
403
+ }
404
+
405
+ return $data;
406
+ }
407
+
408
  /**
409
  * Get all attachments attached to the parsed postId
410
  *
422
  'post_parent' => $postId
423
  ));
424
  }
425
+
426
+ /**
427
+ * Gets all input fields based on the list of obtained settings
428
+ *
429
+ * @param mixed|int $settings
430
+ * @param bool $cacheEnabled (optional, defaults to true)
431
+ * @return mixed $inputFields
432
+ */
433
+ private static function getInputFields($settings, $cacheEnabled = true){
434
+ if(is_numeric($settings))
435
+ $settings = self::getSettings($settings);
436
+ elseif(empty($settings))
437
+ return array();
438
+
439
+ if(!isset(self::$inputFields) || !$cacheEnabled){
440
+ $inputFields = array();
441
+ foreach($settings as $key => $value){
442
+ if(!is_array($value))
443
+ continue;
444
+
445
+ $inputField = '';
446
+ $displayValue = (empty($value[1]) && !is_numeric($value[1]) ? $value[2] : $value[1]);
447
+ $class = ((isset($value[5]))? 'depends-on-field-value ' . $value[5][0] . ' ' . $value[5][1] . ' ': '') . $key;
448
+ switch($value[0]){
449
+ case 'text':
450
+ $inputField .= '<input
451
+ type="text"
452
+ name="' . $key . '"
453
+ class="' . $class . '"
454
+ value="' . $displayValue . '"
455
+ />';
456
+ break;
457
+ case 'textarea':
458
+ $inputField .= '<textarea
459
+ name="' . $key . '"
460
+ class="' . $class . '"
461
+ rows="20"
462
+ cols="60"
463
+ >' . $displayValue . '</textarea>';
464
+ break;
465
+ case 'select':
466
+ $inputField .= '<select name="' . $key . '" class="' . $class . '">';
467
+ foreach($value[4] as $optionKey => $optionValue)
468
+ $inputField .= '<option value="' . $optionKey . '" ' . selected($displayValue, $optionKey, false) . '>
469
+ ' . $optionValue . '
470
+ </option>';
471
+ $inputField .= '</select>';
472
+ break;
473
+ case 'radio':
474
+ foreach($value[4] as $radioKey => $radioValue)
475
+ $inputField .= '<label><input
476
+ type="radio"
477
+ name="' . $key . '"
478
+ class="' . $class . '"
479
+ value="' . $radioKey . '" ' .
480
+ checked($displayValue, $radioKey, false) .
481
+ ' />' . $radioValue . '</label><br />';
482
+ break;
483
+ default:
484
+ $inputField = null;
485
+ break;
486
+ };
487
+
488
+ $inputFields[$key] = $inputField;
489
+ }
490
+
491
+ if($cacheEnabled)
492
+ self::$inputFields = $inputFields;
493
+ }else{
494
+ $inputFields = self::$inputFields;
495
+ }
496
+
497
+ return $inputFields;
498
+ }
499
  }
classes/SlideshowPluginShortcode.php CHANGED
@@ -3,7 +3,7 @@
3
  * Class SlideshowPluginShortcode is called on use of shortcode anywhere on the website.
4
  *
5
  * @author: Stefan Boonstra
6
- * @version: 03-07-12
7
  */
8
  class SlideshowPluginShortcode {
9
 
3
  * Class SlideshowPluginShortcode is called on use of shortcode anywhere on the website.
4
  *
5
  * @author: Stefan Boonstra
6
+ * @version: 15-09-12
7
  */
8
  class SlideshowPluginShortcode {
9
 
classes/SlideshowPluginSlideInserter.php ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class SlideshowPluginSlideInserter
4
+ *
5
+ * TODO This class will probanbly need to be renamed to SlideshowPluginSlideHandler to explain more functionality
6
+ * TODO than just inserting slides. (Show and delete functionality should be applied here as well)
7
+ * @author Stefan Boonstra
8
+ * @version 15-09-2012
9
+ */
10
+ class SlideshowPluginSlideInserter {
11
+
12
+ /**
13
+ * Returns the html for showing the image insert button.
14
+ * Enqueues scripts unless $enqueueFiles is set to false.
15
+ *
16
+ * @param boolean $enqueueFiles
17
+ * @return String $button
18
+ */
19
+ static function getImageSlideInsertButton($enqueueFiles = true){
20
+ if($enqueueFiles)
21
+ self::enqueueFiles();
22
+
23
+ // Put popup html in footer
24
+ add_action('admin_footer', array(__CLASS__, 'includePopup'));
25
+
26
+ // Return button html
27
+ ob_start();
28
+ include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/insert-image-button.php');
29
+ return ob_get_clean();
30
+ }
31
+
32
+ /**
33
+ * Returns the html for showing the text insert button.
34
+ * Enqueues scripts unless $enqueueFiles is set to false.
35
+ *
36
+ * @param boolean $enqueueFiles
37
+ * @return String $button
38
+ */
39
+ static function getTextSlideInsertButton($enqueueFiles = true){
40
+ if($enqueueFiles)
41
+ self::enqueueFiles();
42
+
43
+ // Return button html
44
+ ob_start();
45
+ include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/insert-text-button.php');
46
+ return ob_get_clean();
47
+ }
48
+
49
+ /**
50
+ * Returns the html for showing the video insert button.
51
+ * Enqueues scripts unless $enqueueFiles is set to false.
52
+ *
53
+ * @param boolean $enqueueFiles
54
+ * @return String $button
55
+ */
56
+ static function getVideoSlideInsertButton($enqueueFiles = true){
57
+ if($enqueueFiles)
58
+ self::enqueueFiles();
59
+
60
+ // Return button html
61
+ ob_start();
62
+ include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/insert-video-button.php');
63
+ return ob_get_clean();
64
+ }
65
+
66
+ /**
67
+ * This function is registered in the SlideshowPluginAjax class
68
+ * and deletes slides with a particular $_POST['slideId']
69
+ */
70
+ static function deleteSlide(){
71
+ if((!isset($_POST['slideId']) || !is_numeric($_POST['slideId'])) ||
72
+ (!isset($_POST['postId']) || !is_numeric($_POST['postId'])))
73
+ die;
74
+
75
+ $search = 'slide_' . $_POST['slideId'] . '_';
76
+ $settings = get_post_meta($_POST['postId'], 'settings', true);
77
+ foreach($settings as $key => $setting)
78
+ if(strtolower(substr($key, 0, strlen($search))) == strtolower($search))
79
+ unset($settings[$key]);
80
+ update_post_meta($_POST['postId'], 'settings', $settings);
81
+
82
+ die;
83
+ }
84
+
85
+ /**
86
+ * This function is registered in the SlideshowPluginAjax class
87
+ * and prints the results from the search query
88
+ */
89
+ static function printSearchResults(){
90
+ // Numberposts and offset
91
+ $numberPosts = 10;
92
+ $offset = 0;
93
+ if(isset($_POST['offset']))
94
+ $offset = $_POST['offset'];
95
+
96
+ // Get attachments with a title alike the search string, needs to be filtered
97
+ add_filter('posts_where', array(__CLASS__, 'printSearchResultsWhereFilter'));
98
+ $attachments = get_posts(array(
99
+ 'numberposts' => $numberPosts + 1,
100
+ 'offset' => $offset,
101
+ 'orderby' => 'post_title',
102
+ 'order' => 'ASC',
103
+ 'post_type' => 'attachment',
104
+ 'suppress_filters' => false
105
+ ));
106
+ remove_filter('posts_where', array(__CLASS__, 'printSearchResultsWhereFilter'));
107
+
108
+ // Check if there are enough attachments to print a 'Load more images' button
109
+ $loadMoreResults = false;
110
+ if(count($attachments) > $numberPosts){
111
+ array_pop($attachments);
112
+ $loadMoreResults = true;
113
+ }
114
+
115
+ // Print results to the screen
116
+ if(count($attachments) > 0){
117
+ foreach($attachments as $attachment){
118
+ $image = wp_get_attachment_image_src($attachment->ID);
119
+ if(!$image[3]) $image[0] = SlideshowPluginMain::getPluginUrl() . '/images/SlideshowPluginPostType/no-img.png';
120
+ echo '<tr valign="top">
121
+ <td class="image">
122
+ <img width="60" height="60" src="' . $image[0] . '" class="attachment" alt="' . $attachment->post_title . '" title="' . $attachment->post_title . '">
123
+ </td>
124
+ <td class="column-title">
125
+ <strong class="title">
126
+ ' . $attachment->post_title . '
127
+ </strong>
128
+ <p class="description">' . $attachment->post_content . '</p>
129
+ </td>
130
+ <td class="insert-button">
131
+ <input
132
+ type="button"
133
+ id="' . $attachment->ID . '"
134
+ class="insert-attachment button-secondary"
135
+ value="' . __('Insert', 'slideshow-plugin') . '"
136
+ />
137
+ </td>
138
+ </tr>';
139
+ }
140
+ if($loadMoreResults){
141
+ echo '<tr>
142
+ <td colspan="3" style="text-align: center;">
143
+ <button class="button-secondary load-more-results ' . ($offset + $numberPosts) . '" >
144
+ ' . __('Load more results', 'slideshow-plugin') . '
145
+ </button>
146
+ </td>
147
+ </tr>';
148
+ }
149
+ } else {
150
+ echo '<tr>
151
+ <td colspan="3" style="text-align: center;">
152
+ <a href="' . admin_url() . 'media-new.php" target="_blank">
153
+ ' . __('No images were found, click here to upload some.', 'slideshow-plugin') . '
154
+ </a>
155
+ </td>
156
+ </tr>';
157
+ }
158
+
159
+ die;
160
+ }
161
+
162
+ /**
163
+ * Applies a where clause on the get_posts call from self::printSearchResults()
164
+ *
165
+ * @param string $where
166
+ * @return string $where
167
+ */
168
+ static function printSearchResultsWhereFilter($where){
169
+ global $wpdb;
170
+
171
+ if(isset($_POST['search']))
172
+ $where .= $wpdb->prepare(" AND post_title LIKE '%%%s%%' ", $_POST['search']);
173
+
174
+ return $where;
175
+ }
176
+
177
+ /**
178
+ * Include popup, needs to be called in the footer
179
+ */
180
+ static function includePopup(){
181
+ include(SlideshowPluginMain::getPluginPath() . '/views/' . __CLASS__ . '/search-popup.php');
182
+ }
183
+
184
+ /**
185
+ * Enqueues styles and scripts necessary for the media upload button.
186
+ */
187
+ static function enqueueFiles(){
188
+ // Enqueue style
189
+ wp_enqueue_style(
190
+ 'slideshow-slide-inserter',
191
+ SlideshowPluginMain::getPluginUrl() . '/style/' . __CLASS__ . '/slide-inserter.css'
192
+ );
193
+
194
+ // Enqueue insert button script
195
+ wp_enqueue_script(
196
+ 'slideshow-slide-inserter',
197
+ SlideshowPluginMain::getPluginUrl() . '/js/' . __CLASS__ . '/slide-inserter.js',
198
+ array('jquery')
199
+ );
200
+ }
201
+ }
classes/SlideshowPluginUpload.php CHANGED
@@ -4,7 +4,7 @@
4
  * anywhere on a website.
5
  *
6
  * @author: Stefan Boonstra
7
- * @version: 03-07-12
8
  */
9
  class SlideshowPluginUpload {
10
 
4
  * anywhere on a website.
5
  *
6
  * @author: Stefan Boonstra
7
+ * @version: 15-09-12
8
  */
9
  class SlideshowPluginUpload {
10
 
classes/SlideshowPluginWidget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Class SlideshowPluginWidget allows showing one of your slideshows in your widget area.
4
  *
5
  * @author: Stefan Boonstra
6
- * @version: 03-07-12
7
  */
8
  class SlideshowPluginWidget extends WP_Widget {
9
 
@@ -82,6 +82,7 @@ class SlideshowPluginWidget extends WP_Widget {
82
  *
83
  * @param mixed array $newInstance
84
  * @param mixed array $instance
 
85
  */
86
  function update($newInstance, $instance){
87
  // Update title
3
  * Class SlideshowPluginWidget allows showing one of your slideshows in your widget area.
4
  *
5
  * @author: Stefan Boonstra
6
+ * @version: 15-09-12
7
  */
8
  class SlideshowPluginWidget extends WP_Widget {
9
 
82
  *
83
  * @param mixed array $newInstance
84
  * @param mixed array $instance
85
+ * @return mixed array $instance
86
  */
87
  function update($newInstance, $instance){
88
  // Update title
images/SlideshowPlugin/dark-arrows.png ADDED
Binary file
images/SlideshowPlugin/dark-controlpanel.png ADDED
Binary file
images/SlideshowPlugin/light-arrows.png ADDED
Binary file
images/SlideshowPlugin/light-controlpanel.png ADDED
Binary file
images/SlideshowPluginPostType/adminIcon.png ADDED
Binary file
images/SlideshowPluginPostType/delete.png ADDED
Binary file
images/SlideshowPluginPostType/draggable.png ADDED
Binary file
images/SlideshowPluginPostType/no-img.png ADDED
Binary file
images/SlideshowPluginSlideInserter/close.png ADDED
Binary file
js/SlideshowPlugin/slideshow.js CHANGED
@@ -1,303 +1 @@
1
- /**
2
- * Slideshow class contains all functions for animating
3
- * and controlling the slideshow.
4
- *
5
- * @author Stefan Boonstra
6
- * @version 29-06-12
7
- */
8
- var Slideshow = {
9
-
10
- /** Functional variables (non-customizable) */
11
- slideshowContainer: '.slideshow_container',
12
- sliderBox: '.slideshow',
13
- descriptionBox: '.slideshow_container .descriptionbox',
14
- buttons: '.slideshow_container .button',
15
- buttonNext: '.slideshow_container .next',
16
- buttonPrevious: '.slideshow_container .previous',
17
- divName: 'slideshow_div',
18
- currentSlide: 0,
19
- interval: '',
20
- buttonsActive: false,
21
-
22
- /** Customizable variables */
23
- images: new Array(),
24
- slideSpeed: 1000,
25
- descriptionSpeed: 300,
26
- intervalSpeed: 6000,
27
- width: 0,
28
- height: 100,
29
- stretch: false,
30
- controllable: true,
31
- urlsActive: false,
32
- showText: true,
33
-
34
- /**
35
- * Initializes the app by loading all images into divs.
36
- */
37
- initialize: function(){
38
- // Prevent reference errors
39
- var slideShow = this;
40
-
41
- // Get settings from page
42
- slideShow.getSettings();
43
-
44
- // Set height and width
45
- jQuery(slideShow.slideshowContainer).css({
46
- 'height': slideShow.height,
47
- 'width': slideShow.width
48
- });
49
- jQuery(slideShow.sliderBox).css({
50
- 'height': slideShow.height,
51
- 'width': slideShow.width
52
- });
53
-
54
- // Empty slideshow
55
- jQuery(slideShow.sliderBox).empty();
56
-
57
- // Enable controls
58
- slideShow.buttonsActive = true;
59
-
60
- // Only add img height element when images should not be stretched
61
- var addDimensions = '';
62
- if(slideShow.stretch)
63
- addDimensions = ' width="' + slideShow.width + '" height="' + slideShow.height + '" '
64
- else
65
- addDimensions = ' height="' + slideShow.height + '" ';
66
-
67
- // Add all divs
68
- jQuery.each(slideShow.images, function(index, image){
69
- var url = '';
70
- if(image['url'].length > 0 && slideShow.urlsActive)
71
- url = 'href="' + image['url'] + '"';
72
-
73
- jQuery(slideShow.sliderBox).append(
74
- '<div class="' + slideShow.divName + ' ' + slideShow.divName + index + '">'+
75
- '<a ' + url + '>' +
76
- '<img '+
77
- 'alt="' + image['title'] + '" ' +
78
- 'src="' + image['img'] + '" ' +
79
- addDimensions +
80
- '/>' +
81
- '</a>' +
82
- '</div>'
83
- );
84
- });
85
-
86
- slideShow.slideIn(slideShow.currentSlide);
87
- },
88
-
89
- /**
90
- * Gets and assigns settings from page variable slideshow_settings
91
- */
92
- getSettings: function(){
93
- // Prevent reference errors
94
- var slideShow = this;
95
-
96
- var settings = slideshow_settings;
97
-
98
- // Set speeds
99
- if(settings['slideSpeed'] != '')
100
- slideShow.slideSpeed = settings['slideSpeed'] * 1000;
101
- if(settings['descriptionSpeed'] != '')
102
- slideShow.descriptionSpeed = settings['descriptionSpeed'] * 1000;
103
- if(settings['intervalSpeed'] != '')
104
- slideShow.intervalSpeed = settings['intervalSpeed'] * 1000;
105
-
106
- // Set dimensions
107
- if(settings['width'] != '')
108
- slideShow.width = settings['width'];
109
- if(settings['height'] != '' && settings['height'] >= 100)
110
- slideShow.height = settings['height'];
111
-
112
- // Adjust width if width is 0
113
- if(slideShow.width <= 0)
114
- slideShow.width = parseInt(jQuery(slideShow.slideshowContainer).parent().css('width'), 10);
115
-
116
- // Adjust button positioning
117
- var positioning = ((slideShow.height - 100) / 2) + 100;
118
- jQuery(slideShow.buttons).css({ 'margin-top': '-' + positioning + 'px' });
119
-
120
- // Miscellaneous settings
121
- if(settings['stretch'] != '')
122
- if(settings['stretch'] == 'true')
123
- slideShow.stretch = true;
124
- else
125
- slideShow.stretch = false;
126
- if(settings['controllable'] != '')
127
- if(settings['controllable'] == 'true')
128
- slideShow.controllable = true;
129
- else
130
- slideShow.controllable = false;
131
- if(settings['urlsActive'] != '')
132
- if(settings['urlsActive'] == 'true')
133
- slideShow.urlsActive = true;
134
- else
135
- slideShow.urlsActive = false;
136
- if(settings['showText'] != '')
137
- if(settings['showText'] == 'true')
138
- slideShow.showText = true;
139
- else
140
- slideShow.showText = false;
141
- },
142
-
143
- /**
144
- * Slides in next slide.
145
- */
146
- nextSlide: function(){
147
- // Prevent reference errors
148
- var slideShow = this;
149
-
150
- slideShow.slideOut(slideShow.currentSlide);
151
-
152
- slideShow.currentSlide++;
153
- if(slideShow.currentSlide > slideShow.images.length - 1)
154
- slideShow.currentSlide = 0;
155
-
156
- setTimeout(
157
- function(){ slideShow.slideIn(slideShow.currentSlide); },
158
- slideShow.slideSpeed
159
- );
160
- },
161
-
162
- /**
163
- * Slides in previous slide.
164
- */
165
- previousSlide: function(){
166
- // Prevent reference errors
167
- var slideShow = this;
168
-
169
- slideShow.slideOut(slideShow.currentSlide);
170
-
171
- slideShow.currentSlide--;
172
- if(slideShow.currentSlide < 0)
173
- slideShow.currentSlide = slideShow.images.length - 1;
174
-
175
- setTimeout(
176
- function(){ slideShow.slideIn(slideShow.currentSlide) },
177
- slideShow.slideSpeed
178
- );
179
- },
180
-
181
- /**
182
- * Animates the image with imageId and the descriptionbox sliding into view.
183
- * Also fills up descriptionbox with corresponding title/text.
184
- *
185
- * @param imageId
186
- */
187
- slideIn: function(imageId){
188
- // Prevent reference errors
189
- var slideShow = this;
190
-
191
- // Slide in imagediv
192
- jQuery('.' + slideShow.divName + imageId).animate({
193
- 'width': slideShow.width + 'px'},
194
- slideShow.slideSpeed
195
- );
196
-
197
- // Set text of descriptionbox and slide it up, if showText is true
198
- if(slideShow.showText){
199
- jQuery(slideShow.descriptionBox).html(
200
- '<h2>' + slideShow.images[imageId]['title'] + '</h2><p>' + slideShow.images[imageId]['description'] + '</p>'
201
- );
202
- jQuery(slideShow.descriptionBox).animate({
203
- 'height': slideShow.height + 'px',
204
- 'margin-top': '-' + slideShow.height + 'px'},
205
- slideShow.descriptionSpeed
206
- );
207
- }
208
-
209
- // Deactivate buttons for a while so the user can't mess up the app
210
- slideShow.buttonsActive = false;
211
- setTimeout(function(){ slideShow.buttonsActive = true; }, slideShow.slideSpeed);
212
- },
213
-
214
- /**
215
- * Animates the image with imageId and the descriptionbox sliding out of sight.
216
- *
217
- * @param imageId
218
- */
219
- slideOut: function(imageId){
220
- // Prevent reference errors
221
- var slideShow = this;
222
-
223
- // Slide down descriptionbox
224
- jQuery(slideShow.descriptionBox).animate({
225
- 'height': '0px',
226
- 'margin-top': '0px'},
227
- slideShow.descriptionSpeed
228
- );
229
-
230
- // Slide out imagediv
231
- jQuery('.' + slideShow.divName + imageId).animate({
232
- 'width': '0px'},
233
- slideShow.slideSpeed
234
- );
235
-
236
- // Deactivate buttons for a while so the user can't mess up the app
237
- slideShow.buttonsActive = false;
238
- setTimeout(function(){ slideShow.buttonsActive = true; }, slideShow.slideSpeed);
239
- },
240
-
241
- /**
242
- * Sets css visibility of the buttons, if controls active are set to true.
243
- */
244
- showButtons: function(show){
245
- // Prevent reference errors
246
- var slideShow = this;
247
-
248
- var visibility = 'visible';
249
- if(!show || !slideShow.controllable)
250
- visibility = 'hidden';
251
-
252
- // Set visibility
253
- jQuery(slideShow.buttons).css({'visibility': visibility});
254
- },
255
-
256
- /**
257
- * Resets interval and starts counting from zero again.
258
- */
259
- resetInterval: function(){
260
- // Prevent reference errors
261
- var slideShow = this;
262
-
263
- clearInterval(slideShow.interval);
264
- slideShow.interval = setInterval(function(){ slideShow.nextSlide(); }, slideShow.intervalSpeed);
265
- }
266
- };
267
-
268
- /**
269
- * When clicked on next button, next slide is shown.
270
- */
271
- jQuery(Slideshow.buttonNext).click(function(){
272
- if(!Slideshow.buttonsActive)
273
- return;
274
-
275
- Slideshow.resetInterval();
276
- Slideshow.nextSlide();
277
- });
278
-
279
- /**
280
- * When clicked on previous button, previous slide is shown.
281
- */
282
- jQuery(Slideshow.buttonPrevious).click(function(){
283
- if(!Slideshow.buttonsActive)
284
- return;
285
-
286
- Slideshow.resetInterval();
287
- Slideshow.previousSlide();
288
- });
289
-
290
- jQuery(document).ready(function(){
291
- if(slideshow_images != '')
292
- Slideshow.images = slideshow_images;
293
-
294
- if(Slideshow.images.length == 0)
295
- return;
296
-
297
- Slideshow.initialize();
298
-
299
- if(Slideshow.images.length > 1){
300
- Slideshow.showButtons(true);
301
- Slideshow.interval = setInterval(function(){ Slideshow.nextSlide(); }, Slideshow.intervalSpeed);
302
- }
303
- });
1
+ jQuery.fn.slideshow_script=function(){var $container=jQuery(this),$overflow=$container.find('.slideshow_overflow'),$controlPanel=$container.find('.controlPanel'),$togglePlayButton=$controlPanel.find('.togglePlay'),$nextButton=$container.find('.next'),$previousButton=$container.find('.previous'),$slideshow=$container.find('.slideshow'),$slides=$slideshow.find('.slide');var $settings=jQuery.parseJSON($container.find('.settings').text());jQuery.each($settings,function(setting,value){if(value=='true')$settings[setting]=true;else if(value=='false')$settings[setting]=false});if($container.width()<=0){$container.css('width',$container.parent().width())}$overflow.css('width',$container.width());var $numberSlidesVisible=3,$buttonsActive=false,$interval='',$currentSlideId=0,$currentViewId=0,$slideWidth=$container.width()/$settings['slidesPerView'];init();function init(){var slidePosition=0;var totalWidth=1;jQuery.each($slides,function(key,slide){if(slidePosition<=0)jQuery(slide).css({'padding-left':0,'margin-left':0});if(slidePosition>=$settings['slidesPerView']-1)jQuery(slide).css({'padding-right':0,'margin-right':0});var slideWidth=$slideWidth-(jQuery(slide).outerWidth(true)-jQuery(slide).width());var slideHeight=$slideshow.height()-(jQuery(slide).outerHeight(true)-jQuery(slide).height());jQuery(slide).css({width:slideWidth,height:slideHeight});totalWidth+=jQuery(slide).outerWidth(true);var image=jQuery(slide).find('img');if(image.attr('src')!=undefined){if($settings['stretchImages']){image.attr({width:jQuery(slide).width(),height:jQuery(slide).height()})}else{image.css('width','auto')}}var description=jQuery(slide).find('.description');if($settings['showDescription']&&description.attr('class')!=undefined){if($settings['hideDescription'])description.css({marginBottom:'-'+description.outerHeight(true)+'px'});else description.css({height:$settings['descriptionHeight']});description.css({display:'block'})}var videoSlideIds=jQuery(slide).find('.videoId').text().split(' ');var videoId=videoSlideIds[0];var elementVideoId=videoSlideIds[1];if(videoId&&elementVideoId){swfobject.embedSWF('http://www.youtube.com/v/'+videoId+'?version=3&enablejsapi=1&playerapiid=player',elementVideoId,jQuery(slide).width(),jQuery(slide).height(),'9',null,null,{allowScriptAccess:'always',wmode:'opaque'},{id:elementVideoId})}slidePosition++;if(slidePosition>=$settings['slidesPerView'])slidePosition=0});$slideshow.css({width:totalWidth,float:'none',position:'absolute',top:0,left:0});if($settings['controlPanel']&&$settings['play'])togglePlay(true);resetInterval();if($settings['controllable']){setNextButtonVisible(true);setPreviousButtonVisible(true);$buttonsActive=true}}function gotoView(viewId,relative){if(relative)viewId=$currentViewId+viewId;if(viewId*$settings['slidesPerView']>=$slides.length){if($settings['loop']){viewId=0}else{viewId=Math.floor(($slides.length-1)/$settings['slidesPerView']);return}}else if(viewId<0){if($settings['loop']){viewId=Math.floor(($slides.length-1)/$settings['slidesPerView'])}else{viewId=0;return}}$currentViewId=viewId;var position=0;var slidePosition=$slideshow.find('.slide_'+(viewId*$settings['slidesPerView'])).position();if(slidePosition)position='-='+(slidePosition.left-Math.abs($slideshow.position().left));$buttonsActive=false;if($settings['animation']=='fade'){$slideshow.fadeOut(parseInt($settings['slideSpeed']*1000)/2);setTimeout(function(){$slideshow.css({left:position});$slideshow.fadeIn(parseInt($settings['slideSpeed']*1000)/ 2)}, parseInt($settings['slideSpeed'] * 1000) /2)}else{$slideshow.animate({left:position},parseInt($settings['slideSpeed']*1000))}setTimeout(function(){$buttonsActive=true},parseInt($settings['slideSpeed']*1000))}$nextButton.click(function(){if($buttonsActive){resetInterval();gotoView(1,true)}});$previousButton.click(function(){if($buttonsActive){resetInterval();gotoView(-1,true)}});function setNextButtonVisible(visible){if(!$settings['controllable'])return;if(visible)$nextButton.stop(true,true).fadeIn($settings['slideSpeed']);else $nextButton.stop(true,true).fadeOut($settings['slideSpeed'])}function setPreviousButtonVisible(visible){if(!$settings['controllable'])return;if(visible)$previousButton.stop(true,true).fadeIn($settings['slideSpeed']);else $previousButton.stop(true,true).fadeOut($settings['slideSpeed'])}$togglePlayButton.click(function(){togglePlay()});function togglePlay(adaptButton){if(!adaptButton){$settings['play']=!$settings['play'];resetInterval()}if($settings['play'])$togglePlayButton.attr('class','pause');else $togglePlayButton.attr('class','play')}$container.mouseleave(function(){$controlPanel.stop(true,true).fadeOut('slow')});$container.mouseenter(function(){if($settings['controlPanel'])$controlPanel.stop(true,true).fadeIn('fast')});$slides.mouseenter(function(){if($settings['showDescription']&&$settings['hideDescription'])jQuery(this).find('.description').stop(true,true).animate({'margin-bottom':'0px'},parseInt($settings['descriptionSpeed']*1000))});$slides.mouseleave(function(){if($settings['showDescription']&&$settings['hideDescription']){var description=jQuery(this).find('.description');description.stop(true,true).animate({'margin-bottom':'-'+description.outerHeight(true)+'px'},parseInt($settings['descriptionSpeed']*1000))}});function resetInterval(){clearInterval($interval);if($settings['play'])$interval=setInterval(function(){gotoView(1,true)},$settings['intervalSpeed']*1000)}jQuery(window).load(function(){jQuery.each($slides,function(key,slide){var image=jQuery(slide).find('img');if(image.attr('src')!=undefined){var imageWidth=jQuery(slide).width()-(image.outerWidth(true)-image.width());var imageHeight=jQuery(slide).height()-(image.outerHeight(true)-image.height());if($settings['stretchImages']){image.css({width:imageWidth,height:imageHeight})}else{if(image.outerWidth(true)>jQuery(slide).width()){image.css({width:imageWidth,height:'auto'})}else if(image.outerHeight(true)>jQuery(slide).height()){image.css({width:'auto',height:imageHeight})}}}})})};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/SlideshowPlugin/swfobject.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /* SWFObject v2.2 <http://code.google.com/p/swfobject/>
2
+ is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
3
+ */
4
+ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
js/SlideshowPluginPostType/jscolor/arrow.gif ADDED
Binary file
js/SlideshowPluginPostType/jscolor/cross.gif ADDED
Binary file
js/SlideshowPluginPostType/jscolor/hs.png ADDED
Binary file
js/SlideshowPluginPostType/jscolor/hv.png ADDED
Binary file
js/SlideshowPluginPostType/jscolor/jscolor.js ADDED
@@ -0,0 +1 @@
 
1
+ var jscolor={dir:'',bindClass:'color',binding:true,preloading:true,install:function(){jscolor.addEvent(window,'load',jscolor.init)},init:function(){if(jscolor.binding){jscolor.bind()}if(jscolor.preloading){jscolor.preload()}},getDir:function(){if(!jscolor.dir){var detected=jscolor.detectDir();jscolor.dir=detected!==false?detected:'jscolor/'}return jscolor.dir},detectDir:function(){var base=location.href;var e=document.getElementsByTagName('base');for(var i=0;i<e.length;i+=1){if(e[i].href){base=e[i].href}}var e=document.getElementsByTagName('script');for(var i=0;i<e.length;i+=1){if(e[i].src&&/(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)){var src=new jscolor.URI(e[i].src);var srcAbs=src.toAbsolute(base);srcAbs.path=srcAbs.path.replace(/[^\/]+$/,'');srcAbs.query=null;srcAbs.fragment=null;return srcAbs.toString()}}return false},bind:function(){var matchClass=new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?','i');var e=document.getElementsByTagName('input');for(var i=0;i<e.length;i+=1){var m;if(!e[i].color&&e[i].className&&(m=e[i].className.match(matchClass))){var prop={};if(m[3]){try{prop=(new Function('return ('+m[3]+')'))()}catch(eInvalidProp){}}e[i].color=new jscolor.color(e[i],prop)}}},preload:function(){for(var fn in jscolor.imgRequire){if(jscolor.imgRequire.hasOwnProperty(fn)){jscolor.loadImage(fn)}}},images:{pad:[181,101],sld:[16,101],cross:[15,15],arrow:[7,11]},imgRequire:{},imgLoaded:{},requireImage:function(filename){jscolor.imgRequire[filename]=true},loadImage:function(filename){if(!jscolor.imgLoaded[filename]){jscolor.imgLoaded[filename]=new Image();jscolor.imgLoaded[filename].src=jscolor.getDir()+filename}},fetchElement:function(mixed){return typeof mixed==='string'?document.getElementById(mixed):mixed},addEvent:function(el,evnt,func){if(el.addEventListener){el.addEventListener(evnt,func,false)}else if(el.attachEvent){el.attachEvent('on'+evnt,func)}},fireEvent:function(el,evnt){if(!el){return}if(document.createEvent){var ev=document.createEvent('HTMLEvents');ev.initEvent(evnt,true,true);el.dispatchEvent(ev)}else if(document.createEventObject){var ev=document.createEventObject();el.fireEvent('on'+evnt,ev)}else if(el['on'+evnt]){el['on'+evnt]()}},getElementPos:function(e){var e1=e,e2=e;var x=0,y=0;if(e1.offsetParent){do{x+=e1.offsetLeft;y+=e1.offsetTop}while(e1=e1.offsetParent)}while((e2=e2.parentNode)&&e2.nodeName.toUpperCase()!=='BODY'){x-=e2.scrollLeft;y-=e2.scrollTop}return[x,y]},getElementSize:function(e){return[e.offsetWidth,e.offsetHeight]},getRelMousePos:function(e){var x=0,y=0;if(!e){e=window.event}if(typeof e.offsetX==='number'){x=e.offsetX;y=e.offsetY}else if(typeof e.layerX==='number'){x=e.layerX;y=e.layerY}return{x:x,y:y}},getViewPos:function(){if(typeof window.pageYOffset==='number'){return[window.pageXOffset,window.pageYOffset]}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){return[document.body.scrollLeft,document.body.scrollTop]}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){return[document.documentElement.scrollLeft,document.documentElement.scrollTop]}else{return[0,0]}},getViewSize:function(){if(typeof window.innerWidth==='number'){return[window.innerWidth,window.innerHeight]}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){return[document.body.clientWidth,document.body.clientHeight]}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){return[document.documentElement.clientWidth,document.documentElement.clientHeight]}else{return[0,0]}},URI:function(uri){this.scheme=null;this.authority=null;this.path='';this.query=null;this.fragment=null;this.parse=function(uri){var m=uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);this.scheme=m[3]?m[2]:null;this.authority=m[5]?m[6]:null;this.path=m[7];this.query=m[9]?m[10]:null;this.fragment=m[12]?m[13]:null;return this};this.toString=function(){var result='';if(this.scheme!==null){result=result+this.scheme+':'}if(this.authority!==null){result=result+'//'+this.authority}if(this.path!==null){result=result+this.path}if(this.query!==null){result=result+'?'+this.query}if(this.fragment!==null){result=result+'#'+this.fragment}return result};this.toAbsolute=function(base){var base=new jscolor.URI(base);var r=this;var t=new jscolor.URI;if(base.scheme===null){return false}if(r.scheme!==null&&r.scheme.toLowerCase()===base.scheme.toLowerCase()){r.scheme=null}if(r.scheme!==null){t.scheme=r.scheme;t.authority=r.authority;t.path=removeDotSegments(r.path);t.query=r.query}else{if(r.authority!==null){t.authority=r.authority;t.path=removeDotSegments(r.path);t.query=r.query}else{if(r.path===''){t.path=base.path;if(r.query!==null){t.query=r.query}else{t.query=base.query}}else{if(r.path.substr(0,1)==='/'){t.path=removeDotSegments(r.path)}else{if(base.authority!==null&&base.path===''){t.path='/'+r.path}else{t.path=base.path.replace(/[^\/]+$/,'')+r.path}t.path=removeDotSegments(t.path)}t.query=r.query}t.authority=base.authority}t.scheme=base.scheme}t.fragment=r.fragment;return t};function removeDotSegments(path){var out='';while(path){if(path.substr(0,3)==='../'||path.substr(0,2)==='./'){path=path.replace(/^\.+/,'').substr(1)}else if(path.substr(0,3)==='/./'||path==='/.'){path='/'+path.substr(3)}else if(path.substr(0,4)==='/../'||path==='/..'){path='/'+path.substr(4);out=out.replace(/\/?[^\/]*$/,'')}else if(path==='.'||path==='..'){path=''}else{var rm=path.match(/^\/?[^\/]*/)[0];path=path.substr(rm.length);out=out+rm}}return out}if(uri){this.parse(uri)}},color:function(target,prop){this.required=true;this.adjust=true;this.hash=false;this.caps=true;this.slider=true;this.valueElement=target;this.styleElement=target;this.onImmediateChange=null;this.hsv=[0,0,1];this.rgb=[1,1,1];this.minH=0;this.maxH=6;this.minS=0;this.maxS=1;this.minV=0;this.maxV=1;this.pickerOnfocus=true;this.pickerMode='HSV';this.pickerPosition='bottom';this.pickerSmartPosition=true;this.pickerButtonHeight=20;this.pickerClosable=false;this.pickerCloseText='Close';this.pickerButtonColor='ButtonText';this.pickerFace=10;this.pickerFaceColor='ThreeDFace';this.pickerBorder=1;this.pickerBorderColor='ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight';this.pickerInset=1;this.pickerInsetColor='ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow';this.pickerZIndex=10000;for(var p in prop){if(prop.hasOwnProperty(p)){this[p]=prop[p]}}this.hidePicker=function(){if(isPickerOwner()){removePicker()}};this.showPicker=function(){if(!isPickerOwner()){var tp=jscolor.getElementPos(target);var ts=jscolor.getElementSize(target);var vp=jscolor.getViewPos();var vs=jscolor.getViewSize();var ps=getPickerDims(this);var a,b,c;switch(this.pickerPosition.toLowerCase()){case'left':a=1;b=0;c=-1;break;case'right':a=1;b=0;c=1;break;case'top':a=0;b=1;c=-1;break;default:a=0;b=1;c=1;break}var l=(ts[b]+ps[b])/2;if(!this.pickerSmartPosition){var pp=[tp[a],tp[b]+ts[b]-l+l*c]}else{var pp=[-vp[a]+tp[a]+ps[a]>vs[a]?(-vp[a]+tp[a]+ts[a]/2 > vs[a]/2&&tp[a]+ts[a]-ps[a]>=0?tp[a]+ts[a]-ps[a]:tp[a]):tp[a],-vp[b]+tp[b]+ts[b]+ps[b]-l+l*c>vs[b]?(-vp[b]+tp[b]+ts[b]/2 > vs[b]/2&&tp[b]+ts[b]-l-l*c>=0?tp[b]+ts[b]-l-l*c:tp[b]+ts[b]-l+l*c):(tp[b]+ts[b]-l+l*c>=0?tp[b]+ts[b]-l+l*c:tp[b]+ts[b]-l-l*c)]}drawPicker(pp[a],pp[b])}};this.importColor=function(){if(!valueElement){this.exportColor()}else{if(!this.adjust){if(!this.fromString(valueElement.value,leaveValue)){styleElement.style.backgroundImage=styleElement.jscStyle.backgroundImage;styleElement.style.backgroundColor=styleElement.jscStyle.backgroundColor;styleElement.style.color=styleElement.jscStyle.color;this.exportColor(leaveValue|leaveStyle)}}else if(!this.required&&/^\s*$/.test(valueElement.value)){valueElement.value='';styleElement.style.backgroundImage=styleElement.jscStyle.backgroundImage;styleElement.style.backgroundColor=styleElement.jscStyle.backgroundColor;styleElement.style.color=styleElement.jscStyle.color;this.exportColor(leaveValue|leaveStyle)}else if(this.fromString(valueElement.value)){}else{this.exportColor()}}};this.exportColor=function(flags){if(!(flags&leaveValue)&&valueElement){var value=this.toString();if(this.caps){value=value.toUpperCase()}if(this.hash){value='#'+value}valueElement.value=value}if(!(flags&leaveStyle)&&styleElement){styleElement.style.backgroundImage="none";styleElement.style.backgroundColor='#'+this.toString();styleElement.style.color=0.213*this.rgb[0]+0.715*this.rgb[1]+0.072*this.rgb[2]<0.5?'#FFF':'#000'}if(!(flags&leavePad)&&isPickerOwner()){redrawPad()}if(!(flags&leaveSld)&&isPickerOwner()){redrawSld()}};this.fromHSV=function(h,s,v,flags){if(h!==null){h=Math.max(0.0,this.minH,Math.min(6.0,this.maxH,h))}if(s!==null){s=Math.max(0.0,this.minS,Math.min(1.0,this.maxS,s))}if(v!==null){v=Math.max(0.0,this.minV,Math.min(1.0,this.maxV,v))}this.rgb=HSV_RGB(h===null?this.hsv[0]:(this.hsv[0]=h),s===null?this.hsv[1]:(this.hsv[1]=s),v===null?this.hsv[2]:(this.hsv[2]=v));this.exportColor(flags)};this.fromRGB=function(r,g,b,flags){if(r!==null){r=Math.max(0.0,Math.min(1.0,r))}if(g!==null){g=Math.max(0.0,Math.min(1.0,g))}if(b!==null){b=Math.max(0.0,Math.min(1.0,b))}var hsv=RGB_HSV(r===null?this.rgb[0]:r,g===null?this.rgb[1]:g,b===null?this.rgb[2]:b);if(hsv[0]!==null){this.hsv[0]=Math.max(0.0,this.minH,Math.min(6.0,this.maxH,hsv[0]))}if(hsv[2]!==0){this.hsv[1]=hsv[1]===null?null:Math.max(0.0,this.minS,Math.min(1.0,this.maxS,hsv[1]))}this.hsv[2]=hsv[2]===null?null:Math.max(0.0,this.minV,Math.min(1.0,this.maxV,hsv[2]));var rgb=HSV_RGB(this.hsv[0],this.hsv[1],this.hsv[2]);this.rgb[0]=rgb[0];this.rgb[1]=rgb[1];this.rgb[2]=rgb[2];this.exportColor(flags)};this.fromString=function(hex,flags){var m=hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);if(!m){return false}else{if(m[1].length===6){this.fromRGB(parseInt(m[1].substr(0,2),16)/255,parseInt(m[1].substr(2,2),16)/255,parseInt(m[1].substr(4,2),16)/255,flags)}else{this.fromRGB(parseInt(m[1].charAt(0)+m[1].charAt(0),16)/255,parseInt(m[1].charAt(1)+m[1].charAt(1),16)/255,parseInt(m[1].charAt(2)+m[1].charAt(2),16)/255,flags)}return true}};this.toString=function(){return((0x100|Math.round(255*this.rgb[0])).toString(16).substr(1)+(0x100|Math.round(255*this.rgb[1])).toString(16).substr(1)+(0x100|Math.round(255*this.rgb[2])).toString(16).substr(1))};function RGB_HSV(r,g,b){var n=Math.min(Math.min(r,g),b);var v=Math.max(Math.max(r,g),b);var m=v-n;if(m===0){return[null,0,v]}var h=r===n?3+(b-g)/m:(g===n?5+(r-b)/m:1+(g-r)/m);return[h===6?0:h,m/v,v]}function HSV_RGB(h,s,v){if(h===null){return[v,v,v]}var i=Math.floor(h);var f=i%2?h-i:1-(h-i);var m=v*(1-s);var n=v*(1-s*f);switch(i){case 6:case 0:return[v,n,m];case 1:return[n,v,m];case 2:return[m,v,n];case 3:return[m,n,v];case 4:return[n,m,v];case 5:return[v,m,n]}}function removePicker(){delete jscolor.picker.owner;document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB)}function drawPicker(x,y){if(!jscolor.picker){jscolor.picker={box:document.createElement('div'),boxB:document.createElement('div'),pad:document.createElement('div'),padB:document.createElement('div'),padM:document.createElement('div'),sld:document.createElement('div'),sldB:document.createElement('div'),sldM:document.createElement('div'),btn:document.createElement('div'),btnS:document.createElement('span'),btnT:document.createTextNode(THIS.pickerCloseText)};for(var i=0,segSize=4;i<jscolor.images.sld[1];i+=segSize){var seg=document.createElement('div');seg.style.height=segSize+'px';seg.style.fontSize='1px';seg.style.lineHeight='0';jscolor.picker.sld.appendChild(seg)}jscolor.picker.sldB.appendChild(jscolor.picker.sld);jscolor.picker.box.appendChild(jscolor.picker.sldB);jscolor.picker.box.appendChild(jscolor.picker.sldM);jscolor.picker.padB.appendChild(jscolor.picker.pad);jscolor.picker.box.appendChild(jscolor.picker.padB);jscolor.picker.box.appendChild(jscolor.picker.padM);jscolor.picker.btnS.appendChild(jscolor.picker.btnT);jscolor.picker.btn.appendChild(jscolor.picker.btnS);jscolor.picker.box.appendChild(jscolor.picker.btn);jscolor.picker.boxB.appendChild(jscolor.picker.box)}var p=jscolor.picker;p.box.onmouseup=p.box.onmouseout=function(){target.focus()};p.box.onmousedown=function(){abortBlur=true};p.box.onmousemove=function(e){if(holdPad||holdSld){holdPad&&setPad(e);holdSld&&setSld(e);if(document.selection){document.selection.empty()}else if(window.getSelection){window.getSelection().removeAllRanges()}dispatchImmediateChange()}};p.padM.onmouseup=p.padM.onmouseout=function(){if(holdPad){holdPad=false;jscolor.fireEvent(valueElement,'change')}};p.padM.onmousedown=function(e){switch(modeID){case 0:if(THIS.hsv[2]===0){THIS.fromHSV(null,null,1.0)};break;case 1:if(THIS.hsv[1]===0){THIS.fromHSV(null,1.0,null)};break}holdPad=true;setPad(e);dispatchImmediateChange()};p.sldM.onmouseup=p.sldM.onmouseout=function(){if(holdSld){holdSld=false;jscolor.fireEvent(valueElement,'change')}};p.sldM.onmousedown=function(e){holdSld=true;setSld(e);dispatchImmediateChange()};var dims=getPickerDims(THIS);p.box.style.width=dims[0]+'px';p.box.style.height=dims[1]+'px';p.boxB.style.position='absolute';p.boxB.style.clear='both';p.boxB.style.left=x+'px';p.boxB.style.top=y+'px';p.boxB.style.zIndex=THIS.pickerZIndex;p.boxB.style.border=THIS.pickerBorder+'px solid';p.boxB.style.borderColor=THIS.pickerBorderColor;p.boxB.style.background=THIS.pickerFaceColor;p.pad.style.width=jscolor.images.pad[0]+'px';p.pad.style.height=jscolor.images.pad[1]+'px';p.padB.style.position='absolute';p.padB.style.left=THIS.pickerFace+'px';p.padB.style.top=THIS.pickerFace+'px';p.padB.style.border=THIS.pickerInset+'px solid';p.padB.style.borderColor=THIS.pickerInsetColor;p.padM.style.position='absolute';p.padM.style.left='0';p.padM.style.top='0';p.padM.style.width=THIS.pickerFace+2*THIS.pickerInset+jscolor.images.pad[0]+jscolor.images.arrow[0]+'px';p.padM.style.height=p.box.style.height;p.padM.style.cursor='crosshair';p.sld.style.overflow='hidden';p.sld.style.width=jscolor.images.sld[0]+'px';p.sld.style.height=jscolor.images.sld[1]+'px';p.sldB.style.display=THIS.slider?'block':'none';p.sldB.style.position='absolute';p.sldB.style.right=THIS.pickerFace+'px';p.sldB.style.top=THIS.pickerFace+'px';p.sldB.style.border=THIS.pickerInset+'px solid';p.sldB.style.borderColor=THIS.pickerInsetColor;p.sldM.style.display=THIS.slider?'block':'none';p.sldM.style.position='absolute';p.sldM.style.right='0';p.sldM.style.top='0';p.sldM.style.width=jscolor.images.sld[0]+jscolor.images.arrow[0]+THIS.pickerFace+2*THIS.pickerInset+'px';p.sldM.style.height=p.box.style.height;try{p.sldM.style.cursor='pointer'}catch(eOldIE){p.sldM.style.cursor='hand'}function setBtnBorder(){var insetColors=THIS.pickerInsetColor.split(/\s+/);var pickerOutsetColor=insetColors.length<2?insetColors[0]:insetColors[1]+' '+insetColors[0]+' '+insetColors[0]+' '+insetColors[1];p.btn.style.borderColor=pickerOutsetColor}p.btn.style.display=THIS.pickerClosable?'block':'none';p.btn.style.position='absolute';p.btn.style.left=THIS.pickerFace+'px';p.btn.style.bottom=THIS.pickerFace+'px';p.btn.style.padding='0 15px';p.btn.style.height='18px';p.btn.style.border=THIS.pickerInset+'px solid';setBtnBorder();p.btn.style.color=THIS.pickerButtonColor;p.btn.style.font='12px sans-serif';p.btn.style.textAlign='center';try{p.btn.style.cursor='pointer'}catch(eOldIE){p.btn.style.cursor='hand'}p.btn.onmousedown=function(){THIS.hidePicker()};p.btnS.style.lineHeight=p.btn.style.height;switch(modeID){case 0:var padImg='hs.png';break;case 1:var padImg='hv.png';break}p.padM.style.backgroundImage="url('"+jscolor.getDir()+"cross.gif')";p.padM.style.backgroundRepeat="no-repeat";p.sldM.style.backgroundImage="url('"+jscolor.getDir()+"arrow.gif')";p.sldM.style.backgroundRepeat="no-repeat";p.pad.style.backgroundImage="url('"+jscolor.getDir()+padImg+"')";p.pad.style.backgroundRepeat="no-repeat";p.pad.style.backgroundPosition="0 0";redrawPad();redrawSld();jscolor.picker.owner=THIS;document.getElementsByTagName('body')[0].appendChild(p.boxB)}function getPickerDims(o){var dims=[2*o.pickerInset+2*o.pickerFace+jscolor.images.pad[0]+(o.slider?2*o.pickerInset+2*jscolor.images.arrow[0]+jscolor.images.sld[0]:0),o.pickerClosable?4*o.pickerInset+3*o.pickerFace+jscolor.images.pad[1]+o.pickerButtonHeight:2*o.pickerInset+2*o.pickerFace+jscolor.images.pad[1]];return dims}function redrawPad(){switch(modeID){case 0:var yComponent=1;break;case 1:var yComponent=2;break}var x=Math.round((THIS.hsv[0]/6)*(jscolor.images.pad[0]-1));var y=Math.round((1-THIS.hsv[yComponent])*(jscolor.images.pad[1]-1));jscolor.picker.padM.style.backgroundPosition=(THIS.pickerFace+THIS.pickerInset+x-Math.floor(jscolor.images.cross[0]/2))+'px '+(THIS.pickerFace+THIS.pickerInset+y-Math.floor(jscolor.images.cross[1]/2))+'px';var seg=jscolor.picker.sld.childNodes;switch(modeID){case 0:var rgb=HSV_RGB(THIS.hsv[0],THIS.hsv[1],1);for(var i=0;i<seg.length;i+=1){seg[i].style.backgroundColor='rgb('+(rgb[0]*(1-i/seg.length)*100)+'%,'+(rgb[1]*(1-i/seg.length)*100)+'%,'+(rgb[2]*(1-i/seg.length)*100)+'%)'}break;case 1:var rgb,s,c=[THIS.hsv[2],0,0];var i=Math.floor(THIS.hsv[0]);var f=i%2?THIS.hsv[0]-i:1-(THIS.hsv[0]-i);switch(i){case 6:case 0:rgb=[0,1,2];break;case 1:rgb=[1,0,2];break;case 2:rgb=[2,0,1];break;case 3:rgb=[2,1,0];break;case 4:rgb=[1,2,0];break;case 5:rgb=[0,2,1];break}for(var i=0;i<seg.length;i+=1){s=1-1/(seg.length-1)*i;c[1]=c[0]*(1-s*f);c[2]=c[0]*(1-s);seg[i].style.backgroundColor='rgb('+(c[rgb[0]]*100)+'%,'+(c[rgb[1]]*100)+'%,'+(c[rgb[2]]*100)+'%)'}break}}function redrawSld(){switch(modeID){case 0:var yComponent=2;break;case 1:var yComponent=1;break}var y=Math.round((1-THIS.hsv[yComponent])*(jscolor.images.sld[1]-1));jscolor.picker.sldM.style.backgroundPosition='0 '+(THIS.pickerFace+THIS.pickerInset+y-Math.floor(jscolor.images.arrow[1]/2))+'px'}function isPickerOwner(){return jscolor.picker&&jscolor.picker.owner===THIS}function blurTarget(){if(valueElement===target){THIS.importColor()}if(THIS.pickerOnfocus){THIS.hidePicker()}}function blurValue(){if(valueElement!==target){THIS.importColor()}}function setPad(e){var mpos=jscolor.getRelMousePos(e);var x=mpos.x-THIS.pickerFace-THIS.pickerInset;var y=mpos.y-THIS.pickerFace-THIS.pickerInset;switch(modeID){case 0:THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)),1-y/(jscolor.images.pad[1]-1),null,leaveSld);break;case 1:THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)),null,1-y/(jscolor.images.pad[1]-1),leaveSld);break}}function setSld(e){var mpos=jscolor.getRelMousePos(e);var y=mpos.y-THIS.pickerFace-THIS.pickerInset;switch(modeID){case 0:THIS.fromHSV(null,null,1-y/(jscolor.images.sld[1]-1),leavePad);break;case 1:THIS.fromHSV(null,1-y/(jscolor.images.sld[1]-1),null,leavePad);break}}function dispatchImmediateChange(){if(THIS.onImmediateChange){var callback;if(typeof THIS.onImmediateChange==='string'){callback=new Function(THIS.onImmediateChange)}else{callback=THIS.onImmediateChange}callback.call(THIS)}}var THIS=this;var modeID=this.pickerMode.toLowerCase()==='hvs'?1:0;var abortBlur=false;var valueElement=jscolor.fetchElement(this.valueElement),styleElement=jscolor.fetchElement(this.styleElement);var holdPad=false,holdSld=false;var leaveValue=1<<0,leaveStyle=1<<1,leavePad=1<<2,leaveSld=1<<3;jscolor.addEvent(target,'focus',function(){if(THIS.pickerOnfocus){THIS.showPicker()}});jscolor.addEvent(target,'blur',function(){if(!abortBlur){window.setTimeout(function(){abortBlur||blurTarget();abortBlur=false},0)}else{abortBlur=false}});if(valueElement){var updateField=function(){THIS.fromString(valueElement.value,leaveValue);dispatchImmediateChange()};jscolor.addEvent(valueElement,'keyup',updateField);jscolor.addEvent(valueElement,'input',updateField);jscolor.addEvent(valueElement,'blur',blurValue);valueElement.setAttribute('autocomplete','off')}if(styleElement){styleElement.jscStyle={backgroundImage:styleElement.style.backgroundImage,backgroundColor:styleElement.style.backgroundColor,color:styleElement.style.color}}switch(modeID){case 0:jscolor.requireImage('hs.png');break;case 1:jscolor.requireImage('hv.png');break}jscolor.requireImage('cross.gif');jscolor.requireImage('arrow.gif');this.importColor()}};jscolor.install();
js/SlideshowPluginPostType/post-type-handler.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function(){
2
+ /**
3
+ * Loop through fields that depend on another field's value for showing, register change event
4
+ */
5
+ jQuery('.depends-on-field-value').each(function(key, value){
6
+ var attributes = jQuery(this).attr('class').split(' ');
7
+
8
+ // Check if field should be shown
9
+ var element = jQuery(this).closest('tr');
10
+ if((jQuery('input[name="' + attributes[1] + '"]').val() == attributes[2] && jQuery('input[name="' + attributes[1] + '"]').prop('checked')) ||
11
+ jQuery('select[name="' + attributes[1] + '"]').val() == attributes[2])
12
+ setElementVisibility(element, true);
13
+ else
14
+ setElementVisibility(element, false);
15
+
16
+ // On change, set field's visibility
17
+ jQuery('input[name="' + attributes[1] + '"], select[name="' + attributes[1] + '"]').change(attributes, function(){
18
+ var element = jQuery('.' + attributes[3]).closest('tr');
19
+
20
+ if(jQuery(this).val() == attributes[2])
21
+ setElementVisibility(element, true);
22
+ else
23
+ setElementVisibility(element, false);
24
+ });
25
+ });
26
+
27
+ /**
28
+ * Set element visibility
29
+ *
30
+ * @param element
31
+ * @param visible
32
+ */
33
+ function setElementVisibility(element, visible){
34
+ if(visible)
35
+ jQuery(element).css({'display': 'table-row'});
36
+ else
37
+ jQuery(element).css({'display': 'none'});
38
+ }
39
+ });
js/SlideshowPluginPostType/style-settings.js CHANGED
@@ -14,7 +14,7 @@ jQuery(document).ready(function(){
14
 
15
  function setVisible(element, visible){
16
  if(visible)
17
- jQuery(element).css({'display': 'inline'});
18
  else
19
  jQuery(element).css({'display': 'none'});
20
  }
14
 
15
  function setVisible(element, visible){
16
  if(visible)
17
+ jQuery(element).css({'display': 'table-row'});
18
  else
19
  jQuery(element).css({'display': 'none'});
20
  }
js/SlideshowPluginSlideInserter/slide-inserter.js ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function(){
2
+ // Index first
3
+ slideshowSlideInserterIndexSlidesOrder();
4
+
5
+ // Make list items in the sortables list sortable, exclude elements with cancel option.
6
+ jQuery('.sortable-slides-list').sortable({
7
+ revert: true,
8
+ stop: function(event, ui){
9
+ slideshowSlideInserterIndexSlidesOrder();
10
+ },
11
+ cancel: 'input, select, p'
12
+ });
13
+
14
+ // Make the black background stretch all the way down the document
15
+ jQuery('#slideshow-slide-inserter-popup-background').height(jQuery(document).outerHeight(true));
16
+
17
+ // Center the popup in the window
18
+ jQuery('#slideshow-slide-inserter-popup').css({
19
+ 'top': parseInt((jQuery(window).height() / 2) - (jQuery('#slideshow-slide-inserter-popup').outerHeight(true) / 2), 10),
20
+ 'left': parseInt((jQuery(window).width() / 2) - (jQuery('#slideshow-slide-inserter-popup').outerWidth(true) / 2), 10)
21
+ });
22
+
23
+ // Focus on search bar
24
+ jQuery('#slideshow-slide-inserter-popup #search').focus();
25
+
26
+ // Preload attachments
27
+ slideshowSlideInserterGetSearchResults();
28
+
29
+ /**
30
+ * Close popup when clicked on cross
31
+ */
32
+ jQuery('#slideshow-slide-inserter-popup #close').click(function(){
33
+ slideshowSlideInserterClosePopup();
34
+ });
35
+
36
+ /**
37
+ * Close popup when clicked on background
38
+ */
39
+ jQuery('#slideshow-slide-inserter-popup-background').click(function(){
40
+ slideshowSlideInserterClosePopup();
41
+ });
42
+
43
+ /**
44
+ * Send ajax request on click of the search button
45
+ */
46
+ jQuery('#slideshow-slide-inserter-popup #search-submit').click(function(){
47
+ slideshowSlideInserterGetSearchResults();
48
+ });
49
+
50
+ /**
51
+ * Make the 'enter' key do the same as the search button
52
+ */
53
+ jQuery('#slideshow-slide-inserter-popup #search').keypress(function(event){
54
+ if(event.which == 13){
55
+ event.preventDefault();
56
+ slideshowSlideInserterGetSearchResults();
57
+ }
58
+ });
59
+
60
+ /**
61
+ * Open popup by click on button
62
+ */
63
+ jQuery('#slideshow-insert-image-slide').click(function(){
64
+ jQuery('#slideshow-slide-inserter-popup, #slideshow-slide-inserter-popup-background').css({ display: 'block' });
65
+ });
66
+
67
+ /**
68
+ * Insert text slide into the sortable list when the Insert Text Slide button is clicked
69
+ */
70
+ jQuery('#slideshow-insert-text-slide').click(function(){
71
+ slideshowSlideInserterInsertTextSlide();
72
+ });
73
+
74
+ /**
75
+ * Insert video slide into the sortable list when the Insert Video Slide button is clicked
76
+ */
77
+ jQuery('#slideshow-insert-video-slide').click(function(){
78
+ slideshowSlideInserterInsertVideoSlide();
79
+ });
80
+
81
+ /**
82
+ * Ajax deletes a slide from the slides list and from the database
83
+ */
84
+ jQuery('.slideshow-delete-slide').click(function(){
85
+ var deleteSlide = confirm('Are you sure you want to delete this slide?');
86
+ if(!deleteSlide)
87
+ return;
88
+
89
+ // Get postId from url
90
+ var postId = -1;
91
+ jQuery.each(location.search.replace('?', '').split('&'), function(key, value){
92
+ var splitValue = value.split('=');
93
+ if(splitValue[0] == 'post')
94
+ postId = splitValue[1];
95
+ });
96
+
97
+ // Get slideId
98
+ var slideId = jQuery(this).find('span').attr('class');
99
+
100
+
101
+ if(postId == -1 || slideId == 'undefined')
102
+ return;
103
+
104
+ // Remove slide from DOM
105
+ jQuery(this).parent().remove();
106
+
107
+ // Remove slide by AJAX.
108
+ jQuery.post(
109
+ ajaxurl,
110
+ {
111
+ action: 'slideshow_delete_slide',
112
+ postId: postId,
113
+ slideId: slideId
114
+ }
115
+ );
116
+ });
117
+
118
+ /**
119
+ * Loop through list items, fill hidden field with loop id
120
+ */
121
+ function slideshowSlideInserterIndexSlidesOrder(){
122
+ jQuery.each(jQuery('.sortable-slides-list').find('li'), function(key, value){
123
+ jQuery(value).find('.slide_order').attr('value', key + 1);
124
+ });
125
+ }
126
+
127
+ /**
128
+ * Sends an ajax post request with the search query and print
129
+ * retrieved html to the results table.
130
+ *
131
+ * If offset is set, append data to data that is already there
132
+ *
133
+ * @param offset (optional, defaults to 0)
134
+ */
135
+ function slideshowSlideInserterGetSearchResults(offset){
136
+ if(!offset){
137
+ offset = 0;
138
+ jQuery('#slideshow-slide-inserter-popup #results').html('');
139
+ }
140
+
141
+ jQuery.post(
142
+ ajaxurl,
143
+ {
144
+ action: 'slideshow_slide_inserter_search_query',
145
+ search: jQuery('#slideshow-slide-inserter-popup #search').attr('value'),
146
+ offset: offset
147
+ },
148
+ function(response){
149
+ // Fill table
150
+ jQuery('#slideshow-slide-inserter-popup #results').append(response);
151
+
152
+ // Apply insert to slideshow script
153
+ jQuery('#slideshow-slide-inserter-popup #results .insert-attachment').click(function(){
154
+ var tr = jQuery(this).closest('tr');
155
+ slideshowSlideInserterInsertImageSlide(
156
+ jQuery(this).attr('id'),
157
+ jQuery(tr).find('.title').text(),
158
+ jQuery(tr).find('.description').text(),
159
+ jQuery(tr).find('.image img').attr('src')
160
+ );
161
+ });
162
+
163
+ // Load more results on click of the 'Load more results' button
164
+ if(jQuery('.load-more-results')){
165
+ jQuery('.load-more-results').click(function(){
166
+ // Get offset
167
+ var previousOffset = jQuery(this).attr('class').split(' ')[2];
168
+
169
+ // Load ajax results
170
+ slideshowSlideInserterGetSearchResults(previousOffset);
171
+
172
+ // Remove button row
173
+ jQuery(this).closest('tr').remove();
174
+ });
175
+ }
176
+ }
177
+ );
178
+ }
179
+
180
+ /**
181
+ * Inserts image slide into the slides list
182
+ *
183
+ * @param id
184
+ * @param title
185
+ * @param description
186
+ * @param src
187
+ */
188
+ function slideshowSlideInserterInsertImageSlide(id, title, description, src){
189
+ if(slideshowHighestSlideId == 'undefined')
190
+ return;
191
+
192
+ slideshowHighestSlideId++;
193
+ var imageSlide = jQuery('.image-slide-template').find('li').clone();
194
+
195
+ // Fill slide with data
196
+ imageSlide.find('.attachment').attr('src', src);
197
+ imageSlide.find('.attachment').attr('title', title);
198
+ imageSlide.find('.attachment').attr('alt', title);
199
+ imageSlide.find('.title').html(title);
200
+ imageSlide.find('.description').html(description);
201
+ imageSlide.find('.postId').attr('value', id);
202
+
203
+ // Set names to be saved to the database
204
+ imageSlide.find('.url').attr('name', 'slide_' + slideshowHighestSlideId + '_url');
205
+ imageSlide.find('.type').attr('name', 'slide_' + slideshowHighestSlideId + '_type');
206
+ imageSlide.find('.postId').attr('name', 'slide_' + slideshowHighestSlideId + '_postId');
207
+ imageSlide.find('.slide_order').attr('name', 'slide_' + slideshowHighestSlideId + '_order');
208
+
209
+ // Register delete link (only needs to delete from DOM)
210
+ imageSlide.find('.slideshow-delete-new-slide').click(function(){
211
+ var deleteSlide = confirm('Are you sure you want to delete this slide?');
212
+ if(!deleteSlide)
213
+ return;
214
+
215
+ jQuery(this).closest('li').remove();
216
+ });
217
+
218
+ // Put slide in the sortables list.
219
+ jQuery('.sortable-slides-list').prepend(imageSlide);
220
+
221
+ // Reindex
222
+ slideshowSlideInserterIndexSlidesOrder();
223
+ }
224
+
225
+ /**
226
+ * Inserts text slide into the slides list
227
+ */
228
+ function slideshowSlideInserterInsertTextSlide(){
229
+ if(slideshowHighestSlideId == 'undefined')
230
+ return;
231
+
232
+ slideshowHighestSlideId++;
233
+ var textSlide = jQuery('.text-slide-template').find('li').clone();
234
+
235
+ // Set names to be saved to the database
236
+ textSlide.find('.title').attr('name', 'slide_' + slideshowHighestSlideId + '_title');
237
+ textSlide.find('.description').attr('name', 'slide_' + slideshowHighestSlideId + '_description');
238
+ textSlide.find('.color').attr('name', 'slide_' + slideshowHighestSlideId + '_color');
239
+ textSlide.find('.url').attr('name', 'slide_' + slideshowHighestSlideId + '_url');
240
+ textSlide.find('.type').attr('name', 'slide_' + slideshowHighestSlideId + '_type');
241
+ textSlide.find('.slide_order').attr('name', 'slide_' + slideshowHighestSlideId + '_order');
242
+
243
+ // Register delete link (only needs to delete from DOM)
244
+ textSlide.find('.slideshow-delete-new-slide').click(function(){
245
+ var deleteSlide = confirm('Are you sure you want to delete this slide?');
246
+ if(!deleteSlide)
247
+ return;
248
+
249
+ jQuery(this).closest('li').remove();
250
+ });
251
+
252
+ // Put slide in the sortables list.
253
+ jQuery('.sortable-slides-list').prepend(textSlide);
254
+
255
+ // Reindex slide orders
256
+ slideshowSlideInserterIndexSlidesOrder();
257
+ }
258
+
259
+ /**
260
+ * Inserts video slide into the slides list
261
+ */
262
+ function slideshowSlideInserterInsertVideoSlide(){
263
+ if(slideshowHighestSlideId == 'undefined')
264
+ return;
265
+
266
+ slideshowHighestSlideId++;
267
+ var videoSlide = jQuery('.video-slide-template').find('li').clone();
268
+
269
+ // Set names to be saved to the database
270
+ videoSlide.find('.videoId').attr('name', 'slide_' + slideshowHighestSlideId + '_videoId');
271
+ videoSlide.find('.type').attr('name', 'slide_' + slideshowHighestSlideId + '_type');
272
+ videoSlide.find('.slide_order').attr('name', 'slide_' + slideshowHighestSlideId + '_order');
273
+
274
+ // Register delete link (only needs to delete from DOM)
275
+ videoSlide.find('.slideshow-delete-new-slide').click(function(){
276
+ var deleteSlide = confirm('Are you sure you want to delete this slide?');
277
+ if(!deleteSlide)
278
+ return;
279
+
280
+ jQuery(this).closest('li').remove();
281
+ });
282
+
283
+ // Put slide in the sortables list.
284
+ jQuery('.sortable-slides-list').prepend(videoSlide);
285
+
286
+ // Reindex slide orders
287
+ slideshowSlideInserterIndexSlidesOrder();
288
+ }
289
+
290
+ /**
291
+ * Closes popup
292
+ */
293
+ function slideshowSlideInserterClosePopup(){
294
+ jQuery('#slideshow-slide-inserter-popup, #slideshow-slide-inserter-popup-background').css({ display: 'none' });
295
+ }
296
+ });
languages/slideshow-plugin-nl_NL.mo CHANGED
Binary file
languages/slideshow-plugin-nl_NL.po CHANGED
@@ -2,195 +2,379 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Slideshow Plugin\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2012-06-23 17:41+0100\n"
6
- "PO-Revision-Date: 2012-06-26 01:04+0100\n"
7
  "Last-Translator: Stefan Boonstra <stefanboonstra@hotmail.com>\n"
8
- "Language-Team: Boonstra <stefanboonstra@hotmail.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-KeywordsList: _;_e;__\n"
13
- "X-Poedit-Basepath: C:\\xampp\\htdocs\\wordpress\\vanderlei-showproductions\\wp-content\\plugins\\slideshow-jquery-image-gallery\n"
14
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
15
  "X-Poedit-Language: Dutch\n"
16
  "X-Poedit-Country: NETHERLANDS\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
- #: classes/SlideshowPostType.php:49
20
  msgid "Slideshows"
21
  msgstr "Slideshows"
22
 
23
- #: classes/SlideshowPostType.php:50
24
- #: views/SlideshowWidget/form.php:7
25
  msgid "Slideshow"
26
  msgstr "Slideshow"
27
 
28
- #: classes/SlideshowPostType.php:51
29
  msgid "Add New Slideshow"
30
  msgstr "Nieuwe Slideshow Toevoegen"
31
 
32
- #: classes/SlideshowPostType.php:52
33
  msgid "Edit slideshow"
34
  msgstr "Slideshow bewerken"
35
 
36
- #: classes/SlideshowPostType.php:53
37
  msgid "New slideshow"
38
  msgstr "Nieuwe slideshow"
39
 
40
- #: classes/SlideshowPostType.php:54
41
  msgid "View slideshow"
42
  msgstr "Slideshow bekijken"
43
 
44
- #: classes/SlideshowPostType.php:55
45
  msgid "Search slideshows"
46
  msgstr "Slideshows zoeken"
47
 
48
- #: classes/SlideshowPostType.php:56
49
- #: classes/SlideshowPostType.php:57
50
  msgid "No slideshows found"
51
  msgstr "Geen slideshows gevonden"
52
 
53
- #: classes/SlideshowPostType.php:82
54
  msgid "Information"
55
  msgstr "Informatie"
56
 
57
- #: classes/SlideshowPostType.php:91
58
  msgid "Slides List"
59
  msgstr "Slides Lijst"
60
 
61
- #: classes/SlideshowPostType.php:100
62
  msgid "Slideshow Style"
63
  msgstr "Slideshow Stijl"
64
 
65
- #: classes/SlideshowPostType.php:109
66
  msgid "Slideshow Settings"
67
  msgstr "Slideshow Instellingen"
68
 
69
- #: classes/SlideshowWidget.php:20
70
- msgid "Enables you to show your slideshows in the widget area of your website."
71
- msgstr "Maakt het mogelijk je slideshows te bijken in het wigdet gebied van je website."
72
 
73
- #: classes/SlideshowWidget.php:26
74
- msgid "Slideshow Widget"
75
- msgstr "Slideshow Widget"
76
 
77
- #: views/SlideshowPostType/information.php:3
78
- msgid "To use this slideshow in your website either add this piece of shortcode to your posts or pages"
79
- msgstr "Om deze slideshow op je website te gebruiken voeg je of dit stukje shortcode aan je pagina of post toe"
80
 
81
- #: views/SlideshowPostType/information.php:5
82
- msgid "Or add this piece of code to where ever in your website you want to place the slideshow"
83
- msgstr "Of je voegt dit stuk code toe aan je broncode op de plaats waar je wilt dat de slideshow te zien is"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
- #: views/SlideshowPostType/settings.php:3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  msgid "Number of seconds the slide takes to slide in"
87
  msgstr "Aantal seconden dat de animatie van het inschuiven van de volgende slide duurt"
88
 
89
- #: views/SlideshowPostType/settings.php:5
90
- #: views/SlideshowPostType/settings.php:10
91
- #: views/SlideshowPostType/settings.php:15
92
- #: views/SlideshowPostType/settings.php:20
93
- #: views/SlideshowPostType/settings.php:25
94
- #: views/SlideshowPostType/settings.php:33
95
- #: views/SlideshowPostType/settings.php:41
96
- #: views/SlideshowPostType/settings.php:49
97
- #: views/SlideshowPostType/settings.php:57
98
- msgid "Default"
99
- msgstr "Standaard"
100
-
101
- #: views/SlideshowPostType/settings.php:8
102
  msgid "Number of seconds the description takes to slide in"
103
  msgstr "Aantal seconden dat het inschuiven van de beschrijving duurt"
104
 
105
- #: views/SlideshowPostType/settings.php:13
106
  msgid "Seconds between changing slides"
107
  msgstr "Seconden tussen het wisselen van de slides"
108
 
109
- #: views/SlideshowPostType/settings.php:18
110
- msgid "Width of the slideshow"
111
- msgstr "Breedte van de slideshow"
112
-
113
- #: views/SlideshowPostType/settings.php:20
114
- msgid "Defaults to parent's width."
115
- msgstr "Standaard ingesteld op de breedte van het bovenliggende element."
116
-
117
- #: views/SlideshowPostType/settings.php:23
 
 
 
 
 
 
 
 
 
 
118
  msgid "Height of the slideshow"
119
  msgstr "Hoogte van de slideshow"
120
 
121
- #: views/SlideshowPostType/settings.php:28
122
- msgid "Fit image into slideshow (stretching it)"
 
 
 
 
123
  msgstr "Pas afbeelding in de slideshow (oprekken)"
124
 
125
- #: views/SlideshowPostType/settings.php:30
126
- #: views/SlideshowPostType/settings.php:33
127
- #: views/SlideshowPostType/settings.php:38
128
- #: views/SlideshowPostType/settings.php:41
129
- #: views/SlideshowPostType/settings.php:46
130
- #: views/SlideshowPostType/settings.php:49
131
- #: views/SlideshowPostType/settings.php:54
132
- #: views/SlideshowPostType/settings.php:57
133
- msgid "Yes"
134
- msgstr "Ja"
135
 
136
- #: views/SlideshowPostType/settings.php:31
137
- #: views/SlideshowPostType/settings.php:33
138
- #: views/SlideshowPostType/settings.php:39
139
- #: views/SlideshowPostType/settings.php:41
140
- #: views/SlideshowPostType/settings.php:47
141
- #: views/SlideshowPostType/settings.php:49
142
- #: views/SlideshowPostType/settings.php:55
143
- #: views/SlideshowPostType/settings.php:57
144
- msgid "No"
145
- msgstr "Nee"
 
 
 
 
146
 
147
- #: views/SlideshowPostType/settings.php:36
 
 
 
 
148
  msgid "Activate buttons (so the user can scroll through the slides)"
149
  msgstr "Knoppen activeren (zodat de gebruiker door de slides kan scrollen)"
150
 
151
- #: views/SlideshowPostType/settings.php:44
152
- msgid "Send user to image URL on click"
153
- msgstr "Wanner de gebruiker op de afbeelding klikt, stuur hem naar de URL van het plaatje"
154
 
155
- #: views/SlideshowPostType/settings.php:52
156
- msgid "Show title and description"
157
- msgstr "Toon titel en beschrijving"
158
 
159
- #: views/SlideshowPostType/slides.php:4
160
- msgid "Add slides to this slideshow by using the button above or attaching images from the media page."
161
- msgstr "Voeg slides toe door afbeeldingen te uploaden met de bovenstaande knop of ze te koppelen aan deze slideshow via de media pagina."
162
 
163
- #: views/SlideshowPostType/style-settings.php:3
164
- msgid "Style"
165
- msgstr "Style"
166
 
167
- #: views/SlideshowPostType/style-settings.php:9
168
- msgid "Custom Style"
169
- msgstr "Aangepaste Stijl"
170
 
171
- #: views/SlideshowPostType/style-settings.php:12
172
- msgid "The style used for this slideshow"
173
- msgstr "De stijl te gebruiken voor deze slideshow"
174
 
175
- #: views/SlideshowPostType/style-settings.php:18
176
- msgid "Custom Style Editor"
177
- msgstr "Aangepaste Stijl Bewerker"
 
 
 
 
178
 
179
- #: views/SlideshowPostType/style-settings.php:22
180
- msgid "Custom style"
181
- msgstr "Aangepaste stijl"
182
 
183
- #: views/SlideshowUpload/upload-button.php:1
184
- msgid "Upload/Manage Images"
185
- msgstr "Upload/Beheer Afbeeldingen"
186
 
187
- #: views/SlideshowWidget/form.php:2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  msgid "Title"
189
  msgstr "Titel"
190
 
191
- #: views/SlideshowWidget/form.php:9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  msgid "Random Slideshow"
193
  msgstr "Willekeurige Slideshow"
194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  #~ msgid "Leave any field open to use default value."
196
  #~ msgstr "Een veld dat open wordt gelaten neemt de standaardwaarde aan."
2
  msgstr ""
3
  "Project-Id-Version: Slideshow Plugin\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-09-15 17:46+0100\n"
6
+ "PO-Revision-Date: 2012-09-15 17:47+0100\n"
7
  "Last-Translator: Stefan Boonstra <stefanboonstra@hotmail.com>\n"
8
+ "Language-Team: Stefan Boonstra <wordpress@stefanboonstra.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: _e;__\n"
13
+ "X-Poedit-Basepath: ../\n"
 
14
  "X-Poedit-Language: Dutch\n"
15
  "X-Poedit-Country: NETHERLANDS\n"
16
  "X-Poedit-SearchPath-0: .\n"
17
 
18
+ #: classes/SlideshowPluginPostType.php:39
19
  msgid "Slideshows"
20
  msgstr "Slideshows"
21
 
22
+ #: classes/SlideshowPluginPostType.php:40
 
23
  msgid "Slideshow"
24
  msgstr "Slideshow"
25
 
26
+ #: classes/SlideshowPluginPostType.php:41
27
  msgid "Add New Slideshow"
28
  msgstr "Nieuwe Slideshow Toevoegen"
29
 
30
+ #: classes/SlideshowPluginPostType.php:42
31
  msgid "Edit slideshow"
32
  msgstr "Slideshow bewerken"
33
 
34
+ #: classes/SlideshowPluginPostType.php:43
35
  msgid "New slideshow"
36
  msgstr "Nieuwe slideshow"
37
 
38
+ #: classes/SlideshowPluginPostType.php:44
39
  msgid "View slideshow"
40
  msgstr "Slideshow bekijken"
41
 
42
+ #: classes/SlideshowPluginPostType.php:45
43
  msgid "Search slideshows"
44
  msgstr "Slideshows zoeken"
45
 
46
+ #: classes/SlideshowPluginPostType.php:46
47
+ #: classes/SlideshowPluginPostType.php:47
48
  msgid "No slideshows found"
49
  msgstr "Geen slideshows gevonden"
50
 
51
+ #: classes/SlideshowPluginPostType.php:79
52
  msgid "Information"
53
  msgstr "Informatie"
54
 
55
+ #: classes/SlideshowPluginPostType.php:88
56
  msgid "Slides List"
57
  msgstr "Slides Lijst"
58
 
59
+ #: classes/SlideshowPluginPostType.php:97
60
  msgid "Slideshow Style"
61
  msgstr "Slideshow Stijl"
62
 
63
+ #: classes/SlideshowPluginPostType.php:106
64
  msgid "Slideshow Settings"
65
  msgstr "Slideshow Instellingen"
66
 
67
+ #: classes/SlideshowPluginPostType.php:381
68
+ msgid "Yes"
69
+ msgstr "Ja"
70
 
71
+ #: classes/SlideshowPluginPostType.php:382
72
+ msgid "No"
73
+ msgstr "Nee"
74
 
75
+ #: classes/SlideshowPluginPostType.php:384
76
+ msgid "The style used for this slideshow"
77
+ msgstr "De stijl te gebruiken voor deze slideshow"
78
 
79
+ #: classes/SlideshowPluginPostType.php:384
80
+ msgid "Light"
81
+ msgstr "Licht"
82
+
83
+ #: classes/SlideshowPluginPostType.php:384
84
+ msgid "Dark"
85
+ msgstr "Donker"
86
+
87
+ #: classes/SlideshowPluginPostType.php:384
88
+ msgid "Custom"
89
+ msgstr "Aangepast"
90
+
91
+ #: classes/SlideshowPluginPostType.php:385
92
+ #, fuzzy
93
+ msgid "Custom style editor"
94
+ msgstr "Aangepaste Stijl Bewerker"
95
+
96
+ #: classes/SlideshowPluginPostType.php:386
97
+ msgid "Animation used for transition between slides"
98
+ msgstr "Animatie tussen het wisselen van de slides"
99
 
100
+ #: classes/SlideshowPluginPostType.php:386
101
+ msgid "Slide"
102
+ msgstr "Slide"
103
+
104
+ #: classes/SlideshowPluginPostType.php:386
105
+ msgid "Fade"
106
+ msgstr "Fade"
107
+
108
+ #: classes/SlideshowPluginPostType.php:386
109
+ #: classes/SlideshowPluginPostType.php:387
110
+ #: classes/SlideshowPluginPostType.php:388
111
+ #: classes/SlideshowPluginPostType.php:389
112
+ msgid "Animation"
113
+ msgstr "Animatie"
114
+
115
+ #: classes/SlideshowPluginPostType.php:387
116
  msgid "Number of seconds the slide takes to slide in"
117
  msgstr "Aantal seconden dat de animatie van het inschuiven van de volgende slide duurt"
118
 
119
+ #: classes/SlideshowPluginPostType.php:388
 
 
 
 
 
 
 
 
 
 
 
 
120
  msgid "Number of seconds the description takes to slide in"
121
  msgstr "Aantal seconden dat het inschuiven van de beschrijving duurt"
122
 
123
+ #: classes/SlideshowPluginPostType.php:389
124
  msgid "Seconds between changing slides"
125
  msgstr "Seconden tussen het wisselen van de slides"
126
 
127
+ #: classes/SlideshowPluginPostType.php:390
128
+ msgid "Number of slides to fit into one slide"
129
+ msgstr "Aantal slides om in een slide te plaatsen"
130
+
131
+ #: classes/SlideshowPluginPostType.php:390
132
+ #: classes/SlideshowPluginPostType.php:391
133
+ #: classes/SlideshowPluginPostType.php:392
134
+ #: classes/SlideshowPluginPostType.php:393
135
+ #: classes/SlideshowPluginPostType.php:394
136
+ #: classes/SlideshowPluginPostType.php:395
137
+ #: classes/SlideshowPluginPostType.php:396
138
+ msgid "Display"
139
+ msgstr "Weergave"
140
+
141
+ #: classes/SlideshowPluginPostType.php:391
142
+ msgid "Width of the slideshow, set to parent&#39;s width on 0"
143
+ msgstr "Breedte van de slideshow, past zich aan op bovenliggende element wanneer 0"
144
+
145
+ #: classes/SlideshowPluginPostType.php:392
146
  msgid "Height of the slideshow"
147
  msgstr "Hoogte van de slideshow"
148
 
149
+ #: classes/SlideshowPluginPostType.php:393
150
+ msgid "Height of the description boxes"
151
+ msgstr "Hoogte van de beschrijvingen"
152
+
153
+ #: classes/SlideshowPluginPostType.php:394
154
+ msgid "Fit image into slide (stretching it)"
155
  msgstr "Pas afbeelding in de slideshow (oprekken)"
156
 
157
+ #: classes/SlideshowPluginPostType.php:395
158
+ msgid "Show title and description"
159
+ msgstr "Toon titel en beschrijving"
 
 
 
 
 
 
 
160
 
161
+ #: classes/SlideshowPluginPostType.php:396
162
+ msgid "Hide description box, it will pop up when a mouse hovers over the slide"
163
+ msgstr "Verbeg beschrijving, toon de slide alleen wanneer de muisaanwijzer boven de slide is"
164
+
165
+ #: classes/SlideshowPluginPostType.php:397
166
+ msgid "Automatically slide to the next slide"
167
+ msgstr "Automatisch naar de volgende slide gaan"
168
+
169
+ #: classes/SlideshowPluginPostType.php:397
170
+ #: classes/SlideshowPluginPostType.php:398
171
+ #: classes/SlideshowPluginPostType.php:399
172
+ #: classes/SlideshowPluginPostType.php:400
173
+ msgid "Control"
174
+ msgstr "Controle"
175
 
176
+ #: classes/SlideshowPluginPostType.php:398
177
+ msgid "Return to the beginning of the slideshow after last slide"
178
+ msgstr "Keer terug naar het begin van de slideshow na de laatste slide."
179
+
180
+ #: classes/SlideshowPluginPostType.php:399
181
  msgid "Activate buttons (so the user can scroll through the slides)"
182
  msgstr "Knoppen activeren (zodat de gebruiker door de slides kan scrollen)"
183
 
184
+ #: classes/SlideshowPluginPostType.php:400
185
+ msgid "Show control panel (play and pause button)"
186
+ msgstr "Toon controlepaneel (speel en pause knop)"
187
 
188
+ #: classes/SlideshowPluginPostType.php:401
189
+ msgid "Randomize slides"
190
+ msgstr "Toon slides in willekeurige volgorde"
191
 
192
+ #: classes/SlideshowPluginPostType.php:401
193
+ msgid "Miscellaneous"
194
+ msgstr "Overige"
195
 
196
+ #: classes/SlideshowPluginSlideInserter.php:135
197
+ msgid "Insert"
198
+ msgstr "Invoegen"
199
 
200
+ #: classes/SlideshowPluginSlideInserter.php:144
201
+ msgid "Load more results"
202
+ msgstr "Meer resultaten laden"
203
 
204
+ #: classes/SlideshowPluginSlideInserter.php:153
205
+ msgid "No images were found, click here to upload some."
206
+ msgstr "Geen afbeeldingen gevonden, klik hier om afbeeldingen te uploaden."
207
 
208
+ #: classes/SlideshowPluginWidget.php:20
209
+ msgid "Enables you to show your slideshows in the widget area of your website."
210
+ msgstr "Maakt het mogelijk je slideshows te bijken in het widget gebied van je website."
211
+
212
+ #: classes/SlideshowPluginWidget.php:26
213
+ msgid "Slideshow Widget"
214
+ msgstr "Slideshow Widget"
215
 
216
+ #: views/SlideshowPluginPostType/information.php:1
217
+ msgid "To use this slideshow in your website either add this piece of shortcode to your posts or pages"
218
+ msgstr "Om deze slideshow op je website te gebruiken voeg je of dit stukje shortcode aan je pagina of post toe"
219
 
220
+ #: views/SlideshowPluginPostType/information.php:3
221
+ msgid "Or add this piece of code to where ever in your website you want to place the slideshow"
222
+ msgstr "Of je voegt dit stuk code toe aan je broncode op de plaats waar je wilt dat de slideshow te zien is"
223
 
224
+ #: views/SlideshowPluginPostType/settings.php:8
225
+ msgid "settings"
226
+ msgstr "instellingen"
227
+
228
+ #: views/SlideshowPluginPostType/settings.php:22
229
+ #: views/SlideshowPluginPostType/style-settings.php:6
230
+ msgid "Default"
231
+ msgstr "Standaard"
232
+
233
+ #: views/SlideshowPluginPostType/slides.php:9
234
+ msgid "Add slides to this slideshow by using one of the buttons above."
235
+ msgstr "Voeg slides toe doormiddel van de bovenstaande knoppen."
236
+
237
+ #: views/SlideshowPluginPostType/slides.php:47
238
+ #: views/SlideshowPluginPostType/slides.php:141
239
  msgid "Title"
240
  msgstr "Titel"
241
 
242
+ #: views/SlideshowPluginPostType/slides.php:48
243
+ #: views/SlideshowPluginPostType/slides.php:142
244
+ msgid "Description"
245
+ msgstr "Beschrijving"
246
+
247
+ #: views/SlideshowPluginPostType/slides.php:49
248
+ #: views/SlideshowPluginPostType/slides.php:143
249
+ msgid "Background color"
250
+ msgstr "Achtergrond kleur"
251
+
252
+ #: views/SlideshowPluginPostType/slides.php:55
253
+ #: views/SlideshowPluginPostType/slides.php:110
254
+ #: views/SlideshowPluginPostType/slides.php:149
255
+ #: views/SlideshowPluginPostType/slides.php:197
256
+ msgid "Same window"
257
+ msgstr "Zelfde scherm"
258
+
259
+ #: views/SlideshowPluginPostType/slides.php:56
260
+ #: views/SlideshowPluginPostType/slides.php:111
261
+ #: views/SlideshowPluginPostType/slides.php:150
262
+ #: views/SlideshowPluginPostType/slides.php:198
263
+ msgid "New window"
264
+ msgstr "Nieuw scherm"
265
+
266
+ #: views/SlideshowPluginPostType/slides.php:60
267
+ #: views/SlideshowPluginPostType/slides.php:115
268
+ #: views/SlideshowPluginPostType/slides.php:154
269
+ #: views/SlideshowPluginPostType/slides.php:202
270
+ msgid "URL"
271
+ msgstr "URL"
272
+
273
+ #: views/SlideshowPluginPostType/slides.php:76
274
+ #: views/SlideshowPluginPostType/slides.php:170
275
+ msgid "Youtube Video ID"
276
+ msgstr "Youtube Video ID"
277
+
278
+ #: views/SlideshowPluginPostType/slides.php:94
279
+ #: views/SlideshowPluginPostType/slides.php:101
280
+ msgid "Edit"
281
+ msgstr "Bewerken"
282
+
283
+ #: views/SlideshowPluginPostType/slides.php:126
284
+ msgid "An error occurred while loading this slide, and it will not be present in the slideshow"
285
+ msgstr "Een fout is ontstaan tijdens het laden van deze slide, de slide zal niet te bekijken zijn in je slideshow"
286
+
287
+ #: views/SlideshowPluginPostType/slides.php:131
288
+ #: views/SlideshowPluginPostType/slides.php:162
289
+ #: views/SlideshowPluginPostType/slides.php:177
290
+ #: views/SlideshowPluginPostType/slides.php:211
291
+ msgid "Delete slide"
292
+ msgstr "Verwijder slide"
293
+
294
+ #: views/SlideshowPluginPostType/support-plugin.php:3
295
+ msgid "Help to keep this plugin free!"
296
+ msgstr "Help mee om deze plugin gratis te houden!"
297
+
298
+ #: views/SlideshowPluginPostType/support-plugin.php:6
299
+ msgid "In order to keep you provided with the newest features, forum support, 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!"
300
+ msgstr "Om je te kunnen voorzien van de nieuwste functionaliteiten, forum ondersteuning en fout-oplossingen, is een hoop motivatie nodig. Daarom zou ik het enorm waarderen als je een kleine donatie aan de plugin zou willen doen, of de plugin 5 sterren zou willen geven op Wordpress.org. Alvast bedankt!"
301
+
302
+ #: views/SlideshowPluginPostType/support-plugin.php:15
303
+ msgid "Rate on Wordpress.org"
304
+ msgstr "Geef een waardering op Wordpress.org"
305
+
306
+ #: views/SlideshowPluginPostType/support-plugin.php:24
307
+ msgid "Questions / Suggestions"
308
+ msgstr "Vragen / Opmerkingen"
309
+
310
+ #: views/SlideshowPluginSlideInserter/insert-image-button.php:1
311
+ msgid "Image slide"
312
+ msgstr "Afbeeldingsslide"
313
+
314
+ #: views/SlideshowPluginSlideInserter/insert-text-button.php:1
315
+ msgid "Text slide"
316
+ msgstr "Tekst slide"
317
+
318
+ #: views/SlideshowPluginSlideInserter/insert-video-button.php:1
319
+ msgid "Video slide"
320
+ msgstr "Video slide"
321
+
322
+ #: views/SlideshowPluginSlideInserter/search-popup.php:6
323
+ msgid "Search"
324
+ msgstr "Zoek"
325
+
326
+ #: views/SlideshowPluginSlideInserter/search-popup.php:7
327
+ msgid "Search images by title"
328
+ msgstr "Zoek plaatjes op titel"
329
+
330
+ #: views/SlideshowPluginUpload/upload-button.php:1
331
+ msgid "Upload/Manage Images"
332
+ msgstr "Upload/Beheer Afbeeldingen"
333
+
334
+ #: views/SlideshowPluginWidget/form.php:9
335
  msgid "Random Slideshow"
336
  msgstr "Willekeurige Slideshow"
337
 
338
+ #~ msgid "Custom style editor (Does not work with a Strict Doctype)"
339
+ #~ msgstr "Aangepaste stijl bewerker (Werkt niet met een Strict Doctype)"
340
+
341
+ #~ msgid "Has the Slideshow plugin helped you?"
342
+ #~ msgstr "Heeft de Slideshow plugin je geholpen?"
343
+
344
+ #~ msgid "Help it back!"
345
+ #~ msgstr "Help hem terug!"
346
+
347
+ #~ msgid ""
348
+ #~ "If this plugin has filled you with happiness, please support the upkeep "
349
+ #~ "of the plugin by rating it on Wordpress, posting a suggestion for "
350
+ #~ "improvement on the support forum, or making a donation."
351
+ #~ msgstr ""
352
+ #~ "Als deze plugin je met blijdschap heeft vervuld, zou ik het enorm "
353
+ #~ "waarderen als je de plugin wilt beoordelen op Wordpress, een suggestie "
354
+ #~ "wilt maken voor verbetering, of een donatie doen wilt."
355
+
356
+ #~ msgid "Insert Text Slide"
357
+ #~ msgstr "Tekst-slide invoegen"
358
+
359
+ #~ msgid "Click on an image to insert it as a slide"
360
+ #~ msgstr "Klik op een plaatje om deze in te voegen als slide"
361
+
362
+ #~ msgid "Width of the slideshow"
363
+ #~ msgstr "Breedte van de slideshow"
364
+
365
+ #~ msgid "Defaults to parent's width."
366
+ #~ msgstr "Standaard ingesteld op de breedte van het bovenliggende element."
367
+
368
+ #~ msgid "Send user to image URL on click"
369
+ #~ msgstr ""
370
+ #~ "Wanner de gebruiker op de afbeelding klikt, stuur hem naar de URL van het "
371
+ #~ "plaatje"
372
+
373
+ #~ msgid "Style"
374
+ #~ msgstr "Style"
375
+
376
+ #~ msgid "Custom style"
377
+ #~ msgstr "Aangepaste stijl"
378
+
379
  #~ msgid "Leave any field open to use default value."
380
  #~ msgstr "Een veld dat open wordt gelaten neemt de standaardwaarde aan."
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Slideshow ===
2
 
3
  Contributors: stefanboonstra
4
- Tags: slideshow, slider, slide, images, image, photo, gallery, galleries
5
- Requires at least: 3.0
6
- Tested up to: 3.4.1
7
- Stable tag: 1.3.5
8
  License: GPLv2
9
 
10
  Integrate a fancy slideshow in just five steps. - Rainbows. Rainbows everywhere.
@@ -14,53 +14,137 @@ Integrate a fancy slideshow in just five steps. - Rainbows. Rainbows everywhere.
14
 
15
  Slideshow provides an easy way to integrate a slideshow for any Wordpress installation.
16
 
17
- Any sized image can be loaded into the slideshow using the upload button you're already familiar with from uploading
18
- images to your posts. Once uploaded, the images are shown in your slideshow straight away!
19
 
20
  Fancy doing something crazy? You can create and use as many slideshows as you'd like, with
21
  different images, settings and styles for each one of them.
22
 
23
- - Upload as many images as you like.
24
- - Place it anywhere on your website.
25
- - Customize it to taste.
26
- - Show that visitor who's boss.
27
 
28
- = Currently supported languages =
 
 
 
 
 
 
 
 
 
 
29
 
30
  - English
31
  - Dutch
32
 
 
33
  == Installation ==
34
 
35
  1. Install Slideshow either via the WordPress.org plugin directory, or by uploading the files to your server.
36
 
37
  2. After activating Slideshow, you can create a new slideshow.
38
 
39
- 3. Upload images to your newly created slideshow with the upload button in the slides list.
 
40
 
41
- 4. Use the shortcode or code snippet visible in your slideshow admin panel to deploy your slideshow anywhere on your website.
42
- You can also use the widget to show any of your slideshows in your sidebar.
43
 
44
  5. Feel like a sir.
45
 
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  == Screenshots ==
48
 
49
- 1. Create a new slideshow. A shortcode and a code snippet of how to call it is already visible.
50
 
51
- 2. Attach images to the slideshow with the upload button in the slides list.
52
 
53
- 3. The Wordpress media uploader will pop up and you can start uploading images to the slideshow.
54
 
55
- 4. The attached images are now visible in your newly created slideshow.
56
 
57
- 5. Using the shortcode or code snippet the slideshow shows you, you can enjoy your slides in style.
58
 
59
  6. Not satisfied with the handling or styling of the slideshow? Customize!
60
 
61
 
62
  == Changelog ==
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  = 1.3.5 =
65
  * Fixed: Namespace complications found with the Slideshow widget, renamed all classes.
66
 
1
  === Slideshow ===
2
 
3
  Contributors: stefanboonstra
4
+ Tags: slideshow, slider, slide, show, images, image, photo, gallery, galleries, jquery, javascript,
5
+ Requires at least: 3.3
6
+ Tested up to: 3.4.2
7
+ Stable tag: 2.1.4
8
  License: GPLv2
9
 
10
  Integrate a fancy slideshow in just five steps. - Rainbows. Rainbows everywhere.
14
 
15
  Slideshow provides an easy way to integrate a slideshow for any Wordpress installation.
16
 
17
+ Any image can be loaded into the slideshow by picking it from the Wordpress media page, even images you've already
18
+ uploaded can be inserted into your slideshow right away!
19
 
20
  Fancy doing something crazy? You can create and use as many slideshows as you'd like, with
21
  different images, settings and styles for each one of them.
22
 
23
+ = Features =
 
 
 
24
 
25
+ - Create as many slideshows with as many slides as you like
26
+ - Image slides
27
+ - Text slides
28
+ - Video slides
29
+ - Place it anywhere on your website
30
+ - Run multiple slideshows on the same page
31
+ - Change animations and handling
32
+ - Customize to taste
33
+ - Shows that visitor who's boss
34
+
35
+ = Languages =
36
 
37
  - English
38
  - Dutch
39
 
40
+
41
  == Installation ==
42
 
43
  1. Install Slideshow either via the WordPress.org plugin directory, or by uploading the files to your server.
44
 
45
  2. After activating Slideshow, you can create a new slideshow.
46
 
47
+ 3. Click on 'Insert Image Slide' to insert an image slide, a popup will appear where you can search for the desired
48
+ image. Insert the image by clicking 'Insert'
49
 
50
+ 4. Use the shortcode or code snippet visible in your slideshow admin panel to deploy your slideshow anywhere on your website,
51
+ or use the widget to show any of your slideshows in the sidebar of your website.
52
 
53
  5. Feel like a sir.
54
 
55
 
56
+ == Frequently Asked Questions ==
57
+
58
+ = How do I add image slides? =
59
+
60
+ You can choose from images that have already been uploaded to your Wordpress website by clicking on the
61
+ 'Insert Image Slide' button in the slides list. A screen will pop up and here you are able to search your image files
62
+ by name for image you want to use. If you want to add new images to the slideshow, you need to upload them to the
63
+ Wordpress media page.
64
+
65
+ = The slideshow does not show up (but it's html tags are in the source code) =
66
+
67
+ Often when images are not shown by the slideshow, there's a javascript error somewhere on the page and this error has
68
+ caused javascript to break. For the slideshow to work again, this error needs to be fixed. Check if any errors were
69
+ thrown by opening Google Chrome or Firefox (with Firebug installed) and press the 'F12' key. Errors show in the console tab.
70
+
71
+ = The slideshow does not show up / The slideshow looks like it's not styled =
72
+
73
+ Most times the slideshow is called after the '</head>' tag, which means the scripts need to load in the footer of
74
+ the website. A theme that has no '<?php wp_footer(); ?>' call in it's footer will not be able to load the slideshow's
75
+ scripts.
76
+
77
+ = I chose the 'Custom' style option for my slideshow, but the slideshow is not styled anymore =
78
+
79
+ Since the slideshow is most often called after the </head> tag, the slideshow can't print it's styles in the head of
80
+ the website and has to output it on the page. A strict doctype does not allow stylesheets in the body and thus the
81
+ slideshow is not styled.
82
+
83
+
84
  == Screenshots ==
85
 
86
+ 1. Here's what some default slideshows can look like. Sit back grab a beer, enjoy.
87
 
88
+ 2. Create a new slideshow. A shortcode and a code snippet of how to call it is already visible.
89
 
90
+ 3. Click the 'Insert Image Slide' button in the Slides List to search and pick images from the Wordpress media page.
91
 
92
+ 4. If you haven't uploaded any images yet, you can do so on the Wordpress media page.
93
 
94
+ 5. The images you selected are directly visible in your Slides List, don't forget to save!
95
 
96
  6. Not satisfied with the handling or styling of the slideshow? Customize!
97
 
98
 
99
  == Changelog ==
100
 
101
+ = 2.2.0 Pre-release =
102
+ * Slides can now be randomized.
103
+
104
+ = 2.1.4 =
105
+ * Fixed: Slideshows in posts are now longer broken by Wordpress inserted 'em' tags.
106
+ * Fixed: Image borders no longer fall off-slide.
107
+
108
+ = 2.1.3 =
109
+ * Fixed: Overflow container now adapts to its parent element correctly.
110
+ * Fixed: Internet Explorer now shows control panel (buttons etc.) on top of the Flash element.
111
+ * Fixed: Images are now loaded by the Wordpress function, rather than being loaded from the database's 'guid'.
112
+
113
+ = 2.1.2 =
114
+ * Wordpress media uploader link in image inserter pop-up now opens in a new window.
115
+ * Fixed: Image inserter pop-up CSS no longer pushes the 'insert' buttons off-screen.
116
+
117
+ = 2.1.1 =
118
+ * Fixed: Settings meta-box threw an unexpected 'T_ENDFOREACH' since a shorthand PHP tag was used improperly.
119
+
120
+ = 2.1.0 =
121
+ * Added Youtube video slides.
122
+ * Slide URLs can now be chosen to open in a new window.
123
+ * Added headers above settings, giving the user mover oversight.
124
+ * Endless scrolling is now available in the image inserter pop up.
125
+ * Images are now centered in their slides by default.
126
+ * Script is now activated on document ready, not window load.
127
+ * Hid slides in another element so that buttons could overflow the slideshow container.
128
+ * Fixed: Hide-away settings were influenced by their own settings fields.
129
+ * Fixed: Stretching was not always handled correctly.
130
+ * Fixed: Script counter made the first view show twice.
131
+
132
+ = 2.0.1 =
133
+ * Fixed: Version 1.x.x slides disappeared after updating to version 2.0.0. An automatic converter has been added.
134
+
135
+ = 2.0.0 =
136
+ * Complete sideshow script revision to support new features.
137
+ * The script now supports two kinds of animations: 'Slide' and 'Fade'.
138
+ * Multiple images can be shown in one slide, instead of one.
139
+ * Text slides are available.
140
+ * Descriptions are more cooperative, they don't overlap the entire image anymore. (Instead they hide or have a user-defined fixed height)
141
+ * Multiple slideshows can now be shown on one page.
142
+ * Play and pause buttons are now available, as is the option not to auto-play and/or loop the slideshow.
143
+ * Stylesheets no longer partially depend on the website's stylesheet, except for the fonts.
144
+ * The script and its functional stylesheet are now compressed to save loading time.
145
+ * Added jQuery sortables script to sort slides
146
+ * Images you've already uploaded and attached to other posts can now be loaded into the slideshow, saving disk space (and time).
147
+
148
  = 1.3.5 =
149
  * Fixed: Namespace complications found with the Slideshow widget, renamed all classes.
150
 
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png CHANGED
Binary file
screenshot-5.png CHANGED
Binary file
screenshot-6.png CHANGED
Binary file
slideshow.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  /*
3
  Plugin Name: Slideshow
4
- Plugin URI: http://stefanboonstra.com
5
- Description: This plugin offers a slideshow that is easily deployable in your website. Images can be assigned through the media page. Options are customizable for every single slideshow on your website.
6
- Version: 1.3.5
7
- Requires at least: 3.0
8
  Author: StefanBoonstra
9
  Author URI: http://stefanboonstra.com
10
  License: GPL
@@ -16,12 +16,12 @@
16
  * base path/url returning method.
17
  *
18
  * @author Stefan Boonstra
19
- * @version 03-07-12
20
  */
21
  class SlideshowPluginMain {
22
 
23
  /** Variables */
24
- static $version = '1.3.5';
25
 
26
  /**
27
  * Bootstraps the application by assigning the right functions to
@@ -33,7 +33,10 @@ class SlideshowPluginMain {
33
  // Initialize localization on init
34
  add_action('init', array(__CLASS__, 'localize'));
35
 
36
- // Deploy slide show on do_action('slideshow_deploy'); hook.
 
 
 
37
  add_action('slideshow_deploy', array('SlideshowPlugin', 'deploy'));
38
 
39
  // Add shortcode
@@ -45,11 +48,89 @@ class SlideshowPluginMain {
45
  // Register slideshow post type
46
  SlideshowPluginPostType::initialize();
47
 
 
 
 
48
  // Plugin feedback
49
  add_action('admin_head', array('SlideshowPluginFeedback', 'adminInitialize'));
50
  register_deactivation_hook(__FILE__, array('SlideshowPluginFeedback', 'deactivation'));
51
  }
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  /**
54
  * Translates the plugin
55
  */
1
  <?php
2
  /*
3
  Plugin Name: Slideshow
4
+ Plugin URI: http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/
5
+ Description: This plugin offers a slideshow that is easily deployable in your website. Add any image that has already been uploaded to add to your slideshow. Options and styles are customizable for every single slideshow on your website.
6
+ Version: 2.1.4
7
+ Requires at least: 3.3
8
  Author: StefanBoonstra
9
  Author URI: http://stefanboonstra.com
10
  License: GPL
16
  * base path/url returning method.
17
  *
18
  * @author Stefan Boonstra
19
+ * @version 16-09-12
20
  */
21
  class SlideshowPluginMain {
22
 
23
  /** Variables */
24
+ static $version = '2.1.4';
25
 
26
  /**
27
  * Bootstraps the application by assigning the right functions to
33
  // Initialize localization on init
34
  add_action('init', array(__CLASS__, 'localize'));
35
 
36
+ // For ajax requests
37
+ SlideshowPluginAjax::init();
38
+
39
+ // Deploy slideshow on do_action('slideshow_deploy'); hook.
40
  add_action('slideshow_deploy', array('SlideshowPlugin', 'deploy'));
41
 
42
  // Add shortcode
48
  // Register slideshow post type
49
  SlideshowPluginPostType::initialize();
50
 
51
+ // Transfers v1.x.x slides to the new slide format
52
+ register_activation_hook(__FILE__, array(__CLASS__, 'transferV1toV2'));
53
+
54
  // Plugin feedback
55
  add_action('admin_head', array('SlideshowPluginFeedback', 'adminInitialize'));
56
  register_deactivation_hook(__FILE__, array('SlideshowPluginFeedback', 'deactivation'));
57
  }
58
 
59
+ /**
60
+ * Transfers v1.x.x slides to the new slide format
61
+ */
62
+ static function transferV1toV2(){
63
+ // Check if this has already been done
64
+ if(get_option('slideshow-plugin-updated-from-v1-x-x-to-v2-0-1') !== false)
65
+ return;
66
+
67
+ // Get posts
68
+ $posts = get_posts(array(
69
+ 'numberposts' => -1,
70
+ 'offset' => 0,
71
+ 'post_type' => SlideshowPluginPostType::$postType
72
+ ));
73
+
74
+ // Loop through posts
75
+ foreach($posts as $post){
76
+
77
+ // Stores highest slide id.
78
+ $highestSlideId = -1;
79
+
80
+ // Get stored slide settings and convert them to array([slide-key] => array([setting-name] => [value]));
81
+ $slidesPreOrder = array();
82
+ $settings = SlideshowPluginPostType::getSettings($post->ID, SlideshowPluginPostType::$prefixes['slide-list'], true);
83
+ foreach($settings as $key => $value){
84
+ $key = explode('_', $key);
85
+ if(is_numeric($key[1]))
86
+ $slidesPreOrder[$key[1]][$key[2]] = $value;
87
+ }
88
+
89
+ // Save slide keys from the $slidePreOrder array in the array itself for later use
90
+ foreach($slidesPreOrder as $key => $value){
91
+ // Save highest slide id
92
+ if($key > $highestSlideId)
93
+ $highestSlideId = $key;
94
+ }
95
+
96
+ // Get defaults
97
+ $defaultData = SlideshowPluginPostType::getDefaultData(false);
98
+
99
+ // Get old data
100
+ $oldData = get_post_meta($post->ID, SlideshowPluginPostType::$settingsMetaKey, true);
101
+ if(!is_array(($oldData)))
102
+ $oldData = array();
103
+
104
+ // Get attachments
105
+ $attachments = get_posts(array(
106
+ 'numberposts' => -1,
107
+ 'offset' => 0,
108
+ 'post_type' => 'attachment',
109
+ 'post_parent' => $post->ID
110
+ ));
111
+
112
+ // Get data from attachments
113
+ $newData = array();
114
+ foreach($attachments as $attachment){
115
+ $highestSlideId++;
116
+ $newData['slide_' . $highestSlideId . '_postId'] = $attachment->ID;
117
+ $newData['slide_' . $highestSlideId . '_type'] = 'attachment';
118
+ }
119
+
120
+ // Save settings
121
+ update_post_meta(
122
+ $post->ID,
123
+ SlideshowPluginPostType::$settingsMetaKey,
124
+ array_merge(
125
+ $defaultData,
126
+ $oldData,
127
+ $newData
128
+ ));
129
+ }
130
+
131
+ update_option('slideshow-plugin-updated-from-v1-x-x-to-v2-0-1', 'updated');
132
+ }
133
+
134
  /**
135
  * Translates the plugin
136
  */
style/SlideshowPlugin/functional.css ADDED
@@ -0,0 +1 @@
 
1
+ .slideshow_container{position:relative}.slideshow_container .slideshow_overflow{position:relative;overflow:hidden}.slideshow_container .slideshow{height:100%;width:200%;overflow:hidden}.slideshow_container img{margin:0!important;padding:0!important;max-width:100%;max-height:100%;height:100%;border:0}.slideshow_container .slide{height:100%;float:left;overflow:hidden;text-align:center}.slideshow_container .transparent{zoom:1}.slideshow_container .transparent:hover{zoom:1}.slideshow_container .description{position:absolute;bottom:0;display:none;width:inherit}.slideshow_container .controlPanel{position:absolute;top:5px;left:50%;display:none}.slideshow_container .controlPanel ul{list-style:none;margin:0;padding:0}.slideshow_container .controlPanel ul li{float:left}.slideshow_container .controlPanel ul li:hover{cursor:pointer}.slideshow_container .button{position:absolute;top:50%;cursor:pointer;display:none}.slideshow_container .previous{left:5px}.slideshow_container .next{right:5px}
style/SlideshowPlugin/style-custom.css ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .slideshow_container { }
2
+
3
+ .slideshow_container .slideshow { }
4
+
5
+ .slideshow_container img { }
6
+
7
+ .slideshow_container .slide {
8
+ margin-right: 2px;
9
+ }
10
+
11
+ .slideshow_container .transparent {
12
+ filter: alpha(opacity = 50);
13
+ opacity: 0.5;
14
+ }
15
+
16
+ .slideshow_container .transparent:hover {
17
+ filter: alpha(opacity = 80);
18
+ opacity: 0.8;
19
+ }
20
+
21
+ .slideshow_container .description {
22
+ background: #000;
23
+ }
24
+
25
+ .slideshow_container .controlPanel {
26
+ width: 21px;
27
+ height: 21px;
28
+ background: #000;
29
+ border-radius: 2px;
30
+ -moz-border-radius: 10px;
31
+ }
32
+
33
+ .slideshow_container .controlPanel ul { }
34
+
35
+ .slideshow_container .controlPanel ul li {
36
+ margin: 3px;
37
+ width: 15px;
38
+ height: 15px;
39
+ }
40
+
41
+ .slideshow_container .controlPanel ul li:hover { }
42
+
43
+ .slideshow_container .play {
44
+ background: url('%plugin-url%/images/SlideshowPlugin/light-controlpanel.png') 0 0 no-repeat;
45
+ }
46
+
47
+ .slideshow_container .pause {
48
+ background: url('%plugin-url%/images/SlideshowPlugin/light-controlpanel.png') -15px 0 no-repeat;
49
+ }
50
+
51
+ .slideshow_container .button {
52
+ margin-top: -20px;
53
+ height: 40px;
54
+ width: 19px;
55
+ background: url('%plugin-url%/images/SlideshowPlugin/light-arrows.png') no-repeat;
56
+ }
57
+
58
+ .slideshow_container .previous { }
59
+
60
+ .slideshow_container .next {
61
+ background-position: -19px 0;
62
+ }
63
+
64
+ .slideshow_container a {
65
+ text-decoration: none;
66
+ color: #fff;
67
+ text-align: center;
68
+ }
69
+
70
+ .slideshow_container .description h2,
71
+ .slideshow_container .description p {
72
+ color: #fff;
73
+ }
74
+
75
+ .slideshow_container h2 {
76
+ margin: 5px;
77
+ font-size: 25px;
78
+ }
79
+
80
+ .slideshow_container p {
81
+ margin: 7px;
82
+ font-size: 15px;
83
+ }
style/SlideshowPlugin/style-dark.css CHANGED
@@ -1,66 +1,82 @@
1
- .slideshow_container { /** Contains all slideshow elements */
2
  background: #000;
3
  }
4
 
5
- .slideshow { /** Contains all slides */
6
- overflow: hidden;
 
 
 
 
7
  }
8
 
9
- .slideshow .slideshow_div { /** This is a slide */
10
- width: 0;
11
- overflow: hidden;
12
- float: left;
13
  }
14
 
15
- .slideshow_container .button { /** Style for both buttons */
16
- visibility: hidden;
17
- width: 24px;
18
- height: 100px;
19
- cursor: pointer;
20
-
21
- position: relative;
22
- z-index: 2;
23
  }
24
 
25
- .slideshow_container .next { /** Style for the 'next' button */
26
- float: right;
27
- background: url('../../images/button-next.png');
28
- margin-right: 10px;
29
  }
30
 
31
- .slideshow_container .previous { /** Style for the 'previous' button */
32
- float: left;
33
- background: url('../../images/button-previous.png');
34
- margin-left: 10px;
35
  }
36
 
37
- .slideshow_container .transparent { /** Items with this class are transparent */
38
- zoom: 1;
39
- filter: alpha(opacity = 50);
40
- opacity: 0.5;
 
 
41
  }
42
 
43
- .slideshow_container .transparent:hover { /** On hover over transparent items */
44
- zoom: 1;
45
- filter: alpha(opacity = 80);
46
- opacity: 0.8;
47
  }
48
 
49
- .slideshow_container .descriptionbox { /** Descriptionbox */
50
- background: #000;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  color: #fff;
52
- float: right;
53
- margin-top: 0;
54
- margin-right: 44px;
55
- height: 0;
56
- width: 300px;
57
- overflow: hidden;
58
-
59
- position: relative;
60
- z-index: 1;
 
 
61
  }
62
 
63
- .slideshow_container .descriptionbox h2,
64
- .slideshow_container .descriptionbox p { /** Text inside descriptionbox */
65
- padding: 10px;
66
  }
1
+ .slideshow_container {
2
  background: #000;
3
  }
4
 
5
+ .slideshow_container .slideshow { }
6
+
7
+ .slideshow_container img { }
8
+
9
+ .slideshow_container .slide {
10
+ margin-right: 2px;
11
  }
12
 
13
+ .slideshow_container .transparent {
14
+ filter: alpha(opacity = 50);
15
+ opacity: 0.5;
 
16
  }
17
 
18
+ .slideshow_container .transparent:hover {
19
+ filter: alpha(opacity = 80);
20
+ opacity: 0.8;
 
 
 
 
 
21
  }
22
 
23
+ .slideshow_container .description {
24
+ background: #000;
 
 
25
  }
26
 
27
+ .slideshow_container .controlPanel {
28
+ width: 20px;
29
+ height: 20px;
 
30
  }
31
 
32
+ .slideshow_container .controlPanel ul { }
33
+
34
+ .slideshow_container .controlPanel ul li {
35
+ margin: 3px;
36
+ width: 20px;
37
+ height: 20px;
38
  }
39
 
40
+ .slideshow_container .controlPanel ul li:hover { }
41
+
42
+ .slideshow_container .play {
43
+ background: url('../../images/SlideshowPlugin/dark-controlpanel.png') 0 0 no-repeat;
44
  }
45
 
46
+ .slideshow_container .pause {
47
+ background: url('../../images/SlideshowPlugin/dark-controlpanel.png') -20px 0 no-repeat;
48
+ }
49
+
50
+ .slideshow_container .button {
51
+ margin-top: -50px;
52
+ height: 100px;
53
+ width: 24px;
54
+ background: url('../../images/SlideshowPlugin/dark-arrows.png') no-repeat;
55
+ }
56
+
57
+ .slideshow_container .previous { }
58
+
59
+ .slideshow_container .next {
60
+ background-position: -24px 0;
61
+ }
62
+
63
+ .slideshow_container a {
64
+ text-decoration: none;
65
  color: #fff;
66
+ text-align: center;
67
+ }
68
+
69
+ .slideshow_container .description h2,
70
+ .slideshow_container .description p {
71
+ color: #fff;
72
+ }
73
+
74
+ .slideshow_container h2 {
75
+ margin: 5px;
76
+ font-size: 25px;
77
  }
78
 
79
+ .slideshow_container p {
80
+ margin: 7px;
81
+ font-size: 15px;
82
  }
style/SlideshowPlugin/style-light.css ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .slideshow_container { }
2
+
3
+ .slideshow_container .slideshow { }
4
+
5
+ .slideshow_container img { }
6
+
7
+ .slideshow_container .slide {
8
+ margin-right: 2px;
9
+ }
10
+
11
+ .slideshow_container .transparent {
12
+ filter: alpha(opacity = 50);
13
+ opacity: 0.5;
14
+ }
15
+
16
+ .slideshow_container .transparent:hover {
17
+ filter: alpha(opacity = 80);
18
+ opacity: 0.8;
19
+ }
20
+
21
+ .slideshow_container .description {
22
+ background: #000;
23
+ }
24
+
25
+ .slideshow_container .controlPanel {
26
+ width: 21px;
27
+ height: 21px;
28
+ background: #000;
29
+ border-radius: 2px;
30
+ -moz-border-radius: 10px;
31
+ }
32
+
33
+ .slideshow_container .controlPanel ul { }
34
+
35
+ .slideshow_container .controlPanel ul li {
36
+ margin: 3px;
37
+ width: 15px;
38
+ height: 15px;
39
+ }
40
+
41
+ .slideshow_container .controlPanel ul li:hover { }
42
+
43
+ .slideshow_container .play {
44
+ background: url('../../images/SlideshowPlugin/light-controlpanel.png') 0 0 no-repeat;
45
+ }
46
+
47
+ .slideshow_container .pause {
48
+ background: url('../../images/SlideshowPlugin/light-controlpanel.png') -15px 0 no-repeat;
49
+ }
50
+
51
+ .slideshow_container .button {
52
+ margin-top: -20px;
53
+ height: 40px;
54
+ width: 19px;
55
+ background: url('../../images/SlideshowPlugin/light-arrows.png') no-repeat;
56
+ }
57
+
58
+ .slideshow_container .previous { }
59
+
60
+ .slideshow_container .next {
61
+ background-position: -19px 0;
62
+ }
63
+
64
+ .slideshow_container h2,
65
+ .slideshow_container p,
66
+ .slideshow_container a {
67
+ text-decoration: none;
68
+ color: #fff;
69
+ text-align: center;
70
+ }
71
+
72
+ .slideshow_container h2 {
73
+ margin: 5px;
74
+ font-size: 25px;
75
+ }
76
+
77
+ .slideshow_container p {
78
+ margin: 7px;
79
+ font-size: 15px;
80
+ }
style/SlideshowPluginSlideInserter/slide-inserter.css ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #slideshow-slide-inserter-popup-background {
2
+ background: #000;
3
+ display: none;
4
+ position: absolute;
5
+ top: 0;
6
+ left: 0;
7
+ width: 100%;
8
+ z-index: 10000;
9
+
10
+ zoom: 1;
11
+ filter: alpha(opacity = 50);
12
+ opacity: 0.5;
13
+ }
14
+
15
+ #slideshow-slide-inserter-popup {
16
+ background: #fff;
17
+ display: none;
18
+ position: absolute;
19
+ padding: 20px;
20
+ line-height: 23px;
21
+ z-index: 10001;
22
+
23
+ width: 600px;
24
+ }
25
+
26
+ #slideshow-slide-inserter-popup #search {
27
+ float: left;
28
+ width: 200px;
29
+ }
30
+
31
+ #slideshow-slide-inserter-popup #close {
32
+ float: right;
33
+ width: 32px;
34
+ height: 32px;
35
+ background: url('../../images/SlideshowPluginSlideInserter/close.png') no-repeat;
36
+ }
37
+
38
+ #slideshow-slide-inserter-popup #close:hover {
39
+ cursor: pointer;
40
+ }
41
+
42
+ #slideshow-slide-inserter-popup #search-results {
43
+ height: 400px;
44
+ overflow-y: scroll;
45
+ }
46
+
47
+ .sortable-slides-list-item {
48
+ background: #fff url('../../images/SlideshowPluginPostType/draggable.png') no-repeat right center;
49
+ }
views/SlideshowPlugin/slideshow.php CHANGED
@@ -1,17 +1,125 @@
1
- <div class="slideshow_container">
2
- <div class="slideshow"></div>
3
- <div class="descriptionbox transparent"></div>
4
- <a class="button next transparent"></a>
5
- <a class="button previous transparent"></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  <script type="text/javascript">
8
- var slideshow_images = <?php echo json_encode($images); ?>;
9
- var slideshow_settings = <?php echo json_encode($settings); ?>;
 
 
10
  </script>
11
 
12
  <?php if(!empty($printStyle)): ?>
13
- <style type="text/css">
14
  <?php echo $printStyle; ?>
15
- </style>
16
  <?php endif; ?>
17
  </div>
1
+ <div class="slideshow_container slideshow_id_<?php echo $id; ?>" style="width: <?php echo (is_numeric($settings['width']))? $settings['width'] : 0; ?>px; height: <?php echo (is_numeric($settings['height']))? $settings['height'] : 0; ?>px;">
2
+ <div class="slideshow_overflow" style="width: <?php echo (is_numeric($settings['width']))? $settings['width'] : 0; ?>px; height: <?php echo (is_numeric($settings['height']))? $settings['height'] : 0; ?>px;">
3
+ <div class="slideshow">
4
+ <?php if(count($slides) > 0): ?>
5
+ <?php $i = 0; ?>
6
+ <?php foreach($slides as $slide): ?>
7
+
8
+ <?php
9
+ $url = $target = '';
10
+ if(isset($slide['url']))
11
+ $url = $slide['url'];
12
+ if(isset($slide['urlTarget']))
13
+ $target = $slide['urlTarget'];
14
+ ?>
15
+
16
+ <?php if($slide['type'] == 'text'): ?>
17
+
18
+ <?php
19
+ $title = $description = $color = '';
20
+ if(isset($slide['title']))
21
+ $title = $slide['title'];
22
+ if(isset($slide['description']))
23
+ $description = $slide['description'];
24
+ if(isset($slide['color']))
25
+ $color = $slide['color'];
26
+ ?>
27
+
28
+ <div class="slide slide_<?php echo $i; ?>" <?php if(!empty($color)) echo 'style="background: #' . $color . ';"'; ?>>
29
+ <a <?php if(!empty($url)) echo 'href="' . $url . '"';?> <?php if(!empty($target)) echo 'target="' . $target . '"'; ?>>
30
+ <h2><?php echo $title; ?></h2>
31
+ <p><?php echo $description; ?></p>
32
+ </a>
33
+ </div>
34
+
35
+ <?php elseif($slide['type'] == 'video'): ?>
36
+
37
+ <?php
38
+ $videoId = '';
39
+ if(isset($slide['videoId']))
40
+ $videoId = $slide['videoId'];
41
+
42
+ $elementVideoId = 'youtube-player-' . rand() . '-' . $videoId;
43
+ ?>
44
+
45
+ <div class="slide slide_<?php echo $i; ?> slide_video">
46
+ <div class="videoId" style="display: none;"><?php echo $videoId; ?> <?php echo $elementVideoId; ?></div>
47
+ <div id="<?php echo $elementVideoId; ?>"></div>
48
+ </div>
49
+
50
+ <?php elseif($slide['type'] == 'attachment'): ?>
51
+
52
+ <?php
53
+ $postId = '';
54
+ if(isset($slide['postId']) && is_numeric($slide['postId']))
55
+ $postId = $slide['postId'];
56
+ else
57
+ continue;
58
+
59
+ $attachment = get_post($postId);
60
+ if(empty($attachment))
61
+ continue;
62
+
63
+ $image = wp_get_attachment_image_src($attachment->ID, 'full');
64
+ if(!is_array($image) || !$image) continue;
65
+ ?>
66
+
67
+ <div class="slide slide_<?php echo $i; ?>">
68
+ <div class="description transparent">
69
+ <a <?php if(!empty($url)) echo 'href="' . $url . '"'; ?> <?php if(!empty($target)) echo 'target="' . $target . '"'; ?>>
70
+ <h2><?php echo $attachment->post_title; ?></h2>
71
+ <p><?php echo $attachment->post_content; ?></p>
72
+ </a>
73
+ </div>
74
+ <a <?php if(!empty($url)) echo 'href="' . $url . '"'; ?> <?php if(!empty($target)) echo 'target="' . $target . '"'; ?>>
75
+ <img
76
+ src="<?php echo $image[0]; ?>"
77
+ alt="<?php echo $attachment->post_title; ?>"
78
+ />
79
+ </a>
80
+ </div>
81
+
82
+ <?php endif; ?>
83
+ <?php $i++; ?>
84
+ <?php endforeach; ?>
85
+ <?php endif; ?>
86
+ </div>
87
+ </div>
88
+
89
+ <div class="controllers">
90
+ <div class="controlPanel transparent"><ul><li class="togglePlay play"></li></ul></div>
91
+
92
+ <div class="button previous transparent"></div>
93
+ <div class="button next transparent"></div>
94
+ </div>
95
+
96
+ <div class="settings" style="display: none;"><?php echo json_encode($settings); ?></div>
97
+
98
+ <div style="
99
+ position: absolute !important;
100
+ height: 1px;
101
+ width: 1px;
102
+ overflow: hidden;
103
+ clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
104
+ clip: rect(1px, 1px, 1px, 1px);
105
+ ">
106
+ <a href="http://www.stefanboonstra.com/">Slideshow Stefan Boonstra</a>
107
+ </div>
108
+
109
+ <div style="display: none;">
110
+ <?php echo SlideshowPluginMain::$version; ?>
111
+ </div>
112
 
113
  <script type="text/javascript">
114
+ jQuery(document).ready(function(){
115
+ //jQuery(window).load(function(){
116
+ jQuery('.slideshow_id_<?php echo $id; ?>').slideshow_script();
117
+ });
118
  </script>
119
 
120
  <?php if(!empty($printStyle)): ?>
121
+ <style type="text/css">
122
  <?php echo $printStyle; ?>
123
+ </style>
124
  <?php endif; ?>
125
  </div>
views/SlideshowPluginPostType/information.php CHANGED
@@ -1,10 +1,4 @@
1
- <p>
2
- <?php echo sprintf(
3
- '<p>' . __('To use this slideshow in your website either add this piece of shortcode to your posts or pages', 'slideshow-plugin') . ':</p>
4
- <p><i>%s<i></p>
5
- <p>' . __('Or add this piece of code to where ever in your website you want to place the slideshow', 'slideshow-plugin') . ':</p>
6
- <p><i>%s</i></p>',
7
- $shortCode,
8
- $snippet
9
- ); ?>
10
- </p>
1
+ <p><?php _e('To use this slideshow in your website either add this piece of shortcode to your posts or pages', 'slideshow-plugin'); ?>:</p>
2
+ <p><i><?php echo $shortCode; ?><i></p>
3
+ <p><?php _e('Or add this piece of code to where ever in your website you want to place the slideshow', 'slideshow-plugin'); ?>:</p>
4
+ <p><i><?php echo $snippet; ?></i></p>
 
 
 
 
 
 
views/SlideshowPluginPostType/settings.php CHANGED
@@ -1,59 +1,25 @@
1
- <table border="0">
2
- <tr>
3
- <td><?php _e('Number of seconds the slide takes to slide in', 'slideshow-plugin'); ?></td>
4
- <td><input type="text" name="slideSpeed" value="<?php echo $settings['slideSpeed']; ?>" size="5" /></td>
5
- <td><i><?php _e('Default', 'slideshow-plugin'); ?>: <?php echo $defaultSettings['slideSpeed'] ?></i></td>
6
- </tr>
7
- <tr>
8
- <td><?php _e('Number of seconds the description takes to slide in', 'slideshow-plugin'); ?></td>
9
- <td><input type="text" name="descriptionSpeed" value="<?php echo $settings['descriptionSpeed']; ?>" size="5" /></td>
10
- <td><i><?php _e('Default', 'slideshow-plugin'); ?>: <?php echo $defaultSettings['descriptionSpeed'] ?></i></td>
11
- </tr>
12
- <tr>
13
- <td><?php _e('Seconds between changing slides', 'slideshow-plugin'); ?></td>
14
- <td><input type="text" name="intervalSpeed" value="<?php echo $settings['intervalSpeed']; ?>" size="5" /></td>
15
- <td><i><?php _e('Default', 'slideshow-plugin'); ?>: <?php echo $defaultSettings['intervalSpeed'] ?></i></td>
16
- </tr>
17
- <tr>
18
- <td><?php _e('Width of the slideshow', 'slideshow-plugin'); ?></td>
19
- <td><input type="text" name="width" value="<?php echo $settings['width']; ?>" size="5" /></td>
20
- <td><i><?php _e('Default', 'slideshow-plugin'); ?>: <?php echo $defaultSettings['width'] ?> - <?php _e('Defaults to parent\'s width.', 'slideshow-plugin'); ?></i></td>
21
- </tr>
22
- <tr>
23
- <td><?php _e('Height of the slideshow', 'slideshow-plugin'); ?></td>
24
- <td><input type="text" name="height" value="<?php echo $settings['height']; ?>" size="5" /></td>
25
- <td><i><?php _e('Default', 'slideshow-plugin'); ?>: <?php echo $defaultSettings['height'] ?></i></td>
26
- </tr>
27
- <tr>
28
- <td><?php _e('Fit image into slideshow (stretching it)', 'slideshow-plugin'); ?></td>
29
- <td>
30
- <label><input type="radio" name="stretch" value="true" <?php checked($settings['stretch'], 'true'); ?> /> <?php _e('Yes', 'slideshow-plugin'); ?></label><br />
31
- <label><input type="radio" name="stretch" value="false" <?php checked($settings['stretch'], 'false'); ?> /> <?php _e('No', 'slideshow-plugin'); ?></label>
32
- </td>
33
- <td><i><?php _e('Default', 'slideshow-plugin'); ?>: <?php if($defaultSettings['stretch'] == 'true') _e('Yes', 'slideshow-plugin'); else _e('No', 'slideshow-plugin'); ?></i></td>
34
- </tr>
35
- <tr>
36
- <td><?php _e('Activate buttons (so the user can scroll through the slides)', 'slideshow-plugin'); ?></td>
37
- <td>
38
- <label><input type="radio" name="controllable" value="true" <?php checked($settings['controllable'], 'true'); ?> /> <?php _e('Yes', 'slideshow-plugin'); ?></label><br />
39
- <label><input type="radio" name="controllable" value="false" <?php checked($settings['controllable'], 'false'); ?> /> <?php _e('No', 'slideshow-plugin'); ?></label>
40
- </td>
41
- <td><i><?php _e('Default', 'slideshow-plugin'); ?>: <?php if($defaultSettings['controllable'] == 'true') _e('Yes', 'slideshow-plugin'); else _e('No', 'slideshow-plugin'); ?></i></td>
42
- </tr>
43
- <tr>
44
- <td><?php _e('Send user to image URL on click', 'slideshow-plugin'); ?></td>
45
- <td>
46
- <label><input type="radio" name="urlsActive" value="true" <?php checked($settings['urlsActive'], 'true'); ?> /> <?php _e('Yes', 'slideshow-plugin'); ?></label><br />
47
- <label><input type="radio" name="urlsActive" value="false" <?php checked($settings['urlsActive'], 'false'); ?> /> <?php _e('No', 'slideshow-plugin'); ?></label>
48
- </td>
49
- <td><i><?php _e('Default', 'slideshow-plugin'); ?>: <?php if($defaultSettings['urlsActive'] == 'true') _e('Yes', 'slideshow-plugin'); else _e('No', 'slideshow-plugin'); ?></i></td>
50
- </tr>
51
- <tr>
52
- <td><?php _e('Show title and description', 'slideshow-plugin'); ?></td>
53
- <td>
54
- <label><input type="radio" name="showText" value="true" <?php checked($settings['showText'], 'true'); ?> /> <?php _e('Yes', 'slideshow-plugin'); ?></label><br />
55
- <label><input type="radio" name="showText" value="false" <?php checked($settings['showText'], 'false'); ?> /> <?php _e('No', 'slideshow-plugin'); ?></label>
56
- </td>
57
- <td><i><?php _e('Default', 'slideshow-plugin'); ?>: <?php if($defaultSettings['showText'] == 'true') _e('Yes', 'slideshow-plugin'); else _e('No', 'slideshow-plugin'); ?></i></td>
58
- </tr>
59
  </table>
1
+ <table>
2
+ <?php $groups = array(); ?>
3
+ <?php foreach($settings as $key => $value): ?>
4
+ <?php if(!empty($value['group']) && !isset($groups[$value['group']])): $groups[$value['group']] = true; ?>
5
+ <tr>
6
+ <td colspan="3" style="border-bottom: 1px solid #dfdfdf; text-align: center;">
7
+ <span style="display: inline-block; position: relative; top: 9px; padding: 0 12px; background: #f8f8f8;">
8
+ <?php echo $value['group']; ?> <?php _e('settings', 'slideshow-plugin'); ?>
9
+ </span>
10
+ </td>
11
+ </tr>
12
+ <tr>
13
+ <td colspan="3"></td>
14
+ </tr>
15
+ <?php endif; ?>
16
+ <tr
17
+ <?php echo !empty($value['group'])? 'class="group-' . strtolower(str_replace(' ', '-', $value['group'])) . '"': ''; ?>
18
+ <?php echo !empty($value[5])? 'style="display:none;"': ''; ?>
19
+ >
20
+ <td><?php echo $value[3]; ?></td>
21
+ <td><?php echo $inputFields[$key]; ?></td>
22
+ <td><?php _e('Default', 'slideshow-plugin'); ?>: &#39;<?php echo (isset($value[4]))? $value[4][$value[2]]: $value[2]; ?>&#39;</td>
23
+ </tr>
24
+ <?php endforeach; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  </table>
views/SlideshowPluginPostType/slides.php CHANGED
@@ -1,45 +1,214 @@
1
- <p><?php echo $uploadButton; ?></p>
2
-
3
- <?php if(count($attachments) <= 0): ?>
4
- <p><?php _e('Add slides to this slideshow by using the button above or attaching images from the media page.', 'slideshow-plugin'); ?></p>
5
-
6
- <?php else: ?>
7
- <table class="wp-list-table widefat fixed media" cellspacing="0">
8
- <tbody id="the-list">
9
-
10
- <?php foreach($attachments as $attachment):?>
11
- <?php $editUrl = admin_url() . '/media.php?attachment_id=' . $attachment->ID . '&amp;action=edit'; ?>
12
- <?php $image = wp_get_attachment_image_src($attachment->ID); ?>
13
- <?php if(!$image[3]) $image[0] = $noPreviewIcon; ?>
14
-
15
- <tr id="post-<?php echo $attachment->ID; ?>" class="alternate author-self status-inherit" valign="top">
16
-
17
- <td class="column-icon media-icon">
18
- <a href="<?php echo $editUrl; ?>" title="Edit &#34;<?php echo $attachment->post_title; ?>&#34;">
19
- <img
20
- width="80"
21
- height="60"
22
- src="<?php echo $image[0]; ?>"
23
- class="attachment-80x60"
24
- alt="<?php echo $attachment->post_title; ?>"
25
- title="<?php echo $attachment->post_title; ?>"
26
- />
27
- </a>
28
- </td>
29
-
30
- <td class="title column-title">
31
- <strong>
32
- <a href="<?php echo $editUrl; ?>" title="Edit &#34;<?php echo $attachment->post_title; ?>&#34;"><?php echo $attachment->post_title; ?></a>
33
- </strong>
34
-
35
- <p>
36
- <?php echo $attachment->post_content; ?>
37
- </p>
38
- </td>
39
- </tr>
40
-
41
- <?php endforeach; ?>
42
-
43
- </tbody>
44
- </table>
45
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p style="text-align: center;">
2
+ <i>Insert:</i><br/>
3
+ <?php echo SlideshowPluginSlideInserter::getImageSlideInsertButton(); ?>
4
+ <?php echo SlideshowPluginSlideInserter::getTextSlideInsertButton(); ?>
5
+ <?php echo SlideshowPluginSlideInserter::getVideoSlideInsertButton(); ?>
6
+ </p>
7
+
8
+ <?php if(count($slides) <= 0): ?>
9
+ <p><?php _e('Add slides to this slideshow by using one of the buttons above.', 'slideshow-plugin'); ?></p>
10
+ <?php endif; ?>
11
+
12
+ <style type="text/css">
13
+ .sortable li {
14
+ cursor: pointer;
15
+ }
16
+ </style>
17
+ <script type="text/javascript">
18
+ var slideshowHighestSlideId = <?php echo $highestSlideId; ?>
19
+ </script>
20
+
21
+ <ul class="sortable-slides-list">
22
+ <?php foreach($slides as $key => $slide):
23
+ // General values
24
+ $id = $url = $order = '';
25
+ if(isset($slide['id']))
26
+ $id = $slide['id'];
27
+ if(isset($slide['url']))
28
+ $url = $slide['url'];
29
+ if(isset($slide['order']))
30
+ $order = $slide['order'];
31
+ ?>
32
+
33
+ <li class="widefat sortable-slides-list-item">
34
+ <?php if($slide['type'] == 'text'):
35
+
36
+ // Type specific values
37
+ $title = $description = $color = '';
38
+ if(isset($slide['title']))
39
+ $title = $slide['title'];
40
+ if(isset($slide['description']))
41
+ $description = $slide['description'];
42
+ if(isset($slide['color']))
43
+ $color = $slide['color'];
44
+ ?>
45
+
46
+ <p style="padding: 0 5px;">
47
+ <input type="text" name="slide_<?php echo $id; ?>_title" value="<?php echo $title; ?>" /><i><?php _e('Title', 'slideshow-plugin'); ?></i><br />
48
+ <input type="text" name="slide_<?php echo $id; ?>_description" value="<?php echo $description; ?>" /><i><?php _e('Description', 'slideshow-plugin'); ?></i><br />
49
+ <input type="text" name="slide_<?php echo $id; ?>_color" value="<?php echo $color; ?>" class="color" /><i><?php _e('Background color', 'slideshow-plugin'); ?></i><br />
50
+ </p>
51
+
52
+ <p style="float: left; padding: 0 5px;">
53
+ <input type="text" name="slide_<?php echo $id; ?>_url" value="<?php echo $url; ?>" /><br />
54
+ <select name="slide_<?php echo $id; ?>_urlTarget">
55
+ <option value="_self" <?php selected('_self', $slide['urlTarget']); ?>><?php _e('Same window', 'slideshow-plugin'); ?></option>
56
+ <option value="_blank" <?php selected('_blank', $slide['urlTarget']); ?>><?php _e('New window', 'slideshow-plugin'); ?></option>
57
+ </select>
58
+ </p>
59
+ <p style="float: left; line-height: 50px;">
60
+ <i><?php _e('URL', 'slideshow-plugin'); ?></i>
61
+ </p>
62
+ <p style="clear: both;"></p>
63
+
64
+ <input type="hidden" name="slide_<?php echo $id; ?>_type" value="text" />
65
+ <input type="hidden" name="slide_<?php echo $id; ?>_order" value="<?php echo $order; ?>" class="slide_order" />
66
+
67
+ <?php elseif($slide['type'] == 'video'):
68
+
69
+ // Type specific values
70
+ $videoId = '';
71
+ if(isset($slide['videoId']))
72
+ $videoId = $slide['videoId'];
73
+ ?>
74
+
75
+ <p style="padding: 0 5px;">
76
+ <input type="text" name="slide_<?php echo $id; ?>_videoId" value="<?php echo $videoId; ?>" /><i><?php _e('Youtube Video ID', 'slideshow-plugin'); ?></i>
77
+ </p>
78
+
79
+ <input type="hidden" name="slide_<?php echo $id; ?>_type" value="video" />
80
+ <input type="hidden" name="slide_<?php echo $id; ?>_order" value="<?php echo $order; ?>" class="slide_order" />
81
+
82
+ <?php elseif($slide['type'] == 'attachment'):
83
+
84
+ // The attachment should always be there
85
+ $attachment = get_post($slide['postId']);
86
+ if(!isset($attachment))
87
+ continue;
88
+
89
+ $editUrl = admin_url() . '/media.php?attachment_id=' . $attachment->ID . '&amp;action=edit';
90
+ $image = wp_get_attachment_image_src($attachment->ID);
91
+ if(!$image[3]) $image[0] = $noPreviewIcon; ?>
92
+
93
+ <p style="float: left; padding: 0 5px;">
94
+ <a href="<?php echo $editUrl; ?>" title="<?php _e('Edit', 'slideshow-plugin'); ?> &#34;<?php echo $attachment->post_title; ?>&#34;">
95
+ <img width="80" height="60" src="<?php echo $image[0]; ?>" class="attachment-80x60" alt="<?php echo $attachment->post_title; ?>" title="<?php echo $attachment->post_title; ?>" />
96
+ </a>
97
+ </p>
98
+
99
+ <p style="float: left; padding: 0 5px;">
100
+ <strong>
101
+ <a href="<?php echo $editUrl; ?>" title="<?php _e('Edit', 'slideshow-plugin'); ?> &#34;<?php echo $attachment->post_title; ?>&#34;"><?php echo $attachment->post_title; ?></a>
102
+ </strong><br />
103
+ <?php if(strlen($attachment->post_content) > 30) echo substr($attachment->post_content, 0, 20) . '...'; else echo $attachment->post_content; ?>
104
+ </p>
105
+ <p style="clear: both"></p>
106
+
107
+ <p style="float: left; padding: 0 5px;">
108
+ <input type="text" name="slide_<?php echo $id; ?>_url" value="<?php echo $url; ?>" /><br />
109
+ <select name="slide_<?php echo $id; ?>_urlTarget">
110
+ <option value="_self" <?php selected('_self', $slide['urlTarget']); ?>><?php _e('Same window', 'slideshow-plugin'); ?></option>
111
+ <option value="_blank" <?php selected('_blank', $slide['urlTarget']); ?>><?php _e('New window', 'slideshow-plugin'); ?></option>
112
+ </select>
113
+ </p>
114
+ <p style="float: left; line-height: 50px;">
115
+ <i><?php _e('URL', 'slideshow-plugin'); ?></i>
116
+ </p>
117
+ <p style="clear: both;"></p>
118
+
119
+ <input type="hidden" name="slide_<?php echo $id; ?>_type" value="attachment" />
120
+ <input type="hidden" name="slide_<?php echo $id; ?>_postId" value="<?php echo $attachment->ID; ?>" />
121
+ <input type="hidden" name="slide_<?php echo $id; ?>_order" value="<?php echo $order; ?>" class="slide_order" />
122
+
123
+ <?php else: ?>
124
+
125
+ <p style="padding: 0 5px;">
126
+ <?php _e('An error occurred while loading this slide, and it will not be present in the slideshow', 'slideshow-plugin'); ?>
127
+ </p>
128
+
129
+ <?php endif; ?>
130
+ <p style="padding: 0 5px; color: red; cursor: pointer;" class="slideshow-delete-slide">
131
+ <?php _e('Delete slide', 'slideshow-plugin'); ?>
132
+ <span style="display: none;" class="<?php echo $id; ?>"></span>
133
+ </p>
134
+ </li>
135
+ <?php endforeach; ?>
136
+ </ul>
137
+
138
+ <div class="text-slide-template" style="display: none;">
139
+ <li class="widefat sortable-slides-list-item">
140
+ <p style="padding: 0 5px;">
141
+ <input type="text" class="title" /><i><?php _e('Title', 'slideshow-plugin'); ?></i><br />
142
+ <input type="text" class="description" /><i><?php _e('Description', 'slideshow-plugin'); ?></i><br />
143
+ <input type="text" class="color" /><i><?php _e('Background color', 'slideshow-plugin'); ?></i><br />
144
+ </p>
145
+
146
+ <p style="float: left; padding: 0 5px;">
147
+ <input type="text" class="url" value="" /><br />
148
+ <select class="urlTarget">
149
+ <option value="_self"><?php _e('Same window', 'slideshow-plugin'); ?></option>
150
+ <option value="_blank"><?php _e('New window', 'slideshow-plugin'); ?></option>
151
+ </select>
152
+ </p>
153
+ <p style="float: left; line-height: 50px;">
154
+ <i><?php _e('URL', 'slideshow-plugin'); ?></i>
155
+ </p>
156
+ <p style="clear: both"></p>
157
+
158
+ <input type="hidden" class="type" value="text" />
159
+ <input type="hidden" class="slide_order" />
160
+
161
+ <p style="padding: 0 5px; color: red; cursor: pointer;" class="slideshow-delete-new-slide">
162
+ <?php _e('Delete slide', 'slideshow-plugin'); ?>
163
+ </p>
164
+ </li>
165
+ </div>
166
+
167
+ <div class="video-slide-template" style="display: none;">
168
+ <li class="widefat sortable-slides-list-item">
169
+ <p style="padding: 0 5px;">
170
+ <input type="text" class="videoId" /><i><?php _e('Youtube Video ID', 'slideshow-plugin'); ?></i>
171
+ </p>
172
+
173
+ <input type="hidden" class="type" value="video" />
174
+ <input type="hidden" class="slide_order" />
175
+
176
+ <p style="padding: 0 5px; color: red; cursor: pointer;" class="slideshow-delete-new-slide">
177
+ <?php _e('Delete slide', 'slideshow-plugin'); ?>
178
+ </p>
179
+ </li>
180
+ </div>
181
+
182
+ <div class="image-slide-template" style="display: none;">
183
+ <li class="widefat sortable-slides-list-item">
184
+ <p style="float: left; padding: 0 5px;">
185
+ <img width="80" height="60" src="" class="attachment attachment-80x60" alt="" title="" />
186
+ </p>
187
+
188
+ <p style="float: left; padding: 0 5px;">
189
+ <strong class="title"></strong><br />
190
+ <span class="description"></span>
191
+ </p>
192
+ <p style="clear: both"></p>
193
+
194
+ <p style="float: left; padding: 0 5px;">
195
+ <input type="text" class="url" value="" /><br />
196
+ <select class="urlTarget">
197
+ <option value="_self"><?php _e('Same window', 'slideshow-plugin'); ?></option>
198
+ <option value="_blank"><?php _e('New window', 'slideshow-plugin'); ?></option>
199
+ </select>
200
+ </p>
201
+ <p style="float: left; line-height: 50px;"
202
+ <i><?php _e('URL', 'slideshow-plugin'); ?></i>
203
+ </p>
204
+ <p style="clear: both"></p>
205
+
206
+ <input type="hidden" class="type" value="attachment" />
207
+ <input type="hidden" class="postId" value="" />
208
+ <input type="hidden" value="" class="slide_order" />
209
+
210
+ <p style="padding: 0 5px; color: red; cursor: pointer;" class="slideshow-delete-new-slide">
211
+ <?php _e('Delete slide', 'slideshow-plugin'); ?>
212
+ </p>
213
+ </li>
214
+ </div>
views/SlideshowPluginPostType/style-settings.php CHANGED
@@ -1,32 +1,9 @@
1
- <table border="0">
2
- <tr>
3
- <td><?php _e('Style', 'slideshow-plugin'); ?></td>
4
- <td>
5
- <select class="style-list" name="style">
6
- <?php foreach($styles as $key => $name): ?>
7
- <option value="<?php echo $key; ?>" <?php selected($settings['style'], $key); ?>><?php echo $name; ?></option>
8
- <?php endforeach; ?>
9
- <option value="custom-style" <?php selected($settings['style'], 'custom-style'); ?>><?php _e('Custom Style', 'slideshow-plugin') ?></option>
10
- </select>
11
- </td>
12
- <td><i><?php _e('The style used for this slideshow', 'slideshow-plugin'); ?></i></td>
13
- </tr>
14
- </table>
15
-
16
- <table border="0" class="custom-style">
17
- <tr>
18
- <td><strong><?php _e('Custom Style Editor', 'slideshow-plugin'); ?></strong></td>
19
- <td></td>
20
- </tr>
21
- <tr>
22
- <td><?php _e('Custom style', 'slideshow-plugin'); ?></td>
23
- <td><textarea rows="20" cols="60" class="custom-style-textarea" name="custom-style"><?php echo $settings['custom-style']; ?></textarea></td>
24
- <input type="hidden" class="custom-style-default-css-url" value="<?php ?>" />
25
- </tr>
26
- </table>
27
-
28
- <style type="text/css">
29
- .custom-style{
30
- display: none;
31
- }
32
- </style>
1
+ <table>
2
+ <?php foreach($settings as $key => $value): ?>
3
+ <tr <?php if(!empty($value[5])) echo 'style="display:none;"'; ?>>
4
+ <td><?php echo $value[3]; ?></td>
5
+ <td><?php echo $inputFields[$key]; ?></td>
6
+ <td><?php _e('Default', 'slideshow-plugin'); ?>: &#39;<?php echo $value[2]; ?>&#39;</td>
7
+ </tr>
8
+ <?php endforeach; ?>
9
+ </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/SlideshowPluginPostType/support-plugin.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="updated" style="background: #f7f7f7; border-color: #dfdfdf;">
2
+ <div style="float: left; width: 50%;">
3
+ <h3><?php _e('Help to keep this plugin free!', 'slideshow-plugin'); ?></h3>
4
+
5
+ <p>
6
+ <?php _e('In order to keep you provided with the newest features, forum support, 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-plugin'); ?>
7
+ </p>
8
+ </div>
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-plugin'); ?>"
16
+ onclick="window.open('http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/')"
17
+ />
18
+ </p>
19
+
20
+ <p>
21
+ <input
22
+ type="button"
23
+ class="button-secondary"
24
+ value="<?php _e('Questions / Suggestions', 'slideshow-plugin'); ?>"
25
+ onclick="window.open('http://wordpress.org/support/plugin/slideshow-jquery-image-gallery/')"
26
+ />
27
+ </p>
28
+
29
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
30
+ <input type="hidden" name="cmd" value="_s-xclick" />
31
+ <input type="hidden" name="hosted_button_id" value="VWHWA99RBJZW8" />
32
+ <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." />
33
+ <img alt="" border="0" src="https://www.paypalobjects.com/nl_NL/i/scr/pixel.gif" width="1" height="1" />
34
+ </form>
35
+ </div>
36
+
37
+ <div style="clear: both;"></div>
38
+ </div>
views/SlideshowPluginSlideInserter/insert-image-button.php ADDED
@@ -0,0 +1 @@
 
1
+ <input type="button" id="slideshow-insert-image-slide" class="button" value="<?php _e('Image slide', 'slideshow-plugin'); ?>" />
views/SlideshowPluginSlideInserter/insert-text-button.php ADDED
@@ -0,0 +1 @@
 
1
+ <input type="button" id="slideshow-insert-text-slide" class="button" value="<?php _e('Text slide', 'slideshow-plugin'); ?>" />
views/SlideshowPluginSlideInserter/insert-video-button.php ADDED
@@ -0,0 +1 @@
 
1
+ <input type="button" id="slideshow-insert-video-slide" class="button" value="<?php _e('Video slide', 'slideshow-plugin'); ?>" />
views/SlideshowPluginSlideInserter/search-popup.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-plugin'), 'primary', 'search-submit', false); ?>
7
+ <i><?php _e('Search images by title'); ?></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/SlideshowPluginWidget/widget.php CHANGED
@@ -1,2 +1,4 @@
1
- <h3 class="widget-title"><?php echo $title; ?></h3>
2
- <?php echo $output; ?>
 
 
1
+ <aside class="widget">
2
+ <h3 class="widget-title"><?php echo $title; ?></h3>
3
+ <?php echo $output; ?>
4
+ </aside>