social_stream-base 0.9.21 → 0.9.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/app/assets/images/lightbox-blank.gif +0 -0
  2. data/app/assets/images/lightbox-btn-close.gif +0 -0
  3. data/app/assets/images/lightbox-btn-next.gif +0 -0
  4. data/app/assets/images/lightbox-btn-prev.gif +0 -0
  5. data/app/assets/images/lightbox-ico-loading.gif +0 -0
  6. data/app/assets/javascripts/activities.js.erb +40 -5
  7. data/app/assets/javascripts/activities_security_chosen-modified.jquery.js +767 -0
  8. data/app/assets/javascripts/messages.js +1 -0
  9. data/app/assets/javascripts/social_stream-base.js +1 -0
  10. data/app/assets/stylesheets/base.css.scss +1 -1
  11. data/app/assets/stylesheets/messages.css.scss +1 -0
  12. data/app/controllers/contacts_controller.rb +11 -7
  13. data/app/controllers/groups_controller.rb +11 -2
  14. data/app/views/activities/_new.html.erb +16 -2
  15. data/app/views/activities/index.js.erb +2 -0
  16. data/app/views/comments/create.js.erb +2 -0
  17. data/app/views/conversations/_conversation_full.html.erb +62 -44
  18. data/app/views/conversations/show.html.erb +1 -1
  19. data/app/views/conversations/show.js.erb +1 -1
  20. data/app/views/home/index.js.erb +3 -0
  21. data/app/views/layouts/_header_signed_in.erb +1 -0
  22. data/app/views/messages/new.js.erb +1 -1
  23. data/app/views/settings/_destroy.html.erb +17 -0
  24. data/app/views/settings/_index.html.erb +3 -2
  25. data/app/views/subjects/_show.js.erb +3 -0
  26. data/config/locales/en.yml +5 -0
  27. data/config/locales/es.yml +6 -1
  28. data/lib/social_stream/base/version.rb +1 -1
  29. data/spec/controllers/contacts_controller_spec.rb +8 -1
  30. data/spec/controllers/groups_controller_spec.rb +8 -11
  31. data/vendor/assets/javascripts/jquery.ae.image.resize.js +69 -0
  32. data/vendor/assets/javascripts/jquery.lightbox-with-resize-plugin.js +533 -0
  33. metadata +13 -6
  34. data/app/views/settings/_contacts.html.erb +0 -16
  35. data/vendor/assets/javascripts/chosen.jquery.js +0 -755
