FancyBox for WordPress - Version 2.0

Version Description

Download this release

Release Info

Developer moskis
Plugin Icon wp plugin FancyBox for WordPress
Version 2.0
Comparing to
See all releases

Code changes from version 1.3 to 2.0

admin.php ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function mfbfw_options() {
4
+
5
+ // Set defaults
6
+ add_option('mfbfw_autoApply', 'on');
7
+ add_option('mfbfw_imageScale', 'on');
8
+ add_option('mfbfw_zoomOpacity', 'on');
9
+ add_option('mfbfw_zoomSpeedIn', '500');
10
+ add_option('mfbfw_zoomSpeedOut', '500');
11
+ add_option('mfbfw_overlayShow', 'on');
12
+ add_option('mfbfw_overlayColor', '#666666');
13
+ add_option('mfbfw_overlayOpacity', '0.3');
14
+ add_option('mfbfw_hideOnContentClick', '');
15
+ add_option('mfbfw_centerOnScroll', 'on');
16
+
17
+ // Store plugin options in an array
18
+ $options=array(
19
+ 'autoApply' => get_option('mfbfw_autoApply'),
20
+ 'imageScale' => get_option('mfbfw_imageScale'),
21
+ 'zoomOpacity' => get_option('mfbfw_zoomOpacity'),
22
+ 'zoomSpeedIn' => get_option('mfbfw_zoomSpeedIn'),
23
+ 'zoomSpeedOut' => get_option('mfbfw_zoomSpeedOut'),
24
+ 'overlayShow' => get_option('mfbfw_overlayShow'),
25
+ 'overlayColor' => get_option('mfbfw_overlayColor'),
26
+ 'overlayOpacity' => get_option('mfbfw_overlayOpacity'),
27
+ 'hideOnContentClick' => get_option('mfbfw_hideOnContentClick'),
28
+ 'centerOnScroll' => get_option('mfbfw_centerOnScroll')
29
+ );
30
+
31
+ // Make selects data
32
+ $overlayArray = array(0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1);
33
+ $msArray = array(0,100,200,300,400,500,600,700,800,900,1000,1500);
34
+
35
+
36
+ // Start the Options Page
37
+ ?>
38
+
39
+ <div class="wrap">
40
+
41
+ <div id="icon-plugins" class="icon32"></div>
42
+ <h2><?php _e('Fancybox for WordPress Options', 'mfbfw'); ?></h2>
43
+
44
+ <div style="float:right;margin-left:10px;background:#FFFBCC;text-align:center;width:200px;" class="updated">
45
+
46
+ <p style="line-height:1.5em;">If you use FancyBox and like it, buy the author a beer!</p>
47
+
48
+ <form id="donate_form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
49
+ <input name="cmd" value="_donations" type="hidden">
50
+ <input name="business" value="janis.skarnelis@gmail.com" type="hidden">
51
+ <input name="item_name" value="FancyBox" type="hidden">
52
+ <input name="amount" value="10.00" type="hidden">
53
+ <input name="no_shipping" value="0" type="hidden">
54
+ <input name="logo_custom" value="http://donate.png" type="hidden">
55
+ <input name="no_note" value="1" type="hidden">
56
+ <input name="currency_code" value="EUR" type="hidden">
57
+ <input name="tax" value="0" type="hidden">
58
+ <input name="lc" value="LV" type="hidden">
59
+ <input name="bn" value="PP-DonationsBF" type="hidden">
60
+ <input type="image" border="0" src="<?php echo WP_PLUGIN_URL ?>/fancybox-for-wordpress/img/extra_donate.png" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
61
+ </form>
62
+
63
+ </div>
64
+
65
+ <div style="clear:right;float:right;margin-left:10px;background:#FFFBCC;text-align:center;width:200px;" class="updated">
66
+
67
+ <p style="line-height:1.5em;">The author of this WordPress Plugin also likes beer :P</p>
68
+
69
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
70
+ <input type="hidden" name="cmd" value="_s-xclick"/>
71
+ <input type="hidden" name="hosted_button_id" value="3878319"/>
72
+ <input type="image" border="0" src="<?php echo WP_PLUGIN_URL ?>/fancybox-for-wordpress/img/extra_donate.png" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
73
+ <img height="1" width="1" border="0" alt="" src="https://www.paypal.com/es_ES/i/scr/pixel.gif" />
74
+ </form>
75
+
76
+ </div>
77
+
78
+ <div style="clear:right;float:right;margin-left:10px;background:#9DD1F2;border-color:#419ED9;text-align:center;width:200px;" class="updated">
79
+
80
+ <p style="line-height:1.5em;"><a href="http://twitter.com/moskis/">Follow me on Twitter for more WordPress Plugins and Themes.</a></p>
81
+
82
+ <img height="16" width="16" border="0" alt="" src="<?php echo WP_PLUGIN_URL ?>/fancybox-for-wordpress/img/extra_twitter.png" />
83
+
84
+ </div>
85
+
86
+ <h3><?php _e('About', 'mfbfw'); ?></h3>
87
+
88
+ <p><?php _e('This plugin integrates FancyBox with WordPress without having to edit any file or code. Once activated the plugin will apply FancyBox automatically to all image links, including WordPress galleries. Future versions will include some more options like easier inline content integration and more advanced customization. Enjoy!'); ?></p>
89
+
90
+ <p><?php _e('If you have problems or questions about FancyBox itself you should <a href="http://groups.google.com/group/fancybox">ask in the FancyBox Google Group</a>. If you want to make suggestions or ask just about this WordPress plugin you can <a href="http://blog.moskis.net/downloads/plugins/fancybox-for-wordpress/">leave a comment here</a>, <a href="http://blog.moskis.net/contactar/">send me an email</a>, or <a href="http://twitter.com/moskis">contact me on twitter</a>.'); ?></p>
91
+
92
+ <p><?php _e('<a href="http://fancy.klade.lv/home">FancyBox</a> developed by <a href="http://kac.klade.lv/">Janis Skarnelis</a>, ported to WordPress by <a href="http://moskis.net/">Jos&eacute; Pardilla</a>. Licensed under the <a target="_blank" href="http://en.wikipedia.org/wiki/MIT_License">MIT License</a>.'); ?></p><br />
93
+
94
+ <h3><?php _e('Settings', 'mfbfw'); ?></h3>
95
+
96
+ <form method="post" action="options.php" id="options"><?php echo wp_nonce_field('update-options'); ?>
97
+
98
+ <table class="form-table" style="clear:none;">
99
+ <tbody>
100
+
101
+ <tr valign="top">
102
+ <th scope="row"><?php _e('Auto Apply', 'mfbfw'); ?></th>
103
+ <td>
104
+ <fieldset>
105
+
106
+ <label for="mfbfw_autoApply">
107
+ <input type="checkbox" name="mfbfw_autoApply" id="mfbfw_autoApply"<?php if (get_option('mfbfw_autoApply') == 'on') echo ' checked="yes"';?> />
108
+ <?php _e('Apply FancyBox automatically to all links pointing to .jpg, .jpeg, .png or .gif images (default: on)', 'mfbfw'); ?>
109
+ </label><br />
110
+ <small><em><?php _e('(The link itself must the an image as well, text links will not be affected by this option!)', 'mfbfw'); ?></em></small><br /><br />
111
+
112
+ </fieldset>
113
+ </td>
114
+ </tr>
115
+
116
+ <tr valign="top">
117
+ <th scope="row"><?php _e('Auto Resize to Fit', 'mfbfw'); ?></th>
118
+ <td>
119
+ <fieldset>
120
+
121
+ <label for="mfbfw_imageScale">
122
+ <input type="checkbox" name="mfbfw_imageScale" id="mfbfw_imageScale"<?php if (get_option('mfbfw_imageScale') == 'on') echo ' checked="yes"';?> />
123
+ <?php _e('Scale images to fit in viewport (default: on)', 'mfbfw'); ?>
124
+ </label><br /><br />
125
+
126
+ </fieldset>
127
+ </td>
128
+ </tr>
129
+
130
+ <tr valign="top">
131
+ <th scope="row"><?php _e('Zoom Options', 'mfbfw'); ?></th>
132
+ <td>
133
+ <fieldset>
134
+
135
+ <label for="mfbfw_zoomOpacity">
136
+ <input type="checkbox" name="mfbfw_zoomOpacity" id="mfbfw_zoomOpacity"<?php if (get_option('mfbfw_zoomOpacity') == 'on') echo ' checked="yes"';?> />
137
+ <?php _e('Change content transparency when animating (default: on)', 'mfbfw'); ?>
138
+ </label><br /><br />
139
+
140
+ <label for="mfbfw_zoomSpeedIn">
141
+ <select name="mfbfw_zoomSpeedIn" id="mfbfw_zoomSpeedIn">
142
+ <?php
143
+ foreach($msArray as $key=> $ms) {
144
+ if($options['zoomSpeedIn'] != $ms) $selected = '';
145
+ else $selected = ' selected';
146
+ echo "<option value='$ms'$selected>$ms</option>\n";
147
+ } ?>
148
+ </select>
149
+ <?php _e('Speed in miliseconds of the zooming-in animation (default: 500)', 'mfbfw'); ?>
150
+ </label><br /><br />
151
+
152
+ <label for="mfbfw_zoomSpeedOut">
153
+ <select name="mfbfw_zoomSpeedOut" id="mfbfw_zoomSpeedOut">
154
+ <?php
155
+ foreach($msArray as $key=> $ms) {
156
+ if($options['zoomSpeedOut'] != $ms) $selected = '';
157
+ else $selected = ' selected';
158
+ echo "<option value='$ms'$selected>$ms</option>\n";
159
+ } ?>
160
+ </select>
161
+ <?php _e('Speed in miliseconds of the zooming-out animation (default: 500)', 'mfbfw'); ?>
162
+ </label><br /><br />
163
+
164
+ </fieldset>
165
+ </td>
166
+ </tr>
167
+
168
+ <tr valign="top">
169
+ <th scope="row"><?php _e('Overlay Options', 'mfbfw'); ?></th>
170
+ <td>
171
+ <fieldset>
172
+
173
+ <label for="mfbfw_overlayShow">
174
+ <input type="checkbox" name="mfbfw_overlayShow" id="mfbfw_overlayShow"<?php if (get_option('mfbfw_overlayShow') == 'on') echo ' checked="yes"';?> />
175
+ <?php _e('Add overlay (default: on)', 'mfbfw'); ?>
176
+ </label><br /><br />
177
+
178
+ <label for="mfbfw_overlayColor">
179
+ <input type="text" name="mfbfw_overlayColor" id="mfbfw_overlayColor" value="<?php echo get_option('mfbfw_overlayColor'); ?>" size="7" maxlength="7" />
180
+ <?php _e('HTML color of the overlay (default: #666666)', 'mfbfw'); ?>
181
+ </label><br /><br />
182
+
183
+ <label for="mfbfw_overlayOpacity">
184
+ <select name="mfbfw_overlayOpacity" id="mfbfw_overlayOpacity">
185
+ <?php
186
+ foreach($overlayArray as $key=> $opacity) {
187
+ if($options['overlayOpacity'] != $opacity) $selected = '';
188
+ else $selected = ' selected';
189
+ echo "<option value='$opacity'$selected>$opacity</option>\n";
190
+ }
191
+ ?>
192
+ </select>
193
+ <?php _e('Opacity of overlay. 0 is transparent, 1 is opaque (default: 0.3)', 'mfbfw'); ?>
194
+ </label><br /><br />
195
+
196
+ </fieldset>
197
+ </td>
198
+ </tr>
199
+
200
+ <tr valign="top">
201
+ <th scope="row"><?php _e('Close on Click', 'mfbfw'); ?></th>
202
+ <td>
203
+ <fieldset>
204
+
205
+ <label for="mfbfw_hideOnContentClick">
206
+ <input type="checkbox" name="mfbfw_hideOnContentClick" id="mfbfw_hideOnContentClick"<?php if (get_option('mfbfw_hideOnContentClick') == 'on') echo ' checked="yes"';?> />
207
+ <?php _e('Close FancyBox by clicking on the image (default: off)', 'mfbfw'); ?>
208
+ </label><br />
209
+ <small><em><?php _e('(This does NOT conflict with the previous and next image links on FancyBox galleries.)', 'mfbfw'); ?></em></small><br /><br />
210
+
211
+ </fieldset>
212
+ </td>
213
+ </tr>
214
+
215
+ <tr valign="top">
216
+ <th scope="row"><?php _e('Center on Scroll', 'mfbfw'); ?></th>
217
+ <td>
218
+ <fieldset>
219
+
220
+ <label for="mfbfw_centerOnScroll">
221
+ <input type="checkbox" name="mfbfw_centerOnScroll" id="mfbfw_centerOnScroll"<?php if (get_option('mfbfw_centerOnScroll') == 'on') echo ' checked="yes"';?> />
222
+ <?php _e('Keep image in the center of the browser window when scrolling (default: on)', 'mfbfw'); ?>
223
+ </label><br /><br />
224
+
225
+ </fieldset>
226
+ </td>
227
+ </tr>
228
+
229
+ </tbody>
230
+ </table>
231
+
232
+
233
+ <input type="hidden" name="action" value="update" />
234
+ <input type="hidden" name="page_options" value="mfbfw_autoApply,mfbfw_imageScale,mfbfw_zoomOpacity,mfbfw_zoomSpeedIn,mfbfw_zoomSpeedOut,mfbfw_overlayShow,mfbfw_overlayColor,mfbfw_overlayOpacity,mfbfw_hideOnContentClick,mfbfw_centerOnScroll" />
235
+
236
+ <p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options','mfbfw'); ?>" /></p>
237
+
238
+ </form>
239
+
240
+ </div>
241
+
242
+ <?php } ?>
fancybox.css ADDED
@@ -0,0 +1,319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html, body {
2
+ height: 100%;
3
+ }
4
+
5
+ div#fancy_overlay {
6
+ position: fixed;
7
+ top: 0;
8
+ left: 0;
9
+ width: 100%;
10
+ height: 100%;
11
+ background-color: #666;
12
+ display: none;
13
+ z-index: 30;
14
+ }
15
+
16
+ * html div#fancy_overlay {
17
+ position: absolute;
18
+ height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
19
+ }
20
+
21
+ div#fancy_loading {
22
+ position: absolute;
23
+ height: 40px;
24
+ width: 40px;
25
+ cursor: pointer;
26
+ display: none;
27
+ overflow: hidden;
28
+ background: transparent;
29
+ z-index: 100;
30
+ }
31
+
32
+ div#fancy_loading div {
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ width: 40px;
37
+ height: 480px;
38
+ background: transparent url('img/fancy_progress.png') no-repeat;
39
+ }
40
+
41
+ div#fancy_loading_overlay {
42
+ position: absolute;
43
+ background-color: #FFF;
44
+ z-index: 30;
45
+ }
46
+
47
+ div#fancy_loading_icon {
48
+ position: absolute;
49
+ background: url('img/fancy_loading.gif') no-repeat;
50
+ z-index: 35;
51
+ width: 16px;
52
+ height: 16px;
53
+ }
54
+
55
+ div#fancy_outer {
56
+ position: absolute;
57
+ top: 0;
58
+ left: 0;
59
+ z-index: 90;
60
+ padding: 18px 18px 32px 18px;
61
+ margin: 0;
62
+ overflow: hidden;
63
+ background: transparent;
64
+ display: none;
65
+ }
66
+
67
+ div#fancy_inner {
68
+ position: relative;
69
+ width:100%;
70
+ height:100%;
71
+ border: 1px solid #444;
72
+ background: #FFF;
73
+ }
74
+
75
+ div#fancy_content {
76
+ position: relative;
77
+ margin: 0;
78
+ z-index: 100;
79
+ width: 100%;
80
+ height: 100%;
81
+ }
82
+
83
+ div#fancy_div {
84
+ background: #000;
85
+ color: #FFF;
86
+ height: 100%;
87
+ width: 100%;
88
+ z-index: 100;
89
+ }
90
+
91
+ img#fancy_img {
92
+ position: absolute;
93
+ top: 0;
94
+ left: 0;
95
+ border:0;
96
+ padding: 0;
97
+ margin: 0;
98
+ z-index: 100;
99
+ width: 100%;
100
+ height: 100%;
101
+ }
102
+
103
+ div#fancy_close {
104
+ position: absolute;
105
+ top: -12px;
106
+ right: -15px;
107
+ height: 30px;
108
+ width: 30px;
109
+ background: url('img/fancy_closebox.png') top left no-repeat;
110
+ cursor: pointer;
111
+ z-index: 181;
112
+ display: none;
113
+ }
114
+
115
+ #fancy_frame {
116
+ position: relative;
117
+ width: 100%;
118
+ height: 100%;
119
+ display: none;
120
+ }
121
+
122
+ #fancy_ajax {
123
+ position: absolute;
124
+ overflow: auto;
125
+ top: 15px;
126
+ left: 15px;
127
+ bottom: 15px;
128
+ right: 15px;
129
+ }
130
+
131
+ * html div#fancy_ajax {
132
+ height: expression((this.parentNode.clientHeight - 30) + "px");
133
+ }
134
+
135
+ a#fancy_left, a#fancy_right {
136
+ position: absolute;
137
+ bottom: 0px;
138
+ height: 100%;
139
+ width: 35%;
140
+ cursor: pointer;
141
+ z-index: 111;
142
+ display: none;
143
+ background-image: url(data:image/gif;base64,AAAA);
144
+ }
145
+
146
+ a#fancy_left {
147
+ left: 0px;
148
+ }
149
+
150
+ a#fancy_right {
151
+ right: 0px;
152
+ }
153
+
154
+ span.fancy_ico {
155
+ position: absolute;
156
+ top: 50%;
157
+ margin-top: -15px;
158
+ width: 30px;
159
+ height: 30px;
160
+ z-index: 112;
161
+ cursor: pointer;
162
+ display: block;
163
+ }
164
+
165
+ span#fancy_left_ico {
166
+ left: -9999px;
167
+ background: transparent url('img/fancy_left.png') no-repeat;
168
+ }
169
+
170
+ span#fancy_right_ico {
171
+ right: -9999px;
172
+ background: transparent url('img/fancy_right.png') no-repeat;
173
+ }
174
+
175
+ a#fancy_left:hover {
176
+ visibility: visible;
177
+ }
178
+
179
+ a#fancy_right:hover {
180
+ visibility: visible;
181
+ }
182
+
183
+ a#fancy_left:hover span {
184
+ left: 20px;
185
+ }
186
+
187
+ a#fancy_right:hover span {
188
+ right: 20px;
189
+ }
190
+
191
+ .fancy_bigIframe {
192
+ position: absolute;
193
+ top: 0;
194
+ left: 0;
195
+ width: 100%;
196
+ height: 100%;
197
+ background: transparent;
198
+ }
199
+
200
+ div#fancy_bg {
201
+ position: absolute;
202
+ top: 0; left: 0;
203
+ width: 100%;
204
+ height: 100%;
205
+ z-index: 70;
206
+ border: 0;
207
+ padding: 0;
208
+ margin: 0;
209
+ }
210
+
211
+ div.fancy_bg {
212
+ position: absolute;
213
+ display: block;
214
+ z-index: 70;
215
+ border: 0;
216
+ padding: 0;
217
+ margin: 0;
218
+ }
219
+
220
+ div.fancy_bg_n {
221
+ top: -18px;
222
+ width: 100%;
223
+ height: 18px;
224
+ background: transparent url('img/fancy_shadow_n.png') repeat-x;
225
+ }
226
+
227
+ div.fancy_bg_ne {
228
+ top: -18px;
229
+ right: -13px;
230
+ width: 13px;
231
+ height: 18px;
232
+ background: transparent url('img/fancy_shadow_ne.png') no-repeat;
233
+ }
234
+
235
+ div.fancy_bg_e {
236
+ right: -13px;
237
+ height: 100%;
238
+ width: 13px;
239
+ background: transparent url('img/fancy_shadow_e.png') repeat-y;
240
+ }
241
+
242
+ div.fancy_bg_se {
243
+ bottom: -18px;
244
+ right: -13px;
245
+ width: 13px;
246
+ height: 18px;
247
+ background: transparent url('img/fancy_shadow_se.png') no-repeat;
248
+ }
249
+
250
+ div.fancy_bg_s {
251
+ bottom: -18px;
252
+ width: 100%;
253
+ height: 18px;
254
+ background: transparent url('img/fancy_shadow_s.png') repeat-x;
255
+ }
256
+
257
+ div.fancy_bg_sw {
258
+ bottom: -18px;
259
+ left: -13px;
260
+ width: 13px;
261
+ height: 18px;
262
+ background: transparent url('img/fancy_shadow_sw.png') no-repeat;
263
+ }
264
+
265
+ div.fancy_bg_w {
266
+ left: -13px;
267
+ height: 100%;
268
+ width: 13px;
269
+ background: transparent url('img/fancy_shadow_w.png') repeat-y;
270
+ }
271
+
272
+ div.fancy_bg_nw {
273
+ top: -18px;
274
+ left: -13px;
275
+ width: 13px;
276
+ height: 18px;
277
+ background: transparent url('img/fancy_shadow_nw.png') no-repeat;
278
+ }
279
+
280
+ div#fancy_title {
281
+ position: absolute;
282
+ bottom: -32px;
283
+ left: 0;
284
+ width: 100%;
285
+ z-index: 100;
286
+ display: none;
287
+ }
288
+
289
+ div#fancy_title div {
290
+ color: #FFF;
291
+ font: bold 12px Arial;
292
+ padding-bottom: 3px;
293
+ }
294
+
295
+ div#fancy_title table {
296
+ margin: 0 auto;
297
+ }
298
+
299
+ div#fancy_title table td {
300
+ padding: 0;
301
+ vertical-align: middle;
302
+ }
303
+
304
+ td#fancy_title_left {
305
+ height: 32px;
306
+ width: 15px;
307
+ background: transparent url(img/fancy_title_left.png) repeat-x;
308
+ }
309
+
310
+ td#fancy_title_main {
311
+ height: 32px;
312
+ background: transparent url(img/fancy_title_main.png) repeat-x;
313
+ }
314
+
315
+ td#fancy_title_right {
316
+ height: 32px;
317
+ width: 15px;
318
+ background: transparent url(img/fancy_title_right.png) repeat-x;
319
+ }
fancybox.php CHANGED
@@ -2,70 +2,80 @@
2
  /*
3
  Plugin Name: FancyBox for WordPress
4
  Plugin URI: http://blog.moskis.net/downloads/plugins/fancybox-for-wordpress/
5
- Description: Integrates <a href="http://fancy.klade.lv/">FancyBox</a> by <a href="http://klade.lv/">Janis Skarnelis</a> into WordPress. All images on a page are treated as a gallery allowing to use Next and Previous buttons on the FancyBox frontend.
6
- Version: 1.3
7
  Author: Jose Pardilla (Th3 ProphetMan)
8
- Author URI: http://blog.moskis.net/
9
  */
