ClassFactory.createPackage("core.ui.quirks");ClassFactory.createClass(core.ui.quirks,"TextSelection");with(core.ui.quirks){core.ui.quirks.TextSelection.constructor=function(){};core.ui.quirks.TextSelection.preventSelection=function(A){if(defined(A.onselectstart)){A.onselectstart=new Function("return false")}else{if(defined(A.style.MozUserSelect)){A.style.MozUserSelect="none"}else{A.onmousedown=new Function("return false")}}};core.ui.quirks.TextSelection.allowSelection=function(A,B){if(false===B){this.preventSelection(A)}else{if(defined(A.onselectstart)){A.onselectstart=new Function("return true")}else{if(defined(A.style.MozUserSelect)){A.style.MozUserSelect="text"}else{A.onmousedown=new Function("return true")}}}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Event");with(core.ui){core.ui.Event.constructor=function(){this.stopped=false;this.cancelled=false;this.Event=function(){if(!this.target){this.target=this.srcElement}};this.stop=function(){if(undefined!==this.stopPropagation){this.stopPropagation()}else{if(undefined!==this.cancelBubble){this.cancelBubble=true}}this.stopped=true};this.isStopped=function(){return this.stopped};this.cancel=function(){if(undefined!==this.preventDefault){this.preventDefault()}this.returnValue=false;this.cancelled=true};this.isCancelled=function(){return this.cancelled};this.getType=function(){return this.type};this.getX=function(){return this.clientX+document.body.scrollLeft};this.getScreenX=function(){return this.screenX+document.body.scrollLeft};this.getScreenY=function(){return this.screenY+document.body.scrollTop};this.getY=function(){return this.clientY+document.body.scrollTop};this.getChar=function(){return String.fromCharCode(this.keyCode||this.charCode).toUpperCase()};this.toString=function(){return'[Event type="'+this.type+'"]'}};core.ui.Event.improve=function(A){if(!A){A=window.event}this.apply(A);return A};core.ui.Event.addListener=function(B,A,C){if(undefined!==B.attachEvent){B.attachEvent("on"+A,C)}else{if(undefined!==B.addEventListener){B.addEventListener(A,C,false)}else{B["on"+A]=C}}};core.ui.Event.removeListener=function(B,A,C){if(undefined!==B.detachEvent){B.detachEvent("on"+A,C)}else{if(undefined!==B.removeEventListener){B.removeEventListener(A,C,false)}else{}}};core.ui.Event.addLoadListener=function(A){Event.addListener(window,"load",A)};core.ui.Event.removeLoadListener=function(A){Event.removeListener(window,"load",A)};core.ui.Event.addUnloadListener=function(A){Event.addListener(window,"unload",A)};core.ui.Event.removeUnloadListener=function(A){Event.removeListener(window,"unload",A)};core.ui.Event.types=["blur","change","click","contextmenu","dblclick","focus","keydown","keypress","keyup","load","mousedown","mousemove","mouseout","mouseover","mouseup","select","scroll","unload"];core.ui.Event.KEY_BACKSPACE=8;core.ui.Event.KEY_TAB=9;core.ui.Event.KEY_ENTER=13;core.ui.Event.KEY_SHIFT=16;core.ui.Event.KEY_CTRL=17;core.ui.Event.KEY_ALT=18;core.ui.Event.KEY_PAUSE=19;core.ui.Event.KEY_CAPS_LOCK=20;core.ui.Event.KEY_ESCAPE=27;core.ui.Event.KEY_SPACE=32;core.ui.Event.KEY_PAGE_UP=33;core.ui.Event.KEY_PAGE_DOWN=34;core.ui.Event.KEY_END=35;core.ui.Event.KEY_HOME=36;core.ui.Event.KEY_LEFT_ARROW=37;core.ui.Event.KEY_UP_ARROW=38;core.ui.Event.KEY_RIGHT_ARROW=39;core.ui.Event.KEY_DOWN_ARROW=40;core.ui.Event.KEY_INSERT=45;core.ui.Event.KEY_DELETE=46;core.ui.Event.KEY_LEFT_WINDOW=91;core.ui.Event.KEY_RIGHT_WINDOW=92;core.ui.Event.KEY_SELECT=93;core.ui.Event.KEY_F1=112;core.ui.Event.KEY_F2=113;core.ui.Event.KEY_F3=114;core.ui.Event.KEY_F4=115;core.ui.Event.KEY_F5=116;core.ui.Event.KEY_F6=117;core.ui.Event.KEY_F7=118;core.ui.Event.KEY_F8=119;core.ui.Event.KEY_F9=120;core.ui.Event.KEY_F10=121;core.ui.Event.KEY_F11=122;core.ui.Event.KEY_F12=123;core.ui.Event.KEY_NUM_LOCK=144;core.ui.Event.KEY_SCROLL_LOCK=145}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Notification");with(core.ui){core.ui.Notification.constructor=function(){this.listeners=[];this.addListener=function(C,B){var A=this.findListener(C);if(-1==A){this.listeners.push([C,B])}};this.removeListener=function(B){var A=this.findListener(B);if(-1!=A){delete this.listeners[A];this.listeners.splice(A,1)}};this.send=function(){for(var B=0;B0){this.listeners.pop()}};this.findListener=function(B){for(var A=0;A0){this.http.open("POST",this.url,true);this.http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.http.send(content)}else{this.http.open("GET",this.url,true);this.http.send(null)}};this.onSuccess=function(response){if("function"==typeof this.handler.onSuccess){this.handler.onSuccess(response)}};this.onError=function(error){if("function"==typeof this.handler.onError){this.handler.onError(error)}};this.onComplete=function(){if("function"==typeof this.handler.onComplete){this.handler.onComplete()}};this.onRequestStateChange=callback(this,function(){if(4==this.http.readyState){if((200==this.http.status)||(304==this.http.status)){switch(this.http.getResponseHeader("Content-Type")){case"text/xml":case"application/xml":var rootNode;if(this.http.responseXML&&(rootNode=this.http.responseXML.documentElement)){rootNode.normalize();if("response"==rootNode.nodeName){this.onSuccess(new Response(rootNode))}else{if("error"==rootNode.nodeName){this.onError(new Response(rootNode))}else{}}}break;case"text/json":case"application/json":this.onSuccess(eval("("+this.http.responseText+")"));break;default:this.onSuccess(this.http.responseText);break}}else{this.onError("There was a problem retrieving the XML data:\n"+this.http.statusText)}this.onComplete()}});this.toString=function(){return"[Request]"}};core.ajax.sendRequest=core.ajax.Request.send=function(B,E,F){var C=new core.ajax.Request(B,{onSuccess:E});var D=new Array();if(defined(F)){for(var A in F){D.push(encodeURIComponent(A)+"="+encodeURIComponent(F[A]))}}C.send(D.join("&"))};core.ajax.sendFormData=core.ajax.Request.sendFormData=function(C,E){var F={};for(var D=2;D=0){delete this.elements[B];this.elements.splice(B,1)}};this.clear=function(){while(this.elements.length>0){this.elements.pop()}};this.contains=function(A){return(-1!=this.indexOf(A))};this.indexOf=function(A){for(var B=0;B=0){C*=(this.direction&Handle.DIRECTION_EAST)?1:0}else{C*=(this.direction&Handle.DIRECTION_WEST)?1:0}if(B>=0){B*=(this.direction&Handle.DIRECTION_NORTH)?1:0}else{B*=(this.direction&Handle.DIRECTION_SOUTH)?1:0}this.doDrag(A+C,E+B);D.stop()}};this.onmouseup=function(A){if(this.isDragging()){this.endDrag();this.notifyEndDrag.send(this)}}};core.ui.Handle.DIRECTION_NORTH=1;core.ui.Handle.DIRECTION_SOUTH=4;core.ui.Handle.DIRECTION_EAST=8;core.ui.Handle.DIRECTION_WEST=16;core.ui.Handle.DIRECTION_ALL=(core.ui.Handle.DIRECTION_NORTH|core.ui.Handle.DIRECTION_SOUTH|core.ui.Handle.DIRECTION_EAST|core.ui.Handle.DIRECTION_WEST)}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"FocusWindow");with(core.ui){core.ui.FocusWindow.superClass=core.ui.Window;core.ui.FocusWindow.constructor=function(){this.FocusWindow=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setTabIndex(-1)};this.setFocus=function(A){if(A){if(defined(this.getElement().focus)){window.setTimeout(this.setFocusTimeout,0)}}else{if(defined(this.getElement().blur)){this.getElement().blur()}}};this.hasFocus=function(){};this.setTabIndex=function(A){this.getElement().tabIndex=A};this.getTabIndex=function(){return this.getElement().tabIndex};this.setAccessKey=function(A){this.getElement().accessKey=A};this.getAccessKey=function(){return this.getElement().accessKey};this.setFocusTimeout=callback(this,function(){try{this.getElement().focus()}catch(A){}})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ImageButton");with(core.ui){core.ui.ImageButton.superClass=core.ui.FocusWindow;core.ui.ImageButton.constructor=function(){this.images={};this.imageList;this.state;this.ImageButton=function(B,A,G,E,F){arguments.callee.prototype.apply(this,[B,A,G,E,F]);this.getElement().setAttribute("unselectable","on");core.ui.quirks.TextSelection.preventSelection(this.getElement());var D=[ImageButton.STATE_NORMAL,ImageButton.STATE_HOVER,ImageButton.STATE_PRESSED,ImageButton.STATE_DISABLED];for(var C=0;C0){this.setImage(this.images[A].src)}}};this.getState=function(){return this.state};this.setImages=function(D,C,A,B){if(defined(D)){this.images[ImageButton.STATE_NORMAL].src=D}if(defined(C)){this.images[ImageButton.STATE_HOVER].src=C}if(defined(A)){this.images[ImageButton.STATE_PRESSED].src=A}if(defined(B)){this.images[ImageButton.STATE_DISABLED].src=B}if(this.images[this.state].src.length>0){this.setImage(this.images[this.state].src)}};this.setImageList=function(A){if(!defined(this.imageList)){this.imageList=new window.Image()}this.imageList.src=A;this.setImage(A);this.setStyle("background-position",-(this.getWidth()*this.state)+"px top")};this.setImage=function(A){this.setStyle("background-image",'url("'+A+'")')};this.setEnabled=override(this.setEnabled,function(A){if(A){arguments.callee.prototype.apply(this,[A]);this.setState(ImageButton.STATE_NORMAL)}else{this.setState(ImageButton.STATE_DISABLED);arguments.callee.prototype.apply(this,[A])}});this.onmousedown=function(A){this.setState(ImageButton.STATE_PRESSED);this.setFocus(true);this.activate();A.stop();A.cancel()};this.onmouseover=this.onmouseup=function(A){this.setState(ImageButton.STATE_HOVER);A.stop()};this.onmouseout=function(A){this.setState(ImageButton.STATE_NORMAL);A.stop()};this.ondblclick=function(A){A.stop()};this.onclick=function(C,B,A){if("function"==typeof this.oncommand){this.oncommand(C,B,A)}};this.onkeydown=function(C,B,A){if(Event.KEY_SPACE==C.keyCode){C.stop();this.setState(ImageButton.STATE_PRESSED)}else{if(Event.KEY_ENTER==C.keyCode){C.stop();if("function"==typeof this.oncommand){this.oncommand(C,B,A)}}}};this.onkeyup=function(C,B,A){if(Event.KEY_SPACE==C.keyCode){C.stop();this.setState(ImageButton.STATE_NORMAL);if("function"==typeof this.oncommand){this.oncommand(C,B,A)}}}};core.ui.ImageButton.STATE_NORMAL=0;core.ui.ImageButton.STATE_HOVER=1;core.ui.ImageButton.STATE_PRESSED=2;core.ui.ImageButton.STATE_DISABLED=3;core.ui.ImageButton.states=["normal","hover","pressed","disabled"]}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"InputWindow");with(core.ui){core.ui.InputWindow.superClass=core.ui.FocusWindow;core.ui.InputWindow.constructor=function(){this.setSelected=function(A){if(A){this.getInput().select()}else{this.getInput().blur()}};this.setName=function(A){this.getInput().name=A};this.getName=function(){return this.getInput().name};this.setValue=function(A){this.getInput().value=A};this.getValue=function(){return this.getInput().value};this.setText=function(A){this.setValue(A)};this.getText=function(){return this.getValue()};this.setFocus=function(A){if(A){try{this.getInput().focus()}catch(B){}}else{this.getInput().blur()}};this.setTabIndex=function(A){this.getInput().tabIndex=A};this.getTabIndex=function(){return getInput().tabIndex};this.setAccessKey=function(A){this.getInput().accessKey=A};this.getAccessKey=function(){return this.getInput().accessKey};this.getInput=function(){return this.getElement()};this.createElement=function(){var A=document.createElement("input");A.type=this.getType();return A};this.getType=function(){return"text"}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Edit");with(core.ui){core.ui.Edit.superClass=core.ui.InputWindow;core.ui.Edit.constructor=function(){this.Edit=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.getInput().setAttribute("autocomplete","off");if(defined(this.getInput().onselectstart)){this.getInput().onselectstart=new Function("window.event.cancelBubble = true")}};this.setReadOnly=function(A){this.getElement().readOnly=A};this.isReadOnly=function(){return this.getElement().readOnly};this.getType=function(){return"text"}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"TextArea");with(core.ui){core.ui.TextArea.superClass=core.ui.FocusWindow;core.ui.TextArea.constructor=function(){this.TextArea=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);if(defined(this.getElement().onselectstart)){this.getElement().onselectstart=new Function("window.event.cancelBubble = true")}};this.setName=function(A){this.getElement().name=A};this.getName=function(){return this.getElement().name};this.setValue=function(A){this.getElement().value=A};this.getValue=function(){return this.getElement().value};this.setText=function(A){this.setValue(A)};this.getText=function(){return this.getValue()};this.createElement=function(){return document.createElement("textarea")}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Static");with(core.ui){core.ui.Static.superClass=core.ui.Window;core.ui.Static.constructor=function(){this.Static=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);core.ui.quirks.TextSelection.preventSelection(this.getElement())}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Balloon");with(core.ui){core.ui.Balloon.superClass=core.ui.Window;core.ui.Balloon.constructor=function(){this.owner;this.position;this.timeout;this.tail;this.timerId;this.Balloon=function(C,D,B,A){arguments.callee.prototype.apply(this,[]);this.setStyle("overflow","visible");this.setStyle("z-index",Balloon.ZINDEX);this.tail=this.createTail();this.setPosition(defined(B)?B:Balloon.TOP);this.setTimeout(defined(A)?A:10);this.setOwner(C);this.setText(D)};this.setOwner=function(A){this.owner=A};this.getOwner=function(){return this.owner};this.setPosition=function(B){var A={};A[Balloon.LEFT]="left";A[Balloon.TOP]="top";A[Balloon.RIGHT]="right";A[Balloon.BOTTOM]="bottom";this.removeStyleName(this.getStyleName()+"-"+A[this.position&Balloon.MASK_POSTITON]);this.tail.removeStyleName(this.tail.getStyleName()+"-"+A[this.position&Balloon.MASK_POSTITON]);this.position=B;this.addStyleName(this.getStyleName()+"-"+A[this.position&Balloon.MASK_POSTITON]);this.tail.addStyleName(this.tail.getStyleName()+"-"+A[this.position&Balloon.MASK_POSTITON])};this.getPosition=function(){return this.position};this.setTimeout=function(A){this.timeout=A};this.getTimeout=function(){return this.timeout};this.setVisible=override(this.setVisible,function(A){if(A){this.attachGlobalEvent("mousemove");this.adjustPosition();if(0!==this.timeout){window.clearTimeout(this.timerId);this.timerId=window.setTimeout(this.onTimeout,this.timeout*1000)}}else{window.clearTimeout(this.timerId);this.detachGlobalEvent("mousemove")}this.tail.setVisible(A);arguments.callee.prototype.apply(this,[A])});this.getTail=function(){return this.tail};this.setEnabled=override(this.setEnabled,function(A){this.tail.setEnabled(A);arguments.callee.prototype.apply(this,[A])});this.close=override(this.close,function(){window.clearTimeout(this.timerId);this.tail.close();delete this.tail;arguments.callee.prototype.apply(this,[])});this.createTail=function(){var A=new Window();A.setStyleName(this.getStyleName()+"Tail");A.setStyle("z-index",Balloon.ZINDEX);return A};this.correctPosition=function(){var E=0;var F=0;if(this.position&Balloon.LEFT){var C=this.owner.getAbsX()-this.tail.getWidth();var B=this.owner.getAbsY()+(this.owner.getHeight()-this.tail.getHeight())/2;E=C-this.getWidth();F=B-(this.getHeight()-this.tail.getHeight())/2}else{if(this.position&Balloon.RIGHT){var C=this.owner.getAbsX()+this.owner.getWidth();var B=this.owner.getAbsY()+(this.owner.getHeight()-this.tail.getHeight())/2;E=C+this.tail.getWidth();F=B-(this.getHeight()-this.tail.getHeight())/2}else{if(this.position&Balloon.TOP){var C=this.owner.getAbsX()+(this.owner.getWidth()-this.tail.getWidth())/2;var B=this.owner.getAbsY()-this.tail.getHeight();E=C-(this.getWidth()-this.tail.getWidth())/2;F=B-this.getHeight()}else{if(this.position&Balloon.BOTTOM){var C=this.owner.getAbsX()+(this.owner.getWidth()-this.tail.getWidth())/2;var B=this.owner.getAbsY()+this.owner.getHeight();E=C-(this.getWidth()-this.tail.getWidth())/2;F=B+this.tail.getHeight()}}}}var G=document.body.scrollLeft;var A=document.body.clientWidth+document.body.scrollLeft;var D=document.body.scrollTop;var H=document.body.clientHeight+document.body.scrollTop;if(EA){this.setPosition(Balloon.LEFT|(this.position&Balloon.FLOATING))}}if(FH){this.setPosition(Balloon.TOP|(this.position&Balloon.FLOATING))}}};this.adjustPosition=function(){if(this.position&Balloon.FLOATING){this.correctPosition()}if(this.position&Balloon.LEFT){this.tail.move(this.owner.getAbsX()-this.tail.getWidth(),this.owner.getAbsY()+(this.owner.getHeight()-this.tail.getHeight())/2);this.move(this.tail.getX()-this.getWidth(),this.tail.getY()-(this.getHeight()-this.tail.getHeight())/2)}else{if(this.position&Balloon.RIGHT){this.tail.move(this.owner.getAbsX()+this.owner.getWidth(),this.owner.getAbsY()+(this.owner.getHeight()-this.tail.getHeight())/2);this.move(this.tail.getX()+this.tail.getWidth(),this.tail.getY()-(this.getHeight()-this.tail.getHeight())/2)}else{if(this.position&Balloon.TOP){this.tail.move(this.owner.getAbsX()+(this.owner.getWidth()-this.tail.getWidth())/2,this.owner.getAbsY()-this.tail.getHeight());this.move(this.tail.getX()-(this.getWidth()-this.tail.getWidth())/2,this.tail.getY()-this.getHeight())}else{if(this.position&Balloon.BOTTOM){this.tail.move(this.owner.getAbsX()+(this.owner.getWidth()-this.tail.getWidth())/2,this.owner.getAbsY()+this.owner.getHeight());this.move(this.tail.getX()-(this.getWidth()-this.tail.getWidth())/2,this.tail.getY()+this.tail.getHeight())}}}}};this.onmousedown=function(A,B){if(((B&&(B.constructor===Window||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(Window))))&&((B==this)||B.isChildOf(this))){if(this.isVisible()){this.hide()}}};this.onmousemove=function(A){var B=arguments.callee;if((this.owner.getAbsX()!==B.x)||(this.owner.getAbsY()!==B.y)){B.x=this.owner.getX();B.y=this.owner.getY();this.adjustPosition()}};this.onTimeout=callback(this,function(){if(this.isVisible()){this.hide()}})};core.ui.Balloon.LEFT=1;core.ui.Balloon.TOP=2;core.ui.Balloon.RIGHT=4;core.ui.Balloon.BOTTOM=8;core.ui.Balloon.FLOATING=16;core.ui.Balloon.MASK_POSTITON=15;core.ui.Balloon.ZINDEX=10000}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"Balloon");with(editor.ui){editor.ui.Balloon.superClass=core.ui.Balloon;editor.ui.Balloon.constructor=function(){this.Balloon=function(C,D,B,A){arguments.callee.prototype.apply(this,[C,D,B,A]);this.top=new core.ui.Window(this);this.top.setStyleName(this.getStyleName()+"Top");this.top.setStyle("z-index",core.ui.Balloon.ZINDEX+1);this.center=new core.ui.Window(this);this.center.setStyleName(this.getStyleName()+"Center");this.center.setStyle("z-index",core.ui.Balloon.ZINDEX+1);this.bottom=new core.ui.Window(this);this.bottom.setStyleName(this.getStyleName()+"Bottom");this.bottom.setStyle("z-index",core.ui.Balloon.ZINDEX+1);this.text=new core.ui.Window(this,0,0,"100%","auto");this.text.setStyleName(this.getStyleName()+"Text");this.text.setStyle("position","absolute");this.text.setStyle("z-index",core.ui.Balloon.ZINDEX+2);this.updateLayout()};this.setText=function(A){if((this.text&&(this.text.constructor===core.ui.Window||defined(this.text.constructor.isSubclassOf)&&this.text.constructor.isSubclassOf(core.ui.Window)))){this.text.setText(A)}};this.getText=function(){return this.text.getText()};this.updateLayout=function(){this.text.move(0,0);this.top.setStyle("width","100%");this.center.setStyle("width","100%");this.center.setStyle("height",(this.text.getHeight()-this.top.getHeight()-this.bottom.getHeight())+"px");this.bottom.setStyle("width","100%");this.setStyle("height",this.text.getHeight()+"px")};this.setVisible=override(this.setVisible,function(A){this.updateLayout();arguments.callee.prototype.apply(this,[A])})}}ClassFactory.createPackage("common.util");ClassFactory.createClass(common.util,"MemorialUtils");with(common.util){common.util.MemorialUtils.constructor=function(){};common.util.MemorialUtils.getPageId=function(){if(defined(window.theApp)){return theApp.config.get("page.id")}else{return common.Page.getInstance().config.get("page.id")}};common.util.MemorialUtils.getBaseUri=function(){if(defined(window.theApp)){return theApp.config.get("app.baseUri")}else{return common.Page.getInstance().config.get("page.baseUri")}};common.util.MemorialUtils.htmlEncode=function(A){return A.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")};common.util.MemorialUtils.htmlDecode=function(A){return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"MessageDialog");with(editor.ui){editor.ui.MessageDialog.superClass=core.ui.Dialog;editor.ui.MessageDialog.constructor=function(){this.name;this.mail;this.text;this.notifySubmitClicked=new core.ui.Notification();this.notifyCancelClicked=new core.ui.Notification();this.MessageDialog=function(B,A,E,C,D){this.Dialog();this.initHeader();this.initBody();this.balloon=new editor.ui.Balloon()};this.initBody=function(){var B=new core.ui.Window(this);B.addStyleName("MessageDialogBody");var A=new core.ui.Static(B);A.setStyle("text-align","left");A.setText("Enter your name");this.name=new core.ui.Edit(B);this.name.setTabIndex(1);var D=new core.ui.Static(B);D.setText("Enter your e-mail");this.mail=new core.ui.Edit(B);this.mail.setTabIndex(2);var C=new core.ui.Static(B);C.setText("Enter your message");this.text=new core.ui.TextArea(B);this.text.setTabIndex(3);this.text.setStyle("overflow-y","auto");this.cancel=new core.ui.ImageButton(B);this.cancel.setImageList("images/MessageDialog/close_button.gif");this.cancel.addStyleName("CloseButton");this.cancel.setToolTip("Close window");this.cancel.oncommand=this.onCancelClick;this.submit=new core.ui.ImageButton(B);this.submit.setImageList("images/MessageDialog/ok_button.gif");this.submit.addStyleName("OkButton");this.submit.setToolTip("Add message");this.submit.oncommand=this.onSubmitClick};this.initHeader=function(){var C=new core.ui.Handle(this);C.setDragWindow(this);C.addStyleName("MessageDialogHeader");var B=new core.ui.Window(C);B.addStyleName("HeaderLeftCorner");var A=new core.ui.Window(C);A.addStyleName("HeaderRightCorner")};this.show=override(this.show,function(){arguments.callee.prototype.apply(this,[]);if(this.name.getText()){this.text.setFocus(true)}else{this.name.setFocus(true)}});this.setData=function(B,A,C){this.name.setText(B);this.mail.setText(A);this.text.setText(C)};this.reset=function(){this.text.setText("")};this.showBalloon=function(B,C,A){this.balloon.setOwner(B);this.balloon.setText(C);this.balloon.setPosition(A);this.balloon.show()};this.hideBalloon=function(){this.balloon.hide()};this.validate=function(){var A=/^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)+$/;if(!this.name.getText()){this.showBalloon(this.name,"Please enter your name.",core.ui.Balloon.RIGHT);this.name.setFocus(true);return false}else{if(!this.mail.getText().match(A)){this.showBalloon(this.mail,"Please enter a valid email address.",core.ui.Balloon.RIGHT);this.mail.setFocus(true);return false}else{if(!this.text.getText()){this.text.setFocus(true);this.showBalloon(this.text,"Please type your message.",core.ui.Balloon.RIGHT);return false}}}return true};this.doModal=override(this.doModal,function(){arguments.callee.prototype.apply(this,[]);editor.ui.SelectionManager.get().clearSelection(true)});this.endModal=override(this.endModal,function(){this.hideBalloon();arguments.callee.prototype.apply(this,[]);editor.ui.SelectionManager.get().restoreSelection()});this.submitClicked=function(){this.endModal()};this.cancelClicked=function(){this.endModal()};this.onSubmitClick=callback(this,function(){if(this.validate()){this.submitClicked();this.notifySubmitClicked.send(this)}});this.onCancelClick=callback(this,function(){this.cancelClicked();this.notifyCancelClicked.send(this)})}}ClassFactory.createPackage("common");ClassFactory.createClass(common,"ReportAbuseDialog");with(common){common.ReportAbuseDialog.superClass=editor.ui.MessageDialog;common.ReportAbuseDialog.constructor=function(){this.notifyAbuseSent=new core.ui.Notification();this.ReportAbuseDialog=function(parent,x,y,width,height){this.MessageDialog(parent,x,y,width,height);with(core.ui){Window.notifyResize.addListener(this.onUpdatePosition);Window.notifyScroll.addListener(this.onUpdatePosition)}};this.submitClicked=override(this.submitClicked,function(){core.ajax.sendRequest("ajax.PostAbuseMessage",this.onServerResponse,{"id":Page.getInstance().config.get("page.id"),"name":this.name.getText(),"email":this.mail.getText(),"message":this.text.getText()})});this.onServerResponse=callback(this,function(response){if(response.status=="OK"){alert("Your message has been sent.");this.endModal();this.notifyAbuseSent.send(this,this.name.getText(),this.mail.getText())}else{alert(response.message)}});this.cancelClicked=override(this.cancelClicked,function(){arguments.callee.prototype.apply(this,[]);this.endModal()});this.onUpdatePosition=callback(this,function(){this.center()})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Link");with(core.ui){core.ui.Link.superClass=core.ui.Window;core.ui.Link.constructor=function(){this.Link=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setStyle("display","block");this.setTarget(Link.TARGET_SELF);this.setHref("#")};this.setHref=function(A){this.getElement().href=A};this.getHref=function(){return this.getElement().href};this.setTarget=function(A){this.getElement().target=A};this.getTarget=function(){return this.getElement().target};this.createElement=function(){return document.createElement("a")}};core.ui.Link.TARGET_BLANK="_blank";core.ui.Link.TARGET_PARENT="_parent";core.ui.Link.TARGET_SELF="_self";core.ui.Link.TARGET_TOP="_top"}ClassFactory.createPackage("editor.plugins.comments");ClassFactory.createClass(editor.plugins.comments,"CommentsControls");with(editor.plugins.comments){editor.plugins.comments.CommentsControls.superClass=core.ui.Window;editor.plugins.comments.CommentsControls.constructor=function(){this.owner=null;this.showComments;this.addComment;this.CommentsControls=function(element){arguments.callee.prototype.apply(this,[]);this.owner=element;this.owner.addElementListener(this);this.createButtons();this.updateLayout();this.updateInfo()};this.getMinWidth=function(){return 170};this.onElementChanged=function(){this.updateLayout()};this.close=override(this.close,function(){this.owner.removeElementListener(this);arguments.callee.prototype.apply(this,[])});this.createButtons=function(){with(core.ui){this.showComments=new Link(this);this.showComments.addStyleName("ShowCommentsLink");this.showComments.onclick=this.onShowComments;this.showComments.setText("Loading...");this.addComment=new Link(this);this.addComment.addStyleName("AddCommentLink");this.addComment.onclick=this.onAddComment;this.addComment.setText("Add comment")}};this.updateInfo=function(){core.ajax.sendRequest("ajax.CountComments",this.onServerResponse,{"pageId":common.util.MemorialUtils.getPageId(),"elementId":ObjectComments.getInstance().getElementId(this.owner)});this.countingComments=true;this.showComments.setText("Loading...")};this.updatePosition=function(){var root=this.getElement();root.parentNode.removeChild(root);if(this.owner.getElement().nextSibling){this.owner.getElement().parentNode.insertBefore(root,this.owner.getElement().nextSibling)}else{this.owner.getElement().parentNode.appendChild(root)}};this.updateLayout=function(){if(this.owner.isInEditMode()){if(this.prevPosition!=this.owner.getPosition()){this.updatePosition();this.prevPosition=this.owner.getPosition()}}else{this.updatePosition()}this.setVisible(this.owner.isVisible());this.setStyle("z-index",this.owner.getStyle("z-index"));if(this.owner.getWidth()>this.getMinWidth()){this.move(this.owner.getX(),this.owner.getY()+this.owner.getHeight());this.resize(this.owner.getWidth(),this.getHeight())}else{var offset=(this.getMinWidth()-this.owner.getWidth())/2;this.move(this.owner.getX()-offset,this.owner.getY()+this.owner.getHeight());this.resize(this.getMinWidth(),this.getHeight())}};this.onAddComment=callback(this,function(event){var dialog=ObjectComments.getInstance().getAddCommentDialog();dialog.setOwner(this.owner);dialog.reset();dialog.center();dialog.doModal();event.stop();event.cancel()});this.onShowComments=callback(this,function(event){if(!this.countingComments){var dialog=ObjectComments.getInstance().getViewCommentsDialog();dialog.setCommentId(null);dialog.setOwner(this.owner);dialog.center();dialog.doModal()}event.stop();event.cancel()});this.onServerResponse=callback(this,function(response){if((response.status=="OK")&&(response.count>0)){this.countingComments=false}this.showComments.setText("Comments ("+(response.count?response.count:"0")+")")})}}ClassFactory.createPackage("editor.plugins.comments");ClassFactory.createClass(editor.plugins.comments,"AddCommentDialog");with(editor.plugins.comments){editor.plugins.comments.AddCommentDialog.superClass=editor.ui.MessageDialog;editor.plugins.comments.AddCommentDialog.constructor=function(){this.notifyAdded=new core.ui.Notification();this.setOwner=function(A){this.owner=A};this.submitClicked=override(this.submitClicked,function(){core.ajax.sendRequest("ajax.AddComment",this.onCommentAdded,{"pageId":common.util.MemorialUtils.getPageId(),"elementId":ObjectComments.getInstance().getElementId(this.owner),"name":this.name.getText(),"email":this.mail.getText(),"text":this.text.getText()})});this.onCommentAdded=callback(this,function(A){if(A.status=="OK"){alert("Your message was added.");ObjectComments.getInstance().update(this.owner);this.notifyAdded.send(this);this.endModal()}})}}ClassFactory.createPackage("common.util");ClassFactory.createClass(common.util,"DateUtils");with(common.util){common.util.DateUtils.constructor=function(){};common.util.DateUtils.formatInt=function(A){return(A>=0&&A<10?"0":"")+A};common.util.DateUtils.dateToInt=function(A){return(A.indexOf("0")==0)?parseInt(A.substr(A.indexOf("0")+1)):parseInt(A)};common.util.DateUtils.getMonth=function(A){if(!A){return false}var B=A.indexOf("/",0);var C=this.dateToInt(A.substring(0,B));if(B<0){B=A.indexOf("-",0);j=A.indexOf("-",B+1);C=this.dateToInt(A.substring(B+1,j))}return C};common.util.DateUtils.getYear=function(B){if(!B){return false}var C=B.indexOf("/",0);var A=B.indexOf("/",C+1);var D=this.dateToInt(B.substring(A+1));if(C<0){C=B.indexOf("-",0);A=B.indexOf("-",C+1);D=this.dateToInt(B.substring(0,C))}return D};common.util.DateUtils.getDay=function(C){if(!C){return false}var D=C.indexOf("/",0);var B=C.indexOf("/",D+1);var A=this.dateToInt(C.substring(D+1,B));if(D<0){D=C.indexOf("-",0);B=C.indexOf("-",D+1);A=this.dateToInt(C.substring(B+1))}return A};common.util.DateUtils.toServerDate=function(C,E){if(!C){return false}date=new Date(C);var B=this.formatInt(date.getDate());var G=this.formatInt(date.getMonth()+1);var D=date.getFullYear();var A=this.formatInt(date.getHours());var H=this.formatInt(date.getMinutes());var F="";E=defined(E)?E:false;if(E){F=D+"-"+G+"-"+B+" "+A+":"+min}else{F=D+"-"+G+"-"+B}return F};common.util.DateUtils.toClientDate=function(C,F){if(!C){return false}date=new Date(C);var B=this.formatInt(date.getDate());var G=this.formatInt(date.getMonth()+1);var E=date.getFullYear();var A=this.formatInt(date.getHours());var H=this.formatInt(date.getMinutes());var D="";F=defined(F)?F:false;if(F){D=G+"/"+B+"/"+E+" "+A+":"+H}else{D=G+"/"+B+"/"+E}return D};common.util.DateUtils.toMilliseconds=function(B){if(!B){return false}var C=new Date(this.getYear(B),this.getMonth(B)-1,this.getDay(B));var A=Date.parse(C.toString());return A};common.util.DateUtils.server2client=function(B){var A=this.toMilliseconds(B);return this.toClientDate(A)};common.util.DateUtils.client2server=function(B){var A=this.toMilliseconds(B);return this.toServerDate(A)};common.util.DateUtils.timestamp2millisec=function(A){if(!A){return null}return A*1000};common.util.DateUtils.getSeconds=function(A){return this.formatInt((A%60).toFixed())};common.util.DateUtils.getMinutes=function(A){return this.formatInt(parseInt(A/60))};common.util.DateUtils.exist=function(A){if(this.getMonth(A)>12){return false}else{if(this.getDay(A)>31){return false}else{if(this.toClientDate(this.toMilliseconds(A))!=A){return false}}}return true}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"Grid");with(editor.ui){editor.ui.Grid.superClass=core.ui.Window;editor.ui.Grid.constructor=function(){this.Grid=function(){arguments.callee.prototype.apply(this,[null,0,0,"100%","100%"]);this.setStyle("z-index",0);core.ui.Window.notifyResize.addListener(this.onUpdateLayout);core.ui.Window.notifyScroll.addListener(this.onUpdateLayout)};this.close=override(this.close,function(){core.ui.Window.notifyResize.removeListener(this.onUpdateLayout);core.ui.Window.notifyScroll.removeListener(this.onUpdateLayout);arguments.callee.prototype.apply(this,[])});this.onUpdateLayout=callback(this,function(){this.resize(core.ui.Window.getWidth(),core.ui.Window.getHeight())})};editor.ui.Grid.SIZE=10}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"ArrayList");with(core.util){core.util.ArrayList.constructor=function(){this.ArrayList=function(A){this.elements=A||[]};this.add=function(A){this.elements.push(A)};this.indexOf=function(A){for(var B=0;B0)};this.setSelection=function(A){this.clearSelection();return this.addSelection(A)};this.addSelection=function(B){if(!this.isSelected(B)){this.selections.set(B.getId(),B.createSelection());this.fireSelectionChange(B)}var A=this.selections.get(B.getId());A.select();return A};this.removeSelection=function(B){if(this.isSelected(B)){var A=this.getSelection(B);this.selections.remove(B.getId());if(A.isSelected()){A.unselect();this.fireSelectionChange(B)}}};this.getSelection=function(A){return this.selections.get(A.getId())};this.updateSelection=function(){for(var A=this.selections.getValues().iterator();A.hasNext();A.next()){A.current().select()}};this.clearSelection=function(D){if(D){this.elements=this.getSelectedElements()}for(var C=this.selections.getValues().iterator();C.hasNext();C.next()){var A=C.current();if(A.isSelected()){var B=A.getTarget();A.unselect();this.selections.remove(B.getId());this.fireSelectionChange(B)}}};this.restoreSelection=function(){if((this.elements&&(this.elements.constructor===core.util.ArrayList||defined(this.elements.constructor.isSubclassOf)&&this.elements.constructor.isSubclassOf(core.util.ArrayList)))){for(var A=this.elements.iterator();A.hasNext();A.next()){this.addSelection(A.current())}delete this.elements}};this.getSelectedElements=function(){var A=[];for(var B=this.selections.getValues().iterator();B.hasNext();B.next()){A.push(B.current().getTarget())}return new core.util.ArrayList(A)};this.handleMove=function(C,A,D){for(var E=this.selections.getValues().iterator();E.hasNext();E.next()){var B=E.current();if(B!==D){B.move(B.getX()+C,B.getY()+A)}}};this.fireSelectionChange=function(A){this.listeners.call("onElementSelectionChange",[this,A])};this.onAppClear=function(){this.clearSelection()};this.onAppModeChanged=function(B){for(var A=this.selections.getValues().iterator();A.hasNext();A.next()){A.current().setVisible(B.getMode()===editor.Application.MODE_EDIT)}}};editor.ui.SelectionManager.get=function(){if(!defined(this.instance)){this.instance=new SelectionManager()}return this.instance}}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"CommandHistory");with(editor.commands){editor.commands.CommandHistory.constructor=function(){this.commands=new core.util.ArrayList();this.listeners=new core.util.Listeners();this.CommandHistory=function(){this.commandIndex=-1;editor.Application.getInstance().addAppListener(this)};this.addHistoryListener=function(A){this.listeners.add(A)};this.removeHistoryListener=function(A){this.listeners.remove(A)};this.execute=function(A){this.commands.toArray().splice(this.commandIndex+1);A.execute();this.commands.add(A);if(++this.commandIndex>CommandHistory.MAX_SIZE-1){this.commands.toArray().shift()}this.fireChanged()};this.getUndoCommands=function(){return new core.util.ArrayList(this.commands.toArray().slice(0,this.commandIndex+1))};this.getRedoCommands=function(){return new core.util.ArrayList(this.commands.toArray().slice(this.commandIndex+1))};this.canUndo=function(){return(this.commandIndex>=0)};this.canRedo=function(){return(this.commandIndex<(this.commands.size()-1))};this.undo=function(){if(this.canUndo()){this.commands.get(this.commandIndex--).unexecute();this.fireChanged()}};this.redo=function(){if(this.canRedo()){this.commands.get(++this.commandIndex).execute();this.fireChanged()}};this.fireChanged=function(){this.listeners.call("onHistoryChanged",[this])};this.onAppClear=function(){this.commandIndex=-1;this.commands.clear();this.fireChanged()}};editor.commands.CommandHistory.get=function(){if(!defined(this.instance)){this.instance=new CommandHistory()}return this.instance};editor.commands.CommandHistory.MAX_SIZE=10}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"AbstractCommand");with(editor.commands){editor.commands.AbstractCommand.constructor=function(){this.AbstractCommand=function(B,A){this.target=B;this.name=A};this.setTarget=function(A){this.target=A};this.getTarget=function(){return this.target};this.getName=function(){return this.name};this.setName=function(A){this.name=A};this.execute=function(){};this.unexecute=function(){}}}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"RemoveObjectsGroupCommand");with(editor.commands){editor.commands.RemoveObjectsGroupCommand.superClass=editor.commands.AbstractCommand;editor.commands.RemoveObjectsGroupCommand.constructor=function(){}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"MultipleSelection");with(editor.ui){editor.ui.MultipleSelection.superClass=core.ui.Window;editor.ui.MultipleSelection.constructor=function(){this.startX;this.startY;this.ctrlPressed=false;this.selectionInProgress=false;this.keyEventsAttached=false;this.MultipleSelection=function(){arguments.callee.prototype.apply(this,[]);this.setStyle("position","absolute");this.setStyle("z-index",1024);this.resize(0,0);this.hide()};this.elementsIntersected=function(r1,r2){var left1=r1.getX();var left2=r2.getX();var min=left1>left2?left1:left2;var right1=r1.getX()+r1.getWidth();var right2=r2.getX()+r2.getWidth();var max=right1max){return false}var top1=r1.getY();var top2=r2.getY();min=top1>top2?top1:top2;var bottom1=r1.getY()+r1.getHeight();var bottom2=r2.getY()+r2.getHeight();max=bottom10)&&(this.getHeight()>0)){var i=editor.Application.getInstance().getCollection().iterator();while(i.hasNext()){var element=i.next();if(this.elementsIntersected(this,element)&&(element.getStyle("z-index")>0)){editor.ui.SelectionManager.get().addSelection(element).setFocus(true)}}}};this.onWorkspaceMouseMove=function(subject,event){if(!this.selectionInProgress){return }if(!this.isVisible()){this.show()}var x=event.getX();var y=event.getY();var width=this.startX-x;var height=this.startY-y;if(width>0){this.move(x,this.getY())}if(height>0){this.move(this.getX(),y)}this.resize(Math.abs(width),Math.abs(height))};this.onWorkspaceMouseUp=function(){this.hide();this.selectionInProgress=false;this.attachGlobalEvent("keydown");if(this.getWidth()>2||this.getHeight()>2){this.collectSelectedObjects()}this.resize(0,0)};this.onWorkspaceMouseDown=function(subject,event){this.selectionInProgress=true;this.detachGlobalEvent("keydown");this.startX=event.getX();this.startY=event.getY();this.move(this.startX,this.startY);this.show()};this.onkeydown=function(event){if(core.ui.Event.KEY_DELETE==event.keyCode){this.deleteSelection()}};this.close=override(this.close,function(){this.detachGlobalEvent("keydown");editor.Application.getInstance().getWorkspace().removeMouseListener(this);arguments.callee.prototype.apply(this,[])})}}ClassFactory.createPackage("editor");ClassFactory.createClass(editor,"Workspace");with(editor){editor.Workspace.constructor=function(){this.mouseListeners=new core.util.Listeners();this.addMouseListener=function(A){this.mouseListeners.add(A)};this.removeMouseListener=function(A){this.mouseListeners.remove(A)};this.init=function(){editor.Application.getInstance().addAppListener(this);this.grid=new editor.ui.Grid();this.selection=new editor.ui.MultipleSelection();this.map={"mouseup":"onWorkspaceMouseUp","mousedown":"onWorkspaceMouseDown","mousemove":"onWorkspaceMouseMove"};for(var A in this.map){core.ui.Event.addListener(document.documentElement,A,this.onDocumentMouseEvent)}};this.isGridVisible=function(){return this.grid.isVisible()};this.setGridVisible=function(A){this.grid.setVisible(A)};this.setTitle=function(A){window.document.title=A};this.getTitle=function(){return window.document.title};this.onAppModeChanged=function(A){if(editor.Application.MODE_PREVIEW===A.getMode()){editor.ui.VisibilityManager.hide(this.selection,this.grid)}else{editor.ui.VisibilityManager.restore(this.selection,this.grid)}};this.onDocumentMouseEvent=callback(this,function(A){A=core.ui.Event.improve(A);if("mousedown"==A.getType()){if((document.body!=A.target)&&(document.documentElement!=A.target)&&(this.grid.getElement()!=A.target)){return }}this.mouseListeners.call(this.map[A.getType()],[this,A])})}}ClassFactory.createPackage("editor");ClassFactory.createClass(editor,"SaveContext");with(editor){editor.SaveContext.superClass=core.util.HashMap;editor.SaveContext.constructor=function(){this.SaveContext=function(A){arguments.callee.prototype.apply(this,[]);this.url=A};this.setUrl=function(A){this.url=A};this.getUrl=function(){return this.url}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Menu");with(core.ui){core.ui.Menu.superClass=core.ui.Window;core.ui.Menu.constructor=function(){this.origin;this.items=[];this.popupinfo={};this.notifyEndPopup=new Notification();this.Menu=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setStyle("overflow","visible")};this.doPopup=function(B,A,C){this.origin=B;if(defined(A)&&defined(C)){this.move(A,C)}this.attachGlobalEvent("mousedown");this.attachGlobalEvent("keydown");this.popupinfo.popupState=true;this.activate();this.show()};this.endPopup=function(){if(this.popupinfo.popupState){delete this.origin;this.popupinfo.popupState=false;this.detachGlobalEvent("mousedown");this.detachGlobalEvent("keydown");this.notifyEndPopup.send(this);this.hide()}};this.isPopup=function(A){if(this.popupinfo.popupState){if(defined(A)){return(this.origin==A)}return true}return false};this.getOrigin=function(){return this.origin};this.addItem=function(A){this.items.push(A);return A};this.getItem=function(A){return this.items[A]};this.getItemCount=function(){return this.items.length};this.removeItem=function(A){this.items[A].close();delete this.items[A];this.items.splice(A,1)};this.removeItems=function(){while(this.items.length>0){var A=this.items.pop();A.close();delete A}};this.ensureVisible=function(A){this.getElement().scrollTop=this.items[A].getY()};this.onmousedown=function(A,B){if((B&&(B.constructor===Window||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(Window)))){if((B==this)||B.isChildOf(this)||this.isChildOf(B)){return }if(((this.origin&&(this.origin.constructor===Window||defined(this.origin.constructor.isSubclassOf)&&this.origin.constructor.isSubclassOf(Window))))&&((B==this.origin)||B.isChildOf(this.origin))){return }while(B.isChild()){B=B.getParent()}if(((B&&(B.constructor===Menu||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(Menu))))&&B.isPopup()){return }}this.endPopup()};this.onkeydown=function(A){if(Event.KEY_ESCAPE==A.keyCode){this.endPopup()}}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"MenuItem");with(core.ui){core.ui.MenuItem.superClass=core.ui.FocusWindow;core.ui.MenuItem.constructor=function(){}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"CompositeWindow");with(core.ui){core.ui.CompositeWindow.superClass=core.ui.Window;core.ui.CompositeWindow.constructor=function(){this.updateLayout=function(){};this.resize=override(this.resize,function(A,B){arguments.callee.prototype.apply(this,[A,B]);this.updateLayout()});this.setStyle=override(this.setStyle,function(A,B){arguments.callee.prototype.apply(this,[A,B]);this.updateLayout()});this.setStyleId=override(this.setStyleId,function(A){arguments.callee.prototype.apply(this,[A]);this.updateLayout()});this.setStyleName=override(this.setStyleName,function(A){arguments.callee.prototype.apply(this,[A]);this.updateLayout()});this.addStyleName=override(this.addStyleName,function(A){arguments.callee.prototype.apply(this,[A]);this.updateLayout()});this.removeStyleName=override(this.removeStyleName,function(A){arguments.callee.prototype.apply(this,[A]);this.updateLayout()});this.clearStyleName=override(this.clearStyleName,function(){arguments.callee.prototype.apply(this,[]);this.updateLayout()})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"DragWindow");with(core.ui){core.ui.DragWindow.superClass=core.ui.Handle;core.ui.DragWindow.constructor=function(){this.DragWindow=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setDragWindow(this)}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Slider");with(core.ui){core.ui.Slider.superClass=core.ui.FocusWindow;core.ui.Slider.constructor=function(){this.indicator;this.vertical=false;this.pos=0;this.min=0;this.max=100;this.notifyPositionChanged=new Notification();this.Slider=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.indicator=new DragWindow(this);this.indicator.setStyleName("Indicator");this.indicator.setDirection(Handle.DIRECTION_EAST|Handle.DIRECTION_WEST);this.indicator.notifyDrag.addListener(this.onIndicatorDrag);this.setVertical(false);core.ui.quirks.TextSelection.preventSelection(this.getElement())};this.setRange=function(B,A){this.min=B;this.max=A};this.getRangeMin=function(){return this.min};this.getRangeMax=function(){return this.max};this.setPos=function(C){if(Cthis.max){this.setPos(this.max)}else{this.pos=C}}if(this.isVertical()){var B=this.getClientHeight()-this.indicator.getHeight()-(this.pos-this.min)/(this.max-this.min)*(this.getClientHeight()-this.indicator.getHeight());this.indicator.setStyle("left","auto");this.indicator.setStyle("top",B+"px")}else{var A=(this.pos-this.min)/(this.max-this.min)*(this.getClientWidth()-this.indicator.getWidth());this.indicator.setStyle("left",A+"px");this.indicator.setStyle("top","auto")}};this.getPos=function(){return this.pos};this.setVertical=function(A){this.removeStyleName(this.getStyleName()+(this.vertical?"-vertical":"-horisontal"));this.vertical=A;this.addStyleName(this.getStyleName()+(this.vertical?"-vertical":"-horisontal"));this.indicator.setDirection(this.isVertical()?Handle.DIRECTION_NORTH|Handle.DIRECTION_SOUTH:Handle.DIRECTION_EAST|Handle.DIRECTION_WEST);this.setPos(this.pos)};this.isVertical=function(){return this.vertical};this.getProgressIndicator=function(){return this.indicator};this.getPositionByCoords=function(A,C){var B=(this.isVertical())?this.max-Math.floor(C/(this.getClientHeight()-this.indicator.getHeight())*(this.max-this.min)):this.min+Math.floor(A/(this.getClientWidth()-this.indicator.getWidth())*(this.max-this.min));if(Bthis.max){return this.max}else{return B}}};this.onIndicatorDrag=callback(this,function(){var A=this.getPositionByCoords(this.indicator.getX(),this.indicator.getY());if((this.min==A)||(this.max==A)){this.setPos(A)}else{this.pos=A}this.notifyPositionChanged.send(this,this.pos)});this.onmousedown=function(A,C){if(this==C){var B=this.getPositionByCoords(A.getX()-this.getAbsX()-this.indicator.getWidth()/2,A.getY()-this.getAbsY()-this.indicator.getHeight()/2);this.setPos(B);this.notifyPositionChanged.send(this,B)}};this.onkeypress=function(A){var C=(this.max-this.min)/100;var B=false;if(this.isVertical()){if(Event.KEY_UP_ARROW==A.keyCode){this.setPos(this.getPos()+C);B=true}else{if(Event.KEY_DOWN_ARROW==A.keyCode){this.setPos(this.getPos()-C);B=true}}}else{if(Event.KEY_LEFT_ARROW==A.keyCode){this.setPos(this.getPos()-C);B=true}else{if(Event.KEY_RIGHT_ARROW==A.keyCode){this.setPos(this.getPos()+C);B=true}}}this.notifyPositionChanged.send(this,this.pos);if(B){A.cancel()}}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ScrollBar");with(core.ui){core.ui.ScrollBar.superClass=core.ui.Window;core.ui.ScrollBar.constructor=function(){this.orienation=ScrollBar.VERTICAL;this.step=0;this.target;this.backwardButton;this.forwardButton;this.slider;this.ScrollBar=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.backwardButton=new ImageButton(this);this.backwardButton.setStyleName("BackwardButton");this.backwardButton.setStyle("position","absolute");this.backwardButton.onmousedown=this.onBackwardMouseDown;this.slider=new Slider(this);this.slider.setStyle("position","absolute");this.slider.notifyPositionChanged.addListener(this.onSliderPositionChanged);this.forwardButton=new ImageButton(this);this.forwardButton.setStyleName("ForwardButton");this.forwardButton.setStyle("position","absolute");this.forwardButton.onmousedown=this.onForwardMouseDown;this.setOrientation(ScrollBar.VERTICAL);Event.addListener(this.getElement(),"resize",this.onResize)};this.setOrientation=function(A){this.removeStyleName(this.getStyleName()+"-"+(this.isVertical()?"vertical":"horisontal"));this.orientation=A;this.addStyleName(this.getStyleName()+"-"+(this.isVertical()?"vertical":"horisontal"));this.slider.setVertical(this.isVertical());this.backwardButton.setStyle("left","0px");this.backwardButton.setStyle("top","0px");this.forwardButton.setStyle("left",this.isVertical()?"0px":"");this.forwardButton.setStyle("right",this.isVertical()?"":"0px");this.forwardButton.setStyle("top",this.isVertical()?"":"0px");this.forwardButton.setStyle("bottom",this.isVertical()?"0px":"");this.slider.setStyle("left",this.isVertical()?"0px":"");this.slider.setStyle("top",this.isVertical()?"":"0px");this.updateLayout()};this.getOrientation=function(){return this.orientation};this.isVertical=function(){return(ScrollBar.VERTICAL==this.orientation)};this.setPosition=function(A){A=Math.max(A,0);A=Math.min(A,100);this.slider.setPos(this.isVertical()?100-A:A);this.updateTarget(A)};this.getPosition=function(){var A=this.slider.getPos();return this.isVertical()?100-A:A};this.setScrollTarget=function(A){this.target=A;this.target.setStyle("overflow-"+(this.isVertical()?"y":"x"),"hidden");this.updateLayout()};this.getScrollTarget=function(){return this.target};this.getBackwardButton=function(){return this.backwardButton};this.getForwardButton=function(){return this.forwardButton};this.getSliderControl=function(){return this.slider};this.updateLayout=function(){if((this.target&&(this.target.constructor===Window||defined(this.target.constructor.isSubclassOf)&&this.target.constructor.isSubclassOf(Window)))){if(this.isVertical()){this.slider.setStyle("top",this.backwardButton.getHeight()+"px");this.slider.setStyle("height",Math.max(this.getClientHeight()-this.backwardButton.getHeight()-this.forwardButton.getHeight(),0)+"px");var B=(this.target.getElement().scrollHeight>0)?this.slider.getClientHeight()*this.target.getClientHeight()/this.target.getElement().scrollHeight:0;this.slider.indicator.setStyle("height",Math.max(B,8)+"px");var C=this.target.getElement().scrollTop/(this.target.getElement().scrollHeight-this.target.getHeight())*100}else{this.slider.setStyle("left",this.backwardButton.getWidth()+"px");this.slider.setStyle("width",Math.max(this.getClientWidth()-this.backwardButton.getWidth()-this.forwardButton.getWidth(),0)+"px");var A=(this.target.getElement().scrollWidth>0)?this.slider.getClientWidth()*this.target.getClientWidth()/this.target.getElement().scrollWidth:0;this.slider.indicator.setStyle("width",Math.max(A,8)+"px");var C=this.target.getElement().scrollLeft/(this.target.getElement().scrollWidth-this.target.getWidth())*100}this.setPosition(isNaN(C)?0:C)}};this.updateTarget=function(A){if((this.target&&(this.target.constructor===Window||defined(this.target.constructor.isSubclassOf)&&this.target.constructor.isSubclassOf(Window)))){if(this.isVertical()){this.target.getElement().scrollTop=(this.target.getElement().scrollHeight-this.target.getHeight())*A/100}else{this.target.getElement().scrollLeft=(this.target.getElement().scrollWidth-this.target.getWidth())*A/100}}};this.doScroll=callback(this,function(){if(0!=this.step){this.setPosition(this.getPosition()+this.step);window.setTimeout(this.doScroll,50)}});this.onSliderPositionChanged=callback(this,function(A,B){this.updateTarget(this.isVertical()?100-B:B)});this.onBackwardMouseDown=callback(this,function(){this.attachGlobalEvent("mouseup");this.backwardButton.setState(ImageButton.STATE_PRESSED);this.setPosition(this.getPosition()+(this.step=-3));window.setTimeout(this.doScroll,600)});this.onForwardMouseDown=callback(this,function(){this.attachGlobalEvent("mouseup");this.forwardButton.setState(ImageButton.STATE_PRESSED);this.setPosition(this.getPosition()+(this.step=3));window.setTimeout(this.doScroll,600)});this.onResize=callback(this,function(){this.updateLayout()});this.onmouseup=callback(this,function(){this.detachGlobalEvent("mouseup");this.step=0})};core.ui.ScrollBar.HORISONTAL=1;core.ui.ScrollBar.VERTICAL=2}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"SplitWindow");with(core.ui){core.ui.SplitWindow.superClass=core.ui.CompositeWindow;core.ui.SplitWindow.constructor=function(){this.panes={};this.splitLeft;this.splitRight;this.splitTop;this.splitBottom;this.SplitWindow=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.updateLayout()};this.addPane=function(A,B){A.setStyle("position","absolute");A.setStyle("float","none");this.adjustPane(A,B);this.panes[A.getId()]=B};this.adjustPane=function(B,D){var A=this.splitLeft;var C=this.splitTop;if(defined(D)){if(D&SplitWindow.SPLIT_LEFT){this.splitLeft+=B.getWidth()}if(D&SplitWindow.SPLIT_TOP){this.splitTop+=B.getHeight()}if(D&SplitWindow.SPLIT_RIGHT){this.splitRight-=B.getWidth();A=this.splitRight}if(D&SplitWindow.SPLIT_BOTTOM){this.splitBottom-=B.getHeight();C=this.splitBottom}if(D&SplitWindow.SPLIT_FILL){B.resize(Math.abs(this.splitRight-this.splitLeft),Math.abs(this.splitBottom-this.splitTop))}}B.move(A,C)};this.updateLayout=function(){this.splitLeft=0;this.splitTop=0;this.splitRight=this.getClientWidth();this.splitBottom=this.getClientHeight();for(var C in this.panes){var B=Window.forId(C);var A=this.panes[C];this.adjustPane(B,A)}}};core.ui.SplitWindow.SPLIT_LEFT=1;core.ui.SplitWindow.SPLIT_RIGHT=4;core.ui.SplitWindow.SPLIT_TOP=8;core.ui.SplitWindow.SPLIT_BOTTOM=16;core.ui.SplitWindow.SPLIT_FILL=64}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ScrollWindow");with(core.ui){core.ui.ScrollWindow.superClass=core.ui.SplitWindow;core.ui.ScrollWindow.constructor=function(){this.vscroll;this.hscroll;this.content;this.ScrollWindow=function(parent,x,y,width,height){arguments.callee.prototype.apply(this,[parent,x,y,width,height]);this.vscroll=this.createScrollBar(0,0,undefined,"100%");this.hscroll=this.createScrollBar(0,0,"100%",undefined);this.hscroll.setOrientation(ScrollBar.HORISONTAL);this.addPane(this.hscroll,SplitWindow.SPLIT_BOTTOM);this.addPane(this.vscroll,SplitWindow.SPLIT_RIGHT);this.updateLayout()};this.createScrollBar=function(x,y,width,height){return new ScrollBar(this,x,y,width,height)};this.setText=function(text){if((this.content&&(this.content.constructor===Window||defined(this.content.constructor.isSubclassOf)&&this.content.constructor.isSubclassOf(Window)))){this.content.setText(text);this.updateLayout()}};this.getText=function(){return((this.content&&(this.content.constructor===Window||defined(this.content.constructor.isSubclassOf)&&this.content.constructor.isSubclassOf(Window))))?this.content.getText():""};this.ensureVisible=function(child){if(((this.content&&(this.content.constructor===Window||defined(this.content.constructor.isSubclassOf)&&this.content.constructor.isSubclassOf(Window))))&&((child&&(child.constructor===Window||defined(child.constructor.isSubclassOf)&&child.constructor.isSubclassOf(Window))))&&child.isChildOf(this.content)){with(this.content.getElement()){scrollLeft=child.getX();scrollTop=child.getY()}this.vscroll.updateLayout();this.hscroll.updateLayout()}};this.setContentWindow=function(wnd){wnd.setStyle("overflow","hidden");this.addPane(wnd,SplitWindow.SPLIT_FILL);this.vscroll.setScrollTarget(wnd);this.hscroll.setScrollTarget(wnd);this.content=wnd};this.getContentWindow=function(){return this.content};this.getVerticalScroll=function(){return this.vscroll};this.getHorisontalScroll=function(){return this.hscroll};this.updateLayout=override(this.updateLayout,function(){if((this.content&&(this.content.constructor===Window||defined(this.content.constructor.isSubclassOf)&&this.content.constructor.isSubclassOf(Window)))){var w,h;with(this.content.getElement()){this.vscroll.setStyle("display",(scrollHeight>offsetHeight)?"block":"none");this.hscroll.setStyle("display",(scrollWidth>offsetWidth)?"block":"none");h=(scrollWidth>offsetWidth)?(this.getClientHeight()-this.hscroll.getHeight()):this.getClientHeight();w=(scrollHeight>offsetHeight)?(this.getClientWidth()-this.vscroll.getWidth()):this.getClientWidth()}this.hscroll.setStyle("width",Math.max(w,0)+"px");this.vscroll.setStyle("height",Math.max(h,0)+"px");this.hscroll.updateLayout();this.vscroll.updateLayout()}arguments.callee.prototype.apply(this,[])});this.reset=function(){this.vscroll.setPosition(0);this.hscroll.setPosition(0);this.updateLayout()}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ComboBoxMenu");with(core.ui){core.ui.ComboBoxMenu.superClass=core.ui.Menu;core.ui.ComboBoxMenu.constructor=function(){this.selectedItem;this.notifyItemSelected=new Notification();this.ComboBoxMenu=function(){arguments.callee.prototype.apply(this,[]);this.setStyle("overflow-y","auto");this.setStyle("display","none")};this.addItem=override(this.addItem,function(D,C,A){var B=new MenuItem(this);B.setStyleName("ComboBoxMenuItem");B.setStyle("overflow","hidden");B.setText(D);B.value=C;B.onmouseover=this.onItemMouseOver;B.onmouseout=this.onItemMouseOut;B.onclick=this.onItemClick;if(A){this.selectedItem=B}return arguments.callee.prototype.apply(this,[B])});this.removeItems=override(this.removeItems,function(){this.selectedItem=undefined;arguments.callee.prototype.apply(this,[])});this.setSelectedItem=function(A){if((this.selectedItem&&(this.selectedItem.constructor===Window||defined(this.selectedItem.constructor.isSubclassOf)&&this.selectedItem.constructor.isSubclassOf(Window)))){this.selectedItem.removeStyleName("ComboBoxMenuItem-selected")}A.addStyleName("ComboBoxMenuItem-selected");this.selectedItem=A};this.getSelectedItem=function(){return this.selectedItem};this.doPopup=override(this.doPopup,function(B,A,C){if((this.selectedItem&&(this.selectedItem.constructor===Window||defined(this.selectedItem.constructor.isSubclassOf)&&this.selectedItem.constructor.isSubclassOf(Window)))){this.selectedItem.addStyleName("ComboBoxMenuItem-selected")}this.setStyle("display","");arguments.callee.prototype.apply(this,[B,A,C])});this.endPopup=override(this.endPopup,function(){arguments.callee.prototype.apply(this,[]);this.setStyle("display","none")});this.onItemMouseOver=callback(this,function(B,A){if((this.selectedItem&&(this.selectedItem.constructor===Window||defined(this.selectedItem.constructor.isSubclassOf)&&this.selectedItem.constructor.isSubclassOf(Window)))){this.selectedItem.removeStyleName("ComboBoxMenuItem-selected")}A.addStyleName("ComboBoxMenuItem-highlight")});this.onItemMouseOut=callback(this,function(B,A){A.removeStyleName("ComboBoxMenuItem-highlight")});this.onItemClick=callback(this,function(B,A){this.setSelectedItem(A);this.notifyItemSelected.send(this,A)})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ComboBox");with(core.ui){core.ui.ComboBox.superClass=core.ui.CompositeWindow;core.ui.ComboBox.constructor=function(){this.menu;this.text;this.dropDownButton;this.value;this.notifyValueChanged=new Notification();this.ComboBox=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.text=new Edit(this,0,0);this.text.setStyle("float","left");this.text.onkeypress=this.onTextKeyPress;this.dropDownButton=new ImageButton(this);this.dropDownButton.setStyleName("DropDownButton");this.dropDownButton.setState(ImageButton.STATE_NORMAL);this.dropDownButton.setStyle("float","right");this.dropDownButton.oncommand=this.onDropDownButtonClick;this.menu=this.createMenu();this.menu.notifyItemSelected.addListener(this.onMenuItemSelected);this.menu.notifyEndPopup.addListener(this.onMenuEndPopup);this.setEditable(false);this.updateLayout()};this.addItem=function(D,C,A){var B=this.menu.addItem(D,C);if(A){this.setText(D)}return B};this.insertItem=function(A,C,B){};this.removeItem=function(A){this.menu.removeItem(A)};this.removeItems=function(){this.menu.removeItems()};this.setText=function(A){this.text.setText(A)};this.getText=function(){return this.text.getText()};this.setValue=function(C){if(this.value==C){return }this.value=C;for(var A=0;A100)?value:(2000+value)}else{this[F]=value}}}}this.updateData()};this.getFormattedDate=function(H){if(!defined(H)){H=this.format}if(Calendar.FORMAT_TIMESTAMP==H){return this.getTimestamp()}var E=this.year.toString();var G=(this.month<10)?"0"+this.month:this.month.toString();var B=(this.day<10)?"0"+this.day:this.day.toString();var C={"MM":G,"DD":B,"YYYY":E};for(var A in C){var D=new RegExp(A);var F=C[A];H=H.replace(D,F)}return H};this.getTimestamp=function(A){return(defined(A))?new Date(Date.UTC(this.year,this.month-1,this.day,-A)).getTime()/1000:new Date(Date.UTC(this.year,this.month-1,this.day)).getTime()/1000};this.getYearList=function(){return this.yearList};this.getMonthList=function(){return this.monthList};this.updateData=function(){var F=((this.year%4==0)&&(this.year%100!=0))||(this.year%400==0);var A=[31,F?29:28,31,30,31,30,31,31,30,31,30,31];var D=new Date(this.year,this.month-1).getDay();if(this.yearthis.endYear){this.year=this.endYear}}var E,C;if(this.month>1){E=this.month-1;C=this.year}else{E=12;C=this.year-1}var H,I;if(this.month<12){H=this.month+1;I=this.year}else{H=1;I=this.year+1}for(var G=0,B=A[E-1]-D+1;Gthis.duration){this.finish()}else{this.playback();this.timerId=window.setTimeout(this.onTimer,this.interval)}})};core.ui.effect.BaseEffect.STATE_READY=1;core.ui.effect.BaseEffect.STATE_STARTED=2;core.ui.effect.BaseEffect.STATE_PAUSED=3;core.ui.effect.BaseEffect.STATE_STOPPED=4;core.ui.effect.BaseEffect.STATE_FINISHED=5}ClassFactory.createPackage("core.ui.effect");ClassFactory.createClass(core.ui.effect,"Blink");with(core.ui.effect){core.ui.effect.Blink.superClass=core.ui.effect.BaseEffect;core.ui.effect.Blink.constructor=function(){this.finish=override(this.finish,function(){this.source.setVisible(true);arguments.callee.prototype.apply(this,[])});this.playback=function(){this.source.setVisible(!this.source.isVisible())}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"DialogFrame");with(editor.ui){editor.ui.DialogFrame.superClass=core.ui.Frame;editor.ui.DialogFrame.constructor=function(){this.listeners=new core.util.Listeners();this.DialogFrame=function(parent){arguments.callee.prototype.apply(this,[parent]);with(core.ui){var titleBar=new Handle(this);titleBar.setStyleName("TitleBar");titleBar.setDragWindow(this);this.title=new Static(titleBar);this.title.addStyleName("Title");this.closeButton=new ImageButton(titleBar);this.closeButton.addStyleName("CloseButton");this.closeButton.setToolTip("Close");this.closeButton.setImageList("images/DialogFrame/close.gif");this.closeButton.oncommand=this.onCloseButtonClick;this.blinkEffect=new core.ui.effect.Blink(titleBar)}};this.addCloseListener=function(listener){this.listeners.add(listener)};this.removeCloseListener=function(listener){this.listeners.remove(listener)};this.fireClose=function(){this.listeners.call("onFrameClose",[this])};this.doModal=function(top){this.getContentWindow().doModal(top);this.center();this.show()};this.endModal=function(){this.getContentWindow().endModal();this.hide()};this.setTitle=function(text){this.title.setText(text)};this.getTitle=function(){return this.title.getText()};this.onDialogLooseActivity=function(){this.blinkEffect.play(420,70)};this.onDialogEndModal=function(){this.hide()};this.setContentWindow=override(this.setContentWindow,function(dialog){dialog.addDialogListener(this);arguments.callee.prototype.apply(this,[dialog])});this.onCloseButtonClick=callback(this,function(){this.fireClose()})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"PopupMenuFrame");with(editor.ui){editor.ui.PopupMenuFrame.superClass=core.ui.Frame;editor.ui.PopupMenuFrame.constructor=function(){this.PopupMenuFrame=function(B,A,E,C,D){this.Frame(B,A,E,C,D)};this.doPopupNear=function(C,B){if(!B){B=PopupMenuFrame.POSITION_UNDER}var A;var D;if(B&PopupMenuFrame.POSITION_LEFT){A=C.getAbsX()-this.getWidth()}else{if(B&PopupMenuFrame.POSITION_RIGHT){A=C.getAbsX()+C.getWidth()}else{A=C.getAbsX()}}if(B&PopupMenuFrame.POSITION_ABOVE){D=C.getAbsY()-this.getHeight()}else{if(B&PopupMenuFrame.POSITION_UNDER){D=C.getAbsY()+C.getHeight()}else{D=C.getAbsY()}}this.move(A,D);this.getContentWindow().doPopup(C,0,0);this.show()};this.setContentWindow=override(this.setContentWindow,function(A){var B=this.getContentWindow();if(B){B.notifyEndPopup.removeListener(this.onMenuEndPopup)}A.notifyEndPopup.addListener(this.onMenuEndPopup);arguments.callee.prototype.apply(this,[A])});this.endPopup=function(){this.getContentWindow().endPopup()};this.isPopup=function(){return this.getContentWindow().isPopup()};this.onMenuEndPopup=callback(this,function(A){this.hide()})};editor.ui.PopupMenuFrame.POSITION_ABOVE=1;editor.ui.PopupMenuFrame.POSITION_UNDER=4;editor.ui.PopupMenuFrame.POSITION_LEFT=8;editor.ui.PopupMenuFrame.POSITION_RIGHT=16}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ProgressBar");with(core.ui){core.ui.ProgressBar.superClass=core.ui.Window;core.ui.ProgressBar.constructor=function(){this.pos=0;this.rangeMax=100;this.rangeMin=0;this.current=0;this.items=[];this.setRange=function(B,A){this.rangeMin=B;this.rangeMax=A;this.setPos(B)};this.getRangeMin=function(){return this.rangeMin};this.getRangeMax=function(){return this.rangeMax};this.setItemCount=function(C){if(this.items.length==C){return }while(this.items.length>0){this.items.pop().close()}for(var B=0;B0)?((this.rangeMax-this.rangeMin)/this.items.length):1;this.setPos(this.pos+A)};this.setPos=function(C){var B=Math.ceil((this.items.length-1)*C/(this.rangeMax-this.rangeMin));if(B>=0&&B=B;A--){this.items[A].hide()}for(var A=this.current;A<=B;A++){this.items[A].show()}this.current=B}else{if(0==this.items.length){}}this.pos=C};this.getPos=function(){return this.pos}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"LoadingDialog");with(editor.ui){editor.ui.LoadingDialog.superClass=core.ui.Dialog;editor.ui.LoadingDialog.constructor=function(){this.progressBar;this.LoadingDialog=function(A){arguments.callee.prototype.apply(this,[A]);this.progressBar=new core.ui.ProgressBar(this);this.progressBar.setItemCount(20)}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Image");with(core.ui){core.ui.Image.superClass=core.ui.Window;core.ui.Image.constructor=function(){this.source;this.Image=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setStyle("display","block")};this.setSource=function(A){this.getElement().src=this.source=A};this.getSource=function(){return this.source};this.isLoaded=function(){return this.getElement().complete};this.createElement=function(){var A=document.createElement("img");A.ondragstart=new Function("return false");return A}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"MenuButton");with(editor.ui){editor.ui.MenuButton.superClass=core.ui.ImageButton;editor.ui.MenuButton.constructor=function(){this.icon;this.text;this.MenuButton=function(B,A,E,C,D){this.ImageButton(B,A,E,C,D);this.icon=new core.ui.Image(this);this.text=new core.ui.Static(this);this.icon.hide()};this.setText=function(A){this.text.setText(A)};this.getText=function(){return this.text.getText()};this.setIcon=function(A){this.icon.setSource(A);this.icon.show()}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"SplitButton");with(editor.ui){editor.ui.SplitButton.superClass=core.ui.SplitWindow;editor.ui.SplitButton.constructor=function(){this.leftButton;this.rightButton;this.popupMenu;this.defaultValue;this.imageList;this.state;this.notifyDefaultAction=new core.ui.Notification();this.notifyPopup=new core.ui.Notification();this.SplitButton=function(B,A,E,C,D){this.SplitWindow(B,A,E,C,D);this.leftButton=new editor.ui.MenuButton(this);this.leftButton.addStyleName("SplitButtonLeft");this.leftButton.oncommand=this.onLeftButtonClick;this.rightButton=new core.ui.ImageButton(this);this.rightButton.addStyleName("SplitButtonRight");this.rightButton.oncommand=this.onRightButtonClick;this.setState(core.ui.ImageButton.STATE_NORMAL);this.setImageList("images/SplitButton/splitbutton.gif");this.rightButton.onmousedown=this.leftButton.onmousedown=this.onButtonMouseDown;this.rightButton.onmouseout=this.leftButton.onmouseout=this.onButtonMouseOut;this.rightButton.onmouseover=this.leftButton.onmouseover=this.rightButton.onmouseup=this.leftButton.onmouseup=this.onButtonMouseOver;this.addPane(this.leftButton,core.ui.SplitWindow.SPLIT_LEFT);this.addPane(this.rightButton,core.ui.SplitWindow.SPLIT_RIGHT)};this.setImages=function(E,A,F,H,C,B,G,D){this.leftButton.setImages(E,F,C,G);this.rightButton.setImages(A,H,B,D)};this.setImageList=override(this.setImageList,function(A){if(!defined(this.imageList)){this.imageList=new window.Image()}this.imageList.src=A;this.leftButton.imageList=this.rightButton.imageList=this.imageList;this.leftButton.setImage(A);this.leftButton.setStyle("background-position",-(this.getWidth()*this.state)+"px top");this.rightButton.setImage(A);this.rightButton.setStyle("background-position",-(this.getWidth()*this.state+this.leftButton.getWidth())+"px top")});this.setEnabled=override(this.setEnabled,function(A){arguments.callee.prototype.apply(this,[A]);this.setState(A?core.ui.ImageButton.STATE_NORMAL:core.ui.ImageButton.STATE_DISABLED)});this.setState=function(A){this.getElement().setAttribute("state",A);if(defined(this.imageList)){this.leftButton.setStyle("background-position",-(this.getWidth()*A)+"px top");this.rightButton.setStyle("background-position",-(this.getWidth()*A+this.leftButton.getWidth())+"px top")}else{if(this.rightButton.images[A].src.length>0&&this.leftButton.images[A].src.length>0){this.leftButton.setImage(this.leftButton.images[A].src);this.rightButton.setImage(this.rightButton.images[A].src)}}this.state=A};this.setDefaultValue=function(A){this.defaultValue=A};this.getDefaultValue=function(){return this.defaultValue};this.setIcon=function(A){this.leftButton.setIcon(A)};this.setText=function(A){this.leftButton.setText(A)};this.setPopupMenu=function(A){this.popupMenu=A};this.onRightButtonClick=callback(this,function(){if(defined(this.popupMenu)){if(this.popupMenu.isPopup()){this.popupMenu.endPopup()}else{this.popupMenu.doPopupNear(this);this.notifyPopup.send(this)}}});this.onLeftButtonClick=callback(this,function(){if(this.popupMenu.isPopup()){this.popupMenu.endPopup()}this.notifyDefaultAction.send(this,this.defaultValue)});this.onButtonMouseDown=callback(this,function(A){this.setState(core.ui.ImageButton.STATE_PRESSED);this.activate();A.stop();return false});this.onButtonMouseOver=callback(this,function(A){this.setState(core.ui.ImageButton.STATE_HOVER);A.stop()});this.onButtonMouseOut=callback(this,function(A){this.setState(core.ui.ImageButton.STATE_NORMAL);A.stop()})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"Shortcut");with(editor.ui){editor.ui.Shortcut.constructor=function(){this.listeners=new core.util.Listeners();this.modifiers=0;this.key;this.Shortcut=function(A){this.combination=A;var D=A.split("+");for(var C=0;C1)&&!confirm("The existing data won't be saved. Would you like to continue?")){return }app.loadTemplate(template);var dialog=app.factory.getTemplatesDialog();dialog.getContentWindow().getMenu().notifyTemplateSelected.removeListener(this.onTemplateSelected);dialog.endModal()});this.onPreviewButtonClick=callback(this,function(){editor.Application.getInstance().switchMode(editor.Application.MODE_PREVIEW);this.editButton.move(core.ui.Window.getWidth()-this.editButton.getWidth()-100,core.ui.Window.getHeight()-this.editButton.getHeight()-100);this.editButton.activate();this.editButton.show()});this.onEditModeButtonClick=callback(this,function(){editor.Application.getInstance().switchMode(editor.Application.MODE_EDIT);this.editButton.hide()});this.onUndoButtonClick=callback(this,function(){editor.commands.CommandHistory.get().undo()});this.onRedoButtonClick=callback(this,function(){editor.commands.CommandHistory.get().redo()})}}ClassFactory.createPackage("core.url");ClassFactory.createClass(core.url,"Encoder");with(core.url){core.url.Encoder.constructor=function(){};core.url.encode=core.url.Encoder.encode=function(A){if(!defined(A)){return""}A=encodeURI(A);A=A.replace(/\+/g,"%2B");A=A.replace(/\#/g,"%23");A=A.replace(/\?/g,"%3F");A=A.replace(/&/g,"%26");return A}}ClassFactory.createPackage("core.url");ClassFactory.createClass(core.url,"Parser");with(core.url){core.url.Parser.constructor=function(){};core.url.parse=core.url.Parser.parse=function(C){var E={scheme:"http",host:"",port:"",user:"",password:"",path:"/",query:"",fragment:""};var D=C.indexOf("://");if(D!=-1){E.scheme=C.slice(0,D);C=C.slice(D+3)}D=C.indexOf("/");if(D!=-1){var B=C.slice(0,D);C=C.slice(D);D=B.indexOf("@");if(D!=-1){var A=B.slice(0,D).split(":");E.user=A[0];E.password=(A[1])?A[1]:"";B=B.slice(D+1)}D=B.indexOf(":");if(D!=-1){E.port=parseInt(B.slice(D+1));B=B.slice(0,D)}E.host=B}D=C.indexOf("#");if(D!=-1){E.fragment=C.slice(D+1);C=C.slice(0,D)}D=C.indexOf("?");if(D!=-1){E.query=C.slice(D+1);C=C.slice(0,D)}E.path=C;return E}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"LoadingMessage");with(editor.ui){editor.ui.LoadingMessage.constructor=function(){};editor.ui.LoadingMessage.icons={};editor.ui.LoadingMessage.texts={};editor.ui.LoadingMessage.showIcon=function(B,C){if(!defined(C)){C="images/loading.gif"}if(!defined(this.icons[B.getId()])){this.icons[B.getId()]=new core.ui.Image(B);this.icons[B.getId()].setStyle("position","absolute")}var A=this.icons[B.getId()];A.setSource(C);A.center();A.show()};editor.ui.LoadingMessage.showText=function(B,C){if(!defined(C)){C="Loading..."}if(!defined(this.texts[B.getId()])){this.texts[B.getId()]=new core.ui.Static(B);this.texts[B.getId()].setStyle("position","absolute")}var A=this.texts[B.getId()];A.setText(C);A.center();A.show()};editor.ui.LoadingMessage.hideMessage=function(A){if(defined(this.icons[A.getId()])){this.icons[A.getId()].hide()}if(defined(this.texts[A.getId()])){this.texts[A.getId()].hide()}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ImageLibrary");with(editor.ui){editor.ui.ImageLibrary.superClass=core.ui.Dialog;editor.ui.ImageLibrary.constructor=function(){this.categories;this.images;this.closeButton;this.selectedItem;this.preloadImages={};this.thumbnailSources={};this.imagesCounter=0;this.notifyImageSelected=new core.ui.Notification();this.ImageLibrary=function(parent){this.Dialog(parent);with(core.ui){var splitter=new SplitWindow(this,0,0,"100%","100%");this.categories=new ScrollWindow(splitter);this.categories.setContentWindow(new Menu(this.categories));this.categories.addStyleName("Categories");this.images=new ScrollWindow(splitter);this.images.setContentWindow(new Menu(this.images));this.images.addStyleName("Images");var buttons=new Window(splitter);buttons.addStyleName("ButtonsPane");this.closeButton=new ImageButton(buttons);this.closeButton.addStyleName("CloseButton");this.closeButton.setImageList("images/ImageLibrary/apply.gif");this.closeButton.setToolTip("Close library dialog");this.closeButton.setText("Close");this.closeButton.oncommand=parent.onCloseButtonClick;splitter.addPane(buttons,SplitWindow.SPLIT_BOTTOM);splitter.addPane(this.categories,SplitWindow.SPLIT_LEFT);splitter.addPane(this.images)}this.loadCategories()};this.loadCategories=function(){this.loadedCategories=false;LoadingMessage.showText(this);core.ajax.sendRequest(theApp.getUserCommand("ajax.EnumerateImages"),this.onLoadCategories)};this.addCategoryItem=function(category,icon){var item=new MenuButton(this.categories.getContentWindow());item.category=category;item.setText(category);item.setIcon(icon);item.setToolTip('Select images in category "'+category+'"');item.setImageList("images/ImageLibrary/category.gif");item.oncommand=this.onCategoryClick;this.categories.getContentWindow().addItem(item)};this.onLoadCategories=callback(this,function(response){try{if("OK"==response.status){this.addCategoryItem("My images","images/ImageLibrary/my-images.png");var path=response.path;for(var i=0;i0)};this.getFilePath=function(){return this.path};this.setUploadUrl=function(url){this.url=url};this.getUploadUrl=function(){return this.url};this.setText=function(text){this.text.innerHTML=text};this.getText=function(){return this.text.innerHTML};this.close=override(this.close,function(){this.getElement().removeChild(this.iframe);this.form.removeChild(this.input);this.getElement().removeChild(this.form);delete this.iframe;delete this.input;delete this.form;arguments.callee.prototype.apply(this,[])});this.setFocus=function(){};this.createElement=override(this.createElement,function(){var root=arguments.callee.prototype.apply(this,[]);this.text=document.createElement("div");this.text.style.position="absolute";this.text.style.left=this.text.style.top="0px";this.text.style.width=this.text.style.height="100%";this.text.style.zIndex=0;root.appendChild(this.text);var id=this.getId()+"_iframe";this.iframe=document.createElement("iframe");this.iframe.setAttribute("id",id);this.iframe.setAttribute("name",id);this.iframe.style.display="none";this.iframe.style.width=this.iframe.style.height="0px";this.iframe.style.margin=this.iframe.style.padding="0px";root.appendChild(this.iframe);Event.addListener(this.iframe,"load",this.onIframeLoad);this.form=document.createElement("form");this.form.target=this.iframe.name;this.form.method="POST";this.form.enctype=this.form.encoding="multipart/form-data";this.form.style.margin=this.form.style.padding="0px";root.appendChild(this.form);this.input=document.createElement("input");this.input.name=this.input.type="file";this.input.style.position="absolute";this.input.style.zIndex=1;this.input.style.opacity=0;this.input.style.MozOpacity=0;this.input.style.KhtmlOpacity=0;this.input.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";this.input.style.styleFloat=this.input.style.cssFloat="right";this.input.style.height="100%";this.input.style.right="0px";this.input.onchange=this.onFileInputChange;this.form.appendChild(this.input);return root});this.onIframeLoad=callback(this,function(){if(!this.iframe.contentWindow.name){this.iframe.contentWindow.name=this.iframe.name}var respText=this.iframe.contentWindow.document.body.innerHTML;if(respText.length>0){var status="FAILED";var message="";try{var response=eval("("+respText+")");status=response.status;message=response.message}catch(ex){message=respText}if("OK"==status){this.notifyFileUploaded.send(this,response)}else{this.notifyUploadError.send(this,response)}}});this.onFileInputChange=callback(this,function(){this.path=this.input.value;this.notifyFileSelected.send(this,this.input.value);this.form.reset()});this.onmousemove=function(event){this.input.style.right=this.getAbsX()+this.getWidth()-event.getX()-15+"px";this.input.style.top=event.getY()-this.getAbsY()-this.input.offsetHeight/2+"px"}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ImagePreview");with(editor.ui){editor.ui.ImagePreview.superClass=core.ui.Window;editor.ui.ImagePreview.constructor=function(){this.image;this.loadingWindow;this.loaded=false;this.zoom;this.notifyImageLoaded=new core.ui.Notification();this.ImagePreview=function(B,A,E,C,D){this.Window(B,A,E,C,D);this.loadingWindow=new core.ui.Static(this);this.loadingWindow.setStyle("position","absolute");this.loadingWindow.center();this.loadingWindow.hide();this.image=new window.Image();this.image.onload=this.onImageLoaded;this.reset()};this.setImage=function(A){this.loaded=false;if(A&&("none"!==A)){this.showAnimation();if(1!=this.zoom){A+=((-1!==A.indexOf("?"))?"&":"?");A+="zoom="+Math.ceil(this.zoom*100)}this.image.src=A}};this.setPosition=function(A,B){this.setStyle("background-position",A+" "+B);this.setStyle("background-position-x",A);this.setStyle("background-position-y",B)};this.getPositionX=function(){return this.getStyle("background-position-x")};this.getPositionY=function(){return this.getStyle("background-position-y")};this.setRepeat=function(A){this.setStyle("background-repeat",A)};this.getRepeat=function(){return this.getStyle("background-repeat")};this.setZoom=function(A){this.zoom=A};this.reset=function(){this.loaded=false;this.loadingWindow.hide();this.setStyle("background-image","none");this.setPosition("center","center");this.setRepeat("no-repeat");this.resetZoom()};this.isImageLoaded=function(){return this.loaded};this.showAnimation=function(){this.loaded=false;this.setStyle("background-image","none");this.loadingWindow.setStyle("background","url(images/loading.gif) no-repeat center center");this.loadingWindow.center();this.loadingWindow.show()};this.resetZoom=function(){this.zoom=(this.getWidth()/core.ui.Window.getWidth())};this.onImageLoaded=callback(this,function(){this.loaded=true;this.loadingWindow.hide();this.setStyle("background-image",'url("'+this.image.src+'")');this.notifyImageLoaded.send(this)})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ImageDialog");with(editor.ui){editor.ui.ImageDialog.superClass=core.ui.Dialog;editor.ui.ImageDialog.constructor=function(){this.previewWindow;this.fileUpload;this.libButton;this.urlButton;this.cancelButton;this.applyButton;this.selectedImage;this.notifyImageApplied=new core.ui.Notification();this.notifyCancelled=new core.ui.Notification();this.ImageDialog=function(B,A,E,C,D){this.Dialog(B,A,E,C,D);this.previewWindow=new ImagePreview(this);this.previewWindow.notifyImageLoaded.addListener(this.onPreviewLoaded);this.cancelButton=new core.ui.ImageButton(this);this.cancelButton.setStyleId("image-dialog-button-cancel");this.cancelButton.setImageList("images/ImageDialog/apply.gif");this.cancelButton.setText("Cancel");this.cancelButton.setToolTip("Close without changes");this.cancelButton.oncommand=this.onCancelButtonClick;this.applyButton=new core.ui.ImageButton(this);this.applyButton.setStyleId("image-dialog-button-apply");this.applyButton.setImageList("images/ImageDialog/apply.gif");this.applyButton.setText("OK");this.applyButton.setToolTip("Close and change the image");this.applyButton.oncommand=this.onApplyButtonClick;this.fileUpload=new core.ui.FileUpload(this);this.fileUpload.setUploadUrl(theApp.getUserCommand("ajax.UploadImage"));this.fileUpload.setText("Upload");this.fileUpload.setToolTip("Upload image");this.fileUpload.setImageList("images/ImageDialog/browse.gif");this.fileUpload.notifyFileSelected.addListener(this.onFileSelected);this.fileUpload.notifyFileUploaded.addListener(this.onFileUploaded);this.fileUpload.notifyUploadError.addListener(this.onFileError);this.urlButton=new core.ui.ImageButton(this);this.urlButton.setStyleId("image-dialog-button-url");this.urlButton.setText("Load URL");this.urlButton.setToolTip("Load image from url");this.urlButton.setImageList("images/ImageDialog/url.gif");this.urlButton.oncommand=this.onUrlButtonClick;this.libButton=new core.ui.ImageButton(this);this.libButton.setStyleId("image-dialog-button-lib");this.libButton.setImageList("images/ImageDialog/lib.gif");this.libButton.setText("My images & library");this.libButton.setToolTip("Load image from library");this.libButton.oncommand=this.onLibButtonClick;this.updateControls()};this.setImage=function(A){this.selectedImage=A;this.previewWindow.setImage(A)};this.reset=function(){this.previewWindow.reset();this.fileUpload.clear();theApp.factory.getUrlDialog().getContentWindow().reset();this.updateControls()};this.updateControls=function(){this.applyButton.setEnabled(this.previewWindow.isImageLoaded());this.applyButton.setState(core.ui.ImageButton.STATE_NORMAL);this.applyButton.setStyle("opacity",this.previewWindow.isImageLoaded()?100:75)};this.centerObject=function(A){A.move(core.ui.Window.getWidth()-(document.body.clientWidth+A.getWidth())/2,core.ui.Window.getHeight()-(document.body.clientHeight+A.getHeight())/2)};this.onLibButtonClick=callback(this,function(){var A=theApp.factory.getImageLibrary();A.getContentWindow().notifyImageSelected.addListener(this.onLibImageSelected,true);this.centerObject(A);A.doModal();A.getContentWindow().refreshMyImages()});this.onUrlButtonClick=callback(this,function(){var A=theApp.factory.getUrlDialog();A.setTitle("Image URL");A.getContentWindow().notifySetUrl.addListener(this.onSetImageUrl,true);A.getContentWindow().notifyCancel.addListener(this.onUrlButtonCancelClick,true);this.centerObject(A);A.doModal()});this.onApplyButtonClick=callback(this,function(){this.notifyImageApplied.send(this,this.selectedImage)});this.onCancelButtonClick=callback(this,function(){this.notifyCancelled.send(this)});this.onSetImageUrl=callback(this,function(B,A){core.ajax.sendRequest(theApp.getUserCommand("ajax.CopyImage"),this.onImageCopy,{"url":A});theApp.factory.getUrlDialog().endModal()});this.onImageCopy=callback(this,function(A){try{if("OK"==A.status){this.selectedImage=A.src;this.previewWindow.setImage(A.src)}else{if(A.message){window.alert(A.message)}else{throw new Error("Image is not copied. The response is: "+A)}}}catch(B){alert("Sorry, the error occurs while copying the image.\n\nError details: "+B.message)}});this.onUrlButtonCancelClick=callback(this,function(){theApp.factory.getUrlDialog().endModal()});this.onFileSelected=callback(this,function(){this.previewWindow.showAnimation();this.fileUpload.upload();this.updateControls()});this.onFileUploaded=callback(this,function(A,B){this.selectedImage=B.src;this.previewWindow.setImage(B.src)});this.onFileError=callback(this,function(){this.previewWindow.reset();this.updateControls();alert("Sorry, the file you uploaded is not a valid image.")});this.onLibImageSelected=callback(this,function(B,A){this.selectedImage=A;this.previewWindow.setImage(A);theApp.factory.getImageLibrary().endModal()});this.onPreviewLoaded=callback(this,function(){this.updateControls()})}}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"Color");with(core.util){core.util.Color.constructor=function(){this.hex;this.Color=function(A){switch(typeof A){case"string":if(A.match(/^rgb\((\d+)[^\d]+(\d+)[^\d]+(\d+)\)$/i)){this.fromRgb(parseInt(RegExp.$1),parseInt(RegExp.$2),parseInt(RegExp.$3))}else{if(A.match(/^\#{0,1}([a-f0-9]+)$/i)){this.fromHex(RegExp.$1)}else{this.fromString(A)}}break;case"number":break}};this.fromRgb=function(C,B,A){this.hex=Color.rgb2Hex(C,B,A)};this.fromHex=function(A){this.hex=A.toLowerCase()};this.fromString=function(A){A=A.toLowerCase();if(defined(Color.map[A])){this.hex=Color.map[A];return true}return false};this.toString=function(){return this.hex.toString()}};core.util.Color.dec2Hex=function(C){var B="0123456789abcdef";var A=B.substr(C&15,1);while(C>15){C>>=4;A=B.substr(C&15,1)+A}return(2==A.length)?A:("0"+A)};core.util.Color.rgb2Hex=function(C,B,A){return Color.dec2Hex(C)+Color.dec2Hex(B)+Color.dec2Hex(A)};core.util.Color.hex2Rgb=function(B){var D="";var C="0123456789abcdef";B=B.toLowerCase();for(var A=0;A<6;A+=2){D+=16*C.indexOf(B.charAt(A))+C.indexOf(B.charAt(A+1))+","}return D.substr(0,D.length-1)};core.util.Color.map={"aliceblue":"f0f8ff","antiquewhite":"faebd7","aqua":"00ffff","aquamarine":"7fffd4","azure":"f0ffff","beige":"f5f5dc","bisque":"ffe4c4","black":"000000","blanchedalmond":"ffebcd","blue":"0000ff","blueviolet":"8a2be2","brown":"a52a2a","burlywood":"deb887","cadetblue":"5f9ea0","chartreuse":"7fff00","chocolate":"d2691e","coral":"ff7f50","cornflowerblue":"6495ed","cornsilk":"fff8dc","crimson":"dc143c","cyan":"00ffff","darkblue":"00008b","darkcyan":"008b8b","darkgoldenrod":"b8860b","darkgray":"a9a9a9","darkgreen":"006400","darkkhaki":"bdb76b","darkmagenta":"8b008b","darkolivegreen":"556b2f","darkorange":"ff8c00","darkorchid":"9932cc","darkred":"8b0000","darksalmon":"e9967a","darkseagreen":"8fbc8f","darkslateblue":"483d8b","darkslategray":"2f4f4f","darkturquoise":"00ced1","darkviolet":"9400d3","deeppink":"ff1493","deepskyblue":"00bfff","dimgray":"696969","dodgerblue":"1e90ff","firebrick":"b22222","floralwhite":"fffaf0","forestgreen":"228b22","fuchsia":"ff00ff","gainsboro":"dcdcdc","ghostwhite":"f8f8ff","gold":"ffd700","goldenrod":"daa520","gray":"808080","green":"008000","greenyellow":"adff2f","honeydew":"f0fff0","hotpink":"ff69b4","indianred":"cd5c5c","indigo":"4b0082","ivory":"fffff0","khaki":"f0e68c","lavender":"e6e6fa","lavenderblush":"fff0f5","lawngreen":"7cfc00","lemonchiffon":"fffacd","lightblue":"add8e6","lightcoral":"f08080","lightcyan":"e0ffff","lightgoldenrodyellow":"fafad2","lightgreen":"90ee90","lightgrey":"d3d3d3","lightpink":"ffb6c1","lightsalmon":"ffa07a","lightseagreen":"20b2aa","lightskyblue":"87cefa","lightslategray":"778899","lightsteelblue":"b0c4de","lightyellow":"ffffe0","lime":"00ff00","limegreen":"32cd32","linen":"faf0e6","magenta":"ff00ff","maroon":"800000","mediumaquamarine":"66cdaa","mediumblue":"0000cd","mediumorchid":"ba55d3","mediumpurple":"9370db","mediumseagreen":"3cb371","mediumslateblue":"7b68ee","mediumspringgreen":"00fa9a","mediumturquoise":"48d1cc","mediumvioletred":"c71585","midnightblue":"191970","mintcream":"f5fffa","mistyrose":"ffe4e1","moccasin":"ffe4b5","navajowhite":"ffdead","navy":"000080","oldlace":"fdf5e6","olive":"808000","olivedrab":"6b8e23","orange":"ffa500","orangered":"ff4500","orchid":"da70d6","palegoldenrod":"eee8aa","palegreen":"98fb98","paleturquoise":"afeeee","palevioletred":"db7093","papayawhip":"ffefd5","peachpuff":"ffdab9","peru":"cd853f","pink":"ffc0cb","plum":"dda0dd","powderblue":"b0e0e6","purple":"800080","red":"ff0000","rosybrown":"bc8f8f","royalblue":"4169e1","saddlebrown":"8b4513","salmon":"fa8072","sandybrown":"f4a460","seagreen":"2e8b57","seashell":"fff5ee","sienna":"a0522d","silver":"c0c0c0","skyblue":"87ceeb","slateblue":"6a5acd","slategray":"708090","snow":"fffafa","springgreen":"00ff7f","steelblue":"4682b4","tan":"d2b48c","teal":"008080","thistle":"d8bfd8","tomato":"ff6347","turquoise":"40e0d0","violet":"ee82ee","wheat":"f5deb3","white":"ffffff","whitesmoke":"f5f5f5","yellow":"ffff00","yellowgreen":"9acd32"}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ColorMenu");with(editor.ui){editor.ui.ColorMenu.superClass=editor.ui.PopupMenu;editor.ui.ColorMenu.constructor=function(){this.color;this.menuTitle;this.selectedColor;this.transpColor;this.colorEditor;this.okButton;this.notifyColorSelected=new core.ui.Notification();this.notifyColorApplied=new core.ui.Notification();this.ColorMenu=function(B,A,F,D,E){this.Menu(B,A,F,D,E);this.transpColor=new core.ui.MenuItem(this);this.transpColor.color="transparent";this.transpColor.setStyleId("color-menu-transparent-color");this.transpColor.setStyle("background-image","url(images/ColorMenu/transparent.gif)");this.transpColor.setToolTip("Transparent");this.transpColor.onclick=this.onItemClick;this.menuTitle=new core.ui.Static(this);this.menuTitle.setStyleId("color-menu-title");for(var C=0;C0)&&(this.currentLoop>=this.loop)){this.stop();return }this.text.style.left=this.getWidth()+"px"}this.timerId=window.setTimeout(this.onTimer,this.scrollDelay)})}}ClassFactory.createPackage("editor");ClassFactory.createClass(editor,"MusicPlayer");with(editor){editor.MusicPlayer.constructor=function(){};editor.MusicPlayer.STATE_READY=1;editor.MusicPlayer.STATE_STARTED=2;editor.MusicPlayer.STATE_PAUSED=3;editor.MusicPlayer.STATE_STOPPED=4;editor.MusicPlayer.loadCallback;editor.MusicPlayer.completeCallback;editor.MusicPlayer.currentFile=null;editor.MusicPlayer.currentState=editor.MusicPlayer.STATE_READY;editor.MusicPlayer.currentPosition=0;editor.MusicPlayer.currentVolume=100;editor.MusicPlayer.currentPan=0;editor.MusicPlayer.onSoundLoaded=function(){if(this.loadCallback){this.loadCallback()}};editor.MusicPlayer.onSoundComplete=function(){if(this.completeCallback){this.completeCallback()}};editor.MusicPlayer.onFlashLoaded=function(){this.loaded=true;this.sound=new AFLAX.FlashObject(aflax,"Sound");this.sound.exposeFunction("loadSound",this.sound);this.sound.exposeFunction("start",this.sound);this.sound.exposeFunction("stop",this.sound);this.sound.exposeFunction("setVolume",this.sound);this.sound.exposeFunction("setPan",this.sound);this.sound.exposeProperty("position",this.sound);this.sound.exposeProperty("duration",this.sound);this.sound.mapFunction("addEventHandler");this.sound.addEventHandler("onLoad","editor.MusicPlayer.onSoundLoaded");this.sound.addEventHandler("onSoundComplete","editor.MusicPlayer.onSoundComplete");if(defined(this.currentFile)){this.sound.loadSound(this.currentFile,true);this.sound.stop()}};editor.MusicPlayer.load=function(C,B,A){if(!defined(this.sound)){this.currentFile=C;this.loadCallback=B;this.completeCallback=A;return }this.sound.stop();if((MusicPlayer.STATE_STARTED==this.state)||(MusicPlayer.STATE_PAUSED==this.state)){if(this.completeCallback){this.completeCallback()}}this.currentPosition=0;this.loadCallback=B;this.completeCallback=A;if(this.currentFile!==C){this.currentFile=C;this.sound.loadSound(C,true);this.sound.stop()}else{if(defined(this.loadCallback)){this.loadCallback()}}};editor.MusicPlayer.start=function(){if(defined(this.sound)){this.sound.start(this.currentPosition/1000);this.state=MusicPlayer.STATE_STARTED}};editor.MusicPlayer.pause=function(){if(defined(this.sound)){this.sound.stop();this.currentPosition=this.sound.getPosition();this.state=this.STATE_PAUSED}};editor.MusicPlayer.stop=function(){if(defined(this.sound)){this.sound.stop();this.currentPosition=0;this.state=this.STATE_STOPPED}};editor.MusicPlayer.getPosition=function(){if(defined(this.sound)){return this.sound.getPosition()}};editor.MusicPlayer.getDuration=function(){if(defined(this.sound)){return this.sound.getDuration()}};editor.MusicPlayer.setVolume=function(A){if(defined(this.sound)){if(A<0){A=0}if(A>100){A=100}this.sound.setVolume(this.currentVolume=A)}};editor.MusicPlayer.getVolume=function(){return this.currentVolume};editor.MusicPlayer.setPan=function(A){if(defined(this.sound)){if(A<-100){A=-100}if(A>100){A=100}this.sound.setPan(this.currentPan=A)}};editor.MusicPlayer.getPan=function(){return this.currentPan};editor.MusicPlayer.getState=function(){return this.currentState};editor.MusicPlayer.getFileName=function(){return this.currentFile}}ClassFactory.createPackage("editor.ui.wizard");ClassFactory.createClass(editor.ui.wizard,"WizardPane");with(editor.ui.wizard){editor.ui.wizard.WizardPane.superClass=core.ui.Window;editor.ui.wizard.WizardPane.constructor=function(){this.WizardPane=function(A,B){this.Window(A.getContentPane());this.wizard=A;this.paneId=B;this.nextPaneId=null;this.prevPaneId=null};this.getWizard=function(){return this.wizard};this.getPaneId=function(){return this.paneId};this.setNextPaneId=function(A){this.nextPaneId=A};this.getNextPaneId=function(){return this.nextPaneId};this.setPrevPaneId=function(A){this.prevPaneId=A};this.getPrevPaneId=function(){return this.prevPaneId};this.setTitle=function(A){this.title=A};this.getTitle=function(){return this.title};this.setText=function(A){this.text=A};this.getText=function(){return this.text};this.setSkip=function(A){this.skip=A};this.canSkip=function(){return this.skip};this.reset=function(){};this.validate=function(){return true};this.setVisible=override(this.setVisible,function(A){arguments.callee.prototype.apply(this,[A]);if(this.isVisible()){if(!this.initialized){this.init();this.initialized=true}}});this.setActive=function(A){};this.init=function(){}}}ClassFactory.createPackage("editor.plugins.tribute");ClassFactory.createClass(editor.plugins.tribute,"Sound");with(editor.plugins.tribute){editor.plugins.tribute.Sound.constructor=function(){this.file;this.title;this.duration;this.cyclic=false;this.Sound=function(A,B,C){this.file=defined(A)?A:"";this.title=defined(B)?B:"";this.duration=defined(C)?C:0};this.setFile=function(A){this.file=A};this.getFile=function(){return this.file};this.hasFile=function(){return(this.file.length)>0?true:false};this.setDuration=function(A){this.duration=A};this.getDuration=function(){return this.duration};this.setTitle=function(A){this.title=A};this.getTitle=function(){return this.title};this.setCyclic=function(A){this.cyclic=A?true:false};this.isCyclic=function(){return this.cyclic?true:false};this.clone=function(){var A=new Sound(this.file,this.title,this.duration);A.setCyclic(this.isCyclic());return A}}}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"ImagePreloader");with(core.util){core.util.ImagePreloader.constructor=function(){this.url;this.loading=false;this.image=new Image();this.listeners=new Listeners();this.ImagePreloader=function(){this.image.onload=this.onImageLoaded;this.image.onerror=this.onLoadError};this.preload=function(A){this.url=A;this.loading=true;this.image.src=A};this.addListener=function(A){this.listeners.add(A)};this.removeListener=function(A){this.listeners.remove(A)};this.isLoading=function(){return this.loading};this.getUrl=function(){return this.url};this.getWidth=function(){return this.image.width};this.getHeight=function(){return this.image.height};this.toString=function(){return"[ImagePreloader]"};this.fireImagePreloaded=function(A){this.listeners.call("onImagePreloaded",[this,A])};this.firePreloadFailed=function(A){this.listeners.call("onPreloadFailed",[this,A])};this.onImageLoaded=callback(this,function(){this.loading=false;this.fireImagePreloaded(this.url)});this.onLoadError=callback(this,function(){this.loading=false;this.firePreloadFailed(this.url)})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ImageFrame");with(editor.ui){editor.ui.ImageFrame.superClass=core.ui.Static;editor.ui.ImageFrame.constructor=function(){this.preloader=new core.util.ImagePreloader();this.ImageFrame=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.background=new core.ui.Static(this);this.background.setStyleName("Background");this.background.setStyle("background-repeat","no-repeat");this.background.setStyle("background-position","center center");this.preloader.addListener(this)};this.setImage=function(A){this.src=A;if(!A||"none"==A){this.background.setStyle("background-image",("none"==A)?"none":"")}else{this.background.setStyle("background-image","url(images/loading.gif)");this.preloader.preload(core.url.encode(A)+"?size="+this.background.getWidth()+"x"+this.background.getHeight())}};this.getImage=function(){return this.src};this.close=override(this.close,function(){this.preloader.removeListener(this);arguments.callee.prototype.apply(this,[])});this.onImagePreloaded=function(A){this.background.setStyle("background-image",'url("'+A.getUrl()+'")')}}}ClassFactory.createPackage("editor.plugins.tribute");ClassFactory.createClass(editor.plugins.tribute,"CameraView");with(editor.plugins.tribute){editor.plugins.tribute.CameraView.constructor=function(){this.x;this.y;this.zoom;this.CameraView=function(A,C,B){this.x=defined(A)?A:50;this.y=defined(C)?C:50;this.zoom=defined(B)?B:100};this.setZoom=function(A){this.zoom=Math.max(A,100);if(100==this.zoom){this.x=50;this.y=50}};this.getZoom=function(){return this.zoom};this.center=function(A,B){this.x=A;this.y=B};this.getCenterX=function(){return this.x};this.getCenterY=function(){return this.y};this.reset=function(){this.zoom=100;this.x=50;this.y=50}}}ClassFactory.createPackage("editor.plugins.tribute");ClassFactory.createClass(editor.plugins.tribute,"Subtitles");with(editor.plugins.tribute){editor.plugins.tribute.Subtitles.constructor=function(){this.text;this.size;this.bold=false;this.italic=false;this.underline=false;this.Subtitles=function(B,A){this.text=defined(B)?B:"";this.size=defined(A)?A:12};this.setText=function(A){this.text=A};this.getText=function(){return this.text};this.setSize=function(A){this.size=A};this.getSize=function(){return this.size};this.setBold=function(A){this.bold=(A)?true:false};this.isBold=function(){return(this.bold)?true:false};this.setItalic=function(A){this.italic=(A)?true:false};this.isItalic=function(){return(this.italic)?true:false};this.setUnderline=function(A){this.underline=(A)?true:false};this.isUnderline=function(){return(this.underline)?true:false};this.reset=function(){this.text="";this.size=12;this.bold=false;this.italic=false;this.underline=false}}}ClassFactory.createPackage("editor.plugins.tribute");ClassFactory.createClass(editor.plugins.tribute,"Scene");with(editor.plugins.tribute){editor.plugins.tribute.Scene.constructor=function(){this.period="";this.image="";this.duration;this.fading=Scene.FADING_NORMAL;this.subtitles;this.startView;this.endView;this.notifySceneChanged=new core.ui.Notification();this.Scene=function(A,C,B){this.image=defined(A)?A:"";this.duration=defined(C)?C:10;this.subtitles=new Subtitles(B);this.startView=new CameraView();this.endView=new CameraView()};this.setImage=function(A){this.notifySceneChanged.send(this);this.image=A;this.startView.reset();this.endView.reset()};this.getImage=function(){return this.image};this.setDuration=function(A){this.duration=A};this.getDuration=function(){return this.duration};this.setSubtitles=function(A){this.subtitles=A};this.getSubtitles=function(){return this.subtitles};this.setFadingType=function(A){this.fading=A};this.getFadingType=function(){return this.fading};this.setStartView=function(A){this.startView=A};this.getStartView=function(){return this.startView};this.setEndView=function(A){this.endView=A};this.getEndView=function(){return this.endView};this.setPeriod=function(A){this.period=A};this.getPeriod=function(){return this.period};this.hasImage=function(){return(this.image.length>0)?true:false};this.reset=function(){this.notifySceneChanged.send(this);this.image="";this.fading=Scene.FADING_NORMAL;this.duration=10;this.subtitles.reset();this.startView.reset();this.endView.reset()};this.clone=function(){var B=new Scene(this.image,this.duration);B.setFadingType(this.fading);B.setPeriod(this.period);var D=B.getSubtitles();D.setText(this.subtitles.getText());D.setSize(this.subtitles.getSize());D.setBold(this.subtitles.isBold());D.setItalic(this.subtitles.isItalic());D.setUnderline(this.subtitles.isUnderline());var C=B.getStartView();C.center(this.startView.getCenterX(),this.startView.getCenterY());C.setZoom(this.startView.getZoom());var A=B.getEndView();A.center(this.endView.getCenterX(),this.endView.getCenterY());A.setZoom(this.endView.getZoom());return B}};editor.plugins.tribute.Scene.FADING_NORMAL=0;editor.plugins.tribute.Scene.FADING_CIRCLES=1;editor.plugins.tribute.Scene.FADING_JALOUSIE=2;editor.plugins.tribute.Scene.FADING_SQUARES=3}ClassFactory.createPackage("editor.plugins.tribute.wizard");ClassFactory.createClass(editor.plugins.tribute.wizard,"TributeVideoSubtitlesPane");with(editor.plugins.tribute.wizard){editor.plugins.tribute.wizard.TributeVideoSubtitlesPane.superClass=editor.ui.wizard.WizardPane;editor.plugins.tribute.wizard.TributeVideoSubtitlesPane.constructor=function(){this.TributeVideoSubtitlesPane=function(A){arguments.callee.prototype.apply(this,[A,TributeVideoSubtitlesPane]);this.setPrevPaneId(TributeVideoMusicPane);this.setTitle("Video subtitles");this.setText("Here you can add subtitles to any video scene.");this.items=new core.ui.ScrollWindow(this,0,0,"100%","100%");this.items.setContentWindow(new core.ui.Menu(this.items))};this.createSubtitles=function(){var F=3;var A=[ChildhoodPhotosPane,TeenagePhotosPane,AdultPhotosPane,MaturePhotosPane];for(var C=0;CNote: only mp3 files are supported at the moment.");this.setSkip(true)};this.setActive=function(active){if(active){this.getWizard().addWizardListener(this)}else{this.getWizard().removeWizardListener(this)}};this.init=function(){this.items=new core.ui.ScrollWindow(this,0,0,"100%","100%");this.items.setContentWindow(new core.ui.Menu(this.items));this.addMenuItems(3)};this.addMenuItems=function(count){if(this.addButton){this.addButton.close()}for(var i=0;i0){return arguments.callee.prototype.apply(this,[])}}return undefined});this.createAddButton=function(){this.addButton=new core.ui.ImageButton(this.items.getContentWindow());this.addButton.addStyleName("AddButton");this.addButton.setText("Add more");this.addButton.setToolTip("Add more sounds");this.addButton.setImageList("images/VideoWizard/add.png");this.addButton.oncommand=this.onAddButtonCommand};this.onAddButtonCommand=callback(this,function(){this.addMenuItems(3)});this.stopSound=function(){for(var i=0;i0){this.info.title=E.title}else{this.info.title=E.name}this.info.artist=E.artist;this.info.duration=E.duration;var A=this.info.name;if((this.info.artist.length>0)&&(this.info.title.length>0)){A=this.info.artist+" - "+this.info.title}var C=common.util.DateUtils.getMinutes(this.info.duration);var D=common.util.DateUtils.getSeconds(this.info.duration);A+=" ("+C+":"+D+")";this.track.setStyle("background-image","none");this.track.setText(A);this.track.setToolTip(A);this.track.start();this.updateControls();this.notifyUploaded.send(this,this.info.path,this.info.title,this.info.artist,this.info.duration,this.info.name)});this.onUploadError=callback(this,function(A,B){this.uploaded=false;this.track.setStyle("background-image","none");this.updateControls();this.notifyUploadFailed.send(this);if(defined(B.message)){alert(B.message)}});this.onPlayButtonCommand=callback(this,function(){if(this.started){this.pause();this.notifyMusicPaused.send(this)}else{this.start();this.notifyMusicStarted.send(this)}});this.onStopButtonCommand=callback(this,function(){this.stop();this.notifyMusicStopped.send(this)});this.onSoundLoaded=callback(this,function(){editor.MusicPlayer.start()});this.onSoundComplete=callback(this,function(){this.stop();this.notifyMusicComplete.send(this)})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"CheckBox");with(core.ui){core.ui.CheckBox.superClass=core.ui.InputWindow;core.ui.CheckBox.constructor=function(){this.input;this.label;this.CheckBox=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.updateLayout()};this.setChecked=function(A){this.getInput().checked=A};this.isChecked=function(){return this.getInput().checked};this.setText=function(A){this.label.innerHTML=A};this.getText=function(){return this.label.innerHTML};this.getInput=function(){return this.input};this.resize=override(this.resize,function(A,B){arguments.callee.prototype.apply(this,[A,B]);this.updateLayout()});this.close=override(this.close,function(){this.getElement().removeChild(this.input);this.getElement().removeChild(this.label);delete this.input;delete this.label;arguments.callee.prototype.apply(this,[])});this.getType=function(){return"checkbox"};this.updateLayout=function(){this.label.style.height=this.getClientHeight()+"px";this.label.style.lineHeight=this.getClientHeight()+"px"};this.createElement=override(this.createElement,function(){var A=document.createElement("div");this.input=arguments.callee.prototype.apply(this,[]);this.input.id=this.getId()+"_input";this.input.style.left="0px";this.input.style.top="0px";this.input.style.height="100%";this.input.style.lineHeight="100%";this.input.style.marginTop=this.input.style.marginBottom="0px";this.input.style.marginRight="3px";this.input.style.styleFloat=this.input.style.cssFloat="left";A.appendChild(this.input);this.label=document.createElement("label");this.label.htmlFor=this.input.id;this.label.style.display="block";core.ui.quirks.TextSelection.preventSelection(this.label);A.appendChild(this.label);return A})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"RadioButton");with(core.ui){core.ui.RadioButton.superClass=core.ui.CheckBox;core.ui.RadioButton.constructor=function(){this.createElement=function(){var C=document.createElement("div");var A="radio"+this.getParent().getId();try{this.input=document.createElement('')}catch(B){this.input=document.createElement("input");this.input.type="radio";this.input.name=A}this.input.id=this.getId()+"_input";this.input.style.left="0px";this.input.style.top="0px";this.input.style.height="100%";this.input.style.lineHeight="100%";this.input.style.marginTop=this.input.style.marginBottom=0;this.input.style.marginRight="3px";this.input.style.styleFloat=this.input.style.cssFloat="left";C.appendChild(this.input);this.label=document.createElement("label");this.label.htmlFor=this.input.id;core.ui.quirks.TextSelection.preventSelection(this.label);C.appendChild(this.label);return C};this.getType=function(){return"radio"}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"MusicList");with(editor.ui){editor.ui.MusicList.superClass=core.ui.Menu;editor.ui.MusicList.constructor=function(){this.notifyItemSelected=new core.ui.Notification();this.notifyLoaded=new core.ui.Notification();this.MusicList=function(A){this.Menu(A);this.setStyle("overflow","hidden");this.refresh()};this.addItem=override(this.addItem,function(I,E,B,C,G){var H=new core.ui.RadioButton(this);var A=(C&&G)?(C+" - "+G):B;H.path=I;H.duration=E;H.name=A;H.artist=C;H.title=G;var D=common.util.DateUtils.getMinutes(E);var F=common.util.DateUtils.getSeconds(E);var G=A+" ("+D+":"+F+")";H.setText(G);H.setToolTip(G);H.onclick=this.onItemSelected;return arguments.callee.prototype.apply(this,[H])});this.refresh=function(){this.removeItems();LoadingMessage.showIcon(this);core.ajax.sendRequest(theApp.getUserCommand("ajax.EnumerateSounds"),this.onServerResponse)};this.onServerResponse=callback(this,function(B){try{if("OK"==B.status){for(var A=0;A0)};this.setNew=function(B,A){if(A){this.flags[B.getId()]|=Session.FLAG_NEW}else{this.flags[B.getId()]&=~Session.FLAG_NEW}};this.isNew=function(A){return(this.flags[A.getId()]&Session.FLAG_NEW)};this.setDeleted=function(B,A){if(A){this.flags[B.getId()]|=Session.FLAG_DELETED}else{this.flags[B.getId()]&=~Session.FLAG_DELETED}};this.isDeleted=function(A){return(this.flags[A.getId()]&Session.FLAG_DELETED)};this.clear=function(){this.flags={};this.counter=0}};editor.elements.Session.FLAG_NEW=1;editor.elements.Session.FLAG_MODIFIED=2;editor.elements.Session.FLAG_UNMODIFIED=4;editor.elements.Session.FLAG_DELETED=8}ClassFactory.createPackage("editor.elements");ClassFactory.createClass(editor.elements,"Settings");with(editor.elements){editor.elements.Settings.superClass=core.util.HashMap;editor.elements.Settings.constructor=function(){this.toString=function(){var B=[];for(var A=this.getKeys().iterator();A.hasNext();A.next()){B.push(A.current())}return B.join(" ")}}}ClassFactory.createPackage("editor.elements");ClassFactory.createClass(editor.elements,"Collection");with(editor.elements){editor.elements.Collection.constructor=function(){this.elements=[];this.listeners=new core.util.Listeners();this.settings=new Settings();this.session=new Session();this.Collection=function(){editor.Application.getInstance().addAppListener(this)};this.addListener=function(A){this.listeners.add(A)};this.removeListener=function(A){this.listeners.remove(A)};this.getSession=function(){return this.session};this.loadHtml=function(I){this.removeAll();this.settings.clear();this.session.clear();var B=document.createElement("div");B.innerHTML=I;var L=B.getElementsByTagName("div").item(0);var E=editor.Application.getInstance();for(var H=0;H0)){this.moveToBack(B,C)}B.setDeleted(false);return B};this.get=function(A){return this.elements[A]};this.remove=function(A){this.elements.splice(A.getIndex(),1);this.updateIndexes();A.destroy();this.fireElementRemoved(A)};this.removeAll=function(){for(var A=this.iterator();A.hasNext();A.next()){A.current().destroy()}this.elements=[]};this.getElementCount=function(){return this.elements.length};this.iterator=function(){return new core.util.Iterator(this.elements)};this.moveToFront=function(C,E){var D=C.getIndex();if(E==0||D==this.elements.length-1){return false}for(var A=D+1;A0)){C.fireChanged();return true}}}}}C.fireChanged();return false};this.moveToBack=function(B,E){var D=B.getIndex();if(E==0||D==0){return false}for(var A=D-1;A>=0;A--){var C=this.elements[A];if(C.isOverlappable()){this.elements[B.getIndex()]=C;C.setIndex(B.getIndex());this.elements[A]=B;B.setIndex(A);document.body.replaceChild(C.getElement(),B.getElement());document.body.insertBefore(B.getElement(),C.getElement());C.fireChanged();if(this.isOverlap(C,B)){if(defined(E)&&(E!=null)){if(!(--E>0)){B.fireChanged();return true}}}}}B.fireChanged();return false};this.getPosition=function(A){var C=0;for(var B=A.getIndex()+1;B=A.getX())&&(B.getX()<=A.getX()+A.getWidth())&&(B.getY()+B.getHeight()>=A.getY())&&(B.getY()<=A.getY()+A.getHeight()))};this.updateIndexes=function(){for(var A=0;A"+this.content+""):(B+" />")}}}ClassFactory.createPackage("core.html");ClassFactory.createClass(core.html,"Style");with(core.html){core.html.Style.constructor=function(){this.props;this.filters;this.Style=function(A){this.props=defined(A)?A:{};this.filters={}};this.setProperty=function(A,B){this.props[A]=B};this.getProperty=function(A){return this.props[A]};this.hasProperty=function(A){return defined(this.props[A])};this.removeProperty=function(A){delete this.props[A]};this.setFilter=function(A,B){this.filters[A]=defined(B)?B:{}};this.hasFilter=function(A){return defined(this.filters[A])};this.removeFilter=function(A){delete this.filters[A]};this.setOpacity=function(A){if(100==A){this.removeProperty("opacity");this.removeProperty("-moz-opacity");this.removeProperty("-khtml-opacity");this.removeFilter("Alpha")}else{this.setProperty("opacity",A/100);this.setProperty("-moz-opacity",A/100);this.setProperty("-khtml-opacity",A/100);this.setFilter("Alpha",{"opacity":A})}};this.getOpacity=function(){return this.hasProperty("opacity")?this.getProperty("opacity"):100};this.toString=function(){var F=[];for(var B in this.props){if(this.props[B]){F.push(B+": "+this.props[B])}}var E=[];for(var B in this.filters){var C=this.filters[B];var D=[];if("object"==typeof C){for(var A in C){D.push(A+"="+C[A])}}E.push("filter:progid:DXImageTransform.Microsoft."+B+"("+D.join(", ")+")")}if(E.length>0){F.push(E.join(" "))}return F.join("; ")}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Gripper");with(core.ui){core.ui.Gripper.superClass=core.ui.Window;core.ui.Gripper.constructor=function(){this.target;this.resizeinfo={};this.direction=(Gripper.SOUTH|Gripper.EAST);this.notifyBeginResize=new Notification();this.notifyResize=new Notification();this.notifyEndResize=new Notification();this.setResizeWindow=function(E,C,A,D,B){this.target=E;this.resizeinfo.minWidth=C;this.resizeinfo.minHeight=A;this.resizeinfo.maxWidth=D;this.resizeinfo.maxHeight=B};this.getResizeWindow=function(){return this.target};this.setDirection=function(A){this.direction=A;var B="";if(this.direction&Gripper.SOUTH){B+="s"}else{if(this.direction&Gripper.NORTH){B+="n"}}if(this.direction&Gripper.WEST){B+="w"}else{if(this.direction&Gripper.EAST){B+="e"}}this.setStyle("cursor",B+"-resize")};this.beginResize=function(A){this.resizeinfo.resizeState=true;this.resizeinfo.x=A.getScreenX();this.resizeinfo.y=A.getScreenY();this.attachGlobalEvent("mouseup");this.attachGlobalEvent("mousemove")};this.endResize=function(){this.detachGlobalEvent("mouseup");this.detachGlobalEvent("mousemove");this.resizeinfo.resizeState=false};this.isResizing=function(){return this.resizeinfo.resizeState};this.close=override(this.close,function(){if(this.isResizing()){this.endResize()}arguments.callee.prototype.apply(this,[])});this.onmousedown=function(A){this.beginResize(A);this.notifyBeginResize.send(this);A.stop()};this.onmousemove=function(D){if(this.isResizing()){var B=(D.getScreenX()-this.resizeinfo.x);var A=(D.getScreenY()-this.resizeinfo.y);B*=((this.direction&Gripper.EAST)||(this.direction&Gripper.WEST)?1:0);A*=((this.direction&Gripper.NORTH)||(this.direction&Gripper.SOUTH)?1:0);var G=this.target.getX();var F=this.target.getY();var C=this.target.getWidth();var E=this.target.getHeight();if(this.direction&Gripper.WEST){G+=B;C+=-B}else{C+=B}if(this.direction&Gripper.NORTH){F+=A;E+=-A}else{E+=A}if(defined(this.resizeinfo.minWidth)&&(Cthis.resizeinfo.maxWidth)){C=this.resizeinfo.maxWidth;G=this.target.getX()}if(defined(this.resizeinfo.maxHeight)&&(E>this.resizeinfo.maxHeight)){E=this.resizeinfo.maxHeight;F=this.target.getY()}this.target.move(G,F);this.target.resize(C,E);this.resizeinfo.x=D.getScreenX();this.resizeinfo.y=D.getScreenY();D.stop();this.notifyResize.send(this,B,A)}};this.onmouseup=function(A){if(this.isResizing()){this.endResize();this.notifyEndResize.send(this);A.stop()}}};core.ui.Gripper.NORTH=1;core.ui.Gripper.SOUTH=4;core.ui.Gripper.EAST=8;core.ui.Gripper.WEST=16}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"SelectionMenu");with(editor.ui){editor.ui.SelectionMenu.superClass=core.ui.Window;editor.ui.SelectionMenu.constructor=function(){this.SelectionMenu=function(A){arguments.callee.prototype.apply(this,[]);this.builder=A};this.getBuilder=function(){return this.builder};this.updateLayout=function(B){var A=0;var C=0;if((document.body.clientWidth+document.body.scrollLeft)>(B.getAbsX()+B.getWidth())){A=B.getAbsX()+B.getWidth()-this.getWidth()}else{A=B.getAbsX()}if(document.body.scrollTop<(B.getAbsY()-this.getHeight())){C=B.getAbsY()-this.getHeight()}else{C=B.getAbsY()+B.getHeight()}this.move(A,C)}}}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"MoveCommand");with(editor.commands){editor.commands.MoveCommand.superClass=editor.commands.AbstractCommand;editor.commands.MoveCommand.constructor=function(){this.MoveCommand=function(){arguments.callee.prototype.apply(this,[]);this.changed=false;this.saveInitialState()};this.hasChanges=function(){this.saveFinalState();return this.changed};this.execute=function(){this.saveFinalState();for(var B in this.initialState){var A=this.initialState[B].target;A.move(this.finalState[B].x,this.finalState[B].y);A.setModified(true)}editor.ui.SelectionManager.get().updateSelection()};this.unexecute=function(){for(var B in this.initialState){var A=this.initialState[B].target;A.move(this.initialState[B].x,this.initialState[B].y);A.setModified(this.initialState[B].wasModified)}editor.ui.SelectionManager.get().updateSelection()};this.saveInitialState=function(){if(!defined(this.initialState)){this.initialState={};var B=0;var C=null;var A=editor.ui.SelectionManager.get().getSelectedElements();for(var D=A.iterator();D.hasNext();D.next()){C=D.current();this.initialState[C.getId()]={target:C,x:C.getAbsX(),y:C.getAbsY(),wasModified:C.isModified()};B++}if(B>1){this.setName("Move group of objects")}else{if(C!=null){this.setName("Move "+C.getName().toLowerCase())}}}};this.saveFinalState=function(){if(!defined(this.finalState)){this.finalState={};for(var B in this.initialState){var A=this.initialState[B].target;this.finalState[B]={x:A.getAbsX(),y:A.getAbsY()};if((this.initialState[B].x!==this.finalState[B].x)||(this.initialState[B].y!==this.finalState[B].y)){this.changed=true}}}}}}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"ResizeCommand");with(editor.commands){editor.commands.ResizeCommand.superClass=editor.commands.AbstractCommand;editor.commands.ResizeCommand.constructor=function(){this.ResizeCommand=function(B,A){arguments.callee.prototype.apply(this,[B,A]);this.saveInitialState()};this.hasChanges=function(){return((this.initialState.x!==this.target.getAbsX())||(this.initialState.y!==this.target.getAbsY())||(this.initialState.width!==this.target.getWidth())||(this.initialState.height!==this.target.getHeight()))};this.execute=function(){this.saveFinalState();this.target.move(this.finalState.x,this.finalState.y);this.target.resize(this.finalState.width,this.finalState.height);this.target.setModified(true);editor.ui.SelectionManager.get().updateSelection()};this.unexecute=function(){this.target.move(this.initialState.x,this.initialState.y);this.target.resize(this.initialState.width,this.initialState.height);this.target.setModified(this.initialState.wasModified);editor.ui.SelectionManager.get().updateSelection()};this.saveInitialState=function(){if(!defined(this.initialState)){this.initialState={x:this.target.getAbsX(),y:this.target.getAbsY(),width:this.target.getWidth(),height:this.target.getHeight(),wasModified:this.target.isModified()}}};this.saveFinalState=function(){if(!defined(this.finalState)){this.finalState={x:this.target.getAbsX(),y:this.target.getAbsY(),width:this.target.getWidth(),height:this.target.getHeight()}}}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"DefaultSelection");with(editor.ui){editor.ui.DefaultSelection.superClass=editor.ui.AbstractSelection;editor.ui.DefaultSelection.constructor=function(){this.grippers={};this.gripperSize;this.handle;this.menu;this.DefaultSelection=function(target){arguments.callee.prototype.apply(this,[target]);this.setStyle("background-image","url(images/blank.gif)");this.setStyle("z-index",3);with(core.ui.Gripper){var dirs={"nw":NORTH|WEST,"n":NORTH,"ne":NORTH|EAST,"e":EAST,"se":SOUTH|EAST,"s":SOUTH,"sw":SOUTH|WEST,"w":WEST};for(var n in dirs){this.grippers[n]=new core.ui.Gripper(this);this.grippers[n].setDirection(dirs[n]);this.grippers[n].setStyle("position","absolute");this.grippers[n].notifyBeginResize.addListener(this.onBeginResize);this.grippers[n].notifyEndResize.addListener(this.onEndResize);if(!defined(this.gripperSize)){this.gripperSize={width:this.grippers[n].getWidth(),height:this.grippers[n].getHeight()}}this.grippers[n].setResizeWindow(this,this.getMinimumWidth(),this.getMinimumHeight(),this.getMaximumWidth(),this.getMaximumHeight())}}this.handle=new core.ui.Handle(this,this.gripperSize.width,this.gripperSize.height,target.getWidth(),target.getHeight());this.handle.setDragWindow(this);this.handle.setStyle("position","absolute");this.handle.notifyDrag.addListener(this.onDrag);this.handle.notifyBeginDrag.addListener(this.onBeginDrag);this.handle.notifyEndDrag.addListener(this.onEndDrag)};this.setMenu=function(menu){this.menu=menu};this.getMenu=function(){return this.menu};this.move=function(x,y){this.target.move(x+this.gripperSize.width,y+this.gripperSize.height);this.updateLayout()};this.resize=function(width,height){width=Math.max(this.getMinimumWidth(),width);height=Math.max(this.getMinimumHeight(),height);this.target.resize(width-this.gripperSize.width*2,height-this.gripperSize.height*2);this.updateLayout()};this.setVisible=override(this.setVisible,function(visible){if((this.menu&&(this.menu.constructor===SelectionMenu||defined(this.menu.constructor.isSubclassOf)&&this.menu.constructor.isSubclassOf(SelectionMenu)))){this.menu.setVisible(visible)}arguments.callee.prototype.apply(this,[visible])});this.close=override(this.close,function(){if((this.menu&&(this.menu.constructor===SelectionMenu||defined(this.menu.constructor.isSubclassOf)&&this.menu.constructor.isSubclassOf(SelectionMenu)))){this.menu.close()}arguments.callee.prototype.apply(this,[])});this.select=override(this.select,function(){this.updateLayout();arguments.callee.prototype.apply(this,[]);this.setFocus(true)});this.unselect=override(this.unselect,function(){arguments.callee.prototype.apply(this,[]);this.setFocus(false);this.close()});this.updateLayout=function(){var style={};if((this.target.getWidth()>this.gripperSize.width)&&(this.target.getHeight()>this.gripperSize.height)){style.left=this.target.getX()-this.gripperSize.width;style.top=this.target.getY()-this.gripperSize.height;style.width=this.target.getWidth()+this.gripperSize.width*2;style.height=this.target.getHeight()+this.gripperSize.height*2}else{style.width=this.gripperSize.width*3+3;style.height=this.gripperSize.height*3+3;style.left=this.target.getX()+(this.target.getWidth()-style.width)/2;style.top=this.target.getY()+(this.target.getHeight()-style.height)/2}for(var property in style){this.setStyle(property,style[property]+"px")}this.handle.resize(this.target.getWidth(),this.target.getHeight());this.arrangeGrippers();if((this.menu&&(this.menu.constructor===SelectionMenu||defined(this.menu.constructor.isSubclassOf)&&this.menu.constructor.isSubclassOf(SelectionMenu)))){this.menu.updateLayout(this)}};this.getMinimumWidth=function(){var bw=parseInt(this.target.getStyle("border-left-width"));bw=bw?bw:0;return 2*bw+this.gripperSize.width*3+3};this.getMinimumHeight=function(){var bw=parseInt(this.target.getStyle("border-left-width"));bw=bw?bw:0;return 2*bw+this.gripperSize.height*3+3};this.getMaximumWidth=function(){return 100000};this.getMaximumHeight=function(){return 100000};this.arrangeGrippers=function(){var width=this.getWidth();var height=this.getHeight();this.grippers["nw"].move(0,0);this.grippers["n"].move((width-this.gripperSize.width)/2,0);this.grippers["ne"].move(width-this.gripperSize.width,0);this.grippers["e"].move(width-this.gripperSize.width,(height-this.gripperSize.height)/2);this.grippers["se"].move(width-this.gripperSize.width,height-this.gripperSize.height);this.grippers["s"].move((width-this.gripperSize.width)/2,height-this.gripperSize.height);this.grippers["sw"].move(0,height-this.gripperSize.height);this.grippers["w"].move(0,(height-this.gripperSize.height)/2)};this.alignToGrid=function(){var x=Math.floor(this.getX()/Grid.SIZE)*Grid.SIZE;var y=Math.floor(this.getY()/Grid.SIZE)*Grid.SIZE;this.move(x,y)};this.onDrag=callback(this,function(sender,dx,dy){editor.ui.SelectionManager.get().handleMove(dx,dy,this)});this.onBeginDrag=callback(this,function(){this.moveCommand=new editor.commands.MoveCommand()});this.onEndDrag=callback(this,function(){with(editor.commands){if(((this.moveCommand&&(this.moveCommand.constructor===MoveCommand||defined(this.moveCommand.constructor.isSubclassOf)&&this.moveCommand.constructor.isSubclassOf(MoveCommand))))&&this.moveCommand.hasChanges()){CommandHistory.get().execute(this.moveCommand);delete this.moveCommand}}});this.onBeginResize=callback(this,function(){this.resizeCommand=new editor.commands.ResizeCommand(this.target,"Resize "+this.target.getName().toLowerCase())});this.onEndResize=callback(this,function(){with(editor.commands){if(((this.resizeCommand&&(this.resizeCommand.constructor===ResizeCommand||defined(this.resizeCommand.constructor.isSubclassOf)&&this.resizeCommand.constructor.isSubclassOf(ResizeCommand))))&&this.resizeCommand.hasChanges()){CommandHistory.get().execute(this.resizeCommand);delete this.resizeCommand}}});this.onmousedown=function(event,target){event.stop();if(event.ctrlKey){editor.ui.SelectionManager.get().removeSelection(this.target)}else{if((target===this.target)||(target===this.handle)){if(!this.handle.isDragging()){this.handle.beginDrag(event)}}}};this.onmouseup=function(){var app=editor.Application.getInstance();if(app.getWorkspace().isGridVisible()){var x0=this.getX();var y0=this.getY();this.alignToGrid();var dx=this.getX()-x0;var dy=this.getY()-y0;editor.ui.SelectionManager.get().handleMove(dx,dy,this)}};this.ondblclick=function(event){this.target.activate();this.target.edit();event.stop()};this.onkeydown=function(event){var handled=false;var selections=editor.ui.SelectionManager.get();var d=(theApp.getWorkspace().isGridVisible())?Grid.SIZE:3;if(core.ui.Event.KEY_F2==event.keyCode){this.target.edit();handled=true}else{if(core.ui.Event.KEY_LEFT_ARROW==event.keyCode){selections.handleMove(-d,0);handled=true}else{if(core.ui.Event.KEY_RIGHT_ARROW==event.keyCode){selections.handleMove(d,0);handled=true}else{if(core.ui.Event.KEY_UP_ARROW==event.keyCode){selections.handleMove(0,-d);handled=true}else{if(core.ui.Event.KEY_DOWN_ARROW==event.keyCode){selections.handleMove(0,d);handled=true}else{if(event.ctrlKey){if(event.keyCode==core.ui.Event.KEY_F4){return true}}}}}}}if(handled){event.cancel();event.stop()}}}}ClassFactory.createPackage("editor.elements");ClassFactory.createClass(editor.elements,"AbstractElement");with(editor.elements){editor.elements.AbstractElement.superClass=core.ui.Window;editor.elements.AbstractElement.constructor=function(){this.listeners=new core.util.Listeners();this.AbstractElement=function(root,name){arguments.callee.prototype.apply(this,[null,undefined,undefined,undefined,undefined,root]);this.name=name;this.setStyle("position","absolute");this.setStyle("z-index",2);if(defined(window.theApp)){this.setStyle("display","");this.setSession(editor.Application.getInstance().getCollection().getSession())}if(this.isInEditMode()){this.setNew(!defined(root))}if(defined(root)){this.load(root)}else{this.create()}};this.addElementListener=function(listener){this.listeners.add(listener)};this.removeElementListener=function(listener){this.listeners.remove(listener)};this.getName=function(){return this.name};this.setSession=function(session){this.session=session};this.getSession=function(){return this.session};this.setNew=function(isNew){this.session.setNew(this,isNew)};this.isNew=function(){return this.session.isNew(this)};this.setModified=function(modified){this.session.setModified(this,modified)};this.isModified=function(){return this.session.isModified(this)};this.setDeleted=function(deleted){this.session.setDeleted(this,deleted)};this.isDeleted=function(){return this.session.isDeleted(this)};this.getIndex=function(){return this.positionIndex};this.setIndex=function(positionIndex){this.positionIndex=positionIndex};this.getPosition=function(){return editor.Application.getInstance().getCollection().getPosition(this)};this.select=function(){editor.ui.SelectionManager.get().setSelection(this)};this.destroy=function(){this.close()};this.center=function(){this.move(core.ui.Window.getWidth()/2-this.getWidth()/2+document.body.scrollLeft/2,core.ui.Window.getHeight()/2-this.getHeight()/2+document.body.scrollTop/2)};this.isOverlappable=function(){return true};this.isInEditMode=function(){return((this.session&&(this.session.constructor===Session||defined(this.session.constructor.isSubclassOf)&&this.session.constructor.isSubclassOf(Session))))};this.isInPreviewMode=function(){return !this.isInEditMode()};this.getHtmlTag=function(){with(core.html){var tag=new Tag("div",{"class":this.constructor.className,"package":this.constructor.pkg.name});tag.setAttribute("style",new Style({"position":"absolute","overflow":"hidden","left":this.getX()+"px","top":this.getY()+"px","width":this.getWidth()+"px","height":this.getHeight()+"px","z-index":this.getStyle("z-index")}));tag.setContent(this.getText());return tag}};this.move=override(this.move,function(x,y){arguments.callee.prototype.apply(this,[x,y]);this.fireChanged()});this.resize=override(this.resize,function(w,h){arguments.callee.prototype.apply(this,[w,h]);this.fireChanged()});this.setVisible=override(this.setVisible,function(show){arguments.callee.prototype.apply(this,[show]);this.fireChanged()});this.edit=function(){};this.activate=function(){};this.load=function(root){};this.create=function(){};this.createSelection=function(){return new editor.ui.DefaultSelection(this)};this.fireChanged=function(){this.listeners.call("onElementChanged",[this])};this.fireActivated=function(){this.listeners.call("onElementActivated",[this])};this.onmousedown=function(event){if(this.isInEditMode()){var selections=editor.ui.SelectionManager.get();if(event.ctrlKey){selections.addSelection(this).setFocus(true)}else{var selected=selections.isSelected(this);var selection=(selected)?selections.getSelection(this):selections.setSelection(this);selection.setFocus(!selected);if((selection&&(selection.constructor===editor.ui.DefaultSelection||defined(selection.constructor.isSubclassOf)&&selection.constructor.isSubclassOf(editor.ui.DefaultSelection)))){selection.onmousedown(event,this)}}this.activate();this.fireActivated()}event.stop();event.cancel()}}}ClassFactory.createPackage("editor.plugins.comments");ClassFactory.createClass(editor.plugins.comments,"Comment");with(editor.plugins.comments){editor.plugins.comments.Comment.superClass=core.ui.Window;editor.plugins.comments.Comment.constructor=function(){this.notifyDeleted=new core.ui.Notification();this.notifyChanged=new core.ui.Notification();this.Comment=function(parent,x,y,width,height){arguments.callee.prototype.apply(this,[parent,x,y,width,height]);this.initHeader();this.initBody()};this.initHeader=function(){var header=new core.ui.Window(this);header.addStyleName("CommentHeader");var left=new core.ui.Window(header);left.addStyleName("HeaderLeftCorner");var right=new core.ui.Window(header);right.addStyleName("HeaderRightCorner");this.nameStatic=new core.ui.Static(header);this.nameStatic.addStyleName("CommentHeaderNameStatic");this.mailStatic=new core.ui.Static(header);this.mailStatic.addStyleName("CommentHeaderMailStatic");this.timeStatic=new core.ui.Static(header);this.timeStatic.addStyleName("CommentHeaderDateStatic");this.deleteButton=new core.ui.ImageButton(header);this.deleteButton.addStyleName("CommentHeaderDeleteButton");this.deleteButton.setImageList("images/Comments/delete_button.gif");this.deleteButton.setToolTip("Delete this comment");this.deleteButton.oncommand=this.onDeleteClick;this.editButton=new core.ui.ImageButton(header);this.editButton.addStyleName("CommentHeaderEditButton");this.editButton.setImageList("images/Comments/edit_button.gif");this.editButton.setToolTip("Edit this comment");this.editButton.oncommand=this.onEditClick;if(!defined(window.theApp)){this.editButton.hide();this.deleteButton.hide();this.mailStatic.setStyle("display","none")}};this.initBody=function(){var body=new core.ui.Window(this);body.addStyleName("CommentBody");body.setStyle("opacity",70);this.textStatic=new core.ui.Static(body);this.textStatic.addStyleName("CommentText")};this.setEditable=function(editable){if(editable){this.deleteButton.show();this.editButton.show();this.mailStatic.setStyle("display","block")}else{this.deleteButton.hide();this.editButton.hide();this.mailStatic.setStyle("display","none")}};this.setData=function(id,name,text,time,mail,page){this.commentId=id;this.name=name;this.text=text;this.time=time;this.mail=mail;this.page=page;this.updateLayout()};this.setText=function(text){this.text=text;this.updateLayout()};this.setMail=function(mail){this.mail=mail;this.updateLayout()};this.setName=function(name){this.name=name;this.updateLayout()};this.setCommentId=function(id){this.commentId=id;this.updateLayout()};this.setTime=function(time){this.time=time;this.updateLayout()};this.updateLayout=function(){with(common.util){this.nameStatic.setText(MemorialUtils.htmlEncode(this.name));this.mailStatic.setText(MemorialUtils.htmlEncode("<"+this.mail+">"));this.timeStatic.setText(MemorialUtils.htmlEncode(DateUtils.toClientDate(this.time*1000,true)));this.textStatic.setText(this.text?MemorialUtils.htmlEncode(this.text).replace(/\n/g,"
"):"")}};this.onDeleteClick=callback(this,function(){if(confirm("Do you want to delete this comment?")){core.ajax.sendRequest("ajax.DeleteComment",this.onServerResponse,{"pageId":common.util.MemorialUtils.getPageId(),"commentId":this.commentId})}});this.onEditClick=callback(this,function(){var dialog=ObjectComments.getInstance().getEditCommentDialog();dialog.setCommentId(this.commentId);dialog.setData(this.name,this.mail,this.text);dialog.notifyUpdated.addListener(this.onCommentUpdated,true);dialog.center();dialog.doModal()});this.onCommentUpdated=callback(this,function(sender,commentId,name,mail,text){if(this.commentId==commentId){this.setName(name);this.setMail(mail);this.setText(text);this.notifyChanged.send(this)}});this.onServerResponse=callback(this,function(response){if("OK"==response.status){this.notifyDeleted.send(this)}else{}})}}ClassFactory.createPackage("editor.plugins.comments");ClassFactory.createClass(editor.plugins.comments,"ViewCommentsDialog");with(editor.plugins.comments){editor.plugins.comments.ViewCommentsDialog.superClass=core.ui.Dialog;editor.plugins.comments.ViewCommentsDialog.constructor=function(){this.notifyClose=new core.ui.Notification();this.ViewCommentsDialog=function(parent){arguments.callee.prototype.apply(this,[parent,0,0]);this.initContent()};this.setOwner=function(owner){this.owner=owner};this.getElementId=function(){return((this.owner&&(this.owner.constructor===editor.elements.AbstractElement||defined(this.owner.constructor.isSubclassOf)&&this.owner.constructor.isSubclassOf(editor.elements.AbstractElement))))?ObjectComments.getInstance().getElementId(this.owner):this.elementId};this.setCommentId=function(commentId){this.commentId=commentId;this.setOwner(null)};this.initCommentList=function(){this.scrollWindow=new core.ui.ScrollWindow(this.bodyPanel);this.commentList=new core.ui.Window(this.scrollWindow);this.scrollWindow.setContentWindow(this.commentList);this.scrollWindow.addStyleName("CommentsDialogCommentList")};this.onCommentsReceaved=callback(this,function(response){if(response.status=="OK"){this.clearCommentList();for(var v in response.comments){var info=response.comments[v];if(defined(info.text)){var comment=new Comment(this.commentList);comment.setEditable(defined(window.theApp)&&(theApp.getMode()===editor.Application.MODE_EDIT));comment.notifyChanged.addListener(this.onCommentChanged);comment.notifyDeleted.addListener(this.onCommentDeleted);comment.setData(info.id,info.name,info.text,info.time,info.email,"")}}if(!(this.owner&&(this.owner.constructor===editor.elements.AbstractElement||defined(this.owner.constructor.isSubclassOf)&&this.owner.constructor.isSubclassOf(editor.elements.AbstractElement)))){this.elementId=response.elementId}}this.scrollWindow.reset()});this.initContent=function(){with(core.ui){var header=new Handle(this);header.addStyleName("CommentsDialogHeader");header.setDragWindow(this);var left=new Window(header);left.addStyleName("HeaderLeftCorner");var right=new Window(header);right.addStyleName("HeaderRightCorner");var rssButton=new ImageButton(header);rssButton.addStyleName("RssButton");rssButton.setImageList("images/Comments/rss.gif");rssButton.setToolTip("Subscribe to RSS");rssButton.oncommand=this.onRssClick;var refreshButton=new ImageButton(header);refreshButton.addStyleName("RefreshButton");refreshButton.setImageList("images/Comments/refresh.gif");refreshButton.setToolTip("Refresh list");refreshButton.oncommand=this.onRefreshClick;this.bodyPanel=new Window(this);this.bodyPanel.addStyleName("CommentsDialogBodyPanel");this.initSortCombo(this.bodyPanel);this.initCommentList(this.bodyPanel);this.closeButton=new ImageButton(this.bodyPanel);this.closeButton.addStyleName("CommentsDialogButtonClose");this.closeButton.setImageList("images/Comments/close_button.gif");this.closeButton.setToolTip("Close window");this.closeButton.oncommand=this.onCloseClick}};this.initSortCombo=function(parent){this.sortCombo=new core.ui.ComboBox(parent);this.sortCombo.addStyleName("SortCombo");this.sortCombo.getMenu().setStyleName("SortComboMenu");this.sortCombo.addItem("Sort by ASC","asc",true);this.sortCombo.addItem("Sort by DESC","desc",false);this.sortCombo.notifyValueChanged.addListener(this.onSortTypeChanged);this.order="asc"};this.onCloseClick=callback(this,function(){this.endModal()});this.onRefreshClick=callback(this,function(){this.updateCommentList()});this.onRssClick=callback(this,function(){with(common.util){window.open(MemorialUtils.getBaseUri()+"/rss.Comments?pageId="+MemorialUtils.getPageId()+"&elementId="+this.getElementId())}});this.clearCommentList=function(){for(var id in this.commentList.children){this.commentList.children[id].close();delete this.commentList.children[id]}};this.updateCommentList=function(){core.ajax.sendRequest("ajax.ShowComments",this.onCommentsReceaved,{"pageId":common.util.MemorialUtils.getPageId(),"elementId":this.getElementId(),"commentId":this.commentId||"","order":this.order})};this.doModal=override(this.doModal,function(){this.clearCommentList();this.updateCommentList();arguments.callee.prototype.apply(this,[])});this.endModal=override(this.endModal,function(){ObjectComments.getInstance().update(this.owner);arguments.callee.prototype.apply(this,[])});this.onCommentChanged=callback(this,function(){this.scrollWindow.reset()});this.onCommentDeleted=callback(this,function(){this.updateCommentList()});this.onSortTypeChanged=callback(this,function(sender,order){this.order=order;this.updateCommentList()})}}ClassFactory.createPackage("editor.plugins.comments");ClassFactory.createClass(editor.plugins.comments,"ObjectComments");with(editor.plugins.comments){editor.plugins.comments.ObjectComments.constructor=function(){this.data={};this.addCommentDialog=null;this.editCommentDialog=null;this.viewCommentsDialog=null;this.ObjectComments=function(){this.addCommentDialog=new AddCommentDialog();this.editCommentDialog=new EditCommentDialog();this.viewCommentsDialog=new ViewCommentsDialog();editor.Application.getInstance().addAppListener(this)};this.attach=function(A){if(!this.isAttached(A)){this.data[this.getElementId(A)]={"element":A,"controls":this.createControls(A)}}};this.detach=function(A){if(this.isAttached(A)){var B=this.getElementId(A);this.data[B].controls.close();delete this.data[B]}};this.update=function(A){if(A&&this.isAttached(A)){this.data[this.getElementId(A)].controls.updateInfo()}};this.reset=function(){for(var A in this.data){this.detach(this.data[A].element)}this.data={}};this.getElementId=function(B){var A=B.getElement();if(A.getAttribute("objId")){return A.getAttribute("objId")}else{if(A.getAttribute("comments")&&(A.getAttribute("comments")!=="true")){return A.getAttribute("comments")}else{return B.getId()}}};this.isAttached=function(A){return defined(this.data[this.getElementId(A)])};this.createControls=function(A){return new CommentsControls(A)};this.getAddCommentDialog=function(){return this.addCommentDialog};this.getEditCommentDialog=function(){return this.editCommentDialog};this.getViewCommentsDialog=function(){return this.viewCommentsDialog};this.onAppClear=function(){this.reset()}};editor.plugins.comments.ObjectComments.getInstance=function(){if(!defined(this.instance)){this.instance=new ObjectComments()}return this.instance}}ClassFactory.createPackage("common");ClassFactory.createClass(common,"Page");with(common){common.Page.constructor=function(){this.config=new core.app.Config();this.commentId=null;this.elements=[];this.name="";this.mail="";this.init=function(B,A){this.config.set("page.id",B);this.config.set("page.baseUri",A);this.initContent(document.getElementById("content"));core.ui.Window.notifyResize.addListener(this.onUpdateLayout);this.updatePageLayout()};this.showReportDialog=function(){var A=new ReportAbuseDialog();A.notifyAbuseSent.addListener(this.onAbuseSent);A.setData(this.name,this.mail,"");A.center();A.mail.setText(this.mail);A.doModal()};this.getReportDialog=function(){if(!defined(this.reportDialog)){this.reportDialog=new ReportAbuseDialog()}return this.reportDialog};this.initContent=function(H){core.ui.Event.addListener(H,"mousedown",this.onClicked);var B=editor.plugins.comments.ObjectComments.getInstance();for(var E=0;Edocument.body.offsetWidth){E.style.width=C+20+"px"}else{E.style.width="100%"}var D=document.getElementById("content");if(F+G.offsetHeight>document.body.offsetHeight){D.style.height=F+20+"px"}else{D.style.height="100%"}G.style.visibility="visible"};this.onElementChanged=function(){this.updatePageLayout()};this.onUpdateLayout=callback(this,function(){this.updatePageLayout()});this.onAbuseSent=callback(this,function(C,B,A){this.name=B;this.mail=A})};common.Page.getInstance=function(){if(!defined(this.instance)){this.instance=new Page()}return this.instance}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ToolButton");with(editor.ui){editor.ui.ToolButton.superClass=editor.ui.MenuButton;editor.ui.ToolButton.constructor=function(){this.dragSource;this.listener=null;this.ToolButton=function(A){arguments.callee.prototype.apply(this,[theApp.factory.getToolboxPanel().getContentWindow()]);this.setImageList("images/Toolbox/item.gif");this.icon.onload=this.onIconLoaded;this.dragSource=new core.ui.DragWindow();this.dragSource.notifyDrag.addListener(this.onDrag);this.dragSource.notifyEndDrag.addListener(this.onEndDrag);this.listener=A};this.onIconLoaded=callback(this,function(){this.dragSource.resize(this.icon.getWidth(),this.icon.getHeight());this.dragSource.setStyle("background",'url("'+this.icon.getSource()+'") no-repeat center center')});this.onDrag=callback(this,function(A){if(A.isDragging()){if(!A.isVisible()){A.move(this.getAbsX()+this.getWidth()/2-this.dragSource.getWidth()/2,this.getAbsY()+this.getHeight()/2-this.dragSource.getHeight()/2);A.activate();A.show()}}});this.onEndDrag=callback(this,function(B){var A=B.getX();var D=B.getY();var C=theApp.factory.getToolboxPanel();if((A>C.getX())&&(AC.getY())&&(D"):""));this.timeStatic.setText(MemorialUtils.htmlEncode(DateUtils.toClientDate(this.time*1000,true)));this.textStatic.setText(this.text?MemorialUtils.htmlEncode(this.text).replace(/\n/g,"
"):"")}};this.onDeleteClick=callback(this,function(){if(confirm("Do you want to delete this message?")){core.ajax.sendRequest("ajax.DeleteMessage",this.onServerResponse,{"id":this.id})}});this.onServerResponse=callback(this,function(response){if("OK"==response.status){this.notifyDeleted.send(this)}})}}ClassFactory.createPackage("editor.plugins.condolence");ClassFactory.createClass(editor.plugins.condolence,"MessageList");with(editor.plugins.condolence){editor.plugins.condolence.MessageList.superClass=core.ui.Window;editor.plugins.condolence.MessageList.constructor=function(){this.messagesPerPage=10;this.count=0;this.editable=true;this.notifyMessageAdded=new core.ui.Notification();this.notifyMessageDeleted=new core.ui.Notification();this.messages=[];this.queryMessages=function(A){core.ajax.sendRequest("ajax.ListMessages",this.onServerResponse,{"pageId":common.util.MemorialUtils.getPageId(),"number":A,"count":this.messagesPerPage})};this.setMessagesPerPage=function(A){this.messagesPerPage=A};this.getMinPage=function(){return 1};this.getMaxPage=function(){return Math.ceil(this.count/this.messagesPerPage)};this.addMessage=function(H,D,C,G,F,E,B){var A=new Message(this);A.setEditable(this.editable);A.setData(H,D,C,G,F,E,B);A.setIndex(this.messages.length);A.notifyDeleted.addListener(this.onMessageDeleted);this.messages.push(A);this.notifyMessageAdded.send(this)};this.getMessage=function(A){return this.messages[A]};this.getMessageCount=function(){return this.messages.length};this.hasMessages=function(){return(this.messages.length>0)};this.setEditable=function(A){if(this.editable==A){return }this.editable=A;for(var B in this.children){if(this.children[B].getElement()){this.children[B].setEditable(A)}}};this.onServerResponse=callback(this,function(C){if(C.status=="OK"){this.count=C.count;for(var D in this.children){this.children[D].close();delete this.children[D]}for(var B=0;Bthis.page){this.nextButton.enable()}else{this.nextButton.disable()}if(this.page>1){this.prevButton.enable()}else{this.prevButton.disable()}if(this.isInEditMode()){var selections=editor.ui.SelectionManager.get();if(selections.isSelected(this)){selections.getSelection(this).updateLayout()}}};this.updateControls=function(){this.messageList.queryMessages(this.page)};this.isOverlappable=function(){return false};this.createSelection=function(){return new CondolenceBookSelection(this)};this.onMessageListFilled=callback(this,function(sender){this.setStyle("height","");this.updateLayout();this.fireChanged()});this.onMessageListCroped=callback(this,function(sender){if(this.page>1&&this.page>this.messageList.getMaxPage()){--this.page}this.updateControls();this.fireChanged()});this.onAddMessageClick=callback(this,function(){this.addDialog.reset();var selections=editor.ui.SelectionManager.get();this.hasSelected=selections.isSelected(this);selections.removeSelection(this);this.addDialog.center();this.addDialog.doModal()});this.onMessageAdded=callback(this,function(){this.updateControls()});this.onPreviousPageClick=callback(this,function(){if(this.page<=this.messageList.getMinPage()){return }this.page--;this.updateControls()});this.onNextPageClick=callback(this,function(){if(this.page>=this.messageList.getMaxPage()){return }this.page++;this.updateControls()});this.onRssClick=callback(this,function(){with(common.util){window.open(MemorialUtils.getBaseUri()+"/rss.Condolences?id="+MemorialUtils.getPageId())}});this.onRefreshClick=callback(this,function(){this.updateControls()});this.onmousedown=callback(this,override(this.onmousedown,function(e){if(this.enabled){return arguments.callee.prototype.apply(this,[e])}}))}}ClassFactory.createPackage("editor.plugins.condolence");ClassFactory.createClass(editor.plugins.condolence,"CondolencePlugin");with(editor.plugins.condolence){editor.plugins.condolence.CondolencePlugin.constructor=function(){this.CondolencePlugin=function(){editor.Application.getInstance().addAppListener(this)};this.onAppInitComplete=function(){var button=new editor.ui.ToolButton(this);button.addStyleName("CondolenceBookIcon");button.setText("Condolences");button.setIcon("images/CondolenceBook/icon.png");button.setToolTip("Create new condolence book")};this.onToolButtonPressed=this.onToolButtonDropped=function(button,x,y){var cb=new CondolenceBook();with(editor.commands){CommandHistory.get().execute(new AddCommand(cb,x,y,"Add condolence book"))}cb.select();cb.activate();cb.edit()}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ProportionalSelection");with(editor.ui){editor.ui.ProportionalSelection.superClass=editor.ui.DefaultSelection;editor.ui.ProportionalSelection.constructor=function(){this.ProportionalSelection=function(B){arguments.callee.prototype.apply(this,[B]);for(var A=new core.util.Iterator(["e","n","s","w"]);A.hasNext();A.next()){this.grippers[A.current()].hide()}};this.move=override(this.move,function(A,D){if(!defined(this.ratio)){this.ratio=this.getWidth()/this.getHeight()}var B=this.getY()-D;var C=Math.round(B*this.ratio);if(this.grippers["nw"].isResizing()){this.newWidth=this.getWidth()+C;this.newHeight=this.getHeight()+B;arguments.callee.prototype.apply(this,[this.getX()-C,this.getY()-B])}else{if(this.grippers["sw"].isResizing()){C=this.getX()-A;this.newWidth=this.getWidth()+C;arguments.callee.prototype.apply(this,[this.getX()-C,this.getY()])}else{if(this.grippers["ne"].isResizing()){B=this.getY()-D;this.newHeight=this.getHeight()+B;arguments.callee.prototype.apply(this,[this.getX(),this.getY()-B])}else{arguments.callee.prototype.apply(this,[A,D])}}}});this.resize=function(A,B){if(!defined(this.ratio)){this.ratio=this.width/this.height}if(this.grippers["nw"].isResizing()){if(defined(this.newWidth)){A=this.newWidth}if(defined(this.newHeight)){B=this.newHeight}}else{if(this.grippers["sw"].isResizing()){if(defined(this.newWidth)){A=this.newWidth}B=A/this.ratio}else{if(this.grippers["ne"].isResizing()){if(defined(this.newHeight)){B=this.newHeight}A=B*this.ratio}else{if(this.grippers["se"].isResizing()){A=B*this.ratio}else{this.ratio=A/B}}}}this.newWidth=undefined;this.newHeight=undefined;A=Math.max(this.getMinimumWidth(),A);B=Math.max(this.getMinimumHeight(),B);this.setStyle("width",A+"px");this.setStyle("height",B+"px");this.getTarget().resize(A-this.gripperSize.width*2,B-this.gripperSize.height*2);this.updateLayout()};this.updateLayout=override(this.updateLayout,function(){arguments.callee.prototype.apply(this,[]);this.ratio=this.getWidth()/this.getHeight()})}}ClassFactory.createPackage("editor.plugins.images");ClassFactory.createClass(editor.plugins.images,"ResizeImageBoxCommand");with(editor.plugins.images){editor.plugins.images.ResizeImageBoxCommand.superClass=editor.commands.ResizeCommand;editor.plugins.images.ResizeImageBoxCommand.constructor=function(){this.ResizeImageBoxCommand=function(A){arguments.callee.prototype.apply(this,[A,"Resize picture"])};this.execute=override(this.execute,function(){arguments.callee.prototype.apply(this,[]);this.target.updateImage()});this.unexecute=override(this.unexecute,function(){arguments.callee.prototype.apply(this,[]);this.target.updateImage()})}}ClassFactory.createPackage("editor.plugins.images");ClassFactory.createClass(editor.plugins.images,"ImageBoxSelection");with(editor.plugins.images){editor.plugins.images.ImageBoxSelection.superClass=editor.ui.ProportionalSelection;editor.plugins.images.ImageBoxSelection.constructor=function(){this.ImageBoxSelection=function(B){arguments.callee.prototype.apply(this,[B]);var A=new editor.ui.SelectionMenuBuilder(B);A.buildDeleteIcon();A.buildEditIcon();this.setMenu(A.getMenu())};this.onBeginResize=callback(this,override(this.onBeginResize,function(A){this.resizeCommand=new ResizeImageBoxCommand(this.target)}));this.onEndResize=callback(this,override(this.onEndResize,function(A){arguments.callee.prototype.apply(this,[]);this.target.updateImage()}))}}ClassFactory.createPackage("editor.plugins.images");ClassFactory.createClass(editor.plugins.images,"ImageBox");with(editor.plugins.images){editor.plugins.images.ImageBox.superClass=editor.elements.PageElement;editor.plugins.images.ImageBox.constructor=function(){this.source;this.origin="";this.zoom=100;this.rotation=0;this.url="";this.anchor;this.image;this.ImageBox=function(A){this.preloader=new core.util.ImagePreloader();this.preloader.addListener(this);this.rotator=new core.util.ImagePreloader();this.rotator.addListener(this);this.updater=new core.util.ImagePreloader();this.updater.addListener(this);arguments.callee.prototype.apply(this,[A,"Picture"])};this.setImage=function(A){this.origin=A;this.reset();this.updateControls()};this.getImage=function(){return this.origin};this.isPhoto=function(){var A=this.getElement().getAttribute("id");return(A&&A.match("person.photo"))};this.setZoom=function(B){var A=B/this.zoom;this.resize(this.getWidth()*A,this.getHeight()*A);this.zoom=B};this.getZoom=function(){return this.zoom};this.setTransparency=function(A){this.setStyle("opacity",100-A)};this.getTransparency=function(){return 100-this.getStyle("opacity")};this.setLink=function(A){this.url=A;this.updateControls()};this.getLink=function(){return this.url};this.reset=function(){this.setTransparency(0);this.setZoom(100);this.rotate(0)};this.rotate=function(C){if(C==this.rotation){return }var A=(this.rotation==0||this.rotation==180)?this.getWidth():this.getHeight();var B=(this.rotation==0||this.rotation==180)?this.getHeight():this.getWidth();this.rotation=C;this.rotateImage(this.origin,this.rotation);if(this.rotation==0||this.rotation==180){this.resize(A,B)}else{if(this.rotation==90||this.rotation==270){this.resize(B,A)}}};this.getRotationDegree=function(){return this.rotation};this.setText=function(A){this.image.alt=A};this.getText=function(){return this.image.alt};this.createSelection=function(){return new ImageBoxSelection(this)};this.edit=function(){theApp.plugins.images.getPanel().getContentWindow().loadImage()};this.updateControls=function(){if(0==this.rotation){this.preloadImage(this.origin)}else{this.rotateImage(this.origin,this.rotation)}if(this.url){this.anchor.setAttribute("href",this.url);this.anchor.style.cursor=""}else{this.anchor.removeAttribute("href");this.anchor.style.cursor="default"}};this.createAnchor=function(){var A=document.createElement("a");A.target="_blank";A.style.cursor="default";return A};this.createImage=function(){var A=document.createElement("img");A.style.borderWidth="0px";A.style.display="block";A.style.width="100%";A.style.height="100%";A.ondragstart=new Function("return false");return A};this.activate=override(this.activate,function(){arguments.callee.prototype.apply(this,[]);theApp.plugins.images.getPanel().getContentWindow().setImageBox(this);theApp.switchPanel(theApp.plugins.images.getPanel())});this.createElement=override(this.createElement,function(){var A=arguments.callee.prototype.apply(this,[]);this.anchor=this.createAnchor();A.appendChild(this.anchor);this.image=this.createImage();this.anchor.appendChild(this.image);return A});this.create=override(this.create,function(){arguments.callee.prototype.apply(this,[]);this.origin="images/ImageBox/placeholder.png";this.reset();this.updateControls()});this.load=function(A){if(this.isInEditMode()){var B=A.nodeName.toLowerCase();if("img"==B){this.loadFromImg(A)}else{if("a"==B){this.loadFromAnchor(A)}else{if("div"==B){this.loadFromDiv(A)}}}}};this.loadFromImg=function(A){var C=core.url.parse(A.src);this.origin=C.path.substr(1);this.rotation=0;A.style.boxSizing=A.style.MozBoxSizing="content-box";this.element=this.createElement();this.element.style.overflow="hidden";this.element.style.position="absolute";this.element.style.left=A.offsetLeft+"px";this.element.style.top=A.offsetTop+"px";this.element.style.width=A.offsetWidth+"px";this.element.style.height=A.offsetHeight+"px";this.element.style.borderWidth=A.style.borderWidth;this.element.style.borderStyle=A.style.borderStyle;this.element.style.borderColor=A.style.borderColor;this.element.style.zIndex=2;this.element.className="ImageBox";this.element.id=A.id;this.detach(A);this.attach(this.element);var B=A.parentNode;B.insertBefore(this.element,A);B.removeChild(A);this.updateControls()};this.loadFromAnchor=function(A){this.url=A.href;var D=A.getElementsByTagName("img");if(D.length>0){var C=D.item(0);A.removeChild(C);var B=A.parentNode;B.insertBefore(C,A);B.removeChild(A);this.loadFromImg(C)}};this.loadFromDiv=function(C){this.origin=C.getAttribute("origin")||"";this.rotation=C.getAttribute("rotation")||0;var A=C.getElementsByTagName("a");if(A.length>0){this.url=A.item(0).href;this.anchor=A.item(0)}else{this.anchor=this.createAnchor();C.appendChild(this.anchor)}var B=C.getElementsByTagName("img");if(B.length>0){this.image=B.item(0);this.image.ondragstart=new Function("return false")}else{this.image=this.createImage();this.anchor.appendChild(this.image)}this.updateControls()};this.getHtmlTag=override(this.getHtmlTag,function(){var A=arguments.callee.prototype.apply(this,[]);A.setAttribute("origin",this.origin);A.getAttribute("style").setOpacity(this.getStyle("opacity"));var C=this.getElement().getAttribute("id");if(C){A.setAttribute("id",C)}if(100!==this.zoom){A.setAttribute("zoom",this.zoom)}if(0!==this.rotation){A.setAttribute("rotation",this.rotation)}var B=new core.html.Tag("a",{"target":"_blank"});if(this.url){B.setAttribute("href",this.url)}else{B.setAttribute("style",new core.html.Style({"cursor":"default"}))}B.setContent(new core.html.Tag("img",{"src":this.source,"style":"display: block; width: 100%; height: 100%; border: 0px;","alt":this.image.alt}));A.setContent(B);return A});this.adjustBounds=function(A,C,B,D){var E=A/C;var F=(0!=this.rotation)||(100!=this.zoom);if(E>1){if((B=14)};this.setImageBox=function(imagebox){this.imagebox=imagebox;this.updateControls()};this.loadImage=function(){editor.ui.SelectionManager.get().getSelection(this.imagebox).setFocus(false);var frame=theApp.factory.getImageDialog();var dialog=frame.getContentWindow();dialog.notifyImageApplied.addListener(this.onImageChange);dialog.notifyCancelled.addListener(this.onImageCancelled);dialog.reset();if(!this.imagebox.isNew()||this.imagebox.isModified()){dialog.setImage(this.imagebox.getImage())}frame.move(core.ui.Window.getWidth()-(document.body.clientWidth+frame.getWidth())/2,core.ui.Window.getHeight()-(document.body.clientHeight+frame.getHeight())/2);frame.doModal()};this.updateControls=function(){if(!this.isLoaded()){return }var t=this.imagebox.getTransparency();this.transpSlider.setPos(t);this.transpValue.setText(t.toFixed(0)+"%");var z=this.imagebox.getZoom();this.zoomSlider.setPos(z);this.zoomValue.setText(z.toFixed(0)+"%");var d=this.imagebox.getRotationDegree();this.rotationList.setValue(d)};this.initBorderMenu=function(){this.borderMenu=new PopupMenuFrame();var menu=new BorderMenu(this.borderMenu);menu.notifyColorSelected.addListener(this.onBorderColorChange);menu.notifyWidthSelected.addListener(this.onBorderWidthChange);menu.notifyStyleSelected.addListener(this.onBorderStyleChange);this.borderMenu.setContentWindow(menu);this.borderButton.setPopupMenu(this.borderMenu)};this.onBorderButtonClick=callback(this,function(){var borderDialog=theApp.factory.getBorderDialog();borderDialog.getContentWindow().notifyApplied.addListener(this.onBorderChanged,true);borderDialog.getContentWindow().notifyCancelled.addListener(this.onBorderCancelled,true);borderDialog.getContentWindow().setBorderParameters(this.imagebox.getBorderWidth(),this.imagebox.getBorderStyle(),this.imagebox.getBorderColor());borderDialog.center();borderDialog.doModal()});this.onImageButtonClick=callback(this,function(){this.loadImage()});this.onAboveButtonClick=callback(this,function(){theApp.collection.moveToFront(this.imagebox,1)});this.onUnderButtonClick=callback(this,function(){theApp.collection.moveToBack(this.imagebox,1)});this.onFrontButtonClick=callback(this,function(){theApp.collection.moveToFront(this.imagebox)});this.onBackButtonClick=callback(this,function(){theApp.collection.moveToBack(this.imagebox)});this.onLinkButtonClick=callback(this,function(){editor.ui.SelectionManager.get().removeSelection(this.imagebox);var frame=theApp.factory.getUrlDialog();frame.setTitle("Hyperlink information");frame.getContentWindow().notifySetUrl.addListener(this.onCreateLink,true);frame.getContentWindow().notifyCancel.addListener(this.onCancelLinkDialog,true);frame.getContentWindow().setUrl(this.imagebox.getLink()?this.imagebox.getLink():"");frame.center();frame.doModal()});this.onResetButtonClick=callback(this,function(){var command=new EditImageBoxCommand(this.imagebox,"Reset picture");command.reset();editor.commands.CommandHistory.get().execute(command);editor.ui.SelectionManager.get().getSelection(this.imagebox).updateLayout();this.updateControls()});this.onBorderCancelled=callback(this,function(){theApp.factory.getBorderDialog().endModal()});this.onBorderChanged=callback(this,function(sender,width,style,color){var command=new editor.commands.EditBorderCommand(this.imagebox,"Change border of picture");command.setBorder(width,style,color);editor.commands.CommandHistory.get().execute(command);theApp.factory.getBorderDialog().endModal();editor.ui.SelectionManager.get().getSelection(this.imagebox).updateLayout()});this.onImageChange=callback(this,function(sender,source){source=source.replace(/\?\S*/,"");var command=new EditImageBoxCommand(this.imagebox,"Change picture");command.setImage(source);editor.commands.CommandHistory.get().execute(command);this.updateControls();var selection=editor.ui.SelectionManager.get().getSelection(this.imagebox);selection.updateLayout();selection.setFocus(true);theApp.factory.getImageDialog().endModal()});this.onImageCancelled=callback(this,function(sender){theApp.factory.getImageDialog().endModal();if(!this.imagebox.isModified()&&this.imagebox.isNew()){editor.ui.SelectionManager.get().removeSelection(this.imagebox);this.imagebox.hide();theApp.collection.excludeElement(this.imagebox)}else{editor.ui.SelectionManager.get().getSelection(this.imagebox).setFocus(true)}});this.onZoomBeginDrag=callback(this,function(){this.zoomCommand=new EditImageBoxCommand(this.imagebox,"Zoom picture")});this.onZoomEndDrag=callback(this,function(){if((this.zoomCommand&&(this.zoomCommand.constructor===EditImageBoxCommand||defined(this.zoomCommand.constructor.isSubclassOf)&&this.zoomCommand.constructor.isSubclassOf(EditImageBoxCommand)))){this.zoomCommand.setZoom(this.zoomSlider.getPos());editor.commands.CommandHistory.get().execute(this.zoomCommand);delete this.zoomCommand}});this.onZoomChange=callback(this,function(sender,zoom){if(this.zoomSlider.indicator.isDragging()){this.imagebox.setZoom(zoom)}else{var command=new EditImageBoxCommand(this.imagebox,"Zoom picture");command.setZoom(zoom);editor.commands.CommandHistory.get().execute(command)}editor.ui.SelectionManager.get().getSelection(this.imagebox).updateLayout();this.zoomValue.setText(zoom.toFixed(0)+"%")});this.onTransparencyBeginDrag=callback(this,function(){this.transparencyCommand=new EditImageBoxCommand(this.imagebox,"Change transparency")});this.onTransparencyEndDrag=callback(this,function(){if((this.transparencyCommand&&(this.transparencyCommand.constructor===EditImageBoxCommand||defined(this.transparencyCommand.constructor.isSubclassOf)&&this.transparencyCommand.constructor.isSubclassOf(EditImageBoxCommand)))){this.transparencyCommand.setTransparency(this.transpSlider.getPos());editor.commands.CommandHistory.get().execute(this.transparencyCommand);delete this.transparencyCommand}});this.onTransparencyChange=callback(this,function(sender,t){if(this.transpSlider.indicator.isDragging()){this.imagebox.setTransparency(t)}else{var command=new EditImageBoxCommand(this.imagebox,"Change transparency");command.setTransparency(t);editor.commands.CommandHistory.get().execute(command)}this.transpValue.setText(t.toFixed(0)+"%")});this.onRotationChange=callback(this,function(sender,rotation){var command=new EditImageBoxCommand(this.imagebox,"Rotate picture");command.rotate(rotation);editor.commands.CommandHistory.get().execute(command);editor.ui.SelectionManager.get().getSelection(this.imagebox).updateLayout()});this.onColorChange=callback(this,function(sender,color){this.imagebox.setBackgroundColor(color)});this.onBorderColorChange=callback(this,function(sender,c){var command=new editor.commands.EditBorderCommand(this.imagebox,"Change border color");command.setBorderColor(c);editor.commands.CommandHistory.get().execute(command)});this.onBorderWidthChange=callback(this,function(sender,w){var command=new editor.commands.EditBorderCommand(this.imagebox,"Change border width");command.setBorderWidth(w);editor.commands.CommandHistory.get().execute(command)});this.onBorderStyleChange=callback(this,function(sender,s){var command=new editor.commands.EditBorderCommand(this.imagebox,"Change border style");command.setBorderStyle(s);editor.commands.CommandHistory.get().execute(command)});this.onCancelLinkDialog=callback(this,function(sender){editor.ui.SelectionManager.get().addSelection(this.imagebox);theApp.factory.getUrlDialog().endModal()});this.onCreateLink=callback(this,function(sender,url){this.imagebox.setLink(url);editor.ui.SelectionManager.get().addSelection(this.imagebox);theApp.factory.getUrlDialog().endModal()})}}}ClassFactory.createPackage("editor.plugins.images");ClassFactory.createClass(editor.plugins.images,"ImagesPlugin");with(editor.plugins.images){editor.plugins.images.ImagesPlugin.constructor=function(){this.ImagesPlugin=function(){editor.Application.getInstance().addAppListener(this)};this.onAppInitComplete=function(app){var button=new editor.ui.ToolButton(this);button.addStyleName("ImageBoxIcon");button.setText("Add picture");button.setIcon("images/ImageBox/icon.png");button.setToolTip("Add new picture");var images=app.config.get("page.photos");if(images){for(var i=0;i0){this.defaultItem=this.items.get(0).clone();this.defaultItem.setPageName("(create new page...)");this.defaultItem.setPageUrl("");this.defaultItem.addItemListener(this);this.defaultItem.setToolTip("Create new page");this.getElement().appendChild(this.defaultItem.getElement());this.setCurrentItem(this.items.get(0))}var F=SiteMenu.get();if((F&&(F.constructor===SiteMenu||defined(F.constructor.isSubclassOf)&&F.constructor.isSubclassOf(SiteMenu)))){this.clear();for(var B=F.items.iterator();B.hasNext();B.next()){var G=B.current();var D=this.defaultItem.clone();D.setPageId(G.getPageId());D.setPageName(G.getPageName());D.setPageUrl(G.getPageUrl());this.getElement().insertBefore(D.getElement(),this.defaultItem.getElement());this.addItem(D);if(G===F.getCurrentItem()){this.setCurrentItem(D)}}}SiteMenu.set(this)}});this.getHtmlTag=override(this.getHtmlTag,function(){var A=arguments.callee.prototype.apply(this,[]);var C=A.getAttribute("style");C.setProperty("margin",this.getStyle("margin"));C.setProperty("margin-left",this.getStyle("margin-left"));C.setProperty("margin-top",this.getStyle("margin-top"));C.setProperty("margin-right",this.getStyle("margin-right"));C.setProperty("margin-bottom",this.getStyle("margin-bottom"));C.setProperty("padding",this.getStyle("padding"));C.setProperty("padding-left",this.getStyle("padding-left"));C.setProperty("padding-top",this.getStyle("padding-top"));C.setProperty("padding-right",this.getStyle("padding-right"));C.setProperty("padding-bottom",this.getStyle("padding-bottom"));A.setContent("");for(var B=this.items.iterator();B.hasNext();B.next()){A.addContent(B.current().getHtmlTag())}return A});this.setEnabled=override(this.setEnabled,function(A){});this.onItemClick=function(A){if(this.defaultItem===A){SiteMenuSelection.getInstance(this).getEditor().edit(A)}else{if(this.currentItem!==A){var B=editor.Application.getInstance();B.save();if(A.getPageId()){this.setCurrentItem(A);B.loadPage(A.getPageId())}else{core.ajax.sendRequest(B.getUserCommand("ajax.CreatePage"),this.onPageCreated,{"url":A.getPageUrl(),"name":A.getPageName()})}}}};this.onPageCreated=callback(this,function(A){if("OK"===A.status){var B=this.getItem(A.pageName);B.setPageId(A.pageId);this.setCurrentItem(B);var C=editor.Application.getInstance();C.loadTemplate(C.config.get("page.template"))}});this.onmousedown=function(){editor.ui.SelectionManager.get().clearSelection();editor.Application.getInstance().switchPanel(null)};this.onmouseover=function(A,B){while(((B&&(B.constructor===core.ui.Window||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(core.ui.Window))))&&!((B&&(B.constructor===SiteMenuItem||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(SiteMenuItem))))){B=B.getParent()}if((B&&(B.constructor===core.ui.Window||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(core.ui.Window)))){if(B===this.defaultItem){SiteMenuSelection.getInstance(this).unselect()}else{this.activeItem=B;SiteMenuSelection.getInstance(this).select()}A.stop();A.cancel()}};this.onDocumentMouseOver=callback(this,function(A){A=core.ui.Event.improve(A);if(A.target===document.body){SiteMenuSelection.getInstance(this).unselect()}})};editor.plugins.pages.SiteMenu.set=function(A){this.instance=A};editor.plugins.pages.SiteMenu.get=function(){return this.instance}}ClassFactory.createPackage("editor.plugins.pages");ClassFactory.createClass(editor.plugins.pages,"PagesPlugin");with(editor.plugins.pages){editor.plugins.pages.PagesPlugin.constructor=function(){this.PagesPlugin=function(){editor.Application.getInstance().addAppListener(this)};this.onAppSaving=function(E,B){var D=SiteMenu.get();if((D&&(D.constructor===SiteMenu||defined(D.constructor.isSubclassOf)&&D.constructor.isSubclassOf(SiteMenu)))){var C=D.getCurrentItem();if((C&&(C.constructor===SiteMenuItem||defined(C.constructor.isSubclassOf)&&C.constructor.isSubclassOf(SiteMenuItem)))){B.setUrl("ajax.SavePage?pageId="+C.getPageId())}for(var A=D.getItems().iterator();A.hasNext();A.next()){B.set("page.name"+A.current().getPageId(),A.current().getPageName())}}}}}ClassFactory.createPackage("editor.plugins.text");ClassFactory.createClass(editor.plugins.text,"TextBoxSelection");with(editor.plugins.text){editor.plugins.text.TextBoxSelection.superClass=editor.ui.DefaultSelection;editor.plugins.text.TextBoxSelection.constructor=function(){this.TextBoxSelection=function(B){arguments.callee.prototype.apply(this,[B]);this.setStyle("z-index",2);var A=new editor.ui.SelectionMenuBuilder(B);A.buildDeleteIcon();A.buildEditIcon();this.setMenu(A.getMenu())};this.onEndResize=callback(this,override(this.onEndResize,function(){this.getTarget().updateLayout();this.updateLayout();arguments.callee.prototype.apply(this,[])}))}}ClassFactory.createPackage("editor.plugins.text");ClassFactory.createClass(editor.plugins.text,"TextBox");with(editor.plugins.text){editor.plugins.text.TextBox.superClass=editor.elements.PageElement;editor.plugins.text.TextBox.constructor=function(){this.TextBox=function(A){arguments.callee.prototype.apply(this,[A,"Text"])};this.edit=function(){var A=theApp.plugins.text.getPanel().getContentWindow();if(A.isLoaded()){A.setEditMode(true)}else{A.notifyLoaded.addListener(this.onPanelLoaded,true)}};this.isEmpty=function(){var B=this.getText();var A=B.replace(/( )|(\s+)|(<.+?>)/g,"").length;return(A==0)};this.setText=override(this.setText,function(C){arguments.callee.prototype.apply(this,[C]);var A=this.getElement().getElementsByTagName("a");for(var B in A){if(defined(A[B])){A[B].target="_blank"}else{delete A[B]}}this.updateLayout()});this.setEnabled=override(this.setEnabled,function(A){arguments.callee.prototype.apply(this,[A]);this.getElement().disabled=false});this.activate=override(this.activate,function(){arguments.callee.prototype.apply(this,[]);var B=theApp.plugins.text.getPanel();var A=B.getContentWindow();A.setEditMode(false);A.setTextBox(this);theApp.switchPanel(B)});this.move=override(this.move,function(A,C){arguments.callee.prototype.apply(this,[A,C]);var B=theApp.plugins.text.getPanel().getContentWindow();if(B.editMode&&(this==B.textbox)){B.editor.move(A,C)}});this.resize=override(this.resize,function(B,C){arguments.callee.prototype.apply(this,[B,C]);var A=theApp.plugins.text.getPanel().getContentWindow();if(A.editMode&&(this==A.textbox)){A.editor.resize(B,C)}this.updateLayout()});this.load=override(this.load,function(A){arguments.callee.prototype.apply(this,[A]);if(this.isInEditMode()){this.updateLayout()}});this.onPanelLoaded=callback(this,function(){this.edit()});this.updateLayout=function(){var A=editor.Application.getInstance();if(!A.plugins.text.getPanel().getContentWindow().getEditMode()){this.setStyle("height","auto")}};this.createSelection=function(){return new TextBoxSelection(this)}};editor.plugins.text.TextBox.forElement=function(A){while(A&&(A.className!="TextBox")){A=A.parentNode}return A?core.ui.Window.forId(A.winid):null}}ClassFactory.createPackage("core.ui.quirks");ClassFactory.createClass(core.ui.quirks,"ColorFormat");with(core.ui.quirks){core.ui.quirks.ColorFormat.constructor=function(){};core.ui.quirks.ColorFormat.decToHex=function(B){var A=core.util.Color.dec2Hex(B);A=A.substring(1);return A.substring(4)+A.substring(2,4)+A.substring(0,2)}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ToggleButton");with(editor.ui){editor.ui.ToggleButton.superClass=editor.ui.StateButton;editor.ui.ToggleButton.constructor=function(){this.setEnabled=override(this.setEnabled,function(A){arguments.callee.prototype.apply(this,[A]);if(A){this.setState(this.isTurned()?core.ui.ImageButton.STATE_PRESSED:core.ui.ImageButton.STATE_NORMAL)}});this.onmousedown=function(A){this.turn();this.setState(this.isTurned()?core.ui.ImageButton.STATE_PRESSED:core.ui.ImageButton.STATE_HOVER);this.setFocus(true);this.activate();A.stop();A.cancel()};this.onmouseout=function(A){this.setState((this.isTurned())?core.ui.ImageButton.STATE_PRESSED:core.ui.ImageButton.STATE_NORMAL);A.stop()};this.onblur=function(){this.setState(this.isTurned()?core.ui.ImageButton.STATE_PRESSED:core.ui.ImageButton.STATE_NORMAL)};this.onmouseover=this.onmouseup=function(A){this.setState(this.isTurned()?core.ui.ImageButton.STATE_PRESSED:core.ui.ImageButton.STATE_HOVER);A.stop()}};editor.ui.SealButton.notifyPress=new core.ui.Notification()}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ColorPicker");with(editor.ui){editor.ui.ColorPicker.superClass=core.ui.SplitWindow;editor.ui.ColorPicker.constructor=function(){this.pickButton;this.applyButton;this.popupMenu;this.colorSubmenu;this.color="000000";this.notifyColorSelected=new core.ui.Notification();this.ColorPicker=function(B,A,E,C,D){this.SplitWindow(B,A,E,C,D);this.applyButton=new MenuButton(this);this.applyButton.setIcon("images/blank.gif");this.applyButton.setStyleId("color-picker-button-apply");this.applyButton.oncommand=this.onApplyButtonClick;this.pickButton=new core.ui.ImageButton(this);this.pickButton.setStyleId("color-picker-button-pick");this.pickButton.oncommand=this.onPickButtonClick;this.applyButton.onmousedown=this.pickButton.onmousedown=this.onButtonMouseDown;this.applyButton.onmouseover=this.pickButton.onmouseover=this.onButtonMouseOver;this.applyButton.onmouseup=this.pickButton.onmouseup=this.onButtonMouseOver;this.applyButton.onmouseout=this.pickButton.onmouseout=this.onButtonMouseOut;this.initColorMenu()};this.setColor=function(A){if((defined(this.color))&&this.color==A){return }this.color=A;if(A===this.colorSubmenu.getTranspColor()){this.applyButton.icon.setStyle("background-image","url(images/ColorMenu/transparent-color-icon.gif)");this.colorSubmenu.setColor(A)}else{try{this.applyButton.icon.setStyle("background-image","none");this.applyButton.icon.setStyle("background-color",A);this.colorSubmenu.setColor(A)}catch(B){}}};this.initColorMenu=function(){this.popupMenu=new PopupMenuFrame();var A=new PopupMenu(this.popupMenu);this.colorSubmenu=A.createSubMenu(null,ColorMenu);this.colorSubmenu.setText("Pick color from list");this.colorSubmenu.notifyColorSelected.addListener(this.onMenuColorSelected);this.colorSubmenu.notifyColorApplied.addListener(this.onMenuColorSelected);this.popupMenu.setContentWindow(A)};this.onPickButtonClick=callback(this,function(){if(this.popupMenu.isPopup()){this.popupMenu.endPopup()}else{this.popupMenu.doPopupNear(this.applyButton);this.popupMenu.getContentWindow().origin=this.pickButton}});this.onApplyButtonClick=callback(this,function(){this.notifyColorSelected.send(this,this.colorSubmenu.getColor())});this.onButtonMouseDown=callback(this,function(A){this.applyButton.setState(core.ui.ImageButton.STATE_PRESSED);this.pickButton.setState(core.ui.ImageButton.STATE_PRESSED);this.activate();A.stop();return false});this.onButtonMouseOver=callback(this,function(A){this.applyButton.setState(core.ui.ImageButton.STATE_HOVER);this.pickButton.setState(core.ui.ImageButton.STATE_HOVER);A.stop()});this.onButtonMouseOut=callback(this,function(A){this.applyButton.setState(core.ui.ImageButton.STATE_NORMAL);this.pickButton.setState(core.ui.ImageButton.STATE_NORMAL);A.stop()});this.onMenuColorSelected=callback(this,function(B,A){this.setColor(A);this.notifyColorSelected.send(this,A);this.popupMenu.getContentWindow().endPopup()})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"HtmlEditor");with(core.ui){core.ui.HtmlEditor.superClass=core.ui.Window;core.ui.HtmlEditor.constructor=function(){this.iframe;this.document;this.range="";this.notifySelectionChange=new Notification();this.setText=function(B){var A=this.document.getElementsByTagName("body")[0];if(A){A.innerHTML=B;try{this.execCommand("InsertHtml","")}catch(C){}}};this.getDocument=function(){return this.document};this.getText=function(){var A=this.document.getElementsByTagName("body")[0];return(A)?A.innerHTML:""};this.getSelectedText=function(){return(defined(this.range.toString))?this.range.toString():this.range.text};this.indent=function(){this.execCommand("Indent")};this.isIndent=function(){return this.queryCommandState("Indent")};this.outdent=function(){this.execCommand("Outdent")};this.isOutdent=function(){return this.queryCommandState("Outdent")};this.setFontFace=function(A){this.execCommand("FontName",A)};this.getFontFace=function(){return this.queryCommandValue("FontName")};this.setFontSize=function(A){this.execCommand("FontSize",A)};this.getFontSize=function(){return this.queryCommandValue("FontSize")};this.setForeColor=function(A){this.execCommand("ForeColor",A)};this.getForeColor=function(A){return this.queryCommandValue("ForeColor")};this.setBackColor=function(A){this.execCommand("BackColor",A)};this.getBackColor=function(A){return this.queryCommandValue("BackColor")};this.setBold=function(){this.execCommand("Bold")};this.isBold=function(){return this.queryCommandState("Bold")};this.setItalic=function(){this.execCommand("Italic")};this.isItalic=function(){return this.queryCommandState("Italic")};this.setUnderline=function(){this.execCommand("Underline")};this.isUnderline=function(){return this.queryCommandState("Underline")};this.justifyLeft=function(){this.execCommand("JustifyLeft")};this.isJustifiedLeft=function(){return this.queryCommandState("JustifyLeft")};this.justifyRight=function(){this.execCommand("JustifyRight")};this.isJustifiedRight=function(){return this.queryCommandState("JustifyRight")};this.justifyCenter=function(){this.execCommand("JustifyCenter")};this.isJustifiedCenter=function(){return this.queryCommandState("JustifyCenter")};this.justifyFull=function(){this.execCommand("JustifyFull")};this.isJustifiedFull=function(){return this.queryCommandState("JustifyFull")};this.insertHtml=function(A){this.execCommand("InsertHtml",A)};this.createLink=function(A){this.execCommand("CreateLink",A)};this.getLink=function(){return this.queryCommandValue("CreateLink")};this.unlink=function(){this.execCommand("Unlink")};this.undo=function(){this.execCommand("Undo")};this.canUndo=function(){return this.queryCommandState("Undo")};this.redo=function(){this.execCommand("Redo")};this.canRedo=function(){return this.queryCommandState("Redo")};this.insertOrderedList=function(){this.execCommand("InsertOrderedList")};this.isOrderedList=function(){return this.queryCommandState("InsertOrderedList")};this.insertUnorderedList=function(){this.execCommand("InsertUnorderedList")};this.isUnorderedList=function(){return this.queryCommandState("InsertUnorderedList")};this.close=override(this.close,function(){this.getElement().removeChild(this.iframe);delete this.iframe;delete this.document;arguments.callee.prototype.apply(this,[])});this.initDesignMode=function(){try{this.document=this.iframe.contentWindow.document;this.document.designMode="on";if(defined(this.document.queryCommandSupported)){try{if(this.document.queryCommandSupported("useCSS")){this.document.execCommand("useCSS",false,false)}else{if(this.document.queryCommandSupported("styleWithCSS")){this.document.execCommand("styleWithCSS",false,false)}}}catch(C){this.document.execCommand("styleWithCSS",false,false)}}var B=["mousedown","mouseup","focus"];for(var A=0;A/g,"")==this.textbox.getText()){return }var A=new EditTextBoxCommand(this.textbox,"Change text");A.setText(this.getText());editor.commands.CommandHistory.get().execute(A)};this.setBackgroundColor=function(A){var B=new editor.commands.EditBackgroundColorCommand(this.textbox,"Change text box color");B.setBackgroundColor(A);editor.commands.CommandHistory.get().execute(B);this.setStyle("background-color",A)};this.setBorderColor=function(B){var A=new editor.commands.EditBorderCommand(this.textbox,"Change border color");A.setBorderColor(B);editor.commands.CommandHistory.get().execute(A);this.setStyle("border-color",B)};this.setBorderWidth=function(A){var B=new editor.commands.EditBorderCommand(this.textbox,"Change border width");B.setBorderWidth(A);editor.commands.CommandHistory.get().execute(B);this.setStyle("border-width",A)};this.setBorderStyle=function(A){var B=new editor.commands.EditBorderCommand(this.textbox,"Change border style");B.setBorderStyle(A);editor.commands.CommandHistory.get().execute(B);this.setStyle("border-style",A)};this.setBorder=function(C,B,A){var D=new editor.commands.EditBorderCommand(this.textbox,"Change border of text box");D.setBorder(C,B,A);editor.commands.CommandHistory.get().execute(D);this.setStyle("border-width",C);this.setStyle("border-style",B);this.setStyle("border-color",A)};this.isAllSelected=function(){var B=(this.getText()==this.selectedText&&this.getText()!="");var A=this.getText().replace(/(\s+)|(<.+?>)/g,"")==this.getSelectedText().replace(/(\s+)|(<.+?>)/g,"");return(B||A)};this.isEmpty=function(){return this.getText().replace(/( )|(\s+)|(<.+?>)/g,"")==""};this.onKeyboardEvent=callback(this,override(this.onKeyboardEvent,function(B){arguments.callee.prototype.apply(this,[B]);if(B.type=="keydown"){B=core.ui.Event.improve(B);if(B.ctrlKey){var A=B.getChar();switch(A){case"A":B.cancel();this.select();return false;case"Y":B.cancel();this.redo();return false;case"Z":B.cancel();this.undo();return false}}else{if(core.ui.Event.KEY_DELETE==B.keyCode){if(this.isEmpty()){B.cancel();this.range="";return false}if(this.isAllSelected()){B.cancel();this.range="";this.clear()}this.updateFocus()}else{if(48<=B.keyCode){if(this.isAllSelected()&&!this.isEmpty()){this.clear();this.updateFocus()}this.range=""}else{if(this.isEmpty()){B.cancel();return false}}}}this.selectedText=""}}));this.onMouseEvent=callback(this,override(this.onMouseEvent,function(A){arguments.callee.prototype.apply(this,[]);if(defined(A)&&defined(A.type)&&(A.type=="mousedown")){this.selectedText=""}}));this.onDocumentChange=callback(this,function(A){core.ui.Event.improve(A);this.updateLayout()})}}ClassFactory.createPackage("editor.plugins.text");ClassFactory.createClass(editor.plugins.text,"TextBoxPanel");with(editor.plugins.text){editor.plugins.text.TextBoxPanel.superClass=core.ui.Window;editor.plugins.text.TextBoxPanel.constructor=function(){this.textbox;this.editMode=false;this.editor;this.controlGroupWindow;this.fontFaceList;this.fontSizeList;this.colorPicker;this.boldButton;this.italicButton;this.underlineButton;this.leftAlignButton;this.centerAlignButton;this.rightAlignButton;this.indentButton;this.outdentButton;this.aboveButton;this.underButton;this.backButton;this.frontButton;this.undoButton;this.redoButton;this.hyperlinkButton;this.fillButton;this.borderButton;this.samplesButton;this.fillMenu;this.borderMenu;this.colorSubmenu;this.notifyLoaded=new core.ui.Notification();this.notifySavePage=new core.ui.Notification();with(editor.ui){this.TextBoxPanel=function(parent){arguments.callee.prototype.apply(this,[parent]);this.deferredInit()};this.deferredInit=callback(this,function(){switch(this.initStep){case undefined:this.initStep=0;case 0:this.createProgress();break;case 1:this.editor=new TextBoxEditor();this.editor.move(0,0);this.editor.resize(0,0);this.editor.notifySelectionChange.addListener(this.onEditorSelectionChange);break;case 2:this.controlGroupWindow=new core.ui.Window(this);this.controlGroupWindow.setStyleId("textbox-panel-control-group");this.controlGroupWindow.hide();break;case 3:this.fontFaceList=new core.ui.ComboBox(this.controlGroupWindow);this.fontFaceList.setStyleId("textbox-panel-list-font-family");this.fontFaceList.setStyle("position","absolute");this.fontFaceList.setToolTip("Select font face");this.fontFaceList.notifyValueChanged.addListener(this.onFontFamilyChange);var fontFaces=["Times New Roman","Arial","Verdana","Courier","Georgia","Tahoma"];for(var i=0;i=25)};this.setTextBox=function(textbox){this.textbox=textbox;if(defined(this.editor)){this.editor.setTextBox(textbox)}};this.initFillMenu=function(){this.fillMenu=new PopupMenuFrame();var menu=new PopupMenu(this.fillMenu);this.colorSubmenu=menu.createSubMenu(null,ColorMenu);this.colorSubmenu.setText("Textbox color");this.colorSubmenu.notifyColorApplied.addListener(this.onBackgroundColorChange);this.fillMenu.setContentWindow(menu)};this.initBorderMenu=function(){this.borderMenu=new PopupMenuFrame();var menu=new BorderMenu(this.borderMenu);menu.notifyColorSelected.addListener(this.onBorderColorChange);menu.notifyWidthSelected.addListener(this.onBorderWidthChange);menu.notifyStyleSelected.addListener(this.onBorderStyleChange);this.borderMenu.setContentWindow(menu);this.borderButton.setPopupMenu(this.borderMenu)};this.setEditMode=function(mode,isEscPressed){if(!((this.textbox&&(this.textbox.constructor===TextBox||defined(this.textbox.constructor.isSubclassOf)&&this.textbox.constructor.isSubclassOf(TextBox))))||!((this.editor&&(this.editor.constructor===TextBoxEditor||defined(this.editor.constructor.isSubclassOf)&&this.editor.constructor.isSubclassOf(TextBoxEditor))))){return }var selections=editor.ui.SelectionManager.get();if((mode==this.editMode)||!selections.hasSelection(this.textbox)){return }this.onEditorSelectionChange();this.editMode=mode;this.updateControls();isEscPressed=defined(isEscPressed)?isEscPressed:false;if(this.editMode){if(selections.isSelected(this.textbox)){this.textbox.hide();this.editor.edit(this.textbox);core.ui.Window.registerDocument(this.editor.document);theApp.getWorkspace().selection.detachGlobalEvent("keydown");this.attachGlobalEvent("keydown");selections.getSelection(this.textbox).addSelectionListener(this)}}else{this.editor.editText();core.ui.Window.unregisterDocument(this.editor.document);this.editor.hide();this.editor.move(0,0);this.editor.resize(0,0);if(this.textbox.isEmpty()){if(isEscPressed){selections.removeSelection(this.textbox)}theApp.collection.excludeElement(this.textbox)}else{this.detachGlobalEvent("keydown");theApp.getWorkspace().selection.detachGlobalEvent("keydown");this.textbox.show();var panel=theApp.factory.getWorkspacePanel().getContentWindow()}}};this.getEditMode=function(){return this.editMode};this.updateTextBox=function(){this.textbox.setText(this.editor.getText())};this.updateControls=function(){if(this.isLoaded()){this.controlGroupWindow.setEnabled(this.editMode);this.underButton.setEnabled(true);this.aboveButton.setEnabled(true);this.backButton.setEnabled(true);this.frontButton.setEnabled(true);if(this.editMode){this.hyperlinkButton.setEnabled(this.editor.getSelectedText().length>0)}}};this.onElementUnselected=function(){this.setEditMode(false)};this.onLinkButtonClick=callback(this,function(){if(this.editMode){var text=this.editor.getSelectedText();var frame=theApp.factory.getUrlDialog();frame.setTitle("Hyperlink information");frame.getContentWindow().notifySetUrl.addListener(this.onCreateLink,true);frame.getContentWindow().notifyCancel.addListener(this.onCancelLinkDialog,true);frame.getContentWindow().reset();frame.center();frame.doModal()}});this.onFillButtonClick=callback(this,function(){if(this.fillMenu.isPopup()){this.fillMenu.endPopup()}else{this.colorSubmenu.setColor(this.textbox.getBackgroundColor());this.fillMenu.doPopupNear(this.fillButton)}});this.onStyleBoldButtonClick=callback(this,function(){this.editor.setBold()});this.onStyleItalicButtonClick=callback(this,function(){this.editor.setItalic()});this.onStyleUnderlineButtonClick=callback(this,function(){this.editor.setUnderline()});this.onAlignLeftButtonClick=callback(this,function(){this.editor.justifyLeft()});this.onAlignCenterButtonClick=callback(this,function(){this.editor.justifyCenter()});this.onAlignRightButtonClick=callback(this,function(){this.editor.justifyRight()});this.onIndentButtonClick=callback(this,function(){this.editor.indent()});this.onOutdentButtonClick=callback(this,function(){this.editor.outdent()});this.onUndoButtonClick=callback(this,function(){this.editor.undo();this.updateControls()});this.onRedoButtonClick=callback(this,function(){this.editor.redo();this.updateControls()});this.onUnderButtonClick=callback(this,function(){var collection=editor.Application.getInstance().getCollection();collection.moveToBack(this.textbox,collection.getElementCount());this.editor.updateFocus()});this.onAboveButtonClick=callback(this,function(){var collection=editor.Application.getInstance().getCollection();collection.moveToFront(this.textbox,collection.getElementCount());this.editor.updateFocus()});this.onBackButtonClick=callback(this,function(){theApp.collection.moveToBack(this.textbox,null);this.editor.updateFocus()});this.onFrontButtonClick=callback(this,function(){theApp.collection.moveToFront(this.textbox,null);this.editor.updateFocus()});this.onBorderButtonClick=callback(this,function(){var borderDialog=theApp.factory.getBorderDialog();borderDialog.getContentWindow().notifyApplied.addListener(this.onBorderChanged,true);borderDialog.getContentWindow().notifyCancelled.addListener(this.onBorderCancelled,true);borderDialog.getContentWindow().setBorderParameters(this.textbox.getBorderWidth(),this.textbox.getBorderStyle(),this.textbox.getBorderColor());borderDialog.center();borderDialog.doModal()});this.onEditorSelectionChange=callback(this,function(){var isIE=(navigator.appName=="Microsoft Internet Explorer");var color=this.editor.getForeColor();if(color==""){color="000000"}else{if(isIE){color=core.ui.quirks.ColorFormat.decToHex(color)}}this.colorPicker.setColor(color);var face=this.editor.getFontFace();this.fontFaceList.setValue((face=="")?"Times New Roman":face);var size=this.editor.getFontSize();this.fontSizeList.setValue((size=="")?"3":size);this.boldButton.turn(this.editor.isBold());this.italicButton.turn(this.editor.isItalic());this.underlineButton.turn(this.editor.isUnderline());this.leftAlignButton.turn(this.editor.isJustifiedLeft());this.centerAlignButton.turn(this.editor.isJustifiedCenter());this.rightAlignButton.turn(this.editor.isJustifiedRight());if(this.editor.getSelectedText().length>0!=this.hyperlinkButton.isEnabled()){this.hyperlinkButton.setEnabled(!this.hyperlinkButton.isEnabled())}});this.onFontFamilyChange=callback(this,function(sender,face){this.editor.setFontFace(face)});this.onFontSizeChange=callback(this,function(sender,size){this.editor.setFontSize(size)});this.onBackgroundColorChange=callback(this,function(sender,color){this.editor.setBackgroundColor(color)});this.onTextColorChange=callback(this,function(sender,color){this.editor.setForeColor(color)});this.onTextChange=callback(this,function(sender,html){this.textbox.setText(html)});this.onBorderColorChange=callback(this,function(sender,c){this.editor.setBorderColor(c)});this.onBorderWidthChange=callback(this,function(sender,w){this.editor.setBorderWidth(w)});this.onBorderStyleChange=callback(this,function(sender,s){this.editor.setBorderStyle(s)});this.onBorderChanged=callback(this,function(sender,width,style,color){this.editor.setBorder(width,style,color);theApp.factory.getBorderDialog().endModal()});this.onBorderCancelled=callback(this,function(){theApp.factory.getBorderDialog().endModal()});this.onCancelLinkDialog=callback(this,function(){theApp.factory.getUrlDialog().endModal()});this.onCreateLink=callback(this,function(sender,url){this.editor.createLink(url);theApp.factory.getUrlDialog().endModal()});this.onkeydown=function(event){if(core.ui.Event.KEY_F2==event.keyCode){if(this.editMode){event.cancel();return false}}else{if(core.ui.Event.KEY_ESCAPE==event.keyCode){if(this.editMode){this.setEditMode(false,true);event.cancel()}}}}}}}ClassFactory.createPackage("editor.plugins.text");ClassFactory.createClass(editor.plugins.text,"TextPlugin");with(editor.plugins.text){editor.plugins.text.TextPlugin.constructor=function(){this.TextPlugin=function(){editor.Application.getInstance().addAppListener(this)};this.onAppInitComplete=function(app){var button=new editor.ui.ToolButton(this);button.addStyleName("TextBoxIcon");button.setText("Place text");button.setIcon("images/TextBox/icon.png");button.setToolTip("Create new text box");if(app.config.get("editor.firstRun")){var blocks=app.config.get("page.text");if(blocks){for(var id in blocks){var element=document.getElementById(id);var textBox=TextBox.forElement(element);if((blocks[id].length>0)&&(element)&&((textBox&&(textBox.constructor===TextBox||defined(textBox.constructor.isSubclassOf)&&textBox.constructor.isSubclassOf(TextBox))))){element.innerHTML=blocks[id];textBox.setModified(true)}}}}};this.onAppSaving=function(app,context){this.getPanel().getContentWindow().setEditMode(false);var name=document.getElementById("person.name");if(name){context.set("person.name",name.innerHTML)}};this.onAppPageLoaded=function(app){var element=document.getElementById("person.dates");var dates=TextBox.forElement(element);if((dates&&(dates.constructor===TextBox||defined(dates.constructor.isSubclassOf)&&dates.constructor.isSubclassOf(TextBox)))){var birthDate=common.util.DateUtils.toClientDate(app.config.get("page.birthDate",""));var deathDate=common.util.DateUtils.toClientDate(app.config.get("page.deathDate",""));var text=((birthDate.length>0)&&(deathDate.length>0))?(birthDate+" - "+deathDate):"";if((text.length>0)&&(element.innerHTML!==text)){element.innerHTML=text;dates.setModified(true)}}element=document.getElementById("person.name");var name=TextBox.forElement(element);if((name&&(name.constructor===TextBox||defined(name.constructor.isSubclassOf)&&name.constructor.isSubclassOf(TextBox)))){var personName=app.config.get("page.personName");if(personName!==element.innerHTML){element.innerHTML=app.config.get("page.personName");name.setModified(true)}}};this.onAppModeChanged=function(app){if(app.getMode()===editor.Application.MODE_EDIT){var panel=this.getPanel().getContentWindow();if(panel.isLoaded()){panel.setEditMode(true)}}};this.getPanel=function(){var factory=editor.Application.getInstance().getGuiFactory();return factory.createPanelWithFrame(TextBoxPanel,"Text properties")};this.onToolButtonPressed=this.onToolButtonDropped=function(button,x,y){var text=new TextBox();with(editor.commands){CommandHistory.get().execute(new AddCommand(text,x,y,"Add text"))}text.select();text.activate();text.edit()}}}ClassFactory.createPackage("editor.ui.wizard");ClassFactory.createClass(editor.ui.wizard,"WizardDialog");with(editor.ui.wizard){editor.ui.wizard.WizardDialog.superClass=core.ui.Dialog;editor.ui.wizard.WizardDialog.constructor=function(){this.panes={};this.paneCount=0;this.listeners=new core.util.Listeners();this.WizardDialog=function(parent){arguments.callee.prototype.apply(this,[parent]);with(core.ui){var splitter=new SplitWindow(this,0,0,"100%","100%");this.description=new Static(splitter);this.description.addStyleName("Description");var titlePane=new Window(splitter);titlePane.addStyleName("TitlePane");this.title=new Static(titlePane);this.title.addStyleName("Title");this.contentPane=new Window(splitter);this.contentPane.addStyleName("ContentPane");var buttonsPane=new Window(splitter);buttonsPane.addStyleName("ButtonsPane");this.cancelButton=new ImageButton(buttonsPane);this.cancelButton.addStyleName("CancelButton");this.cancelButton.setImageList("images/Wizard/button.gif");this.cancelButton.setText("Cancel");this.cancelButton.setToolTip("Cancel dialog");this.cancelButton.oncommand=this.onCancelClick;this.cancelButton.setTabIndex(2);this.nextButton=new ImageButton(buttonsPane);this.nextButton.addStyleName("NextButton");this.nextButton.setImageList("images/Wizard/next.gif");this.nextButton.setText("Next");this.nextButton.setTabIndex(1);this.nextButton.oncommand=this.onNextClick;this.backButton=new ImageButton(buttonsPane);this.backButton.addStyleName("BackButton");this.backButton.setImageList("images/Wizard/next.gif");this.backButton.setText("Back");this.backButton.setToolTip("Back to the previous step");this.backButton.setTabIndex(3);this.backButton.oncommand=this.onBackClick;this.skipBox=new CheckBox(buttonsPane);this.skipBox.setText("Skip this wizard");this.skipBox.onclick=this.onSkipClick;splitter.addPane(this.description,SplitWindow.SPLIT_RIGHT);splitter.addPane(titlePane,SplitWindow.SPLIT_TOP);splitter.addPane(this.contentPane,SplitWindow.SPLIT_TOP);splitter.addPane(buttonsPane,SplitWindow.SPLIT_FILL)}};this.addWizardListener=function(listener){this.listeners.add(listener)};this.removeWizardListener=function(listener){this.listeners.remove(listener)};this.reset=function(){for(var id in this.panes){this.panes[id].reset()}this.updateControls()};this.getContentPane=function(){return this.contentPane};this.getDescriptionPane=function(){return this.description};this.updateControls=function(){if(this.currentPane.getNextPaneId()&&!(this.currentPane.canSkip()&&this.skipBox.isChecked())){this.nextButton.setText("Next");this.nextButton.setToolTip("Go to the next step")}else{this.nextButton.setText("Finish");this.nextButton.setToolTip("Finish dialog")}this.backButton.setVisible(null!==this.currentPane.getPrevPaneId());this.skipBox.setVisible(this.currentPane.canSkip())};this.setCurrentPane=function(id){if((this.currentPane&&(this.currentPane.constructor===WizardPane||defined(this.currentPane.constructor.isSubclassOf)&&this.currentPane.constructor.isSubclassOf(WizardPane)))){this.currentPane.setActive(false);this.currentPane.hide()}this.currentPane=this.panes[id];this.title.setText(this.currentPane.getTitle());this.description.setText(this.currentPane.getText());this.currentPane.show();this.currentPane.setActive(true);this.updateControls()};this.getCurrentPane=function(){return this.currentPane};this.setPane=function(id,pane){return this.panes[id]=pane};this.getPane=function(id){return(defined(this.panes[id]))?this.panes[id]:undefined};this.getNextPane=function(){return(this.hasPanes())?this.getPane(this.getCurrentPane().getNextPaneId()):undefined};this.getPrevPane=function(){return(this.hasPanes())?this.getPane(this.getCurrentPane().getPrevPaneId()):undefined};this.addPane=function(pane){this.setPane(pane.getPaneId(),pane);pane.setStyle("position","absolute");pane.setStyle("width","100%");pane.setStyle("height","100%");pane.hide();this.paneCount++};this.removePane=function(pane){delete this.panes[pane.getPaneId()];pane.close();this.paneCount--};this.hasPanes=function(){return(this.paneCount>0)};this.getPaneCount=function(){return this.paneCount};this.iterator=function(){return new core.util.Iterator(this.panes)};this.getNextButton=function(){return this.nextButton};this.getBackButton=function(){return this.backButton};this.getCancelButton=function(){return this.cancelButton};this.next=function(){if(this.currentPane.canSkip()&&this.skipBox.isChecked()){this.fireSkip()}else{if(this.currentPane.getNextPaneId()){this.fireNext();this.getCurrentPane().hide();this.setCurrentPane(this.getNextPane().getPaneId())}else{this.fireFinish()}}};this.back=function(){if(this.currentPane.getPrevPaneId()){this.fireBack();this.currentPane.hide();this.setCurrentPane(this.getPrevPane().getPaneId())}};this.cancel=function(){this.fireCancel()};this.fireNext=function(){this.listeners.call("onWizardNext",[this])};this.fireBack=function(){this.listeners.call("onWizardBack",[this])};this.fireCancel=function(){this.listeners.call("onWizardCancel",[this])};this.fireFinish=function(){this.listeners.call("onWizardFinish",[this])};this.fireSkip=function(){this.listeners.call("onWizardSkip",[this])};this.onNextClick=callback(this,function(){if(this.currentPane.validate()){this.next()}});this.onBackClick=callback(this,function(){this.back()});this.onCancelClick=callback(this,function(){this.cancel()});this.onSkipClick=callback(this,function(){this.updateControls()})}}ClassFactory.createPackage("core.flash");ClassFactory.createClass(core.flash,"FlashPlayer");with(core.flash){core.flash.FlashPlayer.constructor=function(){};core.flash.FlashPlayer.getVersion=function(){var B={major:0,minor:0,revision:0};if(defined(navigator.plugins)&&(navigator.mimeTypes.length>0)){var A=navigator.plugins["Shockwave Flash"];if(defined(A)&&defined(A.description)&&A.description.match(/([0-9]+)\.([0-9]+)\s+r([0-9]+)/)){B.major=parseInt(RegExp.$1);B.minor=parseInt(RegExp.$2);B.revision=parseInt(RegExp.$3)}}else{if(defined(window.ActiveXObject)){try{var D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");var E=D.GetVariable("$version").toString();if(E.match(/([0-9]+),([0-9]+),([0-9]+)/)){B.major=parseInt(RegExp.$1);B.minor=parseInt(RegExp.$2);B.revision=parseInt(RegExp.$3)}}catch(C){}}}return B};core.flash.FlashPlayer.isInstalled=function(B){var A=this.getVersion();if(defined(B)){return((A.major>=B.major)&&(A.minor>=B.minor)&&(A.revision>=B.revision))}else{return(0!=A.major)}}}ClassFactory.createPackage("editor.ui.wizard.panes");ClassFactory.createClass(editor.ui.wizard.panes,"VideoTypePane");with(editor.ui.wizard.panes){editor.ui.wizard.panes.VideoTypePane.superClass=editor.ui.wizard.WizardPane;editor.ui.wizard.panes.VideoTypePane.constructor=function(){this.VideoTypePane=function(wizard){arguments.callee.prototype.apply(this,[wizard,VideoTypePane]);wizard.addWizardListener(this);this.setTitle("Choose video type");if(core.flash.FlashPlayer.isInstalled({major:8,minor:0,revision:0})){this.setText("Choose the type of the new video. If you want to add an existing video to your page, click Embed existing video. If you want to create a slide show using photos from your computer, click Create photo montage.")}else{this.setText('Warning: To play videos on your page you need to install Flash Player first.')}};this.getSelectedType=function(){return this.selectedType};this.getNextPaneId=function(){if(VideoTypePane.TYPE_EMBED==this.selectedType){return editor.plugins.video.EmbedVideoPane}else{if(VideoTypePane.TYPE_CREATE==this.selectedType){return editor.plugins.tribute.wizard.ChildhoodPhotosPane}}return undefined};this.init=function(){this.uploadButton=new core.ui.ImageButton(this);this.uploadButton.addStyleName("UploadButton");this.uploadButton.setImages("images/VideoWizard/upload-video-normal.png","images/VideoWizard/upload-video-hover.png","images/VideoWizard/upload-video-pressed.png");this.uploadButton.setText("Embed existing video");this.uploadButton.setToolTip("Add existing video to the webpage");this.uploadButton.oncommand=this.onTypeButtonCommand;this.createButton=new core.ui.ImageButton(this);this.createButton.addStyleName("CreateButton");this.createButton.setImages("images/VideoWizard/create-video-normal.png","images/VideoWizard/create-video-hover.png","images/VideoWizard/create-video-pressed.png");this.createButton.setText("Create photo montage");this.createButton.setToolTip("Create new video from photos of deceased");this.createButton.oncommand=this.onTypeButtonCommand};this.setActive=function(active){this.getWizard().getNextButton().setVisible(!active)};this.onTypeButtonCommand=callback(this,function(event,target,button){this.selectedType=(this.uploadButton==button)?VideoTypePane.TYPE_EMBED:VideoTypePane.TYPE_CREATE;this.getWizard().next()});this.onWizardNext=function(wizard){if((this==wizard.getCurrentPane())&&!defined(wizard.getNextPane())){with(editor.plugins){if(VideoTypePane.TYPE_EMBED==this.selectedType){wizard.addPane(new video.EmbedVideoPane(wizard))}else{if(VideoTypePane.TYPE_CREATE==this.selectedType){wizard.addPane(new tribute.wizard.ChildhoodPhotosPane(wizard))}}}}}};editor.ui.wizard.panes.VideoTypePane.TYPE_EMBED=1;editor.ui.wizard.panes.VideoTypePane.TYPE_CREATE=2}ClassFactory.createPackage("editor.ui.wizard");ClassFactory.createClass(editor.ui.wizard,"VideoWizardDialog");with(editor.ui.wizard){editor.ui.wizard.VideoWizardDialog.superClass=editor.ui.wizard.WizardDialog;editor.ui.wizard.VideoWizardDialog.constructor=function(){this.VideoWizardDialog=function(parent){arguments.callee.prototype.apply(this,[parent]);with(editor.ui.wizard.panes){this.addPane(new VideoTypePane(this));this.setCurrentPane(VideoTypePane)}}}}ClassFactory.createPackage("editor.plugins.video");ClassFactory.createClass(editor.plugins.video,"EmbedVideoSelection");with(editor.plugins.video){editor.plugins.video.EmbedVideoSelection.superClass=editor.ui.ProportionalSelection;editor.plugins.video.EmbedVideoSelection.constructor=function(){this.EmbedVideoSelection=function(B){arguments.callee.prototype.apply(this,[B]);var A=new editor.ui.SelectionMenuBuilder(B);A.buildDeleteIcon();this.setMenu(A.getMenu())}}}ClassFactory.createPackage("editor.plugins.video");ClassFactory.createClass(editor.plugins.video,"EmbedVideoBox");with(editor.plugins.video){editor.plugins.video.EmbedVideoBox.superClass=editor.elements.PageElement;editor.plugins.video.EmbedVideoBox.constructor=function(){this.embedURL="";this.flashVars="";this.suppressPane;this.EmbedVideoBox=function(root){arguments.callee.prototype.apply(this,[root,"Video"])};this.setMovieUrl=function(url,flashVars){this.movieUrl=url;this.flashVars=flashVars;if((this.suppressPane&&(this.suppressPane.constructor===core.ui.Window||defined(this.suppressPane.constructor.isSubclassOf)&&this.suppressPane.constructor.isSubclassOf(core.ui.Window)))){this.suppressPane.close()}this.setText(this.getEmbedTag());this.suppressPane=this.createSuppressPane();this.updateControls()};this.setEnabled=override(this.setEnabled,function(e){arguments.callee.prototype.apply(this,[e]);this.updateControls()});this.updateControls=function(){if((this.suppressPane&&(this.suppressPane.constructor===core.ui.Window||defined(this.suppressPane.constructor.isSubclassOf)&&this.suppressPane.constructor.isSubclassOf(core.ui.Window)))){if(this.isEnabled()){this.suppressPane.show();this.suppressPane.activate()}else{this.suppressPane.hide()}}};this.getEmbedTag=function(){with(core.html){var tag=new Tag("object",{"type":"application/x-shockwave-flash","classid":"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","width":"100%","height":"100%"});tag.addContent(new Tag("param",{"name":"movie","value":this.movieUrl}));tag.addContent(new Tag("param",{"name":"wmode","value":"transparent"}));tag.addContent(new Tag("param",{"name":"flashvars","value":this.flashVars}));tag.addContent(new Tag("embed",{"src":this.movieUrl,"type":"application/x-shockwave-flash","wmode":"transparent","width":"100%","height":"100%","flashvars":this.flashVars}));return tag}};this.createSuppressPane=function(){var pane=new core.ui.Window(this,0,0,"100%","100%");pane.setStyle("position","absolute");pane.setStyleName("SuppressPane");return pane};this.load=override(this.load,function(root){arguments.callee.prototype.apply(this,[root]);if(this.isInEditMode()){this.setMovieUrl(root.getAttribute("movieUrl"),root.getAttribute("flashVars"))}});this.getHtmlTag=override(this.getHtmlTag,function(){var tag=arguments.callee.prototype.apply(this,[]);tag.setAttribute("movieUrl",this.movieUrl);tag.setAttribute("flashVars",this.flashVars);tag.setContent(this.getEmbedTag());return tag});this.onModeChanged=callback(this,function(){this.updateControls()});this.createSelection=function(){return new EmbedVideoSelection(this)}}}ClassFactory.createPackage("editor.plugins.video");ClassFactory.createClass(editor.plugins.video,"EmbedVideoPane");with(editor.plugins.video){editor.plugins.video.EmbedVideoPane.superClass=editor.ui.wizard.WizardPane;editor.plugins.video.EmbedVideoPane.constructor=function(){this.EmbedVideoPane=function(A){arguments.callee.prototype.apply(this,[A,EmbedVideoPane]);this.setTitle("Use existing video");this.setText("You can embed a video into your webpage by copying this video's embed string provided by video service. We are currently supporting the following video services: YouTube, PhotoBucket, Yahoo, and Google Video. You can try to use other such services as well since they also should work.");this.setPrevPaneId(editor.ui.wizard.panes.VideoTypePane)};this.getMovieParams=function(){var A,B,C,E,D=this.embedField.getText();if(D.match(/src=[\'\"](.*?)[\'\"]/img)){A=RegExp.$1}if(D.match(/width=[\'\"](.*?)[\'\"]/img)||D.match(/width\s*:\s*(\d+)/img)){B=parseInt(RegExp.$1)}if(D.match(/height=[\'\"](.*?)[\'\"]/img)||D.match(/height\s*:\s*(\d+)/img)){C=parseInt(RegExp.$1)}if(D.match(/flashvars=[\'\"](.*?)[\'\"]/img)){E=RegExp.$1}if(A&&B&&C){return{"url":A,"width":B,"height":C,"flashVars":E}}return null};this.setStatusMessage=function(A){this.status.setText(A)};this.reset=function(){this.getWizard().getNextButton().enable()};this.init=function(){var A=new core.ui.Static(this);A.addStyleName("EmbedTitle");A.setText("Please paste an embed string provided by video service:");this.embedField=new core.ui.TextArea(this);this.embedField.addStyleName("EmbedField");this.status=new core.ui.Static(this);this.status.addStyleName("Notice")};this.setActive=function(A){if(A){this.status.setText("")}else{this.reset()}}}}ClassFactory.createPackage("editor.plugins.tribute");ClassFactory.createClass(editor.plugins.tribute,"Video");with(editor.plugins.tribute){editor.plugins.tribute.Video.constructor=function(){this.autoStart=false;this.scenes=[];this.sounds=[];this.periodPhotosCounter=[0,0,0,0];this.addScene=function(A){this.scenes.push(A)};this.removeScene=function(A){this.scenes.splice(A,1)};this.getScene=function(A){return this.scenes[A]};this.hasScenes=function(){for(var A=0;A0){this.scenes.pop()}while(this.sounds.length>0){this.sounds.pop()}};this.serialize=function(){var B=[];if(this.autoStart){B.push("autoStart=1")}for(var C=0;C0){G[F[0]]=F[1]}}if(1==G["autoStart"]){this.autoStart=true}var H=1;while(defined(G["sc"+H])){var E=new Scene(decodeURIComponent(G["sc"+H]));if(defined(G["d"+H])){E.setDuration(parseInt(G["d"+H]))}if(defined(G["f"+H])){E.setFadingType(parseInt(G["f"+H]))}if(defined(G["sx"+H])&&defined(G["sy"+H])){E.getStartView().center(parseInt(G["sx"+H]),parseInt(G["sy"+H]))}if(defined(G["sz"+H])){E.getStartView().setZoom(parseInt(G["sz"+H]))}if(defined(G["ex"+H])&&defined(G["ey"+H])){E.getEndView().center(parseInt(G["ex"+H]),parseInt(G["ey"+H]))}if(defined(G["ez"+H])){E.getEndView().setZoom(parseInt(G["ez"+H]))}if(defined(G["txt"+H])){E.getSubtitles().setText(decodeURIComponent(G["txt"+H]))}if(defined(G["b"+H])){E.getSubtitles().setBold(G["b"+H]?true:false)}if(defined(G["i"+H])){E.getSubtitles().setItalic(G["i"+H]?true:false)}if(defined(G["u"+H])){E.getSubtitles().setUnderline(G["u"+H]?true:false)}if(defined(G["ts"+H])){E.getSubtitles().setSize(parseInt(G["ts"+H]))}if(defined(G["tc"+H])){E.getSubtitles().setColor(G["tc"+H])}if(defined(G["fn"+H])){E.getSubtitles().setFont(G["fn"+H])}this.addScene(E);H++}H=1;while(defined(G["sn"+H])){var D=new Sound(decodeURIComponent(G["sn"+H]));if(defined(G["sd"+H])){D.setDuration(parseInt(G["sd"+H]))}if(defined(G["cy"+H])){D.setCyclic(G["cy"+H]?true:false)}this.addSound(D);H++}};this.clone=function(){var C=new Video();for(var B=0;B'};this.getMovie=function(){return defined(window[this.getId()+"_movie"])?window[this.getId()+"_movie"]:document[this.getId()+"_movie"]};this.onLoad=function(){this.setState(TributeVideoPlayer.STATE_READY)};this.onStarted=function(){this.setState(TributeVideoPlayer.STATE_STARTED)};this.onStopped=function(){this.setState(TributeVideoPlayer.STATE_STOPPED)};this.onComplete=function(){this.setState(TributeVideoPlayer.STATE_COMPLETE)}};TributeVideoPlayer.STATE_EMPTY=1;TributeVideoPlayer.STATE_LOADING=2;TributeVideoPlayer.STATE_READY=3;TributeVideoPlayer.STATE_STARTED=4;TributeVideoPlayer.STATE_PAUSED=5;TributeVideoPlayer.STATE_STOPPED=6;TributeVideoPlayer.STATE_COMPLETE=7}ClassFactory.createPackage("editor.plugins.tribute");ClassFactory.createClass(editor.plugins.tribute,"TributeVideoSelection");with(editor.plugins.tribute){editor.plugins.tribute.TributeVideoSelection.superClass=editor.ui.ProportionalSelection;editor.plugins.tribute.TributeVideoSelection.constructor=function(){this.TributeVideoSelection=function(B){arguments.callee.prototype.apply(this,[B]);this.setStyle("z-index",2);var A=new editor.ui.SelectionMenuBuilder(B);A.buildDeleteIcon();A.buildEditIcon();this.setMenu(A.getMenu())};this.updateLayout=override(this.updateLayout,function(){arguments.callee.prototype.apply(this,[]);this.getTarget().updateControls()});this.onEndResize=callback(this,override(this.onEndResize,function(A){this.getTarget().updateControls();arguments.callee.prototype.apply(this,[A])}))}}ClassFactory.createPackage("editor.plugins.tribute.ui");ClassFactory.createClass(editor.plugins.tribute.ui,"TributeVideoCameraViewEditor");with(editor.plugins.tribute.ui){editor.plugins.tribute.ui.TributeVideoCameraViewEditor.superClass=editor.ui.ImageFrame;editor.plugins.tribute.ui.TributeVideoCameraViewEditor.constructor=function(){this.startWindow;this.endWindow;this.startView;this.endView;this.notifyStartZoomChanged=new core.ui.Notification();this.notifyEndZoomChanged=new core.ui.Notification();this.TributeVideoCameraViewEditor=function(A){this.ImageFrame(A);this.background.setStyle("position","absolute");this.background.move(0,0);this.background.setStyle("width","100%");this.background.setStyle("height","100%");this.startWindow=new core.ui.DragWindow(this);this.startWindow.setStyle("position","absolute");this.startWindow.setStyle("background","url(images/TributeVideoCameraViewEditor/start-point.png) no-repeat center center");this.startWindow.notifyDrag.addListener(this.onWindowDrag);this.startWindow.notifyEndDrag.addListener(this.onStartWindowEndDrag);this.endWindow=new core.ui.DragWindow(this);this.endWindow.setStyle("position","absolute");this.endWindow.setStyle("background","url(images/TributeVideoCameraViewEditor/end-point.png) no-repeat center center");this.endWindow.notifyDrag.addListener(this.onWindowDrag);this.endWindow.notifyEndDrag.addListener(this.onEndWindowMoved)};this.setStartView=function(A){this.startView=A;this.updateViews()};this.setEndView=function(A){this.endView=A;this.updateViews()};this.setStartZoom=function(A){this.startView.setZoom(A);this.updateViews()};this.setEndZoom=function(A){this.endView.setZoom(A);this.updateViews()};this.setImage=override(this.setImage,function(A){arguments.callee.prototype.apply(this,[A]);this.updateViews()});this.updateViews=function(){if(defined(this.startView)){this.startWindow.resize(this.getClientWidth()*(100/this.startView.getZoom()),this.getClientHeight()*(100/this.startView.getZoom()));this.startWindow.move(this.getClientWidth()*(this.startView.getCenterX()/100)-this.startWindow.getWidth()/2,this.getClientHeight()*(this.startView.getCenterY()/100)-this.startWindow.getHeight()/2);this.checkInBounds(this.startWindow);this.startWindow.setVisible(this.startView.getZoom()>100?true:false)}if(defined(this.endView)){this.endWindow.resize(this.getClientWidth()*(100/this.endView.getZoom()),this.getClientHeight()*(100/this.endView.getZoom()));this.endWindow.move(this.getClientWidth()*(this.endView.getCenterX()/100)-this.endWindow.getWidth()/2,this.getClientHeight()*(this.endView.getCenterY()/100)-this.endWindow.getHeight()/2);this.checkInBounds(this.endWindow);this.endWindow.setVisible(this.endView.getZoom()>100?true:false)}};this.checkInBounds=function(B){var A=Math.max(0,B.getX());var C=Math.max(0,B.getY());B.move(Math.min(A,this.getClientWidth()-B.getWidth()),Math.min(C,this.getClientHeight()-B.getHeight()))};this.onWindowDrag=callback(this,function(A){this.checkInBounds(A)});this.onStartWindowEndDrag=callback(this,function(A){this.startView.center((A.getX()+A.getWidth()/2)/this.getClientWidth()*100,(A.getY()+A.getHeight()/2)/this.getClientHeight()*100);this.checkInBounds(A)});this.onEndWindowMoved=callback(this,function(A){this.endView.center((A.getX()+A.getWidth()/2)/this.getClientWidth()*100,(A.getY()+A.getHeight()/2)/this.getClientHeight()*100);this.checkInBounds(A)})}}ClassFactory.createPackage("editor.plugins.tribute.ui");ClassFactory.createClass(editor.plugins.tribute.ui,"TributeVideoSceneEditor");with(editor.plugins.tribute.ui){editor.plugins.tribute.ui.TributeVideoSceneEditor.superClass=core.ui.Window;editor.plugins.tribute.ui.TributeVideoSceneEditor.constructor=function(){this.scene;this.index;this.titlePane;this.titleText;this.infoPane;this.imagePane;this.cameraPane;this.notifyUp=new core.ui.Notification();this.notifyDown=new core.ui.Notification();this.notifyDelete=new core.ui.Notification();this.notifySelect=new core.ui.Notification();this.notifySceneEditorChanged=new core.ui.Notification();this.notifyDurationChanged=new core.ui.Notification();this.TributeVideoSceneEditor=function(parent){this.Window(parent);this.init()};this.setScene=function(scene,index){this.scene=scene;this.index=index;this.cameraEditor.setImage(scene.getImage());this.cameraEditor.setStartView(scene.getStartView());this.cameraEditor.setEndView(scene.getEndView());this.updateControls()};this.getScene=function(){return this.scene};this.setIndex=function(i){this.index=i};this.getIndex=function(){return this.index};this.init=function(){editor.ui.LoadingMessage.showIcon(this);this.initTitlePane();this.initImagePane();this.initInfoPane();this.initCameraPane();editor.ui.LoadingMessage.hideMessage(this)};this.initTitlePane=function(){with(core.ui){this.titlePane=new Window(this);this.titlePane.setStyleName("TitlePane");this.titlePane.setStyle("position","absolute");this.titleText=new Static(this.titlePane);this.titleText.addStyleName("Title");this.upButton=new ImageButton(this.titlePane);this.upButton.addStyleName("UpButton");this.upButton.setText("Move up");this.upButton.setToolTip("Move scene up");this.upButton.setImageList("images/TributeVideoSceneEditor/up.gif");this.upButton.onclick=this.onUpButtonClick;this.downButton=new ImageButton(this.titlePane);this.downButton.addStyleName("DownButton");this.downButton.setText("Move down");this.downButton.setToolTip("Move scene down");this.downButton.setImageList("images/TributeVideoSceneEditor/down.gif");this.downButton.onclick=this.onDownButtonClick;this.resetButton=new ImageButton(this.titlePane);this.resetButton.addStyleName("ResetButton");this.resetButton.setText("Reset");this.resetButton.setToolTip("Reset scene");this.resetButton.setImageList("images/TributeVideoSceneEditor/reset.gif");this.resetButton.onclick=this.onResetButtonClick;this.deleteButton=new ImageButton(this.titlePane);this.deleteButton.addStyleName("DeleteButton");this.deleteButton.setText("Delete");this.deleteButton.setToolTip("Delete this scene");this.deleteButton.setImageList("images/TributeVideoSceneEditor/delete.gif");this.deleteButton.onclick=this.onDeleteButtonClick}};this.initImagePane=function(){with(core.ui){this.imagePane=new Window(this);this.imagePane.setStyleName("ImagePane");this.imagePane.setStyle("position","absolute");this.cameraEditor=new TributeVideoCameraViewEditor(this.imagePane);this.cameraEditor.setStyle("position","absolute");this.fileUpload=new FileUpload(this.imagePane);this.fileUpload.setStyle("position","absolute");this.fileUpload.setText("Upload");this.fileUpload.setToolTip("Upload image");this.fileUpload.setImageList("images/TributeVideoSceneEditor/upload.gif");this.fileUpload.setUploadUrl(theApp.getUserCommand("ajax.UploadImage"));this.fileUpload.notifyFileSelected.addListener(this.onFileSelected);this.fileUpload.notifyFileUploaded.addListener(this.onFileUploaded);this.fileUpload.notifyUploadError.addListener(this.onUploadError);this.libButton=new ImageButton(this.imagePane);this.libButton.setStyle("position","absolute");this.libButton.setImageList("images/TributeVideoSceneEditor/lib.gif");this.libButton.setText("Library");this.libButton.setToolTip("Load image from library");this.libButton.oncommand=this.onLibButtonClick}};this.initInfoPane=function(){with(core.ui){this.infoPane=new Window(this);this.infoPane.setStyleName("InfoPane");this.infoPane.setStyle("position","absolute");this.durationSlider=new Slider(this.infoPane);this.durationSlider.addStyleName("Duration");this.durationSlider.setToolTip("Change scene duration");this.durationSlider.setStyle("position","absolute");this.durationSlider.setRange(2,20);this.durationSlider.setPos(5);this.durationSlider.notifyPositionChanged.addListener(this.onDurationChanged);this.durationText=new Static(this.infoPane);this.durationText.addStyleName("DurationValue");this.durationText.setStyle("position","absolute");this.fadingList=new ComboBox(this.infoPane);this.fadingList.addStyleName("Fading");this.fadingList.setStyle("position","absolute");this.fadingList.setToolTip("Fading effect (in process of development)");this.fadingList.notifyValueChanged.addListener(this.onFadingChanged);with(editor.plugins.tribute){var fadings={};fadings[Scene.FADING_NORMAL]="Fading";fadings[Scene.FADING_CIRCLES]="Circles";fadings[Scene.FADING_JALOUSIE]="Jalousie";fadings[Scene.FADING_SQUARES]="Squares";for(var f in fadings){this.fadingList.addItem(fadings[f],f,(Scene.FADING_NORMAL==f)?true:false)}}this.subtitlesText=new TextArea(this.infoPane);this.subtitlesText.addStyleName("Subtitles");this.subtitlesText.setStyle("position","absolute");this.subtitlesText.setToolTip("Enter scene subtitles");this.subtitlesText.onchange=this.subtitlesText.onmouseout=this.onSubtitlesChange;this.fontSizeList=new ComboBox(this.infoPane);this.fontSizeList.addStyleName("FontSize");this.fontSizeList.setStyle("position","absolute");this.fontSizeList.setToolTip("Select font size");this.fontSizeList.notifyValueChanged.addListener(this.onFontSizeChanged);var sizes={12:"12",20:"20",28:"28",36:"36"};for(var s in sizes){this.fontSizeList.addItem(sizes[s],s,(s==12)?true:false)}with(editor.ui){this.boldButton=new ToggleButton(this.infoPane);this.boldButton.addStyleName("BoldButton");this.boldButton.setStyle("position","absolute");this.boldButton.setImageList("images/TributeVideoSceneEditor/bold.gif");this.boldButton.setToolTip("Bold");this.boldButton.oncommand=this.onBoldButtonClick;this.italicButton=new ToggleButton(this.infoPane);this.italicButton.addStyleName("ItalicButton");this.italicButton.setStyle("position","absolute");this.italicButton.setImageList("images/TributeVideoSceneEditor/italic.gif");this.italicButton.setToolTip("Italic");this.italicButton.oncommand=this.onItalicButtonClick;this.underlineButton=new ToggleButton(this.infoPane);this.underlineButton.addStyleName("UnderlineButton");this.underlineButton.setStyle("position","absolute");this.underlineButton.setImageList("images/TributeVideoSceneEditor/underline.gif");this.underlineButton.setToolTip("Underline");this.underlineButton.oncommand=this.onUnderlineButtonClick}var staticInfo={"Duration":"Duration:","Fading":"Fading:","Subtitles":"Subtitles:"};for(var k in staticInfo){var s=new Static(this.infoPane);s.addStyleName(k+"Title");s.setStyle("position","absolute");s.setText(staticInfo[k])}}};this.initCameraPane=function(){with(core.ui){this.cameraPane=new Window(this);this.cameraPane.setStyleName("CameraPane");this.cameraPane.setStyle("position","absolute");var cameraTitle=new Static(this.cameraPane);cameraTitle.addStyleName("CameraTitle");cameraTitle.setStyle("position","absolute");cameraTitle.setText("Camera view");var startPointIcon=new Image(this.cameraPane);startPointIcon.addStyleName("StartPointIcon");startPointIcon.setStyle("position","absolute");startPointIcon.setSource("images/TributeVideoSceneEditor/start-point.gif");var endPointIcon=new Image(this.cameraPane);endPointIcon.addStyleName("EndPointIcon");endPointIcon.setStyle("position","absolute");endPointIcon.setSource("images/TributeVideoSceneEditor/end-point.gif");var startPointText=new Static(this.cameraPane);startPointText.addStyleName("StartPointTitle");startPointText.setStyle("position","absolute");startPointText.setText("Start point:");var endPointText=new Static(this.cameraPane);endPointText.addStyleName("EndPointTitle");endPointText.setStyle("position","absolute");endPointText.setText("End point:");this.startPointSlider=new Slider(this.cameraPane);this.startPointSlider.addStyleName("StartPoint");this.startPointSlider.setToolTip("Start point zoom");this.startPointSlider.setStyle("position","absolute");this.startPointSlider.setRange(100,400);this.startPointSlider.setPos(100);this.startPointSlider.notifyPositionChanged.addListener(this.onStartPointChanged);this.endPointSlider=new Slider(this.cameraPane);this.endPointSlider.addStyleName("EndPoint");this.endPointSlider.setToolTip("End point zoom");this.endPointSlider.setStyle("position","absolute");this.endPointSlider.setRange(100,400);this.endPointSlider.setPos(100);this.endPointSlider.notifyPositionChanged.addListener(this.onEndPointChanged);this.startPointText=new Static(this.cameraPane);this.startPointText.addStyleName("StartPointValue");this.startPointText.setStyle("position","absolute");this.endPointText=new Static(this.cameraPane);this.endPointText.addStyleName("EndPointValue");this.endPointText.setStyle("position","absolute")}};this.reset=function(){this.scene.reset();this.updateControls();this.notifySceneEditorChanged.send(this)};this.activate=override(this.activate,function(){this.notifySelect.send(this,this.index);arguments.callee.prototype.apply(this,[])});this.updateControls=function(){this.titleText.setText("Scene "+((this.index>=9)?"":"0")+(this.index+1)+" / "+this.scene.getDuration().toFixed(0)+" sec");if(this.durationSlider.getPos()!==this.scene.getDuration()){this.durationSlider.setPos(this.scene.getDuration())}this.durationText.setText(this.scene.getDuration().toFixed(0)+" sec");this.fadingList.setValue(this.scene.getFadingType());this.cameraPane.setEnabled(this.scene.hasImage()?true:false);this.cameraPane.setStyle("opacity",this.scene.hasImage()?100:50);var startZoom,endZoom;if(this.scene.hasImage()){startZoom=this.scene.getStartView().getZoom();endZoom=this.scene.getEndView().getZoom()}else{startZoom=100;endZoom=100;this.cameraEditor.setImage(null)}if(this.startPointSlider.getPos()!==startZoom){this.startPointSlider.setPos(startZoom)}if(this.endPointSlider.getPos()!==endZoom){this.endPointSlider.setPos(endZoom)}this.startPointText.setText(startZoom.toFixed(0)+"%");this.endPointText.setText(endZoom.toFixed(0)+"%");var subtitles=this.scene.getSubtitles();this.boldButton.turn(subtitles.isBold());this.italicButton.turn(subtitles.isItalic());this.underlineButton.turn(subtitles.isUnderline());this.subtitlesText.setText(subtitles.getText());this.fontSizeList.setValue(subtitles.getSize())};this.onUpButtonClick=callback(this,function(){this.notifyUp.send(this,this.index)});this.onDownButtonClick=callback(this,function(){this.notifyDown.send(this,this.index)});this.onResetButtonClick=callback(this,function(){this.reset();this.notifyDurationChanged.send(this,this.index)});this.onDeleteButtonClick=callback(this,function(){this.notifyDelete.send(this,this.index)});this.onSubtitlesChange=callback(this,function(){this.scene.getSubtitles().setText(this.subtitlesText.getText())});this.onBoldButtonClick=callback(this,function(){this.scene.getSubtitles().setBold(!this.scene.getSubtitles().isBold());this.updateControls()});this.onItalicButtonClick=callback(this,function(){this.scene.getSubtitles().setItalic(!this.scene.getSubtitles().isItalic());this.updateControls()});this.onUnderlineButtonClick=callback(this,function(){this.scene.getSubtitles().setUnderline(!this.scene.getSubtitles().isUnderline());this.updateControls()});this.onLibButtonClick=callback(this,function(){var lib=theApp.factory.getImageLibrary();lib.getContentWindow().notifyImageSelected.addListener(this.onLibImageSelected,true);lib.center();lib.doModal()});this.onDurationChanged=callback(this,function(sender,duration){this.scene.setDuration(duration);this.notifyDurationChanged.send(this,this.index);this.updateControls()});this.onFadingChanged=callback(this,function(sender,fading){this.scene.setFadingType(fading);this.updateControls()});this.onFontSizeChanged=callback(this,function(sender,size){this.scene.getSubtitles().setSize(size);this.updateControls()});this.onStartPointChanged=callback(this,function(sender,zoom){this.cameraEditor.setStartZoom(zoom);this.updateControls()});this.onEndPointChanged=callback(this,function(sender,zoom){this.cameraEditor.setEndZoom(zoom);this.updateControls()});this.onFileSelected=callback(this,function(sender,path){editor.ui.LoadingMessage.showIcon(this.cameraEditor);sender.upload()});this.onFileUploaded=callback(this,function(sender,info){this.scene.setImage(info.src);this.cameraEditor.setImage(info.src);this.updateControls();editor.ui.LoadingMessage.hideMessage(this.cameraEditor);this.notifySceneEditorChanged.send(this)});this.onUploadError=callback(this,function(sender,info){console.error("File is not uploaded!");console.dir(info);this.scene.setImage("");this.cameraEditor.setImage(null);this.updateControls();editor.ui.LoadingMessage.hideMessage(this.cameraEditor)});this.onLibImageSelected=callback(this,function(sender,source){this.scene.setImage(source);this.cameraEditor.setImage(source);this.updateControls();theApp.factory.getImageLibrary().endModal();this.notifySceneEditorChanged.send(this)});this.onSceneChanged=callback(this,function(sender){});this.onmousedown=function(){this.notifySelect.send(this,this.index)}}}ClassFactory.createPackage("editor.plugins.tribute.ui");ClassFactory.createClass(editor.plugins.tribute.ui,"TributeVideoSoundEditor");with(editor.plugins.tribute.ui){editor.plugins.tribute.ui.TributeVideoSoundEditor.superClass=core.ui.CompositeWindow;editor.plugins.tribute.ui.TributeVideoSoundEditor.constructor=function(){this.sound;this.index;this.closeButton;this.selectButton;this.title;this.duration;this.cicleBox;this.gripper;this.scale;this.notifyDelete=new core.ui.Notification();this.notifyChange=new core.ui.Notification();this.notifySelect=new core.ui.Notification();this.TributeVideoSoundEditor=function(parent){this.CompositeWindow(parent);with(core.ui){this.closeButton=new ImageButton(this);this.closeButton.addStyleName("CloseButton");this.closeButton.setStyle("position","absolute");this.closeButton.setImageList("images/TributeVideoSoundEditor/close.gif");this.closeButton.setToolTip("Close and delete this sound");this.closeButton.oncommand=this.onCloseButtonClick;this.selectButton=new ImageButton(this);this.selectButton.addStyleName("SelectButton");this.selectButton.setStyle("position","absolute");this.selectButton.setImageList("images/TributeVideoSoundEditor/select.gif");this.selectButton.setText("Select music");this.selectButton.setToolTip("Select music");this.selectButton.oncommand=this.onSelectButtonClick;this.gripper=new Gripper(this);this.gripper.setStyle("position","absolute");this.gripper.setResizeWindow(this,undefined,this.closeButton.getY()+this.closeButton.getHeight()+this.gripper.getHeight());this.gripper.setDirection(Gripper.SOUTH);this.gripper.notifyEndResize.addListener(this.onEndResize);this.title=new Marquee(this);this.title.setStyle("position","absolute");this.title.setScrollDelay(200);this.title.stop();this.duration=new Static(this);this.duration.setStyle("position","absolute");this.duration.setToolTip("Sound duration");this.cycle=new CheckBox(this);this.cycle.setStyle("position","absolute");this.cycle.setText("Cycle");this.cycle.setToolTip("Whether the sound should continue loop after finish");this.cycle.onclick=this.onCycleClick;this.scale=new Static(parent);this.scale.setStyleName("DurationScale");this.scale.setStyle("position","absolute");this.updateLayout()}};this.setSound=function(sound,index){this.sound=sound;this.index=index;this.updateControls();this.title.start()};this.getSound=function(){return this.sound};this.setIndex=function(i){this.index=i};this.getIndex=function(){return this.index};this.close=override(this.close,function(){this.scale.close();this.gripper.notifyEndResize.removeListener(this.onEndResize);arguments.callee.prototype.apply(this,[])});this.getY=function(){return 0};this.updateLayout=function(){this.gripper.move(0,this.getClientHeight()-this.gripper.getHeight());this.scale.move(this.scale.getX(),this.getElement().offsetTop);this.scale.resize(this.scale.getWidth(),this.getHeight())};this.updateControls=function(){if(defined(this.sound)){this.title.setText(this.sound.getTitle());this.title.setToolTip(this.sound.getTitle());var min=common.util.DateUtils.getMinutes(this.sound.getDuration());var sec=common.util.DateUtils.getSeconds(this.sound.getDuration());this.duration.setText(min+":"+sec);this.duration.setToolTip("Sound duration: "+this.duration.getText());this.cycle.setChecked(this.sound.isCyclic());this.selectButton.setText(this.sound.hasFile()?"Change music":"Select music")}};this.onCloseButtonClick=callback(this,function(){this.notifyDelete.send(this,this.index)});this.onSelectButtonClick=callback(this,function(){this.notifySelect.send(this,this.index)});this.onEndResize=callback(this,function(){this.notifyChange.send(this,this.index)});this.onCycleClick=callback(this,function(event,target){if(this.cycle!=target){this.sound.setCyclic(this.cycle.isChecked())}})}}ClassFactory.createPackage("editor.plugins.tribute.ui");ClassFactory.createClass(editor.plugins.tribute.ui,"TributeVideoEditor");with(editor.plugins.tribute.ui){editor.plugins.tribute.ui.TributeVideoEditor.superClass=core.ui.ScrollWindow;editor.plugins.tribute.ui.TributeVideoEditor.constructor=function(){this.video;this.scenesPane;this.soundsPane;this.sceneEditors=[];this.soundEditors=[];this.currentSceneEditor;this.currensSoundEditor;this.addSceneButton;this.addSoundButton;this.notifyLoaded=new core.ui.Notification();this.notifyVideoChanged=new core.ui.Notification();this.TributeVideoEditor=function(parent){this.ScrollWindow(parent);with(core.ui){this.setContentWindow(new Window(this));this.scenesPane=new Window(this.getContentWindow());this.scenesPane.setStyleName("ScenesPane");this.scenesPane.setStyle("position","absolute");this.scenesPane.setStyle("overflow","visible");this.soundsPane=new Window(this.getContentWindow());this.soundsPane.setStyleName("SoundsPane");this.soundsPane.setStyle("position","absolute");this.soundsPane.setStyle("overflow","visible");this.createSceneButton();this.createSoundButton();this.updateControls()}};this.setVideo=function(video){if(video!==this.video){this.video=video;if(undefined!==video){this.loadVideo()}}};this.getVideo=function(){return this.video};this.addScene=function(scene){this.video.addScene(scene);this.addSceneButton.close();var e=new TributeVideoSceneEditor(this.scenesPane);e.setScene(scene,this.video.scenes.length-1);e.notifyUp.addListener(this.onMoveSceneUp);e.notifyDown.addListener(this.onMoveSceneDown);e.notifyDelete.addListener(this.onDeleteScene);e.notifySelect.addListener(this.onSelectScene);e.notifyDurationChanged.addListener(this.onSceneDurationChanged);this.sceneEditors.push(e);e.notifySceneEditorChanged.addListener(this.onSceneEditorChanged);this.createSceneButton();this.updateControls();this.updateLayout();return e};this.removeScene=function(i){this.video.removeScene(i);this.sceneEditors[i].close();this.sceneEditors.splice(i,1);if(((this.currentSceneEditor&&(this.currentSceneEditor.constructor===TributeVideoSceneEditor||defined(this.currentSceneEditor.constructor.isSubclassOf)&&this.currentSceneEditor.constructor.isSubclassOf(TributeVideoSceneEditor))))&&(this.currentSceneEditor.getIndex()==i)){delete this.currentSceneEditor}this.updateControls();this.updateLayout()};this.addSound=function(sound){this.video.addSound(sound);this.addSoundButton.close();var e=new TributeVideoSoundEditor(this.soundsPane);e.setSound(sound,this.video.sounds.length-1);e.notifyDelete.addListener(this.onSoundDelete);e.notifySelect.addListener(this.onSoundSelect);e.notifyChange.addListener(this.onSoundChange);this.soundEditors.push(e);this.updateControls();this.updateLayout();this.createSoundButton()};this.removeSound=function(i){this.video.removeSound(i);this.soundEditors[i].close();this.soundEditors.splice(i,1);this.updateControls();this.updateLayout()};this.moveSceneUp=function(i){this.switchScenes(i,i-1);this.updateControls()};this.moveSceneDown=function(i){this.switchScenes(i,i+1);this.updateControls()};this.resetScroll=override(this.reset,function(){arguments.callee.prototype.apply(this,[])});this.reset=function(){while(this.sceneEditors.length>0){this.sceneEditors.pop().close()}while(this.soundEditors.length>0){this.soundEditors.pop().close()}};this.switchScenes=function(i,j){var e1=this.sceneEditors[i];var e2=this.sceneEditors[j];if(!defined(e1)||!defined(e2)){return }var s1=e1.getScene();var s2=e2.getScene();with(editor.plugins.tribute){if(!(s1&&(s1.constructor===Scene||defined(s1.constructor.isSubclassOf)&&s1.constructor.isSubclassOf(Scene)))||!(s2&&(s2.constructor===Scene||defined(s2.constructor.isSubclassOf)&&s2.constructor.isSubclassOf(Scene)))){return }}this.video.scenes[i]=s2;this.video.scenes[j]=s1;e2.setScene(s1,j);e1.setScene(s2,i);if((this.currentSceneEditor&&(this.currentSceneEditor.constructor===TributeVideoSceneEditor||defined(this.currentSceneEditor.constructor.isSubclassOf)&&this.currentSceneEditor.constructor.isSubclassOf(TributeVideoSceneEditor)))){if(this.currentSceneEditor.getIndex()==i){this.highlightScene(j)}else{if(this.currentSceneEditor.getIndex()==j){this.highlightScene(i)}}}};this.highlightScene=function(i){var editor=this.sceneEditors[i];if(editor!=this.currentSceneEditor){if((this.currentSceneEditor&&(this.currentSceneEditor.constructor===TributeVideoSceneEditor||defined(this.currentSceneEditor.constructor.isSubclassOf)&&this.currentSceneEditor.constructor.isSubclassOf(TributeVideoSceneEditor)))){this.currentSceneEditor.removeStyleName(this.currentSceneEditor.getStyleName()+"-highlight")}editor.addStyleName(editor.getStyleName()+"-highlight");this.currentSceneEditor=editor}};this.updateControls=function(isLoadingVideo){var isLoadingVideo=defined(isLoadingVideo)?isLoadingVideo:false;this.updateSoundEditors(isLoadingVideo);if(defined(this.video)){this.updateScenes();this.updateSounds()}this.updateLayout()};this.updateScenes=function(){for(var i=0;i0)?true:false);this.sceneEditors[i].downButton.setEnabled((i=1){p=this.sceneEditors[j-1].getScene().getPeriod()}else{p=0}this.sceneEditors[j].getScene().setPeriod(p)}else{if(isLoadingVideo){isLoadingVideo=false}}this.periodDurations[p]+=this.sceneEditors[j].getScene().getDuration()}for(var j=0;j0){M++}}this.coeff=M/N;return isLoadingVideo};this.updateSoundData=function(isLoadingVideo){isLoadingVideo=this.updateCoefficient(isLoadingVideo);var coeff=this.coeff;if(coeff==null){return }var delta=0;var k=0;for(var i=0;i0&&!isLoadingVideo){duration=0;if(coeff>=1){while(coeff>=1){duration+=delta;if(delta==0){duration+=this.periodDurations[k];if(this.periodDurations[k]>0){coeff=coeff-1}k++}delta=0;if(coeff<1){duration+=this.periodDurations[k]*coeff;if(coeff>0){delta=this.periodDurations[k]*Math.abs(1-coeff)}}}}else{for(var k=0;k