Easy FancyBox - Version 1.5.0

Version Description

Many new options. Speed improvements: stylesheet browser caching, metadata.js compression. Security fix. Dutch, Indonesian and Polish translations.

=

Download this release

Release Info

Developer RavanH
Plugin Icon 128x128 Easy FancyBox
Version 1.5.0
Comparing to
See all releases

Code changes from version 1.3.4.8 to 1.5.0

easy-fancybox-admin.php ADDED
File without changes
easy-fancybox-class.php ADDED
@@ -0,0 +1,628 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Easy FancyBox Class
4
+ */
5
+ class easyFancyBox {
6
+
7
+ public static $pagehook;
8
+
9
+ public static $add_scripts = false;
10
+
11
+ public static $options = array();
12
+
13
+
14
+ /**********************
15
+ MAIN SCRIPT OUTPUT
16
+ **********************/
17
+
18
+ function main_script() {
19
+
20
+ echo '
21
+ <!-- Easy FancyBox ' . EASY_FANCYBOX_VERSION . ' using FancyBox ' . FANCYBOX_VERSION . ' - RavanH (http://status301.net/wordpress-plugins/easy-fancybox/) -->';
22
+
23
+ // check for any enabled sections
24
+ foreach (self::$options['Global']['options']['Enable']['options'] as $value) {
25
+ // anything enabled?
26
+ if ( isset($value['id']) && '1' == get_option($value['id'],$value['default']) ) {
27
+ self::$add_scripts = true;
28
+ break;
29
+ }
30
+ }
31
+ // and abort when none are active
32
+ if (!self::$add_scripts) {
33
+ echo '
34
+ <!-- Nothing enabled under Settings > Media > FancyBox, please disable the plugin if you are not using it. -->
35
+
36
+ ';
37
+ return;
38
+ }
39
+
40
+ wp_print_scripts('jquery'); // using print_scripts here instead of enqueue because else the order will be wrong... TODO find a way to include jquery before the main script while leaving the fancybox.js for last...
41
+
42
+ // begin output FancyBox settings
43
+ echo '
44
+ <script type="text/javascript">
45
+ /* <![CDATA[ */
46
+ var fb_timeout = null;';
47
+
48
+ /*
49
+ * Global settings routine
50
+ */
51
+ $more=0;
52
+ echo '
53
+ var fb_opts = {';
54
+ foreach (self::$options['Global']['options'] as $globals) {
55
+ foreach ($globals['options'] as $_key => $_value) {
56
+ if ( isset($_value['id']) )
57
+ if ( isset($_value['default']) )
58
+ $parm = get_option($_value['id'], $_value['default']);
59
+ else
60
+ $parm = get_option($_value['id']);
61
+ elseif ( isset($_value['default']) )
62
+ $parm = $_value['default'];
63
+ else
64
+ $parm = '';
65
+
66
+ if ( isset($_value['input']) && 'checkbox'==$_value['input'] )
67
+ $parm = ( '1' == $parm ) ? 'true' : 'false';
68
+
69
+ if( !isset($_value['hide']) && $parm!='' ) {
70
+ $quote = (is_numeric($parm) || (isset($_value['noquotes']) && $_value['noquotes'] == true) ) ? '' : '\'';
71
+ if ($more>0)
72
+ echo ',';
73
+ echo ' \''.$_key.'\' : ';
74
+ echo $quote.$parm.$quote;
75
+ $more++;
76
+ } else {
77
+ $$_key = $parm;
78
+ }
79
+ }
80
+ }
81
+ echo ' };
82
+ var easy_fancybox_handler = function(){';
83
+
84
+ foreach (self::$options as $key => $value) {
85
+ // check if not enabled or hide=true then skip
86
+ if ( isset($value['hide']) || !get_option(self::$options['Global']['options']['Enable']['options'][$key]['id'], self::$options['Global']['options']['Enable']['options'][$key]['default']) )
87
+ continue;
88
+
89
+ echo '
90
+ /* ' . $key . ' */';
91
+ /*
92
+ * Auto-detection routines (2x)
93
+ */
94
+ $autoAttribute = (isset($value['options']['autoAttribute'])) ? get_option( $value['options']['autoAttribute']['id'], $value['options']['autoAttribute']['default'] ) : "";
95
+ // update from previous version:
96
+ if($attributeLimit == '.not(\':empty\')')
97
+ $attributeLimit = ':not(:empty)';
98
+ elseif($attributeLimit == '.has(\'img\')')
99
+ $attributeLimit = ':has(img)';
100
+
101
+ if(!empty($autoAttribute)) {
102
+ if(is_numeric($autoAttribute)) {
103
+ echo '
104
+ jQuery(\'a['.$value['options']['autoAttribute']['selector'].']:not(.nofancybox)'.$attributeLimit.', area['.$value['options']['autoAttribute']['selector'].']:not(.nofancybox)'.$attributeLimit.'\')';
105
+ //if ( isset($value['options']['autoAttribute']['href-replace']) )
106
+ // echo '.attr(\'href\', function(index, attr){'.$value['options']['autoAttribute']['href-replace'].'})';
107
+ echo '.addClass(\''.$value['options']['class']['default'].'\');';
108
+ } else {
109
+ // set selectors
110
+ $file_types = array_filter( explode( ' ', str_replace( ',', ' ', $autoAttribute ) ) );
111
+ $more=0;
112
+ echo '
113
+ var fb_'.$key.'_select = \'';
114
+ foreach ($file_types as $type) {
115
+ if ($type == "jpg" || $type == "jpeg" || $type == "png" || $type == "gif")
116
+ $type = '.'.$type;
117
+ if ($more>0)
118
+ echo ', ';
119
+ echo 'a['.$value['options']['autoAttribute']['selector'].'"'.$type.'"]:not(.nofancybox)'.$attributeLimit.', area['.$value['options']['autoAttribute']['selector'].'"'.$type.'"]:not(.nofancybox)'.$attributeLimit;
120
+ $more++;
121
+ }
122
+ echo '\';';
123
+
124
+ // class and rel depending on settings
125
+ if( '1' == get_option($value['options']['autoAttributeLimit']['id'],$value['options']['autoAttributeLimit']['default']) ) {
126
+ // add class
127
+ echo '
128
+ var fb_'.$key.'_sections = jQuery(\''.get_option($value['options']['autoSelector']['id'],$value['options']['autoSelector']['default']).'\');
129
+ fb_'.$key.'_sections.each(function() { jQuery(this).find(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\')';
130
+ // and set rel
131
+ switch( get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
132
+ case '':
133
+ default :
134
+ echo '; });';
135
+ break;
136
+ case '1':
137
+ echo '.attr(\'rel\', \'gallery-\' + fb_'.$key.'_sections.index(this)); });';
138
+ break;
139
+ case '2':
140
+ echo '.attr(\'rel\', \'gallery\'); });';
141
+ }
142
+ } else {
143
+ // add class
144
+ echo '
145
+ jQuery(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\')';
146
+ // set rel
147
+ switch( get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
148
+ case '':
149
+ default :
150
+ echo ';';
151
+ break;
152
+ case '1':
153
+ echo ';
154
+ var fb_'.$key.'_sections = jQuery(\''.get_option($value['options']['autoSelector']['id'],$value['options']['autoSelector']['default']).'\');
155
+ fb_'.$key.'_sections.each(function() { jQuery(this).find(fb_'.$key.'_select).attr(\'rel\', \'gallery-\' + fb_'.$key.'_sections.index(this)); });';
156
+ break;
157
+ case '2':
158
+ echo '.attr(\'rel\', \'gallery\');';
159
+ }
160
+ }
161
+
162
+ }
163
+ }
164
+
165
+ $autoAttributeAlt = ( isset($value['options']['autoAttributeAlt']) ) ? get_option( $value['options']['autoAttributeAlt']['id'], $value['options']['autoAttributeAlt']['default'] ) : "";
166
+ if(!empty($autoAttributeAlt) && is_numeric($autoAttributeAlt)) {
167
+ echo '
168
+ jQuery(\'a['.$value['options']['autoAttributeAlt']['selector'].']:not(.nofancybox)'.$attributeLimit.', area['.$value['options']['autoAttributeAlt']['selector'].']:not(.nofancybox)'.$attributeLimit.'\')';
169
+ //if (!empty($value['options']['autoAttributeAlt']['href-replace']))
170
+ // echo '.attr(\'href\', function(index, attr){'.$value['options']['autoAttributeAlt']['href-replace']. '})';
171
+ echo '.addClass(\''.$value['options']['class']['default'].'\');';
172
+ }
173
+
174
+ /*
175
+ * Generate .fancybox() bind
176
+ */
177
+ $trigger='';
178
+ if( $key == $autoClick )
179
+ $trigger = '.filter(\':first\').trigger(\'click\')';
180
+
181
+ echo '
182
+ jQuery(\'' . $value['options']['tag']['default']. '\')';
183
+
184
+ // use each() to allow different metadata values per instance; fix by Elron. Thanks!
185
+ if ( '1' == get_option(self::$options['Global']['options']['Links']['options']['metaData']['id'],self::$options['Global']['options']['Links']['options']['metaData']['default']) )
186
+ echo '.each(function() { jQuery(this)';
187
+
188
+ echo '.fancybox( jQuery.extend({}, fb_opts, {';
189
+ $more=0;
190
+ foreach ($value['options'] as $_key => $_value) {
191
+ if (isset($_value['id']) || isset($_value['default']))
192
+ $parm = (isset($_value['id']))? get_option($_value['id'], $_value['default']) : $_value['default'];
193
+ else
194
+ $parm = '';
195
+
196
+ if( isset($_value['input']) && 'checkbox'==$_value['input'] )
197
+ $parm = ( '1' == $parm ) ? 'true' : 'false';
198
+
199
+ if( !isset($_value['hide']) && $parm!='' ) {
200
+ $quote = (is_numeric($parm) || (isset($_value['noquotes']) && $_value['noquotes'] == true) ) ? '' : '\'';
201
+ if ($more>0)
202
+ echo ',';
203
+ echo ' \''.$_key.'\' : ';
204
+ echo $quote.$parm.$quote;
205
+ $more++;
206
+ }
207
+ }
208
+ echo ' }) ';
209
+
210
+ // use each() to allow different metadata values per instance; fix by Elron. Thanks!
211
+ if ( '1' == get_option(self::$options['Global']['options']['Links']['options']['metaData']['id'],self::$options['Global']['options']['Links']['options']['metaData']['default']) )
212
+ echo ');} ';
213
+
214
+ echo ')'.$trigger.';';
215
+
216
+ }
217
+
218
+ switch( $autoClick ) {
219
+ case '':
220
+ default :
221
+ break;
222
+ case '1':
223
+ echo '
224
+ /* Auto-click */
225
+ jQuery(\'#fancybox-auto\').trigger(\'click\');';
226
+ break;
227
+ case '99':
228
+ echo '
229
+ /* Auto-load */
230
+ jQuery(\'a[class*="fancybox"]\').filter(\':first\').trigger(\'click\');';
231
+ break;
232
+ }
233
+ echo '
234
+ }
235
+ /* ]]> */
236
+ </script>
237
+ <style type="text/css">.fancybox-hidden{display:none}.rtl #fancybox-left{left:auto;right:0px}.rtl #fancybox-right{left:0px;right:auto}.rtl #fancybox-right-ico{background-position:-40px -30px}.rtl #fancybox-left-ico{background-position:-40px -60px}.rtl .fancybox-title-over{text-align:right}.rtl #fancybox-left-ico,.rtl #fancybox-right-ico{right:-9999px}.rtl #fancybox-right:hover span{right:auto;left:20px}.rtl #fancybox-left:hover span{right:20px}#fancybox-img{max-width:none;max-height:none}';
238
+
239
+ if ('true' == $overlaySpotlight)
240
+ echo '#fancybox-overlay{background-attachment:fixed;background-image:url("' . EASY_FANCYBOX_PLUGINURL . 'light-mask.png");background-position:center;background-repeat:no-repeat;background-size:cover;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'light-mask.png",sizingMethod="scale");-ms-filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' . EASY_FANCYBOX_PLUGINURL . 'light-mask.png\',sizingMethod=\'scale\')";}';
241
+ if ( !empty($borderRadius) )
242
+ echo '#fancybox-bg-n,#fancybox-bg-ne,#fancybox-bg-e,#fancybox-bg-se,#fancybox-bg-s,#fancybox-bg-sw,#fancybox-bg-w,#fancybox-bg-nw{background-image:none}#fancybox-outer,#fancybox-content{border-radius:'.$borderRadius.'px}#fancybox-outer{-moz-box-shadow:0 0 12px #1111;-webkit-box-shadow:0 0 12px #111;box-shadow:0 0 12px #111}';
243
+ if ('' != $backgroundColor)
244
+ echo '#fancybox-outer{background-color:'.$backgroundColor.'}';
245
+ if ('' != $paddingColor)
246
+ echo '#fancybox-content{border-color:'.$paddingColor.'}';
247
+ if ('' != $textColor)
248
+ echo '#fancybox-content{color:'.$textColor.'}';
249
+ if ('' != $frameOpacity && '1' != $frameOpacity) {
250
+ $frameOpacity_percent = (int)$frameOpacity*100;
251
+ echo '#fancybox-outer{filter:alpha(opacity='.$frameOpacity_percent.');-moz-opacity:'.$frameOpacity.';opacity:'.$frameOpacity.'}';
252
+ }
253
+ echo '</style>
254
+ ';
255
+ }
256
+
257
+
258
+ /***********************
259
+ ADMIN FUNCTIONS
260
+ ***********************/
261
+
262
+ function register_settings($args = array()) {
263
+ foreach ($args as $key => $value) {
264
+ // check to see if the section is enabled, else skip to next
265
+ if ( array_key_exists($key, self::$options['Global']['options']['Enable']['options']) && !get_option( self::$options['Global']['options']['Enable']['options'][$key]['id'], self::$options['Global']['options']['Enable']['options'][$key]['default']) )
266
+ continue;
267
+
268
+ switch($value['input']) {
269
+ case 'deep':
270
+ // go deeper by looping back on itself
271
+ self::register_settings($value['options']);
272
+ break;
273
+ case 'multiple':
274
+ add_settings_field( 'fancybox_'.$key, '<a name="'.$value['title'].'"></a>'.$value['title'], array(__CLASS__, 'settings_fields'), 'media', 'fancybox_section', $value);
275
+ foreach ( $value['options'] as $_value ) {
276
+ if ( !isset($_value['sanitize_callback']) )
277
+ $sanitize_callback = '';
278
+ else
279
+ $sanitize_callback = array(__CLASS__, $_value['sanitize_callback']);
280
+ if ( isset($_value['id']) )
281
+ register_setting( 'media', $_value['id'], $sanitize_callback );
282
+ }
283
+ break;
284
+ default:
285
+ if ( !isset($value['sanitize_callback']) )
286
+ $sanitize_callback = '';
287
+ else
288
+ $sanitize_callback = array(__CLASS__, $value['sanitize_callback']);
289
+ if ( isset($value['id']) )
290
+ register_setting( 'media', 'fancybox_'.$key, $sanitize_callback );
291
+ }
292
+ }
293
+ }
294
+
295
+ // add our FancyBox Media Settings Section on Settings > Media admin page
296
+ function settings_section() {
297
+ echo '<p><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Easy%20FancyBox&item_number='.EASY_FANCYBOX_VERSION.'&no_shipping=0&tax=0&charset=UTF%2d8&currency_code=EUR" title="'.__('Donate to keep the Easy FancyBox plugin development going!','easy-fancybox').'"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" style="border:none;float:right;margin:5px 0 0 10px" alt="'.__('Donate to keep the Easy FancyBox plugin development going!','easy-fancybox').'" width="92" height="26" /></a>'.sprintf(__('The options in this section are provided by the plugin %s and determine the <strong>Media Lightbox</strong> overlay appearance and behaviour controlled by %s.','easy-fancybox'),'<strong><a href="http://status301.net/wordpress-plugins/easy-fancybox/">'.__('Easy FancyBox','easy-fancybox').'</a></strong>','<strong><a href="http://fancybox.net/">'.__('FancyBox','easy-fancybox').'</a></strong>').'</p><p>'.__('First enable each sub-section that you need. Then save and come back to adjust its specific settings.','easy-fancybox').' '.__('Note: Each additional sub-section and features like <em>Auto-detection</em>, <em>Elastic transitions</em> and all <em>Easing effects</em> (except Swing) will have some extra impact on client-side page speed. Enable only those sub-sections and options that you actually need on your site.','easy-fancybox').' '.__('Some setting like Transition options are unavailable for SWF video, PDF and iFrame content to ensure browser compatibility and readability.','easy-fancybox').'</p>';
298
+ }
299
+
300
+ // add our FancyBox Media Settings Fields
301
+ function settings_fields($args){
302
+ $disabled = (isset($args['status']) && 'disabled' == $args['status']) ? ' disabled="disabled"' : '';
303
+ if (isset($args['input']))
304
+ switch($args['input']) {
305
+ case 'multiple':
306
+ case 'deep':
307
+ foreach ($args['options'] as $options)
308
+ self::settings_fields($options);
309
+ if (isset($args['description'])) echo $args['description'];
310
+ break;
311
+ case 'select':
312
+ if( !empty($args['label_for']) )
313
+ echo '<label for="'.$args['label_for'].'">'.$args['title'].'</label> ';
314
+ else
315
+ echo $args['title'];
316
+ echo '
317
+ <select name="'.$args['id'].'" id="'.$args['id'].'">';
318
+ foreach ($args['options'] as $optionkey => $optionvalue) {
319
+ $selected = (get_option($args['id'], $args['default']) == $optionkey) ? ' selected="selected"' : '';
320
+ echo '
321
+ <option value="'.esc_attr($optionkey).'"'.$selected.' '.$disabled.' >'.$optionvalue.'</option>';
322
+ }
323
+ echo '
324
+ </select> ';
325
+ if( empty($args['label_for']) )
326
+ echo '<label for="'.$args['id'].'">'.$args['description'].'</label> ';
327
+ else
328
+ if (isset($args['description'])) echo $args['description'];
329
+ break;
330
+ case 'checkbox':
331
+ if( !empty($args['label_for']) )
332
+ echo '<label for="'.$args['label_for'].'">'.$args['title'].'</label> ';
333
+ else
334
+ if (isset($args['title'])) echo $args['title'];
335
+ $value = esc_attr( get_option($args['id'], $args['default']) );
336
+ if ($value == "1")
337
+ $checked = ' checked="checked"';
338
+ else
339
+ $checked = '';
340
+ if ($args['default'] == "1")
341
+ $default = __('Checked','easy-fancybox');
342
+ else
343
+ $default = __('Unchecked','easy-fancybox');
344
+ if( empty($args['label_for']) )
345
+ echo '
346
+ <label><input type="checkbox" name="'.$args['id'].'" id="'.$args['id'].'" value="1" '.$checked.' '.$disabled.' /> '.$args['description'].'</label><br />';
347
+ else
348
+ echo '
349
+ <input type="checkbox" name="'.$args['id'].'" id="'.$args['id'].'" value="1" '.$checked.' '.$disabled.' /> '.$args['description'].'<br />';
350
+ break;
351
+ case 'text':
352
+ if( !empty($args['label_for']) )
353
+ echo '<label for="'.$args['label_for'].'">'.$args['title'].'</label> ';
354
+ else
355
+ echo $args['title'];
356
+ echo '
357
+ <input type="text" name="'.$args['id'].'" id="'.$args['id'].'" value="'.esc_attr( get_option($args['id'], $args['default']) ).'" class="'.$args['class'].'"'.$disabled.' /> ';
358
+ if( empty($args['label_for']) )
359
+ echo '<label for="'.$args['id'].'">'.$args['description'].'</label> ';
360
+ else
361
+ if (isset($args['description'])) echo $args['description'];
362
+ break;
363
+ case 'number':
364
+ if( !empty($args['label_for']) )
365
+ echo '<label for="'.$args['label_for'].'">'.$args['title'].'</label> ';
366
+ else
367
+ echo $args['title'];
368
+ echo '
369
+ <input type="number" step="'.$args['step'].'" min="'.$args['min'].'" max="'.$args['max'].'" name="'.$args['id'].'" id="'.$args['id'].'" value="'.esc_attr( get_option($args['id'], $args['default']) ).'" class="'.$args['class'].'"'.$disabled.' /> ';
370
+ if( empty($args['label_for']) )
371
+ echo '<label for="'.$args['id'].'">'.$args['description'].'</label> ';
372
+ else
373
+ if (isset($args['description'])) echo $args['description'];
374
+ break;
375
+ case 'hidden':
376
+ echo '
377
+ <input type="hidden" name="'.$args['id'].'" id="'.$args['id'].'" value="'.esc_attr( get_option($args['id'], $args['default']) ).'" /> ';
378
+ break;
379
+ default:
380
+ if (isset($args['description'])) echo $args['description'];
381
+ }
382
+ else
383
+ if (isset($args['description'])) echo $args['description'];
384
+ }
385
+
386
+ /**
387
+ * Adds an action link to the Plugins page
388
+ */
389
+ function add_action_link( $links ) {
390
+ $settings_link = '<a href="' . admin_url('options-media.php') . '">' . __('Settings') . '</a>';
391
+ array_unshift( $links, $settings_link );
392
+ return $links;
393
+ }
394
+
395
+ function intval($setting = '') {
396
+ if ($setting == '')
397
+ return '';
398
+
399
+ if (substr($setting, -1) == '%') {
400
+ $val = intval(substr($setting, 0, -1));
401
+ $prc = '%';
402
+ } else {
403
+ $val = intval($setting);
404
+ $prc = '';
405
+ }
406
+
407
+ return ( $val != 0 ) ? $val.$prc : 0;
408
+ }
409
+
410
+
411
+ /***********************
412
+ ACTIONS & FILTERS
413
+ ***********************/
414
+
415
+ function register_scripts() {
416
+
417
+ // ENQUEUE
418
+ // first get rid of previously registered variants of jquery.fancybox by other plugins or theme
419
+ wp_deregister_script('fancybox');
420
+ wp_deregister_script('jquery.fancybox');
421
+ wp_deregister_script('jquery_fancybox');
422
+ wp_deregister_script('jquery-fancybox');
423
+ // register main fancybox script
424
+ wp_register_script('jquery-fancybox', EASY_FANCYBOX_PLUGINURL.'fancybox/jquery.fancybox-'.FANCYBOX_VERSION.'.pack.js', array('jquery'), FANCYBOX_VERSION, true);
425
+
426
+ // easing in IMG settings?
427
+ if ( ( '' == get_option( self::$options['IMG']['options']['easingIn']['id'], self::$options['IMG']['options']['easingIn']['default']) || 'linear' == get_option( self::$options['IMG']['options']['easingIn']['id'], self::$options['IMG']['options']['easingIn']['default']) ) && ( '' == get_option( self::$options['IMG']['options']['easingOut']['id'], self::$options['IMG']['options']['easingOut']['default']) || 'linear' == get_option( self::$options['IMG']['options']['easingOut']['id'], self::$options['IMG']['options']['easingOut']['default']) ) ) {
428
+ // do nothing
429
+ } else {
430
+ if ( 'elastic' == get_option( self::$options['IMG']['options']['transitionIn']['id'], self::$options['IMG']['options']['transitionIn']['default']) || 'elastic' == get_option( self::$options['IMG']['options']['transitionOut']['id'], self::$options['IMG']['options']['transitionOut']['default']) ) {
431
+ // first get rid of previously registered variants of jquery.easing by other plugins or theme
432
+ wp_deregister_script('easing');
433
+ wp_deregister_script('jquery.easing');
434
+ wp_deregister_script('jqueryeasing');
435
+ wp_deregister_script('jquery_easing');
436
+ wp_deregister_script('jquery-easing');
437
+ // then register our version
438
+ wp_register_script('jquery-easing', EASY_FANCYBOX_PLUGINURL.'jquery.easing.pack.js', array('jquery'), EASING_VERSION, true);
439
+ }
440
+ }
441
+
442
+ // mousewheel in IMG settings?
443
+ if ( '1' == get_option( self::$options['IMG']['options']['mouseWheel']['id'], self::$options['IMG']['options']['mouseWheel']['default']) ) {
444
+ // first get rid of previously registered variants of jquery.mousewheel (by other plugins)
445
+ wp_deregister_script('mousewheel');
446
+ wp_deregister_script('jquery.mousewheel');
447
+ wp_deregister_script('jquerymousewheel');
448
+ wp_deregister_script('jquery_mousewheel');
449
+ wp_deregister_script('jquery-mousewheel');
450
+ // then register our version
451
+ wp_register_script('jquery-mousewheel', EASY_FANCYBOX_PLUGINURL.'jquery.mousewheel.pack.js', array('jquery'), MOUSEWHEEL_VERSION, true);
452
+ }
453
+
454
+ // metadata in Link settings?
455
+ if ('1' == get_option( self::$options['Global']['options']['Links']['options']['metaData']['id'], self::$options['Global']['options']['Links']['options']['metaData']['default']) ) {
456
+ // first get rid of previously registered variants of jquery.metadata (by other plugins)
457
+ wp_deregister_script('metadata');
458
+ wp_deregister_script('jquery.metadata');
459
+ wp_deregister_script('jquerymetadata');
460
+ wp_deregister_script('jquery_metadata');
461
+ wp_deregister_script('jquery-metadata');
462
+ // then register our version
463
+ wp_register_script('jquery-metadata',EASY_FANCYBOX_PLUGINURL.'jquery.metadata.pack.js', array('jquery'), METADATA_VERSION, true);
464
+ }
465
+ }
466
+
467
+ function enqueue_styles() {
468
+ // register style
469
+ wp_enqueue_style('easy-fancybox-css', EASY_FANCYBOX_PLUGINURL.'easy-fancybox.css.php', false, FANCYBOX_VERSION, 'screen');
470
+ }
471
+
472
+ static function enqueue_header_scripts() {
473
+ // TODO: google hosted jquery optional ++ safemode
474
+ //wp_deregister_script('jquery');
475
+ //wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null);
476
+ //wp_enqueue_script('jquery');
477
+
478
+ wp_enqueue_script('jquery-fancybox');
479
+ }
480
+
481
+ static function enqueue_footer_scripts() {
482
+ if (!self::$add_scripts) { // abort mission, there is no need for any script files
483
+ echo '<!-- no fancybox scripts needed -->';
484
+ return;
485
+ }
486
+
487
+ wp_enqueue_script('jquery-fancybox');
488
+ wp_enqueue_script('jquery-easing');
489
+ wp_enqueue_script('jquery-mousewheel');
490
+ wp_enqueue_script('jquery-metadata');
491
+ }
492
+
493
+ function on_ready() {
494
+ if (!self::$add_scripts) // abort mission, there is no need for any script files
495
+ return;
496
+ echo '
497
+ <script type="text/javascript">
498
+ jQuery(document).on(\'ready gform_post_render\', easy_fancybox_handler );
499
+ </script>
500
+ ';
501
+ }
502
+
503
+ static function admin_init(){
504
+
505
+ add_filter('plugin_action_links_' . EASY_FANCYBOX_PLUGINBASENAME, array(__CLASS__, 'add_action_link') );
506
+ // in preparation of admin page move:
507
+ //add_action('admin_menu', array(__CLASS__, 'add_menu'));
508
+
509
+ add_settings_section('fancybox_section', __('FancyBox','easy-fancybox'), array(__CLASS__, 'settings_section'), 'media');
510
+
511
+ self::register_settings( self::$options );
512
+
513
+ // test with media upload resize...
514
+ add_action( 'pre-upload-ui', 'media_upload_max_image_resize' );
515
+ }
516
+
517
+ // Hack to fix missing wmode in Youtube oEmbed code based on David C's code in the comments on
518
+ // http://www.mehigh.biz/wordpress/adding-wmode-transparent-to-wordpress-3-media-embeds.html
519
+ static function add_video_wmode_opaque($html, $url, $attr) {
520
+ if (strpos($html, "<embed src=" ) !== false) {
521
+ $html = str_replace('</param><embed', '</param><param name="wmode" value="opaque"></param><embed wmode="opaque"', $html);
522
+ } elseif (strpos($html, 'youtube' ) !== false && strpos($html, 'wmode' ) == false ) {
523
+ $html = str_replace('feature=oembed', 'feature=oembed&wmode=opaque', $html);
524
+ } elseif ( strpos($html, "vimeo" ) !== false && strpos($html, 'wmode' ) == false ) {
525
+ $html = str_replace('" width', '?theme=none&wmode=opaque" width', $html);
526
+ } elseif ( strpos($html, "dailymotion" ) !== false && strpos($html, 'wmode' ) == false ) {
527
+ $html = str_replace('" width', '?wmode=opaque" width', $html);
528
+ }
529
+ return $html;
530
+ }
531
+
532
+ static function init() {
533
+
534
+ if ( is_admin() ) {
535
+ }
536
+
537
+ require_once(EASY_FANCYBOX_PLUGINDIR . 'easy-fancybox-settings.php');
538
+
539
+ add_filter('embed_oembed_html', array(__CLASS__, 'add_video_wmode_opaque'), 10, 3);
540
+ }
541
+
542
+ static function textdomain() {
543
+ if ( is_admin() ) {
544
+ load_plugin_textdomain('easy-fancybox', false, dirname( EASY_FANCYBOX_PLUGINBASENAME ) . '/languages/');
545
+ }
546
+ }
547
+ /**********************
548
+ ADMIN
549
+ **********************/
550
+
551
+ public static function add_menu() {
552
+ /* Register our plugin page */
553
+ self::$pagehook = add_submenu_page( 'themes.php', __('Easy FancyBox Settings', 'easy-fancybox'), __('FancyBox', 'easy-fancybox'), 'manage_options', 'easy-fancybox', array(__CLASS__, 'admin') );
554
+ /* Using registered $page handle to hook script load */
555
+ add_action('load-' . self::$pagehook, array(__CLASS__, 'admin_scripts'));
556
+ }
557
+
558
+ public static function admin() {
559
+
560
+ add_filter( 'get_user_option_closedpostboxes_'.self::$pagehook, array(__CLASS__, 'closed_meta_boxes') );
561
+
562
+ //add_thickbox(); // do we need that?
563
+
564
+ add_meta_box('submitdiv', __('Sections','easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_submit'), self::$pagehook, 'side', 'high');
565
+ add_meta_box('globaldiv', __('Global settings', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_global'), self::$pagehook, 'normal', 'high');
566
+ add_meta_box('imgdiv', __('Images', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_img'), self::$pagehook, 'normal', 'normal');
567
+ add_meta_box('inlinediv', __('Inline content', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_inline'), self::$pagehook, 'normal', 'normal');
568
+ add_meta_box('pdfdiv', __('PDF', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_pdf'), self::$pagehook, 'normal', 'normal');
569
+ add_meta_box('swfdiv', __('SWF', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_swf'), self::$pagehook, 'normal', 'normal');
570
+ add_meta_box('youtubediv', __('YouTube', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_youtube'), self::$pagehook, 'normal', 'normal');
571
+ add_meta_box('vimeodiv', __('Vimeo', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_vimeo'), self::$pagehook, 'normal', 'normal');
572
+ add_meta_box('dailymotiondiv', __('Dailymotion', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_dailymotion'), self::$pagehook, 'normal', 'normal');
573
+ add_meta_box('iframediv', __('iFrames', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_iframe'), self::$pagehook, 'normal', 'normal');
574
+
575
+ //load admin page
576
+ include(EASY_FANCYBOX_PLUGINDIR . '/easy-fancybox-admin.php');
577
+ }
578
+
579
+ public function closed_meta_boxes( $closed ) {
580
+
581
+ if ( false === $closed )
582
+ // set default closed metaboxes
583
+ $closed = array( 'advanceddiv', 'supportdiv', 'creditsdiv', 'resourcesdiv' );
584
+ else
585
+ // remove closed setting of some metaboxes
586
+ $closed = array_diff ( $closed , array ( 'submitdiv' ) );
587
+
588
+ return $closed;
589
+ }
590
+
591
+ public static function admin_scripts($hook) {
592
+
593
+ // needed javascripts to allow drag/drop, expand/collapse and hide/show of boxes
594
+ wp_enqueue_script('common');
595
+ wp_enqueue_script('wp-list');
596
+ wp_enqueue_script('postbox');
597
+
598
+ //add several metaboxes now, all metaboxes registered during load page can be switched off/on at "Screen Options" automatically, nothing special to do therefore
599
+ //add_meta_box('advanceddiv', __('Advanced Options', 'skype-online-status'), array(__CLASS__.'_Admin', 'meta_box_advanced'), self::$pagehook, 'normal', 'core'); // make these pro options???
600
+
601
+ add_meta_box('supportdiv', __('Support','easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_support'), self::$pagehook, 'side', 'core');
602
+ add_meta_box('resourcesdiv', __('Resources','skype-online-status'), array(__CLASS__.'_Admin', 'meta_box_resources'), self::$pagehook, 'side', 'low');
603
+ add_meta_box('discussiondiv', __('Discussion'), array(__CLASS__.'_Admin', 'meta_box_discussion'), self::$pagehook, 'normal', 'low');
604
+ add_meta_box('creditsdiv', __('Credits','skype-online-status'), array(__CLASS__.'_Admin', 'meta_box_credits'), self::$pagehook, 'side', 'default');
605
+
606
+ }
607
+
608
+ /**********************
609
+ RUN
610
+ **********************/
611
+
612
+ static function run() {
613
+
614
+ // HOOKS //
615
+ add_action('plugins_loaded', array(__CLASS__, 'textdomain'));
616
+
617
+ add_action('admin_init', array(__CLASS__, 'admin_init'));
618
+
619
+ add_action('init', array(__CLASS__, 'init'));
620
+ add_action('wp_print_scripts', array(__CLASS__, 'register_scripts'), 999);
621
+ add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_styles'));
622
+ add_action('wp_head', array(__CLASS__, 'main_script'), 999);
623
+ add_action('wp_footer', array(__CLASS__, 'enqueue_footer_scripts'));
624
+ add_action('wp_footer', array(__CLASS__, 'on_ready'), 999);
625
+ }
626
+
627
+ }
628
+
easy-fancybox-nl.mo DELETED
Binary file
easy-fancybox-nl_NL.mo DELETED
Binary file
easy-fancybox-settings.php CHANGED
@@ -1,360 +1,740 @@
1
  <?php
2
- function easy_fancybox_settings(){
 
 
 
 
3
 
4
- return array (
5
  'Global' => array(
6
  'title' => __('Global settings','easy-fancybox'),
7
- 'input' => 'multiple',
8
  'hide' => true,
9
  'options' => array(
10
- 'intro' => array (
11
- 'hide' => true,
12
- 'description' => __('These settings determine the global overlay appearance and behaviour controlled by FancyBox.','easy-fancybox') . '<br />'
13
- ),
14
- 'p0' => array (
15
- 'hide' => true,
16
- 'description' => '<br /><strong>' . __('Links') . '</strong><br />'
17
- ),
18
- 'attributeLimit' => array (
19
- 'id' => 'fancybox_attributeLimit',
20
- 'title' => __('Exclude','easy-fancybox'),
21
- 'label_for' => 'fancybox_attributeLimit',
22
- 'hide' => true,
23
- 'input' => 'select',
24
- 'options' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  '' => __('None'),
26
  ':not(:empty)' => __('Empty (hidden) links','easy-fancybox'),
27
  ':has(img)' => __('Without thumbnail image','easy-fancybox')
 
 
 
28
  ),
29
- 'default' => ':not(:empty)',
30
- 'description' => '<br />'
31
- ),
32
- 'autoClick' => array (
33
- 'id' => 'fancybox_autoClick',
34
- 'title' => __('Auto-trigger','easy-fancybox'),
35
- 'label_for' => 'fancybox_autoClick',
36
- 'hide' => true,
37
- 'input' => 'select',
38
- 'options' => array(
39
  '' => __('None'),
40
- '1' => __('Manual','easy-fancybox'),
41
- 'IMG' => __('First Image link','easy-fancybox'),
42
- 'PDF' => __('First PDF link','easy-fancybox'),
43
- 'SWF' => __('First SWF link','easy-fancybox'),
44
- 'YouTube' => __('First YouTube link ','easy-fancybox'),
45
- 'Vimeo' => __('First Vimeo link ','easy-fancybox'),
46
- 'Dailymotion' => __('First Dailymotion link ','easy-fancybox'),
47
- 'iFrame' => __('First iFrame link','easy-fancybox'),
48
- '99' => __('First of any link','easy-fancybox'),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  ),
50
- 'default' => '1',
51
- 'description' => '<br />' . __('If you want an image, movie or even hidden content to pop up when a visitor opens the page, select one of these options. "Manual" means you have to create a link with class="fancybox" and id="fancybox-auto" in your content or a text widget.','easy-fancybox')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  ),
53
- 'p1' => array (
54
- 'hide' => true,
55
- 'description' => '<br /><br /><strong>' . __('Overlay','easy-fancybox') . '</strong><br />'
56
- ),
57
- 'overlayShow' => array (
58
- 'id' => 'fancybox_overlayShow',
59
- 'input' => 'checkbox',
60
- 'default' => '1',
61
- 'description' => __('Show the overlay around content opened in FancyBox.','easy-fancybox')
62
- ),
63
- 'overlaySpotlight' => array (
64
- 'id' => 'fancybox_overlaySpotlight',
65
- 'input' => 'checkbox',
66
- 'hide' => true,
67
- 'default' => '',
68
- 'description' => __('Spotlight effect.','easy-fancybox')
69
- ),
70
- 'overlayOpacity' => array (
71
- 'id' => 'fancybox_overlayOpacity',
72
- 'title' => __('Overlay opacity','easy-fancybox'),
73
- 'label_for' => 'fancybox_overlayOpacity',
74
- 'input' => 'text',
75
- 'class' => 'small-text',
76
- 'default' => '',
77
- 'description' => __('Value between 0 and 1. ','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 0.7</em><br />'
78
- ),
79
- 'overlayColor' => array (
80
- 'id' => 'fancybox_overlayColor',
81
- 'title' => __('Overlay color','easy-fancybox'),
82
- 'label_for' => 'fancybox_overlayColor',
83
- 'input' => 'text',
84
- 'class' => 'small-text',
85
- 'default' => '',
86
- 'description' => __('Enter a HTML color value.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' #777</em><br />'
87
  ),
88
  'p2' => array (
89
- 'hide' => true,
90
- 'description' => '<br /><strong>' . __('Overlay window','easy-fancybox') . '</strong><br />'
91
  ),
92
- 'width' => array (
93
- 'id' => 'fancybox_width',
94
- 'title' => __('Width'),
95
- 'label_for' => 'fancybox_width',
96
- 'input' => 'text',
97
- 'class' => 'small-text',
98
- 'default' => '',
99
- 'description' => ' '
 
 
 
 
100
  ),
101
- 'height' => array (
102
- 'id' => 'fancybox_height',
103
- 'title' => __('Height'),
104
- 'label_for' => 'fancybox_height',
105
- 'input' => 'text',
106
- 'class' => 'small-text',
107
- 'default' => ''
 
 
 
 
 
 
108
  ),
109
- 'padding' => array (
110
- 'id' => 'fancybox_padding',
111
- 'title' => __('Border'),
112
- 'label_for' => 'fancybox_padding',
113
- 'input' => 'text',
114
- 'class' => 'small-text',
115
- 'default' => '',
116
- 'description' => '<br />' . __('Change default width, heigth and border of the overlay window.','easy-fancybox') . ' ' . __('Set Border 0 to remove it.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 560 x 340 x 10</em><br />'
117
- ),
118
- 'centerOnScroll' => array (
119
- 'id' => 'fancybox_centerOnScroll',
120
- 'input' => 'checkbox',
121
- 'default' => '1',
122
- 'description' => __('Center while scrolling','easy-fancybox')
123
- ),
124
- 'showCloseButton' => array (
125
- 'id' => 'fancybox_showCloseButton',
126
- 'input' => 'checkbox',
127
- 'default' => '1',
128
- 'description' => __('Show the (X) close button','easy-fancybox')
129
  ),
130
- 'showNavArrows' => array (
131
- 'id' => 'fancybox_showNavArrows',
132
- 'input' => 'checkbox',
133
- 'default' => '1',
134
- 'description' => __('Show the gallery navigation arrows','easy-fancybox')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  ),
136
  'titleShow' => array (
137
- 'id' => 'fancybox_titleShow',
138
- 'input' => 'checkbox',
139
- 'default' => '1',
140
- 'description' => __('Show title','easy-fancybox')
 
141
  ),
142
  'titlePosition' => array (
143
- 'id' => 'fancybox_titlePosition',
144
- 'title' => __('Title Position','easy-fancybox'),
145
- 'label_for' => 'fancybox_titlePosition',
146
- 'input' => 'select',
147
- 'options' => array(
148
- '' => __('Float','easy-fancybox'), // same as 'float'
149
- 'outside' => __('Outside','easy-fancybox'),
150
- 'inside' => __('Inside','easy-fancybox'),
151
- 'over' => __('Overlay','easy-fancybox')
152
- ),
153
- 'default' => 'over',
154
- 'description' => ' '
155
  ),
156
  'titleFromAlt' => array (
157
- 'id' => 'fancybox_titleFromAlt',
158
- 'input' => 'checkbox',
159
- 'default' => '1',
160
- 'description' => __('Allow title from thumbnail alt tag','easy-fancybox')
161
- ),
162
- /* 'titleFormat' => array (
163
- 'id' => 'fancybox_titleFormat',
164
- 'title' => __('Title format','easy-fancybox'),
165
- 'label_for' => 'fancybox_titleFormat',
166
- 'input' => 'select',
167
- 'options' => array(
168
- '' => __('Default FancyBox style','easy-fancybox'),
169
- 'function(title, currentArray, currentIndex, currentOpts) { return \'<div style="font-face:Arial,sans-serif;text-align:left"><span style="float:right;font-size:large"><a href="javascript:;" onclick="$.fancybox.close();">' . __('Close','easy-fancybox') . ' <img src="' . plugins_url(FANCYBOX_SUBDIR, __FILE__) . '/fancybox/fancy_close.png" /></a></span>\' + (title && title.length ? \'<b style="display:block;margin-right:80px">\' + title + \'</b>\' : \'\' ) + \'' . __('Image','easy-fancybox') . '\' + (currentIndex + 1) + \' ' . __('of','easy-fancybox') . ' \' + currentArray.length + \'</div>\';
170
- }' => __('Mimic Lightbox2 style','easy-fancybox'),
171
- ),
172
- 'noquotes' => true,
173
- 'default' => '',
174
- 'description' => '<br />' . __('To improve Lightbox2 style disable Show close button and set titleposition to Inside or Outside','easy-fancybox') . '<br />'
175
- ),*/
176
- 'onComplete' => array (
177
- 'id' => 'fancybox_onComplete',
178
- 'title' => __('Advanced','easy-fancybox'),
179
- 'label_for' => 'fancybox_onComplete',
180
- 'input' => 'select',
181
- 'options' => array(
182
- '' => __('None','easy-fancybox'), // no extra's
183
- 'function() { $(\'#fancybox-title\').hide(); $(\'#fancybox-wrap\').hover(function() { $(\'#fancybox-title\').show(); }, function() { $(\'#fancybox-title\').hide(); }); }' => __('Hide/show title on mouse hover action','easy-fancybox'),
184
- 'function() { fb_timeout = setTimeout(function(){jQuery.fancybox.next();}, 5000); $(\'#fancybox-wrap\').hover(function() { if(fb_timeout) clearTimeout(fb_timeout); }, function() { if(!fb_timeout) var fb_timeout = setTimeout(function(){jQuery.fancybox.next();}, 5000); }); }' => __('Gallery Auto-rotation','easy-fancybox')
185
- ), // \'jQuery("#fancybox-right").trigger("click")\'
186
- // \'jQuery.event.trigger("fancybox-next")\'
187
- // \'jQuery.fancybox.next()\'
188
- // function(){jQuery.fancybox.next();}
189
- 'noquotes' => true,
190
- 'default' => '',
191
- 'description' => '<br />' . __('Note: Hide/show title on mouse hover action works best with Overlay title position. Auto-rotation uses a fixed 5 second pause per image.','easy-fancybox') . '<br />'
192
- ),
193
- 'onCleanup' => array (
194
- 'noquotes' => true,
195
- 'default' => 'function() { if(fb_timeout) { window.clearTimeout(fb_timeout); fb_timeout = null; } }'
196
  ),
197
-
198
  'p3' => array (
199
- 'hide' => true,
200
- 'description' => '<br /><strong>' . __('Transition','easy-fancybox') . '</strong><br />'
201
  ),
202
- 'transitionIn' => array (
203
- 'id' => 'fancybox_transitionIn',
204
- 'title' => __('Transition In','easy-fancybox'),
205
- 'label_for' => 'fancybox_transitionIn',
206
- 'input' => 'select',
207
- 'options' => array(
208
- '' => __('Fade','easy-fancybox'),
209
- 'elastic' => __('Elastic','easy-fancybox'),
210
- 'none' => __('None','easy-fancybox')
211
- ),
212
- 'default' => 'elastic',
213
- 'description' => ' '
 
214
  ),
215
- 'easingIn' => array (
216
- 'id' => 'fancybox_easingIn',
217
- 'title' => __('Easing In','easy-fancybox'),
218
- 'label_for' => 'fancybox_easingIn',
219
- 'input' => 'select',
220
- 'options' => array(
221
- '' => __('Swing','easy-fancybox'),
222
- 'easeOutBack' => __('Back','easy-fancybox'),
223
- 'easeOutQuad' => __('Quad','easy-fancybox'),
224
- 'easeOutExpo' => __('Expo','easy-fancybox'),
225
- ),
226
- 'default' => 'easeOutBack',
227
- 'description' => '<br />'
228
  ),
229
- 'transitionOut' => array (
230
- 'id' => 'fancybox_transitionOut',
231
- 'title' => __('Transition Out','easy-fancybox'),
232
- 'label_for' => 'fancybox_transitionOut',
233
- 'input' => 'select',
234
- 'options' => array(
235
- '' => __('Fade','easy-fancybox'),
236
- 'elastic' => __('Elastic','easy-fancybox'),
237
- 'none' => __('None','easy-fancybox')
238
- ),
239
- 'default' => 'elastic',
240
- 'description' => ' '
241
  ),
242
- 'easingOut' => array (
243
- 'id' => 'fancybox_easingOut',
244
- 'title' => __('Easing Out','easy-fancybox'),
245
- 'label_for' => 'fancybox_easingOut',
246
- 'input' => 'select',
247
- 'options' => array(
248
- '' => __('Swing','easy-fancybox'),
249
- 'easeInBack' => __('Back','easy-fancybox'),
250
- 'easeInQuad' => __('Quad','easy-fancybox'),
251
- 'easeInExpo' => __('Expo','easy-fancybox'),
252
- ),
253
- 'default' => 'easeInBack',
254
- 'description' => '<br />' . __('Easing effects only apply when Transition is set to Elastic. ','easy-fancybox') . '<br /><br />'
255
  ),
256
- 'opacity' => array (
257
- 'id' => 'fancybox_opacity',
258
- 'input' => 'checkbox',
259
- 'default' => '',
260
- 'description' => __('Transparency fade during elastic transition.','easy-fancybox')
261
- ),
262
- 'speedIn' => array (
263
- 'id' => 'fancybox_speedIn',
264
- 'title' => __('Opening speed','easy-fancybox'),
265
- 'label_for' => 'fancybox_speedIn',
266
- 'input' => 'text',
267
- 'class' => 'small-text',
268
- 'default' => '',
269
- ),
270
- 'speedOut' => array (
271
- 'id' => 'fancybox_speedIn',
272
- 'title' => __('Closing speed','easy-fancybox'),
273
- 'label_for' => 'fancybox_speedOut',
274
- 'input' => 'text',
275
- 'class' => 'small-text',
276
- 'default' => '',
277
  ),
278
  'changeFade' => array (
279
- 'id' => 'fancybox_changeFade',
280
- 'title' => __('Fade speed','easy-fancybox'),
281
- 'label_for' => 'fancybox_changeFade',
282
- 'input' => 'text',
283
- 'class' => 'small-text',
284
- 'default' => '',
285
- 'description' => '<br />' . __('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 300</em><br />'
286
- ) )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  ),
288
- 'IMG' => array(
289
- 'title' => __('Images','easy-fancybox'),
 
290
  'input' => 'multiple',
291
  'options' => array(
292
- 'enable' => array (
293
- 'id' => 'fancybox_enableImg',
294
- 'input' => 'checkbox',
295
- 'hide' => true,
296
- 'default' => ( function_exists('is_plugin_active_for_network') && is_plugin_active_for_network(plugin_basename( __FILE__ )) ) ? '' : '1',
297
- 'description' => '<strong>' . __('Enable FancyBox for','easy-fancybox') . ' ' . __('Images','easy-fancybox') . '</strong>'
298
- ),
299
  'intro' => array (
300
- 'hide' => true,
301
- 'description' => __('To make any image file open in an overlay, add its extension to the auto-detect field or use the tag class="fancybox" for its link. Clear field to switch off auto-enabling.','easy-fancybox') . '<br />'
302
  ),
303
- 'autoAttribute' => array (
304
- 'id' => 'fancybox_autoAttribute',
305
- 'title' => __('Auto-detect','easy-fancybox'),
306
- 'label_for' => 'fancybox_autoAttribute',
307
- 'input' => 'text',
308
- 'class' => 'regular-text',
309
- 'hide' => true,
310
- 'default' => 'jpg gif png',
311
- 'selector' => 'href$=',
312
- 'description' => ' <em>' . __('Default:','easy-fancybox') . ' jpg gif png</em><br />' . __('Change option "Advanced" below to further tweak auto-detection and gallery behaviour.','easy-fancybox') . '<br />'
313
  ),
314
- 'autoAttributeLimit' => array (
315
- 'id' => 'fancybox_autoAttributeLimit',
316
- 'title' => __('Apply to','easy-fancybox'),
317
- 'label_for' => 'fancybox_autoAttributeLimit',
318
- 'hide' => true,
319
- 'input' => 'select',
320
- 'options' => array(
321
- '' => __('All image links', 'easy-fancybox'),
322
- '1' => __('Grouped images only','easy-fancybox')
323
- ),
324
- 'default' => '',
325
- 'description' => '<em>' . __('Default:','easy-fancybox') . ' ' . 'All image links' . '</em><br />' . __('Note: The options "Grouped images only" might need adjusting the setting "Group selector(s)" below to make it compatible with your theme.','easy-fancybox') . '<br />'
326
  ),
327
- 'autoGallery' => array (
328
- 'id' => 'fancybox_autoGallery',
329
- 'title' => __('Auto-gallery','easy-fancybox'),
330
- 'label_for' => 'fancybox_autoGallery',
331
- 'hide' => true,
332
- 'input' => 'select',
333
- 'options' => array(
334
- '' => __('Disabled'),
335
- '1' => __('One gallery per group','easy-fancybox'),
336
- '2' => __('One gallery for all','easy-fancybox')
337
- ),
338
- 'default' => '1',
339
- 'description' => '<em>' . __('Default:','easy-fancybox') . ' ' . 'One gallery per group' . '</em><br />' . __('When disabled, you can use the rel attribute to manually group images together. Example: < a href="..." rel="gallery">...< /a>','easy-fancybox') . '<br />' . __('Note: You might need to adjust the setting "Group selector(s)" below to make grouping compatible with your theme.','easy-fancybox') . '<br />'
340
  ),
341
- 'autoSelector' => array (
342
- 'id' => 'fancybox_autoGallerySelector',
343
- 'title' => __('Group selector(s)','easy-fancybox'),
344
- 'label_for' => 'fancybox_autoGallerySelector',
345
- 'hide' => true,
346
- 'input' => 'text',
347
- 'class' => 'regular-text',
348
- 'default' => 'article, div.hentry',
349
- 'description' => __('Seperate with a comma.', 'easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' ' . 'article, div.hentry' . '</em><br />' . __('Examples: If your theme wraps post content in a div with class post, change this value to "div.post". If you want to include images in a sidebar with ID primary, add ", div#primary" or "aside#primary" for html5 themes.','easy-fancybox')
350
- ),
351
- /* 'onStart' => array (
352
- 'noquotes' => true,
353
- 'default' => 'function() { window.clearTimeout(fb_timeout); }'
354
- ),*/
355
- 'class' => array (
356
- 'hide' => true,
357
- 'default' => 'fancybox'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358
  )
359
  )
360
  ),
@@ -363,227 +743,312 @@ function easy_fancybox_settings(){
363
  'title' => __('PDF','easy-fancybox'),
364
  'input' => 'multiple',
365
  'options' => array(
366
- 'enable' => array (
367
- 'id' => 'fancybox_enablePDF',
368
- 'input' => 'checkbox',
369
- 'hide' => true,
370
- 'default' => '',
371
- 'description' => '<strong>' . __('Enable FancyBox for','easy-fancybox') . ' ' . __('PDF','easy-fancybox') . '</strong>'
372
  ),
373
  'autoAttribute' => array (
374
- 'id' => 'fancybox_autoAttributePDF',
375
- 'input' => 'checkbox',
376
- 'hide' => true,
377
- 'default' => '',
378
- 'selector' => 'href$=".pdf"',
379
- 'description' => __('Auto-detect','easy-fancybox')
380
  ),
381
- 'class' => array (
382
- 'hide' => true,
383
- 'default' => 'fancybox-pdf'
384
  ),
385
- 'intro' => array (
386
- 'hide' => true,
387
- 'description' => __('To make any PDF document file open in an overlay, switch on auto-detect or use the tag class="fancybox-pdf" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br /><br />'
388
  ),
389
  'type' => array (
390
- 'default' => 'html'
391
  ),
392
  'width' => array (
393
- 'id' => 'fancybox_PDFwidth',
394
- 'title' => __('Width'),
395
- 'label_for' => 'fancybox_PDFwidth',
396
- 'input' => 'text',
397
- 'class' => 'small-text',
398
- 'default' => '90%',
399
- 'description' => ' '
 
400
  ),
401
  'height' => array (
402
- 'id' => 'fancybox_PDFheight',
403
- 'title' => __('Height'),
404
- 'label_for' => 'fancybox_PDFheight',
405
- 'input' => 'text',
406
- 'class' => 'small-text',
407
- 'default' => '90%'
408
- ),
409
- 'margin' => array (
410
- 'default' => '0'
411
  ),
412
  'padding' => array (
413
- 'id' => 'fancybox_PDFpadding',
414
- 'title' => __('Border'),
415
- 'label_for' => 'fancybox_PDFpadding',
416
- 'input' => 'text',
417
- 'class' => 'small-text',
418
- 'default' => '0',
419
- 'description' => '<br />' . __('Width and height can be relative (%) or absolute sizes.','easy-fancybox') . ' ' . __('Set Border 0 to remove it.','easy-fancybox') . '<br />'
420
- ),
421
- 'autoScale' => array (
422
- 'noquotes' => true,
423
- 'default' => 'false'
424
  ),
 
 
 
 
425
  'titleShow' => array (
426
- 'id' => 'fancybox_PDFtitleShow',
427
- 'input' => 'checkbox',
428
- 'default' => '',
429
- 'description' => __('Show title','easy-fancybox')
 
430
  ),
431
  'titlePosition' => array (
432
- 'id' => 'fancybox_PDFtitlePosition',
433
- 'title' => __('Title Position','easy-fancybox'),
434
- 'label_for' => 'fancybox_PDFtitlePosition',
435
- 'input' => 'select',
436
- 'options' => array(
437
- 'float' => __('Float','easy-fancybox'), // same as 'float'
438
- 'outside' => __('Outside','easy-fancybox'),
439
- 'inside' => __('Inside','easy-fancybox')
440
- //,'over' => __('Overlay','easy-fancybox')
441
- ),
442
- 'default' => 'float',
443
  ),
444
  'titleFromAlt' => array (
445
- 'id' => 'fancybox_PDFtitleFromAlt',
446
- 'input' => 'checkbox',
447
- 'default' => '',
448
- 'description' => __('Allow title from thumbnail alt tag','easy-fancybox')
 
449
  ),
450
- 'transitionOut' => array (
451
- 'id' => 'fancybox_PDFtransitionOut',
452
- 'title' => __('Transition Out','easy-fancybox'),
453
- 'label_for' => 'fancybox_PDFtransitionOut',
454
- 'input' => 'select',
455
- 'class' => '',
456
- 'options' => array(
457
- 'fade' => __('Fade','easy-fancybox'),
458
- //'elastic' => __('Elastic','easy-fancybox'),
459
- 'none' => __('None','easy-fancybox')
460
- ),
461
- 'default' => 'fade',
462
  ),
463
  'easingIn' => array (
464
- 'default' => 'swing'
465
- ),
466
  'autoDimensions' => array (
467
- 'noquotes' => true,
468
- 'default' => 'false'
469
  ),
470
  'scrolling' => array (
471
- 'default' => 'no',
472
  ),
473
  'onStart' => array (
474
- 'noquotes' => true,
475
- // 'default' => 'function(selectedArray, selectedIndex, selectedOpts) { selectedOpts.content = \'<embed src="\' + selectedArray[selectedIndex].href + \'#nameddest=self&page=1&view=FitH,0&zoom=80,0,0" type="application/pdf" height="100%" width="100%" />\' }'
476
- 'default' => 'function(selectedArray, selectedIndex, selectedOpts) { selectedOpts.content = \'<object data="\' + selectedArray[selectedIndex].href + \'#toolbar=1&amp;navpanes=0&amp;nameddest=self&amp;page=1&amp;view=FitH,0&amp;zoom=80,0,0" type="application/pdf" height="100%" width="100%"><param name="src" value="\' + selectedArray[selectedIndex].href + \'#toolbar=1&amp;navpanes=0&amp;nameddest=self&amp;page=1&amp;view=FitH,0&amp;zoom=80,0,0" /><a href="\' + selectedArray[selectedIndex].href + \'" style="display:block;font-size:18px;height:20px;position:absolute;top:50%;margin:-10px auto 0 auto">\' + $(selectedArray[selectedIndex]).html() + \'</a></object>\' }'
477
- )
478
- )
 
 
 
 
 
479
  ),
480
 
481
  'SWF' => array(
482
  'title' => __('SWF','easy-fancybox'),
483
  'input' => 'multiple',
484
  'options' => array(
485
- 'enable' => array (
486
- 'id' => 'fancybox_enableSWF',
487
- 'input' => 'checkbox',
488
- 'hide' => true,
489
- 'default' => '',
490
- 'description' => '<strong>' . __('Enable FancyBox for','easy-fancybox') . ' ' . __('SWF','easy-fancybox') . '</strong>'
491
  ),
492
  'autoAttribute' => array (
493
- 'id' => 'fancybox_autoAttributeSWF',
494
- 'input' => 'checkbox',
495
- 'hide' => true,
496
- 'default' => '',
497
- 'selector' => 'href$=".swf"',
498
- 'description' => __('Auto-detect','easy-fancybox')
499
  ),
500
- 'class' => array (
501
- 'hide' => true,
502
- 'default' => 'fancybox-swf'
503
  ),
504
- 'intro' => array (
505
- 'hide' => true,
506
- 'description' => __('To make any Flash (.swf) file open in an overlay, switch on auto-detect or use the tag class="fancybox-swf" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br /><br />'
507
  ),
508
  'type' => array(
509
- 'default' => 'swf'
510
  ),
511
  'width' => array (
512
- 'id' => 'fancybox_SWFWidth',
513
- 'title' => __('Width'),
514
- 'label_for' => 'fancybox_SWFWidth',
515
- 'input' => 'text',
516
- 'class' => 'small-text',
517
- 'options' => array(),
518
- 'default' => '680',
519
- 'description' => ' '
 
520
  ),
521
  'height' => array (
522
- 'id' => 'fancybox_SWFHeight',
523
- 'title' => __('Height'),
524
- 'label_for' => 'fancybox_SWFHeight',
525
- 'input' => 'text',
526
- 'class' => 'small-text',
527
- 'options' => array(),
528
- 'default' => '495',
 
529
  ),
530
  'padding' => array (
531
- 'id' => 'fancybox_SWFpadding',
532
- 'title' => __('Border'),
533
- 'label_for' => 'fancybox_SWFpadding',
534
- 'input' => 'text',
535
- 'class' => 'small-text',
536
- 'default' => '0',
537
- 'description' => '<br />' . __('Width and height can be relative (%) or absolute sizes.','easy-fancybox') . ' ' . __('Set Border 0 to remove it.','easy-fancybox') . '<br />'
538
- ),
539
- 'autoScale' => array (
540
- 'noquotes' => true,
541
- 'default' => 'false'
542
  ),
543
  'titleShow' => array (
544
- 'id' => 'fancybox_SWFtitleShow',
545
- 'input' => 'checkbox',
546
- 'default' => '',
547
- 'description' => __('Show title','easy-fancybox')
 
548
  ),
549
  'titlePosition' => array (
550
- 'id' => 'fancybox_SWFtitlePosition',
551
- 'title' => __('Title Position','easy-fancybox'),
552
- 'label_for' => 'fancybox_SWFtitlePosition',
553
- 'input' => 'select',
554
- 'options' => array(
555
- 'float' => __('Float','easy-fancybox'), // same as 'float'
556
- 'outside' => __('Outside','easy-fancybox'),
557
- 'inside' => __('Inside','easy-fancybox')
558
- //,'over' => __('Overlay','easy-fancybox')
559
- ),
560
- 'default' => 'float',
561
  ),
562
  'titleFromAlt' => array (
563
- 'id' => 'fancybox_SWFtitleFromAlt',
564
- 'input' => 'checkbox',
565
- 'default' => '',
566
- 'description' => __('Allow title from thumbnail alt tag','easy-fancybox')
 
567
  ),
568
- 'transitionOut' => array (
569
- 'id' => 'fancybox_SWFtransitionOut',
570
- 'title' => __('Transition Out','easy-fancybox'),
571
- 'label_for' => 'fancybox_SWFtransitionOut',
572
- 'input' => 'select',
573
- 'class' => '',
574
- 'options' => array(
575
- 'fade' => __('Fade','easy-fancybox'),
576
- //'elastic' => __('Elastic','easy-fancybox'),
577
- 'none' => __('None','easy-fancybox')
578
- ),
579
- 'default' => 'fade',
 
 
580
  ),
581
- 'easingIn' => array (
582
- 'default' => 'swing'
 
 
 
 
 
583
  ),
584
- 'swf' => array (
585
- 'noquotes' => true,
586
- 'default' => '{\'wmode\':\'opaque\',\'allowfullscreen\':true}'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
587
  )
588
  )
589
  ),
@@ -592,119 +1057,106 @@ function easy_fancybox_settings(){
592
  'title' => __('YouTube','easy-fancybox'),
593
  'input' => 'multiple',
594
  'options' => array(
595
- 'enable' => array (
596
- 'id' => 'fancybox_enableYoutube',
597
- 'input' => 'checkbox',
598
- 'hide' => true,
599
- 'default' => '',
600
- 'description' => '<strong>' . __('Enable FancyBox for','easy-fancybox') . ' ' . __('YouTube','easy-fancybox') . '</strong>'
601
  ),
602
  'autoAttribute' => array (
603
- 'id' => 'fancybox_autoAttributeYoutube',
604
- 'input' => 'checkbox',
605
- 'hide' => true,
606
- 'default' => '',
607
- 'selector' => 'href*="youtube.com/"',
608
- //'href-replace' => "return attr.replace(new RegExp('watch\\\?v=', 'i'), 'v/')",
609
- 'description' => __('Auto-detect','easy-fancybox')
610
  ),
611
  'autoAttributeAlt' => array (
612
- 'id' => 'fancybox_autoAttributeYoutubeShortURL',
613
- 'input' => 'checkbox',
614
- 'hide' => true,
615
- 'default' => '',
616
- 'selector' => 'href*="youtu.be/"',
617
- //'href-replace' => "return attr.replace(new RegExp('youtu.be', 'i'), 'www.youtube.com/v')",
618
- 'description' => __('Auto-detect Short links','easy-fancybox')
619
  ),
620
- 'class' => array (
621
- 'hide' => true,
622
- 'default' => 'fancybox-youtube'
623
  ),
624
- 'intro' => array (
625
- 'hide' => true,
626
- 'description' => __('To make any YouTube movie open in an overlay, switch on auto-detect or use the tag class="fancybox-youtube" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br /><br />'
627
  ),
628
  'type' => array(
629
- 'default' => 'swf'
630
  ),
631
  'width' => array (
632
- 'id' => 'fancybox_YoutubeWidth',
633
- 'title' => __('Width'),
634
- 'label_for' => 'fancybox_YoutubeWidth',
635
- 'input' => 'text',
636
- 'class' => 'small-text',
637
- 'default' => '640',
638
- 'description' => ' '
 
 
 
 
639
  ),
640
  'height' => array (
641
- 'id' => 'fancybox_YoutubeHeight',
642
- 'title' => __('Height'),
643
- 'label_for' => 'fancybox_YoutubeHeight',
644
- 'input' => 'text',
645
- 'class' => 'small-text',
646
- 'default' => '385',
 
 
 
 
647
  ),
648
  'padding' => array (
649
- 'id' => 'fancybox_Youtubepadding',
650
- 'title' => __('Border'),
651
- 'label_for' => 'fancybox_Youtubepadding',
652
- 'input' => 'text',
653
- 'class' => 'small-text',
654
- 'default' => '0',
655
- 'description' => '<br />' . __('Width and height can be relative (%) or absolute sizes.','easy-fancybox') . ' ' . __('Set Border 0 to remove it.','easy-fancybox') . '<br />'
656
- ),
657
- 'autoScale' => array (
658
- 'noquotes' => true,
659
- 'default' => 'false'
660
  ),
661
  'titleShow' => array (
662
- 'id' => 'fancybox_YoutubetitleShow',
663
- 'input' => 'checkbox',
664
- 'default' => '',
665
- 'description' => __('Show title','easy-fancybox')
 
666
  ),
667
  'titlePosition' => array (
668
- 'id' => 'fancybox_YoutubetitlePosition',
669
- 'title' => __('Title Position','easy-fancybox'),
670
- 'label_for' => 'fancybox_YoutubetitlePosition',
671
- 'input' => 'select',
672
- 'options' => array(
673
- 'float' => __('Float','easy-fancybox'), // same as 'float'
674
- 'outside' => __('Outside','easy-fancybox'),
675
- 'inside' => __('Inside','easy-fancybox')
676
- //,'over' => __('Overlay','easy-fancybox')
677
- ),
678
- 'default' => 'float',
679
  ),
680
  'titleFromAlt' => array (
681
- 'id' => 'fancybox_YoutubetitleFromAlt',
682
- 'input' => 'checkbox',
683
- 'default' => '',
684
- 'description' => __('Allow title from thumbnail alt tag','easy-fancybox')
685
- ),
686
- 'transitionOut' => array (
687
- 'id' => 'fancybox_YoutubetransitionOut',
688
- 'title' => __('Transition Out','easy-fancybox'),
689
- 'label_for' => 'fancybox_YoutubetransitionOut',
690
- 'input' => 'select',
691
- 'options' => array(
692
- 'fade' => __('Fade','easy-fancybox'),
693
- //'elastic' => __('Elastic','easy-fancybox'),
694
- 'none' => __('None','easy-fancybox')
695
- ),
696
- 'default' => 'fade'
697
- ),
698
- 'easingIn' => array (
699
- 'default' => 'swing'
700
- ),
701
- 'swf' => array (
702
- 'noquotes' => true,
703
- 'default' => '{\'wmode\':\'opaque\',\'allowfullscreen\':true}'
704
  ),
705
  'onStart' => array (
706
- 'noquotes' => true,
707
- 'default' => 'function(selectedArray, selectedIndex, selectedOpts) { selectedOpts.href = selectedArray[selectedIndex].href.replace(new RegExp(\'youtu.be\', \'i\'), \'www.youtube.com/v\').replace(new RegExp(\'watch\\\?v=\', \'i\'), \'v/\') }'
708
  )
709
  )
710
  ),
@@ -713,127 +1165,97 @@ function easy_fancybox_settings(){
713
  'title' => __('Vimeo','easy-fancybox'),
714
  'input' => 'multiple',
715
  'options' => array(
716
- 'enable' => array (
717
- 'id' => 'fancybox_enableVimeo',
718
- 'input' => 'checkbox',
719
- 'hide' => true,
720
- 'default' => '',
721
- 'description' => '<strong>' . __('Enable FancyBox for','easy-fancybox') . ' ' . __('Vimeo','easy-fancybox') . '</strong>'
722
  ),
723
  'autoAttribute' => array (
724
- 'id' => 'fancybox_autoAttributeVimeo',
725
- 'input' => 'checkbox',
726
- 'hide' => true,
727
- 'default' => '',
728
- 'selector' => 'href*="vimeo.com/"',
729
- //'href-replace' => "return attr.replace(new RegExp('/([0-9])', 'i'), '/moogaloop.swf?clip_id=$1')",
730
- 'description' => __('Auto-detect','easy-fancybox')
731
  ),
732
- 'class' => array (
733
- 'hide' => true,
734
- 'default' => 'fancybox-vimeo'
735
  ),
736
- 'intro' => array (
737
- 'hide' => true,
738
- 'description' => __('To make any Vimeo movie open in an overlay, switch on auto-detect or use the tag class="fancybox-vimeo" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br /><br />'
739
  ),
740
  'type' => array(
741
- 'default' => 'swf'
742
  ),
743
  'width' => array (
744
  'id' => 'fancybox_VimeoWidth',
745
  'title' => __('Width'),
746
  'label_for' => 'fancybox_VimeoWidth',
747
- 'input' => 'text',
 
 
 
 
748
  'class' => 'small-text',
749
- 'default' => '640',
750
  'description' => ' '
751
  ),
752
  'height' => array (
753
- 'id' => 'fancybox_VimeoHeight',
754
- 'title' => __('Height'),
755
- 'label_for' => 'fancybox_VimeoHeight',
756
- 'input' => 'text',
757
- 'class' => 'small-text',
758
- 'default' => '360'
 
 
 
 
759
  ),
760
  'padding' => array (
761
- 'id' => 'fancybox_Vimeopadding',
762
- 'title' => __('Border'),
763
- 'label_for' => 'fancybox_Vimeopadding',
764
- 'input' => 'text',
765
- 'class' => 'small-text',
766
- 'default' => '0',
767
- 'description' => '<br />' . __('Width and height can be relative (%) or absolute sizes.','easy-fancybox') . ' ' . __('Set Border 0 to remove it.','easy-fancybox') . '<br />'
768
- ),
769
- 'autoScale' => array (
770
- 'noquotes' => true,
771
- 'default' => 'false'
772
- ),
773
- 'transitionOut' => array (
774
- 'id' => 'fancybox_VimeotransitionOut',
775
- 'title' => __('Transition Out','easy-fancybox'),
776
- 'label_for' => 'fancybox_VimeotransitionOut',
777
- 'input' => 'select',
778
- 'options' => array(
779
- 'fade' => __('Fade','easy-fancybox'),
780
- //'elastic' => __('Elastic','easy-fancybox'),
781
- 'none' => __('None','easy-fancybox')
782
- ),
783
- 'default' => 'fade',
784
- 'description' => __('Transition effect when closing the overlay.','easy-fancybox')
785
- ),
786
- 'easingIn' => array (
787
- 'default' => 'swing'
788
  ),
789
  'titleShow' => array (
790
- 'id' => 'fancybox_VimeotitleShow',
791