right-rails 1.0.6 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ 2010-10-11 Nikolay Nemshilov
2
+ o Version 1.0.8
3
+ * RightJS 2.1.0 build
4
+ * Sizzle module
5
+ * Italian and Finnish i18n modules
6
+ * Fresh plugins builds
7
+
1
8
  2010-09-20 Nikolay Nemshilov
2
9
  o Version 1.0.4
3
10
  * RightJS 2.0.0 release updates
data/lib/right_rails.rb CHANGED
@@ -2,8 +2,8 @@
2
2
  # The RightRails module. Just a namespace
3
3
  #
4
4
  module RightRails
5
- VERSION = '1.0.0'
6
-
5
+ VERSION = '1.0.8'
6
+
7
7
  autoload :Config, 'right_rails/config'
8
8
  autoload :JavaScriptGenerator, 'right_rails/java_script_generator'
9
9
  autoload :ControllerExtensions, 'right_rails/controller_extensions'
@@ -610,7 +610,7 @@ $(document).on({
610
610
  });
611
611
 
612
612
 
613
- document.write("<style type=\"text/css\"> *.rui-dd-menu, *.rui-dd-menu li{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none} *.rui-dd-menu{display:none;position:absolute;z-index:9999;background:white;border:1px solid #BBB;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;box-shadow:#DDD .2em .2em .4em;-moz-box-shadow:#DDD .2em .2em .4em;-webkit-box-shadow:#DDD .2em .2em .4em} *.rui-dd-menu li{padding:.2em .4em;border-top:none;border-bottom:none;cursor:pointer} *.rui-dd-menu li.current{background:#DDD} *.rui-dd-menu li:hover{background:#EEE}dl.rui-dd-menu dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE}dl.rui-dd-menu dd li{padding-left:1.5em}div.rui-spinner,div.rui-spinner div{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none;display:inline-block; *display:inline; *zoom:1;border-radius:.12em;-moz-border-radius:.12em;-webkit-border-radius:.12em}div.rui-spinner{text-align:center;white-space:nowrap;background:#EEE;border:1px solid #DDD;height:1.2em;padding:0 .2em}div.rui-spinner div{width:.4em;height:70%;background:#BBB;margin-left:1px}div.rui-spinner div:first-child{margin-left:0}div.rui-spinner div.glowing{background:#777}div.rui-re-anchor{margin:0;padding:0;background:none;border:none;float:none;display:inline;position:absolute;z-index:9999}.rui-autocompleter{border-top-color:#DDD !important;border-top-left-radius:0 !important;border-top-rui-radius:0 !important;-moz-border-radius-topleft:0 !important;-moz-border-radius-topright:0 !important;-webkit-border-top-left-radius:0 !important;-webkit-border-top-right-radius:0 !important}.rui-autocompleter-spinner{border:none !important;background:none !important;position:absolute;z-index:9999}.rui-autocompleter-spinner div{margin-top:.2em !important; *margin-top:0.1em !important}</style>");
613
+ document.write("<style type=\"text/css\"> *.rui-dd-menu, *.rui-dd-menu li{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none} *.rui-dd-menu{display:none;position:absolute;z-index:9999;background:white;border:1px solid #BBB;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;box-shadow:#DDD .2em .2em .4em;-moz-box-shadow:#DDD .2em .2em .4em;-webkit-box-shadow:#DDD .2em .2em .4em} *.rui-dd-menu li{padding:.2em .4em;border-top:none;border-bottom:none;cursor:pointer} *.rui-dd-menu li.current{background:#DDD} *.rui-dd-menu li:hover{background:#EEE}dl.rui-dd-menu dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE}dl.rui-dd-menu dd li{padding-left:1.5em}div.rui-spinner,div.rui-spinner div{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none;display:inline-block; *display:inline; *zoom:1;border-radius:.12em;-moz-border-radius:.12em;-webkit-border-radius:.12em}div.rui-spinner{text-align:center;white-space:nowrap;background:#EEE;border:1px solid #DDD;height:1.2em;padding:0 .2em}div.rui-spinner div{width:.4em;height:70%;background:#BBB;margin-left:1px}div.rui-spinner div:first-child{margin-left:0}div.rui-spinner div.glowing{background:#777}div.rui-re-anchor{margin:0;padding:0;background:none;border:none;float:none;display:inline;position:absolute;z-index:9999}.rui-autocompleter{border-top-color:#DDD !important;border-top-left-radius:0 !important;border-top-right-radius:0 !important;-moz-border-radius-topleft:0 !important;-moz-border-radius-topright:0 !important;-webkit-border-top-left-radius:0 !important;-webkit-border-top-right-radius:0 !important}.rui-autocompleter-spinner{border:none !important;background:none !important;position:absolute;z-index:9999}.rui-autocompleter-spinner div{margin-top:.2em !important; *margin-top:0.1em !important}</style>");
614
614
 
615
615
  return Autocompleter;
616
616
  })(document, RightJS);
@@ -14,5 +14,5 @@ this.fire("done")}return this.hide()},setOptions:function(a){this.$super(a,this.
14
14
  this.options.minLength){this.timeout&&this.timeout.cancel();this.timeout=g(this.trigger).bind(this).delay(this.options.threshold)}else return this.hide()},trigger:function(){this.timeout=null;this.cache=this.cache||{};var a=this.input.value(),b=this.options;if(a.length<b.minLength)return this.hide();if(this.cache[a])this.suggest(this.cache[a],a);else if(u(b.local))this.suggest(this.findLocal(a),a);else this.request=t.load(b.url.replace("%{search}",encodeURIComponent(a)),{method:b.method,spinner:this.getSpinner(),
15
15
  onComplete:g(function(d){this.fire("load").suggest(d.text,a)}).bind(this)})},suggest:function(a,b){if(this.options.cache)this.cache[b]=a;if(a.blank())this.hide();else{this.update(a.replace(/<ul[^>]*>|<\/ul>/im,""));this.fire("update").showAt(this.input,"bottom","resize")}return this},findLocal:function(a){var b=new o("("+o.escape(a)+")","ig");return g(this.options.local).map(function(d){if(d.match(b))return"<li>"+d.replace(b,"<strong>$1</strong>")+"</li>"}).compact().join("")},getSpinner:function(){var a=
16
16
  this.options,b=a.spinner;if(b=="native"){b=a.spinner=(new p(3)).insertTo(this);b.addClass("rui-autocompleter-spinner")}b instanceof p&&m.call(b,this.input,"right","resize");return b}});n(j).on({focus:function(a){if((a=a.target)&&a instanceof c.Element&&(a.autocompleter||a.match(k.Options.cssRule)))a.autocompleter||new k(a)},blur:function(a){(a=a.target?a.target.autocompleter:null)&&a.visible()&&a.hide()},keydown:function(a){var b=a.target?a.target.autocompleter:null;if(b&&b.visible()){var d={27:"hide",
17
- 38:"prev",40:"next",13:"done"}[a.keyCode];if(d){a.stop();b[d]()}}},keyup:function(a){var b=a.target?a.target.autocompleter:null;b&&!g([9,27,37,38,39,40,13]).include(a.keyCode)&&b.keypressed(a)}});j.write('<style type="text/css"> *.rui-dd-menu, *.rui-dd-menu li{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none} *.rui-dd-menu{display:none;position:absolute;z-index:9999;background:white;border:1px solid #BBB;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;box-shadow:#DDD .2em .2em .4em;-moz-box-shadow:#DDD .2em .2em .4em;-webkit-box-shadow:#DDD .2em .2em .4em} *.rui-dd-menu li{padding:.2em .4em;border-top:none;border-bottom:none;cursor:pointer} *.rui-dd-menu li.current{background:#DDD} *.rui-dd-menu li:hover{background:#EEE}dl.rui-dd-menu dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE}dl.rui-dd-menu dd li{padding-left:1.5em}div.rui-spinner,div.rui-spinner div{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none;display:inline-block; *display:inline; *zoom:1;border-radius:.12em;-moz-border-radius:.12em;-webkit-border-radius:.12em}div.rui-spinner{text-align:center;white-space:nowrap;background:#EEE;border:1px solid #DDD;height:1.2em;padding:0 .2em}div.rui-spinner div{width:.4em;height:70%;background:#BBB;margin-left:1px}div.rui-spinner div:first-child{margin-left:0}div.rui-spinner div.glowing{background:#777}div.rui-re-anchor{margin:0;padding:0;background:none;border:none;float:none;display:inline;position:absolute;z-index:9999}.rui-autocompleter{border-top-color:#DDD !important;border-top-left-radius:0 !important;border-top-rui-radius:0 !important;-moz-border-radius-topleft:0 !important;-moz-border-radius-topright:0 !important;-webkit-border-top-left-radius:0 !important;-webkit-border-top-right-radius:0 !important}.rui-autocompleter-spinner{border:none !important;background:none !important;position:absolute;z-index:9999}.rui-autocompleter-spinner div{margin-top:.2em !important; *margin-top:0.1em !important}</style>');
17
+ 38:"prev",40:"next",13:"done"}[a.keyCode];if(d){a.stop();b[d]()}}},keyup:function(a){var b=a.target?a.target.autocompleter:null;b&&!g([9,27,37,38,39,40,13]).include(a.keyCode)&&b.keypressed(a)}});j.write('<style type="text/css"> *.rui-dd-menu, *.rui-dd-menu li{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none} *.rui-dd-menu{display:none;position:absolute;z-index:9999;background:white;border:1px solid #BBB;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;box-shadow:#DDD .2em .2em .4em;-moz-box-shadow:#DDD .2em .2em .4em;-webkit-box-shadow:#DDD .2em .2em .4em} *.rui-dd-menu li{padding:.2em .4em;border-top:none;border-bottom:none;cursor:pointer} *.rui-dd-menu li.current{background:#DDD} *.rui-dd-menu li:hover{background:#EEE}dl.rui-dd-menu dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE}dl.rui-dd-menu dd li{padding-left:1.5em}div.rui-spinner,div.rui-spinner div{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none;display:inline-block; *display:inline; *zoom:1;border-radius:.12em;-moz-border-radius:.12em;-webkit-border-radius:.12em}div.rui-spinner{text-align:center;white-space:nowrap;background:#EEE;border:1px solid #DDD;height:1.2em;padding:0 .2em}div.rui-spinner div{width:.4em;height:70%;background:#BBB;margin-left:1px}div.rui-spinner div:first-child{margin-left:0}div.rui-spinner div.glowing{background:#777}div.rui-re-anchor{margin:0;padding:0;background:none;border:none;float:none;display:inline;position:absolute;z-index:9999}.rui-autocompleter{border-top-color:#DDD !important;border-top-left-radius:0 !important;border-top-right-radius:0 !important;-moz-border-radius-topleft:0 !important;-moz-border-radius-topright:0 !important;-webkit-border-top-left-radius:0 !important;-webkit-border-top-right-radius:0 !important}.rui-autocompleter-spinner{border:none !important;background:none !important;position:absolute;z-index:9999}.rui-autocompleter-spinner div{margin-top:.2em !important; *margin-top:0.1em !important}</style>');
18
18
  return k}(document,RightJS);
