right-rails 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/lib/right_rails/helpers/forms.rb +81 -47
- data/lib/right_rails/helpers.rb +9 -0
- data/public/javascripts/right/autocompleter-src.js +1 -1
- data/public/javascripts/right/autocompleter.js +1 -1
- data/public/javascripts/right/billboard-src.js +1 -1
- data/public/javascripts/right/billboard.js +1 -1
- data/public/javascripts/right/calendar-src.js +1 -1
- data/public/javascripts/right/calendar.js +1 -1
- data/public/javascripts/right/casting-src.js +183 -0
- data/public/javascripts/right/casting.js +7 -0
- data/public/javascripts/right/colorpicker-src.js +1 -1
- data/public/javascripts/right/colorpicker.js +1 -1
- data/public/javascripts/right/dialog-src.js +1 -1
- data/public/javascripts/right/dialog.js +1 -1
- data/public/javascripts/right/dnd-src.js +20 -20
- data/public/javascripts/right/dnd.js +2 -2
- data/public/javascripts/right/in-edit-src.js +1 -1
- data/public/javascripts/right/in-edit.js +1 -1
- data/public/javascripts/right/lightbox-src.js +24 -5
- data/public/javascripts/right/lightbox.js +2 -2
- data/public/javascripts/right/rails-src.js +1 -1
- data/public/javascripts/right/rails.js +1 -1
- data/public/javascripts/right/rater-src.js +1 -1
- data/public/javascripts/right/rater.js +1 -1
- data/public/javascripts/right/resizable-src.js +29 -3
- data/public/javascripts/right/resizable.js +2 -2
- data/public/javascripts/right/selectable-src.js +1 -1
- data/public/javascripts/right/selectable.js +1 -1
- data/public/javascripts/right/slider-src.js +5 -5
- data/public/javascripts/right/slider.js +2 -2
- data/public/javascripts/right/sortable-src.js +1 -1
- data/public/javascripts/right/sortable.js +1 -1
- data/public/javascripts/right/tabs-src.js +8 -6
- data/public/javascripts/right/tabs.js +2 -2
- data/public/javascripts/right/tags-src.js +745 -0
- data/public/javascripts/right/tags.js +7 -0
- data/public/javascripts/right/tooltips-src.js +1 -1
- data/public/javascripts/right/tooltips.js +1 -1
- data/public/javascripts/right/uploader-src.js +4 -3
- data/public/javascripts/right/uploader.js +2 -2
- data/public/javascripts/right-safe-src.js +2 -2
- data/public/javascripts/right-safe.js +2 -2
- data/public/javascripts/right-src.js +60 -47
- data/public/javascripts/right.js +2 -2
- data/spec/lib/right_rails/helpers/forms_spec.rb +67 -40
- metadata +10 -15
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
|
-
* RightJS-UI Lightbox v2.2.
|
2
|
+
* RightJS-UI Lightbox v2.2.3
|
3
3
|
* http://rightjs.org/ui/lightbox
|
4
4
|
*
|
5
5
|
* Copyright (C) 2009-2011 Nikolay Nemshilov
|
6
6
|
*/
|
7
|
-
var Lightbox=RightJS.Lightbox=function(a,b){function c(a,c){c||(c=a,a="DIV");var d=new b.Class(b.Element.Wrappers[a]||b.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof b.Input||this instanceof b.Form||e.unshift(a),this.$super.apply(this,e),b.isString(d)&&(d=b.$(d)),d instanceof b.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return b.Wrapper.Cache[b.$uid(this._)]=this},setOptions:function(a,c){c&&(a=b.Object.merge(a,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),a&&b.Options.setOptions.call(this,b.Object.merge(this.options,a));return this}}),e=new b.Class(d,c);b.Observer.createShortcuts(e.prototype,e.EVENTS||[]);return e}var d=new b.Class(b.Element,{initialize:function(a){this.$super("div",{"class":"rui-spinner"}),this.dots=[];for(var c=0;c<(a||4);c++)this.dots.push(new b.Element("div"));this.dots[0].addClass("glowing"),this.insert(this.dots),b(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=b,f=b.$,g=b.$$,h=b.$w,i=b.$E,j=b.$ext,k=b.Xhr,l=b.Class,m=b.Object,n=b.Element,o=b.Browser;o.IE6=o.OLD&&navigator.userAgent.indexOf("MSIE 6")>0;var p=new c({extend:{version:"2.2.2",EVENTS:h("show hide load"),Options:{fxName:"fade",fxDuration:300,group:null,hideOnEsc:!0,hideOnOutClick:!0,showCloseButton:!0,cssRule:"a[data-lightbox]",mediaWidth:425,mediaHeight:350},i18n:{Close:"Close",Prev:"Previous Image",Next:"Next Image"},Images:/\.(jpg|jpeg|gif|png|bmp)/i,Medias:[[/(http:\/\/.*?youtube\.[a-z]+)\/watch\?v=([^&]+)/i,"$1/v/$2","swf"],[/(http:\/\/video.google.com)\/videoplay\?docid=([^&]+)/i,"$1/googleplayer.swf?docId=$2","swf"],[/(http:\/\/vimeo\.[a-z]+)\/([0-9]+).*?/i,"$1/moogaloop.swf?clip_id=$2","swf"]]},initialize:function(a,b){this.$super("lightbox",{}).setOptions(a,b).insert([this.locker=new q(this.options),this.dialog=new r(this.options)]).on({close:this._close,next:this._next,prev:this._prev})},setOptions:function(a,b){this.$super(a,b);if(b){var c=b.get("rel");c&&(c=c.match(/lightbox\[(.+?)\]/))&&(this.options.group=c[1])}return this},setTitle:function(a){this.dialog.setTitle(a);return this},show:function(a){return this._showAnd(function(){this.dialog.show(a,!a)})},hide:function(){p.current=null;return this.$super(this.options.fxName,{duration:this.options.fxDuration/3,onFinish:e(function(){this.fire("hide"),this.remove()}).bind(this)})},load:function(a,b){return this._showAnd(function(){this.dialog.load(a,b)})},resize:function(a){this.dialog.resize(a);return this},_close:function(a){a.stop(),this.hide()},_prev:function(a){a.stop(),t.prev()},_next:function(a){a.stop(),t.next()},_showAnd:function(b){p.current!==this?(p.current=this,g("div.rui-lightbox").each("remove"),this.insertTo(a.body),this.dialog.show("",!0),o.OLD?(this.reposition(),n.prototype.show.call(this),b.call(this)):(this.setStyle("display:none"),n.prototype.show.call(this,this.options.fxName,{duration:this.options.fxDuration/2,onFinish:e(function(){b.call(this),this.fire("show")}).bind(this)}))):b.call(this);return this},reposition:function(){if(o.IE6){var a=f(window);this.setStyle({top:a.scrolls().y+"px",width:a.size().x+"px",height:a.size().y+"px",position:"absolute"})}}});p.extend({hide:function(){p.current&&p.current.hide()},show:function(){return this.inst("show",arguments)},load:function(){return this.inst("load",arguments)},inst:function(a,b){var c=new p;return c[a].apply(c,b)}});var q=new l(n,{initialize:function(a){this.$super("div",{"class":"rui-lightbox-locker"}),a.hideOnOutClick&&this.onClick("fire","close")}}),r=new l(n,{initialize:function(a){var b=p.i18n;this.options=a,this.$super("div",{"class":"rui-lightbox-dialog"}),this.insert([this.title=i("div",{"class":"rui-lightbox-title"}),i("div",{"class":"rui-lightbox-body"}).insert(i("div",{"class":"rui-lightbox-body-inner"}).insert([this.locker=i("div",{"class":"rui-lightbox-body-locker"}).insert(new d(4)),this.scroller=i("div",{"class":"rui-lightbox-scroller"}).insert(this.content=i("div",{"class":"rui-lightbox-content"}))])),i("div",{"class":"rui-lightbox-navigation"}).insert([this.closeButton=i("div",{"class":"close",html:"×",title:b.Close}).onClick("fire","close"),this.prevLink=i("div",{"class":"prev",html:"←",title:b.Prev}).onClick("fire","prev"),this.nextLink=i("div",{"class":"next",html:"→",title:b.Next}).onClick("fire","next")])]),this.prevLink.hide(),this.nextLink.hide(),a.showCloseButton||this.closeButton.hide()},setTitle:function(a){this.title.update(a||"")},resize:function(a,c){var d=this.parent().size(),f=this.scroller.size(),g=(d.y-this.size().y)/2,h=this.size().x-f.x;a?(a=this.scroller.setStyle(a).size(),this.scroller.setStyle({width:f.x+"px",height:f.y+"px"})):a=this.content.size();var i=100;a.x+i>d.x&&(a.x=d.x-i),a.y+i>d.y&&(a.y=d.y-i);var k=(g*2+f.y-a.y)/2,l=this._.style,m=this.scroller._.style;b.Fx&&c&&(a.x!=f.x||a.y!=f.y)?j(new b.Fx(this,{duration:this.options.fxDuration}),{render:function(b){m.width=f.x+(a.x-f.x)*b+"px",m.height=f.y+(a.y-f.y)*b+"px",l.top=g+(k-g)*b+"px",o.IE6&&(l.width=h+f.y+(a.y-f.y)*b+"px")}}).onFinish(e(this.unlock).bind(this)).start():(m.width=a.x+"px",m.height=a.y+"px",l.top=k+"px",o.IE6&&(l.width=h+a.x+"px"),this.request||this.unlock());return this},show:function(a,b){this.content.update(a||""),this.resize(null,!b)},load:function(a,b){a instanceof n&&(this.setTitle(a.get("title")),a=a.get("href")),t.show(this,a),this.lock().cancel(),this.request=new s(a,b,e(function(a,b){this.request=null,this.show(a,b)}).bind(this));return this.resize()},cancel:function(){this.request&&this.request.cancel();return this},lock:function(){this.locker.setStyle("opacity:1;display:block").insertTo(this.scroller,"before");return this},unlock:function(){this.locker.remove(e(this.content.html()).blank()?null:"fade",{duration:this.options.fxDuration*2/3});return this}}),s=new l({initialize:function(a,b,c){this.isImage(a,c)?p.current.addClass("rui-lightbox-image"):this.isMedia(a,c)?p.current.addClass("rui-lightbox-media"):this.xhr=(new k(a,m.merge({method:"get"},b))).onComplete(function(){c(this.text)}).send()},cancel:function(){this.xhr?this.xhr.cancel():this.img&&(this.img.onload=function(){})},isImage:function(a,b){if(a.match(p.Images)){var c=this.img=i("img")._;c.onload=function(){b(c)},c.src=a;return!0}},isMedia:function(a,b){var c=e(p.Medias).map(function(b){return a.match(b[0])?this.buildEmbed(a.replace(b[0],b[1]),b[2]):null},this).compact()[0];if(c){b(c,!0);return!0}},buildEmbed:function(a,b){var c={swf:["D27CDB6E-AE6D-11cf-96B8-444553540000","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0","application/x-shockwave-flash"]},d=p.current?p.current.options:p.Options,e=' width="'+d.mediaWidth+'" height="'+d.mediaHeight+'"';return'<object classid="clsid:'+c[b][0]+'" codebase="'+c[b][1]+'"'+e+'><param name="src" value="'+a+'" /><embed src="'+a+'" type="'+c[b][2]+'"'+e+" /></object>"}}),t={show:function(a,b){if(a.options.group){this.dialog=a,this.links=this.find(a.options.group),this.link=this.links.first(function(a){return a.get("href")===b});var c=this.links.indexOf(this.link),d=this.links.length;a.prevLink[d&&c>0?"show":"hide"](),a.nextLink[d&&c<d-1?"show":"hide"]()}else this.dialog=null},prev:function(){if(this.dialog&&!this.timer){var a=this.links.indexOf(this.link),b=this.links[a-1];b&&(this.dialog.load(b),this.timeout())}},next:function(){if(this.dialog&&!this.timer){var a=this.links.indexOf(this.link),b=this.links[a+1];b&&(this.dialog.load(b),this.timeout())}},find:function(a){return g("a").filter(function(b){var c=b.get("data-lightbox"),d=b.get("rel");return c&&(new Function("return "+c))().group===a||d&&d.indexOf("lightbox["+a+"]")>-1})},timeout:function(){this.timer=e(function(){t.timer=null}).delay(300)}};f(a).on({click:function(a){var b=a.find(p.Options.cssRule)||a.find("a[rel^=lightbox]"),c=a._;b&&!(c.shiftKey||c.altKey||c.ctrlKey||c.metaKey)&&(a.stop(),(new p({},b)).load(b))},mousewheel:function(a){if(p.current){var b=a.target,c=b.parent("div.rui-lightbox-content");(!c||b.getStyle("overflow")==="visible")&&a.stop(),p.current.fire((a._.detail||-a._.wheelDelta)<0?"prev":"next")}},keydown:function(a){var b=p.current,c=({27:"close",33:"prev",37:"prev",38:"prev",39:"next",40:"next",34:"next"})[a.keyCode];if(b&&c)if(c!=="close"||b.options.hideOnEsc)a.stop(),b.fire(c)}}),f(window).on({resize:function(){p.current&&(p.current.reposition(),p.current.dialog.resize())},scroll:function(a){p.current&&o.IE6&&p.current.reposition()}});var u=a.createElement("style"),v=a.createTextNode("div.rui-spinner,div.rui-spinner div{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none;display:inline-block; *display:inline; *zoom:1;border-radius:.12em;-moz-border-radius:.12em;-webkit-border-radius:.12em}div.rui-spinner{text-align:center;white-space:nowrap;background:#EEE;border:1px solid #DDD;height:1.2em;padding:0 .2em}div.rui-spinner div{width:.4em;height:70%;background:#BBB;margin-left:1px}div.rui-spinner div:first-child{margin-left:0}div.rui-spinner div.glowing{background:#777}div.rui-lightbox{position:fixed;top:0;left:0;float:none;width:100%;height:100%;margin:0;padding:0;background:none;border:none;text-align:center;z-index:9999;z-index/*\\**/:auto\\9}div.rui-lightbox-locker{position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#000;opacity:0.8;filter:alpha(opacity=80);cursor:default;z-index/*\\**/:9990\\9}div.rui-lightbox-dialog{display:inline-block; *display:inline; *zoom:1;position:relative;text-align:left;z-index/*\\**/:9999\\9}div.rui-lightbox-title{height:1.2em;margin-bottom:.1em;white-space:nowrap;color:#DDD;font-weight:bold;font-size:1.6em;font-family:Helvetica}div.rui-lightbox-body{background-color:#FFF;padding:1em;border-radius:.5em;-moz-border-radius:.5em;-webkit-border-radius:.5em}div.rui-lightbox-body-inner{position:relative}div.rui-lightbox-scroller{overflow:hidden}div.rui-lightbox-content{display:inline-block; *display:inline; *zoom:1;min-height:10em;min-width:10em;_height:10em;_width:10em}div.rui-lightbox-body-locker{background-color:white;position:absolute;left:0px;top:0px;width:100%;height:100%;opacity:0;filter:alpha(opacity=0)}div.rui-lightbox-body-locker div.rui-spinner{position:absolute;right:0;bottom:0;border:none;background:none;font-size:150%}div.rui-lightbox-navigation{color:#888;font-size:160%;font-family:Arial;height:1em;user-select:none;-moz-user-select:none;-webkit-user-select:none}div.rui-lightbox-navigation div{cursor:pointer;position:absolute}div.rui-lightbox-navigation div:hover{color:white}div.rui-lightbox-navigation div.next{left:2em}div.rui-lightbox-navigation div.close{right:0}div.rui-lightbox-image div.rui-lightbox-body,div.rui-lightbox-media div.rui-lightbox-body{padding:0;border:1px solid #777;border-radius:0px;-moz-border-radius:0px;-webkit-border-radius:0px}div.rui-lightbox-image div.rui-lightbox-content,div.rui-lightbox-media div.rui-lightbox-content{min-height:12em;min-width:12em;_height:12em;_width:12em}div.rui-lightbox-image div.rui-lightbox-content img{vertical-align:middle}div.rui-lightbox-image div.rui-lightbox-body,div.rui-lightbox-image div.rui-lightbox-body-locker,div.rui-lightbox-media div.rui-lightbox-body,div.rui-lightbox-media div.rui-lightbox-body-locker{background-color:#D8D8D8}div.rui-lightbox-image div.rui-lightbox-body-locker div.rui-spinner,div.rui-lightbox-media div.rui-lightbox-body-locker div.rui-spinner{bottom:.5em;right:.5em}");u.type="text/css",a.getElementsByTagName("head")[0].appendChild(u),u.styleSheet?u.styleSheet.cssText=v.nodeValue:u.appendChild(v);return p}(document,RightJS)
|
7
|
+
var Lightbox=RightJS.Lightbox=function(a,b){function c(a,c){c||(c=a,a="DIV");var d=new b.Class(b.Element.Wrappers[a]||b.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof b.Input||this instanceof b.Form||e.unshift(a),this.$super.apply(this,e),b.isString(d)&&(d=b.$(d)),d instanceof b.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return b.Wrapper.Cache[b.$uid(this._)]=this},setOptions:function(a,c){c&&(a=b.Object.merge(a,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),a&&b.Options.setOptions.call(this,b.Object.merge(this.options,a));return this}}),e=new b.Class(d,c);b.Observer.createShortcuts(e.prototype,e.EVENTS||b([]));return e}var d=new b.Class(b.Element,{initialize:function(a){this.$super("div",{"class":"rui-spinner"}),this.dots=[];for(var c=0;c<(a||4);c++)this.dots.push(new b.Element("div"));this.dots[0].addClass("glowing"),this.insert(this.dots),b(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=b,f=b.$,g=b.$$,h=b.$w,i=b.$E,j=b.$ext,k=b.Xhr,l=b.Class,m=b.Object,n=b.Element,o=b.Browser;o.IE6=o.OLD&&navigator.userAgent.indexOf("MSIE 6")>0;var p=new c({extend:{version:"2.2.3",EVENTS:h("show hide load"),Options:{fxName:"fade",fxDuration:300,group:null,hideOnEsc:!0,hideOnOutClick:!0,showCloseButton:!0,cssRule:"a[data-lightbox]",mediaWidth:425,mediaHeight:350},i18n:{Close:"Close",Prev:"Previous Image",Next:"Next Image"},Images:/\.(jpg|jpeg|gif|png|bmp)/i,Medias:[[/(http:\/\/.*?youtube\.[a-z]+)\/watch\?v=([^&]+)/i,"$1/v/$2","swf"],[/(http:\/\/video.google.com)\/videoplay\?docid=([^&]+)/i,"$1/googleplayer.swf?docId=$2","swf"],[/(http:\/\/vimeo\.[a-z]+)\/([0-9]+).*?/i,"$1/moogaloop.swf?clip_id=$2","swf"]]},initialize:function(a,b){this.$super("lightbox",{}).setOptions(a,b).insert([this.locker=new q(this.options),this.dialog=new r(this.options)]).on({close:this._close,next:this._next,prev:this._prev})},setOptions:function(a,b){this.$super(a,b);if(b){var c=b.get("rel");c&&(c=c.match(/lightbox\[(.+?)\]/))&&(this.options.group=c[1])}return this},setTitle:function(a){this.dialog.setTitle(a);return this},show:function(a){return this._showAnd(function(){this.dialog.show(a,!a)})},hide:function(){p.current=null;return this.$super(this.options.fxName,{duration:this.options.fxDuration/3,onFinish:e(function(){this.fire("hide"),this.remove()}).bind(this)})},load:function(a,b){return this._showAnd(function(){this.dialog.load(a,b)})},resize:function(a){this.dialog.resize(a);return this},_close:function(a){a.stop(),this.hide()},_prev:function(a){a.stop(),t.prev()},_next:function(a){a.stop(),t.next()},_showAnd:function(b){p.current!==this?(p.current=this,g("div.rui-lightbox").each("remove"),this.insertTo(a.body),this.dialog.show("",!0),o.OLD?(this.reposition(),n.prototype.show.call(this),b.call(this)):(this.setStyle("display:none"),n.prototype.show.call(this,this.options.fxName,{duration:this.options.fxDuration/2,onFinish:e(function(){b.call(this),this.fire("show")}).bind(this)}))):b.call(this);return this},reposition:function(){if(o.IE6){var a=f(window);this.setStyle({top:a.scrolls().y+"px",width:a.size().x+"px",height:a.size().y+"px",position:"absolute"})}}});p.extend({hide:function(){p.current&&p.current.hide()},show:function(){return this.inst("show",arguments)},load:function(){return this.inst("load",arguments)},inst:function(a,b){var c=new p;return c[a].apply(c,b)}});var q=new l(n,{initialize:function(a){this.$super("div",{"class":"rui-lightbox-locker"}),a.hideOnOutClick&&this.onClick("fire","close")}}),r=new l(n,{initialize:function(a){var b=p.i18n;this.options=a,this.$super("div",{"class":"rui-lightbox-dialog"}),this.insert([this.title=i("div",{"class":"rui-lightbox-title"}),i("div",{"class":"rui-lightbox-body"}).insert(i("div",{"class":"rui-lightbox-body-inner"}).insert([this.locker=i("div",{"class":"rui-lightbox-body-locker"}).insert(new d(4)),this.scroller=i("div",{"class":"rui-lightbox-scroller"}).insert(this.content=i("div",{"class":"rui-lightbox-content"}))])),i("div",{"class":"rui-lightbox-navigation"}).insert([this.closeButton=i("div",{"class":"close",html:"×",title:b.Close}).onClick("fire","close"),this.prevLink=i("div",{"class":"prev",html:"←",title:b.Prev}).onClick("fire","prev"),this.nextLink=i("div",{"class":"next",html:"→",title:b.Next}).onClick("fire","next")])]),this.prevLink.hide(),this.nextLink.hide(),a.showCloseButton||this.closeButton.hide()},setTitle:function(a){this.title.update(a||"")},resize:function(a,c){var d=this.parent().size(),f=this.scroller.size(),g=(d.y-this.size().y)/2,h=this.size().x-f.x;a?(a=this.scroller.setStyle(a).size(),this.scroller.setStyle({width:f.x+"px",height:f.y+"px"})):a=this.content.size();var i=100;/^<img [^>]+>/img.test(this.content.html())?(e([["x","y"],["y","x"]]).each(function(b){var c=b[0],e=b[1],f=a[c];a[c]+i>d[c]&&(a[c]=d[c]-i,a[e]=Math.floor(a[e]*a[c]/f))}),this.content.first("img").setStyle({width:a.x+"px",height:a.y+"px"})):(a.x+i>d.x&&(a.x=d.x-i),a.y+i>d.y&&(a.y=d.y-i));var k=(g*2+f.y-a.y)/2,l=this._.style,m=this.scroller._.style;b.Fx&&c&&(a.x!=f.x||a.y!=f.y)?j(new b.Fx(this,{duration:this.options.fxDuration}),{render:function(b){m.width=f.x+(a.x-f.x)*b+"px",m.height=f.y+(a.y-f.y)*b+"px",l.top=g+(k-g)*b+"px",o.IE6&&(l.width=h+f.y+(a.y-f.y)*b+"px")}}).onFinish(e(this.unlock).bind(this)).start():(m.width=a.x+"px",m.height=a.y+"px",l.top=k+"px",o.IE6&&(l.width=h+a.x+"px"),this.request||this.unlock());return this},show:function(a,b){this.content.update(a||""),this.resize(null,!b)},load:function(a,b){a instanceof n&&(this.setTitle(a.get("title")),a=a.get("href")),t.show(this,a),this.lock().cancel(),this.request=new s(a,b,e(function(a,b){this.request=null,this.show(a,b)}).bind(this));return this.resize()},cancel:function(){this.request&&this.request.cancel();return this},lock:function(){this.locker.setStyle("opacity:1;display:block").insertTo(this.scroller,"before");return this},unlock:function(){this.locker.remove(e(this.content.html()).blank()?null:"fade",{duration:this.options.fxDuration*2/3});return this}}),s=new l({initialize:function(a,b,c){this.isImage(a,c)?p.current.addClass("rui-lightbox-image"):this.isMedia(a,c)?p.current.addClass("rui-lightbox-media"):this.xhr=(new k(a,m.merge({method:"get"},b))).onComplete(function(){c(this.text)}).send()},cancel:function(){this.xhr?this.xhr.cancel():this.img&&(this.img.onload=function(){})},isImage:function(a,b){if(a.match(p.Images)){var c=this.img=i("img")._;c.onload=function(){b(c)},c.src=a;return!0}},isMedia:function(a,b){var c=e(p.Medias).map(function(b){return a.match(b[0])?this.buildEmbed(a.replace(b[0],b[1]),b[2]):null},this).compact()[0];if(c){b(c,!0);return!0}},buildEmbed:function(a,b){var c={swf:["D27CDB6E-AE6D-11cf-96B8-444553540000","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0","application/x-shockwave-flash"]},d=p.current?p.current.options:p.Options,e=' width="'+d.mediaWidth+'" height="'+d.mediaHeight+'"';return'<object classid="clsid:'+c[b][0]+'" codebase="'+c[b][1]+'"'+e+'><param name="src" value="'+a+'" /><embed src="'+a+'" type="'+c[b][2]+'"'+e+" /></object>"}}),t={show:function(a,b){if(a.options.group){this.dialog=a,this.links=this.find(a.options.group),this.link=this.links.first(function(a){return a.get("href")===b});var c=this.links.indexOf(this.link),d=this.links.length;a.prevLink[d&&c>0?"show":"hide"](),a.nextLink[d&&c<d-1?"show":"hide"]()}else this.dialog=null},prev:function(){if(this.dialog&&!this.timer){var a=this.links.indexOf(this.link),b=this.links[a-1];b&&(this.dialog.load(b),this.timeout())}},next:function(){if(this.dialog&&!this.timer){var a=this.links.indexOf(this.link),b=this.links[a+1];b&&(this.dialog.load(b),this.timeout())}},find:function(a){return g("a").filter(function(b){var c=b.get("data-lightbox"),d=b.get("rel");return c&&(new Function("return "+c))().group===a||d&&d.indexOf("lightbox["+a+"]")>-1})},timeout:function(){this.timer=e(function(){t.timer=null}).delay(300)}};f(a).on({click:function(a){var b=a.find(p.Options.cssRule)||a.find("a[rel^=lightbox]"),c=a._;b&&!(c.shiftKey||c.altKey||c.ctrlKey||c.metaKey)&&(a.stop(),(new p({},b)).load(b))},mousewheel:function(a){if(p.current){var b=a.target,c=b.parent("div.rui-lightbox-content");(!c||b.getStyle("overflow")==="visible")&&a.stop(),p.current.fire((a._.detail||-a._.wheelDelta)<0?"prev":"next")}},keydown:function(a){var b=p.current,c=({27:"close",33:"prev",37:"prev",38:"prev",39:"next",40:"next",34:"next"})[a.keyCode];if(b&&c)if(c!=="close"||b.options.hideOnEsc)a.stop(),b.fire(c)}}),f(window).on({resize:function(){p.current&&(p.current.reposition(),p.current.dialog.resize())},scroll:function(a){p.current&&o.IE6&&p.current.reposition()}});var u=a.createElement("style"),v=a.createTextNode("div.rui-spinner,div.rui-spinner div{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none;display:inline-block; *display:inline; *zoom:1;border-radius:.12em;-moz-border-radius:.12em;-webkit-border-radius:.12em}div.rui-spinner{text-align:center;white-space:nowrap;background:#EEE;border:1px solid #DDD;height:1.2em;padding:0 .2em}div.rui-spinner div{width:.4em;height:70%;background:#BBB;margin-left:1px}div.rui-spinner div:first-child{margin-left:0}div.rui-spinner div.glowing{background:#777}div.rui-lightbox{position:fixed;top:0;left:0;float:none;width:100%;height:100%;margin:0;padding:0;background:none;border:none;text-align:center;z-index:9999;z-index/*\\**/:auto\\9}div.rui-lightbox-locker{position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#000;opacity:0.8;filter:alpha(opacity=80);cursor:default;z-index/*\\**/:9990\\9}div.rui-lightbox-dialog{display:inline-block; *display:inline; *zoom:1;position:relative;text-align:left;z-index/*\\**/:9999\\9}div.rui-lightbox-title{height:1.2em;margin-bottom:.1em;white-space:nowrap;color:#DDD;font-weight:bold;font-size:1.6em;font-family:Helvetica}div.rui-lightbox-body{background-color:#FFF;padding:1em;border-radius:.5em;-moz-border-radius:.5em;-webkit-border-radius:.5em}div.rui-lightbox-body-inner{position:relative}div.rui-lightbox-scroller{overflow:hidden}div.rui-lightbox-content{display:inline-block; *display:inline; *zoom:1;min-height:10em;min-width:10em;_height:10em;_width:10em}div.rui-lightbox-body-locker{background-color:white;position:absolute;left:0px;top:0px;width:100%;height:100%;opacity:0;filter:alpha(opacity=0)}div.rui-lightbox-body-locker div.rui-spinner{position:absolute;right:0;bottom:0;border:none;background:none;font-size:150%}div.rui-lightbox-navigation{color:#888;font-size:160%;font-family:Arial;height:1em;user-select:none;-moz-user-select:none;-webkit-user-select:none}div.rui-lightbox-navigation div{cursor:pointer;position:absolute}div.rui-lightbox-navigation div:hover{color:white}div.rui-lightbox-navigation div.next{left:2em}div.rui-lightbox-navigation div.close{right:0}div.rui-lightbox-image div.rui-lightbox-body,div.rui-lightbox-media div.rui-lightbox-body{padding:0;border:1px solid #777;border-radius:0px;-moz-border-radius:0px;-webkit-border-radius:0px}div.rui-lightbox-image div.rui-lightbox-content,div.rui-lightbox-media div.rui-lightbox-content{min-height:12em;min-width:12em;_height:12em;_width:12em}div.rui-lightbox-image div.rui-lightbox-content img{vertical-align:middle}div.rui-lightbox-image div.rui-lightbox-body,div.rui-lightbox-image div.rui-lightbox-body-locker,div.rui-lightbox-media div.rui-lightbox-body,div.rui-lightbox-media div.rui-lightbox-body-locker{background-color:#D8D8D8}div.rui-lightbox-image div.rui-lightbox-body-locker div.rui-spinner,div.rui-lightbox-media div.rui-lightbox-body-locker div.rui-spinner{bottom:.5em;right:.5em}");u.type="text/css",a.getElementsByTagName("head")[0].appendChild(u),u.styleSheet?u.styleSheet.cssText=v.nodeValue:u.appendChild(v);return p}(document,RightJS)
|
@@ -369,7 +369,7 @@ var RR = {
|
|
369
369
|
* @return RR this
|
370
370
|
*/
|
371
371
|
rescan: function(scope) {
|
372
|
-
$w('Draggable Droppable Tabs Slider Selectable').each(function(name) {
|
372
|
+
$w('Draggable Droppable Tabs Tags Slider Selectable').each(function(name) {
|
373
373
|
if (name in window) {
|
374
374
|
window[name].rescan(this.Options.rescanWithScopes ? scope : null);
|
375
375
|
}
|
@@ -4,4 +4,4 @@
|
|
4
4
|
*
|
5
5
|
* Copyright (C) 2009-2011 Nikolay Nemshilov
|
6
6
|
*/
|
7
|
-
(function(a,b,c){var d=c,e=c.$,f=c.$$,g=c.$E,h=c.Xhr,i=c.Object;c.Rails={version:"2.2.1"},d([c.String.prototype,c.Array.prototype,c.Function.prototype,c.Object,c.Options,c.Observer,c.Observer.prototype,a,b]).each(function(a){for(var b in a)try{if(/[A-Z]/.test(b)&&typeof a[b]==="function"){var c=d(b).underscored();if(a[c]===null||a[c]===undefined)a[c]=a[b]}}catch(e){}}),d([c.Element,c.Event,c.Form,c.Input]).each(function(a){if(a){var b={},c=a.prototype;for(var e in c)/[A-Z]/.test(e)&&typeof c[e]==="function"&&(a.prototype[d(e).underscored()]=c[e])}}),c.$alias(c.String.prototype,{index_of:"indexOf",last_index_of:"lastIndexOf",to_f:"toFloat",to_i:"toInt",gsub:"replace",downcase:"toLowerCase",upcase:"toUpperCase",index:"indexOf",rindex:"lastIndexOf",strip:"trim"}),c.$alias(c.Array.prototype,{collect:"map",detect:"filter",index_of:"indexOf",last_index_of:"lastIndexOf",index:"indexOf",rindex:"lastIndexOf"});var j=function(a,b){var c=b.get("data-confirm");if(c&&!confirm(c)){a.stop();return!0}},k=function(a,b){return i.merge({onCreate:function(){a.fire("ajax:loading",{xhr:this})},onComplete:function(){a.fire("ajax:complete",{xhr:this})},onSuccess:function(){a.fire("ajax:success",{xhr:this})},onFailure:function(){a.fire("ajax:failure",{xhr:this})}},b)},l=function(a){var c=a.target,d=c.get("data-method"),e=c.get("data-remote"),i=c.get("href");if(!j(a,c)){(d||e)&&a.stop();if(e)h.load(i,k(c,{method:d||"get",spinner:c.get("data-spinner")}));else if(d){var l=f("meta[name=csrf-param]")[0],m=f("meta[name=csrf-token]")[0],n=g("form",{action:i,method:"post"});l&&m&&n.insert('<input type="hidden" name="'+l.get("content")+'" value="'+m.get("content")+'" />'),n.insert('<input type="hidden" name="_method" value="'+d+'"/>').insertTo(b.body).submit()}}};e(b).on({click:function(a){var b=a.target._.tagName;(b==="A"||b==="BUTTON")&&l(a)},submit:function(a){var b=a.target;b.has("data-remote")&&!j(a,b)&&(a.stop(),b.send(k(b,{spinner:b.get("data-spinner")||b.first(".spinner")})))}});var m={Options:{format:"js",flashId:"flashes",flashHideFx:"slide",flashHideDelay:3200,highlightUpdates:!0,removeFx:"fade",insertFx:"fade",insertPosition:"bottom",linkToAjaxEdit:".ajax_edit",linkToAjaxDelete:".ajax_delete",rescanWithScopes:!0},update_flash:function(a){var b=e(this.Options.flashId);b&&this.replace(b,a).hide_flash();return this},hide_flash:function(){if(this.Options.flashHideDelay>-1){var a=e(this.Options.flashId);a&&a.visible()&&a.hide.bind(a,this.Options.flashHideFx).delay(this.Options.flashHideDelay)}return this},highlight:function(a){e(a)&&this.Options.highlightUpdates&&e(a).highlight();return this},insert:function(a,b,c){var d=c||this.Options.insertPosition,f,g=e(a).insert(b,d);switch(d){case"bottom":f=g.children().last();break;case"top":f=g.first();break;case"before":f=g.prev();break;case"after":f=g.next()}f&&this.Options.insertFx?f.hide().show(this.Options.insertFx,{onFinish:this.highlight.bind(this,f)}):this.highlight(f);return this.rescan(a)},replace:function(a,b){e(a).replace(b);return this.highlight(a).rescan(a)},remove:function(a){e(a)&&e(a).remove(this.Options.removeFx)},remotize_form:function(a){var b=e(a);b&&(b.remotize().enable()._.action+="."+this.Options.format);return this},replace_form:function(a,b){var c=e(a);c&&(c.replace(b),this.remotize_form(a));return this.rescan(a)},show_form_for:function(a,b){e(a).find("form").each("remove"),e(a).insert(b);return this.remotize_form(e(a).first("form")).rescan(a)},process_click:function(a){var b;(b=a.find("a"+this.Options.linkToAjaxEdit))?(a.stop(),h.load(b.get("href")+"."+this.Options.format)):(b=a.find("a"+this.Options.linkToAjaxDelete))&&b.has("onclick")&&(a.stop(),(new Function("return "+b.onclick.toString().replace(".submit",".send")))().call(b))},rescan:function(b){$w("Draggable Droppable Tabs Slider Selectable").each(function(c){c in a&&a[c].rescan(this.Options.rescanWithScopes?b:null)},this);return this}};e(b).on({ready:function(){m.hide_flash()},click:function(a){m.process_click(a)}}),a.RR=m})(window,document,RightJS)
|
7
|
+
(function(a,b,c){var d=c,e=c.$,f=c.$$,g=c.$E,h=c.Xhr,i=c.Object;c.Rails={version:"2.2.1"},d([c.String.prototype,c.Array.prototype,c.Function.prototype,c.Object,c.Options,c.Observer,c.Observer.prototype,a,b]).each(function(a){for(var b in a)try{if(/[A-Z]/.test(b)&&typeof a[b]==="function"){var c=d(b).underscored();if(a[c]===null||a[c]===undefined)a[c]=a[b]}}catch(e){}}),d([c.Element,c.Event,c.Form,c.Input]).each(function(a){if(a){var b={},c=a.prototype;for(var e in c)/[A-Z]/.test(e)&&typeof c[e]==="function"&&(a.prototype[d(e).underscored()]=c[e])}}),c.$alias(c.String.prototype,{index_of:"indexOf",last_index_of:"lastIndexOf",to_f:"toFloat",to_i:"toInt",gsub:"replace",downcase:"toLowerCase",upcase:"toUpperCase",index:"indexOf",rindex:"lastIndexOf",strip:"trim"}),c.$alias(c.Array.prototype,{collect:"map",detect:"filter",index_of:"indexOf",last_index_of:"lastIndexOf",index:"indexOf",rindex:"lastIndexOf"});var j=function(a,b){var c=b.get("data-confirm");if(c&&!confirm(c)){a.stop();return!0}},k=function(a,b){return i.merge({onCreate:function(){a.fire("ajax:loading",{xhr:this})},onComplete:function(){a.fire("ajax:complete",{xhr:this})},onSuccess:function(){a.fire("ajax:success",{xhr:this})},onFailure:function(){a.fire("ajax:failure",{xhr:this})}},b)},l=function(a){var c=a.target,d=c.get("data-method"),e=c.get("data-remote"),i=c.get("href");if(!j(a,c)){(d||e)&&a.stop();if(e)h.load(i,k(c,{method:d||"get",spinner:c.get("data-spinner")}));else if(d){var l=f("meta[name=csrf-param]")[0],m=f("meta[name=csrf-token]")[0],n=g("form",{action:i,method:"post"});l&&m&&n.insert('<input type="hidden" name="'+l.get("content")+'" value="'+m.get("content")+'" />'),n.insert('<input type="hidden" name="_method" value="'+d+'"/>').insertTo(b.body).submit()}}};e(b).on({click:function(a){var b=a.target._.tagName;(b==="A"||b==="BUTTON")&&l(a)},submit:function(a){var b=a.target;b.has("data-remote")&&!j(a,b)&&(a.stop(),b.send(k(b,{spinner:b.get("data-spinner")||b.first(".spinner")})))}});var m={Options:{format:"js",flashId:"flashes",flashHideFx:"slide",flashHideDelay:3200,highlightUpdates:!0,removeFx:"fade",insertFx:"fade",insertPosition:"bottom",linkToAjaxEdit:".ajax_edit",linkToAjaxDelete:".ajax_delete",rescanWithScopes:!0},update_flash:function(a){var b=e(this.Options.flashId);b&&this.replace(b,a).hide_flash();return this},hide_flash:function(){if(this.Options.flashHideDelay>-1){var a=e(this.Options.flashId);a&&a.visible()&&a.hide.bind(a,this.Options.flashHideFx).delay(this.Options.flashHideDelay)}return this},highlight:function(a){e(a)&&this.Options.highlightUpdates&&e(a).highlight();return this},insert:function(a,b,c){var d=c||this.Options.insertPosition,f,g=e(a).insert(b,d);switch(d){case"bottom":f=g.children().last();break;case"top":f=g.first();break;case"before":f=g.prev();break;case"after":f=g.next()}f&&this.Options.insertFx?f.hide().show(this.Options.insertFx,{onFinish:this.highlight.bind(this,f)}):this.highlight(f);return this.rescan(a)},replace:function(a,b){e(a).replace(b);return this.highlight(a).rescan(a)},remove:function(a){e(a)&&e(a).remove(this.Options.removeFx)},remotize_form:function(a){var b=e(a);b&&(b.remotize().enable()._.action+="."+this.Options.format);return this},replace_form:function(a,b){var c=e(a);c&&(c.replace(b),this.remotize_form(a));return this.rescan(a)},show_form_for:function(a,b){e(a).find("form").each("remove"),e(a).insert(b);return this.remotize_form(e(a).first("form")).rescan(a)},process_click:function(a){var b;(b=a.find("a"+this.Options.linkToAjaxEdit))?(a.stop(),h.load(b.get("href")+"."+this.Options.format)):(b=a.find("a"+this.Options.linkToAjaxDelete))&&b.has("onclick")&&(a.stop(),(new Function("return "+b.onclick.toString().replace(".submit",".send")))().call(b))},rescan:function(b){$w("Draggable Droppable Tabs Tags Slider Selectable").each(function(c){c in a&&a[c].rescan(this.Options.rescanWithScopes?b:null)},this);return this}};e(b).on({ready:function(){m.hide_flash()},click:function(a){m.process_click(a)}}),a.RR=m})(window,document,RightJS)
|
@@ -98,7 +98,7 @@ function Widget(tag_name, methods) {
|
|
98
98
|
var Klass = new RightJS.Class(AbstractWidget, methods);
|
99
99
|
|
100
100
|
// creating the widget related shortcuts
|
101
|
-
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || []);
|
101
|
+
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || RightJS([]));
|
102
102
|
|
103
103
|
return Klass;
|
104
104
|
}
|
@@ -4,4 +4,4 @@
|
|
4
4
|
*
|
5
5
|
* Copyright (C) 2009-2011 Nikolay Nemshilov
|
6
6
|
*/
|
7
|
-
var Rater=RightJS.Rater=function(a,b){function c(a,c){c||(c=a,a="DIV");var d=new b.Class(b.Element.Wrappers[a]||b.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof b.Input||this instanceof b.Form||e.unshift(a),this.$super.apply(this,e),b.isString(d)&&(d=b.$(d)),d instanceof b.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return b.Wrapper.Cache[b.$uid(this._)]=this},setOptions:function(a,c){c&&(a=b.Object.merge(a,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),a&&b.Options.setOptions.call(this,b.Object.merge(this.options,a));return this}}),e=new b.Class(d,c);b.Observer.createShortcuts(e.prototype,e.EVENTS||[]);return e}var d={assignTo:function(b){var c=e(function(a,b){(a=f(a))&&a[a.setValue?"setValue":"update"](b.target.getValue())}).curry(b),d=e(function(a,b){a=f(a),a&&a.onChange&&a.onChange(e(function(){this.setValue(a.value())}).bind(b))}).curry(b);f(b)?(c({target:this}),d(this)):f(a).onReady(e(function(){c({target:this}),d(this)}.bind(this)));return this.onChange(c)}},e=b,f=b.$,g=b.$w,h=b.Xhr,i=b.isString,j=b.isNumber,k=new c({include:d,extend:{version:"2.2.0",EVENTS:g("change hover send"),Options:{html:"★",size:5,value:null,update:null,disabled:!1,disableOnVote:!1,url:null,param:"rate",Xhr:null}},initialize:function(a){this.$super("rater",a).on({click:this._clicked,mouseover:this._hovered,mouseout:this._left});if(this.empty())for(var b=0;b<this.options.size;b++)this.insert("<div>"+this.options.html+"</div>");a=this.options,a.value===null&&(a.value=this.find(".active").length),this.setValue(a.value),a.disabled&&this.disable(),a.update&&this.assignTo(a.update)},setValue:function(a){this.disabled()||(a=i(a)?e(a).toInt():a,a=j(a)?e(a).round():0,a=e(a).max(this.options.size),a=e(a).min(0),this.highlight(a),this.value!=a&&this.fire("change",{value:this.value=a}));return this},getValue:function(){return this.value},send:function(){this.options.url&&(this.request=(new h(this.options.url,this.options.Xhr)).send(this.options.param+"="+this.value),this.fire("send",{value:this.value}));return this},disable:function(){return this.addClass("rui-rater-disabled")},enable:function(){return this.removeClass("rui-rater-disabled")},disabled:function(){return this.hasClass("rui-rater-disabled")},_hovered:function(a){var b=this.children().indexOf(a.target);!this.disabled()&&b>-1&&(this.highlight(b+1),this.fire("hover",{value:b+1}))},_clicked:function(a){var b=this.children().indexOf(a.target);!this.disabled()&&b>-1&&(this.setValue(b+1),this.options.disableOnVote&&this.disable(),this.send())},_left:function(){this.setValue(this.value)},highlight:function(a){this.children().each(function(b,c){b[a-1<c?"removeClass":"addClass"]("active")})}});f(a).onMouseover(function(a){var b=a.target,c=a.find(".rui-rater");c&&(c instanceof k||(c=new k(c),b.parent()===c&&b.fire("mouseover")))});var l=a.createElement("style"),m=a.createTextNode("div.rui-rater,div.rui-rater div{margin:0;padding:0;background:none;border:none;display:inline-block; *display:inline; *zoom:1;font-family:Arial;font-size:110%}div.rui-rater{width:6em;height:1em;vertical-align:middle}div.rui-rater div{float:left;width:1em;height:1em;line-height:1em;text-align:center;cursor:pointer;color:#888}div.rui-rater div.active{color:brown;text-shadow:#666 .05em .05em .15em}div.rui-rater-disabled div{cursor:default}");l.type="text/css",a.getElementsByTagName("head")[0].appendChild(l),l.styleSheet?l.styleSheet.cssText=m.nodeValue:l.appendChild(m);return k}(document,RightJS)
|
7
|
+
var Rater=RightJS.Rater=function(a,b){function c(a,c){c||(c=a,a="DIV");var d=new b.Class(b.Element.Wrappers[a]||b.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof b.Input||this instanceof b.Form||e.unshift(a),this.$super.apply(this,e),b.isString(d)&&(d=b.$(d)),d instanceof b.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return b.Wrapper.Cache[b.$uid(this._)]=this},setOptions:function(a,c){c&&(a=b.Object.merge(a,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),a&&b.Options.setOptions.call(this,b.Object.merge(this.options,a));return this}}),e=new b.Class(d,c);b.Observer.createShortcuts(e.prototype,e.EVENTS||b([]));return e}var d={assignTo:function(b){var c=e(function(a,b){(a=f(a))&&a[a.setValue?"setValue":"update"](b.target.getValue())}).curry(b),d=e(function(a,b){a=f(a),a&&a.onChange&&a.onChange(e(function(){this.setValue(a.value())}).bind(b))}).curry(b);f(b)?(c({target:this}),d(this)):f(a).onReady(e(function(){c({target:this}),d(this)}.bind(this)));return this.onChange(c)}},e=b,f=b.$,g=b.$w,h=b.Xhr,i=b.isString,j=b.isNumber,k=new c({include:d,extend:{version:"2.2.0",EVENTS:g("change hover send"),Options:{html:"★",size:5,value:null,update:null,disabled:!1,disableOnVote:!1,url:null,param:"rate",Xhr:null}},initialize:function(a){this.$super("rater",a).on({click:this._clicked,mouseover:this._hovered,mouseout:this._left});if(this.empty())for(var b=0;b<this.options.size;b++)this.insert("<div>"+this.options.html+"</div>");a=this.options,a.value===null&&(a.value=this.find(".active").length),this.setValue(a.value),a.disabled&&this.disable(),a.update&&this.assignTo(a.update)},setValue:function(a){this.disabled()||(a=i(a)?e(a).toInt():a,a=j(a)?e(a).round():0,a=e(a).max(this.options.size),a=e(a).min(0),this.highlight(a),this.value!=a&&this.fire("change",{value:this.value=a}));return this},getValue:function(){return this.value},send:function(){this.options.url&&(this.request=(new h(this.options.url,this.options.Xhr)).send(this.options.param+"="+this.value),this.fire("send",{value:this.value}));return this},disable:function(){return this.addClass("rui-rater-disabled")},enable:function(){return this.removeClass("rui-rater-disabled")},disabled:function(){return this.hasClass("rui-rater-disabled")},_hovered:function(a){var b=this.children().indexOf(a.target);!this.disabled()&&b>-1&&(this.highlight(b+1),this.fire("hover",{value:b+1}))},_clicked:function(a){var b=this.children().indexOf(a.target);!this.disabled()&&b>-1&&(this.setValue(b+1),this.options.disableOnVote&&this.disable(),this.send())},_left:function(){this.setValue(this.value)},highlight:function(a){this.children().each(function(b,c){b[a-1<c?"removeClass":"addClass"]("active")})}});f(a).onMouseover(function(a){var b=a.target,c=a.find(".rui-rater");c&&(c instanceof k||(c=new k(c),b.parent()===c&&b.fire("mouseover")))});var l=a.createElement("style"),m=a.createTextNode("div.rui-rater,div.rui-rater div{margin:0;padding:0;background:none;border:none;display:inline-block; *display:inline; *zoom:1;font-family:Arial;font-size:110%}div.rui-rater{width:6em;height:1em;vertical-align:middle}div.rui-rater div{float:left;width:1em;height:1em;line-height:1em;text-align:center;cursor:pointer;color:#888}div.rui-rater div.active{color:brown;text-shadow:#666 .05em .05em .15em}div.rui-rater-disabled div{cursor:default}");l.type="text/css",a.getElementsByTagName("head")[0].appendChild(l),l.styleSheet?l.styleSheet.cssText=m.nodeValue:l.appendChild(m);return k}(document,RightJS)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* RightJS-UI Resizable v2.2.
|
2
|
+
* RightJS-UI Resizable v2.2.3
|
3
3
|
* http://rightjs.org/ui/resizable
|
4
4
|
*
|
5
5
|
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
@@ -98,7 +98,7 @@ function Widget(tag_name, methods) {
|
|
98
98
|
var Klass = new RightJS.Class(AbstractWidget, methods);
|
99
99
|
|
100
100
|
// creating the widget related shortcuts
|
101
|
-
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || []);
|
101
|
+
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || RightJS([]));
|
102
102
|
|
103
103
|
return Klass;
|
104
104
|
}
|
@@ -126,7 +126,7 @@ var R = RightJS,
|
|
126
126
|
*/
|
127
127
|
var Resizable = new Widget({
|
128
128
|
extend: {
|
129
|
-
version: '2.2.
|
129
|
+
version: '2.2.3',
|
130
130
|
|
131
131
|
EVENTS: $w('resize start release'),
|
132
132
|
|
@@ -422,6 +422,32 @@ Element.include({
|
|
422
422
|
});
|
423
423
|
|
424
424
|
|
425
|
+
/**
|
426
|
+
* The drag-n-drop module patch so it was possible
|
427
|
+
* to use dnd and resizable at the same time
|
428
|
+
*
|
429
|
+
* NOTE: to make it work, the DND module should be
|
430
|
+
* included _before_ the resizable widget!
|
431
|
+
*
|
432
|
+
* Copyright (C) 2011 Nikolay Nemshilov
|
433
|
+
*/
|
434
|
+
if ('Draggable' in RightJS) {
|
435
|
+
RightJS.Draggable.include({
|
436
|
+
/**
|
437
|
+
* Overloading the method so that it didn't trigger
|
438
|
+
* the drag process if the click is happened on
|
439
|
+
* a resizable unit handle
|
440
|
+
*
|
441
|
+
* @return void
|
442
|
+
*/
|
443
|
+
dragStart: function(event) {
|
444
|
+
if (!event.target.hasClass('rui-resizable-handle')) {
|
445
|
+
this.$super(event);
|
446
|
+
}
|
447
|
+
}
|
448
|
+
});
|
449
|
+
}
|
450
|
+
|
425
451
|
var embed_style = document.createElement('style'),
|
426
452
|
embed_rules = document.createTextNode(".rui-resizable,.rui-resizable-top,.rui-resizable-left,.rui-resizable-right,.rui-resizable-bottom,.rui-resizable-content .rui-resizable-handle{margin:0;padding:0;overflow:none;border:none;background:none;width:auto;height:auto;min-width:none;max-width:none;min-height:none;max-height:none}.rui-resizable,.rui-resizable-top,.rui-resizable-left,.rui-resizable-right,.rui-resizable-bottom{position:relative;min-width:8em;min-height:8em;border:1px solid #DDD}.rui-resizable-content{overflow:auto;padding:.5em;position:relative}.rui-resizable-handle{position:absolute;background-image:url(/images/rightjs-ui/resizable.png);background-repeat:no-repeat;background-color:#DDD;cursor:move}.rui-resizable .rui-resizable-handle{right:0;bottom:0;background-position:-2px -2px;background-color:transparent;width:16px;height:16px}.rui-resizable-top .rui-resizable-handle,.rui-resizable-bottom .rui-resizable-handle{height:8px;width:100%;background-position:center -26px;cursor:row-resize}.rui-resizable-left .rui-resizable-handle,.rui-resizable-right .rui-resizable-handle{top:0px;width:8px;height:100%;background-position:-26px center;cursor:col-resize}.rui-resizable-top .rui-resizable-content{padding-top:1em}.rui-resizable-top .rui-resizable-handle{top:0}.rui-resizable-bottom .rui-resizable-content{padding-bottom:1em}.rui-resizable-bottom .rui-resizable-handle{bottom:0}.rui-resizable-left .rui-resizable-content{padding-left:1em}.rui-resizable-left .rui-resizable-handle{left:0}.rui-resizable-right .rui-resizable-content{padding-right:1em}.rui-resizable-right .rui-resizable-handle{right:0}");
|
427
453
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
|
-
* RightJS-UI Resizable v2.2.
|
2
|
+
* RightJS-UI Resizable v2.2.3
|
3
3
|
* http://rightjs.org/ui/resizable
|
4
4
|
*
|
5
5
|
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
6
6
|
*/
|
7
|
-
var Resizable=RightJS.Resizable=function(a,b){function c(a,c){c||(c=a,a="DIV");var d=new b.Class(b.Element.Wrappers[a]||b.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof b.Input||this instanceof b.Form||e.unshift(a),this.$super.apply(this,e),b.isString(d)&&(d=b.$(d)),d instanceof b.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return b.Wrapper.Cache[b.$uid(this._)]=this},setOptions:function(a,c){c&&(a=b.Object.merge(a,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),a&&b.Options.setOptions.call(this,b.Object.merge(this.options,a));return this}}),e=new b.Class(d,c);b.Observer.createShortcuts(e.prototype,e.EVENTS||[]);return e}var d=b,e=b.$,f=b.$w,g=b.$E,h=b.Class,i=b.Element,j=new c({extend:{version:"2.2.
|
7
|
+
var Resizable=RightJS.Resizable=function(a,b){function c(a,c){c||(c=a,a="DIV");var d=new b.Class(b.Element.Wrappers[a]||b.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof b.Input||this instanceof b.Form||e.unshift(a),this.$super.apply(this,e),b.isString(d)&&(d=b.$(d)),d instanceof b.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return b.Wrapper.Cache[b.$uid(this._)]=this},setOptions:function(a,c){c&&(a=b.Object.merge(a,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),a&&b.Options.setOptions.call(this,b.Object.merge(this.options,a));return this}}),e=new b.Class(d,c);b.Observer.createShortcuts(e.prototype,e.EVENTS||b([]));return e}var d=b,e=b.$,f=b.$w,g=b.$E,h=b.Class,i=b.Element,j=new c({extend:{version:"2.2.3",EVENTS:f("resize start release"),Options:{direction:null,minWidth:null,maxWidth:null,minHeight:null,maxHeight:null}},initialize:function(a,b){this.$super("resizable",this.old_inst=e(a)).setOptions(b),this.options.direction?this.addClass("rui-resizable-"+this.options.direction):this.addClass("rui-resizable"),this.content=this.first(".rui-resizable-content")||g("div",{"class":"rui-resizable-content"}).insert(this.children()).insertTo(this),this.handle=this.first(".rui-resizable-handle")||g("div",{"class":"rui-resizable-handle"}).insertTo(this),this.content.setWidth(this.size().x-parseInt(this.getStyle("borderLeftWidth"),10)-parseInt(this.getStyle("borderRightWidth"),10)),this.options.direction!=="left"&&this.options.direction!=="right"&&this.content.setHeight(this.size().y-parseInt(this.getStyle("borderTopWidth"),10)-parseInt(this.getStyle("borderBottomWidth"),10))},destroy:function(){this.removeClass("rui-resizable").removeClass("rui-resizable-top").removeClass("rui-resizable-left").removeClass("rui-resizable-right").removeClass("rui-resizable-bottom").insert(this.content._.childNodes),this.content.remove(),this.handle.remove(),this.old_inst&&(Wrapper.Cache[$uid(this._)]=this.old_inst);return this},setOptions:function(a,b){a=a||{},f("top left right bottom").each(function(b){this.hasClass("rui-resizable-"+b)&&(a.direction=b)},this);return this.$super(a,b)},start:function(a){this.prevSizes=this.size(),this.prevEvPos=a.position(),this.contXDiff=this.size().x-this.content.size().x,this.contYDiff=this.size().y-this.content.size().y,f("minWidth maxWidth minHeight maxHeight").each(function(a){this[a]=this.findDim(a)},this);return this.fire("start",{original:a})},track:function(a){var b=a.position(),c=this.prevEvPos,d=this.handle.dimensions(),e=this.prevSizes,f=e.x,g=e.y,h=c.x-b.x,i=c.y-b.y,j=this.minWidth,k=this.maxWidth,l=this.minHeight,m=this.maxHeight,n=this.options,o=n.direction;f+=(o==="left"?1:-1)*h,g+=(o==="top"?1:-1)*i,f<j&&(f=j),f>k&&(f=k),g<l&&(g=l),g>m&&(g=m),e.x!==f&&o!=="top"&&o!=="bottom"&&this.setWidth(f),e.y!==g&&o!=="left"&&o!=="right"&&this.setHeight(g);if(f==j||f==k)b.x=d.left+d.width/2;if(g==l||g==m)b.y=d.top+d.height/2;this.prevEvPos=b,this.prevSizes=this.size(),this.fire("resize",{original:a})},setWidth:function(a){this.content.setWidth(a-this.contXDiff);return this.$super(a)},setHeight:function(a){this.content.setHeight(a-this.contYDiff);return this.$super(a)},release:function(a){return this.fire("release",{original:a})},findDim:function(a){var b=this.options[a]||this.getStyle(a);if(b&&/\d+/.test(b)&&parseFloat(b)>0){var c=d(a).include("Width")?"width":"height",e=(this._dummy||(this._dummy=g("div",{style:"visibility:hidden;z-index:-1"}))).setStyle(c,b).insertTo(this,"before"),f=e._["offset"+d(c).capitalize()];e.remove();return f}}});e(a).on({mousedown:function(a){var b=a.find(".rui-resizable-handle");if(b){var c=b.parent();c instanceof j||(c=new j(c)),j.current=c.start(a.stop())}},mousemove:function(a){var b=j.current;b&&b.track(a)},mouseup:function(a){var b=j.current;b&&(b.release(a),j.current=null)}}),e(window).onBlur(function(a){var b=j.current;b&&(b.release(a),j.current=null)}),i.include({makeResizable:function(a){return new j(this,a)},undoResizable:function(){this instanceof j&&this.destroy();return this}}),"Draggable"in b&&b.Draggable.include({dragStart:function(a){a.target.hasClass("rui-resizable-handle")||this.$super(a)}});var k=a.createElement("style"),l=a.createTextNode(".rui-resizable,.rui-resizable-top,.rui-resizable-left,.rui-resizable-right,.rui-resizable-bottom,.rui-resizable-content .rui-resizable-handle{margin:0;padding:0;overflow:none;border:none;background:none;width:auto;height:auto;min-width:none;max-width:none;min-height:none;max-height:none}.rui-resizable,.rui-resizable-top,.rui-resizable-left,.rui-resizable-right,.rui-resizable-bottom{position:relative;min-width:8em;min-height:8em;border:1px solid #DDD}.rui-resizable-content{overflow:auto;padding:.5em;position:relative}.rui-resizable-handle{position:absolute;background-image:url(/images/rightjs-ui/resizable.png);background-repeat:no-repeat;background-color:#DDD;cursor:move}.rui-resizable .rui-resizable-handle{right:0;bottom:0;background-position:-2px -2px;background-color:transparent;width:16px;height:16px}.rui-resizable-top .rui-resizable-handle,.rui-resizable-bottom .rui-resizable-handle{height:8px;width:100%;background-position:center -26px;cursor:row-resize}.rui-resizable-left .rui-resizable-handle,.rui-resizable-right .rui-resizable-handle{top:0px;width:8px;height:100%;background-position:-26px center;cursor:col-resize}.rui-resizable-top .rui-resizable-content{padding-top:1em}.rui-resizable-top .rui-resizable-handle{top:0}.rui-resizable-bottom .rui-resizable-content{padding-bottom:1em}.rui-resizable-bottom .rui-resizable-handle{bottom:0}.rui-resizable-left .rui-resizable-content{padding-left:1em}.rui-resizable-left .rui-resizable-handle{left:0}.rui-resizable-right .rui-resizable-content{padding-right:1em}.rui-resizable-right .rui-resizable-handle{right:0}");k.type="text/css",a.getElementsByTagName("head")[0].appendChild(k),k.styleSheet?k.styleSheet.cssText=l.nodeValue:k.appendChild(l);return j}(document,RightJS)
|
@@ -98,7 +98,7 @@ function Widget(tag_name, methods) {
|
|
98
98
|
var Klass = new RightJS.Class(AbstractWidget, methods);
|
99
99
|
|
100
100
|
// creating the widget related shortcuts
|
101
|
-
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || []);
|
101
|
+
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || RightJS([]));
|
102
102
|
|
103
103
|
return Klass;
|
104
104
|
}
|
@@ -4,4 +4,4 @@
|
|
4
4
|
*
|
5
5
|
* Copyright (C) 2009-2011 Nikolay Nemshilov
|
6
6
|
*/
|
7
|
-
var Selectable=RightJS.Selectable=function(a,b){function c(a,c){c||(c=a,a="DIV");var d=new b.Class(b.Element.Wrappers[a]||b.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof b.Input||this instanceof b.Form||e.unshift(a),this.$super.apply(this,e),b.isString(d)&&(d=b.$(d)),d instanceof b.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return b.Wrapper.Cache[b.$uid(this._)]=this},setOptions:function(a,c){c&&(a=b.Object.merge(a,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),a&&b.Options.setOptions.call(this,b.Object.merge(this.options,a));return this}}),e=new b.Class(d,c);b.Observer.createShortcuts(e.prototype,e.EVENTS||[]);return e}var d={assignTo:function(b){var c=e(function(a,b){(a=f(a))&&a[a.setValue?"setValue":"update"](b.target.getValue())}).curry(b),d=e(function(a,b){a=f(a),a&&a.onChange&&a.onChange(e(function(){this.setValue(a.value())}).bind(b))}).curry(b);f(b)?(c({target:this}),d(this)):f(a).onReady(e(function(){c({target:this}),d(this)}.bind(this)));return this.onChange(c)}},e=b,f=b.$,g=b.$$,h=b.$w,i=b.$E,j=b.$A,k=b.Object,l=b.isHash,m=b.isArray,n=b.isString,o=b.isNumber,p=b.defined,q=b.Input,r=b.Element,s=new c("UL",{include:d,extend:{version:"2.2.2",EVENTS:h("change select unselect disable enable hover leave show hide"),Options:{options:null,selected:null,disabled:null,multiple:!0,fxName:"slide",fxDuration:"short",update:null,parseIds:!1,limit:null,hCont:"•"},rescan:function(b){f(b||a).find(".rui-selectable").each(function(a){a instanceof s||new s(a)})}},initialize:function(){var a=j(arguments).compact(),b=a.pop(),c=a.pop(),d;if(!l(b)||b instanceof r)c=f(c||b),b=null;c&&(c=f(c))instanceof q&&(this.selectbox=d=c,b=k.merge(this.harvestOptions(c),b),c=null),this.$super("selectable",c).setOptions(b).on({mousedown:this._mousedown,mouseover:this._mouseover,mouseout:this._mouseout,mouseup:this._mouseup,click:this._click,select:this._change,unselect:this._change}),this.empty()&&this.build(),b=this.options;if(!b.multiple||this.hasClass("rui-selectable-single"))this.isSingle=!0,this.addClass("rui-selectable-single"),this.buildSingle(),b.selected===null&&this.select(this.items()[0]);b.disabled&&this.disable(b.disabled),b.selected&&this.select(b.selected),b.update&&this.assignTo(b.update),d&&(this.assignTo(d).insertTo(d,"before"),d.wrap(i("div",{style:"position:absolute;z-index:-1;visibility:hidden;width:0;height:0;overflow:hidden"})))},setValue:function(a){n(a)&&(a=a.split(",").map("trim").filter(function(a){return!a.blank()})),this.items().each("removeClass","rui-selectable-selected");return this.select(a)},getValue:function(){if(this.isSingle){var a=this.items().first("hasClass","rui-selectable-selected");return a?this.itemValue(a):null}return this.items().filter("hasClass","rui-selectable-selected").map(function(a){return this.itemValue(a)},this)},disable:function(a){this.mapOrAll(a).each(function(a){this.fire("disable",a.addClass("rui-selectable-disabled"))},this);return this},enable:function(a){this.mapOrAll(a).each(function(a){this.fire("enable",a.removeClass("rui-selectable-disabled"))},this);return this},disabled:function(a){return this.mapOrAll(a).every("hasClass","rui-selectable-disabled")},select:function(a){var b=this.mapEnabled(a),c="rui-selectable-selected";this.isSingle&&b&&(this.items().each("removeClass",c),b=e([b[0]]));if(!this.isSingle&&this.options.limit){var d=this.items().filter("hasClass",c),f=[];while(b.length&&d.length+f.length<this.options.limit){var g=b.shift();d.include(g)||f.push(g)}b=f}b.compact().each(function(a){this.fire("select",a.addClass(c))},this);return this},unselect:function(a){var b=this.getValue();this.mapEnabled(a).each(function(a){this.fire("unselect",a.removeClass("rui-selectable-selected"))},this);return this},selected:function(a){return this.mapEnabled(a).every("hasClass","rui-selectable-selected")},insertTo:function(a,b){this.$super.call(this.isSingle?this.container:this,a,b);return this},remove:function(){this.$super.call(this.isSingle?this.container:this);return this},fire:function(a,b){b&&b instanceof r?this.$super(a,{item:b,index:this.items().indexOf(b)}):this.$super.apply(this,arguments);return this},itemValue:function(a){var b=e([a._value,a.get("id")||a.get("val")]).compact()[0];return b!==undefined?this.options.parseIds?b.match(/\d+/):b:this.items().indexOf(a)},items:function(){return this.find("li")},mapOrAll:function(a){var b=this.items();p(a)&&(m(a)||(a=[a]),b=e(a).map(function(a){var c=n(a)&&/^\d+$/.test(a)?parseInt(a,10):a,d=a;o(c)?d=b[c]:n(a)&&(d=b.first(function(b){return b.id==a||b.val==a}));return d},this).compact());return b},mapEnabled:function(a){return this.mapOrAll(a).filter(function(a){return!a.hasClass("rui-selectable-disabled")},this)},_mousedown:function(a){a.stop();var b=a.target,c=this.items();if(c.include(b)&&!this.disabled(b)){this.isSingle?this.select(b):this.selected(b)?(this.unselect(b),this._massRemove=!0):(this.select(b),this._massSelect=!0);if((a.shiftKey||a.metaKey)&&this._prevItem){var d=c.indexOf(this._prevItem),e=c.indexOf(b);if(d!=e){if(d>e){var f=d;d=e,e=d}for(var g=d;g<e;g++)this[this._prevItem.hasClass("rui-selectable-selected")?"select":"unselect"](c[g])}}this._prevItem=b}},_mouseup:function(a){a.stop(),this._massRemove=this._massSelect=!1},_mouseover:function(a){var b=a.target;this.fire("hover",b),this.isSingle||(this._massSelect?this.select(b):this._massRemove&&this.unselect(b))},_mouseout:function(a){this.fire("leave",a.target)},_click:function(a){a.stop()},_change:function(){""+this.value!=""+this.getValue()&&(this.value=this.getValue(),this.fire("change"))},build:function(){var a=this.options.options,b=e([]);if(m(a))a.each(function(a){b.push(m(a)?a:[a,a])});else for(var c in a)b.push([a[c],c]);b.each(function(a){var b=i("li",{val:a[1],html:a[0]});b._value=a[1],this.insert(b)},this);return this},buildSingle:function(){this.container=i("div",{"class":"rui-selectable-container"}).insert([this.trigger=i("div",{html:this.options.hCont,"class":"rui-selectable-handle"}),this.display=i("ul",{"class":"rui-selectable-display"})]).onClick(e(this.toggleList).bind(this)),this.parent()&&this.container.insertTo(this,"instead"),this.container.insert(this),f(a).onClick(e(this.hideList).bind(this));return this.onSelect("showItem").onSelect("hideList").addClass("rui-dd-menu")},toggleList:function(a){a.stop();return this.visible()?this.hideList():this.showList(a)},showList:function(a){a.stop(),g(".rui-selectable-single").without(this).each("hide");var b=this.container.dimensions(),c=this.container.position();this.setStyle({top:b.top+b.height-c.y-1+"px",left:b.left-c.x+"px",width:b.width+"px"}).show(this.options.fxName,{duration:this.options.fxDuration,onFinish:this.fire.bind(this,"show",this)}),this.options.fxName||this.fire("show",this)},hideList:function(){this.isSingle&&this.visible()&&(this.hide(this.options.fxName,{duration:this.options.fxDuration,onFinish:this.fire.bind(this,"hide")}),this.options.fxName||this.fire("hide"))},showItem:function(){var a=this.items().first("hasClass","rui-selectable-selected")||this.items().first();this.display.html("<li>"+(a?a.html():" ")+"</li>")},harvestOptions:function(a){var b=(new Function("return "+a.get("data-selectable")))()||{};b.multiple=a._.type=="select-multiple",b.options=e([]),b.selected=e([]),b.disabled=e([]),j(a._.getElementsByTagName("OPTION")).each(function(c,d){var e=c.innerHTML,f=c.getAttribute("value");b.options.push([e,f===null?e:f]),c.selected&&!a._.disabled&&b.selected.push(d),(c.disabled||a._.disabled)&&b.disabled.push(d)}),b.selected.empty()&&(b.selected=0);return b}});f(a).onReady(function(){s.rescan()});var t=a.createElement("style"),u=a.createTextNode("*.rui-dd-menu, *.rui-dd-menu li{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none} *.rui-dd-menu{display:none;position:absolute;z-index:9999;background:white;border:1px solid #BBB;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;box-shadow:#DDD .2em .2em .4em;-moz-box-shadow:#DDD .2em .2em .4em;-webkit-box-shadow:#DDD .2em .2em .4em} *.rui-dd-menu li{padding:.2em .4em;border-top:none;border-bottom:none;cursor:pointer} *.rui-dd-menu li.current{background:#DDD} *.rui-dd-menu li:hover{background:#EEE}dl.rui-dd-menu dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE}dl.rui-dd-menu dd li{padding-left:1.5em} *.rui-selectable, *.rui-selectable li, *.rui-selectable dt, *.rui-selectable dd, *.rui-selectable ul,div.rui-selectable-container ul.rui-selectable-display,div.rui-selectable-container ul.rui-selectable-display li{margin:0;padding:0;border:none;background:none;list-style:none} *.rui-selectable{border:1px solid #CCC;border-bottom:none;display:inline-block; *display:inline; *zoom:1;min-width:10em;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-selectable li{padding:.3em 1em;cursor:pointer;border-bottom:1px solid #CCC} *.rui-selectable li:hover{background:#EEE} *.rui-selectable li.rui-selectable-selected{font-weight:bold;background:#DDD} *.rui-selectable li.rui-selectable-disabled, *.rui-selectable li.rui-selectable-disabled:hover{background:#CCC;color:#777;cursor:default}dl.rui-selectable dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE;border-bottom:1px solid #CCC}dl.rui-selectable dd li{padding-left:1.5em} *.rui-selectable-single{background:#FFF;display:none} *.rui-selectable-single li{overflow:hidden}div.rui-selectable-container{border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;display:inline-block; *display:inline; *zoom:1; *width:10em;vertical-align:middle;min-width:10em;cursor:pointer;height:1.6em;position:relative}div.rui-selectable-container div.rui-selectable-handle{font-family:Arial;position:absolute;right:0;width:0.8em;background:#DDD;text-align:center;height:100%;line-height:0.8em;font-size:200%;color:#888;border-left:1px solid #CCC}div.rui-selectable-container:hover div.rui-selectable-handle{color:#666}div.rui-selectable-container ul.rui-selectable-display{display:block;width:auto;overflow:hidden;margin-right:2em}div.rui-selectable-container ul.rui-selectable-display li{line-height:1.6em;padding:0 .5em;overflow:hidden;width:100%;white-space:nowrap}select.rui-selectable{visibility:hidden}");t.type="text/css",a.getElementsByTagName("head")[0].appendChild(t),t.styleSheet?t.styleSheet.cssText=u.nodeValue:t.appendChild(u);return s}(document,RightJS)
|
7
|
+
var Selectable=RightJS.Selectable=function(a,b){function c(a,c){c||(c=a,a="DIV");var d=new b.Class(b.Element.Wrappers[a]||b.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof b.Input||this instanceof b.Form||e.unshift(a),this.$super.apply(this,e),b.isString(d)&&(d=b.$(d)),d instanceof b.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return b.Wrapper.Cache[b.$uid(this._)]=this},setOptions:function(a,c){c&&(a=b.Object.merge(a,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),a&&b.Options.setOptions.call(this,b.Object.merge(this.options,a));return this}}),e=new b.Class(d,c);b.Observer.createShortcuts(e.prototype,e.EVENTS||b([]));return e}var d={assignTo:function(b){var c=e(function(a,b){(a=f(a))&&a[a.setValue?"setValue":"update"](b.target.getValue())}).curry(b),d=e(function(a,b){a=f(a),a&&a.onChange&&a.onChange(e(function(){this.setValue(a.value())}).bind(b))}).curry(b);f(b)?(c({target:this}),d(this)):f(a).onReady(e(function(){c({target:this}),d(this)}.bind(this)));return this.onChange(c)}},e=b,f=b.$,g=b.$$,h=b.$w,i=b.$E,j=b.$A,k=b.Object,l=b.isHash,m=b.isArray,n=b.isString,o=b.isNumber,p=b.defined,q=b.Input,r=b.Element,s=new c("UL",{include:d,extend:{version:"2.2.2",EVENTS:h("change select unselect disable enable hover leave show hide"),Options:{options:null,selected:null,disabled:null,multiple:!0,fxName:"slide",fxDuration:"short",update:null,parseIds:!1,limit:null,hCont:"•"},rescan:function(b){f(b||a).find(".rui-selectable").each(function(a){a instanceof s||new s(a)})}},initialize:function(){var a=j(arguments).compact(),b=a.pop(),c=a.pop(),d;if(!l(b)||b instanceof r)c=f(c||b),b=null;c&&(c=f(c))instanceof q&&(this.selectbox=d=c,b=k.merge(this.harvestOptions(c),b),c=null),this.$super("selectable",c).setOptions(b).on({mousedown:this._mousedown,mouseover:this._mouseover,mouseout:this._mouseout,mouseup:this._mouseup,click:this._click,select:this._change,unselect:this._change}),this.empty()&&this.build(),b=this.options;if(!b.multiple||this.hasClass("rui-selectable-single"))this.isSingle=!0,this.addClass("rui-selectable-single"),this.buildSingle(),b.selected===null&&this.select(this.items()[0]);b.disabled&&this.disable(b.disabled),b.selected&&this.select(b.selected),b.update&&this.assignTo(b.update),d&&(this.assignTo(d).insertTo(d,"before"),d.wrap(i("div",{style:"position:absolute;z-index:-1;visibility:hidden;width:0;height:0;overflow:hidden"})))},setValue:function(a){n(a)&&(a=a.split(",").map("trim").filter(function(a){return!a.blank()})),this.items().each("removeClass","rui-selectable-selected");return this.select(a)},getValue:function(){if(this.isSingle){var a=this.items().first("hasClass","rui-selectable-selected");return a?this.itemValue(a):null}return this.items().filter("hasClass","rui-selectable-selected").map(function(a){return this.itemValue(a)},this)},disable:function(a){this.mapOrAll(a).each(function(a){this.fire("disable",a.addClass("rui-selectable-disabled"))},this);return this},enable:function(a){this.mapOrAll(a).each(function(a){this.fire("enable",a.removeClass("rui-selectable-disabled"))},this);return this},disabled:function(a){return this.mapOrAll(a).every("hasClass","rui-selectable-disabled")},select:function(a){var b=this.mapEnabled(a),c="rui-selectable-selected";this.isSingle&&b&&(this.items().each("removeClass",c),b=e([b[0]]));if(!this.isSingle&&this.options.limit){var d=this.items().filter("hasClass",c),f=[];while(b.length&&d.length+f.length<this.options.limit){var g=b.shift();d.include(g)||f.push(g)}b=f}b.compact().each(function(a){this.fire("select",a.addClass(c))},this);return this},unselect:function(a){var b=this.getValue();this.mapEnabled(a).each(function(a){this.fire("unselect",a.removeClass("rui-selectable-selected"))},this);return this},selected:function(a){return this.mapEnabled(a).every("hasClass","rui-selectable-selected")},insertTo:function(a,b){this.$super.call(this.isSingle?this.container:this,a,b);return this},remove:function(){this.$super.call(this.isSingle?this.container:this);return this},fire:function(a,b){b&&b instanceof r?this.$super(a,{item:b,index:this.items().indexOf(b)}):this.$super.apply(this,arguments);return this},itemValue:function(a){var b=e([a._value,a.get("id")||a.get("val")]).compact()[0];return b!==undefined?this.options.parseIds?b.match(/\d+/):b:this.items().indexOf(a)},items:function(){return this.find("li")},mapOrAll:function(a){var b=this.items();p(a)&&(m(a)||(a=[a]),b=e(a).map(function(a){var c=n(a)&&/^\d+$/.test(a)?parseInt(a,10):a,d=a;o(c)?d=b[c]:n(a)&&(d=b.first(function(b){return b.id==a||b.val==a}));return d},this).compact());return b},mapEnabled:function(a){return this.mapOrAll(a).filter(function(a){return!a.hasClass("rui-selectable-disabled")},this)},_mousedown:function(a){a.stop();var b=a.target,c=this.items();if(c.include(b)&&!this.disabled(b)){this.isSingle?this.select(b):this.selected(b)?(this.unselect(b),this._massRemove=!0):(this.select(b),this._massSelect=!0);if((a.shiftKey||a.metaKey)&&this._prevItem){var d=c.indexOf(this._prevItem),e=c.indexOf(b);if(d!=e){if(d>e){var f=d;d=e,e=d}for(var g=d;g<e;g++)this[this._prevItem.hasClass("rui-selectable-selected")?"select":"unselect"](c[g])}}this._prevItem=b}},_mouseup:function(a){a.stop(),this._massRemove=this._massSelect=!1},_mouseover:function(a){var b=a.target;this.fire("hover",b),this.isSingle||(this._massSelect?this.select(b):this._massRemove&&this.unselect(b))},_mouseout:function(a){this.fire("leave",a.target)},_click:function(a){a.stop()},_change:function(){""+this.value!=""+this.getValue()&&(this.value=this.getValue(),this.fire("change"))},build:function(){var a=this.options.options,b=e([]);if(m(a))a.each(function(a){b.push(m(a)?a:[a,a])});else for(var c in a)b.push([a[c],c]);b.each(function(a){var b=i("li",{val:a[1],html:a[0]});b._value=a[1],this.insert(b)},this);return this},buildSingle:function(){this.container=i("div",{"class":"rui-selectable-container"}).insert([this.trigger=i("div",{html:this.options.hCont,"class":"rui-selectable-handle"}),this.display=i("ul",{"class":"rui-selectable-display"})]).onClick(e(this.toggleList).bind(this)),this.parent()&&this.container.insertTo(this,"instead"),this.container.insert(this),f(a).onClick(e(this.hideList).bind(this));return this.onSelect("showItem").onSelect("hideList").addClass("rui-dd-menu")},toggleList:function(a){a.stop();return this.visible()?this.hideList():this.showList(a)},showList:function(a){a.stop(),g(".rui-selectable-single").without(this).each("hide");var b=this.container.dimensions(),c=this.container.position();this.setStyle({top:b.top+b.height-c.y-1+"px",left:b.left-c.x+"px",width:b.width+"px"}).show(this.options.fxName,{duration:this.options.fxDuration,onFinish:this.fire.bind(this,"show",this)}),this.options.fxName||this.fire("show",this)},hideList:function(){this.isSingle&&this.visible()&&(this.hide(this.options.fxName,{duration:this.options.fxDuration,onFinish:this.fire.bind(this,"hide")}),this.options.fxName||this.fire("hide"))},showItem:function(){var a=this.items().first("hasClass","rui-selectable-selected")||this.items().first();this.display.html("<li>"+(a?a.html():" ")+"</li>")},harvestOptions:function(a){var b=(new Function("return "+a.get("data-selectable")))()||{};b.multiple=a._.type=="select-multiple",b.options=e([]),b.selected=e([]),b.disabled=e([]),j(a._.getElementsByTagName("OPTION")).each(function(c,d){var e=c.innerHTML,f=c.getAttribute("value");b.options.push([e,f===null?e:f]),c.selected&&!a._.disabled&&b.selected.push(d),(c.disabled||a._.disabled)&&b.disabled.push(d)}),b.selected.empty()&&(b.selected=0);return b}});f(a).onReady(function(){s.rescan()});var t=a.createElement("style"),u=a.createTextNode("*.rui-dd-menu, *.rui-dd-menu li{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none} *.rui-dd-menu{display:none;position:absolute;z-index:9999;background:white;border:1px solid #BBB;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;box-shadow:#DDD .2em .2em .4em;-moz-box-shadow:#DDD .2em .2em .4em;-webkit-box-shadow:#DDD .2em .2em .4em} *.rui-dd-menu li{padding:.2em .4em;border-top:none;border-bottom:none;cursor:pointer} *.rui-dd-menu li.current{background:#DDD} *.rui-dd-menu li:hover{background:#EEE}dl.rui-dd-menu dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE}dl.rui-dd-menu dd li{padding-left:1.5em} *.rui-selectable, *.rui-selectable li, *.rui-selectable dt, *.rui-selectable dd, *.rui-selectable ul,div.rui-selectable-container ul.rui-selectable-display,div.rui-selectable-container ul.rui-selectable-display li{margin:0;padding:0;border:none;background:none;list-style:none} *.rui-selectable{border:1px solid #CCC;border-bottom:none;display:inline-block; *display:inline; *zoom:1;min-width:10em;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-selectable li{padding:.3em 1em;cursor:pointer;border-bottom:1px solid #CCC} *.rui-selectable li:hover{background:#EEE} *.rui-selectable li.rui-selectable-selected{font-weight:bold;background:#DDD} *.rui-selectable li.rui-selectable-disabled, *.rui-selectable li.rui-selectable-disabled:hover{background:#CCC;color:#777;cursor:default}dl.rui-selectable dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE;border-bottom:1px solid #CCC}dl.rui-selectable dd li{padding-left:1.5em} *.rui-selectable-single{background:#FFF;display:none} *.rui-selectable-single li{overflow:hidden}div.rui-selectable-container{border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;display:inline-block; *display:inline; *zoom:1; *width:10em;vertical-align:middle;min-width:10em;cursor:pointer;height:1.6em;position:relative}div.rui-selectable-container div.rui-selectable-handle{font-family:Arial;position:absolute;right:0;width:0.8em;background:#DDD;text-align:center;height:100%;line-height:0.8em;font-size:200%;color:#888;border-left:1px solid #CCC}div.rui-selectable-container:hover div.rui-selectable-handle{color:#666}div.rui-selectable-container ul.rui-selectable-display{display:block;width:auto;overflow:hidden;margin-right:2em}div.rui-selectable-container ul.rui-selectable-display li{line-height:1.6em;padding:0 .5em;overflow:hidden;width:100%;white-space:nowrap}select.rui-selectable{visibility:hidden}");t.type="text/css",a.getElementsByTagName("head")[0].appendChild(t),t.styleSheet?t.styleSheet.cssText=u.nodeValue:t.appendChild(u);return s}(document,RightJS)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* RightJS-UI Slider v2.2.
|
2
|
+
* RightJS-UI Slider v2.2.3
|
3
3
|
* http://rightjs.org/ui/slider
|
4
4
|
*
|
5
5
|
* Copyright (C) 2009-2011 Nikolay Nemshilov
|
@@ -98,7 +98,7 @@ function Widget(tag_name, methods) {
|
|
98
98
|
var Klass = new RightJS.Class(AbstractWidget, methods);
|
99
99
|
|
100
100
|
// creating the widget related shortcuts
|
101
|
-
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || []);
|
101
|
+
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || RightJS([]));
|
102
102
|
|
103
103
|
return Klass;
|
104
104
|
}
|
@@ -177,7 +177,7 @@ var Slider = new Widget({
|
|
177
177
|
include: Updater,
|
178
178
|
|
179
179
|
extend: {
|
180
|
-
version: '2.2.
|
180
|
+
version: '2.2.3',
|
181
181
|
|
182
182
|
EVENTS: $w('change'),
|
183
183
|
|
@@ -270,7 +270,7 @@ var Slider = new Widget({
|
|
270
270
|
dims = this.dims = this.dimensions();
|
271
271
|
|
272
272
|
this.offset = horizontal ? handle.left - dims.left : dims.top + dims.height - handle.top - handle_size;
|
273
|
-
this.space = (horizontal ? dims.width
|
273
|
+
this.space = (horizontal ? dims.width : dims.height) - handle_size - this.offset * 2;
|
274
274
|
|
275
275
|
return this;
|
276
276
|
},
|
@@ -297,7 +297,7 @@ var Slider = new Widget({
|
|
297
297
|
if (value > options.max) { value = options.max; }
|
298
298
|
if (options.snap) {
|
299
299
|
var snap = options.snap;
|
300
|
-
var diff = value % snap;
|
300
|
+
var diff = (value - options.min) % snap;
|
301
301
|
value = diff < snap/2 ? value - diff : value - diff + snap;
|
302
302
|
}
|
303
303
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
|
-
* RightJS-UI Slider v2.2.
|
2
|
+
* RightJS-UI Slider v2.2.3
|
3
3
|
* http://rightjs.org/ui/slider
|
4
4
|
*
|
5
5
|
* Copyright (C) 2009-2011 Nikolay Nemshilov
|
6
6
|
*/
|
7
|
-
var Slider=RightJS.Slider=function(a,b,c){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||[]);return e}var e={assignTo:function(b){var c=f(function(a,b){(a=g(a))&&a[a.setValue?"setValue":"update"](b.target.getValue())}).curry(b),d=f(function(a,b){a=g(a),a&&a.onChange&&a.onChange(f(function(){this.setValue(a.value())}).bind(b))}).curry(b);g(b)?(c({target:this}),d(this)):g(a).onReady(f(function(){c({target:this}),d(this)}.bind(this)));return this.onChange(c)}},f=c,g=c.$,h=c.$$,i=c.$w,j=c.$E,k=c.$A,l=c.isHash,m=c.Element,n=new d({include:e,extend:{version:"2.2.
|
7
|
+
var Slider=RightJS.Slider=function(a,b,c){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={assignTo:function(b){var c=f(function(a,b){(a=g(a))&&a[a.setValue?"setValue":"update"](b.target.getValue())}).curry(b),d=f(function(a,b){a=g(a),a&&a.onChange&&a.onChange(f(function(){this.setValue(a.value())}).bind(b))}).curry(b);g(b)?(c({target:this}),d(this)):g(a).onReady(f(function(){c({target:this}),d(this)}.bind(this)));return this.onChange(c)}},f=c,g=c.$,h=c.$$,i=c.$w,j=c.$E,k=c.$A,l=c.isHash,m=c.Element,n=new d({include:e,extend:{version:"2.2.3",EVENTS:i("change"),Options:{min:0,max:100,snap:0,value:null,direction:"x",update:null,round:0},current:!1},initialize:function(){var a=k(arguments).compact(),b=a.pop(),c=a.pop();if(!l(b)||b instanceof m)c=g(c||b),b={};this.$super("slider",c).setOptions(b).on("selectstart","stopEvent"),this.level=this.first(".level")||j("div",{"class":"level"}).insertTo(this),this.handle=this.first(".handle")||j("div",{"class":"handle"}).insertTo(this),b=this.options,this.value=b.value===null?b.min:b.value,b.update&&this.assignTo(b.update),b.direction==="y"?this.addClass("rui-slider-vertical"):this.hasClass("rui-slider-vertical")&&(b.direction="y"),this.setValue(this.value)},setValue:function(a){return this.precalc().shiftTo(a)},getValue:function(){return this.value},insertTo:function(a,b){return this.$super(a,b).setValue(this.value)},precalc:function(){var a=this.options.direction==="x",b=this.handle.setStyle(a?{left:0}:{bottom:0}).dimensions(),c=this.hSize=a?b.width:b.height,d=this.dims=this.dimensions();this.offset=a?b.left-d.left:d.top+d.height-b.top-c,this.space=(a?d.width:d.height)-c-this.offset*2;return this},start:function(a){return this.precalc().e2val(a)},move:function(a){return this.e2val(a)},shiftTo:function(a){var c=this.options,d=b.pow(10,c.round),e=c.direction==="x";a=b.round(a*d)/d,a<c.min&&(a=c.min),a>c.max&&(a=c.max);if(c.snap){var f=c.snap,g=(a-c.min)%f;a=g<f/2?a-g:a-g+f}var h=this.space/(c.max-c.min)*(a-c.min);this.handle._.style[e?"left":"bottom"]=h+"px",this.level._.style[e?"width":"height"]=(h>0?h:0)+2+"px",a!==this.value&&(this.value=a,this.fire("change",{value:a}));return this},e2val:function(a){var b=this.options,c=b.direction==="x",d=this.dims,e=this.offset,f=this.space,g=a.position()[c?"x":"y"]-e-this.hSize/2,h=c?d.left+e:d.top+e,i=(b.max-b.min)/f*(g-h);return this.shiftTo(c?b.min+i:b.max-i)}});g(a).on({ready:function(){h(".rui-slider").each(function(a){a instanceof n||(a=new n(a))})},mousedown:function(a){var b=a.find(".rui-slider");b&&(a.stop(),b instanceof n||(b=new n(b)),n.current=b.start(a))},mousemove:function(a){n.current&&n.current.move(a)},mouseup:function(a){n.current&&(n.current=!1)}}),g(window).onBlur(function(){n.current&&(n.current=!1)});var o=a.createElement("style"),p=a.createTextNode("div.rui-slider,div.rui-slider .handle div.rui-slider .level{margin:0;padding:0;border:none;background:none}div.rui-slider{height:0.4em;width:20em;border:1px solid #bbb;background:#F8F8F8;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;position:relative;margin:.6em 0;display:inline-block; *display:inline; *zoom:1;vertical-align:middle;user-select:none;-moz-user-select:none;-webkit-user-select:none;cursor:pointer}div.rui-slider .handle{font-size:25%;position:absolute;left:0;top:0;width:4pt;height:10pt;margin-top:-4pt;margin-left:0.4em;background:#BBB;border:1px solid #999;border-radius:.8em;-moz-border-radius:.8em;-webkit-border-radius:.8em;z-index:20}div.rui-slider .level{font-size:25%;position:absolute;top:0;left:0;width:0;height:100%;background:#ddd;z-index:1}div.rui-slider-vertical{height:10em;width:0.4em;margin:0 .3em}div.rui-slider-vertical .handle{top:auto;bottom:0;margin:0;margin-left:-4pt;margin-bottom:0.4em;height:5pt;width:10pt}div.rui-slider-vertical .level{height:0;width:100%;top:auto;bottom:0}");o.type="text/css",a.getElementsByTagName("head")[0].appendChild(o),o.styleSheet?o.styleSheet.cssText=p.nodeValue:o.appendChild(p);return n}(document,Math,RightJS)
|
@@ -98,7 +98,7 @@ function Widget(tag_name, methods) {
|
|
98
98
|
var Klass = new RightJS.Class(AbstractWidget, methods);
|
99
99
|
|
100
100
|
// creating the widget related shortcuts
|
101
|
-
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || []);
|
101
|
+
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || RightJS([]));
|
102
102
|
|
103
103
|
return Klass;
|
104
104
|
}
|
@@ -4,4 +4,4 @@
|
|
4
4
|
*
|
5
5
|
* Copyright (C) 2009-2011 Nikolay Nemshilov
|
6
6
|
*/
|
7
|
-
var Sortable=RightJS.Sortable=function(a,b){function c(a,c){c||(c=a,a="DIV");var d=new b.Class(b.Element.Wrappers[a]||b.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof b.Input||this instanceof b.Form||e.unshift(a),this.$super.apply(this,e),b.isString(d)&&(d=b.$(d)),d instanceof b.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return b.Wrapper.Cache[b.$uid(this._)]=this},setOptions:function(a,c){c&&(a=b.Object.merge(a,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),a&&b.Options.setOptions.call(this,b.Object.merge(this.options,a));return this}}),e=new b.Class(d,c);b.Observer.createShortcuts(e.prototype,e.EVENTS||[]);return e}var d=b,e=b.$,f=b.$w,g=b.isString,h=b.isArray,i=b.Object,j=new c("UL",{extend:{version:"2.2.0",EVENTS:f("start change finish"),Options:{url:null,method:"put",Xhr:{},idParam:"id",posParam:"position",parseId:!0,dragClass:"dragging",accept:null,minLength:1,itemCss:"li",handleCss:"li",cssRule:"*[data-sortable]"},current:!1,cast:function(a){a=e(a._),a instanceof j||(a=new j(a));return a}},initialize:function(a,b){this.$super("sortable",a).setOptions(b).addClass("rui-sortable").on("finish",this._tryXhr).on("selectstart","stopEvent")},setOptions:function(a,b){this.$super(a,b),a=this.options;var c=a.accept||[];h(c)||(c=[c]),a.accept=d([this].concat(c)).map(e).uniq();return this},items:function(){return this.children(this.options.itemCss)},startDrag:function(a){if(this.items().length>this.options.minLength){var b=a.find(this.options.itemCss),c=a.find(this.options.handleCss);b&&c&&(this._initDrag(b,a.position()),j.current=this,this.fire("start",this._evOpts(a)))}},moveItem:function(a){var b=a.position(),c=this.itemClone._.style,d=b.y-this.yRDiff,e=b.x-this.xRDiff,f=e+this.cloneWidth,g=d+this.cloneHeight;c.top=b.y-this.yDiff+"px",c.left=b.x-this.xDiff+"px";var h=this.suspects.first(function(a){return(d>a.top&&d<a.topHalf||g<a.bottom&&g>a.topHalf)&&(e>a.left&&e<a.leftHalf||f<a.right&&f>a.leftHalf)});h&&(c=h.item,c.insert(this.item,c.prevSiblings().include(this.item)?"after":"before"),this._findSuspects(),this.fire("change",this._evOpts(a,c)))},finishDrag:function(a){this.itemClone&&(this.itemClone.remove(),this.item.setStyle("visibility:visible")),j.current=!1,this.fire("finish",this._evOpts(a))},_evOpts:function(a,b){b=b||this.item;var c=j.cast(b.parent());return{list:c,item:b,event:a,index:c.items().indexOf(b)}},_initDrag:function(a,b){var c=this.dimensions(),d=a.dimensions(),e=a.clone().setStyle({margin:0,zIndex:9999,position:"absolute",top:"0px",left:"0px"}).addClass(this.options.dragClass).insertTo(this).setHeight(this.cloneHeight=d.height).setWidth(this.cloneWidth=d.width),f=e.position(),g=d.left-f.x,h=d.top-f.y;e.moveTo(g,h),this.item=a.setStyle("visibility:hidden"),this.itemClone=e,this.xDiff=b.x-g,this.yDiff=b.y-h,this.xRDiff=b.x-e.position().x,this.yRDiff=b.y-e.position().y,this._findSuspects()},_findSuspects:function(){var a=this.suspects=d([]),b=this.item,c=this.itemClone;this.options.accept.each(function(d){j.cast(d).items().each(function(d){if(d!==b&&d!==c){var e=d.dimensions();a.push({item:d,top:e.top,left:e.left,right:e.left+e.width,bottom:e.top+e.height,topHalf:e.top+e.height/2,leftHalf:e.left+e.width/2})}})})},_tryXhr:function(a){if(this.options.url){var c=d(this.options.url),e={},f=a.item,h=a.index+1,j=i.merge({method:this.options.method,params:{}},this.options.Xhr),k=f.get("id")||"";this.options.parseId&&k&&(k=(k.match(/\d+/)||[""])[0]),c.include("%{id}")?c=c.replace("%{id}",k):e[this.options.idParam]=k,e[this.options.posParam]=h,g(j.params)?j.params+="&"+i.toQueryString(e):j.params=i.merge(j.params,e),b.Xhr.load(c,j)}}});e(a).on({mousedown:function(a){var b=a.find(j.Options.cssRule+",*.rui-sortable");b&&j.cast(b).startDrag(a)},mousemove:function(a){j.current&&j.current.moveItem(a)},mouseup:function(a){j.current&&j.current.finishDrag(a)}}),e(window).onBlur(function(){j.current&&j.current.finishDrag()});var k=a.createElement("style"),l=a.createTextNode(".rui-sortable{user-select:none;-moz-user-select:none;-webkit-user-select:none}");k.type="text/css",a.getElementsByTagName("head")[0].appendChild(k),k.styleSheet?k.styleSheet.cssText=l.nodeValue:k.appendChild(l);return j}(document,RightJS)
|
7
|
+
var Sortable=RightJS.Sortable=function(a,b){function c(a,c){c||(c=a,a="DIV");var d=new b.Class(b.Element.Wrappers[a]||b.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof b.Input||this instanceof b.Form||e.unshift(a),this.$super.apply(this,e),b.isString(d)&&(d=b.$(d)),d instanceof b.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return b.Wrapper.Cache[b.$uid(this._)]=this},setOptions:function(a,c){c&&(a=b.Object.merge(a,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),a&&b.Options.setOptions.call(this,b.Object.merge(this.options,a));return this}}),e=new b.Class(d,c);b.Observer.createShortcuts(e.prototype,e.EVENTS||b([]));return e}var d=b,e=b.$,f=b.$w,g=b.isString,h=b.isArray,i=b.Object,j=new c("UL",{extend:{version:"2.2.0",EVENTS:f("start change finish"),Options:{url:null,method:"put",Xhr:{},idParam:"id",posParam:"position",parseId:!0,dragClass:"dragging",accept:null,minLength:1,itemCss:"li",handleCss:"li",cssRule:"*[data-sortable]"},current:!1,cast:function(a){a=e(a._),a instanceof j||(a=new j(a));return a}},initialize:function(a,b){this.$super("sortable",a).setOptions(b).addClass("rui-sortable").on("finish",this._tryXhr).on("selectstart","stopEvent")},setOptions:function(a,b){this.$super(a,b),a=this.options;var c=a.accept||[];h(c)||(c=[c]),a.accept=d([this].concat(c)).map(e).uniq();return this},items:function(){return this.children(this.options.itemCss)},startDrag:function(a){if(this.items().length>this.options.minLength){var b=a.find(this.options.itemCss),c=a.find(this.options.handleCss);b&&c&&(this._initDrag(b,a.position()),j.current=this,this.fire("start",this._evOpts(a)))}},moveItem:function(a){var b=a.position(),c=this.itemClone._.style,d=b.y-this.yRDiff,e=b.x-this.xRDiff,f=e+this.cloneWidth,g=d+this.cloneHeight;c.top=b.y-this.yDiff+"px",c.left=b.x-this.xDiff+"px";var h=this.suspects.first(function(a){return(d>a.top&&d<a.topHalf||g<a.bottom&&g>a.topHalf)&&(e>a.left&&e<a.leftHalf||f<a.right&&f>a.leftHalf)});h&&(c=h.item,c.insert(this.item,c.prevSiblings().include(this.item)?"after":"before"),this._findSuspects(),this.fire("change",this._evOpts(a,c)))},finishDrag:function(a){this.itemClone&&(this.itemClone.remove(),this.item.setStyle("visibility:visible")),j.current=!1,this.fire("finish",this._evOpts(a))},_evOpts:function(a,b){b=b||this.item;var c=j.cast(b.parent());return{list:c,item:b,event:a,index:c.items().indexOf(b)}},_initDrag:function(a,b){var c=this.dimensions(),d=a.dimensions(),e=a.clone().setStyle({margin:0,zIndex:9999,position:"absolute",top:"0px",left:"0px"}).addClass(this.options.dragClass).insertTo(this).setHeight(this.cloneHeight=d.height).setWidth(this.cloneWidth=d.width),f=e.position(),g=d.left-f.x,h=d.top-f.y;e.moveTo(g,h),this.item=a.setStyle("visibility:hidden"),this.itemClone=e,this.xDiff=b.x-g,this.yDiff=b.y-h,this.xRDiff=b.x-e.position().x,this.yRDiff=b.y-e.position().y,this._findSuspects()},_findSuspects:function(){var a=this.suspects=d([]),b=this.item,c=this.itemClone;this.options.accept.each(function(d){j.cast(d).items().each(function(d){if(d!==b&&d!==c){var e=d.dimensions();a.push({item:d,top:e.top,left:e.left,right:e.left+e.width,bottom:e.top+e.height,topHalf:e.top+e.height/2,leftHalf:e.left+e.width/2})}})})},_tryXhr:function(a){if(this.options.url){var c=d(this.options.url),e={},f=a.item,h=a.index+1,j=i.merge({method:this.options.method,params:{}},this.options.Xhr),k=f.get("id")||"";this.options.parseId&&k&&(k=(k.match(/\d+/)||[""])[0]),c.include("%{id}")?c=c.replace("%{id}",k):e[this.options.idParam]=k,e[this.options.posParam]=h,g(j.params)?j.params+="&"+i.toQueryString(e):j.params=i.merge(j.params,e),b.Xhr.load(c,j)}}});e(a).on({mousedown:function(a){var b=a.find(j.Options.cssRule+",*.rui-sortable");b&&j.cast(b).startDrag(a)},mousemove:function(a){j.current&&j.current.moveItem(a)},mouseup:function(a){j.current&&j.current.finishDrag(a)}}),e(window).onBlur(function(){j.current&&j.current.finishDrag()});var k=a.createElement("style"),l=a.createTextNode(".rui-sortable{user-select:none;-moz-user-select:none;-webkit-user-select:none}");k.type="text/css",a.getElementsByTagName("head")[0].appendChild(k),k.styleSheet?k.styleSheet.cssText=l.nodeValue:k.appendChild(l);return j}(document,RightJS)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* RightJS-UI Tabs v2.2.
|
2
|
+
* RightJS-UI Tabs v2.2.3
|
3
3
|
* http://rightjs.org/ui/tabs
|
4
4
|
*
|
5
5
|
* Copyright (C) 2009-2011 Nikolay Nemshilov
|
@@ -98,7 +98,7 @@ function Widget(tag_name, methods) {
|
|
98
98
|
var Klass = new RightJS.Class(AbstractWidget, methods);
|
99
99
|
|
100
100
|
// creating the widget related shortcuts
|
101
|
-
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || []);
|
101
|
+
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || RightJS([]));
|
102
102
|
|
103
103
|
return Klass;
|
104
104
|
}
|
@@ -176,7 +176,7 @@ var R = RightJS,
|
|
176
176
|
*/
|
177
177
|
var Tabs = new Widget('UL', {
|
178
178
|
extend: {
|
179
|
-
version: '2.2.
|
179
|
+
version: '2.2.3',
|
180
180
|
|
181
181
|
EVENTS: $w('select hide load disable enable add remove move'),
|
182
182
|
|
@@ -489,8 +489,10 @@ var Panel = Tabs.Panel = new Class(Element, {
|
|
489
489
|
// shows the panel
|
490
490
|
show: function() {
|
491
491
|
return this.resizing(function() {
|
492
|
-
this.tab.main.
|
493
|
-
panel[
|
492
|
+
this.tab.main.tabs.each(function(tab) {
|
493
|
+
tab.panel[
|
494
|
+
tab.panel === this ? 'addClass' : 'removeClass'
|
495
|
+
]('rui-tabs-current');
|
494
496
|
}, this);
|
495
497
|
});
|
496
498
|
},
|
@@ -522,7 +524,7 @@ var Panel = Tabs.Panel = new Class(Element, {
|
|
522
524
|
if (controller.__working) { return this.resizing.bind(this, callback).delay(100); }
|
523
525
|
|
524
526
|
var options = controller.options;
|
525
|
-
var prev_panel = controller.
|
527
|
+
var prev_panel = controller.tabs.map('panel').first('hasClass', 'rui-tabs-current');
|
526
528
|
var this_panel = this;
|
527
529
|
var swapping = prev_panel !== this_panel;
|
528
530
|
var loading = this.first('div.rui-tabs-panel-locker');
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
|
-
* RightJS-UI Tabs v2.2.
|
2
|
+
* RightJS-UI Tabs v2.2.3
|
3
3
|
* http://rightjs.org/ui/tabs
|
4
4
|
*
|
5
5
|
* Copyright (C) 2009-2011 Nikolay Nemshilov
|
6
6
|
*/
|
7
|
-
var Tabs=RightJS.Tabs=function(a,b,c){function w(a,b,d){if(c.Cookie){var e=v();e=e.without.apply(e,b.map("id")),e.push(d.target.id),r.set("right-tabs-indexes",e.uniq().join(","),a)}}function v(){return f(c.Cookie?(r.get("right-tabs-indexes")||"").split(","):[])}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||[]);return e}var e=new c.Class(c.Element,{initialize:function(a){this.$super("div",{"class":"rui-spinner"}),this.dots=[];for(var b=0;b<(a||4);b++)this.dots.push(new c.Element("div"));this.dots[0].addClass("glowing"),this.insert(this.dots),c(this.shift).bind(this).periodical(300)},shift:function(){if(this.visible()){var a=this.dots.pop();this.dots.unshift(a),this.insert(a,"top")}}}),f=c,g=c.$,h=c.$$,i=c.$w,j=c.$E,k=c.Fx,l=c.Object,m=c.Browser,n=c.isArray,o=c.isNumber,p=c.Class,q=c.Element,r=c.Cookie,s=new d("UL",{extend:{version:"2.2.2",EVENTS:i("select hide load disable enable add remove move"),Options:{idPrefix:"",tabsElement:null,resizeFx:"both",resizeDuration:400,scrollTabs:!1,scrollDuration:400,selected:null,disabled:null,closable:!1,loop:!1,loopPause:!0,url:!1,cache:!1,Xhr:null,Cookie:null},rescan:function(b){g(b||a).find(".rui-tabs,*[data-tabs]").each(function(a){a=a instanceof s?a:new s(a)})}},initialize:function(a,b){this.$super("tabs",a).setOptions(b).addClass("rui-tabs"),this.isHarmonica=this._.tagName==="DL",this.isCarousel=this.hasClass("rui-tabs-carousel"),this.isSimple=!this.isHarmonica&&!this.isCarousel,this.findTabs().initScrolls().findCurrent().setStyle("visibility:visible"),this.options.disabled&&this.disable(this.options.disabled),this.options.loop&&this.startLoop()},select:function(a){return this.callTab(a,"select")},disable:function(a){return this.callTab(a,"disable")},enable:function(a){return this.callTab(a,"enable")},current:function(){return this.tabs.first("current")},enabled:function(){return this.tabs.filter("enabled")},callTab:function(a,b){f(n(a)?a:[a]).each(function(a){o(a)&&(a=this.tabs[a]),a&&a instanceof t&&a[b]()},this);return this},findTabs:function(){this.tabsList=this.isHarmonica?this:g(this.options.tabsElement)||this.first(".rui-tabs-list")||(this.first("UL")||j("UL").insertTo(this)).addClass("rui-tabs-list"),this.tabs=f([]),this.tabsList.children(this.isHarmonica?"dt":null).map(function(a){this.tabs.push(new t(a,this))},this);for(var a=0,b=this.tabsList.get("childNodes");a<b.length;a++)b[a].nodeType==3&&this.tabsList._.removeChild(b[a]);return this}}),t=s.Tab=new p(q,{extend:{autoId:0},initialize:function(a,b){this.$super(a._),this.addClass("rui-tabs-tab"),this.main=b,this.link=this.first("a"),this.id=this.link.get("href").split("#")[1]||t.autoId++,this.panel=new u(this.findPanel(),this),this.current()&&this.select(),b.options.closable&&this.link.insert(j("div",{"class":"rui-tabs-tab-close-icon",html:"×"}).onClick(f(this.remove).bind(this))),this.onClick(this._clicked)},select:function(){if(this.enabled()){var a=this.main.current();a&&a.removeClass("rui-tabs-current").fire("hide"),this.addClass("rui-tabs-current"),this.main.scrollToTab(this),this.panel.show()}return this.fire("select")},disable:function(){return this.addClass("rui-tabs-disabled").fire("disable")},enable:function(){return this.removeClass("rui-tabs-disabled").fire("enable")},disabled:function(){return!this.enabled()},enabled:function(){return!this.hasClass("rui-tabs-disabled")},current:function(){return this.hasClass("rui-tabs-current")},remove:function(a){a&&a.stop();if(this.current()){var b=this.main.enabled(),c=b[b.indexOf(this)+1]||b[b.indexOf(this)-1];c&&c.select()}this.main.tabs.splice(this.main.tabs.indexOf(this),1),this.panel.remove();var d=this.parent();this.fire("beforeremove"),this.$super(),d.fire("remove",{target:this});return this},_clicked:function(a){a.stop();return this.select()},findPanel:function(){var a=this.main,b=a.options.idPrefix+this.id,c;if(a.isHarmonica){var d=this.next();c=d&&d._.tagName==="DD"?d:j("DD").insertTo(this,"after")}else c=g(b)||j(a._.tagName==="UL"?"LI":"DIV").insertTo(a);return c.set("id",b)},width:function(){var a=this.next();return a?a.position().x-this.position().x:this.size().x+1}}),u=s.Panel=new p(q,{initialize:function(a,b){this.$super(a._),this.addClass("rui-tabs-panel"),this.tab=b,this.id=this.get("id")},show:function(){return this.resizing(function(){this.tab.main.find(".rui-tabs-panel").each(function(a){a[a===this?"addClass":"removeClass"]("rui-tabs-current")},this)})},update:function(a){this.tab.current()?this.resizing(function(){q.prototype.update.call(this,a||"")}):this.$super(a||"");return this},lock:function(){this.insert(this.locker(),"top")},resizing:function(a){var b=this.tab.main;if(b.__working)return this.resizing.bind(this,a).delay(100);var d=b.options,e=b.first(".rui-tabs-panel.rui-tabs-current"),f=this,g=e!==f,h=this.first("div.rui-tabs-panel-locker");f.parent().hasClass("rui-tabs-resizer")&&f.insertTo(e.parent());if(d.resizeFx&&c.Fx&&e&&(g||h)){b.__working=!0;var i=function(){b.__working=!1},l=d.resizeFx==="both"&&h?"slide":d.resizeFx,m=d.resizeDuration;m=k.Durations[m]||m;var n=l==="fade"?0:l==="slide"?m:m/2,o=m-n;l!=="slide"&&f.setStyle({opacity:0});var p=b.isHarmonica&&g?0:e.size().y;a.call(this);var q=f.size().y,r=null,s=null,t=null;l!=="fade"&&p!==q?(b._.style.height=b.size().y+"px",r=j("div",{"class":"rui-tabs-resizer",style:"height: "+p+"px"}),b.isHarmonica&&g&&(e.addClass("rui-tabs-current"),s=j("div",{"class":"rui-tabs-resizer"}),s._.style.height=e.size().y+"px",t=function(){s.replace(e.removeClass("rui-tabs-current"))},e.wrap(s),r._.style.height="0px"),f.wrap(r),b._.style.height="auto"):(rezise_duration=0,m=o);var u=0,v=function(){if(r){if(l=="both"&&!u)return u++;r.replace(f)}i()};s&&s.morph({height:"0px"},{duration:n,onFinish:t}),r&&r.morph({height:q+"px"},{duration:n,onFinish:v}),l!=="slide"&&f.morph.bind(f,{opacity:1},{duration:o,onFinish:v}).delay(n),!r&&l==="slide"&&v()}else a.call(this);return this},locker:function(){return this._locker||(this._locker=j("div",{"class":"rui-tabs-panel-locker"}).insert(new e(5)))}});s.include({next:function(){return this.pickTab(+1)},prev:function(){return this.pickTab(-1)},scrollLeft:function(){this.prevButton.hasClass("rui-tabs-scroller-disabled")||this[this.isCarousel?"prev":"justScroll"](+.6);return this},scrollRight:function(){this.nextButton.hasClass("rui-tabs-scroller-disabled")||this[this.isCarousel?"next":"justScroll"](-.6);return this},initScrolls:function(){(this.scrollable=this.options.scrollTabs||this.isCarousel)&&this.buildScroller();return this},buildScroller:function(){if(!(this.prevButton=this.first(".rui-tabs-scroller-prev"))||!(this.nextButton=this.first(".rui-tabs-scroller-next")))this.prevButton=j("div",{"class":"rui-tabs-scroller-prev",html:"«"}),this.nextButton=j("div",{"class":"rui-tabs-scroller-next",html:"»"}),j("div").insertTo(this.tabsList,"before").replace(j("div",{"class":"rui-tabs-scroller"}).insert([this.prevButton,this.nextButton,this.scroller=j("div",{"class":"rui-tabs-scroller-body"}).insert(this.tabsList)])).remove();this.prevButton.onClick(f(this.scrollLeft).bind(this)),this.nextButton.onClick(f(this.scrollRight).bind(this))},pickTab:function(a){var b=this.current();if(b&&b.enabled()){var c=this.enabled(),d=c[c.indexOf(b)+a];d&&d.select()}},scrollToTab:function(a){if(this.scroller){var c=0;for(var d=0;d<this.tabs.length;d++){c+=this.tabs[d].width();if(this.tabs[d]===a)break}var e=this.scroller.size().x,f=(this.isCarousel?e/2+a.width()/2:e)-c;if(!this.isCarousel){var g=b(this.tabsList.getStyle("left")||0,10);f>=g&&f<g+e-a.width()?f=g:g>-c&&g<=a.width()-c&&(f=a.width()-c)}this.scrollTo(f)}},justScroll:function(a){if(!this.scroller)return this;var c=b(this.tabsList.getStyle("left")||0,10),d=this.scroller.size().x;this.scrollTo(c+d*a)},scrollTo:function(a){var b=this.scroller.size().x,c=this.tabs.map("width").sum();a<b-c&&(a=b-c),a>0&&(a=0),this.tabsList.morph({left:a+"px"},{duration:this.options.scrollDuration}),this.checkScrollButtons(c,b,a)},checkScrollButtons:function(a,b,c){var d=!1,e=!1;if(this.isCarousel){var f=this.enabled(),g=f.first("current");if(g){var h=f.indexOf(g);d=h>0,e=h<f.length-1}}else d=c!==0,e=c>b-a;this.prevButton[d?"removeClass":"addClass"]("rui-tabs-scroller-disabled"),this.nextButton[e?"removeClass":"addClass"]("rui-tabs-scroller-disabled")}}),s.include({findCurrent:function(){var a=this.enabled(),b=this.tabs[this.options.selected]||this.tabs[this.urlIndex()]||this.tabs[this.cookieIndex()]||a.first("current")||a[0];b&&b.select(),this.options.Cookie&&this.onSelect(f(w).curry(this.options.Cookie,this.tabs));return this},urlIndex:function(){var b=-1,c=a.location.href.split("#")[1];if(c)for(var d=0;d<this.tabs.length;d++)if(this.tabs[d].id==c){b=d;break}return b},cookieIndex:function(){var a=-1;if(this.options.Cookie){var b=v();for(var c=0;c<this.tabs.length;c++)if(b.include(this.tabs[c].id)){a=c;break}}return a}}),s.include({add:function(a,b,c){c=c||{};var d=j(this.isHarmonica?"dt":"li").insert(j("a",{html:a,href:c.url||"#"+(c.id||"")})).insertTo(this.tabsList),e=new t(d,this);e.panel.update(b||""),this.tabs.push(e),e.fire("add"),"position"in c&&this.move(e,c.position);return this},move:function(a,b){a=this.tabs[a]||a,this.tabs[b]&&this.tabs[b]!==a&&(this.tabs[b].insert(a,b===this.tabs.length-1?"after":"before"),this.isHarmonica&&a.insert(a.panel,"after"),this.tabs.splice(this.tabs.indexOf(a),1),this.tabs.splice(b,0,a),a.fire("move",{index:b}));return this},remove:function(a){return arguments.length===0?this.$super():this.callTab(a,"remove")}});var x=t.prototype.select;t.include({select:function(){if(this.dogPiling(arguments))return this;var a=x.apply(this,arguments),b=f(this.link.get("href")),d=this.main.options;b.includes("#")&&(b=d.url?d.url.replace("%{id}",b.split("#")[1]):null);if(b&&!this.request&&(!d.cache&&!this.cache)){this.panel.lock();try{this.request=(new c.Xhr(b,l.merge({method:"get"},d.Xhr))).onComplete(f(function(a){if(this.main.__working)return arguments.callee.bind(this,a).delay(100);this.panel.update(a.text),this.request=null,d.cache&&(this.cache=!0),this.fire("load")}).bind(this)).send()}catch(e){if(!m.OLD)throw e}}return a},dogPiling:function(a){if(this.main.__working){this.main.__timeout&&this.main.__timeout.cancel(),this.main.__timeout=f(function(a){this.select.apply(this,a)}).bind(this,a).delay(100);return!0}return this.main.__timeout=null}}),s.include({startLoop:function(a){if(!a&&!this.options.loop)return this;this.options.loopPause&&(this._stopLoop=this._stopLoop||f(this.stopLoop).bind(this,!0),this._startLoop=this._startLoop||f(this.startLoop).bind(this,a),this.forgetHovers().on({mouseover:this._stopLoop,mouseout:this._startLoop})),this.timer&&this.timer.stop(),this.timer=f(function(){var a=this.enabled(),b=this.current(),c=a[a.indexOf(b)+1];this.select(c||a.first())}).bind(this).periodical(this.options.loop||a);return this},stopLoop:function(a,b){this.timer&&(this.timer.stop(),this.timer=null),!b&&this._startLoop&&this.forgetHovers()},forgetHovers:function(){return this.stopObserving("mouseover",this._stopLoop).stopObserving("mouseout",this._startLoop)}}),g(a).onReady(function(){s.rescan()});var y=a.createElement("style"),z=a.createTextNode("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}.rui-tabs,.rui-tabs-list,.rui-tabs-tab,.rui-tabs-panel,.rui-tabs-scroll-left,.rui-tabs-scroll-right,.rui-tabs-scroll-body,.rui-tabs-panel-locker,.rui-tabs-resizer{margin:0;padding:0;background:none;border:none;list-style:none;display:block;width:auto;height:auto}.rui-tabs{display:block;visibility:hidden;border-bottom:1px solid #CCC}.rui-tabs-resizer{overflow:hidden}.rui-tabs-list{display:block;position:relative;padding:0 .5em;border-bottom:1px solid #CCC;white-space:nowrap}.rui-tabs-list .rui-tabs-tab,.rui-tabs-tab *,.rui-tabs-tab *:hover{display:inline-block; *display:inline; *zoom:1;cursor:pointer;text-decoration:none;vertical-align:center}.rui-tabs-list .rui-tabs-tab{vertical-align:bottom;margin-right:.1em}.rui-tabs-tab a{outline:none;position:relative;border:1px solid #CCC;background:#DDD;color:#444;padding:.3em 1em;border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-bottom:none;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}.rui-tabs-tab a:hover{border-color:#CCC;background:#EEE}.rui-tabs-list .rui-tabs-current a,.rui-tabs-list .rui-tabs-current a:hover{font-weight:bold;color:#000;background:#FFF;border-bottom:1px solid #FFF;border-top-width:2px;padding-top:.34em;padding-bottom:.34em;top:1px}.rui-tabs-tab a img{border:none;opacity:.6;filter:alpha(opacity=60)}.rui-tabs-tab a:hover img,.rui-tabs-list .rui-tabs-current a img{opacity:1;filter:alpha(opacity=100)}.rui-tabs-disabled a,.rui-tabs-disabled a:hover{background:#EEE;border-color:#DDD;color:#AAA;cursor:default}.rui-tabs-disabled a img,.rui-tabs-disabled a:hover img{opacity:.5;filter:alpha(opacity=50)}.rui-tabs-tab-close-icon{display:inline-block; *display:inline; *zoom:1;margin-right:-0.5em;margin-left:0.5em;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}.rui-tabs-tab-close-icon:hover{opacity:1;filter:alpha(opacity=100);color:#B00;text-shadow:#888 .15em .15em .2em}.rui-tabs-panel{display:none;position:relative;min-height:4em;padding:.5em 0}.rui-tabs-current{display:block}.rui-tabs-scroller{position:relative;padding:0 1.4em}.rui-tabs-scroller-prev,.rui-tabs-scroller-next{width:1.1em;text-align:center;background:#EEE;color:#666;cursor:pointer;border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;position:absolute;bottom:0px;left:0px;padding:0.3em 0;user-select:none;-moz-user-select:none;-webkit-user-select:none}.rui-tabs-scroller-prev:hover,.rui-tabs-scroller-next:hover{color:#000;background:#DDD;border-color:#AAA}.rui-tabs-scroller-prev:active,.rui-tabs-scroller-next:active{background:#eee;border-color:#ccc}.rui-tabs-scroller-next{left:auto;right:0px}.rui-tabs-scroller-disabled,.rui-tabs-scroller-disabled:hover{cursor:default;background:#DDD;border-color:#DDD;color:#AAA}.rui-tabs-scroller-body{overflow:hidden;width:100%;position:relative}.rui-tabs-scroller .rui-tabs-list{padding-left:0;padding-right:0;width:9999em;z-index:10}.rui-tabs-panel-locker{position:absolute;top:0px;left:0px;opacity:0.5;filter:alpha(opacity=50);background:#CCC;width:100%;height:100%;text-align:center}.rui-tabs-panel-locker .rui-spinner{position:absolute;left:44%;top:44%;background:none;border:none;height:2em}.rui-tabs-panel-locker .rui-spinner div{background:#666;width:.65em;margin-left:.15em}.rui-tabs-panel-locker .rui-spinner div.glowing{background:#000}.rui-tabs-carousel .rui-tabs-list{border:none}.rui-tabs-carousel .rui-tabs-tab a,.rui-tabs-carousel .rui-tabs-scroller .rui-tabs-scroller-prev,.rui-tabs-carousel .rui-tabs-scroller .rui-tabs-scroller-next{height:6em;line-height:6em;padding:0;border-bottom:1px solid #ccc;border-radius:.25em;-moz-border-radius:.25em;-webkit-border-radius:.25em}.rui-tabs-carousel .rui-tabs-tab{margin-right:3px}.rui-tabs-carousel .rui-tabs-tab a img{border:1px solid #CCC;vertical-align:middle;margin:.4em;padding:0;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0}.rui-tabs-carousel .rui-tabs-list .rui-tabs-current a{border-width:1px;border-color:#AAA;padding:0;top:auto}.rui-tabs-carousel .rui-tabs-list .rui-tabs-current a img{border-color:#bbb}.rui-tabs-carousel .rui-tabs-panel{text-align:center}dl.rui-tabs{border:none}dt.rui-tabs-tab,dt.rui-tabs-tab a,dt.rui-tabs-tab a:hover{display:block;float:none}dt.rui-tabs-tab a,dt.rui-tabs-tab a:hover{padding:.2em 1em;border:1px solid #ccc;border-radius:.25em;-moz-border-radius:.3em;-webkit-border-radius:.3em}dl.rui-tabs dt.rui-tabs-current a{background:#EEE;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}dl.rui-tabs dd.rui-tabs-current+dt.rui-tabs-tab a{border-top-left-radius:0;border-top-right-radius:0;-moz-border-radius-topleft:0;-moz-border-radius-topright:0;-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:0}");y.type="text/css",a.getElementsByTagName("head")[0].appendChild(y),y.styleSheet?y.styleSheet.cssText=z.nodeValue:y.appendChild(z);return s}(document,parseInt,RightJS)
|
7
|
+
var Tabs=RightJS.Tabs=function(a,b,c){function w(a,b,d){if(c.Cookie){var e=v();e=e.without.apply(e,b.map("id")),e.push(d.target.id),r.set("right-tabs-indexes",e.uniq().join(","),a)}}function v(){return f(c.Cookie?(r.get("right-tabs-indexes")||"").split(","):[])}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){this.$super("div",{"class":"rui-spinner"}),this.dots=[];for(var b=0;b<(a||4);b++)this.dots.push(new c.Element("div"));this.dots[0].addClass("glowing"),this.insert(this.dots),c(this.shift).bind(this).periodical(300)},shift:function(){if(this.visible()){var a=this.dots.pop();this.dots.unshift(a),this.insert(a,"top")}}}),f=c,g=c.$,h=c.$$,i=c.$w,j=c.$E,k=c.Fx,l=c.Object,m=c.Browser,n=c.isArray,o=c.isNumber,p=c.Class,q=c.Element,r=c.Cookie,s=new d("UL",{extend:{version:"2.2.3",EVENTS:i("select hide load disable enable add remove move"),Options:{idPrefix:"",tabsElement:null,resizeFx:"both",resizeDuration:400,scrollTabs:!1,scrollDuration:400,selected:null,disabled:null,closable:!1,loop:!1,loopPause:!0,url:!1,cache:!1,Xhr:null,Cookie:null},rescan:function(b){g(b||a).find(".rui-tabs,*[data-tabs]").each(function(a){a=a instanceof s?a:new s(a)})}},initialize:function(a,b){this.$super("tabs",a).setOptions(b).addClass("rui-tabs"),this.isHarmonica=this._.tagName==="DL",this.isCarousel=this.hasClass("rui-tabs-carousel"),this.isSimple=!this.isHarmonica&&!this.isCarousel,this.findTabs().initScrolls().findCurrent().setStyle("visibility:visible"),this.options.disabled&&this.disable(this.options.disabled),this.options.loop&&this.startLoop()},select:function(a){return this.callTab(a,"select")},disable:function(a){return this.callTab(a,"disable")},enable:function(a){return this.callTab(a,"enable")},current:function(){return this.tabs.first("current")},enabled:function(){return this.tabs.filter("enabled")},callTab:function(a,b){f(n(a)?a:[a]).each(function(a){o(a)&&(a=this.tabs[a]),a&&a instanceof t&&a[b]()},this);return this},findTabs:function(){this.tabsList=this.isHarmonica?this:g(this.options.tabsElement)||this.first(".rui-tabs-list")||(this.first("UL")||j("UL").insertTo(this)).addClass("rui-tabs-list"),this.tabs=f([]),this.tabsList.children(this.isHarmonica?"dt":null).map(function(a){this.tabs.push(new t(a,this))},this);for(var a=0,b=this.tabsList.get("childNodes");a<b.length;a++)b[a].nodeType==3&&this.tabsList._.removeChild(b[a]);return this}}),t=s.Tab=new p(q,{extend:{autoId:0},initialize:function(a,b){this.$super(a._),this.addClass("rui-tabs-tab"),this.main=b,this.link=this.first("a"),this.id=this.link.get("href").split("#")[1]||t.autoId++,this.panel=new u(this.findPanel(),this),this.current()&&this.select(),b.options.closable&&this.link.insert(j("div",{"class":"rui-tabs-tab-close-icon",html:"×"}).onClick(f(this.remove).bind(this))),this.onClick(this._clicked)},select:function(){if(this.enabled()){var a=this.main.current();a&&a.removeClass("rui-tabs-current").fire("hide"),this.addClass("rui-tabs-current"),this.main.scrollToTab(this),this.panel.show()}return this.fire("select")},disable:function(){return this.addClass("rui-tabs-disabled").fire("disable")},enable:function(){return this.removeClass("rui-tabs-disabled").fire("enable")},disabled:function(){return!this.enabled()},enabled:function(){return!this.hasClass("rui-tabs-disabled")},current:function(){return this.hasClass("rui-tabs-current")},remove:function(a){a&&a.stop();if(this.current()){var b=this.main.enabled(),c=b[b.indexOf(this)+1]||b[b.indexOf(this)-1];c&&c.select()}this.main.tabs.splice(this.main.tabs.indexOf(this),1),this.panel.remove();var d=this.parent();this.fire("beforeremove"),this.$super(),d.fire("remove",{target:this});return this},_clicked:function(a){a.stop();return this.select()},findPanel:function(){var a=this.main,b=a.options.idPrefix+this.id,c;if(a.isHarmonica){var d=this.next();c=d&&d._.tagName==="DD"?d:j("DD").insertTo(this,"after")}else c=g(b)||j(a._.tagName==="UL"?"LI":"DIV").insertTo(a);return c.set("id",b)},width:function(){var a=this.next();return a?a.position().x-this.position().x:this.size().x+1}}),u=s.Panel=new p(q,{initialize:function(a,b){this.$super(a._),this.addClass("rui-tabs-panel"),this.tab=b,this.id=this.get("id")},show:function(){return this.resizing(function(){this.tab.main.tabs.each(function(a){a.panel[a.panel===this?"addClass":"removeClass"]("rui-tabs-current")},this)})},update:function(a){this.tab.current()?this.resizing(function(){q.prototype.update.call(this,a||"")}):this.$super(a||"");return this},lock:function(){this.insert(this.locker(),"top")},resizing:function(a){var b=this.tab.main;if(b.__working)return this.resizing.bind(this,a).delay(100);var d=b.options,e=b.tabs.map("panel").first("hasClass","rui-tabs-current"),f=this,g=e!==f,h=this.first("div.rui-tabs-panel-locker");f.parent().hasClass("rui-tabs-resizer")&&f.insertTo(e.parent());if(d.resizeFx&&c.Fx&&e&&(g||h)){b.__working=!0;var i=function(){b.__working=!1},l=d.resizeFx==="both"&&h?"slide":d.resizeFx,m=d.resizeDuration;m=k.Durations[m]||m;var n=l==="fade"?0:l==="slide"?m:m/2,o=m-n;l!=="slide"&&f.setStyle({opacity:0});var p=b.isHarmonica&&g?0:e.size().y;a.call(this);var q=f.size().y,r=null,s=null,t=null;l!=="fade"&&p!==q?(b._.style.height=b.size().y+"px",r=j("div",{"class":"rui-tabs-resizer",style:"height: "+p+"px"}),b.isHarmonica&&g&&(e.addClass("rui-tabs-current"),s=j("div",{"class":"rui-tabs-resizer"}),s._.style.height=e.size().y+"px",t=function(){s.replace(e.removeClass("rui-tabs-current"))},e.wrap(s),r._.style.height="0px"),f.wrap(r),b._.style.height="auto"):(rezise_duration=0,m=o);var u=0,v=function(){if(r){if(l=="both"&&!u)return u++;r.replace(f)}i()};s&&s.morph({height:"0px"},{duration:n,onFinish:t}),r&&r.morph({height:q+"px"},{duration:n,onFinish:v}),l!=="slide"&&f.morph.bind(f,{opacity:1},{duration:o,onFinish:v}).delay(n),!r&&l==="slide"&&v()}else a.call(this);return this},locker:function(){return this._locker||(this._locker=j("div",{"class":"rui-tabs-panel-locker"}).insert(new e(5)))}});s.include({next:function(){return this.pickTab(+1)},prev:function(){return this.pickTab(-1)},scrollLeft:function(){this.prevButton.hasClass("rui-tabs-scroller-disabled")||this[this.isCarousel?"prev":"justScroll"](+.6);return this},scrollRight:function(){this.nextButton.hasClass("rui-tabs-scroller-disabled")||this[this.isCarousel?"next":"justScroll"](-.6);return this},initScrolls:function(){(this.scrollable=this.options.scrollTabs||this.isCarousel)&&this.buildScroller();return this},buildScroller:function(){if(!(this.prevButton=this.first(".rui-tabs-scroller-prev"))||!(this.nextButton=this.first(".rui-tabs-scroller-next")))this.prevButton=j("div",{"class":"rui-tabs-scroller-prev",html:"«"}),this.nextButton=j("div",{"class":"rui-tabs-scroller-next",html:"»"}),j("div").insertTo(this.tabsList,"before").replace(j("div",{"class":"rui-tabs-scroller"}).insert([this.prevButton,this.nextButton,this.scroller=j("div",{"class":"rui-tabs-scroller-body"}).insert(this.tabsList)])).remove();this.prevButton.onClick(f(this.scrollLeft).bind(this)),this.nextButton.onClick(f(this.scrollRight).bind(this))},pickTab:function(a){var b=this.current();if(b&&b.enabled()){var c=this.enabled(),d=c[c.indexOf(b)+a];d&&d.select()}},scrollToTab:function(a){if(this.scroller){var c=0;for(var d=0;d<this.tabs.length;d++){c+=this.tabs[d].width();if(this.tabs[d]===a)break}var e=this.scroller.size().x,f=(this.isCarousel?e/2+a.width()/2:e)-c;if(!this.isCarousel){var g=b(this.tabsList.getStyle("left")||0,10);f>=g&&f<g+e-a.width()?f=g:g>-c&&g<=a.width()-c&&(f=a.width()-c)}this.scrollTo(f)}},justScroll:function(a){if(!this.scroller)return this;var c=b(this.tabsList.getStyle("left")||0,10),d=this.scroller.size().x;this.scrollTo(c+d*a)},scrollTo:function(a){var b=this.scroller.size().x,c=this.tabs.map("width").sum();a<b-c&&(a=b-c),a>0&&(a=0),this.tabsList.morph({left:a+"px"},{duration:this.options.scrollDuration}),this.checkScrollButtons(c,b,a)},checkScrollButtons:function(a,b,c){var d=!1,e=!1;if(this.isCarousel){var f=this.enabled(),g=f.first("current");if(g){var h=f.indexOf(g);d=h>0,e=h<f.length-1}}else d=c!==0,e=c>b-a;this.prevButton[d?"removeClass":"addClass"]("rui-tabs-scroller-disabled"),this.nextButton[e?"removeClass":"addClass"]("rui-tabs-scroller-disabled")}}),s.include({findCurrent:function(){var a=this.enabled(),b=this.tabs[this.options.selected]||this.tabs[this.urlIndex()]||this.tabs[this.cookieIndex()]||a.first("current")||a[0];b&&b.select(),this.options.Cookie&&this.onSelect(f(w).curry(this.options.Cookie,this.tabs));return this},urlIndex:function(){var b=-1,c=a.location.href.split("#")[1];if(c)for(var d=0;d<this.tabs.length;d++)if(this.tabs[d].id==c){b=d;break}return b},cookieIndex:function(){var a=-1;if(this.options.Cookie){var b=v();for(var c=0;c<this.tabs.length;c++)if(b.include(this.tabs[c].id)){a=c;break}}return a}}),s.include({add:function(a,b,c){c=c||{};var d=j(this.isHarmonica?"dt":"li").insert(j("a",{html:a,href:c.url||"#"+(c.id||"")})).insertTo(this.tabsList),e=new t(d,this);e.panel.update(b||""),this.tabs.push(e),e.fire("add"),"position"in c&&this.move(e,c.position);return this},move:function(a,b){a=this.tabs[a]||a,this.tabs[b]&&this.tabs[b]!==a&&(this.tabs[b].insert(a,b===this.tabs.length-1?"after":"before"),this.isHarmonica&&a.insert(a.panel,"after"),this.tabs.splice(this.tabs.indexOf(a),1),this.tabs.splice(b,0,a),a.fire("move",{index:b}));return this},remove:function(a){return arguments.length===0?this.$super():this.callTab(a,"remove")}});var x=t.prototype.select;t.include({select:function(){if(this.dogPiling(arguments))return this;var a=x.apply(this,arguments),b=f(this.link.get("href")),d=this.main.options;b.includes("#")&&(b=d.url?d.url.replace("%{id}",b.split("#")[1]):null);if(b&&!this.request&&(!d.cache&&!this.cache)){this.panel.lock();try{this.request=(new c.Xhr(b,l.merge({method:"get"},d.Xhr))).onComplete(f(function(a){if(this.main.__working)return arguments.callee.bind(this,a).delay(100);this.panel.update(a.text),this.request=null,d.cache&&(this.cache=!0),this.fire("load")}).bind(this)).send()}catch(e){if(!m.OLD)throw e}}return a},dogPiling:function(a){if(this.main.__working){this.main.__timeout&&this.main.__timeout.cancel(),this.main.__timeout=f(function(a){this.select.apply(this,a)}).bind(this,a).delay(100);return!0}return this.main.__timeout=null}}),s.include({startLoop:function(a){if(!a&&!this.options.loop)return this;this.options.loopPause&&(this._stopLoop=this._stopLoop||f(this.stopLoop).bind(this,!0),this._startLoop=this._startLoop||f(this.startLoop).bind(this,a),this.forgetHovers().on({mouseover:this._stopLoop,mouseout:this._startLoop})),this.timer&&this.timer.stop(),this.timer=f(function(){var a=this.enabled(),b=this.current(),c=a[a.indexOf(b)+1];this.select(c||a.first())}).bind(this).periodical(this.options.loop||a);return this},stopLoop:function(a,b){this.timer&&(this.timer.stop(),this.timer=null),!b&&this._startLoop&&this.forgetHovers()},forgetHovers:function(){return this.stopObserving("mouseover",this._stopLoop).stopObserving("mouseout",this._startLoop)}}),g(a).onReady(function(){s.rescan()});var y=a.createElement("style"),z=a.createTextNode("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}.rui-tabs,.rui-tabs-list,.rui-tabs-tab,.rui-tabs-panel,.rui-tabs-scroll-left,.rui-tabs-scroll-right,.rui-tabs-scroll-body,.rui-tabs-panel-locker,.rui-tabs-resizer{margin:0;padding:0;background:none;border:none;list-style:none;display:block;width:auto;height:auto}.rui-tabs{display:block;visibility:hidden;border-bottom:1px solid #CCC}.rui-tabs-resizer{overflow:hidden}.rui-tabs-list{display:block;position:relative;padding:0 .5em;border-bottom:1px solid #CCC;white-space:nowrap}.rui-tabs-list .rui-tabs-tab,.rui-tabs-tab *,.rui-tabs-tab *:hover{display:inline-block; *display:inline; *zoom:1;cursor:pointer;text-decoration:none;vertical-align:center}.rui-tabs-list .rui-tabs-tab{vertical-align:bottom;margin-right:.1em}.rui-tabs-tab a{outline:none;position:relative;border:1px solid #CCC;background:#DDD;color:#444;padding:.3em 1em;border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-bottom:none;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}.rui-tabs-tab a:hover{border-color:#CCC;background:#EEE}.rui-tabs-list .rui-tabs-current a,.rui-tabs-list .rui-tabs-current a:hover{font-weight:bold;color:#000;background:#FFF;border-bottom:1px solid #FFF;border-top-width:2px;padding-top:.34em;padding-bottom:.34em;top:1px}.rui-tabs-tab a img{border:none;opacity:.6;filter:alpha(opacity=60)}.rui-tabs-tab a:hover img,.rui-tabs-list .rui-tabs-current a img{opacity:1;filter:alpha(opacity=100)}.rui-tabs-disabled a,.rui-tabs-disabled a:hover{background:#EEE;border-color:#DDD;color:#AAA;cursor:default}.rui-tabs-disabled a img,.rui-tabs-disabled a:hover img{opacity:.5;filter:alpha(opacity=50)}.rui-tabs-tab-close-icon{display:inline-block; *display:inline; *zoom:1;margin-right:-0.5em;margin-left:0.5em;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}.rui-tabs-tab-close-icon:hover{opacity:1;filter:alpha(opacity=100);color:#B00;text-shadow:#888 .15em .15em .2em}.rui-tabs-panel{display:none;position:relative;min-height:4em;padding:.5em 0}.rui-tabs-current{display:block}.rui-tabs-scroller{position:relative;padding:0 1.4em}.rui-tabs-scroller-prev,.rui-tabs-scroller-next{width:1.1em;text-align:center;background:#EEE;color:#666;cursor:pointer;border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;position:absolute;bottom:0px;left:0px;padding:0.3em 0;user-select:none;-moz-user-select:none;-webkit-user-select:none}.rui-tabs-scroller-prev:hover,.rui-tabs-scroller-next:hover{color:#000;background:#DDD;border-color:#AAA}.rui-tabs-scroller-prev:active,.rui-tabs-scroller-next:active{background:#eee;border-color:#ccc}.rui-tabs-scroller-next{left:auto;right:0px}.rui-tabs-scroller-disabled,.rui-tabs-scroller-disabled:hover{cursor:default;background:#DDD;border-color:#DDD;color:#AAA}.rui-tabs-scroller-body{overflow:hidden;width:100%;position:relative}.rui-tabs-scroller .rui-tabs-list{padding-left:0;padding-right:0;width:9999em;z-index:10}.rui-tabs-panel-locker{position:absolute;top:0px;left:0px;opacity:0.5;filter:alpha(opacity=50);background:#CCC;width:100%;height:100%;text-align:center}.rui-tabs-panel-locker .rui-spinner{position:absolute;left:44%;top:44%;background:none;border:none;height:2em}.rui-tabs-panel-locker .rui-spinner div{background:#666;width:.65em;margin-left:.15em}.rui-tabs-panel-locker .rui-spinner div.glowing{background:#000}.rui-tabs-carousel .rui-tabs-list{border:none}.rui-tabs-carousel .rui-tabs-tab a,.rui-tabs-carousel .rui-tabs-scroller .rui-tabs-scroller-prev,.rui-tabs-carousel .rui-tabs-scroller .rui-tabs-scroller-next{height:6em;line-height:6em;padding:0;border-bottom:1px solid #ccc;border-radius:.25em;-moz-border-radius:.25em;-webkit-border-radius:.25em}.rui-tabs-carousel .rui-tabs-tab{margin-right:3px}.rui-tabs-carousel .rui-tabs-tab a img{border:1px solid #CCC;vertical-align:middle;margin:.4em;padding:0;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0}.rui-tabs-carousel .rui-tabs-list .rui-tabs-current a{border-width:1px;border-color:#AAA;padding:0;top:auto}.rui-tabs-carousel .rui-tabs-list .rui-tabs-current a img{border-color:#bbb}.rui-tabs-carousel .rui-tabs-panel{text-align:center}dl.rui-tabs{border:none}dt.rui-tabs-tab,dt.rui-tabs-tab a,dt.rui-tabs-tab a:hover{display:block;float:none}dt.rui-tabs-tab a,dt.rui-tabs-tab a:hover{padding:.2em 1em;border:1px solid #ccc;border-radius:.25em;-moz-border-radius:.3em;-webkit-border-radius:.3em}dl.rui-tabs dt.rui-tabs-current a{background:#EEE;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}dl.rui-tabs dd.rui-tabs-current+dt.rui-tabs-tab a{border-top-left-radius:0;border-top-right-radius:0;-moz-border-radius-topleft:0;-moz-border-radius-topright:0;-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:0}");y.type="text/css",a.getElementsByTagName("head")[0].appendChild(y),y.styleSheet?y.styleSheet.cssText=z.nodeValue:y.appendChild(z);return s}(document,parseInt,RightJS)
|