diff options
author | RedMatrix <info@friendica.com> | 2015-01-06 09:40:26 +1100 |
---|---|---|
committer | RedMatrix <info@friendica.com> | 2015-01-06 09:40:26 +1100 |
commit | c45456fa3342bc72d30c20bafd029913930130aa (patch) | |
tree | f707891da9bd1c7272f04e455f33043bbb29ef1d | |
parent | 074be42e234a9d44ffe7875ffef6eb7a5e22f013 (diff) | |
parent | 5ce5de73051e0d68d277dc189b3bcc4593d7ab8d (diff) | |
download | volse-hubzilla-c45456fa3342bc72d30c20bafd029913930130aa.tar.gz volse-hubzilla-c45456fa3342bc72d30c20bafd029913930130aa.tar.bz2 volse-hubzilla-c45456fa3342bc72d30c20bafd029913930130aa.zip |
Merge pull request #820 from pafcu/nomigrate
Steps towards not needing jquery-migrate
212 files changed, 4151 insertions, 15616 deletions
diff --git a/include/widgets.php b/include/widgets.php index bb9890add..18778ed36 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -421,7 +421,7 @@ function widget_affinity($arr) { if(feature_enabled(local_user(),'affinity')) { $tpl = get_markup_template('main_slider.tpl'); $x = replace_macros($tpl,array( - '$val' => $cmin . ';' . $cmax, + '$val' => $cmin . ',' . $cmax, '$refresh' => t('Refresh'), '$me' => t('Me'), '$intimate' => t('Best Friends'), diff --git a/library/colorbox/README.md b/library/colorbox/README.md index bc002381e..5e7c1a379 100644 --- a/library/colorbox/README.md +++ b/library/colorbox/README.md @@ -1,11 +1,231 @@ -## About ColorBox: +## About Colorbox: A customizable lightbox plugin for jQuery. See the [project page](http://jacklmoore.com/colorbox/) for documentation and a demonstration, and the [FAQ](http://jacklmoore.com/colorbox/faq/) for solutions and examples to common issues. Released under the [MIT license](http://www.opensource.org/licenses/mit-license.php). -## Translations Welcome -Send me your language configuration files. See /i18n/jquery.colorbox-de.js as an example. - ## Changelog: +### Version 1.5.14 - 2014/9/9 + +* When opening, append Colorbox to the DOM if it was detached for whatever reason. Fixes #645. + +### Version 1.5.13 - 2014/8/4 + +* Fixed regression introduced with v1.5.12 with legacy versions of jQuery (1.3x-1.6x). References #628. + +### Version 1.5.12 - 2014/7/31 + +* Allowed setting the overlay opacity via CSS, by setting Colorbox's opacity property to false. References #628. + +### Version 1.5.11 - 2014/7/31 + +* Fixed bug where setting opacity to 0 was ignored. Fixes #628. + +### Version 1.5.10 - 2014/6/26 + +* Minor misc. tweaks (merging pull requests #611, #612, #615, #619, #620). + +### Version 1.5.9 - 2014/4/25 + +* Fixed inline content bug when using child selectors. Fixes #599 + +### Version 1.5.8 - 2014/4/15 + +* Fixed accidental leak of global variable. References #591 +* Enabled strict mode. Fixes #597 + +### Version 1.5.7 - 2014/4/15 + +* Fix potential error when calling Colorbox directly. References #591 +* Potentially worked around browser limitation of reporting that an image height and width is 0 immediately after onload. Fixes #535 + +### Version 1.5.6 - 2014/4/4 + +* Applied maxWidth and maxHeight to the initialWidth and initialHeight. Fixes #391 + +### Version 1.5.5 - 2014/3/13 + +* Allow setting the overlay opacity through CSS, rather than having to use Colorbox's opacity property. Fixes #580 + +### Version 1.5.4 - 2014/3/7 + +* Fixed potential issue where IE9+ wouldn't close the modal when clicking on the overlay. Fixes #576 + +### Version 1.5.3 - 2014/3/4 + +* Added access to settings object in callbacks. + +### Version 1.5.2 - 2014/2/28 + +* Added svg to image types regex. + +### Version 1.5.1 - 2014/2/27 + +* Fixed regression that broke direct calls to Colorbox, ie. $.colorbox(…) + +### Version 1.5.0 - 2014/2/27 + +* Changed when the className is applied: immediately on open, but only updated immediately prior to transition. Fixes #565 +* Fixed potential style flash if #cboxLoadedContent is given a background. Fixes #567 +* Misc. code cleanup + +### Version 1.4.37 - 2014/2/11 + +* Fixed potential error when resizing. Fixes #254 +* Added Microsoft's JPEG XR to photo detection regex. + +### Version 1.4.33 - 2013/10/31 + +* Fixed an issue where private events propagated to the document in versions of jQuery prior to 1.7. Fixes #525, Fixes #526 + +### Version 1.4.32 - 2013/10/16 + +* Updated stylesheets to avoid issue with using `div {max-width:100%}` (Fixes #520) + +### Version 1.4.31 - 2013/9/25 + +* Used setAttribute to set londesc, so that the value is accessible via DOM Node longDesc property #508 + +### Version 1.4.30 - 2013/9/24 + +* Added longdesc and aria-describedby attributes to photos. Fixes #508 + +### Version 1.4.29 - 2013/9/10 + +* Fixed a slideshow regression from 1.4.27 +* Fixed a potential issue with the starting size of #cboxLoadedContent + +### Version 1.4.28 - 2013/9/4 + +* Fixed a potential issue with using the open property with mixed slideshow and non-slideshow groups + +### Version 1.4.27 - 2013/7/16 + +* Fixed a width calculation issue relating to using margin:auto on #cboxLoadedContent. + +### Version 1.4.26 - 2013/6/30 + +* Fixed a regression in IE7 and IE8 that was causing an error. + +### Version 1.4.25 - 2013/6/28 + +* Use an animation speed of zero between same-sized content (fixed). +* Removed temporary fix for jQuery UI 1.8 + +### Version 1.4.24 - 2013/6/24 + +* Added closeButton option. Set to false to remove the close button. + +### Version 1.4.23 - 2013/6/23 + +* Bugfix loading overlay/graphic append order + +### Version 1.4.22 - 2013/6/19 + +* Updated manifest files for the jQuery plugin repository and Bower (no changes to plugin) + +### Version 1.4.21 - 2013/6/6 + +* Replaced new Image() with document.createElement('img') to avoid a potential bug in Chrome 27. + +### Version 1.4.20 - 2013/6/5 + +* Fixing bug/typo from last update. + +### Version 1.4.19 - 2013/6/3 + +* Fixed bug where Colorbox was capturing ctrl+click on assigned links on windows browsers with jQuery 1.7+, rather than ignoring. + +### Version 1.4.18 - 2013/5/30 + +* Fixed a scroll position issue when using $.colorbox.resize() + +### Version 1.4.17 - 2013/5/23 + +* Possible fix for a Chrome 27 issue (https://github.com/jackmoore/colorbox/pull/438#issuecomment-18334804) + +### Version 1.4.16 - 2013/5/20 + +* Added trapFocus setting to allow disabling of focus trapping + +### Version 1.4.15 - 2013/4/22 + +* Added .webp to list of recognized image extensions + +### Version 1.4.14 - 2013/4/16 + +* Added fadeOut property to control the closing fadeOut speed. +* Removed longdesc attribute for now. + +### Version 1.4.13 - 2013/4/11 + +* Fixed an error involving IE7/IE8 and legacy versions of jQuery + +### Version 1.4.12 - 2013/4/9 + +* Fixed a potential conflict with Twitter Bootstrap default img styles. + +### Version 1.4.11 - 2013/4/9 + +* Added `type='button'` to buttons to prevent accidental form submission +* Added alt and longdesc attributes to photo content if they are present on the calling element. + +### Version 1.4.10 - 2013/4/2 + +* Better 'old IE' feature detection that fixes an error with jQuery 2.0.0pre. + +### Version 1.4.9 - 2013/4/2 + +* Fixes bug introduced in previous version. + +### Version 1.4.8 - 2013/4/2 + +* Dropped IE6 support. +* Fixed other issues with $.colorbox.remove. + +### Version 1.4.7 - 2013/4/1 + +* Prevented an error if $.colorbox.remove is called during the transition. + +### Version 1.4.6 - 2013/3/19 + +* Minor change to work around a jQuery 1.4.2 bug for legacy users. + +### Version 1.4.5 - 2013/3/10 + +* Minor change to apply the close and className properties sooner. + +### Version 1.4.4 - 2013/3/10 + +* Fixed an issue with percent-based heights in iOS +* Fixed an issue with ajax requests being applied at the wrong time. + +### Version 1.4.3 - 2013/2/18 + +* Made image preloading aware of retina settings. + +### Version 1.4.2 - 2013/2/18 + +* Removed $.contains for compatibility with jQuery 1.3.x + +### Version 1.4.1 - 2013/2/14 + +* Ignored left and right arrow keypresses if combined with the alt key. + +### Version 1.4.0 - 2013/2/12 + +* Better accessibility: + * Replaced div controls with buttons + * Tabbed navigation confined to modal window + * Added aria role + +### Version 1.3.34 - 2013/2/4 + +* Updated manifest for plugins.jquery.com + +### Version 1.3.33 - 2013/2/4 + +* Added retina display properties: retinaImage, retinaUrl, retinaSuffix +* Fixed iframe scrolling on iOS devices. + ### Version 1.3.32 - 2013/1/31 * Improved internal event subscribing & fixed event bug introduced in v1.3.21 @@ -16,7 +236,7 @@ Send me your language configuration files. See /i18n/jquery.colorbox-de.js as a ### Version 1.3.30 - 2013/1/25 -* Delayed border-width calculations until after opening, to avoid a bug in FF when using ColorBox in a hidden iframe. +* Delayed border-width calculations until after opening, to avoid a bug in FF when using Colorbox in a hidden iframe. ### Version 1.3.29 - 2013/1/24 @@ -44,7 +264,7 @@ Send me your language configuration files. See /i18n/jquery.colorbox-de.js as a ### Version 1.3.23 - 2013/1/18 -* Minor bugfix for calling ColorBox on empty jQuery collections without a selector. +* Minor bugfix for calling Colorbox on empty jQuery collections without a selector. ### Version 1.3.22 - 2013/1/17 @@ -53,7 +273,7 @@ Send me your language configuration files. See /i18n/jquery.colorbox-de.js as a ### Version 1.3.21 - 2013/1/15 Files Changed: *.js -* Fixed compatability issues with jQuery 1.9 +* Fixed compatibility issues with jQuery 1.9 ### Version 1.3.20 - August 15 2012 Files Changed:jquery.colorbox.js @@ -72,8 +292,8 @@ Files Changed:jquery.colorbox.js, colorbox.css (all) ### Version 1.3.18 - October 07 2011 Files Changed:jquery.colorbox.js/jquery.colorbox-min.js, colorbox.css (all) and example 1's controls.png -* Fixed a regression where Flash content displayed in ColorBox would be reloaded if the browser window was resized. -* Added safety check to make sure that ColorBox's markup is only added to the DOM a single time, even if $.colorbox.init() is called multiple times. This will allow site owners to manually initialize ColorBox if they need it before the DOM has finished loading. +* Fixed a regression where Flash content displayed in Colorbox would be reloaded if the browser window was resized. +* Added safety check to make sure that Colorbox's markup is only added to the DOM a single time, even if $.colorbox.init() is called multiple times. This will allow site owners to manually initialize Colorbox if they need it before the DOM has finished loading. * Updated the example index.html files to be HTML5 compliant. * Changed the slideshow behavior so that it immediately moves to the next slide when the slideshow is started. * Minor regex bugfix to allow automatic detection of image URLs that include fragments. @@ -82,8 +302,8 @@ Files Changed:jquery.colorbox.js/jquery.colorbox-min.js, colorbox.css (all) and Files Changed:jquery.colorbox.js/jquery.colorbox-min.js * Added properties "top", "bottom", "left" and "right" to specify a position relative to the viewport, rather than using the default centering. -* Added property "data" to specify GET or POST data when using Ajax. ColorBox's ajax functionality is handled by jQuery's .load() method, so the data property works the same way as it does with .load(). -* Added property "fixed" which can provide fixed positioning for ColorBox, rather than absolute positioning. This will allow ColorBox to remain in a fixed position within the visitors viewport, despite scrolling. IE6 support for this was not added, it will continue to use the default absolute positioning. +* Added property "data" to specify GET or POST data when using Ajax. Colorbox's ajax functionality is handled by jQuery's .load() method, so the data property works the same way as it does with .load(). +* Added property "fixed" which can provide fixed positioning for Colorbox, rather than absolute positioning. This will allow Colorbox to remain in a fixed position within the visitors viewport, despite scrolling. IE6 support for this was not added, it will continue to use the default absolute positioning. * Fixed ClearType problem with IE7. * Minor fixes. @@ -109,7 +329,7 @@ Files Changed: jquery.colorbox.js/jquery.colorbox-min.js Files Changed: jquery.colorbox.js/jquery.colorbox-min.js * Changed the index.html example files to use YouTube's new embedded link format. -* By default, ColorBox returns focus to the element it was launched from once it closes. This can now be disabled by setting the 'returnFocus' property to false. Focus was causing problems for some users who had their anchor elements inside animated containers. +* By default, Colorbox returns focus to the element it was launched from once it closes. This can now be disabled by setting the 'returnFocus' property to false. Focus was causing problems for some users who had their anchor elements inside animated containers. * Minor bug fix involved in using a combination of slideshow and non-slideshow content. ### Version 1.3.12 - October 20 2010 @@ -129,8 +349,8 @@ Files Changed: jquery.colorbox.js/jquery.colorbox-min.js * Fixed compatibility with jQuery 1.4.3 * The 'open' property now accepts a function as a value, like all of the other properties. * Preloading now loads the correct href for images when using a dynamic (function) value for the href property. -* Fixed bug in Safari 3 for Win where ColorBox centered on the document, rather than the visitor's viewport. -* May have fixed an issue in Opera 10.6+ where ColorBox would rarely/randomly freeze up while switching between photos in a group. +* Fixed bug in Safari 3 for Win where Colorbox centered on the document, rather than the visitor's viewport. +* May have fixed an issue in Opera 10.6+ where Colorbox would rarely/randomly freeze up while switching between photos in a group. * Some functionality better encapsulated & minor performance improvements. ### Version 1.3.9 - July 7 2010 @@ -145,7 +365,7 @@ Files Changed: jquery.colorbox.js/jquery.colorbox-min.js * Fixed a bug in Chrome where it would sometimes render photos at 0 by 0 width and height (behavior introduced in recent update to Chrome). * Fixed a bug where the onClosed callback would fire twice (only affected 1.3.7). -* Fixed a bug in IE7 that existed with some iframed websites that use JS to reposition the viewport caused ColorBox to move out of position. +* Fixed a bug in IE7 that existed with some iframed websites that use JS to reposition the viewport caused Colorbox to move out of position. * Abstracted the identifiers (HTML ids & classes, and JS plugin name, method, and events) so that the plugin can be easily rebranded. * Small changes to improve either code readability or compression. @@ -156,7 +376,7 @@ Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/index.html * Resize now accepts 'width', 'innerWidth', 'height' and 'innerHeight'. Example: $.colorbox.resize({width:"100%"}) * Added option (loop:false) to disable looping in a group. * Added options (escKey:false, arrowKey:false) to disable esc-key and arrow-key bindings. -* Added method for removing ColorBox from a document: $.colorbox.remove(); +* Added method for removing Colorbox from a document: $.colorbox.remove(); * Fixed a bug where iframed URLs would be truncated if they contained an unencoded apostrophe. * Now uses the exact href specified on an anchor, rather than the version returned by 'this.href'. This was causing "#example" to be normalized to "http://domain/#example" which interfered with how some users were setting up links to inline content. * Changed example documents over to HTML5. @@ -164,7 +384,7 @@ Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/index.html ### Version 1.3.6 - Jan 13 2010 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js -* Small change to make ColorBox compatible with jQuery 1.4 +* Small change to make Colorbox compatible with jQuery 1.4 ### Version 1.3.5 - December 15 2009 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js @@ -176,27 +396,27 @@ Files Changed: jquery.colorbox.js/jquery.colorbox-min.js ### Version 1.3.4 - December 5 2009 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js -* Event delegation is now used for elements that ColorBox is assigned to, rather than individual click events. -* Additional callbacks have been added to represent other stages of ColorBox's lifecycle. Available callbacks, in order of their execution: onOpen, onLoad, onComplete, onCleanup, onClosed These take place at the same time as the event hooks, but will be better suited than the hooks for targeting specific instances of ColorBox. +* Event delegation is now used for elements that Colorbox is assigned to, rather than individual click events. +* Additional callbacks have been added to represent other stages of Colorbox's lifecycle. Available callbacks, in order of their execution: onOpen, onLoad, onComplete, onCleanup, onClosed These take place at the same time as the event hooks, but will be better suited than the hooks for targeting specific instances of Colorbox. * Ajax content is now immediately added to the DOM to be more compatible if that content contains script tags. * Focus is now returned to the calling element on closing. * Fixed a bug where maxHeight and maxWidth did not work for non-photo content. -* Direct calls no longer need 'open:true', it is assumed. Example: `$.fn.colorbox({html:'<p>Hi</p>'});` +* Direct calls no longer need 'open:true', it is assumed. Example: `$.colorbox({html:'<p>Hi</p>'});` ### Version 1.3.3 - November 7 2009 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js -* Changed $.fn.colorbox.element() to return a jQuery object rather the DOM element. +* Changed $.colorbox.element() to return a jQuery object rather the DOM element. * jQuery.colorbox-min.js is compressed with Google's Closure Compiler rather than YUI Compressor. ### Version 1.3.2 - October 27 2009 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js -* Added 'innerWidth' and 'innerHeight' options to allow people to easily set the size dimensions for ColorBox, without having to anticipate the size of the borders and buttons. +* Added 'innerWidth' and 'innerHeight' options to allow people to easily set the size dimensions for Colorbox, without having to anticipate the size of the borders and buttons. * Renamed 'scrollbars' option to 'scrolling' to be in keeping with the existing HTML attribute. The option now also applies to iframes. * Bug fix: In Safari, positioning occassionally incorrect when using '100%' dimensions. * Bug fix: In IE6, the background overlay is briefly not full size when first viewing. -* Bug fix: In Firefox, opening ColorBox causes a split second shift with a small minority of webpage layouts. +* Bug fix: In Firefox, opening Colorbox causes a split second shift with a small minority of webpage layouts. * Simplified code in a few areas. ### Version 1.3.1 - September 16 2009 @@ -208,11 +428,11 @@ Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/colorbox.css/colorbox-i ### Version 1.3.0 - September 15 2009 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/colorbox.css -* Added $.fn.colorbox.resize() method to allow ColorBox to resize it's height if it's contents change. +* Added $.colorbox.resize() method to allow Colorbox to resize it's height if it's contents change. * Added 'scrollbars' option to allow users to turn off scrollbars when using the resize() method. * Renamed the 'resize' option to be less ambiguous. It's now 'scalePhotos'. * Renamed the 'cbox_close' event to be less ambiguous. It's now 'cbox_cleanup'. It is the first thing to happen in the close method while the 'cbox_closed' event is the last to happen. -* Fixed a bug with the slideshow mouseover graphics that appeared after ColorBox is opened a 2nd time. +* Fixed a bug with the slideshow mouseover graphics that appeared after Colorbox is opened a 2nd time. * Fixed a bug where ClearType may not work in IE6&7 if using the fade transition. * Minor code optimizations to increase compression. @@ -233,12 +453,12 @@ Files Changed: jquery.colorbox.js/jquery.colorbox-min.js Files Changed: jquery.colorbox.js/jquery.colorbox-min.js, example stylesheets and background images (core styles have not changed and the updates will not affect existing user themes / old example themes) * Code cleanup and reduction, better organization and documentation in the full source. -* Added ability to use functions in place of static values for ColorBox's options (thanks Ken!). -* Added an option for straight HTML. Example: `$.fn.colorbox({html:'<p>Howdy</p>', open:true})` -* Added an event for the beginning of the closing process. This is in addition to the event that already existed for when ColorBox had completely closed. 'cbox_close' and 'cbox_closed' respectively. -* Fixed a minor bug in IE6 that would cause a brief content shift in the parent document when opening ColorBox. -* Fixed a minor bug in IE6 that would reveal select elements that had a hidden visibility after closing ColorBox. -* The 'esc' key is unbound now when ColorBox is not open, to avoid any potential conflicts. +* Added ability to use functions in place of static values for Colorbox's options (thanks Ken!). +* Added an option for straight HTML. Example: `$.colorbox({html:'<p>Howdy</p>', open:true})` +* Added an event for the beginning of the closing process. This is in addition to the event that already existed for when Colorbox had completely closed. 'cbox_close' and 'cbox_closed' respectively. +* Fixed a minor bug in IE6 that would cause a brief content shift in the parent document when opening Colorbox. +* Fixed a minor bug in IE6 that would reveal select elements that had a hidden visibility after closing Colorbox. +* The 'esc' key is unbound now when Colorbox is not open, to avoid any potential conflicts. * Used background sprites for examples 1 & 4. Put IE-only (non-sprite) background images in a separate folder. * Example themes 1, 3, & 4 received slight visual tweaks. * Optimized pngs for smaller file size. @@ -248,8 +468,8 @@ Files Changed: jquery.colorbox.js/jquery.colorbox-min.js, example stylesheets an Files Changed: jquery.colorbox.js/jquery.colorbox-min.js * Fixed a bug with fixed width/height images in Opera 9.64. -* Fixed a bug with trying to set a value for rel during a direct call to ColorBox. Example: `$.fn.colorbox({rel:'foo', open:true});` -* Changed how href/rel/title settings are determined to avoid users having to manually update ColorBox settings if they use JavaScript to update any of those attributes, after ColorBox has been defined. +* Fixed a bug with trying to set a value for rel during a direct call to Colorbox. Example: `$.colorbox({rel:'foo', open:true});` +* Changed how href/rel/title settings are determined to avoid users having to manually update Colorbox settings if they use JavaScript to update any of those attributes, after Colorbox has been defined. * Fixed a FF3 bug where the back button was disabled after closing an iframe. ### Version 1.2.5 - June 23 2009 @@ -261,13 +481,13 @@ Files Changed: jquery.colorbox.js/jquery.colorbox-min.js ### Version 1.2.4 - June 9 2009 Files Changed: jquery.colorbox.js, jquery.colorbox-min.js -* Fixed an issue where ColorBox may not close completely if it is closed during a transition animation. +* Fixed an issue where Colorbox may not close completely if it is closed during a transition animation. * Minor code reduction. ### Version 1.2.3 - June 4 2009 * Fixed a png transparency stacking issue in IE. * More accurate Ajax auto-sizing if the user was depending on the #cboxLoadedContent ID for CSS styling. -* Added a public function for returning the current html element that ColorBox is associated with. Example use: var that = $.fn.colorbox.element(); +* Added a public function for returning the current html element that Colorbox is associated with. Example use: var that = $.colorbox.element(); * Added bicubic scaling for resized images in the original IE7. * Removed the IE6 stylesheet and png files from Example 3. It now uses the same png file for the controls that the rest of the browsers use (an alpha transparency PNG8). This example now only has 2 graphics files and 1 stylesheet. @@ -277,19 +497,19 @@ Files Changed: jquery.colorbox.js, jquery.colorbox-min.js ### Version 1.2.1 - May 28 2009 * Note: If you are upgrading, update your jquery.colorbox.js and colorbox.css files. * Added photo resizing. -* Added a maximum width and maximum height. Example: {height:800, maxHeight:'100%'}, would allow the box to be a maximum potential height of 800px, instead of a fixed height of 800px. With maxHeight of 100% the height of ColorBox cannot exceed the height of the browser window. -* Added 'rel' setting to add the ability to set an alternative rel for any ColorBox call. This allows the user to group any combination of elements together for a gallery, or to override an existing rel. attribute so those element are not grouped together, without having to alter their rel in the HTML. -* Added a 'photo' setting to force ColorBox to display a link as a photo. Use this when automatic photo detection fails (such as using a url like 'photo.php' instead of 'photo.jpg', 'photo.jpg#1', or 'photo.jpg?pic=1') -* Removed the need to ever create disposable elements to call colorbox on. ColorBox can now be called directly, without being associated with any existing element, by using the following format: - `$.fn.colorbox({open:true, href:'yourLink.xxx'});` -* ColorBox settings are now persistent and unique for each element. This allows for extremely flexible options for individual elements. You could use this to create a gallery in which each page in the gallery has different settings. One could be a photo with a fade transition, next could be an inline element with an elastic transition with a set width and height, etc. +* Added a maximum width and maximum height. Example: {height:800, maxHeight:'100%'}, would allow the box to be a maximum potential height of 800px, instead of a fixed height of 800px. With maxHeight of 100% the height of Colorbox cannot exceed the height of the browser window. +* Added 'rel' setting to add the ability to set an alternative rel for any Colorbox call. This allows the user to group any combination of elements together for a gallery, or to override an existing rel. attribute so those element are not grouped together, without having to alter their rel in the HTML. +* Added a 'photo' setting to force Colorbox to display a link as a photo. Use this when automatic photo detection fails (such as using a url like 'photo.php' instead of 'photo.jpg', 'photo.jpg#1', or 'photo.jpg?pic=1') +* Removed the need to ever create disposable elements to call colorbox on. Colorbox can now be called directly, without being associated with any existing element, by using the following format: + `$.colorbox({open:true, href:'yourLink.xxx'});` +* Colorbox settings are now persistent and unique for each element. This allows for extremely flexible options for individual elements. You could use this to create a gallery in which each page in the gallery has different settings. One could be a photo with a fade transition, next could be an inline element with an elastic transition with a set width and height, etc. * For user callbacks, 'this' now refers to the element colorbox was opened from. * Fixed a minor grouping issue with IE6, when transition type is set to 'none'. * Added an Adobe Illustrator file that contains the borders and buttons used in the various examples. ### Version 1.2 - May 13 2009 * Added a slideshow feature. -* Added re-positioning on browser resize. If the browser is resized, ColorBox will recenter itself onscreen. +* Added re-positioning on browser resize. If the browser is resized, Colorbox will recenter itself onscreen. * Added hooks for key events: cbox_open, cbox_load, cbox_complete, cbox_closed. * Fixed an IE transparency-stacking problem, where transparent PNGs would show through to the background overlay. * Fixed an IE iframe issue where the ifame might shift up and to the left under certain circumstances. @@ -299,54 +519,54 @@ Files Changed: jquery.colorbox.js, jquery.colorbox-min.js * Changed how the JS is structured to be better organized and increase compression. Increased documentation. * Changed CSS :hover states to a .hover class. This sidesteps a minor IE8 bug with css hover states and allows easier access to hover state user styles from the JavaScript. * Changed: elements added to the DOM have new ID's. The naming is more consistent and less likely to cause conflicts with existing website stylesheets. All stylesheets have been updated. -* Changed the behavior for prev/next links so that ColorBox does not get hung up on broken links. A visitor can now skip through broken or long-loading links by clicking prev/next buttons. +* Changed the behavior for prev/next links so that Colorbox does not get hung up on broken links. A visitor can now skip through broken or long-loading links by clicking prev/next buttons. * Changed the naming of variables in the parameter map to be more concise and intuitive. * Removed colorbox.css. Combined the colorbox.css styles with jquery.colorbox.js: the css file was not large enough to warrant being a separate file. ### Version 1.1.6 - April 28 2009 * Prevented the default action of the next & previous anchors and the left and right keys for gallery mode. -* Fixed a bug where the title element was being added back to the DOM when closing ColorBox while using inline content. +* Fixed a bug where the title element was being added back to the DOM when closing Colorbox while using inline content. * Fixed a bug where IE7 would crash for example 2. * Smaller filesize: removed a small amount of unused code and rewrote the HTML injection with less syntax. -* Added a public method for closing ColorBox: $.fn.colorbox.close(). This will allow iframe users to add an event to close ColorBox without having to create an additional function. +* Added a public method for closing Colorbox: $.colorbox.close(). This will allow iframe users to add an event to close Colorbox without having to create an additional function. ### Version 1.1.5 - April 11 2009 -* Fixed minor issues with exiting ColorBox. +* Fixed minor issues with exiting Colorbox. ### Version 1.1.4 - April 08 2009 -* Fixed a bug in the fade transition where ColorBox not close completely if instructed to close during the fade-in portion of the transition. +* Fixed a bug in the fade transition where Colorbox not close completely if instructed to close during the fade-in portion of the transition. ### Version 1.1.3 - April 06 2009 -* Fixed an IE6&7 issue with using ColorBox to display animated GIFs. +* Fixed an IE6&7 issue with using Colorbox to display animated GIFs. ### Version 1.1.2 - April 05 2009 -* Added ability to change content when ColorBox is already open. +* Added ability to change content when Colorbox is already open. * Added vertical photo centering now works for all browsers (this feature previously excluded IE6&7). * Added namespacing to the esc-key keydown event for people who want to disable it: "keydown.colorClose" -* Added 'title' setting to add the ability to set an alternative title for any ColorBox call. +* Added 'title' setting to add the ability to set an alternative title for any Colorbox call. * Fixed rollover navigation issue with IE8. (Added JS-based rollover state due to a browser-bug.) * Fixed an overflow issue for when the fixed width/height is smaller than the size of a photo. -* Fixed a bug in the fade transition where the border would still come up if ColorBox was closed mid-transition. +* Fixed a bug in the fade transition where the border would still come up if Colorbox was closed mid-transition. * Switch from JSMin to Yui Compressor for minification. Minified code now under 7KB. ### Version 1.1.1 - March 31 2009 * More robust image detection regex. Now detects image file types with url fragments and/or query strings. * Added 'nofollow' exception to rel grouping. -* Changed how images are loaded into the DOM to prevent premature size calculation by ColorBox. +* Changed how images are loaded into the DOM to prevent premature size calculation by Colorbox. * Added timestamp to iframe name to prevent caching - this was a problem in some browsers if the user had multiple iframes and the visitor left the page and came back, or if they refreshed the page. ### Version 1.1.0 - March 21 2009 * Animation is now much smoother and less resource intensive. * Added support for % sizing. * Callback option added. -* Inline content now preserves JavaScript events, and changes made while ColorBox is open are also preserved. -* Added 'href' setting to add the ability to set an alternative href for any anchor, or to assign the ColorBox event to non-anchors. +* Inline content now preserves JavaScript events, and changes made while Colorbox is open are also preserved. +* Added 'href' setting to add the ability to set an alternative href for any anchor, or to assign the Colorbox event to non-anchors. Example: $('button').colorbox({'href':'process.php'}) Example: $('a[href='http://msn.com']).colorbox({'href':'http://google.com', iframe:true}); * Photos are now horizontally centered if they are smaller than the lightbox size. Also vertically centered for browsers newer than IE7. * Buttons in the examples are now included in the 'protected zone'. The lightbox will never expand it's borders or buttons beyond an accessible area of the screen. * Keypress events don't queue up by holding down the arrow keys. -* Added option to close ColorBox by clicking on the background overlay. +* Added option to close Colorbox by clicking on the background overlay. * Added 'none' transition setting. * Changed 'contentIframe' and 'contentInline' to 'inline' and 'iframe'. Removed 'contentAjax' because it is automatically assumed for non-image file types. * Changed 'contentWidth' and 'contentHeight' to 'fixedWidth' and 'fixedHeight'. These sizes now reflect the total size of the lightbox, not just the inner content. This is so users can accurately anticipate % sizes without fear of creating scrollbars. diff --git a/library/colorbox/bower.json b/library/colorbox/bower.json new file mode 100644 index 000000000..6cdfb9bab --- /dev/null +++ b/library/colorbox/bower.json @@ -0,0 +1,42 @@ +{ + "name": "jquery-colorbox", + "description": "jQuery lightbox and modal window plugin", + "version": "1.5.14", + "dependencies": { + "jquery": ">=1.3.2" + }, + "keywords": [ + "modal", + "lightbox", + "window", + "popup", + "ui", + "jQuery", + "jquery-plugin" + ], + "authors": [ + { + "name": "Jack Moore", + "url": "http://www.jacklmoore.com", + "email": "hello@jacklmoore.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/mit-license.php" + } + ], + "homepage": "http://www.jacklmoore.com/colorbox", + "main": "jquery.colorbox.js", + "ignore": [ + "colorbox.jquery.json", + "colorbox.ai", + "content", + "example1/index.html", + "example2/index.html", + "example3/index.html", + "example4/index.html", + "example5/index.html" + ] +}
\ No newline at end of file diff --git a/library/colorbox/colorbox.css b/library/colorbox/colorbox.css deleted file mode 100644 index 544a76f3b..000000000 --- a/library/colorbox/colorbox.css +++ /dev/null @@ -1,52 +0,0 @@ -/* - ColorBox Core Style: - The following CSS is consistent between example themes and should not be altered. -*/ -#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} -#cboxOverlay{position:fixed; width:100%; height:100%;} -#cboxMiddleLeft, #cboxBottomLeft{clear:left;} -#cboxContent{position:relative;} -#cboxLoadedContent{overflow:auto;} -#cboxTitle{margin:0;} -#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} -#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} -.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} -.cboxIframe{width:100%; height:100%; display:block; border:0;} -#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} - -/* - User Style: - Change the following styles to modify the appearance of ColorBox. They are - ordered & tabbed in a way that represents the nesting of the generated HTML. -*/ -#cboxOverlay{background:#000;} -#colorbox{} - #cboxTopLeft{width:14px; height:14px; background:url(images/controls.png) no-repeat 0 0;} - #cboxTopCenter{height:14px; background:url(images/border.png) repeat-x top left;} - #cboxTopRight{width:14px; height:14px; background:url(images/controls.png) no-repeat -36px 0;} - #cboxBottomLeft{width:14px; height:43px; background:url(images/controls.png) no-repeat 0 -32px;} - #cboxBottomCenter{height:43px; background:url(images/border.png) repeat-x bottom left;} - #cboxBottomRight{width:14px; height:43px; background:url(images/controls.png) no-repeat -36px -32px;} - #cboxMiddleLeft{width:14px; background:url(images/controls.png) repeat-y -175px 0;} - #cboxMiddleRight{width:14px; background:url(images/controls.png) repeat-y -211px 0;} - #cboxContent{background:#fff; overflow:visible;} - .cboxIframe{background:#fff;} - #cboxError{padding:50px; border:1px solid #ccc;} - #cboxLoadedContent{margin-bottom:5px;} - #cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;} - #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} - #cboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;} - #cboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;} - - #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{position:absolute; bottom:-29px; background:url(images/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;} - #cboxPrevious{left:0px; background-position: -51px -25px;} - #cboxPrevious:hover{background-position:-51px 0px;} - #cboxNext{left:27px; background-position:-75px -25px;} - #cboxNext:hover{background-position:-75px 0px;} - #cboxClose{right:0; background-position:-100px -25px;} - #cboxClose:hover{background-position:-100px 0px;} - - .cboxSlideshow_on #cboxSlideshow{background-position:-125px 0px; right:27px;} - .cboxSlideshow_on #cboxSlideshow:hover{background-position:-150px 0px;} - .cboxSlideshow_off #cboxSlideshow{background-position:-150px -25px; right:27px;} - .cboxSlideshow_off #cboxSlideshow:hover{background-position:-125px 0px;}
\ No newline at end of file diff --git a/library/colorbox/colorbox.jquery.json b/library/colorbox/colorbox.jquery.json deleted file mode 100644 index dd517a5f4..000000000 --- a/library/colorbox/colorbox.jquery.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "colorbox", - "title": "ColorBox", - "description": "A lightweight customizable lightbox plugin", - "keywords": [ - "modal", - "lightbox", - "window", - "popup", - "ui" - ], - "version": "1.3.32", - "author": { - "name": "Jack Moore", - "url": "http://www.jacklmoore.com", - "email": "jack@colorpowered.com" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://www.opensource.org/licenses/mit-license.php" - } - ], - "homepage": "http://jacklmoore.com/colorbox", - "demo": "http://jacklmoore.com/colorbox", - "download": "http://jacklmoore.com/colorbox/colorbox.zip", - "dependencies": { - "jquery": ">=1.3.2" - } -}
\ No newline at end of file diff --git a/library/colorbox/component.json b/library/colorbox/component.json deleted file mode 100644 index 171764fbf..000000000 --- a/library/colorbox/component.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "jquery-autosize", - "version": "1.3.32", - "main": "./jquery.autosize.js", - "dependencies": { - "jquery": ">=1.3.2" - } -}
\ No newline at end of file diff --git a/library/colorbox/content/daisy.jpg b/library/colorbox/content/daisy.jpg Binary files differnew file mode 100644 index 000000000..16da6bdb0 --- /dev/null +++ b/library/colorbox/content/daisy.jpg diff --git a/library/colorbox/content/daisy@2x.jpg b/library/colorbox/content/daisy@2x.jpg Binary files differnew file mode 100644 index 000000000..f2e688dc2 --- /dev/null +++ b/library/colorbox/content/daisy@2x.jpg diff --git a/library/colorbox/content/homer.jpg b/library/colorbox/content/homer.jpg Binary files differindex 87ec76c99..864c17a9f 100644 --- a/library/colorbox/content/homer.jpg +++ b/library/colorbox/content/homer.jpg diff --git a/library/colorbox/content/marylou.jpg b/library/colorbox/content/marylou.jpg Binary files differindex 4c717d276..f113fbf6c 100644 --- a/library/colorbox/content/marylou.jpg +++ b/library/colorbox/content/marylou.jpg diff --git a/library/colorbox/content/ohoopee1.jpg b/library/colorbox/content/ohoopee1.jpg Binary files differindex aae19a3e6..007fa58a8 100644 --- a/library/colorbox/content/ohoopee1.jpg +++ b/library/colorbox/content/ohoopee1.jpg diff --git a/library/colorbox/content/ohoopee2.jpg b/library/colorbox/content/ohoopee2.jpg Binary files differindex 206894489..e56bb0f32 100644 --- a/library/colorbox/content/ohoopee2.jpg +++ b/library/colorbox/content/ohoopee2.jpg diff --git a/library/colorbox/content/ohoopee3.jpg b/library/colorbox/content/ohoopee3.jpg Binary files differindex 4d64d2400..7cc1c7f97 100644 --- a/library/colorbox/content/ohoopee3.jpg +++ b/library/colorbox/content/ohoopee3.jpg diff --git a/library/colorbox/example1/colorbox.css b/library/colorbox/example1/colorbox.css index 5ee3feba9..8a4ff998c 100644 --- a/library/colorbox/example1/colorbox.css +++ b/library/colorbox/example1/colorbox.css @@ -1,26 +1,27 @@ /* - ColorBox Core Style: + Colorbox Core Style: The following CSS is consistent between example themes and should not be altered. */ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxWrapper {max-width:none;} #cboxOverlay{position:fixed; width:100%; height:100%;} #cboxMiddleLeft, #cboxBottomLeft{clear:left;} #cboxContent{position:relative;} -#cboxLoadedContent{overflow:auto;} +#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} #cboxTitle{margin:0;} #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} -.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} -.cboxIframe{width:100%; height:100%; display:block; border:0;} +.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} +.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;} #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} /* User Style: - Change the following styles to modify the appearance of ColorBox. They are + Change the following styles to modify the appearance of Colorbox. They are ordered & tabbed in a way that represents the nesting of the generated HTML. */ -#cboxOverlay{background:url(images/overlay.png) repeat 0 0;} -#colorbox{} +#cboxOverlay{background:url(images/overlay.png) repeat 0 0; opacity: 0.9; filter: alpha(opacity = 90);} +#colorbox{outline:0;} #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px 0;} #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px 0;} #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px -29px;} @@ -35,13 +36,20 @@ #cboxLoadedContent{margin-bottom:28px;} #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;} #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;} + #cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;} + #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} + + /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ + #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; } + + /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ + #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} + #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;} #cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;} #cboxPrevious:hover{background-position:-75px -25px;} #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;} #cboxNext:hover{background-position:-50px -25px;} - #cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;} - #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;} #cboxClose:hover{background-position:-25px -25px;} @@ -59,28 +67,4 @@ .cboxIE #cboxMiddleLeft, .cboxIE #cboxMiddleRight { filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); -} - -/* - The following provides PNG transparency support for IE6 - Feel free to remove this and the /ie6/ directory if you have dropped IE6 support. -*/ -.cboxIE6 #cboxTopLeft{background:url(images/ie6/borderTopLeft.png);} -.cboxIE6 #cboxTopCenter{background:url(images/ie6/borderTopCenter.png);} -.cboxIE6 #cboxTopRight{background:url(images/ie6/borderTopRight.png);} -.cboxIE6 #cboxBottomLeft{background:url(images/ie6/borderBottomLeft.png);} -.cboxIE6 #cboxBottomCenter{background:url(images/ie6/borderBottomCenter.png);} -.cboxIE6 #cboxBottomRight{background:url(images/ie6/borderBottomRight.png);} -.cboxIE6 #cboxMiddleLeft{background:url(images/ie6/borderMiddleLeft.png);} -.cboxIE6 #cboxMiddleRight{background:url(images/ie6/borderMiddleRight.png);} - -.cboxIE6 #cboxTopLeft, -.cboxIE6 #cboxTopCenter, -.cboxIE6 #cboxTopRight, -.cboxIE6 #cboxBottomLeft, -.cboxIE6 #cboxBottomCenter, -.cboxIE6 #cboxBottomRight, -.cboxIE6 #cboxMiddleLeft, -.cboxIE6 #cboxMiddleRight { - _behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')"); -} +}
\ No newline at end of file diff --git a/library/colorbox/example1/images/border.png b/library/colorbox/example1/images/border.png Binary files differindex f463a10d8..9386f3504 100644 --- a/library/colorbox/example1/images/border.png +++ b/library/colorbox/example1/images/border.png diff --git a/library/colorbox/example1/images/controls.png b/library/colorbox/example1/images/controls.png Binary files differindex dcfd6fb9f..1ec3cb1c8 100644 --- a/library/colorbox/example1/images/controls.png +++ b/library/colorbox/example1/images/controls.png diff --git a/library/colorbox/example1/images/ie6/borderBottomCenter.png b/library/colorbox/example1/images/ie6/borderBottomCenter.png Binary files differdeleted file mode 100644 index 0d4475edf..000000000 --- a/library/colorbox/example1/images/ie6/borderBottomCenter.png +++ /dev/null diff --git a/library/colorbox/example1/images/ie6/borderBottomLeft.png b/library/colorbox/example1/images/ie6/borderBottomLeft.png Binary files differdeleted file mode 100644 index 2775eba89..000000000 --- a/library/colorbox/example1/images/ie6/borderBottomLeft.png +++ /dev/null diff --git a/library/colorbox/example1/images/ie6/borderBottomRight.png b/library/colorbox/example1/images/ie6/borderBottomRight.png Binary files differdeleted file mode 100644 index f7f51379c..000000000 --- a/library/colorbox/example1/images/ie6/borderBottomRight.png +++ /dev/null diff --git a/library/colorbox/example1/images/ie6/borderMiddleLeft.png b/library/colorbox/example1/images/ie6/borderMiddleLeft.png Binary files differdeleted file mode 100644 index a2d63d156..000000000 --- a/library/colorbox/example1/images/ie6/borderMiddleLeft.png +++ /dev/null diff --git a/library/colorbox/example1/images/ie6/borderMiddleRight.png b/library/colorbox/example1/images/ie6/borderMiddleRight.png Binary files differdeleted file mode 100644 index fd7c3e849..000000000 --- a/library/colorbox/example1/images/ie6/borderMiddleRight.png +++ /dev/null diff --git a/library/colorbox/example1/images/ie6/borderTopCenter.png b/library/colorbox/example1/images/ie6/borderTopCenter.png Binary files differdeleted file mode 100644 index 2937a9cf9..000000000 --- a/library/colorbox/example1/images/ie6/borderTopCenter.png +++ /dev/null diff --git a/library/colorbox/example1/images/ie6/borderTopLeft.png b/library/colorbox/example1/images/ie6/borderTopLeft.png Binary files differdeleted file mode 100644 index f9d458b5b..000000000 --- a/library/colorbox/example1/images/ie6/borderTopLeft.png +++ /dev/null diff --git a/library/colorbox/example1/images/ie6/borderTopRight.png b/library/colorbox/example1/images/ie6/borderTopRight.png Binary files differdeleted file mode 100644 index 74b8583cf..000000000 --- a/library/colorbox/example1/images/ie6/borderTopRight.png +++ /dev/null diff --git a/library/colorbox/example1/images/loading.gif b/library/colorbox/example1/images/loading.gif Binary files differindex b4695d811..0325c8dbf 100644 --- a/library/colorbox/example1/images/loading.gif +++ b/library/colorbox/example1/images/loading.gif diff --git a/library/colorbox/example1/images/loading_background.png b/library/colorbox/example1/images/loading_background.png Binary files differindex 6ae83e697..23a336b39 100644 --- a/library/colorbox/example1/images/loading_background.png +++ b/library/colorbox/example1/images/loading_background.png diff --git a/library/colorbox/example1/images/overlay.png b/library/colorbox/example1/images/overlay.png Binary files differindex 53ea98f70..10362a423 100644 --- a/library/colorbox/example1/images/overlay.png +++ b/library/colorbox/example1/images/overlay.png diff --git a/library/colorbox/example1/index.html b/library/colorbox/example1/index.html index 727fe78d7..8f10b9306 100644 --- a/library/colorbox/example1/index.html +++ b/library/colorbox/example1/index.html @@ -2,24 +2,24 @@ <html> <head> <meta charset='utf-8'/> - <title>ColorBox Examples</title> + <title>Colorbox Examples</title> <style> body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;} a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;} h2{font-size:13px; margin:15px 0 0 0;} </style> <link rel="stylesheet" href="colorbox.css" /> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../jquery.colorbox.js"></script> <script> $(document).ready(function(){ - //Examples of how to assign the ColorBox event to elements + //Examples of how to assign the Colorbox event to elements $(".group1").colorbox({rel:'group1'}); $(".group2").colorbox({rel:'group2', transition:"fade"}); $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"}); $(".group4").colorbox({rel:'group4', slideshow:true}); $(".ajax").colorbox(); - $(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344}); + $(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390}); $(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409}); $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"}); $(".inline").colorbox({inline:true, width:"50%"}); @@ -30,6 +30,9 @@ onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); }, onClosed:function(){ alert('onClosed: colorbox has completely closed'); } }); + + $('.non-retina').colorbox({rel:'group5', transition:'none'}) + $('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true}); //Example of preserving a JavaScript event for inline calls. $("#click").click(function(){ @@ -40,7 +43,7 @@ </script> </head> <body> - <h1>ColorBox Demonstration</h1> + <h1>Colorbox Demonstration</h1> <h2>Elastic Transition</h2> <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p> <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p> @@ -63,7 +66,7 @@ <h2>Other Content Types</h2> <p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p> - <p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p> + <p><a class='youtube' href="http://www.youtube.com/embed/VOJyrQa_WR4?rel=0&wmode=transparent">Flash / Video (Iframe/Direct Link To YouTube)</a></p> <p><a class='vimeo' href="http://player.vimeo.com/video/2285902" title="Röyksopp: Remind Me">Flash / Video (Iframe/Direct Link To Vimeo)</a></p> <p><a class='iframe' href="http://wikipedia.com">Outside Webpage (Iframe)</a></p> <p><a class='inline' href="#inline_content">Inline HTML</a></p> @@ -71,6 +74,11 @@ <h2>Demonstration of using callbacks</h2> <p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p> + + <h2>Retina Images</h2> + <p><a class="retina" href="../content/daisy.jpg" title="Retina">Retina</a></p> + <p><a class="non-retina" href="../content/daisy.jpg" title="Non-Retina">Non-Retina</a></p> + <!-- This contains the hidden content for inline calls --> <div style='display:none'> <div id='inline_content' style='padding:10px; background:#fff;'> @@ -78,7 +86,7 @@ <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p> <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p> - <p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p> + <p><strong>If you try to open a new Colorbox while it is already open, it will update itself with the new content.</strong></p> <p>Updating Content Example:<br /> <a class="ajax" href="../content/ajax.html">Click here to load new content</a></p> </div> diff --git a/library/colorbox/example2/colorbox.css b/library/colorbox/example2/colorbox.css index 3bb3d8121..0a6710404 100644 --- a/library/colorbox/example2/colorbox.css +++ b/library/colorbox/example2/colorbox.css @@ -1,27 +1,28 @@ /* - ColorBox Core Style: + Colorbox Core Style: The following CSS is consistent between example themes and should not be altered. */ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxWrapper {max-width:none;} #cboxOverlay{position:fixed; width:100%; height:100%;} #cboxMiddleLeft, #cboxBottomLeft{clear:left;} #cboxContent{position:relative;} -#cboxLoadedContent{overflow:auto;} +#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} #cboxTitle{margin:0;} #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} -.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} -.cboxIframe{width:100%; height:100%; display:block; border:0;} +.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} +.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;} #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} /* User Style: - Change the following styles to modify the appearance of ColorBox. They are + Change the following styles to modify the appearance of Colorbox. They are ordered & tabbed in a way that represents the nesting of the generated HTML. */ -#cboxOverlay{background:#fff;} -#colorbox{} - #cboxContent{margin-top:32px; overflow:visible;} +#cboxOverlay{background:#fff; opacity: 0.9; filter: alpha(opacity = 90);} +#colorbox{outline:0;} + #cboxContent{margin-top:32px; overflow:visible; background:#000;} .cboxIframe{background:#fff;} #cboxError{padding:50px; border:1px solid #ccc;} #cboxLoadedContent{background:#000; padding:1px;} @@ -29,7 +30,13 @@ #cboxLoadingOverlay{background:#000;} #cboxTitle{position:absolute; top:-22px; left:0; color:#000;} #cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;} - #cboxSlideshow, #cboxPrevious, #cboxNext, #cboxClose{text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(images/controls.png) no-repeat 0 0;} + + /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ + #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(images/controls.png) no-repeat 0 0;} + + /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ + #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} + #cboxPrevious{background-position:0px 0px; right:44px;} #cboxPrevious:hover{background-position:0px -25px;} #cboxNext{background-position:-25px 0px; right:22px;} diff --git a/library/colorbox/example2/images/controls.png b/library/colorbox/example2/images/controls.png Binary files differindex 8569b57f1..36f526992 100644 --- a/library/colorbox/example2/images/controls.png +++ b/library/colorbox/example2/images/controls.png diff --git a/library/colorbox/example2/images/loading.gif b/library/colorbox/example2/images/loading.gif Binary files differindex 19c67bbd0..a32df5c08 100644 --- a/library/colorbox/example2/images/loading.gif +++ b/library/colorbox/example2/images/loading.gif diff --git a/library/colorbox/example2/index.html b/library/colorbox/example2/index.html index 727fe78d7..8f10b9306 100644 --- a/library/colorbox/example2/index.html +++ b/library/colorbox/example2/index.html @@ -2,24 +2,24 @@ <html> <head> <meta charset='utf-8'/> - <title>ColorBox Examples</title> + <title>Colorbox Examples</title> <style> body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;} a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;} h2{font-size:13px; margin:15px 0 0 0;} </style> <link rel="stylesheet" href="colorbox.css" /> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../jquery.colorbox.js"></script> <script> $(document).ready(function(){ - //Examples of how to assign the ColorBox event to elements + //Examples of how to assign the Colorbox event to elements $(".group1").colorbox({rel:'group1'}); $(".group2").colorbox({rel:'group2', transition:"fade"}); $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"}); $(".group4").colorbox({rel:'group4', slideshow:true}); $(".ajax").colorbox(); - $(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344}); + $(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390}); $(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409}); $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"}); $(".inline").colorbox({inline:true, width:"50%"}); @@ -30,6 +30,9 @@ onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); }, onClosed:function(){ alert('onClosed: colorbox has completely closed'); } }); + + $('.non-retina').colorbox({rel:'group5', transition:'none'}) + $('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true}); //Example of preserving a JavaScript event for inline calls. $("#click").click(function(){ @@ -40,7 +43,7 @@ </script> </head> <body> - <h1>ColorBox Demonstration</h1> + <h1>Colorbox Demonstration</h1> <h2>Elastic Transition</h2> <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p> <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p> @@ -63,7 +66,7 @@ <h2>Other Content Types</h2> <p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p> - <p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p> + <p><a class='youtube' href="http://www.youtube.com/embed/VOJyrQa_WR4?rel=0&wmode=transparent">Flash / Video (Iframe/Direct Link To YouTube)</a></p> <p><a class='vimeo' href="http://player.vimeo.com/video/2285902" title="Röyksopp: Remind Me">Flash / Video (Iframe/Direct Link To Vimeo)</a></p> <p><a class='iframe' href="http://wikipedia.com">Outside Webpage (Iframe)</a></p> <p><a class='inline' href="#inline_content">Inline HTML</a></p> @@ -71,6 +74,11 @@ <h2>Demonstration of using callbacks</h2> <p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p> + + <h2>Retina Images</h2> + <p><a class="retina" href="../content/daisy.jpg" title="Retina">Retina</a></p> + <p><a class="non-retina" href="../content/daisy.jpg" title="Non-Retina">Non-Retina</a></p> + <!-- This contains the hidden content for inline calls --> <div style='display:none'> <div id='inline_content' style='padding:10px; background:#fff;'> @@ -78,7 +86,7 @@ <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p> <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p> - <p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p> + <p><strong>If you try to open a new Colorbox while it is already open, it will update itself with the new content.</strong></p> <p>Updating Content Example:<br /> <a class="ajax" href="../content/ajax.html">Click here to load new content</a></p> </div> diff --git a/library/colorbox/example3/colorbox.css b/library/colorbox/example3/colorbox.css index 153e32e6f..1cebdffd6 100644 --- a/library/colorbox/example3/colorbox.css +++ b/library/colorbox/example3/colorbox.css @@ -1,38 +1,45 @@ /* - ColorBox Core Style: + Colorbox Core Style: The following CSS is consistent between example themes and should not be altered. */ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxWrapper {max-width:none;} #cboxOverlay{position:fixed; width:100%; height:100%;} #cboxMiddleLeft, #cboxBottomLeft{clear:left;} #cboxContent{position:relative;} -#cboxLoadedContent{overflow:auto;} +#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} #cboxTitle{margin:0;} #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} -.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} -.cboxIframe{width:100%; height:100%; display:block; border:0;} +.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} +.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;} #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} /* User Style: - Change the following styles to modify the appearance of ColorBox. They are + Change the following styles to modify the appearance of Colorbox. They are ordered & tabbed in a way that represents the nesting of the generated HTML. */ -#cboxOverlay{background:#000;} -#colorbox{} - #cboxContent{margin-top:20px;} +#cboxOverlay{background:#000; opacity: 0.9; filter: alpha(opacity = 90);} +#colorbox{outline:0;} + #cboxContent{margin-top:20px;background:#000;} .cboxIframe{background:#fff;} #cboxError{padding:50px; border:1px solid #ccc;} #cboxLoadedContent{border:5px solid #000; background:#fff;} #cboxTitle{position:absolute; top:-20px; left:0; color:#ccc;} #cboxCurrent{position:absolute; top:-20px; right:0px; color:#ccc;} + #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} + + /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ + #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; } + + /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ + #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} + #cboxSlideshow{position:absolute; top:-20px; right:90px; color:#fff;} #cboxPrevious{position:absolute; top:50%; left:5px; margin-top:-32px; background:url(images/controls.png) no-repeat top left; width:28px; height:65px; text-indent:-9999px;} #cboxPrevious:hover{background-position:bottom left;} #cboxNext{position:absolute; top:50%; right:5px; margin-top:-32px; background:url(images/controls.png) no-repeat top right; width:28px; height:65px; text-indent:-9999px;} #cboxNext:hover{background-position:bottom right;} - #cboxLoadingOverlay{background:#000;} - #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} #cboxClose{position:absolute; top:5px; right:5px; display:block; background:url(images/controls.png) no-repeat top center; width:38px; height:19px; text-indent:-9999px;} - #cboxClose:hover{background-position:bottom center;}
\ No newline at end of file + #cboxClose:hover{background-position:bottom center;} diff --git a/library/colorbox/example3/images/loading.gif b/library/colorbox/example3/images/loading.gif Binary files differindex 19c67bbd0..a32df5c08 100644 --- a/library/colorbox/example3/images/loading.gif +++ b/library/colorbox/example3/images/loading.gif diff --git a/library/colorbox/example3/index.html b/library/colorbox/example3/index.html index 727fe78d7..8f10b9306 100644 --- a/library/colorbox/example3/index.html +++ b/library/colorbox/example3/index.html @@ -2,24 +2,24 @@ <html> <head> <meta charset='utf-8'/> - <title>ColorBox Examples</title> + <title>Colorbox Examples</title> <style> body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;} a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;} h2{font-size:13px; margin:15px 0 0 0;} </style> <link rel="stylesheet" href="colorbox.css" /> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../jquery.colorbox.js"></script> <script> $(document).ready(function(){ - //Examples of how to assign the ColorBox event to elements + //Examples of how to assign the Colorbox event to elements $(".group1").colorbox({rel:'group1'}); $(".group2").colorbox({rel:'group2', transition:"fade"}); $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"}); $(".group4").colorbox({rel:'group4', slideshow:true}); $(".ajax").colorbox(); - $(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344}); + $(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390}); $(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409}); $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"}); $(".inline").colorbox({inline:true, width:"50%"}); @@ -30,6 +30,9 @@ onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); }, onClosed:function(){ alert('onClosed: colorbox has completely closed'); } }); + + $('.non-retina').colorbox({rel:'group5', transition:'none'}) + $('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true}); //Example of preserving a JavaScript event for inline calls. $("#click").click(function(){ @@ -40,7 +43,7 @@ </script> </head> <body> - <h1>ColorBox Demonstration</h1> + <h1>Colorbox Demonstration</h1> <h2>Elastic Transition</h2> <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p> <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p> @@ -63,7 +66,7 @@ <h2>Other Content Types</h2> <p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p> - <p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p> + <p><a class='youtube' href="http://www.youtube.com/embed/VOJyrQa_WR4?rel=0&wmode=transparent">Flash / Video (Iframe/Direct Link To YouTube)</a></p> <p><a class='vimeo' href="http://player.vimeo.com/video/2285902" title="Röyksopp: Remind Me">Flash / Video (Iframe/Direct Link To Vimeo)</a></p> <p><a class='iframe' href="http://wikipedia.com">Outside Webpage (Iframe)</a></p> <p><a class='inline' href="#inline_content">Inline HTML</a></p> @@ -71,6 +74,11 @@ <h2>Demonstration of using callbacks</h2> <p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p> + + <h2>Retina Images</h2> + <p><a class="retina" href="../content/daisy.jpg" title="Retina">Retina</a></p> + <p><a class="non-retina" href="../content/daisy.jpg" title="Non-Retina">Non-Retina</a></p> + <!-- This contains the hidden content for inline calls --> <div style='display:none'> <div id='inline_content' style='padding:10px; background:#fff;'> @@ -78,7 +86,7 @@ <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p> <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p> - <p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p> + <p><strong>If you try to open a new Colorbox while it is already open, it will update itself with the new content.</strong></p> <p>Updating Content Example:<br /> <a class="ajax" href="../content/ajax.html">Click here to load new content</a></p> </div> diff --git a/library/colorbox/example4/colorbox.css b/library/colorbox/example4/colorbox.css index 54560688a..d475a343a 100644 --- a/library/colorbox/example4/colorbox.css +++ b/library/colorbox/example4/colorbox.css @@ -1,26 +1,27 @@ /* - ColorBox Core Style: + Colorbox Core Style: The following CSS is consistent between example themes and should not be altered. */ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxWrapper {max-width:none;} #cboxOverlay{position:fixed; width:100%; height:100%;} #cboxMiddleLeft, #cboxBottomLeft{clear:left;} #cboxContent{position:relative;} -#cboxLoadedContent{overflow:auto;} +#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} #cboxTitle{margin:0;} #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} -.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} -.cboxIframe{width:100%; height:100%; display:block; border:0;} +.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} +.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;} #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} /* User Style: - Change the following styles to modify the appearance of ColorBox. They are + Change the following styles to modify the appearance of Colorbox. They are ordered & tabbed in a way that represents the nesting of the generated HTML. */ -#cboxOverlay{background:#fff;} -#colorbox{} +#cboxOverlay{background:#fff; opacity: 0.9; filter: alpha(opacity = 90);} +#colorbox{outline:0;} #cboxTopLeft{width:25px; height:25px; background:url(images/border1.png) no-repeat 0 0;} #cboxTopCenter{height:25px; background:url(images/border1.png) repeat-x 0 -50px;} #cboxTopRight{width:25px; height:25px; background:url(images/border1.png) no-repeat -25px 0;} @@ -35,10 +36,17 @@ #cboxLoadedContent{margin-bottom:20px;} #cboxTitle{position:absolute; bottom:0px; left:0; text-align:center; width:100%; color:#999;} #cboxCurrent{position:absolute; bottom:0px; left:100px; color:#999;} + #cboxLoadingOverlay{background:#fff url(images/loading.gif) no-repeat 5px 5px;} + + /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ + #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; } + + /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ + #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} + #cboxSlideshow{position:absolute; bottom:0px; right:42px; color:#444;} #cboxPrevious{position:absolute; bottom:0px; left:0; color:#444;} #cboxNext{position:absolute; bottom:0px; left:63px; color:#444;} - #cboxLoadingOverlay{background:#fff url(images/loading.gif) no-repeat 5px 5px;} #cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;} /* @@ -55,28 +63,4 @@ .cboxIE #cboxMiddleLeft, .cboxIE #cboxMiddleRight { filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); -} - -/* - The following provides PNG transparency support for IE6 - Feel free to remove this and the /ie6/ directory if you have dropped IE6 support. -*/ -.cboxIE6 #cboxTopLeft{background:url(images/ie6/borderTopLeft.png);} -.cboxIE6 #cboxTopCenter{background:url(images/ie6/borderTopCenter.png);} -.cboxIE6 #cboxTopRight{background:url(images/ie6/borderTopRight.png);} -.cboxIE6 #cboxBottomLeft{background:url(images/ie6/borderBottomLeft.png);} -.cboxIE6 #cboxBottomCenter{background:url(images/ie6/borderBottomCenter.png);} -.cboxIE6 #cboxBottomRight{background:url(images/ie6/borderBottomRight.png);} -.cboxIE6 #cboxMiddleLeft{background:url(images/ie6/borderMiddleLeft.png);} -.cboxIE6 #cboxMiddleRight{background:url(images/ie6/borderMiddleRight.png);} - -.cboxIE6 #cboxTopLeft, -.cboxIE6 #cboxTopCenter, -.cboxIE6 #cboxTopRight, -.cboxIE6 #cboxBottomLeft, -.cboxIE6 #cboxBottomCenter, -.cboxIE6 #cboxBottomRight, -.cboxIE6 #cboxMiddleLeft, -.cboxIE6 #cboxMiddleRight { - _behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')"); -} +}
\ No newline at end of file diff --git a/library/colorbox/example4/images/border1.png b/library/colorbox/example4/images/border1.png Binary files differindex 0ddc70405..ea73e1592 100644 --- a/library/colorbox/example4/images/border1.png +++ b/library/colorbox/example4/images/border1.png diff --git a/library/colorbox/example4/images/border2.png b/library/colorbox/example4/images/border2.png Binary files differindex aa62a0b72..72cad44ce 100644 --- a/library/colorbox/example4/images/border2.png +++ b/library/colorbox/example4/images/border2.png diff --git a/library/colorbox/example4/images/ie6/borderBottomCenter.png b/library/colorbox/example4/images/ie6/borderBottomCenter.png Binary files differdeleted file mode 100644 index 12e0e9ac0..000000000 --- a/library/colorbox/example4/images/ie6/borderBottomCenter.png +++ /dev/null diff --git a/library/colorbox/example4/images/ie6/borderBottomLeft.png b/library/colorbox/example4/images/ie6/borderBottomLeft.png Binary files differdeleted file mode 100644 index b7a474ae0..000000000 --- a/library/colorbox/example4/images/ie6/borderBottomLeft.png +++ /dev/null diff --git a/library/colorbox/example4/images/ie6/borderBottomRight.png b/library/colorbox/example4/images/ie6/borderBottomRight.png Binary files differdeleted file mode 100644 index 6b6cb159b..000000000 --- a/library/colorbox/example4/images/ie6/borderBottomRight.png +++ /dev/null diff --git a/library/colorbox/example4/images/ie6/borderMiddleLeft.png b/library/colorbox/example4/images/ie6/borderMiddleLeft.png Binary files differdeleted file mode 100644 index 8d0eb739d..000000000 --- a/library/colorbox/example4/images/ie6/borderMiddleLeft.png +++ /dev/null diff --git a/library/colorbox/example4/images/ie6/borderMiddleRight.png b/library/colorbox/example4/images/ie6/borderMiddleRight.png Binary files differdeleted file mode 100644 index d65509e30..000000000 --- a/library/colorbox/example4/images/ie6/borderMiddleRight.png +++ /dev/null diff --git a/library/colorbox/example4/images/ie6/borderTopCenter.png b/library/colorbox/example4/images/ie6/borderTopCenter.png Binary files differdeleted file mode 100644 index 35d8da2d0..000000000 --- a/library/colorbox/example4/images/ie6/borderTopCenter.png +++ /dev/null diff --git a/library/colorbox/example4/images/ie6/borderTopLeft.png b/library/colorbox/example4/images/ie6/borderTopLeft.png Binary files differdeleted file mode 100644 index ae9bda040..000000000 --- a/library/colorbox/example4/images/ie6/borderTopLeft.png +++ /dev/null diff --git a/library/colorbox/example4/images/ie6/borderTopRight.png b/library/colorbox/example4/images/ie6/borderTopRight.png Binary files differdeleted file mode 100644 index 0d8868399..000000000 --- a/library/colorbox/example4/images/ie6/borderTopRight.png +++ /dev/null diff --git a/library/colorbox/example4/images/loading.gif b/library/colorbox/example4/images/loading.gif Binary files differindex 602ce3c3a..1f3a2c0ab 100644 --- a/library/colorbox/example4/images/loading.gif +++ b/library/colorbox/example4/images/loading.gif diff --git a/library/colorbox/example4/index.html b/library/colorbox/example4/index.html index 727fe78d7..8f10b9306 100644 --- a/library/colorbox/example4/index.html +++ b/library/colorbox/example4/index.html @@ -2,24 +2,24 @@ <html> <head> <meta charset='utf-8'/> - <title>ColorBox Examples</title> + <title>Colorbox Examples</title> <style> body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;} a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;} h2{font-size:13px; margin:15px 0 0 0;} </style> <link rel="stylesheet" href="colorbox.css" /> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../jquery.colorbox.js"></script> <script> $(document).ready(function(){ - //Examples of how to assign the ColorBox event to elements + //Examples of how to assign the Colorbox event to elements $(".group1").colorbox({rel:'group1'}); $(".group2").colorbox({rel:'group2', transition:"fade"}); $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"}); $(".group4").colorbox({rel:'group4', slideshow:true}); $(".ajax").colorbox(); - $(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344}); + $(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390}); $(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409}); $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"}); $(".inline").colorbox({inline:true, width:"50%"}); @@ -30,6 +30,9 @@ onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); }, onClosed:function(){ alert('onClosed: colorbox has completely closed'); } }); + + $('.non-retina').colorbox({rel:'group5', transition:'none'}) + $('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true}); //Example of preserving a JavaScript event for inline calls. $("#click").click(function(){ @@ -40,7 +43,7 @@ </script> </head> <body> - <h1>ColorBox Demonstration</h1> + <h1>Colorbox Demonstration</h1> <h2>Elastic Transition</h2> <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p> <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p> @@ -63,7 +66,7 @@ <h2>Other Content Types</h2> <p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p> - <p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p> + <p><a class='youtube' href="http://www.youtube.com/embed/VOJyrQa_WR4?rel=0&wmode=transparent">Flash / Video (Iframe/Direct Link To YouTube)</a></p> <p><a class='vimeo' href="http://player.vimeo.com/video/2285902" title="Röyksopp: Remind Me">Flash / Video (Iframe/Direct Link To Vimeo)</a></p> <p><a class='iframe' href="http://wikipedia.com">Outside Webpage (Iframe)</a></p> <p><a class='inline' href="#inline_content">Inline HTML</a></p> @@ -71,6 +74,11 @@ <h2>Demonstration of using callbacks</h2> <p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p> + + <h2>Retina Images</h2> + <p><a class="retina" href="../content/daisy.jpg" title="Retina">Retina</a></p> + <p><a class="non-retina" href="../content/daisy.jpg" title="Non-Retina">Non-Retina</a></p> + <!-- This contains the hidden content for inline calls --> <div style='display:none'> <div id='inline_content' style='padding:10px; background:#fff;'> @@ -78,7 +86,7 @@ <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p> <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p> - <p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p> + <p><strong>If you try to open a new Colorbox while it is already open, it will update itself with the new content.</strong></p> <p>Updating Content Example:<br /> <a class="ajax" href="../content/ajax.html">Click here to load new content</a></p> </div> diff --git a/library/colorbox/example5/colorbox.css b/library/colorbox/example5/colorbox.css index 544a76f3b..889f20fea 100644 --- a/library/colorbox/example5/colorbox.css +++ b/library/colorbox/example5/colorbox.css @@ -1,26 +1,27 @@ /* - ColorBox Core Style: + Colorbox Core Style: The following CSS is consistent between example themes and should not be altered. */ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxWrapper {max-width:none;} #cboxOverlay{position:fixed; width:100%; height:100%;} #cboxMiddleLeft, #cboxBottomLeft{clear:left;} #cboxContent{position:relative;} -#cboxLoadedContent{overflow:auto;} +#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} #cboxTitle{margin:0;} #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} -.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} -.cboxIframe{width:100%; height:100%; display:block; border:0;} +.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} +.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;} #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} /* User Style: - Change the following styles to modify the appearance of ColorBox. They are + Change the following styles to modify the appearance of Colorbox. They are ordered & tabbed in a way that represents the nesting of the generated HTML. */ -#cboxOverlay{background:#000;} -#colorbox{} +#cboxOverlay{background:#000; opacity: 0.9; filter: alpha(opacity = 90);} +#colorbox{outline:0;} #cboxTopLeft{width:14px; height:14px; background:url(images/controls.png) no-repeat 0 0;} #cboxTopCenter{height:14px; background:url(images/border.png) repeat-x top left;} #cboxTopRight{width:14px; height:14px; background:url(images/controls.png) no-repeat -36px 0;} @@ -38,7 +39,12 @@ #cboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;} #cboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;} - #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{position:absolute; bottom:-29px; background:url(images/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;} + /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ + #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; position:absolute; bottom:-29px; background:url(images/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;} + + /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ + #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} + #cboxPrevious{left:0px; background-position: -51px -25px;} #cboxPrevious:hover{background-position:-51px 0px;} #cboxNext{left:27px; background-position:-75px -25px;} diff --git a/library/colorbox/example5/images/border.png b/library/colorbox/example5/images/border.png Binary files differindex df13bb6da..c1cd1a2a4 100644 --- a/library/colorbox/example5/images/border.png +++ b/library/colorbox/example5/images/border.png diff --git a/library/colorbox/example5/images/controls.png b/library/colorbox/example5/images/controls.png Binary files differindex 65cfd1dc9..259130cd5 100644 --- a/library/colorbox/example5/images/controls.png +++ b/library/colorbox/example5/images/controls.png diff --git a/library/colorbox/example5/images/loading.gif b/library/colorbox/example5/images/loading.gif Binary files differindex b4695d811..dba33c816 100644 --- a/library/colorbox/example5/images/loading.gif +++ b/library/colorbox/example5/images/loading.gif diff --git a/library/colorbox/example5/images/loading_background.png b/library/colorbox/example5/images/loading_background.png Binary files differindex 9de11f467..23a336b39 100644 --- a/library/colorbox/example5/images/loading_background.png +++ b/library/colorbox/example5/images/loading_background.png diff --git a/library/colorbox/example5/index.html b/library/colorbox/example5/index.html index 727fe78d7..8f10b9306 100644 --- a/library/colorbox/example5/index.html +++ b/library/colorbox/example5/index.html @@ -2,24 +2,24 @@ <html> <head> <meta charset='utf-8'/> - <title>ColorBox Examples</title> + <title>Colorbox Examples</title> <style> body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;} a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;} h2{font-size:13px; margin:15px 0 0 0;} </style> <link rel="stylesheet" href="colorbox.css" /> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../jquery.colorbox.js"></script> <script> $(document).ready(function(){ - //Examples of how to assign the ColorBox event to elements + //Examples of how to assign the Colorbox event to elements $(".group1").colorbox({rel:'group1'}); $(".group2").colorbox({rel:'group2', transition:"fade"}); $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"}); $(".group4").colorbox({rel:'group4', slideshow:true}); $(".ajax").colorbox(); - $(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344}); + $(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390}); $(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409}); $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"}); $(".inline").colorbox({inline:true, width:"50%"}); @@ -30,6 +30,9 @@ onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); }, onClosed:function(){ alert('onClosed: colorbox has completely closed'); } }); + + $('.non-retina').colorbox({rel:'group5', transition:'none'}) + $('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true}); //Example of preserving a JavaScript event for inline calls. $("#click").click(function(){ @@ -40,7 +43,7 @@ </script> </head> <body> - <h1>ColorBox Demonstration</h1> + <h1>Colorbox Demonstration</h1> <h2>Elastic Transition</h2> <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p> <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p> @@ -63,7 +66,7 @@ <h2>Other Content Types</h2> <p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p> - <p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p> + <p><a class='youtube' href="http://www.youtube.com/embed/VOJyrQa_WR4?rel=0&wmode=transparent">Flash / Video (Iframe/Direct Link To YouTube)</a></p> <p><a class='vimeo' href="http://player.vimeo.com/video/2285902" title="Röyksopp: Remind Me">Flash / Video (Iframe/Direct Link To Vimeo)</a></p> <p><a class='iframe' href="http://wikipedia.com">Outside Webpage (Iframe)</a></p> <p><a class='inline' href="#inline_content">Inline HTML</a></p> @@ -71,6 +74,11 @@ <h2>Demonstration of using callbacks</h2> <p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p> + + <h2>Retina Images</h2> + <p><a class="retina" href="../content/daisy.jpg" title="Retina">Retina</a></p> + <p><a class="non-retina" href="../content/daisy.jpg" title="Non-Retina">Non-Retina</a></p> + <!-- This contains the hidden content for inline calls --> <div style='display:none'> <div id='inline_content' style='padding:10px; background:#fff;'> @@ -78,7 +86,7 @@ <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p> <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p> - <p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p> + <p><strong>If you try to open a new Colorbox while it is already open, it will update itself with the new content.</strong></p> <p>Updating Content Example:<br /> <a class="ajax" href="../content/ajax.html">Click here to load new content</a></p> </div> diff --git a/library/colorbox/i18n/jquery.colorbox-ar.js b/library/colorbox/i18n/jquery.colorbox-ar.js new file mode 100644 index 000000000..6c4228cd1 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-ar.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Arabic (ar) + translated by: A.Rhman Sayes +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "الصورة {current} من {total}", + previous: "السابق", + next: "التالي", + close: "إغلاق", + xhrError: "حدث خطأ أثناء تحميل المحتوى.", + imgError: "حدث خطأ أثناء تحميل الصورة.", + slideshowStart: "تشغيل العرض", + slideshowStop: "إيقاف العرض" +}); diff --git a/library/colorbox/i18n/jquery.colorbox-bg.js b/library/colorbox/i18n/jquery.colorbox-bg.js new file mode 100644 index 000000000..de7e4a1d0 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-bg.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Bulgarian (bg) + translated by: Marian M.Bida + site: webmax.bg +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "изображение {current} от {total}", + previous: "предишна", + next: "следваща", + close: "затвори", + xhrError: "Неуспешно зареждане на съдържанието.", + imgError: "Неуспешно зареждане на изображението.", + slideshowStart: "пусни слайд-шоу", + slideshowStop: "спри слайд-шоу" +}); diff --git a/library/colorbox/i18n/jquery.colorbox-bn.js b/library/colorbox/i18n/jquery.colorbox-bn.js new file mode 100644 index 000000000..946229d4c --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-bn.js @@ -0,0 +1,16 @@ +/* +jQuery Colorbox language configuration +language: Bengali (bn) +translated by: Arkaprava Majumder +http://github.com/arkaindas +*/ +jQuery.extend(jQuery.colorbox.settings, { +current: "ছবি {current} এর {total}", +previous: "আগে", +next: "পরে", +close: "বন্ধ", +xhrError: "এই কন্টেন্ট লোড করা যায়নি.", +imgError: "এই ছবিটি লোড করা যায়নি.", +slideshowStart: "স্লাইডশো শুরু", +slideshowStop: "স্লাইডশো বন্ধ" +}); diff --git a/library/colorbox/i18n/jquery.colorbox-ca.js b/library/colorbox/i18n/jquery.colorbox-ca.js new file mode 100644 index 000000000..173c05fdf --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-ca.js @@ -0,0 +1,13 @@ +/* + jQuery Colorbox language configuration + language: Catala (ca) + translated by: eduard salla +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Imatge {current} de {total}", + previous: "Anterior", + next: "Següent", + close: "Tancar", + xhrError: "Error en la càrrega del contingut.", + imgError: "Error en la càrrega de la imatge." +}); diff --git a/library/colorbox/i18n/jquery.colorbox-cs.js b/library/colorbox/i18n/jquery.colorbox-cs.js index 42114c0a7..9649fd455 100644 --- a/library/colorbox/i18n/jquery.colorbox-cs.js +++ b/library/colorbox/i18n/jquery.colorbox-cs.js @@ -1,5 +1,5 @@ /* - jQuery ColorBox language configuration + jQuery Colorbox language configuration language: Czech (cs) translated by: Filip Novak site: mame.napilno.cz/filip-novak @@ -10,5 +10,7 @@ jQuery.extend(jQuery.colorbox.settings, { next: "Následující", close: "Zavřít", xhrError: "Obsah se nepodařilo načíst.", - imgError: "Obrázek se nepodařilo načíst." + imgError: "Obrázek se nepodařilo načíst.", + slideshowStart: "Spustit slideshow", + slideshowStop: "Zastavit slideshow" });
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-da.js b/library/colorbox/i18n/jquery.colorbox-da.js index 66bfb6cd0..676fffed2 100644 --- a/library/colorbox/i18n/jquery.colorbox-da.js +++ b/library/colorbox/i18n/jquery.colorbox-da.js @@ -1,5 +1,5 @@ /* - jQuery ColorBox language configuration + jQuery Colorbox language configuration language: Danish (da) translated by: danieljuhl site: danieljuhl.dk @@ -10,5 +10,7 @@ jQuery.extend(jQuery.colorbox.settings, { next: "Næste", close: "Luk", xhrError: "Indholdet fejlede i indlæsningen.", - imgError: "Billedet fejlede i indlæsningen." + imgError: "Billedet fejlede i indlæsningen.", + slideshowStart: "Start slideshow", + slideshowStop: "Stop slideshow" }); diff --git a/library/colorbox/i18n/jquery.colorbox-de.js b/library/colorbox/i18n/jquery.colorbox-de.js index 3d6e2e147..d489379bc 100644 --- a/library/colorbox/i18n/jquery.colorbox-de.js +++ b/library/colorbox/i18n/jquery.colorbox-de.js @@ -1,5 +1,5 @@ /* - jQuery ColorBox language configuration + jQuery Colorbox language configuration language: German (de) translated by: wallenium */ @@ -9,5 +9,7 @@ jQuery.extend(jQuery.colorbox.settings, { next: "Vor", close: "Schließen", xhrError: "Dieser Inhalt konnte nicht geladen werden.", - imgError: "Dieses Bild konnte nicht geladen werden." + imgError: "Dieses Bild konnte nicht geladen werden.", + slideshowStart: "Slideshow starten", + slideshowStop: "Slideshow anhalten" });
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-es.js b/library/colorbox/i18n/jquery.colorbox-es.js index 6449c66f8..11296fc94 100644 --- a/library/colorbox/i18n/jquery.colorbox-es.js +++ b/library/colorbox/i18n/jquery.colorbox-es.js @@ -1,5 +1,5 @@ /* - jQuery ColorBox language configuration + jQuery Colorbox language configuration language: Spanish (es) translated by: migolo */ diff --git a/library/colorbox/i18n/jquery.colorbox-et.js b/library/colorbox/i18n/jquery.colorbox-et.js new file mode 100644 index 000000000..60a4e888e --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-et.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Estonian (et) + translated by: keevitaja +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{current}/{total}", + previous: "eelmine", + next: "järgmine", + close: "sulge", + xhrError: "Sisu ei õnnestunud laadida.", + imgError: "Pilti ei õnnestunud laadida.", + slideshowStart: "Käivita slaidid", + slideshowStop: "Peata slaidid" +});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-fa.js b/library/colorbox/i18n/jquery.colorbox-fa.js new file mode 100644 index 000000000..32869a4c8 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-fa.js @@ -0,0 +1,18 @@ +/*
+ jQuery Colorbox language configuration
+ language: Persian (Farsi)
+ translated by: Mahdi Jaberzadeh Ansari (MJZSoft)
+ site: www.mjzsoft.ir
+ email: mahdijaberzadehansari (at) yahoo.co.uk
+ Please note : Persian language is right to left like arabic.
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "تصویر {current} از {total}",
+ previous: "قبلی",
+ next: "بعدی",
+ close: "بستن",
+ xhrError: "متاسفانه محتویات مورد نظر قابل نمایش نیست.",
+ imgError: "متاسفانه بارگذاری این عکس با مشکل مواجه شده است.",
+ slideshowStart: "آغاز نمایش خودکار",
+ slideshowStop: "توقف نمایش خودکار"
+});
diff --git a/library/colorbox/i18n/jquery.colorbox-fi.js b/library/colorbox/i18n/jquery.colorbox-fi.js new file mode 100644 index 000000000..ac03fe021 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-fi.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Finnish (fi) + translated by: Mikko +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Kuva {current} / {total}", + previous: "Edellinen", + next: "Seuraava", + close: "Sulje", + xhrError: "Sisällön lataaminen epäonnistui.", + imgError: "Kuvan lataaminen epäonnistui.", + slideshowStart: "Aloita kuvaesitys.", + slideshowStop: "Lopeta kuvaesitys." +}); diff --git a/library/colorbox/i18n/jquery.colorbox-fr.js b/library/colorbox/i18n/jquery.colorbox-fr.js index f6afe3fd4..f76352bd4 100644 --- a/library/colorbox/i18n/jquery.colorbox-fr.js +++ b/library/colorbox/i18n/jquery.colorbox-fr.js @@ -1,14 +1,15 @@ /* - jQuery ColorBox language configuration + jQuery Colorbox language configuration language: French (fr) translated by: oaubert */ jQuery.extend(jQuery.colorbox.settings, { -current: "image {current} sur {total}", -previous: "précédente", -next: "suivante", -close: "fermer", -xhrError: "Impossible de charger ce contenu.", -imgError: "Impossible de charger cette image." + current: "image {current} sur {total}", + previous: "précédente", + next: "suivante", + close: "fermer", + xhrError: "Impossible de charger ce contenu.", + imgError: "Impossible de charger cette image.", + slideshowStart: "démarrer la présentation", + slideshowStop: "arrêter la présentation" }); - diff --git a/library/colorbox/i18n/jquery.colorbox-gl.js b/library/colorbox/i18n/jquery.colorbox-gl.js new file mode 100644 index 000000000..3641b51b1 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-gl.js @@ -0,0 +1,13 @@ +/* + jQuery Colorbox language configuration + language: Galician (gl) + translated by: donatorouco +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Imaxe {current} de {total}", + previous: "Anterior", + next: "Seguinte", + close: "Pechar", + xhrError: "Erro na carga do contido.", + imgError: "Erro na carga da imaxe." +}); diff --git a/library/colorbox/i18n/jquery.colorbox-gr.js b/library/colorbox/i18n/jquery.colorbox-gr.js new file mode 100644 index 000000000..0d2c1bb76 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-gr.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Greek (gr) + translated by: S.Demirtzoglou + site: webiq.gr +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Εικόνα {current} από {total}", + previous: "Προηγούμενη", + next: "Επόμενη", + close: "Απόκρυψη", + xhrError: "Το περιεχόμενο δεν μπόρεσε να φορτωθεί.", + imgError: "Απέτυχε η φόρτωση της εικόνας.", + slideshowStart: "Έναρξη παρουσίασης", + slideshowStop: "Παύση παρουσίασης" +}); diff --git a/library/colorbox/i18n/jquery.colorbox-he.js b/library/colorbox/i18n/jquery.colorbox-he.js new file mode 100644 index 000000000..78908e39f --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-he.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Hebrew (he) + translated by: DavidCo + site: DavidCo.me +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "תמונה {current} מתוך {total}", + previous: "הקודם", + next: "הבא", + close: "סגור", + xhrError: "שגיאה בטעינת התוכן.", + imgError: "שגיאה בטעינת התמונה.", + slideshowStart: "התחל מצגת", + slideshowStop: "עצור מצגת" +}); diff --git a/library/colorbox/i18n/jquery.colorbox-hr.js b/library/colorbox/i18n/jquery.colorbox-hr.js new file mode 100644 index 000000000..7eb62becd --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-hr.js @@ -0,0 +1,15 @@ +/*
+ jQuery Colorbox language configuration
+ language: Croatian (hr)
+ translated by: Mladen Bicanic (base.hr)
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "Slika {current} od {total}",
+ previous: "Prethodna",
+ next: "Sljedeća",
+ close: "Zatvori",
+ xhrError: "Neuspješno učitavanje sadržaja.",
+ imgError: "Neuspješno učitavanje slike.",
+ slideshowStart: "Pokreni slideshow",
+ slideshowStop: "Zaustavi slideshow"
+});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-hu.js b/library/colorbox/i18n/jquery.colorbox-hu.js new file mode 100644 index 000000000..72e9d36b1 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-hu.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Hungarian (hu) + translated by: kovadani +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{current}/{total} kép", + previous: "Előző", + next: "Következő", + close: "Bezár", + xhrError: "A tartalmat nem sikerült betölteni.", + imgError: "A képet nem sikerült betölteni.", + slideshowStart: "Diavetítés indítása", + slideshowStop: "Diavetítés leállítása" +});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-id.js b/library/colorbox/i18n/jquery.colorbox-id.js new file mode 100644 index 000000000..81a62df34 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-id.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Indonesian (id) + translated by: sarwasunda +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "ke {current} dari {total}", + previous: "Sebelumnya", + next: "Berikutnya", + close: "Tutup", + xhrError: "Konten ini tidak dapat dimuat.", + imgError: "Gambar ini tidak dapat dimuat.", + slideshowStart: "Putar", + slideshowStop: "Berhenti" +}); diff --git a/library/colorbox/i18n/jquery.colorbox-it.js b/library/colorbox/i18n/jquery.colorbox-it.js index d67d76cf7..2a4af6453 100644 --- a/library/colorbox/i18n/jquery.colorbox-it.js +++ b/library/colorbox/i18n/jquery.colorbox-it.js @@ -1,5 +1,5 @@ /* - jQuery ColorBox language configuration + jQuery Colorbox language configuration language: Italian (it) translated by: maur8ino */ @@ -9,5 +9,7 @@ jQuery.extend(jQuery.colorbox.settings, { next: "Successiva", close: "Chiudi", xhrError: "Errore nel caricamento del contenuto.", - imgError: "Errore nel caricamento dell'immagine." + imgError: "Errore nel caricamento dell'immagine.", + slideshowStart: "Inizia la presentazione", + slideshowStop: "Termina la presentazione" }); diff --git a/library/colorbox/i18n/jquery.colorbox-ja.js b/library/colorbox/i18n/jquery.colorbox-ja.js new file mode 100644 index 000000000..5480de336 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-ja.js @@ -0,0 +1,15 @@ +/*
+ jQuery Colorbox language configuration
+ language: Japanaese (ja)
+ translated by: Hajime Fujimoto
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "{total}枚中{current}枚目",
+ previous: "前",
+ next: "次",
+ close: "閉じる",
+ xhrError: "コンテンツの読み込みに失敗しました",
+ imgError: "画像の読み込みに失敗しました",
+ slideshowStart: "スライドショー開始",
+ slideshowStop: "スライドショー終了"
+});
diff --git a/library/colorbox/i18n/jquery.colorbox-kr.js b/library/colorbox/i18n/jquery.colorbox-kr.js new file mode 100644 index 000000000..b95702bc0 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-kr.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Korean (kr) + translated by: lunareffect +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "총 {total} 중 {current}", + previous: "이전", + next: "다음", + close: "닫기", + xhrError: "컨텐츠를 불러오는 데 실패했습니다.", + imgError: "이미지를 불러오는 데 실패했습니다.", + slideshowStart: "슬라이드쇼 시작", + slideshowStop: "슬라이드쇼 중지" +}); diff --git a/library/colorbox/i18n/jquery.colorbox-lt.js b/library/colorbox/i18n/jquery.colorbox-lt.js new file mode 100644 index 000000000..a513fcf62 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-lt.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Lithuanian (lt) + translated by: Tomas Norkūnas +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Nuotrauka {current} iš {total}", + previous: "Atgal", + next: "Pirmyn", + close: "Uždaryti", + xhrError: "Nepavyko užkrauti turinio.", + imgError: "Nepavyko užkrauti nuotraukos.", + slideshowStart: "Pradėti automatinę peržiūrą", + slideshowStop: "Sustabdyti automatinę peržiūrą" +});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-lv.js b/library/colorbox/i18n/jquery.colorbox-lv.js new file mode 100644 index 000000000..e376366b9 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-lv.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Latvian (lv) + translated by: Matiss Roberts Treinis + site: x0.lv +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "attēls {current} no {total}", + previous: "iepriekšējais", + next: "nākamais", + close: "aizvērt", + xhrError: "Neizdevās ielādēt saturu.", + imgError: "Neizdevās ielādēt attēlu.", + slideshowStart: "sākt slaidrādi", + slideshowStop: "apturēt slaidrādi" +}); diff --git a/library/colorbox/i18n/jquery.colorbox-my.js b/library/colorbox/i18n/jquery.colorbox-my.js new file mode 100644 index 000000000..216e252cc --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-my.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Myanmar (my) + translated by: Yan Naing +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "ပုံ {total} မှာ {current} မြောက်ပုံ", + previous: "ရှေ့သို့", + next: "နောက်သို့", + close: "ပိတ်မည်", + xhrError: "ပါဝင်သော အကြောင်းအရာများ ဖော်ပြရာတွင် အနည်းငယ် ချို့ယွင်းမှုရှိနေပါသည်", + imgError: "ပုံပြသရာတွင် အနည်းငယ် ချို့ယွင်းချက် ရှိနေပါသည်", + slideshowStart: "ပုံများ စတင်ပြသမည်", + slideshowStop: "ပုံပြသခြင်း ရပ်ဆိုင်မည်" +}); diff --git a/library/colorbox/i18n/jquery.colorbox-nl.js b/library/colorbox/i18n/jquery.colorbox-nl.js new file mode 100644 index 000000000..dfc658ec9 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-nl.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Dutch (nl) + translated by: barryvdh +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Afbeelding {current} van {total}", + previous: "Vorige", + next: "Volgende", + close: "Sluiten", + xhrError: "Deze inhoud kan niet geladen worden.", + imgError: "Deze afbeelding kan niet geladen worden.", + slideshowStart: "Diashow starten", + slideshowStop: "Diashow stoppen" +});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-no.js b/library/colorbox/i18n/jquery.colorbox-no.js new file mode 100644 index 000000000..277c5d3f9 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-no.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Norwegian (no) + translated by: lars-erik + site: markedspartner.no +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Bilde {current} av {total}", + previous: "Forrige", + next: "Neste", + close: "Lukk", + xhrError: "Feil ved lasting av innhold.", + imgError: "Feil ved lasting av bilde.", + slideshowStart: "Start lysbildefremvisning", + slideshowStop: "Stopp lysbildefremvisning" +}); diff --git a/library/colorbox/i18n/jquery.colorbox-pl.js b/library/colorbox/i18n/jquery.colorbox-pl.js new file mode 100644 index 000000000..1c04dae18 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-pl.js @@ -0,0 +1,16 @@ +/*
+ jQuery Colorbox language configuration
+ language: Polski (pl)
+ translated by: Tomasz Wasiński
+ site: 2bevisible.pl
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "{current}. obrazek z {total}",
+ previous: "Poprzedni",
+ next: "Następny",
+ close: "Zamknij",
+ xhrError: "Nie udało się załadować treści.",
+ imgError: "Nie udało się załadować obrazka.",
+ slideshowStart: "rozpocznij pokaz slajdów",
+ slideshowStop: "zatrzymaj pokaz slajdów"
+});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-pt-BR.js b/library/colorbox/i18n/jquery.colorbox-pt-BR.js new file mode 100644 index 000000000..a405d93df --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-pt-BR.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Brazilian Portuguese (pt-BR) + translated by: ReinaldoMT +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Imagem {current} de {total}", + previous: "Anterior", + next: "Próxima", + close: "Fechar", + slideshowStart: "iniciar apresentação de slides", + slideshowStop: "parar apresentação de slides", + xhrError: "Erro ao carregar o conteúdo.", + imgError: "Erro ao carregar a imagem." +});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-ro.js b/library/colorbox/i18n/jquery.colorbox-ro.js new file mode 100644 index 000000000..0a461e28a --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-ro.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Romanian (ro) + translated by: shurub3l +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "imagine {current} din {total}", + previous: "precedenta", + next: "următoarea", + close: "închideți", + xhrError: "Acest conținut nu poate fi încărcat.", + imgError: "Această imagine nu poate fi încărcată", + slideshowStart: "începeți prezentarea (slideshow)", + slideshowStop: "opriți prezentarea (slideshow)" +});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-ru.js b/library/colorbox/i18n/jquery.colorbox-ru.js index c9c220068..1d88b8cda 100644 --- a/library/colorbox/i18n/jquery.colorbox-ru.js +++ b/library/colorbox/i18n/jquery.colorbox-ru.js @@ -1,14 +1,16 @@ /*
- jQuery ColorBox language configuration
+ jQuery Colorbox language configuration
language: Russian (ru)
translated by: Marfa
- site: themarfa.name
+ site: themarfa.name
*/
jQuery.extend(jQuery.colorbox.settings, {
current: "изображение {current} из {total}",
- previous: "предыдущее",
- next: "следующее",
+ previous: "назад",
+ next: "вперёд",
close: "закрыть",
xhrError: "Не удалось загрузить содержимое.",
- imgError: "Не удалось загрузить изображение."
+ imgError: "Не удалось загрузить изображение.",
+ slideshowStart: "начать слайд-шоу",
+ slideshowStop: "остановить слайд-шоу"
});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-si.js b/library/colorbox/i18n/jquery.colorbox-si.js new file mode 100644 index 000000000..034b5b3c4 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-si.js @@ -0,0 +1,15 @@ +/*
+ jQuery Colorbox language configuration
+ language: Slovenian (si)
+ translated by: Boštjan Pišler (pisler.si)
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "Slika {current} od {total}",
+ previous: "Prejšnja",
+ next: "Naslednja",
+ close: "Zapri",
+ xhrError: "Vsebine ni bilo mogoče naložiti.",
+ imgError: "Slike ni bilo mogoče naložiti.",
+ slideshowStart: "Zaženi prezentacijo",
+ slideshowStop: "Zaustavi prezentacijo"
+});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-sk.js b/library/colorbox/i18n/jquery.colorbox-sk.js new file mode 100644 index 000000000..faa9291cb --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-sk.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Slovak (sk) + translated by: Jaroslav Kostal +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{current}. obrázok z {total}", + previous: "Predchádzajúci", + next: "Následujúci", + close: "Zatvoriť", + xhrError: "Obsah sa nepodarilo načítať.", + imgError: "Obrázok sa nepodarilo načítať.", + slideshowStart: "Spustiť slideshow", + slideshowStop: "zastaviť slideshow" +});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-sr.js b/library/colorbox/i18n/jquery.colorbox-sr.js new file mode 100644 index 000000000..618e73c4a --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-sr.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Serbian (sr) + translated by: Sasa Stefanovic (baguje.com) +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Slika {current} od {total}", + previous: "Prethodna", + next: "Sledeća", + close: "Zatvori", + xhrError: "Neuspešno učitavanje sadržaja.", + imgError: "Neuspešno učitavanje slike.", + slideshowStart: "Pokreni slideshow", + slideshowStop: "Zaustavi slideshow" +}); diff --git a/library/colorbox/i18n/jquery.colorbox-sv.js b/library/colorbox/i18n/jquery.colorbox-sv.js new file mode 100644 index 000000000..01bb1d8c6 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-sv.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Swedish (sv) + translated by: Mattias Reichel +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Bild {current} av {total}", + previous: "Föregående", + next: "Nästa", + close: "Stäng", + xhrError: "Innehållet kunde inte laddas.", + imgError: "Den här bilden kunde inte laddas.", + slideshowStart: "Starta bildspel", + slideshowStop: "Stoppa bildspel" +});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-tr.js b/library/colorbox/i18n/jquery.colorbox-tr.js new file mode 100644 index 000000000..d467c2ef1 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-tr.js @@ -0,0 +1,19 @@ +/* + jQuery Colorbox language configuration + language: Turkish (tr) + translated by: Caner ÖNCEL + site: egonomik.com + + edited by: Sinan Eldem + www.sinaneldem.com.tr +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Görsel {current} / {total}", + previous: "Önceki", + next: "Sonraki", + close: "Kapat", + xhrError: "İçerik yüklenirken hata meydana geldi.", + imgError: "Resim yüklenirken hata meydana geldi.", + slideshowStart: "Slaytı Başlat", + slideshowStop: "Slaytı Durdur" +}); diff --git a/library/colorbox/i18n/jquery.colorbox-uk.js b/library/colorbox/i18n/jquery.colorbox-uk.js new file mode 100644 index 000000000..3f786d3f4 --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-uk.js @@ -0,0 +1,16 @@ +/* + jQuery ColorBox language configuration + language: Ukrainian (uk) + translated by: Andrew + http://acisoftware.com.ua +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "зображення {current} з {total}", + previous: "попереднє", + next: "наступне", + close: "закрити", + xhrError: "Не вдалося завантажити вміст.", + imgError: "Не вдалося завантажити зображення.", + slideshowStart: "почати слайд-шоу", + slideshowStop: "зупинити слайд-шоу" +});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-zh-CN.js b/library/colorbox/i18n/jquery.colorbox-zh-CN.js new file mode 100644 index 000000000..770d8eacf --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-zh-CN.js @@ -0,0 +1,15 @@ +/*
+ jQuery Colorbox language configuration
+ language: Chinese Simplified (zh-CN)
+ translated by: zhao weiming
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "当前图像 {current} 总共 {total}",
+ previous: "前一页",
+ next: "后一页",
+ close: "关闭",
+ xhrError: "此内容无法加载",
+ imgError: "此图片无法加载",
+ slideshowStart: "开始播放幻灯片",
+ slideshowStop: "停止播放幻灯片"
+});
\ No newline at end of file diff --git a/library/colorbox/i18n/jquery.colorbox-zh-TW.js b/library/colorbox/i18n/jquery.colorbox-zh-TW.js new file mode 100644 index 000000000..b0c4f123d --- /dev/null +++ b/library/colorbox/i18n/jquery.colorbox-zh-TW.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Chinese Traditional (zh-TW) + translated by: Atans Chiu +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "圖片 {current} 總共 {total}", + previous: "上一頁", + next: "下一頁", + close: "關閉", + xhrError: "此內容加載失敗.", + imgError: "此圖片加載失敗.", + slideshowStart: "開始幻燈片", + slideshowStop: "結束幻燈片" +});
\ No newline at end of file diff --git a/library/colorbox/images/border.png b/library/colorbox/images/border.png Binary files differdeleted file mode 100644 index df13bb6da..000000000 --- a/library/colorbox/images/border.png +++ /dev/null diff --git a/library/colorbox/images/controls.png b/library/colorbox/images/controls.png Binary files differdeleted file mode 100644 index 65cfd1dc9..000000000 --- a/library/colorbox/images/controls.png +++ /dev/null diff --git a/library/colorbox/images/loading.gif b/library/colorbox/images/loading.gif Binary files differdeleted file mode 100644 index b4695d811..000000000 --- a/library/colorbox/images/loading.gif +++ /dev/null diff --git a/library/colorbox/images/loading_background.png b/library/colorbox/images/loading_background.png Binary files differdeleted file mode 100644 index 9de11f467..000000000 --- a/library/colorbox/images/loading_background.png +++ /dev/null diff --git a/library/colorbox/jquery.colorbox-min.js b/library/colorbox/jquery.colorbox-min.js index 969064042..c0cbe5cb7 100644 --- a/library/colorbox/jquery.colorbox-min.js +++ b/library/colorbox/jquery.colorbox-min.js @@ -1 +1,6 @@ -(function($,document,window){var defaults={transition:"elastic",speed:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,inline:false,html:false,iframe:false,fastIframe:true,photo:false,href:false,title:false,rel:false,opacity:.9,preloading:true,className:false,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:false,returnFocus:true,reposition:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,overlayClose:true,escKey:true,arrowKey:true,top:false,bottom:false,left:false,right:false,fixed:false,data:undefined},colorbox="colorbox",prefix="cbox",boxElement=prefix+"Element",event_open=prefix+"_open",event_load=prefix+"_load",event_complete=prefix+"_complete",event_cleanup=prefix+"_cleanup",event_closed=prefix+"_closed",event_purge=prefix+"_purge",isIE=!$.support.leadingWhitespace,isIE6=isIE&&!window.XMLHttpRequest,event_ie6=prefix+"_IE6",$overlay,$box,$wrap,$content,$topBorder,$leftBorder,$rightBorder,$bottomBorder,$related,$window,$loaded,$loadingBay,$loadingOverlay,$title,$current,$slideshow,$next,$prev,$close,$groupControls,$events=$({}),settings,interfaceHeight,interfaceWidth,loadedHeight,loadedWidth,element,index,photo,open,active,closing,loadingTimer,publicMethod,div="div",className,init;function $tag(tag,id,css){var element=document.createElement(tag);if(id){element.id=prefix+id}if(css){element.style.cssText=css}return $(element)}function getIndex(increment){var max=$related.length,newIndex=(index+increment)%max;return newIndex<0?max+newIndex:newIndex}function setSize(size,dimension){return Math.round((/%/.test(size)?(dimension==="x"?$window.width():$window.height())/100:1)*parseInt(size,10))}function isImage(url){return settings.photo||/\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i.test(url)}function makeSettings(){var i,data=$.data(element,colorbox);if(data==null){settings=$.extend({},defaults);if(console&&console.log){console.log("Error: cboxElement missing settings object")}}else{settings=$.extend({},data)}for(i in settings){if($.isFunction(settings[i])&&i.slice(0,2)!=="on"){settings[i]=settings[i].call(element)}}settings.rel=settings.rel||element.rel||$(element).data("rel")||"nofollow";settings.href=settings.href||$(element).attr("href");settings.title=settings.title||element.title;if(typeof settings.href==="string"){settings.href=$.trim(settings.href)}}function trigger(event,callback){$(document).trigger(event);$events.trigger(event);if($.isFunction(callback)){callback.call(element)}}function slideshow(){var timeOut,className=prefix+"Slideshow_",click="click."+prefix,clear,set,start,stop;if(settings.slideshow&&$related[1]){clear=function(){clearTimeout(timeOut)};set=function(){if(settings.loop||$related[index+1]){timeOut=setTimeout(publicMethod.next,settings.slideshowSpeed)}};start=function(){$slideshow.html(settings.slideshowStop).unbind(click).one(click,stop);$events.bind(event_complete,set).bind(event_load,clear).bind(event_cleanup,stop);$box.removeClass(className+"off").addClass(className+"on")};stop=function(){clear();$events.unbind(event_complete,set).unbind(event_load,clear).unbind(event_cleanup,stop);$slideshow.html(settings.slideshowStart).unbind(click).one(click,function(){publicMethod.next();start()});$box.removeClass(className+"on").addClass(className+"off")};if(settings.slideshowAuto){start()}else{stop()}}else{$box.removeClass(className+"off "+className+"on")}}function launch(target){if(!closing){element=target;makeSettings();$related=$(element);index=0;if(settings.rel!=="nofollow"){$related=$("."+boxElement).filter(function(){var data=$.data(this,colorbox),relRelated;if(data){relRelated=$(this).data("rel")||data.rel||this.rel}return relRelated===settings.rel});index=$related.index(element);if(index===-1){$related=$related.add(element);index=$related.length-1}}if(!open){open=active=true;$box.css({visibility:"hidden",display:"block"});$loaded=$tag(div,"LoadedContent","width:0; height:0; overflow:hidden").appendTo($content);interfaceHeight=$topBorder.height()+$bottomBorder.height()+$content.outerHeight(true)-$content.height();interfaceWidth=$leftBorder.width()+$rightBorder.width()+$content.outerWidth(true)-$content.width();loadedHeight=$loaded.outerHeight(true);loadedWidth=$loaded.outerWidth(true);if(settings.returnFocus){$(element).blur();$events.one(event_closed,function(){$(element).focus()})}$overlay.css({opacity:parseFloat(settings.opacity),cursor:settings.overlayClose?"pointer":"auto",visibility:"visible"}).show();settings.w=setSize(settings.initialWidth,"x");settings.h=setSize(settings.initialHeight,"y");publicMethod.position();if(isIE6){$window.bind("resize."+event_ie6+" scroll."+event_ie6,function(){$overlay.css({width:$window.width(),height:$window.height(),top:$window.scrollTop(),left:$window.scrollLeft()})}).trigger("resize."+event_ie6)}slideshow();trigger(event_open,settings.onOpen);$groupControls.add($title).hide();$close.html(settings.close).show()}publicMethod.load(true)}}function appendHTML(){if(!$box&&document.body){init=false;$window=$(window);$box=$tag(div).attr({id:colorbox,"class":isIE?prefix+(isIE6?"IE6":"IE"):""}).hide();$overlay=$tag(div,"Overlay",isIE6?"position:absolute":"").hide();$loadingOverlay=$tag(div,"LoadingOverlay").add($tag(div,"LoadingGraphic"));$wrap=$tag(div,"Wrapper");$content=$tag(div,"Content").append($title=$tag(div,"Title"),$current=$tag(div,"Current"),$next=$tag(div,"Next"),$prev=$tag(div,"Previous"),$slideshow=$tag(div,"Slideshow"),$close=$tag(div,"Close"));$wrap.append($tag(div).append($tag(div,"TopLeft"),$topBorder=$tag(div,"TopCenter"),$tag(div,"TopRight")),$tag(div,false,"clear:left").append($leftBorder=$tag(div,"MiddleLeft"),$content,$rightBorder=$tag(div,"MiddleRight")),$tag(div,false,"clear:left").append($tag(div,"BottomLeft"),$bottomBorder=$tag(div,"BottomCenter"),$tag(div,"BottomRight"))).find("div div").css({"float":"left"});$loadingBay=$tag(div,false,"position:absolute; width:9999px; visibility:hidden; display:none");$groupControls=$next.add($prev).add($current).add($slideshow);$(document.body).append($overlay,$box.append($wrap,$loadingBay))}}function addBindings(){function clickHandler(e){if(!(e.which>1||e.shiftKey||e.altKey||e.metaKey)){e.preventDefault();launch(this)}}if($box){if(!init){init=true;$next.click(function(){publicMethod.next()});$prev.click(function(){publicMethod.prev()});$close.click(function(){publicMethod.close()});$overlay.click(function(){if(settings.overlayClose){publicMethod.close()}});$(document).bind("keydown."+prefix,function(e){var key=e.keyCode;if(open&&settings.escKey&&key===27){e.preventDefault();publicMethod.close()}if(open&&settings.arrowKey&&$related[1]){if(key===37){e.preventDefault();$prev.click()}else if(key===39){e.preventDefault();$next.click()}}});if($.isFunction($.fn.on)){$(document).on("click."+prefix,"."+boxElement,clickHandler)}else{$("."+boxElement).live("click."+prefix,clickHandler)}}return true}return false}if($.colorbox){return}$(appendHTML);publicMethod=$.fn[colorbox]=$[colorbox]=function(options,callback){var $this=this;options=options||{};appendHTML();if(addBindings()){if($.isFunction($this)){$this=$("<a/>");options.open=true}else if(!$this[0]){return $this}if(callback){options.onComplete=callback}$this.each(function(){$.data(this,colorbox,$.extend({},$.data(this,colorbox)||defaults,options))}).addClass(boxElement);if($.isFunction(options.open)&&options.open.call($this)||options.open){launch($this[0])}}return $this};publicMethod.position=function(speed,loadedCallback){var css,top=0,left=0,offset=$box.offset(),scrollTop,scrollLeft;$window.unbind("resize."+prefix);$box.css({top:-9e4,left:-9e4});scrollTop=$window.scrollTop();scrollLeft=$window.scrollLeft();if(settings.fixed&&!isIE6){offset.top-=scrollTop;offset.left-=scrollLeft;$box.css({position:"fixed"})}else{top=scrollTop;left=scrollLeft;$box.css({position:"absolute"})}if(settings.right!==false){left+=Math.max($window.width()-settings.w-loadedWidth-interfaceWidth-setSize(settings.right,"x"),0)}else if(settings.left!==false){left+=setSize(settings.left,"x")}else{left+=Math.round(Math.max($window.width()-settings.w-loadedWidth-interfaceWidth,0)/2)}if(settings.bottom!==false){top+=Math.max($window.height()-settings.h-loadedHeight-interfaceHeight-setSize(settings.bottom,"y"),0)}else if(settings.top!==false){top+=setSize(settings.top,"y")}else{top+=Math.round(Math.max($window.height()-settings.h-loadedHeight-interfaceHeight,0)/2)}$box.css({top:offset.top,left:offset.left,visibility:"visible"});speed=$box.width()===settings.w+loadedWidth&&$box.height()===settings.h+loadedHeight?0:speed||0;$wrap[0].style.width=$wrap[0].style.height="9999px";function modalDimensions(that){$topBorder[0].style.width=$bottomBorder[0].style.width=$content[0].style.width=parseInt(that.style.width,10)-interfaceWidth+"px";$content[0].style.height=$leftBorder[0].style.height=$rightBorder[0].style.height=parseInt(that.style.height,10)-interfaceHeight+"px"}css={width:settings.w+loadedWidth+interfaceWidth,height:settings.h+loadedHeight+interfaceHeight,top:top,left:left};if(speed===0){$box.css(css)}$box.dequeue().animate(css,{duration:speed,complete:function(){modalDimensions(this);active=false;$wrap[0].style.width=settings.w+loadedWidth+interfaceWidth+"px";$wrap[0].style.height=settings.h+loadedHeight+interfaceHeight+"px";if(settings.reposition){setTimeout(function(){$window.bind("resize."+prefix,publicMethod.position)},1)}if(loadedCallback){loadedCallback()}},step:function(){modalDimensions(this)}})};publicMethod.resize=function(options){if(open){options=options||{};if(options.width){settings.w=setSize(options.width,"x")-loadedWidth-interfaceWidth}if(options.innerWidth){settings.w=setSize(options.innerWidth,"x")}$loaded.css({width:settings.w});if(options.height){settings.h=setSize(options.height,"y")-loadedHeight-interfaceHeight}if(options.innerHeight){settings.h=setSize(options.innerHeight,"y")}if(!options.innerHeight&&!options.height){$loaded.css({height:"auto"});settings.h=$loaded.height()}$loaded.css({height:settings.h});publicMethod.position(settings.transition==="none"?0:settings.speed)}};publicMethod.prep=function(object){if(!open){return}var callback,speed=settings.transition==="none"?0:settings.speed;$loaded.empty().remove();$loaded=$tag(div,"LoadedContent").append(object);function getWidth(){settings.w=settings.w||$loaded.width();settings.w=settings.mw&&settings.mw<settings.w?settings.mw:settings.w;return settings.w}function getHeight(){settings.h=settings.h||$loaded.height();settings.h=settings.mh&&settings.mh<settings.h?settings.mh:settings.h;return settings.h}$loaded.hide().appendTo($loadingBay.show()).css({width:getWidth(),overflow:settings.scrolling?"auto":"hidden"}).css({height:getHeight()}).prependTo($content);$loadingBay.hide();$(photo).css({"float":"none"});callback=function(){var total=$related.length,iframe,frameBorder="frameBorder",allowTransparency="allowTransparency",complete;if(!open){return}function removeFilter(){if(isIE){$box[0].style.removeAttribute("filter")}}complete=function(){clearTimeout(loadingTimer);$loadingOverlay.remove();trigger(event_complete,settings.onComplete)};if(isIE){if(photo){$loaded.fadeIn(100)}}$title.html(settings.title).add($loaded).show();if(total>1){if(typeof settings.current==="string"){$current.html(settings.current.replace("{current}",index+1).replace("{total}",total)).show()}$next[settings.loop||index<total-1?"show":"hide"]().html(settings.next);$prev[settings.loop||index?"show":"hide"]().html(settings.previous);if(settings.slideshow){$slideshow.show()}if(settings.preloading){$.each([getIndex(-1),getIndex(1)],function(){var src,img,i=$related[this],data=$.data(i,colorbox);if(data&&data.href){src=data.href;if($.isFunction(src)){src=src.call(i)}}else{src=$(i).attr("href")}if(src&&(isImage(src)||data.photo)){img=new Image;img.src=src}})}}else{$groupControls.hide()}if(settings.iframe){iframe=$tag("iframe")[0];if(frameBorder in iframe){iframe[frameBorder]=0}if(allowTransparency in iframe){iframe[allowTransparency]="true"}if(!settings.scrolling){iframe.scrolling="no"}$(iframe).attr({src:settings.href,name:(new Date).getTime(),"class":prefix+"Iframe",allowFullScreen:true,webkitAllowFullScreen:true,mozallowfullscreen:true}).one("load",complete).appendTo($loaded);$events.one(event_purge,function(){iframe.src="//about:blank"});if(settings.fastIframe){$(iframe).trigger("load")}}else{complete()}if(settings.transition==="fade"){$box.fadeTo(speed,1,removeFilter)}else{removeFilter()}};if(settings.transition==="fade"){$box.fadeTo(speed,0,function(){publicMethod.position(0,callback)})}else{publicMethod.position(speed,callback)}};publicMethod.load=function(launched){var href,setResize,prep=publicMethod.prep,$inline;active=true;photo=false;element=$related[index];if(!launched){makeSettings()}if(className){$box.add($overlay).removeClass(className)}if(settings.className){$box.add($overlay).addClass(settings.className)}className=settings.className;trigger(event_purge);trigger(event_load,settings.onLoad);settings.h=settings.height?setSize(settings.height,"y")-loadedHeight-interfaceHeight:settings.innerHeight&&setSize(settings.innerHeight,"y");settings.w=settings.width?setSize(settings.width,"x")-loadedWidth-interfaceWidth:settings.innerWidth&&setSize(settings.innerWidth,"x");settings.mw=settings.w;settings.mh=settings.h;if(settings.maxWidth){settings.mw=setSize(settings.maxWidth,"x")-loadedWidth-interfaceWidth;settings.mw=settings.w&&settings.w<settings.mw?settings.w:settings.mw}if(settings.maxHeight){settings.mh=setSize(settings.maxHeight,"y")-loadedHeight-interfaceHeight;settings.mh=settings.h&&settings.h<settings.mh?settings.h:settings.mh}href=settings.href;loadingTimer=setTimeout(function(){$loadingOverlay.appendTo($content)},100);if(settings.inline){$inline=$tag(div).hide().insertBefore($(href)[0]);$events.one(event_purge,function(){$inline.replaceWith($loaded.children())});prep($(href))}else if(settings.iframe){prep(" ")}else if(settings.html){prep(settings.html)}else if(isImage(href)){$(photo=new Image).addClass(prefix+"Photo").bind("error",function(){settings.title=false;prep($tag(div,"Error").html(settings.imgError))}).one("load",function(){var percent;if(settings.scalePhotos){setResize=function(){photo.height-=photo.height*percent;photo.width-=photo.width*percent};if(settings.mw&&photo.width>settings.mw){percent=(photo.width-settings.mw)/photo.width;setResize()}if(settings.mh&&photo.height>settings.mh){percent=(photo.height-settings.mh)/photo.height;setResize()}}if(settings.h){photo.style.marginTop=Math.max(settings.mh-photo.height,0)/2+"px"}if($related[1]&&(settings.loop||$related[index+1])){photo.style.cursor="pointer";photo.onclick=function(){publicMethod.next()}}if(isIE){photo.style.msInterpolationMode="bicubic"}setTimeout(function(){prep(photo)},1)});setTimeout(function(){photo.src=href},1)}else if(href){$loadingBay.load(href,settings.data,function(data,status){prep(status==="error"?$tag(div,"Error").html(settings.xhrError):$(this).contents())})}};publicMethod.next=function(){if(!active&&$related[1]&&(settings.loop||$related[index+1])){index=getIndex(1);publicMethod.load()}};publicMethod.prev=function(){if(!active&&$related[1]&&(settings.loop||index)){index=getIndex(-1);publicMethod.load()}};publicMethod.close=function(){if(open&&!closing){closing=true;open=false;trigger(event_cleanup,settings.onCleanup);$window.unbind("."+prefix+" ."+event_ie6);$overlay.fadeTo(200,0);$box.stop().fadeTo(300,0,function(){$box.add($overlay).css({opacity:1,cursor:"auto"}).hide();trigger(event_purge);$loaded.empty().remove();setTimeout(function(){closing=false;trigger(event_closed,settings.onClosed)},1)})}};publicMethod.remove=function(){$([]).add($box).add($overlay).remove();$box=null;$("."+boxElement).removeData(colorbox).removeClass(boxElement);$(document).unbind("click."+prefix)};publicMethod.element=function(){return $(element)};publicMethod.settings=defaults})(jQuery,document,window);
\ No newline at end of file +/*! + Colorbox 1.5.14 + license: MIT + http://www.jacklmoore.com/colorbox +*/ +(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(z+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in y[0]&&!y[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),y.focus())}function c(t){c.str!==t&&(y.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){z=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),z=W.index(_.el),-1===z&&(W=W.add(_.el),z=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!$){$=q=!0,c(_.get("className")),y.css({visibility:"hidden",display:"block",opacity:""}),L=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(L),D=T.height()+k.height()+b.outerHeight(!0)-b.height(),j=C.width()+H.width()+b.outerWidth(!0)-b.width(),A=L.outerHeight(!0),N=L.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=(l!==!1?Math.min(h,a(l,"x")):h)-N-j,_.h=(f!==!1?Math.min(s,a(f,"y")):s)-A-D,L.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),y.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){y||(V=!1,E=t(i),y=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),S=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),x=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),I=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),R=n("button","Slideshow"),S),B=t('<button type="button"/>').attr({id:Z+"Close"}),x.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(I).add(R)),e.body&&!y.parent().length&&t(e.body).append(v,y.append(x,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return y?(V||(V=!0,K.click(function(){J.next()}),P.click(function(){J.prev()}),B.click(function(){J.close()}),v.click(function(){_.get("overlayClose")&&J.close()}),t(e).bind("keydown."+Z,function(t){var e=t.keyCode;$&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),$&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),K.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+Z,"."+te,i):t("."+te).live("click."+Z,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if(q=!0,U=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-A-D:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-N-j:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-N-j,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-A-D,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){S.show()},100),_.get("inline")){var c=t(e);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),U=new Image,t(U).addClass(Z+"Photo").bind("error",function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;t.each(["alt","longdesc","aria-describedby"],function(e,i){var n=t(_.el).attr(i)||t(_.el).attr("data-"+i);n&&U.setAttribute(i,n)}),_.get("retinaImage")&&i.devicePixelRatio>1&&(U.height=U.height/i.devicePixelRatio,U.width=U.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){U.height-=U.height*e,U.width-=U.width*e},_.mw&&U.width>_.mw&&(e=(U.width-_.mw)/U.width,o()),_.mh&&U.height>_.mh&&(e=(U.height-_.mh)/U.height,o())),_.h&&(U.style.marginTop=Math.max(_.mh-U.height,0)/2+"px"),W[1]&&(_.get("loop")||W[z+1])&&(U.style.cursor="pointer",U.onclick=function(){J.next()}),U.style.width=U.width+"px",U.style.height=U.height+"px",h(U)},1)}),U.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,y,x,b,T,C,H,k,W,E,L,M,S,F,I,R,K,P,B,O,_,D,j,A,N,z,U,$,q,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[z+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){R.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),y.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),R.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),y.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,R.hide(),t(),ae.unbind(ne,e).unbind(ie,t),y.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),R.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;if(e=e||{},t.isFunction(o))o=t("<a/>"),e.open=!0;else if(!o[0])return o;return o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(y[0].style.width,10)-j+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(y[0].style.height,10)-D+"px"}var r,h,s,l=0,d=0,c=y.offset();if(E.unbind("resize."+Z),y.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,y.css({position:"fixed"})):(l=h,d=s,y.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-N-j-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-N-j,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-A-D-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-A-D,0)/2),y.css({top:c.top,left:c.left,visibility:"visible"}),x[0].style.width=x[0].style.height="9999px",r={width:_.w+N+j,height:_.h+A+D,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||y.css(r),y.dequeue().animate(r,{duration:e||0,complete:function(){n(),q=!1,x[0].style.width=_.w+N+j+"px",x[0].style.height=_.h+A+D+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;$&&(t=t||{},t.width&&(_.w=a(t.width,"x")-N-j),t.innerWidth&&(_.w=a(t.innerWidth,"x")),L.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-A-D),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=L.scrollTop(),L.css({height:"auto"}),_.h=L.height()),L.css({height:_.h}),e&&L.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||L.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||L.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if($){var d,g="none"===_.get("transition")?0:_.get("speed");L.remove(),L=n(se,"LoadedContent").append(i),L.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(U).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&y[0].style.removeAttribute("filter")}var n,o,a=W.length;$&&(o=function(){clearTimeout(Q),S.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),L.show(),a>1?("string"==typeof _.get("current")&&I.html(_.get("current").replace("{current}",z+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>z?"show":"hide"]().html(_.get("next")),P[_.get("loop")||z?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=e.createElement("iframe"),"frameBorder"in n&&(n.frameBorder=0),"allowTransparency"in n&&(n.allowTransparency="true"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),name:(new Date).getTime(),"class":Z+"Iframe",allowFullScreen:!0}).one("load",o).appendTo(L),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?y.fadeTo(g,1,i):i())},"fade"===_.get("transition")?y.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!q&&W[1]&&(_.get("loop")||W[z+1])&&(z=h(1),f(W[z]))},J.prev=function(){!q&&W[1]&&(_.get("loop")||z)&&(z=h(-1),f(W[z]))},J.close=function(){$&&!G&&(G=!0,$=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),y.stop().fadeTo(_.get("fadeOut")||0,0,function(){y.hide(),v.hide(),u(he),L.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){y&&(y.stop(),t[Y].close(),y.stop(!1,!0).remove(),v.remove(),G=!1,y=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);
\ No newline at end of file diff --git a/library/colorbox/jquery.colorbox.js b/library/colorbox/jquery.colorbox.js index 5b9aecdc2..c0348849e 100644 --- a/library/colorbox/jquery.colorbox.js +++ b/library/colorbox/jquery.colorbox.js @@ -1,15 +1,23 @@ -/* - jQuery ColorBox v1.3.32 - 2013-01-31 - (c) 2013 Jack Moore - jacklmoore.com/colorbox - license: http://www.opensource.org/licenses/mit-license.php +/*! + Colorbox 1.5.14 + license: MIT + http://www.jacklmoore.com/colorbox */ (function ($, document, window) { var // Default settings object. // See http://jacklmoore.com/colorbox for details. defaults = { + // data sources + html: false, + photo: false, + iframe: false, + inline: false, + + // behavior and appearance transition: "elastic", speed: 300, + fadeOut: 300, width: false, initialWidth: "600", innerWidth: false, @@ -20,18 +28,36 @@ maxHeight: false, scalePhotos: true, scrolling: true, - inline: false, - html: false, - iframe: false, - fastIframe: true, - photo: false, - href: false, - title: false, - rel: false, opacity: 0.9, preloading: true, className: false, + overlayClose: true, + escKey: true, + arrowKey: true, + top: false, + bottom: false, + left: false, + right: false, + fixed: false, + data: undefined, + closeButton: true, + fastIframe: true, + open: false, + reposition: true, + loop: true, + slideshow: false, + slideshowAuto: true, + slideshowSpeed: 2500, + slideshowStart: "start slideshow", + slideshowStop: "stop slideshow", + photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i, + + // alternate image paths for high-res displays + retinaImage: false, + retinaUrl: false, + retinaSuffix: '@2x.$1', + // internationalization current: "image {current} of {total}", previous: "previous", next: "next", @@ -39,31 +65,29 @@ xhrError: "This content failed to load.", imgError: "This image failed to load.", - open: false, + // accessbility returnFocus: true, - reposition: true, - loop: true, - slideshow: false, - slideshowAuto: true, - slideshowSpeed: 2500, - slideshowStart: "start slideshow", - slideshowStop: "stop slideshow", + trapFocus: true, + + // callbacks onOpen: false, onLoad: false, onComplete: false, onCleanup: false, onClosed: false, - overlayClose: true, - escKey: true, - arrowKey: true, - top: false, - bottom: false, - left: false, - right: false, - fixed: false, - data: undefined + + rel: function() { + return this.rel; + }, + href: function() { + // using this.href would give the absolute url, when the href may have been inteded as a selector (e.g. '#container') + return $(this).attr('href'); + }, + title: function() { + return this.title; + } }, - + // Abstracting the HTML and event identifiers for easy rebranding colorbox = 'colorbox', prefix = 'cbox', @@ -76,11 +100,6 @@ event_cleanup = prefix + '_cleanup', event_closed = prefix + '_closed', event_purge = prefix + '_purge', - - // Special Handling for IE - isIE = !$.support.leadingWhitespace, // IE6 to IE8 - isIE6 = isIE && !window.XMLHttpRequest, // IE6 - event_ie6 = prefix + '_IE6', // Cached jQuery Object Variables $overlay, @@ -103,7 +122,7 @@ $prev, $close, $groupControls, - $events = $({}), + $events = $('<a/>'), // $({}) would be prefered, but there is an issue with jQuery 1.4.2 // Variables for cached values or use across multiple functions settings, @@ -111,7 +130,6 @@ interfaceWidth, loadedHeight, loadedWidth, - element, index, photo, open, @@ -120,14 +138,15 @@ loadingTimer, publicMethod, div = "div", - className, + requests = 0, + previousCSS = {}, init; // **************** // HELPER FUNCTIONS // **************** - // Convience function for creating new jQuery objects + // Convenience function for creating new jQuery objects function $tag(tag, id, css) { var element = document.createElement(tag); @@ -141,6 +160,44 @@ return $(element); } + + // Get the window height using innerHeight when available to avoid an issue with iOS + // http://bugs.jquery.com/ticket/6724 + function winheight() { + return window.innerHeight ? window.innerHeight : $(window).height(); + } + + function Settings(element, options) { + if (options !== Object(options)) { + options = {}; + } + + this.cache = {}; + this.el = element; + + this.value = function(key) { + var dataAttr; + + if (this.cache[key] === undefined) { + dataAttr = $(this.el).attr('data-cbox-'+key); + + if (dataAttr !== undefined) { + this.cache[key] = dataAttr; + } else if (options[key] !== undefined) { + this.cache[key] = options[key]; + } else if (defaults[key] !== undefined) { + this.cache[key] = defaults[key]; + } + } + + return this.cache[key]; + }; + + this.get = function(key) { + var value = this.value(key); + return $.isFunction(value) ? value.call(this.el, this) : value; + }; + } // Determine the next and previous members in a group. function getIndex(increment) { @@ -153,224 +210,254 @@ // Convert '%' and 'px' values to integers function setSize(size, dimension) { - return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : $window.height()) / 100) : 1) * parseInt(size, 10)); + return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10)); } // Checks an href to see if it is a photo. - // There is a force photo option (photo: true) for hrefs that cannot be matched by this regex. - function isImage(url) { - return settings.photo || /\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i.test(url); + // There is a force photo option (photo: true) for hrefs that cannot be matched by the regex. + function isImage(settings, url) { + return settings.get('photo') || settings.get('photoRegex').test(url); } - // Assigns function results to their respective properties - function makeSettings() { - var i, - data = $.data(element, colorbox); - - if (data == null) { - settings = $.extend({}, defaults); - if (console && console.log) { - console.log('Error: cboxElement missing settings object'); - } - } else { - settings = $.extend({}, data); + function retinaUrl(settings, url) { + return settings.get('retinaUrl') && window.devicePixelRatio > 1 ? url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')) : url; + } + + function trapFocus(e) { + if ('contains' in $box[0] && !$box[0].contains(e.target) && e.target !== $overlay[0]) { + e.stopPropagation(); + $box.focus(); } - - for (i in settings) { - if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time. - settings[i] = settings[i].call(element); - } + } + + function setClass(str) { + if (setClass.str !== str) { + $box.add($overlay).removeClass(setClass.str).addClass(str); + setClass.str = str; } + } + + function getRelated(rel) { + index = 0; - settings.rel = settings.rel || element.rel || $(element).data('rel') || 'nofollow'; - settings.href = settings.href || $(element).attr('href'); - settings.title = settings.title || element.title; - - if (typeof settings.href === "string") { - settings.href = $.trim(settings.href); + if (rel && rel !== false && rel !== 'nofollow') { + $related = $('.' + boxElement).filter(function () { + var options = $.data(this, colorbox); + var settings = new Settings(this, options); + return (settings.get('rel') === rel); + }); + index = $related.index(settings.el); + + // Check direct calls to Colorbox. + if (index === -1) { + $related = $related.add(settings.el); + index = $related.length - 1; + } + } else { + $related = $(settings.el); } } - function trigger(event, callback) { + function trigger(event) { // for external use $(document).trigger(event); - // for internal use - $events.trigger(event); + $events.triggerHandler(event); + } + + var slideshow = (function(){ + var active, + className = prefix + "Slideshow_", + click = "click." + prefix, + timeOut; - if ($.isFunction(callback)) { - callback.call(element); + function clear () { + clearTimeout(timeOut); } - } - // Slideshow functionality - function slideshow() { - var - timeOut, - className = prefix + "Slideshow_", - click = "click." + prefix, - clear, - set, - start, - stop; - - if (settings.slideshow && $related[1]) { - clear = function () { - clearTimeout(timeOut); - }; + function set() { + if (settings.get('loop') || $related[index + 1]) { + clear(); + timeOut = setTimeout(publicMethod.next, settings.get('slideshowSpeed')); + } + } - set = function () { - if (settings.loop || $related[index + 1]) { - timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed); - } - }; + function start() { + $slideshow + .html(settings.get('slideshowStop')) + .unbind(click) + .one(click, stop); - start = function () { - $slideshow - .html(settings.slideshowStop) - .unbind(click) - .one(click, stop); + $events + .bind(event_complete, set) + .bind(event_load, clear); - $events - .bind(event_complete, set) - .bind(event_load, clear) - .bind(event_cleanup, stop); + $box.removeClass(className + "off").addClass(className + "on"); + } - $box.removeClass(className + "off").addClass(className + "on"); - }; + function stop() { + clear(); - stop = function () { - clear(); - - $events - .unbind(event_complete, set) - .unbind(event_load, clear) - .unbind(event_cleanup, stop); - - $slideshow - .html(settings.slideshowStart) - .unbind(click) - .one(click, function () { - publicMethod.next(); - start(); - }); + $events + .unbind(event_complete, set) + .unbind(event_load, clear); + + $slideshow + .html(settings.get('slideshowStart')) + .unbind(click) + .one(click, function () { + publicMethod.next(); + start(); + }); - $box.removeClass(className + "on").addClass(className + "off"); - }; - - if (settings.slideshowAuto) { - start(); - } else { - stop(); - } - } else { - $box.removeClass(className + "off " + className + "on"); + $box.removeClass(className + "on").addClass(className + "off"); } - } - function launch(target) { - if (!closing) { - - element = target; - - makeSettings(); - - $related = $(element); - - index = 0; - - if (settings.rel !== 'nofollow') { - $related = $('.' + boxElement).filter(function () { - var data = $.data(this, colorbox), - relRelated; + function reset() { + active = false; + $slideshow.hide(); + clear(); + $events + .unbind(event_complete, set) + .unbind(event_load, clear); + $box.removeClass(className + "off " + className + "on"); + } - if (data) { - relRelated = $(this).data('rel') || data.rel || this.rel; + return function(){ + if (active) { + if (!settings.get('slideshow')) { + $events.unbind(event_cleanup, reset); + reset(); + } + } else { + if (settings.get('slideshow') && $related[1]) { + active = true; + $events.one(event_cleanup, reset); + if (settings.get('slideshowAuto')) { + start(); + } else { + stop(); } - - return (relRelated === settings.rel); - }); - index = $related.index(element); - - // Check direct calls to ColorBox. - if (index === -1) { - $related = $related.add(element); - index = $related.length - 1; + $slideshow.show(); } } + }; + + }()); + + + function launch(element) { + var options; + + if (!closing) { + + options = $(element).data(colorbox); + + settings = new Settings(element, options); + getRelated(settings.get('rel')); + if (!open) { open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys. + + setClass(settings.get('className')); // Show colorbox so the sizes can be calculated in older versions of jQuery - $box.css({visibility:'hidden', display:'block'}); + $box.css({visibility:'hidden', display:'block', opacity:''}); - $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden').appendTo($content); + $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden; visibility:hidden'); + $content.css({width:'', height:''}).append($loaded); // Cache values needed for size calculations - interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6 + interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height(); interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width(); loadedHeight = $loaded.outerHeight(true); loadedWidth = $loaded.outerWidth(true); - if (settings.returnFocus) { - $(element).blur(); - $events.one(event_closed, function () { - $(element).focus(); - }); - } - - $overlay.css({ - opacity: parseFloat(settings.opacity), - cursor: settings.overlayClose ? "pointer" : "auto", - visibility: 'visible' - }).show(); - - // Opens inital empty ColorBox prior to content being loaded. - settings.w = setSize(settings.initialWidth, 'x'); - settings.h = setSize(settings.initialHeight, 'y'); + // Opens inital empty Colorbox prior to content being loaded. + var initialWidth = setSize(settings.get('initialWidth'), 'x'); + var initialHeight = setSize(settings.get('initialHeight'), 'y'); + var maxWidth = settings.get('maxWidth'); + var maxHeight = settings.get('maxHeight'); + + settings.w = (maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, 'x')) : initialWidth) - loadedWidth - interfaceWidth; + settings.h = (maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, 'y')) : initialHeight) - loadedHeight - interfaceHeight; + + $loaded.css({width:'', height:settings.h}); publicMethod.position(); - if (isIE6) { - $window.bind('resize.' + event_ie6 + ' scroll.' + event_ie6, function () { - $overlay.css({width: $window.width(), height: $window.height(), top: $window.scrollTop(), left: $window.scrollLeft()}); - }).trigger('resize.' + event_ie6); - } - - slideshow(); + trigger(event_open); + settings.get('onOpen'); - trigger(event_open, settings.onOpen); - $groupControls.add($title).hide(); + + $box.focus(); - $close.html(settings.close).show(); + if (settings.get('trapFocus')) { + // Confine focus to the modal + // Uses event capturing that is not supported in IE8- + if (document.addEventListener) { + + document.addEventListener('focus', trapFocus, true); + + $events.one(event_closed, function () { + document.removeEventListener('focus', trapFocus, true); + }); + } + } + + // Return focus on closing + if (settings.get('returnFocus')) { + $events.one(event_closed, function () { + $(settings.el).focus(); + }); + } } + + var opacity = parseFloat(settings.get('opacity')); + $overlay.css({ + opacity: opacity === opacity ? opacity : '', + cursor: settings.get('overlayClose') ? 'pointer' : '', + visibility: 'visible' + }).show(); - publicMethod.load(true); + if (settings.get('closeButton')) { + $close.html(settings.get('close')).appendTo($content); + } else { + $close.appendTo('<div/>'); // replace with .detach() when dropping jQuery < 1.4 + } + + load(); } } - // ColorBox's markup needs to be added to the DOM prior to being called + // Colorbox's markup needs to be added to the DOM prior to being called // so that the browser will go ahead and load the CSS background images. function appendHTML() { - if (!$box && document.body) { + if (!$box) { init = false; - $window = $(window); - $box = $tag(div).attr({id: colorbox, 'class': isIE ? prefix + (isIE6 ? 'IE6' : 'IE') : ''}).hide(); - $overlay = $tag(div, "Overlay", isIE6 ? 'position:absolute' : '').hide(); - $loadingOverlay = $tag(div, "LoadingOverlay").add($tag(div, "LoadingGraphic")); + $box = $tag(div).attr({ + id: colorbox, + 'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS. + role: 'dialog', + tabindex: '-1' + }).hide(); + $overlay = $tag(div, "Overlay").hide(); + $loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div, "LoadingGraphic")[0]]); $wrap = $tag(div, "Wrapper"); $content = $tag(div, "Content").append( $title = $tag(div, "Title"), $current = $tag(div, "Current"), - $next = $tag(div, "Next"), - $prev = $tag(div, "Previous"), - $slideshow = $tag(div, "Slideshow"), - $close = $tag(div, "Close") + $prev = $('<button type="button"/>').attr({id:prefix+'Previous'}), + $next = $('<button type="button"/>').attr({id:prefix+'Next'}), + $slideshow = $tag('button', "Slideshow"), + $loadingOverlay ); + + $close = $('<button type="button"/>').attr({id:prefix+'Close'}); - $wrap.append( // The 3x3 Grid that makes up ColorBox + $wrap.append( // The 3x3 Grid that makes up Colorbox $tag(div).append( $tag(div, "TopLeft"), $topBorder = $tag(div, "TopCenter"), @@ -388,20 +475,21 @@ ) ).find('div div').css({'float': 'left'}); - $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none'); + $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;'); $groupControls = $next.add($prev).add($current).add($slideshow); - + } + if (document.body && !$box.parent().length) { $(document.body).append($overlay, $box.append($wrap, $loadingBay)); } } - // Add ColorBox's event bindings + // Add Colorbox's event bindings function addBindings() { function clickHandler(e) { // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt. // See: http://jacklmoore.com/notes/click-events/ - if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) { + if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) { e.preventDefault(); launch(this); } @@ -422,7 +510,7 @@ publicMethod.close(); }); $overlay.click(function () { - if (settings.overlayClose) { + if (settings.get('overlayClose')) { publicMethod.close(); } }); @@ -430,11 +518,11 @@ // Key Bindings $(document).bind('keydown.' + prefix, function (e) { var key = e.keyCode; - if (open && settings.escKey && key === 27) { + if (open && settings.get('escKey') && key === 27) { e.preventDefault(); publicMethod.close(); } - if (open && settings.arrowKey && $related[1]) { + if (open && settings.get('arrowKey') && $related[1] && !e.altKey) { if (key === 37) { e.preventDefault(); $prev.click(); @@ -446,8 +534,12 @@ }); if ($.isFunction($.fn.on)) { + // For jQuery 1.7+ $(document).on('click.'+prefix, '.'+boxElement, clickHandler); - } else { // For jQuery 1.3.x -> 1.6.x + } else { + // For jQuery 1.3.x -> 1.6.x + // This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed. + // This is not here for jQuery 1.9, it's here for legacy users. $('.'+boxElement).live('click.'+prefix, clickHandler); } } @@ -456,8 +548,8 @@ return false; } - // Don't do anything if ColorBox already exists. - if ($.colorbox) { + // Don't do anything if Colorbox already exists. + if ($[colorbox]) { return; } @@ -467,39 +559,49 @@ // **************** // PUBLIC FUNCTIONS - // Usage format: $.fn.colorbox.close(); - // Usage from within an iframe: parent.$.fn.colorbox.close(); + // Usage format: $.colorbox.close(); + // Usage from within an iframe: parent.jQuery.colorbox.close(); // **************** publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) { - var $this = this; - + var settings; + var $obj = this; + options = options || {}; + + if ($.isFunction($obj)) { // assume a call to $.colorbox + $obj = $('<a/>'); + options.open = true; + } else if (!$obj[0]) { // colorbox being applied to empty collection + return $obj; + } + + + if (!$obj[0]) { // colorbox being applied to empty collection + return $obj; + } appendHTML(); if (addBindings()) { - if ($.isFunction($this)) { // assume a call to $.colorbox - $this = $('<a/>'); - options.open = true; - } else if (!$this[0]) { // colorbox being applied to empty collection - return $this; - } - + if (callback) { options.onComplete = callback; } - - $this.each(function () { - $.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options)); + + $obj.each(function () { + var old = $.data(this, colorbox) || {}; + $.data(this, colorbox, $.extend(old, options)); }).addClass(boxElement); + + settings = new Settings($obj[0], options); - if (($.isFunction(options.open) && options.open.call($this)) || options.open) { - launch($this[0]); + if (settings.get('open')) { + launch($obj[0]); } } - return $this; + return $obj; }; publicMethod.position = function (speed, loadedCallback) { @@ -519,7 +621,7 @@ scrollTop = $window.scrollTop(); scrollLeft = $window.scrollLeft(); - if (settings.fixed && !isIE6) { + if (settings.get('fixed')) { offset.top -= scrollTop; offset.left -= scrollLeft; $box.css({position: 'fixed'}); @@ -530,46 +632,58 @@ } // keeps the top and left positions within the browser's viewport. - if (settings.right !== false) { - left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0); - } else if (settings.left !== false) { - left += setSize(settings.left, 'x'); + if (settings.get('right') !== false) { + left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.get('right'), 'x'), 0); + } else if (settings.get('left') !== false) { + left += setSize(settings.get('left'), 'x'); } else { left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2); } - if (settings.bottom !== false) { - top += Math.max($window.height() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0); - } else if (settings.top !== false) { - top += setSize(settings.top, 'y'); + if (settings.get('bottom') !== false) { + top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.get('bottom'), 'y'), 0); + } else if (settings.get('top') !== false) { + top += setSize(settings.get('top'), 'y'); } else { - top += Math.round(Math.max($window.height() - settings.h - loadedHeight - interfaceHeight, 0) / 2); + top += Math.round(Math.max(winheight() - settings.h - loadedHeight - interfaceHeight, 0) / 2); } $box.css({top: offset.top, left: offset.left, visibility:'visible'}); - - // setting the speed to 0 to reduce the delay between same-sized content. - speed = ($box.width() === settings.w + loadedWidth && $box.height() === settings.h + loadedHeight) ? 0 : speed || 0; // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly, // but it has to be shrank down around the size of div#colorbox when it's done. If not, // it can invoke an obscure IE bug when using iframes. $wrap[0].style.width = $wrap[0].style.height = "9999px"; - function modalDimensions(that) { - $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt(that.style.width,10) - interfaceWidth)+'px'; - $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt(that.style.height,10) - interfaceHeight)+'px'; + function modalDimensions() { + $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px'; + $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px'; } css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left}; - if(speed===0){ // temporary workaround to side-step jQuery-UI 1.8 bug (http://bugs.jquery.com/ticket/12273) + // setting the speed to 0 if the content hasn't changed size or position + if (speed) { + var tempSpeed = 0; + $.each(css, function(i){ + if (css[i] !== previousCSS[i]) { + tempSpeed = speed; + return; + } + }); + speed = tempSpeed; + } + + previousCSS = css; + + if (!speed) { $box.css(css); } + $box.dequeue().animate(css, { - duration: speed, + duration: speed || 0, complete: function () { - modalDimensions(this); + modalDimensions(); active = false; @@ -577,47 +691,57 @@ $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px"; $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px"; - if (settings.reposition) { + if (settings.get('reposition')) { setTimeout(function () { // small delay before binding onresize due to an IE8 bug. $window.bind('resize.' + prefix, publicMethod.position); }, 1); } - if (loadedCallback) { + if ($.isFunction(loadedCallback)) { loadedCallback(); } }, - step: function () { - modalDimensions(this); - } + step: modalDimensions }); }; publicMethod.resize = function (options) { + var scrolltop; + if (open) { options = options || {}; if (options.width) { settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth; } + if (options.innerWidth) { settings.w = setSize(options.innerWidth, 'x'); } + $loaded.css({width: settings.w}); if (options.height) { settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight; } + if (options.innerHeight) { settings.h = setSize(options.innerHeight, 'y'); } + if (!options.innerHeight && !options.height) { + scrolltop = $loaded.scrollTop(); $loaded.css({height: "auto"}); settings.h = $loaded.height(); } + $loaded.css({height: settings.h}); + + if(scrolltop) { + $loaded.scrollTop(scrolltop); + } - publicMethod.position(settings.transition === "none" ? 0 : settings.speed); + publicMethod.position(settings.get('transition') === "none" ? 0 : settings.get('speed')); } }; @@ -626,9 +750,9 @@ return; } - var callback, speed = settings.transition === "none" ? 0 : settings.speed; - - $loaded.empty().remove(); // Using empty first may prevent some IE7 issues. + var callback, speed = settings.get('transition') === "none" ? 0 : settings.get('speed'); + + $loaded.remove(); $loaded = $tag(div, 'LoadedContent').append(object); @@ -645,81 +769,65 @@ $loaded.hide() .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations. - .css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'}) + .css({width: getWidth(), overflow: settings.get('scrolling') ? 'auto' : 'hidden'}) .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height. .prependTo($content); $loadingBay.hide(); // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width. - //$(photo).css({'float': 'none', marginLeft: 'auto', marginRight: 'auto'}); $(photo).css({'float': 'none'}); - + setClass(settings.get('className')); + callback = function () { var total = $related.length, iframe, - frameBorder = 'frameBorder', - allowTransparency = 'allowTransparency', complete; if (!open) { return; } - function removeFilter() { - if (isIE) { + function removeFilter() { // Needed for IE8 in versions of jQuery prior to 1.7.2 + if ($.support.opacity === false) { $box[0].style.removeAttribute('filter'); } } complete = function () { clearTimeout(loadingTimer); - $loadingOverlay.remove(); - trigger(event_complete, settings.onComplete); + $loadingOverlay.hide(); + trigger(event_complete); + settings.get('onComplete'); }; + - if (isIE) { - //This fadeIn helps the bicubic resampling to kick-in. - if (photo) { - $loaded.fadeIn(100); - } - } - - $title.html(settings.title).add($loaded).show(); + $title.html(settings.get('title')).show(); + $loaded.show(); if (total > 1) { // handle grouping - if (typeof settings.current === "string") { - $current.html(settings.current.replace('{current}', index + 1).replace('{total}', total)).show(); + if (typeof settings.get('current') === "string") { + $current.html(settings.get('current').replace('{current}', index + 1).replace('{total}', total)).show(); } - $next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next); - $prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous); + $next[(settings.get('loop') || index < total - 1) ? "show" : "hide"]().html(settings.get('next')); + $prev[(settings.get('loop') || index) ? "show" : "hide"]().html(settings.get('previous')); - if (settings.slideshow) { - $slideshow.show(); - } + slideshow(); // Preloads images within a rel group - if (settings.preloading) { + if (settings.get('preloading')) { $.each([getIndex(-1), getIndex(1)], function(){ - var src, - img, + var img, i = $related[this], - data = $.data(i, colorbox); - - if (data && data.href) { - src = data.href; - if ($.isFunction(src)) { - src = src.call(i); - } - } else { - src = $(i).attr('href'); - } + settings = new Settings(i, $.data(i, colorbox)), + src = settings.get('href'); - if (src && (isImage(src) || data.photo)) { - img = new Image(); + if (src && isImage(settings, src)) { + src = retinaUrl(settings, src); + img = document.createElement('img'); img.src = src; } }); @@ -728,29 +836,27 @@ $groupControls.hide(); } - if (settings.iframe) { - iframe = $tag('iframe')[0]; + if (settings.get('iframe')) { + iframe = document.createElement('iframe'); - if (frameBorder in iframe) { - iframe[frameBorder] = 0; + if ('frameBorder' in iframe) { + iframe.frameBorder = 0; } - if (allowTransparency in iframe) { - iframe[allowTransparency] = "true"; + if ('allowTransparency' in iframe) { + iframe.allowTransparency = "true"; } - if (!settings.scrolling) { + if (!settings.get('scrolling')) { iframe.scrolling = "no"; } $(iframe) .attr({ - src: settings.href, + src: settings.get('href'), name: (new Date()).getTime(), // give the iframe a unique name to prevent caching 'class': prefix + 'Iframe', - allowFullScreen : true, // allow HTML5 video to go fullscreen - webkitAllowFullScreen : true, - mozallowfullscreen : true + allowFullScreen : true // allow HTML5 video to go fullscreen }) .one('load', complete) .appendTo($loaded); @@ -759,21 +865,21 @@ iframe.src = "//about:blank"; }); - if (settings.fastIframe) { + if (settings.get('fastIframe')) { $(iframe).trigger('load'); } } else { complete(); } - if (settings.transition === 'fade') { + if (settings.get('transition') === 'fade') { $box.fadeTo(speed, 1, removeFilter); } else { removeFilter(); } }; - if (settings.transition === 'fade') { + if (settings.get('transition') === 'fade') { $box.fadeTo(speed, 0, function () { publicMethod.position(0, callback); }); @@ -782,38 +888,24 @@ } }; - publicMethod.load = function (launched) { - var href, setResize, prep = publicMethod.prep, $inline; + function load () { + var href, setResize, prep = publicMethod.prep, $inline, request = ++requests; active = true; photo = false; - element = $related[index]; - - if (!launched) { - makeSettings(); - } - - if (className) { - $box.add($overlay).removeClass(className); - } - if (settings.className) { - $box.add($overlay).addClass(settings.className); - } - className = settings.className; - trigger(event_purge); + trigger(event_load); + settings.get('onLoad'); - trigger(event_load, settings.onLoad); + settings.h = settings.get('height') ? + setSize(settings.get('height'), 'y') - loadedHeight - interfaceHeight : + settings.get('innerHeight') && setSize(settings.get('innerHeight'), 'y'); - settings.h = settings.height ? - setSize(settings.height, 'y') - loadedHeight - interfaceHeight : - settings.innerHeight && setSize(settings.innerHeight, 'y'); - - settings.w = settings.width ? - setSize(settings.width, 'x') - loadedWidth - interfaceWidth : - settings.innerWidth && setSize(settings.innerWidth, 'x'); + settings.w = settings.get('width') ? + setSize(settings.get('width'), 'x') - loadedWidth - interfaceWidth : + settings.get('innerWidth') && setSize(settings.get('innerWidth'), 'x'); // Sets the minimum dimensions for use in image scaling settings.mw = settings.w; @@ -821,153 +913,176 @@ // Re-evaluate the minimum width and height based on maxWidth and maxHeight values. // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead. - if (settings.maxWidth) { - settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth; + if (settings.get('maxWidth')) { + settings.mw = setSize(settings.get('maxWidth'), 'x') - loadedWidth - interfaceWidth; settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw; } - if (settings.maxHeight) { - settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight; + if (settings.get('maxHeight')) { + settings.mh = setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight; settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh; } - href = settings.href; + href = settings.get('href'); loadingTimer = setTimeout(function () { - $loadingOverlay.appendTo($content); + $loadingOverlay.show(); }, 100); - if (settings.inline) { + if (settings.get('inline')) { + var $target = $(href); // Inserts an empty placeholder where inline content is being pulled from. - // An event is bound to put inline content back when ColorBox closes or loads new content. - $inline = $tag(div).hide().insertBefore($(href)[0]); + // An event is bound to put inline content back when Colorbox closes or loads new content. + $inline = $('<div>').hide().insertBefore($target); $events.one(event_purge, function () { - $inline.replaceWith($loaded.children()); + $inline.replaceWith($target); }); - prep($(href)); - } else if (settings.iframe) { + prep($target); + } else if (settings.get('iframe')) { // IFrame element won't be added to the DOM until it is ready to be displayed, // to avoid problems with DOM-ready JS that might be trying to run in that iframe. prep(" "); - } else if (settings.html) { - prep(settings.html); - } else if (isImage(href)) { - $(photo = new Image()) + } else if (settings.get('html')) { + prep(settings.get('html')); + } else if (isImage(settings, href)) { + + href = retinaUrl(settings, href); + + photo = new Image(); + + $(photo) .addClass(prefix + 'Photo') .bind('error',function () { - settings.title = false; - prep($tag(div, 'Error').html(settings.imgError)); + prep($tag(div, 'Error').html(settings.get('imgError'))); }) .one('load', function () { - var percent; - - if (settings.scalePhotos) { - setResize = function () { - photo.height -= photo.height * percent; - photo.width -= photo.width * percent; - }; - if (settings.mw && photo.width > settings.mw) { - percent = (photo.width - settings.mw) / photo.width; - setResize(); + if (request !== requests) { + return; + } + + // A small pause because some browsers will occassionaly report a + // img.width and img.height of zero immediately after the img.onload fires + setTimeout(function(){ + var percent; + + $.each(['alt', 'longdesc', 'aria-describedby'], function(i,val){ + var attr = $(settings.el).attr(val) || $(settings.el).attr('data-'+val); + if (attr) { + photo.setAttribute(val, attr); + } + }); + + if (settings.get('retinaImage') && window.devicePixelRatio > 1) { + photo.height = photo.height / window.devicePixelRatio; + photo.width = photo.width / window.devicePixelRatio; } - if (settings.mh && photo.height > settings.mh) { - percent = (photo.height - settings.mh) / photo.height; - setResize(); + + if (settings.get('scalePhotos')) { + setResize = function () { + photo.height -= photo.height * percent; + photo.width -= photo.width * percent; + }; + if (settings.mw && photo.width > settings.mw) { + percent = (photo.width - settings.mw) / photo.width; + setResize(); + } + if (settings.mh && photo.height > settings.mh) { + percent = (photo.height - settings.mh) / photo.height; + setResize(); + } } - } - - if (settings.h) { - photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px'; - } - - if ($related[1] && (settings.loop || $related[index + 1])) { - photo.style.cursor = 'pointer'; - photo.onclick = function () { - publicMethod.next(); - }; - } - - if (isIE) { - photo.style.msInterpolationMode = 'bicubic'; - } - - setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise. + + if (settings.h) { + photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px'; + } + + if ($related[1] && (settings.get('loop') || $related[index + 1])) { + photo.style.cursor = 'pointer'; + photo.onclick = function () { + publicMethod.next(); + }; + } + + photo.style.width = photo.width + 'px'; + photo.style.height = photo.height + 'px'; prep(photo); }, 1); }); - setTimeout(function () { // A pause because Opera 10.6+ will sometimes not run the onload function otherwise. - photo.src = href; - }, 1); + photo.src = href; + } else if (href) { - $loadingBay.load(href, settings.data, function (data, status) { - prep(status === 'error' ? $tag(div, 'Error').html(settings.xhrError) : $(this).contents()); + $loadingBay.load(href, settings.get('data'), function (data, status) { + if (request === requests) { + prep(status === 'error' ? $tag(div, 'Error').html(settings.get('xhrError')) : $(this).contents()); + } }); } - }; + } // Navigates to the next page/image in a set. publicMethod.next = function () { - if (!active && $related[1] && (settings.loop || $related[index + 1])) { + if (!active && $related[1] && (settings.get('loop') || $related[index + 1])) { index = getIndex(1); - publicMethod.load(); + launch($related[index]); } }; publicMethod.prev = function () { - if (!active && $related[1] && (settings.loop || index)) { + if (!active && $related[1] && (settings.get('loop') || index)) { index = getIndex(-1); - publicMethod.load(); + launch($related[index]); } }; - // Note: to use this within an iframe use the following format: parent.$.fn.colorbox.close(); + // Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close(); publicMethod.close = function () { if (open && !closing) { closing = true; - open = false; + trigger(event_cleanup); + settings.get('onCleanup'); + $window.unbind('.' + prefix); + $overlay.fadeTo(settings.get('fadeOut') || 0, 0); - trigger(event_cleanup, settings.onCleanup); - - $window.unbind('.' + prefix + ' .' + event_ie6); - - $overlay.fadeTo(200, 0); - - $box.stop().fadeTo(300, 0, function () { - - $box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide(); - + $box.stop().fadeTo(settings.get('fadeOut') || 0, 0, function () { + $box.hide(); + $overlay.hide(); trigger(event_purge); - - $loaded.empty().remove(); // Using empty first may prevent some IE7 issues. + $loaded.remove(); setTimeout(function () { closing = false; - trigger(event_closed, settings.onClosed); + trigger(event_closed); + settings.get('onClosed'); }, 1); }); } }; - // Removes changes ColorBox made to the document, but does not remove the plugin - // from jQuery. + // Removes changes Colorbox made to the document, but does not remove the plugin. publicMethod.remove = function () { - $([]).add($box).add($overlay).remove(); + if (!$box) { return; } + + $box.stop(); + $[colorbox].close(); + $box.stop(false, true).remove(); + $overlay.remove(); + closing = false; $box = null; $('.' + boxElement) .removeData(colorbox) .removeClass(boxElement); - $(document).unbind('click.'+prefix); + $(document).unbind('click.'+prefix).unbind('keydown.'+prefix); }; - // A method for fetching the current element ColorBox is referencing. + // A method for fetching the current element Colorbox is referencing. // returns a jQuery object. publicMethod.element = function () { - return $(element); + return $(settings.el); }; publicMethod.settings = defaults; diff --git a/library/colorpicker/css/colorpicker.css b/library/colorpicker/css/colorpicker.css deleted file mode 100644 index 05b02b485..000000000 --- a/library/colorpicker/css/colorpicker.css +++ /dev/null @@ -1,161 +0,0 @@ -.colorpicker {
- width: 356px;
- height: 176px;
- overflow: hidden;
- position: absolute;
- background: url(../images/colorpicker_background.png);
- font-family: Arial, Helvetica, sans-serif;
- display: none;
-}
-.colorpicker_color {
- width: 150px;
- height: 150px;
- left: 14px;
- top: 13px;
- position: absolute;
- background: #f00;
- overflow: hidden;
- cursor: crosshair;
-}
-.colorpicker_color div {
- position: absolute;
- top: 0;
- left: 0;
- width: 150px;
- height: 150px;
- background: url(../images/colorpicker_overlay.png);
-}
-.colorpicker_color div div {
- position: absolute;
- top: 0;
- left: 0;
- width: 11px;
- height: 11px;
- overflow: hidden;
- background: url(../images/colorpicker_select.gif);
- margin: -5px 0 0 -5px;
-}
-.colorpicker_hue {
- position: absolute;
- top: 13px;
- left: 171px;
- width: 35px;
- height: 150px;
- cursor: n-resize;
-}
-.colorpicker_hue div {
- position: absolute;
- width: 35px;
- height: 9px;
- overflow: hidden;
- background: url(../images/colorpicker_indic.gif) left top;
- margin: -4px 0 0 0;
- left: 0px;
-}
-.colorpicker_new_color {
- position: absolute;
- width: 60px;
- height: 30px;
- left: 213px;
- top: 13px;
- background: #f00;
-}
-.colorpicker_current_color {
- position: absolute;
- width: 60px;
- height: 30px;
- left: 283px;
- top: 13px;
- background: #f00;
-}
-.colorpicker input {
- background-color: transparent;
- border: 1px solid transparent;
- position: absolute;
- font-size: 10px;
- font-family: Arial, Helvetica, sans-serif;
- color: #898989;
- top: 4px;
- right: 11px;
- text-align: right;
- margin: 0;
- padding: 0;
- height: 11px;
-}
-.colorpicker_hex {
- position: absolute;
- width: 72px;
- height: 22px;
- background: url(../images/colorpicker_hex.png) top;
- left: 212px;
- top: 142px;
-}
-.colorpicker_hex input {
- right: 6px;
-}
-.colorpicker_field {
- height: 22px;
- width: 62px;
- background-position: top;
- position: absolute;
-}
-.colorpicker_field span {
- position: absolute;
- width: 12px;
- height: 22px;
- overflow: hidden;
- top: 0;
- right: 0;
- cursor: n-resize;
-}
-.colorpicker_rgb_r {
- background-image: url(../images/colorpicker_rgb_r.png);
- top: 52px;
- left: 212px;
-}
-.colorpicker_rgb_g {
- background-image: url(../images/colorpicker_rgb_g.png);
- top: 82px;
- left: 212px;
-}
-.colorpicker_rgb_b {
- background-image: url(../images/colorpicker_rgb_b.png);
- top: 112px;
- left: 212px;
-}
-.colorpicker_hsb_h {
- background-image: url(../images/colorpicker_hsb_h.png);
- top: 52px;
- left: 282px;
-}
-.colorpicker_hsb_s {
- background-image: url(../images/colorpicker_hsb_s.png);
- top: 82px;
- left: 282px;
-}
-.colorpicker_hsb_b {
- background-image: url(../images/colorpicker_hsb_b.png);
- top: 112px;
- left: 282px;
-}
-.colorpicker_submit {
- position: absolute;
- width: 22px;
- height: 22px;
- background: url(../images/colorpicker_submit.png) top;
- left: 322px;
- top: 142px;
- overflow: hidden;
-}
-.colorpicker_focus {
- background-position: center;
-}
-.colorpicker_hex.colorpicker_focus {
- background-position: bottom;
-}
-.colorpicker_submit.colorpicker_focus {
- background-position: bottom;
-}
-.colorpicker_slider {
- background-position: bottom;
-}
diff --git a/library/colorpicker/css/layout.css b/library/colorpicker/css/layout.css deleted file mode 100644 index 8b3f00ff3..000000000 --- a/library/colorpicker/css/layout.css +++ /dev/null @@ -1,218 +0,0 @@ -body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
- margin:0;
- padding:0;
-}
-table {
- border-collapse:collapse;
- border-spacing:0;
-}
-fieldset,img {
- border:0;
-}
-address,caption,cite,code,dfn,em,strong,th,var {
- font-style:normal;
- font-weight:normal;
-}
-ol,ul {
- list-style:none;
-}
-caption,th {
- text-align:left;
-}
-h1,h2,h3,h4,h5,h6 {
- font-size:100%;
- font-weight:normal;
-}
-q:before,q:after {
- content:'';
-}
-abbr,acronym { border:0;
-}
-html, body {
- background-color: #fff;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 12px;
- line-height: 18px;
- color: #52697E;
-}
-body {
- text-align: center;
- overflow: auto;
-}
-.wrapper {
- width: 700px;
- margin: 0 auto;
- text-align: left;
-}
-h1 {
- font-size: 21px;
- height: 47px;
- line-height: 47px;
- text-transform: uppercase;
-}
-.navigationTabs {
- height: 23px;
- line-height: 23px;
- border-bottom: 1px solid #ccc;
-}
-.navigationTabs li {
- float: left;
- height: 23px;
- line-height: 23px;
- padding-right: 3px;
-}
-.navigationTabs li a{
- float: left;
- dispaly: block;
- height: 23px;
- line-height: 23px;
- padding: 0 10px;
- overflow: hidden;
- color: #52697E;
- background-color: #eee;
- position: relative;
- text-decoration: none;
-}
-.navigationTabs li a:hover {
- background-color: #f0f0f0;
-}
-.navigationTabs li a.active {
- background-color: #fff;
- border: 1px solid #ccc;
- border-bottom: 0px solid;
-}
-.tabsContent {
- border: 1px solid #ccc;
- border-top: 0px solid;
- width: 698px;
- overflow: hidden;
-}
-.tab {
- padding: 16px;
- display: none;
-}
-.tab h2 {
- font-weight: bold;
- font-size: 16px;
-}
-.tab h3 {
- font-weight: bold;
- font-size: 14px;
- margin-top: 20px;
-}
-.tab p {
- margin-top: 16px;
- clear: both;
-}
-.tab ul {
- margin-top: 16px;
- list-style: disc;
-}
-.tab li {
- margin: 10px 0 0 35px;
-}
-.tab a {
- color: #8FB0CF;
-}
-.tab strong {
- font-weight: bold;
-}
-.tab pre {
- font-size: 11px;
- margin-top: 20px;
- width: 668px;
- overflow: auto;
- clear: both;
-}
-.tab table {
- width: 100%;
-}
-.tab table td {
- padding: 6px 10px 6px 0;
- vertical-align: top;
-}
-.tab dt {
- margin-top: 16px;
-}
-
-#colorSelector {
- position: relative;
- width: 36px;
- height: 36px;
- background: url(../images/select.png);
-}
-#colorSelector div {
- position: absolute;
- top: 3px;
- left: 3px;
- width: 30px;
- height: 30px;
- background: url(../images/select.png) center;
-}
-#colorSelector2 {
- position: absolute;
- top: 0;
- left: 0;
- width: 36px;
- height: 36px;
- background: url(../images/select2.png);
-}
-#colorSelector2 div {
- position: absolute;
- top: 4px;
- left: 4px;
- width: 28px;
- height: 28px;
- background: url(../images/select2.png) center;
-}
-#colorpickerHolder2 {
- top: 32px;
- left: 0;
- width: 356px;
- height: 0;
- overflow: hidden;
- position: absolute;
-}
-#colorpickerHolder2 .colorpicker {
- background-image: url(../images/custom_background.png);
- position: absolute;
- bottom: 0;
- left: 0;
-}
-#colorpickerHolder2 .colorpicker_hue div {
- background-image: url(../images/custom_indic.gif);
-}
-#colorpickerHolder2 .colorpicker_hex {
- background-image: url(../images/custom_hex.png);
-}
-#colorpickerHolder2 .colorpicker_rgb_r {
- background-image: url(../images/custom_rgb_r.png);
-}
-#colorpickerHolder2 .colorpicker_rgb_g {
- background-image: url(../images/custom_rgb_g.png);
-}
-#colorpickerHolder2 .colorpicker_rgb_b {
- background-image: url(../images/custom_rgb_b.png);
-}
-#colorpickerHolder2 .colorpicker_hsb_s {
- background-image: url(../images/custom_hsb_s.png);
- display: none;
-}
-#colorpickerHolder2 .colorpicker_hsb_h {
- background-image: url(../images/custom_hsb_h.png);
- display: none;
-}
-#colorpickerHolder2 .colorpicker_hsb_b {
- background-image: url(../images/custom_hsb_b.png);
- display: none;
-}
-#colorpickerHolder2 .colorpicker_submit {
- background-image: url(../images/custom_submit.png);
-}
-#colorpickerHolder2 .colorpicker input {
- color: #778398;
-}
-#customWidget {
- position: relative;
- height: 36px;
-}
diff --git a/library/colorpicker/images/blank.gif b/library/colorpicker/images/blank.gif Binary files differdeleted file mode 100644 index 75b945d25..000000000 --- a/library/colorpicker/images/blank.gif +++ /dev/null diff --git a/library/colorpicker/images/colorpicker_background.png b/library/colorpicker/images/colorpicker_background.png Binary files differdeleted file mode 100644 index 8401572f1..000000000 --- a/library/colorpicker/images/colorpicker_background.png +++ /dev/null diff --git a/library/colorpicker/images/colorpicker_hex.png b/library/colorpicker/images/colorpicker_hex.png Binary files differdeleted file mode 100644 index 4e532d7c6..000000000 --- a/library/colorpicker/images/colorpicker_hex.png +++ /dev/null diff --git a/library/colorpicker/images/colorpicker_hsb_b.png b/library/colorpicker/images/colorpicker_hsb_b.png Binary files differdeleted file mode 100644 index dfac595d0..000000000 --- a/library/colorpicker/images/colorpicker_hsb_b.png +++ /dev/null diff --git a/library/colorpicker/images/colorpicker_hsb_h.png b/library/colorpicker/images/colorpicker_hsb_h.png Binary files differdeleted file mode 100644 index 3977ed9f2..000000000 --- a/library/colorpicker/images/colorpicker_hsb_h.png +++ /dev/null diff --git a/library/colorpicker/images/colorpicker_hsb_s.png b/library/colorpicker/images/colorpicker_hsb_s.png Binary files differdeleted file mode 100644 index a2a699736..000000000 --- a/library/colorpicker/images/colorpicker_hsb_s.png +++ /dev/null diff --git a/library/colorpicker/images/colorpicker_indic.gif b/library/colorpicker/images/colorpicker_indic.gif Binary files differdeleted file mode 100644 index f9fa95e28..000000000 --- a/library/colorpicker/images/colorpicker_indic.gif +++ /dev/null diff --git a/library/colorpicker/images/colorpicker_overlay.png b/library/colorpicker/images/colorpicker_overlay.png Binary files differdeleted file mode 100644 index 561cdd9c5..000000000 --- a/library/colorpicker/images/colorpicker_overlay.png +++ /dev/null diff --git a/library/colorpicker/images/colorpicker_rgb_b.png b/library/colorpicker/images/colorpicker_rgb_b.png Binary files differdeleted file mode 100644 index dfac595d0..000000000 --- a/library/colorpicker/images/colorpicker_rgb_b.png +++ /dev/null diff --git a/library/colorpicker/images/colorpicker_rgb_g.png b/library/colorpicker/images/colorpicker_rgb_g.png Binary files differdeleted file mode 100644 index 72b32760a..000000000 --- a/library/colorpicker/images/colorpicker_rgb_g.png +++ /dev/null diff --git a/library/colorpicker/images/colorpicker_rgb_r.png b/library/colorpicker/images/colorpicker_rgb_r.png Binary files differdeleted file mode 100644 index 4855fe03f..000000000 --- a/library/colorpicker/images/colorpicker_rgb_r.png +++ /dev/null diff --git a/library/colorpicker/images/colorpicker_select.gif b/library/colorpicker/images/colorpicker_select.gif Binary files differdeleted file mode 100644 index 599f7f13a..000000000 --- a/library/colorpicker/images/colorpicker_select.gif +++ /dev/null diff --git a/library/colorpicker/images/colorpicker_submit.png b/library/colorpicker/images/colorpicker_submit.png Binary files differdeleted file mode 100644 index 7f4c0825f..000000000 --- a/library/colorpicker/images/colorpicker_submit.png +++ /dev/null diff --git a/library/colorpicker/images/custom_background.png b/library/colorpicker/images/custom_background.png Binary files differdeleted file mode 100644 index cf55ffdd6..000000000 --- a/library/colorpicker/images/custom_background.png +++ /dev/null diff --git a/library/colorpicker/images/custom_hex.png b/library/colorpicker/images/custom_hex.png Binary files differdeleted file mode 100644 index 888f44449..000000000 --- a/library/colorpicker/images/custom_hex.png +++ /dev/null diff --git a/library/colorpicker/images/custom_hsb_b.png b/library/colorpicker/images/custom_hsb_b.png Binary files differdeleted file mode 100644 index 2f99dae8e..000000000 --- a/library/colorpicker/images/custom_hsb_b.png +++ /dev/null diff --git a/library/colorpicker/images/custom_hsb_h.png b/library/colorpicker/images/custom_hsb_h.png Binary files differdeleted file mode 100644 index a217e9218..000000000 --- a/library/colorpicker/images/custom_hsb_h.png +++ /dev/null diff --git a/library/colorpicker/images/custom_hsb_s.png b/library/colorpicker/images/custom_hsb_s.png Binary files differdeleted file mode 100644 index 7826b4150..000000000 --- a/library/colorpicker/images/custom_hsb_s.png +++ /dev/null diff --git a/library/colorpicker/images/custom_indic.gif b/library/colorpicker/images/custom_indic.gif Binary files differdeleted file mode 100644 index 222fb94cf..000000000 --- a/library/colorpicker/images/custom_indic.gif +++ /dev/null diff --git a/library/colorpicker/images/custom_rgb_b.png b/library/colorpicker/images/custom_rgb_b.png Binary files differdeleted file mode 100644 index 80764e5d6..000000000 --- a/library/colorpicker/images/custom_rgb_b.png +++ /dev/null diff --git a/library/colorpicker/images/custom_rgb_g.png b/library/colorpicker/images/custom_rgb_g.png Binary files differdeleted file mode 100644 index fc9778be1..000000000 --- a/library/colorpicker/images/custom_rgb_g.png +++ /dev/null diff --git a/library/colorpicker/images/custom_rgb_r.png b/library/colorpicker/images/custom_rgb_r.png Binary files differdeleted file mode 100644 index 91b0cd4c5..000000000 --- a/library/colorpicker/images/custom_rgb_r.png +++ /dev/null diff --git a/library/colorpicker/images/custom_submit.png b/library/colorpicker/images/custom_submit.png Binary files differdeleted file mode 100644 index cd202cd93..000000000 --- a/library/colorpicker/images/custom_submit.png +++ /dev/null diff --git a/library/colorpicker/images/select.png b/library/colorpicker/images/select.png Binary files differdeleted file mode 100644 index 21213bfd5..000000000 --- a/library/colorpicker/images/select.png +++ /dev/null diff --git a/library/colorpicker/images/select2.png b/library/colorpicker/images/select2.png Binary files differdeleted file mode 100644 index 2cd2cabeb..000000000 --- a/library/colorpicker/images/select2.png +++ /dev/null diff --git a/library/colorpicker/images/slider.png b/library/colorpicker/images/slider.png Binary files differdeleted file mode 100644 index 8b03da96e..000000000 --- a/library/colorpicker/images/slider.png +++ /dev/null diff --git a/library/colorpicker/index.html b/library/colorpicker/index.html deleted file mode 100644 index e1ad5782d..000000000 --- a/library/colorpicker/index.html +++ /dev/null @@ -1,184 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <link rel="stylesheet" href="css/colorpicker.css" type="text/css" />
- <link rel="stylesheet" media="screen" type="text/css" href="css/layout.css" />
- <title>ColorPicker - jQuery plugin</title>
- <script type="text/javascript" src="js/jquery.js"></script>
- <script type="text/javascript" src="js/colorpicker.js"></script>
- <script type="text/javascript" src="js/eye.js"></script>
- <script type="text/javascript" src="js/utils.js"></script>
- <script type="text/javascript" src="js/layout.js?ver=1.0.2"></script>
-</head>
-<body>
- <div class="wrapper">
- <h1>Color Picker - jQuery plugin</h1>
- <ul class="navigationTabs">
- <li><a href="#about" rel="about">About</a></li>
- <li><a href="#download" rel="download">Download</a></li>
- <li><a href="#implement" rel="implement">Implement</a></li>
- </ul>
- <div class="tabsContent">
- <div class="tab">
- <h2>About</h2>
- <p>A simple component to select color in the same way you select color in Adobe Photoshop</p>
- <h3>Last update</h3>
- <p>23.05.2009 - Check Download tab</p>
- <h3>Features</h3>
- <ul>
- <li>Flat mode - as element in page</li>
- <li>Powerful controls for color selection</li>
- <li>Easy to customize the look by changing some images</li>
- <li>Fits into the viewport</li>
- </ul>
- <h3>License</h3>
- <p>Dual licensed under the MIT and GPL licenses.</p>
- <h3>Examples</h3>
- <p>Flat mode.</p>
- <p id="colorpickerHolder">
- </p>
- <pre>
-$('#colorpickerHolder').ColorPicker({flat: true});
- </pre>
- <p>Custom skin and using flat mode to display the color picker in a custom widget.</p>
- <div id="customWidget">
- <div id="colorSelector2"><div style="background-color: #00ff00"></div></div>
- <div id="colorpickerHolder2">
- </div>
- </div>
-
- <p>Attached to an text field and using callback functions to update the color with field's value and set the value back in the field by submiting the color.</p>
- <p><input type="text" maxlength="6" size="6" id="colorpickerField1" value="00ff00" /></p>
- <p><input type="text" maxlength="6" size="6" id="colorpickerField3" value="0000ff" /></p>
- <p><input type="text" maxlength="6" size="6" id="colorpickerField2" value="ff0000" /></p>
- <pre>$('#colorpickerField1, #colorpickerField2, #colorpickerField3').ColorPicker({
- onSubmit: function(hsb, hex, rgb, el) {
- $(el).val(hex);
- $(el).ColorPickerHide();
- },
- onBeforeShow: function () {
- $(this).ColorPickerSetColor(this.value);
- }
-})
-.bind('keyup', function(){
- $(this).ColorPickerSetColor(this.value);
-});
-</pre>
- <p>Attached to DOMElement and using callbacks to live preview the color and adding animation.</p>
- <p>
- <div id="colorSelector"><div style="background-color: #0000ff"></div></div>
- </p>
- <pre>
-$('#colorSelector').ColorPicker({
- color: '#0000ff',
- onShow: function (colpkr) {
- $(colpkr).fadeIn(500);
- return false;
- },
- onHide: function (colpkr) {
- $(colpkr).fadeOut(500);
- return false;
- },
- onChange: function (hsb, hex, rgb) {
- $('#colorSelector div').css('backgroundColor', '#' + hex);
- }
-});
-</pre>
- </div>
- <div class="tab">
- <h2>Download</h2>
- <p><a href="colorpicker.zip">colorpicker.zip (73 kb)</a>: jQuery, Javscript files, CSS files, images, examples and instructions.</p>
- <h3>Changelog</h3>
- <dl>
- <dt>23.05.2009</dt>
- <dd>Added: close on color selection example</dd>
- <dd>Added: restore original color option</dd>
- <dd>Changed: color update on key up event</dd>
- <dd>Fixed: colorpicker hide and show methods</dd>
- <dd>Fixed: reference to options. Multiple fields with colorpickers is possible now.</dd>
- <dd>Fixed: RGB to HSB convertion</dd>
- <dt>22.08.2008</dt>
- <dd>Fixed bug: where some events were not canceled right on Safari</dd>
- <dd>Fixed bug: where teh view port was not detected right on Safari</dd>
- <dt>16-07-2008</dt>
- <dd>Fixed bug where the letter 'F' could not be typed in the Hex field</dd>
- <dd>Fixed bug where the changes on Hex field where not parsed</dd>
- <dd>Added new option 'livePreview'</dd>
- <dt>08-07-2008</dt>
- <dd>Fixed typo in the code, both JavaScript and CSS</dd>
- <dd>Changed the cursor for some elements</dd>
- <dd>Added new demo explaining how to implement custom skin</dd>
- <dt>07.07.2008</dt>
- <dd>The first release.</dd>
- </dl>
- </div>
- <div class="tab">
- <h2>Implement</h2>
- <p>Attach the Javascript and CSS files to your document. Edit CSS file and fix the paths to images and change colors to fit your site theme.</p>
- <pre>
-<link rel="stylesheet" media="screen" type="text/css" href="css/colorpicker.css" />
-<script type="text/javascript" src="js/colorpicker.js"></script>
- </pre>
- <h3>Invocation code</h3>
- <p>All you have to do is to select the elements in a jQuery way and call the plugin.</p>
- <pre>
- $('input').ColorPicker(options);
- </pre>
- <h3>Options</h3>
- <p>A hash of parameters. All parameters are optional.</p>
- <table>
- <tr>
- <td><strong>eventName</strong></td>
- <td>string</td>
- <td>The desired event to trigger the colorpicker. Default: 'click'</td>
- </tr>
- <tr>
- <td><strong>color</strong></td>
- <td>string or hash</td>
- <td>The default color. String for hex color or hash for RGB and HSB ({r:255, r:0, b:0}) . Default: 'ff0000'</td>
- </tr>
- <tr>
- <td><strong>flat</strong></td>
- <td>boolean</td>
- <td>Whatever if the color picker is appended to the element or triggered by an event. Default false</td>
- </tr>
- <tr>
- <td><strong>livePreview</strong></td>
- <td>boolean</td>
- <td>Whatever if the color values are filled in the fields while changing values on selector or a field. If false it may improve speed. Default true</td>
- </tr>
- <tr>
- <td><strong>onShow</strong></td>
- <td>function</td>
- <td>Callback function triggered when the color picker is shown</td>
- </tr>
- <tr>
- <td><strong>onBeforeShow</strong></td>
- <td>function</td>
- <td>Callback function triggered before the color picker is shown</td>
- </tr>
- <tr>
- <td><strong>onHide</strong></td>
- <td>function</td>
- <td>Callback function triggered when the color picker is hidden</td>
- </tr>
- <tr>
- <td><strong>onChange</strong></td>
- <td>function</td>
- <td>Callback function triggered when the color is changed</td>
- </tr>
- <tr>
- <td><strong>onSubmit</strong></td>
- <td>function</td>
- <td>Callback function triggered when the color it is chosen</td>
- </tr>
- </table>
- <h3>Set color</h3>
- <p>If you want to set a new color.</p>
- <pre>$('input').ColorPickerSetColor(color);</pre>
- <p>The 'color' argument is the same format as the option color, string for hex color or hash for RGB and HSB ({r:255, r:0, b:0}).</p>
- </div>
- </div>
- </div>
-</body>
-</html>
diff --git a/library/colorpicker/js/colorpicker.js b/library/colorpicker/js/colorpicker.js deleted file mode 100644 index 10a2b2244..000000000 --- a/library/colorpicker/js/colorpicker.js +++ /dev/null @@ -1,484 +0,0 @@ -/**
- *
- * Color picker
- * Author: Stefan Petre www.eyecon.ro
- *
- * Dual licensed under the MIT and GPL licenses
- *
- */
-(function ($) {
- var ColorPicker = function () {
- var
- ids = {},
- inAction,
- charMin = 65,
- visible,
- tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
- defaults = {
- eventName: 'click',
- onShow: function () {},
- onBeforeShow: function(){},
- onHide: function () {},
- onChange: function () {},
- onSubmit: function () {},
- color: 'ff0000',
- livePreview: true,
- flat: false
- },
- fillRGBFields = function (hsb, cal) {
- var rgb = HSBToRGB(hsb);
- $(cal).data('colorpicker').fields
- .eq(1).val(rgb.r).end()
- .eq(2).val(rgb.g).end()
- .eq(3).val(rgb.b).end();
- },
- fillHSBFields = function (hsb, cal) {
- $(cal).data('colorpicker').fields
- .eq(4).val(hsb.h).end()
- .eq(5).val(hsb.s).end()
- .eq(6).val(hsb.b).end();
- },
- fillHexFields = function (hsb, cal) {
- $(cal).data('colorpicker').fields
- .eq(0).val(HSBToHex(hsb)).end();
- },
- setSelector = function (hsb, cal) {
- $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
- $(cal).data('colorpicker').selectorIndic.css({
- left: parseInt(150 * hsb.s/100, 10),
- top: parseInt(150 * (100-hsb.b)/100, 10)
- });
- },
- setHue = function (hsb, cal) {
- $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
- },
- setCurrentColor = function (hsb, cal) {
- $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
- },
- setNewColor = function (hsb, cal) {
- $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
- },
- keyDown = function (ev) {
- var pressedKey = ev.charCode || ev.keyCode || -1;
- if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
- return false;
- }
- var cal = $(this).parent().parent();
- if (cal.data('colorpicker').livePreview === true) {
- change.apply(this);
- }
- },
- change = function (ev) {
- var cal = $(this).parent().parent(), col;
- if (this.parentNode.className.indexOf('_hex') > 0) {
- cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
- } else if (this.parentNode.className.indexOf('_hsb') > 0) {
- cal.data('colorpicker').color = col = fixHSB({
- h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
- s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
- b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
- });
- } else {
- cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
- r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
- g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
- b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
- }));
- }
- if (ev) {
- fillRGBFields(col, cal.get(0));
- fillHexFields(col, cal.get(0));
- fillHSBFields(col, cal.get(0));
- }
- setSelector(col, cal.get(0));
- setHue(col, cal.get(0));
- setNewColor(col, cal.get(0));
- cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
- },
- blur = function (ev) {
- var cal = $(this).parent().parent();
- cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
- },
- focus = function () {
- charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
- $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
- $(this).parent().addClass('colorpicker_focus');
- },
- downIncrement = function (ev) {
- var field = $(this).parent().find('input').focus();
- var current = {
- el: $(this).parent().addClass('colorpicker_slider'),
- max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
- y: ev.pageY,
- field: field,
- val: parseInt(field.val(), 10),
- preview: $(this).parent().parent().data('colorpicker').livePreview
- };
- $(document).bind('mouseup', current, upIncrement);
- $(document).bind('mousemove', current, moveIncrement);
- },
- moveIncrement = function (ev) {
- ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
- if (ev.data.preview) {
- change.apply(ev.data.field.get(0), [true]);
- }
- return false;
- },
- upIncrement = function (ev) {
- change.apply(ev.data.field.get(0), [true]);
- ev.data.el.removeClass('colorpicker_slider').find('input').focus();
- $(document).unbind('mouseup', upIncrement);
- $(document).unbind('mousemove', moveIncrement);
- return false;
- },
- downHue = function (ev) {
- var current = {
- cal: $(this).parent(),
- y: $(this).offset().top
- };
- current.preview = current.cal.data('colorpicker').livePreview;
- $(document).bind('mouseup', current, upHue);
- $(document).bind('mousemove', current, moveHue);
- },
- moveHue = function (ev) {
- change.apply(
- ev.data.cal.data('colorpicker')
- .fields
- .eq(4)
- .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
- .get(0),
- [ev.data.preview]
- );
- return false;
- },
- upHue = function (ev) {
- fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
- fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
- $(document).unbind('mouseup', upHue);
- $(document).unbind('mousemove', moveHue);
- return false;
- },
- downSelector = function (ev) {
- var current = {
- cal: $(this).parent(),
- pos: $(this).offset()
- };
- current.preview = current.cal.data('colorpicker').livePreview;
- $(document).bind('mouseup', current, upSelector);
- $(document).bind('mousemove', current, moveSelector);
- },
- moveSelector = function (ev) {
- change.apply(
- ev.data.cal.data('colorpicker')
- .fields
- .eq(6)
- .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
- .end()
- .eq(5)
- .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
- .get(0),
- [ev.data.preview]
- );
- return false;
- },
- upSelector = function (ev) {
- fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
- fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
- $(document).unbind('mouseup', upSelector);
- $(document).unbind('mousemove', moveSelector);
- return false;
- },
- enterSubmit = function (ev) {
- $(this).addClass('colorpicker_focus');
- },
- leaveSubmit = function (ev) {
- $(this).removeClass('colorpicker_focus');
- },
- clickSubmit = function (ev) {
- var cal = $(this).parent();
- var col = cal.data('colorpicker').color;
- cal.data('colorpicker').origColor = col;
- setCurrentColor(col, cal.get(0));
- cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
- },
- show = function (ev) {
- var cal = $('#' + $(this).data('colorpickerId'));
- cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
- var pos = $(this).offset();
- var viewPort = getViewport();
- var top = pos.top + this.offsetHeight;
- var left = pos.left;
- if (top + 176 > viewPort.t + viewPort.h) {
- top -= this.offsetHeight + 176;
- }
- if (left + 356 > viewPort.l + viewPort.w) {
- left -= 356;
- }
- cal.css({left: left + 'px', top: top + 'px'});
- if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
- cal.show();
- }
- $(document).bind('mousedown', {cal: cal}, hide);
- return false;
- },
- hide = function (ev) {
- if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
- if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
- ev.data.cal.hide();
- }
- $(document).unbind('mousedown', hide);
- }
- },
- isChildOf = function(parentEl, el, container) {
- if (parentEl == el) {
- return true;
- }
- if (parentEl.contains) {
- return parentEl.contains(el);
- }
- if ( parentEl.compareDocumentPosition ) {
- return !!(parentEl.compareDocumentPosition(el) & 16);
- }
- var prEl = el.parentNode;
- while(prEl && prEl != container) {
- if (prEl == parentEl)
- return true;
- prEl = prEl.parentNode;
- }
- return false;
- },
- getViewport = function () {
- var m = document.compatMode == 'CSS1Compat';
- return {
- l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
- t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
- w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
- h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
- };
- },
- fixHSB = function (hsb) {
- return {
- h: Math.min(360, Math.max(0, hsb.h)),
- s: Math.min(100, Math.max(0, hsb.s)),
- b: Math.min(100, Math.max(0, hsb.b))
- };
- },
- fixRGB = function (rgb) {
- return {
- r: Math.min(255, Math.max(0, rgb.r)),
- g: Math.min(255, Math.max(0, rgb.g)),
- b: Math.min(255, Math.max(0, rgb.b))
- };
- },
- fixHex = function (hex) {
- var len = 6 - hex.length;
- if (len > 0) {
- var o = [];
- for (var i=0; i<len; i++) {
- o.push('0');
- }
- o.push(hex);
- hex = o.join('');
- }
- return hex;
- },
- HexToRGB = function (hex) {
- var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
- return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
- },
- HexToHSB = function (hex) {
- return RGBToHSB(HexToRGB(hex));
- },
- RGBToHSB = function (rgb) {
- var hsb = {
- h: 0,
- s: 0,
- b: 0
- };
- var min = Math.min(rgb.r, rgb.g, rgb.b);
- var max = Math.max(rgb.r, rgb.g, rgb.b);
- var delta = max - min;
- hsb.b = max;
- if (max != 0) {
-
- }
- hsb.s = max != 0 ? 255 * delta / max : 0;
- if (hsb.s != 0) {
- if (rgb.r == max) {
- hsb.h = (rgb.g - rgb.b) / delta;
- } else if (rgb.g == max) {
- hsb.h = 2 + (rgb.b - rgb.r) / delta;
- } else {
- hsb.h = 4 + (rgb.r - rgb.g) / delta;
- }
- } else {
- hsb.h = -1;
- }
- hsb.h *= 60;
- if (hsb.h < 0) {
- hsb.h += 360;
- }
- hsb.s *= 100/255;
- hsb.b *= 100/255;
- return hsb;
- },
- HSBToRGB = function (hsb) {
- var rgb = {};
- var h = Math.round(hsb.h);
- var s = Math.round(hsb.s*255/100);
- var v = Math.round(hsb.b*255/100);
- if(s == 0) {
- rgb.r = rgb.g = rgb.b = v;
- } else {
- var t1 = v;
- var t2 = (255-s)*v/255;
- var t3 = (t1-t2)*(h%60)/60;
- if(h==360) h = 0;
- if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
- else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
- else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
- else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
- else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
- else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
- else {rgb.r=0; rgb.g=0; rgb.b=0}
- }
- return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
- },
- RGBToHex = function (rgb) {
- var hex = [
- rgb.r.toString(16),
- rgb.g.toString(16),
- rgb.b.toString(16)
- ];
- $.each(hex, function (nr, val) {
- if (val.length == 1) {
- hex[nr] = '0' + val;
- }
- });
- return hex.join('');
- },
- HSBToHex = function (hsb) {
- return RGBToHex(HSBToRGB(hsb));
- },
- restoreOriginal = function () {
- var cal = $(this).parent();
- var col = cal.data('colorpicker').origColor;
- cal.data('colorpicker').color = col;
- fillRGBFields(col, cal.get(0));
- fillHexFields(col, cal.get(0));
- fillHSBFields(col, cal.get(0));
- setSelector(col, cal.get(0));
- setHue(col, cal.get(0));
- setNewColor(col, cal.get(0));
- };
- return {
- init: function (opt) {
- opt = $.extend({}, defaults, opt||{});
- if (typeof opt.color == 'string') {
- opt.color = HexToHSB(opt.color);
- } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
- opt.color = RGBToHSB(opt.color);
- } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
- opt.color = fixHSB(opt.color);
- } else {
- return this;
- }
- return this.each(function () {
- if (!$(this).data('colorpickerId')) {
- var options = $.extend({}, opt);
- options.origColor = opt.color;
- var id = 'collorpicker_' + parseInt(Math.random() * 1000);
- $(this).data('colorpickerId', id);
- var cal = $(tpl).attr('id', id);
- if (options.flat) {
- cal.appendTo(this).show();
- } else {
- cal.appendTo(document.body);
- }
- options.fields = cal
- .find('input')
- .bind('keyup', keyDown)
- .bind('change', change)
- .bind('blur', blur)
- .bind('focus', focus);
- cal
- .find('span').bind('mousedown', downIncrement).end()
- .find('>div.colorpicker_current_color').bind('click', restoreOriginal);
- options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
- options.selectorIndic = options.selector.find('div div');
- options.el = this;
- options.hue = cal.find('div.colorpicker_hue div');
- cal.find('div.colorpicker_hue').bind('mousedown', downHue);
- options.newColor = cal.find('div.colorpicker_new_color');
- options.currentColor = cal.find('div.colorpicker_current_color');
- cal.data('colorpicker', options);
- cal.find('div.colorpicker_submit')
- .bind('mouseenter', enterSubmit)
- .bind('mouseleave', leaveSubmit)
- .bind('click', clickSubmit);
- fillRGBFields(options.color, cal.get(0));
- fillHSBFields(options.color, cal.get(0));
- fillHexFields(options.color, cal.get(0));
- setHue(options.color, cal.get(0));
- setSelector(options.color, cal.get(0));
- setCurrentColor(options.color, cal.get(0));
- setNewColor(options.color, cal.get(0));
- if (options.flat) {
- cal.css({
- position: 'relative',
- display: 'block'
- });
- } else {
- $(this).bind(options.eventName, show);
- }
- }
- });
- },
- showPicker: function() {
- return this.each( function () {
- if ($(this).data('colorpickerId')) {
- show.apply(this);
- }
- });
- },
- hidePicker: function() {
- return this.each( function () {
- if ($(this).data('colorpickerId')) {
- $('#' + $(this).data('colorpickerId')).hide();
- }
- });
- },
- setColor: function(col) {
- if (typeof col == 'string') {
- col = HexToHSB(col);
- } else if (col.r != undefined && col.g != undefined && col.b != undefined) {
- col = RGBToHSB(col);
- } else if (col.h != undefined && col.s != undefined && col.b != undefined) {
- col = fixHSB(col);
- } else {
- return this;
- }
- return this.each(function(){
- if ($(this).data('colorpickerId')) {
- var cal = $('#' + $(this).data('colorpickerId'));
- cal.data('colorpicker').color = col;
- cal.data('colorpicker').origColor = col;
- fillRGBFields(col, cal.get(0));
- fillHSBFields(col, cal.get(0));
- fillHexFields(col, cal.get(0));
- setHue(col, cal.get(0));
- setSelector(col, cal.get(0));
- setCurrentColor(col, cal.get(0));
- setNewColor(col, cal.get(0));
- }
- });
- }
- };
- }();
- $.fn.extend({
- ColorPicker: ColorPicker.init,
- ColorPickerHide: ColorPicker.hidePicker,
- ColorPickerShow: ColorPicker.showPicker,
- ColorPickerSetColor: ColorPicker.setColor
- });
-})(jQuery)
\ No newline at end of file diff --git a/library/colorpicker/js/eye.js b/library/colorpicker/js/eye.js deleted file mode 100644 index ea70e643f..000000000 --- a/library/colorpicker/js/eye.js +++ /dev/null @@ -1,34 +0,0 @@ -/**
- *
- * Zoomimage
- * Author: Stefan Petre www.eyecon.ro
- *
- */
-(function($){
- var EYE = window.EYE = function() {
- var _registered = {
- init: []
- };
- return {
- init: function() {
- $.each(_registered.init, function(nr, fn){
- fn.call();
- });
- },
- extend: function(prop) {
- for (var i in prop) {
- if (prop[i] != undefined) {
- this[i] = prop[i];
- }
- }
- },
- register: function(fn, type) {
- if (!_registered[type]) {
- _registered[type] = [];
- }
- _registered[type].push(fn);
- }
- };
- }();
- $(EYE.init);
-})(jQuery);
diff --git a/library/colorpicker/js/layout.js b/library/colorpicker/js/layout.js deleted file mode 100644 index e0dfb8f33..000000000 --- a/library/colorpicker/js/layout.js +++ /dev/null @@ -1,67 +0,0 @@ -(function($){
- var initLayout = function() {
- var hash = window.location.hash.replace('#', '');
- var currentTab = $('ul.navigationTabs a')
- .bind('click', showTab)
- .filter('a[rel=' + hash + ']');
- if (currentTab.size() == 0) {
- currentTab = $('ul.navigationTabs a:first');
- }
- showTab.apply(currentTab.get(0));
- $('#colorpickerHolder').ColorPicker({flat: true});
- $('#colorpickerHolder2').ColorPicker({
- flat: true,
- color: '#00ff00',
- onSubmit: function(hsb, hex, rgb) {
- $('#colorSelector2 div').css('backgroundColor', '#' + hex);
- }
- });
- $('#colorpickerHolder2>div').css('position', 'absolute');
- var widt = false;
- $('#colorSelector2').bind('click', function() {
- $('#colorpickerHolder2').stop().animate({height: widt ? 0 : 173}, 500);
- widt = !widt;
- });
- $('#colorpickerField1, #colorpickerField2, #colorpickerField3').ColorPicker({
- onSubmit: function(hsb, hex, rgb, el) {
- $(el).val(hex);
- $(el).ColorPickerHide();
- },
- onBeforeShow: function () {
- $(this).ColorPickerSetColor(this.value);
- }
- })
- .bind('keyup', function(){
- $(this).ColorPickerSetColor(this.value);
- });
- $('#colorSelector').ColorPicker({
- color: '#0000ff',
- onShow: function (colpkr) {
- $(colpkr).fadeIn(500);
- return false;
- },
- onHide: function (colpkr) {
- $(colpkr).fadeOut(500);
- return false;
- },
- onChange: function (hsb, hex, rgb) {
- $('#colorSelector div').css('backgroundColor', '#' + hex);
- }
- });
- };
-
- var showTab = function(e) {
- var tabIndex = $('ul.navigationTabs a')
- .removeClass('active')
- .index(this);
- $(this)
- .addClass('active')
- .blur();
- $('div.tab')
- .hide()
- .eq(tabIndex)
- .show();
- };
-
- EYE.register(initLayout, 'init');
-})(jQuery)
\ No newline at end of file diff --git a/library/colorpicker/js/utils.js b/library/colorpicker/js/utils.js deleted file mode 100644 index cc7ce14ec..000000000 --- a/library/colorpicker/js/utils.js +++ /dev/null @@ -1,252 +0,0 @@ -/**
- *
- * Utilities
- * Author: Stefan Petre www.eyecon.ro
- *
- */
-(function($) {
-EYE.extend({
- getPosition : function(e, forceIt)
- {
- var x = 0;
- var y = 0;
- var es = e.style;
- var restoreStyles = false;
- if (forceIt && jQuery.curCSS(e,'display') == 'none') {
- var oldVisibility = es.visibility;
- var oldPosition = es.position;
- restoreStyles = true;
- es.visibility = 'hidden';
- es.display = 'block';
- es.position = 'absolute';
- }
- var el = e;
- if (el.getBoundingClientRect) { // IE
- var box = el.getBoundingClientRect();
- x = box.left + Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) - 2;
- y = box.top + Math.max(document.documentElement.scrollTop, document.body.scrollTop) - 2;
- } else {
- x = el.offsetLeft;
- y = el.offsetTop;
- el = el.offsetParent;
- if (e != el) {
- while (el) {
- x += el.offsetLeft;
- y += el.offsetTop;
- el = el.offsetParent;
- }
- }
- if (jQuery.browser.safari && jQuery.curCSS(e, 'position') == 'absolute' ) {
- x -= document.body.offsetLeft;
- y -= document.body.offsetTop;
- }
- el = e.parentNode;
- while (el && el.tagName.toUpperCase() != 'BODY' && el.tagName.toUpperCase() != 'HTML')
- {
- if (jQuery.curCSS(el, 'display') != 'inline') {
- x -= el.scrollLeft;
- y -= el.scrollTop;
- }
- el = el.parentNode;
- }
- }
- if (restoreStyles == true) {
- es.display = 'none';
- es.position = oldPosition;
- es.visibility = oldVisibility;
- }
- return {x:x, y:y};
- },
- getSize : function(e)
- {
- var w = parseInt(jQuery.curCSS(e,'width'), 10);
- var h = parseInt(jQuery.curCSS(e,'height'), 10);
- var wb = 0;
- var hb = 0;
- if (jQuery.curCSS(e, 'display') != 'none') {
- wb = e.offsetWidth;
- hb = e.offsetHeight;
- } else {
- var es = e.style;
- var oldVisibility = es.visibility;
- var oldPosition = es.position;
- es.visibility = 'hidden';
- es.display = 'block';
- es.position = 'absolute';
- wb = e.offsetWidth;
- hb = e.offsetHeight;
- es.display = 'none';
- es.position = oldPosition;
- es.visibility = oldVisibility;
- }
- return {w:w, h:h, wb:wb, hb:hb};
- },
- getClient : function(e)
- {
- var h, w;
- if (e) {
- w = e.clientWidth;
- h = e.clientHeight;
- } else {
- var de = document.documentElement;
- w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
- h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
- }
- return {w:w,h:h};
- },
- getScroll : function (e)
- {
- var t=0, l=0, w=0, h=0, iw=0, ih=0;
- if (e && e.nodeName.toLowerCase() != 'body') {
- t = e.scrollTop;
- l = e.scrollLeft;
- w = e.scrollWidth;
- h = e.scrollHeight;
- } else {
- if (document.documentElement) {
- t = document.documentElement.scrollTop;
- l = document.documentElement.scrollLeft;
- w = document.documentElement.scrollWidth;
- h = document.documentElement.scrollHeight;
- } else if (document.body) {
- t = document.body.scrollTop;
- l = document.body.scrollLeft;
- w = document.body.scrollWidth;
- h = document.body.scrollHeight;
- }
- if (typeof pageYOffset != 'undefined') {
- t = pageYOffset;
- l = pageXOffset;
- }
- iw = self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
- ih = self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
- }
- return { t: t, l: l, w: w, h: h, iw: iw, ih: ih };
- },
- getMargins : function(e, toInteger)
- {
- var t = jQuery.curCSS(e,'marginTop') || '';
- var r = jQuery.curCSS(e,'marginRight') || '';
- var b = jQuery.curCSS(e,'marginBottom') || '';
- var l = jQuery.curCSS(e,'marginLeft') || '';
- if (toInteger)
- return {
- t: parseInt(t, 10)||0,
- r: parseInt(r, 10)||0,
- b: parseInt(b, 10)||0,
- l: parseInt(l, 10)
- };
- else
- return {t: t, r: r, b: b, l: l};
- },
- getPadding : function(e, toInteger)
- {
- var t = jQuery.curCSS(e,'paddingTop') || '';
- var r = jQuery.curCSS(e,'paddingRight') || '';
- var b = jQuery.curCSS(e,'paddingBottom') || '';
- var l = jQuery.curCSS(e,'paddingLeft') || '';
- if (toInteger)
- return {
- t: parseInt(t, 10)||0,
- r: parseInt(r, 10)||0,
- b: parseInt(b, 10)||0,
- l: parseInt(l, 10)
- };
- else
- return {t: t, r: r, b: b, l: l};
- },
- getBorder : function(e, toInteger)
- {
- var t = jQuery.curCSS(e,'borderTopWidth') || '';
- var r = jQuery.curCSS(e,'borderRightWidth') || '';
- var b = jQuery.curCSS(e,'borderBottomWidth') || '';
- var l = jQuery.curCSS(e,'borderLeftWidth') || '';
- if (toInteger)
- return {
- t: parseInt(t, 10)||0,
- r: parseInt(r, 10)||0,
- b: parseInt(b, 10)||0,
- l: parseInt(l, 10)||0
- };
- else
- return {t: t, r: r, b: b, l: l};
- },
- traverseDOM : function(nodeEl, func)
- {
- func(nodeEl);
- nodeEl = nodeEl.firstChild;
- while(nodeEl){
- EYE.traverseDOM(nodeEl, func);
- nodeEl = nodeEl.nextSibling;
- }
- },
- getInnerWidth : function(el, scroll) {
- var offsetW = el.offsetWidth;
- return scroll ? Math.max(el.scrollWidth,offsetW) - offsetW + el.clientWidth:el.clientWidth;
- },
- getInnerHeight : function(el, scroll) {
- var offsetH = el.offsetHeight;
- return scroll ? Math.max(el.scrollHeight,offsetH) - offsetH + el.clientHeight:el.clientHeight;
- },
- getExtraWidth : function(el) {
- if($.boxModel)
- return (parseInt($.curCSS(el, 'paddingLeft'))||0)
- + (parseInt($.curCSS(el, 'paddingRight'))||0)
- + (parseInt($.curCSS(el, 'borderLeftWidth'))||0)
- + (parseInt($.curCSS(el, 'borderRightWidth'))||0);
- return 0;
- },
- getExtraHeight : function(el) {
- if($.boxModel)
- return (parseInt($.curCSS(el, 'paddingTop'))||0)
- + (parseInt($.curCSS(el, 'paddingBottom'))||0)
- + (parseInt($.curCSS(el, 'borderTopWidth'))||0)
- + (parseInt($.curCSS(el, 'borderBottomWidth'))||0);
- return 0;
- },
- isChildOf: function(parentEl, el, container) {
- if (parentEl == el) {
- return true;
- }
- if (!el || !el.nodeType || el.nodeType != 1) {
- return false;
- }
- if (parentEl.contains && !$.browser.safari) {
- return parentEl.contains(el);
- }
- if ( parentEl.compareDocumentPosition ) {
- return !!(parentEl.compareDocumentPosition(el) & 16);
- }
- var prEl = el.parentNode;
- while(prEl && prEl != container) {
- if (prEl == parentEl)
- return true;
- prEl = prEl.parentNode;
- }
- return false;
- },
- centerEl : function(el, axis)
- {
- var clientScroll = EYE.getScroll();
- var size = EYE.getSize(el);
- if (!axis || axis == 'vertically')
- $(el).css(
- {
- top: clientScroll.t + ((Math.min(clientScroll.h,clientScroll.ih) - size.hb)/2) + 'px'
- }
- );
- if (!axis || axis == 'horizontally')
- $(el).css(
- {
- left: clientScroll.l + ((Math.min(clientScroll.w,clientScroll.iw) - size.wb)/2) + 'px'
- }
- );
- }
-});
-if (!$.easing.easeout) {
- $.easing.easeout = function(p, n, firstNum, delta, duration) {
- return -delta * ((n=n/duration-1)*n*n*n - 1) + firstNum;
- };
-}
-
-})(jQuery);
\ No newline at end of file diff --git a/library/fancybox/blank.gif b/library/fancybox/blank.gif Binary files differdeleted file mode 100644 index 35d42e808..000000000 --- a/library/fancybox/blank.gif +++ /dev/null diff --git a/library/fancybox/fancy_close.png b/library/fancybox/fancy_close.png Binary files differdeleted file mode 100644 index 07035307a..000000000 --- a/library/fancybox/fancy_close.png +++ /dev/null diff --git a/library/fancybox/fancy_loading.png b/library/fancybox/fancy_loading.png Binary files differdeleted file mode 100644 index 250301796..000000000 --- a/library/fancybox/fancy_loading.png +++ /dev/null diff --git a/library/fancybox/fancy_nav_left.png b/library/fancybox/fancy_nav_left.png Binary files differdeleted file mode 100644 index ebaa6a4fd..000000000 --- a/library/fancybox/fancy_nav_left.png +++ /dev/null diff --git a/library/fancybox/fancy_nav_right.png b/library/fancybox/fancy_nav_right.png Binary files differdeleted file mode 100644 index 873294e96..000000000 --- a/library/fancybox/fancy_nav_right.png +++ /dev/null diff --git a/library/fancybox/fancy_shadow_e.png b/library/fancybox/fancy_shadow_e.png Binary files differdeleted file mode 100644 index 2eda08936..000000000 --- a/library/fancybox/fancy_shadow_e.png +++ /dev/null diff --git a/library/fancybox/fancy_shadow_n.png b/library/fancybox/fancy_shadow_n.png Binary files differdeleted file mode 100644 index 69aa10e23..000000000 --- a/library/fancybox/fancy_shadow_n.png +++ /dev/null diff --git a/library/fancybox/fancy_shadow_ne.png b/library/fancybox/fancy_shadow_ne.png Binary files differdeleted file mode 100644 index 79f6980a3..000000000 --- a/library/fancybox/fancy_shadow_ne.png +++ /dev/null diff --git a/library/fancybox/fancy_shadow_nw.png b/library/fancybox/fancy_shadow_nw.png Binary files differdeleted file mode 100644 index 7182cd938..000000000 --- a/library/fancybox/fancy_shadow_nw.png +++ /dev/null diff --git a/library/fancybox/fancy_shadow_s.png b/library/fancybox/fancy_shadow_s.png Binary files differdeleted file mode 100644 index d8858bfb7..000000000 --- a/library/fancybox/fancy_shadow_s.png +++ /dev/null diff --git a/library/fancybox/fancy_shadow_se.png b/library/fancybox/fancy_shadow_se.png Binary files differdeleted file mode 100644 index 541e3ffd3..000000000 --- a/library/fancybox/fancy_shadow_se.png +++ /dev/null diff --git a/library/fancybox/fancy_shadow_sw.png b/library/fancybox/fancy_shadow_sw.png Binary files differdeleted file mode 100644 index b451689fa..000000000 --- a/library/fancybox/fancy_shadow_sw.png +++ /dev/null diff --git a/library/fancybox/fancy_shadow_w.png b/library/fancybox/fancy_shadow_w.png Binary files differdeleted file mode 100644 index 8a4e4a887..000000000 --- a/library/fancybox/fancy_shadow_w.png +++ /dev/null diff --git a/library/fancybox/fancy_title_left.png b/library/fancybox/fancy_title_left.png Binary files differdeleted file mode 100644 index 6049223d1..000000000 --- a/library/fancybox/fancy_title_left.png +++ /dev/null diff --git a/library/fancybox/fancy_title_main.png b/library/fancybox/fancy_title_main.png Binary files differdeleted file mode 100644 index 8044271f2..000000000 --- a/library/fancybox/fancy_title_main.png +++ /dev/null diff --git a/library/fancybox/fancy_title_over.png b/library/fancybox/fancy_title_over.png Binary files differdeleted file mode 100644 index d9f458f4b..000000000 --- a/library/fancybox/fancy_title_over.png +++ /dev/null diff --git a/library/fancybox/fancy_title_right.png b/library/fancybox/fancy_title_right.png Binary files differdeleted file mode 100644 index e36d9db2a..000000000 --- a/library/fancybox/fancy_title_right.png +++ /dev/null diff --git a/library/fancybox/fancybox-x.png b/library/fancybox/fancybox-x.png Binary files differdeleted file mode 100644 index c2130f869..000000000 --- a/library/fancybox/fancybox-x.png +++ /dev/null diff --git a/library/fancybox/fancybox-y.png b/library/fancybox/fancybox-y.png Binary files differdeleted file mode 100644 index 7ef399b99..000000000 --- a/library/fancybox/fancybox-y.png +++ /dev/null diff --git a/library/fancybox/fancybox.png b/library/fancybox/fancybox.png Binary files differdeleted file mode 100644 index 65e14f68f..000000000 --- a/library/fancybox/fancybox.png +++ /dev/null diff --git a/library/fancybox/jquery.easing-1.3.pack.js b/library/fancybox/jquery.easing-1.3.pack.js deleted file mode 100644 index 9028179e7..000000000 --- a/library/fancybox/jquery.easing-1.3.pack.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ - * - * Uses the built in easing capabilities added In jQuery 1.1 - * to offer multiple easing options - * - * TERMS OF USE - jQuery Easing - * - * Open source under the BSD License. - * - * Copyright © 2008 George McGinley Smith - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the author nor the names of contributors may be used to endorse - * or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * -*/ - -// t: current time, b: begInnIng value, c: change In value, d: duration -eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{})) - -/* - * - * TERMS OF USE - EASING EQUATIONS - * - * Open source under the BSD License. - * - * Copyright © 2001 Robert Penner - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the author nor the names of contributors may be used to endorse - * or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ diff --git a/library/fancybox/jquery.fancybox-1.3.4.css b/library/fancybox/jquery.fancybox-1.3.4.css deleted file mode 100644 index 6f53d8f4a..000000000 --- a/library/fancybox/jquery.fancybox-1.3.4.css +++ /dev/null @@ -1,359 +0,0 @@ -/*
- * FancyBox - jQuery Plugin
- * Simple and fancy lightbox alternative
- *
- * Examples and documentation at: http://fancybox.net
- *
- * Copyright (c) 2008 - 2010 Janis Skarnelis
- * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
- *
- * Version: 1.3.4 (11/11/2010)
- * Requires: jQuery v1.3+
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- */
-
-#fancybox-loading {
- position: fixed;
- top: 50%;
- left: 50%;
- width: 40px;
- height: 40px;
- margin-top: -20px;
- margin-left: -20px;
- cursor: pointer;
- overflow: hidden;
- z-index: 1104;
- display: none;
-}
-
-#fancybox-loading div {
- position: absolute;
- top: 0;
- left: 0;
- width: 40px;
- height: 480px;
- background-image: url('fancybox.png');
-}
-
-#fancybox-overlay {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- z-index: 1100;
- display: none;
-}
-
-#fancybox-tmp {
- padding: 0;
- margin: 0;
- border: 0;
- overflow: auto;
- display: none;
-}
-
-#fancybox-wrap {
- position: absolute;
- top: 0;
- left: 0;
- padding: 20px;
- z-index: 1101;
- outline: none;
- display: none;
-}
-
-#fancybox-outer {
- position: relative;
- width: 100%;
- height: 100%;
- background: #fff;
-}
-
-#fancybox-content {
- width: 0;
- height: 0;
- padding: 0;
- outline: none;
- position: relative;
- overflow: hidden;
- z-index: 1102;
- border: 0px solid #fff;
-}
-
-#fancybox-hide-sel-frame {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: transparent;
- z-index: 1101;
-}
-
-#fancybox-close {
- position: absolute;
- top: -15px;
- right: -15px;
- width: 30px;
- height: 30px;
- background: transparent url('fancybox.png') -40px 0px;
- cursor: pointer;
- z-index: 1103;
- display: none;
-}
-
-#fancybox-error {
- color: #444;
- font: normal 12px/20px Arial;
- padding: 14px;
- margin: 0;
-}
-
-#fancybox-img {
- width: 100%;
- height: 100%;
- padding: 0;
- margin: 0;
- border: none;
- outline: none;
- line-height: 0;
- vertical-align: top;
-}
-
-#fancybox-frame {
- width: 100%;
- height: 100%;
- border: none;
- display: block;
-}
-
-#fancybox-left, #fancybox-right {
- position: absolute;
- bottom: 0px;
- height: 100%;
- width: 35%;
- cursor: pointer;
- outline: none;
- background: transparent url('blank.gif');
- z-index: 1102;
- display: none;
-}
-
-#fancybox-left {
- left: 0px;
-}
-
-#fancybox-right {
- right: 0px;
-}
-
-#fancybox-left-ico, #fancybox-right-ico {
- position: absolute;
- top: 50%;
- left: -9999px;
- width: 30px;
- height: 30px;
- margin-top: -15px;
- cursor: pointer;
- z-index: 1102;
- display: block;
-}
-
-#fancybox-left-ico {
- background-image: url('fancybox.png');
- background-position: -40px -30px;
-}
-
-#fancybox-right-ico {
- background-image: url('fancybox.png');
- background-position: -40px -60px;
-}
-
-#fancybox-left:hover, #fancybox-right:hover {
- visibility: visible; /* IE6 */
-}
-
-#fancybox-left:hover span {
- left: 20px;
-}
-
-#fancybox-right:hover span {
- left: auto;
- right: 20px;
-}
-
-.fancybox-bg {
- position: absolute;
- padding: 0;
- margin: 0;
- border: 0;
- width: 20px;
- height: 20px;
- z-index: 1001;
-}
-
-#fancybox-bg-n {
- top: -20px;
- left: 0;
- width: 100%;
- background-image: url('fancybox-x.png');
-}
-
-#fancybox-bg-ne {
- top: -20px;
- right: -20px;
- background-image: url('fancybox.png');
- background-position: -40px -162px;
-}
-
-#fancybox-bg-e {
- top: 0;
- right: -20px;
- height: 100%;
- background-image: url('fancybox-y.png');
- background-position: -20px 0px;
-}
-
-#fancybox-bg-se {
- bottom: -20px;
- right: -20px;
- background-image: url('fancybox.png');
- background-position: -40px -182px;
-}
-
-#fancybox-bg-s {
- bottom: -20px;
- left: 0;
- width: 100%;
- background-image: url('fancybox-x.png');
- background-position: 0px -20px;
-}
-
-#fancybox-bg-sw {
- bottom: -20px;
- left: -20px;
- background-image: url('fancybox.png');
- background-position: -40px -142px;
-}
-
-#fancybox-bg-w {
- top: 0;
- left: -20px;
- height: 100%;
- background-image: url('fancybox-y.png');
-}
-
-#fancybox-bg-nw {
- top: -20px;
- left: -20px;
- background-image: url('fancybox.png');
- background-position: -40px -122px;
-}
-
-#fancybox-title {
- font-family: Helvetica;
- font-size: 12px;
- z-index: 1102;
-}
-
-.fancybox-title-inside {
- padding-bottom: 10px;
- text-align: center;
- color: #333;
- background: #fff;
- position: relative;
-}
-
-.fancybox-title-outside {
- padding-top: 10px;
- color: #fff;
-}
-
-.fancybox-title-over {
- position: absolute;
- bottom: 0;
- left: 0;
- color: #FFF;
- text-align: left;
-}
-
-#fancybox-title-over {
- padding: 10px;
- background-image: url('fancy_title_over.png');
- display: block;
-}
-
-.fancybox-title-float {
- position: absolute;
- left: 0;
- bottom: -20px;
- height: 32px;
-}
-
-#fancybox-title-float-wrap {
- border: none;
- border-collapse: collapse;
- width: auto;
-}
-
-#fancybox-title-float-wrap td {
- border: none;
- white-space: nowrap;
-}
-
-#fancybox-title-float-left {
- padding: 0 0 0 15px;
- background: url('fancybox.png') -40px -90px no-repeat;
-}
-
-#fancybox-title-float-main {
- color: #FFF;
- line-height: 29px;
- font-weight: bold;
- padding: 0 0 3px 0;
- background: url('fancybox-x.png') 0px -40px;
-}
-
-#fancybox-title-float-right {
- padding: 0 0 0 15px;
- background: url('fancybox.png') -55px -90px no-repeat;
-}
-
-/* IE6 */
-
-.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
-
-.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
-.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
-
-.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
-.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
-.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
-.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
-
-.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
- height: expression(this.parentNode.clientHeight + "px");
-}
-
-#fancybox-loading.fancybox-ie6 {
- position: absolute; margin-top: 0;
- top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
-}
-
-#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
-
-/* IE6, IE7, IE8 */
-
-.fancybox-ie .fancybox-bg { background: transparent !important; }
-
-.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
\ No newline at end of file diff --git a/library/fancybox/jquery.fancybox-1.3.4.js b/library/fancybox/jquery.fancybox-1.3.4.js deleted file mode 100644 index 43e2cd56b..000000000 --- a/library/fancybox/jquery.fancybox-1.3.4.js +++ /dev/null @@ -1,1157 +0,0 @@ -/*
- * FancyBox - jQuery Plugin
- * Simple and fancy lightbox alternative
- *
- * Examples and documentation at: http://fancybox.net
- *
- * Copyright (c) 2008 - 2010 Janis Skarnelis
- * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
- *
- * Version: 1.3.4 (11/11/2010)
- * Requires: jQuery v1.3+
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- */
-
-;(function($) {
- var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
-
- selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
-
- ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,
-
- loadingTimer, loadingFrame = 1,
-
- titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
-
- isIE6 = false,
-// $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
-
- /*
- * Private methods
- */
-
- _abort = function() {
- loading.hide();
-
- imgPreloader.onerror = imgPreloader.onload = null;
-
- if (ajaxLoader) {
- ajaxLoader.abort();
- }
-
- tmp.empty();
- },
-
- _error = function() {
- if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
- loading.hide();
- busy = false;
- return;
- }
-
- selectedOpts.titleShow = false;
-
- selectedOpts.width = 'auto';
- selectedOpts.height = 'auto';
-
- tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );
-
- _process_inline();
- },
-
- _start = function() {
- var obj = selectedArray[ selectedIndex ],
- href,
- type,
- title,
- str,
- emb,
- ret;
-
- _abort();
-
- selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
-
- ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
-
- if (ret === false) {
- busy = false;
- return;
- } else if (typeof ret == 'object') {
- selectedOpts = $.extend(selectedOpts, ret);
- }
-
- title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
-
- if (obj.nodeName && !selectedOpts.orig) {
- selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
- }
-
- if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
- title = selectedOpts.orig.attr('alt');
- }
-
- href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
-
- if ((/^(?:javascript)/i).test(href) || href == '#') {
- href = null;
- }
-
- if (selectedOpts.type) {
- type = selectedOpts.type;
-
- if (!href) {
- href = selectedOpts.content;
- }
-
- } else if (selectedOpts.content) {
- type = 'html';
-
- } else if (href) {
- if (href.match(imgRegExp)) {
- type = 'image';
-
- } else if (href.match(swfRegExp)) {
- type = 'swf';
-
- } else if ($(obj).hasClass("iframe")) {
- type = 'iframe';
-
- } else if (href.indexOf("#") === 0) {
- type = 'inline';
-
- } else {
- type = 'ajax';
- }
- }
-
- if (!type) {
- _error();
- return;
- }
-
- if (type == 'inline') {
- obj = href.substr(href.indexOf("#"));
- type = $(obj).length > 0 ? 'inline' : 'ajax';
- }
-
- selectedOpts.type = type;
- selectedOpts.href = href;
- selectedOpts.title = title;
-
- if (selectedOpts.autoDimensions) {
- if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
- selectedOpts.width = 'auto';
- selectedOpts.height = 'auto';
- } else {
- selectedOpts.autoDimensions = false;
- }
- }
-
- if (selectedOpts.modal) {
- selectedOpts.overlayShow = true;
- selectedOpts.hideOnOverlayClick = false;
- selectedOpts.hideOnContentClick = false;
- selectedOpts.enableEscapeButton = false;
- selectedOpts.showCloseButton = false;
- }
-
- selectedOpts.padding = parseInt(selectedOpts.padding, 10);
- selectedOpts.margin = parseInt(selectedOpts.margin, 10);
-
- tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
-
- $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
- $(this).replaceWith(content.children());
- });
-
- switch (type) {
- case 'html' :
- tmp.html( selectedOpts.content );
- _process_inline();
- break;
-
- case 'inline' :
- if ( $(obj).parent().is('#fancybox-content') === true) {
- busy = false;
- return;
- }
-
- $('<div class="fancybox-inline-tmp" />')
- .hide()
- .insertBefore( $(obj) )
- .bind('fancybox-cleanup', function() {
- $(this).replaceWith(content.children());
- }).bind('fancybox-cancel', function() {
- $(this).replaceWith(tmp.children());
- });
-
- $(obj).appendTo(tmp);
-
- _process_inline();
- break;
-
- case 'image':
- busy = false;
-
- $.fancybox.showActivity();
-
- imgPreloader = new Image();
-
- imgPreloader.onerror = function() {
- _error();
- };
-
- imgPreloader.onload = function() {
- busy = true;
-
- imgPreloader.onerror = imgPreloader.onload = null;
-
- _process_image();
- };
-
- imgPreloader.src = href;
- break;
-
- case 'swf':
- selectedOpts.scrolling = 'no';
-
- str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
- emb = '';
-
- $.each(selectedOpts.swf, function(name, val) {
- str += '<param name="' + name + '" value="' + val + '"></param>';
- emb += ' ' + name + '="' + val + '"';
- });
-
- str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';
-
- tmp.html(str);
-
- _process_inline();
- break;
-
- case 'ajax':
- busy = false;
-
- $.fancybox.showActivity();
-
- selectedOpts.ajax.win = selectedOpts.ajax.success;
-
- ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
- url : href,
- data : selectedOpts.ajax.data || {},
- error : function(XMLHttpRequest, textStatus, errorThrown) {
- if ( XMLHttpRequest.status > 0 ) {
- _error();
- }
- },
- success : function(data, textStatus, XMLHttpRequest) {
- var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
- if (o.status == 200) {
- if ( typeof selectedOpts.ajax.win == 'function' ) {
- ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
-
- if (ret === false) {
- loading.hide();
- return;
- } else if (typeof ret == 'string' || typeof ret == 'object') {
- data = ret;
- }
- }
-
- tmp.html( data );
- _process_inline();
- }
- }
- }));
-
- break;
-
- case 'iframe':
- _show();
- break;
- }
- },
-
- _process_inline = function() {
- var
- w = selectedOpts.width,
- h = selectedOpts.height;
-
- if (w.toString().indexOf('%') > -1) {
- w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
-
- } else {
- w = w == 'auto' ? 'auto' : w + 'px';
- }
-
- if (h.toString().indexOf('%') > -1) {
- h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
-
- } else {
- h = h == 'auto' ? 'auto' : h + 'px';
- }
-
- tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
-
- selectedOpts.width = tmp.width();
- selectedOpts.height = tmp.height();
-
- _show();
- },
-
- _process_image = function() {
- selectedOpts.width = imgPreloader.width;
- selectedOpts.height = imgPreloader.height;
-
- $("<img />").attr({
- 'id' : 'fancybox-img',
- 'src' : imgPreloader.src,
- 'alt' : selectedOpts.title
- }).appendTo( tmp );
-
- _show();
- },
-
- _show = function() {
- var pos, equal;
-
- loading.hide();
-
- if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
- $.event.trigger('fancybox-cancel');
-
- busy = false;
- return;
- }
-
- busy = true;
-
- $(content.add( overlay )).unbind();
-
- $(window).unbind("resize.fb scroll.fb");
- $(document).unbind('keydown.fb');
-
- if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
- wrap.css('height', wrap.height());
- }
-
- currentArray = selectedArray;
- currentIndex = selectedIndex;
- currentOpts = selectedOpts;
-
- if (currentOpts.overlayShow) {
- overlay.css({
- 'background-color' : currentOpts.overlayColor,
- 'opacity' : currentOpts.overlayOpacity,
- 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
- 'height' : $(document).height()
- });
-
- if (!overlay.is(':visible')) {
- if (isIE6) {
- $('select:not(#fancybox-tmp select)').filter(function() {
- return this.style.visibility !== 'hidden';
- }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
- this.style.visibility = 'inherit';
- });
- }
-
- overlay.show();
- }
- } else {
- overlay.hide();
- }
-
- final_pos = _get_zoom_to();
-
- _process_title();
-
- if (wrap.is(":visible")) {
- $( close.add( nav_left ).add( nav_right ) ).hide();
-
- pos = wrap.position(),
-
- start_pos = {
- top : pos.top,
- left : pos.left,
- width : wrap.width(),
- height : wrap.height()
- };
-
- equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
-
- content.fadeTo(currentOpts.changeFade, 0.3, function() {
- var finish_resizing = function() {
- content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
- };
-
- $.event.trigger('fancybox-change');
-
- content
- .empty()
- .removeAttr('filter')
- .css({
- 'border-width' : currentOpts.padding,
- 'width' : final_pos.width - currentOpts.padding * 2,
- 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
- });
-
- if (equal) {
- finish_resizing();
-
- } else {
- fx.prop = 0;
-
- $(fx).animate({prop: 1}, {
- duration : currentOpts.changeSpeed,
- easing : currentOpts.easingChange,
- step : _draw,
- complete : finish_resizing
- });
- }
- });
-
- return;
- }
-
- wrap.removeAttr("style");
-
- content.css('border-width', currentOpts.padding);
-
- if (currentOpts.transitionIn == 'elastic') {
- start_pos = _get_zoom_from();
-
- content.html( tmp.contents() );
-
- wrap.show();
-
- if (currentOpts.opacity) {
- final_pos.opacity = 0;
- }
-
- fx.prop = 0;
-
- $(fx).animate({prop: 1}, {
- duration : currentOpts.speedIn,
- easing : currentOpts.easingIn,
- step : _draw,
- complete : _finish
- });
-
- return;
- }
-
- if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
- title.show();
- }
-
- content
- .css({
- 'width' : final_pos.width - currentOpts.padding * 2,
- 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
- })
- .html( tmp.contents() );
-
- wrap
- .css(final_pos)
- .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
- },
-
- _format_title = function(title) {
- if (title && title.length) {
- if (currentOpts.titlePosition == 'float') {
- return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
- }
-
- return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
- }
-
- return false;
- },
-
- _process_title = function() {
- titleStr = currentOpts.title || '';
- titleHeight = 0;
-
- title
- .empty()
- .removeAttr('style')
- .removeClass();
-
- if (currentOpts.titleShow === false) {
- title.hide();
- return;
- }
-
- titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
-
- if (!titleStr || titleStr === '') {
- title.hide();
- return;
- }
-
- title
- .addClass('fancybox-title-' + currentOpts.titlePosition)
- .html( titleStr )
- .appendTo( 'body' )
- .show();
-
- switch (currentOpts.titlePosition) {
- case 'inside':
- title
- .css({
- 'width' : final_pos.width - (currentOpts.padding * 2),
- 'marginLeft' : currentOpts.padding,
- 'marginRight' : currentOpts.padding
- });
-
- titleHeight = title.outerHeight(true);
-
- title.appendTo( outer );
-
- final_pos.height += titleHeight;
- break;
-
- case 'over':
- title
- .css({
- 'marginLeft' : currentOpts.padding,
- 'width' : final_pos.width - (currentOpts.padding * 2),
- 'bottom' : currentOpts.padding
- })
- .appendTo( outer );
- break;
-
- case 'float':
- title
- .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
- .appendTo( wrap );
- break;
-
- default:
- title
- .css({
- 'width' : final_pos.width - (currentOpts.padding * 2),
- 'paddingLeft' : currentOpts.padding,
- 'paddingRight' : currentOpts.padding
- })
- .appendTo( wrap );
- break;
- }
-
- title.hide();
- },
-
- _set_navigation = function() {
- if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
- $(document).bind('keydown.fb', function(e) {
- if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
- e.preventDefault();
- $.fancybox.close();
-
- } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
- e.preventDefault();
- $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
- }
- });
- }
-
- if (!currentOpts.showNavArrows) {
- nav_left.hide();
- nav_right.hide();
- return;
- }
-
- if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
- nav_left.show();
- }
-
- if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
- nav_right.show();
- }
- },
-
- _finish = function () {
- if (!$.support.opacity) {
- content.get(0).style.removeAttribute('filter');
- wrap.get(0).style.removeAttribute('filter');
- }
-
- if (selectedOpts.autoDimensions) {
- content.css('height', 'auto');
- }
-
- wrap.css('height', 'auto');
-
- if (titleStr && titleStr.length) {
- title.show();
- }
-
- if (currentOpts.showCloseButton) {
- close.show();
- }
-
- _set_navigation();
-
- if (currentOpts.hideOnContentClick) {
- content.bind('click', $.fancybox.close);
- }
-
- if (currentOpts.hideOnOverlayClick) {
- overlay.bind('click', $.fancybox.close);
- }
-
- $(window).bind("resize.fb", $.fancybox.resize);
-
- if (currentOpts.centerOnScroll) {
- $(window).bind("scroll.fb", $.fancybox.center);
- }
-
- if (currentOpts.type == 'iframe') {
- $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content);
- }
-
- wrap.show();
-
- busy = false;
-
- $.fancybox.center();
-
- currentOpts.onComplete(currentArray, currentIndex, currentOpts);
-
- _preload_images();
- },
-
- _preload_images = function() {
- var href,
- objNext;
-
- if ((currentArray.length -1) > currentIndex) {
- href = currentArray[ currentIndex + 1 ].href;
-
- if (typeof href !== 'undefined' && href.match(imgRegExp)) {
- objNext = new Image();
- objNext.src = href;
- }
- }
-
- if (currentIndex > 0) {
- href = currentArray[ currentIndex - 1 ].href;
-
- if (typeof href !== 'undefined' && href.match(imgRegExp)) {
- objNext = new Image();
- objNext.src = href;
- }
- }
- },
-
- _draw = function(pos) {
- var dim = {
- width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
- height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
-
- top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
- left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
- };
-
- if (typeof final_pos.opacity !== 'undefined') {
- dim.opacity = pos < 0.5 ? 0.5 : pos;
- }
-
- wrap.css(dim);
-
- content.css({
- 'width' : dim.width - currentOpts.padding * 2,
- 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
- });
- },
-
- _get_viewport = function() {
- return [
- $(window).width() - (currentOpts.margin * 2),
- $(window).height() - (currentOpts.margin * 2),
- $(document).scrollLeft() + currentOpts.margin,
- $(document).scrollTop() + currentOpts.margin
- ];
- },
-
- _get_zoom_to = function () {
- var view = _get_viewport(),
- to = {},
- resize = currentOpts.autoScale,
- double_padding = currentOpts.padding * 2,
- ratio;
-
- if (currentOpts.width.toString().indexOf('%') > -1) {
- to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
- } else {
- to.width = currentOpts.width + double_padding;
- }
-
- if (currentOpts.height.toString().indexOf('%') > -1) {
- to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
- } else {
- to.height = currentOpts.height + double_padding;
- }
-
- if (resize && (to.width > view[0] || to.height > view[1])) {
- if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
- ratio = (currentOpts.width ) / (currentOpts.height );
-
- if ((to.width ) > view[0]) {
- to.width = view[0];
- to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
- }
-
- if ((to.height) > view[1]) {
- to.height = view[1];
- to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
- }
-
- } else {
- to.width = Math.min(to.width, view[0]);
- to.height = Math.min(to.height, view[1]);
- }
- }
-
- to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
- to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
-
- return to;
- },
-
- _get_obj_pos = function(obj) {
- var pos = obj.offset();
-
- pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
- pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
-
- pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
- pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
-
- pos.width = obj.width();
- pos.height = obj.height();
-
- return pos;
- },
-
- _get_zoom_from = function() {
- var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
- from = {},
- pos,
- view;
-
- if (orig && orig.length) {
- pos = _get_obj_pos(orig);
-
- from = {
- width : pos.width + (currentOpts.padding * 2),
- height : pos.height + (currentOpts.padding * 2),
- top : pos.top - currentOpts.padding - 20,
- left : pos.left - currentOpts.padding - 20
- };
-
- } else {
- view = _get_viewport();
-
- from = {
- width : currentOpts.padding * 2,
- height : currentOpts.padding * 2,
- top : parseInt(view[3] + view[1] * 0.5, 10),
- left : parseInt(view[2] + view[0] * 0.5, 10)
- };
- }
-
- return from;
- },
-
- _animate_loading = function() {
- if (!loading.is(':visible')){
- clearInterval(loadingTimer);
- return;
- }
-
- $('div', loading).css('top', (loadingFrame * -40) + 'px');
-
- loadingFrame = (loadingFrame + 1) % 12;
- };
-
- /*
- * Public methods
- */
-
- $.fn.fancybox = function(options) {
- if (!$(this).length) {
- return this;
- }
-
- $(this)
- .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
- .unbind('click.fb')
- .bind('click.fb', function(e) {
- e.preventDefault();
-
- if (busy) {
- return;
- }
-
- busy = true;
-
- $(this).blur();
-
- selectedArray = [];
- selectedIndex = 0;
-
- var rel = $(this).attr('rel') || '';
-
- if (!rel || rel == '' || rel === 'nofollow') {
- selectedArray.push(this);
-
- } else {
- selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
- selectedIndex = selectedArray.index( this );
- }
-
- _start();
-
- return;
- });
-
- return this;
- };
-
- $.fancybox = function(obj) {
- var opts;
-
- if (busy) {
- return;
- }
-
- busy = true;
- opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
-
- selectedArray = [];
- selectedIndex = parseInt(opts.index, 10) || 0;
-
- if ($.isArray(obj)) {
- for (var i = 0, j = obj.length; i < j; i++) {
- if (typeof obj[i] == 'object') {
- $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
- } else {
- obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
- }
- }
-
- selectedArray = jQuery.merge(selectedArray, obj);
-
- } else {
- if (typeof obj == 'object') {
- $(obj).data('fancybox', $.extend({}, opts, obj));
- } else {
- obj = $({}).data('fancybox', $.extend({content : obj}, opts));
- }
-
- selectedArray.push(obj);
- }
-
- if (selectedIndex > selectedArray.length || selectedIndex < 0) {
- selectedIndex = 0;
- }
-
- _start();
- };
-
- $.fancybox.showActivity = function() {
- clearInterval(loadingTimer);
-
- loading.show();
- loadingTimer = setInterval(_animate_loading, 66);
- };
-
- $.fancybox.hideActivity = function() {
- loading.hide();
- };
-
- $.fancybox.next = function() {
- return $.fancybox.pos( currentIndex + 1);
- };
-
- $.fancybox.prev = function() {
- return $.fancybox.pos( currentIndex - 1);
- };
-
- $.fancybox.pos = function(pos) {
- if (busy) {
- return;
- }
-
- pos = parseInt(pos);
-
- selectedArray = currentArray;
-
- if (pos > -1 && pos < currentArray.length) {
- selectedIndex = pos;
- _start();
-
- } else if (currentOpts.cyclic && currentArray.length > 1) {
- selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
- _start();
- }
-
- return;
- };
-
- $.fancybox.cancel = function() {
- if (busy) {
- return;
- }
-
- busy = true;
-
- $.event.trigger('fancybox-cancel');
-
- _abort();
-
- selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
-
- busy = false;
- };
-
- // Note: within an iframe use - parent.$.fancybox.close();
- $.fancybox.close = function() {
- if (busy || wrap.is(':hidden')) {
- return;
- }
-
- busy = true;
-
- if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
- busy = false;
- return;
- }
-
- _abort();
-
- $(close.add( nav_left ).add( nav_right )).hide();
-
- $(content.add( overlay )).unbind();
-
- $(window).unbind("resize.fb scroll.fb");
- $(document).unbind('keydown.fb');
-
- content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
-
- if (currentOpts.titlePosition !== 'inside') {
- title.empty();
- }
-
- wrap.stop();
-
- function _cleanup() {
- overlay.fadeOut('fast');
-
- title.empty().hide();
- wrap.hide();
-
- $.event.trigger('fancybox-cleanup');
-
- content.empty();
-
- currentOpts.onClosed(currentArray, currentIndex, currentOpts);
-
- currentArray = selectedOpts = [];
- currentIndex = selectedIndex = 0;
- currentOpts = selectedOpts = {};
-
- busy = false;
- }
-
- if (currentOpts.transitionOut == 'elastic') {
- start_pos = _get_zoom_from();
-
- var pos = wrap.position();
-
- final_pos = {
- top : pos.top ,
- left : pos.left,
- width : wrap.width(),
- height : wrap.height()
- };
-
- if (currentOpts.opacity) {
- final_pos.opacity = 1;
- }
-
- title.empty().hide();
-
- fx.prop = 1;
-
- $(fx).animate({ prop: 0 }, {
- duration : currentOpts.speedOut,
- easing : currentOpts.easingOut,
- step : _draw,
- complete : _cleanup
- });
-
- } else {
- wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
- }
- };
-
- $.fancybox.resize = function() {
- if (overlay.is(':visible')) {
- overlay.css('height', $(document).height());
- }
-
- $.fancybox.center(true);
- };
-
- $.fancybox.center = function() {
- var view, align;
-
- if (busy) {
- return;
- }
-
- align = arguments[0] === true ? 1 : 0;
- view = _get_viewport();
-
- if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
- return;
- }
-
- wrap
- .stop()
- .animate({
- 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
- 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
- }, typeof arguments[0] == 'number' ? arguments[0] : 200);
- };
-
- $.fancybox.init = function() {
- if ($("#fancybox-wrap").length) {
- return;
- }
-
- $('body').append(
- tmp = $('<div id="fancybox-tmp"></div>'),
- loading = $('<div id="fancybox-loading"><div></div></div>'),
- overlay = $('<div id="fancybox-overlay"></div>'),
- wrap = $('<div id="fancybox-wrap"></div>')
- );
-
- outer = $('<div id="fancybox-outer"></div>')
- .append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
- .appendTo( wrap );
-
- outer.append(
- content = $('<div id="fancybox-content"></div>'),
- close = $('<a id="fancybox-close"></a>'),
- title = $('<div id="fancybox-title"></div>'),
-
- nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
- nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
- );
-
- close.click($.fancybox.close);
- loading.click($.fancybox.cancel);
-
- nav_left.click(function(e) {
- e.preventDefault();
- $.fancybox.prev();
- });
-
- nav_right.click(function(e) {
- e.preventDefault();
- $.fancybox.next();
- });
-
- if ($.fn.mousewheel) {
- wrap.bind('mousewheel.fb', function(e, delta) {
- if (busy) {
- e.preventDefault();
-
- } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
- e.preventDefault();
- $.fancybox[ delta > 0 ? 'prev' : 'next']();
- }
- });
- }
-
- if (!$.support.opacity) {
- wrap.addClass('fancybox-ie');
- }
-
- if (isIE6) {
- loading.addClass('fancybox-ie6');
- wrap.addClass('fancybox-ie6');
-
- $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
- }
- };
-
- $.fn.fancybox.defaults = {
- padding : 10,
- margin : 40,
- opacity : false,
- modal : false,
- cyclic : false,
- scrolling : 'auto', // 'auto', 'yes' or 'no'
-
- width : 560,
- height : 340,
-
- autoScale : true,
- autoDimensions : true,
- centerOnScroll : false,
-
- ajax : {},
- swf : { wmode: 'transparent' },
-
- hideOnOverlayClick : true,
- hideOnContentClick : false,
-
- overlayShow : true,
- overlayOpacity : 0.7,
- overlayColor : '#777',
-
- titleShow : true,
- titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
- titleFormat : null,
- titleFromAlt : false,
-
- transitionIn : 'fade', // 'elastic', 'fade' or 'none'
- transitionOut : 'fade', // 'elastic', 'fade' or 'none'
-
- speedIn : 300,
- speedOut : 300,
-
- changeSpeed : 300,
- changeFade : 'fast',
-
- easingIn : 'swing',
- easingOut : 'swing',
-
- showCloseButton : true,
- showNavArrows : true,
- enableEscapeButton : true,
- enableKeyboardNav : true,
-
- onStart : function(){},
- onCancel : function(){},
- onComplete : function(){},
- onCleanup : function(){},
- onClosed : function(){},
- onError : function(){}
- };
-
- $(document).ready(function() {
- $.fancybox.init();
- });
-
-})(jQuery);
\ No newline at end of file diff --git a/library/fancybox/jquery.fancybox-1.3.4.pack.js b/library/fancybox/jquery.fancybox-1.3.4.pack.js deleted file mode 100644 index 1373ed083..000000000 --- a/library/fancybox/jquery.fancybox-1.3.4.pack.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * FancyBox - jQuery Plugin - * Simple and fancy lightbox alternative - * - * Examples and documentation at: http://fancybox.net - * - * Copyright (c) 2008 - 2010 Janis Skarnelis - * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. - * - * Version: 1.3.4 (11/11/2010) - * Requires: jQuery v1.3+ - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ - -;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>'); -F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)|| -c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick= -false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel", -function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+ -'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win== -"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+ -";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor, -opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length? -d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding}); -y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height== -i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents()); -f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode== -37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto"); -s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j); -f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c); -j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type== -"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"), -10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)}; -b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k= -0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+ -1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h= -true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1; -b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5- -d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f); -D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()}); -b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}}; -b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing", -easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
\ No newline at end of file diff --git a/library/fancybox/jquery.mousewheel-3.0.4.pack.js b/library/fancybox/jquery.mousewheel-3.0.4.pack.js deleted file mode 100644 index cb66588e2..000000000 --- a/library/fancybox/jquery.mousewheel-3.0.4.pack.js +++ /dev/null @@ -1,14 +0,0 @@ -/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) -* Licensed under the MIT License (LICENSE.txt). -* -* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. -* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. -* Thanks to: Seamus Leahy for adding deltaX and deltaY -* -* Version: 3.0.4 -* -* Requires: 1.2.2+ -*/ - -(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a= -f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
\ No newline at end of file diff --git a/library/jRange/.gitignore b/library/jRange/.gitignore new file mode 100644 index 000000000..089ae868a --- /dev/null +++ b/library/jRange/.gitignore @@ -0,0 +1,2 @@ + +*.codekit diff --git a/library/jslider/MIT-LICENSE.txt b/library/jRange/LICENSE index b193a88a9..8f47b9a63 100644 --- a/library/jslider/MIT-LICENSE.txt +++ b/library/jRange/LICENSE @@ -1,5 +1,6 @@ The MIT License (MIT) -Copyright (c) 2012 Egor Khmelev + +Copyright (c) 2014 Nitin Hayaran Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/library/jRange/README.md b/library/jRange/README.md new file mode 100644 index 000000000..5cbfe6aa8 --- /dev/null +++ b/library/jRange/README.md @@ -0,0 +1,5 @@ +## jQuery plugin to create Range Selector + +![jRange Preview](http://i.imgur.com/da8uZwx.png) + +[Demo and Documentation](http://nitinhayaran.github.io/jRange/demo/)
\ No newline at end of file diff --git a/library/jRange/demo/index.html b/library/jRange/demo/index.html new file mode 100644 index 000000000..ac443f11f --- /dev/null +++ b/library/jRange/demo/index.html @@ -0,0 +1,245 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>jRange : jQuery Range Selector</title> + <link rel="stylesheet" href="normalize.css"> + <link rel="stylesheet" href="main.css"> + <link rel="stylesheet" href="prism/prism.css"> + <link rel="stylesheet" href="../jquery.range.css"> + <link href='http://fonts.googleapis.com/css?family=Raleway:100,300' rel='stylesheet' type='text/css'> + <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> +</head> +<body> + <section class="pane header"> + <div class="header"> + <h1>jRange</h1> + <h2>jQuery Plugin to create Range Selector</h2> + </div> + <footer> + <div class="left"> + <a href="http://twitter.com/share" class="twitter-share-button" data-url="https://github.com/nitinhayaran/jRange" data-text="jRange - jQuery plugin for Range Selector" data-count="none" data-via="nitinhayaran">Tweet</a> + <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> + <iframe src="http://ghbtns.com/github-btn.html?user=nitinhayaran&repo=jRange&type=watch&count=false&size=small" + allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> + </div> + <div class="right"> + <a href="https://twitter.com/nitinhayaran" class="twitter-follow-button" data-show-count="false">Follow @nitinhayaran</a> + <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> + <iframe src="http://ghbtns.com/github-btn.html?user=nitinhayaran&type=follow&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="153" height="20"></iframe> + </div> + </footer> + </section> + <section class="body demo"> + <div class="container"> + <h2>See it in Action</h2> + <h3>Play around with the demo</h3> + <div class="demo-container clearfix"> + <div class="demo-section"> + <div class="demo-code"> + <pre><code class="language-javascript">$('.single-slider').jRange({ + from: 0, + to: 100, + step: 1, + scale: [0,50,100], + format: '%s', + width: 300, + showLabels: true +});</code></pre> + </div> + <div class="demo-output"> + <input class="single-slider" type="hidden" value="25"/> + </div> + </div> + <div class="demo-section"> + <div class="demo-code"> + <pre><code class="language-javascript">$('.range-slider').jRange({ + from: 0, + to: 100, + step: 1, + scale: [0,25,50,75,100], + format: '%s', + width: 300, + showLabels: true, + isRange : true +});</code></pre> + </div> + <div class="demo-output"> + <input class="range-slider" type="hidden" value="25,75"/> + </div> + </div> + + + </div> + <div class="text-container"> + <h2>How to Use</h2> + <h3>Lets see some code</h3> + <p>To get started you'll have to include <code>jquery.range.js</code> and <code>jquery.range.css</code> files in your html file.</p> + <pre><code class="language-css"><link rel="stylesheet" href="jquery.range.css"> +<script src="jquery.range.js"></script></code></pre> + <p>Later just add an hidden input, where ever you want this slider to be shown.</p> + <pre><code class="language-css"><input type="hidden" class="slider-input" value="23" /></code></pre> + <p>After this you'll have to intialize this plugin for that input, as shown in the example above</p> + + <h2>Options</h2> + <h3>See configuration options</h3> + <p>Options can also be set programatically, by passing an options hash to the jRange method. + <table class="plugin-options" width='900'> + <tr> + <th>Option</th> + <th width="200">Override</th> + <th>Type</th> + <th>Details</th> + </tr> + <tr> + <td>from</td> + <td>Mandatory</td> + <td>Integer</td> + <td>Lower bound of slider</td> + </tr> + <tr> + <td>to</td> + <td>Mandatory</td> + <td>Integer</td> + <td>Upper bound of slider</td> + </tr> + <tr> + <td>step</td> + <td>Optional</td> + <td>Integer</td> + <td> + <code>Default : 1</code> + <p>amount of increment on each step</p> + </td> + </tr> + <tr> + <td>scale</td> + <td>Optional</td> + <td>Array</td> + <td> + <p>Array containing label which are shown below the slider. By default its [from, to].</p> + </td> + </tr> + <tr> + <td>showLabels</td> + <td>Optional</td> + <td>Boolean</td> + <td> + <p>False, if you'd like to hide label which are shown on top of slider.</p> + <code>Default : true</code> + </td> + </tr> + <tr> + <td>showScale</td> + <td>Optional</td> + <td>Boolean</td> + <td> + <p>False, if you'd like to hide scale which are shown below the slider.</p> + <code>Default : true</code> + </td> + </tr> + <tr> + <td>format</td> + <td>Optional</td> + <td>String / Function</td> + <td> + <p>this is used to show label on the pointer</p> + <code>Default : "%s"</code> + <p><code>String</code> : %s is replaced by its value, e.g., "%s days", "%s goats"</p> + <p> + <code>Function</code> : format(value, pointer) + <br> + <code>return</code> : string label for a given value and pointer. <br> + <code>pointer</code> could be 'low'/'high' if <code>isRange</code> is true, else undefined + </p> + </td> + </tr> + <tr> + <td>width</td> + <td>Optional</td> + <td>Integer</td> + <td> + <code>Default : 300</code> + </td> + </tr> + <tr> + <td>theme</td> + <td>Optional</td> + <td>String</td> + <td> + <code>Default : "theme-green"</code> + <p>This is the css class name added to the container. Available themes are "theme-blue", "theme-green". You can also add more themes, just like in <code>jquery.range.less</code></p> + </td> + </tr> + <tr> + <td>isRange</td> + <td>Optional</td> + <td>Boolean</td> + <td> + <code>Default : false</code> + <p>True if this is a range selector. If its a range the value of hidden input will be set comma-seperated, e.g., "25,75"</p> + </td> + </tr> + <tr> + <td>onstatechange</td> + <td>Optional</td> + <td>Function</td> + <td> + <p>This function is called whenever the value is changed by user. This same value is also automatically set for the provided Hidden Input.</p> + <p>For single slider value is without comma, however for a range selector value is comma-seperated.</p> + </td> + </tr> + </table> + + <div class="footer"> + <a href="https://github.com/nitinhayaran/jRange" class="large-github">Get it from Github</a> + </div> + </div> + </div> + </section> + <section class="footer"> + <div class="text-container clearfix"> + <div class="left"> + <p> + <a href="https://twitter.com/nitinhayaran" class="twitter-follow-button" data-show-count="false">Follow @nitinhayaran</a> + <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> + </p> + <p><iframe src="http://ghbtns.com/github-btn.html?user=nitinhayaran&type=follow&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="153" height="20"></iframe></p> + </div> + <div class="right"> + <p><a href="https://github.com/nitinhayaran/jRange">jRange</a> is authored and maintained by <a href="https://github.com/nitinhayaran/">@nitinhayaran</a></p> + <p> + Released under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT + License</a> + </p> + </div> + </div> + </section> + <script src="prism/prism.js"></script> + + <script src="../jquery.range.js"></script> + <script type="text/javascript"> + $(document).ready(function(){ + $('.single-slider').jRange({ + from: 0, + to: 100, + step: 1, + scale: [0,25,50,75,100], + format: '%s', + width: 300, + showLabels: true + }); + $('.range-slider').jRange({ + from: 0, + to: 100, + step: 1, + scale: [0,25,50,75,100], + format: '%s', + width: 300, + showLabels: true, + isRange : true + }); + }); + </script> +</body> +</html>
\ No newline at end of file diff --git a/library/jRange/demo/main.css b/library/jRange/demo/main.css new file mode 100644 index 000000000..1e29a98af --- /dev/null +++ b/library/jRange/demo/main.css @@ -0,0 +1,289 @@ +html, +body { + height: 100%; + width: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial sans-serif; + font-size: 16px; + line-height: 1.6; + color: #434343; +} +a { + text-decoration: none; +} +pre code { + line-height: 1.5; +} +.container { + width: 1130px; + padding: 0 20px; + margin: 0px auto; +} +.text-container { + width: 900px; + position: relative; + margin: 0px auto; +} +.clearfix:after { + content: " "; + /* Older browser do not support empty content */ + visibility: hidden; + display: block; + height: 0; + clear: both; +} +.pane { + position: relative; + width: 100%; + height: 50%; + min-height: 450px; +} +.body { + position: relative; +} +section.header { + background-color: #606c88; + background: -webkit-linear-gradient(90deg, #606c88 10%, #3f4c6b 90%); + /* Chrome 10+, Saf5.1+ */ + background: -moz-linear-gradient(90deg, #606c88 10%, #3f4c6b 90%); + /* FF3.6+ */ + background: -ms-linear-gradient(90deg, #606c88 10%, #3f4c6b 90%); + /* IE10 */ + background: -o-linear-gradient(90deg, #606c88 10%, #3f4c6b 90%); + /* Opera 11.10+ */ + background: linear-gradient(90deg, #606c88 10%, #3f4c6b 90%); + /* W3C */ +} +section.header footer { + position: absolute; + width: 100%; + bottom: 0; + padding: 10px 30px; + box-sizing: border-box; +} +.left { + float: left; + text-align: left; +} +.right { + float: right; + text-align: right; +} +div.header { + color: #fff; + width: 600px; + text-align: center; + position: absolute; + top: 40%; + left: 50%; + transform: translate(-50%, -50%); + border-radius: 5px; +} +div.header h1, +div.header h2 { + font-family: 'Raleway' sans-serif; + font-weight: 100; + line-height: 1; + margin: 0; +} +div.header h1 { + font-size: 72px; + margin-bottom: 25px; +} +section.demo h2, +section.demo h3 { + font-family: 'Raleway' sans-serif; + font-weight: 300; + line-height: 1; + margin: 0; + text-align: center; +} +section.demo h2 { + font-size: 48px; + margin-top: 1em; +} +section.demo h3 { + font-size: 28px; + margin: 0.8em 0 1em; +} +section.demo .demo-container { + margin: 40px 0 80px; +} +section.demo .demo-section { + margin: 20px 0; + clear: both; +} +section.demo .demo-section .demo-code { + width: 50%; + float: left; +} +section.demo .demo-section .demo-output { + margin-left: 50%; + padding: 50px 0; +} +section.demo .demo-section .slider-container { + margin: 0 auto; +} +section.demo .text-container h2 { + margin-top: 3em; +} +section.demo .form-vertical { + width: 200px; + float: left; +} +section.demo .image-container { + margin-left: 200px; + padding: 1px; + border: 1px solid #eee; +} +section.demo .form-group { + margin-bottom: 20px; +} +section.demo label { + color: #999; + font-size: 13px; + display: block; +} +section.demo input { + width: 150px; + margin-top: 3px; + border: 1px solid #999; + border-width: 0 0 1px 0; + padding: 3px 0 3px; + transition: 0.3s all; +} +section.demo input:focus, +section.demo input:active { + outline: none; + border-color: #2fc7ff; + box-shadow: 0 1px 3px -3px #2fc7ff; + color: #000; +} +section.demo button { + position: relative; + overflow: visible; + display: inline-block; + padding: 0.3em 1em; + border: 1px solid #d4d4d4; + margin: 0; + text-decoration: none; + text-align: center; + text-shadow: 1px 1px 0 #fff; + font-size: 12px; + color: #333; + white-space: nowrap; + cursor: pointer; + outline: none; + background-color: #ececec; + background-image: linear-gradient(#f4f4f4, #ececec); + background-clip: padding-box; + border-radius: 0.2em; + zoom: 1; + transition: background-image 0.3s; +} +section.demo button:hover, +section.demo button:active { + border-color: #3072b3; + border-bottom-color: #2a65a0; + text-decoration: none; + text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3); + color: #fff; + background-color: #3c8dde; + background-image: linear-gradient(#599bdc, #3072b3); +} +section.demo p { + font-family: 'Raleway' sans-serif; + margin: 1em auto; +} +section.demo .footer { + margin-top: 80px; + text-align: center; +} +section.demo .large-github { + display: inline-block; + border: 1px solid #21b0ff; + font-weight: 400; + font-family: 'Raleway' sans-serif; + text-shadow: none; + background-color: #fff; + background-image: none; + padding: 8px 25px; + color: #21b0ff; + font-size: 18px; + border-radius: 25px; +} +section.demo .large-github:hover, +section.demo .large-github:active { + background-color: #21b0ff; + color: #fff; + background-image: none; + text-shadow: none; +} +.two-coloumn em { + font-weight: normal; + text-decoration: none; + font-style: normal; + display: inline-block; + width: 85px; +} +.plugin-options { + font-size: 14px; + margin-bottom: 40px; + width: 900px; + font-weight: 200; +} +.plugin-options td, +.plugin-options th { + padding: 8px ; + text-align: left; + vertical-align: top; +} +.plugin-options td:first-child, +.plugin-options th:first-child { + font-weight: bold; +} +.plugin-options td:nth-child(2), +.plugin-options td:nth-child(3) { + font-size: 13px; + color: #999; +} +.plugin-options td p { + font-family: Helvetica Neue, Helvetica, Arial, sans-serif; + margin: 4px 0; +} +.plugin-options td p:first-child { + margin-top: 0; +} +.plugin-options th { + background-color: #358ccb; + color: #fff; +} +.plugin-options tr:nth-child(2n + 1) td { + background-color: #f5f5f5; +} +.plugin-options small { + display: block; +} +.plugin-options ul { + list-style: none; + padding: 0; +} +.plugin-options ul ul { + list-style: circle inside; +} +section.footer { + margin-top: 80px; + padding: 30px; + text-align: center; + background-color: #333; + color: #999; + font-weight: 300; + font-size: 13px; +} +section.footer p { + margin: 5px 0; +} +section.footer a { + color: #fff; +} diff --git a/library/jRange/demo/main.less b/library/jRange/demo/main.less new file mode 100644 index 000000000..e9ee232a1 --- /dev/null +++ b/library/jRange/demo/main.less @@ -0,0 +1,296 @@ +@font-family: 'Raleway' sans-serif; +html, body{ + height: 100%; + width: 100%; +} +body{ + font-family: Helvetica Neue, Helvetica, Arial sans-serif; + font-size: 16px; + line-height: 1.6; + color: #434343; +} +a{ + text-decoration: none; +} +pre code{ + line-height: 1.5; +} +.container{ + width: 1130px; + padding: 0 20px; + margin: 0px auto; +} +.text-container{ + width: 900px; + position: relative; + margin: 0px auto; +} +.clearfix:after { + content: " "; /* Older browser do not support empty content */ + visibility: hidden; + display: block; + height: 0; + clear: both; +} +.pane{ + position: relative; + width: 100%; + height: 50%; + min-height: 450px; +} +.body{ + position: relative; +} +section.header{ + background-color: #606c88; + + background: -webkit-linear-gradient(90deg, #606c88 10%, #3f4c6b 90%); /* Chrome 10+, Saf5.1+ */ + background: -moz-linear-gradient(90deg, #606c88 10%, #3f4c6b 90%); /* FF3.6+ */ + background: -ms-linear-gradient(90deg, #606c88 10%, #3f4c6b 90%); /* IE10 */ + background: -o-linear-gradient(90deg, #606c88 10%, #3f4c6b 90%); /* Opera 11.10+ */ + background: linear-gradient(90deg, #606c88 10%, #3f4c6b 90%); /* W3C */ + + // background-image: radial-gradient(50% 102%, #3cb3db 48%, #2e6c9a 100%); + footer{ + position: absolute; + width: 100%; + bottom: 0; + padding: 10px 30px; + box-sizing: border-box; + } +} +.left{ + float: left; + text-align: left; +} +.right{ + float: right; + text-align: right; +} +div.header{ + color: #fff; + width: 600px; + text-align: center; + position: absolute; + top: 40%; + left: 50%; + transform: translate(-50%, -50%); + // background-color: #333; + border-radius: 5px; + h1, h2{ + font-family: @font-family; + font-weight: 100; + line-height: 1; + margin: 0; + } + h1{ + font-size: 72px; + margin-bottom: 25px; + } +} +section.demo{ + h2, h3{ + font-family: @font-family; + font-weight: 300; + line-height: 1; + margin: 0; + text-align: center; + } + h2{ + font-size: 48px; + margin-top: 1em; + } + h3{ + font-size: 28px; + margin: 0.8em 0 1em; + } + .demo-container{ + margin: 40px 0 80px; + } + .demo-section{ + margin: 20px 0; + clear: both; + .demo-code{ + width: 50%; + float: left; + } + .demo-output{ + margin-left: 50%; + padding: 50px 0; + } + .slider-container{ + margin: 0 auto; + } + } + .text-container{ + h2{ + margin-top: 3em; + } + } + .form-vertical{ + width: 200px; + float: left; + } + .image-container{ + margin-left: 200px; + padding: 1px; + border: 1px solid #eee; + // background-color: #333; + } + .form-group{ + margin-bottom: 20px; + } + label{ + color: #999; + font-size: 13px; + display: block; + } + input{ + width: 150px; + margin-top: 3px; + // border-radius: 2px; + border: 1px solid #999; + border-width: 0 0 1px 0; + padding: 3px 0 3px; + transition: 0.3s all; + // color: #999; + &:focus, &:active{ + outline: none; + border-color: #2fc7ff; + box-shadow: 0 1px 3px -3px #2fc7ff; + color: #000; + } + } + button{ + position: relative; + overflow: visible; + display: inline-block; + padding: 0.3em 1em; + border: 1px solid #d4d4d4; + margin: 0; + text-decoration: none; + text-align: center; + text-shadow: 1px 1px 0 #fff; + font-size: 12px; + color: #333; + white-space: nowrap; + cursor: pointer; + outline: none; + background-color: #ececec; + background-image: linear-gradient(#f4f4f4, #ececec); + background-clip: padding-box; + border-radius: 0.2em; + zoom: 1; + transition: background-image 0.3s; + &:hover, &:active{ + border-color: #3072b3; + border-bottom-color: #2a65a0; + text-decoration: none; + text-shadow: -1px -1px 0 rgba(0,0,0,0.3); + color: #fff; + background-color: #3c8dde; + background-image: linear-gradient(#599bdc, #3072b3); + } + } + p{ + font-family: @font-family; + margin: 1em auto; + } + .footer{ + margin-top: 80px; + text-align: center; + } + .large-github{ + display: inline-block; + border: 1px solid #21b0ff; + font-weight: 400; + font-family: @font-family; + text-shadow: none; + background-color: #fff; + background-image: none; + padding: 8px 25px; + color: #21b0ff; + font-size: 18px; + border-radius: 25px; + &:hover, &:active{ + background-color: #21b0ff; + color: #fff; + background-image: none; + text-shadow: none; + } + } +} +.two-coloumn{ + em{ + font-weight: normal; + text-decoration: none; + font-style: normal; + display: inline-block; + width: 85px; + } +} +.plugin-options{ + font-size: 14px; + margin-bottom: 40px; + width: 900px; + font-weight: 200; + td, th{ + padding: 8px ; + text-align: left; + vertical-align: top; + &:first-child{ + font-weight: bold; + } + } + td{ + &:nth-child(2), &:nth-child(3){ + font-size: 13px; + color: #999; + } + p{ + font-family: Helvetica Neue, Helvetica, Arial, sans-serif; + margin: 4px 0; + &:first-child{ + margin-top: 0; + } + } + } + th{ + background-color: #358ccb; + color: #fff; + } + tr{ + &:nth-child(2n + 1){ + td{ + background-color: #f5f5f5; + } + } + } + small{ + display: block; + // white-space: nowrap; + } + ul{ + list-style: none; + padding: 0; + ul{ + list-style: circle inside; + // padding-left: 25px; + } + } +} +section.footer{ + margin-top: 80px; + padding: 30px; + text-align: center; + background-color: #333; + color: #999; + font-weight: 300; + font-size: 13px; + p{ + margin: 5px 0; + } + a{ + color: #fff; + } +}
\ No newline at end of file diff --git a/library/jRange/demo/normalize.css b/library/jRange/demo/normalize.css new file mode 100644 index 000000000..08f895079 --- /dev/null +++ b/library/jRange/demo/normalize.css @@ -0,0 +1,425 @@ +/*! normalize.css v3.0.1 | MIT License | git.io/normalize */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ + +audio, +canvas, +progress, +video { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9/10. + */ + +img { + border: 0; +} + +/** + * Correct overflow not hidden in IE 9/10/11. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari. + */ + +figure { + margin: 1em 40px; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ + +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +/* Forms + ========================================================================== */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ + +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + */ + +button, +input, +optgroup, +select, +textarea { + color: inherit; /* 1 */ + font: inherit; /* 2 */ + margin: 0; /* 3 */ +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ + +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +input { + line-height: normal; +} + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ + +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ + +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +} diff --git a/library/jRange/demo/prism/prism.css b/library/jRange/demo/prism/prism.css new file mode 100644 index 000000000..afc94b354 --- /dev/null +++ b/library/jRange/demo/prism/prism.css @@ -0,0 +1,193 @@ +/* http://prismjs.com/download.html?themes=prism-coy&languages=markup+css+css-extras+clike+javascript */ +/** + * prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML + * Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics); + * @author Tim Shedor + */ + +code[class*="language-"], +pre[class*="language-"] { + color: black; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +/* Code blocks */ +pre[class*="language-"] { + position:relative; + padding: 1em; + margin: .5em 0; + -webkit-box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf; + -moz-box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf; + box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf; + border-left: 10px solid #358ccb; + background-color: #fdfdfd; + background-image: -webkit-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); + background-image: -moz-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); + background-image: -ms-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); + background-image: -o-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); + background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); + background-size: 3em 3em; + background-origin:content-box; + overflow:visible; + max-height:30em; +} + +code[class*="language"] { + max-height:29em; + display:block; + overflow:scroll; +} + +/* Margin bottom to accomodate shadow */ +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background-color:#fdfdfd; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + margin-bottom: 1em; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + position:relative; + padding: .2em; + -webkit-border-radius: 0.3em; + -moz-border-radius: 0.3em; + -ms-border-radius: 0.3em; + -o-border-radius: 0.3em; + border-radius: 0.3em; + color: #c92c2c; + border: 1px solid rgba(0, 0, 0, 0.1); +} + +pre[class*="language-"]:before, +pre[class*="language-"]:after { + content: ''; + z-index: -2; + display:block; + position: absolute; + bottom: 0.75em; + left: 0.18em; + width: 40%; + height: 20%; + -webkit-box-shadow: 0px 13px 8px #979797; + -moz-box-shadow: 0px 13px 8px #979797; + box-shadow: 0px 13px 8px #979797; + -webkit-transform: rotate(-2deg); + -moz-transform: rotate(-2deg); + -ms-transform: rotate(-2deg); + -o-transform: rotate(-2deg); + transform: rotate(-2deg); +} + +:not(pre) > code[class*="language-"]:after, +pre[class*="language-"]:after { + right: 0.75em; + left: auto; + -webkit-transform: rotate(2deg); + -moz-transform: rotate(2deg); + -ms-transform: rotate(2deg); + -o-transform: rotate(2deg); + transform: rotate(2deg); +} + +.token.comment, +.token.block-comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: #7D8B99; +} + +.token.punctuation { + color: #5F6364; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.function-name, +.token.constant, +.token.symbol { + color: #c92c2c; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.function, +.token.builtin { + color: #2f9c0a; +} + +.token.operator, +.token.entity, +.token.url, +.token.variable { + color: #a67f59; + background: rgba(255, 255, 255, 0.5); +} + +.token.atrule, +.token.attr-value, +.token.keyword, +.token.class-name { + color: #1990b8; +} + +.token.regex, +.token.important { + color: #e90; +} +.language-css .token.string, +.style .token.string { + color: #a67f59; + background: rgba(255, 255, 255, 0.5); +} + +.token.important { + font-weight: normal; +} + +.token.entity { + cursor: help; +} + +.namespace { + opacity: .7; +} + +@media screen and (max-width:767px){ + pre[class*="language-"]:before, + pre[class*="language-"]:after { + bottom:14px; + -webkit-box-shadow:none; + -moz-box-shadow:none; + box-shadow:none; + } + +} + +/* Plugin styles */ +.token.tab:not(:empty):before, +.token.cr:before, +.token.lf:before { + color: #e0d7d1; +} + diff --git a/library/jRange/demo/prism/prism.js b/library/jRange/demo/prism/prism.js new file mode 100644 index 000000000..dace66766 --- /dev/null +++ b/library/jRange/demo/prism/prism.js @@ -0,0 +1,8 @@ +/* http://prismjs.com/download.html?themes=prism-coy&languages=markup+css+css-extras+clike+javascript */ +var self=typeof window!="undefined"?window:{},Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content)):t.util.type(e)==="Array"?e.map(t.util.encode):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data),o);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar,l.language);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r,i){var s=t.tokenize(e,r);return n.stringify(t.util.encode(s),i)},tokenize:function(e,n,r){var i=t.Token,s=[e],o=n.rest;if(o){for(var u in o)n[u]=o[u];delete n.rest}e:for(var u in n){if(!n.hasOwnProperty(u)||!n[u])continue;var a=n[u],f=a.inside,l=!!a.lookbehind,c=0;a=a.pattern||a;for(var h=0;h<s.length;h++){var p=s[h];if(s.length>e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+"</"+s.tag+">"};if(!self.document){if(!self.addEventListener)return self.Prism;self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return self.Prism}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}return self.Prism}();typeof module!="undefined"&&module.exports&&(module.exports=Prism);; +Prism.languages.markup={comment:/<!--[\w\W]*?-->/g,prolog:/<\?.+?\?>/,doctype:/<!DOCTYPE.+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/\&#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))});; +Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,punctuation:/[\{\};:]/g,"function":/[-a-z0-9]+(?=\()/ig};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/ig,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});; +Prism.languages.css.selector={pattern:/[^\{\}\s][^\{\}]*(?=\s*\{)/g,inside:{"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/g,"pseudo-class":/:[-\w]+(?:\(.*\))?/g,"class":/\.[-:\.\w]+/g,id:/#[-:\.\w]+/g}};Prism.languages.insertBefore("css","ignore",{hexcode:/#[\da-f]{3,6}/gi,entity:/\\[\da-f]{1,8}/gi,number:/[\d%\.]+/g});; +Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}},number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};; +Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/ig,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}}); +; diff --git a/library/jRange/jquery.range-min.js b/library/jRange/jquery.range-min.js new file mode 100644 index 000000000..8aa6e7ecb --- /dev/null +++ b/library/jRange/jquery.range-min.js @@ -0,0 +1 @@ +!function($,t,i,s){"use strict";var o=function(){return this.init.apply(this,arguments)};o.prototype={defaults:{onstatechange:function(){},isRange:!1,showLabels:!0,showScale:!0,step:1,format:"%s",theme:"theme-green",width:300},template:'<div class="slider-container"> <div class="back-bar"> <div class="selected-bar"></div> <div class="pointer low"></div><div class="pointer-label">123456</div> <div class="pointer high"></div><div class="pointer-label">456789</div> <div class="clickable-dummy"></div> </div> <div class="scale"></div> </div>',init:function(t,i){this.options=$.extend({},this.defaults,i),this.inputNode=$(t),this.options.value=this.inputNode.val()||(this.options.isRange?this.options.from+","+this.options.from:this.options.from),this.domNode=$(this.template),this.domNode.addClass(this.options.theme),this.inputNode.after(this.domNode),this.domNode.on("change",this.onChange),this.pointers=$(".pointer",this.domNode),this.lowPointer=this.pointers.first(),this.highPointer=this.pointers.last(),this.labels=$(".pointer-label",this.domNode),this.lowLabel=this.labels.first(),this.highLabel=this.labels.last(),this.scale=$(".scale",this.domNode),this.bar=$(".selected-bar",this.domNode),this.clickableBar=this.domNode.find(".clickable-dummy"),this.interval=this.options.to-this.options.from,this.render()},render:function(){return 0!==this.inputNode.width()||this.options.width?(this.domNode.width(this.options.width||this.inputNode.width()),this.inputNode.hide(),this.isSingle()&&(this.lowPointer.hide(),this.lowLabel.hide()),this.options.showLabels||this.labels.hide(),this.attachEvents(),this.options.showScale&&this.renderScale(),void this.setValue(this.options.value)):void console.log("jRange : no width found, returning")},isSingle:function(){return"number"==typeof this.options.value?!0:-1!==this.options.value.indexOf(",")||this.options.isRange?!1:!0},attachEvents:function(){this.clickableBar.click($.proxy(this.barClicked,this)),this.pointers.mousedown($.proxy(this.onDragStart,this)),this.pointers.bind("dragstart",function(t){t.preventDefault()})},onDragStart:function(t){if(1===t.which){t.stopPropagation(),t.preventDefault();var s=$(t.target);s.addClass("focused"),this[(s.hasClass("low")?"low":"high")+"Label"].addClass("focused"),$(i).on("mousemove.slider",$.proxy(this.onDrag,this,s)),$(i).on("mouseup.slider",$.proxy(this.onDragEnd,this))}},onDrag:function(t,i){i.stopPropagation(),i.preventDefault();var s=i.clientX-this.domNode.offset().left;this.domNode.trigger("change",[this,t,s])},onDragEnd:function(){this.pointers.removeClass("focused"),this.labels.removeClass("focused"),$(i).off(".slider"),$(i).off(".slider")},barClicked:function(t){var i=t.pageX-this.clickableBar.offset().left;if(this.isSingle())this.setPosition(this.pointers.last(),i,!0,!0);else{var s=Math.abs(parseInt(this.pointers.first().css("left"),10)-i+this.pointers.first().width()/2)<Math.abs(parseInt(this.pointers.last().css("left"),10)-i+this.pointers.first().width()/2)?this.pointers.first():this.pointers.last();this.setPosition(s,i,!0,!0)}},onChange:function(t,i,s,o){var e,n;i.isSingle()?(e=0,n=i.domNode.width()):(e=s.hasClass("high")?i.lowPointer.position().left+i.lowPointer.width()/2:0,n=s.hasClass("low")?i.highPointer.position().left+i.highPointer.width()/2:i.domNode.width());var h=Math.min(Math.max(o,e),n);i.setPosition(s,h,!0)},setPosition:function(t,i,s,o){var e,n=this.lowPointer.position().left,h=this.highPointer.position().left,a=this.highPointer.width()/2;s||(i=this.prcToPx(i)),t[0]===this.highPointer[0]?h=Math.round(i-a):n=Math.round(i-a),t[o?"animate":"css"]({left:Math.round(i-a)}),e=this.isSingle()?0:n+a,this.bar[o?"animate":"css"]({width:Math.round(h+a-e),left:e}),this.showPointerValue(t,i,o)},setValue:function(t){var i=t.toString().split(",");this.options.value=t;var s=this.valuesToPrc(2===i.length?i:[0,i[0]]);this.isSingle()?this.setPosition(this.highPointer,s[1]):(this.setPosition(this.lowPointer,s[0]),this.setPosition(this.highPointer,s[1]))},renderScale:function(){for(var t=this.options.scale||[this.options.from,this.options.to],i=Math.round(100/(t.length-1)*10)/10,s="",o=0;o<t.length;o++)s+='<span style="left: '+o*i+'%">'+("|"!=t[o]?"<ins>"+t[o]+"</ins>":"")+"</span>";this.scale.html(s),$("ins",this.scale).each(function(){$(this).css({marginLeft:-$(this).outerWidth()/2})})},getBarWidth:function(){var t=this.options.value.split(",");return t.length>1?parseInt(t[1],10)-parseInt(t[0],10):parseInt(t[0],10)},showPointerValue:function(t,i,o){var e=$(".pointer-label",this.domNode)[t.hasClass("low")?"first":"last"](),n,h=this.positionToValue(i);if($.isFunction(this.options.format)){var a=this.isSingle()?s:t.hasClass("low")?"low":"high";n=this.options.format(h,a)}else n=this.options.format.replace("%s",h);var r=e.html(n).width(),l=i-r/2;l=Math.min(Math.max(l,0),this.options.width-r),e[o?"animate":"css"]({left:l}),this.setInputValue(t,h)},valuesToPrc:function(t){var i=100*(t[0]-this.options.from)/this.interval,s=100*(t[1]-this.options.from)/this.interval;return[i,s]},prcToPx:function(t){return this.domNode.width()*t/100},positionToValue:function(t){var i=t/this.domNode.width()*this.interval;return i+=this.options.from,Math.round(i/this.options.step)*this.options.step},setInputValue:function(t,i){if(this.isSingle())this.options.value=i.toString();else{var s=this.options.value.split(",");this.options.value=t.hasClass("low")?i+","+s[1]:s[0]+","+i}this.inputNode.val()!==this.options.value&&(this.inputNode.val(this.options.value),this.options.onstatechange.call(this,this.options.value))},getValue:function(){return this.options.value}};var e="jRange";$.fn[e]=function(t){var i=arguments,s;return this.each(function(){var n=$(this),h=$.data(this,"plugin_"+e),a="object"==typeof t&&t;h||n.data("plugin_"+e,h=new o(this,a)),"string"==typeof t&&(s=h[t].apply(h,Array.prototype.slice.call(i,1)))}),s||this}}(jQuery,window,document);
\ No newline at end of file diff --git a/library/jRange/jquery.range.css b/library/jRange/jquery.range.css new file mode 100644 index 000000000..27375c846 --- /dev/null +++ b/library/jRange/jquery.range.css @@ -0,0 +1,168 @@ +.slider-container { + width: 300px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} +.slider-container .back-bar { + height: 10px; + position: relative; +} +.slider-container .back-bar .selected-bar { + position: absolute; + height: 100%; +} +.slider-container .back-bar .pointer { + position: absolute; + width: 10px; + height: 10px; + background-color: red; + cursor: move; + opacity: 1; + z-index: 2; +} +.slider-container .back-bar .pointer-label { + position: absolute; + top: -17px; + font-size: 8px; + background: white; + white-space: nowrap; + line-height: 1; +} +.slider-container .back-bar .focused { + z-index: 10; +} +.slider-container .clickable-dummy { + cursor: pointer; + position: absolute; + width: 100%; + height: 100%; + z-index: 1; +} +.slider-container .scale { + top: 2px; + position: relative; +} +.slider-container .scale span { + position: absolute; + height: 5px; + border-left: 1px solid #999; + font-size: 0; +} +.slider-container .scale ins { + font-size: 9px; + text-decoration: none; + position: absolute; + left: 0; + top: 5px; + color: #999; + line-height: 1; +} +.theme-green .back-bar { + height: 5px; + border-radius: 2px; + background-color: #eeeeee; + background-color: #e7e7e7; + background-image: -moz-linear-gradient(top, #eeeeee, #dddddd); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#eeeeee), to(#dddddd)); + background-image: -webkit-linear-gradient(top, #eeeeee, #dddddd); + background-image: -o-linear-gradient(top, #eeeeee, #dddddd); + background-image: linear-gradient(to bottom, #eeeeee, #dddddd); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeeeeee', endColorstr='#ffdddddd', GradientType=0); +} +.theme-green .back-bar .selected-bar { + border-radius: 2px; + background-color: #a1fad0; + background-image: -moz-linear-gradient(top, #bdfade, #76fabc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#bdfade), to(#76fabc)); + background-image: -webkit-linear-gradient(top, #bdfade, #76fabc); + background-image: -o-linear-gradient(top, #bdfade, #76fabc); + background-image: linear-gradient(to bottom, #bdfade, #76fabc); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbdfade', endColorstr='#ff76fabc', GradientType=0); +} +.theme-green .back-bar .pointer { + width: 14px; + height: 14px; + top: -5px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border-radius: 10px; + border: 1px solid #AAA; + background-color: #e7e7e7; + background-image: -moz-linear-gradient(top, #eeeeee, #dddddd); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#eeeeee), to(#dddddd)); + background-image: -webkit-linear-gradient(top, #eeeeee, #dddddd); + background-image: -o-linear-gradient(top, #eeeeee, #dddddd); + background-image: linear-gradient(to bottom, #eeeeee, #dddddd); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeeeeee', endColorstr='#ffdddddd', GradientType=0); + cursor: col-resize; +} +.theme-green .back-bar .pointer-label { + color: #999; +} +.theme-green .back-bar .focused { + color: #333; +} +.theme-green .scale span { + border-left: 1px solid #e5e5e5; +} +.theme-green .scale ins { + color: #999; +} +.theme-blue .back-bar { + height: 5px; + border-radius: 2px; + background-color: #eeeeee; + background-color: #e7e7e7; + background-image: -moz-linear-gradient(top, #eeeeee, #dddddd); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#eeeeee), to(#dddddd)); + background-image: -webkit-linear-gradient(top, #eeeeee, #dddddd); + background-image: -o-linear-gradient(top, #eeeeee, #dddddd); + background-image: linear-gradient(to bottom, #eeeeee, #dddddd); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeeeeee', endColorstr='#ffdddddd', GradientType=0); +} +.theme-blue .back-bar .selected-bar { + border-radius: 2px; + background-color: #92c1f9; + background-image: -moz-linear-gradient(top, #b1d1f9, #64a8f9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#b1d1f9), to(#64a8f9)); + background-image: -webkit-linear-gradient(top, #b1d1f9, #64a8f9); + background-image: -o-linear-gradient(top, #b1d1f9, #64a8f9); + background-image: linear-gradient(to bottom, #b1d1f9, #64a8f9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb1d1f9', endColorstr='#ff64a8f9', GradientType=0); +} +.theme-blue .back-bar .pointer { + width: 14px; + height: 14px; + top: -5px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border-radius: 10px; + border: 1px solid #AAA; + background-color: #e7e7e7; + background-image: -moz-linear-gradient(top, #eeeeee, #dddddd); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#eeeeee), to(#dddddd)); + background-image: -webkit-linear-gradient(top, #eeeeee, #dddddd); + background-image: -o-linear-gradient(top, #eeeeee, #dddddd); + background-image: linear-gradient(to bottom, #eeeeee, #dddddd); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeeeeee', endColorstr='#ffdddddd', GradientType=0); + cursor: col-resize; +} +.theme-blue .back-bar .pointer-label { + color: #999; +} +.theme-blue .back-bar .focused { + color: #333; +} +.theme-blue .scale span { + border-left: 1px solid #e5e5e5; +} +.theme-blue .scale ins { + color: #999; +} diff --git a/library/jRange/jquery.range.js b/library/jRange/jquery.range.js new file mode 100644 index 000000000..978b3e7ba --- /dev/null +++ b/library/jRange/jquery.range.js @@ -0,0 +1,297 @@ +/*jshint multistr:true, curly: false */ +/*global jQuery:false, define: false */ +/** + * jRange - Awesome range control + * + * Written by + * ---------- + * Nitin Hayaran (nitinhayaran@gmail.com) + * + * Licensed under the MIT (MIT-LICENSE.txt). + * + * @author Nitin Hayaran + * @version 0.1-RELEASE + * + * Dependencies + * ------------ + * jQuery (http://jquery.com) + * + **/ + ; + (function($, window, document, undefined) { + 'use strict'; + + var jRange = function(){ + return this.init.apply(this, arguments); + }; + jRange.prototype = { + defaults : { + onstatechange : function(){}, + isRange : false, + showLabels : true, + showScale : true, + step : 1, + format: '%s', + theme : 'theme-green', + width : 300 + }, + template : '<div class="slider-container">\ + <div class="back-bar">\ + <div class="selected-bar"></div>\ + <div class="pointer low"></div><div class="pointer-label">123456</div>\ + <div class="pointer high"></div><div class="pointer-label">456789</div>\ + <div class="clickable-dummy"></div>\ + </div>\ + <div class="scale"></div>\ + </div>', + init : function(node, options){ + this.options = $.extend({}, this.defaults, options); + this.inputNode = $(node); + this.options.value = this.inputNode.val() || (this.options.isRange ? this.options.from+','+this.options.from : this.options.from); + this.domNode = $(this.template); + this.domNode.addClass(this.options.theme); + this.inputNode.after(this.domNode); + this.domNode.on('change', this.onChange); + this.pointers = $('.pointer', this.domNode); + this.lowPointer = this.pointers.first(); + this.highPointer = this.pointers.last(); + this.labels = $('.pointer-label', this.domNode); + this.lowLabel = this.labels.first(); + this.highLabel = this.labels.last(); + this.scale = $('.scale', this.domNode); + this.bar = $('.selected-bar', this.domNode); + this.clickableBar = this.domNode.find('.clickable-dummy'); + this.interval = this.options.to - this.options.from; + this.render(); + }, + render: function(){ + // Check if inputNode is visible, and have some width, so that we can set slider width accordingly. + if( this.inputNode.width() === 0 && !this.options.width ){ + console.log('jRange : no width found, returning'); + return; + }else{ + this.domNode.width( this.options.width || this.inputNode.width() ); + this.inputNode.hide(); + } + + if(this.isSingle()){ + this.lowPointer.hide(); + this.lowLabel.hide(); + } + if(!this.options.showLabels){ + this.labels.hide(); + } + this.attachEvents(); + if(this.options.showScale){ + this.renderScale(); + } + this.setValue(this.options.value); + }, + isSingle: function(){ + if(typeof(this.options.value) === 'number'){ + return true; + } + return (this.options.value.indexOf(',') !== -1 || this.options.isRange) ? + false : true; + }, + attachEvents: function(){ + this.clickableBar.click($.proxy(this.barClicked, this)); + this.pointers.mousedown($.proxy(this.onDragStart, this)); + this.pointers.bind('dragstart', function(event) { event.preventDefault(); }); + }, + onDragStart: function(e){ + if(e.which !== 1){return;} + e.stopPropagation(); e.preventDefault(); + var pointer = $(e.target); + pointer.addClass('focused'); + this[(pointer.hasClass('low')?'low':'high') + 'Label'].addClass('focused'); + $(document).on('mousemove.slider', $.proxy(this.onDrag, this, pointer)); + $(document).on('mouseup.slider', $.proxy(this.onDragEnd, this)); + }, + onDrag: function(pointer, e){ + e.stopPropagation(); e.preventDefault(); + var position = e.clientX - this.domNode.offset().left; + this.domNode.trigger('change', [this, pointer, position]); + }, + onDragEnd: function(){ + this.pointers.removeClass('focused'); + this.labels.removeClass('focused'); + $(document).off('.slider'); + $(document).off('.slider'); + }, + barClicked: function(e){ + var x = e.pageX - this.clickableBar.offset().left; + if(this.isSingle()) + this.setPosition(this.pointers.last(), x, true, true); + else{ + var pointer = Math.abs(parseInt(this.pointers.first().css('left'), 10) - x + this.pointers.first().width() / 2) < Math.abs(parseInt(this.pointers.last().css('left'), 10) - x + this.pointers.first().width() / 2) ? + this.pointers.first() : this.pointers.last(); + this.setPosition(pointer, x, true, true); + } + }, + onChange: function(e, self, pointer, position){ + var min, max; + if(self.isSingle()){ + min = 0; + max = self.domNode.width(); + }else{ + min = pointer.hasClass('high')? self.lowPointer.position().left + self.lowPointer.width() / 2 : 0; + max = pointer.hasClass('low') ? self.highPointer.position().left + self.highPointer.width() / 2 : self.domNode.width(); + } + var value = Math.min(Math.max(position, min), max); + self.setPosition(pointer, value, true); + }, + setPosition: function(pointer, position, isPx, animate){ + var leftPos, + lowPos = this.lowPointer.position().left, + highPos = this.highPointer.position().left, + circleWidth = this.highPointer.width() / 2; + if(!isPx){ + position = this.prcToPx(position); + } + if(pointer[0] === this.highPointer[0]){ + highPos = Math.round(position - circleWidth); + }else{ + lowPos = Math.round(position - circleWidth); + } + pointer[animate?'animate':'css']({'left': Math.round(position - circleWidth)}); + if(this.isSingle()){ + leftPos = 0; + }else{ + leftPos = lowPos + circleWidth; + } + this.bar[animate?'animate':'css']({ + 'width' : Math.round(highPos + circleWidth - leftPos), + 'left' : leftPos + }); + this.showPointerValue(pointer, position, animate); + }, + // will be called from outside + setValue: function(value){ + var values = value.toString().split(','); + this.options.value = value; + var prc = this.valuesToPrc( values.length === 2 ? values : [0, values[0]] ); + if(this.isSingle()){ + this.setPosition(this.highPointer, prc[1]); + }else{ + this.setPosition(this.lowPointer, prc[0]); + this.setPosition(this.highPointer, prc[1]); + } + }, + renderScale: function(){ + var s = this.options.scale || [this.options.from, this.options.to]; + var prc = Math.round((100 / (s.length - 1)) * 10) / 10; + var str = ''; + for(var i = 0; i < s.length ; i++ ){ + str += '<span style="left: ' + i * prc + '%">' + (s[i] != '|' ? '<ins>' + s[i] + '</ins>' : '') + '</span>'; + } + this.scale.html(str); + + $('ins', this.scale).each(function () { + $(this).css({ + marginLeft: -$(this).outerWidth() / 2 + }); + }); + }, + getBarWidth: function(){ + var values = this.options.value.split(','); + if(values.length > 1){ + return parseInt(values[1], 10) - parseInt(values[0], 10); + }else{ + return parseInt(values[0], 10); + } + }, + showPointerValue: function(pointer, position, animate){ + var label = $('.pointer-label', this.domNode)[pointer.hasClass('low')?'first':'last'](); + var text; + var value = this.positionToValue(position); + if($.isFunction(this.options.format)){ + var type = this.isSingle() ? undefined : (pointer.hasClass('low') ? 'low':'high'); + text = this.options.format(value, type); + }else{ + text = this.options.format.replace('%s', value); + } + + var width = label.html(text).width(), + left = position - width / 2; + left = Math.min(Math.max(left, 0), this.options.width - width); + label[animate?'animate':'css']({left: left}); + this.setInputValue(pointer, value); + }, + valuesToPrc: function(values){ + var lowPrc = ( ( values[0] - this.options.from ) * 100 / this.interval ), + highPrc = ( ( values[1] - this.options.from ) * 100 / this.interval ); + return [lowPrc, highPrc]; + }, + prcToPx: function(prc){ + return (this.domNode.width() * prc) / 100; + }, + positionToValue: function(pos){ + var value = (pos / this.domNode.width()) * this.interval; + value = value + this.options.from; + return Math.round(value / this.options.step) * this.options.step; + }, + setInputValue: function(pointer, v){ + // if(!isChanged) return; + if(this.isSingle()){ + this.options.value = v.toString(); + }else{ + var values = this.options.value.split(','); + if(pointer.hasClass('low')){ + this.options.value = v + ',' + values[1]; + }else{ + this.options.value = values[0] + ',' + v; + } + } + if( this.inputNode.val() !== this.options.value ){ + this.inputNode.val(this.options.value); + this.options.onstatechange.call(this, this.options.value); + } + }, + getValue: function(){ + return this.options.value; + } + }; + + /*$.jRange = function (node, options) { + var jNode = $(node); + if(!jNode.data('jrange')){ + jNode.data('jrange', new jRange(node, options)); + } + return jNode.data('jrange'); + }; + + $.fn.jRange = function (options) { + return this.each(function(){ + $.jRange(this, options); + }); + };*/ + + var pluginName = 'jRange'; + // A really lightweight plugin wrapper around the constructor, + // preventing against multiple instantiations + $.fn[pluginName] = function(option) { + var args = arguments, + result; + + this.each(function() { + var $this = $(this), + data = $.data(this, 'plugin_' + pluginName), + options = typeof option === 'object' && option; + if (!data) { + $this.data('plugin_' + pluginName, (data = new jRange(this, options))); + } + // if first argument is a string, call silimarly named function + // this gives flexibility to call functions of the plugin e.g. + // - $('.dial').plugin('destroy'); + // - $('.dial').plugin('render', $('.new-child')); + if (typeof option === 'string') { + result = data[option].apply(data, Array.prototype.slice.call(args, 1)); + } + }); + + // To enable plugin returns values + return result || this; + }; + +})(jQuery, window, document);
\ No newline at end of file diff --git a/library/jRange/jquery.range.less b/library/jRange/jquery.range.less new file mode 100644 index 000000000..979ed2e1a --- /dev/null +++ b/library/jRange/jquery.range.less @@ -0,0 +1,192 @@ +#gradient { + .horizontal(@startColor: #555, @endColor: #333) { + background-color: @endColor; + background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+ + background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+ + background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+ + background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10 + background-image: linear-gradient(to right, @startColor, @endColor); // Standard, IE10 + background-repeat: repeat-x; + filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@startColor),argb(@endColor))); // IE9 and down + } + .vertical(@startColor: #555, @endColor: #333) { + background-color: mix(@startColor, @endColor, 60%); + background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+ + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+ + background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+ + background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10 + background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10 + background-repeat: repeat-x; + filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down + } + .directional(@startColor: #555, @endColor: #333, @deg: 45deg) { + background-color: @endColor; + background-repeat: repeat-x; + background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+ + background-image: -webkit-linear-gradient(@deg, @startColor, @endColor); // Safari 5.1+, Chrome 10+ + background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10 + background-image: linear-gradient(@deg, @startColor, @endColor); // Standard, IE10 + } + .vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) { + background-color: mix(@midColor, @endColor, 80%); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor)); + background-image: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor); + background-image: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor); + background-image: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor); + background-image: linear-gradient(@startColor, @midColor @colorStop, @endColor); + background-repeat: no-repeat; + filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback + } + .radial(@innerColor: #555, @outerColor: #333) { + background-color: @outerColor; + background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor)); + background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor); + background-image: -moz-radial-gradient(circle, @innerColor, @outerColor); + background-image: -o-radial-gradient(circle, @innerColor, @outerColor); + background-repeat: no-repeat; + } + .striped(@color: #555, @angle: 45deg) { + background-color: @color; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); + } +} + +.slider-container { + width: 300px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + .back-bar { + height: 10px; + position: relative; + .selected-bar { + position: absolute; + height: 100%; + } + .pointer { + position: absolute; + width: 10px; + height: 10px; + background-color: red; + cursor: move; + opacity: 1; + z-index: 2; + } + .pointer-label { + position: absolute; + top: -17px; + font-size: 8px; + background: white; + white-space: nowrap; + line-height: 1; + } + .focused { + z-index: 10; + } + } + .clickable-dummy { + cursor: pointer; + position: absolute; + width: 100%; + height: 100%; + z-index: 1; + } + .scale { + top: 2px; + position: relative; + span { + position: absolute; + height: 5px; + border-left: 1px solid #999; + font-size: 0; + } + ins { + font-size: 9px; + text-decoration: none; + position: absolute; + left: 0; + top: 5px; + color: #999; + line-height: 1; + } + } +} +.theme-green { + .back-bar { + height: 5px; + border-radius: 2px; + background-color: #eeeeee; + #gradient > .vertical(#eeeeee, #dddddd); + .selected-bar { + border-radius: 2px; + #gradient > .vertical(#bdfade, #76fabc); + } + .pointer { + width: 14px; + height: 14px; + top: -5px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border-radius: 10px; + border: 1px solid #AAA; + #gradient > .vertical(#eeeeee, #dddddd); + cursor: col-resize; + } + .pointer-label { + color: #999; + } + .focused { + color: #333; + } + } + .scale { + span { + border-left: 1px solid #e5e5e5; + } + ins { + color: #999; + } + } +} + +.theme-blue { + .back-bar { + height: 5px; + border-radius: 2px; + background-color: #eeeeee; + #gradient > .vertical(#eeeeee, #dddddd); + .selected-bar { + border-radius: 2px; + #gradient > .vertical(#b1d1f9, #64a8f9); + } + .pointer { + width: 14px; + height: 14px; + top: -5px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border-radius: 10px; + border: 1px solid #AAA; + #gradient > .vertical(#eeeeee, #dddddd); + cursor: col-resize; + } + .pointer-label { + color: #999; + } + .focused { + color: #333; + } + } + .scale { + span { + border-left: 1px solid #e5e5e5; + } + ins { + color: #999; + } + } +} diff --git a/library/jgrowl/README b/library/jgrowl/README index 3c94f7508..d0f1a62ad 100644 --- a/library/jgrowl/README +++ b/library/jgrowl/README @@ -1,3 +1,3 @@ -http://stanlemon.net/projects/jgrowl.html +https://github.com/stanlemon/jGrowl jGrowl is free and open source, it's distributed under the MIT and GPL licenses diff --git a/library/jgrowl/jquery.jgrowl.css b/library/jgrowl/jquery.jgrowl.css index b4deb978c..ea3948415 100644 --- a/library/jgrowl/jquery.jgrowl.css +++ b/library/jgrowl/jquery.jgrowl.css @@ -1,136 +1 @@ - -div.jGrowl { - z-index: 9999; - color: #fff; - font-size: 12px; -} - -/** Special IE6 Style Positioning **/ -div.ie6 { - position: absolute; -} - -div.ie6.top-right { - right: auto; - bottom: auto; - left: expression( ( 0 - jGrowl.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); - top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); -} - -div.ie6.top-left { - left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); - top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); -} - -div.ie6.bottom-right { - left: expression( ( 0 - jGrowl.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); - top: expression( ( 0 - jGrowl.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); -} - -div.ie6.bottom-left { - left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); - top: expression( ( 0 - jGrowl.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); -} - -div.ie6.center { - left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); - top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); - width: 100%; -} - -/** Normal Style Positions **/ -div.jGrowl { - position: absolute; -} - -body > div.jGrowl { - position: fixed; -} - -div.jGrowl.top-left { - left: 0px; - top: 0px; -} - -div.jGrowl.top-right { - right: 0px; - top: 0px; -} - -div.jGrowl.bottom-left { - left: 0px; - bottom: 0px; -} - -div.jGrowl.bottom-right { - right: 0px; - bottom: 0px; -} - -div.jGrowl.center { - top: 0px; - width: 50%; - left: 25%; -} - -/** Cross Browser Styling **/ -div.center div.jGrowl-notification, div.center div.jGrowl-closer { - margin-left: auto; - margin-right: auto; -} - -div.jGrowl div.jGrowl-notification, div.jGrowl div.jGrowl-closer { - background-color: #000; - opacity: .85; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85); - zoom: 1; - width: 235px; - padding: 10px; - margin-top: 5px; - margin-bottom: 5px; - font-family: Tahoma, Arial, Helvetica, sans-serif; - font-size: 1em; - text-align: left; - display: none; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; -} - -div.jGrowl div.jGrowl-notification { - min-height: 40px; -} - -div.jGrowl div.jGrowl-notification, -div.jGrowl div.jGrowl-closer { - margin: 10px; -} - -div.jGrowl div.jGrowl-notification div.jGrowl-header { - font-weight: bold; - font-size: .85em; -} - -div.jGrowl div.jGrowl-notification div.jGrowl-close { - z-index: 99; - float: right; - font-weight: bold; - font-size: 1em; - cursor: pointer; -} - -div.jGrowl div.jGrowl-closer { - padding-top: 4px; - padding-bottom: 4px; - cursor: pointer; - font-size: .9em; - font-weight: bold; - text-align: center; -} - -/** Hide jGrowl when printing **/ -@media print { - div.jGrowl { - display: none; - } -} +.jGrowl{z-index:9999;color:#fff;font-size:12px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;position:fixed}.jGrowl.top-left{left:0;top:0}.jGrowl.top-right{right:0;top:0}.jGrowl.bottom-left{left:0;bottom:0}.jGrowl.bottom-right{right:0;bottom:0}.jGrowl.center{top:0;width:50%;left:25%}.jGrowl.center .jGrowl-closer,.jGrowl.center .jGrowl-notification{margin-left:auto;margin-right:auto}.jGrowl-notification{background-color:#000;opacity:.9;-ms-filter:alpha(90);filter:alpha(90);zoom:1;width:250px;padding:10px;margin:10px;text-align:left;display:none;border-radius:5px;min-height:40px}.jGrowl-notification .ui-state-highlight,.jGrowl-notification .ui-widget-content .ui-state-highlight,.jGrowl-notification .ui-widget-header .ui-state-highlight{border:1px solid #000;background:#000;color:#fff}.jGrowl-notification .jGrowl-header{font-weight:700;font-size:.85em}.jGrowl-notification .jGrowl-close{background-color:transparent;color:inherit;border:none;z-index:99;float:right;font-weight:700;font-size:1em;cursor:pointer}.jGrowl-closer{background-color:#000;opacity:.9;-ms-filter:alpha(90);filter:alpha(90);zoom:1;width:250px;padding:10px;margin:10px;display:none;border-radius:5px;padding-top:4px;padding-bottom:4px;cursor:pointer;font-size:.9em;font-weight:700;text-align:center}.jGrowl-closer .ui-state-highlight,.jGrowl-closer .ui-widget-content .ui-state-highlight,.jGrowl-closer .ui-widget-header .ui-state-highlight{border:1px solid #000;background:#000;color:#fff}@media print{.jGrowl{display:none}}
\ No newline at end of file diff --git a/library/jgrowl/jquery.jgrowl_minimized.js b/library/jgrowl/jquery.jgrowl_minimized.js index 782898098..7e8b6fb35 100644 --- a/library/jgrowl/jquery.jgrowl_minimized.js +++ b/library/jgrowl/jquery.jgrowl_minimized.js @@ -1,11 +1,2 @@ -(function($){$.jGrowl=function(m,o){if($('#jGrowl').size()==0) -$('<div id="jGrowl"></div>').addClass((o&&o.position)?o.position:$.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o);};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',$.extend(new $.fn.jGrowl(),{notifications:[],element:null,interval:null}));$(this).data('jGrowl.instance').startup(this);} -if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1));}else{$(this).data('jGrowl.instance').create(m,o);}});};};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',themeState:'highlight',corners:'10px',check:250,life:3000,closeDuration:'normal',openDuration:'normal',easing:'swing',closer:true,closeTemplate:'×',closerTemplate:'<div>[ close all ]</div>',log:function(e,m,o){},beforeOpen:function(e,m,o){},afterOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);if(typeof o.speed!=='undefined'){o.openDuration=o.speed;o.closeDuration=o.speed;} -this.notifications.push({message:message,options:o});o.log.apply(this.element,[this.element,message,o]);},render:function(notification){var self=this;var message=notification.message;var o=notification.options;var notification=$('<div class="jGrowl-notification '+o.themeState+' ui-corner-all'+ -((o.group!=undefined&&o.group!='')?' '+o.group:'')+'">'+'<div class="jGrowl-close">'+o.closeTemplate+'</div>'+'<div class="jGrowl-header">'+o.header+'</div>'+'<div class="jGrowl-message">'+message+'</div></div>').data("jGrowl",o).addClass(o.theme).children('div.jGrowl-close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close');}).parent();$(notification).bind("mouseover.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",true);}).bind("mouseout.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",false);}).bind('jGrowl.beforeOpen',function(){if(o.beforeOpen.apply(notification,[notification,message,o,self.element])!=false){$(this).trigger('jGrowl.open');}}).bind('jGrowl.open',function(){if(o.open.apply(notification,[notification,message,o,self.element])!=false){if(o.glue=='after'){$('div.jGrowl-notification:last',self.element).after(notification);}else{$('div.jGrowl-notification:first',self.element).before(notification);} -$(this).animate(o.animateOpen,o.openDuration,o.easing,function(){if($.browser.msie&&(parseInt($(this).css('opacity'),10)===1||parseInt($(this).css('opacity'),10)===0)) -this.style.removeAttribute('filter');if($(this).data("jGrowl")!=null) -$(this).data("jGrowl").created=new Date();$(this).trigger('jGrowl.afterOpen');});}}).bind('jGrowl.afterOpen',function(){o.afterOpen.apply(notification,[notification,message,o,self.element]);}).bind('jGrowl.beforeClose',function(){if(o.beforeClose.apply(notification,[notification,message,o,self.element])!=false) -$(this).trigger('jGrowl.close');}).bind('jGrowl.close',function(){$(this).data('jGrowl.pause',true);$(this).animate(o.animateClose,o.closeDuration,o.easing,function(){if($.isFunction(o.close)){if(o.close.apply(notification,[notification,message,o,self.element])!==false) -$(this).remove();}else{$(this).remove();}});}).trigger('jGrowl.beforeOpen');if(o.corners!=''&&$.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',self.element).size()>1&&$('div.jGrowl-closer',self.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer ui-state-highlight ui-corner-all').addClass(this.defaults.theme).appendTo(self.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().trigger("jGrowl.beforeClose");if($.isFunction(self.defaults.closer)){self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);}});};},update:function(){$(this.element).find('div.jGrowl-notification:parent').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+parseInt($(this).data("jGrowl").life))<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl.pause")==undefined||$(this).data("jGrowl.pause")!=true)){$(this).trigger('jGrowl.beforeClose');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()<this.defaults.pool)) -this.render(this.notifications.shift());if($(this.element).find('div.jGrowl-notification:parent').size()<2){$(this.element).find('div.jGrowl-closer').animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){$(this).remove();});}},startup:function(e){this.element=$(e).addClass('jGrowl').append('<div class="jGrowl-notification"></div>');this.interval=setInterval(function(){$(e).data('jGrowl.instance').update();},parseInt(this.defaults.check));if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"]){$(this.element).addClass('ie6');}},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval);},close:function(){$(this.element).find('div.jGrowl-notification').each(function(){$(this).trigger('jGrowl.beforeClose');});}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery);
\ No newline at end of file +!function(a){a.jGrowl=function(b,c){0===a("#jGrowl").length&&a('<div id="jGrowl"></div>').addClass(c&&c.position?c.position:a.jGrowl.defaults.position).appendTo(c&&c.appendTo?c.appendTo:a.jGrowl.defaults.appendTo),a("#jGrowl").jGrowl(b,c)},a.fn.jGrowl=function(b,c){if(void 0===c&&a.isPlainObject(b)&&(c=b,b=c.message),a.isFunction(this.each)){var d=arguments;return this.each(function(){void 0===a(this).data("jGrowl.instance")&&(a(this).data("jGrowl.instance",a.extend(new a.fn.jGrowl,{notifications:[],element:null,interval:null})),a(this).data("jGrowl.instance").startup(this)),a.isFunction(a(this).data("jGrowl.instance")[b])?a(this).data("jGrowl.instance")[b].apply(a(this).data("jGrowl.instance"),a.makeArray(d).slice(1)):a(this).data("jGrowl.instance").create(b,c)})}},a.extend(a.fn.jGrowl.prototype,{defaults:{pool:0,header:"",group:"",sticky:!1,position:"top-right",appendTo:"body",glue:"after",theme:"default",themeState:"highlight",corners:"10px",check:250,life:3e3,closeDuration:"normal",openDuration:"normal",easing:"swing",closer:!0,closeTemplate:"×",closerTemplate:"<div>[ close all ]</div>",log:function(){},beforeOpen:function(){},afterOpen:function(){},open:function(){},beforeClose:function(){},close:function(){},click:function(){},animateOpen:{opacity:"show"},animateClose:{opacity:"hide"}},notifications:[],element:null,interval:null,create:function(b,c){var d=a.extend({},this.defaults,c);"undefined"!=typeof d.speed&&(d.openDuration=d.speed,d.closeDuration=d.speed),this.notifications.push({message:b,options:d}),d.log.apply(this.element,[this.element,b,d])},render:function(b){var c=this,d=b.message,e=b.options;e.themeState=""===e.themeState?"":"ui-state-"+e.themeState;var f=a("<div/>").addClass("jGrowl-notification alert "+e.themeState+" ui-corner-all"+(void 0!==e.group&&""!==e.group?" "+e.group:"")).append(a("<button/>").addClass("jGrowl-close").html(e.closeTemplate)).append(a("<div/>").addClass("jGrowl-header").html(e.header)).append(a("<div/>").addClass("jGrowl-message").html(d)).data("jGrowl",e).addClass(e.theme).children(".jGrowl-close").bind("click.jGrowl",function(){return a(this).parent().trigger("jGrowl.beforeClose"),!1}).parent();a(f).bind("mouseover.jGrowl",function(){a(".jGrowl-notification",c.element).data("jGrowl.pause",!0)}).bind("mouseout.jGrowl",function(){a(".jGrowl-notification",c.element).data("jGrowl.pause",!1)}).bind("jGrowl.beforeOpen",function(){e.beforeOpen.apply(f,[f,d,e,c.element])!==!1&&a(this).trigger("jGrowl.open")}).bind("jGrowl.open",function(){e.open.apply(f,[f,d,e,c.element])!==!1&&("after"==e.glue?a(".jGrowl-notification:last",c.element).after(f):a(".jGrowl-notification:first",c.element).before(f),a(this).animate(e.animateOpen,e.openDuration,e.easing,function(){a.support.opacity===!1&&this.style.removeAttribute("filter"),null!==a(this).data("jGrowl")&&"undefined"!=typeof a(this).data("jGrowl")&&(a(this).data("jGrowl").created=new Date),a(this).trigger("jGrowl.afterOpen")}))}).bind("jGrowl.afterOpen",function(){e.afterOpen.apply(f,[f,d,e,c.element])}).bind("click",function(){e.click.apply(f,[f.message,e,c.element])}).bind("jGrowl.beforeClose",function(){e.beforeClose.apply(f,[f,d,e,c.element])!==!1&&a(this).trigger("jGrowl.close")}).bind("jGrowl.close",function(){a(this).data("jGrowl.pause",!0),a(this).animate(e.animateClose,e.closeDuration,e.easing,function(){a.isFunction(e.close)?e.close.apply(f,[f,d,e,c.element])!==!1&&a(this).remove():a(this).remove()})}).trigger("jGrowl.beforeOpen"),""!==e.corners&&void 0!==a.fn.corner&&a(f).corner(e.corners),a(".jGrowl-notification:parent",c.element).length>1&&0===a(".jGrowl-closer",c.element).length&&this.defaults.closer!==!1&&a(this.defaults.closerTemplate).addClass("jGrowl-closer "+this.defaults.themeState+" ui-corner-all").addClass(this.defaults.theme).appendTo(c.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){a(this).siblings().trigger("jGrowl.beforeClose"),a.isFunction(c.defaults.closer)&&c.defaults.closer.apply(a(this).parent()[0],[a(this).parent()[0]])})},update:function(){a(this.element).find(".jGrowl-notification:parent").each(function(){void 0!==a(this).data("jGrowl")&&void 0!==a(this).data("jGrowl").created&&a(this).data("jGrowl").created.getTime()+parseInt(a(this).data("jGrowl").life,10)<(new Date).getTime()&&a(this).data("jGrowl").sticky!==!0&&(void 0===a(this).data("jGrowl.pause")||a(this).data("jGrowl.pause")!==!0)&&a(this).trigger("jGrowl.beforeClose")}),this.notifications.length>0&&(0===this.defaults.pool||a(this.element).find(".jGrowl-notification:parent").length<this.defaults.pool)&&this.render(this.notifications.shift()),a(this.element).find(".jGrowl-notification:parent").length<2&&a(this.element).find(".jGrowl-closer").animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){a(this).remove()})},startup:function(b){this.element=a(b).addClass("jGrowl").append('<div class="jGrowl-notification"></div>'),this.interval=setInterval(function(){a(b).data("jGrowl.instance").update()},parseInt(this.defaults.check,10))},shutdown:function(){a(this.element).removeClass("jGrowl").find(".jGrowl-notification").trigger("jGrowl.close").parent().empty(),clearInterval(this.interval)},close:function(){a(this.element).find(".jGrowl-notification").each(function(){a(this).trigger("jGrowl.beforeClose")})}}),a.jGrowl.defaults=a.fn.jGrowl.prototype.defaults}(jQuery); +//# sourceMappingURL=jquery.jgrowl.map
\ No newline at end of file diff --git a/library/jquery.divgrow/divGrow-1.3.1.zip b/library/jquery.divgrow/divGrow-1.3.1.zip Binary files differdeleted file mode 100644 index 8f1deacf1..000000000 --- a/library/jquery.divgrow/divGrow-1.3.1.zip +++ /dev/null diff --git a/library/jquery.divgrow/howto b/library/jquery.divgrow/howto deleted file mode 100644 index c2fdd66f9..000000000 --- a/library/jquery.divgrow/howto +++ /dev/null @@ -1,46 +0,0 @@ -1) Inlcude the JS file into your page (after jQuery): - -<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> - -<script src="JS/jquery.divgrow.js" type="text/javascript"></script> - - -2) Call the divgrow function to any div element you want to grow. initialHeight sets the height of the containers before they are expanded. - -<script type="text/javascript"> - $().ready(function() { - $('div.more-block').divgrow({ initialHeight: 147 }); - }); - - -3) Create you container and give it a reference, i.e. by classname "more-block" - - <div class="more-block"> - <h2>Corns and Callus (Hyperkeratosis)</h2> - <p> - These occur in areas of the foot that are experiencing excess pressure and/or friction. The body seeks to defend itself by producing extra layers of skin as a form of protection. However as the process continues the accumulation of extra skin exceeds that which is lost naturally so the skin in these vulnerable areas builds up and becomes compacted as the original cause of the process continues. The protective mechanism becomes the problem if left untreated and the cause not addressed.<br /> - Callus denotes a general area of hard dead skin and a corn is a much more concentrated collection which often goes deep rather than wide. Corns can produce pain completely out of proportion to their size often because of impingement upon nerves or sometimes infection.<br /> - Treatment of the symptoms is the first step to stopping the pain and discomfort and this is usually addressed without much discomfort by a foot health professional. Treating the cause can be as simple as discarding an ill fitting pair of shoes or may entail a more detailed assessment of individual foot function.<br /> - Callus is not always caused by mechanical factors but can be a symptom of a systemic disease such as Psoriasis.<br /> - There are some useful devices to assist in protecting vulnerable areas from corns and callus ? see our recommended <a href="Products.aspx">products page</a>. - </p> - </div> - - - ------------------------------------------------------ - -Thats it. - -Optional arguments: - -initialHeight: 100 - (default) -moreText: "+ Show More" - (default) -lessText: "- Show Less" - (default) -showBrackets: true - (default) - -e.g. - -$('div.more-block').divgrow({ initialHeight: 147, moreText: "give me more", lessText: "thats enough", showBrackets: false }); - - diff --git a/library/jquery.divgrow/jquery.divgrow-1.3.1.js b/library/jquery.divgrow/jquery.divgrow-1.3.1.js deleted file mode 100644 index 49788f802..000000000 --- a/library/jquery.divgrow/jquery.divgrow-1.3.1.js +++ /dev/null @@ -1,89 +0,0 @@ -/*
-* Copyright (c) 2010 Simon Hibbard
-*
-* Permission is hereby granted, free of charge, to any person
-* obtaining a copy of this software and associated documentation
-* files (the "Software"), to deal in the Software without
-* restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell
-* copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following
-* conditions:
-
-* The above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-* OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-/*
-* Version: V1.3.1
-* Release: 22-12-2010
-* Based on jQuery 1.4.2
-*/
-
-(function ($) {
- var divgrowid = 0;
- $.fn.divgrow = function (options) {
- var options = $.extend({}, { initialHeight: 100, moreText: "+ Show More", lessText: "- Show Less", speed: 400, showBrackets: true }, options);
-
- return this.each(function () {
- divgrowid++;
-
- obj = $(this);
-
- var fullHeight = obj.height() + 10;
-
- obj.css('height', options.initialHeight).css('overflow', 'hidden');
- if (options.showBrackets) {
- obj.after('<p class="divgrow-brackets">[…]</p><div href="#" class="divgrow-showmore' + " divgrow-obj-" + divgrowid + '"' + '></div>');
- }
- else {
- obj.after('<div class="divgrow-showmore' + " divgrow-obj-" + divgrowid + '"' + '></div>');
- }
- $("div.divgrow-showmore").html(options.moreText);
-
- $("." + "divgrow-obj-" + divgrowid).toggle(function () {
- //alert(obj.attr('class'));
- // Set the height from the elements rel value
- //var height = $(this).prevAll("div:first").attr('rel');
-
- $(this).prevAll("div:first").animate({ height: fullHeight + "px" }, options.speed, function () { // Animation complete.
-
- // Hide the overlay text when expanded, change the link text
- if (options.showBrackets) {
- $(this).nextAll("p.divgrow-brackets:first").fadeOut();
- }
- $(this).nextAll("div.divgrow-showmore:first").html(options.lessText);
-
- });
-
-
- }, function () {
-
- $(this).prevAll("div:first").stop(true, false).animate({ height: options.initialHeight }, options.speed, function () { // Animation complete.
-
- // show the overlay text while closed, change the link text
- if (options.showBrackets) {
- $(this).nextAll("p.divgrow-brackets:first").stop(true, false).fadeIn();
- }
- $(this).nextAll("div.divgrow-showmore:first").stop(true, false).html(options.moreText);
-
- });
- });
-
- });
- };
-})(jQuery);
-
-
-
-
-
diff --git a/library/jquery.divgrow/jquery.divgrow-1.3.1.min.js b/library/jquery.divgrow/jquery.divgrow-1.3.1.min.js deleted file mode 100644 index fd08f7fa8..000000000 --- a/library/jquery.divgrow/jquery.divgrow-1.3.1.min.js +++ /dev/null @@ -1 +0,0 @@ -(function ($) { var divgrowid = 0; $.fn.divgrow = function (options) { var options = $.extend({}, { initialHeight: 100, moreText: "+ Show More", lessText: "- Show Less", speed: 1000, showBrackets: true }, options); return this.each(function () { divgrowid++; obj = $(this); var fullHeight = obj.height() + 10; obj.css('height', options.initialHeight).css('overflow', 'hidden'); if (options.showBrackets) { obj.after('<p class="divgrow-brackets">[…]</p><a href="#" class="divgrow-showmore' + " divgrow-obj-" + divgrowid + '"' + '></a>') } else { obj.after('<a href="#" class="divgrow-showmore' + " divgrow-obj-" + divgrowid + '"' + '></a>') } $("a.divgrow-showmore").html(options.moreText); $("." + "divgrow-obj-" + divgrowid).toggle(function () { $(this).prevAll("div:first").animate({ height: fullHeight + "px" }, options.speed, function () { if (options.showBrackets) { $(this).nextAll("p.divgrow-brackets:first").fadeOut() } $(this).nextAll("a.divgrow-showmore:first").html(options.lessText) }) }, function () { $(this).prevAll("div:first").stop(true, false).animate({ height: options.initialHeight }, options.speed, function () { if (options.showBrackets) { $(this).nextAll("p.divgrow-brackets:first").stop(true, false).fadeIn() } $(this).nextAll("a.divgrow-showmore:first").stop(true, false).html(options.moreText) }) }) }) } })(jQuery);
\ No newline at end of file diff --git a/library/jslider/.gitignore b/library/jslider/.gitignore deleted file mode 100644 index 1e0fc5a99..000000000 --- a/library/jslider/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*/.DS_Store -.DS_Store diff --git a/library/jslider/Makefile b/library/jslider/Makefile deleted file mode 100644 index 0559b48e5..000000000 --- a/library/jslider/Makefile +++ /dev/null @@ -1,15 +0,0 @@ - -css_compiler: js_compiler - mkdir -p bin - cat css/jslider.css css/jslider.blue.css css/jslider.plastic.css css/jslider.round.css css/jslider.round.plastic.css > bin/jquery.slider.all.css - java -jar tools/yuicompressor-2.4.7.jar --type=css bin/jquery.slider.all.css > bin/jquery.slider.min.css - rm -f bin/jquery.slider.all.css - -js_compiler: - mkdir -p bin - rm -f bin/jquery.slider.all.js bin/jquery.slider.min.js - cat js/jshashtable-2.1_src.js js/jquery.numberformatter-1.2.3.js js/tmpl.js js/jquery.dependClass-0.1.js js/draggable-0.1.js js/jquery.slider.js > bin/jquery.slider.all.js - uglifyjs -nc bin/jquery.slider.all.js > bin/jquery.slider.min.js - rm -f bin/jquery.slider.all.js - - diff --git a/library/jslider/README.md b/library/jslider/README.md deleted file mode 100644 index 0d4c61347..000000000 --- a/library/jslider/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# jQuery Slider plugin - -jQuery Slider is easy to use and multifunctional jQuery plugin. - -[Check out demos and documentations here](http://egorkhmelev.github.com/jslider/) - -## License - -(MIT License) — Copyright © 2012 Egor Khmelev
\ No newline at end of file diff --git a/library/jslider/bin/jquery.slider.min.css b/library/jslider/bin/jquery.slider.min.css deleted file mode 100644 index 14b3f2210..000000000 --- a/library/jslider/bin/jquery.slider.min.css +++ /dev/null @@ -1 +0,0 @@ -.jslider .jslider-bg i,.jslider .jslider-pointer{background:url(../img/jslider.png) no-repeat 0 0}.jslider{display:block;width:100%;height:1em;position:relative;top:.6em;font-family:Arial,sans-serif}.jslider table{width:100%;border-collapse:collapse;border:0}.jslider td,.jslider th{padding:0;vertical-align:top;text-align:left;border:0}.jslider table,.jslider table tr,.jslider table tr td{width:100%;vertical-align:top}.jslider .jslider-bg{position:relative}.jslider .jslider-bg i{height:5px;position:absolute;font-size:0;top:0}.jslider .jslider-bg .l{width:50%;background-position:0 0;left:0}.jslider .jslider-bg .r{width:50%;left:50%;background-position:right 0}.jslider .jslider-bg .v{position:absolute;width:60%;left:20%;top:0;height:5px;background-position:0 -20px}.jslider .jslider-pointer{width:13px;height:15px;background-position:0 -40px;position:absolute;left:20%;top:-4px;margin-left:-6px;cursor:pointer;cursor:hand}.jslider .jslider-pointer-hover{background-position:-20px -40px}.jslider .jslider-pointer-to{left:80%}.jslider .jslider-label{font-size:9px;line-height:12px;color:black;opacity:.4;white-space:nowrap;padding:0 2px;position:absolute;top:-18px;left:0}.jslider .jslider-label-to{left:auto;right:0}.jslider .jslider-value{font-size:9px;white-space:nowrap;padding:1px 2px 0;position:absolute;top:-19px;left:20%;background:white;line-height:12px;-moz-border-radius:2px;-webkit-border-radius:2px;-o-border-radius:2px;border-radius:2px}.jslider .jslider-value-to{left:80%}.jslider .jslider-label small,.jslider .jslider-value small{position:relative;top:-0.4em}.jslider .jslider-scale{position:relative;top:9px}.jslider .jslider-scale span{position:absolute;height:5px;border-left:1px solid #999;font-size:0}.jslider .jslider-scale ins{font-size:9px;text-decoration:none;position:absolute;left:0;top:5px;color:#999}.jslider-single .jslider-pointer-to,.jslider-single .jslider-value-to,.jslider-single .jslider-bg .v,.jslider-limitless .jslider-label{display:none}.jslider_blue .jslider-bg i,.jslider_blue .jslider-pointer{background-image:url(../img/jslider.blue.png)}.jslider_plastic .jslider-bg i,.jslider_plastic .jslider-pointer{background-image:url(../img/jslider.plastic.png)}.jslider_round .jslider-bg i,.jslider_round .jslider-pointer{background-image:url(../img/jslider.round.png)}.jslider_round .jslider-pointer{width:17px;height:17px;top:-6px;margin-left:-8px}.jslider_round_plastic .jslider-bg i,.jslider_round_plastic .jslider-pointer{background-image:url(../img/jslider.round.plastic.png)}.jslider_round_plastic .jslider-pointer{width:18px;height:18px;top:-7px;margin-left:-8px}
\ No newline at end of file diff --git a/library/jslider/bin/jquery.slider.min.js b/library/jslider/bin/jquery.slider.min.js deleted file mode 100644 index 562c5af80..000000000 --- a/library/jslider/bin/jquery.slider.min.js +++ /dev/null @@ -1 +0,0 @@ -var Hashtable=function(){function c(b){var d;if(typeof b=="string")return b;if(typeof b.hashCode==a)return d=b.hashCode(),typeof d=="string"?d:c(d);if(typeof b.toString==a)return b.toString();try{return String(b)}catch(e){return Object.prototype.toString.call(b)}}function d(a,b){return a.equals(b)}function e(b,c){return typeof c.equals==a?c.equals(b):b===c}function f(a){return function(b){if(b===null)throw new Error("null is not a valid "+a);if(typeof b=="undefined")throw new Error(a+" must not be undefined")}}function i(a,b,c,d){this[0]=a,this.entries=[],this.addEntry(b,c),d!==null&&(this.getEqualityFunction=function(){return d})}function m(a){return function(b){var c=this.entries.length,d,e=this.getEqualityFunction(b);while(c--){d=this.entries[c];if(e(b,d[0]))switch(a){case j:return!0;case k:return d;case l:return[c,d[1]]}}return!1}}function n(a){return function(b){var c=b.length;for(var d=0,e=this.entries.length;d<e;++d)b[c+d]=this.entries[d][a]}}function o(a,b){var c=a.length,d;while(c--){d=a[c];if(b===d[0])return c}return null}function p(a,b){var c=a[b];return c&&c instanceof i?c:null}function q(d,e){var f=this,j=[],k={},l=typeof d==a?d:c,m=typeof e==a?e:null;this.put=function(a,b){g(a),h(b);var c=l(a),d,e,f=null;return d=p(k,c),d?(e=d.getEntryForKey(a),e?(f=e[1],e[1]=b):d.addEntry(a,b)):(d=new i(c,a,b,m),j[j.length]=d,k[c]=d),f},this.get=function(a){g(a);var b=l(a),c=p(k,b);if(c){var d=c.getEntryForKey(a);if(d)return d[1]}return null},this.containsKey=function(a){g(a);var b=l(a),c=p(k,b);return c?c.containsKey(a):!1},this.containsValue=function(a){h(a);var b=j.length;while(b--)if(j[b].containsValue(a))return!0;return!1},this.clear=function(){j.length=0,k={}},this.isEmpty=function(){return!j.length};var n=function(a){return function(){var b=[],c=j.length;while(c--)j[c][a](b);return b}};this.keys=n("keys"),this.values=n("values"),this.entries=n("getEntries"),this.remove=function(a){g(a);var c=l(a),d,e=null,f=p(k,c);return f&&(e=f.removeEntryForKey(a),e!==null&&(f.entries.length||(d=o(j,c),b(j,d),delete k[c]))),e},this.size=function(){var a=0,b=j.length;while(b--)a+=j[b].entries.length;return a},this.each=function(a){var b=f.entries(),c=b.length,d;while(c--)d=b[c],a(d[0],d[1])},this.putAll=function(b,c){var d=b.entries(),e,g,h,i,j=d.length,k=typeof c==a;while(j--)e=d[j],g=e[0],h=e[1],k&&(i=f.get(g))&&(h=c(g,i,h)),f.put(g,h)},this.clone=function(){var a=new q(d,e);return a.putAll(f),a}}var a="function",b=typeof Array.prototype.splice==a?function(a,b){a.splice(b,1)}:function(a,b){var c,d,e;if(b===a.length-1)a.length=b;else{c=a.slice(b+1),a.length=b;for(d=0,e=c.length;d<e;++d)a[b+d]=c[d]}},g=f("key"),h=f("value"),j=0,k=1,l=2;return i.prototype={getEqualityFunction:function(b){return typeof b.equals==a?d:e},getEntryForKey:m(k),getEntryAndIndexForKey:m(l),removeEntryForKey:function(a){var c=this.getEntryAndIndexForKey(a);return c?(b(this.entries,c[0]),c[1]):null},addEntry:function(a,b){this.entries[this.entries.length]=[a,b]},keys:n(0),values:n(1),getEntries:function(a){var b=a.length;for(var c=0,d=this.entries.length;c<d;++c)a[b+c]=this.entries[c].slice(0)},containsKey:m(j),containsValue:function(a){var b=this.entries.length;while(b--)if(a===this.entries[b][1])return!0;return!1}},q}();(function(a){function i(a,b,c){this.dec=a,this.group=b,this.neg=c}function j(){for(var a=0;a<h.length;a++){localeGroup=h[a];for(var c=0;c<localeGroup.length;c++)b.put(localeGroup[c],a)}}function k(a,c){b.size()==0&&j();var d=".",e=",",f="-";c==0&&(a.indexOf("_")!=-1?a=a.split("_")[1].toLowerCase():a.indexOf("-")!=-1&&(a=a.split("-")[1].toLowerCase()));var h=b.get(a);if(h){var k=g[h];k&&(d=k[0],e=k[1])}return new i(d,e,f)}var b=new Hashtable,c=["ae","au","ca","cn","eg","gb","hk","il","in","jp","sk","th","tw","us"],d=["at","br","de","dk","es","gr","it","nl","pt","tr","vn"],e=["cz","fi","fr","ru","se","pl"],f=["ch"],g=[[".",","],[",","."],[","," "],[".","'"]],h=[c,d,e,f];a.fn.formatNumber=function(b,c,d){return this.each(function(){c==null&&(c=!0),d==null&&(d=!0);var e;a(this).is(":input")?e=new String(a(this).val()):e=new String(a(this).text());var f=a.formatNumber(e,b);c&&(a(this).is(":input")?a(this).val(f):a(this).text(f));if(d)return f})},a.formatNumber=function(b,c){var c=a.extend({},a.fn.formatNumber.defaults,c),d=k(c.locale.toLowerCase(),c.isFullLocale),e=d.dec,f=d.group,g=d.neg,h="0#-,.",i="",j=!1;for(var l=0;l<c.format.length;l++){if(h.indexOf(c.format.charAt(l))!=-1){if(l==0&&c.format.charAt(l)=="-"){j=!0;continue}break}i+=c.format.charAt(l)}var m="";for(var l=c.format.length-1;l>=0;l--){if(h.indexOf(c.format.charAt(l))!=-1)break;m=c.format.charAt(l)+m}c.format=c.format.substring(i.length),c.format=c.format.substring(0,c.format.length-m.length);var n=new Number(b);return a._formatNumber(n,c,m,i,j)},a._formatNumber=function(b,c,d,e,f){var c=a.extend({},a.fn.formatNumber.defaults,c),g=k(c.locale.toLowerCase(),c.isFullLocale),h=g.dec,i=g.group,j=g.neg,l=!1;if(isNaN(b)){if(c.nanForceZero!=1)return null;b=0,l=!0}d=="%"&&(b*=100);var m="";if(c.format.indexOf(".")>-1){var n=h,o=c.format.substring(c.format.lastIndexOf(".")+1);if(c.round==1)b=new Number(b.toFixed(o.length));else{var p=b.toString();p=p.substring(0,p.lastIndexOf(".")+o.length+1),b=new Number(p)}var q=b%1,r=new String(q.toFixed(o.length));r=r.substring(r.lastIndexOf(".")+1);for(var s=0;s<o.length;s++){if(o.charAt(s)=="#"&&r.charAt(s)!="0"){n+=r.charAt(s);continue}if(o.charAt(s)=="#"&&r.charAt(s)=="0"){var t=r.substring(s);if(t.match("[1-9]")){n+=r.charAt(s);continue}break}o.charAt(s)=="0"&&(n+=r.charAt(s))}m+=n}else b=Math.round(b);var u=Math.floor(b);b<0&&(u=Math.ceil(b));var v="";c.format.indexOf(".")==-1?v=c.format:v=c.format.substring(0,c.format.indexOf("."));var w="";if(u!=0||v.substr(v.length-1)!="#"||l){var x=new String(Math.abs(u)),y=9999;v.lastIndexOf(",")!=-1&&(y=v.length-v.lastIndexOf(",")-1);var z=0;for(var s=x.length-1;s>-1;s--)w=x.charAt(s)+w,z++,z==y&&s!=0&&(w=i+w,z=0);if(v.length>w.length){var A=v.indexOf("0");if(A!=-1){var B=v.length-A,C=v.length-w.length-1;while(w.length<B){var D=v.charAt(C);D==","&&(D=i),w=D+w,C--}}}}return!w&&v.indexOf("0",v.length-1)!==-1&&(w="0"),m=w+m,b<0&&f&&e.length>0?e=j+e:b<0&&(m=j+m),c.decimalSeparatorAlwaysShown||m.lastIndexOf(h)==m.length-1&&(m=m.substring(0,m.length-1)),m=e+m+d,m},a.fn.parseNumber=function(b,c,d){c==null&&(c=!0),d==null&&(d=!0);var e;a(this).is(":input")?e=new String(a(this).val()):e=new String(a(this).text());var f=a.parseNumber(e,b);if(f){c&&(a(this).is(":input")?a(this).val(f.toString()):a(this).text(f.toString()));if(d)return f}},a.parseNumber=function(b,c){var c=a.extend({},a.fn.parseNumber.defaults,c),d=k(c.locale.toLowerCase(),c.isFullLocale),e=d.dec,f=d.group,g=d.neg,h="1234567890.-";while(b.indexOf(f)>-1)b=b.replace(f,"");b=b.replace(e,".").replace(g,"-");var i="",j=!1;if(b.charAt(b.length-1)=="%"||c.isPercentage==1)j=!0;for(var l=0;l<b.length;l++)h.indexOf(b.charAt(l))>-1&&(i+=b.charAt(l));var m=new Number(i);if(j){m/=100;var n=i.indexOf(".");if(n!=-1){var o=i.length-n-1;m=m.toFixed(o+2)}else m=m.toFixed(i.length-1)}return m},a.fn.parseNumber.defaults={locale:"us",decimalSeparatorAlwaysShown:!1,isPercentage:!1,isFullLocale:!1},a.fn.formatNumber.defaults={format:"#,###.00",locale:"us",decimalSeparatorAlwaysShown:!1,nanForceZero:!0,round:!0,isFullLocale:!1},Number.prototype.toFixed=function(b){return a._roundNumber(this,b)},a._roundNumber=function(a,b){var c=Math.pow(10,b||0),d=String(Math.round(a*c)/c);if(b>0){var e=d.indexOf(".");e==-1?(d+=".",e=0):e=d.length-(e+1);while(e<b)d+="0",e++}return d}})(jQuery),function(){var a={};this.tmpl=function b(c,d){var e=/\W/.test(c)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+c.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):a[c]=a[c]||b(document.getElementById(c).innerHTML);return d?e(d):e}}(),function(a){a.baseClass=function(b){return b=a(b),b.get(0).className.match(/([^ ]+)/)[1]},a.fn.addDependClass=function(b,c){var d={delimiter:c?c:"-"};return this.each(function(){var c=a.baseClass(this);c&&a(this).addClass(c+d.delimiter+b)})},a.fn.removeDependClass=function(b,c){var d={delimiter:c?c:"-"};return this.each(function(){var c=a.baseClass(this);c&&a(this).removeClass(c+d.delimiter+b)})},a.fn.toggleDependClass=function(b,c){var d={delimiter:c?c:"-"};return this.each(function(){var c=a.baseClass(this);c&&(a(this).is("."+c+d.delimiter+b)?a(this).removeClass(c+d.delimiter+b):a(this).addClass(c+d.delimiter+b))})}}(jQuery),function(a){function b(){this._init.apply(this,arguments)}b.prototype.oninit=function(){},b.prototype.events=function(){},b.prototype.onmousedown=function(){this.ptr.css({position:"absolute"})},b.prototype.onmousemove=function(a,b,c){this.ptr.css({left:b,top:c})},b.prototype.onmouseup=function(){},b.prototype.isDefault={drag:!1,clicked:!1,toclick:!0,mouseup:!1},b.prototype._init=function(){if(arguments.length>0){this.ptr=a(arguments[0]),this.outer=a(".draggable-outer"),this.is={},a.extend(this.is,this.isDefault);var b=this.ptr.offset();this.d={left:b.left,top:b.top,width:this.ptr.width(),height:this.ptr.height()},this.oninit.apply(this,arguments),this._events()}},b.prototype._getPageCoords=function(a){return a.targetTouches&&a.targetTouches[0]?{x:a.targetTouches[0].pageX,y:a.targetTouches[0].pageY}:{x:a.pageX,y:a.pageY}},b.prototype._bindEvent=function(a,b,c){var d=this;this.supportTouches_?a.get(0).addEventListener(this.events_[b],c,!1):a.bind(this.events_[b],c)},b.prototype._events=function(){var b=this;this.supportTouches_=a.browser.webkit&&navigator.userAgent.indexOf("Mobile")!=-1,this.events_={click:this.supportTouches_?"touchstart":"click",down:this.supportTouches_?"touchstart":"mousedown",move:this.supportTouches_?"touchmove":"mousemove",up:this.supportTouches_?"touchend":"mouseup"},this._bindEvent(a(document),"move",function(a){b.is.drag&&(a.stopPropagation(),a.preventDefault(),b._mousemove(a))}),this._bindEvent(a(document),"down",function(a){b.is.drag&&(a.stopPropagation(),a.preventDefault())}),this._bindEvent(a(document),"up",function(a){b._mouseup(a)}),this._bindEvent(this.ptr,"down",function(a){return b._mousedown(a),!1}),this._bindEvent(this.ptr,"up",function(a){b._mouseup(a)}),this.ptr.find("a").click(function(){b.is.clicked=!0;if(!b.is.toclick)return b.is.toclick=!0,!1}).mousedown(function(a){return b._mousedown(a),!1}),this.events()},b.prototype._mousedown=function(b){this.is.drag=!0,this.is.clicked=!1,this.is.mouseup=!1;var c=this.ptr.offset(),d=this._getPageCoords(b);this.cx=d.x-c.left,this.cy=d.y-c.top,a.extend(this.d,{left:c.left,top:c.top,width:this.ptr.width(),height:this.ptr.height()}),this.outer&&this.outer.get(0)&&this.outer.css({height:Math.max(this.outer.height(),a(document.body).height()),overflow:"hidden"}),this.onmousedown(b)},b.prototype._mousemove=function(a){this.is.toclick=!1;var b=this._getPageCoords(a);this.onmousemove(a,b.x-this.cx,b.y-this.cy)},b.prototype._mouseup=function(b){var c=this;this.is.drag&&(this.is.drag=!1,this.outer&&this.outer.get(0)&&(a.browser.mozilla?this.outer.css({overflow:"hidden"}):this.outer.css({overflow:"visible"}),a.browser.msie&&a.browser.version=="6.0"?this.outer.css({height:"100%"}):this.outer.css({height:"auto"})),this.onmouseup(b))},window.Draggable=b}(jQuery),function(a){function b(a){return typeof a=="undefined"?!1:a instanceof Array||!(a instanceof Object)&&Object.prototype.toString.call(a)=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice")?!0:!1}function d(){return this.init.apply(this,arguments)}function e(){Draggable.apply(this,arguments)}a.slider=function(b,c){var e=a(b);return e.data("jslider")||e.data("jslider",new d(b,c)),e.data("jslider")},a.fn.slider=function(c,d){function g(a){return a!==undefined}function h(a){return a!=null}var e,f=arguments;return this.each(function(){var i=a.slider(this,c);if(typeof c=="string")switch(c){case"value":if(g(f[1])&&g(f[2])){var j=i.getPointers();h(j[0])&&h(f[1])&&(j[0].set(f[1]),j[0].setIndexOver()),h(j[1])&&h(f[2])&&(j[1].set(f[2]),j[1].setIndexOver())}else if(g(f[1])){var j=i.getPointers();h(j[0])&&h(f[1])&&(j[0].set(f[1]),j[0].setIndexOver())}else e=i.getValue();break;case"prc":if(g(f[1])&&g(f[2])){var j=i.getPointers();h(j[0])&&h(f[1])&&(j[0]._set(f[1]),j[0].setIndexOver()),h(j[1])&&h(f[2])&&(j[1]._set(f[2]),j[1].setIndexOver())}else if(g(f[1])){var j=i.getPointers();h(j[0])&&h(f[1])&&(j[0]._set(f[1]),j[0].setIndexOver())}else e=i.getPrcValue();break;case"calculatedValue":var k=i.getValue().split(";");e="";for(var l=0;l<k.length;l++)e+=(l>0?";":"")+i.nice(k[l]);break;case"skin":i.setSkin(f[1])}else!c&&!d&&(b(e)||(e=[]),e.push(i))}),b(e)&&e.length==1&&(e=e[0]),e||this};var c={settings:{from:1,to:10,step:1,smooth:!0,limits:!0,round:0,format:{format:"#,##0.##"},value:"5;7",dimension:""},className:"jslider",selector:".jslider-",template:tmpl('<span class="<%=className%>"><table><tr><td><div class="<%=className%>-bg"><i class="l"></i><i class="r"></i><i class="v"></i></div><div class="<%=className%>-pointer"></div><div class="<%=className%>-pointer <%=className%>-pointer-to"></div><div class="<%=className%>-label"><span><%=settings.from%></span></div><div class="<%=className%>-label <%=className%>-label-to"><span><%=settings.to%></span><%=settings.dimension%></div><div class="<%=className%>-value"><span></span><%=settings.dimension%></div><div class="<%=className%>-value <%=className%>-value-to"><span></span><%=settings.dimension%></div><div class="<%=className%>-scale"><%=scale%></div></td></tr></table></span>')};d.prototype.init=function(b,d){this.settings=a.extend(!0,{},c.settings,d?d:{}),this.inputNode=a(b).hide(),this.settings.interval=this.settings.to-this.settings.from,this.settings.value=this.inputNode.attr("value"),this.settings.calculate&&a.isFunction(this.settings.calculate)&&(this.nice=this.settings.calculate),this.settings.onstatechange&&a.isFunction(this.settings.onstatechange)&&(this.onstatechange=this.settings.onstatechange),this.is={init:!1},this.o={},this.create()},d.prototype.onstatechange=function(){},d.prototype.create=function(){var b=this;this.domNode=a(c.template({className:c.className,settings:{from:this.nice(this.settings.from),to:this.nice(this.settings.to),dimension:this.settings.dimension},scale:this.generateScale()})),this.inputNode.after(this.domNode),this.drawScale(),this.settings.skin&&this.settings.skin.length>0&&this.setSkin(this.settings.skin),this.sizes={domWidth:this.domNode.width(),domOffset:this.domNode.offset()},a.extend(this.o,{pointers:{},labels:{0:{o:this.domNode.find(c.selector+"value").not(c.selector+"value-to")},1:{o:this.domNode.find(c.selector+"value").filter(c.selector+"value-to")}},limits:{0:this.domNode.find(c.selector+"label").not(c.selector+"label-to"),1:this.domNode.find(c.selector+"label").filter(c.selector+"label-to")}}),a.extend(this.o.labels[0],{value:this.o.labels[0].o.find("span")}),a.extend(this.o.labels[1],{value:this.o.labels[1].o.find("span")}),b.settings.value.split(";")[1]||(this.settings.single=!0,this.domNode.addDependClass("single")),b.settings.limits||this.domNode.addDependClass("limitless"),this.domNode.find(c.selector+"pointer").each(function(a){var c=b.settings.value.split(";")[a];if(c){b.o.pointers[a]=new e(this,a,b);var d=b.settings.value.split(";")[a-1];d&&new Number(c)<new Number(d)&&(c=d),c=c<b.settings.from?b.settings.from:c,c=c>b.settings.to?b.settings.to:c,b.o.pointers[a].set(c,!0)}}),this.o.value=this.domNode.find(".v"),this.is.init=!0,a.each(this.o.pointers,function(a){b.redraw(this)}),function(b){a(window).resize(function(){b.onresize()})}(this)},d.prototype.setSkin=function(a){this.skin_&&this.domNode.removeDependClass(this.skin_,"_"),this.domNode.addDependClass(this.skin_=a,"_")},d.prototype.setPointersIndex=function(b){a.each(this.getPointers(),function(a){this.index(a)})},d.prototype.getPointers=function(){return this.o.pointers},d.prototype.generateScale=function(){if(this.settings.scale&&this.settings.scale.length>0){var a="",b=this.settings.scale,c=Math.round(100/(b.length-1)*10)/10;for(var d=0;d<b.length;d++)a+='<span style="left: '+d*c+'%">'+(b[d]!="|"?"<ins>"+b[d]+"</ins>":"")+"</span>";return a}return""},d.prototype.drawScale=function(){this.domNode.find(c.selector+"scale span ins").each(function(){a(this).css({marginLeft:-a(this).outerWidth()/2})})},d.prototype.onresize=function(){var b=this;this.sizes={domWidth:this.domNode.width(),domOffset:this.domNode.offset()},a.each(this.o.pointers,function(a){b.redraw(this)})},d.prototype.update=function(){this.onresize(),this.drawScale()},d.prototype.limits=function(a,b){if(!this.settings.smooth){var c=this.settings.step*100/this.settings.interval;a=Math.round(a/c)*c}var d=this.o.pointers[1-b.uid];return d&&b.uid&&a<d.value.prc&&(a=d.value.prc),d&&!b.uid&&a>d.value.prc&&(a=d.value.prc),a<0&&(a=0),a>100&&(a=100),Math.round(a*10)/10},d.prototype.redraw=function(a){if(!this.is.init)return!1;this.setValue(),this.o.pointers[0]&&this.o.pointers[1]&&this.o.value.css({left:this.o.pointers[0].value.prc+"%",width:this.o.pointers[1].value.prc-this.o.pointers[0].value.prc+"%"}),this.o.labels[a.uid].value.html(this.nice(a.value.origin)),this.redrawLabels(a)},d.prototype.redrawLabels=function(a){function b(a,b,d){return b.margin=-b.label/2,label_left=b.border+b.margin,label_left<0&&(b.margin-=label_left),b.border+b.label/2>c.sizes.domWidth?(b.margin=0,b.right=!0):b.right=!1,a.o.css({left:d+"%",marginLeft:b.margin,right:"auto"}),b.right&&a.o.css({left:"auto",right:0}),b}var c=this,d=this.o.labels[a.uid],e=a.value.prc,f={label:d.o.outerWidth(),right:!1,border:e*this.sizes.domWidth/100};if(!this.settings.single){var g=this.o.pointers[1-a.uid],h=this.o.labels[g.uid];switch(a.uid){case 0:f.border+f.label/2>h.o.offset().left-this.sizes.domOffset.left?(h.o.css({visibility:"hidden"}),h.value.html(this.nice(g.value.origin)),d.o.css({visibility:"visible"}),e=(g.value.prc-e)/2+e,g.value.prc!=a.value.prc&&(d.value.html(this.nice(a.value.origin)+" – "+this.nice(g.value.origin)),f.label=d.o.outerWidth(),f.border=e*this.sizes.domWidth/100)):h.o.css({visibility:"visible"});break;case 1:f.border-f.label/2<h.o.offset().left-this.sizes.domOffset.left+h.o.outerWidth()?(h.o.css({visibility:"hidden"}),h.value.html(this.nice(g.value.origin)),d.o.css({visibility:"visible"}),e=(e-g.value.prc)/2+g.value.prc,g.value.prc!=a.value.prc&&(d.value.html(this.nice(g.value.origin)+" – "+this.nice(a.value.origin)),f.label=d.o.outerWidth(),f.border=e*this.sizes.domWidth/100)):h.o.css({visibility:"visible"})}}f=b(d,f,e);if(h){var f={label:h.o.outerWidth(),right:!1,border:g.value.prc*this.sizes.domWidth/100};f=b(h,f,g.value.prc)}this.redrawLimits()},d.prototype.redrawLimits=function(){if(this.settings.limits){var a=[!0,!0];for(key in this.o.pointers)if(!this.settings.single||key==0){var b=this.o.pointers[key],c=this.o.labels[b.uid],d=c.o.offset().left-this.sizes.domOffset.left,e=this.o.limits[0];d<e.outerWidth()&&(a[0]=!1);var e=this.o.limits[1];d+c.o.outerWidth()>this.sizes.domWidth-e.outerWidth()&&(a[1]=!1)}for(var f=0;f<a.length;f++)a[f]?this.o.limits[f].fadeIn("fast"):this.o.limits[f].fadeOut("fast")}},d.prototype.setValue=function(){var a=this.getValue();this.inputNode.attr("value",a),this.onstatechange.call(this,a)},d.prototype.getValue=function(){if(!this.is.init)return!1;var b=this,c="";return a.each(this.o.pointers,function(a){this.value.prc!=undefined&&!isNaN(this.value.prc)&&(c+=(a>0?";":"")+b.prcToValue(this.value.prc))}),c},d.prototype.getPrcValue=function(){if(!this.is.init)return!1;var b=this,c="";return a.each(this.o.pointers,function(a){this.value.prc!=undefined&&!isNaN(this.value.prc)&&(c+=(a>0?";":"")+this.value.prc)}),c},d.prototype.prcToValue=function(a){if(this.settings.heterogeneity&&this.settings.heterogeneity.length>0){var b=this.settings.heterogeneity,c=0,d=this.settings.from;for(var e=0;e<=b.length;e++){if(b[e])var f=b[e].split("/");else var f=[100,this.settings.to];f[0]=new Number(f[0]),f[1]=new Number(f[1]);if(a>=c&&a<=f[0])var g=d+(a-c)*(f[1]-d)/(f[0]-c);c=f[0],d=f[1]}}else var g=this.settings.from+a*this.settings.interval/100;return this.round(g)},d.prototype.valueToPrc=function(a,b){if(this.settings.heterogeneity&&this.settings.heterogeneity.length>0){var c=this.settings.heterogeneity,d=0,e=this.settings.from;for(var f=0;f<=c.length;f++){if(c[f])var g=c[f].split("/");else var g=[100,this.settings.to];g[0]=new Number(g[0]),g[1]=new Number(g[1]);if(a>=e&&a<=g[1])var h=b.limits(d+(a-e)*(g[0]-d)/(g[1]-e));d=g[0],e=g[1]}}else var h=b.limits((a-this.settings.from)*100/this.settings.interval);return h},d.prototype.round=function(a){return a=Math.round(a/this.settings.step)*this.settings.step,this.settings.round?a=Math.round(a*Math.pow(10,this.settings.round))/Math.pow(10,this.settings.round):a=Math.round(a),a},d.prototype.nice=function(b){return b=b.toString().replace(/,/gi,".").replace(/ /gi,""),a.formatNumber?a.formatNumber(new Number(b),this.settings.format||{}).replace(/-/gi,"−"):new Number(b)},e.prototype=new Draggable,e.prototype.oninit=function(a,b,c){this.uid=b,this.parent=c,this.value={},this.settings=this.parent.settings},e.prototype.onmousedown=function(a){this._parent={offset:this.parent.domNode.offset(),width:this.parent.domNode.width()},this.ptr.addDependClass("hover"),this.setIndexOver()},e.prototype.onmousemove=function(a,b){var c=this._getPageCoords(a);this._set(this.calc(c.x))},e.prototype.onmouseup=function(b){this.parent.settings.callback&&a.isFunction(this.parent.settings.callback)&&this.parent.settings.callback.call(this.parent,this.parent.getValue()),this.ptr.removeDependClass("hover")},e.prototype.setIndexOver=function(){this.parent.setPointersIndex(1),this.index(2)},e.prototype.index=function(a){this.ptr.css({zIndex:a})},e.prototype.limits=function(a){return this.parent.limits(a,this)},e.prototype.calc=function(a){var b=this.limits((a-this._parent.offset.left)*100/this._parent.width);return b},e.prototype.set=function(a,b){this.value.origin=this.parent.round(a),this._set(this.parent.valueToPrc(a,this),b)},e.prototype._set=function(a,b){b||(this.value.origin=this.parent.prcToValue(a)),this.value.prc=a,this.ptr.css({left:a+"%"}),this.parent.redraw(this)}}(jQuery);
\ No newline at end of file diff --git a/library/jslider/css/jslider.blue.css b/library/jslider/css/jslider.blue.css deleted file mode 100644 index ae378433c..000000000 --- a/library/jslider/css/jslider.blue.css +++ /dev/null @@ -1,4 +0,0 @@ - - .jslider_blue .jslider-bg i, - .jslider_blue .jslider-pointer { background-image: url(../img/jslider.blue.png); } -
\ No newline at end of file diff --git a/library/jslider/css/jslider.css b/library/jslider/css/jslider.css deleted file mode 100644 index fe943dc0a..000000000 --- a/library/jslider/css/jslider.css +++ /dev/null @@ -1,39 +0,0 @@ - - .jslider .jslider-bg i, - .jslider .jslider-pointer { background: url(../img/jslider.png) no-repeat 0 0; } - - .jslider { display: block; width: 100%; height: 1em; position: relative; top: 0.6em; font-family: Arial, sans-serif; } - .jslider table { width: 100%; border-collapse: collapse; border: 0; } - .jslider td, .jslider th { padding: 0; vertical-align: top; text-align: left; border: 0; } - - .jslider table, - .jslider table tr, - .jslider table tr td { width: 100%; vertical-align: top; } - - .jslider .jslider-bg { position: relative; } - .jslider .jslider-bg i { height: 5px; position: absolute; font-size: 0; top: 0; } - .jslider .jslider-bg .l { width: 50%; background-position: 0 0; left: 0; background: #888; } - .jslider .jslider-bg .r { width: 50%; left: 50%; background-position: right 0; background: #888;} - .jslider .jslider-bg .v { position: absolute; background: url(../img/jslider.png) repeat-x 0 0; width: 60%; left: 20%; top: 0; height: 5px; background-position: 0 -20px; } - - .jslider .jslider-pointer { width: 13px; height: 15px; background-position: 0 -40px; position: absolute; left: 20%; top: -4px; margin-left: -6px; cursor: pointer; cursor: hand; } - .jslider .jslider-pointer-hover { background-position: -20px -40px; } - .jslider .jslider-pointer-to { left: 80%; } - - .jslider .jslider-label { font-size: 9px; line-height: 12px; color: black; opacity: 0.4; white-space: nowrap; padding: 0px 2px; position: absolute; top: -18px; left: 0px; } - .jslider .jslider-label-to { left: auto; right: 0; } - - .jslider .jslider-value { font-size: 9px; white-space: nowrap; padding: 1px 2px 0; position: absolute; top: -19px; left: 20%; line-height: 12px; } - .jslider .jslider-value-to { left: 80%; } - - .jslider .jslider-label small, - .jslider .jslider-value small { position: relative; top: -0.4em; } - - .jslider .jslider-scale { position: relative; top: 9px; } - .jslider .jslider-scale span { position: absolute; height: 5px; border-left: 1px solid #999; font-size: 0; } - .jslider .jslider-scale ins { font-size: 9px; text-decoration: none; position: absolute; left: 0px; top: 5px; color: #999; } - - .jslider-single .jslider-pointer-to, - .jslider-single .jslider-value-to, - .jslider-single .jslider-bg .v, - .jslider-limitless .jslider-label { display: none; } diff --git a/library/jslider/css/jslider.plastic.css b/library/jslider/css/jslider.plastic.css deleted file mode 100644 index 32b54676b..000000000 --- a/library/jslider/css/jslider.plastic.css +++ /dev/null @@ -1,3 +0,0 @@ - - .jslider_plastic .jslider-bg i, - .jslider_plastic .jslider-pointer { background-image: url(../img/jslider.plastic.png); } diff --git a/library/jslider/css/jslider.round.css b/library/jslider/css/jslider.round.css deleted file mode 100644 index 00ad952e6..000000000 --- a/library/jslider/css/jslider.round.css +++ /dev/null @@ -1,5 +0,0 @@ - - .jslider_round .jslider-bg i, - .jslider_round .jslider-pointer { background-image: url(../img/jslider.round.png); } - - .jslider_round .jslider-pointer { width: 17px; height: 17px; top: -6px; margin-left: -8px; } diff --git a/library/jslider/css/jslider.round.plastic.css b/library/jslider/css/jslider.round.plastic.css deleted file mode 100644 index 4272e1fb0..000000000 --- a/library/jslider/css/jslider.round.plastic.css +++ /dev/null @@ -1,5 +0,0 @@ - - .jslider_round_plastic .jslider-bg i, - .jslider_round_plastic .jslider-pointer { background-image: url(../img/jslider.round.plastic.png); } - - .jslider_round_plastic .jslider-pointer { width: 18px; height: 18px; top: -7px; margin-left: -8px; } diff --git a/library/jslider/img/jslider.blue.png b/library/jslider/img/jslider.blue.png Binary files differdeleted file mode 100644 index e3d573c12..000000000 --- a/library/jslider/img/jslider.blue.png +++ /dev/null diff --git a/library/jslider/img/jslider.plastic.png b/library/jslider/img/jslider.plastic.png Binary files differdeleted file mode 100644 index 39c6d6527..000000000 --- a/library/jslider/img/jslider.plastic.png +++ /dev/null diff --git a/library/jslider/img/jslider.png b/library/jslider/img/jslider.png Binary files differdeleted file mode 100644 index 280eb7188..000000000 --- a/library/jslider/img/jslider.png +++ /dev/null diff --git a/library/jslider/img/jslider.round.plastic.png b/library/jslider/img/jslider.round.plastic.png Binary files differdeleted file mode 100644 index 3604d76bd..000000000 --- a/library/jslider/img/jslider.round.plastic.png +++ /dev/null diff --git a/library/jslider/img/jslider.round.png b/library/jslider/img/jslider.round.png Binary files differdeleted file mode 100644 index 24153eaa3..000000000 --- a/library/jslider/img/jslider.round.png +++ /dev/null diff --git a/library/jslider/index.html b/library/jslider/index.html deleted file mode 100644 index 994b0783f..000000000 --- a/library/jslider/index.html +++ /dev/null @@ -1,152 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <title>jSlider</title> - - <!-- bin/jquery.slider.min.css --> - <link rel="stylesheet" href="css/jslider.css" type="text/css"> - <link rel="stylesheet" href="css/jslider.blue.css" type="text/css"> - <link rel="stylesheet" href="css/jslider.plastic.css" type="text/css"> - <link rel="stylesheet" href="css/jslider.round.css" type="text/css"> - <link rel="stylesheet" href="css/jslider.round.plastic.css" type="text/css"> - <!-- end --> - - <script type="text/javascript" src="js/jquery-1.7.1.js"></script> - - <!-- bin/jquery.slider.min.js --> - <script type="text/javascript" src="js/jshashtable-2.1_src.js"></script> - <script type="text/javascript" src="js/jquery.numberformatter-1.2.3.js"></script> - <script type="text/javascript" src="js/tmpl.js"></script> - <script type="text/javascript" src="js/jquery.dependClass-0.1.js"></script> - <script type="text/javascript" src="js/draggable-0.1.js"></script> - <script type="text/javascript" src="js/jquery.slider.js"></script> - <!-- end --> - - <style type="text/css" media="screen"> - body { background: #EEF0F7; } - .layout { padding: 50px; font-family: Georgia, serif; } - .layout-slider { margin-bottom: 60px; width: 50%; } - .layout-slider-settings { font-size: 12px; padding-bottom: 10px; } - .layout-slider-settings pre { font-family: Courier; } - </style> - -</head> -<body> - - <div class="layout"> - - <div class="layout-slider" style="width: 100%"> - Slider <span style="display: inline-block; width: 400px; padding: 0 5px;"><input id="Slider1" type="slider" name="price" value="30000.5;60000" /></span> in string - </div> - <script type="text/javascript" charset="utf-8"> - jQuery("#Slider1").slider({ from: 1000, to: 100000, step: 500, smooth: true, round: 0, dimension: " $", skin: "plastic" }); - </script> - - <div class="layout-slider-settings"> -<pre>{ - from: 5, - to: 50, - step: 2.5, - round: 1, - format: { format: '##.0', locale: 'de' }, - dimension: '&nbsp;€' -}</pre> - </div> - <div class="layout-slider"> - <input id="SliderSingle" type="slider" name="price" value="20" /> - </div> - <script type="text/javascript" charset="utf-8"> - jQuery("#SliderSingle").slider({ from: 5, to: 50, step: 2.5, round: 1, format: { format: '##.0', locale: 'de' }, dimension: ' €', skin: "round" }); - </script> - - <div class="layout-slider-settings"> -<pre>{ - from: 5000, - to: 150000, - heterogeneity: ['50/50000'], - step: 1000, - dimension: '&nbsp;$' -}</pre> - </div> - <div class="layout-slider"> - <input id="Slider2" type="slider" name="price" value="5000;50000" /> - </div> - <script type="text/javascript" charset="utf-8"> - jQuery("#Slider2").slider({ from: 5000, to: 150000, heterogeneity: ['50/50000'], step: 1000, dimension: ' $' }); - </script> - - <div class="layout-slider-settings"> -<pre>{ - from: 0, - to: 500, - heterogeneity: ['50/100', '75/250'], - scale: [0, '|', 50, '|' , '100', '|', 250, '|', 500], - limits: false, - step: 1, - dimension: '&nbsp;m<small>2</small>' -}</pre> - </div> - <div class="layout-slider"> - <input id="Slider3" type="slider" name="area" value="25;75" /> - </div> - <script type="text/javascript" charset="utf-8"> - jQuery("#Slider3").slider({ from: 0, to: 500, heterogeneity: ['50/100', '75/250'], scale: [0, '|', 50, '|', '100', '|', 250, '|', 500], limits: false, step: 1, dimension: ' m<small>2</small>', skin: "round_plastic" }); - </script> - - <div class="layout-slider-settings"> -<pre>{ - from: 1, - to: 30, - heterogeneity: ['50/5', '75/15'], - scale: [1, '|', 3, '|', '5', '|', 15, '|', 30], - limits: false, - step: 1, - dimension: '', - skin: "blue" -}</pre> - </div> - <div class="layout-slider"> - <input id="Slider4" type="slider" name="area" value="2;10" /> - </div> - <script type="text/javascript" charset="utf-8"> - jQuery("#Slider4").slider({ from: 1, to: 30, heterogeneity: ['50/5', '75/15'], scale: [1, '|', 3, '|', '5', '|', 15, '|', 30], limits: false, step: 1, dimension: '', skin: "blue", callback: function( value ){ console.dir( this ); } }); - </script> - - - <div class="layout-slider-settings"> -<pre>{ - from: 480, - to: 1020, - step: 15, - dimension: '', - scale: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00'], - limits: false, - calculate: function( value ){ - var hours = Math.floor( value / 60 ); - var mins = ( value - hours*60 ); - return (hours < 10 ? "0"+hours : hours) + ":" + ( mins == 0 ? "00" : mins ); - }, - onstatechange: function( value ){ - console.dir( this ); - } -}</pre> - </div> - <div class="layout-slider"> - <input id="Slider5" type="slider" name="area" value="600;720" /> - </div> - <script type="text/javascript" charset="utf-8"> - - jQuery("#Slider5").slider({ from: 480, to: 1020, step: 15, dimension: '', scale: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00'], limits: false, calculate: function( value ){ - var hours = Math.floor( value / 60 ); - var mins = ( value - hours*60 ); - return (hours < 10 ? "0"+hours : hours) + ":" + ( mins == 0 ? "00" : mins ); - }}) - - </script> - - </div> - - -</body> -</html>
\ No newline at end of file diff --git a/library/jslider/js/draggable-0.1.js b/library/jslider/js/draggable-0.1.js deleted file mode 100644 index dd2688da5..000000000 --- a/library/jslider/js/draggable-0.1.js +++ /dev/null @@ -1,196 +0,0 @@ -/** - * draggable - Class allows to make any element draggable - * - * Written by - * Egor Khmelev (hmelyoff@gmail.com) - * - * Licensed under the MIT (MIT-LICENSE.txt). - * - * @author Egor Khmelev - * @version 0.1.0-BETA ($Id$) - * - **/ - -(function( $ ){ - - function Draggable(){ - this._init.apply( this, arguments ); - }; - - Draggable.prototype.oninit = function(){ - - }; - - Draggable.prototype.events = function(){ - - }; - - Draggable.prototype.onmousedown = function(){ - this.ptr.css({ position: "absolute" }); - }; - - Draggable.prototype.onmousemove = function( evt, x, y ){ - this.ptr.css({ left: x, top: y }); - }; - - Draggable.prototype.onmouseup = function(){ - - }; - - Draggable.prototype.isDefault = { - drag: false, - clicked: false, - toclick: true, - mouseup: false - }; - - Draggable.prototype._init = function(){ - if( arguments.length > 0 ){ - this.ptr = $(arguments[0]); - this.outer = $(".draggable-outer"); - - this.is = {}; - $.extend( this.is, this.isDefault ); - - var _offset = this.ptr.offset(); - this.d = { - left: _offset.left, - top: _offset.top, - width: this.ptr.width(), - height: this.ptr.height() - }; - - this.oninit.apply( this, arguments ); - - this._events(); - } - }; - - Draggable.prototype._getPageCoords = function( event ){ - if( event.targetTouches && event.targetTouches[0] ){ - return { x: event.targetTouches[0].pageX, y: event.targetTouches[0].pageY }; - } else - return { x: event.pageX, y: event.pageY }; - }; - - Draggable.prototype._bindEvent = function( ptr, eventType, handler ){ - var self = this; - - if( this.supportTouches_ ) - ptr.get(0).addEventListener( this.events_[ eventType ], handler, false ); - - else - ptr.bind( this.events_[ eventType ], handler ); - }; - - Draggable.prototype._events = function(){ - var self = this; - - this.supportTouches_ = ( $.browser.webkit && navigator.userAgent.indexOf("Mobile") != -1 ); - this.events_ = { - "click": this.supportTouches_ ? "touchstart" : "click", - "down": this.supportTouches_ ? "touchstart" : "mousedown", - "move": this.supportTouches_ ? "touchmove" : "mousemove", - "up" : this.supportTouches_ ? "touchend" : "mouseup" - }; - - this._bindEvent( $( document ), "move", function( event ){ - if( self.is.drag ){ - event.stopPropagation(); - event.preventDefault(); - self._mousemove( event ); - } - }); - this._bindEvent( $( document ), "down", function( event ){ - if( self.is.drag ){ - event.stopPropagation(); - event.preventDefault(); - } - }); - this._bindEvent( $( document ), "up", function( event ){ - self._mouseup( event ); - }); - - this._bindEvent( this.ptr, "down", function( event ){ - self._mousedown( event ); - return false; - }); - this._bindEvent( this.ptr, "up", function( event ){ - self._mouseup( event ); - }); - - this.ptr.find("a") - .click(function(){ - self.is.clicked = true; - - if( !self.is.toclick ){ - self.is.toclick = true; - return false; - } - }) - .mousedown(function( event ){ - self._mousedown( event ); - return false; - }); - - this.events(); - }; - - Draggable.prototype._mousedown = function( evt ){ - this.is.drag = true; - this.is.clicked = false; - this.is.mouseup = false; - - var _offset = this.ptr.offset(); - var coords = this._getPageCoords( evt ); - this.cx = coords.x - _offset.left; - this.cy = coords.y - _offset.top; - - $.extend(this.d, { - left: _offset.left, - top: _offset.top, - width: this.ptr.width(), - height: this.ptr.height() - }); - - if( this.outer && this.outer.get(0) ){ - this.outer.css({ height: Math.max(this.outer.height(), $(document.body).height()), overflow: "hidden" }); - } - - this.onmousedown( evt ); - }; - - Draggable.prototype._mousemove = function( evt ){ - this.is.toclick = false; - var coords = this._getPageCoords( evt ); - this.onmousemove( evt, coords.x - this.cx, coords.y - this.cy ); - }; - - Draggable.prototype._mouseup = function( evt ){ - var oThis = this; - - if( this.is.drag ){ - this.is.drag = false; - - if( this.outer && this.outer.get(0) ){ - - if( $.browser.mozilla ){ - this.outer.css({ overflow: "hidden" }); - } else { - this.outer.css({ overflow: "visible" }); - } - - if( $.browser.msie && $.browser.version == '6.0' ){ - this.outer.css({ height: "100%" }); - } else { - this.outer.css({ height: "auto" }); - } - } - - this.onmouseup( evt ); - } - }; - - window.Draggable = Draggable; - -})( jQuery ); diff --git a/library/jslider/js/jquery-1.7.1.js b/library/jslider/js/jquery-1.7.1.js deleted file mode 100644 index 8ccd0ea78..000000000 --- a/library/jslider/js/jquery-1.7.1.js +++ /dev/null @@ -1,9266 +0,0 @@ -/*! - * jQuery JavaScript Library v1.7.1 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Mon Nov 21 21:11:03 2011 -0500 - */ -(function( window, undefined ) { - -// Use the correct document accordingly with window argument (sandbox) -var document = window.document, - navigator = window.navigator, - location = window.location; -var jQuery = (function() { - -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // A central reference to the root jQuery(document) - rootjQuery, - - // A simple way to check for HTML strings or ID strings - // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) - quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - - // Used for trimming whitespace - trimLeft = /^\s+/, - trimRight = /\s+$/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, - rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - - // Useragent RegExp - rwebkit = /(webkit)[ \/]([\w.]+)/, - ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, - rmsie = /(msie) ([\w.]+)/, - rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, - - // Matches dashed string for camelizing - rdashAlpha = /-([a-z]|[0-9])/ig, - rmsPrefix = /^-ms-/, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return ( letter + "" ).toUpperCase(); - }, - - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // The deferred used on DOM ready - readyList, - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, - - // [[Class]] -> type pairs - class2type = {}; - -jQuery.fn = jQuery.prototype = { - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem, ret, doc; - - // Handle $(""), $(null), or $(undefined) - if ( !selector ) { - return this; - } - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // The body element only exists once, optimize finding it - if ( selector === "body" && !context && document.body ) { - this.context = document; - this[0] = document.body; - this.selector = selector; - this.length = 1; - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = quickExpr.exec( selector ); - } - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - doc = ( context ? context.ownerDocument || context : document ); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } - - } else { - ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; - } - - return jQuery.merge( this, selector ); - - // HANDLE: $("#id") - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.7.1", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return slice.call( this, 0 ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = this.constructor(); - - if ( jQuery.isArray( elems ) ) { - push.apply( ret, elems ); - - } else { - jQuery.merge( ret, elems ); - } - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) { - ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; - } else if ( name ) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Attach the listeners - jQuery.bindReady(); - - // Add the callback - readyList.add( fn ); - - return this; - }, - - eq: function( i ) { - i = +i; - return i === -1 ? - this.slice( i ) : - this.slice( i, i + 1 ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - // Either a released hold or an DOMready/load event and not yet ready - if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 1 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.fireWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger( "ready" ).off( "ready" ); - } - } - }, - - bindReady: function() { - if ( readyList ) { - return; - } - - readyList = jQuery.Callbacks( "once memory" ); - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - return setTimeout( jQuery.ready, 1 ); - } - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", DOMContentLoaded ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch(e) {} - - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - // A crude way of determining if an object is a window - isWindow: function( obj ) { - return obj && typeof obj === "object" && "setInterval" in obj; - }, - - isNumeric: function( obj ) { - return !isNaN( parseFloat(obj) ) && isFinite( obj ); - }, - - type: function( obj ) { - return obj == null ? - String( obj ) : - class2type[ toString.call(obj) ] || "object"; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - for ( var name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw new Error( msg ); - }, - - parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return ( new Function( "return " + data ) )(); - - } - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - parseXML: function( data ) { - var xml, tmp; - try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { - xml = undefined; - } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && rnotwhite.test( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction( object ); - - if ( args ) { - if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { - break; - } - } - } - } - - return object; - }, - - // Use native String.trim function wherever possible - trim: trim ? - function( text ) { - return text == null ? - "" : - trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); - }, - - // results is for internal usage only - makeArray: function( array, results ) { - var ret = results || []; - - if ( array != null ) { - // The window, strings (and functions) also have 'length' - // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - var type = jQuery.type( array ); - - if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { - push.call( ret, array ); - } else { - jQuery.merge( ret, array ); - } - } - - return ret; - }, - - inArray: function( elem, array, i ) { - var len; - - if ( array ) { - if ( indexOf ) { - return indexOf.call( array, elem, i ); - } - - len = array.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in array && array[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var i = first.length, - j = 0; - - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var ret = [], retVal; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, key, ret = [], - i = 0, - length = elems.length, - // jquery objects are treated as arrays - isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( key in elems ) { - value = callback( elems[ key ], key, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return ret.concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - if ( typeof context === "string" ) { - var tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - var args = slice.call( arguments, 2 ), - proxy = function() { - return fn.apply( context, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; - - return proxy; - }, - - // Mutifunctional method to get and set values to a collection - // The value/s can optionally be executed if it's a function - access: function( elems, key, value, exec, fn, pass ) { - var length = elems.length; - - // Setting many attributes - if ( typeof key === "object" ) { - for ( var k in key ) { - jQuery.access( elems, k, key[k], exec, fn, value ); - } - return elems; - } - - // Setting one attribute - if ( value !== undefined ) { - // Optionally, function values get executed if exec is true - exec = !pass && exec && jQuery.isFunction(value); - - for ( var i = 0; i < length; i++ ) { - fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); - } - - return elems; - } - - // Getting an attribute - return length ? fn( elems[0], key ) : undefined; - }, - - now: function() { - return ( new Date() ).getTime(); - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); - - var match = rwebkit.exec( ua ) || - ropera.exec( ua ) || - rmsie.exec( ua ) || - ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - sub: function() { - function jQuerySub( selector, context ) { - return new jQuerySub.fn.init( selector, context ); - } - jQuery.extend( true, jQuerySub, this ); - jQuerySub.superclass = this; - jQuerySub.fn = jQuerySub.prototype = this(); - jQuerySub.fn.constructor = jQuerySub; - jQuerySub.sub = this.sub; - jQuerySub.fn.init = function init( selector, context ) { - if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { - context = jQuerySub( context ); - } - - return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); - }; - jQuerySub.fn.init.prototype = jQuerySub.fn; - var rootjQuerySub = jQuerySub(document); - return jQuerySub; - }, - - browser: {} -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} - -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} - -// IE doesn't match non-breaking spaces with \s -if ( rnotwhite.test( "\xA0" ) ) { - trimLeft = /^[\s\xA0]+/; - trimRight = /[\s\xA0]+$/; -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); - -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; - -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch(e) { - setTimeout( doScrollCheck, 1 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); -} - -return jQuery; - -})(); - - -// String to Object flags format cache -var flagsCache = {}; - -// Convert String-formatted flags into Object-formatted ones and store in cache -function createFlags( flags ) { - var object = flagsCache[ flags ] = {}, - i, length; - flags = flags.split( /\s+/ ); - for ( i = 0, length = flags.length; i < length; i++ ) { - object[ flags[i] ] = true; - } - return object; -} - -/* - * Create a callback list using the following parameters: - * - * flags: an optional list of space-separated flags that will change how - * the callback list behaves - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible flags: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( flags ) { - - // Convert flags from String-formatted to Object-formatted - // (we check in cache first) - flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; - - var // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = [], - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list is currently firing - firing, - // First callback to fire (used internally by add and fireWith) - firingStart, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // Add one or several callbacks to the list - add = function( args ) { - var i, - length, - elem, - type, - actual; - for ( i = 0, length = args.length; i < length; i++ ) { - elem = args[ i ]; - type = jQuery.type( elem ); - if ( type === "array" ) { - // Inspect recursively - add( elem ); - } else if ( type === "function" ) { - // Add if not in unique mode and callback is not in - if ( !flags.unique || !self.has( elem ) ) { - list.push( elem ); - } - } - } - }, - // Fire callbacks - fire = function( context, args ) { - args = args || []; - memory = !flags.memory || [ context, args ]; - firing = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { - memory = true; // Mark as halted - break; - } - } - firing = false; - if ( list ) { - if ( !flags.once ) { - if ( stack && stack.length ) { - memory = stack.shift(); - self.fireWith( memory[ 0 ], memory[ 1 ] ); - } - } else if ( memory === true ) { - self.disable(); - } else { - list = []; - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - var length = list.length; - add( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away, unless previous - // firing was halted (stopOnFalse) - } else if ( memory && memory !== true ) { - firingStart = length; - fire( memory[ 0 ], memory[ 1 ] ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - var args = arguments, - argIndex = 0, - argLength = args.length; - for ( ; argIndex < argLength ; argIndex++ ) { - for ( var i = 0; i < list.length; i++ ) { - if ( args[ argIndex ] === list[ i ] ) { - // Handle firingIndex and firingLength - if ( firing ) { - if ( i <= firingLength ) { - firingLength--; - if ( i <= firingIndex ) { - firingIndex--; - } - } - } - // Remove the element - list.splice( i--, 1 ); - // If we have some unicity property then - // we only need to do this once - if ( flags.unique ) { - break; - } - } - } - } - } - return this; - }, - // Control if a given callback is in the list - has: function( fn ) { - if ( list ) { - var i = 0, - length = list.length; - for ( ; i < length; i++ ) { - if ( fn === list[ i ] ) { - return true; - } - } - } - return false; - }, - // Remove all callbacks from the list - empty: function() { - list = []; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory || memory === true ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( stack ) { - if ( firing ) { - if ( !flags.once ) { - stack.push( [ context, args ] ); - } - } else if ( !( flags.once && memory ) ) { - fire( context, args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!memory; - } - }; - - return self; -}; - - - - -var // Static reference to slice - sliceDeferred = [].slice; - -jQuery.extend({ - - Deferred: function( func ) { - var doneList = jQuery.Callbacks( "once memory" ), - failList = jQuery.Callbacks( "once memory" ), - progressList = jQuery.Callbacks( "memory" ), - state = "pending", - lists = { - resolve: doneList, - reject: failList, - notify: progressList - }, - promise = { - done: doneList.add, - fail: failList.add, - progress: progressList.add, - - state: function() { - return state; - }, - - // Deprecated - isResolved: doneList.fired, - isRejected: failList.fired, - - then: function( doneCallbacks, failCallbacks, progressCallbacks ) { - deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); - return this; - }, - always: function() { - deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); - return this; - }, - pipe: function( fnDone, fnFail, fnProgress ) { - return jQuery.Deferred(function( newDefer ) { - jQuery.each( { - done: [ fnDone, "resolve" ], - fail: [ fnFail, "reject" ], - progress: [ fnProgress, "notify" ] - }, function( handler, data ) { - var fn = data[ 0 ], - action = data[ 1 ], - returned; - if ( jQuery.isFunction( fn ) ) { - deferred[ handler ](function() { - returned = fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); - } else { - newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); - } - }); - } else { - deferred[ handler ]( newDefer[ action ] ); - } - }); - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - if ( obj == null ) { - obj = promise; - } else { - for ( var key in promise ) { - obj[ key ] = promise[ key ]; - } - } - return obj; - } - }, - deferred = promise.promise({}), - key; - - for ( key in lists ) { - deferred[ key ] = lists[ key ].fire; - deferred[ key + "With" ] = lists[ key ].fireWith; - } - - // Handle state - deferred.done( function() { - state = "resolved"; - }, failList.disable, progressList.lock ).fail( function() { - state = "rejected"; - }, doneList.disable, progressList.lock ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( firstParam ) { - var args = sliceDeferred.call( arguments, 0 ), - i = 0, - length = args.length, - pValues = new Array( length ), - count = length, - pCount = length, - deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? - firstParam : - jQuery.Deferred(), - promise = deferred.promise(); - function resolveFunc( i ) { - return function( value ) { - args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - if ( !( --count ) ) { - deferred.resolveWith( deferred, args ); - } - }; - } - function progressFunc( i ) { - return function( value ) { - pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - deferred.notifyWith( promise, pValues ); - }; - } - if ( length > 1 ) { - for ( ; i < length; i++ ) { - if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { - args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); - } else { - --count; - } - } - if ( !count ) { - deferred.resolveWith( deferred, args ); - } - } else if ( deferred !== firstParam ) { - deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); - } - return promise; - } -}); - - - - -jQuery.support = (function() { - - var support, - all, - a, - select, - opt, - input, - marginDiv, - fragment, - tds, - events, - eventName, - i, - isSupported, - div = document.createElement( "div" ), - documentElement = document.documentElement; - - // Preliminary tests - div.setAttribute("className", "t"); - div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; - - all = div.getElementsByTagName( "*" ); - a = div.getElementsByTagName( "a" )[ 0 ]; - - // Can't get basic test support - if ( !all || !all.length || !a ) { - return {}; - } - - // First batch of supports tests - select = document.createElement( "select" ); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName( "input" )[ 0 ]; - - support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: ( div.firstChild.nodeType === 3 ), - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName("tbody").length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName("link").length, - - // Get the style information from getAttribute - // (IE uses .cssText instead) - style: /top/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: ( a.getAttribute("href") === "/a" ), - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.55/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: ( input.value === "on" ), - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: opt.selected, - - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - getSetAttribute: div.className !== "t", - - // Tests for enctype support on a form(#6743) - enctype: !!document.createElement("form").enctype, - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", - - // Will be defined later - submitBubbles: true, - changeBubbles: true, - focusinBubbles: false, - deleteExpando: true, - noCloneEvent: true, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableMarginRight: true - }; - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Test to see if it's possible to delete an expando from an element - // Fails in Internet Explorer - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { - div.attachEvent( "onclick", function() { - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - support.noCloneEvent = false; - }); - div.cloneNode( true ).fireEvent( "onclick" ); - } - - // Check if a radio maintains its value - // after being appended to the DOM - input = document.createElement("input"); - input.value = "t"; - input.setAttribute("type", "radio"); - support.radioValue = input.value === "t"; - - input.setAttribute("checked", "checked"); - div.appendChild( input ); - fragment = document.createDocumentFragment(); - fragment.appendChild( div.lastChild ); - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - fragment.removeChild( input ); - fragment.appendChild( div ); - - div.innerHTML = ""; - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. For more - // info see bug #3333 - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - if ( window.getComputedStyle ) { - marginDiv = document.createElement( "div" ); - marginDiv.style.width = "0"; - marginDiv.style.marginRight = "0"; - div.style.width = "2px"; - div.appendChild( marginDiv ); - support.reliableMarginRight = - ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; - } - - // Technique from Juriy Zaytsev - // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ - // We only care about the case where non-standard event systems - // are used, namely in IE. Short-circuiting here helps us to - // avoid an eval call (in setAttribute) which can cause CSP - // to go haywire. See: https://developer.mozilla.org/en/Security/CSP - if ( div.attachEvent ) { - for( i in { - submit: 1, - change: 1, - focusin: 1 - }) { - eventName = "on" + i; - isSupported = ( eventName in div ); - if ( !isSupported ) { - div.setAttribute( eventName, "return;" ); - isSupported = ( typeof div[ eventName ] === "function" ); - } - support[ i + "Bubbles" ] = isSupported; - } - } - - fragment.removeChild( div ); - - // Null elements to avoid leaks in IE - fragment = select = opt = marginDiv = div = input = null; - - // Run tests that need a body at doc ready - jQuery(function() { - var container, outer, inner, table, td, offsetSupport, - conMarginTop, ptlm, vb, style, html, - body = document.getElementsByTagName("body")[0]; - - if ( !body ) { - // Return for frameset docs that don't have a body - return; - } - - conMarginTop = 1; - ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;"; - vb = "visibility:hidden;border:0;"; - style = "style='" + ptlm + "border:5px solid #000;padding:0;'"; - html = "<div " + style + "><div></div></div>" + - "<table " + style + " cellpadding='0' cellspacing='0'>" + - "<tr><td></td></tr></table>"; - - container = document.createElement("div"); - container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; - body.insertBefore( container, body.firstChild ); - - // Construct the test element - div = document.createElement("div"); - container.appendChild( div ); - - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - // (only IE 8 fails this test) - div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>"; - tds = div.getElementsByTagName( "td" ); - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Check if empty table cells still have offsetWidth/Height - // (IE <= 8 fail this test) - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - - // Figure out if the W3C box model works as expected - div.innerHTML = ""; - div.style.width = div.style.paddingLeft = "1px"; - jQuery.boxModel = support.boxModel = div.offsetWidth === 2; - - if ( typeof div.style.zoom !== "undefined" ) { - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - // (IE < 8 does this) - div.style.display = "inline"; - div.style.zoom = 1; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); - - // Check if elements with layout shrink-wrap their children - // (IE 6 does this) - div.style.display = ""; - div.innerHTML = "<div style='width:4px;'></div>"; - support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); - } - - div.style.cssText = ptlm + vb; - div.innerHTML = html; - - outer = div.firstChild; - inner = outer.firstChild; - td = outer.nextSibling.firstChild.firstChild; - - offsetSupport = { - doesNotAddBorder: ( inner.offsetTop !== 5 ), - doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) - }; - - inner.style.position = "fixed"; - inner.style.top = "20px"; - - // safari subtracts parent border width here which is 5px - offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); - inner.style.position = inner.style.top = ""; - - outer.style.overflow = "hidden"; - outer.style.position = "relative"; - - offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); - offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); - - body.removeChild( container ); - div = container = null; - - jQuery.extend( support, offsetSupport ); - }); - - return support; -})(); - - - - -var rbrace = /^(?:\{.*\}|\[.*\])$/, - rmultiDash = /([A-Z])/g; - -jQuery.extend({ - cache: {}, - - // Please use with caution - uuid: 0, - - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var privateCache, thisCache, ret, - internalKey = jQuery.expando, - getByName = typeof name === "string", - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, - isEvents = name === "events"; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - elem[ internalKey ] = id = ++jQuery.uuid; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - cache[ id ] = {}; - - // Avoids exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - privateCache = thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Users should not attempt to inspect the internal events object using jQuery.data, - // it is undocumented and subject to change. But does anyone listen? No. - if ( isEvents && !thisCache[ name ] ) { - return privateCache.events; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( getByName ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; - }, - - removeData: function( elem, name, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, l, - - // Reference to internal data cache key - internalKey = jQuery.expando, - - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - - // See jQuery.data for more information - id = isNode ? elem[ internalKey ] : internalKey; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split( " " ); - } - } - } - - for ( i = 0, l = name.length; i < l; i++ ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject(cache[ id ]) ) { - return; - } - } - - // Browsers that fail expando deletion also refuse to delete expandos on - // the window, but it will allow it on all other JS objects; other browsers - // don't care - // Ensure that `cache` is not a window object #10080 - if ( jQuery.support.deleteExpando || !cache.setInterval ) { - delete cache[ id ]; - } else { - cache[ id ] = null; - } - - // We destroyed the cache and need to eliminate the expando on the node to avoid - // false lookups in the cache for entries that no longer exist - if ( isNode ) { - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( jQuery.support.deleteExpando ) { - delete elem[ internalKey ]; - } else if ( elem.removeAttribute ) { - elem.removeAttribute( internalKey ); - } else { - elem[ internalKey ] = null; - } - } - }, - - // For internal use only. - _data: function( elem, name, data ) { - return jQuery.data( elem, name, data, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - if ( elem.nodeName ) { - var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; - - if ( match ) { - return !(match === true || elem.getAttribute("classid") !== match); - } - } - - return true; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var parts, attr, name, - data = null; - - if ( typeof key === "undefined" ) { - if ( this.length ) { - data = jQuery.data( this[0] ); - - if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) { - attr = this[0].attributes; - for ( var i = 0, l = attr.length; i < l; i++ ) { - name = attr[i].name; - - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.substring(5) ); - - dataAttr( this[0], name, data[ name ] ); - } - } - jQuery._data( this[0], "parsedAttrs", true ); - } - } - - return data; - - } else if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - // Try to fetch any internally stored data first - if ( data === undefined && this.length ) { - data = jQuery.data( this[0], key ); - data = dataAttr( this[0], key, data ); - } - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - - } else { - return this.each(function() { - var self = jQuery( this ), - args = [ parts[0], value ]; - - self.triggerHandler( "setData" + parts[1] + "!", args ); - jQuery.data( this, key, value ); - self.triggerHandler( "changeData" + parts[1] + "!", args ); - }); - } - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - jQuery.isNumeric( data ) ? parseFloat( data ) : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - for ( var name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - - - - -function handleQueueMarkDefer( elem, type, src ) { - var deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - defer = jQuery._data( elem, deferDataKey ); - if ( defer && - ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && - ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { - // Give room for hard-coded callbacks to fire first - // and eventually mark/queue something else on the element - setTimeout( function() { - if ( !jQuery._data( elem, queueDataKey ) && - !jQuery._data( elem, markDataKey ) ) { - jQuery.removeData( elem, deferDataKey, true ); - defer.fire(); - } - }, 0 ); - } -} - -jQuery.extend({ - - _mark: function( elem, type ) { - if ( elem ) { - type = ( type || "fx" ) + "mark"; - jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); - } - }, - - _unmark: function( force, elem, type ) { - if ( force !== true ) { - type = elem; - elem = force; - force = false; - } - if ( elem ) { - type = type || "fx"; - var key = type + "mark", - count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); - if ( count ) { - jQuery._data( elem, key, count ); - } else { - jQuery.removeData( elem, key, true ); - handleQueueMarkDefer( elem, type, "mark" ); - } - } - }, - - queue: function( elem, type, data ) { - var q; - if ( elem ) { - type = ( type || "fx" ) + "queue"; - q = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !q || jQuery.isArray(data) ) { - q = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - q.push( data ); - } - } - return q || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - fn = queue.shift(), - hooks = {}; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - } - - if ( fn ) { - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - jQuery._data( elem, type + ".run", hooks ); - fn.call( elem, function() { - jQuery.dequeue( elem, type ); - }, hooks ); - } - - if ( !queue.length ) { - jQuery.removeData( elem, type + "queue " + type + ".run", true ); - handleQueueMarkDefer( elem, type, "queue" ); - } - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) { - return jQuery.queue( this[0], type ); - } - return this.each(function() { - var queue = jQuery.queue( this, type, data ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = setTimeout( next, time ); - hooks.stop = function() { - clearTimeout( timeout ); - }; - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, object ) { - if ( typeof type !== "string" ) { - object = type; - type = undefined; - } - type = type || "fx"; - var defer = jQuery.Deferred(), - elements = this, - i = elements.length, - count = 1, - deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - tmp; - function resolve() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - } - while( i-- ) { - if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || - ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || - jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && - jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { - count++; - tmp.add( resolve ); - } - } - resolve(); - return defer.promise(); - } -}); - - - - -var rclass = /[\n\t\r]/g, - rspace = /\s+/, - rreturn = /\r/g, - rtype = /^(?:button|input)$/i, - rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea)?$/i, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute, - nodeHook, boolHook, fixSpecified; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.attr ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.prop ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classNames, i, l, elem, - setClass, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call(this, j, this.className) ); - }); - } - - if ( value && typeof value === "string" ) { - classNames = value.split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 ) { - if ( !elem.className && classNames.length === 1 ) { - elem.className = value; - - } else { - setClass = " " + elem.className + " "; - - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { - setClass += classNames[ c ] + " "; - } - } - elem.className = jQuery.trim( setClass ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classNames, i, l, elem, className, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call(this, j, this.className) ); - }); - } - - if ( (value && typeof value === "string") || value === undefined ) { - classNames = ( value || "" ).split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - className = (" " + elem.className + " ").replace( rclass, " " ); - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[ c ] + " ", " "); - } - elem.className = jQuery.trim( className ); - - } else { - elem.className = ""; - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - state = stateVal, - classNames = value.split( rspace ); - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " ", - i = 0, - l = this.length; - for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var hooks, ret, isFunction, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var self = jQuery(this), val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, self.val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - }, - select: { - get: function( elem ) { - var value, i, max, option, - index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type === "select-one"; - - // Nothing was selected - if ( index < 0 ) { - return null; - } - - // Loop through all the selected options - i = one ? index : 0; - max = one ? index + 1 : options.length; - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Don't return options that are disabled or in a disabled optgroup - if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && - (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - // Fixes Bug #2551 -- select.val() broken in IE after form.reset() - if ( one && !values.length && options.length ) { - return jQuery( options[ index ] ).val(); - } - - return values; - }, - - set: function( elem, value ) { - var values = jQuery.makeArray( value ); - - jQuery(elem).find("option").each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - - attr: function( elem, name, value, pass ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( pass && name in jQuery.attrFn ) { - return jQuery( elem )[ name ]( value ); - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - // All attributes are lowercase - // Grab necessary hook if one is defined - if ( notxml ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - - } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, "" + value ); - return value; - } - - } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - - ret = elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return ret === null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, value ) { - var propName, attrNames, name, l, - i = 0; - - if ( value && elem.nodeType === 1 ) { - attrNames = value.toLowerCase().split( rspace ); - l = attrNames.length; - - for ( ; i < l; i++ ) { - name = attrNames[ i ]; - - if ( name ) { - propName = jQuery.propFix[ name ] || name; - - // See #9699 for explanation of this approach (setting first, then removal) - jQuery.attr( elem, name, "" ); - elem.removeAttribute( getSetAttribute ? name : propName ); - - // Set corresponding property to false for boolean attributes - if ( rboolean.test( name ) && propName in elem ) { - elem[ propName ] = false; - } - } - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - // We can't allow the type property to be changed (since it causes problems in IE) - if ( rtype.test( elem.nodeName ) && elem.parentNode ) { - jQuery.error( "type property can't be changed" ); - } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to it's default in case type is set after value - // This is for element creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - }, - // Use the value property for back compat - // Use the nodeHook for button elements in IE6/7 (#1954) - value: { - get: function( elem, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.get( elem, name ); - } - return name in elem ? - elem.value : - null; - }, - set: function( elem, value, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.set( elem, value, name ); - } - // Does not return so that setAttribute is also used - elem.value = value; - } - } - }, - - propFix: { - tabindex: "tabIndex", - readonly: "readOnly", - "for": "htmlFor", - "class": "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder", - contenteditable: "contentEditable" - }, - - prop: function( elem, name, value ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - return ( elem[ name ] = value ); - } - - } else { - if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - return elem[ name ]; - } - } - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - var attributeNode = elem.getAttributeNode("tabindex"); - - return attributeNode && attributeNode.specified ? - parseInt( attributeNode.value, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - } - } -}); - -// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) -jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; - -// Hook for boolean attributes -boolHook = { - get: function( elem, name ) { - // Align boolean attributes with corresponding properties - // Fall back to attribute presence where some booleans are not supported - var attrNode, - property = jQuery.prop( elem, name ); - return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? - name.toLowerCase() : - undefined; - }, - set: function( elem, value, name ) { - var propName; - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - // value is true since we know at this point it's type boolean and not false - // Set boolean attributes to the same name and set the DOM property - propName = jQuery.propFix[ name ] || name; - if ( propName in elem ) { - // Only set the IDL specifically if it already exists on the element - elem[ propName ] = true; - } - - elem.setAttribute( name, name.toLowerCase() ); - } - return name; - } -}; - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !getSetAttribute ) { - - fixSpecified = { - name: true, - id: true - }; - - // Use this for any attribute in IE6/7 - // This fixes almost every IE6/7 issue - nodeHook = jQuery.valHooks.button = { - get: function( elem, name ) { - var ret; - ret = elem.getAttributeNode( name ); - return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? - ret.nodeValue : - undefined; - }, - set: function( elem, value, name ) { - // Set the existing or create a new attribute node - var ret = elem.getAttributeNode( name ); - if ( !ret ) { - ret = document.createAttribute( name ); - elem.setAttributeNode( ret ); - } - return ( ret.nodeValue = value + "" ); - } - }; - - // Apply the nodeHook to tabindex - jQuery.attrHooks.tabindex.set = nodeHook.set; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }); - }); - - // Set contenteditable to false on removals(#10429) - // Setting to empty string throws an error as an invalid value - jQuery.attrHooks.contenteditable = { - get: nodeHook.get, - set: function( elem, value, name ) { - if ( value === "" ) { - value = "false"; - } - nodeHook.set( elem, value, name ); - } - }; -} - - -// Some attributes require a special call on IE -if ( !jQuery.support.hrefNormalized ) { - jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - get: function( elem ) { - var ret = elem.getAttribute( name, 2 ); - return ret === null ? undefined : ret; - } - }); - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Normalize to lowercase since IE uppercases css property names - return elem.style.cssText.toLowerCase() || undefined; - }, - set: function( elem, value ) { - return ( elem.style.cssText = "" + value ); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - return null; - } - }); -} - -// IE6/7 call enctype encoding -if ( !jQuery.support.enctype ) { - jQuery.propFix.enctype = "encoding"; -} - -// Radios and checkboxes getter/setter -if ( !jQuery.support.checkOn ) { - jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - get: function( elem ) { - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - } - }; - }); -} -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); - } - } - }); -}); - - - - -var rformElems = /^(?:textarea|input|select)$/i, - rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, - rhoverHack = /\bhover(\.\S+)?\b/, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, - quickParse = function( selector ) { - var quick = rquickIs.exec( selector ); - if ( quick ) { - // 0 1 2 3 - // [ _, tag, id, class ] - quick[1] = ( quick[1] || "" ).toLowerCase(); - quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); - } - return quick; - }, - quickIs = function( elem, m ) { - var attrs = elem.attributes || {}; - return ( - (!m[1] || elem.nodeName.toLowerCase() === m[1]) && - (!m[2] || (attrs.id || {}).value === m[2]) && - (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) - ); - }, - hoverHack = function( events ) { - return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); - }; - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - add: function( elem, types, handler, data, selector ) { - - var elemData, eventHandle, events, - t, tns, type, namespaces, handleObj, - handleObjIn, quick, handlers, special; - - // Don't attach events to noData or text/comment nodes (allow plain objects tho) - if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - events = elemData.events; - if ( !events ) { - elemData.events = events = {}; - } - eventHandle = elemData.handle; - if ( !eventHandle ) { - elemData.handle = eventHandle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = jQuery.trim( hoverHack(types) ).split( " " ); - for ( t = 0; t < types.length; t++ ) { - - tns = rtypenamespace.exec( types[t] ) || []; - type = tns[1]; - namespaces = ( tns[2] || "" ).split( "." ).sort(); - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: tns[1], - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - quick: quickParse( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - handlers = events[ type ]; - if ( !handlers ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), - t, tns, type, origType, namespaces, origCount, - j, events, special, handle, eventType, handleObj; - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = jQuery.trim( hoverHack( types || "" ) ).split(" "); - for ( t = 0; t < types.length; t++ ) { - tns = rtypenamespace.exec( types[t] ) || []; - type = origType = tns[1]; - namespaces = tns[2]; - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector? special.delegateType : special.bindType ) || type; - eventType = events[ type ] || []; - origCount = eventType.length; - namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; - - // Remove matching events - for ( j = 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !namespaces || namespaces.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - eventType.splice( j--, 1 ); - - if ( handleObj.selector ) { - eventType.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( eventType.length === 0 && origCount !== eventType.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - handle = elemData.handle; - if ( handle ) { - handle.elem = null; - } - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery.removeData( elem, [ "events", "handle" ], true ); - } - }, - - // Events that are safe to short-circuit if no handlers are attached. - // Native DOM events should not be added, they may have inline handlers. - customEvent: { - "getData": true, - "setData": true, - "changeData": true - }, - - trigger: function( event, data, elem, onlyHandlers ) { - // Don't do events on text and comment nodes - if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { - return; - } - - // Event object or event type - var type = event.type || event, - namespaces = [], - cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "!" ) >= 0 ) { - // Exclusive events trigger only for the exact event (no namespaces) - type = type.slice(0, -1); - exclusive = true; - } - - if ( type.indexOf( "." ) >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - - if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { - // No jQuery handlers for this event type, and it can't have inline handlers - return; - } - - // Caller can pass in an Event, Object, or just an event type string - event = typeof event === "object" ? - // jQuery.Event object - event[ jQuery.expando ] ? event : - // Object literal - new jQuery.Event( type, event ) : - // Just the event type (string) - new jQuery.Event( type ); - - event.type = type; - event.isTrigger = true; - event.exclusive = exclusive; - event.namespace = namespaces.join( "." ); - event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; - ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; - - // Handle a global trigger - if ( !elem ) { - - // TODO: Stop taunting the data cache; remove global events and always attach to document - cache = jQuery.cache; - for ( i in cache ) { - if ( cache[ i ].events && cache[ i ].events[ type ] ) { - jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); - } - } - return; - } - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data != null ? jQuery.makeArray( data ) : []; - data.unshift( event ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - eventPath = [[ elem, special.bindType || type ]]; - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; - old = null; - for ( ; cur; cur = cur.parentNode ) { - eventPath.push([ cur, bubbleType ]); - old = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( old && old === elem.ownerDocument ) { - eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); - } - } - - // Fire handlers on the event path - for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { - - cur = eventPath[i][0]; - event.type = eventPath[i][1]; - - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - // Note that this is a bare JS function and not a jQuery handler - handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) { - event.preventDefault(); - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && - !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - // IE<9 dies on focus/blur to hidden element (#1486) - if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - old = elem[ ontype ]; - - if ( old ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( old ) { - elem[ ontype ] = old; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event || window.event ); - - var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), - delegateCount = handlers.delegateCount, - args = [].slice.call( arguments, 0 ), - run_all = !event.exclusive && !event.namespace, - handlerQueue = [], - i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Determine handlers that should run if there are delegated events - // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861) - if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) { - - // Pregenerate a single jQuery object for reuse with .is() - jqcur = jQuery(this); - jqcur.context = this.ownerDocument || this; - - for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { - selMatch = {}; - matches = []; - jqcur[0] = cur; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - sel = handleObj.selector; - - if ( selMatch[ sel ] === undefined ) { - selMatch[ sel ] = ( - handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) - ); - } - if ( selMatch[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, matches: matches }); - } - } - } - - // Add the remaining (directly-bound) handlers - if ( handlers.length > delegateCount ) { - handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); - } - - // Run delegates first; they may want to stop propagation beneath us - for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { - matched = handlerQueue[ i ]; - event.currentTarget = matched.elem; - - for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { - handleObj = matched.matches[ j ]; - - // Triggered event must either 1) be non-exclusive and have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { - - event.data = handleObj.data; - event.handleObj = handleObj; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - return event.result; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** - props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var eventDoc, doc, body, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, - originalEvent = event, - fixHook = jQuery.event.fixHooks[ event.type ] || {}, - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = jQuery.Event( originalEvent ); - - for ( i = copy.length; i; ) { - prop = copy[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Target should not be a text node (#504, Safari) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) - if ( event.metaKey === undefined ) { - event.metaKey = event.ctrlKey; - } - - return fixHook.filter? fixHook.filter( event, originalEvent ) : event; - }, - - special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady - }, - - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - - focus: { - delegateType: "focusin" - }, - blur: { - delegateType: "focusout" - }, - - beforeunload: { - setup: function( data, namespaces, eventHandle ) { - // We only want to do this special case on windows - if ( jQuery.isWindow( this ) ) { - this.onbeforeunload = eventHandle; - } - }, - - teardown: function( namespaces, eventHandle ) { - if ( this.onbeforeunload === eventHandle ) { - this.onbeforeunload = null; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -// Some plugins are using, but it's undocumented/deprecated and will be removed. -// The 1.7 special event interface should provide all the hooks needed now. -jQuery.event.handle = jQuery.event.dispatch; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - - // if preventDefault exists run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // otherwise set the returnValue property of the original event to false (IE) - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - // if stopPropagation exists run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var target = this, - related = event.relatedTarget, - handleObj = event.handleObj, - selector = handleObj.selector, - ret; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !form._submit_attached ) { - jQuery.event.add( form, "submit._submit", function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - }); - form._submit_attached = true; - } - }); - // return undefined since we don't need an event listener - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !jQuery.support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - jQuery.event.simulate( "change", this, event, true ); - } - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - elem._change_attached = true; - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0, - handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on.call( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - var handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( var type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - bind: function( types, data, fn ) { - return this.on( types, null, data, fn ); - }, - unbind: function( types, fn ) { - return this.off( types, null, fn ); - }, - - live: function( types, data, fn ) { - jQuery( this.context ).on( types, this.selector, data, fn ); - return this; - }, - die: function( types, fn ) { - jQuery( this.context ).off( types, this.selector || "**", fn ); - return this; - }, - - delegate: function( selector, types, data, fn ) { - return this.on( types, selector, data, fn ); - }, - undelegate: function( selector, types, fn ) { - // ( namespace ) or ( selector, types [, fn] ) - return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - if ( this[0] ) { - return jQuery.event.trigger( type, data, this[0], true ); - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, - guid = fn.guid || jQuery.guid++, - i = 0, - toggler = function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - }; - - // link all the functions, so any of them can unbind this click handler - toggler.guid = guid; - while ( i < args.length ) { - args[ i++ ].guid = guid; - } - - return this.click( toggler ); - }, - - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - if ( fn == null ) { - fn = data; - data = null; - } - - return arguments.length > 0 ? - this.on( name, null, data, fn ) : - this.trigger( name ); - }; - - if ( jQuery.attrFn ) { - jQuery.attrFn[ name ] = true; - } - - if ( rkeyEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; - } - - if ( rmouseEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; - } -}); - - - -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - expando = "sizcache" + (Math.random() + '').replace('.', ''), - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true, - rBackslash = /\\/g, - rReturn = /\r\n/g, - rNonWord = /\W/; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function() { - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function( selector, context, results, seed ) { - results = results || []; - context = context || document; - - var origContext = context; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var m, set, checkSet, extra, ret, cur, pop, i, - prune = true, - contextXML = Sizzle.isXML( context ), - parts = [], - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec( "" ); - m = chunker.exec( soFar ); - - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context, seed ); - - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set, seed ); - } - } - - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? - Sizzle.filter( ret.expr, ret.set )[0] : - ret.set[0]; - } - - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - - set = ret.expr ? - Sizzle.filter( ret.expr, ret.set ) : - ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray( set ); - - } else { - prune = false; - } - - while ( parts.length ) { - cur = parts.pop(); - pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function( results ) { - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[ i - 1 ] ) { - results.splice( i--, 1 ); - } - } - } - } - - return results; -}; - -Sizzle.matches = function( expr, set ) { - return Sizzle( expr, null, null, set ); -}; - -Sizzle.matchesSelector = function( node, expr ) { - return Sizzle( expr, null, null, [node] ).length > 0; -}; - -Sizzle.find = function( expr, context, isXML ) { - var set, i, len, match, type, left; - - if ( !expr ) { - return []; - } - - for ( i = 0, len = Expr.order.length; i < len; i++ ) { - type = Expr.order[i]; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - left = match[1]; - match.splice( 1, 1 ); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace( rBackslash, "" ); - set = Expr.find[ type ]( match, context, isXML ); - - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = typeof context.getElementsByTagName !== "undefined" ? - context.getElementsByTagName( "*" ) : - []; - } - - return { set: set, expr: expr }; -}; - -Sizzle.filter = function( expr, set, inplace, not ) { - var match, anyFound, - type, found, item, filter, left, - i, pass, - old = expr, - result = [], - curLoop = set, - isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); - - while ( expr && set.length ) { - for ( type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - filter = Expr.filter[ type ]; - left = match[1]; - - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - pass = not ^ found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - - } else { - curLoop[i] = false; - } - - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Utility function for retreiving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -var getText = Sizzle.getText = function( elem ) { - var i, node, - nodeType = elem.nodeType, - ret = ""; - - if ( nodeType ) { - if ( nodeType === 1 || nodeType === 9 ) { - // Use textContent || innerText for elements - if ( typeof elem.textContent === 'string' ) { - return elem.textContent; - } else if ( typeof elem.innerText === 'string' ) { - // Replace IE's carriage returns - return elem.innerText.replace( rReturn, '' ); - } else { - // Traverse it's children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - } else { - - // If no nodeType, this is expected to be an array - for ( i = 0; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - if ( node.nodeType !== 8 ) { - ret += getText( node ); - } - } - } - return ret; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - - leftMatch: {}, - - attrMap: { - "class": "className", - "for": "htmlFor" - }, - - attrHandle: { - href: function( elem ) { - return elem.getAttribute( "href" ); - }, - type: function( elem ) { - return elem.getAttribute( "type" ); - } - }, - - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !rNonWord.test( part ), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - - ">": function( checkSet, part ) { - var elem, - isPartStr = typeof part === "string", - i = 0, - l = checkSet.length; - - if ( isPartStr && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - - "": function(checkSet, part, isXML){ - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); - }, - - "~": function( checkSet, part, isXML ) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); - } - }, - - find: { - ID: function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }, - - NAME: function( match, context ) { - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], - results = context.getElementsByName( match[1] ); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - - TAG: function( match, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( match[1] ); - } - } - }, - preFilter: { - CLASS: function( match, curLoop, inplace, result, not, isXML ) { - match = " " + match[1].replace( rBackslash, "" ) + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - - ID: function( match ) { - return match[1].replace( rBackslash, "" ); - }, - - TAG: function( match, curLoop ) { - return match[1].replace( rBackslash, "" ).toLowerCase(); - }, - - CHILD: function( match ) { - if ( match[1] === "nth" ) { - if ( !match[2] ) { - Sizzle.error( match[0] ); - } - - match[2] = match[2].replace(/^\+|\s*/g, ''); - - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - else if ( match[2] ) { - Sizzle.error( match[0] ); - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - - ATTR: function( match, curLoop, inplace, result, not, isXML ) { - var name = match[1] = match[1].replace( rBackslash, "" ); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - // Handle if an un-quoted value was used - match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - - PSEUDO: function( match, curLoop, inplace, result, not ) { - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - - if ( !inplace ) { - result.push.apply( result, ret ); - } - - return false; - } - - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - - POS: function( match ) { - match.unshift( true ); - - return match; - } - }, - - filters: { - enabled: function( elem ) { - return elem.disabled === false && elem.type !== "hidden"; - }, - - disabled: function( elem ) { - return elem.disabled === true; - }, - - checked: function( elem ) { - return elem.checked === true; - }, - - selected: function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - parent: function( elem ) { - return !!elem.firstChild; - }, - - empty: function( elem ) { - return !elem.firstChild; - }, - - has: function( elem, i, match ) { - return !!Sizzle( match[3], elem ).length; - }, - - header: function( elem ) { - return (/h\d/i).test( elem.nodeName ); - }, - - text: function( elem ) { - var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); - }, - - radio: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; - }, - - checkbox: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; - }, - - file: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; - }, - - password: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; - }, - - submit: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "submit" === elem.type; - }, - - image: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; - }, - - reset: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "reset" === elem.type; - }, - - button: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && "button" === elem.type || name === "button"; - }, - - input: function( elem ) { - return (/input|select|textarea|button/i).test( elem.nodeName ); - }, - - focus: function( elem ) { - return elem === elem.ownerDocument.activeElement; - } - }, - setFilters: { - first: function( elem, i ) { - return i === 0; - }, - - last: function( elem, i, match, array ) { - return i === array.length - 1; - }, - - even: function( elem, i ) { - return i % 2 === 0; - }, - - odd: function( elem, i ) { - return i % 2 === 1; - }, - - lt: function( elem, i, match ) { - return i < match[3] - 0; - }, - - gt: function( elem, i, match ) { - return i > match[3] - 0; - }, - - nth: function( elem, i, match ) { - return match[3] - 0 === i; - }, - - eq: function( elem, i, match ) { - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function( elem, match, i, array ) { - var name = match[1], - filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; - - } else if ( name === "not" ) { - var not = match[3]; - - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } - } - - return true; - - } else { - Sizzle.error( name ); - } - }, - - CHILD: function( elem, match ) { - var first, last, - doneName, parent, cache, - count, diff, - type = match[1], - node = elem; - - switch ( type ) { - case "only": - case "first": - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - if ( type === "first" ) { - return true; - } - - node = elem; - - case "last": - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - return true; - - case "nth": - first = match[2]; - last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - doneName = match[0]; - parent = elem.parentNode; - - if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { - count = 0; - - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - - parent[ expando ] = doneName; - } - - diff = elem.nodeIndex - last; - - if ( first === 0 ) { - return diff === 0; - - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - - ID: function( elem, match ) { - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - - TAG: function( elem, match ) { - return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; - }, - - CLASS: function( elem, match ) { - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - - ATTR: function( elem, match ) { - var name = match[1], - result = Sizzle.attr ? - Sizzle.attr( elem, name ) : - Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - !type && Sizzle.attr ? - result != null : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - - POS: function( elem, match, i, array ) { - var name = match[2], - filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} - -var makeArray = function( array, results ) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - -// Provide a fallback method if it does not work -} catch( e ) { - makeArray = function( array, results ) { - var i = 0, - ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder, siblingCheck; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - return a.compareDocumentPosition ? -1 : 1; - } - - return a.compareDocumentPosition(b) & 4 ? -1 : 1; - }; - -} else { - sortOrder = function( a, b ) { - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Fallback to using sourceIndex (in IE) if it's available on both nodes - } else if ( a.sourceIndex && b.sourceIndex ) { - return a.sourceIndex - b.sourceIndex; - } - - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // If the nodes are siblings (or identical) we can do a quick check - if ( aup === bup ) { - return siblingCheck( a, b ); - - // If no parents were found then the nodes are disconnected - } else if ( !aup ) { - return -1; - - } else if ( !bup ) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while ( cur ) { - ap.unshift( cur ); - cur = cur.parentNode; - } - - cur = bup; - - while ( cur ) { - bp.unshift( cur ); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for ( var i = 0; i < al && i < bl; i++ ) { - if ( ap[i] !== bp[i] ) { - return siblingCheck( ap[i], bp[i] ); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck( a, bp[i], -1 ) : - siblingCheck( ap[i], b, 1 ); - }; - - siblingCheck = function( a, b, ret ) { - if ( a === b ) { - return ret; - } - - var cur = a.nextSibling; - - while ( cur ) { - if ( cur === b ) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; - }; -} - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(), - root = document.documentElement; - - form.innerHTML = "<a name='" + id + "'/>"; - - // Inject it into the root element, check its status, and remove it quickly - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - - return m ? - m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? - [m] : - undefined : - []; - } - }; - - Expr.filter.ID = function( elem, match ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - - // release memory in IE - root = form = null; -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function( match, context ) { - var results = context.getElementsByTagName( match[1] ); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = "<a href='#'></a>"; - - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - - Expr.attrHandle.href = function( elem ) { - return elem.getAttribute( "href", 2 ); - }; - } - - // release memory in IE - div = null; -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, - div = document.createElement("div"), - id = "__sizzle__"; - - div.innerHTML = "<p class='TEST'></p>"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function( query, context, extra, seed ) { - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && !Sizzle.isXML(context) ) { - // See if we find a selector to speed up - var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - - if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { - // Speed-up: Sizzle("TAG") - if ( match[1] ) { - return makeArray( context.getElementsByTagName( query ), extra ); - - // Speed-up: Sizzle(".CLASS") - } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { - return makeArray( context.getElementsByClassName( match[2] ), extra ); - } - } - - if ( context.nodeType === 9 ) { - // Speed-up: Sizzle("body") - // The body element only exists once, optimize finding it - if ( query === "body" && context.body ) { - return makeArray( [ context.body ], extra ); - - // Speed-up: Sizzle("#ID") - } else if ( match && match[3] ) { - var elem = context.getElementById( match[3] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id === match[3] ) { - return makeArray( [ elem ], extra ); - } - - } else { - return makeArray( [], extra ); - } - } - - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(qsaError) {} - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - var oldContext = context, - old = context.getAttribute( "id" ), - nid = old || id, - hasParent = context.parentNode, - relativeHierarchySelector = /^\s*[+~]/.test( query ); - - if ( !old ) { - context.setAttribute( "id", nid ); - } else { - nid = nid.replace( /'/g, "\\$&" ); - } - if ( relativeHierarchySelector && hasParent ) { - context = context.parentNode; - } - - try { - if ( !relativeHierarchySelector || hasParent ) { - return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); - } - - } catch(pseudoError) { - } finally { - if ( !old ) { - oldContext.removeAttribute( "id" ); - } - } - } - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - // release memory in IE - div = null; - })(); -} - -(function(){ - var html = document.documentElement, - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; - - if ( matches ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9 fails this) - var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), - pseudoWorks = false; - - try { - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( document.documentElement, "[test!='']:sizzle" ); - - } catch( pseudoError ) { - pseudoWorks = true; - } - - Sizzle.matchesSelector = function( node, expr ) { - // Make sure that attribute selectors are quoted - expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - if ( !Sizzle.isXML( node ) ) { - try { - if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { - var ret = matches.call( node, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || !disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9, so check for that - node.document && node.document.nodeType !== 11 ) { - return ret; - } - } - } catch(e) {} - } - - return Sizzle(expr, null, null, [node]).length > 0; - }; - } -})(); - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "<div class='test e'></div><div class='test'></div>"; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function( match, context, isXML ) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - // release memory in IE - div = null; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -if ( document.documentElement.contains ) { - Sizzle.contains = function( a, b ) { - return a !== b && (a.contains ? a.contains(b) : true); - }; - -} else if ( document.documentElement.compareDocumentPosition ) { - Sizzle.contains = function( a, b ) { - return !!(a.compareDocumentPosition(b) & 16); - }; - -} else { - Sizzle.contains = function() { - return false; - }; -} - -Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function( selector, context, seed ) { - var match, - tmpSet = [], - later = "", - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet, seed ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -// Override sizzle attribute retrieval -Sizzle.attr = jQuery.attr; -Sizzle.selectors.attrMap = {}; -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})(); - - -var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, - isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, - POS = jQuery.expr.match.POS, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var self = this, - i, l; - - if ( typeof selector !== "string" ) { - return jQuery( selector ).filter(function() { - for ( i = 0, l = self.length; i < l; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }); - } - - var ret = this.pushStack( "", "find", selector ), - length, n, r; - - for ( i = 0, l = this.length; i < l; i++ ) { - length = ret.length; - jQuery.find( selector, this[i], ret ); - - if ( i > 0 ) { - // Make sure that the results are unique - for ( n = length; n < ret.length; n++ ) { - for ( r = 0; r < length; r++ ) { - if ( ret[r] === ret[n] ) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function( target ) { - var targets = jQuery( target ); - return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false), "not", selector); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true), "filter", selector ); - }, - - is: function( selector ) { - return !!selector && ( - typeof selector === "string" ? - // If this is a positional selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - POS.test( selector ) ? - jQuery( selector, this.context ).index( this[0] ) >= 0 : - jQuery.filter( selector, this ).length > 0 : - this.filter( selector ).length > 0 ); - }, - - closest: function( selectors, context ) { - var ret = [], i, l, cur = this[0]; - - // Array (deprecated as of jQuery 1.7) - if ( jQuery.isArray( selectors ) ) { - var level = 1; - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( i = 0; i < selectors.length; i++ ) { - - if ( jQuery( cur ).is( selectors[ i ] ) ) { - ret.push({ selector: selectors[ i ], elem: cur, level: level }); - } - } - - cur = cur.parentNode; - level++; - } - - return ret; - } - - // String - var pos = POS.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( i = 0, l = this.length; i < l; i++ ) { - cur = this[i]; - - while ( cur ) { - if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { - ret.push( cur ); - break; - - } else { - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { - break; - } - } - } - } - - ret = ret.length > 1 ? jQuery.unique( ret ) : ret; - - return this.pushStack( ret, "closest", selectors ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? - all : - jQuery.unique( all ) ); - }, - - andSelf: function() { - return this.add( this.prevObject ); - } -}); - -// A painfully simple check to see if an element is disconnected -// from a document (should be improved, where feasible). -function isDisconnected( node ) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); - }, - prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( elem.parentNode.firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, name, slice.call( arguments ).join(",") ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - nth: function( cur, result, dir, elem ) { - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, keep ) { - - // Can't pass null or undefined to indexOf in Firefox 4 - // Set to 0 to skip string check - qualifier = qualifier || 0; - - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - var retVal = !!qualifier.call( elem, i, elem ); - return retVal === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem, i ) { - return ( elem === qualifier ) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem, i ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; - }); -} - - - - -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, - rtagName = /<([\w:]+)/, - rtbody = /<tbody/i, - rhtml = /<|&#?\w+;/, - rnoInnerhtml = /<(?:script|style)/i, - rnocache = /<(?:script|object|embed|option|style)/i, - rnoshimcache = new RegExp("<(?:" + nodeNames + ")", "i"), - // checked="checked" or checked - rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, - rscriptType = /\/(java|ecma)script/i, - rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/, - wrapMap = { - option: [ 1, "<select multiple='multiple'>", "</select>" ], - legend: [ 1, "<fieldset>", "</fieldset>" ], - thead: [ 1, "<table>", "</table>" ], - tr: [ 2, "<table><tbody>", "</tbody></table>" ], - td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], - col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], - area: [ 1, "<map>", "</map>" ], - _default: [ 0, "", "" ] - }, - safeFragment = createSafeFragment( document ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize <link> and <script> tags normally -if ( !jQuery.support.htmlSerialize ) { - wrapMap._default = [ 1, "div<div>", "</div>" ]; -} - -jQuery.fn.extend({ - text: function( text ) { - if ( jQuery.isFunction(text) ) { - return this.each(function(i) { - var self = jQuery( this ); - - self.text( text.call(this, i, self.text()) ); - }); - } - - if ( typeof text !== "object" && text !== undefined ) { - return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); - } - - return jQuery.text( this ); - }, - - wrapAll: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapAll( html.call(this, i) ); - }); - } - - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); - - if ( this[0].parentNode ) { - wrap.insertBefore( this[0] ); - } - - wrap.map(function() { - var elem = this; - - while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { - elem = elem.firstChild; - } - - return elem; - }).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapInner( html.call(this, i) ); - }); - } - - return this.each(function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - }); - }, - - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); - - return this.each(function(i) { - jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); - }); - }, - - unwrap: function() { - return this.parent().each(function() { - if ( !jQuery.nodeName( this, "body" ) ) { - jQuery( this ).replaceWith( this.childNodes ); - } - }).end(); - }, - - append: function() { - return this.domManip(arguments, true, function( elem ) { - if ( this.nodeType === 1 ) { - this.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip(arguments, true, function( elem ) { - if ( this.nodeType === 1 ) { - this.insertBefore( elem, this.firstChild ); - } - }); - }, - - before: function() { - if ( this[0] && this[0].parentNode ) { - return this.domManip(arguments, false, function( elem ) { - this.parentNode.insertBefore( elem, this ); - }); - } else if ( arguments.length ) { - var set = jQuery.clean( arguments ); - set.push.apply( set, this.toArray() ); - return this.pushStack( set, "before", arguments ); - } - }, - - after: function() { - if ( this[0] && this[0].parentNode ) { - return this.domManip(arguments, false, function( elem ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - }); - } else if ( arguments.length ) { - var set = this.pushStack( this, "after", arguments ); - set.push.apply( set, jQuery.clean(arguments) ); - return set; - } - }, - - // keepData is for internal use only--do not document - remove: function( selector, keepData ) { - for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { - if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( elem.getElementsByTagName("*") ); - jQuery.cleanData( [ elem ] ); - } - - if ( elem.parentNode ) { - elem.parentNode.removeChild( elem ); - } - } - } - - return this; - }, - - empty: function() { - for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( elem.getElementsByTagName("*") ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function () { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - if ( value === undefined ) { - return this[0] && this[0].nodeType === 1 ? - this[0].innerHTML.replace(rinlinejQuery, "") : - null; - - // See if we can take a shortcut and just use innerHTML - } else if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) && - !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) { - - value = value.replace(rxhtmlTag, "<$1></$2>"); - - try { - for ( var i = 0, l = this.length; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - if ( this[i].nodeType === 1 ) { - jQuery.cleanData( this[i].getElementsByTagName("*") ); - this[i].innerHTML = value; - } - } - - // If using innerHTML throws an exception, use the fallback method - } catch(e) { - this.empty().append( value ); - } - - } else if ( jQuery.isFunction( value ) ) { - this.each(function(i){ - var self = jQuery( this ); - - self.html( value.call(this, i, self.html()) ); - }); - - } else { - this.empty().append( value ); - } - - return this; - }, - - replaceWith: function( value ) { - if ( this[0] && this[0].parentNode ) { - // Make sure that the elements are removed from the DOM before they are inserted - // this can help fix replacing a parent with child elements - if ( jQuery.isFunction( value ) ) { - return this.each(function(i) { - var self = jQuery(this), old = self.html(); - self.replaceWith( value.call( this, i, old ) ); - }); - } - - if ( typeof value !== "string" ) { - value = jQuery( value ).detach(); - } - - return this.each(function() { - var next = this.nextSibling, - parent = this.parentNode; - - jQuery( this ).remove(); - - if ( next ) { - jQuery(next).before( value ); - } else { - jQuery(parent).append( value ); - } - }); - } else { - return this.length ? - this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) : - this; - } - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, table, callback ) { - var results, first, fragment, parent, - value = args[0], - scripts = []; - - // We can't cloneNode fragments that contain checked, in WebKit - if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) { - return this.each(function() { - jQuery(this).domManip( args, table, callback, true ); - }); - } - - if ( jQuery.isFunction(value) ) { - return this.each(function(i) { - var self = jQuery(this); - args[0] = value.call(this, i, table ? self.html() : undefined); - self.domManip( args, table, callback ); - }); - } - - if ( this[0] ) { - parent = value && value.parentNode; - - // If we're in a fragment, just use that instead of building a new one - if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) { - results = { fragment: parent }; - - } else { - results = jQuery.buildFragment( args, this, scripts ); - } - - fragment = results.fragment; - - if ( fragment.childNodes.length === 1 ) { - first = fragment = fragment.firstChild; - } else { - first = fragment.firstChild; - } - - if ( first ) { - table = table && jQuery.nodeName( first, "tr" ); - - for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) { - callback.call( - table ? - root(this[i], first) : - this[i], - // Make sure that we do not leak memory by inadvertently discarding - // the original fragment (which might have attached data) instead of - // using it; in addition, use the original fragment object for the last - // item instead of first because it can end up being emptied incorrectly - // in certain situations (Bug #8070). - // Fragments from the fragment cache must always be cloned and never used - // in place. - results.cacheable || ( l > 1 && i < lastIndex ) ? - jQuery.clone( fragment, true, true ) : - fragment - ); - } - } - - if ( scripts.length ) { - jQuery.each( scripts, evalScript ); - } - } - - return this; - } -}); - -function root( elem, cur ) { - return jQuery.nodeName(elem, "table") ? - (elem.getElementsByTagName("tbody")[0] || - elem.appendChild(elem.ownerDocument.createElement("tbody"))) : - elem; -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function cloneFixAttributes( src, dest ) { - var nodeName; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - // clearAttributes removes the attributes, which we don't want, - // but also removes the attachEvent events, which we *do* want - if ( dest.clearAttributes ) { - dest.clearAttributes(); - } - - // mergeAttributes, in contrast, only merges back on the - // original attributes, not the events - if ( dest.mergeAttributes ) { - dest.mergeAttributes( src ); - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 fail to clone children inside object elements that use - // the proprietary classid attribute value (rather than the type - // attribute) to identify the type of content to display - if ( nodeName === "object" ) { - dest.outerHTML = src.outerHTML; - - } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - if ( src.checked ) { - dest.defaultChecked = dest.checked = src.checked; - } - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } - - // Event data gets referenced instead of copied if the expando - // gets copied too - dest.removeAttribute( jQuery.expando ); -} - -jQuery.buildFragment = function( args, nodes, scripts ) { - var fragment, cacheable, cacheresults, doc, - first = args[ 0 ]; - - // nodes may contain either an explicit document object, - // a jQuery collection or context object. - // If nodes[0] contains a valid object to assign to doc - if ( nodes && nodes[0] ) { - doc = nodes[0].ownerDocument || nodes[0]; - } - - // Ensure that an attr object doesn't incorrectly stand in as a document object - // Chrome and Firefox seem to allow this to occur and will throw exception - // Fixes #8950 - if ( !doc.createDocumentFragment ) { - doc = document; - } - - // Only cache "small" (1/2 KB) HTML strings that are associated with the main document - // Cloning options loses the selected state, so don't cache them - // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment - // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache - // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501 - if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document && - first.charAt(0) === "<" && !rnocache.test( first ) && - (jQuery.support.checkClone || !rchecked.test( first )) && - (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) { - - cacheable = true; - - cacheresults = jQuery.fragments[ first ]; - if ( cacheresults && cacheresults !== 1 ) { - fragment = cacheresults; - } - } - - if ( !fragment ) { - fragment = doc.createDocumentFragment(); - jQuery.clean( args, doc, fragment, scripts ); - } - - if ( cacheable ) { - jQuery.fragments[ first ] = cacheresults ? fragment : 1; - } - - return { fragment: fragment, cacheable: cacheable }; -}; - -jQuery.fragments = {}; - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var ret = [], - insert = jQuery( selector ), - parent = this.length === 1 && this[0].parentNode; - - if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { - insert[ original ]( this[0] ); - return this; - - } else { - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = ( i > 0 ? this.clone(true) : this ).get(); - jQuery( insert[i] )[ original ]( elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, name, insert.selector ); - } - }; -}); - -function getAll( elem ) { - if ( typeof elem.getElementsByTagName !== "undefined" ) { - return elem.getElementsByTagName( "*" ); - - } else if ( typeof elem.querySelectorAll !== "undefined" ) { - return elem.querySelectorAll( "*" ); - - } else { - return []; - } -} - -// Used in clean, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( elem.type === "checkbox" || elem.type === "radio" ) { - elem.defaultChecked = elem.checked; - } -} -// Finds all inputs and passes them to fixDefaultChecked -function findInputs( elem ) { - var nodeName = ( elem.nodeName || "" ).toLowerCase(); - if ( nodeName === "input" ) { - fixDefaultChecked( elem ); - // Skip scripts, get other children - } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) { - jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked ); - } -} - -// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js -function shimCloneNode( elem ) { - var div = document.createElement( "div" ); - safeFragment.appendChild( div ); - - div.innerHTML = elem.outerHTML; - return div.firstChild; -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var srcElements, - destElements, - i, - // IE<=8 does not properly clone detached, unknown element nodes - clone = jQuery.support.html5Clone || !rnoshimcache.test( "<" + elem.nodeName ) ? - elem.cloneNode( true ) : - shimCloneNode( elem ); - - if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - // IE copies events bound via attachEvent when using cloneNode. - // Calling detachEvent on the clone will also remove the events - // from the original. In order to get around this, we use some - // proprietary methods to clear the events. Thanks to MooTools - // guys for this hotness. - - cloneFixAttributes( elem, clone ); - - // Using Sizzle here is crazy slow, so we use getElementsByTagName instead - srcElements = getAll( elem ); - destElements = getAll( clone ); - - // Weird iteration because IE will replace the length property - // with an element if you are cloning the body and one of the - // elements on the page has a name or id of "length" - for ( i = 0; srcElements[i]; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - cloneFixAttributes( srcElements[i], destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - cloneCopyEvent( elem, clone ); - - if ( deepDataAndEvents ) { - srcElements = getAll( elem ); - destElements = getAll( clone ); - - for ( i = 0; srcElements[i]; ++i ) { - cloneCopyEvent( srcElements[i], destElements[i] ); - } - } - } - - srcElements = destElements = null; - - // Return the cloned set - return clone; - }, - - clean: function( elems, context, fragment, scripts ) { - var checkScriptType; - - context = context || document; - - // !context.createElement fails in IE with an error but returns typeof 'object' - if ( typeof context.createElement === "undefined" ) { - context = context.ownerDocument || context[0] && context[0].ownerDocument || document; - } - - var ret = [], j; - - for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { - if ( typeof elem === "number" ) { - elem += ""; - } - - if ( !elem ) { - continue; - } - - // Convert html string into DOM nodes - if ( typeof elem === "string" ) { - if ( !rhtml.test( elem ) ) { - elem = context.createTextNode( elem ); - } else { - // Fix "XHTML"-style tags in all browsers - elem = elem.replace(rxhtmlTag, "<$1></$2>"); - - // Trim whitespace, otherwise indexOf won't work as expected - var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(), - wrap = wrapMap[ tag ] || wrapMap._default, - depth = wrap[0], - div = context.createElement("div"); - - // Append wrapper element to unknown element safe doc fragment - if ( context === document ) { - // Use the fragment we've already created for this document - safeFragment.appendChild( div ); - } else { - // Use a fragment created with the owner document - createSafeFragment( context ).appendChild( div ); - } - - // Go to html and back, then peel off extra wrappers - div.innerHTML = wrap[1] + elem + wrap[2]; - - // Move to the right depth - while ( depth-- ) { - div = div.lastChild; - } - - // Remove IE's autoinserted <tbody> from table fragments - if ( !jQuery.support.tbody ) { - - // String was a <table>, *may* have spurious <tbody> - var hasBody = rtbody.test(elem), - tbody = tag === "table" && !hasBody ? - div.firstChild && div.firstChild.childNodes : - - // String was a bare <thead> or <tfoot> - wrap[1] === "<table>" && !hasBody ? - div.childNodes : - []; - - for ( j = tbody.length - 1; j >= 0 ; --j ) { - if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { - tbody[ j ].parentNode.removeChild( tbody[ j ] ); - } - } - } - - // IE completely kills leading whitespace when innerHTML is used - if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); - } - - elem = div.childNodes; - } - } - - // Resets defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - var len; - if ( !jQuery.support.appendChecked ) { - if ( elem[0] && typeof (len = elem.length) === "number" ) { - for ( j = 0; j < len; j++ ) { - findInputs( elem[j] ); - } - } else { - findInputs( elem ); - } - } - - if ( elem.nodeType ) { - ret.push( elem ); - } else { - ret = jQuery.merge( ret, elem ); - } - } - - if ( fragment ) { - checkScriptType = function( elem ) { - return !elem.type || rscriptType.test( elem.type ); - }; - for ( i = 0; ret[i]; i++ ) { - if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { - scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); - - } else { - if ( ret[i].nodeType === 1 ) { - var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType ); - - ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); - } - fragment.appendChild( ret[i] ); - } - } - } - - return ret; - }, - - cleanData: function( elems ) { - var data, id, - cache = jQuery.cache, - special = jQuery.event.special, - deleteExpando = jQuery.support.deleteExpando; - - for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { - if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { - continue; - } - - id = elem[ jQuery.expando ]; - - if ( id ) { - data = cache[ id ]; - - if ( data && data.events ) { - for ( var type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - - // Null the DOM reference to avoid IE6/7/8 leak (#7054) - if ( data.handle ) { - data.handle.elem = null; - } - } - - if ( deleteExpando ) { - delete elem[ jQuery.expando ]; - - } else if ( elem.removeAttribute ) { - elem.removeAttribute( jQuery.expando ); - } - - delete cache[ id ]; - } - } - } -}); - -function evalScript( i, elem ) { - if ( elem.src ) { - jQuery.ajax({ - url: elem.src, - async: false, - dataType: "script" - }); - } else { - jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) ); - } - - if ( elem.parentNode ) { - elem.parentNode.removeChild( elem ); - } -} - - - - -var ralpha = /alpha\([^)]*\)/i, - ropacity = /opacity=([^)]*)/, - // fixed for IE9, see #8346 - rupper = /([A-Z]|^ms)/g, - rnumpx = /^-?\d+(?:px)?$/i, - rnum = /^-?\d/, - rrelNum = /^([\-+])=([\-+.\de]+)/, - - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssWidth = [ "Left", "Right" ], - cssHeight = [ "Top", "Bottom" ], - curCSS, - - getComputedStyle, - currentStyle; - -jQuery.fn.css = function( name, value ) { - // Setting 'undefined' is a no-op - if ( arguments.length === 2 && value === undefined ) { - return this; - } - - return jQuery.access( this, name, value, true, function( elem, name, value ) { - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }); -}; - -jQuery.extend({ - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity", "opacity" ); - return ret === "" ? "1" : ret; - - } else { - return elem.style.opacity; - } - } - } - }, - - // Exclude the following css properties to add px - cssNumber: { - "fillOpacity": true, - "fontWeight": true, - "lineHeight": true, - "opacity": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: { - // normalize float css property - "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" - }, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, origName = jQuery.camelCase( name ), - style = elem.style, hooks = jQuery.cssHooks[ origName ]; - - name = jQuery.cssProps[ origName ] || origName; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // convert relative number strings (+= or -=) to relative numbers. #7345 - if ( type === "string" && (ret = rrelNum.exec( value )) ) { - value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) ); - // Fixes bug #9237 - type = "number"; - } - - // Make sure that NaN and null values aren't set. See: #7116 - if ( value == null || type === "number" && isNaN( value ) ) { - return; - } - - // If a number was passed in, add 'px' to the (except for certain CSS properties) - if ( type === "number" && !jQuery.cssNumber[ origName ] ) { - value += "px"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) { - // Wrapped to prevent IE from throwing errors when 'invalid' values are provided - // Fixes bug #5509 - try { - style[ name ] = value; - } catch(e) {} - } - - } else { - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra ) { - var ret, hooks; - - // Make sure that we're working with the right name - name = jQuery.camelCase( name ); - hooks = jQuery.cssHooks[ name ]; - name = jQuery.cssProps[ name ] || name; - - // cssFloat needs a special treatment - if ( name === "cssFloat" ) { - name = "float"; - } - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) { - return ret; - - // Otherwise, if a way to get the computed value exists, use that - } else if ( curCSS ) { - return curCSS( elem, name ); - } - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations - swap: function( elem, options, callback ) { - var old = {}; - - // Remember the old values, and insert the new ones - for ( var name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - callback.call( elem ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - } -}); - -// DEPRECATED, Use jQuery.css() instead -jQuery.curCSS = jQuery.css; - -jQuery.each(["height", "width"], function( i, name ) { - jQuery.cssHooks[ name ] = { - get: function( elem, computed, extra ) { - var val; - - if ( computed ) { - if ( elem.offsetWidth !== 0 ) { - return getWH( elem, name, extra ); - } else { - jQuery.swap( elem, cssShow, function() { - val = getWH( elem, name, extra ); - }); - } - - return val; - } - }, - - set: function( elem, value ) { - if ( rnumpx.test( value ) ) { - // ignore negative width and height values #1599 - value = parseFloat( value ); - - if ( value >= 0 ) { - return value + "px"; - } - - } else { - return value; - } - } - }; -}); - -if ( !jQuery.support.opacity ) { - jQuery.cssHooks.opacity = { - get: function( elem, computed ) { - // IE uses filters for opacity - return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? - ( parseFloat( RegExp.$1 ) / 100 ) + "" : - computed ? "1" : ""; - }, - - set: function( elem, value ) { - var style = elem.style, - currentStyle = elem.currentStyle, - opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", - filter = currentStyle && currentStyle.filter || style.filter || ""; - - // IE has trouble with opacity if it does not have layout - // Force it by setting the zoom level - style.zoom = 1; - - // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 - if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) { - - // Setting style.filter to null, "" & " " still leave "filter:" in the cssText - // if "filter:" is present at all, clearType is disabled, we want to avoid this - // style.removeAttribute is IE Only, but so apparently is this code path... - style.removeAttribute( "filter" ); - - // if there there is no filter style applied in a css rule, we are done - if ( currentStyle && !currentStyle.filter ) { - return; - } - } - - // otherwise, set new filter values - style.filter = ralpha.test( filter ) ? - filter.replace( ralpha, opacity ) : - filter + " " + opacity; - } - }; -} - -jQuery(function() { - // This hook cannot be added until DOM ready because the support test - // for it is not run until after DOM ready - if ( !jQuery.support.reliableMarginRight ) { - jQuery.cssHooks.marginRight = { - get: function( elem, computed ) { - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - // Work around by temporarily setting element display to inline-block - var ret; - jQuery.swap( elem, { "display": "inline-block" }, function() { - if ( computed ) { - ret = curCSS( elem, "margin-right", "marginRight" ); - } else { - ret = elem.style.marginRight; - } - }); - return ret; - } - }; - } -}); - -if ( document.defaultView && document.defaultView.getComputedStyle ) { - getComputedStyle = function( elem, name ) { - var ret, defaultView, computedStyle; - - name = name.replace( rupper, "-$1" ).toLowerCase(); - - if ( (defaultView = elem.ownerDocument.defaultView) && - (computedStyle = defaultView.getComputedStyle( elem, null )) ) { - ret = computedStyle.getPropertyValue( name ); - if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { - ret = jQuery.style( elem, name ); - } - } - - return ret; - }; -} - -if ( document.documentElement.currentStyle ) { - currentStyle = function( elem, name ) { - var left, rsLeft, uncomputed, - ret = elem.currentStyle && elem.currentStyle[ name ], - style = elem.style; - - // Avoid setting ret to empty string here - // so we don't default to auto - if ( ret === null && style && (uncomputed = style[ name ]) ) { - ret = uncomputed; - } - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - if ( !rnumpx.test( ret ) && rnum.test( ret ) ) { - - // Remember the original values - left = style.left; - rsLeft = elem.runtimeStyle && elem.runtimeStyle.left; - - // Put in the new values to get a computed value out - if ( rsLeft ) { - elem.runtimeStyle.left = elem.currentStyle.left; - } - style.left = name === "fontSize" ? "1em" : ( ret || 0 ); - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - if ( rsLeft ) { - elem.runtimeStyle.left = rsLeft; - } - } - - return ret === "" ? "auto" : ret; - }; -} - -curCSS = getComputedStyle || currentStyle; - -function getWH( elem, name, extra ) { - - // Start with offset property - var val = name === "width" ? elem.offsetWidth : elem.offsetHeight, - which = name === "width" ? cssWidth : cssHeight, - i = 0, - len = which.length; - - if ( val > 0 ) { - if ( extra !== "border" ) { - for ( ; i < len; i++ ) { - if ( !extra ) { - val -= parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0; - } - if ( extra === "margin" ) { - val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0; - } else { - val -= parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0; - } - } - } - - return val + "px"; - } - - // Fall back to computed then uncomputed css if necessary - val = curCSS( elem, name, name ); - if ( val < 0 || val == null ) { - val = elem.style[ name ] || 0; - } - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; - - // Add padding, border, margin - if ( extra ) { - for ( ; i < len; i++ ) { - val += parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0; - if ( extra !== "padding" ) { - val += parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0; - } - if ( extra === "margin" ) { - val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0; - } - } - } - - return val + "px"; -} - -if ( jQuery.expr && jQuery.expr.filters ) { - jQuery.expr.filters.hidden = function( elem ) { - var width = elem.offsetWidth, - height = elem.offsetHeight; - - return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); - }; - - jQuery.expr.filters.visible = function( elem ) { - return !jQuery.expr.filters.hidden( elem ); - }; -} - - - - -var r20 = /%20/g, - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rhash = /#.*$/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL - rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - rquery = /\?/, - rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, - rselectTextarea = /^(?:select|textarea)/i, - rspacesAjax = /\s+/, - rts = /([?&])_=[^&]*/, - rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/, - - // Keep a copy of the old load method - _load = jQuery.fn.load, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Document location - ajaxLocation, - - // Document location segments - ajaxLocParts, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = ["*/"] + ["*"]; - -// #8138, IE may throw an exception when accessing -// a field from window.location if document.domain has been set -try { - ajaxLocation = location.href; -} catch( e ) { - // Use the href attribute of an A element - // since IE will modify it given document.location - ajaxLocation = document.createElement( "a" ); - ajaxLocation.href = ""; - ajaxLocation = ajaxLocation.href; -} - -// Segment location into parts -ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - if ( jQuery.isFunction( func ) ) { - var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ), - i = 0, - length = dataTypes.length, - dataType, - list, - placeBefore; - - // For each dataType in the dataTypeExpression - for ( ; i < length; i++ ) { - dataType = dataTypes[ i ]; - // We control if we're asked to add before - // any existing element - placeBefore = /^\+/.test( dataType ); - if ( placeBefore ) { - dataType = dataType.substr( 1 ) || "*"; - } - list = structure[ dataType ] = structure[ dataType ] || []; - // then we add to the structure accordingly - list[ placeBefore ? "unshift" : "push" ]( func ); - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, - dataType /* internal */, inspected /* internal */ ) { - - dataType = dataType || options.dataTypes[ 0 ]; - inspected = inspected || {}; - - inspected[ dataType ] = true; - - var list = structure[ dataType ], - i = 0, - length = list ? list.length : 0, - executeOnly = ( structure === prefilters ), - selection; - - for ( ; i < length && ( executeOnly || !selection ); i++ ) { - selection = list[ i ]( options, originalOptions, jqXHR ); - // If we got redirected to another dataType - // we try there if executing only and not done already - if ( typeof selection === "string" ) { - if ( !executeOnly || inspected[ selection ] ) { - selection = undefined; - } else { - options.dataTypes.unshift( selection ); - selection = inspectPrefiltersOrTransports( - structure, options, originalOptions, jqXHR, selection, inspected ); - } - } - } - // If we're only executing or nothing was selected - // we try the catchall dataType if not done already - if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) { - selection = inspectPrefiltersOrTransports( - structure, options, originalOptions, jqXHR, "*", inspected ); - } - // unnecessary when only executing (prefilters) - // but it'll be ignored by the caller in that case - return selection; -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } -} - -jQuery.fn.extend({ - load: function( url, params, callback ) { - if ( typeof url !== "string" && _load ) { - return _load.apply( this, arguments ); - - // Don't do a request if no elements are being requested - } else if ( !this.length ) { - return this; - } - - var off = url.indexOf( " " ); - if ( off >= 0 ) { - var selector = url.slice( off, url.length ); - url = url.slice( 0, off ); - } - - // Default to a GET request - var type = "GET"; - - // If the second parameter was provided - if ( params ) { - // If it's a function - if ( jQuery.isFunction( params ) ) { - // We assume that it's the callback - callback = params; - params = undefined; - - // Otherwise, build a param string - } else if ( typeof params === "object" ) { - params = jQuery.param( params, jQuery.ajaxSettings.traditional ); - type = "POST"; - } - } - - var self = this; - - // Request the remote document - jQuery.ajax({ - url: url, - type: type, - dataType: "html", - data: params, - // Complete callback (responseText is used internally) - complete: function( jqXHR, status, responseText ) { - // Store the response as specified by the jqXHR object - responseText = jqXHR.responseText; - // If successful, inject the HTML into all the matched elements - if ( jqXHR.isResolved() ) { - // #4825: Get the actual response in case - // a dataFilter is present in ajaxSettings - jqXHR.done(function( r ) { - responseText = r; - }); - // See if a selector was specified - self.html( selector ? - // Create a dummy div to hold the results - jQuery("<div>") - // inject the contents of the document in, removing the scripts - // to avoid any 'Permission Denied' errors in IE - .append(responseText.replace(rscript, "")) - - // Locate the specified elements - .find(selector) : - - // If not, just inject the full result - responseText ); - } - - if ( callback ) { - self.each( callback, [ responseText, status, jqXHR ] ); - } - } - }); - - return this; - }, - - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - - serializeArray: function() { - return this.map(function(){ - return this.elements ? jQuery.makeArray( this.elements ) : this; - }) - .filter(function(){ - return this.name && !this.disabled && - ( this.checked || rselectTextarea.test( this.nodeName ) || - rinput.test( this.type ) ); - }) - .map(function( i, elem ){ - var val = jQuery( this ).val(); - - return val == null ? - null : - jQuery.isArray( val ) ? - jQuery.map( val, function( val, i ){ - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - }) : - { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - }).get(); - } -}); - -// Attach a bunch of functions for handling common AJAX events -jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){ - jQuery.fn[ o ] = function( f ){ - return this.on( o, f ); - }; -}); - -jQuery.each( [ "get", "post" ], function( i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - // shift arguments if data argument was omitted - if ( jQuery.isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - return jQuery.ajax({ - type: method, - url: url, - data: data, - success: callback, - dataType: type - }); - }; -}); - -jQuery.extend({ - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - if ( settings ) { - // Building a settings object - ajaxExtend( target, jQuery.ajaxSettings ); - } else { - // Extending ajaxSettings - settings = target; - target = jQuery.ajaxSettings; - } - ajaxExtend( target, settings ); - return target; - }, - - ajaxSettings: { - url: ajaxLocation, - isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), - global: true, - type: "GET", - contentType: "application/x-www-form-urlencoded", - processData: true, - async: true, - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - traditional: false, - headers: {}, - */ - - accepts: { - xml: "application/xml, text/xml", - html: "text/html", - text: "text/plain", - json: "application/json, text/javascript", - "*": allTypes - }, - - contents: { - xml: /xml/, - html: /html/, - json: /json/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText" - }, - - // List of data converters - // 1) key format is "source_type destination_type" (a single space in-between) - // 2) the catchall symbol "*" can be used for source_type - converters: { - - // Convert anything to text - "* text": window.String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": jQuery.parseJSON, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - context: true, - url: true - } - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - // Callbacks context - callbackContext = s.context || s, - // Context for global events - // It's the callbackContext if one was provided in the options - // and if it's a DOM node or a jQuery collection - globalEventContext = callbackContext !== s && - ( callbackContext.nodeType || callbackContext instanceof jQuery ) ? - jQuery( callbackContext ) : jQuery.event, - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - // Status-dependent callbacks - statusCode = s.statusCode || {}, - // ifModified key - ifModifiedKey, - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - // Response headers - responseHeadersString, - responseHeaders, - // transport - transport, - // timeout handle - timeoutTimer, - // Cross-domain detection vars - parts, - // The jqXHR state - state = 0, - // To know if global events are to be dispatched - fireGlobals, - // Loop variable - i, - // Fake xhr - jqXHR = { - - readyState: 0, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( !state ) { - var lname = name.toLowerCase(); - name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Raw string - getAllResponseHeaders: function() { - return state === 2 ? responseHeadersString : null; - }, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( state === 2 ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; - } - } - match = responseHeaders[ key.toLowerCase() ]; - } - return match === undefined ? null : match; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( !state ) { - s.mimeType = type; - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - statusText = statusText || "abort"; - if ( transport ) { - transport.abort( statusText ); - } - done( 0, statusText ); - return this; - } - }; - - // Callback for when everything is done - // It is defined here because jslint complains if it is declared - // at the end of the function (which would be more logical and readable) - function done( status, nativeStatusText, responses, headers ) { - - // Called once - if ( state === 2 ) { - return; - } - - // State is "done" now - state = 2; - - // Clear timeout if it exists - if ( timeoutTimer ) { - clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - var isSuccess, - success, - error, - statusText = nativeStatusText, - response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined, - lastModified, - etag; - - // If successful, handle type chaining - if ( status >= 200 && status < 300 || status === 304 ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - - if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) { - jQuery.lastModified[ ifModifiedKey ] = lastModified; - } - if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) { - jQuery.etag[ ifModifiedKey ] = etag; - } - } - - // If not modified - if ( status === 304 ) { - - statusText = "notmodified"; - isSuccess = true; - - // If we have data - } else { - - try { - success = ajaxConvert( s, response ); - statusText = "success"; - isSuccess = true; - } catch(e) { - // We have a parsererror - statusText = "parsererror"; - error = e; - } - } - } else { - // We extract error from statusText - // then normalize statusText and status for non-aborts - error = statusText; - if ( !statusText || status ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = "" + ( nativeStatusText || statusText ); - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ), - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - // Attach deferreds - deferred.promise( jqXHR ); - jqXHR.success = jqXHR.done; - jqXHR.error = jqXHR.fail; - jqXHR.complete = completeDeferred.add; - - // Status-dependent callbacks - jqXHR.statusCode = function( map ) { - if ( map ) { - var tmp; - if ( state < 2 ) { - for ( tmp in map ) { - statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ]; - } - } else { - tmp = map[ jqXHR.status ]; - jqXHR.then( tmp, tmp ); - } - } - return this; - }; - - // Remove hash character (#7531: and string promotion) - // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) - // We also use the url parameter if available - s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); - - // Extract dataTypes list - s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax ); - - // Determine if a cross-domain request is in order - if ( s.crossDomain == null ) { - parts = rurl.exec( s.url.toLowerCase() ); - s.crossDomain = !!( parts && - ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] || - ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != - ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) - ); - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefiler, stop there - if ( state === 2 ) { - return false; - } - - // We can fire global events as of now if asked to - fireGlobals = s.global; - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // If data is available, append data to url - if ( s.data ) { - s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data; - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Get ifModifiedKey before adding the anti-cache parameter - ifModifiedKey = s.url; - - // Add anti-cache in url if needed - if ( s.cache === false ) { - - var ts = jQuery.now(), - // try replacing _= if it is there - ret = s.url.replace( rts, "$1_=" + ts ); - - // if nothing was replaced, add timestamp to the end - s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - ifModifiedKey = ifModifiedKey || s.url; - if ( jQuery.lastModified[ ifModifiedKey ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] ); - } - if ( jQuery.etag[ ifModifiedKey ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] ); - } - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? - s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { - // Abort if not done already - jqXHR.abort(); - return false; - - } - - // Install callbacks on deferreds - for ( i in { success: 1, error: 1, complete: 1 } ) { - jqXHR[ i ]( s[ i ] ); - } - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = setTimeout( function(){ - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - state = 1; - transport.send( requestHeaders, done ); - } catch (e) { - // Propagate exception as error if not done - if ( state < 2 ) { - done( -1, e ); - // Simply rethrow otherwise - } else { - throw e; - } - } - } - - return jqXHR; - }, - - // Serialize an array of form elements or a set of - // key/values into a query string - param: function( a, traditional ) { - var s = [], - add = function( key, value ) { - // If value is a function, invoke it and return its value - value = jQuery.isFunction( value ) ? value() : value; - s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); - }; - - // Set traditional to true for jQuery <= 1.3.2 behavior. - if ( traditional === undefined ) { - traditional = jQuery.ajaxSettings.traditional; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - }); - - } else { - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( var prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ).replace( r20, "+" ); - } -}); - -function buildParams( prefix, obj, traditional, add ) { - if ( jQuery.isArray( obj ) ) { - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - // If array item is non-scalar (array or object), encode its - // numeric index to resolve deserialization ambiguity issues. - // Note that rack (as of 1.0.0) can't currently deserialize - // nested arrays properly, and attempting to do so may cause - // a server error. Possible fixes are to modify rack's - // deserialization algorithm or to provide an option or flag - // to force array serialization to be shallow. - buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add ); - } - }); - - } else if ( !traditional && obj != null && typeof obj === "object" ) { - // Serialize object item. - for ( var name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - // Serialize scalar item. - add( prefix, obj ); - } -} - -// This is still on the jQuery object... for now -// Want to move this to jQuery.ajax some day -jQuery.extend({ - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {} - -}); - -/* Handles responses to an ajax request: - * - sets all responseXXX fields accordingly - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var contents = s.contents, - dataTypes = s.dataTypes, - responseFields = s.responseFields, - ct, - type, - finalDataType, - firstDataType; - - // Fill responseXXX fields - for ( type in responseFields ) { - if ( type in responses ) { - jqXHR[ responseFields[type] ] = responses[ type ]; - } - } - - // Remove auto dataType and get content-type in the process - while( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "content-type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -// Chain conversions given the request and the original response -function ajaxConvert( s, response ) { - - // Apply the dataFilter if provided - if ( s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - var dataTypes = s.dataTypes, - converters = {}, - i, - key, - length = dataTypes.length, - tmp, - // Current and previous dataTypes - current = dataTypes[ 0 ], - prev, - // Conversion expression - conversion, - // Conversion function - conv, - // Conversion functions (transitive conversion) - conv1, - conv2; - - // For each dataType in the chain - for ( i = 1; i < length; i++ ) { - - // Create converters map - // with lowercased keys - if ( i === 1 ) { - for ( key in s.converters ) { - if ( typeof key === "string" ) { - converters[ key.toLowerCase() ] = s.converters[ key ]; - } - } - } - - // Get the dataTypes - prev = current; - current = dataTypes[ i ]; - - // If current is auto dataType, update it to prev - if ( current === "*" ) { - current = prev; - // If no auto and dataTypes are actually different - } else if ( prev !== "*" && prev !== current ) { - - // Get the converter - conversion = prev + " " + current; - conv = converters[ conversion ] || converters[ "* " + current ]; - - // If there is no direct converter, search transitively - if ( !conv ) { - conv2 = undefined; - for ( conv1 in converters ) { - tmp = conv1.split( " " ); - if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) { - conv2 = converters[ tmp[1] + " " + current ]; - if ( conv2 ) { - conv1 = converters[ conv1 ]; - if ( conv1 === true ) { - conv = conv2; - } else if ( conv2 === true ) { - conv = conv1; - } - break; - } - } - } - } - // If we found no converter, dispatch an error - if ( !( conv || conv2 ) ) { - jQuery.error( "No conversion from " + conversion.replace(" "," to ") ); - } - // If found converter is not an equivalence - if ( conv !== true ) { - // Convert with 1 or 2 converters accordingly - response = conv ? conv( response ) : conv2( conv1(response) ); - } - } - } - return response; -} - - - - -var jsc = jQuery.now(), - jsre = /(\=)\?(&|$)|\?\?/i; - -// Default jsonp settings -jQuery.ajaxSetup({ - jsonp: "callback", - jsonpCallback: function() { - return jQuery.expando + "_" + ( jsc++ ); - } -}); - -// Detect, normalize options and install callbacks for jsonp requests -jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { - - var inspectData = s.contentType === "application/x-www-form-urlencoded" && - ( typeof s.data === "string" ); - - if ( s.dataTypes[ 0 ] === "jsonp" || - s.jsonp !== false && ( jsre.test( s.url ) || - inspectData && jsre.test( s.data ) ) ) { - - var responseContainer, - jsonpCallback = s.jsonpCallback = - jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback, - previous = window[ jsonpCallback ], - url = s.url, - data = s.data, - replace = "$1" + jsonpCallback + "$2"; - - if ( s.jsonp !== false ) { - url = url.replace( jsre, replace ); - if ( s.url === url ) { - if ( inspectData ) { - data = data.replace( jsre, replace ); - } - if ( s.data === data ) { - // Add callback manually - url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback; - } - } - } - - s.url = url; - s.data = data; - - // Install callback - window[ jsonpCallback ] = function( response ) { - responseContainer = [ response ]; - }; - - // Clean-up function - jqXHR.always(function() { - // Set callback back to previous value - window[ jsonpCallback ] = previous; - // Call if it was a function and we have a response - if ( responseContainer && jQuery.isFunction( previous ) ) { - window[ jsonpCallback ]( responseContainer[ 0 ] ); - } - }); - - // Use data converter to retrieve json after script execution - s.converters["script json"] = function() { - if ( !responseContainer ) { - jQuery.error( jsonpCallback + " was not called" ); - } - return responseContainer[ 0 ]; - }; - - // force json dataType - s.dataTypes[ 0 ] = "json"; - - // Delegate to script - return "script"; - } -}); - - - - -// Install script dataType -jQuery.ajaxSetup({ - accepts: { - script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /javascript|ecmascript/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -}); - -// Handle cache's special case and global -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - s.global = false; - } -}); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function(s) { - - // This transport only deals with cross domain requests - if ( s.crossDomain ) { - - var script, - head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement; - - return { - - send: function( _, callback ) { - - script = document.createElement( "script" ); - - script.async = "async"; - - if ( s.scriptCharset ) { - script.charset = s.scriptCharset; - } - - script.src = s.url; - - // Attach handlers for all browsers - script.onload = script.onreadystatechange = function( _, isAbort ) { - - if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { - - // Handle memory leak in IE - script.onload = script.onreadystatechange = null; - - // Remove the script - if ( head && script.parentNode ) { - head.removeChild( script ); - } - - // Dereference the script - script = undefined; - - // Callback if not abort - if ( !isAbort ) { - callback( 200, "success" ); - } - } - }; - // Use insertBefore instead of appendChild to circumvent an IE6 bug. - // This arises when a base node is used (#2709 and #4378). - head.insertBefore( script, head.firstChild ); - }, - - abort: function() { - if ( script ) { - script.onload( 0, 1 ); - } - } - }; - } -}); - - - - -var // #5280: Internet Explorer will keep connections alive if we don't abort on unload - xhrOnUnloadAbort = window.ActiveXObject ? function() { - // Abort all pending requests - for ( var key in xhrCallbacks ) { - xhrCallbacks[ key ]( 0, 1 ); - } - } : false, - xhrId = 0, - xhrCallbacks; - -// Functions to create xhrs -function createStandardXHR() { - try { - return new window.XMLHttpRequest(); - } catch( e ) {} -} - -function createActiveXHR() { - try { - return new window.ActiveXObject( "Microsoft.XMLHTTP" ); - } catch( e ) {} -} - -// Create the request object -// (This is still attached to ajaxSettings for backward compatibility) -jQuery.ajaxSettings.xhr = window.ActiveXObject ? - /* Microsoft failed to properly - * implement the XMLHttpRequest in IE7 (can't request local files), - * so we use the ActiveXObject when it is available - * Additionally XMLHttpRequest can be disabled in IE7/IE8 so - * we need a fallback. - */ - function() { - return !this.isLocal && createStandardXHR() || createActiveXHR(); - } : - // For all other browsers, use the standard XMLHttpRequest object - createStandardXHR; - -// Determine support properties -(function( xhr ) { - jQuery.extend( jQuery.support, { - ajax: !!xhr, - cors: !!xhr && ( "withCredentials" in xhr ) - }); -})( jQuery.ajaxSettings.xhr() ); - -// Create transport if the browser can provide an xhr -if ( jQuery.support.ajax ) { - - jQuery.ajaxTransport(function( s ) { - // Cross domain only allowed if supported through XMLHttpRequest - if ( !s.crossDomain || jQuery.support.cors ) { - - var callback; - - return { - send: function( headers, complete ) { - - // Get a new xhr - var xhr = s.xhr(), - handle, - i; - - // Open the socket - // Passing null username, generates a login popup on Opera (#2865) - if ( s.username ) { - xhr.open( s.type, s.url, s.async, s.username, s.password ); - } else { - xhr.open( s.type, s.url, s.async ); - } - - // Apply custom fields if provided - if ( s.xhrFields ) { - for ( i in s.xhrFields ) { - xhr[ i ] = s.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( s.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( s.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !s.crossDomain && !headers["X-Requested-With"] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Need an extra try/catch for cross domain requests in Firefox 3 - try { - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - } catch( _ ) {} - - // Do send the request - // This may raise an exception which is actually - // handled in jQuery.ajax (so no try/catch here) - xhr.send( ( s.hasContent && s.data ) || null ); - - // Listener - callback = function( _, isAbort ) { - - var status, - statusText, - responseHeaders, - responses, - xml; - - // Firefox throws exceptions when accessing properties - // of an xhr when a network error occured - // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) - try { - - // Was never called and is aborted or complete - if ( callback && ( isAbort || xhr.readyState === 4 ) ) { - - // Only called once - callback = undefined; - - // Do not keep as active anymore - if ( handle ) { - xhr.onreadystatechange = jQuery.noop; - if ( xhrOnUnloadAbort ) { - delete xhrCallbacks[ handle ]; - } - } - - // If it's an abort - if ( isAbort ) { - // Abort it manually if needed - if ( xhr.readyState !== 4 ) { - xhr.abort(); - } - } else { - status = xhr.status; - responseHeaders = xhr.getAllResponseHeaders(); - responses = {}; - xml = xhr.responseXML; - - // Construct response list - if ( xml && xml.documentElement /* #4958 */ ) { - responses.xml = xml; - } - responses.text = xhr.responseText; - - // Firefox throws an exception when accessing - // statusText for faulty cross-domain requests - try { - statusText = xhr.statusText; - } catch( e ) { - // We normalize with Webkit giving an empty statusText - statusText = ""; - } - - // Filter status for non standard behaviors - - // If the request is local and we have data: assume a success - // (success with no data won't get notified, that's the best we - // can do given current implementations) - if ( !status && s.isLocal && !s.crossDomain ) { - status = responses.text ? 200 : 404; - // IE - #1450: sometimes returns 1223 when it should be 204 - } else if ( status === 1223 ) { - status = 204; - } - } - } - } catch( firefoxAccessException ) { - if ( !isAbort ) { - complete( -1, firefoxAccessException ); - } - } - - // Call complete if needed - if ( responses ) { - complete( status, statusText, responses, responseHeaders ); - } - }; - - // if we're in sync mode or it's in cache - // and has been retrieved directly (IE6 & IE7) - // we need to manually fire the callback - if ( !s.async || xhr.readyState === 4 ) { - callback(); - } else { - handle = ++xhrId; - if ( xhrOnUnloadAbort ) { - // Create the active xhrs callbacks list if needed - // and attach the unload handler - if ( !xhrCallbacks ) { - xhrCallbacks = {}; - jQuery( window ).unload( xhrOnUnloadAbort ); - } - // Add to list of active xhrs callbacks - xhrCallbacks[ handle ] = callback; - } - xhr.onreadystatechange = callback; - } - }, - - abort: function() { - if ( callback ) { - callback(0,1); - } - } - }; - } - }); -} - - - - -var elemdisplay = {}, - iframe, iframeDoc, - rfxtypes = /^(?:toggle|show|hide)$/, - rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, - timerId, - fxAttrs = [ - // height animations - [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], - // width animations - [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], - // opacity animations - [ "opacity" ] - ], - fxNow; - -jQuery.fn.extend({ - show: function( speed, easing, callback ) { - var elem, display; - - if ( speed || speed === 0 ) { - return this.animate( genFx("show", 3), speed, easing, callback ); - - } else { - for ( var i = 0, j = this.length; i < j; i++ ) { - elem = this[ i ]; - - if ( elem.style ) { - display = elem.style.display; - - // Reset the inline display of this element to learn if it is - // being hidden by cascaded rules or not - if ( !jQuery._data(elem, "olddisplay") && display === "none" ) { - display = elem.style.display = ""; - } - - // Set elements which have been overridden with display: none - // in a stylesheet to whatever the default browser style is - // for such an element - if ( display === "" && jQuery.css(elem, "display") === "none" ) { - jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); - } - } - } - - // Set the display of most of the elements in a second loop - // to avoid the constant reflow - for ( i = 0; i < j; i++ ) { - elem = this[ i ]; - - if ( elem.style ) { - display = elem.style.display; - - if ( display === "" || display === "none" ) { - elem.style.display = jQuery._data( elem, "olddisplay" ) || ""; - } - } - } - - return this; - } - }, - - hide: function( speed, easing, callback ) { - if ( speed || speed === 0 ) { - return this.animate( genFx("hide", 3), speed, easing, callback); - - } else { - var elem, display, - i = 0, - j = this.length; - - for ( ; i < j; i++ ) { - elem = this[i]; - if ( elem.style ) { - display = jQuery.css( elem, "display" ); - - if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) { - jQuery._data( elem, "olddisplay", display ); - } - } - } - - // Set the display of the elements in a second loop - // to avoid the constant reflow - for ( i = 0; i < j; i++ ) { - if ( this[i].style ) { - this[i].style.display = "none"; - } - } - - return this; - } - }, - - // Save the old toggle function - _toggle: jQuery.fn.toggle, - - toggle: function( fn, fn2, callback ) { - var bool = typeof fn === "boolean"; - - if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) { - this._toggle.apply( this, arguments ); - - } else if ( fn == null || bool ) { - this.each(function() { - var state = bool ? fn : jQuery(this).is(":hidden"); - jQuery(this)[ state ? "show" : "hide" ](); - }); - - } else { - this.animate(genFx("toggle", 3), fn, fn2, callback); - } - - return this; - }, - - fadeTo: function( speed, to, easing, callback ) { - return this.filter(":hidden").css("opacity", 0).show().end() - .animate({opacity: to}, speed, easing, callback); - }, - - animate: function( prop, speed, easing, callback ) { - var optall = jQuery.speed( speed, easing, callback ); - - if ( jQuery.isEmptyObject( prop ) ) { - return this.each( optall.complete, [ false ] ); - } - - // Do not change referenced properties as per-property easing will be lost - prop = jQuery.extend( {}, prop ); - - function doAnimation() { - // XXX 'this' does not always have a nodeName when running the - // test suite - - if ( optall.queue === false ) { - jQuery._mark( this ); - } - - var opt = jQuery.extend( {}, optall ), - isElement = this.nodeType === 1, - hidden = isElement && jQuery(this).is(":hidden"), - name, val, p, e, - parts, start, end, unit, - method; - - // will store per property easing and be used to determine when an animation is complete - opt.animatedProperties = {}; - - for ( p in prop ) { - - // property name normalization - name = jQuery.camelCase( p ); - if ( p !== name ) { - prop[ name ] = prop[ p ]; - delete prop[ p ]; - } - - val = prop[ name ]; - - // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default) - if ( jQuery.isArray( val ) ) { - opt.animatedProperties[ name ] = val[ 1 ]; - val = prop[ name ] = val[ 0 ]; - } else { - opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing'; - } - - if ( val === "hide" && hidden || val === "show" && !hidden ) { - return opt.complete.call( this ); - } - - if ( isElement && ( name === "height" || name === "width" ) ) { - // Make sure that nothing sneaks out - // Record all 3 overflow attributes because IE does not - // change the overflow attribute when overflowX and - // overflowY are set to the same value - opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ]; - - // Set display property to inline-block for height/width - // animations on inline elements that are having width/height animated - if ( jQuery.css( this, "display" ) === "inline" && - jQuery.css( this, "float" ) === "none" ) { - - // inline-level elements accept inline-block; - // block-level elements need to be inline with layout - if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) { - this.style.display = "inline-block"; - - } else { - this.style.zoom = 1; - } - } - } - } - - if ( opt.overflow != null ) { - this.style.overflow = "hidden"; - } - - for ( p in prop ) { - e = new jQuery.fx( this, opt, p ); - val = prop[ p ]; - - if ( rfxtypes.test( val ) ) { - - // Tracks whether to show or hide based on private - // data attached to the element - method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 ); - if ( method ) { - jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" ); - e[ method ](); - } else { - e[ val ](); - } - - } else { - parts = rfxnum.exec( val ); - start = e.cur(); - - if ( parts ) { - end = parseFloat( parts[2] ); - unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" ); - - // We need to compute starting value - if ( unit !== "px" ) { - jQuery.style( this, p, (end || 1) + unit); - start = ( (end || 1) / e.cur() ) * start; - jQuery.style( this, p, start + unit); - } - - // If a +=/-= token was provided, we're doing a relative animation - if ( parts[1] ) { - end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start; - } - - e.custom( start, end, unit ); - - } else { - e.custom( start, val, "" ); - } - } - } - - // For JS strict compliance - return true; - } - - return optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - - stop: function( type, clearQueue, gotoEnd ) { - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue && type !== false ) { - this.queue( type || "fx", [] ); - } - - return this.each(function() { - var index, - hadTimers = false, - timers = jQuery.timers, - data = jQuery._data( this ); - - // clear marker counters if we know they won't be - if ( !gotoEnd ) { - jQuery._unmark( true, this ); - } - - function stopQueue( elem, data, index ) { - var hooks = data[ index ]; - jQuery.removeData( elem, index, true ); - hooks.stop( gotoEnd ); - } - - if ( type == null ) { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) { - stopQueue( this, data, index ); - } - } - } else if ( data[ index = type + ".run" ] && data[ index ].stop ){ - stopQueue( this, data, index ); - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { - if ( gotoEnd ) { - - // force the next step to be the last - timers[ index ]( true ); - } else { - timers[ index ].saveState(); - } - hadTimers = true; - timers.splice( index, 1 ); - } - } - - // start the next in the queue if the last step wasn't forced - // timers currently will call their complete callbacks, which will dequeue - // but only if they were gotoEnd - if ( !( gotoEnd && hadTimers ) ) { - jQuery.dequeue( this, type ); - } - }); - } - -}); - -// Animations created synchronously will run synchronously -function createFxNow() { - setTimeout( clearFxNow, 0 ); - return ( fxNow = jQuery.now() ); -} - -function clearFxNow() { - fxNow = undefined; -} - -// Generate parameters to create a standard animation -function genFx( type, num ) { - var obj = {}; - - jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() { - obj[ this ] = type; - }); - - return obj; -} - -// Generate shortcuts for custom animations -jQuery.each({ - slideDown: genFx( "show", 1 ), - slideUp: genFx( "hide", 1 ), - slideToggle: genFx( "toggle", 1 ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -}); - -jQuery.extend({ - speed: function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - jQuery.isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing - }; - - opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : - opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; - - // normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function( noUnmark ) { - if ( jQuery.isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } else if ( noUnmark !== false ) { - jQuery._unmark( this ); - } - }; - - return opt; - }, - - easing: { - linear: function( p, n, firstNum, diff ) { - return firstNum + diff * p; - }, - swing: function( p, n, firstNum, diff ) { - return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum; - } - }, - - timers: [], - - fx: function( elem, options, prop ) { - this.options = options; - this.elem = elem; - this.prop = prop; - - options.orig = options.orig || {}; - } - -}); - -jQuery.fx.prototype = { - // Simple function for setting a style value - update: function() { - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this ); - }, - - // Get the current size - cur: function() { - if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) { - return this.elem[ this.prop ]; - } - - var parsed, - r = jQuery.css( this.elem, this.prop ); - // Empty strings, null, undefined and "auto" are converted to 0, - // complex values such as "rotate(1rad)" are returned as is, - // simple values such as "10px" are parsed to Float. - return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed; - }, - - // Start an animation from one number to another - custom: function( from, to, unit ) { - var self = this, - fx = jQuery.fx; - - this.startTime = fxNow || createFxNow(); - this.end = to; - this.now = this.start = from; - this.pos = this.state = 0; - this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" ); - - function t( gotoEnd ) { - return self.step( gotoEnd ); - } - - t.queue = this.options.queue; - t.elem = this.elem; - t.saveState = function() { - if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) { - jQuery._data( self.elem, "fxshow" + self.prop, self.start ); - } - }; - - if ( t() && jQuery.timers.push(t) && !timerId ) { - timerId = setInterval( fx.tick, fx.interval ); - } - }, - - // Simple 'show' function - show: function() { - var dataShow = jQuery._data( this.elem, "fxshow" + this.prop ); - - // Remember where we started, so that we can go back to it later - this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop ); - this.options.show = true; - - // Begin the animation - // Make sure that we start at a small width/height to avoid any flash of content - if ( dataShow !== undefined ) { - // This show is picking up where a previous hide or show left off - this.custom( this.cur(), dataShow ); - } else { - this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() ); - } - - // Start by showing the element - jQuery( this.elem ).show(); - }, - - // Simple 'hide' function - hide: function() { - // Remember where we started, so that we can go back to it later - this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop ); - this.options.hide = true; - - // Begin the animation - this.custom( this.cur(), 0 ); - }, - - // Each step of an animation - step: function( gotoEnd ) { - var p, n, complete, - t = fxNow || createFxNow(), - done = true, - elem = this.elem, - options = this.options; - - if ( gotoEnd || t >= options.duration + this.startTime ) { - this.now = this.end; - this.pos = this.state = 1; - this.update(); - - options.animatedProperties[ this.prop ] = true; - - for ( p in options.animatedProperties ) { - if ( options.animatedProperties[ p ] !== true ) { - done = false; - } - } - - if ( done ) { - // Reset the overflow - if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) { - - jQuery.each( [ "", "X", "Y" ], function( index, value ) { - elem.style[ "overflow" + value ] = options.overflow[ index ]; - }); - } - - // Hide the element if the "hide" operation was done - if ( options.hide ) { - jQuery( elem ).hide(); - } - - // Reset the properties, if the item has been hidden or shown - if ( options.hide || options.show ) { - for ( p in options.animatedProperties ) { - jQuery.style( elem, p, options.orig[ p ] ); - jQuery.removeData( elem, "fxshow" + p, true ); - // Toggle data is no longer needed - jQuery.removeData( elem, "toggle" + p, true ); - } - } - - // Execute the complete function - // in the event that the complete function throws an exception - // we must ensure it won't be called twice. #5684 - - complete = options.complete; - if ( complete ) { - - options.complete = false; - complete.call( elem ); - } - } - - return false; - - } else { - // classical easing cannot be used with an Infinity duration - if ( options.duration == Infinity ) { - this.now = t; - } else { - n = t - this.startTime; - this.state = n / options.duration; - - // Perform the easing function, defaults to swing - this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration ); - this.now = this.start + ( (this.end - this.start) * this.pos ); - } - // Perform the next step of the animation - this.update(); - } - - return true; - } -}; - -jQuery.extend( jQuery.fx, { - tick: function() { - var timer, - timers = jQuery.timers, - i = 0; - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - // Checks the timer has not already been removed - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - }, - - interval: 13, - - stop: function() { - clearInterval( timerId ); - timerId = null; - }, - - speeds: { - slow: 600, - fast: 200, - // Default speed - _default: 400 - }, - - step: { - opacity: function( fx ) { - jQuery.style( fx.elem, "opacity", fx.now ); - }, - - _default: function( fx ) { - if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) { - fx.elem.style[ fx.prop ] = fx.now + fx.unit; - } else { - fx.elem[ fx.prop ] = fx.now; - } - } - } -}); - -// Adds width/height step functions -// Do not set anything below 0 -jQuery.each([ "width", "height" ], function( i, prop ) { - jQuery.fx.step[ prop ] = function( fx ) { - jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit ); - }; -}); - -if ( jQuery.expr && jQuery.expr.filters ) { - jQuery.expr.filters.animated = function( elem ) { - return jQuery.grep(jQuery.timers, function( fn ) { - return elem === fn.elem; - }).length; - }; -} - -// Try to restore the default display value of an element -function defaultDisplay( nodeName ) { - - if ( !elemdisplay[ nodeName ] ) { - - var body = document.body, - elem = jQuery( "<" + nodeName + ">" ).appendTo( body ), - display = elem.css( "display" ); - elem.remove(); - - // If the simple way fails, - // get element's real default display by attaching it to a temp iframe - if ( display === "none" || display === "" ) { - // No iframe to use yet, so create it - if ( !iframe ) { - iframe = document.createElement( "iframe" ); - iframe.frameBorder = iframe.width = iframe.height = 0; - } - - body.appendChild( iframe ); - - // Create a cacheable copy of the iframe document on first call. - // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML - // document to it; WebKit & Firefox won't allow reusing the iframe document. - if ( !iframeDoc || !iframe.createElement ) { - iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; - iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" ); - iframeDoc.close(); - } - - elem = iframeDoc.createElement( nodeName ); - - iframeDoc.body.appendChild( elem ); - - display = jQuery.css( elem, "display" ); - body.removeChild( iframe ); - } - - // Store the correct default display - elemdisplay[ nodeName ] = display; - } - - return elemdisplay[ nodeName ]; -} - - - - -var rtable = /^t(?:able|d|h)$/i, - rroot = /^(?:body|html)$/i; - -if ( "getBoundingClientRect" in document.documentElement ) { - jQuery.fn.offset = function( options ) { - var elem = this[0], box; - - if ( options ) { - return this.each(function( i ) { - jQuery.offset.setOffset( this, options, i ); - }); - } - - if ( !elem || !elem.ownerDocument ) { - return null; - } - - if ( elem === elem.ownerDocument.body ) { - return jQuery.offset.bodyOffset( elem ); - } - - try { - box = elem.getBoundingClientRect(); - } catch(e) {} - - var doc = elem.ownerDocument, - docElem = doc.documentElement; - - // Make sure we're not dealing with a disconnected DOM node - if ( !box || !jQuery.contains( docElem, elem ) ) { - return box ? { top: box.top, left: box.left } : { top: 0, left: 0 }; - } - - var body = doc.body, - win = getWindow(doc), - clientTop = docElem.clientTop || body.clientTop || 0, - clientLeft = docElem.clientLeft || body.clientLeft || 0, - scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop, - scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft, - top = box.top + scrollTop - clientTop, - left = box.left + scrollLeft - clientLeft; - - return { top: top, left: left }; - }; - -} else { - jQuery.fn.offset = function( options ) { - var elem = this[0]; - - if ( options ) { - return this.each(function( i ) { - jQuery.offset.setOffset( this, options, i ); - }); - } - - if ( !elem || !elem.ownerDocument ) { - return null; - } - - if ( elem === elem.ownerDocument.body ) { - return jQuery.offset.bodyOffset( elem ); - } - - var computedStyle, - offsetParent = elem.offsetParent, - prevOffsetParent = elem, - doc = elem.ownerDocument, - docElem = doc.documentElement, - body = doc.body, - defaultView = doc.defaultView, - prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, - top = elem.offsetTop, - left = elem.offsetLeft; - - while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { - if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) { - break; - } - - computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; - top -= elem.scrollTop; - left -= elem.scrollLeft; - - if ( elem === offsetParent ) { - top += elem.offsetTop; - left += elem.offsetLeft; - - if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) { - top += parseFloat( computedStyle.borderTopWidth ) || 0; - left += parseFloat( computedStyle.borderLeftWidth ) || 0; - } - - prevOffsetParent = offsetParent; - offsetParent = elem.offsetParent; - } - - if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { - top += parseFloat( computedStyle.borderTopWidth ) || 0; - left += parseFloat( computedStyle.borderLeftWidth ) || 0; - } - - prevComputedStyle = computedStyle; - } - - if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) { - top += body.offsetTop; - left += body.offsetLeft; - } - - if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) { - top += Math.max( docElem.scrollTop, body.scrollTop ); - left += Math.max( docElem.scrollLeft, body.scrollLeft ); - } - - return { top: top, left: left }; - }; -} - -jQuery.offset = { - - bodyOffset: function( body ) { - var top = body.offsetTop, - left = body.offsetLeft; - - if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) { - top += parseFloat( jQuery.css(body, "marginTop") ) || 0; - left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; - } - - return { top: top, left: left }; - }, - - setOffset: function( elem, options, i ) { - var position = jQuery.css( elem, "position" ); - - // set position first, in-case top/left are set even on static elem - if ( position === "static" ) { - elem.style.position = "relative"; - } - - var curElem = jQuery( elem ), - curOffset = curElem.offset(), - curCSSTop = jQuery.css( elem, "top" ), - curCSSLeft = jQuery.css( elem, "left" ), - calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, - props = {}, curPosition = {}, curTop, curLeft; - - // need to be able to calculate position if either top or left is auto and position is either absolute or fixed - if ( calculatePosition ) { - curPosition = curElem.position(); - curTop = curPosition.top; - curLeft = curPosition.left; - } else { - curTop = parseFloat( curCSSTop ) || 0; - curLeft = parseFloat( curCSSLeft ) || 0; - } - - if ( jQuery.isFunction( options ) ) { - options = options.call( elem, i, curOffset ); - } - - if ( options.top != null ) { - props.top = ( options.top - curOffset.top ) + curTop; - } - if ( options.left != null ) { - props.left = ( options.left - curOffset.left ) + curLeft; - } - - if ( "using" in options ) { - options.using.call( elem, props ); - } else { - curElem.css( props ); - } - } -}; - - -jQuery.fn.extend({ - - position: function() { - if ( !this[0] ) { - return null; - } - - var elem = this[0], - - // Get *real* offsetParent - offsetParent = this.offsetParent(), - - // Get correct offsets - offset = this.offset(), - parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); - - // Subtract element margins - // note: when an element has margin: auto the offsetLeft and marginLeft - // are the same in Safari causing offset.left to incorrectly be 0 - offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; - offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; - - // Add offsetParent borders - parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; - parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; - - // Subtract the two offsets - return { - top: offset.top - parentOffset.top, - left: offset.left - parentOffset.left - }; - }, - - offsetParent: function() { - return this.map(function() { - var offsetParent = this.offsetParent || document.body; - while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { - offsetParent = offsetParent.offsetParent; - } - return offsetParent; - }); - } -}); - - -// Create scrollLeft and scrollTop methods -jQuery.each( ["Left", "Top"], function( i, name ) { - var method = "scroll" + name; - - jQuery.fn[ method ] = function( val ) { - var elem, win; - - if ( val === undefined ) { - elem = this[ 0 ]; - - if ( !elem ) { - return null; - } - - win = getWindow( elem ); - - // Return the scroll offset - return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] : - jQuery.support.boxModel && win.document.documentElement[ method ] || - win.document.body[ method ] : - elem[ method ]; - } - - // Set the scroll offset - return this.each(function() { - win = getWindow( this ); - - if ( win ) { - win.scrollTo( - !i ? val : jQuery( win ).scrollLeft(), - i ? val : jQuery( win ).scrollTop() - ); - - } else { - this[ method ] = val; - } - }); - }; -}); - -function getWindow( elem ) { - return jQuery.isWindow( elem ) ? - elem : - elem.nodeType === 9 ? - elem.defaultView || elem.parentWindow : - false; -} - - - - -// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods -jQuery.each([ "Height", "Width" ], function( i, name ) { - - var type = name.toLowerCase(); - - // innerHeight and innerWidth - jQuery.fn[ "inner" + name ] = function() { - var elem = this[0]; - return elem ? - elem.style ? - parseFloat( jQuery.css( elem, type, "padding" ) ) : - this[ type ]() : - null; - }; - - // outerHeight and outerWidth - jQuery.fn[ "outer" + name ] = function( margin ) { - var elem = this[0]; - return elem ? - elem.style ? - parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) : - this[ type ]() : - null; - }; - - jQuery.fn[ type ] = function( size ) { - // Get window width or height - var elem = this[0]; - if ( !elem ) { - return size == null ? null : this; - } - - if ( jQuery.isFunction( size ) ) { - return this.each(function( i ) { - var self = jQuery( this ); - self[ type ]( size.call( this, i, self[ type ]() ) ); - }); - } - - if ( jQuery.isWindow( elem ) ) { - // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode - // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat - var docElemProp = elem.document.documentElement[ "client" + name ], - body = elem.document.body; - return elem.document.compatMode === "CSS1Compat" && docElemProp || - body && body[ "client" + name ] || docElemProp; - - // Get document width or height - } else if ( elem.nodeType === 9 ) { - // Either scroll[Width/Height] or offset[Width/Height], whichever is greater - return Math.max( - elem.documentElement["client" + name], - elem.body["scroll" + name], elem.documentElement["scroll" + name], - elem.body["offset" + name], elem.documentElement["offset" + name] - ); - - // Get or set width or height on the element - } else if ( size === undefined ) { - var orig = jQuery.css( elem, type ), - ret = parseFloat( orig ); - - return jQuery.isNumeric( ret ) ? ret : orig; - - // Set the width or height on the element (default to pixels if value is unitless) - } else { - return this.css( type, typeof size === "string" ? size : size + "px" ); - } - }; - -}); - - - - -// Expose jQuery to the global object -window.jQuery = window.$ = jQuery; - -// Expose jQuery as an AMD module, but only for AMD loaders that -// understand the issues with loading multiple versions of jQuery -// in a page that all might call define(). The loader will indicate -// they have special allowances for multiple jQuery versions by -// specifying define.amd.jQuery = true. Register as a named module, -// since jQuery can be concatenated with other files that may use define, -// but not use a proper concatenation script that understands anonymous -// AMD modules. A named AMD is safest and most robust way to register. -// Lowercase jquery is used because AMD module names are derived from -// file names, and jQuery is normally delivered in a lowercase file name. -// Do this after creating the global so that if an AMD module wants to call -// noConflict to hide this version of jQuery, it will work. -if ( typeof define === "function" && define.amd && define.amd.jQuery ) { - define( "jquery", [], function () { return jQuery; } ); -} - - - -})( window ); diff --git a/library/jslider/js/jquery.dependClass-0.1.js b/library/jslider/js/jquery.dependClass-0.1.js deleted file mode 100644 index 2636f6673..000000000 --- a/library/jslider/js/jquery.dependClass-0.1.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * jquery.dependClass - Attach class based on first class in list of current element - * - * Written by - * Egor Khmelev (hmelyoff@gmail.com) - * - * Licensed under the MIT (MIT-LICENSE.txt). - * - * @author Egor Khmelev - * @version 0.1.0-BETA ($Id$) - * - **/ - -(function($) { - $.baseClass = function(obj){ - obj = $(obj); - return obj.get(0).className.match(/([^ ]+)/)[1]; - }; - - $.fn.addDependClass = function(className, delimiter){ - var options = { - delimiter: delimiter ? delimiter : '-' - } - return this.each(function(){ - var baseClass = $.baseClass(this); - if(baseClass) - $(this).addClass(baseClass + options.delimiter + className); - }); - }; - - $.fn.removeDependClass = function(className, delimiter){ - var options = { - delimiter: delimiter ? delimiter : '-' - } - return this.each(function(){ - var baseClass = $.baseClass(this); - if(baseClass) - $(this).removeClass(baseClass + options.delimiter + className); - }); - }; - - $.fn.toggleDependClass = function(className, delimiter){ - var options = { - delimiter: delimiter ? delimiter : '-' - } - return this.each(function(){ - var baseClass = $.baseClass(this); - if(baseClass) - if($(this).is("." + baseClass + options.delimiter + className)) - $(this).removeClass(baseClass + options.delimiter + className); - else - $(this).addClass(baseClass + options.delimiter + className); - }); - }; - -})(jQuery);
\ No newline at end of file diff --git a/library/jslider/js/jquery.numberformatter-1.2.3.js b/library/jslider/js/jquery.numberformatter-1.2.3.js deleted file mode 100644 index 213db297a..000000000 --- a/library/jslider/js/jquery.numberformatter-1.2.3.js +++ /dev/null @@ -1,510 +0,0 @@ -/**
- * jquery.numberformatter - Formatting/Parsing Numbers in jQuery
- *
- * Written by
- * Michael Abernethy (mike@abernethysoft.com),
- * Andrew Parry (aparry0@gmail.com)
- *
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * @author Michael Abernethy, Andrew Parry
- * @version 1.2.3-SNAPSHOT ($Id$)
- *
- * Dependencies
- *
- * jQuery (http://jquery.com)
- * jshashtable (http://www.timdown.co.uk/jshashtable)
- *
- * Notes & Thanks
- *
- * many thanks to advweb.nanasi.jp for his bug fixes
- * jsHashtable is now used also, so thanks to the author for that excellent little class.
- *
- * This plugin can be used to format numbers as text and parse text as Numbers
- * Because we live in an international world, we cannot assume that everyone
- * uses "," to divide thousands, and "." as a decimal point.
- *
- * As of 1.2 the way this plugin works has changed slightly, parsing text to a number
- * has 1 set of functions, formatting a number to text has it's own. Before things
- * were a little confusing, so I wanted to separate the 2 out more.
- *
- *
- * jQuery extension functions:
- *
- * formatNumber(options, writeBack, giveReturnValue) - Reads the value from the subject, parses to
- * a Javascript Number object, then formats back to text using the passed options and write back to
- * the subject.
- *
- * parseNumber(options) - Parses the value in the subject to a Number object using the passed options
- * to decipher the actual number from the text, then writes the value as text back to the subject.
- *
- *
- * Generic functions:
- *
- * formatNumber(numberString, options) - Takes a plain number as a string (e.g. '1002.0123') and returns
- * a string of the given format options.
- *
- * parseNumber(numberString, options) - Takes a number as text that is formatted the same as the given
- * options then and returns it as a plain Number object.
- *
- * To achieve the old way of combining parsing and formatting to keep say a input field always formatted
- * to a given format after it has lost focus you'd simply use a combination of the functions.
- *
- * e.g.
- * $("#salary").blur(function(){
- * $(this).parseNumber({format:"#,###.00", locale:"us"});
- * $(this).formatNumber({format:"#,###.00", locale:"us"});
- * });
- *
- * The syntax for the formatting is:
- * 0 = Digit
- * # = Digit, zero shows as absent
- * . = Decimal separator
- * - = Negative sign
- * , = Grouping Separator
- * % = Percent (multiplies the number by 100)
- *
- * For example, a format of "#,###.00" and text of 4500.20 will
- * display as "4.500,20" with a locale of "de", and "4,500.20" with a locale of "us"
- *
- *
- * As of now, the only acceptable locales are
- * Arab Emirates -> "ae"
- * Australia -> "au"
- * Austria -> "at"
- * Brazil -> "br"
- * Canada -> "ca"
- * China -> "cn"
- * Czech -> "cz"
- * Denmark -> "dk"
- * Egypt -> "eg"
- * Finland -> "fi"
- * France -> "fr"
- * Germany -> "de"
- * Greece -> "gr"
- * Great Britain -> "gb"
- * Hong Kong -> "hk"
- * India -> "in"
- * Israel -> "il"
- * Japan -> "jp"
- * Russia -> "ru"
- * South Korea -> "kr"
- * Spain -> "es"
- * Sweden -> "se"
- * Switzerland -> "ch"
- * Taiwan -> "tw"
- * Thailand -> "th"
- * United States -> "us"
- * Vietnam -> "vn"
- **/
-
-(function(jQuery) {
-
- var nfLocales = new Hashtable();
-
- var nfLocalesLikeUS = [ 'ae','au','ca','cn','eg','gb','hk','il','in','jp','sk','th','tw','us' ];
- var nfLocalesLikeDE = [ 'at','br','de','dk','es','gr','it','nl','pt','tr','vn' ];
- var nfLocalesLikeFR = [ 'cz','fi','fr','ru','se','pl' ];
- var nfLocalesLikeCH = [ 'ch' ];
-
- var nfLocaleFormatting = [ [".", ","], [",", "."], [",", " "], [".", "'"] ];
- var nfAllLocales = [ nfLocalesLikeUS, nfLocalesLikeDE, nfLocalesLikeFR, nfLocalesLikeCH ]
-
- function FormatData(dec, group, neg) {
- this.dec = dec;
- this.group = group;
- this.neg = neg;
- };
-
- function init() {
- // write the arrays into the hashtable
- for (var localeGroupIdx = 0; localeGroupIdx < nfAllLocales.length; localeGroupIdx++) {
- localeGroup = nfAllLocales[localeGroupIdx];
- for (var i = 0; i < localeGroup.length; i++) {
- nfLocales.put(localeGroup[i], localeGroupIdx);
- }
- }
- };
-
- function formatCodes(locale, isFullLocale) {
- if (nfLocales.size() == 0)
- init();
-
- // default values
- var dec = ".";
- var group = ",";
- var neg = "-";
-
- if (isFullLocale == false) {
- // Extract and convert to lower-case any language code from a real 'locale' formatted string, if not use as-is
- // (To prevent locale format like : "fr_FR", "en_US", "de_DE", "fr_FR", "en-US", "de-DE")
- if (locale.indexOf('_') != -1)
- locale = locale.split('_')[1].toLowerCase();
- else if (locale.indexOf('-') != -1)
- locale = locale.split('-')[1].toLowerCase();
- }
-
- // hashtable lookup to match locale with codes
- var codesIndex = nfLocales.get(locale);
- if (codesIndex) {
- var codes = nfLocaleFormatting[codesIndex];
- if (codes) {
- dec = codes[0];
- group = codes[1];
- }
- }
- return new FormatData(dec, group, neg);
- };
-
-
- /* Formatting Methods */
-
-
- /**
- * Formats anything containing a number in standard js number notation.
- *
- * @param {Object} options The formatting options to use
- * @param {Boolean} writeBack (true) If the output value should be written back to the subject
- * @param {Boolean} giveReturnValue (true) If the function should return the output string
- */
- jQuery.fn.formatNumber = function(options, writeBack, giveReturnValue) {
-
- return this.each(function() {
- // enforce defaults
- if (writeBack == null)
- writeBack = true;
- if (giveReturnValue == null)
- giveReturnValue = true;
-
- // get text
- var text;
- if (jQuery(this).is(":input"))
- text = new String(jQuery(this).val());
- else
- text = new String(jQuery(this).text());
-
- // format
- var returnString = jQuery.formatNumber(text, options);
-
- // set formatted string back, only if a success
-// if (returnString) {
- if (writeBack) {
- if (jQuery(this).is(":input"))
- jQuery(this).val(returnString);
- else
- jQuery(this).text(returnString);
- }
- if (giveReturnValue)
- return returnString;
-// }
-// return '';
- });
- };
-
- /**
- * First parses a string and reformats it with the given options.
- *
- * @param {Object} numberString
- * @param {Object} options
- */
- jQuery.formatNumber = function(numberString, options){
- var options = jQuery.extend({}, jQuery.fn.formatNumber.defaults, options);
- var formatData = formatCodes(options.locale.toLowerCase(), options.isFullLocale);
-
- var dec = formatData.dec;
- var group = formatData.group;
- var neg = formatData.neg;
-
- var validFormat = "0#-,.";
-
- // strip all the invalid characters at the beginning and the end
- // of the format, and we'll stick them back on at the end
- // make a special case for the negative sign "-" though, so
- // we can have formats like -$23.32
- var prefix = "";
- var negativeInFront = false;
- for (var i = 0; i < options.format.length; i++) {
- if (validFormat.indexOf(options.format.charAt(i)) == -1)
- prefix = prefix + options.format.charAt(i);
- else
- if (i == 0 && options.format.charAt(i) == '-') {
- negativeInFront = true;
- continue;
- }
- else
- break;
- }
- var suffix = "";
- for (var i = options.format.length - 1; i >= 0; i--) {
- if (validFormat.indexOf(options.format.charAt(i)) == -1)
- suffix = options.format.charAt(i) + suffix;
- else
- break;
- }
-
- options.format = options.format.substring(prefix.length);
- options.format = options.format.substring(0, options.format.length - suffix.length);
-
- // now we need to convert it into a number
- //while (numberString.indexOf(group) > -1)
- // numberString = numberString.replace(group, '');
- //var number = new Number(numberString.replace(dec, ".").replace(neg, "-"));
- var number = new Number(numberString);
-
- return jQuery._formatNumber(number, options, suffix, prefix, negativeInFront);
- };
-
- /**
- * Formats a Number object into a string, using the given formatting options
- *
- * @param {Object} numberString
- * @param {Object} options
- */
- jQuery._formatNumber = function(number, options, suffix, prefix, negativeInFront) {
- var options = jQuery.extend({}, jQuery.fn.formatNumber.defaults, options);
- var formatData = formatCodes(options.locale.toLowerCase(), options.isFullLocale);
-
- var dec = formatData.dec;
- var group = formatData.group;
- var neg = formatData.neg;
-
- var forcedToZero = false;
- if (isNaN(number)) {
- if (options.nanForceZero == true) {
- number = 0;
- forcedToZero = true;
- } else
- return null;
- }
-
- // special case for percentages
- if (suffix == "%")
- number = number * 100;
-
- var returnString = "";
- if (options.format.indexOf(".") > -1) {
- var decimalPortion = dec;
- var decimalFormat = options.format.substring(options.format.lastIndexOf(".") + 1);
-
- // round or truncate number as needed
- if (options.round == true)
- number = new Number(number.toFixed(decimalFormat.length));
- else {
- var numStr = number.toString();
- numStr = numStr.substring(0, numStr.lastIndexOf('.') + decimalFormat.length + 1);
- number = new Number(numStr);
- }
-
- var decimalValue = number % 1;
- var decimalString = new String(decimalValue.toFixed(decimalFormat.length));
- decimalString = decimalString.substring(decimalString.lastIndexOf(".") + 1);
-
- for (var i = 0; i < decimalFormat.length; i++) {
- if (decimalFormat.charAt(i) == '#' && decimalString.charAt(i) != '0') {
- decimalPortion += decimalString.charAt(i);
- continue;
- } else if (decimalFormat.charAt(i) == '#' && decimalString.charAt(i) == '0') {
- var notParsed = decimalString.substring(i);
- if (notParsed.match('[1-9]')) {
- decimalPortion += decimalString.charAt(i);
- continue;
- } else
- break;
- } else if (decimalFormat.charAt(i) == "0")
- decimalPortion += decimalString.charAt(i);
- }
- returnString += decimalPortion
- } else
- number = Math.round(number);
-
- var ones = Math.floor(number);
- if (number < 0)
- ones = Math.ceil(number);
-
- var onesFormat = "";
- if (options.format.indexOf(".") == -1)
- onesFormat = options.format;
- else
- onesFormat = options.format.substring(0, options.format.indexOf("."));
-
- var onePortion = "";
- if (!(ones == 0 && onesFormat.substr(onesFormat.length - 1) == '#') || forcedToZero) {
- // find how many digits are in the group
- var oneText = new String(Math.abs(ones));
- var groupLength = 9999;
- if (onesFormat.lastIndexOf(",") != -1)
- groupLength = onesFormat.length - onesFormat.lastIndexOf(",") - 1;
- var groupCount = 0;
- for (var i = oneText.length - 1; i > -1; i--) {
- onePortion = oneText.charAt(i) + onePortion;
- groupCount++;
- if (groupCount == groupLength && i != 0) {
- onePortion = group + onePortion;
- groupCount = 0;
- }
- }
-
- // account for any pre-data padding
- if (onesFormat.length > onePortion.length) {
- var padStart = onesFormat.indexOf('0');
- if (padStart != -1) {
- var padLen = onesFormat.length - padStart;
-
- // pad to left with 0's or group char
- var pos = onesFormat.length - onePortion.length - 1;
- while (onePortion.length < padLen) {
- var padChar = onesFormat.charAt(pos);
- // replace with real group char if needed
- if (padChar == ',')
- padChar = group;
- onePortion = padChar + onePortion;
- pos--;
- }
- }
- }
- }
-
- if (!onePortion && onesFormat.indexOf('0', onesFormat.length - 1) !== -1)
- onePortion = '0';
-
- returnString = onePortion + returnString;
-
- // handle special case where negative is in front of the invalid characters
- if (number < 0 && negativeInFront && prefix.length > 0)
- prefix = neg + prefix;
- else if (number < 0)
- returnString = neg + returnString;
-
- if (!options.decimalSeparatorAlwaysShown) {
- if (returnString.lastIndexOf(dec) == returnString.length - 1) {
- returnString = returnString.substring(0, returnString.length - 1);
- }
- }
- returnString = prefix + returnString + suffix;
- return returnString;
- };
-
-
- /* Parsing Methods */
-
-
- /**
- * Parses a number of given format from the element and returns a Number object.
- * @param {Object} options
- */
- jQuery.fn.parseNumber = function(options, writeBack, giveReturnValue) {
- // enforce defaults
- if (writeBack == null)
- writeBack = true;
- if (giveReturnValue == null)
- giveReturnValue = true;
-
- // get text
- var text;
- if (jQuery(this).is(":input"))
- text = new String(jQuery(this).val());
- else
- text = new String(jQuery(this).text());
-
- // parse text
- var number = jQuery.parseNumber(text, options);
-
- if (number) {
- if (writeBack) {
- if (jQuery(this).is(":input"))
- jQuery(this).val(number.toString());
- else
- jQuery(this).text(number.toString());
- }
- if (giveReturnValue)
- return number;
- }
- };
-
- /**
- * Parses a string of given format into a Number object.
- *
- * @param {Object} string
- * @param {Object} options
- */
- jQuery.parseNumber = function(numberString, options) {
- var options = jQuery.extend({}, jQuery.fn.parseNumber.defaults, options);
- var formatData = formatCodes(options.locale.toLowerCase(), options.isFullLocale);
-
- var dec = formatData.dec;
- var group = formatData.group;
- var neg = formatData.neg;
-
- var valid = "1234567890.-";
-
- // now we need to convert it into a number
- while (numberString.indexOf(group)>-1)
- numberString = numberString.replace(group,'');
- numberString = numberString.replace(dec,".").replace(neg,"-");
- var validText = "";
- var hasPercent = false;
- if (numberString.charAt(numberString.length - 1) == "%" || options.isPercentage == true)
- hasPercent = true;
- for (var i=0; i<numberString.length; i++) {
- if (valid.indexOf(numberString.charAt(i))>-1)
- validText = validText + numberString.charAt(i);
- }
- var number = new Number(validText);
- if (hasPercent) {
- number = number / 100;
- var decimalPos = validText.indexOf('.');
- if (decimalPos != -1) {
- var decimalPoints = validText.length - decimalPos - 1;
- number = number.toFixed(decimalPoints + 2);
- } else {
- number = number.toFixed(validText.length - 1);
- }
- }
-
- return number;
- };
-
- jQuery.fn.parseNumber.defaults = {
- locale: "us",
- decimalSeparatorAlwaysShown: false,
- isPercentage: false,
- isFullLocale: false
- };
-
- jQuery.fn.formatNumber.defaults = {
- format: "#,###.00",
- locale: "us",
- decimalSeparatorAlwaysShown: false,
- nanForceZero: true,
- round: true,
- isFullLocale: false
- };
-
- Number.prototype.toFixed = function(precision) {
- return jQuery._roundNumber(this, precision);
- };
-
- jQuery._roundNumber = function(number, decimalPlaces) {
- var power = Math.pow(10, decimalPlaces || 0);
- var value = String(Math.round(number * power) / power);
-
- // ensure the decimal places are there
- if (decimalPlaces > 0) {
- var dp = value.indexOf(".");
- if (dp == -1) {
- value += '.';
- dp = 0;
- } else {
- dp = value.length - (dp + 1);
- }
-
- while (dp < decimalPlaces) {
- value += '0';
- dp++;
- }
- }
- return value;
- };
-
- })(jQuery);
\ No newline at end of file diff --git a/library/jslider/js/jquery.slider.js b/library/jslider/js/jquery.slider.js deleted file mode 100644 index 6d903775f..000000000 --- a/library/jslider/js/jquery.slider.js +++ /dev/null @@ -1,700 +0,0 @@ -/** - * jquery.slider - Slider ui control in jQuery - * - * Written by - * Egor Khmelev (hmelyoff@gmail.com) - * - * Licensed under the MIT (MIT-LICENSE.txt). - * - * @author Egor Khmelev - * @version 1.1.0-RELEASE ($Id$) - * - * Dependencies - * - * jQuery (http://jquery.com) - * jquery.numberformatter (http://code.google.com/p/jquery-numberformatter/) - * tmpl (http://ejohn.org/blog/javascript-micro-templating/) - * jquery.dependClass - * draggable - * - **/ - -(function( $ ) { - - function isArray( value ){ - if( typeof value == "undefined" ) return false; - - if (value instanceof Array || (!(value instanceof Object) && - (Object.prototype.toString.call((value)) == '[object Array]') || - typeof value.length == 'number' && - typeof value.splice != 'undefined' && - typeof value.propertyIsEnumerable != 'undefined' && - !value.propertyIsEnumerable('splice') - )) { - return true; - } - - return false; - } - - $.slider = function( node, settings ){ - var jNode = $(node); - if( !jNode.data( "jslider" ) ) - jNode.data( "jslider", new jSlider( node, settings ) ); - - return jNode.data( "jslider" ); - }; - - $.fn.slider = function( action, opt_value ){ - var returnValue, args = arguments; - - function isDef( val ){ - return val !== undefined; - }; - - function isDefAndNotNull( val ){ - return val != null; - }; - - this.each(function(){ - var self = $.slider( this, action ); - - // do actions - if( typeof action == "string" ){ - switch( action ){ - case "value": - if( isDef( args[ 1 ] ) && isDef( args[ 2 ] ) ){ - var pointers = self.getPointers(); - if( isDefAndNotNull( pointers[0] ) && isDefAndNotNull( args[1] ) ){ - pointers[0].set( args[ 1 ] ); - pointers[0].setIndexOver(); - } - - if( isDefAndNotNull( pointers[1] ) && isDefAndNotNull( args[2] ) ){ - pointers[1].set( args[ 2 ] ); - pointers[1].setIndexOver(); - } - } - - else if( isDef( args[ 1 ] ) ){ - var pointers = self.getPointers(); - if( isDefAndNotNull( pointers[0] ) && isDefAndNotNull( args[1] ) ){ - pointers[0].set( args[ 1 ] ); - pointers[0].setIndexOver(); - } - } - - else - returnValue = self.getValue(); - - break; - - case "prc": - if( isDef( args[ 1 ] ) && isDef( args[ 2 ] ) ){ - var pointers = self.getPointers(); - if( isDefAndNotNull( pointers[0] ) && isDefAndNotNull( args[1] ) ){ - pointers[0]._set( args[ 1 ] ); - pointers[0].setIndexOver(); - } - - if( isDefAndNotNull( pointers[1] ) && isDefAndNotNull( args[2] ) ){ - pointers[1]._set( args[ 2 ] ); - pointers[1].setIndexOver(); - } - } - - else if( isDef( args[ 1 ] ) ){ - var pointers = self.getPointers(); - if( isDefAndNotNull( pointers[0] ) && isDefAndNotNull( args[1] ) ){ - pointers[0]._set( args[ 1 ] ); - pointers[0].setIndexOver(); - } - } - - else - returnValue = self.getPrcValue(); - - break; - - case "calculatedValue": - var value = self.getValue().split(";"); - returnValue = ""; - for (var i=0; i < value.length; i++) { - returnValue += (i > 0 ? ";" : "") + self.nice( value[i] ); - }; - - break; - - case "skin": - self.setSkin( args[1] ); - - break; - }; - - } - - // return actual object - else if( !action && !opt_value ){ - if( !isArray( returnValue ) ) - returnValue = []; - - returnValue.push( self ); - } - }); - - // flatten array just with one slider - if( isArray( returnValue ) && returnValue.length == 1 ) - returnValue = returnValue[ 0 ]; - - return returnValue || this; - }; - - var OPTIONS = { - - settings: { - from: 1, - to: 10, - step: 1, - smooth: true, - limits: true, - round: 0, - format: { format: "#,##0.##" }, - value: "5;7", - dimension: "" - }, - - className: "jslider", - selector: ".jslider-", - - template: tmpl( - '<span class="<%=className%>">' + - '<table><tr><td>' + - '<div class="<%=className%>-bg">' + - '<i class="l"></i><i class="r"></i>' + - '<i class="v"></i>' + - '</div>' + - - '<div class="<%=className%>-pointer"></div>' + - '<div class="<%=className%>-pointer <%=className%>-pointer-to"></div>' + - - '<div class="<%=className%>-label"><span><%=settings.from%></span></div>' + - '<div class="<%=className%>-label <%=className%>-label-to"><span><%=settings.to%></span><%=settings.dimension%></div>' + - - '<div class="<%=className%>-value"><span></span><%=settings.dimension%></div>' + - '<div class="<%=className%>-value <%=className%>-value-to"><span></span><%=settings.dimension%></div>' + - - '<div class="<%=className%>-scale"><%=scale%></div>'+ - - '</td></tr></table>' + - '</span>' - ) - - }; - - function jSlider(){ - return this.init.apply( this, arguments ); - }; - - jSlider.prototype.init = function( node, settings ){ - this.settings = $.extend(true, {}, OPTIONS.settings, settings ? settings : {}); - - // obj.sliderHandler = this; - this.inputNode = $( node ).hide(); - - this.settings.interval = this.settings.to-this.settings.from; - this.settings.value = this.inputNode.attr("value"); - - if( this.settings.calculate && $.isFunction( this.settings.calculate ) ) - this.nice = this.settings.calculate; - - if( this.settings.onstatechange && $.isFunction( this.settings.onstatechange ) ) - this.onstatechange = this.settings.onstatechange; - - this.is = { - init: false - }; - this.o = {}; - - this.create(); - }; - - jSlider.prototype.onstatechange = function(){ - - }; - - jSlider.prototype.create = function(){ - var $this = this; - - this.domNode = $( OPTIONS.template({ - className: OPTIONS.className, - settings: { - from: this.nice( this.settings.from ), - to: this.nice( this.settings.to ), - dimension: this.settings.dimension - }, - scale: this.generateScale() - }) ); - - this.inputNode.after( this.domNode ); - this.drawScale(); - - // set skin class - if( this.settings.skin && this.settings.skin.length > 0 ) - this.setSkin( this.settings.skin ); - - this.sizes = { - domWidth: this.domNode.width(), - domOffset: this.domNode.offset() - }; - - // find some objects - $.extend(this.o, { - pointers: {}, - labels: { - 0: { - o: this.domNode.find(OPTIONS.selector + "value").not(OPTIONS.selector + "value-to") - }, - 1: { - o: this.domNode.find(OPTIONS.selector + "value").filter(OPTIONS.selector + "value-to") - } - }, - limits: { - 0: this.domNode.find(OPTIONS.selector + "label").not(OPTIONS.selector + "label-to"), - 1: this.domNode.find(OPTIONS.selector + "label").filter(OPTIONS.selector + "label-to") - } - }); - - $.extend(this.o.labels[0], { - value: this.o.labels[0].o.find("span") - }); - - $.extend(this.o.labels[1], { - value: this.o.labels[1].o.find("span") - }); - - - if( !$this.settings.value.split(";")[1] ){ - this.settings.single = true; - this.domNode.addDependClass("single"); - } - - if( !$this.settings.limits ) - this.domNode.addDependClass("limitless"); - - this.domNode.find(OPTIONS.selector + "pointer").each(function( i ){ - var value = $this.settings.value.split(";")[i]; - if( value ){ - $this.o.pointers[i] = new jSliderPointer( this, i, $this ); - - var prev = $this.settings.value.split(";")[i-1]; - if( prev && new Number(value) < new Number(prev) ) value = prev; - - value = value < $this.settings.from ? $this.settings.from : value; - value = value > $this.settings.to ? $this.settings.to : value; - - $this.o.pointers[i].set( value, true ); - } - }); - - this.o.value = this.domNode.find(".v"); - this.is.init = true; - - $.each(this.o.pointers, function(i){ - $this.redraw(this); - }); - - (function(self){ - $(window).resize(function(){ - self.onresize(); - }); - })(this); - - }; - - jSlider.prototype.setSkin = function( skin ){ - if( this.skin_ ) - this.domNode.removeDependClass( this.skin_, "_" ); - - this.domNode.addDependClass( this.skin_ = skin, "_" ); - }; - - jSlider.prototype.setPointersIndex = function( i ){ - $.each(this.getPointers(), function(i){ - this.index( i ); - }); - }; - - jSlider.prototype.getPointers = function(){ - return this.o.pointers; - }; - - jSlider.prototype.generateScale = function(){ - if( this.settings.scale && this.settings.scale.length > 0 ){ - var str = ""; - var s = this.settings.scale; - var prc = Math.round((100/(s.length-1))*10)/10; - for( var i=0; i < s.length; i++ ){ - str += '<span style="left: ' + i*prc + '%">' + ( s[i] != '|' ? '<ins>' + s[i] + '</ins>' : '' ) + '</span>'; - }; - return str; - } else return ""; - - return ""; - }; - - jSlider.prototype.drawScale = function(){ - this.domNode.find(OPTIONS.selector + "scale span ins").each(function(){ - $(this).css({ marginLeft: -$(this).outerWidth()/2 }); - }); - }; - - jSlider.prototype.onresize = function(){ - var self = this; - this.sizes = { - domWidth: this.domNode.width(), - domOffset: this.domNode.offset() - }; - - $.each(this.o.pointers, function(i){ - self.redraw(this); - }); - }; - - jSlider.prototype.update = function(){ - this.onresize(); - this.drawScale(); - }; - - jSlider.prototype.limits = function( x, pointer ){ - // smooth - if( !this.settings.smooth ){ - var step = this.settings.step*100 / ( this.settings.interval ); - x = Math.round( x/step ) * step; - } - - var another = this.o.pointers[1-pointer.uid]; - if( another && pointer.uid && x < another.value.prc ) x = another.value.prc; - if( another && !pointer.uid && x > another.value.prc ) x = another.value.prc; - - // base limit - if( x < 0 ) x = 0; - if( x > 100 ) x = 100; - - return Math.round( x*10 ) / 10; - }; - - jSlider.prototype.redraw = function( pointer ){ - if( !this.is.init ) return false; - - this.setValue(); - - // redraw range line - if( this.o.pointers[0] && this.o.pointers[1] ) - this.o.value.css({ left: this.o.pointers[0].value.prc + "%", width: ( this.o.pointers[1].value.prc - this.o.pointers[0].value.prc ) + "%" }); - - this.o.labels[pointer.uid].value.html( - this.nice( - pointer.value.origin - ) - ); - - // redraw position of labels - this.redrawLabels( pointer ); - - }; - - jSlider.prototype.redrawLabels = function( pointer ){ - - function setPosition( label, sizes, prc ){ - sizes.margin = -sizes.label/2; - - // left limit - label_left = sizes.border + sizes.margin; - if( label_left < 0 ) - sizes.margin -= label_left; - - // right limit - if( sizes.border+sizes.label / 2 > self.sizes.domWidth ){ - sizes.margin = 0; - sizes.right = true; - } else - sizes.right = false; - - label.o.css({ left: prc + "%", marginLeft: sizes.margin, right: "auto" }); - if( sizes.right ) label.o.css({ left: "auto", right: 0 }); - return sizes; - } - - var self = this; - var label = this.o.labels[pointer.uid]; - var prc = pointer.value.prc; - - var sizes = { - label: label.o.outerWidth(), - right: false, - border: ( prc * this.sizes.domWidth ) / 100 - }; - - if( !this.settings.single ){ - // glue if near; - var another = this.o.pointers[1-pointer.uid]; - var another_label = this.o.labels[another.uid]; - - switch( pointer.uid ){ - case 0: - if( sizes.border+sizes.label / 2 > another_label.o.offset().left-this.sizes.domOffset.left ){ - another_label.o.css({ visibility: "hidden" }); - another_label.value.html( this.nice( another.value.origin ) ); - - label.o.css({ visibility: "visible" }); - - prc = ( another.value.prc - prc ) / 2 + prc; - if( another.value.prc != pointer.value.prc ){ - label.value.html( this.nice(pointer.value.origin) + " – " + this.nice(another.value.origin) ); - sizes.label = label.o.outerWidth(); - sizes.border = ( prc * this.sizes.domWidth ) / 100; - } - } else { - another_label.o.css({ visibility: "visible" }); - } - break; - - case 1: - if( sizes.border - sizes.label / 2 < another_label.o.offset().left - this.sizes.domOffset.left + another_label.o.outerWidth() ){ - another_label.o.css({ visibility: "hidden" }); - another_label.value.html( this.nice(another.value.origin) ); - - label.o.css({ visibility: "visible" }); - - prc = ( prc - another.value.prc ) / 2 + another.value.prc; - if( another.value.prc != pointer.value.prc ){ - label.value.html( this.nice(another.value.origin) + " – " + this.nice(pointer.value.origin) ); - sizes.label = label.o.outerWidth(); - sizes.border = ( prc * this.sizes.domWidth ) / 100; - } - } else { - another_label.o.css({ visibility: "visible" }); - } - break; - } - } - - sizes = setPosition( label, sizes, prc ); - - /* draw second label */ - if( another_label ){ - var sizes = { - label: another_label.o.outerWidth(), - right: false, - border: ( another.value.prc * this.sizes.domWidth ) / 100 - }; - sizes = setPosition( another_label, sizes, another.value.prc ); - } - - this.redrawLimits(); - }; - - jSlider.prototype.redrawLimits = function(){ - if( this.settings.limits ){ - - var limits = [ true, true ]; - - for( key in this.o.pointers ){ - - if( !this.settings.single || key == 0 ){ - - var pointer = this.o.pointers[key]; - var label = this.o.labels[pointer.uid]; - var label_left = label.o.offset().left - this.sizes.domOffset.left; - - var limit = this.o.limits[0]; - if( label_left < limit.outerWidth() ) - limits[0] = false; - - var limit = this.o.limits[1]; - if( label_left + label.o.outerWidth() > this.sizes.domWidth - limit.outerWidth() ) - limits[1] = false; - } - - }; - - for( var i=0; i < limits.length; i++ ){ - if( limits[i] ) - this.o.limits[i].fadeIn("fast"); - else - this.o.limits[i].fadeOut("fast"); - }; - - } - }; - - jSlider.prototype.setValue = function(){ - var value = this.getValue(); - this.inputNode.attr( "value", value ); - this.onstatechange.call( this, value ); - }; - - jSlider.prototype.getValue = function(){ - if(!this.is.init) return false; - var $this = this; - - var value = ""; - $.each( this.o.pointers, function(i){ - if( this.value.prc != undefined && !isNaN(this.value.prc) ) value += (i > 0 ? ";" : "") + $this.prcToValue( this.value.prc ); - }); - return value; - }; - - jSlider.prototype.getPrcValue = function(){ - if(!this.is.init) return false; - var $this = this; - - var value = ""; - $.each( this.o.pointers, function(i){ - if( this.value.prc != undefined && !isNaN(this.value.prc) ) value += (i > 0 ? ";" : "") + this.value.prc; - }); - return value; - }; - - jSlider.prototype.prcToValue = function( prc ){ - - if( this.settings.heterogeneity && this.settings.heterogeneity.length > 0 ){ - var h = this.settings.heterogeneity; - - var _start = 0; - var _from = this.settings.from; - - for( var i=0; i <= h.length; i++ ){ - if( h[i] ) var v = h[i].split("/"); - else var v = [100, this.settings.to]; - - v[0] = new Number(v[0]); - v[1] = new Number(v[1]); - - if( prc >= _start && prc <= v[0] ) { - var value = _from + ( (prc-_start) * (v[1]-_from) ) / (v[0]-_start); - } - - _start = v[0]; - _from = v[1]; - }; - - } else { - var value = this.settings.from + ( prc * this.settings.interval ) / 100; - } - - return this.round( value ); - }; - - jSlider.prototype.valueToPrc = function( value, pointer ){ - if( this.settings.heterogeneity && this.settings.heterogeneity.length > 0 ){ - var h = this.settings.heterogeneity; - - var _start = 0; - var _from = this.settings.from; - - for (var i=0; i <= h.length; i++) { - if(h[i]) var v = h[i].split("/"); - else var v = [100, this.settings.to]; - v[0] = new Number(v[0]); v[1] = new Number(v[1]); - - if(value >= _from && value <= v[1]){ - var prc = pointer.limits(_start + (value-_from)*(v[0]-_start)/(v[1]-_from)); - } - - _start = v[0]; _from = v[1]; - }; - - } else { - var prc = pointer.limits((value-this.settings.from)*100/this.settings.interval); - } - - return prc; - }; - - jSlider.prototype.round = function( value ){ - value = Math.round( value / this.settings.step ) * this.settings.step; - if( this.settings.round ) value = Math.round( value * Math.pow(10, this.settings.round) ) / Math.pow(10, this.settings.round); - else value = Math.round( value ); - return value; - }; - - jSlider.prototype.nice = function( value ){ - value = value.toString().replace(/,/gi, ".").replace(/ /gi, "");; - - if( $.formatNumber ){ - return $.formatNumber( new Number(value), this.settings.format || {} ).replace( /-/gi, "−" ); - } - - else { - return new Number(value); - } - }; - - - function jSliderPointer(){ - Draggable.apply( this, arguments ); - } - jSliderPointer.prototype = new Draggable(); - - jSliderPointer.prototype.oninit = function( ptr, id, _constructor ){ - this.uid = id; - this.parent = _constructor; - this.value = {}; - this.settings = this.parent.settings; - }; - - jSliderPointer.prototype.onmousedown = function(evt){ - this._parent = { - offset: this.parent.domNode.offset(), - width: this.parent.domNode.width() - }; - this.ptr.addDependClass("hover"); - this.setIndexOver(); - }; - - jSliderPointer.prototype.onmousemove = function( evt, x ){ - var coords = this._getPageCoords( evt ); - this._set( this.calc( coords.x ) ); - }; - - jSliderPointer.prototype.onmouseup = function( evt ){ - if( this.parent.settings.callback && $.isFunction(this.parent.settings.callback) ) - this.parent.settings.callback.call( this.parent, this.parent.getValue() ); - - this.ptr.removeDependClass("hover"); - }; - - jSliderPointer.prototype.setIndexOver = function(){ - this.parent.setPointersIndex( 1 ); - this.index( 2 ); - }; - - jSliderPointer.prototype.index = function( i ){ - this.ptr.css({ zIndex: i }); - }; - - jSliderPointer.prototype.limits = function( x ){ - return this.parent.limits( x, this ); - }; - - jSliderPointer.prototype.calc = function(coords){ - var x = this.limits(((coords-this._parent.offset.left)*100)/this._parent.width); - return x; - }; - - jSliderPointer.prototype.set = function( value, opt_origin ){ - this.value.origin = this.parent.round(value); - this._set( this.parent.valueToPrc( value, this ), opt_origin ); - }; - - jSliderPointer.prototype._set = function( prc, opt_origin ){ - if( !opt_origin ) - this.value.origin = this.parent.prcToValue(prc); - - this.value.prc = prc; - this.ptr.css({ left: prc + "%" }); - this.parent.redraw(this); - }; - -})(jQuery);
\ No newline at end of file diff --git a/library/jslider/js/jshashtable-2.1_src.js b/library/jslider/js/jshashtable-2.1_src.js deleted file mode 100644 index 086f3de5b..000000000 --- a/library/jslider/js/jshashtable-2.1_src.js +++ /dev/null @@ -1,370 +0,0 @@ -/**
- * Copyright 2010 Tim Down.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * jshashtable
- *
- * jshashtable is a JavaScript implementation of a hash table. It creates a single constructor function called Hashtable
- * in the global scope.
- *
- * Author: Tim Down <tim@timdown.co.uk>
- * Version: 2.1
- * Build date: 21 March 2010
- * Website: http://www.timdown.co.uk/jshashtable
- */
-
-var Hashtable = (function() {
- var FUNCTION = "function";
-
- var arrayRemoveAt = (typeof Array.prototype.splice == FUNCTION) ?
- function(arr, idx) {
- arr.splice(idx, 1);
- } :
-
- function(arr, idx) {
- var itemsAfterDeleted, i, len;
- if (idx === arr.length - 1) {
- arr.length = idx;
- } else {
- itemsAfterDeleted = arr.slice(idx + 1);
- arr.length = idx;
- for (i = 0, len = itemsAfterDeleted.length; i < len; ++i) {
- arr[idx + i] = itemsAfterDeleted[i];
- }
- }
- };
-
- function hashObject(obj) {
- var hashCode;
- if (typeof obj == "string") {
- return obj;
- } else if (typeof obj.hashCode == FUNCTION) {
- // Check the hashCode method really has returned a string
- hashCode = obj.hashCode();
- return (typeof hashCode == "string") ? hashCode : hashObject(hashCode);
- } else if (typeof obj.toString == FUNCTION) {
- return obj.toString();
- } else {
- try {
- return String(obj);
- } catch (ex) {
- // For host objects (such as ActiveObjects in IE) that have no toString() method and throw an error when
- // passed to String()
- return Object.prototype.toString.call(obj);
- }
- }
- }
-
- function equals_fixedValueHasEquals(fixedValue, variableValue) {
- return fixedValue.equals(variableValue);
- }
-
- function equals_fixedValueNoEquals(fixedValue, variableValue) {
- return (typeof variableValue.equals == FUNCTION) ?
- variableValue.equals(fixedValue) : (fixedValue === variableValue);
- }
-
- function createKeyValCheck(kvStr) {
- return function(kv) {
- if (kv === null) {
- throw new Error("null is not a valid " + kvStr);
- } else if (typeof kv == "undefined") {
- throw new Error(kvStr + " must not be undefined");
- }
- };
- }
-
- var checkKey = createKeyValCheck("key"), checkValue = createKeyValCheck("value");
-
- /*----------------------------------------------------------------------------------------------------------------*/
-
- function Bucket(hash, firstKey, firstValue, equalityFunction) {
- this[0] = hash;
- this.entries = [];
- this.addEntry(firstKey, firstValue);
-
- if (equalityFunction !== null) {
- this.getEqualityFunction = function() {
- return equalityFunction;
- };
- }
- }
-
- var EXISTENCE = 0, ENTRY = 1, ENTRY_INDEX_AND_VALUE = 2;
-
- function createBucketSearcher(mode) {
- return function(key) {
- var i = this.entries.length, entry, equals = this.getEqualityFunction(key);
- while (i--) {
- entry = this.entries[i];
- if ( equals(key, entry[0]) ) {
- switch (mode) {
- case EXISTENCE:
- return true;
- case ENTRY:
- return entry;
- case ENTRY_INDEX_AND_VALUE:
- return [ i, entry[1] ];
- }
- }
- }
- return false;
- };
- }
-
- function createBucketLister(entryProperty) {
- return function(aggregatedArr) {
- var startIndex = aggregatedArr.length;
- for (var i = 0, len = this.entries.length; i < len; ++i) {
- aggregatedArr[startIndex + i] = this.entries[i][entryProperty];
- }
- };
- }
-
- Bucket.prototype = {
- getEqualityFunction: function(searchValue) {
- return (typeof searchValue.equals == FUNCTION) ? equals_fixedValueHasEquals : equals_fixedValueNoEquals;
- },
-
- getEntryForKey: createBucketSearcher(ENTRY),
-
- getEntryAndIndexForKey: createBucketSearcher(ENTRY_INDEX_AND_VALUE),
-
- removeEntryForKey: function(key) {
- var result = this.getEntryAndIndexForKey(key);
- if (result) {
- arrayRemoveAt(this.entries, result[0]);
- return result[1];
- }
- return null;
- },
-
- addEntry: function(key, value) {
- this.entries[this.entries.length] = [key, value];
- },
-
- keys: createBucketLister(0),
-
- values: createBucketLister(1),
-
- getEntries: function(entries) {
- var startIndex = entries.length;
- for (var i = 0, len = this.entries.length; i < len; ++i) {
- // Clone the entry stored in the bucket before adding to array
- entries[startIndex + i] = this.entries[i].slice(0);
- }
- },
-
- containsKey: createBucketSearcher(EXISTENCE),
-
- containsValue: function(value) {
- var i = this.entries.length;
- while (i--) {
- if ( value === this.entries[i][1] ) {
- return true;
- }
- }
- return false;
- }
- };
-
- /*----------------------------------------------------------------------------------------------------------------*/
-
- // Supporting functions for searching hashtable buckets
-
- function searchBuckets(buckets, hash) {
- var i = buckets.length, bucket;
- while (i--) {
- bucket = buckets[i];
- if (hash === bucket[0]) {
- return i;
- }
- }
- return null;
- }
-
- function getBucketForHash(bucketsByHash, hash) {
- var bucket = bucketsByHash[hash];
-
- // Check that this is a genuine bucket and not something inherited from the bucketsByHash's prototype
- return ( bucket && (bucket instanceof Bucket) ) ? bucket : null;
- }
-
- /*----------------------------------------------------------------------------------------------------------------*/
-
- function Hashtable(hashingFunctionParam, equalityFunctionParam) {
- var that = this;
- var buckets = [];
- var bucketsByHash = {};
-
- var hashingFunction = (typeof hashingFunctionParam == FUNCTION) ? hashingFunctionParam : hashObject;
- var equalityFunction = (typeof equalityFunctionParam == FUNCTION) ? equalityFunctionParam : null;
-
- this.put = function(key, value) {
- checkKey(key);
- checkValue(value);
- var hash = hashingFunction(key), bucket, bucketEntry, oldValue = null;
-
- // Check if a bucket exists for the bucket key
- bucket = getBucketForHash(bucketsByHash, hash);
- if (bucket) {
- // Check this bucket to see if it already contains this key
- bucketEntry = bucket.getEntryForKey(key);
- if (bucketEntry) {
- // This bucket entry is the current mapping of key to value, so replace old value and we're done.
- oldValue = bucketEntry[1];
- bucketEntry[1] = value;
- } else {
- // The bucket does not contain an entry for this key, so add one
- bucket.addEntry(key, value);
- }
- } else {
- // No bucket exists for the key, so create one and put our key/value mapping in
- bucket = new Bucket(hash, key, value, equalityFunction);
- buckets[buckets.length] = bucket;
- bucketsByHash[hash] = bucket;
- }
- return oldValue;
- };
-
- this.get = function(key) {
- checkKey(key);
-
- var hash = hashingFunction(key);
-
- // Check if a bucket exists for the bucket key
- var bucket = getBucketForHash(bucketsByHash, hash);
- if (bucket) {
- // Check this bucket to see if it contains this key
- var bucketEntry = bucket.getEntryForKey(key);
- if (bucketEntry) {
- // This bucket entry is the current mapping of key to value, so return the value.
- return bucketEntry[1];
- }
- }
- return null;
- };
-
- this.containsKey = function(key) {
- checkKey(key);
- var bucketKey = hashingFunction(key);
-
- // Check if a bucket exists for the bucket key
- var bucket = getBucketForHash(bucketsByHash, bucketKey);
-
- return bucket ? bucket.containsKey(key) : false;
- };
-
- this.containsValue = function(value) {
- checkValue(value);
- var i = buckets.length;
- while (i--) {
- if (buckets[i].containsValue(value)) {
- return true;
- }
- }
- return false;
- };
-
- this.clear = function() {
- buckets.length = 0;
- bucketsByHash = {};
- };
-
- this.isEmpty = function() {
- return !buckets.length;
- };
-
- var createBucketAggregator = function(bucketFuncName) {
- return function() {
- var aggregated = [], i = buckets.length;
- while (i--) {
- buckets[i][bucketFuncName](aggregated);
- }
- return aggregated;
- };
- };
-
- this.keys = createBucketAggregator("keys");
- this.values = createBucketAggregator("values");
- this.entries = createBucketAggregator("getEntries");
-
- this.remove = function(key) {
- checkKey(key);
-
- var hash = hashingFunction(key), bucketIndex, oldValue = null;
-
- // Check if a bucket exists for the bucket key
- var bucket = getBucketForHash(bucketsByHash, hash);
-
- if (bucket) {
- // Remove entry from this bucket for this key
- oldValue = bucket.removeEntryForKey(key);
- if (oldValue !== null) {
- // Entry was removed, so check if bucket is empty
- if (!bucket.entries.length) {
- // Bucket is empty, so remove it from the bucket collections
- bucketIndex = searchBuckets(buckets, hash);
- arrayRemoveAt(buckets, bucketIndex);
- delete bucketsByHash[hash];
- }
- }
- }
- return oldValue;
- };
-
- this.size = function() {
- var total = 0, i = buckets.length;
- while (i--) {
- total += buckets[i].entries.length;
- }
- return total;
- };
-
- this.each = function(callback) {
- var entries = that.entries(), i = entries.length, entry;
- while (i--) {
- entry = entries[i];
- callback(entry[0], entry[1]);
- }
- };
-
- this.putAll = function(hashtable, conflictCallback) {
- var entries = hashtable.entries();
- var entry, key, value, thisValue, i = entries.length;
- var hasConflictCallback = (typeof conflictCallback == FUNCTION);
- while (i--) {
- entry = entries[i];
- key = entry[0];
- value = entry[1];
-
- // Check for a conflict. The default behaviour is to overwrite the value for an existing key
- if ( hasConflictCallback && (thisValue = that.get(key)) ) {
- value = conflictCallback(key, thisValue, value);
- }
- that.put(key, value);
- }
- };
-
- this.clone = function() {
- var clone = new Hashtable(hashingFunctionParam, equalityFunctionParam);
- clone.putAll(that);
- return clone;
- };
- }
-
- return Hashtable;
-})();
\ No newline at end of file diff --git a/library/jslider/js/tmpl.js b/library/jslider/js/tmpl.js deleted file mode 100644 index 36eadf28a..000000000 --- a/library/jslider/js/tmpl.js +++ /dev/null @@ -1,35 +0,0 @@ -// Simple JavaScript Templating -// John Resig - http://ejohn.org/ - MIT Licensed -(function(){ - var cache = {}; - - this.tmpl = function tmpl(str, data){ - // Figure out if we're getting a template, or if we need to - // load the template - and be sure to cache the result. - var fn = !/\W/.test(str) ? - cache[str] = cache[str] || - tmpl(document.getElementById(str).innerHTML) : - - // Generate a reusable function that will serve as a template - // generator (and which will be cached). - new Function("obj", - "var p=[],print=function(){p.push.apply(p,arguments);};" + - - // Introduce the data as local variables using with(){} - "with(obj){p.push('" + - - // Convert the template into pure JavaScript - str - .replace(/[\r\t\n]/g, " ") - .split("<%").join("\t") - .replace(/((^|%>)[^\t]*)'/g, "$1\r") - .replace(/\t=(.*?)%>/g, "',$1,'") - .split("\t").join("');") - .split("%>").join("p.push('") - .split("\r").join("\\'") - + "');}return p.join('');"); - - // Provide some basic currying to the user - return data ? fn( data ) : fn; - }; -})();
\ No newline at end of file diff --git a/library/jslider/src/skin.psd b/library/jslider/src/skin.psd Binary files differdeleted file mode 100644 index 2c46c91db..000000000 --- a/library/jslider/src/skin.psd +++ /dev/null diff --git a/library/jslider/tests/show_hide.html b/library/jslider/tests/show_hide.html deleted file mode 100644 index 57d3e929d..000000000 --- a/library/jslider/tests/show_hide.html +++ /dev/null @@ -1,53 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <title>jSlider Show/hide test</title> - - <!-- bin/jquery.slider.min.css --> - <link rel="stylesheet" href="../css/jslider.css" type="text/css"> - <link rel="stylesheet" href="../css/jslider.plastic.css" type="text/css"> - <!-- end --> - - <script type="text/javascript" src="../js/jquery-1.7.1.js"></script> - - <!-- bin/jquery.slider.min.js --> - <script type="text/javascript" src="../js/jshashtable-2.1_src.js"></script> - <script type="text/javascript" src="../js/jquery.numberformatter-1.2.3.js"></script> - <script type="text/javascript" src="../js/tmpl.js"></script> - <script type="text/javascript" src="../js/jquery.dependClass-0.1.js"></script> - <script type="text/javascript" src="../js/draggable-0.1.js"></script> - <script type="text/javascript" src="../js/jquery.slider.js"></script> - <!-- end --> - - <style type="text/css" media="screen"> - body { background: #EEF0F7; } - .layout { padding: 50px; font-family: Georgia, serif; } - .layout-slider { margin-bottom: 60px; width: 50%; padding: 20px 0; } - </style> - -</head> -<body> - - <div class="layout"> - - <div class="layout-slider" style="width: 100%; display: none;"> - Slider <span style="display: inline-block; width: 400px; padding: 0 5px;"><input id="Slider3" type="text" name="area" value="25;75" /></span> in string - </div> - <a href="#" id="trigger">Show/Hide</a> - - <script type="text/javascript" charset="utf-8"> - var layout = $(".layout-slider"), - trigger = $("#trigger"); - - jQuery("#Slider3").slider({ from: 0, to: 500, heterogeneity: ['50/100', '75/250'], scale: [0, '|', 50, '|', '100', '|', 250, '|', 500], limits: false, step: 1, dimension: ' m<small>2</small>', skin: "plastic" }); - - $(trigger).click( function(){ - layout.slideToggle("fast"); - $("#Slider3").slider().update(); - }); - </script> - - </div> -</body> -</html>
\ No newline at end of file diff --git a/library/jslider/tests/zero_value.html b/library/jslider/tests/zero_value.html deleted file mode 100644 index 7d9e9f874..000000000 --- a/library/jslider/tests/zero_value.html +++ /dev/null @@ -1,64 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <title>jSlider Zero value test</title> - - <!-- bin/jquery.slider.min.css --> - <link rel="stylesheet" href="../css/jslider.css" type="text/css"> - <link rel="stylesheet" href="../css/jslider.plastic.css" type="text/css"> - <!-- end --> - - <script type="text/javascript" src="../js/jquery-1.7.1.js"></script> - - <!-- bin/jquery.slider.min.js --> - <script type="text/javascript" src="../js/jshashtable-2.1_src.js"></script> - <script type="text/javascript" src="../js/jquery.numberformatter-1.2.3.js"></script> - <script type="text/javascript" src="../js/tmpl.js"></script> - <script type="text/javascript" src="../js/jquery.dependClass-0.1.js"></script> - <script type="text/javascript" src="../js/draggable-0.1.js"></script> - <script type="text/javascript" src="../js/jquery.slider.js"></script> - <!-- end --> - - <style type="text/css" media="screen"> - body { background: #EEF0F7; } - .layout { padding: 50px; font-family: Georgia, serif; } - .layout-slider { margin-bottom: 60px; width: 50%; } - </style> - -</head> -<body> - - <div class="layout"> - - <div class="layout-slider" style="width: 100%"> - Slider <span style="display: inline-block; width: 400px; padding: 0 5px;"><input id="Slider1" type="slider" name="price" value="50" /></span> in string - </div> - <script type="text/javascript" charset="utf-8"> - jQuery("#Slider1").slider({ - from: -50, - to: 200, - step: 5, - dimension: '%', - skin: 'plastic', - scale: ['-50', '|', '0', '|', '50', '|', '100', '|', '150', '|', '200'] - }); - </script> - - <div class="layout-slider" style="width: 100%"> - Slider <span style="display: inline-block; width: 400px; padding: 0 5px;"><input id="Slider2" type="slider" name="price" value="-0.5;0.5" /></span> in string - </div> - <script type="text/javascript" charset="utf-8"> - jQuery("#Slider2").slider({ - from: -1, - to: 1, - step: 0.1, - round: 1, - dimension: 'px', - skin: 'plastic' - }); - </script> - - </div> -</body> -</html>
\ No newline at end of file diff --git a/library/jslider/tools/yuicompressor-2.4.7.jar b/library/jslider/tools/yuicompressor-2.4.7.jar Binary files differdeleted file mode 100644 index 3c9a408aa..000000000 --- a/library/jslider/tools/yuicompressor-2.4.7.jar +++ /dev/null diff --git a/library/readmore.js/README.md b/library/readmore.js/README.md new file mode 100644 index 000000000..0116fbe8b --- /dev/null +++ b/library/readmore.js/README.md @@ -0,0 +1,171 @@ +# Readmore.js + +A smooth, responsive jQuery plugin for collapsing and expanding long blocks of text with "Read more" and "Close" links. + +The markup Readmore.js requires is so simple, you can probably use it with your existing HTML—there's no need for complicated sets of `div`'s or hardcoded classes, just call `.readmore()` on the element containing your block of text and Readmore.js takes care of the rest. Readmore.js plays well in a responsive environment, too. + +Readmore.js is tested with—and supported on—all versions of jQuery greater than 1.9.1. All the "good" browsers are supported, as well as IE10+; IE8 & 9 _should_ work, but are not supported and the experience will not be ideal. + + +## Install + +Install Readmore.js with Bower: + +``` +$ bower install readmore +``` + +Then include it in your HTML: + +```html +<script src="/bower_components/readmore/readmore.min.js"></script> +``` + + +## Use + +```javascript +$('article').readmore(); +``` + +It's that simple. You can change the speed of the animation, the height of the collapsed block, and the open and close elements. + +```javascript +$('article').readmore({ + speed: 75, + lessLink: '<a href="#">Read less</a>' +}); +``` + +### The options: + +* `speed: 100` in milliseconds +* `collapsedHeight: 200` in pixels +* `heightMargin: 16` in pixels, avoids collapsing blocks that are only slightly larger than `collapsedHeight` +* `moreLink: '<a href="#">Read more</a>'` +* `lessLink: '<a href="#">Close</a>'` +* `embedCSS: true` insert required CSS dynamically, set this to `false` if you include the necessary CSS in a stylesheet +* `blockCSS: 'display: block; width: 100%;'` sets the styling of the blocks, ignored if `embedCSS` is `false` +* `startOpen: false` do not immediately truncate, start in the fully opened position +* `beforeToggle: function() {}` called after a more or less link is clicked, but *before* the block is collapsed or expanded +* `afterToggle: function() {}` called *after* the block is collapsed or expanded + +If the element has a `max-height` CSS property, Readmore.js will use that value rather than the value of the `collapsedHeight` option. + +### The callbacks: + +The callback functions, `beforeToggle` and `afterToggle`, both receive the same arguments: `trigger`, `element`, and `expanded`. + +* `trigger`: the "Read more" or "Close" element that was clicked +* `element`: the block that is being collapsed or expanded +* `expanded`: Boolean; `true` means the block is expanded + +#### Callback example: + +Here's an example of how you could use the `afterToggle` callback to scroll back to the top of a block when the "Close" link is clicked. + +```javascript +$('article').readmore({ + afterToggle: function(trigger, element, expanded) { + if(! expanded) { // The "Close" link was clicked + $('html, body').animate( { scrollTop: element.offset().top }, {duration: 100 } ); + } + } +}); +``` + +### Removing Readmore: + +You can remove the Readmore.js functionality like so: + +```javascript +$('article').readmore('destroy'); +``` + +Or, you can be more surgical by specifying a particular element: + +```javascript +$('article:first').readmore('destroy'); +``` + +### Toggling blocks programmatically: + +You can toggle a block from code: + +```javascript +$('article:nth-of-type(3)').readmore('toggle'); +``` + + +## CSS: + +Readmore.js is designed to use CSS for as much functionality as possible: collapsed height can be set in CSS with the `max-height` property; "collapsing" is achieved by setting `overflow: hidden` on the containing block and changing the `height` property; and, finally, the expanding/collapsing animation is done with CSS3 transitions. + +By default, Readmore.js inserts the following CSS, in addition to some transition-related rules: + +```css +selector + [data-readmore-toggle], selector[data-readmore] { + display: block; + width: 100%; +} +``` + +_`selector` would be the element you invoked `readmore()` on, e.g.: `$('selector').readmore()`_ + +You can override the base rules when you set up Readmore.js like so: + +```javascript +$('article').readmore({blockCSS: 'display: inline-block; width: 50%;'}); +``` + +If you want to include the necessary styling in your site's stylesheet, you can disable the dynamic embedding by setting `embedCSS` to `false`: + +```javascript +$('article').readmore({embedCSS: false}); +``` + +### Media queries and other CSS tricks: + +If you wanted to set a `maxHeight` based on lines, you could do so in CSS with something like: + +```css +body { + font: 16px/1.5 sans-serif; +} + +/* Show only 4 lines in smaller screens */ +article { + max-height: 6em; /* (4 * 1.5 = 6) */ +} +``` + +Then, with a media query you could change the number of lines shown, like so: + +```css +/* Show 8 lines on larger screens */ +@media screen and (min-width: 640px) { + article { + max-height: 12em; + } +} +``` + + +## Contributing + +Pull requests are always welcome, but not all suggested features will get merged. Feel free to contact me if you have an idea for a feature. + +Pull requests should include the minified script and this readme and the demo HTML should be updated with descriptions of your new feature. + +You'll need NPM: + +``` +$ npm install +``` + +Which will install the necessary development dependencies. Then, to build the minified script: + +``` +$ gulp compress +``` + diff --git a/library/readmore.js/readmore.js b/library/readmore.js/readmore.js new file mode 100644 index 000000000..81cfb3cea --- /dev/null +++ b/library/readmore.js/readmore.js @@ -0,0 +1,319 @@ +/*! + * @preserve + * + * Readmore.js jQuery plugin + * Author: @jed_foster + * Project home: http://jedfoster.github.io/Readmore.js + * Licensed under the MIT license + * + * Debounce function from http://davidwalsh.name/javascript-debounce-function + */ + +/* global jQuery */ + +(function($) { + 'use strict'; + + var readmore = 'readmore', + defaults = { + speed: 100, + collapsedHeight: 200, + heightMargin: 16, + moreLink: '<a href="#">Read More</a>', + lessLink: '<a href="#">Close</a>', + embedCSS: true, + blockCSS: 'display: block; width: 100%;', + startOpen: false, + + // callbacks + beforeToggle: function(){}, + afterToggle: function(){} + }, + cssEmbedded = {}, + uniqueIdCounter = 0; + + function debounce(func, wait, immediate) { + var timeout; + + return function() { + var context = this, args = arguments; + var later = function() { + timeout = null; + if (! immediate) { + func.apply(context, args); + } + }; + var callNow = immediate && !timeout; + + clearTimeout(timeout); + timeout = setTimeout(later, wait); + + if (callNow) { + func.apply(context, args); + } + }; + } + + function uniqueId(prefix) { + var id = ++uniqueIdCounter; + + return String(prefix == null ? 'rmjs-' : prefix) + id; + } + + function setBoxHeights(element) { + var el = element.clone().css({ + height: 'auto', + width: element.width(), + maxHeight: 'none', + overflow: 'hidden' + }).insertAfter(element), + expandedHeight = el.outerHeight(), + cssMaxHeight = parseInt(el.css({maxHeight: ''}).css('max-height').replace(/[^-\d\.]/g, ''), 10), + defaultHeight = element.data('defaultHeight'); + + el.remove(); + + var collapsedHeight = element.data('collapsedHeight') || defaultHeight; + + if (!cssMaxHeight) { + collapsedHeight = defaultHeight; + } + else if (cssMaxHeight > collapsedHeight) { + collapsedHeight = cssMaxHeight; + } + + // Store our measurements. + element.data({ + expandedHeight: expandedHeight, + maxHeight: cssMaxHeight, + collapsedHeight: collapsedHeight + }) + // and disable any `max-height` property set in CSS + .css({ + maxHeight: 'none' + }); + } + + var resizeBoxes = debounce(function() { + $('[data-readmore]').each(function() { + var current = $(this), + isExpanded = (current.attr('aria-expanded') === 'true'); + + setBoxHeights(current); + + current.css({ + height: current.data( (isExpanded ? 'expandedHeight' : 'collapsedHeight') ) + }); + }); + }, 100); + + function embedCSS(options) { + if (! cssEmbedded[options.selector]) { + var styles = ' '; + + if (options.embedCSS && options.blockCSS !== '') { + styles += options.selector + ' + [data-readmore-toggle], ' + + options.selector + '[data-readmore]{' + + options.blockCSS + + '}'; + } + + // Include the transition CSS even if embedCSS is false + styles += options.selector + '[data-readmore]{' + + 'transition: height ' + options.speed + 'ms;' + + 'overflow: hidden;' + + '}'; + + (function(d, u) { + var css = d.createElement('style'); + css.type = 'text/css'; + + if (css.styleSheet) { + css.styleSheet.cssText = u; + } + else { + css.appendChild(d.createTextNode(u)); + } + + d.getElementsByTagName('head')[0].appendChild(css); + }(document, styles)); + + cssEmbedded[options.selector] = true; + } + } + + function Readmore(element, options) { + var $this = this; + + this.element = element; + + this.options = $.extend({}, defaults, options); + + $(this.element).data({ + defaultHeight: this.options.collapsedHeight, + heightMargin: this.options.heightMargin + }); + + embedCSS(this.options); + + this._defaults = defaults; + this._name = readmore; + + window.addEventListener('load', function() { + $this.init(); + }); + } + + + Readmore.prototype = { + init: function() { + var $this = this; + + $(this.element).each(function() { + var current = $(this); + + setBoxHeights(current); + + var collapsedHeight = current.data('collapsedHeight'), + heightMargin = current.data('heightMargin'); + + if (current.outerHeight(true) <= collapsedHeight + heightMargin) { + // The block is shorter than the limit, so there's no need to truncate it. + return true; + } + else { + var id = current.attr('id') || uniqueId(), + useLink = $this.options.startOpen ? $this.options.lessLink : $this.options.moreLink; + + current.attr({ + 'data-readmore': '', + 'aria-expanded': false, + 'id': id + }); + + current.after($(useLink) + .on('click', function(event) { $this.toggle(this, current[0], event); }) + .attr({ + 'data-readmore-toggle': '', + 'aria-controls': id + })); + + if (! $this.options.startOpen) { + current.css({ + height: collapsedHeight + }); + } + } + }); + + window.addEventListener('resize', function() { + resizeBoxes(); + }); + }, + + toggle: function(trigger, element, event) { + if (event) { + event.preventDefault(); + } + + if (! trigger) { + trigger = $('[aria-controls="' + this.element.id + '"]')[0]; + } + + if (! element) { + element = this.element; + } + + var $this = this, + $element = $(element), + newHeight = '', + newLink = '', + expanded = false, + collapsedHeight = $element.data('collapsedHeight'); + + if ($element.height() <= collapsedHeight) { + newHeight = $element.data('expandedHeight') + 'px'; + newLink = 'lessLink'; + expanded = true; + } + else { + newHeight = collapsedHeight; + newLink = 'moreLink'; + } + + // Fire beforeToggle callback + // Since we determined the new "expanded" state above we're now out of sync + // with our true current state, so we need to flip the value of `expanded` + $this.options.beforeToggle(trigger, element, ! expanded); + + $element.css({'height': newHeight}); + + // Fire afterToggle callback + $element.on('transitionend', function() { + $this.options.afterToggle(trigger, element, expanded); + + $(this).attr({ + 'aria-expanded': expanded + }).off('transitionend'); + }); + + $(trigger).replaceWith($($this.options[newLink]) + .on('click', function(event) { $this.toggle(this, element, event); }) + .attr({ + 'data-readmore-toggle': '', + 'aria-controls': $element.attr('id') + })); + }, + + destroy: function() { + $(this.element).each(function() { + var current = $(this); + + current.attr({ + 'data-readmore': null, + 'aria-expanded': null + }) + .css({ + maxHeight: '', + height: '' + }) + .next('[data-readmore-toggle]') + .remove(); + + current.removeData(); + }); + } + }; + + + $.fn.readmore = function(options) { + var args = arguments, + selector = this.selector; + + options = options || {}; + + if (typeof options === 'object') { + return this.each(function() { + if ($.data(this, 'plugin_' + readmore)) { + var instance = $.data(this, 'plugin_' + readmore); + instance.destroy.apply(instance); + } + + options.selector = selector; + + $.data(this, 'plugin_' + readmore, new Readmore(this, options)); + }); + } + else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') { + return this.each(function () { + var instance = $.data(this, 'plugin_' + readmore); + if (instance instanceof Readmore && typeof instance[options] === 'function') { + instance[options].apply(instance, Array.prototype.slice.call(args, 1)); + } + }); + } + }; + +})(jQuery); + + diff --git a/view/js/jquery-compat.js b/view/js/jquery-compat.js deleted file mode 100644 index 7bf912542..000000000 --- a/view/js/jquery-compat.js +++ /dev/null @@ -1,71 +0,0 @@ - -// provide jquery.browser so we can get rid of the migration toolkit - -jQuery.uaMatch = function( ua ) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || - /(webkit)[ \/]([\w.]+)/.exec( ua ) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || - /(msie) ([\w.]+)/.exec( ua ) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; -}; - - -// Don't clobber any existing jQuery.browser in case it's different -if ( !jQuery.browser ) { - matched = jQuery.uaMatch( navigator.userAgent ); - browser = {}; - - if ( matched.browser ) { - browser[ matched.browser ] = true; - browser.version = matched.version; - } - - // Chrome is Webkit, but Webkit is also Safari. - if ( browser.chrome ) { - browser.webkit = true; - } else if ( browser.webkit ) { - browser.safari = true; - } - - jQuery.browser = browser; -} - -jQuery.fn.toggle = function( fn, fn2 ) { - - // Don't mess with animation or css toggles - if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) { - return oldToggle.apply( this, arguments ); - } - - // Save reference to arguments for access in closure - var args = arguments, - guid = fn.guid || jQuery.guid++, - i = 0, - toggler = function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - }; - - // link all the functions, so any of them can unbind this click handler - toggler.guid = guid; - while ( i < args.length ) { - args[ i++ ].guid = guid; - } - - return this.click( toggler ); -}; diff --git a/view/js/main.js b/view/js/main.js index 8c48bbb72..85aea9875 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -269,9 +269,9 @@ } // fancyboxes - $("a.popupbox").fancybox({ - 'transitionIn' : 'elastic', - 'transitionOut' : 'elastic' + // Is this actually used anywhere? + $("a.popupbox").colorbox({ + 'transition' : 'elastic' }); @@ -598,14 +598,15 @@ function updateConvItems(mode,data) { $(".wall-item-body, .contact-info").each(function() { if($(this).height() > divmore_height + 10) { if(! $(this).hasClass('divmore')) { - $(this).divgrow({ initialHeight: divmore_height, moreText: aStr['divgrowmore'], lessText: aStr['divgrowless'], showBrackets: false }); + $(this).readmore({collapsedHeight: divmore_height, moreLink: '<a href="#">'+aStr['divgrowmore']+'</a>', lessLink: '<a href="#">'+aStr['divgrowless']+'</a>'}); $(this).addClass('divmore'); } - } + } }); } function liveUpdate() { + if(typeof profile_uid === 'undefined') profile_uid = false; /* Should probably be unified with channelId defined in head.tpl */ if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').spin(false); return; } if(($('.comment-edit-text-full').length) || (in_progress)) { if(livetime) { diff --git a/view/php/theme_init.php b/view/php/theme_init.php index 33b7e87dc..d43a87046 100644 --- a/view/php/theme_init.php +++ b/view/php/theme_init.php @@ -2,11 +2,9 @@ require_once('include/plugin.php'); -head_add_css('library/fancybox/jquery.fancybox-1.3.4.css'); head_add_css('library/tiptip/tipTip.css'); head_add_css('library/jgrowl/jquery.jgrowl.css'); -head_add_css('library/jslider/css/jslider.css'); -head_add_css('library/colorbox/colorbox.css'); +head_add_css('library/jRange/jquery.range.css'); head_add_css('view/css/conversation.css'); head_add_css('view/css/widgets.css'); @@ -23,9 +21,9 @@ head_add_js('jquery.spin.js'); head_add_js('jquery.textinputs.js'); head_add_js('autocomplete.js'); head_add_js('library/jquery-textcomplete/jquery.textcomplete.js'); -head_add_js('library/fancybox/jquery.fancybox-1.3.4.js'); +head_add_js('library/colorbox/jquery.colorbox.js'); head_add_js('library/jquery.timeago.js'); -head_add_js('library/jquery.divgrow/jquery.divgrow-1.3.1.js'); +head_add_js('library/readmore.js/readmore.js'); head_add_js('library/jquery_ac/friendica.complete.js'); head_add_js('library/tiptip/jquery.tipTip.minified.js'); head_add_js('library/jgrowl/jquery.jgrowl_minimized.js'); @@ -39,7 +37,7 @@ head_add_js('acl.js'); head_add_js('webtoolkit.base64.js'); head_add_js('main.js'); head_add_js('crypto.js'); -head_add_js('library/jslider/bin/jquery.slider.min.js'); +head_add_js('library/jRange/jquery.range.js'); head_add_js('docready.js'); head_add_js('library/colorbox/jquery.colorbox-min.js'); head_add_js('library/bootstrap-tagsinput/bootstrap-tagsinput.js'); diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 7a6ceb968..842e7063a 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1028,7 +1028,7 @@ footer { background: none repeat scroll 0% 0% $cal_bgcolour !important; } -#fancybox-content { +#colorbox { border: 0px solid $fancybox_bgcolour; background-color: $fancybox_bgcolour; } @@ -2352,6 +2352,8 @@ aside .nav > li > a:hover, aside .nav > li > a:focus { border: 1px solid #cccccc; } +/* Abusing theme-green is less work than makeing a new new one */ +.theme-green .back-bar .selected-bar { background-color: #000000; background-image: none; !important } /* Turn checkboxes into switches */ diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl index 0003ddfc0..caeddeecb 100755 --- a/view/tpl/admin_site.tpl +++ b/view/tpl/admin_site.tpl @@ -1,15 +1,15 @@ <script> $(function(){ - $("#cnftheme").fancybox({ + $("#cnftheme").colorbox({ width: 800, - autoDimensions: false, - onStart: function(){ + onLoad: function(){ var theme = $("#id_theme :selected").val(); $("#cnftheme").attr('href',"{{$baseurl}}/admin/themes/"+theme); }, onComplete: function(){ - $("div#fancybox-content form").submit(function(e){ + $(this).colorbox.resize(); + $("#colorbox form").submit(function(e){ var url = $(this).attr('action'); // can't get .serialize() to work... var data={}; diff --git a/view/tpl/contact_slider.tpl b/view/tpl/contact_slider.tpl index 93d0cc625..09a79edd8 100755 --- a/view/tpl/contact_slider.tpl +++ b/view/tpl/contact_slider.tpl @@ -1,4 +1,4 @@ <div id="contact-slider" class="slider" style="height: 32px; position: relative; left: 5%; width: 90%;"><input id="contact-range" type="text" name="fake-closeness" value="{{$val}}" /></div> <script> - $("#contact-range").slider({ from: {{$min|default:'0'}}, to: 99, step: 1, scale: ['{{$me}}', '|', '{{$intimate}}', '|', '{{$friends}}', '|', '{{$oldfriends}}', '|', '{{$acquaintances}}', '|', '{{$world}}' ], onstatechange: function(v) { $("#contact-closeness-mirror").val(v); } }); + $("#contact-range").jRange({ from: {{$min|default:'0'}}, to: 99, step: 1, scale: ['{{$me}}', '|', '{{$intimate}}', '|', '{{$friends}}', '|', '{{$oldfriends}}', '|', '{{$acquaintances}}', '|', '{{$world}}' ], width:'100%', showLabels: false, onstatechange: function(v) { $("#contact-closeness-mirror").val(v); } }); </script> diff --git a/view/tpl/main_slider.tpl b/view/tpl/main_slider.tpl index fbc290df1..c8f3d2e06 100755 --- a/view/tpl/main_slider.tpl +++ b/view/tpl/main_slider.tpl @@ -2,8 +2,8 @@ <script> var old_cmin = 0; var old_cmax = 99; - $("#main-range").slider({ from: 0, to: 99, step: 1, scale: ['{{$me}}', '|', '{{$intimate}}', '|', '{{$friends}}', '|', '{{$oldfriends}}', '|', '{{$acquaintances}}', '|', '{{$world}}' ], onstatechange: function(v) { - var carr = v.split(";"); + $("#main-range").jRange({ isRange: true, from: 0, to: 99, step: 1, scale: ['{{$me}}', '|', '{{$intimate}}', '|', '{{$friends}}', '|', '{{$oldfriends}}', '|', '{{$acquaintances}}', '|', '{{$world}}' ], width:'100%', showLabels: false, onstatechange: function(v) { + var carr = v.split(","); if(carr[0] != bParam_cmin) { old_cmin = bParam_cmin; bParam_cmin = carr[0]; |