FancyBox for WordPress - Version 1.2

Version Description

Download this release

Release Info

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

Code changes from version 1.1 to 1.2

Files changed (4) hide show
  1. fancybox.php +2 -2
  2. jquery.fancybox-1.2.0.pack.js +9 -0
  3. jquery.fancybox.js +0 -384
  4. readme.txt +17 -4
fancybox.php CHANGED
@@ -3,7 +3,7 @@
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.1
7
  Author: Jose Pardilla (Th3 ProphetMan)
8
  Author URI: http://blog.moskis.net/
9
  */
@@ -62,7 +62,7 @@ function wp_fancybox_do() {
62
  }
63
 
64
  function wp_fancybox_init() {
65
- wp_enqueue_script('fancybox', WPFANCYBOXHOME . 'jquery.fancybox.js', array('jquery') ); // Load fancybox with jQuery
66
  }
67
 
68
  add_action('wp_print_scripts', 'wp_fancybox_init'); // Add the fancybox script to the WordPress head
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.2
7
  Author: Jose Pardilla (Th3 ProphetMan)
8
  Author URI: http://blog.moskis.net/
9
  */
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
jquery.fancybox-1.2.0.pack.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * FancyBox - simple jQuery plugin for fancy image zooming
3
+ * Examples and documentation at: http://fancy.klade.lv/
4
+ * Version: 1.2.0 (27/02/2009)
5
+ * Copyright (c) 2009 Janis Skarnelis
6
+ * Licensed under the MIT License: http://en.wikipedia.org/wiki/MIT_License
7
+ * Requires: jQuery v1.3+
8
+ */
9
+ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}(';(7($){$.9.29=7(){v G.2u(7(){c 1i=$(G).o(\'2C\');6(1i.W(/^3d\\(["\']?(.*\\.2i)["\']?\\)$/i)){1i=3f.$1;$(G).o({\'2C\':\'3h\',\'3w\':"3v:3r.3u.3L(3M=D, 41="+($(G).o(\'3Z\')==\'23-3W\'?\'3T\':\'35\')+", O=\'"+1i+"\')"}).2u(7(){c 10=$(G).o(\'10\');6(10!=\'2s\'&&10!=\'2h\')$(G).o(\'10\',\'2h\')})}})};c 1W,4,L=C,q=1r 1s,1v,1p=1,1u=/\\.(31|2N|2i|30|3j)(.*)?$/i;c 1c=($.2g.3m&&22($.2g.3a.38(0,1))<8);$.9.b=7(V){V=$.3k({},$.9.b.26,V);c S=G;7 24(){1W=G;4=V;2f();v C};7 2f(){6(L)v;6($.2E(4.1U)){4.1U()}4.l=[];4.f=0;6(V.l.Q>0){4.l=V.l}s{c 1h={};3c(c i=0;i<S.Q;i++){1h={d:S[i].d,19:S[i].19};6($(S[i]).2d("1G:2e").Q){1h.11=$(S[i]).2d("1G:2e")}4.l.3g(1h)}}3o(4.l[4.f].d!=1W.d){4.f++}6(4.1Y){6(1c){$(\'1L, 1M, 1O\').o(\'1N\',\'3l\')}$("#1z").o(\'1V\',4.2c).I()}X()};7 X(){$("#16, #1g, #Y, #y").U();c d=4.l[4.f].d;6(d.W(/#/)){c 1j=1m.3i.d.34(\'#\')[0];1j=d.3p(1j,\'\');17(\'<5 j="2Q">\'+$(1j).n()+\'</5>\',4.1w,4.1x)}s 6(d.W(1u)){q=1r 1s;q.O=d;6(q.2P){1P()}s{$.9.b.2G();$(q).F().Z(\'2O\',7(){$(".z").U();1P()})}}s 6(d.W("15")){17(\'<15 j="2B" 2L="$.9.b.2n()" 2M="2S\'+t.N(t.33()*2U)+\'" 1Z="0" 32="0" O="\'+d+\'"></15>\',4.1w,4.1x)}s{$.2Z(d,7(2j){17(\'<5 j="2Y">\'+2j+\'</5>\',4.1w,4.1x)})}};7 1P(){6(4.28){c w=$.9.b.1a();c r=t.1Q(t.1Q(w[0]-36,q.g)/q.g,t.1Q(w[1]-47,q.h)/q.h);c g=t.N(r*q.g);c h=t.N(r*q.h)}s{c g=q.g;c h=q.h}17(\'<1G 3U="" j="3V" O="\'+q.O+\'" />\',g,h);2k()};7 2k(){6((4.l.Q-1)>4.f){c d=4.l[4.f+1].d;6(d.W(1u)){1t=1r 1s();1t.O=d}}6(4.f>0){c d=4.l[4.f-1].d;6(d.W(1u)){1t=1r 1s();1t.O=d}}};7 17(1f,g,h){c w=$.9.b.1a();c 2b=(g+36)>w[0]?w[2]:(w[2]+t.N((w[0]-g-36)/2));c 2l=(h+1o)>w[1]?w[3]:(w[3]+t.N((w[1]-h-1o)/2));c H={\'E\':2b,\'A\':2l,\'g\':g+\'K\',\'h\':h+\'K\'};6($("#m").1H(":13")){6(g==$("#u").g()&&h==$("#u").h()){$("#u").1R("1b",7(){$("#u").1l().1q($(1f)).1K("1b",7(){1e()})})}s{$("#u").1R("1b",7(){$("#u").1l();$("#m").1S(H,4.2m,4.2p,7(){$("#u").1q($(1f)).1K("1b",7(){1e()})})})}}s{6(4.1F>0&&4.l[4.f].11!==1B){$("#u").1l().1q($(1f));c J=4.l[4.f].11;c T=$.9.b.1D(J);$("#m").o({\'E\':(T.E-18)+\'K\',\'A\':(T.A-18)+\'K\',\'g\':$(J).g(),\'h\':$(J).h()});L=D;6(4.1C){H.1V=\'I\'}$("#m").1S(H,4.1F,4.2o,7(){1e()})}s{$("#u").1l().1q($(1f));L=D;$("#m").o(H).1K("43",7(){1e()})}}};7 21(){6(4.f!=0){$("#1g, #2v").F().Z("P",7(e){e.2r();4.f--;X();v C});$("#1g").I()}6(4.f!=(4.l.Q-1)){$("#16, #2z").F().Z("P",7(e){e.2r();4.f++;X();v C});$("#16").I()}};7 1e(){21();$(M).1n(7(e){6(e.1I==27){$.9.b.14();$(M).F("1n")}s 6(e.1I==37&&4.f!=0){4.f--;X();$(M).F("1n")}s 6(e.1I==39&&4.f!=(4.l.Q-1)){4.f++;X();$(M).F("1n")}});6(4.2J){$(1m).Z("3y 3z",$.9.b.2a)}s{$("5#m").o("10","2s")}6(4.2K){$("#1A").P($.9.b.14)}s{$("#1A").F()}$("#Y").I();6(4.l[4.f].19!==1B&&4.l[4.f].19.Q>0){$(\'#y 5\').n(4.l[4.f].19);$(\'#y\').I()}6(4.1Y&&1c){$(\'#u\').3t(\'1L, 1M, 1O\').o(\'1N\',\'13\')}L=C};v G.F(\'P\').P(24)};$.9.b.2a=7(){c k=$.9.b.1a();$("#m").o(\'E\',(($("#m").g()+36)>k[0]?k[2]:k[2]+t.N((k[0]-$("#m").g()-36)/2)));$("#m").o(\'A\',(($("#m").h()+1o)>k[1]?k[3]:k[3]+t.N((k[1]-$("#m").h()-1o)/2)))};$.9.b.1d=7(x,20){v 22($.3I(x.3J?x[0]:x,20,D))||0};$.9.b.1D=7(x){c k=x.3K();k.A+=$.9.b.1d(x,\'3H\');k.A+=$.9.b.1d(x,\'3G\');k.E+=$.9.b.1d(x,\'3C\');k.E+=$.9.b.1d(x,\'3F\');v k};$.9.b.2n=7(){$(".z").U();$("#2B").I()};$.9.b.1a=7(){v[$(1m).g(),$(1m).h(),$(M).3B(),$(M).3A()]};$.9.b.2A=7(){6(!$("#z").1H(\':13\')){2x(1v);v}$("#z > 5").o(\'A\',(1p*-40)+\'K\');1p=(1p+1)%12};$.9.b.2G=7(){2x(1v);c k=$.9.b.1a();$("#z").o({\'E\':((k[0]-40)/2+k[2]),\'A\':((k[1]-40)/2+k[3])}).I();$("#z").Z(\'P\',$.9.b.14);1v=3Y($.9.b.2A,42)};$.9.b.14=7(){$(q).F();$("#Y, .z, #1g, #16, #y").U();1k=7(){$("#1z, #m").U();6(1c){$(\'1L, 1M, 1O\').o(\'1N\',\'13\')}6($.2E(4.1X)){4.1X()}L=C};6($("#m").1H(":13")!==C){L=D;6(4.1J>0&&4.l[4.f].11!==1B){c J=4.l[4.f].11;c T=$.9.b.1D(J);c H={\'E\':(T.E-18)+\'K\',\'A\':(T.A-18)+\'K\',\'g\':$(J).g(),\'h\':$(J).h()};6(4.1C){H.1V=\'U\'}$("#m").1S(H,4.1J,4.2q,1k)}s{$("#m").3b().1R("1b",1k)}}s{1k()}v C};$.9.b.2D=7(){c n=\'\';n+=\'<5 j="1z"></5>\';n+=\'<5 j="1A">\';n+=\'<5 p="z" j="z"><5></5></5>\';n+=\'<5 j="m">\';n+=\'<5 j="2I">\';n+=\'<5 j="Y"></5>\';n+=\'<5 j="B"><5 p="B 3N"></5><5 p="B 3R"></5><5 p="B 3s"></5><5 p="B 2X"></5><5 p="B 2W"></5><5 p="B 2T"></5><5 p="B 3n"></5><5 p="B 3e"></5></5>\';n+=\'<a d="2t:;" j="1g"><1y p="1T" j="2v"></1y></a><a d="2t:;" j="16"><1y p="1T" j="2z"></1y></a>\';n+=\'<5 j="u"></5>\';n+=\'<5 j="y"></5>\';n+=\'</5>\';n+=\'</5>\';n+=\'</5>\';$(n).2y("3S");$(\'<2H 3O="0" 3P="0" 3Q="0"><2F><R p="y" j="3X"></R><R p="y" j="45"><5></5></R><R p="y" j="46"></R></2F></2H>\').2y(\'#y\');6(1c){$("#2I").3E(\'<15 p="25" 3D="23" 1Z="0"></15>\');$("#Y, .B, .y, .1T").29()}$("#1z, #25, #z, #Y").Z("P",$.9.b.14)};$.9.b.26={28:D,1C:C,1F:0,1J:0,2m:44,2o:\'1E\',2q:\'1E\',2p:\'1E\',1w:3q,1x:2R,1Y:D,2c:0.3,2K:D,2J:D,l:[],1U:2w,1X:2w};$(M).2V(7(){$.9.b.2D()})})(3x);',62,256,'||||opts|div|if|function||fn||fancybox|var|href||itemCurrent|width|height||id|pos|itemArray|fancy_outer|html|css|class|imagePreloader||else|Math|fancy_content|return||el|fancy_title|fancy_loading|top|fancy_bg|false|true|left|unbind|this|itemOpts|show|orig_item|px|busy|document|round|src|click|length|td|matchedGroup|orig_pos|hide|settings|match|_change_item|fancy_close|bind|position|orig||visible|close|iframe|fancy_right|_set_content||title|getViewport|fast|isIE|getNumeric|_finish|value|fancy_left|item|image|target|__cleanup|empty|window|keydown|50|loadingFrame|append|new|Image|objNext|imageRegExp|loadingTimer|frameWidth|frameHeight|span|fancy_overlay|fancy_wrap|undefined|zoomOpacity|getPosition|swing|zoomSpeedIn|img|is|keyCode|zoomSpeedOut|fadeIn|embed|object|visibility|select|_proceed_image|min|fadeOut|animate|fancy_ico|callbackOnStart|opacity|elem|callbackOnClose|overlayShow|frameborder|prop|_set_navigation|parseInt|no|_initialize|fancy_bigIframe|defaults||imageScale|fixPNG|scrollBox|itemLeft|overlayOpacity|children|first|_start|browser|relative|png|data|_preload_neighbor_images|itemTop|zoomSpeedChange|showIframe|easingIn|easingChange|easingOut|stopPropagation|absolute|javascript|each|fancy_left_ico|null|clearInterval|appendTo|fancy_right_ico|animateLoading|fancy_frame|backgroundImage|build|isFunction|tr|showLoading|table|fancy_inner|centerOnScroll|hideOnContentClick|onload|name|gif|load|complete|fancy_div|355|fancy_iframe|fancy_bg_sw|1000|ready|fancy_bg_s|fancy_bg_se|fancy_ajax|get|bmp|jpg|hspace|random|split|scale|||substr||version|stop|for|url|fancy_bg_nw|RegExp|push|none|location|jpeg|extend|hidden|msie|fancy_bg_w|while|replace|425|DXImageTransform|fancy_bg_e|find|Microsoft|progid|filter|jQuery|resize|scroll|scrollTop|scrollLeft|paddingLeft|scrolling|prepend|borderLeftWidth|borderTopWidth|paddingTop|curCSS|jquery|offset|AlphaImageLoader|enabled|fancy_bg_n|cellspacing|cellpadding|border|fancy_bg_ne|body|crop|alt|fancy_img|repeat|fancy_title_left|setInterval|backgroundRepeat||sizingMethod|66|normal|300|fancy_title_main|fancy_title_right|60'.split('|'),0,{}))
jquery.fancybox.js DELETED
@@ -1,384 +0,0 @@
1
- /*
2
- * FancyBox - simple jQuery plugin for fancy image zooming
3
- * Examples and documentation at: http://fancy.klade.lv/
4
- * Version: 1.0.0 (29/04/2008)
5
- * Copyright (c) 2008 Janis Skarnelis
6
- * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
7
- * Requires: jQuery v1.2.1 or later
8
- */
9
- (function(jQuery) {
10
- var opts = {},
11
- imgPreloader = new Image, imgTypes = ['png', 'jpg', 'jpeg', 'gif'],
12
- loadingTimer, loadingFrame = 1;
13
-
14
- jQuery.fn.fancybox = function(settings) {
15
- opts.settings = jQuery.extend({}, jQuery.fn.fancybox.defaults, settings);
16
-
17
- jQuery.fn.fancybox.init();
18
-
19
- return this.each(function() {
20
- var $this = jQuery(this);
21
- var o = jQuery.metadata ? jQuery.extend({}, opts.settings, jQuerythis.metadata()) : opts.settings;
22
-
23
- $this.unbind('click').click(function() {
24
- jQuery.fn.fancybox.start(this, o); return false;
25
- });
26
- });
27
- };
28
-
29
- jQuery.fn.fancybox.start = function(el, o) {
30
- if (opts.animating) return false;
31
-
32
- if (o.overlayShow) {
33
- jQuery("#fancy_wrap").prepend('<div id="fancy_overlay"></div>');
34
- jQuery("#fancy_overlay").css({'width': jQuery(window).width(), 'height': jQuery(document).height(), 'opacity': o.overlayOpacity});
35
-
36
- if (jQuery.browser.msie) {
37
- jQuery("#fancy_wrap").prepend('<iframe id="fancy_bigIframe" scrolling="no" frameborder="0"></iframe>');
38
- jQuery("#fancy_bigIframe").css({'width': jQuery(window).width(), 'height': jQuery(document).height(), 'opacity': 0});
39
- }
40
-
41
- jQuery("#fancy_overlay").click(jQuery.fn.fancybox.close);
42
- }
43
-
44
- opts.itemArray = [];
45
- opts.itemNum = 0;
46
-
47
- if (jQuery.isFunction(o.itemLoadCallback)) {
48
- o.itemLoadCallback.apply(this, [opts]);
49
-
50
- var c = jQuery(el).children("img:first").length ? jQuery(el).children("img:first") : jQuery(el);
51
- var tmp = {'width': c.width(), 'height': c.height(), 'pos': jQuery.fn.fancybox.getPosition(c)}
52
-
53
- for (var i = 0; i < opts.itemArray.length; i++) {
54
- opts.itemArray[i].o = jQuery.extend({}, o, opts.itemArray[i].o);
55
-
56
- if (o.zoomSpeedIn > 0 || o.zoomSpeedOut > 0) {
57
- opts.itemArray[i].orig = tmp;
58
- }
59
- }
60
-
61
- } else {
62
- if (!el.rel || el.rel == '') {
63
- var item = {url: el.href, title: el.title, o: o};
64
-
65
- if (o.zoomSpeedIn > 0 || o.zoomSpeedOut > 0) {
66
- var c = jQuery(el).children("img:first").length ? jQuery(el).children("img:first") : jQuery(el);
67
- item.orig = {'width': c.width(), 'height': c.height(), 'pos': jQuery.fn.fancybox.getPosition(c)}
68
- }
69
-
70
- opts.itemArray.push(item);
71
-
72
- } else {
73
- var arr = jQuery("a[@rel=" + el.rel + "]").get();
74
-
75
- for (var i = 0; i < arr.length; i++) {
76
- var tmp = jQuery.metadata ? jQuery.extend({}, o, jQuery(arr[i]).metadata()) : o;
77
- var item = {url: arr[i].href, title: arr[i].title, o: tmp};
78
-
79
- if (o.zoomSpeedIn > 0 || o.zoomSpeedOut > 0) {
80
- var c = jQuery(arr[i]).children("img:first").length ? jQuery(arr[i]).children("img:first") : jQuery(el);
81
-
82
- item.orig = {'width': c.width(), 'height': c.height(), 'pos': jQuery.fn.fancybox.getPosition(c)}
83
- }
84
-
85
- if (arr[i].href == el.href) opts.itemNum = i;
86
-
87
- opts.itemArray.push(item);
88
- }
89
- }
90
- }
91
-
92
- jQuery.fn.fancybox.changeItem(opts.itemNum);
93
- };
94
-
95
- jQuery.fn.fancybox.changeItem = function(n) {
96
- jQuery.fn.fancybox.showLoading();
97
-
98
- opts.itemNum = n;
99
-
100
- jQuery("#fancy_nav").empty();
101
- jQuery("#fancy_outer").stop();
102
- jQuery("#fancy_title").hide();
103
- jQuery(document).unbind("keydown");
104
-
105
- imgRegExp = imgTypes.join('|');
106
- imgRegExp = new RegExp('\.' + imgRegExp + 'jQuery', 'i');
107
-
108
- var url = opts.itemArray[n].url;
109
-
110
- if (url.match(/#/)) {
111
- var target = window.location.href.split('#')[0]; target = url.replace(target,'');
112
-
113
- jQuery.fn.fancybox.showItem('<div id="fancy_div">' + jQuery(target).html() + '</div>');
114
-
115
- jQuery("#fancy_loading").hide();
116
-
117
- } else if (url.match(imgRegExp)) {
118
- jQuery(imgPreloader).unbind('load').bind('load', function() {
119
- jQuery("#fancy_loading").hide();
120
-
121
- opts.itemArray[n].o.frameWidth = imgPreloader.width;
122
- opts.itemArray[n].o.frameHeight = imgPreloader.height;
123
-
124
- jQuery.fn.fancybox.showItem('<img id="fancy_img" title="Click to close" src="' + imgPreloader.src + '" />');
125
-
126
- }).attr('src', url + '?rand=' + Math.floor(Math.random() * 999999999) );
127
-
128
- } else {
129
- jQuery.fn.fancybox.showItem('<iframe id="fancy_frame" onload="jQuery.fn.fancybox.showIframe()" name="fancy_iframe' + Math.round(Math.random()*1000) + '" frameborder="0" hspace="0" src="' + url + '"></iframe>');
130
- }
131
- };
132
-
133
- jQuery.fn.fancybox.showIframe = function() {
134
- jQuery("#fancy_loading").hide();
135
- jQuery("#fancy_frame").show();
136
- };
137
-
138
- jQuery.fn.fancybox.showItem = function(val) {
139
- jQuery.fn.fancybox.preloadNeighborImages();
140
-
141
- var viewportPos = jQuery.fn.fancybox.getViewport();
142
- var itemSize = jQuery.fn.fancybox.getMaxSize(viewportPos[0] - 50, viewportPos[1] - 100, opts.itemArray[opts.itemNum].o.frameWidth, opts.itemArray[opts.itemNum].o.frameHeight);
143
-
144
- var itemLeft = viewportPos[2] + Math.round((viewportPos[0] - itemSize[0]) / 2) - 20;
145
- var itemTop = viewportPos[3] + Math.round((viewportPos[1] - itemSize[1]) / 2) - 40;
146
-
147
- var itemOpts = {
148
- 'left': itemLeft,
149
- 'top': itemTop,
150
- 'width': itemSize[0] + 'px',
151
- 'height': itemSize[1] + 'px'
152
- }
153
-
154
- if (opts.active) {
155
- jQuery('#fancy_content').fadeOut("normal", function() {
156
- jQuery("#fancy_content").empty();
157
-
158
- jQuery("#fancy_outer").animate(itemOpts, "normal", function() {
159
- jQuery("#fancy_content").append(jQuery(val)).fadeIn("normal");
160
- jQuery.fn.fancybox.updateDetails();
161
- });
162
- });
163
-
164
- } else {
165
- opts.active = true;
166
-
167
- jQuery("#fancy_content").empty();
168
-
169
- if (jQuery("#fancy_content").is(":animated")) {
170
- console.info('animated!');
171
- }
172
-
173
- if (opts.itemArray[opts.itemNum].o.zoomSpeedIn > 0) {
174
- opts.animating = true;
175
- itemOpts.opacity = "show";
176
-
177
- jQuery("#fancy_outer").css({
178
- 'top': opts.itemArray[opts.itemNum].orig.pos.top - 18,
179
- 'left': opts.itemArray[opts.itemNum].orig.pos.left - 18,
180
- 'height': opts.itemArray[opts.itemNum].orig.height,
181
- 'width': opts.itemArray[opts.itemNum].orig.width
182
- });
183
-
184
- jQuery("#fancy_content").append(jQuery(val)).show();
185
-
186
- jQuery("#fancy_outer").animate(itemOpts, opts.itemArray[opts.itemNum].o.zoomSpeedIn, function() {
187
- opts.animating = false;
188
- jQuery.fn.fancybox.updateDetails();
189
- });
190
-
191
- } else {
192
- jQuery("#fancy_content").append(jQuery(val)).show();
193
- jQuery("#fancy_outer").css(itemOpts).show();
194
- jQuery.fn.fancybox.updateDetails();
195
- }
196
- }
197
- };
198
-
199
- jQuery.fn.fancybox.updateDetails = function() {
200
- jQuery("#fancy_bg,#fancy_close").show();
201
-
202
- if (opts.itemArray[opts.itemNum].title !== undefined && opts.itemArray[opts.itemNum].title !== '') {
203
- jQuery('#fancy_title div').html(opts.itemArray[opts.itemNum].title);
204
- jQuery('#fancy_title').show();
205
- }
206
-
207
- if (opts.itemArray[opts.itemNum].o.hideOnContentClick) {
208
- jQuery("#fancy_content").click(jQuery.fn.fancybox.close);
209
- } else {
210
- jQuery("#fancy_content").unbind('click');
211
- }
212
-
213
- if (opts.itemNum != 0) {
214
- jQuery("#fancy_nav").append('<a id="fancy_left" href="javascript:;"></a>');
215
-
216
- jQuery('#fancy_left').click(function() {
217
- jQuery.fn.fancybox.changeItem(opts.itemNum - 1); return false;
218
- });
219
- }
220
-
221
- if (opts.itemNum != (opts.itemArray.length - 1)) {
222
- jQuery("#fancy_nav").append('<a id="fancy_right" href="javascript:;"></a>');
223
-
224
- jQuery('#fancy_right').click(function(){
225
- jQuery.fn.fancybox.changeItem(opts.itemNum + 1); return false;
226
- });
227
- }
228
-
229
- jQuery(document).keydown(function(event) {
230
- if (event.keyCode == 27) {
231
- jQuery.fn.fancybox.close();
232
-
233
- } else if(event.keyCode == 37 && opts.itemNum != 0) {
234
- jQuery.fn.fancybox.changeItem(opts.itemNum - 1);
235
-
236
- } else if(event.keyCode == 39 && opts.itemNum != (opts.itemArray.length - 1)) {
237
- jQuery.fn.fancybox.changeItem(opts.itemNum + 1);
238
- }
239
- });
240
- };
241
-
242
- jQuery.fn.fancybox.preloadNeighborImages = function() {
243
- if ((opts.itemArray.length - 1) > opts.itemNum) {
244
- preloadNextImage = new Image();
245
- preloadNextImage.src = opts.itemArray[opts.itemNum + 1].url;
246
- }
247
-
248
- if (opts.itemNum > 0) {
249
- preloadPrevImage = new Image();
250
- preloadPrevImage.src = opts.itemArray[opts.itemNum - 1].url;
251
- }
252
- };
253
-
254
- jQuery.fn.fancybox.close = function() {
255
- if (opts.animating) return false;
256
-
257
- jQuery(imgPreloader).unbind('load');
258
- jQuery(document).unbind("keydown");
259
-
260
- jQuery("#fancy_loading,#fancy_title,#fancy_close,#fancy_bg").hide();
261
-
262
- jQuery("#fancy_nav").empty();
263
-
264
- opts.active = false;
265
-
266
- if (opts.itemArray[opts.itemNum].o.zoomSpeedOut > 0) {
267
- var itemOpts = {
268
- 'top': opts.itemArray[opts.itemNum].orig.pos.top - 18,
269
- 'left': opts.itemArray[opts.itemNum].orig.pos.left - 18,
270
- 'height': opts.itemArray[opts.itemNum].orig.height,
271
- 'width': opts.itemArray[opts.itemNum].orig.width,
272
- 'opacity': 'hide'
273
- };
274
-
275
- opts.animating = true;
276
-
277
- jQuery("#fancy_outer").animate(itemOpts, opts.itemArray[opts.itemNum].o.zoomSpeedOut, function() {
278
- jQuery("#fancy_content").hide().empty();
279
- jQuery("#fancy_overlay,#fancy_bigIframe").remove();
280
- opts.animating = false;
281
- });
282
-
283
- } else {
284
- jQuery("#fancy_outer").hide();
285
- jQuery("#fancy_content").hide().empty();
286
- jQuery("#fancy_overlay,#fancy_bigIframe").fadeOut("fast").remove();
287
- }
288
- };
289
-
290
- jQuery.fn.fancybox.showLoading = function() {
291
- clearInterval(loadingTimer);
292
-
293
- var pos = jQuery.fn.fancybox.getViewport();
294
-
295
- jQuery("#fancy_loading").css({'left': ((pos[0] - 40) / 2 + pos[2]), 'top': ((pos[1] - 40) / 2 + pos[3])}).show();
296
- jQuery("#fancy_loading").bind('click', jQuery.fn.fancybox.close);
297
-
298
- loadingTimer = setInterval(jQuery.fn.fancybox.animateLoading, 66);
299
- };
300
-
301
- jQuery.fn.fancybox.animateLoading = function(el, o) {
302
- if (!jQuery("#fancy_loading").is(':visible')){
303
- clearInterval(loadingTimer);
304
- return;
305
- }
306
-
307
- jQuery("#fancy_loading > div").css('top', (loadingFrame * -40) + 'px');
308
-
309
- loadingFrame = (loadingFrame + 1) % 12;
310
- };
311
-
312
- jQuery.fn.fancybox.init = function() {
313
- if (!jQuery('#fancy_wrap').length) {
314
- jQuery('<div id="fancy_wrap"><div id="fancy_loading"><div></div></div><div id="fancy_outer"><div id="fancy_inner"><div id="fancy_nav"></div><div id="fancy_close"></div><div id="fancy_content"></div><div id="fancy_title"></div></div></div></div>').appendTo("body");
315
- jQuery('<div id="fancy_bg"><div class="fancy_bg fancy_bg_n"></div><div class="fancy_bg fancy_bg_ne"></div><div class="fancy_bg fancy_bg_e"></div><div class="fancy_bg fancy_bg_se"></div><div class="fancy_bg fancy_bg_s"></div><div class="fancy_bg fancy_bg_sw"></div><div class="fancy_bg fancy_bg_w"></div><div class="fancy_bg fancy_bg_nw"></div></div>').prependTo("#fancy_inner");
316
-
317
- jQuery('<table cellspacing="0" cellpadding="0" border="0"><tr><td id="fancy_title_left"></td><td id="fancy_title_main"><div></div></td><td id="fancy_title_right"></td></tr></table>').appendTo('#fancy_title');
318
- }
319
-
320
- if (jQuery.browser.msie) {
321
- jQuery("#fancy_inner").prepend('<iframe id="fancy_freeIframe" scrolling="no" frameborder="0"></iframe>');
322
- }
323
-
324
- if (jQuery.fn.pngFix) jQuery(document).pngFix();
325
-
326
- jQuery("#fancy_close").click(jQuery.fn.fancybox.close);
327
- };
328
-
329
- jQuery.fn.fancybox.getPosition = function(el) {
330
- var pos = el.offset();
331
-
332
- pos.top += jQuery.fn.fancybox.num(el, 'paddingTop');
333
- pos.top += jQuery.fn.fancybox.num(el, 'borderTopWidth');
334
-
335
- pos.left += jQuery.fn.fancybox.num(el, 'paddingLeft');
336
- pos.left += jQuery.fn.fancybox.num(el, 'borderLeftWidth');
337
-
338
- return pos;
339
- };
340
-
341
- jQuery.fn.fancybox.num = function (el, prop) {
342
- return parseInt(jQuery.curCSS(el.jquery?el[0]:el,prop,true))||0;
343
- };
344
-
345
- jQuery.fn.fancybox.getPageScroll = function() {
346
- var xScroll, yScroll;
347
-
348
- if (self.pageYOffset) {
349
- yScroll = self.pageYOffset;
350
- xScroll = self.pageXOffset;
351
- } else if (document.documentElement && document.documentElement.scrollTop) {
352
- yScroll = document.documentElement.scrollTop;
353
- xScroll = document.documentElement.scrollLeft;
354
- } else if (document.body) {
355
- yScroll = document.body.scrollTop;
356
- xScroll = document.body.scrollLeft;
357
- }
358
-
359
- return [xScroll, yScroll];
360
- };
361
-
362
- jQuery.fn.fancybox.getViewport = function() {
363
- var scroll = jQuery.fn.fancybox.getPageScroll();
364
-
365
- return [jQuery(window).width(), jQuery(window).height(), scroll[0], scroll[1]];
366
- };
367
-
368
- jQuery.fn.fancybox.getMaxSize = function(maxWidth, maxHeight, imageWidth, imageHeight) {
369
- var r = Math.min(Math.min(maxWidth, imageWidth) / imageWidth, Math.min(maxHeight, imageHeight) / imageHeight);
370
-
371
- return [Math.round(r * imageWidth), Math.round(r * imageHeight)];
372
- };
373
-
374
- jQuery.fn.fancybox.defaults = {
375
- hideOnContentClick: true,
376
- zoomSpeedIn: 500,
377
- zoomSpeedOut: 500,
378
- frameWidth: 600,
379
- frameHeight: 400,
380
- overlayShow: false,
381
- overlayOpacity: 0.4,
382
- itemLoadCallback: null
383
- };
384
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: moskis
3
  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
7
- Stable tag: 1.1
8
 
9
  Seamlessly integrates FancyBox into your blog: Upload, activate, and you're done. No further configuration needed.
10
 
@@ -22,7 +22,14 @@ The requirements are that the link is an image (for example a thumbnail), and th
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
- 1.1 Fixes:
 
 
 
 
 
 
 
26
 
27
  * Fixed FancyBox not being applied to .jpeg files
28
  * Fixed "Click to close" overlay text
@@ -33,17 +40,23 @@ Finally, i have only tested the plugin in WordPress 2.7, but it should work on r
33
 
34
  1. Upload the `fancybox-for-wordpress` folder to the `/wp-content/plugins/` directory
35
  2. Activate the plugin through the 'Plugins' menu in WordPress
36
- 3. See [FancyBox](http://fancy.klade.lv/) magically applied to all your image links and galleries.
37
 
38
 
39
  == Frequently Asked Questions ==
40
 
 
 
 
 
41
  = About future releases =
42
 
43
  Future releases will continue to work without having to make any configuration, but i will provide an options page to allow customization of the [FancyBox](http://fancy.klade.lv/) effect, and being able to change where it is used in your blog.
44
 
45
  = No worky, what now? =
46
 
 
 
47
  If the plugin is not working or you find any bug/bad behaviour/conflict deactivate it and email me at jose (at) moskis.net with a description of the problem, and i'll take a look at it.
48
 
49
  If activating the plugin somehow brakes your panel (cant imagine that happening but just in case) delete the plugin from the plugins folder and go to your blog panel.
3
  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.2
8
 
9
  Seamlessly integrates FancyBox into your blog: Upload, activate, and you're done. No further configuration needed.
10
 
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.2 Updates:
28
+
29
+ * Upgraded to use FancyBox 1.2.0
30
+ * Uses packed version of the JavaScript file (8kb instead of 14kb).
31
+
32
+ 1.1 Updates:
33
 
34
  * Fixed FancyBox not being applied to .jpeg files
35
  * Fixed "Click to close" overlay text
40
 
41
  1. Upload the `fancybox-for-wordpress` folder to the `/wp-content/plugins/` directory
42
  2. Activate the plugin through the 'Plugins' menu in WordPress
43
+ 3. That's it, [FancyBox](http://fancy.klade.lv/) will be automatically applied to all your image links and galleries.
44
 
45
 
46
  == Frequently Asked Questions ==
47
 
48
+ = Are you the author of FancyBox? =
49
+
50
+ NO. I just ported it to WordPress. For more info on the FancyBox script itself [visit its website](http://fancy.klade.lv/home).
51
+
52
  = About future releases =
53
 
54
  Future releases will continue to work without having to make any configuration, but i will provide an options page to allow customization of the [FancyBox](http://fancy.klade.lv/) effect, and being able to change where it is used in your blog.
55
 
56
  = No worky, what now? =
57
 
58
+ First, try other versions of this plugin, and see if any version works for you. Version 1.2 uses the latest FancyBox which might not work well without jQuery 1.3.x or later.
59
+
60
  If the plugin is not working or you find any bug/bad behaviour/conflict deactivate it and email me at jose (at) moskis.net with a description of the problem, and i'll take a look at it.
61
 
62
  If activating the plugin somehow brakes your panel (cant imagine that happening but just in case) delete the plugin from the plugins folder and go to your blog panel.