diff --git a/deluge/ui/webui/static/mooui.js b/deluge/ui/webui/static/mooui.js index 09752301a..525bcac46 100644 --- a/deluge/ui/webui/static/mooui.js +++ b/deluge/ui/webui/static/mooui.js @@ -1 +1,19 @@ -(function(){function C(F,E){F=String(F);E=E||2;while(F.length99?Math.round(N/10):N),t:Q<12?"a":"p",tt:Q<12?"am":"pm",T:Q<12?"A":"P",TT:Q<12?"AM":"PM",Z:P?"UTC":(String(this).match(B)||[""]).pop().replace(D,""),o:(F>0?"-":"+")+C(Math.floor(Math.abs(F)/60)*100+Math.abs(F)%60,4),S:["th","st","nd","rd"][K%10>3?0:(K%100-K%10!=10)*K%10]};return T.replace(A,function(H){return H in G?G[H]:H.slice(1,H.length-1)})}})})();Array.implement({sum:function(A){var B=0;this.each(function(C){var D=C;if(!$defined(D)){return}if($defined(A)){D=C[A]}if($type(D)=="number"){B+=D}},this);return B}});Element.implement({getInnerSize:function(){this.getPadding();if((/^(?:body|html)$/i).test(this.tagName)){return this.getWindow().getSize()}return{x:this.clientWidth-this.padding.x,y:this.clientHeight-this.padding.y}},getInnerHeight:function(){return this.getInnerSize().y},getInnerWidth:function(){return this.getInnerSize().x},getSizeModifiers:function(D){if(!this.modifiers){var A=this.getBorder(D);var B=this.getMargin(D);var C=this.getPadding(D);this.modifiers={left:A.left+B.left+C.left,right:A.right+B.right+C.right,top:A.top+B.top+C.top,bottom:A.bottom+B.bottom+C.bottom,x:A.x+B.x+C.x,y:A.y+B.y+C.y}}},getMargin:function(B){if(!this.margin||B){var A=this.getStyle("margin").split(" ");this.margin={left:A[1].toInt(),right:A[3].toInt(),top:A[0].toInt(),bottom:A[2].toInt(),x:A[0].toInt()+A[2].toInt(),y:A[1].toInt()+A[3].toInt()}}return this.margin},getPadding:function(B){if(!this.padding||B){var A=this.getStyle("padding").split(" ");this.padding={left:A[1].toInt(),right:A[3].toInt(),top:A[0].toInt(),bottom:A[2].toInt(),x:A[0].toInt()+A[2].toInt(),y:A[1].toInt()+A[3].toInt()}}return this.padding},getBorder:function(B){if(!this.border||B){var A=this.getStyle("border-width").split(" ");this.border={left:A[1].toInt(),right:A[3].toInt(),top:A[0].toInt(),bottom:A[2].toInt(),x:A[0].toInt()+A[2].toInt(),y:A[1].toInt()+A[3].toInt()}}return this.border}});Number.implement({toBytes:function(){var A=this;if(A<1024){return A.toFixed(1)+"B"}else{A=A/1024}if(A<1024){return A.toFixed(1)+"KiB"}else{A=A/1024}if(A<1024){return A.toFixed(1)+"MiB"}else{A=A/1024}return A.toFixed(1)+"GiB"},toSpeed:function(){var A=this;if(A<1024){return A.toFixed(1)+"b/s"}else{A=A/1024}if(A<1024){return A.toFixed(1)+"KiB/s"}else{A=A/1024}return A.toFixed(2)+"MiB/s"},toTime:function(){var C=this;if(C==0){return"∞"}if(C<60){return C+"s"}else{C=C/60}if(C<60){var B=Math.floor(C);var D=Math.round(60*(C-B));if(D>0){return B+"m "+D+"s"}else{return B+"m"}}else{C=C/60}if(C<24){var A=Math.floor(C);var B=Math.round(60*(C-A));if(B>0){return A+"h "+B+"m"}else{return A+"h"}}else{C=C/24}var E=Math.floor(C);var A=Math.round(24*(C-E));if(A>0){return E+"d "+A+"h"}else{return E+"d"}}});String.implement({strip:function(){var A=this.replace(/^\s*/,"");A.replace(/\s*$/,"");return A}});Sorters={Simple:new Class({initialize:function(B,A){this.column=B;this.order=A},sorter:function(){return function(C,B){var D,A;D=C.cells[this.column].value;A=B.cells[this.column].value;return this.sort(D,A)}.bind(this)},sort:function(B,A){if(B>A){return 1*this.order}if(B0){this.element.setStyle(C,B)}if(!D){this.fireEvent("resize",A)}}else{this[C]=B;this.element.setStyle(C,B)}},sets:function(C){C=new Hash(C);var B=false;var A={};C.each(function(E,D){if(D=="height"||D=="width"){A[("old-"+D).camelCase()]=this[D];A[D]=E;B=true}this.set(D,E,true)},this);if(B){this.fireEvent("resize",A)}},toElement:function(){return this.element}});$W=function(A){if(!A.isMoouiWidget){if(A.retrieve){A=A.retrieve("moouiWidget");return(A)?A:new Widgets.Base(A)}else{return new Widgets.Base(A)}}else{return A}};$$W=function(A){if(!A.isMoouiWidget){if(A.retrieve){A=A.retrieve("moouiWidget");return(A)?A:null}else{return null}}else{return wrap}};Widgets.PopupMenu=new Class({Extends:Widgets.WidgetBase,Implements:Events,initialize:function(){this.items=[];this.noClose=false;this.build()},add:function(B){if($type(B)=="array"){for(var A=0;A=A.y){y=A.y-B.y-(A.y-y)}this.element.setStyles({left:x,top:y-2});this.element.addEvent("mouseleave",function(D){this.hide()}.bind(this))},fixSize:function(A){var B=0;A.getElements("li").each(function(D){var E=D.getElement("span");var C=E.getSize().x;if(C>B){B=C}});A.setStyle("width",B+32)},fixLeft:function(A){var B=0;A.getElements("li").each(function(D){var C=D.getSize().x;if(C>B){B=C}});A.setStyle("width",B+2);A.getElements("li ul").each(function(C){C.setStyle("left",B-20)})},showPos:function(A,B){}});Widgets.ProgressBar=new Class({Extends:Widgets.Base,initialize:function(){this.parent(new Element("div"));this.bound={onResize:this.onResize.bindWithEvent(this)};this.element.addClass("moouiProgressBar");this.bar=new Element("div").inject(this.element);this.textSpan=new Element("span").inject(this.bar);this.sets({width:200,height:20});this.addEvent("resize",this.bound.onResize)},onResize:function(){this.textSpan.setStyles({width:this.width,height:this.height});this.update(this.text,this.percent)},update:function(B,A){if(this.text!=B){this.text=B;this.textSpan.set("text",B)}if(this.percent!=A){this.percent=A;this.bar.setStyles({width:Math.floor(this.width/100*A),height:this.height})}}});Widgets.Spinner=new Class({Extends:Widgets.Base,options:{precision:0,step:1,limit:{high:null,low:null}},initialize:function(A,B){this.parent(new Element("div"),B);this.bound={onMouseDown:this.onMouseDown.bindWithEvent(this),onMouseUp:this.onMouseUp.bindWithEvent(this),onMouseWheel:this.onMouseWheel.bindWithEvent(this),onKeyDown:this.onKeyDown.bindWithEvent(this),onKeyUp:this.onKeyUp.bindWithEvent(this),onChange:this.onChange.bindWithEvent(this)};value=0;this.keyDown=false;if(A){this.element.replaces(A);value=new Number(A.value)}this.input=(A)?A:new Element("input");this.input.store("moouiWidget",this);this.element.grab(this.input);this.element.addClass("moouiSpinner");this.element.addEvent("mousewheel",this.bound.onMouseWheel);this.input.addEvent("keydown",this.bound.onKeyDown);this.input.addEvent("change",this.bound.onChange);this.buttons=new Element("div").addClass("moouiSpinnerButtons");this.up=new Element("div").addClass("moouiSpinnerUp");this.down=new Element("div").addClass("moouiSpinnerDown");this.up.addEvent("mousedown",this.bound.onMouseDown);this.down.addEvent("mousedown",this.bound.onMouseDown);this.buttons.grab(this.up);this.buttons.grab(this.down);this.element.grab(this.buttons);this.setValue(value)},getPrecision:function(){return Math.pow(10,this.options.precision+1)/10},setValue:function(A){if(this.options.limit){if(this.options.limit.low&&A<=this.options.limit.low){A=this.options.limit.low;this.down.setStyle("opacity","0.5")}else{if(this.options.limit.high&&A>=this.options.limit.high){A=this.options.limit.high;this.up.setStyle("opacity","0.5")}else{this.up.setStyle("opacity","1");this.down.setStyle("opacity","1")}}}this.value=new Number(A);this.input.set("value",this.value.toFixed(this.options.precision));this.settingValue=true;this.input.fireEvent("change")},changeValue:function(A){value=this.value+(A/this.getPrecision());this.setValue(value)},acceleratingChange:function(A){if(this.stop){return}this.changeValue(A);if(this.interval>100){this.interval-=100}else{if(this.interval>10){this.interval-=10}}this.acceleratingChange.delay(this.interval,this,A)},onMouseDown:function(A){this.value=new Number(this.input.value);document.addEvent("mouseup",this.bound.onMouseUp);if(A.target.hasClass("moouiSpinnerUp")){change=this.options.step}else{change=this.options.step*-1}this.interval=600;this.stop=false;this.acceleratingChange(change)},onMouseUp:function(A){this.stop=true;document.removeEvent("mouseup",this.bound.onMouseUp)},onKeyDown:function(A){if(A.key=="up"||A.key=="down"){if(this.keyDown){return}this.value=new Number(this.input.value);change=(A.key=="up")?this.options.step:this.options.step*-1;this.input.addEvent("keyup",this.bound.onKeyUp);this.interval=600;this.stop=false;this.keyDown=true;this.acceleratingChange(change)}else{if($A(["left","right","backspace"]).contains(A.key)){return}else{A.key=(A.code==190)?".":A.key;pattern=/[0-9]/;if(!this.input.value.match(/\./)&&this.options.precision>0){pattern=/[0-9\.]/}if(!A.key.match(pattern)){A.stop();return}}}},onKeyUp:function(A){this.stop=true;this.keyDown=false;this.input.removeEvent("keyup",this.bound.onKeyUp)},onMouseWheel:function(A){this.changeValue(this.options.step*A.wheel)},onChange:function(A){if(this.settingValue){this.settingValue=false;return}this.setValue(new Number(this.input.value))}});Widgets.SplitPane=new Class({Extends:Widgets.Base,options:{direction:"horizontal",name:null,splitSize:6,pane1:{},pane2:{}},initialize:function(C,D,B,A){this.parent(C,A);this.bound={onResize:this.onResize.bindWithEvent(this),onMouseDown:this.onMouseDown.bindWithEvent(this),onMouseMove:this.onMouseMove.bindWithEvent(this),onMouseUp:this.onMouseUp.bindWithEvent(this)};this.horizontal=(this.options.direction=="horizontal")?true:false;this.pane1=$W(D);this.pane2=$W(B);if(this.options.expand){this.expand()}this.initPane(this.pane1,this.options.pane1);this.initPane(this.pane2,this.options.pane2);this.initSplitter();this.calculatePositions();this.setPosition(this.pane1);this.setPosition(this.splitter);this.setPosition(this.pane2);this.splitter.addEvent("mousedown",this.bound.onMouseDown);this.addEvent("resize",this.bound.onResize)},initSplitter:function(){this.splitter=new Element("div").addClass("moouiSplitter");this.splitter.inject(this.pane1,"after");this.splitter.paneinfo={};if(this.horizontal){this.splitter.addClass("moouiSplitterVertical")}else{this.splitter.addClass("moouiSplitterHorizontal")}this.splitter.grab(new Element("div"));this.splitter.grab(new Element("div"));this.splitter.grab(new Element("div"))},onMouseDown:function(A){document.addEvent("mouseup",this.bound.onMouseUp);document.addEvent("mousemove",this.bound.onMouseMove);this.mouseStart={x:A.client.x,y:A.client.y};this.paneInfo={one:{startWidth:this.pane1.paneinfo.width,startHeight:this.pane1.paneinfo.height},two:{startWidth:this.pane2.paneinfo.width,startHeight:this.pane2.paneinfo.height}}},onMouseMove:function(A){if(this.horizontal){diff=A.client.x-this.mouseStart.x;p1width=this.paneInfo.one.startWidth+diff;p2width=this.paneInfo.two.startWidth-diff;if((this.pane1.paneinfo.min+this.pane1.element.modifiers.x)>p1width){this.pane1.paneinfo.width=this.pane1.paneinfo.min;this.pane2.paneinfo.width=this.paneInfo.two.startWidth+(this.paneInfo.one.startWidth-this.pane1.paneinfo.min)}else{if((this.pane2.paneinfo.min+this.pane2.element.modifiers.x)>p2width){this.pane2.paneinfo.width=this.pane2.paneinfo.min;this.pane1.paneinfo.width=this.paneInfo.one.startWidth+(this.paneInfo.two.startWidth-this.pane2.paneinfo.min)}else{this.pane1.paneinfo.width=p1width;this.pane2.paneinfo.width=p2width}}}else{diff=A.client.y-this.mouseStart.y;p1height=this.paneInfo.one.startHeight+diff;p2height=this.paneInfo.two.startHeight-diff;if((this.pane1.paneinfo.min+this.pane1.element.modifiers.y)>p1height){this.pane1.paneinfo.height=this.pane1.paneinfo.min;this.pane2.paneinfo.height=this.paneInfo.two.startHeight+(this.paneInfo.one.startHeight-this.pane1.paneinfo.min)}else{if((this.pane2.paneinfo.min+this.pane2.element.modifiers.y)>p2height){this.pane2.paneinfo.height=this.pane2.paneinfo.min;this.pane1.paneinfo.height=this.paneInfo.one.startHeight+(this.paneInfo.two.startHeight-this.pane2.paneinfo.min)}else{this.pane1.paneinfo.height=p1height;this.pane2.paneinfo.height=p2height}}}this.setPosition(this.pane1);this.setPosition(this.pane2)},onMouseUp:function(A){document.removeEvent("mouseup",this.bound.onMouseUp);document.removeEvent("mousemove",this.bound.onMouseMove)},initPane:function(B,A){B.addClass("moouiPane");B.paneinfo={};if(A){B.paneinfo.min=(A.min)?A.min:0;B.paneinfo.expand=(A.expand)?A.expand:false}},calculatePositions:function(A){if(A){if(this.horizontal){this.calculateResize(A,"width","height","x","y")}else{this.calculateResize(A,"height","width","y","x")}}else{if(this.horizontal){this.calculateInitial("width","height","x","y")}else{this.calculateInitial("height","width","y","x")}}},calculateInitial:function(A,D,C,E){var B=this.getInnerSize();this.pane1.getSizeModifiers();this.pane2.getSizeModifiers();this.splitter.getSizeModifiers();if(this.pane1.paneinfo.expand){this.pane2.paneinfo[A]=this.pane2.paneinfo.min;this.pane1.paneinfo[A]=B[C]-this.pane2.paneinfo.min-this.options.splitSize;this.pane1.paneinfo[A]-=this.pane1.element.modifiers[C]+this.pane2.element.modifiers[C]}else{this.pane1.paneinfo[A]=this.pane1.paneinfo.min;this.pane2.paneinfo[A]=B[C]-this.pane1.paneinfo.min-this.options.splitSize;this.pane2.paneinfo[A]-=this.pane2.element.modifiers[C]+this.pane1.element.modifiers[C]}this.pane1.paneinfo[D]=this.pane2.paneinfo[D]=B[E];this.pane1.paneinfo[D]-=this.pane1.element.modifiers[E];this.pane2.paneinfo[D]-=this.pane2.element.modifiers[E];this.splitter.paneinfo[D]=B[E];this.splitter.paneinfo[A]=this.options.splitSize},calculateResize:function(B,A,D,C,E){size=this.getInnerSize();this.pane1.getSizeModifiers();this.pane2.getSizeModifiers();this.splitter.getSizeModifiers();if(B[A]&&B[A]!=B[("old-"+A).camelCase()]){if(this.pane1.paneinfo.expand){this.pane1.paneinfo[A]=size[C]-this.pane2.paneinfo[A]-this.options.splitSize;this.pane1.paneinfo[A]-=this.pane1.element.modifiers[C]+this.pane2.element.modifiers[C]}else{this.pane2.paneinfo[A]=size[C]-this.pane1.paneinfo[A]-this.options.splitSize;this.pane2.paneinfo[A]-=this.pane2.element.modifiers[C]+this.pane1.element.modifiers[C]}}if(B[D]&&B[D]!=B[("old-"+D).camelCase()]){this.pane1.paneinfo[D]=this.pane2.paneinfo[D]=size[E];this.splitter.paneinfo[D]=size[E];this.splitter.paneinfo[D]-=this.splitter.modifiers[E];this.pane1.paneinfo[D]-=this.pane1.element.modifiers[E];this.pane2.paneinfo[D]-=this.pane2.element.modifiers[E]}},setPosition:function(A){if(A.hasClass("moouiSplitter")){sets=A.setStyles.bind(A)}else{sets=A.sets.bind(A)}sets({width:A.paneinfo.width,height:A.paneinfo.height})},onResize:function(A){this.calculatePositions(A);this.setPosition(this.pane1);this.setPosition(this.splitter);this.setPosition(this.pane2)}});Widgets.Tabs=new Class({Extends:Widgets.Base,initialize:function(A){this.parent(A);this.bound={onResize:this.onResize.bindWithEvent(this)};this.pages=[];this.currentPage=-1;this.tabsList=new Element("ul").inject(this.element);this.element.addClass("moouiTabs");this.pagesDiv=new Element("div").inject(this.element);this.pagesDiv.addClass("moouiTabPages");if(this.options.expand){this.expand()}},addPage:function(C){this.pages.include(C);var B=new Element("li");B.set("text",C.name);B.addEvent("click",function(D){this.select(A)}.bindWithEvent(this));C.tab=B;this.tabsList.grab(B);this.pagesDiv.grab(C.element.addClass("moouiTabPage"));var A=this.pages.indexOf(C);if(this.currentPage<0){this.currentPage=A;this.select(A)}},select:function(A){this.pages[this.currentPage].removeClass("moouiTabPageActive");this.pages[this.currentPage].tab.removeClass("moouiTabActive");this.pages[A].addClass("moouiTabPageActive");this.pages[A].tab.addClass("moouiTabActive");this.currentPage=A;this.fireEvent("pageChanged")},onResize:function(){this._pages.each(function(A){A.resize(this.width,this.height-45)},this)}});Widgets.TabPage=new Class({Extends:Widgets.Base,options:{element:null,url:null},initialize:function(B,A){this.name=B;var C=null;if(A&&A.element){C=A.element}else{C=new Element("div")}this.parent(C,A);if(this.options.url){new Request.HTML({url:this.options.url,update:C,onSuccess:function(D){this.fireEvent("loaded")}.bindWithEvent(this)}).get()}}});Widgets.VBox=new Class({Extends:Widgets.Base,initialize:function(B,A){this.parent(B,A);this.boxes=[];if(this.options.expand){this.expand()}},addBox:function(B,A){B=$W(B);B.boxInfo=(A)?A:{fixed:false};this.boxes.include(B);this.element.grab(B)},calculatePositions:function(){if(this.options.expand){this.expand()}var C=this.getInnerSize();var A=C.y,B=0;this.boxes.each(function(F){F.getSizeModifiers();if(!F.boxInfo.fixed){B++}else{A-=F.height+F.element.modifiers.y}},this);var E=A/B,D=A%B;this.boxes.each(function(H){var G={};if(!H.boxInfo.fixed){var F=E-H.element.modifiers.y;if(D>0){F-=1;D--}G.height=F}else{G.height=H.height}G.width=C.x-H.element.modifiers.x;H.sets({height:G.height,width:G.width})},this)},refreshChildren:function(){this.boxes.each(function(A){A.refresh();A.setStyle("position","relative")})}});Widgets.Window=new Class({Extends:Widgets.Base,initialize:function(A){var B=new Element("div");this.parent(B,A);this.addClass("moouiWindow");this.sets({width:this.options.width,height:this.options.height});this.element.setStyle("opacity",0);this.titleBar=new Element("div").addClass("moouiWindowTitlebar");this.element.grab(this.titleBar);this.title=new Element("h3").addClass("moouiWindowTitle");this.title.set("text",this.options.title);this.titleBar.grab(this.title);this.drag=new Drag(this.element,{handle:this.titleBar});this.close=new Element("div").addClass("moouiWindowClose");this.close.inject(this.titleBar);this.close.addEvent("click",function(C){this.hide()}.bindWithEvent(this));this.content=new Element("div").addClass("moouiWindowContent");this.content.inject(this.element);if(this.options.url){new Request.HTML({url:this.options.url,update:this.content,onSuccess:function(C){this.fireEvent("loaded")}.bindWithEvent(this)}).get()}},show:function(){this.fireEvent("beforeShow");var A=document.body.getInnerSize();var C=(A.x-this.options.width)/2,B=(A.y-this.options.height)/2;this.sets({left:C,top:B});document.body.grab(this.element);this.element.setStyle("opacity",1);this.fireEvent("show")},hide:function(){var A=this.element.get("tween");A.addEvent("complete",function(B){this.element.dispose()}.bind(this));this.element.fade(0)}});Widgets.DataGridCell=new Class({Implements:[Events,Options],options:{name:"",type:"text",width:0},initialize:function(A){this.setOptions(A);this.element=new Element("td")},set:function(B){this.value=B;var C=B,A=true;switch(this.options.type){case"bytes":C=B.toBytes();break;case"time":C=B.toTime();break;case"date":this.value=new Date(B);C=this.value.format("ddd mmm dd yyyy");break;case"speed":C=B.toSpeed();break;case"icon":C=B.text;this.element.setStyles({"background-repeat":"no-repeat","background-position":"2px","background-image":"url("+B.icon+")","padding-left":20});break;case"image":if(!this.image){this.image=new Element("img");this.image.inject(this.element)}this.image.src=B;A=false;break;case"progress":if(!this.progress){this.progress=new Widgets.ProgressBar();this.progress.sets({width:this.options.width,height:14});this.progress.element.inject(this.element)}this.progress.update(B.text,B.percent);A=false;break}if(A){this.element.set("text",C)}this.fireEvent("changed",{cell:this})}});Widgets.DataGridColumn=new Class({Implements:[Events,Options],options:{name:"",type:"string",text:"",width:50},initialize:function(A){this.setOptions(A);this.order=1},setText:function(A){this.options.text=A;this.fireEvent("textChanged",A)},get_sorter:function(A){switch(this.options.type){case"number":return new Sorters.Number(A,this.order);case"progress":return new Sorters.Progress(A,this.order);default:return new Sorters.Simple(A,this.order)}}});Widgets.DataGridRow=new Class({Implements:[Events],initialize:function(B,A){this.id=B;this.columns=A;this.element=new Element("tr");this.element.store("rowid",this.id);this.cells=[];this.selected=false;this.columns.each(function(D){var C=new Widgets.DataGridCell({name:D.options.name,type:D.options.type,width:D.options.width});C.element.inject(this.element);C.addEvent("changed",this.oncellchanged.bind(this));this.cells.include(C)},this);this.element.addEvent("contextmenu",this.oncontextmenu.bind(this));this.element.addEvent("click",this.onclick.bind(this))},update:function(A){A=new Hash(A);A.getKeys().each(function(B){if(B!="data"||B!="id"){this[B]=A[B]}},this);this.cells.each(function(B){B.set(A.data[B.options.name])},this);return this},oncellchanged:function(A){A.row=this;this.fireEvent("changed",A)},oncontextmenu:function(A){A.row=this;this.fireEvent("menu",A)},onclick:function(A){A.row=this;this.fireEvent("click",A)}});Widgets.DataGrid=new Class({Implements:[Options,Events],Extends:Widgets.Base,options:{columns:[],element:null},initialize:function(B,A){if(!B){B=this.createElement}this.parent(B,A);this.bound={onResize:this.onResize.bindWithEvent(this),onRowMenu:this.onRowMenu.bindWithEvent(this),onRowClick:this.onRowClick.bindWithEvent(this)};this.columns=[];this.options.columns.each(function(C){var D=new Widgets.DataGridColumn(C);D.addEvent("textChanged",function(F){var E=this.columns.indexOf(D);this.header.getElements("th")[E].set("text",F)}.bindWithEvent(this));this.columns.include(D)},this);this.rows=[];this.displayRows=[];this.selectedIndex=-1;this.filterer=false;this.sorted_by=0;this.columns[0].order=-1;if($chk(this.element)){this.scanElement()}else{this.createElement}this.element.setStyle("MozUserSelect","none");this.resizeColumns();this.addEvent("resize",this.bound.onResize)},createElement:function(){this.element=new Element("div");this.table=new Element("table").inject(this.element);this.header=new Element("thead").inject(this.table).grab(new Element("tr"));this.body=new Element("tbody").inject(this.table);this.options.columns.each(function(A){new Element("th",{"class":A.name,text:A.text})},this)},scanElement:function(){this.element.addClass("moouiDataGrid");this.table=this.element.getElement("table");if(!this.table){this.table=new Element("table").inject(this.element)}this.header=this.table.getElement("thead");if(!this.header){this.header=new Element("thead").inject(this.table)}this.body=this.table.getElement("tbody");if(!this.body){this.body=new Element("tbody").inject(this.table)}this.header.empty();var A=new Element("tr");this.header.grab(A);this.columns.each(function(C,B){new Element("th").addEvent("click",function(D){this.sort(C,B);this.render()}.bindWithEvent(this)).set("text",C.options.text).inject(A)},this)},addRow:function(B,A){var C=new Widgets.DataGridRow(B.id,this.columns);C.store=B.store;this.rows.include(C);C.update(B);C.addEvent("menu",this.bound.onRowMenu);C.addEvent("click",this.bound.onRowClick);if(!A){this.render()}},onRowMenu:function(A){if(!this.selectedRow){this.selectRow(A.row)}this.fireEvent("rowMenu",A)},onRowClick:function(A){A.row.index=this.displayRows.indexOf(this.getById(A.row.id));if(A.shift){this.deselectRows();this.selectRows(A.row.index)}else{if(A.control){if(A.row.selected){this.deselectRow(A.row)}else{this.selectRow(A.row)}}else{this.deselectRows();this.selectRow(A.row)}}this.fireEvent("rowClick",A)},deselectRow:function(A){if(!$chk(A)){return}A.selected=false;A.element.removeClass("selected");if(A==this.selectedRow){this.selectedRow=null;this.fireEvent("selectedChanged")}},deselectRows:function(){this.selected=-1;this.rows.each(function(A){A.selected=false;A.element.removeClass("selected")})},filter:function(){this.filterer=(this.filterer)?this.filterer:$lambda(true);this.displayRows.empty();this.rows.each(function(A){if(this.filterer(A)){this.displayRows.include(A)}}.bind(this))},getById:function(B){var A=null;this.rows.each(function(C){if(C.id==B){A=C}});return A},getSelected:function(){selected=[];this.rows.each(function(A){if(A.selected){selected.include(A)}});return selected},has:function(A){if(this.getById(A)){return true}else{return false}},remove:function(A){this.getById(A)},render:function(){this.filter();this.resort();var C=[],A=[];this.rows.each(function(D){if(this.displayRows.contains(D)){C.include(D.element);A.include(D.id)}},this);this.body.adopt(C);this.body.getChildren().each(function(D){var E=D.retrieve("rowid");if(!E){D.destroy()}else{if(!A.contains(E)){D.dispose()}}},this);var B=this.body.getElements("tr.selected");if(B){this.selected=$A(this.body.rows).indexOf(B)}},resizeColumns:function(){var A=this.options.columns.sum("width");this.table.setStyle("width",A);var B=this.header.getElements("th");B.each(function(D,C){if(this.options.columns[C]){D.setStyle("width",this.options.columns[C].width)}},this)},onResize:function(){var A=this.width;var B=this.options.columns.sum("width");if(B>A){this.table.setStyle("width",B)}else{this.table.setStyle("width",A)}var C=this.header.getElements("th");C.each(function(E,D){var F=this.columns[D].options.width;if(D==C.length-1&&A>F){E.setStyle("width",A)}else{E.setStyle("width",F);A-=F}},this)},selectRows:function(B){var A=this.displayRows.indexOf(this.selectedRow);if(A>B){for(var C=B;C<=A;C++){this.displayRows[C].selected=true;this.displayRows[C].element.addClass("selected")}}else{if(A Specifies the type of the input file + --charset Read the input file using + --line-break Insert a line break after the specified column number + -v, --verbose Display informational messages and warnings + -o Place the output into . Defaults to stdout. + +JavaScript Options + --nomunge Minify only, do not obfuscate + --preserve-semi Preserve all semicolons + --disable-optimizations Disable all micro optimizations + +If no input file is specified, it defaults to stdin. In this case, the 'type' +option is required. Otherwise, the 'type' option is required only if the input +file extension is neither 'js' nor 'css'. diff --git a/deluge/ui/webui/templates/ajax/index.html b/deluge/ui/webui/templates/ajax/index.html index 63bbb577d..f9d15240b 100644 --- a/deluge/ui/webui/templates/ajax/index.html +++ b/deluge/ui/webui/templates/ajax/index.html @@ -6,9 +6,8 @@ - + - diff --git a/deluge/ui/webui/templates/ajax/render/html/window_add_torrent.html b/deluge/ui/webui/templates/ajax/render/html/window_add_torrent.html index d47c44ab5..78b3937b2 100644 --- a/deluge/ui/webui/templates/ajax/render/html/window_add_torrent.html +++ b/deluge/ui/webui/templates/ajax/render/html/window_add_torrent.html @@ -1,13 +1,13 @@ -

Torrents

-
- - - - + + + +
- - + +
diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-add.js b/deluge/ui/webui/templates/ajax/static/js/deluge-add.js index bded37bbc..75497f65b 100644 --- a/deluge/ui/webui/templates/ajax/static/js/deluge-add.js +++ b/deluge/ui/webui/templates/ajax/static/js/deluge-add.js @@ -35,7 +35,6 @@ Deluge.Widgets.AddWindow = new Class({ this.torrents = this.content.getElement('select'); this.torrents.addEvent('change', this.bound.onTorrentChanged); this.torrentInfo = new Hash(); - this.tabs = new Widgets.Tabs(this.content.getElement('div.moouiTabs')); this.filesTab = new Deluge.Widgets.AddTorrent.FilesTab(); this.tabs.addPage(this.filesTab);