10
 
11
- define( 'WPFANCYBOXHOME', get_option('siteurl') . '/wp-content/plugins/fancybox-for-wordpress/' ); // Get full url to plugin path
12
 
13
- function wp_fancybox_do() {
14
-
15
- // CSS is included here to reduce the number of server calls. ?>
16
- <style type="text/css">
17
- div#fancy_overlay{position:absolute;top:0;left:0;z-index:90;width:100%;background-color:#333;}
18
- div#fancy_loading{position:absolute;height:40px;width:40px;cursor:pointer;display:none;overflow:hidden;background:transparent;z-index:100;}
19
- div#fancy_loading div{position:absolute;top:0;left:0;width:40px;height:480px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_progress.png) no-repeat;}
20
- div#fancy_close{position:absolute;top:-12px;right:-12px;height:30px;width:30px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_closebox.png);cursor:pointer;z-index:1000;display:none;}
21
- div#fancy_content{position:absolute;top:0;left:0;width:100%;height:100%;z-index:96;margin:0;padding:0;}
22
- #fancy_frame{position:relative;width:100%;height:100%;display:none;}
23
- img#fancy_img{position:absolute;top:0;left:0;width:100%;height:100%;border:0;z-index:92;margin:0;padding:0;}
24
- div#fancy_title{position:absolute;bottom:-35px;left:0;width:100%;z-index:100;display:none;}
25
- div#fancy_title table{margin:0 auto;}div#fancy_title div{color:#FFF;font:bold 12px Arial;padding-bottom:2px;}
26
- td#fancy_title_left{height:32px;width:15px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_title_sprite.png) no-repeat 0 -32px;}
27
- td#fancy_title_main{height:32px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_title_sprite.png) repeat-x;}
28
- td#fancy_title_right{height:32px;width:15px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_title_sprite.png) no-repeat 0 -64px;}
29
- div#fancy_outer{position:absolute;top:0;left:0;z-index:90;overflow:hidden;background:transparent;display:none;margin:0;padding:18px 18px 58px;}
30
- div#fancy_inner{position:relative;width:100%;height:100%;border:1px solid #444;background:#FFF;}
31
- a#fancy_left,a#fancy_right{position:absolute;bottom:10px;height:100%;width:35%;cursor:pointer;background-image:url(data:image/gif;base64,AAAA);z-index:100;}
32
- a#fancy_left{left:0;}a#fancy_right{right:0;}a#fancy_left:hover{background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_left.gif) no-repeat 0 50%;}
33
- a#fancy_right:hover{background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_right.gif) no-repeat 100% 50%;}
34
- #fancy_bigIframe,#fancy_freeIframe{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10;}
35
- div.fancy_bg{position:absolute;display:block;z-index:70;}
36
- div.fancy_bg_n{top:-18px;width:100%;height:18px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_shadow_horizontal.png) repeat-x;}
37
- div.fancy_bg_ne{top:-18px;right:-13px;width:13px;height:18px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_shadow_corners.png) no-repeat -13px 0;}
38
- div.fancy_bg_e{right:-13px;height:100%;width:13px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_shadow_vertical.png) repeat-y -13px 0;}
39
- div.fancy_bg_se{bottom:-18px;right:-13px;width:13px;height:18px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_shadow_corners.png) no-repeat -13px -18px;}
40
- div.fancy_bg_s{bottom:-18px;width:100%;height:18px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_shadow_horizontal.png) repeat-x 0 -18px;}
41
- div.fancy_bg_sw{bottom:-18px;left:-13px;width:13px;height:18px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_shadow_corners.png) no-repeat 0 -18px;}
42
- div.fancy_bg_w{left:-13px;height:100%;width:13px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_shadow_vertical.png) repeat-y;}
43
- div.fancy_bg_nw{top:-18px;left:-13px;width:13px;height:18px;background:transparent url(<?php echo WPFANCYBOXHOME; ?>img/fancy_shadow_corners.png) no-repeat;}
44
- * html div.fancy_bg_n,* html div.fancy_bg_ne,* html div.fancy_bg_e,* html div.fancy_bg_se,* html div.fancy_bg_s,* html div.fancy_bg_sw,* html div.fancy_bg_w,* html div.fancy_bg_nw{background:none;}
45
- * html td#fancy_title_left,* html td#fancy_title_main,* html td#fancy_title_right{background:#000;}
46
- * html div#fancy_close{background:url(<?php echo WPFANCYBOXHOME; ?>img/fancy_ie_closebox.gif);}
47
- </style>
48
-
49
- <script type="text/javascript">
50
- jQuery.noConflict(); // Apply jQuery.noConflict()
51
- jQuery(function(){
52
- jQuery("a:has(img)[href$='.jpg']").attr({ rel: "fancybox" }); // These four lines add the rel="fancybox"
53
- jQuery("a:has(img)[href$='.jpeg']").attr({ rel: "fancybox" }); // attribute to all links that contain
54
- jQuery("a:has(img)[href$='.gif']").attr({ rel: "fancybox" }); // an image (i.e thumbnail) and link
55
- jQuery("a:has(img)[href$='.png']").attr({ rel: "fancybox" }); // to a JPG, JPEG, PNG or GIF image.
56
- jQuery("a[rel='fancybox']").fancybox(); //This applies fancybox to the links we have just edited.
57
- });
58
- </script>
 
 
59
 