@@ -149,6 +149,7 @@ var Button = new RightJS.Wrapper(RightJS.Element, {
149
149
  this.$super('div', options);
150
150
  this._.innerHTML = caption;
151
151
  this.addClass('rui-button');
152
+ this.on('selectstart', 'stopEvent');
152
153
  },
153
154
 
154
155
  /**
@@ -6,31 +6,31 @@
6
6
  * @copyright (C) 2009-2010 Nikolay Nemshilov
7
7
  */
8
8
  var Calendar=RightJS.Calendar=function(u,p,f){function x(a,b,c,e){if(f.Fx)if(c===undefined){c=this.options.fxName;if(e===undefined){e={duration:this.options.fxDuration,onFinish:f(this.fire).bind(this,b)};if(b==="hide")e.duration=(f.Fx.Durations[e.duration]||e.duration)/2}}f.Element.prototype[b].call(a,c,e);if(!f.Fx||!c)this.fire(b);return this}function s(a){return(a<10?"0":"")+a}var o=f,y=f.$,D=f.$$,q=f.$w,E=f.$ext,F=f.isString,z=f.isArray,G=f.isFunction,t=f.Wrapper,l=f.Element,A=f.Input,B=f.RegExp,
9
- C=f.Browser,r=new f.Wrapper(f.Element,{initialize:function(a,b){this.$super("div",b);this._.innerHTML=a;this.addClass("rui-button")},disable:function(){return this.addClass("rui-button-disabled")},enable:function(){return this.removeClass("rui-button-disabled")},disabled:function(){return this.hasClass("rui-button-disabled")},enabled:function(){return!this.disabled()},fire:function(){this.enabled()&&this.$super.apply(this,arguments);return this}}),n=new (function(a,b){if(!b){b=a;a="DIV"}var c=new f.Wrapper(f.Element.Wrappers[a]||
10
- f.Element,{initialize:function(e,d){this.key=e;var g=[{"class":"rui-"+e}];this instanceof f.Input||this instanceof f.Form||g.unshift(a);this.$super.apply(this,g);if(f.isString(d))d=f.$(d);if(d instanceof f.Element){this._=d._;if("$listeners"in d)d.$listeners=d.$listeners;d={}}this.setOptions(d,this);return this},setOptions:function(e,d){d=d||this;f.Options.setOptions.call(this,f.Object.merge(e,eval("("+(d.get("data-"+this.key)||"{}")+")")));return this}});c=new f.Wrapper(c,b);f.Observer.createShortcuts(c.prototype,
11
- c.EVENTS||[]);return c})({include:[{show:function(a,b){this.constructor.current=this;return x.call(this,this,"show",a,b)},hide:function(a,b){this.constructor.current=null;return x.call(this,this,"hide",a,b)},showAt:function(a,b,c){var e=this.hide(null).shownAt=a=f.$(a),d=(this.reAnchor||(this.reAnchor=new f.Element("div",{"class":"rui-re-anchor"})).insert(this)).insertTo(e,"after").position();a=e.dimensions();var g=p(e.getStyle("borderTopWidth")),h=p(e.getStyle("borderLeftWidth")),j=p(e.getStyle("borderRightWidth")),
12
- i=p(e.getStyle("borderBottomWidth"));e=a.top-d.y+g;d=a.left-d.x+h;h=a.width-h-j;a=a.height-g-i;this.setStyle("visibility:hidden").show(null);if(b==="right")d+=h-this.size().x;else e+=a;this.moveTo(d,e);if(c)["left","right"].include(b)?this.setHeight(a):this.setWidth(h);this.setStyle("visibility:visible").hide(null);return this.show()},toggleAt:function(a,b,c){return this.hidden()?this.showAt(a,b,c):this.hide()}},{assignTo:function(a,b){a=f.$(a);if(b=f.$(b)){b[this.key]=this;b.assignedInput=a}else a[this.key]=
13
- this;var c=f(function(){if(this.visible()&&(!this.showAt||this.shownAt===a))this.setValue(a.value())}).bind(this);a.on({keyup:c,change:c});this.onChange(function(){if(!this.showAt||this.shownAt===a)a.setValue(this.getValue())});return this}}],extend:{version:"2.0.0",EVENTS:q("show hide change done"),Options:{format:"ISO",showTime:null,showButtons:false,minDate:false,maxDate:false,fxName:"fade",fxDuration:"short",firstDay:1,numberOfMonths:1,timePeriod:1,twentyFourHour:null,listYears:false,hideOnPick:false,
14
- update:null,trigger:null,cssRule:"*[data-calendar]"},Formats:{ISO:"%Y-%m-%d",POSIX:"%Y/%m/%d",EUR:"%d-%m-%Y",US:"%m/%d/%Y"},i18n:{Done:"Done",Now:"Now",NextMonth:"Next Month",PrevMonth:"Previous Month",NextYear:"Next Year",PrevYear:"Previous Year",dayNames:q("Sunday Monday Tuesday Wednesday Thursday Friday Saturday"),dayNamesShort:q("Sun Mon Tue Wed Thu Fri Sat"),dayNamesMin:q("Su Mo Tu We Th Fr Sa"),monthNames:q("January February March April May June July August September October November December"),
15
- monthNamesShort:q("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")},current:null,hideAll:function(a){D("div.rui-calendar").each(function(b){b instanceof n&&b!==a&&b.visible()&&!b.inlined()&&b.hide()})}},initialize:function(a){this.$super("calendar",a);this.addClass("rui-panel");a=this.options;this.insert([this.swaps=new H(a),this.greed=new I(a)]);if(a.showTime)this.insert(this.timepicker=new J(a));if(a.showButtons)this.insert(this.buttons=new K(a));this.setDate(new Date).initEvents()},setDate:function(a,
16
- b){if(a=this.parse(a)){var c=this.options;if(c.minDate&&c.minDate>a)a=new Date(c.minDate);if(c.maxDate&&c.maxDate<a){a=new Date(c.maxDate);a.setDate(a.getDate()-1)}this._date=b?new Date(this._date||this.date):null;this.greed.setDate(this._date||a,a);if(c.minDate||c.maxDate)this.swaps.setDate(a);this.timepicker&&!b&&this.timepicker.setDate(a);if(a!=this.date)this.fire("change",{date:this.date=a})}return this},getDate:function(){return this.date},setValue:function(a){return this.setDate(a)},getValue:function(a){return this.format(a)},
17
- insertTo:function(a,b){this.addClass("rui-calendar-inline");return this.$super(a,b)},done:function(){this.inlined()||this.hide();this.fire("done",{date:this.date})},inlined:function(){return this.hasClass("rui-calendar-inline")},setOptions:function(a){a=a||{};this.$super(a,y(a.trigger||a.update));var b=this.constructor,c=this.options;c.i18n={};for(var e in b.i18n)c.i18n[e]=z(b.i18n[e])?b.i18n[e].clone():b.i18n[e];E(c.i18n,a.i18n);c.dayNames=c.i18n.dayNamesMin;c.firstDay&&c.dayNames.push(c.dayNames.shift());
18
- if(!z(c.numberOfMonths))c.numberOfMonths=[c.numberOfMonths,1];if(c.minDate)c.minDate=this.parse(c.minDate);if(c.maxDate){c.maxDate=this.parse(c.maxDate);c.maxDate.setDate(c.maxDate.getDate()+1)}c.format=o(b.Formats[c.format]||c.format).trim();if(c.showTime===null)c.showTime=c.format.search(/%[HkIl]/)>-1;if(c.twentyFourHour===null)c.twentyFourHour=c.format.search(/%[Il]/)<0;if(c.timePeriod>60&&12%Math.ceil(c.timePeriod/60))c.twentyFourHour=true;c.update&&this.assignTo(c.update,c.trigger);return this},
19
- hideOthers:function(){n.hideAll(this);return this}}),H=new t(l,{initialize:function(a){this.$super("div",{"class":"swaps"});this.options=a;var b=a.i18n;this.insert([this.prevMonth=new r("&lsaquo;",{title:b.PrevMonth,"class":"prev-month"}),this.nextMonth=new r("&rsaquo;",{title:b.NextMonth,"class":"next-month"})]);if(a.listYears)this.insert([this.prevYear=new r("&laquo;",{title:b.PrevYear,"class":"prev-year"}),this.nextYear=new r("&raquo;",{title:b.NextYear,"class":"next-year"})]);this.buttons=o([this.prevMonth,
20
- this.nextMonth,this.prevYear,this.nextYear]).compact();this.onClick(this.clicked)},setDate:function(a){var b=this.options,c=b.numberOfMonths[0]*b.numberOfMonths[1],e=true,d=true,g=true,h=true;if(b.minDate){g=new Date(a.getFullYear(),0,1,0,0,0);var j=new Date(b.minDate.getFullYear(),0,1,0,0,0);e=g>j;g.setMonth(a.getMonth()-Math.ceil(c-c/2));j.setMonth(b.minDate.getMonth());g=g>=j}if(b.maxDate){a=new Date(a);b=new Date(b.maxDate);c=o([a,b]);c.each(function(i){i.setDate(32);i.setMonth(i.getMonth()-1);
21
- i.setDate(32-i.getDate());i.setHours(0);i.setMinutes(0);i.setSeconds(0);i.setMilliseconds(0)});h=a<b;c.each("setMonth",0);d=a<b}this.nextMonth[h?"enable":"disable"]();this.prevMonth[g?"enable":"disable"]();if(this.nextYear){this.nextYear[d?"enable":"disable"]();this.prevYear[e?"enable":"disable"]()}},clicked:function(a){(a=a.target)&&this.buttons.include(a)&&a.enabled()&&this.fire(a.get("className").split(/\s+/)[0])}}),L=new t(l,{initialize:function(a){this.$super("table",{"class":"month"});this.options=
22
- a;this.insert(this.caption=new l("caption"));this.insert("<thead><tr>"+a.dayNames.map(function(d){return"<th>"+d+"</th>"}).join("")+"</tr></thead>");this.days=[];a=(new l("tbody")).insertTo(this);var b,c,e;for(c=0;c<6;c++){e=(new l("tr")).insertTo(a);for(b=0;b<7;b++)this.days.push((new l("td")).insertTo(e))}this.onClick(this.clicked)},setDate:function(a,b){a.setDate(32);var c=32-a.getDate();a.setMonth(a.getMonth()-1);for(var e=Math.ceil(b.getTime()/864E5),d=this.options,g=d.i18n,h=this.days,j=0,i=
23
- h.length-1,k,m,v;j<7;j++){k=h[j]._;m=h[i-j]._;v=h[i-j-7]._;k.innerHTML=m.innerHTML=v.innerHTML="";k.className=m.className=v.className="blank"}j=1;i=0;for(var w;j<=c;j++){a.setDate(j);m=a.getDay();if(d.firstDay===1)m=m>0?m-1:6;if(j===1||m===0){w=h.slice(i*7,i*7+7);i++}k=w[m]._;if(C.OLD){k.innerHTML="";k.appendChild(u.createTextNode(j))}else k.innerHTML=""+j;k.className=e===Math.ceil(a.getTime()/864E5)?"selected":"";if(d.minDate&&d.minDate>a||d.maxDate&&d.maxDate<a)k.className="disabled";w[m].date=
24
- new Date(a)}c=(d.listYears?g.monthNamesShort[a.getMonth()]+",":g.monthNames[a.getMonth()])+" "+a.getFullYear();e=this.caption._;if(C.OLD){e.innerHTML="";e.appendChild(u.createTextNode(c))}else e.innerHTML=c},clicked:function(a){a=a.target;var b=a.date;if(a&&b&&!a.hasClass("disabled")&&!a.hasClass("blank")){a.addClass("selected");this.fire("date-set",{date:b.getDate(),month:b.getMonth(),year:b.getFullYear()})}}}),I=new t(l,{initialize:function(a){this.$super("table",{"class":"greed"});this.months=
25
- [];for(var b=(new l("tbody")).insertTo(this),c,e=0;e<a.numberOfMonths[1];e++)for(var d=(new l("tr")).insertTo(b),g=0;g<a.numberOfMonths[0];g++){this.months.push(c=new L(a));(new l("td")).insertTo(d).insert(c)}},setDate:function(a,b){var c=this.months,e=c.length;b=b||a;for(var d=-Math.ceil(e-e/2)+1,g=0;d<Math.floor(e-e/2)+1;d++,g++){var h=new Date(a);h.setMonth(a.getMonth()+d);c[g].setDate(h,b)}}}),J=new t(l,{initialize:function(a){this.$super("div",{"class":"timepicker"});this.options=a;var b=o(this.timeChanged).bind(this);
26
- this.insert([this.hours=(new l("select")).onChange(b),this.minutes=(new l("select")).onChange(b)]);for(var c=a.timePeriod<60?a.timePeriod:60,e=a.timePeriod<60?1:Math.ceil(a.timePeriod/60),d=0;d<60;d++){var g=s(d);if(d<24&&d%e==0)if(a.twentyFourHour)this.hours.insert(new l("option",{value:d,html:g}));else if(d<12)this.hours.insert(new l("option",{value:d,html:d==0?12:d}));d%c==0&&this.minutes.insert(new l("option",{value:d,html:g}))}if(!a.twentyFourHour){this.meridian=(new l("select")).onChange(b).insertTo(this);
27
- o(o(a.format).includes(/%P/)?["am","pm"]:["AM","PM"]).each(function(h){this.meridian.insert(new l("option",{value:h.toLowerCase(),html:h}))},this)}},setDate:function(a){var b=this.options,c=b.timePeriod<60?a.getHours():Math.round(a.getHours()/(b.timePeriod/60))*(b.timePeriod/60);a=Math.round(a.getMinutes()/(b.timePeriod%60))*b.timePeriod;if(this.meridian){this.meridian.setValue(c<12?"am":"pm");c=c==0||c==12?12:c>12?c-12:c}this.hours.setValue(c);this.minutes.setValue(a)},timeChanged:function(a){a.stopPropagation();
28
- a=p(this.hours.value());var b=p(this.minutes.value());if(this.meridian){if(a==12)a=0;if(this.meridian.value()=="pm")a+=12}this.fire("time-set",{hours:a,minutes:b})}}),K=new t(l,{initialize:function(a){this.$super("div",{"class":"buttons"});this.insert([(new r(a.i18n.Now,{"class":"now"})).onClick("fire","now-clicked"),(new r(a.i18n.Done,{"class":"done"})).onClick("fire","done-clicked")])}});n.include({parse:function(a){var b;if(F(a)&&a){var c=B.escape(this.options.format),e=o(c.match(/%[a-z]/ig)).map("match",
29
- /[a-z]$/i).map("first").without("%");c=new B("^"+c.replace(/%p/i,"(pm|PM|am|AM)").replace(/(%[a-z])/ig,"(.+?)")+"$");if(a=o(a).trim().match(c)){a.shift();for(var d=c=null,g=null,h=null,j=null,i;a.length;){var k=a.shift(),m=e.shift();if(m.toLowerCase()=="b")d=this.options.i18n[m=="b"?"monthNamesShort":"monthNames"].indexOf(k);else if(m.toLowerCase()=="p")i=k.toLowerCase();else{k=p(k,10);switch(m){case "d":case "e":b=k;break;case "m":d=k-1;break;case "y":case "Y":c=k;break;case "H":case "k":case "I":case "l":g=
30
- k;break;case "M":h=k;break;case "S":j=k;break}}}if(i){g=g==12?0:g;g=i=="pm"?g+12:g}b=new Date(c,d,b,g,h,j)}}else if(a instanceof Date||Date.parse(a))b=new Date(a);return!b||isNaN(b.getTime())?null:b},format:function(a){var b=this.options.i18n,c=this.date.getDay(),e=this.date.getMonth(),d=this.date.getDate(),g=this.date.getFullYear(),h=this.date.getHours(),j=this.date.getMinutes(),i=this.date.getSeconds(),k=h==0?12:h<13?h:h-12;b={a:b.dayNamesShort[c],A:b.dayNames[c],b:b.monthNamesShort[e],B:b.monthNames[e],
31
- d:s(d),e:""+d,m:(e<9?"0":"")+(e+1),y:(""+g).substring(2,4),Y:""+g,H:s(h),k:""+h,I:(h>0&&(h<10||h>12&&h<22)?"0":"")+k,l:""+k,p:h<12?"AM":"PM",P:h<12?"am":"pm",M:s(j),S:s(i),"%":"%"};a=a||this.options.format;for(var m in b)a=a.replace("%"+m,b[m]);return a}});n.include({initEvents:function(){var a=this._terminate;this.on({"prev-day":["_shiftDate",{Date:-1}],"next-day":["_shiftDate",{Date:1}],"prev-week":["_shiftDate",{Date:-7}],"next-week":["_shiftDate",{Date:7}],"prev-month":["_shiftDate",{Month:-1}],
32
- "next-month":["_shiftDate",{Month:1}],"prev-year":["_shiftDate",{FullYear:-1}],"next-year":["_shiftDate",{FullYear:1}],"date-set":this._changeDate,"time-set":this._changeTime,"now-clicked":this._setNow,"done-clicked":this.done,click:a,mousedown:a,focus:a,blur:a})},_shiftDate:function(a){var b=new Date(this.date);for(var c in a)b["set"+c](b["get"+c]()+a[c]);this.setDate(b)},_changeDate:function(a){var b=new Date(this.date);b.setDate(a.date);b.setMonth(a.month);b.setFullYear(a.year);this.setDate(b,
33
- true);this.options.hideOnPick&&this.done()},_changeTime:function(a){var b=new Date(this.date);b.setHours(a.hours);b.setMinutes(a.minutes);this.setDate(b)},_setNow:function(){this.setDate(new Date)},_terminate:function(a){a.stopPropagation();if(this._hide_delay){this._hide_delay.cancel();this._hide_delay=null}}});y(u).on({focus:function(a){a=a.target instanceof A&&a.target.get("type")=="text"?a.target:null;n.hideAll();if(a&&(a.calendar||a.match(n.Options.cssRule)))(a.calendar||new n({update:a})).setValue(a.value()).showAt(a)},
34
- blur:function(a){var b=a.target.calendar;if(b)b._hide_delay=o(function(){b.hide()}).delay(200)},click:function(a){var b=a.target instanceof l?a.target:null;if(b&&(b.calendar||b.match(n.Options.cssRule))){if(!(b instanceof A)||b.get("type")!="text"){a.stop();(b.calendar||new n({trigger:b})).hide(null).toggleAt(b.assignedInput)}}else a.find("div.rui-calendar")||n.hideAll()},keydown:function(a){var b=n.current,c={27:"hide",37:"prev-day",39:"next-day",38:"prev-week",40:"next-week",33:"prev-month",34:"next-month",
35
- 13:"done"}[a.keyCode];if(c&&b&&b.visible()){a.stop();G(b[c])?b[c]():b.fire(c)}}});u.write('<style type="text/css">.rui-panel{margin:0;padding:.5em;position:relative;background-color:#EEE;border:1px solid #BBB;border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;box-shadow:.15em .3em .5em #BBB;-moz-box-shadow:.15em .3em .5em #BBB;-webkit-box-shadow:.15em .3em .5em #BBB;cursor:default} *.rui-button{display:inline-block; *display:inline; *zoom:1;height:1em;line-height:1em;margin:0;padding:.2em .5em;text-align:center;border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;cursor:pointer;color:#333;background-color:#FFF;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-button:hover{color:#111;border-color:#999;background-color:#DDD;box-shadow:#888 0 0 .1em;-moz-box-shadow:#888 0 0 .1em;-webkit-box-shadow:#888 0 0 .1em} *.rui-button:active{color:#000;border-color:#777;text-indent:1px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none} *.rui-button-disabled, *.rui-button-disabled:hover, *.rui-button-disabled:active{color:#888;background:#DDD;border-color:#CCC;cursor:default;text-indent:0;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-re-anchor{margin:0;padding:0;background:none;border:none;float:none;display:inline;position:absolute;z-index:9999}div.rui-calendar .swaps,div.rui-calendar .greed,div.rui-calendar .timepicker,div.rui-calendar .buttons,div.rui-calendar table,div.rui-calendar table tr,div.rui-calendar table th,div.rui-calendar table td,div.rui-calendar table tbody,div.rui-calendar table thead,div.rui-calendar table caption{background:none;border:none;width:auto;height:auto;margin:0;padding:0}div.rui-calendar-inline{position:relative;display:inline-block; *display:inline; *zoom:1;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-calendar .swaps{position:relative}div.rui-calendar .swaps .rui-button{position:absolute;float:left;width:1em;padding:.15em .4em}div.rui-calendar .swaps .next-month{right:0em;_right:.5em}div.rui-calendar .swaps .prev-year{left:2.05em}div.rui-calendar .swaps .next-year{right:2.05em;_right:2.52em}div.rui-calendar .greed{border-spacing:0px;border-collapse:collapse;border-size:0}div.rui-calendar .greed td{vertical-align:top;padding-left:.4em}div.rui-calendar .greed>tbody>tr>td:first-child{padding:0}div.rui-calendar .month{margin-top:.2em;border-spacing:1px;border-collapse:separate}div.rui-calendar .month caption{text-align:center}div.rui-calendar .month th{color:#666;text-align:center}div.rui-calendar .month td{text-align:right;padding:.1em .3em;background-color:#FFF;border:1px solid #CCC;cursor:pointer;color:#555;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em}div.rui-calendar .month td:hover{background-color:#CCC;border-color:#AAA;color:#000}div.rui-calendar .month td.blank{background:transparent;cursor:default;border:none}div.rui-calendar .month td.selected{background-color:#BBB;border-color:#AAA;color:#222;font-weight:bold;padding:.1em .2em}div.rui-calendar .month td.disabled{color:#888;background:#EEE;border-color:#CCC;cursor:default}div.rui-calendar .timepicker{border-top:1px solid #ccc;margin-top:.3em;padding-top:.5em;text-align:center}div.rui-calendar .timepicker select{margin:0 .4em}div.rui-calendar .buttons{position:relative;margin-top:.5em}div.rui-calendar .buttons div.rui-button{width:4em;padding:.25em .5em}div.rui-calendar .buttons .done{position:absolute;right:0em;top:0}</style>');
9
+ C=f.Browser,r=new f.Wrapper(f.Element,{initialize:function(a,b){this.$super("div",b);this._.innerHTML=a;this.addClass("rui-button");this.on("selectstart","stopEvent")},disable:function(){return this.addClass("rui-button-disabled")},enable:function(){return this.removeClass("rui-button-disabled")},disabled:function(){return this.hasClass("rui-button-disabled")},enabled:function(){return!this.disabled()},fire:function(){this.enabled()&&this.$super.apply(this,arguments);return this}}),n=new (function(a,
10
+ b){if(!b){b=a;a="DIV"}var c=new f.Wrapper(f.Element.Wrappers[a]||f.Element,{initialize:function(e,d){this.key=e;var g=[{"class":"rui-"+e}];this instanceof f.Input||this instanceof f.Form||g.unshift(a);this.$super.apply(this,g);if(f.isString(d))d=f.$(d);if(d instanceof f.Element){this._=d._;if("$listeners"in d)d.$listeners=d.$listeners;d={}}this.setOptions(d,this);return this},setOptions:function(e,d){d=d||this;f.Options.setOptions.call(this,f.Object.merge(e,eval("("+(d.get("data-"+this.key)||"{}")+
11
+ ")")));return this}});c=new f.Wrapper(c,b);f.Observer.createShortcuts(c.prototype,c.EVENTS||[]);return c})({include:[{show:function(a,b){this.constructor.current=this;return x.call(this,this,"show",a,b)},hide:function(a,b){this.constructor.current=null;return x.call(this,this,"hide",a,b)},showAt:function(a,b,c){var e=this.hide(null).shownAt=a=f.$(a),d=(this.reAnchor||(this.reAnchor=new f.Element("div",{"class":"rui-re-anchor"})).insert(this)).insertTo(e,"after").position();a=e.dimensions();var g=
12
+ p(e.getStyle("borderTopWidth")),h=p(e.getStyle("borderLeftWidth")),j=p(e.getStyle("borderRightWidth")),i=p(e.getStyle("borderBottomWidth"));e=a.top-d.y+g;d=a.left-d.x+h;h=a.width-h-j;a=a.height-g-i;this.setStyle("visibility:hidden").show(null);if(b==="right")d+=h-this.size().x;else e+=a;this.moveTo(d,e);if(c)["left","right"].include(b)?this.setHeight(a):this.setWidth(h);this.setStyle("visibility:visible").hide(null);return this.show()},toggleAt:function(a,b,c){return this.hidden()?this.showAt(a,b,
13
+ c):this.hide()}},{assignTo:function(a,b){a=f.$(a);if(b=f.$(b)){b[this.key]=this;b.assignedInput=a}else a[this.key]=this;var c=f(function(){if(this.visible()&&(!this.showAt||this.shownAt===a))this.setValue(a.value())}).bind(this);a.on({keyup:c,change:c});this.onChange(function(){if(!this.showAt||this.shownAt===a)a.setValue(this.getValue())});return this}}],extend:{version:"2.0.0",EVENTS:q("show hide change done"),Options:{format:"ISO",showTime:null,showButtons:false,minDate:false,maxDate:false,fxName:"fade",
14
+ fxDuration:"short",firstDay:1,numberOfMonths:1,timePeriod:1,twentyFourHour:null,listYears:false,hideOnPick:false,update:null,trigger:null,cssRule:"*[data-calendar]"},Formats:{ISO:"%Y-%m-%d",POSIX:"%Y/%m/%d",EUR:"%d-%m-%Y",US:"%m/%d/%Y"},i18n:{Done:"Done",Now:"Now",NextMonth:"Next Month",PrevMonth:"Previous Month",NextYear:"Next Year",PrevYear:"Previous Year",dayNames:q("Sunday Monday Tuesday Wednesday Thursday Friday Saturday"),dayNamesShort:q("Sun Mon Tue Wed Thu Fri Sat"),dayNamesMin:q("Su Mo Tu We Th Fr Sa"),
15
+ monthNames:q("January February March April May June July August September October November December"),monthNamesShort:q("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")},current:null,hideAll:function(a){D("div.rui-calendar").each(function(b){b instanceof n&&b!==a&&b.visible()&&!b.inlined()&&b.hide()})}},initialize:function(a){this.$super("calendar",a);this.addClass("rui-panel");a=this.options;this.insert([this.swaps=new H(a),this.greed=new I(a)]);if(a.showTime)this.insert(this.timepicker=new J(a));
16
+ if(a.showButtons)this.insert(this.buttons=new K(a));this.setDate(new Date).initEvents()},setDate:function(a,b){if(a=this.parse(a)){var c=this.options;if(c.minDate&&c.minDate>a)a=new Date(c.minDate);if(c.maxDate&&c.maxDate<a){a=new Date(c.maxDate);a.setDate(a.getDate()-1)}this._date=b?new Date(this._date||this.date):null;this.greed.setDate(this._date||a,a);if(c.minDate||c.maxDate)this.swaps.setDate(a);this.timepicker&&!b&&this.timepicker.setDate(a);if(a!=this.date)this.fire("change",{date:this.date=
17
+ a})}return this},getDate:function(){return this.date},setValue:function(a){return this.setDate(a)},getValue:function(a){return this.format(a)},insertTo:function(a,b){this.addClass("rui-calendar-inline");return this.$super(a,b)},done:function(){this.inlined()||this.hide();this.fire("done",{date:this.date})},inlined:function(){return this.hasClass("rui-calendar-inline")},setOptions:function(a){a=a||{};this.$super(a,y(a.trigger||a.update));var b=this.constructor,c=this.options;c.i18n={};for(var e in b.i18n)c.i18n[e]=
18
+ z(b.i18n[e])?b.i18n[e].clone():b.i18n[e];E(c.i18n,a.i18n);c.dayNames=c.i18n.dayNamesMin;c.firstDay&&c.dayNames.push(c.dayNames.shift());if(!z(c.numberOfMonths))c.numberOfMonths=[c.numberOfMonths,1];if(c.minDate)c.minDate=this.parse(c.minDate);if(c.maxDate){c.maxDate=this.parse(c.maxDate);c.maxDate.setDate(c.maxDate.getDate()+1)}c.format=o(b.Formats[c.format]||c.format).trim();if(c.showTime===null)c.showTime=c.format.search(/%[HkIl]/)>-1;if(c.twentyFourHour===null)c.twentyFourHour=c.format.search(/%[Il]/)<
19
+ 0;if(c.timePeriod>60&&12%Math.ceil(c.timePeriod/60))c.twentyFourHour=true;c.update&&this.assignTo(c.update,c.trigger);return this},hideOthers:function(){n.hideAll(this);return this}}),H=new t(l,{initialize:function(a){this.$super("div",{"class":"swaps"});this.options=a;var b=a.i18n;this.insert([this.prevMonth=new r("&lsaquo;",{title:b.PrevMonth,"class":"prev-month"}),this.nextMonth=new r("&rsaquo;",{title:b.NextMonth,"class":"next-month"})]);if(a.listYears)this.insert([this.prevYear=new r("&laquo;",
20
+ {title:b.PrevYear,"class":"prev-year"}),this.nextYear=new r("&raquo;",{title:b.NextYear,"class":"next-year"})]);this.buttons=o([this.prevMonth,this.nextMonth,this.prevYear,this.nextYear]).compact();this.onClick(this.clicked)},setDate:function(a){var b=this.options,c=b.numberOfMonths[0]*b.numberOfMonths[1],e=true,d=true,g=true,h=true;if(b.minDate){g=new Date(a.getFullYear(),0,1,0,0,0);var j=new Date(b.minDate.getFullYear(),0,1,0,0,0);e=g>j;g.setMonth(a.getMonth()-Math.ceil(c-c/2));j.setMonth(b.minDate.getMonth());
21
+ g=g>=j}if(b.maxDate){a=new Date(a);b=new Date(b.maxDate);c=o([a,b]);c.each(function(i){i.setDate(32);i.setMonth(i.getMonth()-1);i.setDate(32-i.getDate());i.setHours(0);i.setMinutes(0);i.setSeconds(0);i.setMilliseconds(0)});h=a<b;c.each("setMonth",0);d=a<b}this.nextMonth[h?"enable":"disable"]();this.prevMonth[g?"enable":"disable"]();if(this.nextYear){this.nextYear[d?"enable":"disable"]();this.prevYear[e?"enable":"disable"]()}},clicked:function(a){(a=a.target)&&this.buttons.include(a)&&a.enabled()&&
22
+ this.fire(a.get("className").split(/\s+/)[0])}}),L=new t(l,{initialize:function(a){this.$super("table",{"class":"month"});this.options=a;this.insert(this.caption=new l("caption"));this.insert("<thead><tr>"+a.dayNames.map(function(d){return"<th>"+d+"</th>"}).join("")+"</tr></thead>");this.days=[];a=(new l("tbody")).insertTo(this);var b,c,e;for(c=0;c<6;c++){e=(new l("tr")).insertTo(a);for(b=0;b<7;b++)this.days.push((new l("td")).insertTo(e))}this.onClick(this.clicked)},setDate:function(a,b){a.setDate(32);
23
+ var c=32-a.getDate();a.setMonth(a.getMonth()-1);for(var e=Math.ceil(b.getTime()/864E5),d=this.options,g=d.i18n,h=this.days,j=0,i=h.length-1,k,m,v;j<7;j++){k=h[j]._;m=h[i-j]._;v=h[i-j-7]._;k.innerHTML=m.innerHTML=v.innerHTML="";k.className=m.className=v.className="blank"}j=1;i=0;for(var w;j<=c;j++){a.setDate(j);m=a.getDay();if(d.firstDay===1)m=m>0?m-1:6;if(j===1||m===0){w=h.slice(i*7,i*7+7);i++}k=w[m]._;if(C.OLD){k.innerHTML="";k.appendChild(u.createTextNode(j))}else k.innerHTML=""+j;k.className=e===
24
+ Math.ceil(a.getTime()/864E5)?"selected":"";if(d.minDate&&d.minDate>a||d.maxDate&&d.maxDate<a)k.className="disabled";w[m].date=new Date(a)}c=(d.listYears?g.monthNamesShort[a.getMonth()]+",":g.monthNames[a.getMonth()])+" "+a.getFullYear();e=this.caption._;if(C.OLD){e.innerHTML="";e.appendChild(u.createTextNode(c))}else e.innerHTML=c},clicked:function(a){a=a.target;var b=a.date;if(a&&b&&!a.hasClass("disabled")&&!a.hasClass("blank")){a.addClass("selected");this.fire("date-set",{date:b.getDate(),month:b.getMonth(),
25
+ year:b.getFullYear()})}}}),I=new t(l,{initialize:function(a){this.$super("table",{"class":"greed"});this.months=[];for(var b=(new l("tbody")).insertTo(this),c,e=0;e<a.numberOfMonths[1];e++)for(var d=(new l("tr")).insertTo(b),g=0;g<a.numberOfMonths[0];g++){this.months.push(c=new L(a));(new l("td")).insertTo(d).insert(c)}},setDate:function(a,b){var c=this.months,e=c.length;b=b||a;for(var d=-Math.ceil(e-e/2)+1,g=0;d<Math.floor(e-e/2)+1;d++,g++){var h=new Date(a);h.setMonth(a.getMonth()+d);c[g].setDate(h,
26
+ b)}}}),J=new t(l,{initialize:function(a){this.$super("div",{"class":"timepicker"});this.options=a;var b=o(this.timeChanged).bind(this);this.insert([this.hours=(new l("select")).onChange(b),this.minutes=(new l("select")).onChange(b)]);for(var c=a.timePeriod<60?a.timePeriod:60,e=a.timePeriod<60?1:Math.ceil(a.timePeriod/60),d=0;d<60;d++){var g=s(d);if(d<24&&d%e==0)if(a.twentyFourHour)this.hours.insert(new l("option",{value:d,html:g}));else if(d<12)this.hours.insert(new l("option",{value:d,html:d==0?
27
+ 12:d}));d%c==0&&this.minutes.insert(new l("option",{value:d,html:g}))}if(!a.twentyFourHour){this.meridian=(new l("select")).onChange(b).insertTo(this);o(o(a.format).includes(/%P/)?["am","pm"]:["AM","PM"]).each(function(h){this.meridian.insert(new l("option",{value:h.toLowerCase(),html:h}))},this)}},setDate:function(a){var b=this.options,c=b.timePeriod<60?a.getHours():Math.round(a.getHours()/(b.timePeriod/60))*(b.timePeriod/60);a=Math.round(a.getMinutes()/(b.timePeriod%60))*b.timePeriod;if(this.meridian){this.meridian.setValue(c<
28
+ 12?"am":"pm");c=c==0||c==12?12:c>12?c-12:c}this.hours.setValue(c);this.minutes.setValue(a)},timeChanged:function(a){a.stopPropagation();a=p(this.hours.value());var b=p(this.minutes.value());if(this.meridian){if(a==12)a=0;if(this.meridian.value()=="pm")a+=12}this.fire("time-set",{hours:a,minutes:b})}}),K=new t(l,{initialize:function(a){this.$super("div",{"class":"buttons"});this.insert([(new r(a.i18n.Now,{"class":"now"})).onClick("fire","now-clicked"),(new r(a.i18n.Done,{"class":"done"})).onClick("fire",
29
+ "done-clicked")])}});n.include({parse:function(a){var b;if(F(a)&&a){var c=B.escape(this.options.format),e=o(c.match(/%[a-z]/ig)).map("match",/[a-z]$/i).map("first").without("%");c=new B("^"+c.replace(/%p/i,"(pm|PM|am|AM)").replace(/(%[a-z])/ig,"(.+?)")+"$");if(a=o(a).trim().match(c)){a.shift();for(var d=c=null,g=null,h=null,j=null,i;a.length;){var k=a.shift(),m=e.shift();if(m.toLowerCase()=="b")d=this.options.i18n[m=="b"?"monthNamesShort":"monthNames"].indexOf(k);else if(m.toLowerCase()=="p")i=k.toLowerCase();
30
+ else{k=p(k,10);switch(m){case "d":case "e":b=k;break;case "m":d=k-1;break;case "y":case "Y":c=k;break;case "H":case "k":case "I":case "l":g=k;break;case "M":h=k;break;case "S":j=k;break}}}if(i){g=g==12?0:g;g=i=="pm"?g+12:g}b=new Date(c,d,b,g,h,j)}}else if(a instanceof Date||Date.parse(a))b=new Date(a);return!b||isNaN(b.getTime())?null:b},format:function(a){var b=this.options.i18n,c=this.date.getDay(),e=this.date.getMonth(),d=this.date.getDate(),g=this.date.getFullYear(),h=this.date.getHours(),j=this.date.getMinutes(),
31
+ i=this.date.getSeconds(),k=h==0?12:h<13?h:h-12;b={a:b.dayNamesShort[c],A:b.dayNames[c],b:b.monthNamesShort[e],B:b.monthNames[e],d:s(d),e:""+d,m:(e<9?"0":"")+(e+1),y:(""+g).substring(2,4),Y:""+g,H:s(h),k:""+h,I:(h>0&&(h<10||h>12&&h<22)?"0":"")+k,l:""+k,p:h<12?"AM":"PM",P:h<12?"am":"pm",M:s(j),S:s(i),"%":"%"};a=a||this.options.format;for(var m in b)a=a.replace("%"+m,b[m]);return a}});n.include({initEvents:function(){var a=this._terminate;this.on({"prev-day":["_shiftDate",{Date:-1}],"next-day":["_shiftDate",
32
+ {Date:1}],"prev-week":["_shiftDate",{Date:-7}],"next-week":["_shiftDate",{Date:7}],"prev-month":["_shiftDate",{Month:-1}],"next-month":["_shiftDate",{Month:1}],"prev-year":["_shiftDate",{FullYear:-1}],"next-year":["_shiftDate",{FullYear:1}],"date-set":this._changeDate,"time-set":this._changeTime,"now-clicked":this._setNow,"done-clicked":this.done,click:a,mousedown:a,focus:a,blur:a})},_shiftDate:function(a){var b=new Date(this.date);for(var c in a)b["set"+c](b["get"+c]()+a[c]);this.setDate(b)},_changeDate:function(a){var b=
33
+ new Date(this.date);b.setDate(a.date);b.setMonth(a.month);b.setFullYear(a.year);this.setDate(b,true);this.options.hideOnPick&&this.done()},_changeTime:function(a){var b=new Date(this.date);b.setHours(a.hours);b.setMinutes(a.minutes);this.setDate(b)},_setNow:function(){this.setDate(new Date)},_terminate:function(a){a.stopPropagation();if(this._hide_delay){this._hide_delay.cancel();this._hide_delay=null}}});y(u).on({focus:function(a){a=a.target instanceof A&&a.target.get("type")=="text"?a.target:null;
34
+ n.hideAll();if(a&&(a.calendar||a.match(n.Options.cssRule)))(a.calendar||new n({update:a})).setValue(a.value()).showAt(a)},blur:function(a){var b=a.target.calendar;if(b)b._hide_delay=o(function(){b.hide()}).delay(200)},click:function(a){var b=a.target instanceof l?a.target:null;if(b&&(b.calendar||b.match(n.Options.cssRule))){if(!(b instanceof A)||b.get("type")!="text"){a.stop();(b.calendar||new n({trigger:b})).hide(null).toggleAt(b.assignedInput)}}else a.find("div.rui-calendar")||n.hideAll()},keydown:function(a){var b=
35
+ n.current,c={27:"hide",37:"prev-day",39:"next-day",38:"prev-week",40:"next-week",33:"prev-month",34:"next-month",13:"done"}[a.keyCode];if(c&&b&&b.visible()){a.stop();G(b[c])?b[c]():b.fire(c)}}});u.write('<style type="text/css">.rui-panel{margin:0;padding:.5em;position:relative;background-color:#EEE;border:1px solid #BBB;border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;box-shadow:.15em .3em .5em #BBB;-moz-box-shadow:.15em .3em .5em #BBB;-webkit-box-shadow:.15em .3em .5em #BBB;cursor:default} *.rui-button{display:inline-block; *display:inline; *zoom:1;height:1em;line-height:1em;margin:0;padding:.2em .5em;text-align:center;border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;cursor:pointer;color:#333;background-color:#FFF;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-button:hover{color:#111;border-color:#999;background-color:#DDD;box-shadow:#888 0 0 .1em;-moz-box-shadow:#888 0 0 .1em;-webkit-box-shadow:#888 0 0 .1em} *.rui-button:active{color:#000;border-color:#777;text-indent:1px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none} *.rui-button-disabled, *.rui-button-disabled:hover, *.rui-button-disabled:active{color:#888;background:#DDD;border-color:#CCC;cursor:default;text-indent:0;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-re-anchor{margin:0;padding:0;background:none;border:none;float:none;display:inline;position:absolute;z-index:9999}div.rui-calendar .swaps,div.rui-calendar .greed,div.rui-calendar .timepicker,div.rui-calendar .buttons,div.rui-calendar table,div.rui-calendar table tr,div.rui-calendar table th,div.rui-calendar table td,div.rui-calendar table tbody,div.rui-calendar table thead,div.rui-calendar table caption{background:none;border:none;width:auto;height:auto;margin:0;padding:0}div.rui-calendar-inline{position:relative;display:inline-block; *display:inline; *zoom:1;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-calendar .swaps{position:relative}div.rui-calendar .swaps .rui-button{position:absolute;float:left;width:1em;padding:.15em .4em}div.rui-calendar .swaps .next-month{right:0em;_right:.5em}div.rui-calendar .swaps .prev-year{left:2.05em}div.rui-calendar .swaps .next-year{right:2.05em;_right:2.52em}div.rui-calendar .greed{border-spacing:0px;border-collapse:collapse;border-size:0}div.rui-calendar .greed td{vertical-align:top;padding-left:.4em}div.rui-calendar .greed>tbody>tr>td:first-child{padding:0}div.rui-calendar .month{margin-top:.2em;border-spacing:1px;border-collapse:separate}div.rui-calendar .month caption{text-align:center}div.rui-calendar .month th{color:#666;text-align:center}div.rui-calendar .month td{text-align:right;padding:.1em .3em;background-color:#FFF;border:1px solid #CCC;cursor:pointer;color:#555;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em}div.rui-calendar .month td:hover{background-color:#CCC;border-color:#AAA;color:#000}div.rui-calendar .month td.blank{background:transparent;cursor:default;border:none}div.rui-calendar .month td.selected{background-color:#BBB;border-color:#AAA;color:#222;font-weight:bold;padding:.1em .2em}div.rui-calendar .month td.disabled{color:#888;background:#EEE;border-color:#CCC;cursor:default}div.rui-calendar .timepicker{border-top:1px solid #ccc;margin-top:.3em;padding-top:.5em;text-align:center}div.rui-calendar .timepicker select{margin:0 .4em}div.rui-calendar .buttons{position:relative;margin-top:.5em}div.rui-calendar .buttons div.rui-button{width:4em;padding:.25em .5em}div.rui-calendar .buttons .done{position:absolute;right:0em;top:0}</style>');
36
36
  return n}(document,parseInt,RightJS);
@@ -144,6 +144,7 @@ var Button = new RightJS.Wrapper(RightJS.Element, {
144
144
  this.$super('div', options);
145
145
  this._.innerHTML = caption;
146
146
  this.addClass('rui-button');
147
+ this.on('selectstart', 'stopEvent');
147
148
  },
148
149
 
149
150
  /**
@@ -6,13 +6,13 @@
6
6
  * Copyright (C) 2010 Nikolay Nemshilov
7
7
  */
8
8
  var Colorpicker=RightJS.Colorpicker=function(p,q,i,e){function r(a,b,c,d){if(e.Fx)if(c===undefined){c=this.options.fxName;if(d===undefined){d={duration:this.options.fxDuration,onFinish:e(this.fire).bind(this,b)};if(b==="hide")d.duration=(e.Fx.Durations[d.duration]||d.duration)/2}}e.Element.prototype[b].call(a,c,d);if(!e.Fx||!c)this.fire(b);return this}var j=e,n=e.$,u=e.$w,v=e.$$,h=e.$E,s=e.$A,w=e.isArray,o=e.Wrapper,m=e.Element,t=e.Input,x=new e.Wrapper(e.Element,{initialize:function(a,b){this.$super("div",
9
- b);this._.innerHTML=a;this.addClass("rui-button")},disable:function(){return this.addClass("rui-button-disabled")},enable:function(){return this.removeClass("rui-button-disabled")},disabled:function(){return this.hasClass("rui-button-disabled")},enabled:function(){return!this.disabled()},fire:function(){this.enabled()&&this.$super.apply(this,arguments);return this}}),g=new (function(a,b){if(!b){b=a;a="DIV"}var c=new e.Wrapper(e.Element.Wrappers[a]||e.Element,{initialize:function(d,f){this.key=d;var k=
10
- [{"class":"rui-"+d}];this instanceof e.Input||this instanceof e.Form||k.unshift(a);this.$super.apply(this,k);if(e.isString(f))f=e.$(f);if(f instanceof e.Element){this._=f._;if("$listeners"in f)f.$listeners=f.$listeners;f={}}this.setOptions(f,this);return this},setOptions:function(d,f){f=f||this;e.Options.setOptions.call(this,e.Object.merge(d,eval("("+(f.get("data-"+this.key)||"{}")+")")));return this}});c=new e.Wrapper(c,b);e.Observer.createShortcuts(c.prototype,c.EVENTS||[]);return c})({include:[{show:function(a,
11
- b){this.constructor.current=this;return r.call(this,this,"show",a,b)},hide:function(a,b){this.constructor.current=null;return r.call(this,this,"hide",a,b)},showAt:function(a,b,c){var d=this.hide(null).shownAt=a=e.$(a),f=(this.reAnchor||(this.reAnchor=new e.Element("div",{"class":"rui-re-anchor"})).insert(this)).insertTo(d,"after").position();a=d.dimensions();var k=i(d.getStyle("borderTopWidth")),l=i(d.getStyle("borderLeftWidth")),y=i(d.getStyle("borderRightWidth")),z=i(d.getStyle("borderBottomWidth"));
12
- d=a.top-f.y+k;f=a.left-f.x+l;l=a.width-l-y;a=a.height-k-z;this.setStyle("visibility:hidden").show(null);if(b==="right")f+=l-this.size().x;else d+=a;this.moveTo(f,d);if(c)["left","right"].include(b)?this.setHeight(a):this.setWidth(l);this.setStyle("visibility:visible").hide(null);return this.show()},toggleAt:function(a,b,c){return this.hidden()?this.showAt(a,b,c):this.hide()}},{assignTo:function(a,b){a=e.$(a);if(b=e.$(b)){b[this.key]=this;b.assignedInput=a}else a[this.key]=this;var c=e(function(){if(this.visible()&&
13
- (!this.showAt||this.shownAt===a))this.setValue(a.value())}).bind(this);a.on({keyup:c,change:c});this.onChange(function(){if(!this.showAt||this.shownAt===a)a.setValue(this.getValue())});return this}}],extend:{version:"2.0.0",EVENTS:u("change show hide done"),Options:{format:"hex",update:null,updateBg:null,trigger:null,fxName:"fade",fxDuration:"short",cssRule:"*[data-colorpicker]"},i18n:{Done:"Done"},hideAll:function(){v("div.rui-colorpicker").each(function(a){a instanceof g&&!a.inlined()&&a.hide()})}},
14
- initialize:function(a){this.$super("colorpicker",a).addClass("rui-panel").insert([this.field=new A,this.colors=new B,this.controls=new C]).on({mousedown:this.startTrack,keyup:this.recalc,blur:this.update,focus:this.cancelTimer,done:this.done});this.options.update&&this.assignTo(this.options.update,this.options.trigger);this.options.updateBg&&this.updateBg(this.options.updateBg);this.tint=j([1,0,0]);this.satur=0;this.bright=1;this.color=j([255,255,255]);this.recalc().update()},setValue:function(a){if((a=
15
- w(a)?a:this.toColor(a))&&a.length===3){this.color=a=a.map(function(b){return this.bound(i(""+b),0,255)},this);this.color2tint().update();this.colors.size().y||this.update.bind(this).delay(20)}return this},getValue:function(a){return a?this.color:this[this.options.format==="rgb"?"toRgb":"toHex"]()},updateBg:function(a){var b=n(a);b&&this.onChange(j(function(){b._.style.backgroundColor=this.toRgb()}).bind(this));return this},insertTo:function(a,b){return this.$super(a,b).addClass("rui-colorpicker-inline")},
9
+ b);this._.innerHTML=a;this.addClass("rui-button");this.on("selectstart","stopEvent")},disable:function(){return this.addClass("rui-button-disabled")},enable:function(){return this.removeClass("rui-button-disabled")},disabled:function(){return this.hasClass("rui-button-disabled")},enabled:function(){return!this.disabled()},fire:function(){this.enabled()&&this.$super.apply(this,arguments);return this}}),g=new (function(a,b){if(!b){b=a;a="DIV"}var c=new e.Wrapper(e.Element.Wrappers[a]||e.Element,{initialize:function(d,
10
+ f){this.key=d;var k=[{"class":"rui-"+d}];this instanceof e.Input||this instanceof e.Form||k.unshift(a);this.$super.apply(this,k);if(e.isString(f))f=e.$(f);if(f instanceof e.Element){this._=f._;if("$listeners"in f)f.$listeners=f.$listeners;f={}}this.setOptions(f,this);return this},setOptions:function(d,f){f=f||this;e.Options.setOptions.call(this,e.Object.merge(d,eval("("+(f.get("data-"+this.key)||"{}")+")")));return this}});c=new e.Wrapper(c,b);e.Observer.createShortcuts(c.prototype,c.EVENTS||[]);
11
+ return c})({include:[{show:function(a,b){this.constructor.current=this;return r.call(this,this,"show",a,b)},hide:function(a,b){this.constructor.current=null;return r.call(this,this,"hide",a,b)},showAt:function(a,b,c){var d=this.hide(null).shownAt=a=e.$(a),f=(this.reAnchor||(this.reAnchor=new e.Element("div",{"class":"rui-re-anchor"})).insert(this)).insertTo(d,"after").position();a=d.dimensions();var k=i(d.getStyle("borderTopWidth")),l=i(d.getStyle("borderLeftWidth")),y=i(d.getStyle("borderRightWidth")),
12
+ z=i(d.getStyle("borderBottomWidth"));d=a.top-f.y+k;f=a.left-f.x+l;l=a.width-l-y;a=a.height-k-z;this.setStyle("visibility:hidden").show(null);if(b==="right")f+=l-this.size().x;else d+=a;this.moveTo(f,d);if(c)["left","right"].include(b)?this.setHeight(a):this.setWidth(l);this.setStyle("visibility:visible").hide(null);return this.show()},toggleAt:function(a,b,c){return this.hidden()?this.showAt(a,b,c):this.hide()}},{assignTo:function(a,b){a=e.$(a);if(b=e.$(b)){b[this.key]=this;b.assignedInput=a}else a[this.key]=
13
+ this;var c=e(function(){if(this.visible()&&(!this.showAt||this.shownAt===a))this.setValue(a.value())}).bind(this);a.on({keyup:c,change:c});this.onChange(function(){if(!this.showAt||this.shownAt===a)a.setValue(this.getValue())});return this}}],extend:{version:"2.0.0",EVENTS:u("change show hide done"),Options:{format:"hex",update:null,updateBg:null,trigger:null,fxName:"fade",fxDuration:"short",cssRule:"*[data-colorpicker]"},i18n:{Done:"Done"},hideAll:function(){v("div.rui-colorpicker").each(function(a){a instanceof
14
+ g&&!a.inlined()&&a.hide()})}},initialize:function(a){this.$super("colorpicker",a).addClass("rui-panel").insert([this.field=new A,this.colors=new B,this.controls=new C]).on({mousedown:this.startTrack,keyup:this.recalc,blur:this.update,focus:this.cancelTimer,done:this.done});this.options.update&&this.assignTo(this.options.update,this.options.trigger);this.options.updateBg&&this.updateBg(this.options.updateBg);this.tint=j([1,0,0]);this.satur=0;this.bright=1;this.color=j([255,255,255]);this.recalc().update()},
15
+ setValue:function(a){if((a=w(a)?a:this.toColor(a))&&a.length===3){this.color=a=a.map(function(b){return this.bound(i(""+b),0,255)},this);this.color2tint().update();this.colors.size().y||this.update.bind(this).delay(20)}return this},getValue:function(a){return a?this.color:this[this.options.format==="rgb"?"toRgb":"toHex"]()},updateBg:function(a){var b=n(a);b&&this.onChange(j(function(){b._.style.backgroundColor=this.toRgb()}).bind(this));return this},insertTo:function(a,b){return this.$super(a,b).addClass("rui-colorpicker-inline")},
16
16
  inlined:function(){return this.hasClass("rui-colorpicker-inline")},done:function(){this.inlined()||this.hide();return this},setOptions:function(a){a=a||{};this.$super(a,n(a.trigger||a.update))},update:function(){this.field._.style.backgroundColor="rgb("+this.tint.map(function(d){return q.round(d*255)})+")";var a=this.color,b=this.controls;b.preview._.style.backgroundColor=b.display._.value=this.toHex();b.rDisplay._.value=a[0];b.gDisplay._.value=a[1];b.bDisplay._.value=a[2];b=this.field.pointer._.style;
17
17
  a=this.field.size();var c=this.satur*a.x-2;b.top=this.bound(a.y-this.bright*a.y-2,0,a.y-5)+"px";b.left=this.bound(c,0,a.x-5)+"px";b=this.tint;a=this.colors.size();b=b[1]==0?b[0]==1?b[2]:2-b[0]:b[0]==0?2+(b[2]==1?b[1]:2-b[2]):4+(b[1]==1?b[0]:2-b[1]);b=b/6*a.y;this.colors.pointer._.style.top=this.bound(b,0,a.y-4)+"px";if(this.prevColor!==""+this.color){this.fire("change",{value:this.color});this.prevColor=""+this.color}return this},recalc:function(a){if(a){a=a.target;var b=a._.value,c=s(this.color),
18
18
  d=false;if(a===this.controls.display&&/#\w{6}/.test(b))d=c=this.toColor(b);else if(/^\d+$/.test(b)){c[a._.cIndex]=b;d=true}d&&this.setValue(c)}else this.tint2color();return this},startTrack:function(a){this.stopTrack();this.cancelTimer();if(a.target===this.field.pointer)a.target=this.field;else if(a.target===this.colors.pointer)a.target=this.colors;if(a.target===this.field||a.target===this.colors){a.stop();g.tracking=this;a.target.tracking=true;this.trackMove(a)}},stopTrack:function(){g.tracking=
@@ -0,0 +1,43 @@
1
+ /**
2
+ * RightJS UI Internationalization: Finnish module
3
+ *
4
+ * Copyright (C) Juho Vepsäläinen
5
+ * Source: http://www.csc.fi/sivut/kotoistus/suositukset/vahv_kalenterit_cldr1_4.htm
6
+ */
7
+ if (self.Calendar) {
8
+ $ext(Calendar.i18n, {
9
+ Done: "OK",
10
+ Now: "Tänään",
11
+ NextMonth: "Seuraava kuukausi",
12
+ PrevMonth: "Edellinen kuukausi",
13
+ NextYear: "Seuraava vuosi",
14
+ PrevYear: "Edellinen vuosi",
15
+
16
+ dayNames: $w('Sunnuntai Maanantai Tiistai Keskiviikko Torstai Perjantai Lauantai'),
17
+ dayNamesShort: $w('Su Ma Ti Ke To Pe La'),
18
+ dayNamesMin: $w('S M T K T P L'),
19
+ monthNames: $w('Tammikuu Helmikuu Maaliskuu Huhtikuu Toukokuu Kesäkuu Heinäkuu Elokuu Syyskuu Lokakuu Marraskuu Joulukuu'),
20
+ monthNamesShort: $w('Tammi Helmi Maalis Huhti Touko Kesä Heinä Elo Syys Loka Marras Joulu')
21
+ });
22
+ }
23
+
24
+ if (self.Lightbox) {
25
+ $ext(Lightbox.i18n, {
26
+ Close: 'Sulje',
27
+ Prev: 'Edellinen kuva',
28
+ Next: 'Seuraava kuva'
29
+ });
30
+ }
31
+
32
+ if (self.InEdit) {
33
+ $ext(InEdit.i18n, {
34
+ Save: "Tallenna",
35
+ Cancel: "Peruuta"
36
+ });
37
+ }
38
+
39
+ if (self.Colorpicker) {
40
+ $ext(Colorpicker.i18n, {
41
+ Done: 'OK'
42
+ });
43
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * RightJS UI Internationalization: Italian module
3
+ *
4
+ * Copyright (C) Nikolay Nemshilov
5
+ */
6
+ if (self.Calendar) {
7
+ $ext(Calendar.i18n, {
8
+ Done: 'Fatto',
9
+ Now: 'Oggi',
10
+ NextMonth: 'Mese successivo',
11
+ PrevMonth: 'Mese precedente',
12
+ NextYear: 'Anno seguente',
13
+ PrevYear: 'Anno precedente',
14
+
15
+ dayNames: $w('Domenica Lunedi Martedi Mercoledi Giovedi Venerdi Sabato'),
16
+ dayNamesShort: $w('Dom Lun Mar Mer Gio Ven Sab'),
17
+ dayNamesMin: $w('Do Lu Ma Me Gi Ve Sa'),
18
+ monthNames: $w('Gennaio Febbraio Marzo Aprile Maggio Giugno Luglio Agosto Settembre Ottobre Novembre Dicembre'),
19
+ monthNamesShort: $w('Gen Feb Mar Apr Mag Giu Lug Ago Set Ott Nov Dic')
20
+ });
21
+ }
22
+
23
+ if (self.Lightbox) {
24
+ $ext(Lightbox.i18n, {
25
+ Close: 'Chiudi',
26
+ Prev: 'Immagine precedente',
27
+ Next: 'Immagine seguente'
28
+ });
29
+ }
30
+
31
+ if (self.InEdit) {
32
+ $ext(InEdit.i18n, {
33
+ Save: "Salva",
34
+ Cancel: "Abbandona"
35
+ });
36
+ }
37
+
38
+ if (self.Colorpicker) {
39
+ $ext(Colorpicker.i18n, {
40
+ Done: 'Fatto'
41
+ });
42
+ }
@@ -175,13 +175,13 @@ var Spinner = new RightJS.Wrapper(RightJS.Element, {
175
175
  var Lightbox = new Widget({
176
176
 
177
177
  extend: {
178
- version: '2.0.0',
178
+ version: '2.0.2',
179
179
 
180
180
  EVENTS: $w('show hide load'),
181
181
 
182
182
  Options: {
183
183
  fxName: 'fade',
184
- fxDuration: 200,
184
+ fxDuration: 300,
185
185
 
186
186
  group: null, // a group marker
187
187
 
@@ -527,7 +527,7 @@ var Dialog = new Wrapper(Element, {
527
527
 
528
528
  if (RightJS.Fx && with_fx && (end_size.x != cur_size.x || end_size.y != cur_size.y)) {
529
529
 
530
- $ext(new RightJS.Fx(this, {duration: this.options.fxDuration, transition: 'Lin'}), {
530
+ $ext(new RightJS.Fx(this, {duration: this.options.fxDuration}), {
531
531
  render: function(delta) {
532
532
  content.width = (cur_size.x + (end_size.x - cur_size.x) * delta) + 'px';
533
533
  content.height = (cur_size.y + (end_size.y - cur_size.y) * delta) + 'px';
@@ -610,7 +610,7 @@ var Dialog = new Wrapper(Element, {
610
610
  * @return Dialog this
611
611
  */
612
612
  lock: function() {
613
- this.locker.setStyle('opacity:1');
613
+ this.locker.setStyle('opacity:1;display:block').insertTo(this.scroller, 'before');
614
614
  return this;
615
615
  },
616
616
 
@@ -620,7 +620,7 @@ var Dialog = new Wrapper(Element, {
620
620
  * @return Dialog this
621
621
  */
622
622
  unlock: function() {
623
- this.locker.morph({opacity: 0}, {
623
+ this.locker.remove(this.content.html().blank() ? null : 'fade', {
624
624
  duration: this.options.fxDuration * 2/3
625
625
  });
626
626
 
@@ -836,7 +836,12 @@ $(document).on({
836
836
  */
837
837
  mousewheel: function(event) {
838
838
  if (Lightbox.current) {
839
- event.stop();
839
+ var target = event.target, box = target.parent('div.rui-lightbox-content');
840
+
841
+ if (!box || target.getStyle('overflow') === 'visible') {
842
+ event.stop();
843
+ }
844
+
840
845
  Lightbox.current.fire((event._.detail || -event._.wheelDelta) < 0 ? 'prev' : 'next');
841
846
  }
842
847
  },
@@ -883,7 +888,7 @@ $(window).on({
883
888
  });
884
889
 
885
890
 
886
- document.write("<style type=\"text/css\">div.rui-spinner,div.rui-spinner div{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none;display:inline-block; *display:inline; *zoom:1;border-radius:.12em;-moz-border-radius:.12em;-webkit-border-radius:.12em}div.rui-spinner{text-align:center;white-space:nowrap;background:#EEE;border:1px solid #DDD;height:1.2em;padding:0 .2em}div.rui-spinner div{width:.4em;height:70%;background:#BBB;margin-left:1px}div.rui-spinner div:first-child{margin-left:0}div.rui-spinner div.glowing{background:#777}div.rui-lightbox{position:fixed;top:0;left:0;z-index:9999;float:none;width:100%;height:100%;margin:0;padding:0;background:none;border:none;text-align:center}div.rui-lightbox-locker{position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#000;opacity:0.8;filter:alpha(opacity=80);cursor:default}div.rui-lightbox-dialog{display:inline-block; *display:inline; *zoom:1;position:relative;text-align:left}div.rui-lightbox-title{height:1.2em;margin-bottom:.1em;white-space:nowrap;color:#DDD;font-weight:bold;font-size:1.6em;font-family:Helvetica;text-shadow:#000 .05em .1em .2em}div.rui-lightbox-body{background-color:white;padding:1em;border-radius:.5em;-moz-border-radius:.5em;-webkit-border-radius:.5em}div.rui-lightbox-body-inner{position:relative}div.rui-lightbox-scroller{overflow:hidden}div.rui-lightbox-content{display:inline-block; *display:inline; *zoom:1;min-height:10em;min-width:10em;_height:10em;_width:10em}div.rui-lightbox-body-locker{background-color:white;position:absolute;left:0px;top:0px;width:100%;height:100%;z-index:999;opacity:0;filter:alpha(opacity=0)}div.rui-lightbox-body-locker div.rui-spinner{position:absolute;right:0;bottom:0;border:none;background:none;font-size:150%}div.rui-lightbox-navigation{color:#888;font-size:150%;font-family:Arial;height:1em;user-select:none;-moz-user-select:none;-webkit-user-select:none}div.rui-lightbox-navigation div{cursor:pointer;position:absolute}div.rui-lightbox-navigation div:hover{color:white}div.rui-lightbox-navigation div.next{left:2em}div.rui-lightbox-navigation div.close{right:0}div.rui-lightbox-image div.rui-lightbox-body,div.rui-lightbox-media div.rui-lightbox-body{padding:0;border:1px solid #777;border-radius:0px;-moz-border-radius:0px;-webkit-border-radius:0px}div.rui-lightbox-image div.rui-lightbox-content,div.rui-lightbox-media div.rui-lightbox-content{min-height:12em;min-width:12em;_height:12em;_width:12em}div.rui-lightbox-image div.rui-lightbox-content img{vertical-align:middle}div.rui-lightbox-image div.rui-lightbox-body,div.rui-lightbox-image div.rui-lightbox-body-locker,div.rui-lightbox-media div.rui-lightbox-body,div.rui-lightbox-media div.rui-lightbox-body-locker{background-color:#D8D8D8}div.rui-lightbox-image div.rui-lightbox-body-locker div.rui-spinner,div.rui-lightbox-media div.rui-lightbox-body-locker div.rui-spinner{bottom:.5em;right:.5em}</style>");
891
+ document.write("<style type=\"text/css\">div.rui-spinner,div.rui-spinner div{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none;display:inline-block; *display:inline; *zoom:1;border-radius:.12em;-moz-border-radius:.12em;-webkit-border-radius:.12em}div.rui-spinner{text-align:center;white-space:nowrap;background:#EEE;border:1px solid #DDD;height:1.2em;padding:0 .2em}div.rui-spinner div{width:.4em;height:70%;background:#BBB;margin-left:1px}div.rui-spinner div:first-child{margin-left:0}div.rui-spinner div.glowing{background:#777}div.rui-lightbox{position:fixed;top:0;left:0;z-index:9999;float:none;width:100%;height:100%;margin:0;padding:0;background:none;border:none;text-align:center}div.rui-lightbox-locker{position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#000;opacity:0.8;filter:alpha(opacity=80);cursor:default}div.rui-lightbox-dialog{display:inline-block; *display:inline; *zoom:1;position:relative;text-align:left}div.rui-lightbox-title{height:1.2em;margin-bottom:.1em;white-space:nowrap;color:#DDD;font-weight:bold;font-size:1.6em;font-family:Helvetica}div.rui-lightbox-body{background-color:white;padding:1em;border-radius:.5em;-moz-border-radius:.5em;-webkit-border-radius:.5em}div.rui-lightbox-body-inner{position:relative}div.rui-lightbox-scroller{overflow:hidden}div.rui-lightbox-content{display:inline-block; *display:inline; *zoom:1;min-height:10em;min-width:10em;_height:10em;_width:10em}div.rui-lightbox-body-locker{background-color:white;position:absolute;left:0px;top:0px;width:100%;height:100%;z-index:999;opacity:0;filter:alpha(opacity=0)}div.rui-lightbox-body-locker div.rui-spinner{position:absolute;right:0;bottom:0;border:none;background:none;font-size:150%}div.rui-lightbox-navigation{color:#888;font-size:160%;font-family:Arial;height:1em;user-select:none;-moz-user-select:none;-webkit-user-select:none}div.rui-lightbox-navigation div{cursor:pointer;position:absolute}div.rui-lightbox-navigation div:hover{color:white}div.rui-lightbox-navigation div.next{left:2em}div.rui-lightbox-navigation div.close{right:0}div.rui-lightbox-image div.rui-lightbox-body,div.rui-lightbox-media div.rui-lightbox-body{padding:0;border:1px solid #777;border-radius:0px;-moz-border-radius:0px;-webkit-border-radius:0px}div.rui-lightbox-image div.rui-lightbox-content,div.rui-lightbox-media div.rui-lightbox-content{min-height:12em;min-width:12em;_height:12em;_width:12em}div.rui-lightbox-image div.rui-lightbox-content img{vertical-align:middle}div.rui-lightbox-image div.rui-lightbox-body,div.rui-lightbox-image div.rui-lightbox-body-locker,div.rui-lightbox-media div.rui-lightbox-body,div.rui-lightbox-media div.rui-lightbox-body-locker{background-color:#D8D8D8}div.rui-lightbox-image div.rui-lightbox-body-locker div.rui-spinner,div.rui-lightbox-media div.rui-lightbox-body-locker div.rui-spinner{bottom:.5em;right:.5em}</style>");
887
892
 
888
893
  return Lightbox;
889
894
  })(document, RightJS);
@@ -6,19 +6,19 @@
6
6
  */
7
7
  var Lightbox=RightJS.Lightbox=function(p,d){var q=d.$,r=d.$$,u=d.$w,h=d.$E,v=d.$ext,w=d.Xhr,x=d.Class,y=d.Object,s=d.Wrapper,j=d.Element,i=d.Browser;i.IE6=i.OLD&&navigator.userAgent.indexOf("MSIE 6")>0;var z=new d.Wrapper(d.Element,{initialize:function(a){this.$super("div",{"class":"rui-spinner"});this.dots=[];for(var b=0;b<(a||4);b++)this.dots.push(new d.Element("div"));this.dots[0].addClass("glowing");this.insert(this.dots);d(this.shift).bind(this).periodical(300)},shift:function(){if(this.visible()){var a=
8
8
  this.dots.pop();this.dots.unshift(a);this.insert(a,"top")}}}),f=new (function(a,b){if(!b){b=a;a="DIV"}var c=new d.Wrapper(d.Element.Wrappers[a]||d.Element,{initialize:function(e,g){this.key=e;var k=[{"class":"rui-"+e}];this instanceof d.Input||this instanceof d.Form||k.unshift(a);this.$super.apply(this,k);if(d.isString(g))g=d.$(g);if(g instanceof d.Element){this._=g._;if("$listeners"in g)g.$listeners=g.$listeners;g={}}this.setOptions(g,this);return this},setOptions:function(e,g){g=g||this;d.Options.setOptions.call(this,
9
- d.Object.merge(e,eval("("+(g.get("data-"+this.key)||"{}")+")")));return this}});c=new d.Wrapper(c,b);d.Observer.createShortcuts(c.prototype,c.EVENTS||[]);return c})({extend:{version:"2.0.0",EVENTS:u("show hide load"),Options:{fxName:"fade",fxDuration:200,group:null,hideOnEsc:true,hideOnOutClick:true,showCloseButton:true,cssRule:"a[data-lightbox]",mediaWidth:425,mediaHeight:350},i18n:{Close:"Close",Prev:"Previous Image",Next:"Next Image"},Images:/\.(jpg|jpeg|gif|png|bmp)/,Medias:[[/(http:\/\/.*?youtube\.[a-z]+)\/watch\?v=([^&]+)/,
9
+ d.Object.merge(e,eval("("+(g.get("data-"+this.key)||"{}")+")")));return this}});c=new d.Wrapper(c,b);d.Observer.createShortcuts(c.prototype,c.EVENTS||[]);return c})({extend:{version:"2.0.2",EVENTS:u("show hide load"),Options:{fxName:"fade",fxDuration:300,group:null,hideOnEsc:true,hideOnOutClick:true,showCloseButton:true,cssRule:"a[data-lightbox]",mediaWidth:425,mediaHeight:350},i18n:{Close:"Close",Prev:"Previous Image",Next:"Next Image"},Images:/\.(jpg|jpeg|gif|png|bmp)/,Medias:[[/(http:\/\/.*?youtube\.[a-z]+)\/watch\?v=([^&]+)/,
10
10
  "$1/v/$2","swf"],[/(http:\/\/video.google.com)\/videoplay\?docid=([^&]+)/,"$1/googleplayer.swf?docId=$2","swf"],[/(http:\/\/vimeo\.[a-z]+)\/([0-9]+).*?/,"$1/moogaloop.swf?clip_id=$2","swf"]]},initialize:function(a,b){this.$super("lightbox",{}).setOptions(a,b).insert([this.locker=new A(this.options),this.dialog=new B(this.options)]).on({close:this._close,next:this._next,prev:this._prev})},setOptions:function(a,b){this.$super(a,b);if(b){var c=b.get("rel");if(c&&(c=c.match(/lightbox\[(.+?)\]/)))this.options.group=
11
11
  c[1]}return this},setTitle:function(a){this.dialog.setTitle(a);return this},show:function(a){return this._showAnd(function(){this.dialog.show(a,!a)})},hide:function(){f.current=null;return this.$super(this.options.fxName,{duration:this.options.fxDuration/3,onFinish:d(function(){this.fire("hide");this.remove()}).bind(this)})},load:function(a,b){return this._showAnd(function(){this.dialog.load(a,b)})},resize:function(a){this.dialog.resize(a);return this},_close:function(a){a.stop();this.hide()},_prev:function(a){a.stop();
12
12
  l.prev()},_next:function(a){a.stop();l.next()},_showAnd:function(a){if(f.current!==this){f.current=this;r("div.rui-lightbox").each("remove");this.insertTo(p.body);this.dialog.show("",true);if(i.OLD){this.reposition();j.prototype.show.call(this);a.call(this)}else{this.setStyle("display:none");j.prototype.show.call(this,this.options.fxName,{duration:this.options.fxDuration/2,onFinish:d(function(){a.call(this);this.fire("show")}).bind(this)})}}else a.call(this);return this},reposition:function(){if(i.IE6){var a=
13
13
  q(window);this.setStyle({top:a.scrolls().y+"px",width:a.size().x+"px",height:a.size().y+"px",position:"absolute"})}}});f.extend({hide:function(){f.current&&f.current.hide()},show:function(){return this.inst("show",arguments)},load:function(){return this.inst("load",arguments)},inst:function(a,b){var c=new f;return c[a].apply(c,b)}});var A=new s(j,{initialize:function(a){this.$super("div",{"class":"rui-lightbox-locker"});a.hideOnOutClick&&this.onClick("fire","close")}}),B=new s(j,{initialize:function(a){var b=
14
14
  f.i18n;this.options=a;this.$super("div",{"class":"rui-lightbox-dialog"});this.insert([this.title=h("div",{"class":"rui-lightbox-title"}),h("div",{"class":"rui-lightbox-body"}).insert(h("div",{"class":"rui-lightbox-body-inner"}).insert([this.locker=h("div",{"class":"rui-lightbox-body-locker"}).insert(new z(4)),this.scroller=h("div",{"class":"rui-lightbox-scroller"}).insert(this.content=h("div",{"class":"rui-lightbox-content"}))])),h("div",{"class":"rui-lightbox-navigation"}).insert([this.closeButton=
15
15
  h("div",{"class":"close",html:"&times;",title:b.Close}).onClick("fire","close"),this.prevLink=h("div",{"class":"prev",html:"&larr;",title:b.Prev}).onClick("fire","prev"),this.nextLink=h("div",{"class":"next",html:"&rarr;",title:b.Next}).onClick("fire","next")])]);this.prevLink.hide();this.nextLink.hide();a.showCloseButton||this.closeButton.hide()},setTitle:function(a){this.title.update(a||"")},resize:function(a,b){var c=this.parent().size(),e=this.scroller.size(),g=(c.y-this.size().y)/2,k=this.size().x-
16
- e.x;if(a){a=this.scroller.setStyle(a).size();this.scroller.setStyle({width:e.x+"px",height:e.y+"px"})}else a=this.content.size();if(a.x+100>c.x)a.x=c.x-100;if(a.y+100>c.y)a.y=c.y-100;var t=(g*2+e.y-a.y)/2,m=this._.style,n=this.scroller._.style;if(d.Fx&&b&&(a.x!=e.x||a.y!=e.y))v(new d.Fx(this,{duration:this.options.fxDuration,transition:"Lin"}),{render:function(o){n.width=e.x+(a.x-e.x)*o+"px";n.height=e.y+(a.y-e.y)*o+"px";m.top=g+(t-g)*o+"px";if(i.IE6)m.width=k+e.y+(a.y-e.y)*o+"px"}}).onFinish(d(this.unlock).bind(this)).start();
17
- else{n.width=a.x+"px";n.height=a.y+"px";m.top=t+"px";if(i.IE6)m.width=k+a.x+"px";this.request||this.unlock()}return this},show:function(a,b){this.content.update(a||"");this.resize(null,!b)},load:function(a,b){if(a instanceof j){this.setTitle(a.get("title"));a=a.get("href")}l.show(this,a);this.lock().cancel();this.request=new C(a,b,d(function(c,e){this.request=null;this.show(c,e)}).bind(this));return this.resize()},cancel:function(){this.request&&this.request.cancel();return this},lock:function(){this.locker.setStyle("opacity:1");
18
- return this},unlock:function(){this.locker.morph({opacity:0},{duration:this.options.fxDuration*2/3});return this}}),C=new x({initialize:function(a,b,c){if(this.isImage(a,c))f.current.addClass("rui-lightbox-image");else if(this.isMedia(a,c))f.current.addClass("rui-lightbox-media");else this.xhr=(new w(a,y.merge({method:"get"},b))).onComplete(function(){c(this.text)}).send()},cancel:function(){if(this.xhr)this.xhr.cancel();else if(this.img)this.img.onload=function(){}},isImage:function(a,b){if(a.match(f.Images)){var c=
19
- this.img=h("img")._;c.onload=function(){b(c)};c.src=a;return true}},isMedia:function(a,b){var c=d(f.Medias).map(function(e){return a.match(e[0])?this.buildEmbed(a.replace(e[0],e[1]),e[2]):null},this).compact()[0];if(c){b(c,true);return true}},buildEmbed:function(a,b){var c={swf:["D27CDB6E-AE6D-11cf-96B8-444553540000","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0","application/x-shockwave-flash"]},e=f.current?f.current.options:f.Options;e=' width="'+e.mediaWidth+
20
- '" height="'+e.mediaHeight+'"';return'<object classid="clsid:'+c[b][0]+'" codebase="'+c[b][1]+'"'+e+'><param name="src" value="'+a+'" /><embed src="'+a+'" type="'+c[b][2]+'"'+e+" /></object>"}}),l={show:function(a,b){if(a.options.group){this.dialog=a;this.links=this.find(a.options.group);this.link=this.links.first(function(g){return g.get("href")===b});var c=this.links.indexOf(this.link),e=this.links.length;a.prevLink[e&&c>0?"show":"hide"]();a.nextLink[e&&c<e-1?"show":"hide"]()}else this.dialog=null},
21
- prev:function(){if(this.dialog&&!this.timer){var a=this.links[this.links.indexOf(this.link)-1];if(a){this.dialog.load(a);this.timeout()}}},next:function(){if(this.dialog&&!this.timer){var a=this.links[this.links.indexOf(this.link)+1];if(a){this.dialog.load(a);this.timeout()}}},find:function(a){return r("a").filter(function(b){var c=b.get("data-lightbox");b=b.get("rel");return c&&eval("("+c+")").group===a||b&&b.indexOf("lightbox["+a+"]")>-1})},timeout:function(){this.timer=d(function(){l.timer=null}).delay(300)}};
22
- q(p).on({click:function(a){var b=a.find(f.Options.cssRule)||a.find("a[rel^=lightbox]");if(b){a.stop();(new f({},b)).load(b)}},mousewheel:function(a){if(f.current){a.stop();f.current.fire((a._.detail||-a._.wheelDelta)<0?"prev":"next")}},keydown:function(a){var b=f.current,c={27:"close",33:"prev",37:"prev",38:"prev",39:"next",40:"next",34:"next"}[a.keyCode];if(b&&c)if(c!=="close"||b.options.hideOnEsc){a.stop();b.fire(c)}}});q(window).on({resize:function(){if(f.current){f.current.reposition();f.current.dialog.resize()}},
23
- scroll:function(){f.current&&i.IE6&&f.current.reposition()}});p.write('<style type="text/css">div.rui-spinner,div.rui-spinner div{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none;display:inline-block; *display:inline; *zoom:1;border-radius:.12em;-moz-border-radius:.12em;-webkit-border-radius:.12em}div.rui-spinner{text-align:center;white-space:nowrap;background:#EEE;border:1px solid #DDD;height:1.2em;padding:0 .2em}div.rui-spinner div{width:.4em;height:70%;background:#BBB;margin-left:1px}div.rui-spinner div:first-child{margin-left:0}div.rui-spinner div.glowing{background:#777}div.rui-lightbox{position:fixed;top:0;left:0;z-index:9999;float:none;width:100%;height:100%;margin:0;padding:0;background:none;border:none;text-align:center}div.rui-lightbox-locker{position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#000;opacity:0.8;filter:alpha(opacity=80);cursor:default}div.rui-lightbox-dialog{display:inline-block; *display:inline; *zoom:1;position:relative;text-align:left}div.rui-lightbox-title{height:1.2em;margin-bottom:.1em;white-space:nowrap;color:#DDD;font-weight:bold;font-size:1.6em;font-family:Helvetica;text-shadow:#000 .05em .1em .2em}div.rui-lightbox-body{background-color:white;padding:1em;border-radius:.5em;-moz-border-radius:.5em;-webkit-border-radius:.5em}div.rui-lightbox-body-inner{position:relative}div.rui-lightbox-scroller{overflow:hidden}div.rui-lightbox-content{display:inline-block; *display:inline; *zoom:1;min-height:10em;min-width:10em;_height:10em;_width:10em}div.rui-lightbox-body-locker{background-color:white;position:absolute;left:0px;top:0px;width:100%;height:100%;z-index:999;opacity:0;filter:alpha(opacity=0)}div.rui-lightbox-body-locker div.rui-spinner{position:absolute;right:0;bottom:0;border:none;background:none;font-size:150%}div.rui-lightbox-navigation{color:#888;font-size:150%;font-family:Arial;height:1em;user-select:none;-moz-user-select:none;-webkit-user-select:none}div.rui-lightbox-navigation div{cursor:pointer;position:absolute}div.rui-lightbox-navigation div:hover{color:white}div.rui-lightbox-navigation div.next{left:2em}div.rui-lightbox-navigation div.close{right:0}div.rui-lightbox-image div.rui-lightbox-body,div.rui-lightbox-media div.rui-lightbox-body{padding:0;border:1px solid #777;border-radius:0px;-moz-border-radius:0px;-webkit-border-radius:0px}div.rui-lightbox-image div.rui-lightbox-content,div.rui-lightbox-media div.rui-lightbox-content{min-height:12em;min-width:12em;_height:12em;_width:12em}div.rui-lightbox-image div.rui-lightbox-content img{vertical-align:middle}div.rui-lightbox-image div.rui-lightbox-body,div.rui-lightbox-image div.rui-lightbox-body-locker,div.rui-lightbox-media div.rui-lightbox-body,div.rui-lightbox-media div.rui-lightbox-body-locker{background-color:#D8D8D8}div.rui-lightbox-image div.rui-lightbox-body-locker div.rui-spinner,div.rui-lightbox-media div.rui-lightbox-body-locker div.rui-spinner{bottom:.5em;right:.5em}</style>');
16
+ e.x;if(a){a=this.scroller.setStyle(a).size();this.scroller.setStyle({width:e.x+"px",height:e.y+"px"})}else a=this.content.size();if(a.x+100>c.x)a.x=c.x-100;if(a.y+100>c.y)a.y=c.y-100;var t=(g*2+e.y-a.y)/2,m=this._.style,n=this.scroller._.style;if(d.Fx&&b&&(a.x!=e.x||a.y!=e.y))v(new d.Fx(this,{duration:this.options.fxDuration}),{render:function(o){n.width=e.x+(a.x-e.x)*o+"px";n.height=e.y+(a.y-e.y)*o+"px";m.top=g+(t-g)*o+"px";if(i.IE6)m.width=k+e.y+(a.y-e.y)*o+"px"}}).onFinish(d(this.unlock).bind(this)).start();
17
+ else{n.width=a.x+"px";n.height=a.y+"px";m.top=t+"px";if(i.IE6)m.width=k+a.x+"px";this.request||this.unlock()}return this},show:function(a,b){this.content.update(a||"");this.resize(null,!b)},load:function(a,b){if(a instanceof j){this.setTitle(a.get("title"));a=a.get("href")}l.show(this,a);this.lock().cancel();this.request=new C(a,b,d(function(c,e){this.request=null;this.show(c,e)}).bind(this));return this.resize()},cancel:function(){this.request&&this.request.cancel();return this},lock:function(){this.locker.setStyle("opacity:1;display:block").insertTo(this.scroller,
18
+ "before");return this},unlock:function(){this.locker.remove(this.content.html().blank()?null:"fade",{duration:this.options.fxDuration*2/3});return this}}),C=new x({initialize:function(a,b,c){if(this.isImage(a,c))f.current.addClass("rui-lightbox-image");else if(this.isMedia(a,c))f.current.addClass("rui-lightbox-media");else this.xhr=(new w(a,y.merge({method:"get"},b))).onComplete(function(){c(this.text)}).send()},cancel:function(){if(this.xhr)this.xhr.cancel();else if(this.img)this.img.onload=function(){}},
19
+ isImage:function(a,b){if(a.match(f.Images)){var c=this.img=h("img")._;c.onload=function(){b(c)};c.src=a;return true}},isMedia:function(a,b){var c=d(f.Medias).map(function(e){return a.match(e[0])?this.buildEmbed(a.replace(e[0],e[1]),e[2]):null},this).compact()[0];if(c){b(c,true);return true}},buildEmbed:function(a,b){var c={swf:["D27CDB6E-AE6D-11cf-96B8-444553540000","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0","application/x-shockwave-flash"]},e=f.current?
20
+ f.current.options:f.Options;e=' width="'+e.mediaWidth+'" height="'+e.mediaHeight+'"';return'<object classid="clsid:'+c[b][0]+'" codebase="'+c[b][1]+'"'+e+'><param name="src" value="'+a+'" /><embed src="'+a+'" type="'+c[b][2]+'"'+e+" /></object>"}}),l={show:function(a,b){if(a.options.group){this.dialog=a;this.links=this.find(a.options.group);this.link=this.links.first(function(g){return g.get("href")===b});var c=this.links.indexOf(this.link),e=this.links.length;a.prevLink[e&&c>0?"show":"hide"]();a.nextLink[e&&
21
+ c<e-1?"show":"hide"]()}else this.dialog=null},prev:function(){if(this.dialog&&!this.timer){var a=this.links[this.links.indexOf(this.link)-1];if(a){this.dialog.load(a);this.timeout()}}},next:function(){if(this.dialog&&!this.timer){var a=this.links[this.links.indexOf(this.link)+1];if(a){this.dialog.load(a);this.timeout()}}},find:function(a){return r("a").filter(function(b){var c=b.get("data-lightbox");b=b.get("rel");return c&&eval("("+c+")").group===a||b&&b.indexOf("lightbox["+a+"]")>-1})},timeout:function(){this.timer=
22
+ d(function(){l.timer=null}).delay(300)}};q(p).on({click:function(a){var b=a.find(f.Options.cssRule)||a.find("a[rel^=lightbox]");if(b){a.stop();(new f({},b)).load(b)}},mousewheel:function(a){if(f.current){var b=a.target;if(!b.parent("div.rui-lightbox-content")||b.getStyle("overflow")==="visible")a.stop();f.current.fire((a._.detail||-a._.wheelDelta)<0?"prev":"next")}},keydown:function(a){var b=f.current,c={27:"close",33:"prev",37:"prev",38:"prev",39:"next",40:"next",34:"next"}[a.keyCode];if(b&&c)if(c!==
23
+ "close"||b.options.hideOnEsc){a.stop();b.fire(c)}}});q(window).on({resize:function(){if(f.current){f.current.reposition();f.current.dialog.resize()}},scroll:function(){f.current&&i.IE6&&f.current.reposition()}});p.write('<style type="text/css">div.rui-spinner,div.rui-spinner div{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none;display:inline-block; *display:inline; *zoom:1;border-radius:.12em;-moz-border-radius:.12em;-webkit-border-radius:.12em}div.rui-spinner{text-align:center;white-space:nowrap;background:#EEE;border:1px solid #DDD;height:1.2em;padding:0 .2em}div.rui-spinner div{width:.4em;height:70%;background:#BBB;margin-left:1px}div.rui-spinner div:first-child{margin-left:0}div.rui-spinner div.glowing{background:#777}div.rui-lightbox{position:fixed;top:0;left:0;z-index:9999;float:none;width:100%;height:100%;margin:0;padding:0;background:none;border:none;text-align:center}div.rui-lightbox-locker{position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#000;opacity:0.8;filter:alpha(opacity=80);cursor:default}div.rui-lightbox-dialog{display:inline-block; *display:inline; *zoom:1;position:relative;text-align:left}div.rui-lightbox-title{height:1.2em;margin-bottom:.1em;white-space:nowrap;color:#DDD;font-weight:bold;font-size:1.6em;font-family:Helvetica}div.rui-lightbox-body{background-color:white;padding:1em;border-radius:.5em;-moz-border-radius:.5em;-webkit-border-radius:.5em}div.rui-lightbox-body-inner{position:relative}div.rui-lightbox-scroller{overflow:hidden}div.rui-lightbox-content{display:inline-block; *display:inline; *zoom:1;min-height:10em;min-width:10em;_height:10em;_width:10em}div.rui-lightbox-body-locker{background-color:white;position:absolute;left:0px;top:0px;width:100%;height:100%;z-index:999;opacity:0;filter:alpha(opacity=0)}div.rui-lightbox-body-locker div.rui-spinner{position:absolute;right:0;bottom:0;border:none;background:none;font-size:150%}div.rui-lightbox-navigation{color:#888;font-size:160%;font-family:Arial;height:1em;user-select:none;-moz-user-select:none;-webkit-user-select:none}div.rui-lightbox-navigation div{cursor:pointer;position:absolute}div.rui-lightbox-navigation div:hover{color:white}div.rui-lightbox-navigation div.next{left:2em}div.rui-lightbox-navigation div.close{right:0}div.rui-lightbox-image div.rui-lightbox-body,div.rui-lightbox-media div.rui-lightbox-body{padding:0;border:1px solid #777;border-radius:0px;-moz-border-radius:0px;-webkit-border-radius:0px}div.rui-lightbox-image div.rui-lightbox-content,div.rui-lightbox-media div.rui-lightbox-content{min-height:12em;min-width:12em;_height:12em;_width:12em}div.rui-lightbox-image div.rui-lightbox-content img{vertical-align:middle}div.rui-lightbox-image div.rui-lightbox-body,div.rui-lightbox-image div.rui-lightbox-body-locker,div.rui-lightbox-media div.rui-lightbox-body,div.rui-lightbox-media div.rui-lightbox-body-locker{background-color:#D8D8D8}div.rui-lightbox-image div.rui-lightbox-body-locker div.rui-spinner,div.rui-lightbox-media div.rui-lightbox-body-locker div.rui-spinner{bottom:.5em;right:.5em}</style>');
24
24
  return f}(document,RightJS);
@@ -161,7 +161,9 @@ RightJS.$alias(RightJS.Array.prototype, {
161
161
  var form = event.target;
162
162
  if (form.has('data-remote') && !user_cancels(event, form)) {
163
163
  event.stop();
164
- form.send(add_xhr_events(form));
164
+ form.send(add_xhr_events(form, {
165
+ spinner: form.get('data-spinner') || form.first('.spinner')
166
+ }));
165
167
  }
166
168
  }
167
169
  });
@@ -7,8 +7,8 @@
7
7
  (function(i,j,e){var f=e.$,l=e.$$,o=e.$E,m=e.Xhr,p=e.Object;e([e.String.prototype,e.Array.prototype,e.Function.prototype,e.Object,e.Options,e.Observer,e.Observer.prototype,i,j]).each(function(a){for(var b in a)try{if(/[A-Z]/.test(b)&&typeof a[b]==="function"){var c=e(b).underscored();if(a[c]===null||a[c]===undefined)a[c]=a[b]}}catch(d){}});e([e.Element,e.Event,e.Form,e.Input]).each(function(a){if(a){var b=a.prototype;for(var c in b)if(/[A-Z]/.test(c)&&typeof b[c]==="function")a.prototype[e(c).underscored()]=
8
8
  b[c]}});e.$alias(e.String.prototype,{index_of:"indexOf",last_index_of:"lastIndexOf",to_f:"toFloat",to_i:"toInt",gsub:"replace",downcase:"toLowerCase",upcase:"toUpperCase",index:"indexOf",rindex:"lastIndexOf",strip:"trim"});e.$alias(e.Array.prototype,{collect:"map",detect:"filter",index_of:"indexOf",last_index_of:"lastIndexOf",index:"indexOf",rindex:"lastIndexOf"});(function(){var a=function(c,d){var g=d.get("data-confirm");if(g&&!confirm(g)){c.stop();return true}},b=function(c,d){return p.merge({onCreate:function(){c.fire("ajax:loading",
9
9
  this)},onComplete:function(){c.fire("ajax:complete",this)},onSuccess:function(){c.fire("ajax:success",this)},onFailure:function(){c.fire("ajax:failure",this)}},d)};f(j).on({click:function(c){var d=c.target._.tagName;if(d==="A"||d==="BUTTON"){var g=c.target;d=g.get("data-method");var n=g.get("data-remote"),h=g.get("href");if(!a(c,g)){if(d||n)c.stop();if(n)m.load(h,b(g,{method:d||"get",spinner:g.get("data-spinner")}));else if(d){c=l("meta[name=csrf-param]")[0];g=l("meta[name=csrf-token]")[0];h=o("form",
10
- {action:h,method:"post"});c&&g&&h.insert('<input type="hidden" name="'+c.get("content")+'" value="'+g.get("content")+'" />');h.insert('<input type="hidden" name="_method" value="'+d+'"/>').insertTo(j.body).submit()}}}},submit:function(c){var d=c.target;if(d.has("data-remote")&&!a(c,d)){c.stop();d.send(b(d))}}})})();var k={Options:{format:"js",flashId:"flashes",flashHideFx:"slide",flashHideDelay:3200,highlightUpdates:true,removeFx:"fade",insertFx:"fade",insertPosition:"bottom",linkToAjaxEdit:".ajax_edit",
11
- linkToAjaxDelete:".ajax_delete",rescanWithScopes:true},update_flash:function(a){var b=f(this.Options.flashId);b&&this.replace(b,a).hide_flash();return this},hide_flash:function(){if(this.Options.flashHideDelay>-1){var a=f(this.Options.flashId);a&&a.visible()&&a.hide.bind(a,this.Options.flashHideFx).delay(this.Options.flashHideDelay)}return this},highlight:function(a){f(a)&&this.Options.highlightUpdates&&f(a).highlight();return this},insert:function(a,b,c){c=c||this.Options.insertPosition;var d;b=
12
- f(a).insert(b,c);switch(c){case "bottom":d=b.children().last();break;case "top":d=b.first();break;case "before":d=b.prev();break;case "after":d=b.next();break}d&&this.Options.insertFx?d.hide().show(this.Options.insertFx,{onFinish:this.highlight.bind(this,d)}):this.highlight(d);return this.rescan(a)},replace:function(a,b){f(a).replace(b);return this.highlight(a).rescan(a)},remove:function(a){f(a)&&f(a).remove(this.Options.removeFx)},remotize_form:function(a){if(a=f(a))a.remotize().enable()._.action+=
13
- "."+this.Options.format;return this},replace_form:function(a,b){var c=f(a);if(c){c.replace(b);this.remotize_form(a)}return this.rescan(a)},show_form_for:function(a,b){f(a).select("form").each("remove");f(a).insert(b);return this.remotize_form(f(a).first("form")).rescan(a)},process_click:function(a){var b;if(b=a.find("a"+this.Options.linkToAjaxEdit)){a.stop();m.load(b.get("href")+"."+this.Options.format)}else if((b=a.find("a"+this.Options.linkToAjaxDelete))&&b.has("onclick")){a.stop();eval("({f:"+
14
- b.onclick.toString().replace(".submit",".send")+"})").f.call(b)}},rescan:function(a){$w("Draggable Droppable Tabs Slider Selectable").each(function(b){if(b in i)i[b].rescan(this.Options.rescanWithScopes?a:null)},this);return this}};f(j).on({ready:function(){k.hide_flash()},click:function(a){k.process_click(a)}});i.RR=k})(window,document,RightJS);
10
+ {action:h,method:"post"});c&&g&&h.insert('<input type="hidden" name="'+c.get("content")+'" value="'+g.get("content")+'" />');h.insert('<input type="hidden" name="_method" value="'+d+'"/>').insertTo(j.body).submit()}}}},submit:function(c){var d=c.target;if(d.has("data-remote")&&!a(c,d)){c.stop();d.send(b(d,{spinner:d.get("data-spinner")||d.first(".spinner")}))}}})})();var k={Options:{format:"js",flashId:"flashes",flashHideFx:"slide",flashHideDelay:3200,highlightUpdates:true,removeFx:"fade",insertFx:"fade",
11
+ insertPosition:"bottom",linkToAjaxEdit:".ajax_edit",linkToAjaxDelete:".ajax_delete",rescanWithScopes:true},update_flash:function(a){var b=f(this.Options.flashId);b&&this.replace(b,a).hide_flash();return this},hide_flash:function(){if(this.Options.flashHideDelay>-1){var a=f(this.Options.flashId);a&&a.visible()&&a.hide.bind(a,this.Options.flashHideFx).delay(this.Options.flashHideDelay)}return this},highlight:function(a){f(a)&&this.Options.highlightUpdates&&f(a).highlight();return this},insert:function(a,
12
+ b,c){c=c||this.Options.insertPosition;var d;b=f(a).insert(b,c);switch(c){case "bottom":d=b.children().last();break;case "top":d=b.first();break;case "before":d=b.prev();break;case "after":d=b.next();break}d&&this.Options.insertFx?d.hide().show(this.Options.insertFx,{onFinish:this.highlight.bind(this,d)}):this.highlight(d);return this.rescan(a)},replace:function(a,b){f(a).replace(b);return this.highlight(a).rescan(a)},remove:function(a){f(a)&&f(a).remove(this.Options.removeFx)},remotize_form:function(a){if(a=
13
+ f(a))a.remotize().enable()._.action+="."+this.Options.format;return this},replace_form:function(a,b){var c=f(a);if(c){c.replace(b);this.remotize_form(a)}return this.rescan(a)},show_form_for:function(a,b){f(a).select("form").each("remove");f(a).insert(b);return this.remotize_form(f(a).first("form")).rescan(a)},process_click:function(a){var b;if(b=a.find("a"+this.Options.linkToAjaxEdit)){a.stop();m.load(b.get("href")+"."+this.Options.format)}else if((b=a.find("a"+this.Options.linkToAjaxDelete))&&b.has("onclick")){a.stop();
14
+ eval("({f:"+b.onclick.toString().replace(".submit",".send")+"})").f.call(b)}},rescan:function(a){$w("Draggable Droppable Tabs Slider Selectable").each(function(b){if(b in i)i[b].rescan(this.Options.rescanWithScopes?a:null)},this);return this}};f(j).on({ready:function(){k.hide_flash()},click:function(a){k.process_click(a)}});i.RR=k})(window,document,RightJS);