kalindar 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +23 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +48 -0
- data/Rakefile +7 -0
- data/config.json +12 -0
- data/config.ru +2 -0
- data/kalindar.gemspec +29 -0
- data/lib/kalindar.rb +8 -0
- data/lib/kalindar/app.rb +100 -0
- data/lib/kalindar/event.rb +24 -0
- data/lib/kalindar/event_calendar.rb +103 -0
- data/lib/kalindar/locales/de.yml +24 -0
- data/lib/kalindar/locales/en.yml +24 -0
- data/lib/kalindar/public/kalindar.css +70 -0
- data/lib/kalindar/public/kalindar.js +12 -0
- data/lib/kalindar/public/pure-min.css +11 -0
- data/lib/kalindar/public/pure.css +1664 -0
- data/lib/kalindar/public/right-calendar.js +7 -0
- data/lib/kalindar/public/right-dialog.js +7 -0
- data/lib/kalindar/public/right.js +7 -0
- data/lib/kalindar/version.rb +3 -0
- data/lib/kalindar/views/event_list.slim +23 -0
- data/lib/kalindar/views/layout.slim +12 -0
- data/lib/kalindar/views/new_event.slim +37 -0
- data/spec/kalindar_spec.rb +86 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/testcal.ics +72 -0
- metadata +176 -0
@@ -0,0 +1,7 @@
|
|
1
|
+
/**
|
2
|
+
* RightJS-UI Calendar v2.3.2
|
3
|
+
* http://rightjs.org/ui/calendar
|
4
|
+
*
|
5
|
+
* Copyright (C) 2009-2012 Nikolay Nemshilov
|
6
|
+
*/
|
7
|
+
var Calendar=RightJS.Calendar=function(a,b,c){function j(a){return(a<10?"0":"")+a}function h(a,d,e){var f=this.reAnchor||(this.reAnchor=new c.Element("div",{"class":"rui-re-anchor"})).insert(this),g=f.insertTo(a,"after").position(),h=a.dimensions(),i=this,j=b(a.getStyle("borderTopWidth")),k=b(a.getStyle("borderLeftWidth")),l=b(a.getStyle("borderRightWidth")),m=b(a.getStyle("borderBottomWidth")),n=h.top-g.y+j,o=h.left-g.x+k,p=h.width-k-l,q=h.height-j-m;i.setStyle("visibility:hidden").show(null),d==="right"?o+=p-i.size().x:n+=q,i.moveTo(o,n),e&&(d==="left"||d==="right"?i.setHeight(q):i.setWidth(p)),i.setStyle("visibility:visible").hide(null)}function g(a,b,d,e){if(b==="hide"&&a.visible()||b==="show"&&a.hidden()){c.Fx?(a.___fx=!0,d===undefined&&(d=a.options.fxName,e===undefined&&(e={duration:a.options.fxDuration,onFinish:function(){a.___fx=!1,a.fire(b)}},b==="hide"&&(e.duration=(c.Fx.Durations[e.duration]||e.duration)/2)))):(a.___fx=!1,d||a.fire(b));return a.$super(d,e)}return a}function d(a,b){b||(b=a,a="DIV");var d=new c.Class(c.Element.Wrappers[a]||c.Element,{initialize:function(b,d){this.key=b;var e=[{"class":"rui-"+b}];this instanceof c.Input||this instanceof c.Form||e.unshift(a),this.$super.apply(this,e),c.isString(d)&&(d=c.$(d)),d instanceof c.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return c.Wrapper.Cache[c.$uid(this._)]=this},setOptions:function(a,b){b&&(a=c.Object.merge(a,(new Function("return "+(b.get("data-"+this.key)||"{}")))())),a&&c.Options.setOptions.call(this,c.Object.merge(this.options,a));return this}}),e=new c.Class(d,b);c.Observer.createShortcuts(e.prototype,e.EVENTS||c([]));return e}var e=new c.Class(c.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}}),f={show:function(a,b){this.constructor.current=this;return g(this,"show",a,b)},hide:function(a,b){this.constructor.current=null;return g(this,"hide",a,b)},showAt:function(a,b,d){this.hide(null).shownAt=a=c.$(a),h.call(this,a,b,d);return this.show()},toggleAt:function(a,b,c){return this.hidden()?this.showAt(a,b,c):this.hide()}},i={assignTo:function(a,b){a=c.$(a),b=c.$(b),b?(b[this.key]=this,b.assignedInput=a):a[this.key]=this;var d=c(function(){this.visible()&&(!this.showAt||this.shownAt===a)&&this.setValue(a.value())}).bind(this);a.on({keyup:d,change:d}),this.onChange(function(){(!this.showAt||this.shownAt===a)&&a.setValue(this.getValue())});return this}},k=c,l=c.$,m=c.$$,n=c.$w,o=c.$ext,p=c.$uid,q=c.isString,r=c.isArray,s=c.isFunction,t=c.Class,u=c.Element,v=c.Input,w=c.RegExp,x=c.Browser,y=new d({include:[f,i],extend:{version:"2.3.2",EVENTS:n("show hide change done"),Options:{format:"ISO",showTime:null,showButtons:!1,minDate:!1,maxDate:!1,fxName:"fade",fxDuration:"short",firstDay:1,numberOfMonths:1,timePeriod:1,twentyFourHour:null,listYears:!1,hideOnPick:!1,update:null,trigger:null,highlight: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:n("Sunday Monday Tuesday Wednesday Thursday Friday Saturday"),dayNamesShort:n("Sun Mon Tue Wed Thu Fri Sat"),dayNamesMin:n("Su Mo Tu We Th Fr Sa"),monthNames:n("January February March April May June July August September October November December"),monthNamesShort:n("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")},current:null,hideAll:function(a){m("div.rui-calendar").each(function(b){b instanceof y&&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 z(a),this.grid=new B(a)]),a.showTime&&this.insert(this.timepicker=new C(a)),a.showButtons&&this.insert(this.buttons=new D(a)),this.setDate(new Date).initEvents()},setDate:function(a,b){if(a=this.parse(a)){var c=this.options;c.minDate&&c.minDate>a&&(a=new Date(c.minDate)),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.grid.setDate(this._date||a,a),(c.minDate||c.maxDate)&&this.swaps.setDate(a),this.timepicker&&!b&&this.timepicker.setDate(a),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)},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,l(a.trigger||a.update));var b=this.constructor,c=this.options;c.i18n={};for(var d in b.i18n)c.i18n[d]=r(b.i18n[d])?b.i18n[d].clone():b.i18n[d];o(c.i18n,a.i18n),c.dayNames=c.i18n.dayNamesMin,c.firstDay&&c.dayNames.push(c.dayNames.shift()),r(c.numberOfMonths)||(c.numberOfMonths=[c.numberOfMonths,1]),c.minDate&&(c.minDate=this.parse(c.minDate)),c.maxDate&&(c.maxDate=this.parse(c.maxDate),c.maxDate.setDate(c.maxDate.getDate()+1)),c.format=k(b.Formats[c.format]||c.format).trim(),c.showTime===null&&(c.showTime=c.format.search(/%[HkIl]/)>-1),c.twentyFourHour===null&&(c.twentyFourHour=c.format.search(/%[Il]/)<0),c.timePeriod>60&&12%Math.ceil(c.timePeriod/60)&&(c.twentyFourHour=!0),c.update&&this.assignTo(c.update,c.trigger),r(c.highlight)&&(c.highlight=k(c.highlight).map(function(a){return q(a)?this.parse(a):a},this));return this},hideOthers:function(){y.hideAll(this);return this}}),z=new t(u,{initialize:function(a){this.$super("div",{"class":"swaps"}),this.options=a;var b=a.i18n;this.insert([this.prevMonth=new e("‹",{title:b.PrevMonth,"class":"prev-month"}),this.nextMonth=new e("›",{title:b.NextMonth,"class":"next-month"})]),a.listYears&&this.insert([this.prevYear=new e("«",{title:b.PrevYear,"class":"prev-year"}),this.nextYear=new e("»",{title:b.NextYear,"class":"next-year"})]),this.buttons=k([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],d=!0,e=!0,f=!0,g=!0;if(b.minDate){var h=new Date(a.getFullYear(),0,1,0,0,0),i=new Date(b.minDate.getFullYear(),0,1,0,0,0);d=h>i,h.setMonth(a.getMonth()-Math.ceil(c-c/2)),i.setMonth(b.minDate.getMonth()),f=h>=i}if(b.maxDate){var j=new Date(a),l=new Date(b.maxDate),m=k([j,l]);m.each(function(a){a.setDate(32),a.setMonth(a.getMonth()-1),a.setDate(32-a.getDate()),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}),g=j<l,m.each("setMonth",0),e=j<l}this.nextMonth[g?"enable":"disable"](),this.prevMonth[f?"enable":"disable"](),this.nextYear&&(this.nextYear[e?"enable":"disable"](),this.prevYear[d?"enable":"disable"]())},clicked:function(a){var b=a.target;b&&this.buttons.include(b)&&(b.enabled()&&this.fire(b.get("className").split(/\s+/)[0]))}}),A=new t(u,{initialize:function(a){this.$super("table",{"class":"month"}),this.options=a,this.insert(this.caption=new u("caption")),this.insert("<thead><tr>"+a.dayNames.map(function(a){return"<th>"+a+"</th>"}).join("")+"</tr></thead>"),this.days=[];var b=(new u("tbody")).insertTo(this),c,d,e;for(d=0;d<6;d++){e=(new u("tr")).insertTo(b);for(c=0;c<7;c++)this.days.push((new u("td")).insertTo(e))}this.onClick(this.clicked)},setDate:function(b,c){b.setDate(32);var d=32-b.getDate();b.setMonth(b.getMonth()-1);var e=Math.ceil(c.getTime()/864e5),f=this.options,g=f.i18n,h=this.days;for(var i=0,j=h.length-1,k,l,m;i<7;i++)k=h[i]._,l=h[j-i]._,m=h[j-i-7]._,k.innerHTML=l.innerHTML=m.innerHTML="",k.className=l.className=m.className="blank";for(var i=1,n=0,o,p;i<=d;i++){b.setDate(i);var q=b.getDay();f.firstDay===1&&(q=q>0?q-1:6);if(i===1||q===0)o=h.slice(n*7,n*7+7),n++;p=o[q]._,x.OLD?(p.innerHTML="",p.appendChild(a.createTextNode(i))):p.innerHTML=""+i,p.className=e===Math.ceil(b.getTime()/864e5)?"selected":"";if(f.minDate&&f.minDate>b||f.maxDate&&f.maxDate<b)p.className="disabled";r(f.highlight)&&(f.highlight.first(function(a){return a.getFullYear()===b.getFullYear()&&a.getMonth()===b.getMonth()&&a.getDate()===b.getDate()})&&(p.className+=" highlighted")),o[q].date=new Date(b)}var s=(f.listYears?g.monthNamesShort[b.getMonth()]+",":g.monthNames[b.getMonth()])+" "+b.getFullYear(),t=this.caption._;x.OLD?(t.innerHTML="",t.appendChild(a.createTextNode(s))):t.innerHTML=s},clicked:function(a){var b=a.target,c=b.date;b&&c&&!b.hasClass("disabled")&&!b.hasClass("blank")&&(b.addClass("selected"),this.fire("date-set",{date:c.getDate(),month:c.getMonth(),year:c.getFullYear()}))}}),B=new t(u,{initialize:function(a){this.$super("table",{"class":"grid"}),this.months=[];var b=(new u("tbody")).insertTo(this),c;for(var d=0;d<a.numberOfMonths[1];d++){var e=(new u("tr")).insertTo(b);for(var f=0;f<a.numberOfMonths[0];f++)this.months.push(c=new A(a)),(new u("td")).insertTo(e).insert(c)}},setDate:function(a,b){var c=this.months,d=c.length;b=b||a;for(var e=-Math.ceil(d-d/2)+1,f=0;e<Math.floor(d-d/2)+1;e++,f++){var g=new Date(a);g.setDate(1),g.setMonth(a.getMonth()+e),c[f].setDate(g,b)}}}),C=new t(u,{initialize:function(a){this.$super("div",{"class":"timepicker"}),this.options=a;var b=k(this.timeChanged).bind(this);this.insert([this.hours=(new u("select")).onChange(b),this.minutes=(new u("select")).onChange(b)]);var c=a.timePeriod<60?a.timePeriod:60,d=a.timePeriod<60?1:Math.ceil(a.timePeriod/60);for(var e=0;e<60;e++){var f=j(e);e<24&&e%d==0&&(a.twentyFourHour?this.hours.insert(new u("option",{value:e,html:f})):e<12&&this.hours.insert(new u("option",{value:e,html:e==0?12:e}))),e%c==0&&this.minutes.insert(new u("option",{value:e,html:f}))}a.twentyFourHour||(this.meridian=(new u("select")).onChange(b).insertTo(this),k(k(a.format).includes(/%P/)?["am","pm"]:["AM","PM"]).each(function(a){this.meridian.insert(new u("option",{value:a.toLowerCase(),html:a}))},this))},setDate:function(a){var b=this.options,c=b.timePeriod<60?a.getHours():Math.round(a.getHours()/(b.timePeriod/60))*(b.timePeriod/60),d=Math.round(a.getMinutes()/(b.timePeriod%60))*b.timePeriod;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(d)},timeChanged:function(a){a.stopPropagation();var c=b(this.hours.value()),d=b(this.minutes.value());this.meridian&&(c==12&&(c=0),this.meridian.value()=="pm"&&(c+=12)),this.fire("time-set",{hours:c,minutes:d})}}),D=new t(u,{initialize:function(a){this.$super("div",{"class":"buttons"}),this.insert([(new e(a.i18n.Now,{"class":"now"})).onClick("fire","now-clicked"),(new e(a.i18n.Done,{"class":"done"})).onClick("fire","done-clicked")])}});y.include({parse:function(a){var c;if(q(a)&&a){var d=w.escape(this.options.format),e=k(d.match(/%[a-z]/ig)).map("match",/[a-z]$/i).map("first").without("%"),f=new w("^"+d.replace(/%p/i,"(pm|PM|am|AM)").replace(/(%[a-z])/ig,"(.+?)")+"$"),g=k(a).trim().match(f);if(g){g.shift();var h=null,i=null,j=null,l=null,m=null,n;while(g.length){var o=g.shift(),p=e.shift();if(p.toLowerCase()=="b")i=this.options.i18n[p=="b"?"monthNamesShort":"monthNames"].indexOf(o);else if(p.toLowerCase()=="p")n=o.toLowerCase();else{o=b(o,10);switch(p){case"d":case"e":c=o;break;case"m":i=o-1;break;case"y":case"Y":h=o;break;case"H":case"k":case"I":case"l":j=o;break;case"M":l=o;break;case"S":m=o}}}n&&(j=j==12?0:j,j=n=="pm"?j+12:j),c=new Date(h,i,c,j,l,m)}}else if(a instanceof Date||Date.parse(a))c=new Date(a);return!c||isNaN(c.getTime())?null:c},format:function(a){var b=this.options.i18n,c=this.date.getDay(),d=this.date.getMonth(),e=this.date.getDate(),f=this.date.getFullYear(),g=this.date.getHours(),h=this.date.getMinutes(),i=this.date.getSeconds(),k=g==0?12:g<13?g:g-12,l={a:b.dayNamesShort[c],A:b.dayNames[c],b:b.monthNamesShort[d],B:b.monthNames[d],d:j(e),e:""+e,m:(d<9?"0":"")+(d+1),y:(""+f).substring(2,4),Y:""+f,H:j(g),k:""+g,I:(g>0&&(g<10||g>12&&g<22)?"0":"")+k,l:""+k,p:g<12?"AM":"PM",P:g<12?"am":"pm",M:j(h),S:j(i),"%":"%"},m=a||this.options.format;for(var n in l)m=m.replace("%"+n,l[n]);return m}}),y.include({initEvents:function(){var a="_shiftDate",b=this._terminate;this.on({"prev-day":[a,{Date:-1}],"next-day":[a,{Date:1}],"prev-week":[a,{Date:-7}],"next-week":[a,{Date:7}],"prev-month":[a,{Month:-1}],"next-month":[a,{Month:1}],"prev-year":[a,{FullYear:-1}],"next-year":[a,{FullYear:1}],"date-set":this._changeDate,"time-set":this._changeTime,"now-clicked":this._setNow,"done-clicked":this.done,click:b,mousedown:b,focus:b,blur:b})},_shiftDate:function(a){var b=new Date(this.date),c=this.options;for(var d in a)b["set"+d](b["get"+d]()+a[d]);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,!0),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(),this._hide_delay&&(this._hide_delay.cancel(),this._hide_delay=null)}}),l(a).on({focus:function(a){var b=a.target instanceof v&&a.target.get("type")=="text"?a.target:null;y.hideAll(),b&&(b.calendar||b.match(y.Options.cssRule))&&(b.calendar||new y({update:b})).setValue(b.value()).showAt(b)},blur:function(a){var b=a.target,c=b.calendar;c&&(c._hide_delay=k(function(){c.hide()}).delay(200))},click:function(a){var b=a.target instanceof u?a.target:null;if(b&&(b.calendar||b.match(y.Options.cssRule))){if(!(b instanceof v)||b.get("type")!="text")a.stop(),(b.calendar||new y({trigger:b})).hide(null).toggleAt(b.assignedInput)}else a.find("div.rui-calendar")||y.hideAll()},keydown:function(a){var b=y.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];c&&b&&b.visible()&&(a.stop(),s(b[c])?b[c]():b.fire(c))}});var E=a.createElement("style"),F=a.createTextNode(".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 .grid,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 .grid{border-spacing:0px;border-collapse:collapse;border-size:0}div.rui-calendar .grid td{vertical-align:top;padding-left:.4em}div.rui-calendar .grid>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 .month td.highlighted{background-color:#DDD;border-color:#bbb;color:#111}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}");E.type="text/css",a.getElementsByTagName("head")[0].appendChild(E),E.styleSheet?E.styleSheet.cssText=F.nodeValue:E.appendChild(F);return y}(document,parseInt,RightJS)
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/**
|
2
|
+
* RightJS-UI Dialog v2.2.2
|
3
|
+
* http://rightjs.org/ui/dialog
|
4
|
+
*
|
5
|
+
* Copyright (C) 2010-2012 Nikolay Nemshilov
|
6
|
+
*/
|
7
|
+
var Dialog=RightJS.Dialog=function(a){function o(a){m.dragged&&m.dragged.head.dragStop(a)}function n(a){m.dragged&&m.dragged.head.dragMove(a)}function b(b,c){c||(c=b,b="DIV");var d=new a.Class(a.Element.Wrappers[b]||a.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof a.Input||this instanceof a.Form||e.unshift(b),this.$super.apply(this,e),a.isString(d)&&(d=a.$(d)),d instanceof a.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return a.Wrapper.Cache[a.$uid(this._)]=this},setOptions:function(b,c){c&&(b=a.Object.merge(b,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),b&&a.Options.setOptions.call(this,a.Object.merge(this.options,b));return this}}),e=new a.Class(d,c);a.Observer.createShortcuts(e.prototype,e.EVENTS||a([]));return e}var c=new a.Class(a.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}}),d=new a.Class(a.Element,{initialize:function(b){this.$super("div",{"class":"rui-spinner"}),this.dots=[];for(var c=0;c<(b||4);c++)this.dots.push(new a.Element("div"));this.dots[0].addClass("glowing"),this.insert(this.dots),a(this.shift).bind(this).periodical(300)},shift:function(){if(this.visible()){var a=this.dots.pop();this.dots.unshift(a),this.insert(a,"top")}}}),e=a,f=a.$,g=a.$w,h=a.$E,i=a.Xhr,j=a.Class,k=a.Object,l=a.Element,m=new b({extend:{version:"2.2.2",EVENTS:g("ok cancel help expand collapse resize load"),Options:{lockScreen:!0,fxDuration:"short",draggable:!0,closeable:!0,expandable:!1,showHelp:!1,showIcon:null,title:null,html:null,url:null},i18n:{Ok:"Ok",Close:"Close",Cancel:"Cancel",Help:"Help",Expand:"Expand",Collapse:"Collapse",Alert:"Warning!",Confirm:"Confirm",Prompt:"Enter"},current:!1,dragged:!1},initialize:function(a){this.$super("dialog",a).append(this.head=new m.Head(this),this.body=new m.Body(this),this.foot=new m.Foot(this)).onCancel(this.hide),this.locker=h("div",{"class":"rui-screen-locker"}),this.options.title&&this.title(this.options.title),this.options.html&&this.html(this.options.html),this.options.url&&this.load(this.options.url)},show:function(){this.options.lockScreen&&this.locker.insertTo(document.body),this.setStyle("visibility:hidden").insertTo(document.body).resize().setStyle("visibility:visible;opacity:0"),this.options.fxDuration?this.morph({opacity:1},{duration:this.options.fxDuration}):this.setStyle("opacity:1");return m.current=this},hide:function(){this.locker.remove(),this.remove(),m.current=!1;return this},resize:function(){arguments.length&&this.$super.apply(this,arguments);var a=this.size(),b=f(window).size();this.expanded&&(a.x=b.x-20,a.y=b.y-10,this.$super.call(this,a)),this.setStyle({top:(b.y-a.y)/2+f(window).scrolls().y+"px",left:(b.x-a.x-16)/2+"px"});return this.fire("resize")},title:function(a){if(arguments.length){this.head.title.html(a);return this}return this.head.title.html()},update:function(a){this.body.update(a);return this.resize()},html:function(){return arguments.length?this.$super.apply(this,arguments):this.body.html()},load:function(a,b){this.show(),this.body.load(a,b);return this},expand:function(){this.expanded||(this._prevSize=this.size(),this.resize({x:f(window).size().x-20,y:f(window).size().y-10}),this.expanded=!0,this.fire("expand"));return this},collapse:function(){this.expanded&&(this.expanded=!1,this.resize(this._prevSize),this.fire("collapse"));return this}});m.Head=new j(l,{initialize:function(a){this.dialog=a,this.options=a.options,this.$super("div",{"class":"rui-dialog-head"}),this.append(this.icon=h("div",{"class":"icon"}),this.title=h("div",{"class":"title",html:" "}),this.tools=h("div",{"class":"tools"})),this.fsButton=h("div",{"class":"expand",html:"≡",title:m.i18n.Expand}).onClick(function(){a.expanded?(a.collapse(),this.html("≡").set("title",m.i18n.Expand)):(a.expand(),this.html("_").set("title",m.i18n.Collapse))}),this.closeButton=h("div",{"class":"close",html:"×",title:m.i18n.Close}).onClick(function(){a.fire("cancel")}),this.options.expandable&&this.tools.insert(this.fsButton),this.options.closeable&&this.tools.insert(this.closeButton),this.on({selectstart:function(a){a.stop()},mousedown:this.dragStart,touchstart:this.dragStart}),this.options.draggable||this.dialog.addClass("rui-dialog-nodrag")},dragStart:function(a){if(this.options.draggable&&!a.find("div.tools div")){var b=this.dialog.dimensions(),c=a.position();this.xDiff=b.left-c.x,this.yDiff=b.top-c.y,this.maxX=f(window).size().x-b.width-20,this.dlgStyle=this.dialog.get("style"),m.dragged=this.dialog,a.stop()}},dragMove:function(a){var b=a.position(),c=b.x+this.xDiff,d=b.y+this.yDiff;c<0?c=0:c>this.maxX&&(c=this.maxX),d<0&&(d=0),this.dlgStyle.top=d+"px",this.dlgStyle.left=c+"px"},dragStop:function(a){m.dragged=!1}}),m.Body=new j(l,{initialize:function(a){this.dialog=a,this.options=a.options,this.$super("div",{"class":"rui-dialog-body"}),this.locker=h("div",{"class":"rui-dialog-body-locker"}).insert(new d)},load:function(a,b){this.insert(this.locker,"top"),this.xhr=(new i(a,k.merge({method:"get"},b))).onComplete(e(function(a){this.update(a.text),this.dialog.resize().fire("load")}).bind(this)).send();return this},update:function(a){this.$super(a),this.options.showIcon&&this.insert('<div class="rui-dialog-body-icon">'+this.options.showIcon+"</div>","top");return this}}),m.Foot=new j(l,{initialize:function(a){this.$super("div",{"class":"rui-dialog-foot"}),this.dialog=a,a.okButton=(new c(m.i18n.Ok,{"class":"ok"})).onClick(function(){a.fire("ok")}),a.helpButton=(new c(m.i18n.Help,{"class":"help"})).onClick(function(){a.fire("help")}),a.cancelButton=(new c(m.i18n.Cancel,{"class":"cancel"})).onClick(function(){a.fire("cancel")}),a.options.showHelp&&this.insert(a.helpButton),a.options.closeable&&this.insert(a.cancelButton),this.insert(a.okButton)}}),m.Alert=new j(m,{initialize:function(a){a=k.merge({showIcon:"!",title:m.i18n.Alert},a),this.$super(a),this.addClass("rui-dialog-alert"),this.on("ok","hide")}}),m.Confirm=new j(m,{initialize:function(a){a=k.merge({showIcon:"?",title:m.i18n.Confirm},a),this.$super(a),this.addClass("rui-dialog-confirm"),this.on("ok","hide")}}),m.Prompt=new j(m,{initialize:function(b){b=k.merge({showIcon:"➥",title:m.i18n.Prompt,label:m.i18n.Prompt},b),this.$super(b),this.addClass("rui-dialog-prompt"),this.html([h("label",{html:this.options.label}),this.input=new a.Input(this.options.input||{})]),this.input.get("type")!=="textarea"&&this.input.onKeydown(e(function(a){a.keyCode===13&&this.fire("ok")}).bind(this))},show:function(){this.$super.apply(this,arguments),this.input.select();return this}}),f(document).on({keydown:function(a){a.keyCode===27&&m.current?m.current.options.closeable&&m.current.fire("cancel"):a.keyCode===13&&m.current&&(m.current instanceof m.Prompt||(a.stop(),m.current.fire("ok")))},mousemove:n,touchmove:n,mouseup:o,touchend:o}),f(window).onResize(function(){m.current&&m.current.resize()});var p=document.createElement("style"),q=document.createTextNode("*.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-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-screen-locker{position:fixed;top:0;left:0;width:100%;height:100%;margin:0;padding:0;background:#000;opacity:.5;filter:alpha(opacity=50);z-index:99999;cursor:default}div.rui-dialog{position:absolute;z-index:99999;background:white;margin:0;padding:0;padding-top:2.5em;padding-bottom:2.8em;border-radius:.35em;-moz-border-radius:.35em;-webkit-border-radius:.35em;border:1px solid #ccc}div.rui-dialog-body{min-width:20em;min-height:4.5em;margin:0;padding:0 1em;height:100%;overflow:auto;position:relative}div.rui-dialog-body-locker{position:absolute;z-index:9999;left:0;top:0;width:100%;height:100%;text-align:center;opacity:.6;filter:alpha(opacity=60)}div.rui-dialog-body-locker div.rui-spinner{border:none;background:none;font-size:150%;margin-top:8%}div.rui-dialog-body-icon{float:left;background:#eee;font-size:360%;font-family:Arial;border:2px solid gray;border-radius:.1em;-moz-border-radius:.1em;-webkit-border-radius:.1em;width:1em;line-height:1em;text-align:center;margin-right:.2em;margin-top:.05em;cursor:default;user-select:none;-moz-user-select:none;-webkit-user-select:none}div.rui-dialog-head{position:absolute;top:0;left:0;margin:0;padding:0;width:100%;line-height:2em;background:#ccc;border-radius:.35em;-moz-border-radius:.35em;-webkit-border-radius:.35em;border-bottom-left-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;cursor:move;user-select:none;-moz-user-select:none;-webkit-user-select:none}div.rui-dialog-head div.icon{float:left;height:1.4em;width:1.4em;margin-left:1em;margin-top:.3em;margin-right:.3em;display:none}div.rui-dialog-head div.title{margin-left:1em;color:#444}div.rui-dialog-head div.tools{position:absolute;right:.3em;top:.3em}div.rui-dialog-head div.tools div{float:left;width:1.4em;line-height:1.4em;text-align:center;margin-left:.15em;cursor:pointer;background:#aaa;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;font-family:Verdana;opacity:.6;filter:alpha(opacity=60)}div.rui-dialog-head div.tools div:hover{opacity:1;filter:alpha(opacity=100);box-shadow:#444 0 0 .1em;-moz-box-shadow:#444 0 0 .1em;-webkit-box-shadow:#444 0 0 .1em}div.rui-dialog-head div.tools div.close:hover{background:#daa}div.rui-dialog-nodrag div.rui-dialog-head{cursor:default}div.rui-dialog-foot{position:absolute;bottom:0;left:0;width:100%;text-align:right}div.rui-dialog-foot div.rui-button{margin:.6em 1em;background:#eee;width:4em}div.rui-dialog-foot div.help{float:left}div.rui-dialog-foot div.cancel{margin-right:-.5em}div.rui-dialog-foot div.ok:hover{background-color:#ded}div.rui-dialog-foot div.cancel:hover{background-color:#ecc}div.rui-dialog-alert div.rui-dialog-foot{text-align:center}div.rui-dialog-alert div.rui-dialog-foot div.cancel{display:none}div.rui-dialog-alert div.rui-dialog-body-icon{color:brown;background:#FEE;border-color:brown}div.rui-dialog-confirm div.rui-dialog-body-icon{color:#44A;background:#EEF;border-color:#44a}div.rui-dialog-prompt div.rui-dialog-body-icon{color:#333}div.rui-dialog-prompt div.rui-dialog-body label{display:block;font-weight:bold;font-size:120%;color:#444;margin-bottom:.5em}div.rui-dialog-prompt div.rui-dialog-body input,div.rui-dialog-prompt div.rui-dialog-body textarea{border:1px solid #aaa;font-size:1em;display:block;width:16em;margin:0;padding:.2em;margin-left:4.7em;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;outline:none}div.rui-dialog-prompt div.rui-dialog-body textarea{width:24em;height:8em}");p.type="text/css",document.getElementsByTagName("head")[0].appendChild(p),p.styleSheet?p.styleSheet.cssText=q.nodeValue:p.appendChild(q);return m}(RightJS)
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/**
|
2
|
+
* RightJS v2.3.1 - http://rightjs.org
|
3
|
+
* Released under the terms of MIT license
|
4
|
+
*
|
5
|
+
* Copyright (C) 2008-2012 Nikolay Nemshilov
|
6
|
+
*/
|
7
|
+
var RightJS=function(a,b,c,d,e,f,g,h,i){function cL(a,b,c,d){var e={},f=a.marginLeft.toFloat()||0,g=a.marginTop.toFloat()||0,h=c==="right",i=c==="bottom",j=c==="top"||i;d==="out"?(e[j?"height":"width"]="0px",h?e.marginLeft=f+b.x+"px":i&&(e.marginTop=g+b.y+"px")):(j?(e.height=b.y+"px",a.height="0px"):(e.width=b.x+"px",a.width="0px"),h?(e.marginLeft=f+"px",a.marginLeft=f+b.x+"px"):i&&(e.marginTop=g+"px",a.marginTop=g+b.y+"px"));return e}function cK(a,b,c){var d=a.clone().setStyle("position:absolute;z-index:-1;visibility:hidden").setWidth(a.size().x).setStyle(b),e;a.parent()&&a.insert(d,"before"),e=cJ(d,c),d.remove();return e}function cJ(a,b){var c=0,d=b.length,e=a.computedStyles(),f={},g;for(;c<d;c++)g=b[c],g in e&&(f[g]=""+e[g],g==="opacity"&&(f[g]=f[g].replace(",",".")));return f}function cI(a,b,c){var d;for(d in c)(d=="width"||d=="height")&&b[d]=="auto"&&(b[d]=a._["offset"+d.capitalize()]+"px");bu&&c.filter&&!b.filter&&(b.filter="alpha(opacity=100)"),cG(a,b,c);for(d in c){if(c[d]!==b[d]&&/color/i.test(d)){bq&&(c[d]=c[d].replace(/"/g,""),b[d]=b[d].replace(/"/g,"")),cF(c[d])||(c[d]=c[d].toRgb()),cF(b[d])||(b[d]=b[d].toRgb());if(!c[d]||!b[d])c[d]=b[d]=""}/\d/.test(c[d])&&!/\d/.test(b[d])&&(b[d]=c[d].replace(/[\d\.\-]+/g,"0"));if(c[d]===b[d]||!/\d/.test(b[d])||!/\d/.test(c[d]))delete c[d],delete b[d]}}function cH(a){var b={},c=/[\d\.\-]+/g,d,e,f,g;for(e in a){d=a[e].match(c),f=d.map("toFloat"),f.t=a[e].split(c),f.r=f.t[0]==="rgb(",f.t.length==1&&f.t.unshift("");for(g=0;g<f.length;g++)f.t.splice(g*2+1,0,f[g]);b[e]=f}return b}function cG(a,b,c){for(var d=0;d<4;d++){var e="border"+cC[d]+"Style",f="border"+cC[d]+"Width",g="border"+cC[d]+"Color";if(e in b&&b[e]!=c[e]){var h=a._.style;b[e]=="none"&&(h[f]="0px"),h[e]=c[e],cF(b[g])&&(h[g]=a.getStyle("Color"))}}}function cF(a){return a==="transparent"||a==="rgba(0, 0, 0, 0)"}function cE(a){var b=[],c=["Style","Color","Width"],d,e,f;for(d in a)if(d.startsWith("border"))for(e=0;e<3;e++)for(f=0;f<4;f++)b.push("border"+cC[f]+c[e]);else d==="margin"||d==="padding"?cD(b,d,cC):d.startsWith("background")?cD(b,"background",["Color","Position","PositionX","PositionY"]):d==="opacity"&&bu?b.push("filter"):b.push(d);return b}function cD(a,b,c){for(var d=0;d<c.length;d++)a.push(b+c[d])}function cB(a){function g(){for(var a in f)e[a]=f[a]}var b=this.options,d=this.element,e=d._.style,f=c.only(d.computedStyles(),cx,cy,cz);this.onFinish(g).onCancel(function(){e[cx]="none",setTimeout(g,1)}),e[cx]="all",e[cy]=(cg.Durations[b.duration]||b.duration)+"ms",e[cz]=cA[b.transition]||b.transition,setTimeout(function(){d.setStyle(a)},0)}function cu(a,b,c){var d=J(c).compact(),e=A(d.last())?d.pop():{},f=new(cg[b.capitalize()])(a,e);f.start.apply(f,d);return a}function ct(a,b){function q(a){var b=a,c=0,d;while(c<5){d=n(b)-a;if(h.abs(d)<.001)break;b=b-d/p(b),c++}return b}function p(a){return d+a*(2*e+a*3*f)+.001}function o(a){return a*(g+a*(i+a*j))}function n(a){return a*(d+a*(e+a*f))}a=cr[a]||cA[a]||a,a=a.match(/([\d\.]+)[\s,]+([\d\.]+)[\s,]+([\d\.]+)[\s,]+([\d\.]+)/),a=[0,a[1]-0,a[2]-0,a[3]-0,a[4]-0];var c=a.join(",")+","+b,d,e,f,g,i,j,k,l,m;if(!(c in cs)){d=3*a[1],e=3*(a[3]-a[1])-d,f=1-d-e,g=3*a[2],i=3*(a[4]-a[2])-g,j=1-g-i,cs[c]=k=[],m=0,l=1/b;while(m<1.0001)k.push(o(q(m))),m+=l}return cs[c]}function cq(a){a._timer&&clearInterval(a._timer)}function cp(a){var b=a.options,c=cg.Durations[b.duration]||b.duration,d=h.ceil(c/1e3*b.fps),e=ct(b.transition,d),f=h.round(1e3/b.fps),g=0;a._timer=setInterval(function(){g===d?a.finish():(a.render(e[g]),g++)},f)}function co(a){var b=I(a._);(ci[b]||[]).each("cancel"),(ch[b]||[]).splice(0)}function cn(a){var b=a.ch,c=b.shift();if(c=b[0])c[1].$ch=!0,c[1].start.apply(c[1],c[0])}function cm(a){var b=a.cr;b&&b.splice(b.indexOf(a),1)}function cl(a){a.cr&&a.cr.push(a)}function ck(a,b){var c=a.ch,d=a.options.queue;if(!c||a.$ch)return a.$ch=!1;d&&c.push([b,a]);return d&&c[0][1]!==a}function cj(a){var b=I((a.element||{})._||{});a.ch=ch[b]=ch[b]||[],a.cr=ci[b]=ci[b]||[]}function cf(a,b){a.stop(),this.send(b)}function cc(a,b){var d=a[0],e,f,g=cb(a),h=!c.keys(g).length;return(b.$listeners||[]).filter(function(a){return a.dr&&a.n===d&&(h||function(){for(var b in g)if(a.dr===b)for(e=0,f=g[b];e<f.length;e++)if(!f[e].length||f[e][0]===a.dc)return!0;return!1}())})}function cb(a){var b=J(a),c=b[1]||{},d={},e;y(c)?(d[c]=b.slice(2),B(d[c][0])&&(d[c]=d[c][0].map(N))):d=c;for(e in d)d[e]=N(d[e]),d[e]=B(d[e][0])?d[e]:[d[e]];return d}function ca(a,b,c){var d=J(b),e=d.shift();return function(b){var c=b.find(a);return c===i?c:typeof e==="string"?c[e].apply(c,d):e.apply(c,[b].concat(d))}}function b_(){bX&&(bX=!1,br?(b.attachEvent("onmouseover",bZ),a.attachEvent("blur",b$)):(b.addEventListener("mouseover",bZ,!1),a.addEventListener("blur",b$,!1)))}function b$(a){bW.each(function(b,c){b&&q[c]&&bY(a,q[c]._,c,!1)})}function bZ(a){var b=a.target||a.srcElement,c=a.relatedTarget||a.fromElement,d=b,e=!1,f=[],g,h;while(d.nodeType===1)g=I(d),bW[g]===i&&bY(a,d,g,bW[g]=!0),d===c&&(e=!0),f.push(d),d=d.parentNode;if(c&&!e)while(c!==null&&c.nodeType===1&&f.indexOf(c)===-1)g=I(c),bW[g]!==i&&bY(a,c,g,bW[g]=i),c=c.parentNode}function bY(a,b,c,d){var e=new bE(a);e.type=d===!0?"mouseenter":"mouseleave",e.bubbles=!1,e.stopped=!0,e.target=bA(b),e.find=function(a){return F(a,!0).indexOf(this.target._)===-1?i:this.target},e.target.fire(e),bC.fire(e)}function bV(a){var b=new bE(a),c=b.target,d=c.parent&&c.parent();b.type=a.type==="focusin"||a.type==="focus"?"focus":"blur",d&&d.fire(b)}function bS(a){a=H(a),bF=bF.concat(a),bm(bG.prototype,a),bm(bB.prototype,a)}function bR(a,b){b=b.camelize();if(b==="opacity")return bu?(/opacity=(\d+)/i.exec(a.filter||"")||["","100"])[1].toInt()/100+"":a[b].replace(",",".");b==="float"&&(b=br?"styleFloat":"cssFloat");var c=a[b];bq&&/color/i.test(b)&&c&&(c=c.replace(/"/g,""));return c}function bQ(a,b){if(typeof b==="string"){var c=a.tagName,d=bP,e=c in bN?bN[c]:["","",1],f=e[2];d.innerHTML=e[0]+"<"+c+">"+b+"</"+c+">"+e[1];while(f--!==0)d=d.firstChild;b=d.childNodes;while(b.length!==0)bO.appendChild(b[0])}else for(var g=0,h=b.length,i;g<h;g++)i=b[b.length===h?g:0],bO.appendChild(i instanceof bG?i._:i);return bO}function bL(a,b,c){var d=a._,e=[],f=0,g=!c;while(d=d[b])d.nodeType===1&&(g||bA(d).match(c))&&(e[f++]=bA(d));return e}function bK(a,b,c){if(typeof b==="string"){a._=bJ(b,c);if(c!==i)for(var d in c)switch(d){case"id":a._.id=c[d];break;case"html":a._.innerHTML=c[d];break;case"class":a._.className=c[d];break;case"on":a.on(c[d]);break;default:a.set(d,c[d])}}else a._=b}function bA(a){if(a!=null){var b=r in a?q[a[r]]:i;if(b!==i)return b;if(a.nodeType===1)return new bG(a);if(a.nodeType===9)return new bB(a);if(a.window==a)return new bD(a);if(C(a.target)||C(a.srcElement))return new bE(a)}return a}function bz(a,b){typeof a==="string"&&(a=s({type:a},b),this.stopped=a.bubbles===!1,A(b)&&s(this,b)),this._=a,this.type=a.type,this.which=a.which,this.keyCode=a.keyCode,this.target=bA(a.target!=null&&"nodeType"in a.target&&a.target.nodeType===3?a.target.parentNode:a.target),this.currentTarget=bA(a.currentTarget),this.relatedTarget=bA(a.relatedTarget),this.pageX=a.pageX,this.pageY=a.pageY;if(bt&&"srcElement"in a){this.which=a.button===2?3:a.button===4?2:1,this.target=bA(a.srcElement)||b,this.relatedTarget=this.target._===a.fromElement?bA(a.toElement):this.target,this.currentTarget=b;var c=this.target.win().scrolls();this.pageX=a.clientX+c.x,this.pageY=a.clientY+c.y}}function by(a,b){bK(this,a,b);var c=this,d=c._,e=bw.Cast(d),f=r in d?d[r]:d[r]=p++;e!==i&&(c=new e(d,b),"$listeners"in this&&(c.$listeners=this.$listeners)),q[f]=c;return c}function bx(){return function(a,b){bi(this),this.initialize.apply(this,arguments);var c=this._,d=r in c?c[r]:c[r]=(c.nodeType===1?1:-1)*p++;q[d]=this}}function bo(a,b,c,d){if(A(b))for(var e in b)a.stopObserving(e,b[e]);else y(b)||(c=b,b=null),y(c)&&(c=a[c]),a.$listeners=(a.$listeners||[]).filter(function(a){var e=b&&c?a.e!==b||a.f!==c:b?a.e!==b:a.f!==c;e||d(a);return e})}function bn(a,b,c){var d=n.call(b,2),e=b[0],f=b[1],g=!1;if(y(e))switch(typeof f){case"string":g=f,f=f in a?a[f]:function(){};case"function":("$listeners"in a?a.$listeners:a.$listeners=[]).push(c({e:e,f:f,a:d,r:g||!1,t:a}));break;default:if(B(f))for(var h=0;h<f.length;h++)a.on.apply(a,[e].concat(N(f[h])).concat(d))}else{d=n.call(b,1);for(g in e)a.on.apply(a,[g].concat(N(e[g])).concat(d))}}function bi(a){"prebind"in a&&B(a.prebind)&&a.prebind.each(function(b){a[b]=a[b].bind(a)})}function bh(a,b){var c=b.toUpperCase(),d=a.constructor,e=[a,d].concat(d.ancestors||[]),f=0;for(l=e.length;f<l;f++){if(c in e[f])return e[f][c];if(b in e[f])return e[f][b]}return null}function bg(a,b,c){(b[be[c?0:2]]||b[be[c?1:3]]||function(){}).call(b,a)}function bf(a,b){return c.without.apply(c,[a].concat(be.concat(b?H("prototype parent ancestors"):["constructor"])))}function bb(a,b){return a>b?1:a<b?-1:0}function ba(a){return!!a}function _(a,b,c){try{return a.apply(b,Z(c,b))}catch(d){if(!(d instanceof $))throw d}return i}function $(){}function Z(a,b){var c=a[0],d=n.call(a,1),e=b,f;typeof c==="string"?(f=c,b.length!==0&&typeof b[0][f]==="function"?c=function(a){return a[f].apply(a,d)}:c=function(a){return a[f]}):e=d[0];return[c,e]}function O(a,b){var c=[],d,e,f;for(d in a){e=a[d],b&&(d=b+"["+d+"]");if(typeof e==="object"){if(B(e)){d.endsWith("[]")||(d+="[]");for(f=0;f<e.length;f++)c.push([d,e[f]])}else if(e){e=O(e,d);for(f=0;f<e.length;f++)c.push(e[f])}}else c.push([d,e])}return c}function N(a){return B(a)?a:[a]}function K(a){return s(a,{Methods:{},include:function(){for(var b=0,c=arguments.length;b<c;b++)A(arguments[b])&&(s(a.prototype,arguments[b]),s(a.Methods,arguments[b]))}})}var j=function(a){return a};j.version="2.3.1",j.modules=["core","dom","form","events","xhr","fx","cookie"];var k=d.prototype,m=c.prototype.toString,n=k.slice,o=b.documentElement,p=1,q=[],r="uniqueNumber",s=j.$ext=function(a,b,c){var d=b||{},e;for(e in d)if(!c||!(e in a))a[e]=d[e];return a},t=j.$eval=function(b){b&&("execScript"in a?bC.win()._.execScript(b):G("script",{text:b}).insertTo(o))},u=j.$break=function(){throw new $},v=j.$alias=function(a,b){for(var c in b)a[c]=a[b[c]];return a},w=j.defined=function(a){return typeof a!=="undefined"},x=j.isFunction=function(a){return typeof a==="function"},y=j.isString=function(a){return typeof a==="string"},z=j.isNumber=function(a){return typeof a==="number"&&!isNaN(a)},A=j.isHash=function(a){return m.call(a)==="[object Object]"},B=j.isArray=function(a){return m.call(a)==="[object Array]"},C=j.isElement=function(a){return a!=null&&a.nodeType===1},D=j.isNode=function(a){return a!=null&&a.nodeType!=null},E=j.$=function(a){if(a instanceof bw)return a;typeof a==="string"&&(a=b.getElementById(a));return bA(a)},F=j.$$=function(a,b){return bC.find(a,b)},G=j.$E=function(a,b){return new bG(a,b)},H=j.$w=function(a){return a.trim().split(/\s+/)},I=j.$uid=function(a){return r in a?a[r]:a[r]=p++},J=j.$A=function(a){return n.call(a,0)};k.map||(J=j.$A=function(a){try{return n.call(a,0)}catch(b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=a[d];return c}}),A(o)&&(A=j.isHash=function(a){return m.call(a)==="[object Object]"&&a!=null&&a.hasOwnProperty!=null});for(var L=0,M="Array Function Number String Date RegExp".split(" ");L<M.length;L++)j[M[L]]=K((new f("return "+M[L]))());j.Object=c,j.Math=h,s(c,{keys:function(a){var b=[],c;for(c in a)b.push(c);return b},values:function(a){var b=[],c;for(c in a)b.push(a[c]);return b},each:function(a,b,c){for(var d in a)b.call(c,d,a[d]);return a},empty:function(a){for(var b in a)return!1;return!0},clone:function(a){return c.merge(a)},without:function(){var a=J(arguments),b=a.shift(),c={},d;for(d in b)a.include(d)||(c[d]=b[d]);return c},only:function(){var a=J(arguments),b=a.shift(),c={},d=0,e=a.length;for(;d<e;d++)a[d]in b&&(c[a[d]]=b[a[d]]);return c},merge:function(){var a={},b=0,d=arguments,e=d.length,f;for(;b<e;b++)if(A(d[b]))for(f in d[b])a[f]=A(d[b][f])&&!(d[b][f]instanceof bc)?c.merge(f in a?a[f]:{},d[b][f]):d[b][f];return a},toQueryString:function(a){var b=O(a),c=0,d=[];for(;c<b.length;c++)d.push(encodeURIComponent(b[c][0])+"="+encodeURIComponent(""+b[c][1]));return d.join("&")}},!0);var P=h.random;h.random=function(a,b){if(arguments.length===0)return P();arguments.length===1&&(b=a,a=0);return~~(P()*(b-a+1)+~~a)};var Q=k.sort,R=k.forEach||function(a,b){for(var c=0,d=this.length;c<d;c++)a.call(b,this[c],c,this)},S=k.filter||function(a,b){for(var c=[],d=0,e=0,f=this.length;e<f;e++)a.call(b,this[e],e,this)&&(c[d++]=this[e]);return c},T=function(a,b){for(var c=[],d=0,e=0,f=this.length;e<f;e++)a.call(b,this[e],e,this)||(c[d++]=this[e]);return c},U=k.map||function(a,b){for(var c=[],d=0,e=this.length;d<e;d++)c[d]=a.call(b,this[d],d,this);return c},V=k.some||function(a,b){for(var c=0,d=this.length;c<d;c++)if(a.call(b,this[c],c,this))return!0;return!1},W=k.every||function(a,b){for(var c=0,d=this.length;c<d;c++)if(!a.call(b,this[c],c,this))return!1;return!0},X=function(a,b){for(var c=0,d=this.length;c<d;c++)if(a.call(b,this[c],c,this))return this[c];return i},Y=function(a,b){for(var c=this.length-1;c>-1;c--)if(a.call(b,this[c],c,this))return this[c];return i};d.include({indexOf:k.indexOf||function(a,b){for(var c=b<0?h.max(0,this.length+b):b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},lastIndexOf:k.lastIndexOf||function(a){for(var b=this.length-1;b>-1;b--)if(this[b]===a)return b;return-1},first:function(){return arguments.length?_(X,this,arguments):this[0]},last:function(){return arguments.length?_(Y,this,arguments):this[this.length-1]},random:function(){return this.length===0?i:this[h.random(this.length-1)]},size:function(){return this.length},clean:function(){this.length=0;return this},empty:function(){return this.length===0},clone:function(){return this.slice(0)},each:function(){_(R,this,arguments);return this},forEach:R,map:function(){return _(U,this,arguments)},filter:function(){return _(S,this,arguments)},reject:function(){return _(T,this,arguments)},some:function(a){return _(V,this,a?arguments:[ba])},every:function(a){return _(W,this,a?arguments:[ba])},walk:function(){this.map.apply(this,arguments).forEach(function(a,b){this[b]=a},this);return this},merge:function(){for(var a=this.clone(),b,c=0;c<arguments.length;c++){b=N(arguments[c]);for(var d=0;d<b.length;d++)a.indexOf(b[d])==-1&&a.push(b[d])}return a},flatten:function(){var a=[];this.forEach(function(b){B(b)?a=a.concat(b.flatten()):a.push(b)});return a},compact:function(){return this.without(null,i)},uniq:function(){return[].merge(this)},includes:function(){for(var a=0;a<arguments.length;a++)if(this.indexOf(arguments[a])===-1)return!1;return!0},without:function(){var a=n.call(arguments);return this.filter(function(b){return a.indexOf(b)===-1})},shuffle:function(){var a=this.clone(),b,c,d=a.length;for(;d>0;b=h.random(d-1),c=a[--d],a[d]=a[b],a[b]=c){}return a},sort:function(a){return Q.apply(this,a||!z(this[0])?arguments:[bb])},sortBy:function(){var a=Z(arguments,this);return this.sort(function(b,c){return bb(a[0].call(a[1],b),a[0].call(a[1],c))})},min:function(){return h.min.apply(h,this)},max:function(){return h.max.apply(h,this)},sum:function(){for(var a=0,b=0,c=this.length;b<c;a+=this[b++]){}return a}}),k.include=k.includes,e.include({empty:function(){return this==""},blank:function(){return this==!1},trim:e.prototype.trim||function(){var a=this.replace(/^\s\s*/,""),b=a.length;while(/\s/.test(a.charAt(--b))){}return a.slice(0,b+1)},stripTags:function(){return this.replace(/<\/?[^>]+>/ig,"")},stripScripts:function(a){var b="",c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/img,function(a,c){b+=c+"\n";return""});a===!0?t(b):x(a)&&a(b,c);return c},extractScripts:function(){var a="";this.stripScripts(function(b){a=b});return a},evalScripts:function(){this.stripScripts(!0);return this},camelize:function(){return this.replace(/(\-|_)+(.)?/g,function(a,b,c){return c?c.toUpperCase():""})},underscored:function(){return this.replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/\-/g,"_").toLowerCase()},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},dasherize:function(){return this.underscored().replace(/_/g,"-")},includes:function(a){return this.indexOf(a)!=-1},startsWith:function(a,b){return(b!==!0?this.indexOf(a):this.toLowerCase().indexOf(a.toLowerCase()))===0},endsWith:function(a,b){return this.length-(b!==!0?this.lastIndexOf(a):this.toLowerCase().lastIndexOf(a.toLowerCase()))===a.length},toInt:function(a){return parseInt(this,a===i?10:a)},toFloat:function(a){return parseFloat(a===!0?this:this.replace(",",".").replace(/(\d)-(\d)/,"$1.$2"))}}),e.prototype.include=e.prototype.includes,f.include({bind:function(){var a=J(arguments),b=a.shift(),c=this;return function(){return c.apply(b,a.length!==0||arguments.length!==0?a.concat(J(arguments)):a)}},bindAsEventListener:function(){var a=J(arguments),b=a.shift(),c=this;return function(d){return c.apply(b,[d].concat(a).concat(J(arguments)))}},curry:function(){return this.bind.apply(this,[this].concat(J(arguments)))},rcurry:function(){var a=J(arguments),b=this;return function(){return b.apply(b,J(arguments).concat(a))}},delay:function(){var a=J(arguments),b=a.shift(),c=new g(setTimeout(this.bind.apply(this,[this].concat(a)),b));c.cancel=function(){clearTimeout(this)};return c},periodical:function(){var a=J(arguments),b=a.shift(),c=new g(setInterval(this.bind.apply(this,[this].concat(a)),b));c.stop=function(){clearInterval(this)};return c},chain:function(){var a=J(arguments),b=a.shift(),c=this;return function(){var d=c.apply(c,arguments);b.apply(b,a);return d}}}),g.include({times:function(a,b){for(var c=0;c<this;c++)a.call(b,c);return this},upto:function(a,b,c){for(var d=this+0;d<=a;d++)b.call(c,d);return this},downto:function(a,b,c){for(var d=this+0;d>=a;d--)b.call(c,d);return this},to:function(a,b,c){var d=this+0,e=a,f=[],g=d;b=b||function(a){return a};if(e>d)for(;g<=e;g++)f.push(b.call(c,g));else for(;g>=e;g--)f.push(b.call(c,g));return f},abs:function(){return h.abs(this)},round:function(a){return a?parseFloat(this.toFixed(a)):h.round(this)},ceil:function(){return h.ceil(this)},floor:function(){return h.floor(this)},min:function(a){return this<a?a:this+0},max:function(a){return this>a?a:this+0}}),RegExp.escape=function(a){return(""+a).replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1")},a.JSON||(a.JSON=function(){function g(a){return(a<10?"0":"")+a}function d(a){return a.replace(c,function(a){return b[a]||"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}var a=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,b={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;return{stringify:function(a){switch(typeof a){case"boolean":return e(a);case"number":return e(a+0);case"string":return'"'+d(a)+'"';case"object":if(a===null)return"null";if(B(a))return"["+J(a).map(JSON.stringify).join(",")+"]";if(m.call(a)==="[object Date]")return'"'+a.getUTCFullYear()+"-"+g(a.getUTCMonth()+1)+"-"+g(a.getUTCDate())+"T"+g(a.getUTCHours())+":"+g(a.getUTCMinutes())+":"+g(a.getUTCSeconds())+"."+g(a.getMilliseconds())+'Z"';var b=[],c;for(c in a)b.push('"'+c+'":'+JSON.stringify(a[c]));return"{"+b.join(",")+"}"}},parse:function(b){if(y(b)&&b){b=b.replace(a,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return(new f("return "+b))()}throw"JSON parse error: "+b}}}());var bc=j.Class=function(){var a=J(arguments).slice(0,2),b=a.pop()||{},c=a.pop(),d=arguments[2],e=function(){};!a.length&&!A(b)&&(c=b,b={}),!d&&c&&(c===bw||c.ancestors.include(bw))&&(d=bx()),d=s(d||function(){bi(this);return"initialize"in this?this.initialize.apply(this,arguments):this},bd),c=c||bc,e.prototype=c.prototype,d.prototype=new e,d.parent=c,d.prototype.constructor=d,d.ancestors=[];while(c)d.ancestors.push(c),c=c.parent;["extend","include"].each(function(a){a in b&&d[a].apply(d,N(b[a]))});return d.include(b)},bd={extend:function(){J(arguments).filter(A).each(function(a){s(this,bf(a,!0)),bg(this,a,!0)},this);return this},include:function(){var a=[this].concat(this.ancestors);J(arguments).filter(A).each(function(b){c.each(bf(b,!1),function(b,c){for(var d,e=0,f=a.length;e<f;e++)if(b in a[e].prototype){d=a[e].prototype[b];break}this.prototype[b]=x(c)&&x(d)?function(){this.$super=d;return c.apply(this,arguments)}:c},this),bg(this,b,!1)},this);return this}},be=H("selfExtended self_extended selfIncluded self_included extend include");s(bc,bd),bc.prototype.$super=i;var bj=j.Options={setOptions:function(a){var b=this.options=s(s({},c.clone(bh(this,"Options"))),a),d,e;if(x(this.on))for(e in b)if(d=e.match(/on([A-Z][A-Za-z]+)/))this.on(d[1].toLowerCase(),b[e]),delete b[e];return this},cutOptions:function(a){var b=J(a);this.setOptions(A(b.last())?b.pop():{});return b}},bk=j.Observer=new bc({include:bj,initialize:function(a){this.setOptions(a),bm(this,bh(this,"Events"));return this},on:function(){bn(this,arguments,function(a){return a});return this},observes:function(a,b){y(a)||(b=a,a=null),y(b)&&(b=b in this?this[b]:null);return(this.$listeners||[]).some(function(c){return a&&b?c.e===a&&c.f===b:a?c.e===a:c.f===b})},stopObserving:function(a,b){bo(this,a,b,function(){});return this},listeners:function(a){return(this.$listeners||[]).filter(function(b){return!a||b.e===a}).map(function(a){return a.f}).uniq()},fire:function(){var a=J(arguments),b=a.shift();(this.$listeners||[]).each(function(c){c.e===b&&c.f.apply(this,c.a.concat(a))},this);return this}}),bl=bk.create=function(a,b){s(a,c.without(bk.prototype,"initialize","setOptions"),!0);return bm(a,b||bh(a,"Events"))},bm=bk.createShortcuts=function(a,b){(b||[]).each(function(b){var c="on"+b.replace(/(^|_|:)([a-z])/g,function(a,b,c){return c.toUpperCase()});c in a||(a[c]=function(){return this.on.apply(this,[b].concat(J(arguments)))})});return a},bp=navigator.userAgent,bq="opera"in a,br="attachEvent"in a&&!bq,bs=j.Browser={IE:br,Opera:bq,WebKit:bp.include("AppleWebKit/"),Gecko:bp.include("Gecko")&&!bp.include("KHTML"),MobileSafari:/Apple.*Mobile.*Safari/.test(bp),Konqueror:bp.include("Konqueror"),OLD:!b.querySelector,IE8L:!1},bt=!1,bu=!("opacity"in o.style)&&"filter"in o.style;try{b.createElement("<input/>"),bs.OLD=bs.IE8L=bt=!0}catch(bv){}var bw=j.Wrapper=new bc({_:i,initialize:function(a){this._=a}});bw.Cache=q,bw.Cast=function(a){return a.tagName in bH?bH[a.tagName]:i};var bB=j.Document=new bc(bw,{win:function(){return bA(this._.defaultView||this._.parentWindow)}}),bC=bA(b),bD=j.Window=new bc(bw,{win:function(){return this},size:function(){var a=this._,b=a.document.documentElement;return a.innerWidth?{x:a.innerWidth,y:a.innerHeight}:{x:b.clientWidth,y:b.clientHeight}},scrolls:function(){var a=this._,b=a.document,c=b.body,d=b.documentElement;return a.pageXOffset||a.pageYOffset?{x:a.pageXOffset,y:a.pageYOffset}:c&&(c.scrollLeft||c.scrollTop)?{x:c.scrollLeft,y:c.scrollTop}:{x:d.scrollLeft,y:d.scrollTop}},scrollTo:function(a,b,c){var d=a,e=b,f=z(a)?null:E(a);f instanceof bG&&(a=f.position()),A(a)&&(e=a.y,d=a.x),A(c=c||b)&&j.Fx?(new cg.Scroll(this,c)).start({x:d,y:e}):this._.scrollTo(d,e);return this}}),bE=j.Event=new bc(bw,{type:null,which:null,keyCode:null,target:null,currentTarget:null,relatedTarget:null,pageX:null,pageY:null,initialize:bz,stopPropagation:function(){this._.stopPropagation?this._.stopPropagation():this._.cancelBubble=!0,this.stopped=!0;return this},preventDefault:function(){this._.preventDefault?this._.preventDefault():this._.returnValue=!1;return this},stop:function(){return this.stopPropagation().preventDefault()},position:function(){return{x:this.pageX,y:this.pageY}},offset:function(){if(this.target instanceof bG){var a=this.target.position();return{x:this.pageX-a.x,y:this.pageY-a.y}}return null},find:function(a){if(this.target instanceof bw&&this.currentTarget instanceof bw){var b=this.target._,c=this.currentTarget.find(a,!0);while(b){if(c.indexOf(b)!==-1)return bA(b);b=b.parentNode}}return i}},bz),bF=[],bG=j.Element=new bc(bw,{initialize:function(a,b){bK(this,a,b)}},by),bH=bG.Wrappers={},bI={},bJ=function(a,c){return(a in bI?bI[a]:bI[a]=b.createElement(a)).cloneNode(!1)};bt&&(bJ=function(a,c){c!==i&&(a==="input"||a==="button")&&(a="<"+a+' name="'+c.name+'" type="'+c.type+'"'+(c.checked?" checked":"")+" />",delete c.name,delete c.type);return b.createElement(a)}),bG.include({parent:function(a){var b=this._.parentNode,c=b&&b.nodeType;return a?this.parents(a)[0]:c===1||c===9?bA(b):null},parents:function(a){return bL(this,"parentNode",a)},children:function(a){return this.find(a).filter(function(a){return a._.parentNode===this._},this)},siblings:function(a){return this.prevSiblings(a).reverse().concat(this.nextSiblings(a))},nextSiblings:function(a){return bL(this,"nextSibling",a)},prevSiblings:function(a){return bL(this,"previousSibling",a)},next:function(a){return!a&&this._.nextElementSibling!==i?bA(this._.nextElementSibling):this.nextSiblings(a)[0]},prev:function(a){return!a&&this._.previousElementSibling!==i?bA(this._.previousElementSibling):this.prevSiblings(a)[0]},remove:function(){var a=this._,b=a.parentNode;b&&b.removeChild(a);return this},insert:function(a,b){var c=null,d=this._;b=b===i?"bottom":b,typeof a!=="object"?c=a=""+a:a instanceof bG&&(a=a._),bM[b](d,a.nodeType===i?bQ(b==="bottom"||b==="top"?d:d.parentNode,a):a),c!==null&&c.evalScripts();return this},insertTo:function(a,b){E(a).insert(this,b);return this},append:function(a){return this.insert(y(a)?J(arguments).join(""):arguments)},update:function(a){if(typeof a!=="object"){a=""+a;try{this._.innerHTML=a}catch(b){return this.clean().insert(a)}a.evalScripts();return this}return this.clean().insert(a)},html:function(a){return a===i?this._.innerHTML:this.update(a)},text:function(a){return a===i?this._.textContent===i?this._.innerText:this._.textContent:this.update(this.doc()._.createTextNode(a))},replace:function(a){return this.insert(a,"instead")},wrap:function(a){var b=this._,c=b.parentNode;c&&(a=E(a)._,c.replaceChild(a,b),a.appendChild(b));return this},clean:function(){while(this._.firstChild)this._.removeChild(this._.firstChild);return this},empty:function(){return this.html().blank()},clone:function(){return new bG(this._.cloneNode(!0))},index:function(){var a=this._,b=a.parentNode.firstChild,c=0;while(b!==a)b.nodeType===1&&c++,b=b.nextSibling;return c}});var bM={bottom:function(a,b){a.appendChild(b)},top:function(a,b){a.firstChild!==null?a.insertBefore(b,a.firstChild):a.appendChild(b)},after:function(a,b){var c=a.parentNode,d=a.nextSibling;d!==null?c.insertBefore(b,d):c.appendChild(b)},before:function(a,b){a.parentNode.insertBefore(b,a)},instead:function(a,b){a.parentNode.replaceChild(b,a)}},bN={TBODY:["<TABLE>","</TABLE>",2],TR:["<TABLE><TBODY>","</TBODY></TABLE>",3],TD:["<TABLE><TBODY><TR>","</TR></TBODY></TABLE>",4],COL:["<TABLE><COLGROUP>","</COLGROUP><TBODY></TBODY></TABLE>",2],LEGEND:["<FIELDSET>","</FIELDSET>",2],AREA:["<map>","</map>",2],OPTION:["<SELECT>","</SELECT>",2]};v(bN,{OPTGROUP:"OPTION",THEAD:"TBODY",TFOOT:"TBODY",TH:"TD"});var bO=b.createDocumentFragment(),bP=b.createElement("DIV");bG.include({setStyle:function(a,b){var c,d,e={},f=this._.style;b!==i?(e[a]=b,a=e):y(a)&&(a.split(";").each(function(a){var b=a.split(":").map("trim");b[0]&&b[1]&&(e[b[0]]=b[1])}),a=e);for(c in a)d=c.indexOf("-")<0?c:c.camelize(),bu&&c==="opacity"?f.filter="alpha(opacity="+a[c]*100+")":c==="float"&&(d=br?"styleFloat":"cssFloat"),f[d]=a[c];return this},getStyle:function(a){return bR(this._.style,a)||bR(this.computedStyles(),a)},computedStyles:o.currentStyle?function(){return this._.currentStyle||{}}:o.runtimeStyle?function(){return this._.runtimeStyle||{}}:function(){return this._.ownerDocument.defaultView.getComputedStyle(this._,null)},hasClass:function(a){return(" "+this._.className+" ").indexOf(" "+a+" ")!=-1},setClass:function(a){this._.className=a;return this},getClass:function(){return this._.className},addClass:function(a){var b=" "+this._.className+" ";b.indexOf(" "+a+" ")==-1&&(this._.className+=(b===" "?"":" ")+a);return this},removeClass:function(a){this._.className=(" "+this._.className+" ").replace(" "+a+" "," ").trim();return this},toggleClass:function(a){return this[this.hasClass(a)?"removeClass":"addClass"](a)},radioClass:function(a){this.siblings().each("removeClass",a);return this.addClass(a)}}),bG.include({set:function(a,b){if(typeof a==="string"){var c={};c[a]=b,a=c}var d,e=this._;for(d in a)d==="style"?this.setStyle(a[d]):(d in e||e.setAttribute(d,""+a[d]),d.substr(0,5)!=="data-"&&(e[d]=a[d]));return this},get:function(a){var b=this._,c=b[a]||b.getAttribute(a);return c===""?null:c},has:function(a){return this.get(a)!==null},erase:function(a){this._.removeAttribute(a);return this},hidden:function(){return this.getStyle("display")==="none"},visible:function(){return!this.hidden()},hide:function(a,b){this.visible()&&(this._d=this.getStyle("display"),this._.style.display="none");return this},show:function(){if(this.hidden()){var a=this._,b=this._d,c;if(!b||b==="none")c=G(a.tagName).insertTo(o),b=c.getStyle("display"),c.remove();b==="none"&&(b="block"),a.style.display=b}return this},toggle:function(){return this[this.visible()?"hide":"show"]()},radio:function(a,b){this.siblings().each("hide",a,b);return this.show()},data:function(a,b){var c,d,e,f,g,h;if(A(a))for(c in a)b=this.data(c,a[c]);else if(b===i){a="data-"+(""+a).dasherize();for(d={},e=!1,f=this._.attributes,h=0;h<f.length;h++){b=f[h].value;try{b=JSON.parse(b)}catch(j){}if(f[h].name===a){d=b,e=!0;break}f[h].name.indexOf(a)===0&&(d[f[h].name.substring(a.length+1).camelize()]=b,e=!0)}b=e?d:null}else{a="data-"+(""+a).dasherize(),A(b)||(b={"":b});for(c in b)g=c.blank()?a:a+"-"+c.dasherize(),b[c]===null?this._.removeAttribute(g):this._.setAttribute(g,y(b[c])?b[c]:JSON.stringify(b[c]));b=this}return b}}),bG.include({doc:function(){return bA(this._.ownerDocument)},win:function(){return this.doc().win()},size:function(){return{x:this._.offsetWidth,y:this._.offsetHeight}},position:function(){var a=this._.getBoundingClientRect(),b=this.doc()._.documentElement,c=this.win().scrolls();return{x:a.left+c.x-b.clientLeft,y:a.top+c.y-b.clientTop}},scrolls:function(){return{x:this._.scrollLeft,y:this._.scrollTop}},dimensions:function(){var a=this.size(),b=this.scrolls(),c=this.position();return{top:c.y,left:c.x,width:a.x,height:a.y,scrollLeft:b.x,scrollTop:b.y}},overlaps:function(a){var b=this.position(),c=this.size();return a.x>b.x&&a.x<b.x+c.x&&a.y>b.y&&a.y<b.y+c.y},setWidth:function(a){var b=this._.style;b.width=a+"px",b.width=2*a-this._.offsetWidth+"px";return this},setHeight:function(a){var b=this._.style;b.height=a+"px",b.height=2*a-this._.offsetHeight+"px";return this},resize:function(a,b){A(a)&&(b=a.y,a=a.x);return this.setWidth(a).setHeight(b)},moveTo:function(a,b){A(a)&&(b=a.y,a=a.x);return this.setStyle({left:a+"px",top:b+"px"})},scrollTo:function(a,b){A(a)&&(b=a.y,a=a.x),this._.scrollLeft=a,this._.scrollTop=b;return this},scrollThere:function(a){this.win().scrollTo(this,a);return this}}),[bG,bB,bD].each("include",s(bl({}),{on:function(){bn(this,arguments,function(a){a.e==="mouseenter"||a.e==="mouseleave"?(b_(),a.n=a.e,a.w=function(){}):(a.e==="contextmenu"&&bs.Konqueror?a.n="rightclick":a.e==="mousewheel"&&bs.Gecko?a.n="DOMMouseScroll":a.n=a.e,a.w=function(b){b=new bE(b,a.t),a.f.apply(a.t,(a.r?[]:[b]).concat(a.a))===!1&&b.stop()},bt?a.t._.attachEvent("on"+a.n,a.w):a.t._.addEventListener(a.n,a.w,!1));return a});return this},stopObserving:function(a,b){bo(this,a,b,function(a){bt?a.t._.detachEvent("on"+a.n,a.w):a.t._.removeEventListener(a.n,a.w,!1)});return this},fire:function(a,b){var c=this.parent&&this.parent();a instanceof bE||(a=new bE(a,s({target:this._},b))),a.currentTarget=this,(this.$listeners||[]).each(function(b){b.e===a.type&&b.f.apply(this,(b.r?[]:[a]).concat(b.a))===!1&&a.stop()},this),c&&c.fire&&!a.stopped&&c.fire(a);return this},stopEvent:function(){return!1}})),bm(bD.prototype,H("blur focus scroll resize load")),bS("click rightclick contextmenu mousedown mouseup mouseover mouseout mousemove keypress keydown keyup"),[bG,bB].each("include",{first:function(a){return bA(a===i&&this._.firstElementChild!==i?this._.firstElementChild:this._.querySelector(a||"*"))},find:function(a,b){var c=this._.querySelectorAll(a||"*"),d,e=0,f=c.length;if(b===!0)d=J(c);else for(d=[];e<f;e++)d[e]=bA(c[e]);return d},match:function(a){var c=this._,d=c,e,f=!1;while(d.parentNode!==null&&d.parentNode.nodeType!==11)d=d.parentNode;c===d&&(d=b.createElement("div"),d.appendChild(c),f=!0),e=bA(d).find(a,!0).indexOf(c)!==-1,f&&d.removeChild(c);return e}}),bB.include({on:function(a){if(a==="ready"&&!this._iR){var b=this._,c=this.fire.bind(this,"ready");"readyState"in b?function(){["loaded","complete"].include(b.readyState)?c():arguments.callee.delay(50)}():b.addEventListener("DOMContentLoaded",c,!1),this._iR=!0}return this.$super.apply(this,arguments)}}),bm(bB.prototype,["ready"]);var bT=j.Form=bH.FORM=new bc(bG,{initialize:function(a){var b=a||{},d="remote"in b,e=b;A(b)&&!C(b)&&(e="form",b=c.without(b,"remote")),this.$super(e,b),d&&this.remotize()},elements:function(){return this.find("input,button,select,textarea")},inputs:function(){return this.elements().filter(function(a){return!["submit","button","reset","image",null].include(a._.type)})},input:function(a){var b=this._[a];"tagName"in b?b=bA(b):b=J(b).map(bA);return b},focus:function(){var a=this.inputs().first(function(a){return a._.type!=="hidden"});a&&a.focus();return this},blur:function(){this.elements().each("blur");return this},disable:function(){this.elements().each("disable");return this},enable:function(){this.elements().each("enable");return this},values:function(){var a={};this.inputs().each(function(b){var c=b._,d=a,e,f=c.name.match(/[^\[]+/g);if(!c.disabled&&c.name&&(c.type!=="checkbox"&&c.type!=="radio"||c.checked)){while(f.length>1)e=f.shift(),e.endsWith("]")&&(e=e.substr(0,e.length-1)),d[e]||(d[e]=f[0]==="]"?[]:{}),d=d[e];e=f.shift(),e.endsWith("]")&&(e=e.substr(0,e.length-1)),e===""?d.push(b.value()):d[e]=b.value()}});return a},serialize:function(){return c.toQueryString(this.values())},submit:function(){this._.submit();return this},reset:function(){this._.reset();return this}});bS("submit reset focus blur disable enable change");var bU=j.Input=bH.INPUT=bH.BUTTON=bH.SELECT=bH.TEXTAREA=bH.OPTGROUP=new bc(bG,{initialize:function(a,b){if(!a||A(a)&&!C(a))b=a||{},/textarea|select/.test(b.type||"")?(a=b.type,delete b.type):a="input";this.$super(a,b)},form:function(){return bA(this._.form)},insert:function(a,b){this.$super(a,b),this.find("option").each(function(a){a._.selected=!!a.get("selected")});return this},update:function(a){return this.clean().insert(a)},getValue:function(){return this._.type=="select-multiple"?this.find("option").map(function(a){return a._.selected?a._.value:null}).compact():this._.value},setValue:function(a){this._.type=="select-multiple"?(a=N(a).map(e),this.find("option").each(function(b){b._.selected=a.include(b._.value)})):this._.value=a;return this},value:function(a){return this[a===i?"getValue":"setValue"](a)},focus:function(){this._.focus(),this.focused=!0,br&&this.fire("focus",{bubbles:!1});return this},blur:function(){this._.blur(),this.focused=!1,br&&this.fire("blur",{bubbles:!1});return this},select:function(){this._.select();return this.focus()},disable:function(){this._.disabled=!0;return this.fire("disable")},enable:function(){this._.disabled=!1;return this.fire("enable")},disabled:function(a){return a===i?this._.disabled:this[a?"disable":"enable"]()},checked:function(a){a===i?a=this._.checked:(this._.checked=a,a=this);return a}});bt?(b.attachEvent("onfocusin",bV),b.attachEvent("onfocusout",bV)):(b.addEventListener("focus",bV,!0),b.addEventListener("blur",bV,!0));var bW=[],bX=!0;bS("mouseenter mouseleave"),[bG,bB].each("include",{delegate:function(a){var b=cb(arguments),c,d,e,f;for(c in b)for(d=0,f=b[c];d<f.length;d++)this.on(a,ca(c,f[d],this)),s(this.$listeners.last(),{dr:c,dc:f[d][0]});return this},undelegate:function(a){cc(arguments,this).each(function(a){this.stopObserving(a.n,a.f)},this);return this},delegates:function(){return!!cc(arguments,this).length}}),c.each({on:"delegate",stopObserving:"undelegate",observes:"delegates"},function(a,b){e.prototype[a]=function(){var a=J(arguments),c;a.splice(1,0,""+this),c=bC[b].apply(bC,a);return c===bC?this:c}});var cd=e.prototype.on;e.prototype.on=function(a){if(A(a))for(var b in a)cd.apply(this,[b].concat([a[b]]));else cd.apply(this,arguments);return this},bF.each(function(a){e.prototype["on"+a.capitalize()]=function(){return this.on.apply(this,[a].concat(J(arguments)))}}),H("Element Input Form").each(function(a){c.each(a in j?j[a].prototype:{},function(a,b){x(b)&&!(a in e.prototype)&&(e.prototype[a]=function(){var b=F(this,!0),c=0,d=b.length,e=!0,f,g;for(;c<d;c++){f=bA(b[c]),g=f[a].apply(f,arguments);if(e){if(g!==f)return g;e=!1}}return null})})});var ce=j.Xhr=new bc(bk,{extend:{EVENTS:H("success failure complete request cancel create"),Options:{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript,text/html,application/xml,text/xml,*/*"},method:"post",encoding:"utf-8",async:!0,evalScripts:!1,evalResponse:!1,evalJS:!0,evalJSON:!0,secureJSON:!0,urlEncoded:!0,spinner:null,spinnerFx:"fade",params:null,iframed:!1,jsonp:!1},load:function(a,b){return(new this(a,s({method:"get"},b))).send()}},initialize:function(a,b){this.initCallbacks(),this.url=a,s(this.$super(b),this.options),this.params!=ce.Options.params&&(this.params=this.prepareData(ce.Options.params,this.params)),ce.Options.spinner&&E(this.spinner)===E(ce.Options.spinner)&&(this.spinner=null)},setHeader:function(a,b){this.headers[a]=b;return this},getHeader:function(a){var b;try{b=this.xhr.getResponseHeader(a)}catch(c){}return b},successful:function(){return this.status>=200&&this.status<300},send:function(a){var b={},c=this.url,d=this.method.toLowerCase(),e=this.headers,f,g;if(d=="put"||d=="delete")b._method=d,d="post";var h=this.prepareData(this.params,this.prepareParams(a),b);this.urlEncoded&&d=="post"&&!e["Content-type"]&&this.setHeader("Content-type","application/x-www-form-urlencoded;charset="+this.encoding),d=="get"&&(h&&(c+=(c.include("?")?"&":"?")+h),h=null),g=this.xhr=this.createXhr(),this.fire("create"),g.open(d,c,this.async),g.onreadystatechange=this.stateChanged.bind(this);for(f in e)g.setRequestHeader(f,e[f]);g.send(h),this.fire("request"),this.async||this.stateChanged();return this},update:function(a,b){return this.onSuccess(function(b){a.update(b.text)}).send(b)},cancel:function(){var a=this.xhr;if(!a||a.canceled)return this;a.abort(),a.onreadystatechange=function(){},a.canceled=!0;return this.fire("cancel")},fire:function(a){return this.$super(a,this,this.xhr)},createXhr:function(){return this.jsonp?new ce.JSONP(this):this.form&&this.form.first("input[type=file]")?new ce.IFramed(this.form):"ActiveXObject"in a?new ActiveXObject("MSXML2.XMLHTTP"):new XMLHttpRequest},prepareParams:function(a){return a},prepareData:function(){return J(arguments).map(function(a){y(a)||(a=c.toQueryString(a));return a.blank()?null:a}).compact().join("&")},stateChanged:function(){var a=this.xhr;if(a.readyState==4&&!a.canceled){try{this.status=a.status}catch(b){this.status=0}this.text=this.responseText=a.responseText,this.xml=this.responseXML=a.responseXML,this.fire("complete").fire(this.successful()?"success":"failure")}},tryScripts:function(a){var b=this.getHeader("Content-type"),c=this.getHeader("X-JSON");c&&(this.json=this.responseJSON=this.headerJSON=JSON.parse(c)),this.evalResponse||this.evalJS&&/(ecma|java)script/i.test(b)?t(this.text):/json/.test(b)&&this.evalJSON?this.json=this.responseJSON=JSON.parse(this.text):this.evalScripts&&this.text.evalScripts()},initCallbacks:function(){this.on({create:"showSpinner",complete:"hideSpinner",cancel:"hideSpinner"}),this.on("complete","tryScripts"),ce.EVENTS.each(function(a){this.on(a,function(){ce.fire(a,this,this.xhr)})},this)},showSpinner:function(){ce.showSpinner.call(this,this)},hideSpinner:function(){ce.hideSpinner.call(this,this)}});s(bl(ce),{counter:0,showSpinner:function(a){ce.trySpinner(a,"show")},hideSpinner:function(a){ce.trySpinner(a,"hide")},trySpinner:function(a,b){var c=a||ce.Options,d=E(c.spinner);d&&d[b](c.spinnerFx,{duration:100})},countIn:function(){ce.counter++,ce.showSpinner()},countOut:function(){ce.counter--,ce.counter<1&&ce.hideSpinner()}}).on({create:"countIn",complete:"countOut",cancel:"countOut"}),bT.include({send:function(a){a=a||{},a.method=a.method||this._.method||"post",this.xhr=(new ce(this._.action||b.location.href,s({spinner:this.first(".spinner")},a))).onComplete(this.enable.bind(this)).onCancel(this.enable.bind(this)).send(this),this.disable.bind(this).delay(1);return this},cancelXhr:function(){this.xhr instanceof ce&&this.xhr.cancel();return this},remotize:function(a){this.remote||(this.on("submit",cf,a),this.remote=!0);return this},unremotize:function(){this.stopObserving("submit",cf),this.remote=!1;return this}}),ce.include({prepareParams:function(a){a&&a instanceof bT&&(this.form=a,a=a.values());return a}}),bG.include({load:function(a,b){(new ce(a,s({method:"get"},b))).update(this);return this}}),ce.Dummy={open:function(){},setRequestHeader:function(){},onreadystatechange:function(){}},ce.IFramed=new bc({include:ce.Dummy,initialize:function(a){this.form=a,this.id="xhr_"+(new Date).getTime(),this.form.doc().first("body").append('<i><iframe name="'+this.id+'" id="'+this.id+'" width="0" height="0" frameborder="0" src="about:blank"></iframe></i>',"after"),E(this.id).on("load",this.onLoad.bind(this))},send:function(){this.form.set("target",this.id).submit()},onLoad:function(){this.status=200,this.readyState=4,this.form.set("target","");try{this.responseText=a[this.id].document.documentElement.innerHTML}catch(b){}this.onreadystatechange()},abort:function(){E(this.id).set("src","about:blank")}}),ce.JSONP=new bc({include:ce.Dummy,prefix:"jsonp",initialize:function(a){this.xhr=a,this.name=this.prefix+(new Date).getTime(),this.param=(y(a.jsonp)?a.jsonp:"callback")+"="+this.name,this.script=G("script",{charset:a.encoding,async:a.async})},open:function(a,b,c){this.url=b,this.method=a},send:function(b){a[this.name]=this.finish.bind(this),this.script.set("src",this.url+(this.url.include("?")?"&":"?")+this.param+"&"+b).insertTo(F("script").last(),"after")},finish:function(a){this.status=200,this.readyState=4,this.xhr.json=this.xhr.responseJSON=a,this.onreadystatechange()},abort:function(){a[this.name]=function(){}}});var cg=j.Fx=new bc(bk,{extend:{EVENTS:H("start finish cancel"),Durations:{"short":200,normal:400,"long":800},Options:{fps:bt?40:60,duration:"normal",transition:"default",queue:!0,engine:"css"}},initialize:function(a,b){this.$super(b),this.element=E(a),cj(this)},start:function(){if(ck(this,arguments))return this;cl(this),this.prepare.apply(this,arguments),cp(this);return this.fire("start",this)},finish:function(){cq(this),cm(this),this.fire("finish"),cn(this);return this},cancel:function(){cq(this),cm(this);return this.fire("cancel")},prepare:function(){},render:function(){}}),ch=[],ci=[],cr={"default":"(.25,.1,.25,1)",linear:"(0,0,1,1)","ease-in":"(.42,0,1,1)","ease-out":"(0,0,.58,1)","ease-in-out":"(.42,0,.58,1)","ease-out-in":"(0,.42,1,.58)"},cs={};e.COLORS={maroon:"#800000",red:"#ff0000",orange:"#ffA500",yellow:"#ffff00",olive:"#808000",purple:"#800080",fuchsia:"#ff00ff",white:"#ffffff",lime:"#00ff00",green:"#008000",navy:"#000080",blue:"#0000ff",aqua:"#00ffff",teal:"#008080",black:"#000000",silver:"#c0c0c0",gray:"#808080",brown:"#a52a2a"},e.include({toHex:function(){var a=/^#(\w)(\w)(\w)$/.exec(this);a?a="#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:(a=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/.exec(this))?a="#"+a.slice(1).map(function(a){a=(a-0).toString(16);return a.length==1?"0"+a:a}).join(""):a=e.COLORS[this]||this;return a},toRgb:function(a){var b=/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/i.exec(this.toHex()||"");b&&(b=b.slice(1).map("toInt",16),b=a?b:"rgb("+b+")");return b}}),bG.include({stop:function(){co(this);return this},hide:function(a,b){return a&&this.visible()?cu(this,a,["out",b]):this.$super()},show:function(a,b){return a&&!this.visible()?cu(this,a,["in",b]):this.$super()},toggle:function(a,b){return a?cu(this,a,["toggle",b]):this.$super()},remove:function(a,b){return a&&this.visible()?cu(this,a,["out",s(b||{},{onFinish:this.$super.bind(this)})]):this.$super()},morph:function(a,b){return cu(this,"morph",[a,b||{}])},highlight:function(){return cu(this,"highlight",arguments)},fade:function(){return cu(this,"fade",arguments)},slide:function(){return cu(this,"slide",arguments)},scroll:function(a,b){return cu(this,"scroll",[a,b||{}])},scrollTo:function(a,b){return A(b)?this.scroll(a,b):this.$super.apply(this,arguments)}});var cv=["WebkitT","OT","MozT","MsT","t"].first(function(a){return a+"ransition"in o.style}),cw=cv+"ransition",cx=cw+"Property",cy=cw+"Duration",cz=cw+"TimingFunction",cA={Sin:"cubic-bezier(.3,0,.6,1)",Cos:"cubic-bezier(0,.3,.6,0)",Log:"cubic-bezier(0,.6,.3,.8)",Exp:"cubic-bezier(.6,0,.8,.3)",Lin:"cubic-bezier(0,0,1,1)"};cg.Options.engine=cv===i||bq?"javascript":"native",cg.Morph=new bc(cg,{prepare:function(a){if(this.options.engine==="native"&&cv!==i)this.render=this.transition=function(){},cB.call(this,a);else{var b=cE(a),c=cJ(this.element,b),d=cK(this.element,a,b);cI(this.element,c,d),this.before=cH(c),this.after=cH(d)}},render:function(a){var b,c,d,e=this.element._.style,f,g,i;for(f in this.after){b=this.before[f],c=this.after[f];for(g=0,i=c.length;g<i;g++)d=b[g]+(c[g]-b[g])*a,c.r&&(d=h.round(d)),c.t[g*2+1]=d;e[f]=c.t.join("")}}});var cC=H("Top Left Right Bottom");cg.Highlight=new bc(cg.Morph,{extend:{Options:c.merge(cg.Options,{color:"#FF8",transition:"Exp"})},prepare:function(a,b){var c=this.element,d=c._.style,e="backgroundColor",f=b||c.getStyle(e);cF(f)&&(this.onFinish(function(){d[e]="transparent"}),f=[c].concat(c.parents()).map("getStyle",e).reject(cF).compact().first()||"#FFF"),d[e]=a||this.options.color;return this.$super({backgroundColor:f})}}),cg.Twin=new bc(cg.Morph,{finish:function(){this.how==="out"&&bG.prototype.hide.call(this.element);return this.$super()},setHow:function(a){this.how=a||"toggle",this.how==="toggle"&&(this.how=this.element.visible()?"out":"in")}}),cg.Slide=new bc(cg.Twin,{extend:{Options:c.merge(cg.Options,{direction:"top"})},prepare:function(a){function f(){for(var a in e)d[a]=e[a]}this.setHow(a);var b=bG.prototype.show.call(this.element),d=b._.style,e=c.only(d,"overflow","width","height","marginTop","marginLeft");this.onFinish(f).onCancel(f),d.overflow="hidden";return this.$super(cL(d,b.size(),this.options.direction,this.how))}}),cg.Fade=new bc(cg.Twin,{prepare:function(a){this.setHow(a),this.how==="in"&&bG.prototype.show.call(this.element.setStyle({opacity:0}));return this.$super({opacity:this.how==="in"?1:0})}}),cg.Attr=new bc(cg,{prepare:function(a){this.before={},this.after=a;var b,c=this.element._;for(b in a)this.before[b]=c[b]},render:function(a){var b,c=this.element._,d=this.before;for(b in d)c[b]=d[b]+(this.after[b]-d[b])*a}}),cg.Scroll=new bc(cg.Attr,{initialize:function(a,b){a=E(a),this.$super(a instanceof bD?a._.document[bs.WebKit?"body":"documentElement"]:a,b)},prepare:function(a){var b={};"x"in a&&(b.scrollLeft=a.x),"y"in a&&(b.scrollTop=a.y),this.$super(b)}});var cM=j.Cookie=new bc({include:bj,extend:{set:function(a,b,c){return(new this(a,c)).set(b)},get:function(a,b){return(new this(a,b)).get()},remove:function(a,b){return(new this(a,b)).remove()},enabled:function(){b.cookie="__t=1";return b.cookie.indexOf("__t=1")!=-1},Options:{secure:!1,document:b}},initialize:function(a,b){this.name=a,this.setOptions(b)},set:function(a){y(a)||(a=JSON.stringify(a));var b=encodeURIComponent(a),c=this.options;c.domain&&(b+="; domain="+c.domain),c.path&&(b+="; path="+c.path);if(c.duration){var d=new Date;d.setTime(d.getTime()+c.duration*24*60*60*1e3),b+="; expires="+d.toGMTString()}c.secure&&(b+="; secure"),c.document.cookie=this.name+"="+b;return this},get:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+RegExp.escape(this.name)+"=([^;]*)");if(a){a=decodeURIComponent(a[1]);try{a=JSON.parse(a)}catch(b){}}return a||null},remove:function(){this.options.duration=-1;return this.set("")}});s(a,c.without(j,"version","modules"));return j}(window,document,Object,Array,String,Function,Number,Math);RightJS.Browser.OLD&&function(a){var b=a.createElement("script"),c=a.getElementsByTagName("script"),d=c[c.length-1];b.src=d.src.replace(/(^|\/)(right)([^\/]+)$/,"$1$2-olds$3"),d.parentNode.appendChild(b)}(document)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
ul.day_list
|
2
|
+
- @events.each do |day, evs|
|
3
|
+
li class=li_day_class(day)
|
4
|
+
center
|
5
|
+
| #{l day, :format => :short}
|
6
|
+
br
|
7
|
+
a#new_event_link href="/event/new/#{day.strftime('%Y%m%d')}" #{t 'create_event'}
|
8
|
+
.hidden_new_event_mask
|
9
|
+
== slim :new_event, :layout => false, :locals => {'start_date' => day.strftime("%Y%m%d")}
|
10
|
+
ul.event_list
|
11
|
+
- evs.each do |ev|
|
12
|
+
li#event_day
|
13
|
+
#event
|
14
|
+
#time
|
15
|
+
| #{ev.time_f day}
|
16
|
+
#summary
|
17
|
+
| #{ev.summary}
|
18
|
+
- if ev.location
|
19
|
+
| [#{ev.location}]
|
20
|
+
#hidden_description
|
21
|
+
| (#{ev.from_to_f})
|
22
|
+
br
|
23
|
+
| #{ev.description}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
doctype 5
|
2
|
+
html
|
3
|
+
head
|
4
|
+
title Kalindar
|
5
|
+
meta charset="utf-8"
|
6
|
+
script type="text/javascript" src="/right.js"
|
7
|
+
script type="text/javascript" src="/right-dialog.js"
|
8
|
+
script type="text/javascript" src="/kalindar.js"
|
9
|
+
link type="text/css" rel="stylesheet" href="/kalindar.css"
|
10
|
+
link type="text/css" rel="stylesheet" href="/pure.css"
|
11
|
+
body
|
12
|
+
==yield
|
@@ -0,0 +1,37 @@
|
|
1
|
+
form.pure-form.pure-form-stacked action="/event" method="post"
|
2
|
+
input type="hidden" name="_method" value="put"
|
3
|
+
fieldset
|
4
|
+
legend = t 'new_event'
|
5
|
+
|
6
|
+
- if !start_date.nil?
|
7
|
+
label for="start_day" = t 'start_date'
|
8
|
+
input type="text" readonly=true name="start_day" value="#{start_date}"
|
9
|
+
- else
|
10
|
+
label for="start_day" = t 'start_date'
|
11
|
+
input type="text" name="start_day" value="" placeholder="YYYYMMDD")
|
12
|
+
|
13
|
+
label for="start_time" = t 'when'
|
14
|
+
input type="text" name="start_time" value="" placeholder="HH:MM"
|
15
|
+
|
16
|
+
label for="start" = t 'summary'
|
17
|
+
input type="text" name="summary" placeholder="summary"
|
18
|
+
|
19
|
+
label for="location" = t 'location'
|
20
|
+
input type="text" name="location" placeholder="place"
|
21
|
+
|
22
|
+
label for="description" = t 'description'
|
23
|
+
textarea name="description" rows=3 width=40
|
24
|
+
|
25
|
+
label for="duration" = t 'duration'
|
26
|
+
select name="duration"
|
27
|
+
option value="15m" = t '15m'
|
28
|
+
option value="30m" = t '30m'
|
29
|
+
option value="60m" = t '60m'
|
30
|
+
option value="90m" = t '90m'
|
31
|
+
option value="120m" = t '120m'
|
32
|
+
option value="whole" = t 'whole_day'
|
33
|
+
option value="1d" = t '1d'
|
34
|
+
option value="2d" = t '2d'
|
35
|
+
option value="5d" = t '5d'
|
36
|
+
option value="1w" = t '1w'
|
37
|
+
button.pure-button type="submit" value="save" = t 'save'
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Kalindar do
|
4
|
+
it 'has a version number' do
|
5
|
+
expect(Kalindar::VERSION).not_to be nil
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
describe EventCalendar do
|
10
|
+
it 'parses an ics file' do
|
11
|
+
cal = EventCalendar.new 'spec/testcal.ics'
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'initializes alternatively with a list of ics files' do
|
15
|
+
cal = EventCalendar.new ['spec/testcal.ics', 'spec/testcal2.ics']
|
16
|
+
expect(cal.calendars.length).to eql 2
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'exposes filename of parsed calendar' do
|
20
|
+
cal = EventCalendar.new ['spec/testcal.ics', 'spec/testcal2.ics']
|
21
|
+
expect(cal.filename_of cal.calendars.first).to eql 'spec/testcal.ics'
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'finds events given date' do
|
25
|
+
cal = EventCalendar.new 'spec/testcal.ics'
|
26
|
+
events = cal.find_events (Date.new(2014, 07, 27))
|
27
|
+
event_names = events.map(&:summary)
|
28
|
+
expect(event_names.include? "onehour").to eq true
|
29
|
+
expect(event_names.include? "allday").to eq true
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'finds events that reocur' do
|
33
|
+
cal = EventCalendar.new 'spec/testcal.ics'
|
34
|
+
events = cal.find_events (Date.new(2014, 07, 27))
|
35
|
+
event_names = events.map(&:summary)
|
36
|
+
expect(event_names.include? "daily").to eq true
|
37
|
+
end
|
38
|
+
|
39
|
+
it '#events_in' do
|
40
|
+
cal = EventCalendar.new 'spec/testcal.ics'
|
41
|
+
events = cal.events_in(Date.new(2014, 07, 27), Date.new(2014, 07, 28))
|
42
|
+
event_names = events.map(&:summary)
|
43
|
+
expect(event_names).to eq ["allday", "onehour", "daily", "allday", "daily"]
|
44
|
+
end
|
45
|
+
|
46
|
+
it '#events_in by day' do
|
47
|
+
cal = EventCalendar.new 'spec/testcal.ics'
|
48
|
+
events = cal.events_in(Date.new(2014, 7, 27), Date.new(2014, 7, 28))
|
49
|
+
event_names = events.map(&:summary)
|
50
|
+
expect(event_names).to eq ["allday", "onehour", "daily", "allday", "daily"]
|
51
|
+
expect(event_names.class).to eq({}.class)
|
52
|
+
end
|
53
|
+
|
54
|
+
describe "Event" do
|
55
|
+
describe "#start_time_f" do
|
56
|
+
it "returns the time if given day is start day" do
|
57
|
+
cal = EventCalendar.new 'spec/testcal.ics'
|
58
|
+
events = cal.events_in(Date.new(2014, 8, 27), Date.new(2014, 8, 28))
|
59
|
+
expect(Event.new(events[0]).start_time_f Date.new(2014, 8, 27)).to eq "12:00"
|
60
|
+
expect(Event.new(events[0]).start_time_f Date.new(2014, 8, 28)).to eq ""
|
61
|
+
end
|
62
|
+
end
|
63
|
+
describe "#finish_time_f" do
|
64
|
+
it "returns the time if given day is end day" do
|
65
|
+
cal = EventCalendar.new 'spec/testcal.ics'
|
66
|
+
events = cal.events_in(Date.new(2014, 8, 27), Date.new(2014, 8, 28))
|
67
|
+
expect(Event.new(events[0]).finish_time_f Date.new(2014, 8, 27)).to eq ""
|
68
|
+
expect(Event.new(events[0]).finish_time_f Date.new(2014, 8, 28)).to eq "13:00"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
describe "#time_f" do
|
72
|
+
it "returns the from to time for given day" do
|
73
|
+
cal = EventCalendar.new 'spec/testcal.ics'
|
74
|
+
events = cal.events_in(Date.new(2014, 8, 27), Date.new(2014, 8, 28))
|
75
|
+
expect(Event.new(events[0]).time_f Date.new(2014, 8, 27)).to eq "12:00 - "
|
76
|
+
end
|
77
|
+
end
|
78
|
+
describe "#time_f" do
|
79
|
+
it "returns the from to time" do
|
80
|
+
cal = EventCalendar.new 'spec/testcal.ics'
|
81
|
+
events = cal.events_in(Date.new(2014, 8, 27), Date.new(2014, 8, 28))
|
82
|
+
expect(Event.new(events[0]).from_to_f).to eq "27.08. 12:00 - 28.08. 13:00"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
data/spec/spec_helper.rb
ADDED
data/spec/testcal.ics
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
BEGIN:VCALENDAR
|
2
|
+
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
|
3
|
+
VERSION:2.0
|
4
|
+
BEGIN:VTIMEZONE
|
5
|
+
TZID:Europe/Berlin
|
6
|
+
X-LIC-LOCATION:Europe/Berlin
|
7
|
+
BEGIN:DAYLIGHT
|
8
|
+
TZOFFSETFROM:+0100
|
9
|
+
TZOFFSETTO:+0200
|
10
|
+
TZNAME:CEST
|
11
|
+
DTSTART:19700329T020000
|
12
|
+
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
|
13
|
+
END:DAYLIGHT
|
14
|
+
BEGIN:STANDARD
|
15
|
+
TZOFFSETFROM:+0200
|
16
|
+
TZOFFSETTO:+0100
|
17
|
+
TZNAME:CET
|
18
|
+
DTSTART:19701025T030000
|
19
|
+
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
|
20
|
+
END:STANDARD
|
21
|
+
END:VTIMEZONE
|
22
|
+
BEGIN:VEVENT
|
23
|
+
CREATED:20140726T154946Z
|
24
|
+
LAST-MODIFIED:20140726T154956Z
|
25
|
+
DTSTAMP:20140726T154956Z
|
26
|
+
UID:cb523dc2-eab8-49c9-a99f-ed69ac3b65d0
|
27
|
+
SUMMARY:allday
|
28
|
+
DTSTART;VALUE=DATE:20140727
|
29
|
+
DTEND;VALUE=DATE:20140728
|
30
|
+
CLASS:PUBLIC
|
31
|
+
TRANSP:TRANSPARENT
|
32
|
+
DESCRIPTION:allday\n
|
33
|
+
END:VEVENT
|
34
|
+
BEGIN:VEVENT
|
35
|
+
CREATED:20140726T155032Z
|
36
|
+
LAST-MODIFIED:20140726T155043Z
|
37
|
+
DTSTAMP:20140726T155043Z
|
38
|
+
UID:72a8d584-31e2-4f85-a71f-391fca748d4f
|
39
|
+
SUMMARY:onehour
|
40
|
+
DTSTART;TZID=Europe/Berlin:20140727T091500
|
41
|
+
DTEND;TZID=Europe/Berlin:20140727T101500
|
42
|
+
CLASS:PUBLIC
|
43
|
+
TRANSP:OPAQUE
|
44
|
+
DESCRIPTION:onehour
|
45
|
+
END:VEVENT
|
46
|
+
BEGIN:VEVENT
|
47
|
+
CREATED:20140729T212951Z
|
48
|
+
LAST-MODIFIED:20140729T213024Z
|
49
|
+
DTSTAMP:20140729T213024Z
|
50
|
+
UID:aea8d217-8025-4d9b-88e6-3df9e6abd33c
|
51
|
+
SUMMARY:2days
|
52
|
+
DTSTART;TZID=Europe/Berlin:20140827T120000
|
53
|
+
DTEND;TZID=Europe/Berlin:20140828T130000
|
54
|
+
TRANSP:OPAQUE
|
55
|
+
CLASS:PUBLIC
|
56
|
+
END:VEVENT
|
57
|
+
BEGIN:VEVENT
|
58
|
+
CREATED:20140727T152843Z
|
59
|
+
LAST-MODIFIED:20140729T212856Z
|
60
|
+
DTSTAMP:20140729T212856Z
|
61
|
+
UID:d7844d09-75d9-4a8b-a1de-453fe63d6415
|
62
|
+
SUMMARY:daily
|
63
|
+
RRULE:FREQ=DAILY;UNTIL=20140806T094500Z
|
64
|
+
DTSTART;TZID=Europe/Berlin:20140727T114500
|
65
|
+
DTEND;TZID=Europe/Berlin:20140727T124500
|
66
|
+
CLASS:PUBLIC
|
67
|
+
TRANSP:OPAQUE
|
68
|
+
DESCRIPTION:daily
|
69
|
+
SEQUENCE:1
|
70
|
+
X-MOZ-GENERATION:1
|
71
|
+
END:VEVENT
|
72
|
+
END:VCALENDAR
|
metadata
ADDED
@@ -0,0 +1,176 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kalindar
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Felix Wolfsteller
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-07-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: ri_cal
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.8'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sinatra
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.4'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: slim
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: i18n
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.6'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.6'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.6'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.6'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: Web-Interface to ics files with sinatra
|
112
|
+
email:
|
113
|
+
- felix.wolfsteller@gmail.com
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- .gitignore
|
119
|
+
- .rspec
|
120
|
+
- .travis.yml
|
121
|
+
- Gemfile
|
122
|
+
- LICENSE.txt
|
123
|
+
- README.md
|
124
|
+
- Rakefile
|
125
|
+
- config.json
|
126
|
+
- config.ru
|
127
|
+
- kalindar.gemspec
|
128
|
+
- lib/kalindar.rb
|
129
|
+
- lib/kalindar/app.rb
|
130
|
+
- lib/kalindar/event.rb
|
131
|
+
- lib/kalindar/event_calendar.rb
|
132
|
+
- lib/kalindar/locales/de.yml
|
133
|
+
- lib/kalindar/locales/en.yml
|
134
|
+
- lib/kalindar/public/kalindar.css
|
135
|
+
- lib/kalindar/public/kalindar.js
|
136
|
+
- lib/kalindar/public/pure-min.css
|
137
|
+
- lib/kalindar/public/pure.css
|
138
|
+
- lib/kalindar/public/right-calendar.js
|
139
|
+
- lib/kalindar/public/right-dialog.js
|
140
|
+
- lib/kalindar/public/right.js
|
141
|
+
- lib/kalindar/version.rb
|
142
|
+
- lib/kalindar/views/.layout.haml.swp
|
143
|
+
- lib/kalindar/views/event_list.slim
|
144
|
+
- lib/kalindar/views/layout.slim
|
145
|
+
- lib/kalindar/views/new_event.slim
|
146
|
+
- spec/kalindar_spec.rb
|
147
|
+
- spec/spec_helper.rb
|
148
|
+
- spec/testcal.ics
|
149
|
+
homepage: ''
|
150
|
+
licenses:
|
151
|
+
- MIT
|
152
|
+
metadata: {}
|
153
|
+
post_install_message:
|
154
|
+
rdoc_options: []
|
155
|
+
require_paths:
|
156
|
+
- lib
|
157
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ! '>='
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ! '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
requirements: []
|
168
|
+
rubyforge_project:
|
169
|
+
rubygems_version: 2.2.2
|
170
|
+
signing_key:
|
171
|
+
specification_version: 4
|
172
|
+
summary: Web-Interface to ics files
|
173
|
+
test_files:
|
174
|
+
- spec/kalindar_spec.rb
|
175
|
+
- spec/spec_helper.rb
|
176
|
+
- spec/testcal.ics
|