From 3524ef0c26f8760615c01217045c72f9bb20dde9 Mon Sep 17 00:00:00 2001 From: Richard Worth Date: Sat, 7 Jun 2008 17:35:27 +0000 Subject: removed extra level ui folder --- source/effects.blind.js | 50 ++ source/effects.bounce.js | 79 ++ source/effects.clip.js | 54 ++ source/effects.core.js | 510 +++++++++++++ source/effects.drop.js | 51 ++ source/effects.explode.js | 80 ++ source/effects.fold.js | 52 ++ source/effects.highlight.js | 49 ++ source/effects.pulsate.js | 56 ++ source/effects.scale.js | 180 +++++ source/effects.shake.js | 58 ++ source/effects.slide.js | 51 ++ source/effects.transfer.js | 59 ++ source/i18n/ui.datepicker-am.js | 22 + source/i18n/ui.datepicker-ar.js | 31 + source/i18n/ui.datepicker-bg.js | 22 + source/i18n/ui.datepicker-ca.js | 22 + source/i18n/ui.datepicker-cs.js | 22 + source/i18n/ui.datepicker-da.js | 22 + source/i18n/ui.datepicker-de.js | 22 + source/i18n/ui.datepicker-es.js | 22 + source/i18n/ui.datepicker-fi.js | 24 + source/i18n/ui.datepicker-fr.js | 22 + source/i18n/ui.datepicker-he.js | 22 + source/i18n/ui.datepicker-hu.js | 22 + source/i18n/ui.datepicker-id.js | 22 + source/i18n/ui.datepicker-is.js | 22 + source/i18n/ui.datepicker-it.js | 22 + source/i18n/ui.datepicker-ja.js | 22 + source/i18n/ui.datepicker-ko.js | 22 + source/i18n/ui.datepicker-lt.js | 25 + source/i18n/ui.datepicker-lv.js | 24 + source/i18n/ui.datepicker-nl.js | 21 + source/i18n/ui.datepicker-no.js | 23 + source/i18n/ui.datepicker-pl.js | 22 + source/i18n/ui.datepicker-pt-BR.js | 22 + source/i18n/ui.datepicker-ro.js | 22 + source/i18n/ui.datepicker-ru.js | 22 + source/i18n/ui.datepicker-sk.js | 22 + source/i18n/ui.datepicker-sv.js | 22 + source/i18n/ui.datepicker-th.js | 22 + source/i18n/ui.datepicker-tr.js | 22 + source/i18n/ui.datepicker-ua.js | 22 + source/i18n/ui.datepicker-zh-CN.js | 22 + source/i18n/ui.datepicker-zh-TW.js | 23 + source/ui.accordion.js | 302 ++++++++ source/ui.core.js | 289 +++++++ source/ui.datepicker.js | 1450 ++++++++++++++++++++++++++++++++++++ source/ui.dialog.js | 445 +++++++++++ source/ui.draggable.js | 552 ++++++++++++++ source/ui.droppable.js | 283 +++++++ source/ui.resizable.js | 729 ++++++++++++++++++ source/ui.selectable.js | 266 +++++++ source/ui.slider.js | 424 +++++++++++ source/ui.sortable.js | 665 +++++++++++++++++ source/ui.tabs.js | 595 +++++++++++++++ 56 files changed, 8050 insertions(+) create mode 100644 source/effects.blind.js create mode 100644 source/effects.bounce.js create mode 100644 source/effects.clip.js create mode 100644 source/effects.core.js create mode 100644 source/effects.drop.js create mode 100644 source/effects.explode.js create mode 100644 source/effects.fold.js create mode 100644 source/effects.highlight.js create mode 100644 source/effects.pulsate.js create mode 100644 source/effects.scale.js create mode 100644 source/effects.shake.js create mode 100644 source/effects.slide.js create mode 100644 source/effects.transfer.js create mode 100644 source/i18n/ui.datepicker-am.js create mode 100644 source/i18n/ui.datepicker-ar.js create mode 100644 source/i18n/ui.datepicker-bg.js create mode 100644 source/i18n/ui.datepicker-ca.js create mode 100644 source/i18n/ui.datepicker-cs.js create mode 100644 source/i18n/ui.datepicker-da.js create mode 100644 source/i18n/ui.datepicker-de.js create mode 100644 source/i18n/ui.datepicker-es.js create mode 100644 source/i18n/ui.datepicker-fi.js create mode 100644 source/i18n/ui.datepicker-fr.js create mode 100644 source/i18n/ui.datepicker-he.js create mode 100644 source/i18n/ui.datepicker-hu.js create mode 100644 source/i18n/ui.datepicker-id.js create mode 100644 source/i18n/ui.datepicker-is.js create mode 100644 source/i18n/ui.datepicker-it.js create mode 100644 source/i18n/ui.datepicker-ja.js create mode 100644 source/i18n/ui.datepicker-ko.js create mode 100644 source/i18n/ui.datepicker-lt.js create mode 100644 source/i18n/ui.datepicker-lv.js create mode 100644 source/i18n/ui.datepicker-nl.js create mode 100644 source/i18n/ui.datepicker-no.js create mode 100644 source/i18n/ui.datepicker-pl.js create mode 100644 source/i18n/ui.datepicker-pt-BR.js create mode 100644 source/i18n/ui.datepicker-ro.js create mode 100644 source/i18n/ui.datepicker-ru.js create mode 100644 source/i18n/ui.datepicker-sk.js create mode 100644 source/i18n/ui.datepicker-sv.js create mode 100644 source/i18n/ui.datepicker-th.js create mode 100644 source/i18n/ui.datepicker-tr.js create mode 100644 source/i18n/ui.datepicker-ua.js create mode 100644 source/i18n/ui.datepicker-zh-CN.js create mode 100644 source/i18n/ui.datepicker-zh-TW.js create mode 100644 source/ui.accordion.js create mode 100644 source/ui.core.js create mode 100644 source/ui.datepicker.js create mode 100644 source/ui.dialog.js create mode 100644 source/ui.draggable.js create mode 100644 source/ui.droppable.js create mode 100644 source/ui.resizable.js create mode 100644 source/ui.selectable.js create mode 100644 source/ui.slider.js create mode 100644 source/ui.sortable.js create mode 100644 source/ui.tabs.js (limited to 'source') diff --git a/source/effects.blind.js b/source/effects.blind.js new file mode 100644 index 000000000..34dd829e8 --- /dev/null +++ b/source/effects.blind.js @@ -0,0 +1,50 @@ +/* + * jQuery UI Effects Blind + * + * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Blind + * + * Depends: + * effects.core.js + * + */ +(function($) { + +$.effects.blind = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'vertical'; // Default direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = (direction == 'vertical') ? 'height' : 'width'; + var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width(); + if(mode == 'show') wrapper.css(ref, 0); // Shift + + // Animation + var animation = {}; + animation[ref] = mode == 'show' ? distance : 0; + + // Animate + wrapper.animate(animation, o.duration, o.options.easing, function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }); + + }); + +}; + +})(jQuery); diff --git a/source/effects.bounce.js b/source/effects.bounce.js new file mode 100644 index 000000000..85f843fab --- /dev/null +++ b/source/effects.bounce.js @@ -0,0 +1,79 @@ +/* + * jQuery UI Effects Bounce + * + * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Bounce + * + * Depends: + * effects.core.js + * + */ +(function($) { + +$.effects.bounce = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var direction = o.options.direction || 'up'; // Default direction + var distance = o.options.distance || 20; // Default distance + var times = o.options.times || 5; // Default # of times + var speed = o.duration || 250; // Default speed per bounce + if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3); + if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift + if (mode == 'hide') distance = distance / (times * 2); + if (mode != 'hide') times--; + + // Animate + if (mode == 'show') { // Show Bounce + var animation = {opacity: 1}; + animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation, speed / 2, o.options.easing); + distance = distance / 2; + times--; + }; + for (var i = 0; i < times; i++) { // Bounces + var animation1 = {}, animation2 = {}; + animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing); + distance = (mode == 'hide') ? distance * 2 : distance / 2; + }; + if (mode == 'hide') { // Last Bounce + var animation = {opacity: 0}; + animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + el.animate(animation, speed / 2, o.options.easing, function(){ + el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + } else { + var animation1 = {}, animation2 = {}; + animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){ + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + }; + el.queue('fx', function() { el.dequeue(); }); + el.dequeue(); + }); + +}; + +})(jQuery); diff --git a/source/effects.clip.js b/source/effects.clip.js new file mode 100644 index 000000000..fc0fb22ad --- /dev/null +++ b/source/effects.clip.js @@ -0,0 +1,54 @@ +/* + * jQuery UI Effects Clip + * + * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Clip + * + * Depends: + * effects.core.js + * + */ +(function($) { + +$.effects.clip = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left','width','height']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'vertical'; // Default direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = { + size: (direction == 'vertical') ? 'height' : 'width', + position: (direction == 'vertical') ? 'top' : 'left' + }; + var distance = (direction == 'vertical') ? el.height() : el.width(); + if(mode == 'show') { el.css(ref.size, 0); el.css(ref.position, distance / 2); } // Shift + + // Animation + var animation = {}; + animation[ref.size] = mode == 'show' ? distance : 0; + animation[ref.position] = mode == 'show' ? 0 : distance / 2; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); diff --git a/source/effects.core.js b/source/effects.core.js new file mode 100644 index 000000000..c8641d97c --- /dev/null +++ b/source/effects.core.js @@ -0,0 +1,510 @@ +/* + * jQuery UI Effects + * + * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/ + * + */ +;(function($) { + +$.effects = $.effects || {}; //Add the 'effects' scope + +$.extend($.effects, { + save: function(el, set) { + for(var i=0;i'); + var wrapper = el.parent(); + if (el.css('position') == 'static'){ + wrapper.css({position: 'relative'}); + el.css({position: 'relative'}); + } else { + var top = parseInt(el.css('top'), 10); if(isNaN(top)) top = 'auto'; + var left = parseInt(el.css('left'), 10); if(isNaN(top)) left = 'auto'; + wrapper.css({ position: el.css('position'), top: top, left: left, zIndex: el.css('z-index') }).show(); + el.css({position: 'relative', top:0, left:0}); + } + wrapper.css(props); + return wrapper; + }, + removeWrapper: function(el) { + if (el.parent().attr('id') == 'fxWrapper') + return el.parent().replaceWith(el); + return el; + }, + setTransition: function(el, list, factor, val) { + val = val || {}; + $.each(list,function(i, x){ + unit = el.cssUnit(x); + if (unit[0] > 0) val[x] = unit[0] * factor + unit[1]; + }); + return val; + }, + animateClass: function(value, duration, easing, callback) { + + var cb = (typeof easing == "function" ? easing : (callback ? callback : null)); + var ea = (typeof easing == "object" ? easing : null); + + return this.each(function() { + + var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || ''; + if(typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */ + if(value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; } + + //Let's get a style offset + var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle)); + if(value.add) that.addClass(value.add); if(value.remove) that.removeClass(value.remove); + var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle)); + if(value.add) that.removeClass(value.add); if(value.remove) that.addClass(value.remove); + + // The main function to form the object for animation + for(var n in newStyle) { + if( typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */ + && n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */ + && newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */ + && (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */ + && (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */ + ) offset[n] = newStyle[n]; + } + + that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object + // Change style attribute back to original. For stupid IE, we need to clear the damn object. + if(typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr); + if(value.add) $(this).addClass(value.add); if(value.remove) $(this).removeClass(value.remove); + if(cb) cb.apply(this, arguments); + }); + + }); + } +}); + +//Extend the methods of jQuery +$.fn.extend({ + //Save old methods + _show: $.fn.show, + _hide: $.fn.hide, + __toggle: $.fn.toggle, + _addClass: $.fn.addClass, + _removeClass: $.fn.removeClass, + _toggleClass: $.fn.toggleClass, + // New ec methods + effect: function(fx,o,speed,callback) { + return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: o || {}, duration: speed, callback: callback }) : null; + }, + show: function() { + if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0]))) + return this._show.apply(this, arguments); + else { + var o = arguments[1] || {}; o['mode'] = 'show'; + return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]); + } + }, + hide: function() { + if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0]))) + return this._hide.apply(this, arguments); + else { + var o = arguments[1] || {}; o['mode'] = 'hide'; + return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]); + } + }, + toggle: function(){ + if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])) || (arguments[0].constructor == Function)) + return this.__toggle.apply(this, arguments); + else { + var o = arguments[1] || {}; o['mode'] = 'toggle'; + return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]); + } + }, + addClass: function(classNames,speed,easing,callback) { + return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames); + }, + removeClass: function(classNames,speed,easing,callback) { + return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames); + }, + toggleClass: function(classNames,speed,easing,callback) { + return speed ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames); + }, + morph: function(remove,add,speed,easing,callback) { + return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]); + }, + switchClass: function() { + return this.morph.apply(this, arguments); + }, + // helper functions + cssUnit: function(key) { + var style = this.css(key), val = []; + $.each( ['em','px','%','pt'], function(i, unit){ + if(style.indexOf(unit) > 0) + val = [parseFloat(style), unit]; + }); + return val; + } +}); + +/* + * jQuery Color Animations + * Copyright 2007 John Resig + * Released under the MIT and GPL licenses. + */ + +// We override the animation for all of these color styles +jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){ + jQuery.fx.step[attr] = function(fx){ + if ( fx.state == 0 ) { + fx.start = getColor( fx.elem, attr ); + fx.end = getRGB( fx.end ); + } + + fx.elem.style[attr] = "rgb(" + [ + Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), + Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), + Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) + ].join(",") + ")"; + } +}); + +// Color Conversion functions from highlightFade +// By Blair Mitchelmore +// http://jquery.offput.ca/highlightFade/ + +// Parse strings looking for color tuples [255,255,255] +function getRGB(color) { + var result; + + // Check if we're already dealing with an array of colors + if ( color && color.constructor == Array && color.length == 3 ) + return color; + + // Look for rgb(num,num,num) + if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) + return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])]; + + // Look for rgb(num%,num%,num%) + if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) + return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; + + // Look for #a0b1c2 + if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) + return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; + + // Look for #fff + if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) + return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; + + // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 + if (result = /rgba\(0, 0, 0, 0\)/.exec(color)) + return colors['transparent'] + + // Otherwise, we're most likely dealing with a named color + return colors[jQuery.trim(color).toLowerCase()]; +} + +function getColor(elem, attr) { + var color; + + do { + color = jQuery.curCSS(elem, attr); + + // Keep going until we find an element that has color, or we hit the body + if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") ) + break; + + attr = "backgroundColor"; + } while ( elem = elem.parentNode ); + + return getRGB(color); +}; + +// Some named colors to work with +// From Interface by Stefan Petre +// http://interface.eyecon.ro/ + +var colors = { + aqua:[0,255,255], + azure:[240,255,255], + beige:[245,245,220], + black:[0,0,0], + blue:[0,0,255], + brown:[165,42,42], + cyan:[0,255,255], + darkblue:[0,0,139], + darkcyan:[0,139,139], + darkgrey:[169,169,169], + darkgreen:[0,100,0], + darkkhaki:[189,183,107], + darkmagenta:[139,0,139], + darkolivegreen:[85,107,47], + darkorange:[255,140,0], + darkorchid:[153,50,204], + darkred:[139,0,0], + darksalmon:[233,150,122], + darkviolet:[148,0,211], + fuchsia:[255,0,255], + gold:[255,215,0], + green:[0,128,0], + indigo:[75,0,130], + khaki:[240,230,140], + lightblue:[173,216,230], + lightcyan:[224,255,255], + lightgreen:[144,238,144], + lightgrey:[211,211,211], + lightpink:[255,182,193], + lightyellow:[255,255,224], + lime:[0,255,0], + magenta:[255,0,255], + maroon:[128,0,0], + navy:[0,0,128], + olive:[128,128,0], + orange:[255,165,0], + pink:[255,192,203], + purple:[128,0,128], + violet:[128,0,128], + red:[255,0,0], + silver:[192,192,192], + white:[255,255,255], + yellow:[255,255,0], + transparent: [255,255,255] +}; + +/* + * 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 +jQuery.easing['jswing'] = jQuery.easing['swing']; + +jQuery.extend( jQuery.easing, +{ + def: 'easeOutQuad', + swing: function (x, t, b, c, d) { + //alert(jQuery.easing.default); + return jQuery.easing[jQuery.easing.def](x, t, b, c, d); + }, + easeInQuad: function (x, t, b, c, d) { + return c*(t/=d)*t + b; + }, + easeOutQuad: function (x, t, b, c, d) { + return -c *(t/=d)*(t-2) + b; + }, + easeInOutQuad: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t + b; + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + easeInCubic: function (x, t, b, c, d) { + return c*(t/=d)*t*t + b; + }, + easeOutCubic: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t + 1) + b; + }, + easeInOutCubic: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t + b; + return c/2*((t-=2)*t*t + 2) + b; + }, + easeInQuart: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t + b; + }, + easeOutQuart: function (x, t, b, c, d) { + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + easeInOutQuart: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t + b; + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + easeInQuint: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t*t + b; + }, + easeOutQuint: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t*t*t + 1) + b; + }, + easeInOutQuint: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; + return c/2*((t-=2)*t*t*t*t + 2) + b; + }, + easeInSine: function (x, t, b, c, d) { + return -c * Math.cos(t/d * (Math.PI/2)) + c + b; + }, + easeOutSine: function (x, t, b, c, d) { + return c * Math.sin(t/d * (Math.PI/2)) + b; + }, + easeInOutSine: function (x, t, b, c, d) { + return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; + }, + easeInExpo: function (x, t, b, c, d) { + return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; + }, + easeOutExpo: function (x, t, b, c, d) { + return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; + }, + easeInOutExpo: function (x, t, b, c, d) { + if (t==0) return b; + if (t==d) return b+c; + if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; + return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + easeInCirc: function (x, t, b, c, d) { + return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; + }, + easeOutCirc: function (x, t, b, c, d) { + return c * Math.sqrt(1 - (t=t/d-1)*t) + b; + }, + easeInOutCirc: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; + }, + easeInElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + easeOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + easeInOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + easeInBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + easeOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + easeInOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + easeInBounce: function (x, t, b, c, d) { + return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; + }, + easeOutBounce: function (x, t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } else { + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + } + }, + easeInOutBounce: function (x, t, b, c, d) { + if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; + return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; + } +}); + +/* + * + * 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. + * + */ + +})(jQuery); diff --git a/source/effects.drop.js b/source/effects.drop.js new file mode 100644 index 000000000..e45bc9bd3 --- /dev/null +++ b/source/effects.drop.js @@ -0,0 +1,51 @@ +/* + * jQuery UI Effects Drop + * + * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Drop + * + * Depends: + * effects.core.js + * + */ +(function($) { + +$.effects.drop = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left','opacity']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'left'; // Default Direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2); + if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift + + // Animation + var animation = {opacity: mode == 'show' ? 1 : 0}; + animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); diff --git a/source/effects.explode.js b/source/effects.explode.js new file mode 100644 index 000000000..8e93e6d6e --- /dev/null +++ b/source/effects.explode.js @@ -0,0 +1,80 @@ +/* + * jQuery UI Effects Explode + * + * Copyright (c) 2008 Paul Bakaus (ui.jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Explode + * + * Depends: + * effects.core.js + * + */ +(function($) { + +$.effects.explode = function(o) { + + return this.queue(function() { + + var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; + var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; + + o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode; + var el = $(this).show().css('visibility', 'hidden'); + var offset = el.offset(); + + //Substract the margins - not fixing the problem yet. + offset.top -= parseInt(el.css("marginTop")) || 0; + offset.left -= parseInt(el.css("marginLeft")) || 0; + + var width = el.outerWidth(true); + var height = el.outerHeight(true); + + for(var i=0;i') + .css({ + position: 'absolute', + visibility: 'visible', + left: -j*(width/cells), + top: -i*(height/rows) + }) + .parent() + .addClass('effects-explode') + .css({ + position: 'absolute', + overflow: 'hidden', + width: width/cells, + height: height/rows, + left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0), + top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0), + opacity: o.options.mode == 'show' ? 0 : 1 + }).animate({ + left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)), + top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)), + opacity: o.options.mode == 'show' ? 1 : 0 + }, o.duration || 500); + } + } + + // Set a timeout, to call the callback approx. when the other animations have finished + setTimeout(function() { + + o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide(); + if(o.callback) o.callback.apply(el[0]); // Callback + el.dequeue(); + + $('.effects-explode').remove(); + + }, o.duration || 500); + + + }); + +}; + +})(jQuery); diff --git a/source/effects.fold.js b/source/effects.fold.js new file mode 100644 index 000000000..b006df978 --- /dev/null +++ b/source/effects.fold.js @@ -0,0 +1,52 @@ +/* + * jQuery UI Effects Fold + * + * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * effects.core.js + * + */ +(function($) { + +$.effects.fold = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var size = o.options.size || 15; // Default fold size + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = (mode == 'show') ? ['width', 'height'] : ['height', 'width']; + var distance = (mode == 'show') ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()]; + if(mode == 'show') wrapper.css({height: size, width: 0}); // Shift + + // Animation + var animation1 = {}, animation2 = {}; + animation1[ref[0]] = mode == 'show' ? distance[0] : size; + animation2[ref[1]] = mode == 'show' ? distance[1] : 0; + + // Animate + wrapper.animate(animation1, o.duration / 2, o.options.easing) + .animate(animation2, o.duration / 2, o.options.easing, function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }); + + }); + +}; + +})(jQuery); diff --git a/source/effects.highlight.js b/source/effects.highlight.js new file mode 100644 index 000000000..9d6e3a1b1 --- /dev/null +++ b/source/effects.highlight.js @@ -0,0 +1,49 @@ +/* + * jQuery UI Effects Highlight + * + * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * effects.core.js + * + */ +;(function($) { + +$.effects.highlight = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['backgroundImage','backgroundColor','opacity']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode + var color = o.options.color || "#ffff99"; // Default highlight color + var oldColor = el.css("backgroundColor"); + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + el.css({backgroundImage: 'none', backgroundColor: color}); // Shift + + // Animation + var animation = {backgroundColor: oldColor }; + if (mode == "hide") animation['opacity'] = 0; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == "hide") el.hide(); + $.effects.restore(el, props); + if (mode == "show" && jQuery.browser.msie) this.style.removeAttribute('filter'); + if(o.callback) o.callback.apply(this, arguments); + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); diff --git a/source/effects.pulsate.js b/source/effects.pulsate.js new file mode 100644 index 000000000..690e79805 --- /dev/null +++ b/source/effects.pulsate.js @@ -0,0 +1,56 @@ +/* + * jQuery UI Effects Pulsate + * + * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * effects.core.js + * + */ +(function($) { + +$.effects.pulsate = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this); + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode + var times = o.options.times || 5; // Default # of times + + // Adjust + if (mode != 'hide') times--; + if (el.is(':hidden')) { // Show fadeIn + el.css('opacity', 0); + el.show(); // Show + el.animate({opacity: 1}, o.duration / 2, o.options.easing); + times--; + } + + // Animate + for (var i = 0; i < times; i++) { // Pulsate + el.animate({opacity: 0}, o.duration / 2, o.options.easing).animate({opacity: 1}, o.duration / 2, o.options.easing); + }; + if (mode == 'hide') { // Last Pulse + el.animate({opacity: 0}, o.duration / 2, o.options.easing, function(){ + el.hide(); // Hide + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + } else { + el.animate({opacity: 0}, o.duration / 2, o.options.easing).animate({opacity: 1}, o.duration / 2, o.options.easing, function(){ + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + }; + el.queue('fx', function() { el.dequeue(); }); + el.dequeue(); + }); + +}; + +})(jQuery); diff --git a/source/effects.scale.js b/source/effects.scale.js new file mode 100644 index 000000000..7bf8fdf9d --- /dev/null +++ b/source/effects.scale.js @@ -0,0 +1,180 @@ +/* + * jQuery UI Effects Scale + * + * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Scale + * + * Depends: + * effects.core.js + * + */ +(function($) { + +$.effects.puff = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this); + + // Set options + var options = $.extend(true, {}, o); + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var percent = parseInt(o.options.percent) || 150; // Set default puff percent + options.fade = true; // It's not a puff if it doesn't fade! :) + var original = {height: el.height(), width: el.width()}; // Save original + + // Adjust + var factor = percent / 100; + el.from = (mode == 'hide') ? original : {height: original.height * factor, width: original.width * factor}; + + // Animation + options.from = el.from; + options.percent = (mode == 'hide') ? percent : 100; + options.mode = mode; + + // Animate + el.effect('scale', options, o.duration, o.callback); + el.dequeue(); + }); + +}; + +$.effects.scale = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this); + + // Set options + var options = $.extend(true, {}, o); + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var percent = parseInt(o.options.percent) || (parseInt(o.options.percent) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent + var direction = o.options.direction || 'both'; // Set default axis + var origin = o.options.origin; // The origin of the scaling + if (mode != 'effect') { // Set default origin and restore for show/hide + origin = origin || ['middle','center']; + options.restore = true; + } + var original = {height: el.height(), width: el.width()}; // Save original + el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state + + // Adjust + var factor = { // Set scaling factor + y: direction != 'horizontal' ? (percent / 100) : 1, + x: direction != 'vertical' ? (percent / 100) : 1 + }; + el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state + if (origin) { // Calculate baseline shifts + var baseline = $.effects.getBaseline(origin, original); + el.from.top = (original.height - el.from.height) * baseline.y; + el.from.left = (original.width - el.from.width) * baseline.x; + el.to.top = (original.height - el.to.height) * baseline.y; + el.to.left = (original.width - el.to.width) * baseline.x; + }; + if (o.options.fade) { // Fade option to support puff + if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;}; + if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;}; + }; + + // Animation + options.from = el.from; options.to = el.to; options.mode = mode; + + // Animate + el.effect('size', options, o.duration, o.callback); + el.dequeue(); + }); + +}; + +$.effects.size = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left','width','height','overflow','opacity']; + var props1 = ['position','overflow','opacity']; // Always restore + var props2 = ['width','height','overflow']; // Copy for children + var cProps = ['fontSize']; + var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom']; + var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var restore = o.options.restore || false; // Default restore + var scale = o.options.scale || 'both'; // Default scale mode + var original = {height: el.height(), width: el.width()}; // Save original + el.from = o.options.from || original; // Default from state + el.to = o.options.to || original; // Default to state + + // Adjust + var factor = { // Set scaling factor + from: {y: el.from.height / original.height, x: el.from.width / original.width}, + to: {y: el.to.height / original.height, x: el.to.width / original.width} + }; + if (scale == 'box' || scale == 'both') { // Scale the css box + if (factor.from.y != factor.to.y) { // Vertical props scaling + props = props.concat(vProps); + el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from); + el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to); + }; + if (factor.from.x != factor.to.x) { // Horizontal props scaling + props = props.concat(hProps); + el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from); + el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to); + }; + }; + if (scale == 'content' || scale == 'both') { // Scale the content + if (factor.from.y != factor.to.y) { // Vertical props scaling + props = props.concat(cProps); + el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from); + el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to); + }; + }; + $.effects.save(el, restore ? props : props1); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + el.css('overflow','hidden').css(el.from); // Shift + + // Animate + if (scale == 'content' || scale == 'both') { // Scale the children + vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size + hProps = hProps.concat(['marginLeft','marginRight']); // Add margins + props2 = props.concat(vProps).concat(hProps); // Concat + el.find("*[width]").each(function(){ + child = $(this); + if (restore) $.effects.save(child, props2); + var c_original = {height: child.height(), width: child.width()}; // Save original + child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x}; + child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x}; + if (factor.from.y != factor.to.y) { // Vertical props scaling + child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from); + child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to); + }; + if (factor.from.x != factor.to.x) { // Horizontal props scaling + child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from); + child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to); + }; + child.css(child.from); // Shift children + child.animate(child.to, o.duration, o.options.easing, function(){ + if (restore) $.effects.restore(child, props2); // Restore children + }); // Animate children + }); + }; + + // Animate + el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); diff --git a/source/effects.shake.js b/source/effects.shake.js new file mode 100644 index 000000000..d1f54477e --- /dev/null +++ b/source/effects.shake.js @@ -0,0 +1,58 @@ +/* + * jQuery UI Effects Shake + * + * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Shake + * + * Depends: + * effects.core.js + * + */ +(function($) { + +$.effects.shake = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var direction = o.options.direction || 'left'; // Default direction + var distance = o.options.distance || 20; // Default distance + var times = o.options.times || 3; // Default # of times + var speed = o.duration || o.options.duration || 140; // Default speed per shake + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + + // Animation + var animation = {}, animation1 = {}, animation2 = {}; + animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2; + animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2; + + // Animate + el.animate(animation, speed, o.options.easing); + for (var i = 1; i < times; i++) { // Shakes + el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing); + }; + el.animate(animation1, speed, o.options.easing). + animate(animation, speed / 2, o.options.easing, function(){ // Last shake + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + el.queue('fx', function() { el.dequeue(); }); + el.dequeue(); + }); + +}; + +})(jQuery); diff --git a/source/effects.slide.js b/source/effects.slide.js new file mode 100644 index 000000000..ce76a5509 --- /dev/null +++ b/source/effects.slide.js @@ -0,0 +1,51 @@ +/* + * jQuery UI Effects Slide + * + * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Slide + * + * Depends: + * effects.core.js + * + */ +(function($) { + +$.effects.slide = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode + var direction = o.options.direction || 'left'; // Default Direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true})); + if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift + + // Animation + var animation = {}; + animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); diff --git a/source/effects.transfer.js b/source/effects.transfer.js new file mode 100644 index 000000000..7812c4e2b --- /dev/null +++ b/source/effects.transfer.js @@ -0,0 +1,59 @@ +/* + * jQuery UI Effects Transfer + * + * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Transfer + * + * Depends: + * effects.core.js + * + */ +(function($) { + +$.effects.transfer = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this); + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var target = $(o.options.to); // Find Target + var position = el.offset(); + var transfer = $('
').appendTo(document.body); + + // Set target css + transfer.addClass(o.options.className); + transfer.css({ + top: position.top, + left: position.left, + height: el.outerHeight(true) - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')), + width: el.outerWidth(true) - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth')), + position: 'absolute' + }); + + // Animation + position = target.offset(); + animation = { + top: position.top, + left: position.top, + height: target.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')), + width: target.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth')) + }; + + // Animate + transfer.animate(animation, o.duration, o.options.easing, function() { + transfer.remove(); // Remove div + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }); + + }); + +}; + +})(jQuery); diff --git a/source/i18n/ui.datepicker-am.js b/source/i18n/ui.datepicker-am.js new file mode 100644 index 000000000..32ba8c27a --- /dev/null +++ b/source/i18n/ui.datepicker-am.js @@ -0,0 +1,22 @@ +/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/ +jQuery(function($){ + $.datepicker.regional['am'] = {clearText: 'Մաքրել', clearStatus: '', + closeText: 'Փակել', closeStatus: '', + prevText: '<Նախ.', prevStatus: '', + nextText: 'Հաջ.>', nextStatus: '', + currentText: 'Այսօր', currentStatus: '', + monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս', + 'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'], + monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս', + 'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'], + monthStatus: '', yearStatus: '', + weekHeader: 'ՇԲՏ', weekStatus: '', + dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'], + dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], + dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['am']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-ar.js b/source/i18n/ui.datepicker-ar.js new file mode 100644 index 000000000..8e4e08562 --- /dev/null +++ b/source/i18n/ui.datepicker-ar.js @@ -0,0 +1,31 @@ +/* Arabic Translation for jQuery UI date picker plugin. */ +/* Khaled Al Horani -- koko.dw@gmail.com */ +jQuery(function($){ + $.datepicker.regional['ar'] = { + clearText: '', + clearStatus: ' ', + closeText: '', + closeStatus: ' ', + prevText: '<', + prevStatus: ' ', + nextText: '>', + nextStatus: ' ', + currentText: '', + currentStatus: ' ', + monthNames: [' ', '', '', '', '', '', '', '', '', ' ', ' ', ' '], + monthNamesShort: [' ', '', '', '', '', '', '', '', '', ' ', ' ', ' '], + monthStatus: ' ', + yearStatus: ' ', + weekHeader: '', + weekStatus: ' ', + dayNames: ['', '', '', '', '', '', ''], + dayNamesShort: ['', '', '', '', '', '', ''], + dayNamesMin: ['', '', '', '', '', '', ''], + dayStatus: ' DD ', + dateStatus: ' D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: ' ', + isRTL: true + }; + $.datepicker.setDefaults($.datepicker.regional['ar']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-bg.js b/source/i18n/ui.datepicker-bg.js new file mode 100644 index 000000000..1f1a81537 --- /dev/null +++ b/source/i18n/ui.datepicker-bg.js @@ -0,0 +1,22 @@ +/* German initialisation for the jQuery UI date picker plugin. */ +/* Written by Stoyan Kyosev (http://svest.org). */ +jQuery(function($){ + $.datepicker.regional['bg'] = {clearText: 'изчисти', clearStatus: 'изчисти актуалната дата', + closeText: 'затвори', closeStatus: 'затвори без промени', + prevText: '<назад', prevStatus: 'покажи последния месец', + nextText: 'напред>', nextStatus: 'покажи следващия месец', + currentText: 'днес', currentStatus: '', + monthNames: ['Януари','Февруари','Март','Април','Май','Юни', + 'Юли','Август','Септември','Октомври','Ноември','Декември'], + monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни', + 'Юли','Авг','Сеп','Окт','Нов','Дек'], + monthStatus: 'покажи друг месец', yearStatus: 'покажи друга година', + weekHeader: 'Wk', weekStatus: 'седмица от месеца', + dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'], + dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'], + dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'], + dayStatus: 'Сложи DD като първи ден от седмицата', dateStatus: 'Избери D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Избери дата', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['bg']); +}); diff --git a/source/i18n/ui.datepicker-ca.js b/source/i18n/ui.datepicker-ca.js new file mode 100644 index 000000000..709a96ae8 --- /dev/null +++ b/source/i18n/ui.datepicker-ca.js @@ -0,0 +1,22 @@ +/* Inicialitzaci en catal per a l'extenci 'calendar' per jQuery. */ +/* Writers: (joan.leon@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ca'] = {clearText: 'Netejar', clearStatus: '', + closeText: 'Tancar', closeStatus: '', + prevText: '<Ant', prevStatus: '', + nextText: 'Seg>', nextStatus: '', + currentText: 'Avui', currentStatus: '', + monthNames: ['Gener','Febrer','Març','Abril','Maig','Juny', + 'Juliol','Agost','Setembre','Octubre','Novembre','Decembre'], + monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun', + 'Jul','Ago','Set','Oct','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'], + dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'], + dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'mm/dd/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ca']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-cs.js b/source/i18n/ui.datepicker-cs.js new file mode 100644 index 000000000..e195deb43 --- /dev/null +++ b/source/i18n/ui.datepicker-cs.js @@ -0,0 +1,22 @@ +/* Czech initialisation for the jQuery UI date picker plugin. */ +/* Written by Tomas Muller (tomas@tomas-muller.net). */ +jQuery(function($){ + $.datepicker.regional['cs'] = {clearText: 'Vymazat', clearStatus: 'Vymaže zadané datum', + closeText: 'Zavřít', closeStatus: 'Zavře kalendář beze změny', + prevText: '<Dříve', prevStatus: 'Přejít na předchozí měsí', + nextText: 'Později>', nextStatus: 'Přejít na další měsíc', + currentText: 'Nyní', currentStatus: 'Přejde na aktuální měsíc', + monthNames: ['leden','únor','březen','duben','květen','červen', + 'červenec','srpen','září','říjen','listopad','prosinec'], + monthNamesShort: ['led','úno','bře','dub','kvě','čer', + 'čvc','srp','zář','říj','lis','pro'], + monthStatus: 'Přejít na jiný měsíc', yearStatus: 'Přejít na jiný rok', + weekHeader: 'Týd', weekStatus: 'Týden v roce', + dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], + dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], + dayNamesMin: ['ne','po','út','st','čt','pá','so'], + dayStatus: 'Nastavit DD jako první den v týdnu', dateStatus: '\'Vyber\' DD, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Vyberte datum', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['cs']); +}); diff --git a/source/i18n/ui.datepicker-da.js b/source/i18n/ui.datepicker-da.js new file mode 100644 index 000000000..794f6ef44 --- /dev/null +++ b/source/i18n/ui.datepicker-da.js @@ -0,0 +1,22 @@ +/* Danish initialisation for the jQuery UI date picker plugin. */ +/* Written by Jan Christensen ( deletestuff@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['da'] = {clearText: 'Nulstil', clearStatus: 'Nulstil den aktuelle dato', + closeText: 'Luk', closeStatus: 'Luk uden ændringer', + prevText: '<Forrige', prevStatus: 'Vis forrige måned', + nextText: 'Næste>', nextStatus: 'Vis næste måned', + currentText: 'Idag', currentStatus: 'Vis aktuel måned', + monthNames: ['Januar','Februar','Marts','April','Maj','Juni', + 'Juli','August','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + monthStatus: 'Vis en anden måned', yearStatus: 'Vis et andet år', + weekHeader: 'Uge', weekStatus: 'Årets uge', + dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], + dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], + dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], + dayStatus: 'Sæt DD som første ugedag', dateStatus: 'Vælg D, M d', + dateFormat: 'dd-mm-yy', firstDay: 0, + initStatus: 'Vælg en dato', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['da']); +}); diff --git a/source/i18n/ui.datepicker-de.js b/source/i18n/ui.datepicker-de.js new file mode 100644 index 000000000..d31af3a1b --- /dev/null +++ b/source/i18n/ui.datepicker-de.js @@ -0,0 +1,22 @@ +/* German initialisation for the jQuery UI date picker plugin. */ +/* Written by Milian Wolff (mail@milianw.de). */ +jQuery(function($){ + $.datepicker.regional['de'] = {clearText: 'löschen', clearStatus: 'aktuelles Datum löschen', + closeText: 'schließen', closeStatus: 'ohne Änderungen schließen', + prevText: '<zurück', prevStatus: 'letzten Monat zeigen', + nextText: 'Vor>', nextStatus: 'nächsten Monat zeigen', + currentText: 'heute', currentStatus: '', + monthNames: ['Januar','Februar','März','April','Mai','Juni', + 'Juli','August','September','Oktober','November','Dezember'], + monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dez'], + monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen', + weekHeader: 'Wo', weekStatus: 'Woche des Monats', + dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], + dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], + dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], + dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Wähle ein Datum', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['de']); +}); diff --git a/source/i18n/ui.datepicker-es.js b/source/i18n/ui.datepicker-es.js new file mode 100644 index 000000000..c5fdd719d --- /dev/null +++ b/source/i18n/ui.datepicker-es.js @@ -0,0 +1,22 @@ +/* Inicializacin en espaol para la extensin 'UI date picker' para jQuery. */ +/* Traducido por Vester (xvester@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['es'] = {clearText: 'Limpiar', clearStatus: '', + closeText: 'Cerrar', closeStatus: '', + prevText: '<Ant', prevStatus: '', + nextText: 'Sig>', nextStatus: '', + currentText: 'Hoy', currentStatus: '', + monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', + 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'], + monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', + 'Jul','Ago','Sep','Oct','Nov','Dic'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sádabo'], + dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'], + dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['es']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-fi.js b/source/i18n/ui.datepicker-fi.js new file mode 100644 index 000000000..550a980aa --- /dev/null +++ b/source/i18n/ui.datepicker-fi.js @@ -0,0 +1,24 @@ +/* Finnish initialisation for the jQuery UI date picker plugin. */ +/* Written by Harri Kilpi (harrikilpio@gmail.com). */ + +$(document).ready(function(){ + $.datepicker.regional['fi'] = { + clearText: 'Tyhjennä', clearStatus: '', + closeText: 'Sulje', closeStatus: '', + prevText: '«Edellinen', prevStatus: '', + nextText: 'Seuraava»', nextStatus: '', + currentText: 'Tänään', currentStatus: '', + monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kesäkuu', + 'Heinäkuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'], + monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kesä', + 'Heinä','Elo','Syys','Loka','Marras','Joulu'], + monthStatus: '', yearStatus: '', + weekHeader: 'Vk', weekStatus: '', + dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','Su'], + dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'], + dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['fi']); +}); diff --git a/source/i18n/ui.datepicker-fr.js b/source/i18n/ui.datepicker-fr.js new file mode 100644 index 000000000..b3e390706 --- /dev/null +++ b/source/i18n/ui.datepicker-fr.js @@ -0,0 +1,22 @@ +/* French initialisation for the jQuery UI date picker plugin. */ +/* Written by Keith Wood (kbwood@iprimus.com.au) and Stéphane Nahmani (sholby@sholby.net). */ +jQuery(function($){ + $.datepicker.regional['fr'] = {clearText: 'Effacer', clearStatus: '', + closeText: 'Fermer', closeStatus: 'Fermer sans modifier', + prevText: '<Préc', prevStatus: 'Voir le mois précédent', + nextText: 'Suiv>', nextStatus: 'Voir le mois suivant', + currentText: 'Courant', currentStatus: 'Voir le mois courant', + monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', + 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], + monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun', + 'Jul','Aoû','Sep','Oct','Nov','Déc'], + monthStatus: 'Voir un autre mois', yearStatus: 'Voir un autre année', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], + dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'], + dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'], + dayStatus: 'Utiliser DD comme premier jour de la semaine', dateStatus: 'Choisir le DD, MM d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: 'Choisir la date', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['fr']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-he.js b/source/i18n/ui.datepicker-he.js new file mode 100644 index 000000000..87f55f729 --- /dev/null +++ b/source/i18n/ui.datepicker-he.js @@ -0,0 +1,22 @@ +/* Hebrew initialisation for the UI Datepicker extension. */ +/* Written by Amir Hardon (ahardon at gmail dot com). */ +jQuery(document).ready(function(){ + jQuery.datepicker.regional['he'] = {clearText: 'נקה', clearStatus: '', + closeText: 'סגור', closeStatus: '', + prevText: '<הקודם', prevStatus: '', + nextText: 'הבא>', nextStatus: '', + currentText: 'היום', currentStatus: '', + monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני', + 'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'], + monthNamesShort: ['1','2','3','4','5','6', + '7','8','9','10','11','12'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'], + dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'], + dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'], + dayStatus: 'DD', dateStatus: 'DD, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: true}; + jQuery.datepicker.setDefaults($.datepicker.regional['he']); +}); diff --git a/source/i18n/ui.datepicker-hu.js b/source/i18n/ui.datepicker-hu.js new file mode 100644 index 000000000..1d71a3ddf --- /dev/null +++ b/source/i18n/ui.datepicker-hu.js @@ -0,0 +1,22 @@ +/* Hungarian initialisation for the jQuery UI date picker plugin. */ +/* Written by Istvan Karaszi (jquerycalendar@spam.raszi.hu). */ +jQuery(function($){ + $.datepicker.regional['hu'] = {clearText: 'törlés', clearStatus: '', + closeText: 'bezárás', closeStatus: '', + prevText: '« vissza', prevStatus: '', + nextText: 'előre »', nextStatus: '', + currentText: 'ma', currentStatus: '', + monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', + 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'], + monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún', + 'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Hé', weekStatus: '', + dayNames: ['Vasámap', 'Hétfö', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'], + dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'], + dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['hu']); +}); diff --git a/source/i18n/ui.datepicker-id.js b/source/i18n/ui.datepicker-id.js new file mode 100644 index 000000000..6c14e2fc4 --- /dev/null +++ b/source/i18n/ui.datepicker-id.js @@ -0,0 +1,22 @@ +/* Indonesian initialisation for the jQuery UI date picker plugin. */ +/* Written by Deden Fathurahman (dedenf@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['id'] = {clearText: 'kosongkan', clearStatus: 'bersihkan tanggal yang sekarang', + closeText: 'Tutup', closeStatus: 'Tutup tanpa mengubah', + prevText: '', nextStatus: 'Tampilkan bulan berikutnya', + currentText: 'hari ini', currentStatus: 'Tampilkan bulan sekarang', + monthNames: ['Januari','Februari','Maret','April','Mei','Juni', + 'Juli','Agustus','September','Oktober','Nopember','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun', + 'Jul','Agus','Sep','Okt','Nop','Des'], + monthStatus: 'Tampilkan bulan yang berbeda', yearStatus: 'Tampilkan tahun yang berbeda', + weekHeader: 'Mg', weekStatus: 'Minggu dalam tahun', + dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'], + dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'], + dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'], + dayStatus: 'gunakan DD sebagai awal hari dalam minggu', dateStatus: 'pilih le DD, MM d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: 'Pilih Tanggal', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['id']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-is.js b/source/i18n/ui.datepicker-is.js new file mode 100644 index 000000000..65316eed0 --- /dev/null +++ b/source/i18n/ui.datepicker-is.js @@ -0,0 +1,22 @@ +/* Icelandic initialisation for the jQuery UI date picker plugin. */ +/* Written by Haukur H. Thorsson (haukur@eskill.is). */ +jQuery(function($){ + $.datepicker.regional['is'] = {clearText: 'Hreinsa', clearStatus: '', + closeText: 'Loka', closeStatus: '', + prevText: '< Fyrri', prevStatus: '', + nextText: 'Næsti >', nextStatus: '', + currentText: 'Í dag', currentStatus: '', + monthNames: ['Janúar','Febrúar','Mars','Apríl','Maí','Júní', + 'Júlí','Ágúst','September','Október','Nóvember','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maí','Jún', + 'Júl','Ágú','Sep','Okt','Nóv','Des'], + monthStatus: '', yearStatus: '', + weekHeader: 'Vika', weekStatus: '', + dayNames: ['Sunnudagur','Mánudagur','Þriðjudagur','Miðvikudagur','Fimmtudagur','Föstudagur','Laugardagur'], + dayNamesShort: ['Sun','Mán','Þri','Mið','Fim','Fös','Lau'], + dayNamesMin: ['Su','Má','Þr','Mi','Fi','Fö','La'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['is']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-it.js b/source/i18n/ui.datepicker-it.js new file mode 100644 index 000000000..a1ee89599 --- /dev/null +++ b/source/i18n/ui.datepicker-it.js @@ -0,0 +1,22 @@ +/* Italian initialisation for the jQuery UI date picker plugin. */ +/* Written by Apaella (apaella@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['it'] = {clearText: 'Svuota', clearStatus: '', + closeText: 'Chiudi', closeStatus: '', + prevText: '<Prec', prevStatus: '', + nextText: 'Succ>', nextStatus: '', + currentText: 'Oggi', currentStatus: '', + monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno', + 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'], + monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu', + 'Lug','Ago','Set','Ott','Nov','Dic'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'], + dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'], + dayNamesMin: ['Do','Lu','Ma','Me','Gio','Ve','Sa'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['it']); +}); diff --git a/source/i18n/ui.datepicker-ja.js b/source/i18n/ui.datepicker-ja.js new file mode 100644 index 000000000..e33909fe5 --- /dev/null +++ b/source/i18n/ui.datepicker-ja.js @@ -0,0 +1,22 @@ +/* Japanese (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Milly. */ +jQuery(function($){ + $.datepicker.regional['ja'] = {clearText: '削除', clearStatus: '', + closeText: '閉じる', closeStatus: '', + prevText: '<前月', prevStatus: '', + nextText: '次月>', nextStatus: '', + currentText: '今日', currentStatus: '', + monthNames: ['1月','2月','3月','4月','5月','6月', + '7月','8月','9月','10月','11月','12月'], + monthNamesShort: ['1月','2月','3月','4月','5月','6月', + '7月','8月','9月','10月','11月','12月'], + monthStatus: '', yearStatus: '', + weekHeader: 'Wk', weekStatus: '', + dayNames: ['日','月','火','水','木','金','土'], + dayNamesShort: ['日','月','火','水','木','金','土'], + dayNamesMin: ['日','月','火','水','木','金','土'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy/mm/dd', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ja']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-ko.js b/source/i18n/ui.datepicker-ko.js new file mode 100644 index 000000000..1381e66b7 --- /dev/null +++ b/source/i18n/ui.datepicker-ko.js @@ -0,0 +1,22 @@ +/* Korean initialisation for the jQuery calendar extension. */ +/* Written by DaeKwon Kang (ncrash.dk@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ko'] = {clearText: '지우기', clearStatus: '', + closeText: '닫기', closeStatus: '', + prevText: '이전달', prevStatus: '', + nextText: '다음달', nextStatus: '', + currentText: '오늘', currentStatus: '', + monthNames: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)', + '7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'], + monthNamesShort: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)', + '7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'], + monthStatus: '', yearStatus: '', + weekHeader: 'Wk', weekStatus: '', + dayNames: ['일','월','화','수','목','금','토'], + dayNamesShort: ['일','월','화','수','목','금','토'], + dayNamesMin: ['일','월','화','수','목','금','토'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ko']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-lt.js b/source/i18n/ui.datepicker-lt.js new file mode 100644 index 000000000..120e82b2f --- /dev/null +++ b/source/i18n/ui.datepicker-lt.js @@ -0,0 +1,25 @@ +/** + * Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. + * + * @author Arturas Paleicikas + */ +jQuery(function($){ + $.datepicker.regional['lt'] = {clearText: 'Išvalyti', clearStatus: '', + closeText: 'Uždaryti', closeStatus: '', + prevText: '<Atgal', prevStatus: '', + nextText: 'Pirmyn>', nextStatus: '', + currentText: 'Šiandien', currentStatus: '', + monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis', + 'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'], + monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir', + 'Lie','Rugp','Rugs','Spa','Lap','Gru'], + monthStatus: '', yearStatus: '', + weekHeader: '', weekStatus: '', + dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'], + dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'], + dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Še'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['lt']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-lv.js b/source/i18n/ui.datepicker-lv.js new file mode 100644 index 000000000..809185df5 --- /dev/null +++ b/source/i18n/ui.datepicker-lv.js @@ -0,0 +1,24 @@ +/** + * @author Arturas Paleicikas + */ +jQuery(function($){ + $.datepicker.regional['lv'] = { + clearText: 'Notīrīt', clearStatus: '', + closeText: 'Aizvērt', closeStatus: '', + prevText: 'Iepr', prevStatus: '', + nextText: 'Nāka', nextStatus: '', + currentText: 'Šodien', currentStatus: '', + monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs', + 'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn', + 'Jūl','Aug','Sep','Okt','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Nav', weekStatus: '', + dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'], + dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'], + dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd-mm-yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['lv']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-nl.js b/source/i18n/ui.datepicker-nl.js new file mode 100644 index 000000000..0d52d6f33 --- /dev/null +++ b/source/i18n/ui.datepicker-nl.js @@ -0,0 +1,21 @@ +/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */ +jQuery(function($){ + $.datepicker.regional['nl'] = {clearText: 'Wissen', clearStatus: 'Wis de huidige datum', + closeText: 'Sluiten', closeStatus: 'Sluit zonder verandering', + prevText: '<Terug', prevStatus: 'Laat de voorgaande maand zien', + nextText: 'Volgende>', nextStatus: 'Laat de volgende maand zien', + currentText: 'Vandaag', currentStatus: 'Laat de huidige maand zien', + monthNames: ['Januari','Februari','Maart','April','Mei','Juni', + 'Juli','Augustus','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mrt','Apr','Mei','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + monthStatus: 'Laat een andere maand zien', yearStatus: 'Laat een ander jaar zien', + weekHeader: 'Wk', weekStatus: 'Week van het jaar', + dayNames: ['Zondag','Maandag','Dinsdag','Woensdag','Donderdag','Vrijdag','Zaterdag'], + dayNamesShort: ['Zon','Maa','Din','Woe','Don','Vri','Zat'], + dayNamesMin: ['Zo','Ma','Di','Wo','Do','Vr','Za'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Kies een datum', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['nl']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-no.js b/source/i18n/ui.datepicker-no.js new file mode 100644 index 000000000..42932b0f9 --- /dev/null +++ b/source/i18n/ui.datepicker-no.js @@ -0,0 +1,23 @@ +/* Norwegian initialisation for the jQuery UI date picker plugin. */ +/* Written by Naimdjon Takhirov (naimdjon@gmail.com). */ + +$(document).ready(function(){ + $.datepicker.regional['no'] = {clearText: 'Tøm', clearStatus: '', + closeText: 'Lukk', closeStatus: '', + prevText: '«Forrige', prevStatus: '', + nextText: 'Neste»', nextStatus: '', + currentText: 'I dag', currentStatus: '', + monthNames: ['Januar','Februar','Mars','April','Mai','Juni', + 'Juli','August','September','Oktober','November','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun', + 'Jul','Aug','Sep','Okt','Nov','Des'], + monthStatus: '', yearStatus: '', + weekHeader: 'Uke', weekStatus: '', + dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], + dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], + dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['no']); +}); diff --git a/source/i18n/ui.datepicker-pl.js b/source/i18n/ui.datepicker-pl.js new file mode 100644 index 000000000..bb3112d96 --- /dev/null +++ b/source/i18n/ui.datepicker-pl.js @@ -0,0 +1,22 @@ +/* Polish initialisation for the jQuery UI date picker plugin. */ +/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pl'] = {clearText: 'Wyczyść', clearStatus: 'Wyczyść obecną datę', + closeText: 'Zamknij', closeStatus: 'Zamknij bez zapisywania', + prevText: '<Poprzedni', prevStatus: 'Pokaż poprzedni miesiąc', + nextText: 'Następny>', nextStatus: 'Pokaż następny miesiąc', + currentText: 'Dziś', currentStatus: 'Pokaż aktualny miesiąc', + monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec', + 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'], + monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze', + 'Lip','Sie','Wrz','Pa','Lis','Gru'], + monthStatus: 'Pokaż inny miesiąc', yearStatus: 'Pokaż inny rok', + weekHeader: 'Tydz', weekStatus: 'Tydzień roku', + dayNames: ['Niedziela','Poniedzialek','Wtorek','Środa','Czwartek','Piątek','Sobota'], + dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'], + dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'], + dayStatus: 'Ustaw DD jako pierwszy dzień tygodnia', dateStatus: 'Wybierz D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: 'Wybierz datę', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['pl']); +}); diff --git a/source/i18n/ui.datepicker-pt-BR.js b/source/i18n/ui.datepicker-pt-BR.js new file mode 100644 index 000000000..457341983 --- /dev/null +++ b/source/i18n/ui.datepicker-pt-BR.js @@ -0,0 +1,22 @@ +/* Brazilian initialisation for the jQuery UI date picker plugin. */ +/* Written by Leonildo Costa Silva (leocsilva@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pt-BR'] = {clearText: 'Limpar', clearStatus: '', + closeText: 'Fechar', closeStatus: '', + prevText: '<Anterior', prevStatus: '', + nextText: 'Próximo>', nextStatus: '', + currentText: 'Hoje', currentStatus: '', + monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', + 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], + monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', + 'Jul','Ago','Set','Out','Nov','Dez'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'], + dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'], + dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['pt-BR']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-ro.js b/source/i18n/ui.datepicker-ro.js new file mode 100644 index 000000000..5902596af --- /dev/null +++ b/source/i18n/ui.datepicker-ro.js @@ -0,0 +1,22 @@ +/* Romanian initialisation for the jQuery UI date picker plugin. */ +/* Written by Edmond L. (ll_edmond@walla.com). */ +jQuery(function($){ + $.datepicker.regional['ro'] = {clearText: 'Curat', clearStatus: 'Sterge data curenta', + closeText: 'Inchide', closeStatus: 'Inchide fara schimbare', + prevText: '<Anterior', prevStatus: 'Arata luna trecuta', + nextText: 'Urmator>', nextStatus: 'Arata luna urmatoare', + currentText: 'Azi', currentStatus: 'Arata luna curenta', + monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Junie', + 'Julie','August','Septembrie','Octobrie','Noiembrie','Decembrie'], + monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Noi', 'Dec'], + monthStatus: 'Arata o luna diferita', yearStatus: 'Arat un an diferit', + weekHeader: 'Sapt', weekStatus: 'Saptamana anului', + dayNames: ['Duminica', 'Luni', 'Marti', 'Miercuri', 'Joi', 'Vineri', 'Sambata'], + dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sam'], + dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sa'], + dayStatus: 'Seteaza DD ca prima saptamana zi', dateStatus: 'Selecteaza D, M d', + dateFormat: 'mm/dd/yy', firstDay: 0, + initStatus: 'Selecteaza o data', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ro']); +}); diff --git a/source/i18n/ui.datepicker-ru.js b/source/i18n/ui.datepicker-ru.js new file mode 100644 index 000000000..1b6518c50 --- /dev/null +++ b/source/i18n/ui.datepicker-ru.js @@ -0,0 +1,22 @@ +/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Andrew Stromnov (stromnov@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ru'] = {clearText: 'Очистить', clearStatus: '', + closeText: 'Закрыть', closeStatus: '', + prevText: '<Пред', prevStatus: '', + nextText: 'След>', nextStatus: '', + currentText: 'Сегодня', currentStatus: '', + monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', + 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], + monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', + 'Июл','Авг','Сен','Окт','Ноя','Дек'], + monthStatus: '', yearStatus: '', + weekHeader: 'Не', weekStatus: '', + dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], + dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], + dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ru']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-sk.js b/source/i18n/ui.datepicker-sk.js new file mode 100644 index 000000000..c486fd7bb --- /dev/null +++ b/source/i18n/ui.datepicker-sk.js @@ -0,0 +1,22 @@ +/* Slovak initialisation for the jQuery UI date picker plugin. */ +/* Written by Vojtech Rinik (vojto@hmm.sk). */ +jQuery(function($){ + $.datepicker.regional['sk'] = {clearText: 'Zmazať', clearStatus: '', + closeText: 'Zavrieť', closeStatus: '', + prevText: '<Predchádzajúci', prevStatus: '', + nextText: 'Nasledujúci>', nextStatus: '', + currentText: 'Dnes', currentStatus: '', + monthNames: ['Január','Február','Marec','Apríl','Máj','Jún', + 'Júl','August','September','Október','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún', + 'Júl','Aug','Sep','Okt','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Ty', weekStatus: '', + dayNames: ['Nedel\'a','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'], + dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'], + dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['sk']); +}); diff --git a/source/i18n/ui.datepicker-sv.js b/source/i18n/ui.datepicker-sv.js new file mode 100644 index 000000000..87befa260 --- /dev/null +++ b/source/i18n/ui.datepicker-sv.js @@ -0,0 +1,22 @@ +/* Swedish initialisation for the jQuery UI date picker plugin. */ +/* Written by Anders Ekdahl ( anders@nomadiz.se). */ +jQuery(function($){ + $.datepicker.regional['sv'] = {clearText: 'Rensa', clearStatus: '', + closeText: 'Stäng', closeStatus: '', + prevText: '«Förra', prevStatus: '', + nextText: 'Nästa»', nextStatus: '', + currentText: 'Idag', currentStatus: '', + monthNames: ['Januari','Februari','Mars','April','Maj','Juni', + 'Juli','Augusti','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Ve', weekStatus: '', + dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'], + dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'], + dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['sv']); +}); diff --git a/source/i18n/ui.datepicker-th.js b/source/i18n/ui.datepicker-th.js new file mode 100644 index 000000000..cfbf0ccc7 --- /dev/null +++ b/source/i18n/ui.datepicker-th.js @@ -0,0 +1,22 @@ +/* Thai initialisation for the jQuery UI date picker plugin. */ +/* Written by pipo (pipo@sixhead.com). */ +jQuery(function($){ + $.datepicker.regional['th'] = {clearText: 'ลบ', clearStatus: '', + closeText: 'ปิด', closeStatus: '', + prevText: '« ย้อน', prevStatus: '', + nextText: 'ถัดไป »', nextStatus: '', + currentText: 'วันนี้', currentStatus: '', + monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน', + 'กรกฏาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'], + monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.', + 'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'], + dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], + dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['th']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-tr.js b/source/i18n/ui.datepicker-tr.js new file mode 100644 index 000000000..80670d14b --- /dev/null +++ b/source/i18n/ui.datepicker-tr.js @@ -0,0 +1,22 @@ +/* Turkish initialisation for the jQuery UI date picker plugin. */ +/* Written by Izzet Emre Erkan (kara@karalamalar.net). */ +jQuery(function($){ + $.datepicker.regional['tr'] = {clearText: 'temizle', clearStatus: 'geçerli tarihi temizler', + closeText: 'kapat', closeStatus: 'sadece göstergeyi kapat', + prevText: '<geri', prevStatus: 'önceki ayı göster', + nextText: 'ileri>', nextStatus: 'sonraki ayı göster', + currentText: 'bugün', currentStatus: '', + monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran', + 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'], + monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz', + 'Tem','Ağu','Eyl','Eki','Kas','Ara'], + monthStatus: 'başka ay', yearStatus: 'başka yıl', + weekHeader: 'Hf', weekStatus: 'Ayın haftaları', + dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'], + dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], + dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], + dayStatus: 'Haftanın ilk gününü belirleyin', dateStatus: 'D, M d seçiniz', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Bir tarih seçiniz', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['tr']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-ua.js b/source/i18n/ui.datepicker-ua.js new file mode 100644 index 000000000..f233c6395 --- /dev/null +++ b/source/i18n/ui.datepicker-ua.js @@ -0,0 +1,22 @@ +/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ua'] = {clearText: 'Очистити', clearStatus: '', + closeText: 'Закрити', closeStatus: '', + prevText: '<<', prevStatus: '', + nextText: '>>', nextStatus: '', + currentText: 'Сьогодні', currentStatus: '', + monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень', + 'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'], + monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер', + 'Лип','Сер','Вер','Жов','Лис','Гру'], + monthStatus: '', yearStatus: '', + weekHeader: 'Не', weekStatus: '', + dayNames: ['неділя','понеділок','вівторок','середа','четвер','пятниця','суббота'], + dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'], + dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ua']); +}); \ No newline at end of file diff --git a/source/i18n/ui.datepicker-zh-CN.js b/source/i18n/ui.datepicker-zh-CN.js new file mode 100644 index 000000000..05dad7244 --- /dev/null +++ b/source/i18n/ui.datepicker-zh-CN.js @@ -0,0 +1,22 @@ +/* Chinese initialisation for the jQuery UI date picker plugin. */ +/* Written by Cloudream (cloudream@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['zh-CN'] = {clearText: '清除', clearStatus: '清除已选日期', + closeText: '关闭', closeStatus: '不改变当前选择', + prevText: '<上月', prevStatus: '显示上月', + nextText: '下月>', nextStatus: '显示下月', + currentText: '今天', currentStatus: '显示本月', + monthNames: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + monthNamesShort: ['一','二','三','四','五','六', + '七','八','九','十','十一','十二'], + monthStatus: '选择月份', yearStatus: '选择年份', + weekHeader: '周', weekStatus: '年内周次', + dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], + dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], + dayNamesMin: ['日','一','二','三','四','五','六'], + dayStatus: '设置 DD 为一周起始', dateStatus: '选择 m月 d日, DD', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '请选择日期', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['zh-CN']); +}); diff --git a/source/i18n/ui.datepicker-zh-TW.js b/source/i18n/ui.datepicker-zh-TW.js new file mode 100644 index 000000000..d1bca8d04 --- /dev/null +++ b/source/i18n/ui.datepicker-zh-TW.js @@ -0,0 +1,23 @@ +/* Chinese initialisation for the jQuery UI date picker plugin. */ +/* Written by Ressol (ressol@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['zh-TW'] = { + clearText: '清除', clearStatus: '清除已選日期', + closeText: '關閉', closeStatus: '不改變目前的選擇', + prevText: '<上月', prevStatus: '顯示上月', + nextText: '下月>', nextStatus: '顯示下月', + currentText: '今天', currentStatus: '顯示本月', + monthNames: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + monthNamesShort: ['一','二','三','四','五','六', + '七','八','九','十','十一','十二'], + monthStatus: '選擇月份', yearStatus: '選擇年份', + weekHeader: '周', weekStatus: '年內周次', + dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], + dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], + dayNamesMin: ['日','一','二','三','四','五','六'], + dayStatus: '設定 DD 為一周起始', dateStatus: '選擇 m月 d日, DD', + dateFormat: 'yy/mm/dd', firstDay: 1, + initStatus: '請選擇日期', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['zh-TW']); +}); diff --git a/source/ui.accordion.js b/source/ui.accordion.js new file mode 100644 index 000000000..7ba499d49 --- /dev/null +++ b/source/ui.accordion.js @@ -0,0 +1,302 @@ +/* + * jQuery UI Accordion + * + * Copyright (c) 2007, 2008 Jörn Zaefferer + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Accordion + * + * Depends: + * ui.core.js + * + * Revision: $Id: ui.accordion.js 5656 2008-05-21 19:35:33Z braeker $ + */ +(function($) { + +$.widget("ui.accordion", { + init: function() { + var options = this.options; + + if ( options.navigation ) { + var current = this.element.find("a").filter(options.navigationFilter); + if ( current.length ) { + if ( current.filter(options.header).length ) { + options.active = current; + } else { + options.active = current.parent().parent().prev(); + current.addClass("current"); + } + } + } + + // calculate active if not specified, using the first header + options.headers = this.element.find(options.header); + options.active = findActive(options.headers, options.active); + + // IE7-/Win - Extra vertical space in Lists fixed + if ($.browser.msie) { + this.element.find('a').css('zoom', '1'); + } + + if (!this.element.hasClass("ui-accordion")) { + this.element.addClass("ui-accordion"); + $("").insertBefore(options.headers); + $("").appendTo(options.headers); + options.headers.addClass("ui-accordion-header").attr("tabindex", "0"); + } + + var maxHeight; + if ( options.fillSpace ) { + maxHeight = this.element.parent().height(); + options.headers.each(function() { + maxHeight -= $(this).outerHeight(); + }); + var maxPadding = 0; + options.headers.next().each(function() { + maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height()); + }).height(maxHeight - maxPadding); + } else if ( options.autoHeight ) { + maxHeight = 0; + options.headers.next().each(function() { + maxHeight = Math.max(maxHeight, $(this).outerHeight()); + }).height(maxHeight); + } + + options.headers + .not(options.active || "") + .next() + .hide(); + options.active.parent().andSelf().addClass(options.selectedClass); + + if (options.event) { + this.element.bind((options.event) + ".accordion", clickHandler); + } + }, + activate: function(index) { + // call clickHandler with custom event + clickHandler.call(this.element[0], { + target: findActive( this.options.headers, index )[0] + }); + }, + destroy: function() { + this.options.headers.next().css("display", ""); + if ( this.options.fillSpace || this.options.autoHeight ) { + this.options.headers.next().css("height", ""); + } + $.removeData(this.element[0], "accordion"); + this.element.removeClass("ui-accordion").unbind(".accordion"); + } +}); + +function scopeCallback(callback, scope) { + return function() { + return callback.apply(scope, arguments); + }; +}; + +function completed(cancel) { + // if removed while animated data can be empty + if (!$.data(this, "accordion")) { + return; + } + + var instance = $.data(this, "accordion"); + var options = instance.options; + options.running = cancel ? 0 : --options.running; + if ( options.running ) { + return; + } + if ( options.clearStyle ) { + options.toShow.add(options.toHide).css({ + height: "", + overflow: "" + }); + } + $(this).triggerHandler("accordionchange", [options.data], options.change); +} + +function toggle(toShow, toHide, data, clickedActive, down) { + var options = $.data(this, "accordion").options; + options.toShow = toShow; + options.toHide = toHide; + options.data = data; + var complete = scopeCallback(completed, this); + + // count elements to animate + options.running = toHide.size() === 0 ? toShow.size() : toHide.size(); + + if ( options.animated ) { + if ( !options.alwaysOpen && clickedActive ) { + $.ui.accordion.animations[options.animated]({ + toShow: jQuery([]), + toHide: toHide, + complete: complete, + down: down, + autoHeight: options.autoHeight + }); + } else { + $.ui.accordion.animations[options.animated]({ + toShow: toShow, + toHide: toHide, + complete: complete, + down: down, + autoHeight: options.autoHeight + }); + } + } else { + if ( !options.alwaysOpen && clickedActive ) { + toShow.toggle(); + } else { + toHide.hide(); + toShow.show(); + } + complete(true); + } +} + +function clickHandler(event) { + var options = $.data(this, "accordion").options; + if (options.disabled) { + return false; + } + + // called only when using activate(false) to close all parts programmatically + if ( !event.target && !options.alwaysOpen ) { + options.active.parent().andSelf().toggleClass(options.selectedClass); + var toHide = options.active.next(), + data = { + instance: this, + options: options, + newHeader: jQuery([]), + oldHeader: options.active, + newContent: jQuery([]), + oldContent: toHide + }, + toShow = (options.active = $([])); + toggle.call(this, toShow, toHide, data ); + return false; + } + // get the click target + var clicked = $(event.target); + + // due to the event delegation model, we have to check if one + // of the parent elements is our actual header, and find that + if ( clicked.parents(options.header).length ) { + while ( !clicked.is(options.header) ) { + clicked = clicked.parent(); + } + } + + var clickedActive = clicked[0] == options.active[0]; + + // if animations are still active, or the active header is the target, ignore click + if (options.running || (options.alwaysOpen && clickedActive)) { + return false; + } + if (!clicked.is(options.header)) { + return; + } + + // switch classes + options.active.parent().andSelf().toggleClass(options.selectedClass); + if ( !clickedActive ) { + clicked.parent().andSelf().addClass(options.selectedClass); + } + + // find elements to show and hide + var toShow = clicked.next(), + toHide = options.active.next(), + //data = [clicked, options.active, toShow, toHide], + data = { + instance: this, + options: options, + newHeader: clicked, + oldHeader: options.active, + newContent: toShow, + oldContent: toHide + }, + down = options.headers.index( options.active[0] ) > options.headers.index( clicked[0] ); + + options.active = clickedActive ? $([]) : clicked; + toggle.call(this, toShow, toHide, data, clickedActive, down ); + + return false; +}; + +function findActive(headers, selector) { + return selector != undefined + ? typeof selector == "number" + ? headers.filter(":eq(" + selector + ")") + : headers.not(headers.not(selector)) + : selector === false + ? $([]) + : headers.filter(":eq(0)"); +} + +$.extend($.ui.accordion, { + defaults: { + selectedClass: "selected", + alwaysOpen: true, + animated: 'slide', + event: "click", + header: "a", + autoHeight: true, + running: 0, + navigationFilter: function() { + return this.href.toLowerCase() == location.href.toLowerCase(); + } + }, + animations: { + slide: function(options, additions) { + options = $.extend({ + easing: "swing", + duration: 300 + }, options, additions); + if ( !options.toHide.size() ) { + options.toShow.animate({height: "show"}, options); + return; + } + var hideHeight = options.toHide.height(), + showHeight = options.toShow.height(), + difference = showHeight / hideHeight; + options.toShow.css({ height: 0, overflow: 'hidden' }).show(); + options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{ + step: function(now) { + var current = (hideHeight - now) * difference; + if ($.browser.msie || $.browser.opera) { + current = Math.ceil(current); + } + options.toShow.height( current ); + }, + duration: options.duration, + easing: options.easing, + complete: function() { + if ( !options.autoHeight ) { + options.toShow.css("height", "auto"); + } + options.complete(); + } + }); + }, + bounceslide: function(options) { + this.slide(options, { + easing: options.down ? "bounceout" : "swing", + duration: options.down ? 1000 : 200 + }); + }, + easeslide: function(options) { + this.slide(options, { + easing: "easeinout", + duration: 700 + }); + } + } +}); + +// deprecated, use accordion("activate", index) instead +$.fn.activate = function(index) { + return this.accordion("activate", index); +}; + +})(jQuery); diff --git a/source/ui.core.js b/source/ui.core.js new file mode 100644 index 000000000..7b96ced5a --- /dev/null +++ b/source/ui.core.js @@ -0,0 +1,289 @@ +/* + * jQuery UI @VERSION + * + * Copyright (c) 2008 Paul Bakaus (ui.jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI + * + * $Id: ui.core.js 5587 2008-05-13 19:56:42Z scott.gonzalez $ + */ +;(function($) { + +$.ui = { + plugin: { + add: function(module, option, set) { + var proto = $.ui[module].prototype; + for(var i in set) { + proto.plugins[i] = proto.plugins[i] || []; + proto.plugins[i].push([option, set[i]]); + } + }, + call: function(instance, name, args) { + var set = instance.plugins[name]; + if(!set) { return; } + + for (var i = 0; i < set.length; i++) { + if (instance.options[set[i][0]]) { + set[i][1].apply(instance.element, args); + } + } + } + }, + cssCache: {}, + css: function(name) { + if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; } + var tmp = $('
').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body'); + + //if (!$.browser.safari) + //tmp.appendTo('body'); + + //Opera and Safari set width and height to 0px instead of auto + //Safari returns rgba(0,0,0,0) when bgcolor is not set + $.ui.cssCache[name] = !!( + (!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) || + !(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))) + ); + try { $('body').get(0).removeChild(tmp.get(0)); } catch(e){} + return $.ui.cssCache[name]; + }, + disableSelection: function(e) { + e.unselectable = "on"; + e.onselectstart = function() { return false; }; + if (e.style) { e.style.MozUserSelect = "none"; } + }, + enableSelection: function(e) { + e.unselectable = "off"; + e.onselectstart = function() { return true; }; + if (e.style) { e.style.MozUserSelect = ""; } + }, + hasScroll: function(e, a) { + var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false; + if (e[scroll] > 0) return true; e[scroll] = 1; + has = e[scroll] > 0 ? true : false; e[scroll] = 0; + return has; + } +}; + + +/** jQuery core modifications and additions **/ + +var _remove = $.fn.remove; +$.fn.remove = function() { + $("*", this).add(this).trigger("remove"); + return _remove.apply(this, arguments ); +}; + +// $.widget is a factory to create jQuery plugins +// taking some boilerplate code out of the plugin code +// created by Scott González and Jörn Zaefferer +function getter(namespace, plugin, method) { + var methods = $[namespace][plugin].getter || []; + methods = (typeof methods == "string" ? methods.split(/,?\s+/) : methods); + return ($.inArray(method, methods) != -1); +} + +$.widget = function(name, prototype) { + var namespace = name.split(".")[0]; + name = name.split(".")[1]; + + // create plugin method + $.fn[name] = function(options) { + var isMethodCall = (typeof options == 'string'), + args = Array.prototype.slice.call(arguments, 1); + + if (isMethodCall && getter(namespace, name, options)) { + var instance = $.data(this[0], name); + return (instance ? instance[options].apply(instance, args) + : undefined); + } + + return this.each(function() { + var instance = $.data(this, name); + if (isMethodCall && instance) { + instance[options].apply(instance, args); + } else if (!isMethodCall) { + $.data(this, name, new $[namespace][name](this, options)); + } + }); + }; + + // create widget constructor + $[namespace][name] = function(element, options) { + var self = this; + + this.widgetName = name; + this.widgetBaseClass = namespace + '-' + name; + + this.options = $.extend({}, $[namespace][name].defaults, options); + this.element = $(element) + .bind('setData.' + name, function(e, key, value) { + return self.setData(key, value); + }) + .bind('getData.' + name, function(e, key) { + return self.getData(key); + }) + .bind('remove', function() { + return self.destroy(); + }); + this.init(); + }; + + // add widget prototype + $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype); +}; + +$.widget.prototype = { + init: function() {}, + destroy: function() { + this.element.removeData(this.widgetName); + }, + + getData: function(key) { + return this.options[key]; + }, + setData: function(key, value) { + this.options[key] = value; + + if (key == 'disabled') { + this.element[value ? 'addClass' : 'removeClass']( + this.widgetBaseClass + '-disabled'); + } + }, + + enable: function() { + this.setData('disabled', false); + }, + disable: function() { + this.setData('disabled', true); + } +}; + + +/** Mouse Interaction Plugin **/ + +$.ui.mouse = { + mouseInit: function() { + var self = this; + + this.element.bind('mousedown.'+this.widgetName, function(e) { + return self.mouseDown(e); + }); + + // Prevent text selection in IE + if ($.browser.msie) { + this._mouseUnselectable = this.element.attr('unselectable'); + this.element.attr('unselectable', 'on'); + } + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + mouseDestroy: function() { + this.element.unbind('.'+this.widgetName); + + // Restore text selection in IE + ($.browser.msie + && this.element.attr('unselectable', this._mouseUnselectable)); + }, + + mouseDown: function(e) { + // we may have missed mouseup (out of window) + (this._mouseStarted && this.mouseUp(e)); + + this._mouseDownEvent = e; + + var self = this, + btnIsLeft = (e.which == 1), + elIsCancel = ($(e.target).is(this.options.cancel)); + if (!btnIsLeft || elIsCancel) { + return true; + } + + this._mouseDelayMet = !this.options.delay; + if (!this._mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + self._mouseDelayMet = true; + }, this.options.delay); + } + + if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) { + this._mouseStarted = (this.mouseStart(e) !== false); + if (!this._mouseStarted) { return false; } + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(e) { + return self.mouseMove(e); + }; + this._mouseUpDelegate = function(e) { + return self.mouseUp(e); + }; + $(document) + .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + return false; + }, + + mouseMove: function(e) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.browser.msie && !e.button) { + return this.mouseUp(e); + } + + if (this._mouseStarted) { + this.mouseDrag(e); + return false; + } + + if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) { + this._mouseStarted = + (this.mouseStart(this._mouseDownEvent, e) !== false); + (this._mouseStarted ? this.mouseDrag(e) : this.mouseUp(e)); + } + + return !this._mouseStarted; + }, + + mouseUp: function(e) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + if (this._mouseStarted) { + this._mouseStarted = false; + this.mouseStop(e); + } + + return false; + }, + + mouseDistanceMet: function(e) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - e.pageX), + Math.abs(this._mouseDownEvent.pageY - e.pageY) + ) >= this.options.distance + ); + }, + + mouseDelayMet: function(e) { + return this._mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + mouseStart: function(e) {}, + mouseDrag: function(e) {}, + mouseStop: function(e) {} +}; + +$.ui.mouse.defaults = { + cancel: null, + distance: 1, + delay: 0 +}; + +})(jQuery); \ No newline at end of file diff --git a/source/ui.datepicker.js b/source/ui.datepicker.js new file mode 100644 index 000000000..c1f1b3c4d --- /dev/null +++ b/source/ui.datepicker.js @@ -0,0 +1,1450 @@ +/* + * jQuery UI Datepicker + * + * Copyright (c) 2006, 2007, 2008 Marc Grabanski + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Datepicker + * + * Depends: + * ui.core.js + * + * Marc Grabanski (m@marcgrabanski.com) and Keith Wood (kbwood@virginbroadband.com.au). + */ + +(function($) { // hide the namespace + +/* Date picker manager. + Use the singleton instance of this class, $.datepicker, to interact with the date picker. + Settings for (groups of) date pickers are maintained in an instance object + (DatepickerInstance), allowing multiple different settings on the same page. */ + +function Datepicker() { + this.debug = false; // Change this to true to start debugging + this._nextId = 0; // Next ID for a date picker instance + this._inst = []; // List of instances indexed by ID + this._curInst = null; // The current instance in use + this._disabledInputs = []; // List of date picker inputs that have been disabled + this._datepickerShowing = false; // True if the popup picker is showing , false if not + this._inDialog = false; // True if showing within a "dialog", false if not + this.regional = []; // Available regional settings, indexed by language code + this.regional[''] = { // Default regional settings + clearText: 'Clear', // Display text for clear link + clearStatus: 'Erase the current date', // Status text for clear link + closeText: 'Close', // Display text for close link + closeStatus: 'Close without change', // Status text for close link + prevText: '<Prev', // Display text for previous month link + prevStatus: 'Show the previous month', // Status text for previous month link + nextText: 'Next>', // Display text for next month link + nextStatus: 'Show the next month', // Status text for next month link + currentText: 'Today', // Display text for current month link + currentStatus: 'Show the current month', // Status text for current month link + monthNames: ['January','February','March','April','May','June', + 'July','August','September','October','November','December'], // Names of months for drop-down and formatting + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting + monthStatus: 'Show a different month', // Status text for selecting a month + yearStatus: 'Show a different year', // Status text for selecting a year + weekHeader: 'Wk', // Header for the week of the year column + weekStatus: 'Week of the year', // Status text for the week of the year column + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday + dayStatus: 'Set DD as first week day', // Status text for the day of the week selection + dateStatus: 'Select DD, M d', // Status text for the date selection + dateFormat: 'mm/dd/yy', // See format options on parseDate + firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... + initStatus: 'Select a date', // Initial Status text on opening + isRTL: false // True if right-to-left language, false if left-to-right + }; + this._defaults = { // Global defaults for all the date picker instances + showOn: 'focus', // 'focus' for popup on focus, + // 'button' for trigger button, or 'both' for either + showAnim: 'show', // Name of jQuery animation for popup + defaultDate: null, // Used when field is blank: actual date, + // +/-number for offset from today, null for today + appendText: '', // Display text following the input box, e.g. showing the format + buttonText: '...', // Text for trigger button + buttonImage: '', // URL for trigger button image + buttonImageOnly: false, // True if the image appears alone, false if it appears on a button + closeAtTop: true, // True to have the clear/close at the top, + // false to have them at the bottom + mandatory: false, // True to hide the Clear link, false to include it + hideIfNoPrevNext: false, // True to hide next/previous month links + // if not applicable, false to just disable them + changeMonth: true, // True if month can be selected directly, false if only prev/next + changeYear: true, // True if year can be selected directly, false if only prev/next + yearRange: '-10:+10', // Range of years to display in drop-down, + // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn) + changeFirstDay: true, // True to click on day name to change, false to remain as set + showOtherMonths: false, // True to show dates in other months, false to leave blank + showWeeks: false, // True to show week of the year, false to omit + calculateWeek: this.iso8601Week, // How to calculate the week of the year, + // takes a Date and returns the number of the week for it + shortYearCutoff: '+10', // Short year values < this are in the current century, + // > this are in the previous century, + // string value starting with '+' for current year + value + showStatus: false, // True to show status bar at bottom, false to not show it + statusForDate: this.dateStatus, // Function to provide status text for a date - + // takes date and instance as parameters, returns display text + minDate: null, // The earliest selectable date, or null for no limit + maxDate: null, // The latest selectable date, or null for no limit + speed: 'normal', // Speed of display/closure + beforeShowDay: null, // Function that takes a date and returns an array with + // [0] = true if selectable, false if not, + // [1] = custom CSS class name(s) or '', e.g. $.datepicker.noWeekends + beforeShow: null, // Function that takes an input field and + // returns a set of custom settings for the date picker + onSelect: null, // Define a callback function when a date is selected + onClose: null, // Define a callback function when the datepicker is closed + numberOfMonths: 1, // Number of months to show at a time + stepMonths: 1, // Number of months to step back/forward + rangeSelect: false, // Allows for selecting a date range on one date picker + rangeSeparator: ' - ' // Text between two dates in a range + }; + $.extend(this._defaults, this.regional['']); + this._datepickerDiv = $('
'); +} + +$.extend(Datepicker.prototype, { + /* Class name added to elements to indicate already configured with a date picker. */ + markerClassName: 'hasDatepicker', + + /* Debug logging (if enabled). */ + log: function () { + if (this.debug) + console.log.apply('', arguments); + }, + + /* Register a new date picker instance - with custom settings. */ + _register: function(inst) { + var id = this._nextId++; + this._inst[id] = inst; + return id; + }, + + /* Retrieve a particular date picker instance based on its ID. */ + _getInst: function(id) { + return this._inst[id] || id; + }, + + /* Override the default settings for all instances of the date picker. + @param settings object - the new settings to use as defaults (anonymous object) + @return the manager object */ + setDefaults: function(settings) { + extendRemove(this._defaults, settings || {}); + return this; + }, + + /* Attach the date picker to a jQuery selection. + @param target element - the target input field or division or span + @param settings object - the new settings to use for this date picker instance (anonymous) */ + _attachDatepicker: function(target, settings) { + // check for settings on the control itself - in namespace 'date:' + var inlineSettings = null; + for (attrName in this._defaults) { + var attrValue = target.getAttribute('date:' + attrName); + if (attrValue) { + inlineSettings = inlineSettings || {}; + try { + inlineSettings[attrName] = eval(attrValue); + } catch (err) { + inlineSettings[attrName] = attrValue; + } + } + } + var nodeName = target.nodeName.toLowerCase(); + var instSettings = (inlineSettings ? + $.extend(settings || {}, inlineSettings || {}) : settings); + if (nodeName == 'input') { + var inst = (inst && !inlineSettings ? inst : + new DatepickerInstance(instSettings, false)); + this._connectDatepicker(target, inst); + } else if (nodeName == 'div' || nodeName == 'span') { + var inst = new DatepickerInstance(instSettings, true); + this._inlineDatepicker(target, inst); + } + }, + + /* Detach a datepicker from its control. + @param target element - the target input field or division or span */ + _destroyDatepicker: function(target) { + var nodeName = target.nodeName.toLowerCase(); + var calId = target._calId; + target._calId = null; + var $target = $(target); + if (nodeName == 'input') { + $target.siblings('.ui-datepicker-append').replaceWith('').end() + .siblings('.ui-datepicker-trigger').replaceWith('').end() + .removeClass(this.markerClassName) + .unbind('focus', this._showDatepicker) + .unbind('keydown', this._doKeyDown) + .unbind('keypress', this._doKeyPress); + var wrapper = $target.parents('.ui-datepicker-wrap'); + if (wrapper) + wrapper.replaceWith(wrapper.html()); + } else if (nodeName == 'div' || nodeName == 'span') + $target.removeClass(this.markerClassName).empty(); + if ($('input[_calId=' + calId + ']').length == 0) + // clean up if last for this ID + this._inst[calId] = null; + }, + + /* Enable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _enableDatepicker: function(target) { + target.disabled = false; + $(target).siblings('button.ui-datepicker-trigger').each(function() { this.disabled = false; }).end() + .siblings('img.ui-datepicker-trigger').css({opacity: '1.0', cursor: ''}); + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + }, + + /* Disable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _disableDatepicker: function(target) { + target.disabled = true; + $(target).siblings('button.ui-datepicker-trigger').each(function() { this.disabled = true; }).end() + .siblings('img.ui-datepicker-trigger').css({opacity: '0.5', cursor: 'default'}); + this._disabledInputs = $.map($.datepicker._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + this._disabledInputs[$.datepicker._disabledInputs.length] = target; + }, + + /* Is the first field in a jQuery collection disabled as a datepicker? + @param target element - the target input field or division or span + @return boolean - true if disabled, false if enabled */ + _isDisabledDatepicker: function(target) { + if (!target) + return false; + for (var i = 0; i < this._disabledInputs.length; i++) { + if (this._disabledInputs[i] == target) + return true; + } + return false; + }, + + /* Update the settings for a date picker attached to an input field or division. + @param target element - the target input field or division or span + @param name string - the name of the setting to change or + object - the new settings to update + @param value any - the new value for the setting (omit if above is an object) */ + _changeDatepicker: function(target, name, value) { + var settings = name || {}; + if (typeof name == 'string') { + settings = {}; + settings[name] = value; + } + if (inst = this._getInst(target._calId)) { + extendRemove(inst._settings, settings); + this._updateDatepicker(inst); + } + }, + + /* Set the dates for a jQuery selection. + @param target element - the target input field or division or span + @param date Date - the new date + @param endDate Date - the new end date for a range (optional) */ + _setDateDatepicker: function(target, date, endDate) { + if (inst = this._getInst(target._calId)) { + inst._setDate(date, endDate); + this._updateDatepicker(inst); + } + }, + + /* Get the date(s) for the first entry in a jQuery selection. + @param target element - the target input field or division or span + @return Date - the current date or + Date[2] - the current dates for a range */ + _getDateDatepicker: function(target) { + var inst = this._getInst(target._calId); + if (inst) { + inst._setDateFromField($(target)); + } + return (inst ? inst._getDate() : null); + }, + + /* Handle keystrokes. */ + _doKeyDown: function(e) { + var inst = $.datepicker._getInst(this._calId); + if ($.datepicker._datepickerShowing) + switch (e.keyCode) { + case 9: $.datepicker._hideDatepicker(null, ''); + break; // hide on tab out + case 13: $.datepicker._selectDay(inst, inst._selectedMonth, inst._selectedYear, + $('td.ui-datepicker-days-cell-over', inst._datepickerDiv)[0]); + return false; // don't submit the form + break; // select the value on enter + case 27: $.datepicker._hideDatepicker(null, inst._get('speed')); + break; // hide on escape + case 33: $.datepicker._adjustDate(inst, + (e.ctrlKey ? -1 : -inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M')); + break; // previous month/year on page up/+ ctrl + case 34: $.datepicker._adjustDate(inst, + (e.ctrlKey ? +1 : +inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M')); + break; // next month/year on page down/+ ctrl + case 35: if (e.ctrlKey) $.datepicker._clearDate(inst); + break; // clear on ctrl+end + case 36: if (e.ctrlKey) $.datepicker._gotoToday(inst); + break; // current on ctrl+home + case 37: if (e.ctrlKey) $.datepicker._adjustDate(inst, -1, 'D'); + break; // -1 day on ctrl+left + case 38: if (e.ctrlKey) $.datepicker._adjustDate(inst, -7, 'D'); + break; // -1 week on ctrl+up + case 39: if (e.ctrlKey) $.datepicker._adjustDate(inst, +1, 'D'); + break; // +1 day on ctrl+right + case 40: if (e.ctrlKey) $.datepicker._adjustDate(inst, +7, 'D'); + break; // +1 week on ctrl+down + } + else if (e.keyCode == 36 && e.ctrlKey) // display the date picker on ctrl+home + $.datepicker._showDatepicker(this); + }, + + /* Filter entered characters - based on date format. */ + _doKeyPress: function(e) { + var inst = $.datepicker._getInst(this._calId); + var chars = $.datepicker._possibleChars(inst._get('dateFormat')); + var chr = String.fromCharCode(e.charCode == undefined ? e.keyCode : e.charCode); + return e.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); + }, + + /* Attach the date picker to an input field. */ + _connectDatepicker: function(target, inst) { + var input = $(target); + if (input.is('.' + this.markerClassName)) + return; + var appendText = inst._get('appendText'); + var isRTL = inst._get('isRTL'); + if (appendText) { + if (isRTL) + input.before('' + appendText); + else + input.after('' + appendText); + } + var showOn = inst._get('showOn'); + if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field + input.focus(this._showDatepicker); + if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked + input.wrap(''); + var buttonText = inst._get('buttonText'); + var buttonImage = inst._get('buttonImage'); + var trigger = $(inst._get('buttonImageOnly') ? + $('').addClass('ui-datepicker-trigger').attr({ src: buttonImage, alt: buttonText, title: buttonText }) : + $('