Easy FancyBox - Version 1.5.7

Version Description

  • FIX: Pro extension link update
  • NEW: WebP support and class='image' to force image media type
  • IE 6-8 css rules optional
  • iframe embed for Youtube, Vimeo and Dailymotion
  • Croation translation
  • HTML5 players allowfullscreen default
Download this release

Release Info

Developer deployer
Plugin Icon 128x128 Easy FancyBox
Version 1.5.7
Comparing to
See all releases

Code changes from version 1.3.4.9 to 1.5.7

Files changed (60) hide show
  1. easy-fancybox-admin.php +0 -0
  2. easy-fancybox-class.php +659 -0
  3. easy-fancybox-fr_FR.mo +0 -0
  4. easy-fancybox-id_ID.mo +0 -0
  5. easy-fancybox-settings.php +1026 -580
  6. easy-fancybox-tr_TR.mo +0 -0
  7. easy-fancybox.css.php +0 -33
  8. easy-fancybox.php +42 -447
  9. easy-fancybox_sk_SK.mo +0 -0
  10. fancybox/jquery.easing-1.3.pack.js +0 -72
  11. fancybox/jquery.fancybox-1.3.4.pack.js +0 -46
  12. fancybox/{jquery.fancybox-1.3.4.css → jquery.fancybox-1.3.7.css} +70 -44
  13. fancybox/{jquery.fancybox-1.3.4.js → jquery.fancybox-1.3.7.js} +88 -54
  14. fancybox/jquery.fancybox-1.3.7.min.css +1 -0
  15. fancybox/jquery.fancybox-1.3.7.min.js +43 -0
  16. fancybox/jquery.mousewheel-3.0.4.pack.js +0 -14
  17. jquery.easing.js +205 -0
  18. jquery.easing.pack.js +14 -0
  19. jquery.metadata.pack.js +21 -0
  20. jquery.mousewheel.js +221 -0
  21. jquery.mousewheel.min.js +8 -0
  22. jquery.mousewheel.pack.js +8 -0
  23. languages/easy-fancybox-cs_CZ.mo +0 -0
  24. languages/easy-fancybox-cs_CZ.po +1022 -0
  25. languages/easy-fancybox-el_GR.mo +0 -0
  26. languages/easy-fancybox-el_GR.po +1054 -0
  27. easy-fancybox-es_ES.mo → languages/easy-fancybox-es_ES.mo +0 -0
  28. languages/easy-fancybox-es_ES.po +526 -0
  29. languages/easy-fancybox-fa_IR.mo +0 -0
  30. languages/easy-fancybox-fa_IR.po +1032 -0
  31. languages/easy-fancybox-fr_FR.mo +0 -0
  32. languages/easy-fancybox-fr_FR.po +856 -0
  33. languages/easy-fancybox-gu_IN.mo +0 -0
  34. languages/easy-fancybox-gu_IN.po +983 -0
  35. easy-fancybox-hi_IN.mo → languages/easy-fancybox-hi_IN.mo +0 -0
  36. languages/easy-fancybox-hi_IN.po +525 -0
  37. languages/easy-fancybox-hr.mo +0 -0
  38. languages/easy-fancybox-hr.po +981 -0
  39. languages/easy-fancybox-id_ID.mo +0 -0
  40. languages/easy-fancybox-id_ID.po +980 -0
  41. easy-fancybox-lt_LT.mo → languages/easy-fancybox-lt_LT.mo +0 -0
  42. languages/easy-fancybox-lt_LT.po +523 -0
  43. languages/easy-fancybox-nl_NL.mo +0 -0
  44. languages/easy-fancybox-nl_NL.po +1067 -0
  45. easy-fancybox-pl_PL.mo → languages/easy-fancybox-pl_PL.mo +0 -0
  46. languages/easy-fancybox-pl_PL.po +526 -0
  47. languages/easy-fancybox-ro_RO.po +522 -0
  48. languages/easy-fancybox-sk_SK.mo +0 -0
  49. languages/easy-fancybox-sk_SK.po +1084 -0
  50. languages/easy-fancybox-sr_RS.mo +0 -0
  51. languages/easy-fancybox-sr_RS.po +1029 -0
  52. languages/easy-fancybox-tr_TR.mo +0 -0
  53. languages/easy-fancybox-tr_TR.po +1073 -0
  54. easy-fancybox-ua_UA.mo → languages/easy-fancybox-ua_UA.mo +0 -0
  55. easy-fancybox.pot → languages/easy-fancybox-ua_UA.po +140 -88
  56. languages/easy-fancybox-xx_XX.po +961 -0
  57. languages/easy-fancybox.pot +963 -0
  58. easy-fancybox-ro_RO.mo → languages/easy-fancybox.ro_RO.mo +0 -0
  59. languages/instructions.txt +28 -0
  60. readme.txt +292 -103
