From tchemit@users.chorem.org Mon Jun 18 11:45:51 2012 From: tchemit@users.chorem.org To: pollen-commits@list.chorem.org Subject: [Pollen-commits] r3508 - in trunk/pollen-ui-struts2/src/main/webapp: WEB-INF/jsp/poll css img js Date: Mon, 18 Jun 2012 11:45:51 +0200 Message-ID: <20120618094551.4D62B1663C@nuiton.codelutin.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8896333788528577647==" --===============8896333788528577647== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: tchemit Date: 2012-06-18 11:45:51 +0200 (Mon, 18 Jun 2012) New Revision: 3508 Url: http://chorem.org/repositories/revision/pollen/3508 Log: fixes #614: We cannot see images in real size anymore Added: trunk/pollen-ui-struts2/src/main/webapp/css/jquery.lightbox-0.5.css trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-blank.gif trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-btn-close.gif trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-btn-next.gif trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-btn-prev.gif trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-ico-loading.gif trunk/pollen-ui-struts2/src/main/webapp/js/jquery.lightbox-0.5.js trunk/pollen-ui-struts2/src/main/webapp/js/jquery.lightbox-0.5.min.js Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp 2012-= 06-18 09:45:47 UTC (rev 3507) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp 2012-= 06-18 09:45:51 UTC (rev 3508) @@ -25,7 +25,13 @@ <%@ taglib prefix=3D"sj" uri=3D"/struts-jquery-tags" %> "/> +"/> =20 + + + + =20