@@ -0,0 +1,69 @@
1
+ (function( $ ) {
2
+
3
+ $.fn.aeImageResize = function( params ) {
4
+
5
+ var aspectRatio = 0
6
+ // Nasty I know but it's done only once, so not too bad I guess
7
+ // Alternate suggestions welcome :)
8
+ , isIE6 = $.browser.msie && (6 == ~~ $.browser.version)
9
+ ;
10
+
11
+ // We cannot do much unless we have one of these
12
+ if ( !params.height && !params.width ) {
13
+ return this;
14
+ }
15
+
16
+ // Calculate aspect ratio now, if possible
17
+ if ( params.height && params.width ) {
18
+ aspectRatio = params.width / params.height;
19
+ }
20
+
21
+ // Attach handler to load
22
+ // Handler is executed just once per element
23
+ // Load event required for Webkit browsers
24
+ return this.one( "load", function() {
25
+
26
+ // Remove all attributes and CSS rules
27
+ this.removeAttribute( "height" );
28
+ this.removeAttribute( "width" );
29
+ this.style.height = this.style.width = "";
30
+
31
+ var imgHeight = this.height
32
+ , imgWidth = this.width
33
+ , imgAspectRatio = imgWidth / imgHeight
34
+ , bxHeight = params.height
35
+ , bxWidth = params.width
36
+ , bxAspectRatio = aspectRatio;
37
+
38
+ // Work the magic!
39
+ // If one parameter is missing, we just force calculate it
40
+ if ( !bxAspectRatio ) {
41
+ if ( bxHeight ) {
42
+ bxAspectRatio = imgAspectRatio + 1;
43
+ } else {
44
+ bxAspectRatio = imgAspectRatio - 1;
45
+ }
46
+ }
47
+
48
+ // Only resize the images that need resizing
49
+ if ( (bxHeight && imgHeight > bxHeight) || (bxWidth && imgWidth > bxWidth) ) {
50
+
51
+ if ( imgAspectRatio > bxAspectRatio ) {
52
+ bxHeight = ~~ ( imgHeight / imgWidth * bxWidth );
53
+ } else {
54
+ bxWidth = ~~ ( imgWidth / imgHeight * bxHeight );
55
+ }
56
+
57
+ this.height = bxHeight;
58
+ this.width = bxWidth;
59
+ }
60
+ })
61
+ .each(function() {
62
+
63
+ // Trigger load event (for Gecko and MSIE)
64
+ if ( this.complete || isIE6 ) {
65
+ $( this ).trigger( "load" );
66
+ }
67
+ });
68
+ };
69
+ })( jQuery );
@@ -0,0 +1,533 @@
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 CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/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
+ maxWidth : null,
25
+ maxHeight : null,
26
+ // Configuration related to overlay
27
+ 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.
28
+ overlayOpacity : 0.8, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
29
+ // Configuration related to navigation
30
+ fixedNavigation : false, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
31
+ // Configuration related to images
32
+ imageLoading : 'images/lightbox-ico-loading.gif', // (string) Path and the name of the loading icon
33
+ imageBtnPrev : 'images/lightbox-btn-prev.gif', // (string) Path and the name of the prev button image
34
+ imageBtnNext : 'images/lightbox-btn-next.gif', // (string) Path and the name of the next button image
35
+ imageBtnClose : 'images/lightbox-btn-close.gif', // (string) Path and the name of the close btn
36
+ imageBlank : 'images/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel)
37
+ // Configuration related to container image box
38
+ 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
39
+ containerResizeSpeed : 400, // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
40
+ // Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
41
+ txtImage : 'Image', // (string) Specify text "Image"
42
+ txtOf : 'of', // (string) Specify text "of"
43
+ // Configuration related to keyboard navigation
44
+ 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.
45
+ keyToPrev : 'p', // (string) (p = previous) Letter to show the previous image
46
+ keyToNext : 'n', // (string) (n = next) Letter to show the next image.
47
+ // Don�t alter these variables in any way
48
+ imageArray : [],
49
+ activeImage : 0
50
+ }, settings);
51
+ // Caching the jQuery object with all elements matched
52
+ var jQueryMatchedObj = this;
53
+ // This, in this context, refer to jQuery object
54
+ /**
55
+ * Initializing the plugin calling the start function
56
+ *
57
+ * @return boolean false
58
+ */
59
+ function _initialize() {
60
+ _start(this, jQueryMatchedObj);
61
+ // This, in this context, refer to object (link) which the user have clicked
62
+ return false;
63
+ // Avoid the browser following the link
64
+ }
65
+
66
+ /**
67
+ * Start the jQuery lightBox plugin
68
+ *
69
+ * @param object objClicked The object (link) whick the user have clicked
70
+ * @param object jQueryMatchedObj The jQuery object with all elements matched
71
+ */
72
+ function _start(objClicked, jQueryMatchedObj) {
73
+ // Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
74
+ $('embed, object, select').css({
75
+ 'visibility' : 'hidden'
76
+ });
77
+ // Call the function to create the markup structure; style some elements; assign events in some elements.
78
+ _set_interface();
79
+ // Unset total images in imageArray
80
+ settings.imageArray.length = 0;
81
+ // Unset image active information
82
+ settings.activeImage = 0;
83
+ // We have an image set? Or just an image? Let�s see it.
84
+ if(jQueryMatchedObj.length == 1) {
85
+ settings.imageArray.push(new Array(objClicked.getAttribute('href'), objClicked.getAttribute('title')));
86
+ } else {
87
+ // Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references
88
+ for(var i = 0; i < jQueryMatchedObj.length; i++) {
89
+ settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'), jQueryMatchedObj[i].getAttribute('title')));
90
+ }
91
+ }
92
+ while(settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href')) {
93
+ settings.activeImage++;
94
+ }
95
+ // Call the function that prepares image exibition
96
+ _set_image_to_view();
97
+ }
98
+
99
+ /**
100
+ * Create the jQuery lightBox plugin interface
101
+ *
102
+ * The HTML markup will be like that:
103
+ <div id="jquery-overlay"></div>
104
+ <div id="jquery-lightbox">
105
+ <div id="lightbox-container-image-box">
106
+ <div id="lightbox-container-image">
107
+ <img src="../fotos/XX.jpg" id="lightbox-image">
108
+ <div id="lightbox-nav">
109
+ <a href="#" id="lightbox-nav-btnPrev"></a>
110
+ <a href="#" id="lightbox-nav-btnNext"></a>
111
+ </div>
112
+ <div id="lightbox-loading">
113
+ <a href="#" id="lightbox-loading-link">
114
+ <img src="../images/lightbox-ico-loading.gif">
115
+ </a>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ <div id="lightbox-container-image-data-box">
120
+ <div id="lightbox-container-image-data">
121
+ <div id="lightbox-image-details">
122
+ <span id="lightbox-image-details-caption"></span>
123
+ <span id="lightbox-image-details-currentNumber"></span>
124
+ </div>
125
+ <div id="lightbox-secNav">
126
+ <a href="#" id="lightbox-secNav-btnClose">
127
+ <img src="../images/lightbox-btn-close.gif">
128
+ </a>
129
+ </div>
130
+ </div>
131
+ </div>
132
+ </div>
133
+ *
134
+ */
135
+ function _set_interface() {
136
+ // Apply the HTML markup into body tag
137
+ $('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>');
138
+ // Get page sizes
139
+ var arrPageSizes = ___getPageSize();
140
+ // Style overlay and show it
141
+ $('#jquery-overlay').css({
142
+ backgroundColor : settings.overlayBgColor,
143
+ opacity : settings.overlayOpacity,
144
+ width : arrPageSizes[0],
145
+ height : arrPageSizes[1]
146
+ }).fadeIn();
147
+ // Get page scroll
148
+ var arrPageScroll = ___getPageScroll();
149
+ // Calculate top and left offset for the jquery-lightbox div object and show it
150
+ $('#jquery-lightbox').css({
151
+ top : arrPageScroll[1] + (arrPageSizes[3] / 10),
152
+ left : arrPageScroll[0]
153
+ }).show();
154
+ // Assigning click events in elements to close overlay
155
+ $('#jquery-overlay,#jquery-lightbox').click(function() {
156
+ _finish();
157
+ });
158
+ // Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects
159
+ $('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
160
+ _finish();
161
+ return false;
162
+ });
163
+ // If window was resized, calculate the new overlay dimensions
164
+ $(window).resize(function() {
165
+ // Get page sizes
166
+ var arrPageSizes = ___getPageSize();
167
+ // Style overlay and show it
168
+ $('#jquery-overlay').css({
169
+ width : arrPageSizes[0],
170
+ height : arrPageSizes[1]
171
+ });
172
+ // Get page scroll
173
+ var arrPageScroll = ___getPageScroll();
174
+ // Calculate top and left offset for the jquery-lightbox div object and show it
175
+ $('#jquery-lightbox').css({
176
+ top : arrPageScroll[1] + (arrPageSizes[3] / 10),
177
+ left : arrPageScroll[0]
178
+ });
179
+ });
180
+ }
181
+
182
+ /**
183
+ * Prepares image exibition; doing a image�s preloader to calculate it�s size
184
+ *
185
+ */
186
+ function _set_image_to_view() {// show the loading
187
+ // Show the loading
188
+ $('#lightbox-loading').show();
189
+ if(settings.fixedNavigation) {
190
+ $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
191
+ } else {
192
+ // Hide some elements
193
+ $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
194
+ }
195
+ // Image preload process
196
+ var objImagePreloader = new Image();
197
+ objImagePreloader.onload = function() {
198
+ $('#lightbox-image').attr('src', settings.imageArray[settings.activeImage][0]);
199
+ // Perfomance an effect in the image container resizing it
200
+ _resize_container_image_box(objImagePreloader.width, objImagePreloader.height);
201
+ // clear onLoad, IE behaves irratically with animated gifs otherwise
202
+ objImagePreloader.onload = function() {
203
+ };
204
+ };
205
+ objImagePreloader.src = settings.imageArray[settings.activeImage][0];
206
+ };
207
+
208
+ /**
209
+ * Perfomance an effect in the image container resizing it
210
+ *
211
+ * @param integer intImageWidth The image�s width that will be showed
212
+ * @param integer intImageHeight The image�s height that will be showed
213
+ */
214
+ function _resize_container_image_box(intImageWidth, intImageHeight) {
215
+ //rescale if necessary
216
+ if((settings.maxWidth != null && settings.maxHeight != null) && (intImageWidth > settings.maxWidth || intImageHeight > settings.maxHeight)) {
217
+ var isWider = intImageWidth > intImageHeight;
218
+ //is the image wide or tall?
219
+ var scale = isWider ? settings.maxWidth / intImageWidth : settings.maxHeight / intImageHeight;
220
+ intImageWidth = intImageWidth * scale;
221
+ intImageHeight = intImageHeight * scale;
222
+ }
223
+
224
+ $('#lightbox-image').height(intImageHeight);
225
+ $('#lightbox-image').width(intImageWidth);
226
+ // Get current width and height
227
+ var intCurrentWidth = $('#lightbox-container-image-box').width();
228
+ var intCurrentHeight = $('#lightbox-container-image-box').height();
229
+ // Get the width and height of the selected image plus the padding
230
+ var intWidth = (intImageWidth + (settings.containerBorderSize * 2));
231
+ // Plus the image�s width and the left and right padding value
232
+ var intHeight = (intImageHeight + (settings.containerBorderSize * 2));
233
+ // Plus the image�s height and the left and right padding value
234
+ // Diferences
235
+ var intDiffW = intCurrentWidth - intWidth;
236
+ var intDiffH = intCurrentHeight - intHeight;
237
+ // Perfomance the effect
238
+ $('#lightbox-container-image-box').animate({
239
+ width : intWidth,
240
+ height : intHeight
241
+ }, settings.containerResizeSpeed, function() { _show_image();
242
+ });
243
+ if((intDiffW == 0 ) && (intDiffH == 0 )) {
244
+ if($.browser.msie) {
245
+ ___pause(250);
246
+ } else {
247
+ ___pause(100);
248
+ }
249
+ }
250
+ $('#lightbox-container-image-data-box').css({
251
+ width : intImageWidth
252
+ });
253
+ $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({
254
+ height : intImageHeight + (settings.containerBorderSize * 2)
255
+ });
256
+ };
257
+
258
+ /**
259
+ * Show the prepared image
260
+ *
261
+ */
262
+ function _show_image() {
263
+ $('#lightbox-loading').hide();
264
+ $('#lightbox-image').fadeIn(function() {
265
+ _show_image_data();
266
+ _set_navigation();
267
+ });
268
+ _preload_neighbor_images();
269
+ };
270
+
271
+ /**
272
+ * Show the image information
273
+ *
274
+ */
275
+ function _show_image_data() {
276
+ $('#lightbox-container-image-data-box').slideDown('fast');
277
+ $('#lightbox-image-details-caption').hide();
278
+ if(settings.imageArray[settings.activeImage][1]) {
279
+ $('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();
280
+ }
281
+ // If we have a image set, display 'Image X of X'
282
+ if(settings.imageArray.length > 1) {
283
+ $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + (settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();
284
+ }
285
+ }
286
+
287
+ /**
288
+ * Display the button navigations
289
+ *
290
+ */
291
+ function _set_navigation() {
292
+ $('#lightbox-nav').show();
293
+
294
+ // Instead to define this configuration in CSS file, we define here. And it�s need to IE. Just.
295
+ $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({
296
+ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat'
297
+ });
298
+
299
+ // Show the prev button, if not the first image in set
300
+ if(settings.activeImage != 0) {
301
+ if(settings.fixedNavigation) {
302
+ $('#lightbox-nav-btnPrev').css({
303
+ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat'
304
+ }).unbind().bind('click', function() {
305
+ settings.activeImage = settings.activeImage - 1;
306
+ _set_image_to_view();
307
+ return false;
308
+ });
309
+ } else {
310
+ // Show the images button for Next buttons
311
+ $('#lightbox-nav-btnPrev').unbind().hover(function() {
312
+ $(this).css({
313
+ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat'
314
+ });
315
+ }, function() {
316
+ $(this).css({
317
+ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat'
318
+ });
319
+ }).show().bind('click', function() {
320
+ settings.activeImage = settings.activeImage - 1;
321
+ _set_image_to_view();
322
+ return false;
323
+ });
324
+ }
325
+ }
326
+
327
+ // Show the next button, if not the last image in set
328
+ if(settings.activeImage != (settings.imageArray.length - 1 )) {
329
+ if(settings.fixedNavigation) {
330
+ $('#lightbox-nav-btnNext').css({
331
+ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat'
332
+ }).unbind().bind('click', function() {
333
+ settings.activeImage = settings.activeImage + 1;
334
+ _set_image_to_view();
335
+ return false;
336
+ });
337
+ } else {
338
+ // Show the images button for Next buttons
339
+ $('#lightbox-nav-btnNext').unbind().hover(function() {
340
+ $(this).css({
341
+ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat'
342
+ });
343
+ }, function() {
344
+ $(this).css({
345
+ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat'
346
+ });
347
+ }).show().bind('click', function() {
348
+ settings.activeImage = settings.activeImage + 1;
349
+ _set_image_to_view();
350
+ return false;
351
+ });
352
+ }
353
+ }
354
+ // Enable keyboard navigation
355
+ _enable_keyboard_navigation();
356
+ }
357
+
358
+ /**
359
+ * Enable a support to keyboard navigation
360
+ *
361
+ */
362
+ function _enable_keyboard_navigation() {
363
+ $(document).keydown(function(objEvent) {
364
+ _keyboard_action(objEvent);
365
+ });
366
+ }
367
+
368
+ /**
369
+ * Disable the support to keyboard navigation
370
+ *
371
+ */
372
+ function _disable_keyboard_navigation() {
373
+ $(document).unbind();
374
+ }
375
+
376
+ /**
377
+ * Perform the keyboard actions
378
+ *
379
+ */
380
+ function _keyboard_action(objEvent) {
381
+ // To ie
382
+ if(objEvent == null) {
383
+ keycode = event.keyCode;
384
+ escapeKey = 27;
385
+ // To Mozilla
386
+ } else {
387
+ keycode = objEvent.keyCode;
388
+ escapeKey = objEvent.DOM_VK_ESCAPE;
389
+ }
390
+ // Get the key in lower case form
391
+ key = String.fromCharCode(keycode).toLowerCase();
392
+ // Verify the keys to close the ligthBox
393
+ if((key == settings.keyToClose ) || (key == 'x' ) || (keycode == escapeKey )) {
394
+ _finish();
395
+ }
396
+ // Verify the key to show the previous image
397
+ if((key == settings.keyToPrev ) || (keycode == 37 )) {
398
+ // If we�re not showing the first image, call the previous
399
+ if(settings.activeImage != 0) {
400
+ settings.activeImage = settings.activeImage - 1;
401
+ _set_image_to_view();
402
+ _disable_keyboard_navigation();
403
+ }
404
+ }
405
+ // Verify the key to show the next image
406
+ if((key == settings.keyToNext ) || (keycode == 39 )) {
407
+ // If we�re not showing the last image, call the next
408
+ if(settings.activeImage != (settings.imageArray.length - 1 )) {
409
+ settings.activeImage = settings.activeImage + 1;
410
+ _set_image_to_view();
411
+ _disable_keyboard_navigation();
412
+ }
413
+ }
414
+ }
415
+
416
+ /**
417
+ * Preload prev and next images being showed
418
+ *
419
+ */
420
+ function _preload_neighbor_images() {
421
+ if((settings.imageArray.length - 1) > settings.activeImage) {
422
+ objNext = new Image();
423
+ objNext.src = settings.imageArray[settings.activeImage + 1][0];
424
+ }
425
+ if(settings.activeImage > 0) {
426
+ objPrev = new Image();
427
+ objPrev.src = settings.imageArray[settings.activeImage -1][0];
428
+ }
429
+ }
430
+
431
+ /**
432
+ * Remove jQuery lightBox plugin HTML markup
433
+ *
434
+ */
435
+ function _finish() {
436
+ $('#jquery-lightbox').remove();
437
+ $('#jquery-overlay').fadeOut(function() {
438
+ $('#jquery-overlay').remove();
439
+ });
440
+ // Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
441
+ $('embed, object, select').css({
442
+ 'visibility' : 'visible'
443
+ });
444
+ }
445
+
446
+ /**
447
+ / THIRD FUNCTION
448
+ * getPageSize() by quirksmode.com
449
+ *
450
+ * @return Array Return an array with page width, height and window width, height
451
+ */
452
+ function ___getPageSize() {
453
+ var xScroll, yScroll;
454
+ if(window.innerHeight && window.scrollMaxY) {
455
+ xScroll = window.innerWidth + window.scrollMaxX;
456
+ yScroll = window.innerHeight + window.scrollMaxY;
457
+ } else if(document.body.scrollHeight > document.body.offsetHeight) {// all but Explorer Mac
458
+ xScroll = document.body.scrollWidth;
459
+ yScroll = document.body.scrollHeight;
460
+ } else {// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
461
+ xScroll = document.body.offsetWidth;
462
+ yScroll = document.body.offsetHeight;
463
+ }
464
+ var windowWidth, windowHeight;
465
+ if(self.innerHeight) {// all except Explorer
466
+ if(document.documentElement.clientWidth) {
467
+ windowWidth = document.documentElement.clientWidth;
468
+ } else {
469
+ windowWidth = self.innerWidth;
470
+ }
471
+ windowHeight = self.innerHeight;
472
+ } else if(document.documentElement && document.documentElement.clientHeight) {// Explorer 6 Strict Mode
473
+ windowWidth = document.documentElement.clientWidth;
474
+ windowHeight = document.documentElement.clientHeight;
475
+ } else if(document.body) {// other Explorers
476
+ windowWidth = document.body.clientWidth;
477
+ windowHeight = document.body.clientHeight;
478
+ }
479
+ // for small pages with total height less then height of the viewport
480
+ if(yScroll < windowHeight) {
481
+ pageHeight = windowHeight;
482
+ } else {
483
+ pageHeight = yScroll;
484
+ }
485
+ // for small pages with total width less then width of the viewport
486
+ if(xScroll < windowWidth) {
487
+ pageWidth = xScroll;
488
+ } else {
489
+ pageWidth = windowWidth;
490
+ }
491
+ arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight);
492
+ return arrayPageSize;
493
+ };
494
+
495
+ /**
496
+ / THIRD FUNCTION
497
+ * getPageScroll() by quirksmode.com
498
+ *
499
+ * @return Array Return an array with x,y page scroll values.
500
+ */
501
+ function ___getPageScroll() {
502
+ var xScroll, yScroll;
503
+ if(self.pageYOffset) {
504
+ yScroll = self.pageYOffset;
505
+ xScroll = self.pageXOffset;
506
+ } else if(document.documentElement && document.documentElement.scrollTop) {// Explorer 6 Strict
507
+ yScroll = document.documentElement.scrollTop;
508
+ xScroll = document.documentElement.scrollLeft;
509
+ } else if(document.body) {// all other Explorers
510
+ yScroll = document.body.scrollTop;
511
+ xScroll = document.body.scrollLeft;
512
+ }
513
+ arrayPageScroll = new Array(xScroll, yScroll);
514
+ return arrayPageScroll;
515
+ };
516
+
517
+ /**
518
+ * Stop the code execution from a escified time in milisecond
519
+ *
520
+ */
521
+ function ___pause(ms) {
522
+ var date = new Date();
523
+ curDate = null;
524
+ do {
525
+ var curDate = new Date();
526
+ } while ( curDate - date < ms);
527
+ };
528
+
529
+ // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
530
+ return this.unbind('click').click(_initialize);
531
+ };
532
+ })(jQuery);
533
+ // Call and execute the function immediately passing the jQuery object