60
- <?php
61
 
62
  }
63
 
64
- function wp_fancybox_init() {
65
- wp_enqueue_script('fancybox', WPFANCYBOXHOME . 'jquery.fancybox-1.2.0.pack.js', array('jquery'), '1.3.2' ); // Load fancybox with jQuery
 
 
 
 
66
  }
67
 
68
- add_action('wp_print_scripts', 'wp_fancybox_init'); // Add the fancybox script to the WordPress head
69
- add_action('wp_head', 'wp_fancybox_do'); // Add css and apply fancyboy the the page loads
 
 
 
 
 
70
 
71
  ?>
2
  /*
3
  Plugin Name: FancyBox for WordPress
4
  Plugin URI: http://blog.moskis.net/downloads/plugins/fancybox-for-wordpress/
5
+ Description: Integrates <a href="http://fancy.klade.lv/">FancyBox</a> by <a href="http://klade.lv/">Janis Skarnelis</a> into WordPress. All images on a page are treated as a gallery allowing visitors to use Next and Previous buttons on the FancyBox frontend.
6
+ Version: 2.0
7
  Author: Jose Pardilla (Th3 ProphetMan)
8
+ Author URI: http://moskis.net/
9
  */
10
 
 
11
 
12
+ function mfbfw_init() {
13
+
14
+ wp_enqueue_script('fancybox', WP_PLUGIN_URL . '/fancybox-for-wordpress/jquery.fancybox-1.2.0.pack.js', array('jquery'), '1.3.2' ); // Load fancybox with jQuery
15
+
16
+ }
17
+
18
+
19
+ function mfbfw_css() {
20
+
21
+ echo "\n"."<!-- Fancybox for WordPress -->"."\n".'<link rel="stylesheet" href="'.WP_PLUGIN_URL.'/fancybox-for-wordpress/fancybox.css" type="text/css" media="screen" />'."\n";
22
+ ?><style type="text/css">div#fancy_overlay {background-color:<?php echo get_option('mfbfw_overlayColor'); ?>}</style><?php
23
+
24
+ }
25
+
26
+
27
+ function mfbfw_do() { ?>
28
+
29
+ <script type="text/javascript">
30
+
31
+ jQuery.noConflict();
32
+
33
+ jQuery(function(){
34
+
35
+ <?php if (get_option('mfbfw_autoApply') == 'on') { ?>
36
+
37
+ jQuery("a:has(img)[href$='.jpg']").attr({ rel: "fancybox" }); // These five lines add the rel="fancybox" attribute to all links that contain
38
+ jQuery("a:has(img)[href$='.jpeg']").attr({ rel: "fancybox" }); // an image (i.e thumbnail) and link to a JPG, JPEG, PNG, GIF or BMP image.
39
+ jQuery("a:has(img)[href$='.gif']").attr({ rel: "fancybox" });
40
+ jQuery("a:has(img)[href$='.png']").attr({ rel: "fancybox" });
41
+ jQuery("a:has(img)[href$='.bmp']").attr({ rel: "fancybox" });
42
+
43
+ <?php } ?>
44
+
45
+ // This applies fancybox to the links we have just edited and applies the options set by the user on the admin panel.
46
+ jQuery("a[rel='fancybox']").fancybox({
47
+ 'imageScale': <?php if (get_option('mfbfw_imageScale') == 'on') { echo "true"; } else { echo "false"; } ?>,
48
+ 'zoomOpacity': <?php if (get_option('mfbfw_zoomOpacity') == 'on') { echo "true"; } else { echo "false"; } ?>,
49
+ 'zoomSpeedIn': <?php echo get_option('mfbfw_zoomSpeedIn'); ?>,
50
+ 'zoomSpeedOut': <?php echo get_option('mfbfw_zoomSpeedOut'); ?>,
51
+ 'overlayShow': <?php if (get_option('mfbfw_overlayShow') == 'on') { echo "true"; } else { echo "false"; } ?>,
52
+ 'overlayOpacity': <?php echo get_option('mfbfw_overlayOpacity'); ?>,
53
+ 'hideOnContentClick': <?php if (get_option('mfbfw_hideOnContentClick') == 'on') { echo "true"; } else { echo "false"; } ?>,
54
+ 'centerOnScroll': <?php if (get_option('mfbfw_centerOnScroll') == 'on') { echo "true"; } else { echo "false"; } ?>
55
+ });
56
+
57
+ });
58
+
59
+ </script>
60
 
61
+ <?php echo "<!-- Fancybox for WordPress -->"."\n";
62
 
63
  }