@@ -106,11 +120,19 @@ escapeAmp=3D"false"> + + + + + - 3D"<s:property" - title=3D"" - src=3D""> + " rel=3D"lightbox"> + 3D"<s:property" + title=3D"" + src=3D""> + =20
@@ -162,8 +184,10 @@
- - ' alt=3D"<= s:property/>" + + ' + alt=3D"" title=3D"" src=3D""> Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp 2012-06= -18 09:45:47 UTC (rev 3507) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp 2012-06= -18 09:45:51 UTC (rev 3508) @@ -28,9 +28,13 @@ =20 "/> +"/> =20 + =20 @@ -97,6 +101,13 @@ $votingIdField.attr('disabled', $(this).prop('checked')); }); =20 + $('a[rel*=3D"lightbox"]').lightBox( + { + imageLoading:'', + imageBtnClose:'', + imageBtnPrev:'', + imageBtnNext:'' + }); }); =20 @@ -232,26 +243,36 @@ + + + + + + =20 - - 3D"<s:property" - title=3D'' - src=3D""> + " rel=3D"lightbox"> + 3D"<s:property" + title=3D'' + src=3D""> + - 3D"<s:property" - title=3D'' - src=3D""> + " rel=3D"lightbox"> + 3D"<s:property" + title=3D'' + src=3D""> + Added: trunk/pollen-ui-struts2/src/main/webapp/css/jquery.lightbox-0.5.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pollen-ui-struts2/src/main/webapp/css/jquery.lightbox-0.5.css = (rev 0) +++ trunk/pollen-ui-struts2/src/main/webapp/css/jquery.lightbox-0.5.css 2012-= 06-18 09:45:51 UTC (rev 3508) @@ -0,0 +1,102 @@ +/** + * %%Ignore-License + * jQuery lightBox plugin + * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar = (http://www.huddletogether.com/projects/lightbox2/) + * and adapted to me for use like a plugin from jQuery. + * @name jquery-lightbox-0.5.css + * @author Leandro Vieira Pinho - http://leandrovieira.com + * @version 0.5 + * @date April 11, 2008 + * @category jQuery plugin + * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) + * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org= /licenses/by-sa/2.5/br/deed.en_US + * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for mor= e informations about this jQuery plugin + */ +#jquery-overlay { + position: absolute; + top: 0; + left: 0; + z-index: 90; + width: 100%; + height: 500px; +} +#jquery-lightbox { + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 100; + text-align: center; + line-height: 0; +} +#jquery-lightbox a img { border: none; } +#lightbox-container-image-box { + position: relative; + background-color: #fff; + width: 250px; + height: 250px; + margin: 0 auto; +} +#lightbox-container-image { padding: 10px; } +#lightbox-loading { + position: absolute; + top: 40%; + left: 0%; + height: 25%; + width: 100%; + text-align: center; + line-height: 0; +} +#lightbox-nav { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + z-index: 10; +} +#lightbox-container-image-box > #lightbox-nav { left: 0; } +#lightbox-nav a { outline: none;} +#lightbox-nav-btnPrev, #lightbox-nav-btnNext { + width: 49%; + height: 100%; + zoom: 1; + display: block; +} +#lightbox-nav-btnPrev {=20 + left: 0;=20 + float: left; +} +#lightbox-nav-btnNext {=20 + right: 0;=20 + float: right; +} +#lightbox-container-image-data-box { + font: 10px Verdana, Helvetica, sans-serif; + background-color: #fff; + margin: 0 auto; + line-height: 1.4em; + overflow: auto; + width: 100%; + padding: 0 10px 0; +} +#lightbox-container-image-data { + padding: 0 10px;=20 + color: #666;=20 +} +#lightbox-container-image-data #lightbox-image-details {=20 + width: 70%;=20 + float: left;=20 + text-align: left;=20 +}=09 +#lightbox-image-details-caption { font-weight: bold; } +#lightbox-image-details-currentNumber { + display: block;=20 + clear: left;=20 + padding-bottom: 1.0em;=09 +} =09 +#lightbox-secNav-btnClose { + width: 66px;=20 + float: right; + padding-bottom: 0.7em;=09 +} \ No newline at end of file Property changes on: trunk/pollen-ui-struts2/src/main/webapp/css/jquery.light= box-0.5.css ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-blank.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-bla= nk.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-btn-close.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-btn= -close.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-btn-next.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-btn= -next.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-btn-prev.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-btn= -prev.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-ico-loading.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: trunk/pollen-ui-struts2/src/main/webapp/img/lightbox-ico= -loading.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/pollen-ui-struts2/src/main/webapp/js/jquery.lightbox-0.5.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pollen-ui-struts2/src/main/webapp/js/jquery.lightbox-0.5.js = (rev 0) +++ trunk/pollen-ui-struts2/src/main/webapp/js/jquery.lightbox-0.5.js 2012-06= -18 09:45:51 UTC (rev 3508) @@ -0,0 +1,474 @@ +/** + * %%Ignore-License + * + * jQuery lightBox plugin + * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar = (http://www.huddletogether.com/projects/lightbox2/) + * and adapted to me for use like a plugin from jQuery. + * @name jquery-lightbox-0.5.js + * @author Leandro Vieira Pinho - http://leandrovieira.com + * @version 0.5 + * @date April 11, 2008 + * @category jQuery plugin + * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) + * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org= /licenses/by-sa/2.5/br/deed.en_US + * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for mor= e informations about this jQuery plugin + */ + +// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugin= s/Authoring#Custom_Alias +(function($) { + /** + * $ is an alias to jQuery object + * + */ + $.fn.lightBox =3D function(settings) { + // Settings to configure the jQuery lightBox plugin how you like + settings =3D jQuery.extend({ + // Configuration related to overlay + overlayBgColor: '#000', // (string) Background color to overlay; infor= m a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal= values for the red, green, and blue values of the color. + overlayOpacity: 0.8, // (integer) Opacity value to overlay; inform: 0.= X. Where X are number from 0 to 9 + // Configuration related to navigation + fixedNavigation: false, // (boolean) Boolean that informs if the naviga= tion (next and prev button) will be fixed or not in the interface. + // Configuration related to images + imageLoading: '../images/lightbox-ico-loading.gif', // (string) Path a= nd the name of the loading icon + imageBtnPrev: '../images/lightbox-btn-prev.gif', // (string) Path and= the name of the prev button image + imageBtnNext: '../images/lightbox-btn-next.gif', // (string) Path and= the name of the next button image + imageBtnClose: '../images/lightbox-btn-close.gif', // (string) Path an= d the name of the close btn + imageBlank: '../images/lightbox-blank.gif', // (string) Path and the= name of a blank image (one pixel) + // Configuration related to container image box + 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 + containerResizeSpeed: 400, // (integer) Specify the resize duration of c= ontainer image. These number are miliseconds. 400 is default. + // Configuration related to texts in caption. For example: Image 2 of 8. = You can alter either "Image" and "of" texts. + txtImage: 'Image', // (string) Specify text "Image" + txtOf: 'of', // (string) Specify text "of" + // Configuration related to keyboard navigation + keyToClose: 'c', // (string) (c =3D close) Letter to close the jQuery= lightBox interface. Beyond this letter, the letter X and the SCAPE key is us= ed to. + keyToPrev: 'p', // (string) (p =3D previous) Letter to show the previ= ous image + keyToNext: 'n', // (string) (n =3D next) Letter to show the next imag= e. + // Don=EF=BF=BDt alter these variables in any way + imageArray: [], + activeImage: 0 + },settings); + // Caching the jQuery object with all elements matched + var jQueryMatchedObj =3D this; // This, in this context, refer to jQuery o= bject + /** + * Initializing the plugin calling the start function + * + * @return boolean false + */ + function _initialize() { + _start(this,jQueryMatchedObj); // This, in this context, refer to object = (link) which the user have clicked + return false; // Avoid the browser following the link + } + /** + * Start the jQuery lightBox plugin + * + * @param object objClicked The object (link) whick the user have clicked + * @param object jQueryMatchedObj The jQuery object with all elements matc= hed + */ + function _start(objClicked,jQueryMatchedObj) { + // Hime some elements to avoid conflict with overlay in IE. These element= s appear above the overlay. + $('embed, object, select').css({ 'visibility' : 'hidden' }); + // Call the function to create the markup structure; style some elements;= assign events in some elements. + _set_interface(); + // Unset total images in imageArray + settings.imageArray.length =3D 0; + // Unset image active information + settings.activeImage =3D 0; + // We have an image set? Or just an image? Let=EF=BF=BDs see it. + if ( jQueryMatchedObj.length =3D=3D 1 ) { + settings.imageArray.push(new Array(objClicked.getAttribute('href'),objCl= icked.getAttribute('title'))); + } else { + // Add an Array (as many as we have), with href and title atributes, ins= ide the Array that storage the images references =09 + for ( var i =3D 0; i < jQueryMatchedObj.length; i++ ) { + settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('hr= ef'),jQueryMatchedObj[i].getAttribute('title'))); + } + } + while ( settings.imageArray[settings.activeImage][0] !=3D objClicked.getA= ttribute('href') ) { + settings.activeImage++; + } + // Call the function that prepares image exibition + _set_image_to_view(); + } + /** + * Create the jQuery lightBox plugin interface + * + * The HTML markup will be like that: +
+
+
+
+ +
+ + +
+
+ + + +
+
+
+
+
+
+ + +
+
+ + + +
+
+
+
+ * + */ + function _set_interface() { + // Apply the HTML markup into body tag + $('body').append('
');=09 + // Get page sizes + var arrPageSizes =3D ___getPageSize(); + // Style overlay and show it + $('#jquery-overlay').css({ + backgroundColor: settings.overlayBgColor, + opacity: settings.overlayOpacity, + width: arrPageSizes[0], + height: arrPageSizes[1] + }).fadeIn(); + // Get page scroll + var arrPageScroll =3D ___getPageScroll(); + // Calculate top and left offset for the jquery-lightbox div object and s= how it + $('#jquery-lightbox').css({ + top: arrPageScroll[1] + (arrPageSizes[3] / 10), + left: arrPageScroll[0] + }).show(); + // Assigning click events in elements to close overlay + $('#jquery-overlay,#jquery-lightbox').click(function() { + _finish(); =09 + }); + // Assign the _finish function to lightbox-loading-link and lightbox-secN= av-btnClose objects + $('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() { + _finish(); + return false; + }); + // If window was resized, calculate the new overlay dimensions + $(window).resize(function() { + // Get page sizes + var arrPageSizes =3D ___getPageSize(); + // Style overlay and show it + $('#jquery-overlay').css({ + width: arrPageSizes[0], + height: arrPageSizes[1] + }); + // Get page scroll + var arrPageScroll =3D ___getPageScroll(); + // Calculate top and left offset for the jquery-lightbox div object and = show it + $('#jquery-lightbox').css({ + top: arrPageScroll[1] + (arrPageSizes[3] / 10), + left: arrPageScroll[0] + }); + }); + } + /** + * Prepares image exibition; doing a image=EF=BF=BDs preloader to calculat= e it=EF=BF=BDs size + * + */ + function _set_image_to_view() { // show the loading + // Show the loading + $('#lightbox-loading').show(); + if ( settings.fixedNavigation ) { + $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-de= tails-currentNumber').hide(); + } else { + // Hide some elements + $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btn= Next,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber= ').hide(); + } + // Image preload process + var objImagePreloader =3D new Image(); + objImagePreloader.onload =3D function() { + $('#lightbox-image').attr('src',settings.imageArray[settings.activeImage= ][0]); + // Perfomance an effect in the image container resizing it + _resize_container_image_box(objImagePreloader.width,objImagePreloader.he= ight); + // clear onLoad, IE behaves irratically with animated gifs otherwise + objImagePreloader.onload=3Dfunction(){}; + }; + objImagePreloader.src =3D settings.imageArray[settings.activeImage][0]; + }; + /** + * Perfomance an effect in the image container resizing it + * + * @param integer intImageWidth The image=EF=BF=BDs width that will be sho= wed + * @param integer intImageHeight The image=EF=BF=BDs height that will be s= howed + */ + function _resize_container_image_box(intImageWidth,intImageHeight) { + // Get current width and height + var intCurrentWidth =3D $('#lightbox-container-image-box').width(); + var intCurrentHeight =3D $('#lightbox-container-image-box').height(); + // Get the width and height of the selected image plus the padding + var intWidth =3D (intImageWidth + (settings.containerBorderSize * 2)); //= Plus the image=EF=BF=BDs width and the left and right padding value + var intHeight =3D (intImageHeight + (settings.containerBorderSize * 2)); = // Plus the image=EF=BF=BDs height and the left and right padding value + // Diferences + var intDiffW =3D intCurrentWidth - intWidth; + var intDiffH =3D intCurrentHeight - intHeight; + // Perfomance the effect + $('#lightbox-container-image-box').animate({ width: intWidth, height: int= Height },settings.containerResizeSpeed,function() { _show_image(); }); + if ( ( intDiffW =3D=3D 0 ) && ( intDiffH =3D=3D 0 ) ) { + if ( $.browser.msie ) { + ___pause(250); + } else { + ___pause(100);=09 + } + }=20 + $('#lightbox-container-image-data-box').css({ width: intImageWidth }); + $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHe= ight + (settings.containerBorderSize * 2) }); + }; + /** + * Show the prepared image + * + */ + function _show_image() { + $('#lightbox-loading').hide(); + $('#lightbox-image').fadeIn(function() { + _show_image_data(); + _set_navigation(); + }); + _preload_neighbor_images(); + }; + /** + * Show the image information + * + */ + function _show_image_data() { + $('#lightbox-container-image-data-box').slideDown('fast'); + $('#lightbox-image-details-caption').hide(); + if ( settings.imageArray[settings.activeImage][1] ) { + $('#lightbox-image-details-caption').html(settings.imageArray[settings.a= ctiveImage][1]).show(); + } + // If we have a image set, display 'Image X of X' + if ( settings.imageArray.length > 1 ) { + $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' = + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageA= rray.length).show(); + } =09 + } + /** + * Display the button navigations + * + */ + function _set_navigation() { + $('#lightbox-nav').show(); + + // Instead to define this configuration in CSS file, we define here. And = it=EF=BF=BDs need to IE. Just. + $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'tr= ansparent url(' + settings.imageBlank + ') no-repeat' }); + =09 + // Show the prev button, if not the first image in set + if ( settings.activeImage !=3D 0 ) { + if ( settings.fixedNavigation ) { + $('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.image= BtnPrev + ') left 15% no-repeat' }) + .unbind() + .bind('click',function() { + settings.activeImage =3D settings.activeImage - 1; + _set_image_to_view(); + return false; + }); + } else { + // Show the images button for Next buttons + $('#lightbox-nav-btnPrev').unbind().hover(function() { + $(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left = 15% no-repeat' }); + },function() { + $(this).css({ 'background' : 'transparent url(' + settings.imageBlank = + ') no-repeat' }); + }).show().bind('click',function() { + settings.activeImage =3D settings.activeImage - 1; + _set_image_to_view(); + return false; + }); + } + } + =09 + // Show the next button, if not the last image in set + if ( settings.activeImage !=3D ( settings.imageArray.length -1 ) ) { + if ( settings.fixedNavigation ) { + $('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.image= BtnNext + ') right 15% no-repeat' }) + .unbind() + .bind('click',function() { + settings.activeImage =3D settings.activeImage + 1; + _set_image_to_view(); + return false; + }); + } else { + // Show the images button for Next buttons + $('#lightbox-nav-btnNext').unbind().hover(function() { + $(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right= 15% no-repeat' }); + },function() { + $(this).css({ 'background' : 'transparent url(' + settings.imageBlank = + ') no-repeat' }); + }).show().bind('click',function() { + settings.activeImage =3D settings.activeImage + 1; + _set_image_to_view(); + return false; + }); + } + } + // Enable keyboard navigation + _enable_keyboard_navigation(); + } + /** + * Enable a support to keyboard navigation + * + */ + function _enable_keyboard_navigation() { + $(document).keydown(function(objEvent) { + _keyboard_action(objEvent); + }); + } + /** + * Disable the support to keyboard navigation + * + */ + function _disable_keyboard_navigation() { + $(document).unbind(); + } + /** + * Perform the keyboard actions + * + */ + function _keyboard_action(objEvent) { + // To ie + if ( objEvent =3D=3D null ) { + keycode =3D event.keyCode; + escapeKey =3D 27; + // To Mozilla + } else { + keycode =3D objEvent.keyCode; + escapeKey =3D objEvent.DOM_VK_ESCAPE; + } + // Get the key in lower case form + key =3D String.fromCharCode(keycode).toLowerCase(); + // Verify the keys to close the ligthBox + if ( ( key =3D=3D settings.keyToClose ) || ( key =3D=3D 'x' ) || ( keycod= e =3D=3D escapeKey ) ) { + _finish(); + } + // Verify the key to show the previous image + if ( ( key =3D=3D settings.keyToPrev ) || ( keycode =3D=3D 37 ) ) { + // If we=EF=BF=BDre not showing the first image, call the previous + if ( settings.activeImage !=3D 0 ) { + settings.activeImage =3D settings.activeImage - 1; + _set_image_to_view(); + _disable_keyboard_navigation(); + } + } + // Verify the key to show the next image + if ( ( key =3D=3D settings.keyToNext ) || ( keycode =3D=3D 39 ) ) { + // If we=EF=BF=BDre not showing the last image, call the next + if ( settings.activeImage !=3D ( settings.imageArray.length - 1 ) ) { + settings.activeImage =3D settings.activeImage + 1; + _set_image_to_view(); + _disable_keyboard_navigation(); + } + } + } + /** + * Preload prev and next images being showed + * + */ + function _preload_neighbor_images() { + if ( (settings.imageArray.length -1) > settings.activeImage ) { + objNext =3D new Image(); + objNext.src =3D settings.imageArray[settings.activeImage + 1][0]; + } + if ( settings.activeImage > 0 ) { + objPrev =3D new Image(); + objPrev.src =3D settings.imageArray[settings.activeImage -1][0]; + } + } + /** + * Remove jQuery lightBox plugin HTML markup + * + */ + function _finish() { + $('#jquery-lightbox').remove(); + $('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); = }); + // Show some elements to avoid conflict with overlay in IE. These element= s appear above the overlay. + $('embed, object, select').css({ 'visibility' : 'visible' }); + } + /** + / THIRD FUNCTION + * getPageSize() by quirksmode.com + * + * @return Array Return an array with page width, height and window width,= height + */ + function ___getPageSize() { + var xScroll, yScroll; + if (window.innerHeight && window.scrollMaxY) {=09 + xScroll =3D window.innerWidth + window.scrollMaxX; + yScroll =3D window.innerHeight + window.scrollMaxY; + } else if (document.body.scrollHeight > document.body.offsetHeight){ // a= ll but Explorer Mac + xScroll =3D document.body.scrollWidth; + yScroll =3D document.body.scrollHeight; + } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla = and Safari + xScroll =3D document.body.offsetWidth; + yScroll =3D document.body.offsetHeight; + } + var windowWidth, windowHeight; + if (self.innerHeight) { // all except Explorer + if(document.documentElement.clientWidth){ + windowWidth =3D document.documentElement.clientWidth;=20 + } else { + windowWidth =3D self.innerWidth; + } + windowHeight =3D self.innerHeight; + } else if (document.documentElement && document.documentElement.clientHei= ght) { // Explorer 6 Strict Mode + windowWidth =3D document.documentElement.clientWidth; + windowHeight =3D document.documentElement.clientHeight; + } else if (document.body) { // other Explorers + windowWidth =3D document.body.clientWidth; + windowHeight =3D document.body.clientHeight; + }=09 + // for small pages with total height less then height of the viewport + if(yScroll < windowHeight){ + pageHeight =3D windowHeight; + } else {=20 + pageHeight =3D yScroll; + } + // for small pages with total width less then width of the viewport + if(xScroll < windowWidth){=09 + pageWidth =3D xScroll; =09 + } else { + pageWidth =3D windowWidth; + } + arrayPageSize =3D new Array(pageWidth,pageHeight,windowWidth,windowHeight= ); + return arrayPageSize; + }; + /** + / THIRD FUNCTION + * getPageScroll() by quirksmode.com + * + * @return Array Return an array with x,y page scroll values. + */ + function ___getPageScroll() { + var xScroll, yScroll; + if (self.pageYOffset) { + yScroll =3D self.pageYOffset; + xScroll =3D self.pageXOffset; + } else if (document.documentElement && document.documentElement.scrollTop= ) { // Explorer 6 Strict + yScroll =3D document.documentElement.scrollTop; + xScroll =3D document.documentElement.scrollLeft; + } else if (document.body) {// all other Explorers + yScroll =3D document.body.scrollTop; + xScroll =3D document.body.scrollLeft;=09 + } + arrayPageScroll =3D new Array(xScroll,yScroll); + return arrayPageScroll; + }; + /** + * Stop the code execution from a escified time in milisecond + * + */ + function ___pause(ms) { + var date =3D new Date();=20 + curDate =3D null; + do { var curDate =3D new Date(); } + while ( curDate - date < ms); + }; + // Return the jQuery object for chaining. The unbind method is used to avo= id click conflict when the plugin is called more than once + return this.unbind('click').click(_initialize); + }; +})(jQuery); // Call and execute the function immediately passing the jQuery = object \ No newline at end of file Property changes on: trunk/pollen-ui-struts2/src/main/webapp/js/jquery.lightb= ox-0.5.js ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/main/webapp/js/jquery.lightbox-0.5.min.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pollen-ui-struts2/src/main/webapp/js/jquery.lightbox-0.5.min.js = (rev 0) +++ trunk/pollen-ui-struts2/src/main/webapp/js/jquery.lightbox-0.5.min.js 201= 2-06-18 09:45:51 UTC (rev 3508) @@ -0,0 +1,43 @@ +/** + * %%Ignore-License + * jQuery lightBox plugin + * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar = (http://www.huddletogether.com/projects/lightbox2/) + * and adapted to me for use like a plugin from jQuery. + * @name jquery-lightbox-0.5.js + * @author Leandro Vieira Pinho - http://leandrovieira.com + * @version 0.5 + * @date April 11, 2008 + * @category jQuery plugin + * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) + * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org= /licenses/by-sa/2.5/br/deed.en_US + * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for mor= e informations about this jQuery plugin + */ +(function($){$.fn.lightBox=3Dfunction(settings){settings=3DjQuery.extend({ov= erlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'im= ages/lightbox-ico-loading.gif',imageBtnPrev:'images/lightbox-btn-prev.gif',im= ageBtnNext:'images/lightbox-btn-next.gif',imageBtnClose:'images/lightbox-btn-= close.gif',imageBlank:'images/lightbox-blank.gif',containerBorderSize:10,cont= ainerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p'= ,keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=3D= this;function _initialize(){_start(this,jQueryMatchedObj);return false;} +function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css(= {'visibility':'hidden'});_set_interface();settings.imageArray.length=3D0;sett= ings.activeImage=3D0;if(jQueryMatchedObj.length=3D=3D1){settings.imageArray.p= ush(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title'= )));}else{for(var i=3D0;i
');var arrPageSizes=3D___getPageSize();$('#jquery-overlay').css= ({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,wid= th:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=3D___g= etPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[= 3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').c= lick(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnCl= ose').click(function(){_finish();return false;});$(window).resize(function(){= var arrPageSizes=3D___getPageSize();$('#jquery-overlay').css({width:arrPageSi= zes[0],height:arrPageSizes[1]});var arrPageScroll=3D___getPageScroll();$('#jq= uery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageSc= roll[0]});});} +function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixe= dNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-= image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#= lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box= ,#lightbox-image-details-currentNumber').hide();} +var objImagePreloader=3Dnew Image();objImagePreloader.onload=3Dfunction(){$(= '#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_= resize_container_image_box(objImagePreloader.width,objImagePreloader.height);= objImagePreloader.onload=3Dfunction(){};};objImagePreloader.src=3Dsettings.im= ageArray[settings.activeImage][0];};function _resize_container_image_box(intI= mageWidth,intImageHeight){var intCurrentWidth=3D$('#lightbox-container-image-= box').width();var intCurrentHeight=3D$('#lightbox-container-image-box').heigh= t();var intWidth=3D(intImageWidth+(settings.containerBorderSize*2));var intHe= ight=3D(intImageHeight+(settings.containerBorderSize*2));var intDiffW=3DintCu= rrentWidth-intWidth;var intDiffH=3DintCurrentHeight-intHeight;$('#lightbox-co= ntainer-image-box').animate({width:intWidth,height:intHeight},settings.contai= nerResizeSpeed,function(){_show_image();});if((intDiffW=3D=3D0)&&(intDiffH=3D= =3D0)){if($.browser.msie){___pause(250);}else{___pause(100);}} +$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#light= box-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.= containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide= ();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation(= );});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-co= ntainer-image-data-box').slideDown('fast');$('#lightbox-image-details-caption= ').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image= -details-caption').html(settings.imageArray[settings.activeImage][1]).show();} +if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').= html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+se= ttings.imageArray.length).show();}} +function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPre= v,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.image= Blank+') no-repeat'});if(settings.activeImage!=3D0){if(settings.fixedNavigati= on){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev= +') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeIma= ge=3Dsettings.activeImage-1;_set_image_to_view();return false;});}else{$('#li= ghtbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url= ('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'= background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().= bind('click',function(){settings.activeImage=3Dsettings.activeImage-1;_set_im= age_to_view();return false;});}} +if(settings.activeImage!=3D(settings.imageArray.length-1)){if(settings.fixed= Navigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imag= eBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.= activeImage=3Dsettings.activeImage+1;_set_image_to_view();return false;});}el= se{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'backgro= und':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(th= is).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});= }).show().bind('click',function(){settings.activeImage=3Dsettings.activeImage= +1;_set_image_to_view();return false;});}} +_enable_keyboard_navigation();} +function _enable_keyboard_navigation(){$(document).keydown(function(objEvent= ){_keyboard_action(objEvent);});} +function _disable_keyboard_navigation(){$(document).unbind();} +function _keyboard_action(objEvent){if(objEvent=3D=3Dnull){keycode=3Devent.k= eyCode;escapeKey=3D27;}else{keycode=3DobjEvent.keyCode;escapeKey=3DobjEvent.D= OM_VK_ESCAPE;} +key=3DString.fromCharCode(keycode).toLowerCase();if((key=3D=3Dsettings.keyTo= Close)||(key=3D=3D'x')||(keycode=3D=3DescapeKey)){_finish();} +if((key=3D=3Dsettings.keyToPrev)||(keycode=3D=3D37)){if(settings.activeImage= !=3D0){settings.activeImage=3Dsettings.activeImage-1;_set_image_to_view();_di= sable_keyboard_navigation();}} +if((key=3D=3Dsettings.keyToNext)||(keycode=3D=3D39)){if(settings.activeImage= !=3D(settings.imageArray.length-1)){settings.activeImage=3Dsettings.activeIma= ge+1;_set_image_to_view();_disable_keyboard_navigation();}}} +function _preload_neighbor_images(){if((settings.imageArray.length-1)>settin= gs.activeImage){objNext=3Dnew Image();objNext.src=3Dsettings.imageArray[setti= ngs.activeImage+1][0];} +if(settings.activeImage>0){objPrev=3Dnew Image();objPrev.src=3Dsettings.imag= eArray[settings.activeImage-1][0];}} +function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeO= ut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css= ({'visibility':'visible'});} +function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.= scrollMaxY){xScroll=3Dwindow.innerWidth+window.scrollMaxX;yScroll=3Dwindow.in= nerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body= .offsetHeight){xScroll=3Ddocument.body.scrollWidth;yScroll=3Ddocument.body.sc= rollHeight;}else{xScroll=3Ddocument.body.offsetWidth;yScroll=3Ddocument.body.= offsetHeight;} +var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElemen= t.clientWidth){windowWidth=3Ddocument.documentElement.clientWidth;}else{windo= wWidth=3Dself.innerWidth;} +windowHeight=3Dself.innerHeight;}else if(document.documentElement&&document.= documentElement.clientHeight){windowWidth=3Ddocument.documentElement.clientWi= dth;windowHeight=3Ddocument.documentElement.clientHeight;}else if(document.bo= dy){windowWidth=3Ddocument.body.clientWidth;windowHeight=3Ddocument.body.clie= ntHeight;} +if(yScroll