Lightbox Gallery - Version 0.1

Version Description

Download this release

Release Info

Developer Hiroaki Miyashita
Plugin Icon wp plugin Lightbox Gallery
Version 0.1
Comparing to
See all releases

Version 0.1

images/lightbox-blank.gif ADDED
Binary file
images/lightbox-btn-close.gif ADDED
Binary file
images/lightbox-btn-next.gif ADDED
Binary file
images/lightbox-btn-prev.gif ADDED
Binary file
images/lightbox-ico-loading.gif ADDED
Binary file
js/jquery.bgiframe.js ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
2
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
3
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
4
+ *
5
+ * $LastChangedDate: 2007-06-20 03:23:36 +0200 (Mi, 20 Jun 2007) $
6
+ * $Rev: 2110 $
7
+ *
8
+ * Version 2.1
9
+ */
10
+
11
+ (function($){
12
+
13
+ /**
14
+ * The bgiframe is chainable and applies the iframe hack to get
15
+ * around zIndex issues in IE6. It will only apply itself in IE
16
+ * and adds a class to the iframe called 'bgiframe'. The iframe
17
+ * is appeneded as the first child of the matched element(s)
18
+ * with a tabIndex and zIndex of -1.
19
+ *
20
+ * By default the plugin will take borders, sized with pixel units,
21
+ * into account. If a different unit is used for the border's width,
22
+ * then you will need to use the top and left settings as explained below.
23
+ *
24
+ * NOTICE: This plugin has been reported to cause perfromance problems
25
+ * when used on elements that change properties (like width, height and
26
+ * opacity) a lot in IE6. Most of these problems have been caused by
27
+ * the expressions used to calculate the elements width, height and
28
+ * borders. Some have reported it is due to the opacity filter. All
29
+ * these settings can be changed if needed as explained below.
30
+ *
31
+ * @example $('div').bgiframe();
32
+ * @before <div><p>Paragraph</p></div>
33
+ * @result <div><iframe class="bgiframe".../><p>Paragraph</p></div>
34
+ *
35
+ * @param Map settings Optional settings to configure the iframe.
36
+ * @option String|Number top The iframe must be offset to the top
37
+ * by the width of the top border. This should be a negative
38
+ * number representing the border-top-width. If a number is
39
+ * is used here, pixels will be assumed. Otherwise, be sure
40
+ * to specify a unit. An expression could also be used.
41
+ * By default the value is "auto" which will use an expression
42
+ * to get the border-top-width if it is in pixels.
43
+ * @option String|Number left The iframe must be offset to the left
44
+ * by the width of the left border. This should be a negative
45
+ * number representing the border-left-width. If a number is
46
+ * is used here, pixels will be assumed. Otherwise, be sure
47
+ * to specify a unit. An expression could also be used.
48
+ * By default the value is "auto" which will use an expression
49
+ * to get the border-left-width if it is in pixels.
50
+ * @option String|Number width This is the width of the iframe. If
51
+ * a number is used here, pixels will be assume. Otherwise, be sure
52
+ * to specify a unit. An experssion could also be used.
53
+ * By default the value is "auto" which will use an experssion
54
+ * to get the offsetWidth.
55
+ * @option String|Number height This is the height of the iframe. If
56
+ * a number is used here, pixels will be assume. Otherwise, be sure
57
+ * to specify a unit. An experssion could also be used.
58
+ * By default the value is "auto" which will use an experssion
59
+ * to get the offsetHeight.
60
+ * @option Boolean opacity This is a boolean representing whether or not
61
+ * to use opacity. If set to true, the opacity of 0 is applied. If
62
+ * set to false, the opacity filter is not applied. Default: true.
63
+ * @option String src This setting is provided so that one could change
64
+ * the src of the iframe to whatever they need.
65
+ * Default: "javascript:false;"
66
+ *
67
+ * @name bgiframe
68
+ * @type jQuery
69
+ * @cat Plugins/bgiframe
70
+ * @author Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
71
+ */
72
+ $.fn.bgIframe = $.fn.bgiframe = function(s) {
73
+ // This is only for IE6
74
+ if ( $.browser.msie && parseInt($.browser.version) <= 6 ) {
75
+ s = $.extend({
76
+ top : 'auto', // auto == .currentStyle.borderTopWidth
77
+ left : 'auto', // auto == .currentStyle.borderLeftWidth
78
+ width : 'auto', // auto == offsetWidth
79
+ height : 'auto', // auto == offsetHeight
80
+ opacity : true,
81
+ src : 'javascript:false;'
82
+ }, s || {});
83
+ var prop = function(n){return n&&n.constructor==Number?n+'px':n;},
84
+ html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+
85
+ 'style="display:block;position:absolute;z-index:-1;'+
86
+ (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+
87
+ 'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+
88
+ 'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+
89
+ 'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+
90
+ 'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+
91
+ '"/>';
92
+ return this.each(function() {
93
+ if ( $('> iframe.bgiframe', this).length == 0 )
94
+ this.insertBefore( document.createElement(html), this.firstChild );
95
+ });
96
+ }
97
+ return this;
98
+ };
99
+
100
+ // Add browser.version if it doesn't exist
101
+ if (!$.browser.version)
102
+ $.browser.version = navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1];
103
+
104
+ })(jQuery);
js/jquery.lightbox.css ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jQuery lightBox plugin
3
+ * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
4
+ * and adapted to me for use like a plugin from jQuery.
5
+ * @name jquery-lightbox-0.5.css
6
+ * @author Leandro Vieira Pinho - http://leandrovieira.com
7
+ * @version 0.5
8
+ * @date April 11, 2008
9
+ * @category jQuery plugin
10
+ * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
11
+ * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
12
+ * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
13
+ */
14
+ #jquery-overlay {
15
+ position: absolute;
16
+ top: 0;
17
+ left: 0;
18
+ z-index: 90;
19
+ width: 100%;
20
+ height: 500px;
21
+ }
22
+ #jquery-lightbox {
23
+ position: absolute;
24
+ top: 0;
25
+ left: 0;
26
+ width: 100%;
27
+ z-index: 100;
28
+ text-align: center;
29
+ line-height: 0;
30
+ }
31
+ #jquery-lightbox a img { border: none; }
32
+ #lightbox-container-image-box {
33
+ position: relative;
34
+ background-color: #fff;
35
+ width: 250px;
36
+ height: 250px;
37
+ margin: 0 auto;
38
+ }
39
+ #lightbox-container-image { padding: 10px; }
40
+ #lightbox-loading {
41
+ position: absolute;
42
+ top: 40%;
43
+ left: 0%;
44
+ height: 25%;
45
+ width: 100%;
46
+ text-align: center;
47
+ line-height: 0;
48
+ }
49
+ #lightbox-nav {
50
+ position: absolute;
51
+ top: 0;
52
+ left: 0;
53
+ height: 100%;
54
+ width: 100%;
55
+ z-index: 10;
56
+ }
57
+ #lightbox-container-image-box > #lightbox-nav { left: 0; }
58
+ #lightbox-nav a { outline: none;}
59
+ #lightbox-nav-btnPrev, #lightbox-nav-btnNext {
60
+ width: 49%;
61
+ height: 100%;
62
+ zoom: 1;
63
+ display: block;
64
+ }
65
+ #lightbox-nav-btnPrev {
66
+ left: 0;
67
+ float: left;
68
+ }
69
+ #lightbox-nav-btnNext {
70
+ right: 0;
71
+ float: right;
72
+ }
73
+ #lightbox-container-image-data-box {
74
+ font: 10px Verdana, Helvetica, sans-serif;
75
+ background-color: #fff;
76
+ margin: 0 auto;
77
+ line-height: 1.4em;
78
+ overflow: auto;
79
+ width: 100%;
80
+ padding: 0 10px 0;
81
+ }
82
+ #lightbox-container-image-data {
83
+ padding: 0 10px;
84
+ color: #666;
85
+ }
86
+ #lightbox-container-image-data #lightbox-image-details {
87
+ width: 70%;
88
+ float: left;
89
+ text-align: left;
90
+ }
91
+ #lightbox-image-details-caption { font-weight: bold; }
92
+ #lightbox-image-details-currentNumber {
93
+ display: block;
94
+ clear: left;
95
+ padding-bottom: 1.0em;
96
+ }
97
+ #lightbox-secNav-btnClose {
98
+ width: 66px;
99
+ float: right;
100
+ padding-bottom: 0.7em;
101
+ }
js/jquery.lightbox.js ADDED
@@ -0,0 +1,472 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jQuery lightBox plugin
3
+ * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
4
+ * and adapted to me for use like a plugin from jQuery.
5
+ * @name jquery-lightbox-0.5.js
6
+ * @author Leandro Vieira Pinho - http://leandrovieira.com
7
+ * @version 0.5
8
+ * @date April 11, 2008
9
+ * @category jQuery plugin
10
+ * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
11
+ * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
12
+ * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
13
+ */
14
+
15
+ // Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias
16
+ (function($) {
17
+ /**
18
+ * $ is an alias to jQuery object
19
+ *
20
+ */
21
+ $.fn.lightBox = function(settings) {
22
+ // Settings to configure the jQuery lightBox plugin how you like
23
+ settings = jQuery.extend({
24
+ // Configuration related to overlay
25
+ overlayBgColor: '#000', // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
26
+ overlayOpacity: 0.8, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
27
+ // Configuration related to navigation
28
+ fixedNavigation: false, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
29
+ // Configuration related to images
30
+ imageLoading: lightbox_path+'images/lightbox-ico-loading.gif', // (string) Path and the name of the loading icon
31
+ imageBtnPrev: lightbox_path+'images/lightbox-btn-prev.gif', // (string) Path and the name of the prev button image
32
+ imageBtnNext: lightbox_path+'images/lightbox-btn-next.gif', // (string) Path and the name of the next button image
33
+ imageBtnClose: lightbox_path+'images/lightbox-btn-close.gif', // (string) Path and the name of the close btn
34
+ imageBlank: lightbox_path+'images/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel)
35
+ // Configuration related to container image box
36
+ containerBorderSize: 10, // (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
37
+ containerResizeSpeed: 400, // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
38
+ // Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
39
+ txtImage: 'Image', // (string) Specify text "Image"
40
+ txtOf: 'of', // (string) Specify text "of"
41
+ // Configuration related to keyboard navigation
42
+ keyToClose: 'c', // (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
43
+ keyToPrev: 'p', // (string) (p = previous) Letter to show the previous image
44
+ keyToNext: 'n', // (string) (n = next) Letter to show the next image.
45
+ // Don�t alter these variables in any way
46
+ imageArray: [],
47
+ activeImage: 0
48
+ },settings);
49
+ // Caching the jQuery object with all elements matched
50
+ var jQueryMatchedObj = this; // This, in this context, refer to jQuery object
51
+ /**
52
+ * Initializing the plugin calling the start function
53
+ *
54
+ * @return boolean false
55
+ */
56
+ function _initialize() {
57
+ _start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked
58
+ return false; // Avoid the browser following the link
59
+ }
60
+ /**
61
+ * Start the jQuery lightBox plugin
62
+ *
63
+ * @param object objClicked The object (link) whick the user have clicked
64
+ * @param object jQueryMatchedObj The jQuery object with all elements matched
65
+ */
66
+ function _start(objClicked,jQueryMatchedObj) {
67
+ // Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
68
+ $('embed, object, select').css({ 'visibility' : 'hidden' });
69
+ // Call the function to create the markup structure; style some elements; assign events in some elements.
70
+ _set_interface();
71
+ // Unset total images in imageArray
72
+ settings.imageArray.length = 0;
73
+ // Unset image active information
74
+ settings.activeImage = 0;
75
+ // We have an image set? Or just an image? Let�s see it.
76
+ if ( jQueryMatchedObj.length == 1 ) {
77
+ settings.imageArray.push(new Array(objClicked.getAttribute('href'),jQuery(objClicked).parent().next().html()));
78
+ } else {
79
+ // Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references
80
+ for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
81
+ settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQuery(jQueryMatchedObj[i]).parent().next().html()));
82
+ }
83
+ }
84
+ while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {
85
+ settings.activeImage++;
86
+ }
87
+ // Call the function that prepares image exibition
88
+ _set_image_to_view();
89
+ }
90
+ /**
91
+ * Create the jQuery lightBox plugin interface
92
+ *
93
+ * The HTML markup will be like that:
94
+ <div id="jquery-overlay"></div>
95
+ <div id="jquery-lightbox">
96
+ <div id="lightbox-container-image-box">
97
+ <div id="lightbox-container-image">
98
+ <img src="../fotos/XX.jpg" id="lightbox-image">
99
+ <div id="lightbox-nav">
100
+ <a href="#" id="lightbox-nav-btnPrev"></a>
101
+ <a href="#" id="lightbox-nav-btnNext"></a>
102
+ </div>
103
+ <div id="lightbox-loading">
104
+ <a href="#" id="lightbox-loading-link">
105
+ <img src="../images/lightbox-ico-loading.gif">
106
+ </a>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ <div id="lightbox-container-image-data-box">
111
+ <div id="lightbox-container-image-data">
112
+ <div id="lightbox-image-details">
113
+ <span id="lightbox-image-details-caption"></span>
114
+ <span id="lightbox-image-details-currentNumber"></span>
115
+ </div>
116
+ <div id="lightbox-secNav">
117
+ <a href="#" id="lightbox-secNav-btnClose">
118
+ <img src="../images/lightbox-btn-close.gif">
119
+ </a>
120
+ </div>
121
+ </div>
122
+ </div>
123
+ </div>
124
+ *
125
+ */
126
+ function _set_interface() {
127
+ // Apply the HTML markup into body tag
128
+ $('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');
129
+ // Get page sizes
130
+ var arrPageSizes = ___getPageSize();
131
+ // Style overlay and show it
132
+ $('#jquery-overlay').css({
133
+ backgroundColor: settings.overlayBgColor,
134
+ opacity: settings.overlayOpacity,
135
+ width: arrPageSizes[0],
136
+ height: arrPageSizes[1]
137
+ }).fadeIn();
138
+ // Get page scroll
139
+ var arrPageScroll = ___getPageScroll();
140
+ // Calculate top and left offset for the jquery-lightbox div object and show it
141
+ $('#jquery-lightbox').css({
142
+ top: arrPageScroll[1] + (arrPageSizes[3] / 10),
143
+ left: arrPageScroll[0]
144
+ }).show();
145
+ // Assigning click events in elements to close overlay
146
+ $('#jquery-overlay,#jquery-lightbox').click(function() {
147
+ _finish();
148
+ });
149
+ // Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects
150
+ $('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
151
+ _finish();
152
+ return false;
153
+ });
154
+ // If window was resized, calculate the new overlay dimensions
155
+ $(window).resize(function() {
156
+ // Get page sizes
157
+ var arrPageSizes = ___getPageSize();
158
+ // Style overlay and show it
159
+ $('#jquery-overlay').css({
160
+ width: arrPageSizes[0],
161
+ height: arrPageSizes[1]
162
+ });
163
+ // Get page scroll
164
+ var arrPageScroll = ___getPageScroll();
165
+ // Calculate top and left offset for the jquery-lightbox div object and show it
166
+ $('#jquery-lightbox').css({
167
+ top: arrPageScroll[1] + (arrPageSizes[3] / 10),
168
+ left: arrPageScroll[0]
169
+ });
170
+ });
171
+ }
172
+ /**
173
+ * Prepares image exibition; doing a image�s preloader to calculate it�s size
174
+ *
175
+ */
176
+ function _set_image_to_view() { // show the loading
177
+ // Show the loading
178
+ $('#lightbox-loading').show();
179
+ if ( settings.fixedNavigation ) {
180
+ $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
181
+ } else {
182
+ // Hide some elements
183
+ $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
184
+ }
185
+ // Image preload process
186
+ var objImagePreloader = new Image();
187
+ objImagePreloader.onload = function() {
188
+ $('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);
189
+ // Perfomance an effect in the image container resizing it
190
+ _resize_container_image_box(objImagePreloader.width,objImagePreloader.height);
191
+ // clear onLoad, IE behaves irratically with animated gifs otherwise
192
+ objImagePreloader.onload=function(){};
193
+ };
194
+ objImagePreloader.src = settings.imageArray[settings.activeImage][0];
195
+ };
196
+ /**
197
+ * Perfomance an effect in the image container resizing it
198
+ *
199
+ * @param integer intImageWidth The image�s width that will be showed
200
+ * @param integer intImageHeight The image�s height that will be showed
201
+ */
202
+ function _resize_container_image_box(intImageWidth,intImageHeight) {
203
+ // Get current width and height
204
+ var intCurrentWidth = $('#lightbox-container-image-box').width();
205
+ var intCurrentHeight = $('#lightbox-container-image-box').height();
206
+ // Get the width and height of the selected image plus the padding
207
+ var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image�s width and the left and right padding value
208
+ var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image�s height and the left and right padding value
209
+ // Diferences
210
+ var intDiffW = intCurrentWidth - intWidth;
211
+ var intDiffH = intCurrentHeight - intHeight;
212
+ // Perfomance the effect
213
+ $('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });
214
+ if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {
215
+ if ( $.browser.msie ) {
216
+ ___pause(250);
217
+ } else {
218
+ ___pause(100);
219
+ }
220
+ }
221
+ $('#lightbox-container-image-data-box').css({ width: intImageWidth });
222
+ $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });
223
+ };
224
+ /**
225
+ * Show the prepared image
226
+ *
227
+ */
228
+ function _show_image() {
229
+ $('#lightbox-loading').hide();
230
+ $('#lightbox-image').fadeIn(function() {
231
+ _show_image_data();
232
+ _set_navigation();
233
+ });
234
+ _preload_neighbor_images();
235
+ };
236
+ /**
237
+ * Show the image information
238
+ *
239
+ */
240
+ function _show_image_data() {
241
+ $('#lightbox-container-image-data-box').slideDown('fast');
242
+ $('#lightbox-image-details-caption').hide();
243
+ if ( settings.imageArray[settings.activeImage][1] ) {
244
+ $('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();
245
+ }
246
+ // If we have a image set, display 'Image X of X'
247
+ if ( settings.imageArray.length > 1 ) {
248
+ $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();
249
+ }
250
+ }
251
+ /**
252
+ * Display the button navigations
253
+ *
254
+ */
255
+ function _set_navigation() {
256
+ $('#lightbox-nav').show();
257
+
258
+ // Instead to define this configuration in CSS file, we define here. And it�s need to IE. Just.
259
+ $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
260
+
261
+ // Show the prev button, if not the first image in set
262
+ if ( settings.activeImage != 0 ) {
263
+ if ( settings.fixedNavigation ) {
264
+ $('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })
265
+ .unbind()
266
+ .bind('click',function() {
267
+ settings.activeImage = settings.activeImage - 1;
268
+ _set_image_to_view();
269
+ return false;
270
+ });
271
+ } else {
272
+ // Show the images button for Next buttons
273
+ $('#lightbox-nav-btnPrev').unbind().hover(function() {
274
+ $(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });
275
+ },function() {
276
+ $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
277
+ }).show().bind('click',function() {
278
+ settings.activeImage = settings.activeImage - 1;
279
+ _set_image_to_view();
280
+ return false;
281
+ });
282
+ }
283
+ }
284
+
285
+ // Show the next button, if not the last image in set
286
+ if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {
287
+ if ( settings.fixedNavigation ) {
288
+ $('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })
289
+ .unbind()
290
+ .bind('click',function() {
291
+ settings.activeImage = settings.activeImage + 1;
292
+ _set_image_to_view();
293
+ return false;
294
+ });
295
+ } else {
296
+ // Show the images button for Next buttons
297
+ $('#lightbox-nav-btnNext').unbind().hover(function() {
298
+ $(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });
299
+ },function() {
300
+ $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
301
+ }).show().bind('click',function() {
302
+ settings.activeImage = settings.activeImage + 1;
303
+ _set_image_to_view();
304
+ return false;
305
+ });
306
+ }
307
+ }
308
+ // Enable keyboard navigation
309
+ _enable_keyboard_navigation();
310
+ }
311
+ /**
312
+ * Enable a support to keyboard navigation
313
+ *
314
+ */
315
+ function _enable_keyboard_navigation() {
316
+ $(document).keydown(function(objEvent) {
317
+ _keyboard_action(objEvent);
318
+ });
319
+ }
320
+ /**
321
+ * Disable the support to keyboard navigation
322
+ *
323
+ */
324
+ function _disable_keyboard_navigation() {
325
+ $(document).unbind();
326
+ }
327
+ /**
328
+ * Perform the keyboard actions
329
+ *
330
+ */
331
+ function _keyboard_action(objEvent) {
332
+ // To ie
333
+ if ( objEvent == null ) {
334
+ keycode = event.keyCode;
335
+ escapeKey = 27;
336
+ // To Mozilla
337
+ } else {
338
+ keycode = objEvent.keyCode;
339
+ escapeKey = objEvent.DOM_VK_ESCAPE;
340
+ }
341
+ // Get the key in lower case form
342
+ key = String.fromCharCode(keycode).toLowerCase();
343
+ // Verify the keys to close the ligthBox
344
+ if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {
345
+ _finish();
346
+ }
347
+ // Verify the key to show the previous image
348
+ if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {
349
+ // If we�re not showing the first image, call the previous
350
+ if ( settings.activeImage != 0 ) {
351
+ settings.activeImage = settings.activeImage - 1;
352
+ _set_image_to_view();
353
+ _disable_keyboard_navigation();
354
+ }
355
+ }
356
+ // Verify the key to show the next image
357
+ if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {
358
+ // If we�re not showing the last image, call the next
359
+ if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {
360
+ settings.activeImage = settings.activeImage + 1;
361
+ _set_image_to_view();
362
+ _disable_keyboard_navigation();
363
+ }
364
+ }
365
+ }
366
+ /**
367
+ * Preload prev and next images being showed
368
+ *
369
+ */
370
+ function _preload_neighbor_images() {
371
+ if ( (settings.imageArray.length -1) > settings.activeImage ) {
372
+ objNext = new Image();
373
+ objNext.src = settings.imageArray[settings.activeImage + 1][0];
374
+ }
375
+ if ( settings.activeImage > 0 ) {
376
+ objPrev = new Image();
377
+ objPrev.src = settings.imageArray[settings.activeImage -1][0];
378
+ }
379
+ }
380
+ /**
381
+ * Remove jQuery lightBox plugin HTML markup
382
+ *
383
+ */
384
+ function _finish() {
385
+ $('#jquery-lightbox').remove();
386
+ $('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });
387
+ // Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
388
+ $('embed, object, select').css({ 'visibility' : 'visible' });
389
+ }
390
+ /**
391
+ / THIRD FUNCTION
392
+ * getPageSize() by quirksmode.com
393
+ *
394
+ * @return Array Return an array with page width, height and window width, height
395
+ */
396
+ function ___getPageSize() {
397
+ var xScroll, yScroll;
398
+ if (window.innerHeight && window.scrollMaxY) {
399
+ xScroll = window.innerWidth + window.scrollMaxX;
400
+ yScroll = window.innerHeight + window.scrollMaxY;
401
+ } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
402
+ xScroll = document.body.scrollWidth;
403
+ yScroll = document.body.scrollHeight;
404
+ } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
405
+ xScroll = document.body.offsetWidth;
406
+ yScroll = document.body.offsetHeight;
407
+ }
408
+ var windowWidth, windowHeight;
409
+ if (self.innerHeight) { // all except Explorer
410
+ if(document.documentElement.clientWidth){
411
+ windowWidth = document.documentElement.clientWidth;
412
+ } else {
413
+ windowWidth = self.innerWidth;
414
+ }
415
+ windowHeight = self.innerHeight;
416
+ } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
417
+ windowWidth = document.documentElement.clientWidth;
418
+ windowHeight = document.documentElement.clientHeight;
419
+ } else if (document.body) { // other Explorers
420
+ windowWidth = document.body.clientWidth;
421
+ windowHeight = document.body.clientHeight;
422
+ }
423
+ // for small pages with total height less then height of the viewport
424
+ if(yScroll < windowHeight){
425
+ pageHeight = windowHeight;
426
+ } else {
427
+ pageHeight = yScroll;
428
+ }
429
+ // for small pages with total width less then width of the viewport
430
+ if(xScroll < windowWidth){
431
+ pageWidth = xScroll;
432
+ } else {
433
+ pageWidth = windowWidth;
434
+ }
435
+ arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
436
+ return arrayPageSize;
437
+ };
438
+ /**
439
+ / THIRD FUNCTION
440
+ * getPageScroll() by quirksmode.com
441
+ *
442
+ * @return Array Return an array with x,y page scroll values.
443
+ */
444
+ function ___getPageScroll() {
445
+ var xScroll, yScroll;
446
+ if (self.pageYOffset) {
447
+ yScroll = self.pageYOffset;
448
+ xScroll = self.pageXOffset;
449
+ } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
450
+ yScroll = document.documentElement.scrollTop;
451
+ xScroll = document.documentElement.scrollLeft;
452
+ } else if (document.body) {// all other Explorers
453
+ yScroll = document.body.scrollTop;
454
+ xScroll = document.body.scrollLeft;
455
+ }
456
+ arrayPageScroll = new Array(xScroll,yScroll);
457
+ return arrayPageScroll;
458
+ };
459
+ /**
460
+ * Stop the code execution from a escified time in milisecond
461
+ *
462
+ */
463
+ function ___pause(ms) {
464
+ var date = new Date();
465
+ curDate = null;
466
+ do { var curDate = new Date(); }
467
+ while ( curDate - date < ms);
468
+ };
469
+ // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
470
+ return this.unbind('click').click(_initialize);
471
+ };
472
+ })(jQuery); // Call and execute the function immediately passing the jQuery object
js/jquery.tooltip.css ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ #tooltip {
2
+ position: absolute;
3
+ z-index: 3000;
4
+ padding: 5px;
5
+ opacity: 0.85;
6
+ border: 1px solid #000;
7
+ background-color: #444;
8
+ color: #FFFFFF;
9
+ line-height:120%;
10
+ }
11
+ #tooltip h3, #tooltip div { margin: 0;color: #FFFFFF; }
js/jquery.tooltip.js ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Tooltip plugin 1.2
3
+ *
4
+ * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
5
+ * http://docs.jquery.com/Plugins/Tooltip
6
+ *
7
+ * Copyright (c) 2006 - 2008 Jörn Zaefferer
8
+ *
9
+ * jQueryId: jquery.tooltip.js 4569 2008-01-31 19:36:35Z joern.zaefferer jQuery
10
+ *
11
+ * Dual licensed under the MIT and GPL licenses:
12
+ * http://www.opensource.org/licenses/mit-license.php
13
+ * http://www.gnu.org/licenses/gpl.html
14
+ */
15
+
16
+ ;(function(jQuery) {
17
+
18
+ // the tooltip element
19
+ var helper = {},
20
+ // the current tooltipped element
21
+ current,
22
+ // the title of the current element, used for restoring
23
+ title,
24
+ // timeout id for delayed tooltips
25
+ tID,
26
+ // IE 5.5 or 6
27
+ IE = jQuery.browser.msie && /MSIE\s(5\.5|6\.)/.test(navigator.userAgent),
28
+ // flag for mouse tracking
29
+ track = false;
30
+
31
+ jQuery.tooltip = {
32
+ blocked: false,
33
+ defaults: {
34
+ delay: 200,
35
+ showURL: true,
36
+ extraClass: "",
37
+ top: 15,
38
+ left: 15,
39
+ id: "tooltip"
40
+ },
41
+ block: function() {
42
+ jQuery.tooltip.blocked = !jQuery.tooltip.blocked;
43
+ }
44
+ };
45
+
46
+ jQuery.fn.extend({
47
+ tooltip: function(settings) {
48
+ settings = jQuery.extend({}, jQuery.tooltip.defaults, settings);
49
+ createHelper(settings);
50
+ return this.each(function() {
51
+ jQuery.data(this, "tooltip-settings", settings);
52
+ // copy tooltip into its own expando and remove the title
53
+ this.tooltipText = this.title;
54
+ jQuery(this).removeAttr("title");
55
+ // also remove alt attribute to prevent default tooltip in IE
56
+ jQuery(this).children().removeAttr("alt");
57
+ //this.alt = "";
58
+ })
59
+ .hover(save, hide)
60
+ .click(hide);
61
+ },
62
+ fixPNG: IE ? function() {
63
+ return this.each(function () {
64
+ var image = jQuery(this).css('backgroundImage');
65
+ if (image.match(/^url\(["']?(.*\.png)["']?\)jQuery/i)) {
66
+ image = RegExp.jQuery1;
67
+ jQuery(this).css({
68
+ 'backgroundImage': 'none',
69
+ 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
70
+ }).each(function () {
71
+ var position = jQuery(this).css('position');
72
+ if (position != 'absolute' && position != 'relative')
73
+ jQuery(this).css('position', 'relative');
74
+ });
75
+ }
76
+ });
77
+ } : function() { return this; },
78
+ unfixPNG: IE ? function() {
79
+ return this.each(function () {
80
+ jQuery(this).css({'filter': '', backgroundImage: ''});
81
+ });
82
+ } : function() { return this; },
83
+ hideWhenEmpty: function() {
84
+ return this.each(function() {
85
+ jQuery(this)[ jQuery(this).html() ? "show" : "hide" ]();
86
+ });
87
+ },
88
+ url: function() {
89
+ return this.attr('href') || this.attr('src');
90
+ }
91
+ });
92
+
93
+ function createHelper(settings) {
94
+ // there can be only one tooltip helper
95
+ if( helper.parent )
96
+ return;
97
+ // create the helper, h3 for title, div for url
98
+ helper.parent = jQuery('<div id="' + settings.id + '"><h3></h3><div class="body"></div><div class="url"></div></div>')
99
+ // add to document
100
+ .appendTo(document.body)
101
+ // hide it at first
102
+ .hide();
103
+
104
+ // apply bgiframe if available
105
+ if ( jQuery.fn.bgiframe )
106
+ helper.parent.bgiframe();
107
+
108
+ // save references to title and url elements
109
+ helper.title = jQuery('h3', helper.parent);
110
+ helper.body = jQuery('div.body', helper.parent);
111
+ helper.url = jQuery('div.url', helper.parent);
112
+ }
113
+
114
+ function settings(element) {
115
+ return jQuery.data(element, "tooltip-settings");
116
+ }
117
+
118
+ // main event handler to start showing tooltips
119
+ function handle(event) {
120
+ // show helper, either with timeout or on instant
121
+ if( settings(this).delay )
122
+ tID = setTimeout(show, settings(this).delay);
123
+ else
124
+ show();
125
+
126
+ // if selected, update the helper position when the mouse moves
127
+ track = !!settings(this).track;
128
+ jQuery(document.body).bind('mousemove', update);
129
+
130
+ // update at least once
131
+ update(event);
132
+ }
133
+
134
+ // save elements title before the tooltip is displayed
135
+ function save() {
136
+ // if this is the current source, or it has no title (occurs with click event), stop
137
+ if ( jQuery.tooltip.blocked || this == current || (!this.tooltipText && !settings(this).bodyHandler) )
138
+ return;
139
+
140
+ // save current
141
+ current = this;
142
+ title = this.tooltipText;
143
+
144
+ if ( settings(this).bodyHandler ) {
145
+ helper.title.hide();
146
+ var bodyContent = settings(this).bodyHandler.call(this);
147
+ if (bodyContent.nodeType || bodyContent.jquery) {
148
+ helper.body.empty().append(bodyContent)
149
+ } else {
150
+ helper.body.html( bodyContent );
151
+ }
152
+ helper.body.show();
153
+ } else if ( settings(this).showBody ) {
154
+ var parts = title.split(settings(this).showBody);
155
+ helper.title.html(parts.shift()).show();
156
+ helper.body.empty();
157
+ for(var i = 0, part; part = parts[i]; i++) {
158
+ if(i > 0)
159
+ helper.body.append("<br/>");
160
+ helper.body.append(part);
161
+ }
162
+ helper.body.hideWhenEmpty();
163
+ } else {
164
+ helper.title.html(title).show();
165
+ helper.body.hide();
166
+ }
167
+
168
+ // if element has href or src, add and show it, otherwise hide it
169
+ if( settings(this).showURL && jQuery(this).url() )
170
+ helper.url.html( jQuery(this).url().replace('http://', '') ).show();
171
+ else
172
+ helper.url.hide();
173
+
174
+ // add an optional class for this tip
175
+ helper.parent.addClass(settings(this).extraClass);
176
+
177
+ // fix PNG background for IE
178
+ if (settings(this).fixPNG )
179
+ helper.parent.fixPNG();
180
+
181
+ handle.apply(this, arguments);
182
+ }
183
+
184
+ // delete timeout and show helper
185
+ function show() {
186
+ tID = null;
187
+ helper.parent.show();
188
+ update();
189
+ }
190
+
191
+ /**
192
+ * callback for mousemove
193
+ * updates the helper position
194
+ * removes itself when no current element
195
+ */
196
+ function update(event) {
197
+ if(jQuery.tooltip.blocked)
198
+ return;
199
+
200
+ // stop updating when tracking is disabled and the tooltip is visible
201
+ if ( !track && helper.parent.is(":visible")) {
202
+ jQuery(document.body).unbind('mousemove', update)
203
+ }
204
+
205
+ // if no current element is available, remove this listener
206
+ if( current == null ) {
207
+ jQuery(document.body).unbind('mousemove', update);
208
+ return;
209
+ }
210
+
211
+ // remove position helper classes
212
+ helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");
213
+
214
+ var left = helper.parent[0].offsetLeft;
215
+ var top = helper.parent[0].offsetTop;
216
+ if(event) {
217
+ // position the helper 15 pixel to bottom right, starting from mouse position
218
+ left = event.pageX + settings(current).left;
219
+ top = event.pageY + settings(current).top;
220
+ helper.parent.css({
221
+ left: left + 'px',
222
+ top: top + 'px'
223
+ });
224
+ }
225
+
226
+ var v = viewport(),
227
+ h = helper.parent[0];
228
+ // check horizontal position
229
+ if(v.x + v.cx < h.offsetLeft + h.offsetWidth) {
230
+ left -= h.offsetWidth + 20 + settings(current).left;
231
+ helper.parent.css({left: left + 'px'}).addClass("viewport-right");
232
+ }
233
+ // check vertical position
234
+ if(v.y + v.cy < h.offsetTop + h.offsetHeight) {
235
+ top -= h.offsetHeight + 20 + settings(current).top;
236
+ helper.parent.css({top: top + 'px'}).addClass("viewport-bottom");
237
+ }
238
+ }
239
+
240
+ function viewport() {
241
+ return {
242
+ x: jQuery(window).scrollLeft(),
243
+ y: jQuery(window).scrollTop(),
244
+ cx: jQuery(window).width(),
245
+ cy: jQuery(window).height()
246
+ };
247
+ }
248
+
249
+ // hide helper and restore added classes and the title
250
+ function hide(event) {
251
+ if(jQuery.tooltip.blocked)
252
+ return;
253
+ // clear timeout if possible
254
+ if(tID)
255
+ clearTimeout(tID);
256
+ // no more current element
257
+ current = null;
258
+
259
+ helper.parent.hide().removeClass( settings(this).extraClass );
260
+
261
+ if( settings(this).fixPNG )
262
+ helper.parent.unfixPNG();
263
+ }
264
+
265
+ jQuery.fn.Tooltip = jQuery.fn.tooltip;
266
+
267
+ })(jQuery);
lightbox-gallery-ja.mo ADDED
Binary file
lightbox-gallery-ja.po ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WordPress 用日本語リソース (UTF-8)
2
+ # Japanese (UTF-8) translation for WordPress
3
+ #
4
+ # Copyright (c) 2005-2008
5
+ # このファイルは WordPress 本体と同じライセンスのもと配布されています。
6
+ # This file is distributed under the same license as the WordPress package.
7
+ #
8
+ # WordPress 日本語版作成チーム / WP ja translation team
9
+ # <http://groups.google.com/group/wp-ja-pkg/web/members>
10
+ #
11
+ # 誤字脱字誤訳、あるいはよりよい訳などありましたら以下までぜひお知らせください。
12
+ # また、翻訳、校正、コミットをお手伝いしていただける方も随時募集中です。
13
+ # 連絡先 / Contact: wpja.team@gmail.com (件名か内容に「日本語リソース」と入れてください)
14
+ #
15
+ msgid ""
16
+ msgstr ""
17
+ "Project-Id-Version: Lightbox Gallery\n"
18
+ "Report-Msgid-Bugs-To: wp-polyglots@lists.automattic.com\n"
19
+ "POT-Creation-Date: 2008-03-26 13:02+0200\n"
20
+ "PO-Revision-Date: 2008-04-21 20:41+0900\n"
21
+ "Last-Translator: \n"
22
+ "Language-Team: \n"
23
+ "MIME-Version: 1.0\n"
24
+ "Content-Type: text/plain; charset=UTF-8\n"
25
+ "Content-Transfer-Encoding: 8bit\n"
26
+ "X-Poedit-Language: Japanese\n"
27
+ "X-Poedit-Country: JAPAN\n"
28
+ "X-Poedit-SourceCharset: utf-8\n"
29
+ "X-Poedit-KeywordsList: __;_e;_c\n"
30
+ "X-Poedit-Basepath: ../\n"
31
+ "X-Poedit-SearchPath-0: lightbox-gallery\n"
32
+
33
+ #: lightbox-gallery/lightbox-gallery.php:95
34
+ msgid "camera"
35
+ msgstr "機種"
36
+
37
+ #: lightbox-gallery/lightbox-gallery.php:97
38
+ msgid "aperture"
39
+ msgstr "絞り値"
40
+
41
+ #: lightbox-gallery/lightbox-gallery.php:99
42
+ msgid "focal_length"
43
+ msgstr "焦点距離"
44
+
45
+ #: lightbox-gallery/lightbox-gallery.php:101
46
+ msgid "shutter_speed"
47
+ msgstr "シャッタースピード"
48
+
49
+ #: lightbox-gallery/lightbox-gallery.php:103
50
+ msgid "created_timestamp"
51
+ msgstr "撮影日時"
52
+
lightbox-gallery.css ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ @charset "utf-8";
2
+
3
+ .gallery {margin: auto;}
4
+ .gallery-item {float: left; margin: 10px auto; text-align: center;}
5
+ .gallery img {border: 2px solid #cfcfcf;}
6
+ .gallery-caption {margin-left: 0; display:none;}
lightbox-gallery.js ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Change to your domain name
2
+ var lightbox_path = 'http://domainname/wp-content/plugins/lightbox-gallery/';
3
+
4
+ jQuery(document).ready(function () {
5
+ var i = 0;
6
+ showImg(i);
7
+ jQuery('.gallery a').lightBox();
8
+ jQuery('.gallery a').Tooltip({track:true, delay:0, showURL: false});
9
+ });
10
+
11
+ function showImg(i){
12
+ if(i == jQuery('img').length){
13
+ return;
14
+ }else{
15
+ jQuery(jQuery('img')[i]).animate({opacity:'show'},"normal",function(){i++;showImg(i)});
16
+ }
17
+ }
lightbox-gallery.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Lightbox Gallery
4
+ Plugin URI: http://wordpressgogo.com/development/lightbox-gallery.html
5
+ Description: Changes to the lightbox view in galleries.
6
+ Author: Hiroaki Miyashita
7
+ Version: 0.1
8
+ Author URI: http://wordpressgogo.com/
9
+ */
10
+
11
+ add_action('init', 'lightbox_gallery_textdomain');
12
+ function lightbox_gallery_textdomain() {
13
+ load_plugin_textdomain('lightbox-gallery', 'wp-content/plugins/lightbox-gallery');
14
+ }
15
+
16
+ add_action('wp_head', 'add_lightbox_gallery_head',1);
17
+ add_action('wp_print_scripts', 'add_lightbox_gallery_jquery',1);
18
+
19
+ function add_lightbox_gallery_head() {
20
+ echo '<link rel="stylesheet" type="text/css" href="' . get_settings('siteurl') . '/wp-content/plugins/lightbox-gallery/lightbox-gallery.css" />'."\n";
21
+ echo '<link rel="stylesheet" type="text/css" href="' . get_settings('siteurl') . '/wp-content/plugins/lightbox-gallery/js/jquery.lightbox.css" />'."\n";
22
+ echo '<link rel="stylesheet" type="text/css" href="' . get_settings('siteurl') . '/wp-content/plugins/lightbox-gallery/js/jquery.tooltip.css" />'."\n";
23
+ }
24
+
25
+ function add_lightbox_gallery_jquery() {
26
+ if (strpos($_SERVER['REQUEST_URI'], 'admin.php') === false ) {
27
+ wp_enqueue_script( 'jquery');
28
+ wp_enqueue_script('dimensions', '/wp-includes/js/jquery/jquery.dimensions.js', array('jquery'));
29
+ wp_enqueue_script('bgtiframe', '/wp-content/plugins/lightbox-gallery/js/jquery.bgiframe.js', array('jquery'));
30
+ wp_enqueue_script('lightbox', '/wp-content/plugins/lightbox-gallery/js/jquery.lightbox.js', array('jquery'));
31
+ wp_enqueue_script('tooltip', '/wp-content/plugins/lightbox-gallery/js/jquery.tooltip.js', array('jquery'));
32
+ wp_enqueue_script('lightbox-gallery', '/wp-content/plugins/lightbox-gallery/lightbox-gallery.js', array('jquery'));
33
+ }
34
+ }
35
+
36
+ add_shortcode('gallery', 'lightbox_gallery');
37
+
38
+ function lightbox_gallery($attr) {
39
+ global $post;
40
+
41
+ // Allow plugins/themes to override the default gallery template.
42
+ $output = apply_filters('post_gallery', '', $attr);
43
+ if ( $output != '' )
44
+ return $output;
45
+
46
+ extract(shortcode_atts(array(
47
+ 'orderby' => 'ID ASC',
48
+ 'id' => $post->ID,
49
+ 'itemtag' => 'dl',
50
+ 'icontag' => 'dt',
51
+ 'captiontag' => 'dd',
52
+ 'columns' => 3,
53
+ 'size' => 'thumbnail',
54
+ 'lightboxsize' => 'medium',
55
+ 'meta' => 'false'
56
+ ), $attr));
57
+
58
+ $id = intval($id);
59
+ $orderby = addslashes($orderby);
60
+ $attachments = get_children("post_parent=$id&post_type=attachment&post_mime_type=image&orderby=\"{$orderby}\"");
61
+
62
+ if ( empty($attachments) )
63
+ return '';
64
+
65
+ if ( is_feed() ) {
66
+ $output = "\n";
67
+ foreach ( $attachments as $id => $attachment )
68
+ $output .= wp_get_attachment_link($id, $size, true) . "\n";
69
+ return $output;
70
+ }
71
+
72
+ $listtag = tag_escape($listtag);
73
+ $itemtag = tag_escape($itemtag);
74
+ $captiontag = tag_escape($captiontag);
75
+ $columns = intval($columns);
76
+ $itemwidth = $columns > 0 ? floor(100/$columns) : 100;
77
+
78
+ $output = apply_filters('gallery_style', "
79
+ <style type='text/css'>
80
+ .gallery-item {width: {$itemwidth}%;}
81
+ </style>
82
+ <div class='gallery'>");
83
+
84
+ foreach ( $attachments as $id => $attachment ) {
85
+ $thumbnail_link = wp_get_attachment_image_src($attachment->ID, $size, false);
86
+ $lightbox_link = wp_get_attachment_image_src($attachment->ID, $lightboxsize, false);
87
+ trim($attachment->post_content);
88
+ trim($attachment->post_excerpt);
89
+
90
+ if($meta == "true") {
91
+ $imagedata = wp_get_attachment_metadata($attachment->ID);
92
+ unset($metadata);
93
+ if($imagedata['image_meta']['camera'])
94
+ $metadata .= __('camera', 'lightbox-gallery') . ": ". $imagedata['image_meta']['camera'] . " ";
95
+ if($imagedata['image_meta']['aperture'])
96
+ $metadata .= __('aperture', 'lightbox-gallery') . ": F". $imagedata['image_meta']['aperture'] . " ";
97
+ if($imagedata['image_meta']['focal_length'])
98
+ $metadata .= __('focal_length', 'lightbox-gallery') . ": ". $imagedata['image_meta']['focal_length'] . "mm ";
99
+ if($imagedata['image_meta']['shutter_speed']) {
100
+ if($imagedata['image_meta']['shutter_speed']<1) $speed = "1/". round(1/$imagedata['image_meta']['shutter_speed']);
101
+ else $speed = $imagedata['image_meta']['shutter_speed'];
102
+ $metadata .= __('shutter_speed', 'lightbox-gallery') . ": " . $speed . " ";
103
+ }
104
+ if($imagedata['image_meta']['created_timestamp'])
105
+ $metadata .= __('created_timestamp', 'lightbox-gallery') . ": ". date('Y:m:d H:i:s', $imagedata['image_meta']['created_timestamp']);
106
+ }
107
+
108
+ $output .= "<{$itemtag} class='gallery-item'>";
109
+ $output .= "
110
+ <{$icontag} class='gallery-icon'>
111
+ <a href='{$lightbox_link[0]}' title='{$attachment->post_excerpt}'><img src='{$thumbnail_link[0]}' width='{$thumbnail_link[1]}' height='{$thumbnail_link[2]}' alt='{$attachment->post_excerpt}' /></a>
112
+ </{$icontag}>";
113
+ if ( $captiontag && (trim($attachment->post_excerpt) || trim($attachment->post_content) || $metadata) ) {
114
+ $output .= "<{$captiontag} class='gallery-caption'>";
115
+ if($attachment->post_excerpt) $output .= $attachment->post_excerpt . "<br />\n";
116
+ if($attachment->post_content) $output .= $attachment->post_content . "<br />\n";
117
+ if($metadata) $output .= $metadata;
118
+ $output .= "</{$captiontag}>";
119
+ }
120
+ $output .= "</{$itemtag}>";
121
+ if ( $columns > 0 && ++$i % $columns == 0 )
122
+ $output .= '<div style="clear: both"></div>';
123
+ }
124
+
125
+ $output .= '
126
+ <div style="clear: both"></div>
127
+ </div>';
128
+
129
+ return $output;
130
+ }
131
+
132
+
133
+ ?>
readme.txt ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Lightbox Gallery ===
2
+ Contributors: Hiroaki Miyashita
3
+ Donate link: http://wordpressgogo.com/development/lightbox-gallery.html
4
+ Tags: lightbox, gallery, image, images, album, photo
5
+ Requires at least: 2.5
6
+ Tested up to: 2.5.1
7
+ Stable tag: 0.1
8
+
9
+ This plugin changes the view of galleries to the lightbox.
10
+
11
+ == Description ==
12
+
13
+ The Lightbox Gallery plugin changes the view of galleries to the lightbox.
14
+
15
+ * Lightbox display of Gallery
16
+ * Tooltip view of caption of images
17
+ * Displays the associated metadata with images
18
+
19
+ == Installation ==
20
+
21
+ 1. Edit the `lightbox-gallery.js` and change the path of line 2 according to your settings.
22
+ 2. Copy the `lightbox-gallery` directory into your `wp-content/plugins` directory
23
+ 3. Activate the plugin through the 'Plugins' menu in WordPress
24
+ 4. That's it! :)
25
+
26
+ == Known Issues / Bugs ==
27
+
28
+ == Frequently Asked Questions ==
29
+ * How can I make regular images appear in a lightbox without [gallery] shortcode?
30
+
31
+ Just enclose "a" and "img" tags by "gallery" class. Here is a sample.
32
+
33
+ &lt;div class="gallery"&gt;
34
+ &lt;a href="image.jpg" title="this is a caption"&gt;<br />
35
+ &lt;img src="thumbnail.jpg" alt="" /&gt;<br />
36
+ &lt;/a&gt;
37
+ &lt;/div&gt;
38
+
39
+ == Screenshots ==
40
+
41
+ 1. Lightbox Gallery
42
+
43
+ == How to use ==
44
+ How to use this plugin is basically the same as the way to add [gallery] which has been adopted
45
+ by over WordPress 2.5. Lightbox Gallery plugin automatically converted the default view of gallery
46
+ into the lightbox view. Photo captions are displayed as tooltips. Photo descriptions are displayed
47
+ when the lightbox pops up.
48
+
49
+ == Advanced settings ==
50
+ There are two additional options to extend the shorttag [gallery].
51
+
52
+ * lightboxsize
53
+
54
+ The image size when the lightbox pops up. The default is medium, but you can change to full.
55
+
56
+ [gallery lightboxsize="full"]
57
+
58
+ * meta
59
+
60
+ Defines whether the exif information is displayed. The default is false.
61
+ If you want to show the photo info, set true. The exif shown on the lightbox includes camera body,
62
+ aperture, focal length, shutter speed, and created timestamp.
63
+
64
+ [gallery meta="true"]
65
+
66
+ == Uninstall ==
67
+
68
+ 1. Deactivate the plugin
69
+ 2. That's it! :)
screenshot-1.jpg ADDED
Binary file