64
 
65
+
66
+ function mfbfw_admin() {
67
+
68
+ require dirname(__FILE__) . '/admin.php';
69
+ add_options_page('Fancybox for WordPress Options', 'Fancybox for WordPress', 10, __FILE__, 'mfbfw_options');
70
+
71
  }
72
 
73
+
74
+
75
+ // Start calling the functions
76
+ add_action('wp_print_scripts', 'mfbfw_init'); // Add the fancybox script to the WordPress head
77
+ add_action('wp_head', 'mfbfw_css'); // Load stylesheet
78
+ add_action('wp_head', 'mfbfw_do'); // Apply fancyboy when the page loads
79
+ add_action('admin_menu', 'mfbfw_admin'); // Admin Panel Page
80
 
81
  ?>
img/extra_donate.png ADDED
Binary file
img/extra_twitter.png ADDED
Binary file
img/fancy_ie_closebox.gif DELETED
Binary file
img/fancy_left.gif DELETED
Binary file
img/fancy_left.png ADDED
Binary file
img/fancy_right.gif DELETED
Binary file
img/fancy_right.png ADDED
Binary file
img/fancy_shadow_corners.png DELETED
Binary file
img/fancy_shadow_e.png ADDED
Binary file
img/fancy_shadow_horizontal.png DELETED
Binary file
img/fancy_shadow_n.png ADDED
Binary file
img/fancy_shadow_ne.png ADDED
Binary file
img/fancy_shadow_nw.png ADDED
Binary file
img/fancy_shadow_s.png ADDED
Binary file
img/fancy_shadow_se.png ADDED
Binary file
img/fancy_shadow_sw.png ADDED
Binary file
img/fancy_shadow_vertical.png DELETED
Binary file
img/fancy_shadow_w.png ADDED
Binary file
img/fancy_title_left.png ADDED
Binary file
img/fancy_title_main.png ADDED
Binary file
img/fancy_title_right.png ADDED
Binary file
img/fancy_title_sprite.png DELETED
Binary file
readme.txt CHANGED
@@ -4,13 +4,14 @@ Donate link: https://www.asmallorange.com/extras/donate/?id=10218
4
  Tags: fancybox, lightbox, jquery, image, gallery