easy-fancybox-admin.php ADDED
File without changes
easy-fancybox-class.php ADDED
@@ -0,0 +1,659 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ public static 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
+ //if(!empty(self::$options['Global']['options']['Enable']['options']))
25
+ foreach (self::$options['Global']['options']['Enable']['options'] as $value) {
26
+ // anything enabled?
27
+ if ( isset($value['id']) && '1' == get_option($value['id'],$value['default']) ) {
28
+ self::$add_scripts = true;
29
+ break;
30
+ }
31
+ }
32
+ // and abort when none are active
33
+ if (!self::$add_scripts) {
34
+ echo '
35
+ <!-- Nothing enabled under Settings > Media > FancyBox. -->
36
+
37
+ ';
38
+ return;
39
+ }
40
+
41
+ // begin output FancyBox settings
42
+ echo '
43
+ <script type="text/javascript">
44
+ /* <![CDATA[ */
45
+ var fb_timeout = null;';
46
+
47
+ /*
48
+ * Global settings routine
49
+ */
50
+ $more=0;
51
+ echo '
52
+ var fb_opts = {';
53
+ foreach (self::$options['Global']['options'] as $globals) {
54
+ foreach ($globals['options'] as $_key => $_value) {
55
+ if ( isset($_value['id']) )
56
+ if ( isset($_value['default']) )
57
+ $parm = get_option($_value['id'], $_value['default']);
58
+ else
59
+ $parm = get_option($_value['id']);
60
+ elseif ( isset($_value['default']) )
61
+ $parm = $_value['default'];
62
+ else
63
+ $parm = '';
64
+
65
+ if ( isset($_value['input']) && 'checkbox'==$_value['input'] )
66
+ $parm = ( '1' == $parm ) ? 'true' : 'false';
67
+
68
+ if( !isset($_value['hide']) && $parm!='' ) {
69
+ $quote = (is_numeric($parm) || (isset($_value['noquotes']) && $_value['noquotes'] == true) ) ? '' : '\'';
70
+ if ($more>0)
71
+ echo ',';
72
+ echo ' \''.$_key.'\' : ';
73
+ echo $quote.$parm.$quote;
74
+ $more++;
75
+ } else {
76
+ $$_key = $parm;
77
+ }
78
+ }
79
+ }
80
+ echo ' };
81
+ var easy_fancybox_handler = function(){';
82
+
83
+ foreach (self::$options as $key => $value) {
84
+ // check if not enabled or hide=true then skip
85
+ if ( isset($value['hide']) || !get_option(self::$options['Global']['options']['Enable']['options'][$key]['id'], self::$options['Global']['options']['Enable']['options'][$key]['default']) )
86
+ continue;
87
+
88
+ echo '
89
+ /* ' . $key . ' */';
90
+ /*
91
+ * Auto-detection routines (2x)
92
+ */
93
+ $autoAttribute = (isset($value['options']['autoAttribute'])) ? get_option( $value['options']['autoAttribute']['id'], $value['options']['autoAttribute']['default'] ) : "";
94
+ // update from previous version:
95
+ if($attributeLimit == '.not(\':empty\')')
96
+ $attributeLimit = ':not(:empty)';
97
+ elseif($attributeLimit == '.has(\'img\')')
98
+ $attributeLimit = ':has(img)';
99
+
100
+ if(!empty($autoAttribute)) {
101
+ if(is_numeric($autoAttribute)) {
102
+ echo '
103
+ jQuery(\'a['.$value['options']['autoAttribute']['selector'].']:not(.nofancybox)'.$attributeLimit.', area['.$value['options']['autoAttribute']['selector'].']:not(.nofancybox)'.$attributeLimit.'\')';
104
+ //if ( isset($value['options']['autoAttribute']['href-replace']) )
105
+ // echo '.attr(\'href\', function(index, attr){'.$value['options']['autoAttribute']['href-replace'].'})';
106
+ echo '.addClass(\''.$value['options']['class']['default'].'\');';
107
+ } else {
108
+ // set selectors
109
+ $file_types = array_filter( explode( ' ', str_replace( ',', ' ', $autoAttribute ) ) );
110
+ $more=0;
111
+ echo '
112
+ var fb_'.$key.'_select = \'';
113
+ foreach ($file_types as $type) {
114
+ if ($type == "jpg" || $type == "jpeg" || $type == "png" || $type == "gif")
115
+ $type = '.'.$type;
116
+ if ($more>0)
117
+ echo ', ';
118
+ echo 'a['.$value['options']['autoAttribute']['selector'].'"'.$type.'"]:not(.nofancybox,.pin-it-button)'.$attributeLimit.', area['.$value['options']['autoAttribute']['selector'].'"'.$type.'"]:not(.nofancybox)'.$attributeLimit;
119
+ $more++;
120
+ }
121
+ echo '\';';
122
+
123
+ // class and rel depending on settings
124
+ if( '1' == get_option($value['options']['autoAttributeLimit']['id'],$value['options']['autoAttributeLimit']['default']) ) {
125
+ // add class
126
+ echo '
127
+ var fb_'.$key.'_sections = jQuery(\''.get_option($value['options']['autoSelector']['id'],$value['options']['autoSelector']['default']).'\');
128
+ fb_'.$key.'_sections.each(function() { jQuery(this).find(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\')';
129
+ // and set rel
130
+ switch( get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
131
+ case '':
132
+ default :
133
+ echo '; });';
134
+ break;
135
+ case '1':
136
+ echo '.attr(\'rel\', \'gallery-\' + fb_'.$key.'_sections.index(this)); });';
137
+ break;
138
+ case '2':
139
+ echo '.attr(\'rel\', \'gallery\'); });';
140
+ }
141
+ } else {
142
+ // add class
143
+ echo '
144
+ jQuery(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\')';
145
+ // set rel
146
+ switch( get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
147
+ case '':
148
+ default :
149
+ echo ';';
150
+ break;
151
+ case '1':
152
+ echo ';
153
+ var fb_'.$key.'_sections = jQuery(\''.get_option($value['options']['autoSelector']['id'],$value['options']['autoSelector']['default']).'\');
154
+ fb_'.$key.'_sections.each(function() { jQuery(this).find(fb_'.$key.'_select).attr(\'rel\', \'gallery-\' + fb_'.$key.'_sections.index(this)); });';
155
+ break;
156
+ case '2':
157
+ echo '.attr(\'rel\', \'gallery\');';
158
+ }
159
+ }
160
+
161
+ }
162
+ }
163
+
164
+ $autoAttributeAlt = ( isset($value['options']['autoAttributeAlt']) ) ? get_option( $value['options']['autoAttributeAlt']['id'], $value['options']['autoAttributeAlt']['default'] ) : "";
165
+ if(!empty($autoAttributeAlt) && is_numeric($autoAttributeAlt)) {
166
+ echo '
167
+ jQuery(\'a['.$value['options']['autoAttributeAlt']['selector'].']:not(.nofancybox)'.$attributeLimit.', area['.$value['options']['autoAttributeAlt']['selector'].']:not(.nofancybox)'.$attributeLimit.'\')';
168
+ //if (!empty($value['options']['autoAttributeAlt']['href-replace']))
169
+ // echo '.attr(\'href\', function(index, attr){'.$value['options']['autoAttributeAlt']['href-replace']. '})';
170
+ echo '.addClass(\''.$value['options']['class']['default'].'\');';
171
+ }
172
+
173
+ /*
174
+ * Generate .fancybox() bind
175
+ */
176
+ $trigger='';
177
+ if( $key == $autoClick )
178
+ $trigger = '.filter(\':first\').trigger(\'click\')';
179
+
180
+ echo '
181
+ jQuery(\'' . $value['options']['tag']['default']. '\')';
182
+
183
+ // use each() to allow different metadata values per instance; fix by Elron. Thanks!
184
+ if ( '1' == get_option(self::$options['Global']['options']['Links']['options']['metaData']['id'],self::$options['Global']['options']['Links']['options']['metaData']['default']) )
185
+ echo '.each(function() { jQuery(this)';
186
+
187
+ echo '.fancybox( jQuery.extend({}, fb_opts, {';
188
+ $more=0;
189
+ foreach ($value['options'] as $_key => $_value) {
190
+ if (isset($_value['id']) || isset($_value['default']))
191
+ $parm = (isset($_value['id']))? get_option($_value['id'], $_value['default']) : $_value['default'];
192
+ else
193
+ $parm = '';
194
+
195
+ if( isset($_value['input']) && 'checkbox'==$_value['input'] )
196
+ $parm = ( '1' == $parm ) ? 'true' : 'false';
197
+
198
+ if( !isset($_value['hide']) && $parm!='' ) {
199
+ $quote = (is_numeric($parm) || (isset($_value['noquotes']) && $_value['noquotes'] == true) ) ? '' : '\'';
200
+ if ($more>0)
201
+ echo ',';
202
+ echo ' \''.$_key.'\' : ';
203
+ echo $quote.$parm.$quote;
204
+ $more++;
205
+ }
206
+ }
207
+ echo ' }) ';
208
+
209
+ // use each() to allow different metadata values per instance; fix by Elron. Thanks!
210
+ if ( '1' == get_option(self::$options['Global']['options']['Links']['options']['metaData']['id'],self::$options['Global']['options']['Links']['options']['metaData']['default']) )
211
+ echo ');} ';
212
+
213
+ echo ')'.$trigger.';';
214
+
215
+ }
216
+
217
+ switch( $autoClick ) {
218
+ case '':
219
+ default :
220
+ break;
221
+ case '1':
222
+ echo '
223
+ /* Auto-click */
224
+ jQuery(\'#fancybox-auto\').trigger(\'click\');';
225
+ break;
226
+ case '99':
227
+ echo '
228
+ /* Auto-load */
229
+ jQuery(\'a[class*="fancybox"]\').filter(\':first\').trigger(\'click\');';
230
+ break;
231
+ }
232
+ echo '
233
+ }
234
+ /* ]]> */
235
+ </script>
236
+ ';
237
+
238
+ // customized styles
239
+ $styles = '';
240
+ if (isset($overlaySpotlight) && 'true' == $overlaySpotlight)
241
+ $styles .= '
242
+ #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\')";}';
243
+ if (isset($borderRadius) && !empty($borderRadius))
244
+ $styles .= '
245
+ #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}.fancybox-title-inside{padding-top:'.$borderRadius.'px;margin-top:-'.$borderRadius.'px !important;border-radius: 0 0 '.$borderRadius.'px '.$borderRadius.'px}';
246
+ if (isset($backgroundColor) && '' != $backgroundColor)
247
+ $styles .= '
248
+ #fancybox-content{background-color:'.$backgroundColor.'}';
249
+ if (isset($paddingColor) && '' != $paddingColor)
250
+ $styles .= '
251
+ #fancybox-content{border-color:'.$paddingColor.'}#fancybox-outer{background-color:'.$paddingColor.'}'; //.fancybox-title-inside{background-color:'.$paddingColor.';margin-left:0 !important;margin-right:0 !important;width:100% !important;}
252
+ if (isset($textColor) && '' != $textColor)
253
+ $styles .= '
254
+ #fancybox-content{color:'.$textColor.'}';
255
+ if (isset($titleColor) && '' != $titleColor)
256
+ $styles .= '
257
+ #fancybox-title,#fancybox-title-float-main{color:'.$titleColor.'}';
258
+
259
+ if ( !empty($styles) ) {
260
+ echo '
261
+ <style type="text/css">' . $styles . '
262
+ </style>
263
+ ';
264
+ }
265
+
266
+ // running our IE alphaimageloader relative path styles here
267
+ if (isset($compatIE6) && 'true' == $compatIE6)
268
+ echo '
269
+ <!--[if lt IE 8]>
270
+ <style type="text/css">
271
+ .fancybox-ie6 #fancybox-close{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_close.png",sizingMethod="scale")}
272
+ .fancybox-ie6 #fancybox-left-ico{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_nav_left.png",sizingMethod="scale")}
273
+ .fancybox-ie6 #fancybox-right-ico{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_nav_right.png",sizingMethod="scale")}
274
+ .fancybox-ie6 #fancybox-title-over{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_title_over.png",sizingMethod="scale");zoom:1}
275
+ .fancybox-ie6 #fancybox-title-float-left{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_title_left.png",sizingMethod="scale")}
276
+ .fancybox-ie6 #fancybox-title-float-main{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_title_main.png",sizingMethod="scale")}
277
+ .fancybox-ie6 #fancybox-title-float-right{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_title_right.png",sizingMethod="scale")}
278
+ .fancybox-ie6 #fancybox-bg-w,.fancybox-ie6 #fancybox-bg-e,.fancybox-ie6 #fancybox-left,.fancybox-ie6 #fancybox-right,#fancybox-hide-sel-frame{height:expression(this.parentNode.clientHeight+"px")}
279
+ #fancybox-loading.fancybox-ie6{position:absolute;margin-top:0;top:expression((-20+(document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2)+(ignoreMe=document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+"px")}
280
+ #fancybox-loading.fancybox-ie6 div{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_loading.png", sizingMethod="scale")}
281
+ .fancybox-ie #fancybox-bg-n{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_n.png",sizingMethod="scale")}
282
+ .fancybox-ie #fancybox-bg-ne{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_ne.png",sizingMethod="scale")}
283
+ .fancybox-ie #fancybox-bg-e{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_e.png",sizingMethod="scale")}
284
+ .fancybox-ie #fancybox-bg-se{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_se.png",sizingMethod="scale")}
285
+ .fancybox-ie #fancybox-bg-s{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_s.png",sizingMethod="scale")}
286
+ .fancybox-ie #fancybox-bg-sw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_sw.png",sizingMethod="scale")}
287
+ .fancybox-ie #fancybox-bg-w{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_w.png",sizingMethod="scale")}
288
+ .fancybox-ie #fancybox-bg-nw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_nw.png",sizingMethod="scale")}
289
+ </style>
290
+ <![endif]-->
291
+ ';
292
+
293
+ // running our IE alphaimageloader relative path styles here
294
+ if (isset($compatIE8) && 'true' == $compatIE8)
295
+ echo '
296
+ <!--[if IE 8]>
297
+ <style type="text/css">
298
+ .fancybox-ie #fancybox-bg-n{-ms-filter:\'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_n.png",sizingMethod="scale")\'}
299
+ .fancybox-ie #fancybox-bg-ne{-ms-filter:\'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_ne.png",sizingMethod="scale")\'}
300
+ .fancybox-ie #fancybox-bg-e{-ms-filter:\'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_e.png",sizingMethod="scale")\'}
301
+ .fancybox-ie #fancybox-bg-se{-ms-filter:\'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_se.png",sizingMethod="scale")\'}
302
+ .fancybox-ie #fancybox-bg-s{-ms-filter:\'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_s.png",sizingMethod="scale")\'}
303
+ .fancybox-ie #fancybox-bg-sw{-ms-filter:\'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_sw.png",sizingMethod="scale")\'}
304
+ .fancybox-ie #fancybox-bg-w{-ms-filter:\'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_w.png",sizingMethod="scale")\'}
305
+ .fancybox-ie #fancybox-bg-nw{-ms-filter:\'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' . EASY_FANCYBOX_PLUGINURL . 'fancybox/fancy_shadow_nw.png",sizingMethod="scale")\'}
306
+ </style>
307
+ <![endif]-->
308
+ ';
309
+ }
310
+
311
+
312
+ /***********************
313
+ ADMIN FUNCTIONS
314
+ ***********************/
315
+
316
+ public static function register_settings($args = array()) {
317
+ foreach ($args as $key => $value) {
318
+ // check to see if the section is enabled, else skip to next
319
+ 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']) )
320
+ continue;
321
+
322
+ switch($value['input']) {
323
+ case 'deep':
324
+ // go deeper by looping back on itself
325
+ self::register_settings($value['options']);
326
+ break;
327
+ case 'multiple':
328
+ add_settings_field( 'fancybox_'.$key, '<a name="'.$value['title'].'"></a>'.$value['title'], array(__CLASS__, 'settings_fields'), 'media', 'fancybox_section', $value);
329
+ foreach ( $value['options'] as $_value ) {
330
+ if ( !isset($_value['sanitize_callback']) )
331
+ $sanitize_callback = '';
332
+ else
333
+ $sanitize_callback = array(__CLASS__, $_value['sanitize_callback']);
334
+ if ( isset($_value['id']) )
335
+ register_setting( 'media', $_value['id'], $sanitize_callback );
336
+ }
337
+ break;
338
+ default:
339
+ if ( !isset($value['sanitize_callback']) )
340
+ $sanitize_callback = '';
341
+ else
342
+ $sanitize_callback = array(__CLASS__, $value['sanitize_callback']);
343
+ if ( isset($value['id']) )
344
+ register_setting( 'media', 'fancybox_'.$key, $sanitize_callback );
345
+ }
346
+ }
347
+ }
348
+
349
+ // add our FancyBox Media Settings Section on Settings > Media admin page
350
+ public static function settings_section() {
351
+ 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>';
352
+ }
353
+
354
+ // add our FancyBox Media Settings Fields
355
+ public static function settings_fields($args){
356
+ $disabled = (isset($args['status']) && 'disabled' == $args['status']) ? ' disabled="disabled"' : '';
357
+ if (isset($args['input']))
358
+ switch($args['input']) {
359
+ case 'multiple':
360
+ case 'deep':
361
+ foreach ($args['options'] as $options)
362
+ self::settings_fields($options);
363
+ if (isset($args['description'])) echo $args['description'];
364
+ break;
365
+ case 'select':
366
+ if( !empty($args['label_for']) )
367
+ echo '<label for="'.$args['label_for'].'">'.$args['title'].'</label> ';
368
+ else
369
+ echo $args['title'];
370
+ echo '
371
+ <select name="'.$args['id'].'" id="'.$args['id'].'">';
372
+ foreach ($args['options'] as $optionkey => $optionvalue) {
373
+ $selected = (get_option($args['id'], $args['default']) == $optionkey) ? ' selected="selected"' : '';
374
+ echo '
375
+ <option value="'.esc_attr($optionkey).'"'.$selected.' '.$disabled.' >'.$optionvalue.'</option>';
376
+ }
377
+ echo '
378
+ </select> ';
379
+ if( empty($args['label_for']) )
380
+ echo '<label for="'.$args['id'].'">'.$args['description'].'</label> ';
381
+ else
382
+ if (isset($args['description'])) echo $args['description'];
383
+ break;
384
+ case 'checkbox':
385
+ if( !empty($args['label_for']) )
386
+ echo '<label for="'.$args['label_for'].'">'.$args['title'].'</label> ';
387
+ else
388
+ if (isset($args['title'])) echo $args['title'];
389
+ $value = esc_attr( get_option($args['id'], $args['default']) );
390
+ if ($value == "1")
391
+ $checked = ' checked="checked"';
392
+ else
393
+ $checked = '';
394
+ if ($args['default'] == "1")
395
+ $default = __('Checked','easy-fancybox');
396
+ else
397
+ $default = __('Unchecked','easy-fancybox');
398
+ if( empty($args['label_for']) )
399
+ echo '
400
+ <label><input type="checkbox" name="'.$args['id'].'" id="'.$args['id'].'" value="1" '.$checked.' '.$disabled.' /> '.$args['description'].'</label><br />';
401
+ else
402
+ echo '
403
+ <input type="checkbox" name="'.$args['id'].'" id="'.$args['id'].'" value="1" '.$checked.' '.$disabled.' /> '.$args['description'].'<br />';
404
+ break;
405
+ case 'text':
406
+ if( !empty($args['label_for']) )
407
+ echo '<label for="'.$args['label_for'].'">'.$args['title'].'</label> ';
408
+ else
409
+ echo $args['title'];
410
+ echo '
411
+ <input type="text" name="'.$args['id'].'" id="'.$args['id'].'" value="'.esc_attr( get_option($args['id'], $args['default']) ).'" class="'.$args['class'].'"'.$disabled.' /> ';
412
+ if( empty($args['label_for']) )
413
+ echo '<label for="'.$args['id'].'">'.$args['description'].'</label> ';
414
+ else
415
+ if (isset($args['description'])) echo $args['description'];
416
+ break;
417
+ case 'number':
418
+ if( !empty($args['label_for']) )
419
+ echo '<label for="'.$args['label_for'].'">'.$args['title'].'</label> ';
420
+ else
421
+ echo $args['title'];
422
+ echo '
423
+ <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.' /> ';
424
+ if( empty($args['label_for']) )
425
+ echo '<label for="'.$args['id'].'">'.$args['description'].'</label> ';
426
+ else
427
+ if (isset($args['description'])) echo $args['description'];
428
+ break;
429
+ case 'hidden':
430
+ echo '
431
+ <input type="hidden" name="'.$args['id'].'" id="'.$args['id'].'" value="'.esc_attr( get_option($args['id'], $args['default']) ).'" /> ';
432
+ break;
433
+ default:
434
+ if (isset($args['description'])) echo $args['description'];
435
+ }
436
+ else
437
+ if (isset($args['description'])) echo $args['description'];
438
+ }
439
+
440
+ /**
441
+ * Adds an action link to the Plugins page
442
+ */
443
+ public static function add_action_link( $links ) {
444
+ $settings_link = '<a href="' . admin_url('options-media.php') . '">' . translate('Settings') . '</a>';
445
+ array_unshift( $links, $settings_link );
446
+ return $links;
447
+ }
448
+
449
+ public static function intval($setting = '') {
450
+ if ($setting == '')
451
+ return '';
452
+
453
+ if (substr($setting, -1) == '%') {
454
+ $val = intval(substr($setting, 0, -1));
455
+ $prc = '%';
456
+ } else {
457
+ $val = intval($setting);
458
+ $prc = '';
459
+ }
460
+
461
+ return ( $val != 0 ) ? $val.$prc : 0;
462
+ }
463
+
464
+
465
+ /***********************
466
+ ACTIONS & FILTERS
467
+ ***********************/
468
+
469
+ public static function register_scripts() {
470
+
471
+ if ( is_admin() ) return;
472
+
473
+ // ENQUEUE
474
+ // first get rid of previously registered variants of jquery.fancybox by other plugins or theme
475
+ wp_deregister_script('fancybox');
476
+ wp_deregister_script('jquery.fancybox');
477
+ wp_deregister_script('jquery_fancybox');
478
+ wp_deregister_script('jquery-fancybox');
479
+ // register main fancybox script
480
+ if ( defined('WP_DEBUG') && true == WP_DEBUG )
481
+ wp_register_script('jquery-fancybox', EASY_FANCYBOX_PLUGINURL.'fancybox/jquery.fancybox-'.FANCYBOX_VERSION.'.js', array('jquery'), EASY_FANCYBOX_VERSION, true);
482
+ else
483
+ wp_register_script('jquery-fancybox', EASY_FANCYBOX_PLUGINURL.'fancybox/jquery.fancybox-'.FANCYBOX_VERSION.'.min.js', array('jquery'), EASY_FANCYBOX_VERSION, true);
484
+
485
+ // easing in IMG settings?
486
+ 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']) ) ) {
487
+ // do nothing
488
+ } else {
489
+ 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']) ) {
490
+ wp_deregister_script('jquery-easing');
491
+ wp_register_script('jquery-easing', EASY_FANCYBOX_PLUGINURL.'jquery.easing.pack.js', array('jquery'), EASING_VERSION, true);
492
+ }
493
+ }
494
+
495
+ // mousewheel in IMG settings?
496
+ if ( '1' == get_option( self::$options['IMG']['options']['mouseWheel']['id'], self::$options['IMG']['options']['mouseWheel']['default']) ) {
497
+ wp_deregister_script('jquery-mousewheel');
498
+ wp_register_script('jquery-mousewheel', EASY_FANCYBOX_PLUGINURL.'jquery.mousewheel.min.js', array('jquery'), MOUSEWHEEL_VERSION, true);
499
+ }
500
+
501
+ // metadata in Link settings?
502
+ if ('1' == get_option( self::$options['Global']['options']['Links']['options']['metaData']['id'], self::$options['Global']['options']['Links']['options']['metaData']['default']) ) {
503
+ wp_deregister_script('jquery-metadata');
504
+ wp_register_script('jquery-metadata',EASY_FANCYBOX_PLUGINURL.'jquery.metadata.pack.js', array('jquery'), METADATA_VERSION, true);
505
+ }
506
+ }
507
+
508
+ public static function enqueue_styles() {
509
+ // register style
510
+ wp_dequeue_style('fancybox');
511
+ if ( defined('WP_DEBUG') && true == WP_DEBUG )
512
+ wp_enqueue_style('fancybox', EASY_FANCYBOX_PLUGINURL.'fancybox/jquery.fancybox-'.FANCYBOX_VERSION.'.css', false, EASY_FANCYBOX_VERSION, 'screen');
513
+ else
514
+ wp_enqueue_style('fancybox', EASY_FANCYBOX_PLUGINURL.'fancybox/jquery.fancybox-'.FANCYBOX_VERSION.'.min.css', false, EASY_FANCYBOX_VERSION, 'screen');
515
+ }
516
+
517
+ public static function enqueue_footer_scripts() {
518
+ if (!self::$add_scripts)
519
+ return;
520
+
521
+ wp_enqueue_script('jquery-fancybox');
522
+ wp_enqueue_script('jquery-easing');
523
+ wp_enqueue_script('jquery-mousewheel');
524
+ wp_enqueue_script('jquery-metadata');
525
+ }
526
+
527
+ public static function on_ready() {
528
+ if (!self::$add_scripts) // abort mission, there is no need for any script files
529
+ return;
530
+
531
+ // 'gform_post_render' for gForms content triggers an error... Why?
532
+ // 'post-load' is for Infinite Scroll by JetPack
533
+ echo '
534
+ <script type="text/javascript">
535
+ jQuery(document).on(\'ready post-load\', easy_fancybox_handler );
536
+ </script>
537
+ ';
538
+ }
539
+
540
+ public static function admin_init(){
541
+
542
+ add_filter('plugin_action_links_' . EASY_FANCYBOX_PLUGINBASENAME, array(__CLASS__, 'add_action_link') );
543
+
544
+ // in preparation of dedicated admin page move:
545
+ //add_action('admin_menu', array(__CLASS__, 'add_menu'));
546
+
547
+ add_settings_section('fancybox_section', __('FancyBox','easy-fancybox'), array(__CLASS__, 'settings_section'), 'media');
548
+
549
+ self::register_settings( self::$options );
550
+
551
+ // TODO : fix?? media_upload_max_image_resize() does not exist anymore...
552
+ //add_action( 'pre-upload-ui', 'media_upload_max_image_resize' );
553
+ }
554
+
555
+ // Hack to fix missing wmode in Youtube oEmbed code based on David C's code in the comments on
556
+ // http://www.mehigh.biz/wordpress/adding-wmode-transparent-to-wordpress-3-media-embeds.html
557
+ public static function add_video_wmode_opaque($html, $url, $attr) {
558
+ if (strpos($html, "<embed src=" ) !== false) {
559
+ $html = str_replace('</param><embed', '</param><param name="wmode" value="opaque"></param><embed wmode="opaque"', $html);
560
+ } elseif (strpos($html, 'youtube' ) !== false && strpos($html, 'wmode' ) == false ) {
561
+ $html = str_replace('feature=oembed', 'feature=oembed&wmode=opaque', $html);
562
+ } elseif ( strpos($html, "vimeo" ) !== false && strpos($html, 'wmode' ) == false ) {
563
+ $html = str_replace('" width', '?theme=none&wmode=opaque" width', $html);
564
+ } elseif ( strpos($html, "dailymotion" ) !== false && strpos($html, 'wmode' ) == false ) {
565
+ $html = str_replace('" width', '?wmode=opaque" width', $html);
566
+ }
567
+ return $html;
568
+ }
569
+
570
+ public static function init() {
571
+ require_once(EASY_FANCYBOX_PLUGINDIR . 'easy-fancybox-settings.php');
572
+
573
+ add_filter('embed_oembed_html', array(__CLASS__, 'add_video_wmode_opaque'), 10, 3);
574
+ }
575
+
576
+ public static function textdomain() {
577
+ if ( is_admin() ) {
578
+ load_plugin_textdomain('easy-fancybox', false, dirname( EASY_FANCYBOX_PLUGINBASENAME ) . '/languages/');
579
+ }
580
+ }
581
+ /**********************
582
+ ADMIN
583
+ **********************/
584
+
585
+ public static function add_menu() {
586
+ /* Register our plugin page */
587
+ self::$pagehook = add_submenu_page( 'themes.php', __('Easy FancyBox Settings', 'easy-fancybox'), __('FancyBox', 'easy-fancybox'), 'manage_options', 'easy-fancybox', array(__CLASS__, 'admin') );
588
+ /* Using registered $page handle to hook script load */
589
+ add_action('load-' . self::$pagehook, array(__CLASS__, 'admin_scripts'));
590
+ }
591
+
592
+ public static function admin() {
593
+
594
+ add_filter( 'get_user_option_closedpostboxes_'.self::$pagehook, array(__CLASS__, 'closed_meta_boxes') );
595
+
596
+ add_meta_box('submitdiv', __('Sections','easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_submit'), self::$pagehook, 'side', 'high');
597
+ add_meta_box('globaldiv', __('Global settings', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_global'), self::$pagehook, 'normal', 'high');
598
+ add_meta_box('imgdiv', __('Images', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_img'), self::$pagehook, 'normal', 'normal');
599
+ add_meta_box('inlinediv', __('Inline content', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_inline'), self::$pagehook, 'normal', 'normal');
600
+ add_meta_box('pdfdiv', __('PDF', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_pdf'), self::$pagehook, 'normal', 'normal');
601
+ add_meta_box('swfdiv', __('SWF', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_swf'), self::$pagehook, 'normal', 'normal');
602
+ add_meta_box('youtubediv', __('YouTube', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_youtube'), self::$pagehook, 'normal', 'normal');
603
+ add_meta_box('vimeodiv', __('Vimeo', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_vimeo'), self::$pagehook, 'normal', 'normal');
604
+ add_meta_box('dailymotiondiv', __('Dailymotion', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_dailymotion'), self::$pagehook, 'normal', 'normal');
605
+ add_meta_box('iframediv', __('iFrames', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_iframe'), self::$pagehook, 'normal', 'normal');
606
+
607
+ //load admin page
608
+ include(EASY_FANCYBOX_PLUGINDIR . '/easy-fancybox-admin.php');
609
+ }
610
+
611
+ public function closed_meta_boxes( $closed ) {
612
+
613
+ if ( false === $closed )
614
+ // set default closed metaboxes
615
+ $closed = array( 'advanceddiv', 'supportdiv', 'creditsdiv', 'resourcesdiv' );
616
+ else
617
+ // remove closed setting of some metaboxes
618
+ $closed = array_diff ( $closed , array ( 'submitdiv' ) );
619
+
620
+ return $closed;
621
+ }
622
+
623
+ public static function admin_scripts($hook) {
624
+
625
+ // needed javascripts to allow drag/drop, expand/collapse and hide/show of boxes
626
+ wp_enqueue_script('common');
627
+ wp_enqueue_script('wp-list');
628
+ wp_enqueue_script('postbox');
629
+
630
+ //add several metaboxes now, all metaboxes registered during load page can be switched off/on at "Screen Options" automatically, nothing special to do therefore
631
+ //add_meta_box('advanceddiv', __('Advanced Options', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_advanced'), self::$pagehook, 'normal', 'core');
632
+
633
+ add_meta_box('supportdiv', __('Support','easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_support'), self::$pagehook, 'side', 'core');
634
+ add_meta_box('resourcesdiv', __('Resources','skype-online-status'), array(__CLASS__.'_Admin', 'meta_box_resources'), self::$pagehook, 'side', 'low');
635
+ add_meta_box('discussiondiv', translate('Discussion'), array(__CLASS__.'_Admin', 'meta_box_discussion'), self::$pagehook, 'normal', 'low');
636
+ add_meta_box('creditsdiv', __('Credits','skype-online-status'), array(__CLASS__.'_Admin', 'meta_box_credits'), self::$pagehook, 'side', 'default');
637
+
638
+ }
639
+
640
+ /**********************
641
+ RUN
642
+ **********************/
643
+
644
+ static function run() {
645
+
646
+ // HOOKS //
647
+ add_action('plugins_loaded', array(__CLASS__, 'textdomain'));
648
+
649
+ add_action('admin_init', array(__CLASS__, 'admin_init'));
650
+
651
+ add_action('init', array(__CLASS__, 'init'));
652
+ add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_styles'), 999);
653
+ add_action('wp_head', array(__CLASS__, 'main_script'), 999);
654
+ add_action('wp_print_scripts', array(__CLASS__, 'register_scripts'), 999);
655
+ add_action('wp_footer', array(__CLASS__, 'enqueue_footer_scripts'));
656
+ add_action('wp_footer', array(__CLASS__, 'on_ready'), 999);
657
+ }
658
+
659
+ }
easy-fancybox-fr_FR.mo DELETED
Binary file
easy-fancybox-id_ID.mo DELETED
Binary file
easy-fancybox-settings.php CHANGED
@@ -1,27 +1,37 @@
1
  <?php
2
- function easy_fancybox_settings(){
 
 
 
 
3
 
4
- return array (
5
  'Global' => array(
6
  'title' => __('Global settings','easy-fancybox'),
7
  'input' => 'deep',
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
  'Enable' => array (
15
- 'title' => __('Enable FancyBox for','easy-fancybox'),
16
  'input' => 'multiple',
17
  'hide' => true,
18
  'options' => array(
 
 
 
 
19
  'IMG' => array (
20
  'id' => 'fancybox_enableImg',
21
  'input' => 'checkbox',
22
  'hide' => true,
23
- 'default' => ( function_exists('is_plugin_active_for_network') && is_plugin_active_for_network(plugin_basename( __FILE__ )) ) ? '' : '1',
24
- 'description' => '<strong>' . __('Images & Inline content','easy-fancybox') . '</strong>'
 
 
 
 
 
 
 
25
  ),
26
  'PDF' => array (
27
  'id' => 'fancybox_enablePDF',
@@ -37,6 +47,13 @@ function easy_fancybox_settings(){
37
  'default' => '',
38
  'description' => '<strong>' . __('SWF','easy-fancybox') . '</strong>'
39
  ),
 
 
 
 
 
 
 
40
  'YouTube' => array (
41
  'id' => 'fancybox_enableYoutube',
42
  'input' => 'checkbox',
@@ -65,17 +82,14 @@ function easy_fancybox_settings(){
65
  'default' => '',
66
  'description' => '<strong>' . __('iFrames','easy-fancybox') . '</strong>'
67
  )
68
- )
 
69
  ),
70
  'Links' => array(
71
- 'title' => __('Links'),
72
  'input' => 'multiple',
73
  'hide' => true,
74
  'options' => array(
75
- /*'p1' => array (
76
- 'hide' => true,
77
- 'description' => '<br />'
78
- ),*/
79
  'attributeLimit' => array (
80
  'id' => 'fancybox_attributeLimit',
81
  'title' => __('Exclude','easy-fancybox'),
@@ -83,7 +97,7 @@ function easy_fancybox_settings(){
83
  'hide' => true,
84
  'input' => 'select',
85
  'options' => array(
86
- '' => __('None'),
87
  ':not(:empty)' => __('Empty (hidden) links','easy-fancybox'),
88
  ':has(img)' => __('Without thumbnail image','easy-fancybox')
89
  ),
@@ -92,24 +106,23 @@ function easy_fancybox_settings(){
92
  ),
93
  'autoClick' => array (
94
  'id' => 'fancybox_autoClick',
95
- 'title' => __('Auto-open','easy-fancybox'),
96
  'label_for' => 'fancybox_autoClick',
97
  'hide' => true,
98
  'input' => 'select',
99
  'options' => array(
100
- '' => __('None'),
101
  '1' => __('Link with ID "fancybox-auto"','easy-fancybox'),
102
- 'IMG' => __('First Image link','easy-fancybox'),
103
- 'PDF' => __('First PDF link','easy-fancybox'),
104
- 'SWF' => __('First SWF link','easy-fancybox'),
105
- 'YouTube' => __('First YouTube link ','easy-fancybox'),
106
- 'Vimeo' => __('First Vimeo link ','easy-fancybox'),
107
- 'Dailymotion' => __('First Dailymotion link ','easy-fancybox'),
108
- 'iFrame' => __('First iFrame link','easy-fancybox'),
109
- '99' => __('First of any link','easy-fancybox'),
110
  ),
111
  'default' => '1',
112
- 'description' => '<br />'
 
 
 
 
 
 
 
113
  )
114
  )
115
  ),
@@ -121,21 +134,25 @@ function easy_fancybox_settings(){
121
  'overlayShow' => array (
122
  'id' => 'fancybox_overlayShow',
123
  'input' => 'checkbox',
 
124
  'default' => '1',
125
  'description' => __('Show the overlay around content opened in FancyBox.','easy-fancybox')
126
  ),
127
- 'overlaySpotlight' => array (
128
- 'id' => 'fancybox_overlaySpotlight',
129
  'input' => 'checkbox',
130
- 'hide' => true,
131
- 'default' => '',
132
- 'description' => __('Spotlight effect.','easy-fancybox')
133
  ),
134
  'overlayOpacity' => array (
135
  'id' => 'fancybox_overlayOpacity',
136
  'title' => __('Opacity','easy-fancybox'),
137
  'label_for' => 'fancybox_overlayOpacity',
138
- 'input' => 'text',
 
 
 
139
  'class' => 'small-text',
140
  'default' => '',
141
  'description' => __('Value between 0 and 1. ','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 0.7</em><br />'
@@ -148,10 +165,17 @@ function easy_fancybox_settings(){
148
  'class' => 'small-text',
149
  'default' => '',
150
  'description' => __('Enter an HTML color value.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' #777</em><br />'
 
 
 
 
 
 
 
 
151
  )
152
  )
153
  ),
154
-
155
  'Window' => array (
156
  'title' => __('Window','easy-fancybox'),
157
  'input' => 'multiple',
@@ -159,43 +183,39 @@ function easy_fancybox_settings(){
159
  'options' => array(
160
  'p1' => array (
161
  'hide' => true,
162
- 'description' => '<strong>' . __('Size') . '</strong><br />'
163
  ),
164
- 'width' => array (
165
- 'id' => 'fancybox_width',
166
- 'title' => __('Width'),
167
- 'label_for' => 'fancybox_width',
168
- 'input' => 'text',
169
- 'class' => 'small-text',
170
- 'default' => '',
171
- 'description' => ' '
172
  ),
173
- 'height' => array (
174
- 'id' => 'fancybox_height',
175
- 'title' => __('Height'),
176
- 'label_for' => 'fancybox_height',
177
  'input' => 'text',
 
178
  'class' => 'small-text',
179
- 'default' => ''
 
180
  ),
181
- 'padding' => array (
182
- 'id' => 'fancybox_padding',
183
- 'title' => __('Border'),
184
- 'label_for' => 'fancybox_padding',
185
  'input' => 'text',
 
186
  'class' => 'small-text',
187
  'default' => '',
188
- 'description' => '<em>' . __('Default:','easy-fancybox') . ' 560 x 340 x 10</em><br />'
189
- ),
190
- 'p2' => array (
191
- 'hide' => true,
192
- 'description' => '<br /><strong>' . __('Color','easy-fancybox') . '</strong><br />'
193
  ),
194
- 'backgroundColor' => array (
195
- 'id' => 'fancybox_backgroundColor',
196
  'hide' => true,
197
- 'title' => __('Background'),
198
- 'label_for' => 'fancybox_backgroundColor',
199
  'input' => 'text',
200
  'class' => 'small-text',
201
  'default' => '',
@@ -204,64 +224,97 @@ function easy_fancybox_settings(){
204
  'paddingColor' => array (
205
  'id' => 'fancybox_paddingColor',
206
  'hide' => true,
207
- 'title' => __('Border'),
208
- 'label_for' => 'fancybox_paddingColor',
209
  'input' => 'text',
210
  'class' => 'small-text',
211
  'default' => '',
212
- 'description' => ''
213
  ),
214
- 'textColor' => array (
215
- 'id' => 'fancybox_textColor',
216
  'hide' => true,
217
- 'title' => __('Text'),
218
- 'label_for' => 'fancybox_textColor',
219
- 'input' => 'text',
 
 
 
220
  'class' => 'small-text',
221
  'default' => '',
222
- 'description' => ''
223
  ),
224
- 'frameOpacity' => array (
225
- 'id' => 'fancybox_frameOpacity',
226
  'hide' => true,
227
- 'title' => __('Opacity','easy-fancybox'),
228
- 'label_for' => 'fancybox_frameOpacity',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  'input' => 'text',
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  'class' => 'small-text',
231
  'default' => '',
232
- 'description' => '<br /><em>' . __('Default:','easy-fancybox') . ' #fff x #fff x inherit x 1.0</em><br />'
233
  ),
234
- 'p3' => array (
 
235
  'hide' => true,
236
  'description' => '<br /><strong>' . __('Behavior','easy-fancybox') . '</strong><br />'
237
  ),
238
  'centerOnScroll' => array (
239
  'id' => 'fancybox_centerOnScroll',
240
  'input' => 'checkbox',
 
241
  'default' => '1',
242
  'description' => __('Center while scrolling','easy-fancybox')
243
  ),
244
- 'showCloseButton' => array (
245
- 'id' => 'fancybox_showCloseButton',
246
  'input' => 'checkbox',
 
247
  'default' => '1',
248
- 'description' => __('Show the (X) close button','easy-fancybox')
249
  ),
250
- 'showNavArrows' => array (
251
- 'id' => 'fancybox_showNavArrows',
252
  'input' => 'checkbox',
 
253
  'default' => '1',
254
- 'description' => __('Show the gallery navigation arrows','easy-fancybox')
255
- ),
256
- 'p4' => array (
257
- 'hide' => true,
258
- 'description' => '<br />'
259
  ),
260
  'speedIn' => array (
261
  'id' => 'fancybox_speedIn',
262
  'title' => __('Opening speed','easy-fancybox'),
263
  'label_for' => 'fancybox_speedIn',
264
- 'input' => 'text',
 
 
 
 
265
  'class' => 'small-text',
266
  'default' => '',
267
  ),
@@ -269,118 +322,155 @@ function easy_fancybox_settings(){
269
  'id' => 'fancybox_speedOut',
270
  'title' => __('Closing speed','easy-fancybox'),
271
  'label_for' => 'fancybox_speedOut',
272
- 'input' => 'text',
 
 
 
 
273
  'class' => 'small-text',
274
  'default' => '',
 
 
 
 
 
 
 
 
 
 
 
 
 
275
  ),
276
- 'changeFade' => array (
277
- 'id' => 'fancybox_changeFade',
278
- 'title' => __('Fade speed','easy-fancybox'),
279
- 'label_for' => 'fancybox_changeFade',
280
- 'input' => 'text',
 
 
 
 
281
  'class' => 'small-text',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  'default' => '',
283
- 'description' => '<br />' . __('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 300</em><br />'
284
  ),
285
- 'p5' => array (
 
 
286
  'hide' => true,
287
- 'description' => '<br />'
 
288
  ),
289
- 'onComplete' => array (
290
- 'id' => 'fancybox_onComplete',
291
- 'title' => __('Advanced','easy-fancybox'),
292
- 'label_for' => 'fancybox_onComplete',
293
- 'input' => 'select',
294
- 'options' => array(
295
- '' => __('None','easy-fancybox'), // no extra's
296
- 'function() { $(\'#fancybox-title\').hide(); $(\'#fancybox-wrap\').hover(function() { $(\'#fancybox-title\').show(); }, function() { $(\'#fancybox-title\').hide(); }); }' => __('Hide/show title on mouse hover action','easy-fancybox'),
297
- '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')
298
- ), // \'jQuery("#fancybox-right").trigger("click")\'
299
- // \'jQuery.event.trigger("fancybox-next")\'
300
- // \'jQuery.fancybox.next()\'
301
- // function(){jQuery.fancybox.next();}
302
- 'noquotes' => true,
303
  'default' => '',
304
- '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 />'
305
  ),
306
- 'onCleanup' => array (
307
- 'noquotes' => true,
308
- 'default' => 'function() { if(fb_timeout) { window.clearTimeout(fb_timeout); fb_timeout = null; } }'
309
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  )
311
  )
312
-
313
  )
314
  ),
 
315
  'IMG' => array(
316
- 'title' => __('Images & Inline content','easy-fancybox'),
317
  'input' => 'multiple',
318
  'options' => array(
319
  'intro' => array (
320
- 'hide' => true,
321
- 'description' => __('To make images open in an overlay, add their extension to the auto-detect field or use the class "fancybox" for its link. Clear field to switch off auto-enabling.','easy-fancybox') . '<br />'
 
 
 
 
 
 
 
 
 
 
 
322
  ),
323
  'autoAttribute' => array (
324
- 'id' => 'fancybox_autoAttribute',
325
- 'title' => __('Auto-detect','easy-fancybox'),
326
- 'label_for' => 'fancybox_autoAttribute',
327
- 'input' => 'text',
328
- 'class' => 'regular-text',
329
- 'hide' => true,
330
- 'default' => 'jpg gif png',
331
- 'selector' => 'href$=',
332
- 'description' => ' <em>' . __('Default:','easy-fancybox') . ' jpg gif png</em><br /><br />'
333
  ),
334
  'autoAttributeLimit' => array (
335
- 'id' => 'fancybox_autoAttributeLimit',
336
- 'title' => __('Apply to','easy-fancybox'),
337
- 'label_for' => 'fancybox_autoAttributeLimit',
338
- 'hide' => true,
339
- 'input' => 'select',
340
- 'options' => array(
341
- '' => __('All image links', 'easy-fancybox'),
342
- '1' => __('Links inside Section(s) only (below)','easy-fancybox')
343
- ),
344
- 'default' => '',
345
- 'description' => '<em>' . __('Default:','easy-fancybox') . ' ' . 'All image links' . '</em><br />'
346
  ),
347
- 'autoGallery' => array (
348
- 'id' => 'fancybox_autoGallery',
349
- 'title' => __('Auto-gallery','easy-fancybox'),
350
- 'label_for' => 'fancybox_autoGallery',
351
- 'hide' => true,
352
- 'input' => 'select',
353
- 'options' => array(
354
- '' => __('Disabled'),
355
- '1' => __('Galleries per Section (below)','easy-fancybox'),
356
- '2' => __('All in one gallery','easy-fancybox')
357
- ),
358
- 'default' => '2',
359
- 'description' => '<br />&nbsp; ' . __('When disabled, you can use the rel attribute to manually group image links together.','easy-fancybox') . '<br />'
360
  ),
361
- 'autoSelector' => array (
362
- 'id' => 'fancybox_autoGallerySelector',
363
- 'title' => __('Section(s)','easy-fancybox'),
364
- 'label_for' => 'fancybox_autoGallerySelector',
365
- 'hide' => true,
366
- 'input' => 'text',
367
- 'class' => 'regular-text',
368
- 'default' => 'article, div.hentry',
369
- 'description' => ' <em>' . __('Default:','easy-fancybox') . ' ' . 'article, div.hentry' . '</em><br />' . __('This applies when <em>Apply to</em> is set to <em>Limited to Sections</em> and/or <em>Auto-gallery</em> is set to <em>Galleries per Section</em>. Adapt it to conform with your theme.','easy-fancybox') . '<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') . '<br /><br />'
370
- ),
371
- /* 'onStart' => array (
372
- 'noquotes' => true,
373
- 'default' => 'function() { window.clearTimeout(fb_timeout); }'
374
- ),*/
375
  'transitionIn' => array (
376
  'id' => 'fancybox_transitionIn',
377
  'title' => __('Transition In','easy-fancybox'),
378
  'label_for' => 'fancybox_transitionIn',
379
  'input' => 'select',
380
  'options' => array(
 
381
  '' => __('Fade','easy-fancybox'),
382
  'elastic' => __('Elastic','easy-fancybox'),
383
- 'none' => __('None','easy-fancybox')
384
  ),
385
  'default' => 'elastic',
386
  'description' => ' '
@@ -393,12 +483,11 @@ function easy_fancybox_settings(){
393
  'options' => array(
394
  'linear' => __('Linear','easy-fancybox'),
395
  '' => __('Swing','easy-fancybox'),
396
- 'easeOutBack' => __('Back','easy-fancybox'),
397
- 'easeOutQuad' => __('Quad','easy-fancybox'),
398
- 'easeOutExpo' => __('Expo','easy-fancybox'),
399
  ),
400
  'default' => 'easeOutBack',
401
- 'description' => '<br />'
402
  ),
403
  'transitionOut' => array (
404
  'id' => 'fancybox_transitionOut',
@@ -406,9 +495,9 @@ function easy_fancybox_settings(){
406
  'label_for' => 'fancybox_transitionOut',
407
  'input' => 'select',
408
  'options' => array(
 
409
  '' => __('Fade','easy-fancybox'),
410
  'elastic' => __('Elastic','easy-fancybox'),
411
- 'none' => __('None','easy-fancybox')
412
  ),
413
  'default' => 'elastic',
414
  'description' => ' '
@@ -421,22 +510,34 @@ function easy_fancybox_settings(){
421
  'options' => array(
422
  'linear' => __('Linear','easy-fancybox'),
423
  '' => __('Swing','easy-fancybox'),
424
- 'easeInBack' => __('Back','easy-fancybox'),
425
- 'easeInQuad' => __('Quad','easy-fancybox'),
426
- 'easeInExpo' => __('Expo','easy-fancybox'),
427
  ),
428
  'default' => 'easeInBack',
429
- 'description' => '<br />' . __('Easing effects only apply when Transition is set to Elastic. ','easy-fancybox') . '<br />'
430
  ),
431
  'opacity' => array (
432
  'id' => 'fancybox_opacity',
433
  'input' => 'checkbox',
 
 
 
 
 
 
 
 
434
  'default' => '',
435
- 'description' => __('Transparency fade during elastic transition.','easy-fancybox') . '<br />'
 
 
 
 
436
  ),
437
  'titleShow' => array (
438
  'id' => 'fancybox_titleShow',
439
  'input' => 'checkbox',
 
440
  'default' => '1',
441
  'description' => __('Show title','easy-fancybox')
442
  ),
@@ -446,7 +547,7 @@ function easy_fancybox_settings(){
446
  'label_for' => 'fancybox_titlePosition',
447
  'input' => 'select',
448
  'options' => array(
449
- '' => __('Float','easy-fancybox'), // same as 'float'
450
  'outside' => __('Outside','easy-fancybox'),
451
  'inside' => __('Inside','easy-fancybox'),
452
  'over' => __('Overlay','easy-fancybox')
@@ -457,10 +558,111 @@ function easy_fancybox_settings(){
457
  'titleFromAlt' => array (
458
  'id' => 'fancybox_titleFromAlt',
459
  'input' => 'checkbox',
 
460
  'default' => '1',
461
  'description' => __('Allow title from thumbnail alt tag','easy-fancybox')
462
  ),
463
- /* 'titleFormat' => array (
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
  'id' => 'fancybox_titleFormat',
465
  'title' => __('Title format','easy-fancybox'),
466
  'label_for' => 'fancybox_titleFormat',
@@ -474,130 +676,240 @@ function easy_fancybox_settings(){
474
  'default' => '',
475
  'description' => '<br />' . __('To improve Lightbox2 style disable Show close button and set titleposition to Inside or Outside','easy-fancybox') . '<br />'
476
  ),*/
477
- 'tag' => array (
478
- 'hide' => true,
479
- 'default' => 'a, area'
480
- ),
481
- 'class' => array (
482
- 'hide' => true,
483
- 'default' => 'fancybox'
484
- )
485
  )
486
  ),
487
 
488
- 'PDF' => array(
489
- 'title' => __('PDF','easy-fancybox'),
490
- 'input' => 'multiple',
491
  'options' => array(
492
  'intro' => array (
493
- 'hide' => true,
494
- 'description' => __('To make any PDF document file open in an overlay, switch on auto-detect or use the class "fancybox-pdf" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br />'
495
- ),
496
- 'autoAttribute' => array (
497
- 'id' => 'fancybox_autoAttributePDF',
498
- 'input' => 'checkbox',
499
- 'hide' => true,
500
- 'default' => '1',
501
- 'selector' => 'href$=".pdf"',
502
- 'description' => __('Auto-detect','easy-fancybox') . '<br />'
503
  ),
504
  'tag' => array (
505
- 'hide' => true,
506
- 'default' => 'a, area'
507
  ),
508
  'class' => array (
509
- 'hide' => true,
510
- 'default' => 'fancybox-pdf'
511
  ),
512
  'type' => array (
513
- 'default' => 'html'
514
- ),
515
- 'width' => array (
516
- 'id' => 'fancybox_PDFwidth',
517
- 'title' => __('Width'),
518
- 'label_for' => 'fancybox_PDFwidth',
519
- 'input' => 'text',
520
- 'class' => 'small-text',
521
- 'default' => '90%',
522
- 'description' => ' '
523
  ),
524
- 'height' => array (
525
- 'id' => 'fancybox_PDFheight',
526
- 'title' => __('Height'),
527
- 'label_for' => 'fancybox_PDFheight',
528
- 'input' => 'text',
529
- 'class' => 'small-text',
530
- 'default' => '90%'
531
- ),
532
- 'padding' => array (
533
- 'id' => 'fancybox_PDFpadding',
534
- 'title' => __('Border'),
535
- 'label_for' => 'fancybox_PDFpadding',
536
- 'input' => 'text',
537
- 'class' => 'small-text',
538
- 'default' => '10',
539
- 'description' => '<br /><br />'
540
- ),
541
- 'autoScale' => array (
542
- 'noquotes' => true,
543
- 'default' => 'false'
544
- ),
545
- 'titleShow' => array (
546
- 'id' => 'fancybox_PDFtitleShow',
547
- 'input' => 'checkbox',
548
- 'default' => '',
549
- 'description' => __('Show title','easy-fancybox')
550
  ),
551
- 'titlePosition' => array (
552
- 'id' => 'fancybox_PDFtitlePosition',
553
- 'title' => __('Title Position','easy-fancybox'),
554
- 'label_for' => 'fancybox_PDFtitlePosition',
555
- 'input' => 'select',
556
- 'options' => array(
557
- 'float' => __('Float','easy-fancybox'), // same as 'float'
558
- 'outside' => __('Outside','easy-fancybox'),
559
- 'inside' => __('Inside','easy-fancybox')
560
- //,'over' => __('Overlay','easy-fancybox')
561
- ),
562
- 'default' => 'float',
563
  ),
564
- 'titleFromAlt' => array (
565
- 'id' => 'fancybox_PDFtitleFromAlt',
566
- 'input' => 'checkbox',
567
- 'default' => '1',
568
- 'description' => __('Allow title from thumbnail alt tag','easy-fancybox')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
569
  ),
570
  /* 'transitionOut' => array (
571
- 'id' => 'fancybox_PDFtransitionOut',
572
- 'title' => __('Transition Out','easy-fancybox'),
573
- 'label_for' => 'fancybox_PDFtransitionOut',
574
- 'input' => 'select',
575
- 'class' => '',
576
- 'options' => array(
577
- 'fade' => __('Fade','easy-fancybox'),
578
- //'elastic' => __('Elastic','easy-fancybox'),
579
- 'none' => __('None','easy-fancybox')
580
- ),
581
- 'default' => 'fade',
582
  ),
583
  'easingIn' => array (
584
- 'default' => 'swing'
585
  ),*/
586
  'autoDimensions' => array (
587
- 'noquotes' => true,
588
- 'default' => 'false'
589
  ),
590
  'scrolling' => array (
591
- 'default' => 'no',
592
  ),
593
  'onStart' => array (
594
- 'noquotes' => true,
595
- // '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%" />\' }'
596
- '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" /><embed src="\' + 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%" /><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>\' }'
 
597
  ),
598
  /* 'onClosed' => array (
599
- 'noquotes' => true,
600
- 'default' => 'function() { $("#fancybox-content").empty(); }'
601
  )*/
602
  )
603
  ),
@@ -607,88 +919,186 @@ function easy_fancybox_settings(){
607
  'input' => 'multiple',
608
  'options' => array(
609
  'intro' => array (
610
- 'hide' => true,
611
- 'description' => __('To make any Flash (.swf) file open in an overlay, switch on auto-detect or use the class "fancybox-swf" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br />'
612
  ),
613
  'autoAttribute' => array (
614
- 'id' => 'fancybox_autoAttributeSWF',
615
- 'input' => 'checkbox',
616
- 'hide' => true,
617
- 'default' => '1',
618
- 'selector' => 'href$=".swf"',
619
- 'description' => __('Auto-detect','easy-fancybox') . '<br />'
620
  ),
621
  'tag' => array (
622
- 'hide' => true,
623
- 'default' => 'a, area'
624
  ),
625
  'class' => array (
626
- 'hide' => true,
627
- 'default' => 'fancybox-swf'
628
  ),
629
  'type' => array(
630
- 'default' => 'swf'
631
  ),
632
  'width' => array (
633
- 'id' => 'fancybox_SWFWidth',
634
- 'title' => __('Width'),
635
- 'label_for' => 'fancybox_SWFWidth',
636
- 'input' => 'text',
637
- 'class' => 'small-text',
638
- 'options' => array(),
639
- 'default' => '680',
640
- 'description' => ' '
 
641
  ),
642
  'height' => array (
643
- 'id' => 'fancybox_SWFHeight',
644
- 'title' => __('Height'),
645
- 'label_for' => 'fancybox_SWFHeight',
646
- 'input' => 'text',
647
- 'class' => 'small-text',
648
- 'options' => array(),
649
- 'default' => '495',
 
650
  ),
651
  'padding' => array (
652
- 'id' => 'fancybox_SWFpadding',
653
- 'title' => __('Border'),
654
- 'label_for' => 'fancybox_SWFpadding',
655
- 'input' => 'text',
656
- 'class' => 'small-text',
657
- 'default' => '0',
658
- 'description' => '<br /><br />'
659
- ),
660
- 'autoScale' => array (
661
- 'noquotes' => true,
662
- 'default' => 'false'
663
  ),
664
  'titleShow' => array (
665
- 'id' => 'fancybox_SWFtitleShow',
666
- 'input' => 'checkbox',
667
- 'default' => '',
668
- 'description' => __('Show title','easy-fancybox')
 
669
  ),
670
  'titlePosition' => array (
671
- 'id' => 'fancybox_SWFtitlePosition',
672
- 'title' => __('Title Position','easy-fancybox'),
673
- 'label_for' => 'fancybox_SWFtitlePosition',
674
- 'input' => 'select',
675
- 'options' => array(
676
- 'float' => __('Float','easy-fancybox'), // same as 'float'
677
- 'outside' => __('Outside','easy-fancybox'),
678
- 'inside' => __('Inside','easy-fancybox')
679
- //,'over' => __('Overlay','easy-fancybox')
680
- ),
681
- 'default' => 'float',
682
  ),
683
  'titleFromAlt' => array (
684
- 'id' => 'fancybox_SWFtitleFromAlt',
685
- 'input' => 'checkbox',
686
- 'default' => '1',
687
- 'description' => __('Allow title from thumbnail alt tag','easy-fancybox')
 
688
  ),
689
  'swf' => array (
690
- 'noquotes' => true,
691
- 'default' => '{\'wmode\':\'opaque\',\'allowfullscreen\':true}'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
692
  )
693
  )
694
  ),
@@ -698,100 +1108,105 @@ function easy_fancybox_settings(){
698
  'input' => 'multiple',
699
  'options' => array(
700
  'intro' => array (
701
- 'hide' => true,
702
- 'description' => __('To make any YouTube movie open in an overlay, switch on auto-detect or use the class "fancybox-youtube" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br />'
703
  ),
704
  'autoAttribute' => array (
705
- 'id' => 'fancybox_autoAttributeYoutube',
706
- 'input' => 'checkbox',
707
- 'hide' => true,
708
- 'default' => '1',
709
- 'selector' => 'href*="youtube.com/"',
710
- //'href-replace' => "return attr.replace(new RegExp('watch\\\?v=', 'i'), 'v/')",
711
- 'description' => __('Auto-detect','easy-fancybox')
712
  ),
713
  'autoAttributeAlt' => array (
714
- 'id' => 'fancybox_autoAttributeYoutubeShortURL',
715
- 'input' => 'checkbox',
716
- 'hide' => true,
717
- 'default' => '1',
718
- 'selector' => 'href*="youtu.be/"',
719
- //'href-replace' => "return attr.replace(new RegExp('youtu.be', 'i'), 'www.youtube.com/v')",
720
- 'description' => __('Auto-detect Short links','easy-fancybox') . '<br />'
721
  ),
722
  'tag' => array (
723
- 'hide' => true,
724
- 'default' => 'a, area'
725
  ),
726
  'class' => array (
727
- 'hide' => true,
728
- 'default' => 'fancybox-youtube'
729
  ),
730
  'type' => array(
731
- 'default' => 'iframe'
732
  ),
733
  'width' => array (
734
- 'id' => 'fancybox_YoutubeWidth',
735
- 'title' => __('Width'),
736
- 'label_for' => 'fancybox_YoutubeWidth',
737
- 'input' => 'text',
738
- 'class' => 'small-text',
739
- 'default' => '640',
740
- 'description' => ' '
 
 
 
 
741
  ),
742
  'height' => array (
743
- 'id' => 'fancybox_YoutubeHeight',
744
- 'title' => __('Height'),
745
- 'label_for' => 'fancybox_YoutubeHeight',
746
- 'input' => 'text',
747
- 'class' => 'small-text',
748
- 'default' => '390',
 
 
 
 
749
  ),
750
  'padding' => array (
751
- 'id' => 'fancybox_Youtubepadding',
752
- 'title' => __('Border'),
753
- 'label_for' => 'fancybox_Youtubepadding',
754
- 'input' => 'text',
755
- 'class' => 'small-text',
756
- 'default' => '0',
757
- 'description' => '<br /><br />'
758
- ),
759
- 'autoScale' => array (
760
- 'noquotes' => true,
761
- 'default' => 'false'
762
  ),
763
  'titleShow' => array (
764
- 'id' => 'fancybox_YoutubetitleShow',
765
- 'input' => 'checkbox',
766
- 'default' => '',
767
- 'description' => __('Show title','easy-fancybox')
 
768
  ),
769
  'titlePosition' => array (
770
- 'id' => 'fancybox_YoutubetitlePosition',
771
- 'title' => __('Title Position','easy-fancybox'),
772
- 'label_for' => 'fancybox_YoutubetitlePosition',
773
- 'input' => 'select',
774
- 'options' => array(
775
- 'float' => __('Float','easy-fancybox'), // same as 'float'
776
- 'outside' => __('Outside','easy-fancybox'),
777
- 'inside' => __('Inside','easy-fancybox')
778
- //,'over' => __('Overlay','easy-fancybox')
779
- ),
780
- 'default' => 'float',
781
  ),
782
  'titleFromAlt' => array (
783
- 'id' => 'fancybox_YoutubetitleFromAlt',
784
- 'input' => 'checkbox',
785
- 'default' => '1',
786
- 'description' => __('Allow title from thumbnail alt tag','easy-fancybox')
787
- ),
788
- /* 'swf' => array (
789
- 'noquotes' => true,
790
- 'default' => '{\'wmode\':\'opaque\',\'allowfullscreen\':true}'
791
- ), */
792
  'onStart' => array (
793
- 'noquotes' => true,
794
- 'default' => 'function(selectedArray, selectedIndex, selectedOpts) { selectedOpts.href = selectedArray[selectedIndex].href.replace(new RegExp(\'youtu.be\', \'i\'), \'www.youtube.com/embed\').replace(new RegExp(\'watch\\\?v=([a-z0-9\_\-]+)(&|\\\?)?(.*)\', \'i\'), \'embed/$1?version=3&$3\') }'
795
  )
796
  )
797
  ),
@@ -801,91 +1216,96 @@ function easy_fancybox_settings(){
801
  'input' => 'multiple',
802
  'options' => array(
803
  'intro' => array (
804
- 'hide' => true,
805
- 'description' => __('To make any Vimeo movie open in an overlay, switch on auto-detect or use the class "fancybox-vimeo" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br />'
806
  ),
807
  'autoAttribute' => array (
808
- 'id' => 'fancybox_autoAttributeVimeo',
809
- 'input' => 'checkbox',
810
- 'hide' => true,
811
- 'default' => '1',
812
- 'selector' => 'href*="vimeo.com/"',
813
- //'href-replace' => "return attr.replace(new RegExp('/([0-9])', 'i'), '/moogaloop.swf?clip_id=$1')",
814
- 'description' => __('Auto-detect','easy-fancybox') . '<br />'
815
  ),
816
  'tag' => array (
817
- 'hide' => true,
818
- 'default' => 'a, area'
819
  ),
820
  'class' => array (
821
- 'hide' => true,
822
- 'default' => 'fancybox-vimeo'
823
  ),
824
  'type' => array(
825
- 'default' => 'iframe'
826
  ),
827
  'width' => array (
828
  'id' => 'fancybox_VimeoWidth',
829
- 'title' => __('Width'),
830
  'label_for' => 'fancybox_VimeoWidth',
831
- 'input' => 'text',