5
  Requires at least: 2.7
6
  Tested up to: 2.7.1
7
- Stable tag: 1.3
 
 
8
 
9
- Seamlessly integrates FancyBox into your blog: Upload, activate, and you're done. No further configuration needed.
10
 
11
  == Description ==
12
 
13
- Seamlessly integrates [FancyBox](http://fancy.klade.lv/) into your blog: Upload, activate and you're done. No further configuration needed.
14
 
15
  All images on the page will be considered part of a gallery, allowing you and your visitors to navigate through them with the [FancyBox](http://fancy.klade.lv/) interface.
16
 
@@ -20,10 +21,17 @@ The requirements are that the link is an image (for example a thumbnail), and th
20
 
21
  [FancyBox](http://fancy.klade.lv/) will NOT be applied on text links, but i will implement a configuration page in the admin panel to optionally customize that and much more stuff in future versions.
22
 
23
- Finally, i have only tested the plugin in WordPress 2.7, but it should work on recent previous versions. However, there's no reason why you shouldn't be already using WP2.7, is there? ;)
 
24
 
25
  = Changelog =
26
 
 
 
 
 
 
 
27
  1.3 Updates:
28
 
29
  * Shadows and Close button should be fixed now
@@ -39,15 +47,33 @@ Finally, i have only tested the plugin in WordPress 2.7, but it should work on r
39
  * Fixed "Click to close" overlay text
40
  * Moved images to /img/ folder
41
 
 
 
 
 
 
 
 
 
 
42
  = Known Bugs =
43
 
44
- * Shadows and caption Box still a mess on IE, need to completely update CSS to match changes in FancyBox 1.2.0
 
 
45
 
46
  == Installation ==
47
 
48
  1. Upload the `fancybox-for-wordpress` folder to the `/wp-content/plugins/` directory
49
  2. Activate the plugin through the 'Plugins' menu in WordPress
50
  3. That's it, [FancyBox](http://fancy.klade.lv/) will be automatically applied to all your image links and galleries.
 
 
 
 
 
 
 
51
 
52
 
53
  == Frequently Asked Questions ==
4
  Tags: fancybox, lightbox, jquery, image, gallery
5
  Requires at least: 2.7
6
  Tested up to: 2.7.1
7
+ Stable tag: 2.0
8
+
9
+ Seamlessly integrates FancyBox into your blog: Upload, activate, and you're done. No further configuration needed. However, you can customize it from the Options Page if you like... :)
10
 
 
11
 
12
  == Description ==
13
 
14
+ Seamlessly integrates FancyBox into your blog: Upload, activate, and you're done. No further configuration needed. However, you can customize it from the Options Page if you like... :)
15
 
16
  All images on the page will be considered part of a gallery, allowing you and your visitors to navigate through them with the [FancyBox](http://fancy.klade.lv/) interface.
17
 
21
 
22
  [FancyBox](http://fancy.klade.lv/) will NOT be applied on text links, but i will implement a configuration page in the admin panel to optionally customize that and much more stuff in future versions.
23
 
24
+ Finally, i have only tested the plugin in WordPress 2.7, so it's very recomended to use it with WordPress 2.7 or later. However, there's no reason why you shouldn't be already using WP2.7, is there? ;)
25
+
26
 
27
  = Changelog =
28
 
29
+ 2.0 Updates:
30
+
31
+ * Brand new Options Page in Admin Panel lets you easely customize many options: fancybox auto apply, image resize to fit, opacity fade while zooming, zoom speed, overlay on/off, overlay color, overlay opacity, close fancybox on image click, keep fancybox centered while scrolling.
32
+ * CSS completely updated for FancyBox 1.2.0
33
+ * Captions fixed in IE
34
+
35
  1.3 Updates:
36
 
37
  * Shadows and Close button should be fixed now
47
  * Fixed "Click to close" overlay text
48
  * Moved images to /img/ folder
49
 
50
+
51
+ = TODO List =
52
+
53
+ * Add support for easing effects
54
+ * Custom expression field in Options page to specify aditional elements where FancyBox should be applied (for example "#moskislink" or ""a.someclass:has(img)[href$='.gif']" )
55
+ * Better support for inline content width adjustable window width and height.
56
+ * Add alternative methods of loading the javascript so that the user can swuitch them in the option page if there are problems.
57
+
58
+
59
  = Known Bugs =
60
 
61
+ * Shadows still a mess on IE6/7
62
+ * Captions don't look right on Hybrid Theme and its child themes
63
+
64
 
65
  == Installation ==
66
 
67
  1. Upload the `fancybox-for-wordpress` folder to the `/wp-content/plugins/` directory
68
  2. Activate the plugin through the 'Plugins' menu in WordPress
69
  3. That's it, [FancyBox](http://fancy.klade.lv/) will be automatically applied to all your image links and galleries.
70
+ 4. If you want to customize a bit the look and feel of FancyBox, go to the Options Page under General Options in the WordPress Admin panel.
71
+
72
+
73
+ == Screenshots ==
74
+
75
+ 1. Simple example of fancybox applied to a wordpress page gallery. [Live demo here](http://blog.moskis.net/downloads/plugins/fancybox-for-wordpress/).
76
+ 2. Options Page in the Admin Panel makes it very easy to customize the plugin to your needs.
77
 
78
 
79
  == Frequently Asked Questions ==
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file