/*
	Copyright (c) 2004-2006, The Dojo Foundation
	All Rights Reserved.

	Licensed under the Academic Free License version 2.1 or above OR the
	modified BSD license. For more information on Dojo licensing, see:

		http://dojotoolkit.org/community/licensing.shtml
*/

dojo.provide("custom.layers.cu");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.declare");
dojo.provide("dojo.dnd.DragAndDrop");
dojo.declare("dojo.dnd.DragSource",null,{type:"",onDragEnd:function(_1){
},onDragStart:function(_2){
},onSelected:function(_3){
},unregister:function(){
dojo.dnd.dragManager.unregisterDragSource(this);
},reregister:function(){
dojo.dnd.dragManager.registerDragSource(this);
}});
dojo.declare("dojo.dnd.DragObject",null,{type:"",register:function(){
var dm=dojo.dnd.dragManager;
if(dm["registerDragObject"]){
dm.registerDragObject(this);
}
},onDragStart:function(_5){
},onDragMove:function(_6){
},onDragOver:function(_7){
},onDragOut:function(_8){
},onDragEnd:function(_9){
},onDragLeave:dojo.lang.forward("onDragOut"),onDragEnter:dojo.lang.forward("onDragOver"),ondragout:dojo.lang.forward("onDragOut"),ondragover:dojo.lang.forward("onDragOver")});
dojo.declare("dojo.dnd.DropTarget",null,{acceptsType:function(_a){
if(!dojo.lang.inArray(this.acceptedTypes,"*")){
if(!dojo.lang.inArray(this.acceptedTypes,_a)){
return false;
}
}
return true;
},accepts:function(_b){
if(!dojo.lang.inArray(this.acceptedTypes,"*")){
for(var i=0;i<_b.length;i++){
if(!dojo.lang.inArray(this.acceptedTypes,_b[i].type)){
return false;
}
}
}
return true;
},unregister:function(){
dojo.dnd.dragManager.unregisterDropTarget(this);
},onDragOver:function(_d){
},onDragOut:function(_e){
},onDragMove:function(_f){
},onDropStart:function(evt){
},onDrop:function(evt){
},onDropEnd:function(){
}},function(){
this.acceptedTypes=[];
});
dojo.dnd.DragEvent=function(){
this.dragSource=null;
this.dragObject=null;
this.target=null;
this.eventStatus="success";
};
dojo.declare("dojo.dnd.DragManager",null,{selectedSources:[],dragObjects:[],dragSources:[],registerDragSource:function(_12){
},dropTargets:[],registerDropTarget:function(_13){
},lastDragTarget:null,currentDragTarget:null,onKeyDown:function(){
},onMouseOut:function(){
},onMouseMove:function(){
},onMouseUp:function(){
}});
dojo.provide("dojo.dnd.HtmlDragManager");
dojo.require("dojo.event.*");
dojo.require("dojo.lang.array");
dojo.require("dojo.html.common");
dojo.require("dojo.html.layout");
dojo.declare("dojo.dnd.HtmlDragManager",dojo.dnd.DragManager,{disabled:false,nestedTargets:false,mouseDownTimer:null,dsCounter:0,dsPrefix:"dojoDragSource",dropTargetDimensions:[],currentDropTarget:null,previousDropTarget:null,_dragTriggered:false,selectedSources:[],dragObjects:[],dragSources:[],dropTargets:[],currentX:null,currentY:null,lastX:null,lastY:null,mouseDownX:null,mouseDownY:null,threshold:7,dropAcceptable:false,cancelEvent:function(e){
e.stopPropagation();
e.preventDefault();
},registerDragSource:function(ds){
if(ds["domNode"]){
var dp=this.dsPrefix;
var _17=dp+"Idx_"+(this.dsCounter++);
ds.dragSourceId=_17;
this.dragSources[_17]=ds;
ds.domNode.setAttribute(dp,_17);
if(dojo.render.html.ie){
dojo.event.browser.addListener(ds.domNode,"ondragstart",this.cancelEvent);
}
}
},unregisterDragSource:function(ds){
if(ds["domNode"]){
var dp=this.dsPrefix;
var _1a=ds.dragSourceId;
delete ds.dragSourceId;
delete this.dragSources[_1a];
ds.domNode.setAttribute(dp,null);
if(dojo.render.html.ie){
dojo.event.browser.removeListener(ds.domNode,"ondragstart",this.cancelEvent);
}
}
},registerDropTarget:function(dt){
this.dropTargets.push(dt);
},unregisterDropTarget:function(dt){
var _1d=dojo.lang.find(this.dropTargets,dt,true);
if(_1d>=0){
this.dropTargets.splice(_1d,1);
}
},getDragSource:function(e){
var tn=e.target;
if(tn===dojo.body()){
return;
}
var ta=dojo.html.getAttribute(tn,this.dsPrefix);
while((!ta)&&(tn)){
tn=tn.parentNode;
if((!tn)||(tn===dojo.body())){
return;
}
ta=dojo.html.getAttribute(tn,this.dsPrefix);
}
return this.dragSources[ta];
},onKeyDown:function(e){
},onMouseDown:function(e){
if(this.disabled){
return;
}
if(dojo.render.html.ie){
if(e.button!=1){
return;
}
}else{
if(e.which!=1){
return;
}
}
var _23=e.target.nodeType==dojo.html.TEXT_NODE?e.target.parentNode:e.target;
if(dojo.html.isTag(_23,"button","textarea","input","select","option")){
return;
}
var ds=this.getDragSource(e);
if(!ds){
return;
}
if(!dojo.lang.inArray(this.selectedSources,ds)){
this.selectedSources.push(ds);
ds.onSelected();
}
this.mouseDownX=e.pageX;
this.mouseDownY=e.pageY;
e.preventDefault();
dojo.event.connect(document,"onmousemove",this,"onMouseMove");
},onMouseUp:function(e,_26){
if(this.selectedSources.length==0){
return;
}
this.mouseDownX=null;
this.mouseDownY=null;
this._dragTriggered=false;
e.dragSource=this.dragSource;
if((!e.shiftKey)&&(!e.ctrlKey)){
if(this.currentDropTarget){
this.currentDropTarget.onDropStart();
}
dojo.lang.forEach(this.dragObjects,function(_27){
var ret=null;
if(!_27){
return;
}
if(this.currentDropTarget){
e.dragObject=_27;
var ce=this.currentDropTarget.domNode.childNodes;
if(ce.length>0){
e.dropTarget=ce[0];
while(e.dropTarget==_27.domNode){
e.dropTarget=e.dropTarget.nextSibling;
}
}else{
e.dropTarget=this.currentDropTarget.domNode;
}
if(this.dropAcceptable){
ret=this.currentDropTarget.onDrop(e);
}else{
this.currentDropTarget.onDragOut(e);
}
}
e.dragStatus=this.dropAcceptable&&ret?"dropSuccess":"dropFailure";
dojo.lang.delayThese([function(){
try{
_27.dragSource.onDragEnd(e);
}
catch(err){
var _2a={};
for(var i in e){
if(i=="type"){
_2a.type="mouseup";
continue;
}
_2a[i]=e[i];
}
_27.dragSource.onDragEnd(_2a);
}
},function(){
_27.onDragEnd(e);
}]);
},this);
this.selectedSources=[];
this.dragObjects=[];
this.dragSource=null;
if(this.currentDropTarget){
this.currentDropTarget.onDropEnd();
}
}else{
}
dojo.event.disconnect(document,"onmousemove",this,"onMouseMove");
this.currentDropTarget=null;
},onScroll:function(){
for(var i=0;i<this.dragObjects.length;i++){
if(this.dragObjects[i].updateDragOffset){
this.dragObjects[i].updateDragOffset();
}
}
if(this.dragObjects.length){
this.cacheTargetLocations();
}
},_dragStartDistance:function(x,y){
if((!this.mouseDownX)||(!this.mouseDownX)){
return;
}
var dx=Math.abs(x-this.mouseDownX);
var dx2=dx*dx;
var dy=Math.abs(y-this.mouseDownY);
var dy2=dy*dy;
return parseInt(Math.sqrt(dx2+dy2),10);
},cacheTargetLocations:function(){
dojo.profile.start("cacheTargetLocations");
this.dropTargetDimensions=[];
dojo.lang.forEach(this.dropTargets,function(_33){
var tn=_33.domNode;
if(!tn||!_33.accepts([this.dragSource])){
return;
}
var abs=dojo.html.getAbsolutePosition(tn,true);
var bb=dojo.html.getBorderBox(tn);
this.dropTargetDimensions.push([[abs.x,abs.y],[abs.x+bb.width,abs.y+bb.height],_33]);
},this);
dojo.profile.end("cacheTargetLocations");
},onMouseMove:function(e){
if((dojo.render.html.ie)&&(e.button!=1)){
this.currentDropTarget=null;
this.onMouseUp(e,true);
return;
}
if((this.selectedSources.length)&&(!this.dragObjects.length)){
var dx;
var dy;
if(!this._dragTriggered){
this._dragTriggered=(this._dragStartDistance(e.pageX,e.pageY)>this.threshold);
if(!this._dragTriggered){
return;
}
dx=e.pageX-this.mouseDownX;
dy=e.pageY-this.mouseDownY;
}
this.dragSource=this.selectedSources[0];
dojo.lang.forEach(this.selectedSources,function(_3a){
if(!_3a){
return;
}
var tdo=_3a.onDragStart(e);
if(tdo){
tdo.onDragStart(e);
tdo.dragOffset.y+=dy;
tdo.dragOffset.x+=dx;
tdo.dragSource=_3a;
this.dragObjects.push(tdo);
}
},this);
this.previousDropTarget=null;
this.cacheTargetLocations();
}
dojo.lang.forEach(this.dragObjects,function(_3c){
if(_3c){
_3c.onDragMove(e);
}
});
if(this.currentDropTarget){
var c=dojo.html.toCoordinateObject(this.currentDropTarget.domNode,true);
var dtp=[[c.x,c.y],[c.x+c.width,c.y+c.height]];
}
if((!this.nestedTargets)&&(dtp)&&(this.isInsideBox(e,dtp))){
if(this.dropAcceptable){
this.currentDropTarget.onDragMove(e,this.dragObjects);
}
}else{
var _3f=this.findBestTarget(e);
if(_3f.target===null){
if(this.currentDropTarget){
this.currentDropTarget.onDragOut(e);
this.previousDropTarget=this.currentDropTarget;
this.currentDropTarget=null;
}
this.dropAcceptable=false;
return;
}
if(this.currentDropTarget!==_3f.target){
if(this.currentDropTarget){
this.previousDropTarget=this.currentDropTarget;
this.currentDropTarget.onDragOut(e);
}
this.currentDropTarget=_3f.target;
e.dragObjects=this.dragObjects;
this.dropAcceptable=this.currentDropTarget.onDragOver(e);
}else{
if(this.dropAcceptable){
this.currentDropTarget.onDragMove(e,this.dragObjects);
}
}
}
},findBestTarget:function(e){
var _41=this;
var _42=new Object();
_42.target=null;
_42.points=null;
dojo.lang.every(this.dropTargetDimensions,function(_43){
if(!_41.isInsideBox(e,_43)){
return true;
}
_42.target=_43[2];
_42.points=_43;
return Boolean(_41.nestedTargets);
});
return _42;
},isInsideBox:function(e,_45){
if((e.pageX>_45[0][0])&&(e.pageX<_45[1][0])&&(e.pageY>_45[0][1])&&(e.pageY<_45[1][1])){
return true;
}
return false;
},onMouseOver:function(e){
},onMouseOut:function(e){
}});
dojo.dnd.dragManager=new dojo.dnd.HtmlDragManager();
(function(){
var d=document;
var dm=dojo.dnd.dragManager;
dojo.event.connect(d,"onkeydown",dm,"onKeyDown");
dojo.event.connect(d,"onmouseover",dm,"onMouseOver");
dojo.event.connect(d,"onmouseout",dm,"onMouseOut");
dojo.event.connect(d,"onmousedown",dm,"onMouseDown");
dojo.event.connect(d,"onmouseup",dm,"onMouseUp");
dojo.event.connect(window,"onscroll",dm,"onScroll");
})();
dojo.kwCompoundRequire({common:["dojo.html.common","dojo.html.style"]});
dojo.provide("dojo.html.*");
dojo.provide("dojo.dnd.HtmlDragAndDrop");
dojo.require("dojo.html.display");
dojo.require("dojo.html.util");
dojo.require("dojo.html.selection");
dojo.require("dojo.html.iframe");
dojo.require("dojo.lang.extras");
dojo.require("dojo.lfx.*");
dojo.require("dojo.event.*");
dojo.declare("dojo.dnd.HtmlDragSource",dojo.dnd.DragSource,{dragClass:"",onDragStart:function(){
var _4a=new dojo.dnd.HtmlDragObject(this.dragObject,this.type);
if(this.dragClass){
_4a.dragClass=this.dragClass;
}
if(this.constrainToContainer){
_4a.constrainTo(this.constrainingContainer||this.domNode.parentNode);
}
return _4a;
},setDragHandle:function(_4b){
_4b=dojo.byId(_4b);
dojo.dnd.dragManager.unregisterDragSource(this);
this.domNode=_4b;
dojo.dnd.dragManager.registerDragSource(this);
},setDragTarget:function(_4c){
this.dragObject=_4c;
},constrainTo:function(_4d){
this.constrainToContainer=true;
if(_4d){
this.constrainingContainer=_4d;
}
},onSelected:function(){
for(var i=0;i<this.dragObjects.length;i++){
dojo.dnd.dragManager.selectedSources.push(new dojo.dnd.HtmlDragSource(this.dragObjects[i]));
}
},addDragObjects:function(el){
for(var i=0;i<arguments.length;i++){
this.dragObjects.push(dojo.byId(arguments[i]));
}
}},function(_51,_52){
_51=dojo.byId(_51);
this.dragObjects=[];
this.constrainToContainer=false;
if(_51){
this.domNode=_51;
this.dragObject=_51;
this.type=(_52)||(this.domNode.nodeName.toLowerCase());
dojo.dnd.DragSource.prototype.reregister.call(this);
}
});
dojo.declare("dojo.dnd.HtmlDragObject",dojo.dnd.DragObject,{dragClass:"",opacity:0.5,createIframe:true,disableX:false,disableY:false,createDragNode:function(){
var _53=this.domNode.cloneNode(true);
if(this.dragClass){
dojo.html.addClass(_53,this.dragClass);
}
if(this.opacity<1){
dojo.html.setOpacity(_53,this.opacity);
}
var ltn=_53.tagName.toLowerCase();
var _55=(ltn=="tr");
if((_55)||(ltn=="tbody")){
var doc=this.domNode.ownerDocument;
var _57=doc.createElement("table");
if(_55){
var _58=doc.createElement("tbody");
_57.appendChild(_58);
_58.appendChild(_53);
}else{
_57.appendChild(_53);
}
var _59=((_55)?this.domNode:this.domNode.firstChild);
var _5a=((_55)?_53:_53.firstChild);
var _5b=_59.childNodes;
var _5c=_5a.childNodes;
for(var i=0;i<_5b.length;i++){
if((_5c[i])&&(_5c[i].style)){
_5c[i].style.width=dojo.html.getContentBox(_5b[i]).width+"px";
}
}
_53=_57;
}
if((dojo.render.html.ie55||dojo.render.html.ie60)&&this.createIframe){
with(_53.style){
top="0px";
left="0px";
}
var _5e=document.createElement("div");
_5e.appendChild(_53);
this.bgIframe=new dojo.html.BackgroundIframe(_5e);
_5e.appendChild(this.bgIframe.iframe);
_53=_5e;
}
_53.style.zIndex=999;
return _53;
},onDragStart:function(e){
dojo.html.clearSelection();
this.scrollOffset=dojo.html.getScroll().offset;
this.dragStartPosition=dojo.html.getAbsolutePosition(this.domNode,true);
this.dragOffset={y:this.dragStartPosition.y-e.pageY,x:this.dragStartPosition.x-e.pageX};
this.dragClone=this.createDragNode();
this.containingBlockPosition=this.domNode.offsetParent?dojo.html.getAbsolutePosition(this.domNode.offsetParent,true):{x:0,y:0};
if(this.constrainToContainer){
this.constraints=this.getConstraints();
}
with(this.dragClone.style){
position="absolute";
top=this.dragOffset.y+e.pageY+"px";
left=this.dragOffset.x+e.pageX+"px";
}
dojo.body().appendChild(this.dragClone);
dojo.event.topic.publish("dragStart",{source:this});
},getConstraints:function(){
if(this.constrainingContainer.nodeName.toLowerCase()=="body"){
var _60=dojo.html.getViewport();
var _61=_60.width;
var _62=_60.height;
var _63=dojo.html.getScroll().offset;
var x=_63.x;
var y=_63.y;
}else{
var _66=dojo.html.getContentBox(this.constrainingContainer);
_61=_66.width;
_62=_66.height;
x=this.containingBlockPosition.x+dojo.html.getPixelValue(this.constrainingContainer,"padding-left",true)+dojo.html.getBorderExtent(this.constrainingContainer,"left");
y=this.containingBlockPosition.y+dojo.html.getPixelValue(this.constrainingContainer,"padding-top",true)+dojo.html.getBorderExtent(this.constrainingContainer,"top");
}
var mb=dojo.html.getMarginBox(this.domNode);
return {minX:x,minY:y,maxX:x+_61-mb.width,maxY:y+_62-mb.height};
},updateDragOffset:function(){
var _68=dojo.html.getScroll().offset;
if(_68.y!=this.scrollOffset.y){
var _69=_68.y-this.scrollOffset.y;
this.dragOffset.y+=_69;
this.scrollOffset.y=_68.y;
}
if(_68.x!=this.scrollOffset.x){
var _69=_68.x-this.scrollOffset.x;
this.dragOffset.x+=_69;
this.scrollOffset.x=_68.x;
}
},onDragMove:function(e){
this.updateDragOffset();
var x=this.dragOffset.x+e.pageX;
var y=this.dragOffset.y+e.pageY;
if(this.constrainToContainer){
if(x<this.constraints.minX){
x=this.constraints.minX;
}
if(y<this.constraints.minY){
y=this.constraints.minY;
}
if(x>this.constraints.maxX){
x=this.constraints.maxX;
}
if(y>this.constraints.maxY){
y=this.constraints.maxY;
}
}
this.setAbsolutePosition(x,y);
dojo.event.topic.publish("dragMove",{source:this});
},setAbsolutePosition:function(x,y){
if(!this.disableY){
this.dragClone.style.top=y+"px";
}
if(!this.disableX){
this.dragClone.style.left=x+"px";
}
},onDragEnd:function(e){
switch(e.dragStatus){
case "dropSuccess":
dojo.html.removeNode(this.dragClone);
this.dragClone=null;
break;
case "dropFailure":
var _70=dojo.html.getAbsolutePosition(this.dragClone,true);
var _71={left:this.dragStartPosition.x+1,top:this.dragStartPosition.y+1};
var _72=dojo.lfx.slideTo(this.dragClone,_71,300);
var _73=this;
dojo.event.connect(_72,"onEnd",function(e){
dojo.html.removeNode(_73.dragClone);
_73.dragClone=null;
});
_72.play();
break;
}
dojo.event.topic.publish("dragEnd",{source:this});
},constrainTo:function(_75){
this.constrainToContainer=true;
if(_75){
this.constrainingContainer=_75;
}else{
this.constrainingContainer=this.domNode.parentNode;
}
}},function(_76,_77){
this.domNode=dojo.byId(_76);
this.type=_77;
this.constrainToContainer=false;
this.dragSource=null;
dojo.dnd.DragObject.prototype.register.call(this);
});
dojo.declare("dojo.dnd.HtmlDropTarget",dojo.dnd.DropTarget,{vertical:false,onDragOver:function(e){
if(!this.accepts(e.dragObjects)){
return false;
}
this.childBoxes=[];
for(var i=0,_7a;i<this.domNode.childNodes.length;i++){
_7a=this.domNode.childNodes[i];
if(_7a.nodeType!=dojo.html.ELEMENT_NODE){
continue;
}
var pos=dojo.html.getAbsolutePosition(_7a,true);
var _7c=dojo.html.getBorderBox(_7a);
this.childBoxes.push({top:pos.y,bottom:pos.y+_7c.height,left:pos.x,right:pos.x+_7c.width,height:_7c.height,width:_7c.width,node:_7a});
}
return true;
},_getNodeUnderMouse:function(e){
for(var i=0,_7f;i<this.childBoxes.length;i++){
with(this.childBoxes[i]){
if(e.pageX>=left&&e.pageX<=right&&e.pageY>=top&&e.pageY<=bottom){
return i;
}
}
}
return -1;
},createDropIndicator:function(){
this.dropIndicator=document.createElement("div");
with(this.dropIndicator.style){
position="absolute";
zIndex=999;
if(this.vertical){
borderLeftWidth="1px";
borderLeftColor="black";
borderLeftStyle="solid";
height=dojo.html.getBorderBox(this.domNode).height+"px";
top=dojo.html.getAbsolutePosition(this.domNode,true).y+"px";
}else{
borderTopWidth="1px";
borderTopColor="black";
borderTopStyle="solid";
width=dojo.html.getBorderBox(this.domNode).width+"px";
left=dojo.html.getAbsolutePosition(this.domNode,true).x+"px";
}
}
},onDragMove:function(e,_81){
var i=this._getNodeUnderMouse(e);
if(!this.dropIndicator){
this.createDropIndicator();
}
var _83=this.vertical?dojo.html.gravity.WEST:dojo.html.gravity.NORTH;
var _84=false;
if(i<0){
if(this.childBoxes.length){
var _85=(dojo.html.gravity(this.childBoxes[0].node,e)&_83);
if(_85){
_84=true;
}
}else{
var _85=true;
}
}else{
var _86=this.childBoxes[i];
var _85=(dojo.html.gravity(_86.node,e)&_83);
if(_86.node===_81[0].dragSource.domNode){
_84=true;
}else{
var _87=_85?(i>0?this.childBoxes[i-1]:_86):(i<this.childBoxes.length-1?this.childBoxes[i+1]:_86);
if(_87.node===_81[0].dragSource.domNode){
_84=true;
}
}
}
if(_84){
this.dropIndicator.style.display="none";
return;
}else{
this.dropIndicator.style.display="";
}
this.placeIndicator(e,_81,i,_85);
if(!dojo.html.hasParent(this.dropIndicator)){
dojo.body().appendChild(this.dropIndicator);
}
},placeIndicator:function(e,_89,_8a,_8b){
var _8c=this.vertical?"left":"top";
var _8d;
if(_8a<0){
if(this.childBoxes.length){
_8d=_8b?this.childBoxes[0]:this.childBoxes[this.childBoxes.length-1];
}else{
this.dropIndicator.style[_8c]=dojo.html.getAbsolutePosition(this.domNode,true)[this.vertical?"x":"y"]+"px";
}
}else{
_8d=this.childBoxes[_8a];
}
if(_8d){
this.dropIndicator.style[_8c]=(_8b?_8d[_8c]:_8d[this.vertical?"right":"bottom"])+"px";
if(this.vertical){
this.dropIndicator.style.height=_8d.height+"px";
this.dropIndicator.style.top=_8d.top+"px";
}else{
this.dropIndicator.style.width=_8d.width+"px";
this.dropIndicator.style.left=_8d.left+"px";
}
}
},onDragOut:function(e){
if(this.dropIndicator){
dojo.html.removeNode(this.dropIndicator);
delete this.dropIndicator;
}
},onDrop:function(e){
this.onDragOut(e);
var i=this._getNodeUnderMouse(e);
var _91=this.vertical?dojo.html.gravity.WEST:dojo.html.gravity.NORTH;
if(i<0){
if(this.childBoxes.length){
if(dojo.html.gravity(this.childBoxes[0].node,e)&_91){
return this.insert(e,this.childBoxes[0].node,"before");
}else{
return this.insert(e,this.childBoxes[this.childBoxes.length-1].node,"after");
}
}
return this.insert(e,this.domNode,"append");
}
var _92=this.childBoxes[i];
if(dojo.html.gravity(_92.node,e)&_91){
return this.insert(e,_92.node,"before");
}else{
return this.insert(e,_92.node,"after");
}
},insert:function(e,_94,_95){
var _96=e.dragObject.domNode;
if(_95=="before"){
return dojo.html.insertBefore(_96,_94);
}else{
if(_95=="after"){
return dojo.html.insertAfter(_96,_94);
}else{
if(_95=="append"){
_94.appendChild(_96);
return true;
}
}
}
return false;
}},function(_97,_98){
if(arguments.length==0){
return;
}
this.domNode=dojo.byId(_97);
dojo.dnd.DropTarget.call(this);
if(_98&&dojo.lang.isString(_98)){
_98=[_98];
}
this.acceptedTypes=_98||[];
dojo.dnd.dragManager.registerDropTarget(this);
});
dojo.provide("dojo.widget.SplitContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.html.style");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.selection");
dojo.require("dojo.io.cookie");
dojo.widget.defineWidget("dojo.widget.SplitContainer",dojo.widget.HtmlWidget,function(){
this.sizers=[];
},{isContainer:true,activeSizing:false,sizerWidth:15,orientation:"horizontal",persist:true,postMixInProperties:function(){
dojo.widget.SplitContainer.superclass.postMixInProperties.apply(this,arguments);
this.isHorizontal=(this.orientation=="horizontal");
},fillInTemplate:function(){
dojo.widget.SplitContainer.superclass.fillInTemplate.apply(this,arguments);
dojo.html.addClass(this.domNode,"dojoSplitContainer");
if(dojo.render.html.moz){
this.domNode.style.overflow="-moz-scrollbars-none";
}
var _99=dojo.html.getContentBox(this.domNode);
this.paneWidth=_99.width;
this.paneHeight=_99.height;
},onResized:function(e){
var _9b=dojo.html.getContentBox(this.domNode);
if(_9b.width>0||_9b.height>0){
this.paneWidth=_9b.width;
this.paneHeight=_9b.height;
this._layoutPanels();
}
},postCreate:function(_9c,_9d,_9e){
dojo.widget.SplitContainer.superclass.postCreate.apply(this,arguments);
for(var i=0;i<this.children.length;i++){
with(this.children[i].domNode.style){
position=(i==0)?"relative":"absolute";
}
dojo.html.addClass(this.children[i].domNode,"dojoSplitPane");
if(i==this.children.length-1){
break;
}
this._addSizer();
}
if(typeof this.sizerWidth=="object"){
try{
this.sizerWidth=parseInt(this.sizerWidth.toString());
}
catch(e){
this.sizerWidth=15;
}
}
this.virtualSizer=document.createElement("div");
this.virtualSizer.style.position="absolute";
this.virtualSizer.style.display="none";
this.virtualSizer.style.zIndex=10;
this.virtualSizer.className=this.isHorizontal?"dojoSplitContainerVirtualSizerH":"dojoSplitContainerVirtualSizerV";
this.domNode.appendChild(this.virtualSizer);
dojo.html.disableSelection(this.virtualSizer);
if(this.persist){
this._restoreState();
}
this.resizeSoon();
},_injectChild:function(_a0){
with(_a0.domNode.style){
position=(this.children.length>0)?"absolute":"relative";
}
dojo.html.addClass(_a0.domNode,"dojoSplitPane");
},_addSizer:function(){
var i=this.sizers.length;
this.sizers[i]=document.createElement("div");
this.sizers[i].style.position="absolute";
this.sizers[i].className=this.isHorizontal?"dojoSplitContainerSizerH":"dojoSplitContainerSizerV";
var _a2=this;
var _a3=(function(){
var _a4=i;
return function(e){
_a2.beginSizing(e,_a4);
};
})();
dojo.event.connect(this.sizers[i],"onmousedown",_a3);
this.domNode.appendChild(this.sizers[i]);
dojo.html.disableSelection(this.sizers[i]);
},removeChild:function(_a6){
if(this.sizers.length>0){
for(var x=0;x<this.children.length;x++){
if(this.children[x]===_a6){
var i=this.sizers.length-1;
this.domNode.removeChild(this.sizers[i]);
this.sizers.length=i;
break;
}
}
}
dojo.widget.SplitContainer.superclass.removeChild.call(this,_a6,arguments);
this.onResized();
},addChild:function(_a9){
dojo.widget.SplitContainer.superclass.addChild.apply(this,arguments);
this._injectChild(_a9);
if(this.children.length>1){
this._addSizer();
}
this._layoutPanels();
},_layoutPanels:function(){
if(this.children.length==0){
return;
}
var _aa=this.isHorizontal?this.paneWidth:this.paneHeight;
if(this.children.length>1){
_aa-=this.sizerWidth*(this.children.length-1);
}
var _ab=0;
for(var i=0;i<this.children.length;i++){
if(isNaN(this.children[i].sizeShare)){
this.children[i].sizeShare=50;
}
_ab+=this.children[i].sizeShare;
}
var _ad=_aa/_ab;
var _ae=0;
for(var i=0;i<this.children.length-1;i++){
dojo.debug(i+"="+this.children[i].sizeShare);
var _af=Math.round(_ad*this.children[i].sizeShare);
this.children[i].sizeActual=_af;
if(isNaN(this.children[i].sizeActual)){
this.children[i].sizeShare=50;
}
_ae+=_af;
}
this.children[this.children.length-1].sizeActual=_aa-_ae;
if(isNaN(this.children[this.children.length-1].sizeActual)){
this.children[this.children.length-1].sizeShare=50;
}
this._checkSizes();
var pos=0;
var _af=this.children[0].sizeActual;
this._movePanel(this.children[0],pos,_af);
this.children[0].position=pos;
pos+=_af;
for(var i=1;i<this.children.length;i++){
this._moveSlider(this.sizers[i-1],pos,this.sizerWidth);
this.sizers[i-1].position=pos;
pos+=this.sizerWidth;
_af=this.children[i].sizeActual;
this._movePanel(this.children[i],pos,_af);
this.children[i].position=pos;
pos+=_af;
}
this.onSizeChanged();
},_movePanel:function(_b1,pos,_b3){
if(this.isHorizontal){
_b1.domNode.style.left=pos+"px";
_b1.domNode.style.top=0;
dojo.html.setContentBox(_b1.domNode,{width:_b3,height:this.paneHeight});
_b1.onResized();
}else{
_b1.domNode.style.left=0;
_b1.domNode.style.top=pos+"px";
dojo.html.setContentBox(_b1.domNode,{width:this.paneWidth,height:_b3});
_b1.onResized();
}
},_moveSlider:function(_b4,pos,_b6){
if(this.isHorizontal){
_b4.style.left=pos+"px";
_b4.style.top=0;
dojo.html.setMarginBox(_b4,{width:_b6,height:this.paneHeight});
}else{
_b4.style.left=0;
_b4.style.top=pos+"px";
dojo.html.setMarginBox(_b4,{width:this.paneWidth,height:_b6});
}
dojo.debug("slider="+pos);
},_growPane:function(_b7,_b8){
if(_b7>0){
if(_b8.sizeActual>_b8.sizeMin){
if((_b8.sizeActual-_b8.sizeMin)>_b7){
_b8.sizeActual=_b8.sizeActual-_b7;
_b7=0;
}else{
_b7-=_b8.sizeActual-_b8.sizeMin;
_b8.sizeActual=_b8.sizeMin;
}
}
}
return _b7;
},_checkSizes:function(){
var _b9=0;
var _ba=0;
for(var i=0;i<this.children.length;i++){
_ba+=this.children[i].sizeActual;
_b9+=this.children[i].sizeMin;
}
if(_b9<=_ba){
var _bc=0;
for(var i=0;i<this.children.length;i++){
if(this.children[i].sizeActual<this.children[i].sizeMin){
_bc+=this.children[i].sizeMin-this.children[i].sizeActual;
this.children[i].sizeActual=this.children[i].sizeMin;
}
}
if(_bc>0){
if(this.isDraggingLeft){
for(var i=this.children.length-1;i>=0;i--){
_bc=this._growPane(_bc,this.children[i]);
}
}else{
for(var i=0;i<this.children.length;i++){
_bc=this._growPane(_bc,this.children[i]);
}
}
}
}else{
for(var i=0;i<this.children.length;i++){
this.children[i].sizeActual=Math.round(_ba*(this.children[i].sizeMin/_b9));
}
}
},beginSizing:function(e,i){
this.paneBefore=this.children[i];
this.paneAfter=this.children[i+1];
this.isSizing=true;
this.sizingSplitter=this.sizers[i];
this.originPos=dojo.html.getAbsolutePosition(this.children[0].domNode,true,dojo.html.boxSizing.MARGIN_BOX);
if(this.isHorizontal){
var _bf=(e.layerX?e.layerX:e.offsetX);
var _c0=e.pageX;
this.originPos=this.originPos.x;
}else{
var _bf=(e.layerY?e.layerY:e.offsetY);
var _c0=e.pageY;
this.originPos=this.originPos.y;
}
this.startPoint=this.lastPoint=_c0;
this.screenToClientOffset=_c0-_bf;
this.dragOffset=this.lastPoint-this.paneBefore.sizeActual-this.originPos-this.paneBefore.position;
if(!this.activeSizing){
this._showSizingLine();
}
dojo.event.connect(dojo.body(),"onmousemove",this,"changeSizing");
dojo.event.connect(dojo.body(),"onmouseup",this,"endSizing");
dojo.event.topic.publish("drag.start",{object:this});
dojo.event.browser.stopEvent(e);
},changeSizing:function(e){
this.lastPoint=this.isHorizontal?e.pageX:e.pageY;
if(this.activeSizing){
this.movePoint();
this._updateSize();
}else{
this.movePoint();
this._moveSizingLine();
}
dojo.event.browser.stopEvent(e);
},onSizeChanged:function(){
},endSizing:function(e){
if(!this.activeSizing){
this._hideSizingLine();
}
this._updateSize();
this.isSizing=false;
dojo.event.disconnect(dojo.body(),"onmousemove",this,"changeSizing");
dojo.event.disconnect(dojo.body(),"onmouseup",this,"endSizing");
if(this.persist){
this._saveState(this);
}
dojo.event.browser.stopEvent(e);
},movePoint:function(){
var p=this.lastPoint-this.screenToClientOffset;
var a=p-this.dragOffset;
a=this.legaliseSplitPoint(a);
p=a+this.dragOffset;
this.lastPoint=p+this.screenToClientOffset;
},legaliseSplitPoint:function(a){
a+=this.sizingSplitter.position;
this.isDraggingLeft=(a>0)?true:false;
if(!this.activeSizing){
if(a<this.paneBefore.position+this.paneBefore.sizeMin){
a=this.paneBefore.position+this.paneBefore.sizeMin;
}
if(a>this.paneAfter.position+(this.paneAfter.sizeActual-(this.sizerWidth+this.paneAfter.sizeMin))){
a=this.paneAfter.position+(this.paneAfter.sizeActual-(this.sizerWidth+this.paneAfter.sizeMin));
}
}
a-=this.sizingSplitter.position;
this._checkSizes();
return a;
},_updateSize:function(){
var pos=this.lastPoint-this.dragOffset-this.originPos;
var _c7=this.paneBefore.position;
var _c8=this.paneAfter.position+this.paneAfter.sizeActual;
this.paneBefore.sizeActual=pos-_c7;
this.paneAfter.position=pos+this.sizerWidth;
this.paneAfter.sizeActual=_c8-this.paneAfter.position;
for(var i=0;i<this.children.length;i++){
this.children[i].sizeShare=this.children[i].sizeActual;
}
this._layoutPanels();
},_showSizingLine:function(){
this._moveSizingLine();
if(this.isHorizontal){
dojo.html.setMarginBox(this.virtualSizer,{width:this.sizerWidth,height:this.paneHeight});
}else{
dojo.html.setMarginBox(this.virtualSizer,{width:this.paneWidth,height:this.sizerWidth});
}
this.virtualSizer.style.display="block";
},_hideSizingLine:function(){
this.virtualSizer.style.display="none";
},_moveSizingLine:function(){
var pos=this.lastPoint-this.startPoint+this.sizingSplitter.position;
if(this.isHorizontal){
this.virtualSizer.style.left=pos+"px";
}else{
var pos=(this.lastPoint-this.startPoint)+this.sizingSplitter.position;
this.virtualSizer.style.top=pos+"px";
}
},_getCookieName:function(i){
return this.widgetId+"_"+i;
},_restoreState:function(){
for(var i=0;i<this.children.length;i++){
var _cd=this._getCookieName(i);
var _ce=dojo.io.cookie.getCookie(_cd);
if(_ce!=null){
var pos=parseInt(_ce);
if(typeof pos=="number"){
this.children[i].sizeShare=pos;
}
}
}
},_saveState:function(){
for(var i=0;i<this.children.length;i++){
var _d1=this._getCookieName(i);
dojo.io.cookie.setCookie(_d1,this.children[i].sizeShare,null,null,null,null);
}
}});
dojo.lang.extend(dojo.widget.Widget,{sizeMin:10,sizeShare:10});
dojo.widget.defineWidget("dojo.widget.SplitContainerPanel",dojo.widget.ContentPane,{});
dojo.provide("dojo.widget.TreeNode");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("dojo.widget.TreeNode",dojo.widget.HtmlWidget,function(){
this.actionsDisabled=[];
},{widgetType:"TreeNode",loadStates:{UNCHECKED:"UNCHECKED",LOADING:"LOADING",LOADED:"LOADED"},actions:{MOVE:"MOVE",REMOVE:"REMOVE",EDIT:"EDIT",ADDCHILD:"ADDCHILD"},isContainer:true,lockLevel:0,templateString:("<div class=\"dojoTreeNode\"> "+"<span treeNode=\"${this.widgetId}\" class=\"dojoTreeNodeLabel\" dojoAttachPoint=\"labelNode\"> "+"\t\t<span dojoAttachPoint=\"titleNode\" dojoAttachEvent=\"onClick: onTitleClick\" class=\"dojoTreeNodeLabelTitle\">${this.title}</span> "+"</span> "+"<span class=\"dojoTreeNodeAfterLabel\" dojoAttachPoint=\"afterLabelNode\">${this.afterLabel}</span> "+"<div dojoAttachPoint=\"containerNode\" style=\"display:none\"></div> "+"</div>").replace(/(>|<)\s+/g,"$1"),childIconSrc:"",childIconFolderSrc:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/closed.gif"),childIconDocumentSrc:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/document.gif"),childIcon:null,isTreeNode:true,objectId:"",afterLabel:"",afterLabelNode:null,expandIcon:null,title:"",object:"",isFolder:false,labelNode:null,titleNode:null,imgs:null,expandLevel:"",tree:null,depth:0,isExpanded:false,state:null,domNodeInitialized:false,isFirstChild:function(){
return this.getParentIndex()==0?true:false;
},isLastChild:function(){
return this.getParentIndex()==this.parent.children.length-1?true:false;
},lock:function(){
return this.tree.lock.apply(this,arguments);
},unlock:function(){
return this.tree.unlock.apply(this,arguments);
},isLocked:function(){
return this.tree.isLocked.apply(this,arguments);
},cleanLock:function(){
return this.tree.cleanLock.apply(this,arguments);
},actionIsDisabled:function(_d2){
var _d3=this;
var _d4=false;
if(this.tree.strictFolders&&_d2==this.actions.ADDCHILD&&!this.isFolder){
_d4=true;
}
if(dojo.lang.inArray(_d3.actionsDisabled,_d2)){
_d4=true;
}
if(this.isLocked()){
_d4=true;
}
return _d4;
},getInfo:function(){
var _d5={widgetId:this.widgetId,objectId:this.objectId,index:this.getParentIndex(),isFolder:this.isFolder};
return _d5;
},initialize:function(_d6,_d7){
this.state=this.loadStates.UNCHECKED;
for(var i=0;i<this.actionsDisabled.length;i++){
this.actionsDisabled[i]=this.actionsDisabled[i].toUpperCase();
}
this.expandLevel=parseInt(this.expandLevel);
},adjustDepth:function(_d9){
for(var i=0;i<this.children.length;i++){
this.children[i].adjustDepth(_d9);
}
this.depth+=_d9;
if(_d9>0){
for(var i=0;i<_d9;i++){
var img=this.tree.makeBlankImg();
this.imgs.unshift(img);
dojo.html.insertBefore(this.imgs[0],this.domNode.firstChild);
}
}
if(_d9<0){
for(var i=0;i<-_d9;i++){
this.imgs.shift();
dojo.html.removeNode(this.domNode.firstChild);
}
}
},markLoading:function(){
this._markLoadingSavedIcon=this.expandIcon.src;
this.expandIcon.src=this.tree.expandIconSrcLoading;
},unMarkLoading:function(){
if(!this._markLoadingSavedIcon){
return;
}
var im=new Image();
im.src=this.tree.expandIconSrcLoading;
if(this.expandIcon.src==im.src){
this.expandIcon.src=this._markLoadingSavedIcon;
}
this._markLoadingSavedIcon=null;
},setFolder:function(){
dojo.event.connect(this.expandIcon,"onclick",this,"onTreeClick");
this.expandIcon.src=this.isExpanded?this.tree.expandIconSrcMinus:this.tree.expandIconSrcPlus;
this.isFolder=true;
},createDOMNode:function(_dd,_de){
this.tree=_dd;
this.depth=_de;
this.imgs=[];
for(var i=0;i<this.depth+1;i++){
var img=this.tree.makeBlankImg();
this.domNode.insertBefore(img,this.labelNode);
this.imgs.push(img);
}
this.expandIcon=this.imgs[this.imgs.length-1];
this.childIcon=this.tree.makeBlankImg();
this.imgs.push(this.childIcon);
dojo.html.insertBefore(this.childIcon,this.titleNode);
if(this.children.length||this.isFolder){
this.setFolder();
}else{
this.state=this.loadStates.LOADED;
}
dojo.event.connect(this.childIcon,"onclick",this,"onIconClick");
for(var i=0;i<this.children.length;i++){
this.children[i].parent=this;
var _e1=this.children[i].createDOMNode(this.tree,this.depth+1);
this.containerNode.appendChild(_e1);
}
if(this.children.length){
this.state=this.loadStates.LOADED;
}
this.updateIcons();
this.domNodeInitialized=true;
dojo.event.topic.publish(this.tree.eventNames.createDOMNode,{source:this});
return this.domNode;
},onTreeClick:function(e){
dojo.event.topic.publish(this.tree.eventNames.treeClick,{source:this,event:e});
},onIconClick:function(e){
dojo.event.topic.publish(this.tree.eventNames.iconClick,{source:this,event:e});
},onTitleClick:function(e){
dojo.event.topic.publish(this.tree.eventNames.titleClick,{source:this,event:e});
},markSelected:function(){
dojo.html.addClass(this.titleNode,"dojoTreeNodeLabelSelected");
},unMarkSelected:function(){
dojo.html.removeClass(this.titleNode,"dojoTreeNodeLabelSelected");
},updateExpandIcon:function(){
if(this.isFolder){
this.expandIcon.src=this.isExpanded?this.tree.expandIconSrcMinus:this.tree.expandIconSrcPlus;
}else{
this.expandIcon.src=this.tree.blankIconSrc;
}
},updateExpandGrid:function(){
if(this.tree.showGrid){
if(this.depth){
this.setGridImage(-2,this.isLastChild()?this.tree.gridIconSrcL:this.tree.gridIconSrcT);
}else{
if(this.isFirstChild()){
this.setGridImage(-2,this.isLastChild()?this.tree.gridIconSrcX:this.tree.gridIconSrcY);
}else{
this.setGridImage(-2,this.isLastChild()?this.tree.gridIconSrcL:this.tree.gridIconSrcT);
}
}
}else{
this.setGridImage(-2,this.tree.blankIconSrc);
}
},updateChildGrid:function(){
if((this.depth||this.tree.showRootGrid)&&this.tree.showGrid){
this.setGridImage(-1,(this.children.length&&this.isExpanded)?this.tree.gridIconSrcP:this.tree.gridIconSrcC);
}else{
if(this.tree.showGrid&&!this.tree.showRootGrid){
this.setGridImage(-1,(this.children.length&&this.isExpanded)?this.tree.gridIconSrcZ:this.tree.blankIconSrc);
}else{
this.setGridImage(-1,this.tree.blankIconSrc);
}
}
},updateParentGrid:function(){
var _e5=this.parent;
for(var i=0;i<this.depth;i++){
var idx=this.imgs.length-(3+i);
var img=(this.tree.showGrid&&!_e5.isLastChild())?this.tree.gridIconSrcV:this.tree.blankIconSrc;
this.setGridImage(idx,img);
_e5=_e5.parent;
}
},updateExpandGridColumn:function(){
if(!this.tree.showGrid){
return;
}
var _e9=this;
var _ea=this.isLastChild()?this.tree.blankIconSrc:this.tree.gridIconSrcV;
dojo.lang.forEach(_e9.getDescendants(),function(_eb){
_eb.setGridImage(_e9.depth,_ea);
});
this.updateExpandGrid();
},updateIcons:function(){
this.imgs[0].style.display=this.tree.showRootGrid?"inline":"none";
this.buildChildIcon();
this.updateExpandGrid();
this.updateChildGrid();
this.updateParentGrid();
dojo.profile.stop("updateIcons");
},buildChildIcon:function(){
if(this.childIconSrc){
this.childIcon.src=this.childIconSrc;
}
this.childIcon.style.display=this.childIconSrc?"inline":"none";
},setGridImage:function(idx,src){
if(idx<0){
idx=this.imgs.length+idx;
}
this.imgs[idx].style.backgroundImage="url("+src+")";
},updateIconTree:function(){
this.tree.updateIconTree.call(this);
},expand:function(){
if(this.isExpanded){
return;
}
if(this.children.length){
this.showChildren();
}
this.isExpanded=true;
this.updateExpandIcon();
dojo.event.topic.publish(this.tree.eventNames.expand,{source:this});
},collapse:function(){
if(!this.isExpanded){
return;
}
this.hideChildren();
this.isExpanded=false;
this.updateExpandIcon();
dojo.event.topic.publish(this.tree.eventNames.collapse,{source:this});
},hideChildren:function(){
this.tree.toggleObj.hide(this.containerNode,this.toggleDuration,this.explodeSrc,dojo.lang.hitch(this,"onHide"));
if(dojo.exists(dojo,"dnd.dragManager.dragObjects")&&dojo.dnd.dragManager.dragObjects.length){
dojo.dnd.dragManager.cacheTargetLocations();
}
},showChildren:function(){
this.tree.toggleObj.show(this.containerNode,this.toggleDuration,this.explodeSrc,dojo.lang.hitch(this,"onShow"));
if(dojo.exists(dojo,"dnd.dragManager.dragObjects")&&dojo.dnd.dragManager.dragObjects.length){
dojo.dnd.dragManager.cacheTargetLocations();
}
},addChild:function(){
return this.tree.addChild.apply(this,arguments);
},doAddChild:function(){
return this.tree.doAddChild.apply(this,arguments);
},edit:function(_ee){
dojo.lang.mixin(this,_ee);
if(_ee.title){
this.titleNode.innerHTML=this.title;
}
if(_ee.afterLabel){
this.afterLabelNode.innerHTML=this.afterLabel;
}
if(_ee.childIconSrc){
this.buildChildIcon();
}
},removeNode:function(){
return this.tree.removeNode.apply(this,arguments);
},doRemoveNode:function(){
return this.tree.doRemoveNode.apply(this,arguments);
},toString:function(){
return "["+this.widgetType+" Tree:"+this.tree+" ID:"+this.widgetId+" Title:"+this.title+"]";
}});
dojo.provide("dojo.dnd.TreeDragAndDrop");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.extras");
dojo.require("dojo.html.layout");
dojo.dnd.TreeDragSource=function(_ef,_f0,_f1,_f2){
this.controller=_f0;
this.treeNode=_f2;
dojo.dnd.HtmlDragSource.call(this,_ef,_f1);
};
dojo.inherits(dojo.dnd.TreeDragSource,dojo.dnd.HtmlDragSource);
dojo.lang.extend(dojo.dnd.TreeDragSource,{onDragStart:function(){
var _f3=dojo.dnd.HtmlDragSource.prototype.onDragStart.call(this);
_f3.treeNode=this.treeNode;
_f3.onDragStart=dojo.lang.hitch(_f3,function(e){
this.savedSelectedNode=this.treeNode.tree.selector.selectedNode;
if(this.savedSelectedNode){
this.savedSelectedNode.unMarkSelected();
}
var _f5=dojo.dnd.HtmlDragObject.prototype.onDragStart.apply(this,arguments);
var _f6=this.dragClone.getElementsByTagName("img");
for(var i=0;i<_f6.length;i++){
_f6.item(i).style.backgroundImage="url()";
}
return _f5;
});
_f3.onDragEnd=function(e){
if(this.savedSelectedNode){
this.savedSelectedNode.markSelected();
}
return dojo.dnd.HtmlDragObject.prototype.onDragEnd.apply(this,arguments);
};
return _f3;
},onDragEnd:function(e){
var res=dojo.dnd.HtmlDragSource.prototype.onDragEnd.call(this,e);
return res;
}});
dojo.dnd.TreeDropTarget=function(_fb,_fc,_fd,_fe){
this.treeNode=_fe;
this.controller=_fc;
dojo.dnd.HtmlDropTarget.apply(this,[_fb,_fd]);
};
dojo.inherits(dojo.dnd.TreeDropTarget,dojo.dnd.HtmlDropTarget);
dojo.lang.extend(dojo.dnd.TreeDropTarget,{autoExpandDelay:1500,autoExpandTimer:null,position:null,indicatorStyle:"2px black solid",showIndicator:function(_ff){
if(this.position==_ff){
return;
}
this.hideIndicator();
this.position=_ff;
if(_ff=="before"){
this.treeNode.labelNode.style.borderTop=this.indicatorStyle;
}else{
if(_ff=="after"){
this.treeNode.labelNode.style.borderBottom=this.indicatorStyle;
}else{
if(_ff=="onto"){
this.treeNode.markSelected();
}
}
}
},hideIndicator:function(){
this.treeNode.labelNode.style.borderBottom="";
this.treeNode.labelNode.style.borderTop="";
this.treeNode.unMarkSelected();
this.position=null;
},onDragOver:function(e){
var _101=dojo.dnd.HtmlDropTarget.prototype.onDragOver.apply(this,arguments);
if(_101&&this.treeNode.isFolder&&!this.treeNode.isExpanded){
this.setAutoExpandTimer();
}
return _101;
},accepts:function(_102){
var _103=dojo.dnd.HtmlDropTarget.prototype.accepts.apply(this,arguments);
if(!_103){
return false;
}
var _104=_102[0].treeNode;
if(dojo.lang.isUndefined(_104)||!_104||!_104.isTreeNode){
dojo.raise("Source is not TreeNode or not found");
}
if(_104===this.treeNode){
return false;
}
return true;
},setAutoExpandTimer:function(){
var _105=this;
var _106=function(){
if(dojo.dnd.dragManager.currentDropTarget===_105){
_105.controller.expand(_105.treeNode);
}
};
this.autoExpandTimer=dojo.lang.setTimeout(_106,_105.autoExpandDelay);
},getDNDMode:function(){
return this.treeNode.tree.DNDMode;
},getAcceptPosition:function(e,_108){
var _109=this.getDNDMode();
if(_109&dojo.widget.Tree.prototype.DNDModes.ONTO&&!(!this.treeNode.actionIsDisabled(dojo.widget.TreeNode.prototype.actions.ADDCHILD)&&_108.parent!==this.treeNode&&this.controller.canMove(_108,this.treeNode))){
_109&=~dojo.widget.Tree.prototype.DNDModes.ONTO;
}
var _10a=this.getPosition(e,_109);
if(_10a=="onto"||(!this.isAdjacentNode(_108,_10a)&&this.controller.canMove(_108,this.treeNode.parent))){
return _10a;
}else{
return false;
}
},onDragOut:function(e){
this.clearAutoExpandTimer();
this.hideIndicator();
},clearAutoExpandTimer:function(){
if(this.autoExpandTimer){
clearTimeout(this.autoExpandTimer);
this.autoExpandTimer=null;
}
},onDragMove:function(e,_10d){
var _10e=_10d[0].treeNode;
var _10f=this.getAcceptPosition(e,_10e);
if(_10f){
this.showIndicator(_10f);
}
},isAdjacentNode:function(_110,_111){
if(_110===this.treeNode){
return true;
}
if(_110.getNextSibling()===this.treeNode&&_111=="before"){
return true;
}
if(_110.getPreviousSibling()===this.treeNode&&_111=="after"){
return true;
}
return false;
},getPosition:function(e,_113){
var node=dojo.byId(this.treeNode.labelNode);
var _115=e.pageY||e.clientY+dojo.body().scrollTop;
var _116=dojo.html.getAbsolutePosition(node).y;
var _117=dojo.html.getBorderBox(node).height;
var relY=_115-_116;
var p=relY/_117;
var _11a="";
if(_113&dojo.widget.Tree.prototype.DNDModes.ONTO&&_113&dojo.widget.Tree.prototype.DNDModes.BETWEEN){
if(p<=0.3){
_11a="before";
}else{
if(p<=0.7){
_11a="onto";
}else{
_11a="after";
}
}
}else{
if(_113&dojo.widget.Tree.prototype.DNDModes.BETWEEN){
if(p<=0.5){
_11a="before";
}else{
_11a="after";
}
}else{
if(_113&dojo.widget.Tree.prototype.DNDModes.ONTO){
_11a="onto";
}
}
}
return _11a;
},getTargetParentIndex:function(_11b,_11c){
var _11d=_11c=="before"?this.treeNode.getParentIndex():this.treeNode.getParentIndex()+1;
if(this.treeNode.parent===_11b.parent&&this.treeNode.getParentIndex()>_11b.getParentIndex()){
_11d--;
}
return _11d;
},onDrop:function(e){
var _11f=this.position;
this.onDragOut(e);
var _120=e.dragObject.treeNode;
if(!dojo.lang.isObject(_120)){
dojo.raise("TreeNode not found in dragObject");
}
if(_11f=="onto"){
return this.controller.move(_120,this.treeNode,0);
}else{
var _121=this.getTargetParentIndex(_120,_11f);
return this.controller.move(_120,this.treeNode.parent,_121);
}
}});
dojo.dnd.TreeDNDController=function(_122){
this.treeController=_122;
this.dragSources={};
this.dropTargets={};
};
dojo.lang.extend(dojo.dnd.TreeDNDController,{listenTree:function(tree){
dojo.event.topic.subscribe(tree.eventNames.createDOMNode,this,"onCreateDOMNode");
dojo.event.topic.subscribe(tree.eventNames.moveFrom,this,"onMoveFrom");
dojo.event.topic.subscribe(tree.eventNames.moveTo,this,"onMoveTo");
dojo.event.topic.subscribe(tree.eventNames.addChild,this,"onAddChild");
dojo.event.topic.subscribe(tree.eventNames.removeNode,this,"onRemoveNode");
dojo.event.topic.subscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
},unlistenTree:function(tree){
dojo.event.topic.unsubscribe(tree.eventNames.createDOMNode,this,"onCreateDOMNode");
dojo.event.topic.unsubscribe(tree.eventNames.moveFrom,this,"onMoveFrom");
dojo.event.topic.unsubscribe(tree.eventNames.moveTo,this,"onMoveTo");
dojo.event.topic.unsubscribe(tree.eventNames.addChild,this,"onAddChild");
dojo.event.topic.unsubscribe(tree.eventNames.removeNode,this,"onRemoveNode");
dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
},onTreeDestroy:function(_125){
this.unlistenTree(_125.source);
},onCreateDOMNode:function(_126){
this.registerDNDNode(_126.source);
},onAddChild:function(_127){
this.registerDNDNode(_127.child);
},onMoveFrom:function(_128){
var _129=this;
dojo.lang.forEach(_128.child.getDescendants(),function(node){
_129.unregisterDNDNode(node);
});
},onMoveTo:function(_12b){
var _12c=this;
dojo.lang.forEach(_12b.child.getDescendants(),function(node){
_12c.registerDNDNode(node);
});
},registerDNDNode:function(node){
if(!node.tree.DNDMode){
return;
}
var _12f=null;
var _130=null;
if(!node.actionIsDisabled(node.actions.MOVE)){
var _12f=new dojo.dnd.TreeDragSource(node.labelNode,this,node.tree.widgetId,node);
this.dragSources[node.widgetId]=_12f;
}
var _130=new dojo.dnd.TreeDropTarget(node.labelNode,this.treeController,node.tree.DNDAcceptTypes,node);
this.dropTargets[node.widgetId]=_130;
},unregisterDNDNode:function(node){
if(this.dragSources[node.widgetId]){
dojo.dnd.dragManager.unregisterDragSource(this.dragSources[node.widgetId]);
delete this.dragSources[node.widgetId];
}
if(this.dropTargets[node.widgetId]){
dojo.dnd.dragManager.unregisterDropTarget(this.dropTargets[node.widgetId]);
delete this.dropTargets[node.widgetId];
}
}});
dojo.provide("dojo.widget.TreeBasicController");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("dojo.widget.TreeBasicController",dojo.widget.HtmlWidget,{widgetType:"TreeBasicController",DNDController:"",dieWithTree:false,initialize:function(args,frag){
if(this.DNDController=="create"){
this.DNDController=new dojo.dnd.TreeDNDController(this);
}
},listenTree:function(tree){
dojo.event.topic.subscribe(tree.eventNames.createDOMNode,this,"onCreateDOMNode");
dojo.event.topic.subscribe(tree.eventNames.treeClick,this,"onTreeClick");
dojo.event.topic.subscribe(tree.eventNames.treeCreate,this,"onTreeCreate");
dojo.event.topic.subscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
if(this.DNDController){
this.DNDController.listenTree(tree);
}
},unlistenTree:function(tree){
dojo.event.topic.unsubscribe(tree.eventNames.createDOMNode,this,"onCreateDOMNode");
dojo.event.topic.unsubscribe(tree.eventNames.treeClick,this,"onTreeClick");
dojo.event.topic.unsubscribe(tree.eventNames.treeCreate,this,"onTreeCreate");
dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
},onTreeDestroy:function(_136){
var tree=_136.source;
this.unlistenTree(tree);
if(this.dieWithTree){
this.destroy();
}
},onCreateDOMNode:function(_138){
var node=_138.source;
if(node.expandLevel>0){
this.expandToLevel(node,node.expandLevel);
}
},onTreeCreate:function(_13a){
var tree=_13a.source;
var _13c=this;
if(tree.expandLevel){
dojo.lang.forEach(tree.children,function(_13d){
_13c.expandToLevel(_13d,tree.expandLevel-1);
});
}
},expandToLevel:function(node,_13f){
if(_13f==0){
return;
}
var _140=node.children;
var _141=this;
var _142=function(node,_144){
this.node=node;
this.expandLevel=_144;
this.process=function(){
for(var i=0;i<this.node.children.length;i++){
var _146=node.children[i];
_141.expandToLevel(_146,this.expandLevel);
}
};
};
var h=new _142(node,_13f-1);
this.expand(node,false,h,h.process);
},onTreeClick:function(_148){
var node=_148.source;
if(node.isLocked()){
return false;
}
if(node.isExpanded){
this.collapse(node);
}else{
this.expand(node);
}
},expand:function(node,sync,_14c,_14d){
node.expand();
if(_14d){
_14d.apply(_14c,[node]);
}
},collapse:function(node){
node.collapse();
},canMove:function(_14f,_150){
if(_14f.actionIsDisabled(_14f.actions.MOVE)){
return false;
}
if(_14f.parent!==_150&&_150.actionIsDisabled(_150.actions.ADDCHILD)){
return false;
}
var node=_150;
while(node.isTreeNode){
if(node===_14f){
return false;
}
node=node.parent;
}
return true;
},move:function(_152,_153,_154){
if(!this.canMove(_152,_153)){
return false;
}
var _155=this.doMove(_152,_153,_154);
if(!_155){
return _155;
}
if(_153.isTreeNode){
this.expand(_153);
}
return _155;
},doMove:function(_156,_157,_158){
_156.tree.move(_156,_157,_158);
return true;
},canRemoveNode:function(_159){
if(_159.actionIsDisabled(_159.actions.REMOVE)){
return false;
}
return true;
},removeNode:function(node,_15b,_15c){
if(!this.canRemoveNode(node)){
return false;
}
return this.doRemoveNode(node,_15b,_15c);
},doRemoveNode:function(node,_15e,_15f){
node.tree.removeNode(node);
if(_15f){
_15f.apply(dojo.lang.isUndefined(_15e)?this:_15e,[node]);
}
},canCreateChild:function(_160,_161,data){
if(_160.actionIsDisabled(_160.actions.ADDCHILD)){
return false;
}
return true;
},createChild:function(_163,_164,data,_166,_167){
if(!this.canCreateChild(_163,_164,data)){
return false;
}
return this.doCreateChild.apply(this,arguments);
},doCreateChild:function(_168,_169,data,_16b,_16c){
var _16d=data.widgetType?data.widgetType:"TreeNode";
var _16e=dojo.widget.createWidget(_16d,data);
_168.addChild(_16e,_169);
this.expand(_168);
if(_16c){
_16c.apply(_16b,[_16e]);
}
return _16e;
}});
dojo.provide("dojo.widget.TreeSelector");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.TreeSelector",dojo.widget.HtmlWidget,function(){
this.eventNames={};
this.listenedTrees=[];
},{widgetType:"TreeSelector",selectedNode:null,dieWithTree:false,eventNamesDefault:{select:"select",destroy:"destroy",deselect:"deselect",dblselect:"dblselect"},initialize:function(){
for(var name in this.eventNamesDefault){
if(dojo.lang.isUndefined(this.eventNames[name])){
this.eventNames[name]=this.widgetId+"/"+this.eventNamesDefault[name];
}
}
},destroy:function(){
dojo.event.topic.publish(this.eventNames.destroy,{source:this});
return dojo.widget.HtmlWidget.prototype.destroy.apply(this,arguments);
},listenTree:function(tree){
dojo.event.topic.subscribe(tree.eventNames.titleClick,this,"select");
dojo.event.topic.subscribe(tree.eventNames.iconClick,this,"select");
dojo.event.topic.subscribe(tree.eventNames.collapse,this,"onCollapse");
dojo.event.topic.subscribe(tree.eventNames.moveFrom,this,"onMoveFrom");
dojo.event.topic.subscribe(tree.eventNames.removeNode,this,"onRemoveNode");
dojo.event.topic.subscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
this.listenedTrees.push(tree);
},unlistenTree:function(tree){
dojo.event.topic.unsubscribe(tree.eventNames.titleClick,this,"select");
dojo.event.topic.unsubscribe(tree.eventNames.iconClick,this,"select");
dojo.event.topic.unsubscribe(tree.eventNames.collapse,this,"onCollapse");
dojo.event.topic.unsubscribe(tree.eventNames.moveFrom,this,"onMoveFrom");
dojo.event.topic.unsubscribe(tree.eventNames.removeNode,this,"onRemoveNode");
dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
for(var i=0;i<this.listenedTrees.length;i++){
if(this.listenedTrees[i]===tree){
this.listenedTrees.splice(i,1);
break;
}
}
},onTreeDestroy:function(_173){
this.unlistenTree(_173.source);
if(this.dieWithTree){
this.destroy();
}
},onCollapse:function(_174){
if(!this.selectedNode){
return;
}
var node=_174.source;
var _176=this.selectedNode.parent;
while(_176!==node&&_176.isTreeNode){
_176=_176.parent;
}
if(_176.isTreeNode){
this.deselect();
}
},select:function(_177){
var node=_177.source;
var e=_177.event;
if(this.selectedNode===node){
if(e.ctrlKey||e.shiftKey||e.metaKey){
this.deselect();
return;
}
dojo.event.topic.publish(this.eventNames.dblselect,{node:node});
return;
}
if(this.selectedNode){
this.deselect();
}
this.doSelect(node);
dojo.event.topic.publish(this.eventNames.select,{node:node});
},onMoveFrom:function(_17a){
if(_17a.child!==this.selectedNode){
return;
}
if(!dojo.lang.inArray(this.listenedTrees,_17a.newTree)){
this.deselect();
}
},onRemoveNode:function(_17b){
if(_17b.child!==this.selectedNode){
return;
}
this.deselect();
},doSelect:function(node){
node.markSelected();
this.selectedNode=node;
},deselect:function(){
var node=this.selectedNode;
this.selectedNode=null;
node.unMarkSelected();
dojo.event.topic.publish(this.eventNames.deselect,{node:node});
}});
dojo.provide("dojo.widget.Tree");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.html.common");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.Tree",dojo.widget.HtmlWidget,function(){
this.eventNames={};
this.tree=this;
this.DNDAcceptTypes=[];
this.actionsDisabled=[];
},{widgetType:"Tree",eventNamesDefault:{createDOMNode:"createDOMNode",treeCreate:"treeCreate",treeDestroy:"treeDestroy",treeClick:"treeClick",iconClick:"iconClick",titleClick:"titleClick",moveFrom:"moveFrom",moveTo:"moveTo",addChild:"addChild",removeNode:"removeNode",expand:"expand",collapse:"collapse"},isContainer:true,DNDMode:"off",lockLevel:0,strictFolders:true,DNDModes:{BETWEEN:1,ONTO:2},DNDAcceptTypes:"",templateString:"<div class=\"dojoTree\"></div>",isExpanded:true,isTree:true,objectId:"",controller:"",selector:"",menu:"",expandLevel:"",blankIconSrc:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_blank.gif"),gridIconSrcT:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_grid_t.gif"),gridIconSrcL:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_grid_l.gif"),gridIconSrcV:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_grid_v.gif"),gridIconSrcP:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_grid_p.gif"),gridIconSrcC:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_grid_c.gif"),gridIconSrcX:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_grid_x.gif"),gridIconSrcY:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_grid_y.gif"),gridIconSrcZ:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_grid_z.gif"),expandIconSrcPlus:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_expand_plus.gif"),expandIconSrcMinus:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_expand_minus.gif"),expandIconSrcLoading:dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_loading.gif"),iconWidth:18,iconHeight:18,showGrid:true,showRootGrid:true,actionIsDisabled:function(_17e){
var _17f=this;
return dojo.lang.inArray(_17f.actionsDisabled,_17e);
},actions:{ADDCHILD:"ADDCHILD"},getInfo:function(){
var info={widgetId:this.widgetId,objectId:this.objectId};
return info;
},initializeController:function(){
if(this.controller!="off"){
if(this.controller){
this.controller=dojo.widget.byId(this.controller);
}else{
this.controller=dojo.widget.createWidget("TreeBasicController",{DNDController:(this.DNDMode?"create":""),dieWithTree:true});
}
this.controller.listenTree(this);
}else{
this.controller=null;
}
},initializeSelector:function(){
if(this.selector!="off"){
if(this.selector){
this.selector=dojo.widget.byId(this.selector);
}else{
this.selector=dojo.widget.createWidget("TreeSelector",{dieWithTree:true});
}
this.selector.listenTree(this);
}else{
this.selector=null;
}
},initialize:function(args,frag){
var _183=this;
for(name in this.eventNamesDefault){
if(dojo.lang.isUndefined(this.eventNames[name])){
this.eventNames[name]=this.widgetId+"/"+this.eventNamesDefault[name];
}
}
for(var i=0;i<this.actionsDisabled.length;i++){
this.actionsDisabled[i]=this.actionsDisabled[i].toUpperCase();
}
if(this.DNDMode=="off"){
this.DNDMode=0;
}else{
if(this.DNDMode=="between"){
this.DNDMode=this.DNDModes.ONTO|this.DNDModes.BETWEEN;
}else{
if(this.DNDMode=="onto"){
this.DNDMode=this.DNDModes.ONTO;
}
}
}
this.expandLevel=parseInt(this.expandLevel);
this.initializeSelector();
this.initializeController();
if(this.menu){
this.menu=dojo.widget.byId(this.menu);
this.menu.listenTree(this);
}
this.containerNode=this.domNode;
},postCreate:function(){
this.createDOMNode();
},createDOMNode:function(){
dojo.html.disableSelection(this.domNode);
for(var i=0;i<this.children.length;i++){
this.children[i].parent=this;
var node=this.children[i].createDOMNode(this,0);
this.domNode.appendChild(node);
}
if(!this.showRootGrid){
for(var i=0;i<this.children.length;i++){
this.children[i].expand();
}
}
dojo.event.topic.publish(this.eventNames.treeCreate,{source:this});
},destroy:function(){
dojo.event.topic.publish(this.tree.eventNames.treeDestroy,{source:this});
return dojo.widget.HtmlWidget.prototype.destroy.apply(this,arguments);
},addChild:function(_187,_188){
var _189={child:_187,index:_188,parent:this,domNodeInitialized:_187.domNodeInitialized};
this.doAddChild.apply(this,arguments);
dojo.event.topic.publish(this.tree.eventNames.addChild,_189);
},doAddChild:function(_18a,_18b){
if(dojo.lang.isUndefined(_18b)){
_18b=this.children.length;
}
if(!_18a.isTreeNode){
dojo.raise("You can only add TreeNode widgets to a "+this.widgetType+" widget!");
return;
}
if(this.isTreeNode){
if(!this.isFolder){
this.setFolder();
}
}
var _18c=this;
dojo.lang.forEach(_18a.getDescendants(),function(elem){
elem.tree=_18c.tree;
});
_18a.parent=this;
if(this.isTreeNode){
this.state=this.loadStates.LOADED;
}
if(_18b<this.children.length){
dojo.html.insertBefore(_18a.domNode,this.children[_18b].domNode);
}else{
this.containerNode.appendChild(_18a.domNode);
if(this.isExpanded&&this.isTreeNode){
this.showChildren();
}
}
this.children.splice(_18b,0,_18a);
if(_18a.domNodeInitialized){
var d=this.isTreeNode?this.depth:-1;
_18a.adjustDepth(d-_18a.depth+1);
_18a.updateIconTree();
}else{
_18a.depth=this.isTreeNode?this.depth+1:0;
_18a.createDOMNode(_18a.tree,_18a.depth);
}
var _18f=_18a.getPreviousSibling();
if(_18a.isLastChild()&&_18f){
_18f.updateExpandGridColumn();
}
},makeBlankImg:function(){
var img=document.createElement("img");
img.style.width=this.iconWidth+"px";
img.style.height=this.iconHeight+"px";
img.src=this.blankIconSrc;
img.style.verticalAlign="middle";
return img;
},updateIconTree:function(){
if(!this.isTree){
this.updateIcons();
}
for(var i=0;i<this.children.length;i++){
this.children[i].updateIconTree();
}
},toString:function(){
return "["+this.widgetType+" ID:"+this.widgetId+"]";
},move:function(_192,_193,_194){
var _195=_192.parent;
var _196=_192.tree;
this.doMove.apply(this,arguments);
var _193=_192.parent;
var _197=_192.tree;
var _198={oldParent:_195,oldTree:_196,newParent:_193,newTree:_197,child:_192};
dojo.event.topic.publish(_196.eventNames.moveFrom,_198);
dojo.event.topic.publish(_197.eventNames.moveTo,_198);
},doMove:function(_199,_19a,_19b){
_199.parent.doRemoveNode(_199);
_19a.doAddChild(_199,_19b);
},removeNode:function(_19c){
if(!_19c.parent){
return;
}
var _19d=_19c.tree;
var _19e=_19c.parent;
var _19f=this.doRemoveNode.apply(this,arguments);
dojo.event.topic.publish(this.tree.eventNames.removeNode,{child:_19f,tree:_19d,parent:_19e});
return _19f;
},doRemoveNode:function(_1a0){
if(!_1a0.parent){
return;
}
var _1a1=_1a0.parent;
var _1a2=_1a1.children;
var _1a3=_1a0.getParentIndex();
if(_1a3<0){
dojo.raise("Couldn't find node "+_1a0+" for removal");
}
_1a2.splice(_1a3,1);
dojo.html.removeNode(_1a0.domNode);
if(_1a1.children.length==0&&!_1a1.isTree){
_1a1.containerNode.style.display="none";
}
if(_1a3==_1a2.length&&_1a3>0){
_1a2[_1a3-1].updateExpandGridColumn();
}
if(_1a1 instanceof dojo.widget.Tree&&_1a3==0&&_1a2.length>0){
_1a2[0].updateExpandGrid();
}
_1a0.parent=_1a0.tree=null;
return _1a0;
},markLoading:function(){
},unMarkLoading:function(){
},lock:function(){
!this.lockLevel&&this.markLoading();
this.lockLevel++;
},unlock:function(){
if(!this.lockLevel){
dojo.raise("unlock: not locked");
}
this.lockLevel--;
!this.lockLevel&&this.unMarkLoading();
},isLocked:function(){
var node=this;
while(true){
if(node.lockLevel){
return true;
}
if(node instanceof dojo.widget.Tree){
break;
}
node=node.parent;
}
return false;
},flushLock:function(){
this.lockLevel=0;
this.unMarkLoading();
}});
dojo.provide("tree.widget.SelectableTree");
SelectOption=function(){
};
SelectOption.ALL_NODES=0;
SelectOption.SELECTED_NODES_ALL=1;
SelectOption.SELECTED_NODES_CHILDREN_ONLY=2;
SelectOption.SELECTED_NODES_PARENT=3;
SelectOption.SELECTED_NODES_PARENT_CHILDREN=4;
TreeEvents=function(){
};
TreeEvents.onTreeSelectionChange="onTreeSelectionChange";
TreeEvents.onTreeNodeClicked="onTreeNodeClicked";
dojo.widget.defineWidget("tree.widget.SelectableTree",[dojo.widget.Tree],{showSelectBox:true,propagateSelect:true,parseComponents:false,selectOnLabelClick:true,prefixName:false,dataSet:"",initializer:function(){
tree.widget.SelectableTree.superclass.initializer.call(this);
},postCreate:function(){
try{
dojo.debug("SelectableTree.postCreate : Enter");
tree.widget.SelectableTree.superclass.postCreate.call(this);
if(typeof window[this.dataSet]!=="undefined"){
dojo.dom.removeChildren(this.containerNode);
var ds=window[this.dataSet];
dojo.debug("SelectableTree.postCreate : ds.length="+ds.length);
for(var i=0;i<ds.length;i++){
var node=this._newWidget(ds[i]);
node._init(this);
}
}else{
if(this.dataSet!=""){
this.containerNode.innerHTML="Loading...";
window.setTimeout(dojo.lang.hitch(this,"postCreate"),50);
}else{
dojo.debug("SelectableTree.postCreate : no dataset");
}
}
}
catch(e){
circleup.widget.utils.dumpProps(e);
}
dojo.debug("SelectableTree.postCreate : Exit");
},scrollToFirstSelected:function(){
for(var i=0;i<this.children.length;i++){
var _1a9=this.children[i];
if(_1a9.isSelected()){
if(!_1a9.isExpanded){
var _1aa=Math.min(this.children.length-i-1,8);
var node=this.children[i+_1aa];
dojo.html.scrollIntoView(node.domNode);
}else{
dojo.html.scrollIntoView(_1a9.domNode);
}
break;
}
}
},isSelected:function(){
var _1ac=false;
for(var i=0;i<this.children.length;i++){
var _1ae=this.children[i];
if(_1ae.isSelected()){
_1ac=true;
break;
}
}
return _1ac;
},getInfo:function(){
var info=tree.widget.SelectableTree.superclass.getInfo.call(this);
info.selected=this.isSelected();
info.widgetType=this.widgetType;
return info;
},clear:function(){
dojo.lang.forEach(this.children,function(_1b0){
if(typeof _1b0.clear!=="undefined"){
_1b0.clear();
}
});
this._publishEvent();
},asXML:function(_1b1){
var _1b2=this._buildElement();
var _1b3="";
dojo.lang.forEach(this.children,function(_1b4){
_1b3+=_1b4.asXML(_1b1);
});
var _1b5="</Tree>";
return _1b2+_1b3+_1b5;
},asObject:function(_1b6){
var node=this.getInfo();
var _1b8=new Array();
var j=0;
for(var i=0;i<this.children.length;i++){
var _1bb=this.children[i].asObject("",_1b6);
if(_1bb!=null){
if(_1bb.length>0){
_1b8=_1b8.concat(_1bb);
j=_1b8.length;
}else{
_1b8[j++]=_1bb;
}
}
}
node.children=_1b8;
return node;
},createDOMNode:function(){
tree.widget.SelectableTree.superclass.createDOMNode.call(this);
for(var i=0;i<this.children.length;i++){
this.children[i]._init(this);
}
},_newWidget:function(_1bd){
_1bd.showSelectBox=this.showSelectBox;
_1bd.propagateSelect=this.propagateSelect;
_1bd.selectOnLabelClick=this.selectOnLabelClick;
_1bd.prefixName=this.prefixName;
if(this.prefixName){
_1bd.widgetId=this.widgetId+"_"+_1bd.widgetId;
}
var _1be=dojo.widget.createWidget("tree:SelectableTreeNode",_1bd);
this.addChild(_1be);
return _1be;
},_publishEvent:function(){
dojo.event.topic.publish(TreeEvents.onTreeSelectionChange,{source:this,selected:this.isSelected()});
},_buildElement:function(){
var str="<Tree id=\""+this.id+"\" showGrid=\"false\" ";
str+="widgetId=\""+this.widgetId+"\" ";
str+=">";
return str;
}});
dojo.provide("tree.widget.SelectableTreeNode");
dojo.require("circleup.widget.Utils");
var noHoverCheck=circleup.widget.utils.asset("tree.widget","template/images/no-hover-check.png");
var hoverCheck=circleup.widget.utils.asset("tree.widget","template/images/hover-check.png");
var noHoverEmpty=circleup.widget.utils.asset("tree.widget","template/images/no-hover-empty.png");
var hoverEmpty=circleup.widget.utils.asset("tree.widget","template/images/hover-empty.png");
var noHoverCross=circleup.widget.utils.asset("tree.widget","template/images/no-hover-cross.png");
var hoverCross=circleup.widget.utils.asset("tree.widget","template/images/hover-cross.png");
var treeNodeBlank=dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_blank.gif").toString();
var treeMinus=dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_expand_minus.gif").toString();
var treeExpand=dojo.uri.moduleUri("dojo.widget","templates/images/Tree/treenode_expand_plus.gif").toString();
function loadTreeNodeImages(){
circleup.widget.utils.preloadImages(noHoverCheck,hoverCheck,noHoverEmpty,hoverEmpty,noHoverCross,hoverCross,treeNodeBlank,treeMinus,treeExpand);
}
dojo.addOnLoad(function(){
window.setTimeout(loadTreeNodeImages,2000);
});
function SelectState(){
}
SelectState.NOT_SELECTED=0;
SelectState.SELECTED=1;
SelectState.PARTIALLY_SELECTED=2;
dojo.widget.defineWidget("tree.widget.SelectableTreeNode",[dojo.widget.TreeNode],{tree:null,showSelectBox:true,propagateSelect:true,parseComponents:false,prefixName:false,selected:false,marked:false,checkBoxNode:null,selectOnLabelClick:true,data:"",dataSet:null,initialExpand:false,childSelectedCount:0,childPartiallySelectedCount:0,templateString:null,templateString:"<div class=\"dojoTreeNode\">\n\t<span treeNode=\"${this.widgetId}\" class=\"dojoTreeNodeLabel\" dojoAttachPoint=\"labelNode\">\n\t<img src=\"${this.noHoverEmpty}\" dojoAttachPoint=\"checkBoxNode\" dojoAttachEvent=\"onMouseOver: _onHoverOver; onMouseOut: _onHoverOut; onClick: _onSelectClick\">\n\t\t<span dojoAttachPoint=\"titleNode\" dojoAttachEvent=\"onClick: onTitleClick\" class=\"dojoTreeNodeLabelTitle\" style=\"font-weight:normal;\">\n\t\t\t${this.title}\n\t\t</span>\n\t</span>\n\t<span class=\"dojoTreeNodeAfterLabel\" dojoAttachPoint=\"afterLabelNode\">${this.afterLabel}</span>\n  <div dojoAttachPoint=\"containerNode\" style=\"display:none\"></div>\n</div>\n",noHoverEmpty:noHoverEmpty,_selectState:-1,initializer:function(){
dojo.debug("SelectableTreeNode.initializer : Enter");
tree.widget.SelectableTreeNode.superclass.initializer.call(this);
},postCreate:function(){
try{
dojo.debug("SelectableTreeNode.postCreate : Enter");
if(this.showSelectBox==false){
this.checkBoxNode.style.display="none";
}
tree.widget.SelectableTreeNode.superclass.postCreate.call(this);
}
catch(e){
circleup.widget.utils.dumpProps(e);
}
dojo.debug("SelectableTreeNode.postCreate : Exit");
},isSelected:function(){
return (this._selectState!=SelectState.NOT_SELECTED);
},getSelectState:function(){
return this._selectState;
},destroy:function(){
this.checkBoxNode=null;
this.labelNode=null;
this.titleNode=null;
this.afterLabelNode=null;
this.imgs=null;
this.expandIcon=null;
this.childIcon=null;
this.tree=null;
tree.widget.SelectableTreeNode.superclass.destroy.call(this);
},onTitleClick:function(e){
if(this.marked){
this.unMarkSelected();
}else{
this.markSelected();
}
dojo.event.topic.publish(TreeEvents.onTreeNodeClicked,{source:this,marked:this.marked});
if(this.selectOnLabelClick){
this._onSelectClick(e);
}
},markSelected:function(){
this.titleNode.style.backgroundColor="#B2B4BF";
this.marked=true;
},unMarkSelected:function(){
this.titleNode.style.backgroundColor="#ffffff";
this.marked=false;
},setSelected:function(_1c1){
var _1c2=this._selectState;
this._setSelected(_1c1);
if((_1c1&&_1c2==SelectState.NOT_SELECTED)||(!_1c1&&_1c2!=SelectState.NOT_SELECTED)||_1c2!=this._selectState){
this._notifyParent(_1c2);
}
if(_1c2!=this._selectState){
this._publishEvent();
}
if(!this.isSelected()){
this.unMarkSelected();
}
},hasChildren:function(){
return (this.children&&this.children.length>0);
},getInfo:function(){
var info=tree.widget.SelectableTreeNode.superclass.getInfo.call(this);
info.selected=(this.propagateSelect)?this.isSelected():false;
info.widgetType=this.widgetType;
info.data=this.data;
info.title=this.title;
return info;
},asXML:function(_1c4){
var _1c5="";
var _1c6="";
var _1c7="";
if(_1c4==null){
_1c4=SelectOption.ALL_NODES;
}
var _1c8=this._getDirectives(_1c4);
if(_1c8.buildElement){
_1c5=this._buildElement();
_1c7=this._closeTag();
}
if(_1c8.callChildren){
dojo.lang.forEach(this.children,function(_1c9){
_1c6+=_1c9.asXML(_1c4);
});
}
return _1c5+_1c6+_1c7;
},clear:function(){
this._setSelected(false);
},asObject:function(_1ca,_1cb){
var node=null;
var _1cd=null;
if(_1cb==null){
_1cb=SelectOption.ALL_NODES;
}
var _1ce=this._getDirectives(_1cb);
if(_1ce.callChildren){
_1cd=new Array();
var j=0;
for(var i=0;i<this.children.length;i++){
var _1d1=this.children[i].asObject(this.title,_1cb);
if(_1d1!=null){
if(_1d1.length>0){
_1cd=_1cd.concat(_1d1);
j=_1cd.length;
}else{
_1cd[j++]=_1d1;
}
}
}
}
if(_1ce.buildElement){
node=this.getInfo();
node.children=_1cd;
node.parent=_1ca;
if(node.children){
}
}else{
node=_1cd;
}
return node;
},_init:function(tree){
this.tree=tree;
if(this.dataSet!==null){
for(var i=0;i<this.dataSet.length;i++){
var node=this.dataSet[i];
this._newChild(node,false,true);
}
}
if(this.hasChildren()){
this._initChildren();
this._setExpandState();
}else{
this.setSelected(this.selected);
}
},_initChildren:function(){
for(var i=0;i<this.children.length;i++){
this.children[i]._init(this.tree);
}
},_setSelected:function(_1d6){
this._selectState=(_1d6)?SelectState.SELECTED:SelectState.NOT_SELECTED;
this.childSelectedCount=(_1d6)?this.children.length:0;
this.childPartiallySelectedCount=0;
this._handleImageSwap(false,_1d6);
this._setExpandState();
this._setChildren();
},_onChildChange:function(_1d7,_1d8){
if(_1d8==SelectState.SELECTED&&this.childSelectedCount>0){
this.childSelectedCount--;
}else{
if(_1d8==SelectState.PARTIALLY_SELECTED&&this.childPartiallySelectedCount>0){
this.childPartiallySelectedCount--;
}
}
if(_1d7==SelectState.SELECTED&&(this.childSelectedCount+this.childPartiallySelectedCount)<this.children.length){
this.childSelectedCount++;
}else{
if(_1d7==SelectState.PARTIALLY_SELECTED&&(this.childSelectedCount+this.childPartiallySelectedCount)<this.children.length){
this.childPartiallySelectedCount++;
}
}
this._setState();
},_setState:function(){
var _1d9=this._selectState;
if((this.childPartiallySelectedCount>0&&this._selectState!=SelectState.PARTIALLY_SELECTED)||(this.childSelectedCount>0&&this.childSelectedCount<this.children.length&&this._selectState!=SelectState.PARTIALLY_SELECTED)){
this._selectState=SelectState.PARTIALLY_SELECTED;
this._handleImageSwap(true);
if(_1d9!=SelectState.PARTIALLY_SELECTED){
this._notifyParent(_1d9);
}
}else{
if(this.childSelectedCount==this.children.length&&this._selectState!=SelectState.SELECTED){
this._selectState=SelectState.SELECTED;
this._handleImageSwap(false,true);
if(_1d9!=SelectState.SELECTED){
this._notifyParent(_1d9);
}
}else{
if(this.childSelectedCount+this.childPartiallySelectedCount==0&&this._selectState!=SelectState.NOT_SELECTED){
this._selectState=SelectState.NOT_SELECTED;
this._handleImageSwap(false,false);
this._notifyParent(_1d9);
}
}
}
},_setExpandState:function(){
dojo.debug("_setExpandState "+this.title+","+this.initialExpand);
if((this.isSelected()&&this.hasChildren())||this.initialExpand){
this.expand();
this.initialExpand=false;
}
},_setChildren:function(){
if(this.hasChildren()){
var _1da=this.isSelected();
dojo.lang.forEach(this.children,function(_1db){
_1db._setSelected(_1da);
});
}
},_notifyParent:function(_1dc){
if(this.parent!==null&&this.parent._onChildChange){
this.parent._onChildChange(this._selectState,_1dc);
}
},_publishEvent:function(){
dojo.event.topic.publish(TreeEvents.onTreeSelectionChange,{source:this,selected:this.isSelected()});
},_buildElement:function(){
var str=this._openTag();
str+=this._attributes();
str+=">";
return str;
},_openTag:function(){
return "<Node ";
},_closeTag:function(){
return "</Node>";
},_attributes:function(){
var str="selected=\""+this.isSelected()+"\" ";
str+="title=\""+dojo.string.escape("xml",this.title)+"\" ";
str+="data=\""+dojo.string.escape("xml",this.data)+"\" ";
str+="isFolder=\""+this.isFolder+"\" ";
return str;
},_onSelectClick:function(e){
this.setSelected(this._selectState==SelectState.NOT_SELECTED||this._selectState==SelectState.PARTIALLY_SELECTED);
dojo.event.browser.stopEvent(e);
},_handleImageSwap:function(_1e0,_1e1){
if(!_1e0){
if(_1e1){
if(this.checkBoxNode.src.indexOf("no-hover")!=-1){
this.checkBoxNode.src=noHoverCheck;
}else{
this.checkBoxNode.src=hoverCheck;
}
}else{
if(this.checkBoxNode.src.indexOf("no-hover")!=-1){
this.checkBoxNode.src=noHoverEmpty;
}else{
this.checkBoxNode.src=hoverEmpty;
}
}
}else{
if(this.checkBoxNode.src.indexOf("no-hover")!=-1){
this.checkBoxNode.src=noHoverCross;
}else{
this.checkBoxNode.src=hoverCross;
}
}
},_onHoverOver:function(e){
if(this.checkBoxNode.src.indexOf("no-hover")!=-1){
this.checkBoxNode.src=this.checkBoxNode.src.replace(/no-/,"");
}
},_onHoverOut:function(e){
if(this.checkBoxNode.src.indexOf("no-hover")==-1){
this.checkBoxNode.src=this.checkBoxNode.src.replace(/hover/,"no-hover");
}
},_newChild:function(_1e4,_1e5,_1e6){
_1e4.showSelectBox=this.showSelectBox;
_1e4.propagateSelect=this.propagateSelect;
_1e4.selectOnLabelClick=this.selectOnLabelClick;
_1e4.prefixName=this.prefixName;
if(this.prefixName){
_1e4.widgetId=this.widgetId+"_"+_1e4.widgetId;
}
var _1e7=null;
if(_1e4.more!=="true"){
_1e7=dojo.widget.manager.getWidgetById(_1e4.widgetId);
if(_1e7==null){
_1e7=this._createChild(_1e4);
}else{
if(_1e6){
_1e7.setSelected(_1e4.selected);
}
if(_1e5){
this.removeChild(_1e7);
}else{
if(_1e7.parent==null){
this.addChild(_1e7);
}
_1e7=null;
}
}
}else{
_1e7=dojo.widget.byId(_1e4.widgetId);
if(_1e7!=null){
this.removeChild(_1e7);
_1e7=null;
}else{
_1e7=null;
}
_1e4.index=parseInt(_1e4.index);
_1e4.total=parseInt(_1e4.total);
_1e4.fetchSize=parseInt(_1e4.fetchSize);
if(_1e4.index<=_1e4.total){
_1e7=dojo.widget.createWidget("tree:MoreNode",_1e4);
}
}
if(_1e7!=null){
this.addChild(_1e7);
}
return _1e7;
},_createChild:function(_1e8){
return dojo.widget.createWidget("tree:SelectableTreeNode",_1e8);
},_getDirectives:function(_1e9){
var _1ea={buildElement:false,callChildren:false};
switch(_1e9){
case SelectOption.ALL_NODES:
_1ea.buildElement=true;
_1ea.callChildren=true;
break;
case SelectOption.SELECTED_NODES_ALL:
if(this.isSelected()==true){
_1ea.buildElement=true;
_1ea.callChildren=true;
}
break;
case SelectOption.SELECTED_NODES_CHILDREN_ONLY:
if(this.isSelected()==true){
if(!this.hasChildren()){
_1ea.buildElement=true;
}else{
_1ea.callChildren=true;
}
}
break;
case SelectOption.SELECTED_NODES_PARENT:
if(this.isSelected()==true){
if(this._selectState==SelectState.SELECTED){
_1ea.buildElement=true;
}else{
if(this._selectState==SelectState.PARTIALLY_SELECTED){
_1ea.buildElement=false;
_1ea.callChildren=true;
}
}
}
break;
case SelectOption.SELECTED_NODES_PARENT_CHILDREN:
if(this.isSelected()==true){
_1ea.buildElement=true;
if(this._selectState==SelectState.SELECTED){
_1ea.callChildren=false;
}else{
_1ea.callChildren=true;
}
}
break;
default:
break;
}
return _1ea;
}});
dojo.provide("tree.widget.MoreNode");
dojo.widget.defineWidget("tree.widget.MoreNode",[tree.widget.SelectableTreeNode],{index:0,total:0,fetchSize:0,isFolder:true,displayCounts:true,getInfo:function(){
var info=tree.widget.MoreNode.superclass.getInfo.call(this);
info.parent=this.parent.getInfo();
info.index=this.index;
info.total=this.total;
info.fetchSize=this.fetchSize;
return info;
},expand:function(){
if(this.isExpanded){
var _1ec=this.parent;
_1ec.removeChild(this);
if(this.isSelected()){
_1ec._onChildChange(false);
}
this.destroy();
this._publishEvent();
}else{
this.isExpanded=true;
this.updateExpandIcon();
dojo.event.topic.publish(this.tree.eventNames.expand,{source:this});
}
},_openTag:function(){
return "<More ";
},_closeTag:function(){
return "</More>";
},_attributes:function(){
var str=tree.widget.MoreNode.superclass._attributes.call(this);
str+="index=\""+this.index+"\" ";
str+="total=\""+this.total+"\" ";
str+="fetchSize=\""+this.fetchSize+"\" ";
return str;
},_setTitle:function(){
if(this.displayCounts){
this.title="more("+this.index+" of "+this.total+")...";
}else{
this.title="more...";
}
this.titleNode.innerHTML=this.title;
},fillInTemplate:function(args,frag){
tree.widget.MoreNode.superclass.fillInTemplate.call(this,args,frag);
this._setTitle();
},_newChild:function(_1f0,_1f1){
return this.parent._newChild(_1f0,true,false);
}});
dojo.provide("tree.widget.NameNode");
dojo.widget.defineWidget("tree.widget.NameNode",[dojo.widget.TreeNode],{parseComponents:false,templateString:null,templateString:"<div class=\"dojoTreeNode dojoTreeNameNode\">\n\t<span class=\"dojoTreeNodeLabel\">${this.title}</span>\n  \t<div dojoAttachPoint=\"containerNode\" style=\"display:none\"></div>\n</div>\n",initializer:function(){
tree.widget.NameNode.superclass.initializer.call(this);
},destroy:function(){
tree.widget.NameNode.superclass.destroy.call(this);
},asXML:function(_1f2){
return "";
},isSelected:function(){
return false;
},asObject:function(_1f3){
var node=this.getInfo();
return node;
},_init:function(){
return;
}});
dojo.provide("tree.widget.SeparatorNode");
dojo.widget.defineWidget("tree.widget.SeparatorNode",[dojo.widget.TreeNode],{parseComponents:false,templateString:null,templateString:"<div class=\"dojoTreeNode\">\n\t<hr style=\"width:60%;align:left;color:black;\" noshade=\"noshade\" size=\"3\"/>\n  \t<div style=\"display:none\"></div>\n</div>\n",isExapnded:true,isFolder:false,initializer:function(){
tree.widget.SeparatorNode.superclass.initializer.call(this);
},createDOMNode:function(tree,_1f6){
return this.domNode;
},destroy:function(){
tree.widget.SeparatorNode.superclass.destroy.call(this);
},asXML:function(_1f7){
return "";
},isSelected:function(){
return false;
},asObject:function(_1f8){
var node=this.getInfo();
return node;
},_init:function(){
return;
}});
dojo.provide("dojo.widget.TreeLoadingController");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("dojo.widget.TreeLoadingController",dojo.widget.TreeBasicController,{RPCUrl:"",RPCActionParam:"action",RPCErrorHandler:function(type,obj,evt){
alert("RPC Error: "+(obj.message||"no message"));
},preventCache:true,getRPCUrl:function(_1fd){
if(this.RPCUrl=="local"){
var dir=document.location.href.substr(0,document.location.href.lastIndexOf("/"));
var _1ff=dir+"/"+_1fd;
return _1ff;
}
if(!this.RPCUrl){
dojo.raise("Empty RPCUrl: can't load");
}
return this.RPCUrl+(this.RPCUrl.indexOf("?")>-1?"&":"?")+this.RPCActionParam+"="+_1fd;
},loadProcessResponse:function(node,_201,_202,_203){
if(!dojo.lang.isUndefined(_201.error)){
this.RPCErrorHandler("server",_201.error);
return false;
}
var _204=_201;
if(!dojo.lang.isArray(_204)){
dojo.raise("loadProcessResponse: Not array loaded: "+_204);
}
for(var i=0;i<_204.length;i++){
_204[i]=dojo.widget.createWidget(node.widgetType,_204[i]);
node.addChild(_204[i]);
}
node.state=node.loadStates.LOADED;
if(dojo.lang.isFunction(_203)){
_203.apply(dojo.lang.isUndefined(_202)?this:_202,[node,_204]);
}
},getInfo:function(obj){
return obj.getInfo();
},runRPC:function(kw){
var _208=this;
var _209=function(type,data,evt){
if(kw.lock){
dojo.lang.forEach(kw.lock,function(t){
t.unlock();
});
}
if(type=="load"){
kw.load.call(this,data);
}else{
this.RPCErrorHandler(type,data,evt);
}
};
if(kw.lock){
dojo.lang.forEach(kw.lock,function(t){
t.lock();
});
}
dojo.io.bind({url:kw.url,handle:dojo.lang.hitch(this,_209),mimetype:"text/json",preventCache:_208.preventCache,sync:kw.sync,content:{data:dojo.json.serialize(kw.params)}});
},loadRemote:function(node,sync,_211,_212){
var _213=this;
var _214={node:this.getInfo(node),tree:this.getInfo(node.tree)};
this.runRPC({url:this.getRPCUrl("getChildren"),load:function(_215){
_213.loadProcessResponse(node,_215,_211,_212);
},sync:sync,lock:[node],params:_214});
},expand:function(node,sync,_218,_219){
if(node.state==node.loadStates.UNCHECKED&&node.isFolder){
this.loadRemote(node,sync,this,function(node,_21b){
this.expand(node,sync,_218,_219);
});
return;
}
dojo.widget.TreeBasicController.prototype.expand.apply(this,arguments);
},doMove:function(_21c,_21d,_21e){
if(_21d.isTreeNode&&_21d.state==_21d.loadStates.UNCHECKED){
this.loadRemote(_21d,true);
}
return dojo.widget.TreeBasicController.prototype.doMove.apply(this,arguments);
},doCreateChild:function(_21f,_220,data,_222,_223){
if(_21f.state==_21f.loadStates.UNCHECKED){
this.loadRemote(_21f,true);
}
return dojo.widget.TreeBasicController.prototype.doCreateChild.apply(this,arguments);
}});
dojo.provide("dojo.widget.TreeRPCController");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("dojo.widget.TreeRPCController",dojo.widget.TreeLoadingController,{doMove:function(_224,_225,_226){
var _227={child:this.getInfo(_224),childTree:this.getInfo(_224.tree),newParent:this.getInfo(_225),newParentTree:this.getInfo(_225.tree),newIndex:_226};
var _228;
this.runRPC({url:this.getRPCUrl("move"),load:function(_229){
_228=this.doMoveProcessResponse(_229,_224,_225,_226);
},sync:true,lock:[_224,_225],params:_227});
return _228;
},doMoveProcessResponse:function(_22a,_22b,_22c,_22d){
if(!dojo.lang.isUndefined(_22a.error)){
this.RPCErrorHandler("server",_22a.error);
return false;
}
var args=[_22b,_22c,_22d];
return dojo.widget.TreeLoadingController.prototype.doMove.apply(this,args);
},doRemoveNode:function(node,_230,_231){
var _232={node:this.getInfo(node),tree:this.getInfo(node.tree)};
this.runRPC({url:this.getRPCUrl("removeNode"),load:function(_233){
this.doRemoveNodeProcessResponse(_233,node,_230,_231);
},params:_232,lock:[node]});
},doRemoveNodeProcessResponse:function(_234,node,_236,_237){
if(!dojo.lang.isUndefined(_234.error)){
this.RPCErrorHandler("server",_234.error);
return false;
}
if(!_234){
return false;
}
if(_234==true){
var args=[node,_236,_237];
dojo.widget.TreeLoadingController.prototype.doRemoveNode.apply(this,args);
return;
}else{
if(dojo.lang.isObject(_234)){
dojo.raise(_234.error);
}else{
dojo.raise("Invalid response "+_234);
}
}
},doCreateChild:function(_239,_23a,_23b,_23c,_23d){
var _23e={tree:this.getInfo(_239.tree),parent:this.getInfo(_239),index:_23a,data:_23b};
this.runRPC({url:this.getRPCUrl("createChild"),load:function(_23f){
this.doCreateChildProcessResponse(_23f,_239,_23a,_23c,_23d);
},params:_23e,lock:[_239]});
},doCreateChildProcessResponse:function(_240,_241,_242,_243,_244){
if(!dojo.lang.isUndefined(_240.error)){
this.RPCErrorHandler("server",_240.error);
return false;
}
if(!dojo.lang.isObject(_240)){
dojo.raise("Invalid result "+_240);
}
var args=[_241,_242,_240,_243,_244];
dojo.widget.TreeLoadingController.prototype.doCreateChild.apply(this,args);
}});
dojo.provide("tree.widget.STRPCController");
dojo.widget.defineWidget("tree.widget.STRPCController",[dojo.widget.TreeRPCController],{onTreeFetchFailure:"onTreeFetchFailure",onTreeClick:function(_246){
var node=_246.source;
if(node.isExpanded){
this.expand(node);
}else{
this.collapse(node);
}
},loadProcessResponse:function(node,_249,_24a,_24b){
if(!dojo.lang.isUndefined(_249.error)){
this.RPCErrorHandler("server",_249.error);
return false;
}
var _24c=[];
if(!dojo.lang.isArray(_249)){
dojo.raise("loadProcessResponse: Not array loaded: "+_249);
}
var j=0;
for(var i=0;i<_249.length;i++){
var _24f=node._newChild(_249[i],false,true);
if(_24f!==null){
if(_24f.tree==null){
_24f._init(node.tree);
}else{
_24f.setSelected(node.isSelected());
}
_24c[j++]=_24f;
}
}
node.state=node.loadStates.LOADED;
if(dojo.lang.isFunction(_24b)){
_24b.apply(dojo.lang.isUndefined(_24a)?this:_24a,[node,_24c]);
}
this.onProcessResponse();
},onProcessResponse:function(){
},RPCErrorHandler:function(type,obj,evt){
dojo.event.topic.publish(this.onTreeFetchFailure,{source:this,msg:(obj.message.replace("XMLHttpTransport Error: 403 ","")||"Unable to retrieve data from server, please try again")});
}});
dojo.kwCompoundRequire({common:["tree.widget.SelectableTree","tree.widget.SelectableTreeNode","tree.widget.MoreNode","tree.widget.NameNode","tree.widget.SeparatorNode","tree.widget.STRPCController"],browser:[]});
dojo.provide("tree.widget.*");
dojo.provide("circleup.widget.UserPopup");
dojo.require("circleup.widget.AssetPopup");
dojo.require("circleup.widget.ScalableImage");
dojo.widget.defineWidget("circleup.widget.UserPopup",circleup.widget.AssetPopup,{thumbHeight:"30px",thumbWidth:"30px",previewHeight:"90px",previewWidth:"90px",createThumbnailElement:function(){
var _253=dojo.widget.createWidget("circleup:ScalableImage",{id:this.id+"_img_thumb",cssStyle:"border:0px;display:block;margin:auto;",src:this.src,maxWidth:this.thumbWidth,maxHeight:this.thumbHeight,errorImg:djConfig.staticHost+"/assets/default/web-home/default_image.gif"});
this.thumbnailElement=_253.img;
},createPreviewElement:function(){
var _254=dojo.widget.createWidget("circleup:ScalableImage",{id:this.id+"_img_preview",cssStyle:"position:absolute;zIndex:999;visibility:hidden;border:0px;",src:this.src,showOnLoad:false,maxWidth:this.previewWidth,maxHeight:this.previewHeight,errorImg:djConfig.staticHost+"/assets/default/web-home/default_image.gif"});
this.previewElement=_254.img;
}});
dojo.provide("circleup.widget.DropdownContainer");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.PopupContainer");
dojo.require("circleup.widget.DialogManager");
dojo.widget.defineWidget("circleup.widget.DropdownContainer",[dojo.widget.HtmlWidget,circleup.widget.BoundedForm],{bind:false,useButton:false,buttonCaption:"",widgetsInTemplate:true,iconURL:dojo.uri.moduleUri("circleup.widget","templates/images/combo_box_arrow.png"),iconAlt:"",containerToggle:"plain",containerToggleDuration:150,cssStyle:"",templateImgString:"<div style=\"${this.cssStyle}\"><img src=\"${this.iconURL}\" alt=\"${this.iconAlt}\" dojoAttachEvent=\"onclick:onClick\" dojoAttachPoint=\"buttonNode\" style=\"cursor:pointer;\" /></div>",templateButtonString:"<div style=\"${this.cssStyle}\"><div dojoType=\"circleup:CUButton\" dojoAttachEvent=\"onClick:onClick\" dojoAttachPoint=\"buttonNode\"/>${this.buttonCaption}</div></div>",templateCssPath:"",isContainer:true,buttonNode:null,buildRendering:function(args,frag){
this.templateString=(this.useButton)?this.templateButtonString:this.templateImgString;
circleup.widget.DropdownContainer.superclass.buildRendering.apply(this,arguments);
},attachTemplateNodes:function(){
var _257="_pc"+this.widgetId;
this.popup=dojo.widget.byId(_257);
if(this.popup==null){
this.popup=dojo.widget.createWidget("PopupContainer",{widgetId:_257,toggle:this.containerToggle,toggleDuration:this.containerToggleDuration});
}else{
dojo.dom.removeChildren(this.popup.domNode);
}
this.containerNode=this.popup.domNode;
circleup.widget.DropdownContainer.superclass.attachTemplateNodes.apply(this,arguments);
dojo.event.connect(this.popup,"close",this,"_onHide");
},fillInTemplate:function(args,frag){
this.domNode.appendChild(this.popup.domNode);
if(this.id){
this.domNode.id=this.id;
}
},postInitialize:function(args,frag,_25c){
frag["dojoDontFollow"]=true;
circleup.widget.DropdownContainer.superclass.postInitialize.call(this,args,frag,_25c);
},postCreate:function(e){
this._bindForm();
},onPopupShow:function(){
},onPopupHide:function(){
},onClick:function(evt){
var mgr=circleup.widget.DialogManager.getInstance();
if(this.disabled){
return;
}
if(!this.popup.isShowingNow){
this.onPopupShow();
if(this.useButton){
this.popup.open(this.buttonNode.domNode,this,this.buttonNode.domNode);
}else{
this.popup.open(this.buttonNode,this,this.buttonNode);
}
this.popup.domNode.style.zIndex=(mgr.getZindex()+mgr.ZINDEX_INCR/2).toString();
dojo.event.topic.subscribe("drag.start",this,"_onEvent");
dojo.event.topic.subscribe("dialog.pop",this,"_onEvent");
mgr.disconnect();
}else{
this.onPopupHide();
this.hideContainer();
}
},hideContainer:function(){
if(this.popup.isShowingNow){
this.popup.close();
}
},_onEvent:function(e){
var _261=parseInt(this.popup.domNode.style.zIndex);
if(circleup.widget.DialogManager.getInstance().getZindex()>_261){
return;
}
this.hideContainer();
},_onHide:function(){
var mgr=circleup.widget.DialogManager.getInstance();
mgr.connect();
dojo.event.topic.unsubscribe("drag.start",this,"_onEvent");
dojo.event.topic.unsubscribe("dialog.pop",this,"_onEvent");
}});
dojo.provide("circleup.widget.MovableDialog");
dojo.require("circleup.widget.Dialog");
dojo.require("circleup.widget.Movable");
dojo.require("circleup.widget.ManagedDialog");
dojo.widget.defineWidget("circleup.widget.MovableDialog",[circleup.widget.Dialog,circleup.widget.Movable,circleup.widget.ManagedDialog,circleup.widget.Shimmable],{cssStyle:"",cssClass:"",_cssText:"",templateString:"<div id=\"${this.widgetId}\" class=\"dojoDialog\" dojoattachpoint=\"wrapper\">\n\t<span dojoattachpoint=\"tabStartOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\"\ttabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabStart\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<div dojoattachpoint=\"containerNode\" style=\"${this.cssStyle}\" class=\"${this.cssClass}\"></div>\n\t<span dojoattachpoint=\"tabEnd\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabEndOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n</div>\n",fillInTemplate:function(){
circleup.widget.MovableDialog.superclass.fillInTemplate.call(this);
this._initMovable();
this._initManagedDialog();
},postCreate:function(){
this._shimmed=this.wrapper;
circleup.widget.MovableDialog.superclass.postCreate.call(this);
},show:function(){
circleup.widget.MovableDialog.superclass.show.call(this);
if(this.containerNode!==null&&this._cssText!==""){
this.containerNode.style.cssText=this._cssText;
}
this._setShim();
},placeModalDialog:function(){
circleup.widget.MovableDialog.superclass.placeModalDialog.call(this);
this._setShim();
},_onScroll:function(){
circleup.widget.MovableDialog.superclass._onScroll.call(this);
this._setShim();
},_onResize:function(){
circleup.widget.MovableDialog.superclass._onResize.call(this);
this._setShim();
},onResized:function(){
circleup.widget.MovableDialog.superclass.onResized.call(this);
this._setShim();
},onLoad:function(){
circleup.widget.MovableDialog.superclass.onLoad.call(this);
this._setShim();
},onHide:function(){
circleup.widget.MovableDialog.superclass.onHide.call(this);
this._hideShim();
},_initMovable:function(){
this.initMovable(this.wrapper);
}});
dojo.provide("circleup.widget.ConfirmDialog");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("circleup.widget.CUDialog");
dojo.require("circleup.widget.Themes");
var ConfirmDialogTypes={YES_NO:"yn",OK:"ok"};
dojo.widget.defineWidget("circleup.widget.ConfirmDialog",[dojo.widget.HtmlWidget],{isContainer:true,widgetsInTemplate:true,parseComponents:false,title:"Confirm",enableDragging:"true",positioning:"CENTERED",top:"20px",left:"auto",type:ConfirmDialogTypes.OK,theme:djConfig.theme,templateCssString:".msgDialogError {\n    font-family: Verdana, Arial;\n    width: 100%;\n    padding: 0px;\n    color: #c90202;\n}\n.msgDialogMsg {\n    font-family: Verdana, Arial;\n    width: 100%;\n    padding: 0px;\n    color: #000000;\n}\n",templateCssString:".msgDialogError {\n    font-family: Verdana, Arial;\n    width: 100%;\n    padding: 0px;\n    color: #c90202;\n}\n.msgDialogMsg {\n    font-family: Verdana, Arial;\n    width: 100%;\n    padding: 0px;\n    color: #000000;\n}\n",templateCssPath:dojo.uri.moduleUri("circleup.widget","template/css/MsgDialog.css"),templateString:"<div dojoattachpoint=\"containerNode\">\n\t<div dojoType=\"circleup:CUDialog\" \n\t     dojoattachpoint=\"_dialog\"\n\t     id=\"${this.widgetId}_dialog\"\n\t     widgetId=\"${this.widgetId}_dialog\"\n\t     dialogTitleStr=\"${this.dialogTitleStr}\"\n\t     followScroll=\"${this.followScroll}\"\n\t     parseComponents=\"false\"\n\t     bind=\"false\"\n\t     enableDragging=\"${this.enableDragging}\"\n\t     positioning=\"${this.positioning}\"\n\t     top=\"${this.top}\"\n\t     left=\"${this.left}\"\n\t     style=\"display:none;\">\n\t\t<div style=\"width:300px;font-size:12px;text-align:center;\">\n\t\t\t<div dojoattachpoint=\"_msgArea\" \n\t\t\t     class=\"msgDialogMsg\" \n\t\t\t     style=\"display:block;margin:25px auto 25px auto;overflow:hidden;\">&nbsp</div>\n\t\t\t\t<table align=\"center\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div dojoType=\"circleup:CUButton\"\n\t\t\t\t\t\t\t     id=\"${this.widgetId}_ok\" \n\t\t\t\t\t\t\t     widgetId=\"${this.widgetId}_ok\" \n\t\t\t\t\t\t\t     dojoattachpoint=\"_okButton\"    \n\t\t\t\t\t\t\t     theme=\"${this.theme}\"\n\t\t\t\t\t\t\t     cssStyle=\"float:right;\"\n\t\t\t\t\t\t\t     onclick=\"return false;\">Ok</div>\n\t\t\t\t\t\t</td>\n\t\t\t        \t<td>\n\t\t\t        \t\t<div dojoType=\"circleup:CUButton\" \n\t\t\t\t\t\t\t     id=\"${this.widgetId}_cancel\" \n\t\t\t\t\t\t\t     widgetId=\"${this.widgetId}_cancel\" \n\t\t\t\t\t\t\t     dojoattachpoint=\"_cancelButton\"    \n\t\t\t\t\t\t\t     theme=\"${this.theme}\"\n\t\t\t\t\t\t\t     cssStyle=\"float:left;\"\n\t\t\t        \t\t     onclick=\"return false;\">Cancel</button>\n\t\t\t\t\t\t</td>\n\t\t\t      </tr>\n\t\t\t  </table>\n\t\t</div>\n\t</div>\n</div>\n\t\n",followScroll:false,dialogTitleStr:"Confirm",_dialog:null,_msgArea:null,_okButton:null,_cancelButton:null,_buttonText:null,buildRendering:function(args,frag){
if(this.theme==null){
this.theme=Themes.CU;
}
this._buttonText=new Array();
this._buttonText[ConfirmDialogTypes.OK]={ok:"Ok",cancel:"Cancel"};
this._buttonText[ConfirmDialogTypes.YES_NO]={ok:"Yes",cancel:"No"};
register(this.widgetId+"_dialog",this.widgetId);
register(this.widgetId+"_ok",this.widgetId+"_dialog");
register(this.widgetId+"_cancel",this.widgetId+"_dialog");
circleup.widget.ConfirmDialog.superclass.buildRendering.apply(this,arguments);
},postCreate:function(){
dojo.event.connect(this._okButton,"onClick",this,"onOk");
dojo.event.connect(this._cancelButton,"onClick",this,"onCancel");
},setTitle:function(_265){
this.title=_265;
},setType:function(type){
this.type=type;
},onShow:function(){
var _267=this._okButton;
window.setTimeout(function(){
_267.focus();
},100);
},onHide:function(){
},onOk:function(){
this.hide();
},onCancel:function(){
this.hide();
},showMsg:function(msg){
this._okButton.setCaption(this._buttonText[this.type].ok);
this._cancelButton.setCaption(this._buttonText[this.type].cancel);
this._msgArea.className="info dialog";
this._dialog.setTitle(this.title);
this._msgArea.innerHTML=msg;
this._dialog.show();
this.onShow();
},hide:function(){
this._dialog.hide();
this.onHide();
},destroy:function(e){
this._okButton.destroy();
this._cancelButton.destroy();
this._okButton=null;
this._cancelButton=null;
this._dialog.destroy();
this._dialog=null;
circleup.widget.ConfirmDialog.superclass.destroy.call(this);
}});
dojo.provide("circleup.widget.ContactNode");
dojo.widget.defineWidget("circleup.widget.ContactNode",[tree.widget.SelectableTreeNode],{contactIcon:"",isFolder:false,templateString:null,templateString:"<div class=\"dojoTreeNode\">\n\t<span treeNode=\"${this.widgetId}\" class=\"dojoTreeNodeLabel\" dojoAttachPoint=\"labelNode\">\n\t<img src=\"${this.noHoverEmpty}\" dojoAttachPoint=\"checkBoxNode\" dojoAttachEvent=\"onMouseOver: _onHoverOver; onMouseOut: _onHoverOut; onClick: _onSelectClick\"/>\n\t<img src=\"${this.circleGraphic}\" width=\"16\" height=\"16\"/>\n\t\t<span dojoAttachPoint=\"titleNode\" dojoAttachEvent=\"onClick: onTitleClick\" dojoAttachEvent=\"onClick: _onSelectClick\" class=\"dojoTreeNodeLabelTitle\" style=\"font-weight:normal;\">\n\t\t\t${this.title}\n\t\t</span>\n\t</span>\n\t<span class=\"dojoTreeNodeAfterLabel\" dojoAttachPoint=\"afterLabelNode\">${this.afterLabel}</span>\n  <div dojoAttachPoint=\"containerNode\" style=\"display:none\"></div>\n</div>\n",circleGraphic:circleup.widget.utils.asset("circleup.widget","template/images/icon_contact.png"),getInfo:function(){
var info=circleup.widget.ContactNode.superclass.getInfo.call(this);
info.contactIcon=this.contactIcon;
return info;
},_openTag:function(){
return "<Contact ";
},_closeTag:function(){
return "</Contact>";
},_init:function(){
circleGraphic:
circleup.widget.utils.asset("circleup.widget","template/images/icon_contact.png");
circleup.widget.ContactNode.superclass._init.call(this);
}});
dojo.provide("circleup.widget.CircleNode");
dojo.widget.defineWidget("circleup.widget.CircleNode",[tree.widget.SelectableTreeNode],{circleIcon:"",isFolder:true,isOwner:true,isExternal:false,templateString:null,templateString:"<div class=\"dojoTreeNode\">\n\t<span treeNode=\"${this.widgetId}\" class=\"dojoTreeNodeLabel\" dojoAttachPoint=\"labelNode\">\n\t<img src=\"${this.noHoverEmpty}\" dojoAttachPoint=\"checkBoxNode\" dojoAttachEvent=\"onMouseOver: _onHoverOver; onMouseOut: _onHoverOut; onClick: _onSelectClick\"/>\n\t<img src=\"${this.circleGraphic}\" width=\"16\" height=\"16\"/>\n\t\t<span dojoAttachPoint=\"titleNode\" dojoAttachEvent=\"onClick: onTitleClick\" dojoAttachEvent=\"onClick: _onSelectClick\" class=\"dojoTreeNodeLabelTitle\" style=\"font-weight:normal;\">\n\t\t\t${this.title}\n\t\t</span>\n\t</span>\n\t<span class=\"dojoTreeNodeAfterLabel\" dojoAttachPoint=\"afterLabelNode\">${this.afterLabel}</span>\n  <div dojoAttachPoint=\"containerNode\" style=\"display:none\"></div>\n</div>\n",circleGraphic:"",getInfo:function(){
var info=circleup.widget.CircleNode.superclass.getInfo.call(this);
info.circleIcon=this.circleIcon;
info.circleGraphic=this.circleGraphic;
info.isOwner=this.isOwner;
info.isExternal=this.isExternal;
return info;
},_createChild:function(_26c){
if(_26c.type!="GROUP"){
_26c.isOwner=this.isOwner;
_26c.isExternal=this.isExternal;
return dojo.widget.createWidget("circleup:ContactNode",_26c);
}else{
return dojo.widget.createWidget("circleup:CircleNode",_26c);
}
},_openTag:function(){
return "<Circle ";
},_closeTag:function(){
return "</Circle>";
}});
dojo.provide("circleup.widget.QuestionBox");
dojo.widget.defineWidget("circleup.widget.QuestionBox",[circleup.widget.MovableDialog],{templateString:"<div id=\"${this.widgetId}\" class=\"dojoDialog\" dojoattachpoint=\"wrapper\" style=\"width:100%;\">\n\t<span dojoattachpoint=\"tabStartOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\"\ttabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabStart\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<div dojoattachpoint=\"containerNode\" style=\"position: relative; z-index: 2;width:100%;\"></div>\n\t<span dojoattachpoint=\"tabEnd\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabEndOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n</div>\n",loadingMessage:"<table><tr><td/></tr></table><div style='display:block;margin:auto;height:700px;width:250px;'><div style='position:relative;top:45%;font-weight:bold;font-family:Verdana,Arial;font-size:20px;color:#777777;text-align:center;'>Loading...</div></div>",cacheContent:false,addStyles:false,widgetsInTemplate:true,parseComponents:false,positioning:"FIXED",top:"20px",left:"0px",enableDragging:true,scriptSeparation:false,executeScripts:true,useShim:false,preload:true,_initMovable:function(){
},setUrl:function(url){
if(url.indexOf("?")>0){
url+="&parentId="+this.widgetId;
}else{
url+="?parentId="+this.widgetId;
}
circleup.widget.QuestionBox.superclass.setUrl.call(this,url);
},onHide:function(){
circleup.widget.QuestionBox.superclass.onHide.call(this);
this.useShim=false;
},onLoad:function(){
circleup.widget.QuestionBox.superclass.onLoad.call(this);
this.initMovable(this.wrapper,dojo.byId("boxhead"));
this.useShim=true;
this._shimmed=dojo.byId("qbox");
this._setShim();
}});
dojo.provide("circleup.widget.LoginDialog");
dojo.require("circleup.widget.CUDialog");
dojo.widget.defineWidget("circleup.widget.LoginDialog",[circleup.widget.CUDialog],{bind:false,preload:true,enableDragging:false,positioning:Positions.FIXED,top:"5%",left:"45%",followScroll:false,dialogTitleStr:"Login",href:"/auth/loginView.jsp",onLoad:function(){
}});
dojo.provide("circleup.widget.DropdownMenu");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Menu2");
var DD_on=circleup.widget.utils.asset("circleup.widget","template/images/Dropdown_icon_on.png");
var DD_over=circleup.widget.utils.asset("circleup.widget","template/images/Dropdown_icon_over.png");
function loadDDImages(){
circleup.widget.utils.preloadImages(DD_on,DD_over);
}
dojo.addOnLoad(function(){
window.setTimeout(loadDDImages,2000);
});
dojo.widget.defineWidget("circleup.widget.DropdownMenu",dojo.widget.HtmlWidget,{widgetsInTemplate:true,isContainer:true,parseComponents:false,dataSet:"",data:"",DD_on:DD_on,DD_over:DD_over,button:null,menu:null,cssStyle:"",cssClass:"",cssLabelStyle:"font-family:arial;font-size:6px;",cssButtonStyle:"display:block;",hoverElement:"",toggleOnHover:false,_isOver:false,_isInside:false,_isMenuShowing:false,_isShowing:false,_outTimer:null,templateString:"<div dojoattachpoint=\"containerNode\"\n     class=\"${this.cssClass}\"\n     style=\"${this.cssStyle};display:none;\">\n\t<div style=\"float:left;cursor:pointer;${this.cssLabelStyle}\"\n\t   dojoattachevent=\"onMouseOver; onMouseOut; onMouseDown; onMouseUp : _stopEvent; onClick : _stopEvent;\"\n        >Actions</div>\n\t<img src=\"${this.DD_on}\" \n\t     border=\"0\" \n\t     id=\"${this.widgetId}_button\"\n\t     title=\"\"\n\t     style=\"margin:auto;${this.cssButtonStyle}\"\n\t     dojoattachevent=\"onMouseOver; onMouseOut; onMouseDown; onMouseUp : _stopEvent; onClick : _stopEvent;\"\n\t     dojoattachpoint=\"button\"/>\n</div>\n",postMixInProperties:function(args,frag){
dojo.dom.removeChildren(this.getFragNodeRef(frag));
circleup.widget.DropdownMenu.superclass.postMixInProperties.call(this,arguments);
},postCreate:function(){
if(this.toggleOnHover&&this.hoverElement!=""){
var ele=dojo.byId(this.hoverElement);
if(ele!=null){
dojo.event.connect(ele,"onmouseover",this,"onMouseOverHoverElement");
dojo.event.connect(ele,"onmouseout",this,"onMouseOutHoverElement");
}
}else{
this.domNode.style.display="";
}
this._init();
},showButton:function(){
this.domNode.style.display="block";
this._isShowing=true;
},hideButton:function(){
this.domNode.style.display="none";
this._isShowing=false;
},openMenu:function(e){
this.menu.open(e.currentTarget,null,e.currentTarget);
if(djConfig.onAnalyticsEvent){
djConfig.onAnalyticsEvent("EVENT",{"category":"DropdownMenu","action":"Open","opt_label":this.widgetId});
}
},closeMenu:function(){
this.menu.close();
if(djConfig.onAnalyticsEvent){
djConfig.onAnalyticsEvent("EVENT",{"category":"DropdownMenu","action":"Close","opt_label":this.widgetId});
}
},onMouseOver:function(e){
this.domNode.style.display="block";
this._isShowing=true;
if(!this._isMenuShowing){
this.button.src=this.DD_over;
}
this._isOver=true;
},onMouseOut:function(e){
this.domNode.style.display="block";
this._isShowing=true;
if(!this._isMenuShowing){
this.button.src=this.DD_on;
}
this._isOver=false;
},onMouseOverHoverElement:function(e){
this.domNode.style.display="block";
this._isShowing=true;
if(!this._isOver&&!this._isMenuShowing){
this.button.src=this.DD_on;
}
this._isInside=true;
},onMouseOutHoverElement:function(e){
this._isInside=false;
var self=this;
if(this._outTimer){
window.clearTimeout(this._outTimer);
}
this._outTimer=window.setTimeout(function(){
if(!self._isInside&&!self._isOver&&!self._isMenuShowing){
self.domNode.style.display="none";
this._isShowing=false;
}
self._outTimer=null;
},50);
},onMouseDown:function(e){
if(this.menu.isShowingNow){
this.closeMenu();
}else{
this.openMenu(e);
}
this._stopEvent(e);
},_stopEvent:function(e){
dojo.event.browser.stopEvent(e);
},onClick:function(item){
if(djConfig.onAnalyticsEvent){
djConfig.onAnalyticsEvent("EVENT",{"category":"DropdownMenu","action":"Click","opt_label":item.caption});
}
item.onClickDelegate(this.data);
},isMenuShowing:function(){
return this._isMenuShowing;
},onMenuShow:function(){
},onMenuHide:function(){
},_onMenuShow:function(){
this._isMenuShowing=true;
this.onMenuShow();
},_onMenuHide:function(){
this._isMenuShowing=false;
if(!this._isOver){
this.onMouseOut();
}
if(this.hoverElement!=""&&!this._isInside){
this.onMouseOutHoverElement();
}
this.onMenuHide();
},_init:function(){
if(typeof window[this.dataSet]!=="undefined"){
var _27a=circleup.widget.utils.clone(window[this.dataSet]);
this.menu=this._addMenu(_27a);
dojo.event.connect(this.menu,"onShow",this,"_onMenuShow");
dojo.event.connect(this.menu,"onHide",this,"_onMenuHide");
}
},_addMenu:function(_27b){
var menu=dojo.widget.createWidget("PopupMenu2",{templateCssPath:this.templateCssPath,parseComponents:false,templateCssString:""});
this.addChild(menu);
this._addItems(menu,_27b);
return menu;
},_addItems:function(menu,_27e){
var _27f=this;
dojo.lang.forEach(_27e,function(item){
item.templateCssPath=_27f.templateCssPath;
item.onClickDelegate=item.onClick;
item.parseComponents=false;
item.onClick=function(){
_27f.onClick(item);
};
var _281=dojo.widget.createWidget("MenuItem2",item);
menu.addChild(_281);
_281.domNode.style.display="";
if(typeof item.children!=="undefined"){
var _282=_27f._addMenu(item.children);
_281.submenuId=_282.widgetId;
}
});
}});
dojo.provide("circleup.widget.CircleTree");
dojo.widget.defineWidget("circleup.widget.CircleTree",[tree.widget.SelectableTree],{_newWidget:function(_283){
_283.showSelectBox=this.showSelectBox;
_283.propagateSelect=this.propagateSelect;
_283.selectOnLabelClick=this.selectOnLabelClick;
_283.prefixName=this.prefixName;
if(this.prefixName){
_283.widgetId=this.widgetId+"_"+_283.widgetId;
}
var _284;
if(_283.nameNode){
_284=dojo.widget.createWidget("tree:NameNode",_283);
}else{
if(_283.separator){
_284=dojo.widget.createWidget("tree:SeparatorNode",_283);
}else{
_284=dojo.widget.createWidget("circleup:CircleNode",_283);
}
}
this.addChild(_284);
return _284;
},isEmpty:function(){
var _285=true;
for(var i=0;i<this.children.length;i++){
if(this.children[i].widgetType=="CircleNode"){
_285=false;
break;
}
}
return _285;
}});
dojo.provide("dojo.lfx.shadow");
dojo.require("dojo.lang.common");
dojo.require("dojo.uri.Uri");
dojo.lfx.shadow=function(node){
this.shadowPng=dojo.uri.moduleUri("dojo.html","images/shadow");
this.shadowThickness=8;
this.shadowOffset=15;
this.init(node);
};
dojo.extend(dojo.lfx.shadow,{init:function(node){
this.node=node;
this.pieces={};
var x1=-1*this.shadowThickness;
var y0=this.shadowOffset;
var y1=this.shadowOffset+this.shadowThickness;
this._makePiece("tl","top",y0,"left",x1);
this._makePiece("l","top",y1,"left",x1,"scale");
this._makePiece("tr","top",y0,"left",0);
this._makePiece("r","top",y1,"left",0,"scale");
this._makePiece("bl","top",0,"left",x1);
this._makePiece("b","top",0,"left",0,"crop");
this._makePiece("br","top",0,"left",0);
},_makePiece:function(name,_28d,_28e,_28f,_290,_291){
var img;
var url=this.shadowPng+name.toUpperCase()+".png";
if(dojo.render.html.ie55||dojo.render.html.ie60){
img=dojo.doc().createElement("div");
img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+url+"'"+(_291?", sizingMethod='"+_291+"'":"")+")";
}else{
img=dojo.doc().createElement("img");
img.src=url;
}
img.style.position="absolute";
img.style[_28d]=_28e+"px";
img.style[_28f]=_290+"px";
img.style.width=this.shadowThickness+"px";
img.style.height=this.shadowThickness+"px";
this.pieces[name]=img;
this.node.appendChild(img);
},size:function(_294,_295){
var _296=_295-(this.shadowOffset+this.shadowThickness+1);
if(_296<0){
_296=0;
}
if(_295<1){
_295=1;
}
if(_294<1){
_294=1;
}
with(this.pieces){
l.style.height=_296+"px";
r.style.height=_296+"px";
b.style.width=(_294-1)+"px";
bl.style.top=(_295-1)+"px";
b.style.top=(_295-1)+"px";
br.style.top=(_295-1)+"px";
tr.style.left=(_294-1)+"px";
r.style.left=(_294-1)+"px";
br.style.left=(_294-1)+"px";
}
}});
dojo.provide("circleup.widget.AutoCompleteSuggestionBox");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("circleup.widget.DialogManager");
dojo.widget.defineWidget("circleup.widget.AutoCompleteSuggestionBox",dojo.widget.HtmlWidget,{templateString:"<div class=\"asholder\">\n\t<input type=\"text\" \n\t       id=\"testinput_xml\" \n\t       dojoattachpoint=\"inputBox\" \n\t       value=\"${this.value}\"\n\t       class=\"composer_subject_text_area\" /> \n</div>\n",inputBox:null,dataSource:"",value:"",auto:null,postCreate:function(){
var _297={json:true,dataSource:this.dataSource,script:function(_298){
return this.dataSource+"?question="+_298+"&preventCache="+new Date().getTime();
}};
this.auto=new bsn.AutoSuggest(this.inputBox.id,_297);
dojo.event.connect(this.auto,"onSuggestion",this,"onSuggestion");
dojo.event.connect(this.auto,"onError",this,"onError");
},onSuggestion:function(data){
},onError:function(data){
},destroy:function(){
dojo.event.disconnect(this.auto,"onSuggestion",this,"onSuggestion");
dojo.event.disconnect(this.auto,"onError",this,"onError");
this.auto.cleanup();
this.auto=null;
circleup.widget.AutoCompleteSuggestionBox.superclass.destroy.call(this);
},focus:function(data){
this.inputBox.focus();
}});
if(typeof (bsn)=="undefined"){
_b=bsn={};
}
if(typeof (_b.Autosuggest)=="undefined"){
_b.Autosuggest={};
}
_b.AutoSuggest=function(id,_29d,_29e){
if(!document.getElementById){
alert("No document.getElementById");
}
this.fld=_b.DOM.gE(id);
if(!this.fld){
return 0;
}
this.sInp="";
this.nInpC=0;
this.aSug=[];
this.iHigh=0;
this.isActive=false;
this.oP=_29d?_29d:{};
var k,def={minchars:1,meth:"get",varname:"input",className:"autosuggest",timeout:5000,delay:500,offsety:0,shownoresults:false,noresults:"No results!",maxheight:250,cache:true,maxentries:25};
for(k in def){
if(typeof (this.oP[k])!=typeof (def[k])){
this.oP[k]=def[k];
}
}
var p=this;
this.fld.onkeypress=function(ev){
return p.onKeyPress(ev);
};
this.fld.onkeyup=function(ev){
return p.onKeyUp(ev);
};
this.fld.setAttribute("autocomplete","off");
};
_b.AutoSuggest.prototype.onKeyPress=function(ev){
var key=(window.event)?window.event.keyCode:ev.keyCode;
var _2a6=13;
var TAB=9;
var ESC=27;
var _2a9=1;
switch(key){
case _2a6:
this.setHighlightedValue();
_2a9=0;
break;
case ESC:
this.clearSuggestions();
_2a9=0;
break;
}
return _2a9;
};
_b.AutoSuggest.prototype.onKeyUp=function(ev){
var key=(window.event)?window.event.keyCode:ev.keyCode;
var _2ac=38;
var _2ad=40;
var _2ae=1;
switch(key){
case _2ac:
this.changeHighlight(key);
_2ae=0;
break;
case _2ad:
this.changeHighlight(key);
_2ae=0;
break;
default:
this.getSuggestions(this.fld.value);
}
return _2ae;
};
_b.AutoSuggest.prototype.getSuggestions=function(val){
this.isActive=true;
var _2b0=this;
this.fld.onblur=function(){
_2b0.clearSuggestions();
};
if(val==this.sInp){
return 0;
}
_b.DOM.remE(this.idAs);
this.sInp=val;
if(val.length<this.oP.minchars){
this.aSug=[];
this.nInpC=val.length;
return 0;
}
var ol=this.nInpC;
this.nInpC=val.length?val.length:0;
var l=this.aSug.length;
if(this.nInpC>ol&&l&&l<this.oP.maxentries&&this.oP.cache){
var arr=[];
for(var i=0;i<l;i++){
if(this.aSug[i].value.substr(0,val.length).toLowerCase()==val.toLowerCase()){
arr.push(this.aSug[i]);
}
}
this.aSug=arr;
this.createList(this.aSug);
return false;
}else{
var _2b0=this;
var _2b5=this.sInp;
clearTimeout(this.ajID);
this.ajID=setTimeout(function(){
_2b0.doAjaxRequest(_2b5);
},this.oP.delay);
}
return false;
};
_b.AutoSuggest.prototype.doAjaxRequest=function(_2b6){
if(_2b6!=this.fld.value){
return false;
}
var _2b7=this;
if(typeof (this.oP.script)=="function"){
var url=this.oP.script(encodeURIComponent(this.sInp));
}else{
var url=this.oP.script+this.oP.varname+"="+encodeURIComponent(this.sInp);
}
if(!url){
return false;
}
var meth=this.oP.meth;
var _2b6=this.sInp;
var _2ba=function(req){
_2b7.setSuggestions(req,_2b6);
};
var _2bc=function(_2bd){
_2b7.onError("AJAX Error: "+_2bd);
};
var _2be=new _b.Ajax();
_2be.makeRequest(url,meth,_2ba,_2bc);
};
_b.AutoSuggest.prototype.setSuggestions=function(req,_2c0){
if(_2c0!=this.fld.value||this.isActive==false){
return false;
}
this.aSug=[];
if(this.oP.json){
var _2c1=eval("("+req.responseText+")");
for(var i=0;i<_2c1.length;i++){
this.aSug.push({"id":_2c1[i].id,"value":_2c1[i].value,"info":_2c1[i].info});
}
}else{
var xml=req.responseXML;
var _2c4=xml.getElementsByTagName("results")[0].childNodes;
for(var i=0;i<_2c4.length;i++){
if(_2c4[i].hasChildNodes()){
this.aSug.push({"id":_2c4[i].getAttribute("id"),"value":_2c4[i].childNodes[0].nodeValue,"info":_2c4[i].getAttribute("info")});
}
}
}
this.idAs="as_"+this.fld.id;
this.createList(this.aSug);
};
_b.AutoSuggest.prototype.createList=function(arr){
var _2c6=this;
_b.DOM.remE(this.idAs);
this.killTimeout();
if(arr.length==0&&!this.oP.shownoresults){
return false;
}
var div=_b.DOM.cE("div",{id:this.idAs,className:this.oP.className});
var _2c8=_b.DOM.cE("div",{className:"as_corner"});
var hbar=_b.DOM.cE("div",{className:"as_bar"});
var _2ca=_b.DOM.cE("div",{className:"as_header"});
_2ca.appendChild(_2c8);
_2ca.appendChild(hbar);
div.appendChild(_2ca);
var ul=_b.DOM.cE("ul",{id:"as_ul"});
for(var i=0;i<arr.length;i++){
var _2cd=arr[i].value;
var span=_b.DOM.cE("span",{},_2cd,true);
if(arr[i].info!=""){
var br=_b.DOM.cE("br",{});
span.appendChild(br);
var _2d0=_b.DOM.cE("small",{},arr[i].info);
span.appendChild(_2d0);
}
var a=_b.DOM.cE("a",{href:"#"});
a.appendChild(span);
a.name=i+1;
a.onmousedown=function(){
_2c6.setHighlightedValue();
return false;
};
a.onmouseover=function(){
_2c6.setHighlight(this.name);
};
var li=_b.DOM.cE("li",{},a);
ul.appendChild(li);
}
if(arr.length==0&&this.oP.shownoresults){
var li=_b.DOM.cE("li",{className:"as_warning"},this.oP.noresults);
ul.appendChild(li);
}
div.appendChild(ul);
var _2d3=_b.DOM.cE("div",{className:"as_corner"});
var fbar=_b.DOM.cE("div",{className:"as_bar"});
var _2d5=_b.DOM.cE("div",{className:"as_footer"});
_2d5.appendChild(_2d3);
_2d5.appendChild(fbar);
div.appendChild(_2d5);
div.style.position="relative";
var div2=circleup.widget.utils.addShadow(div);
var pos=dojo.html.abs(this.fld,true);
var dim=dojo.html.getBorderBox(this.fld);
div2.style.position="absolute";
div2.style.left=pos.x+"px";
div2.style.top=(pos.y+dim.height+this.oP.offsety)+"px";
div.style.width=(dim.width-50)+"px";
div2.style.zIndex=circleup.widget.DialogManager.getInstance().getZindex().toString();
div.onmouseover=function(){
_2c6.killTimeout();
};
div.onmouseout=function(){
_2c6.resetTimeout();
};
document.getElementsByTagName("body")[0].appendChild(div2);
this.iHigh=0;
dojo.event.topic.subscribe("drag.start",this,"clearSuggestions");
dojo.event.topic.subscribe("dialog.pop",this,"clearSuggestions");
var _2c6=this;
this.toID=setTimeout(function(){
_2c6.clearSuggestions();
},this.oP.timeout);
};
_b.AutoSuggest.prototype.changeHighlight=function(key){
var list=_b.DOM.gE("as_ul");
if(!list){
return false;
}
var n;
if(key==40){
n=this.iHigh+1;
}else{
if(key==38){
n=this.iHigh-1;
}
}
if(n>list.childNodes.length){
n=list.childNodes.length;
}
if(n<1){
n=1;
}
this.setHighlight(n);
};
_b.AutoSuggest.prototype.setHighlight=function(n){
var list=_b.DOM.gE("as_ul");
if(!list){
return false;
}
if(this.iHigh>0){
this.clearHighlight();
}
this.iHigh=Number(n);
list.childNodes[this.iHigh-1].className="as_highlight";
this.killTimeout();
};
_b.AutoSuggest.prototype.clearHighlight=function(){
var list=_b.DOM.gE("as_ul");
if(!list){
return false;
}
if(this.iHigh>0){
list.childNodes[this.iHigh-1].className="";
this.iHigh=0;
}
};
_b.AutoSuggest.prototype.setHighlightedValue=function(){
if(this.iHigh){
this.sInp=this.fld.value=this.aSug[this.iHigh-1].value;
this.fld.focus();
this.clearSuggestions();
this.onSuggestion(this.aSug[this.iHigh-1]);
}
};
_b.AutoSuggest.prototype.onSuggestion=function(data){
};
_b.AutoSuggest.prototype.onError=function(data){
};
_b.AutoSuggest.prototype.killTimeout=function(){
clearTimeout(this.toID);
};
_b.AutoSuggest.prototype.resetTimeout=function(){
clearTimeout(this.toID);
var _2e1=this;
this.toID=setTimeout(function(){
_2e1.clearSuggestions();
},2000);
};
_b.AutoSuggest.prototype.cleanup=function(){
this.clearSuggestions();
if(this.fld!=null){
this.fld.onkeypress=null;
this.fld.onkeyup=null;
this.fld=null;
}
};
_b.AutoSuggest.prototype.clearSuggestions=function(){
dojo.event.topic.unsubscribe("drag.start",this,"clearSuggestions");
dojo.event.topic.unsubscribe("dialog.pop",this,"clearSuggestions");
this.killTimeout();
this.isActive=false;
var ele=_b.DOM.gE(this.idAs);
if(ele){
ele.style.display="none";
}
if(this.fld!=null){
this.fld.onblur=null;
}
};
if(typeof (_b.Ajax)=="undefined"){
_b.Ajax={};
}
_b.Ajax=function(){
this.req={};
this.isIE=false;
};
_b.Ajax.prototype.makeRequest=function(url,meth,_2e5,_2e6){
if(meth!="POST"){
meth="GET";
}
this.onComplete=_2e5;
this.onError=_2e6;
var _2e7=this;
if(window.XMLHttpRequest){
this.req=new XMLHttpRequest();
this.req.onreadystatechange=function(){
_2e7.processReqChange();
};
this.req.open("GET",url,true);
this.req.send(null);
}else{
if(window.ActiveXObject){
this.req=new ActiveXObject("Microsoft.XMLHTTP");
if(this.req){
this.req.onreadystatechange=function(){
_2e7.processReqChange();
};
this.req.open(meth,url,true);
this.req.send();
}
}
}
};
_b.Ajax.prototype.processReqChange=function(){
if(this.req.readyState==4){
if(this.req.status==200){
this.onComplete(this.req);
}else{
this.onError(this.req.status);
}
}
};
if(typeof (_b.DOM)=="undefined"){
_b.DOM={};
}
_b.DOM.cE=function(type,attr,cont,html){
var ne=document.createElement(type);
if(!ne){
return 0;
}
for(var a in attr){
ne[a]=attr[a];
}
var t=typeof (cont);
if(t=="string"&&!html){
ne.appendChild(document.createTextNode(cont));
}else{
if(t=="string"&&html){
ne.innerHTML=cont;
}else{
if(t=="object"){
ne.appendChild(cont);
}
}
}
return ne;
};
_b.DOM.gE=function(e){
var t=typeof (e);
if(t=="undefined"){
return 0;
}else{
if(t=="string"){
var re=document.getElementById(e);
if(!re){
return 0;
}else{
if(typeof (re.appendChild)!="undefined"){
return re;
}else{
return 0;
}
}
}else{
if(typeof (e.appendChild)!="undefined"){
return e;
}else{
return 0;
}
}
}
};
_b.DOM.remE=function(ele){
var e=this.gE(ele);
if(!e){
return 0;
}else{
if(e.parentNode.removeChild(e)){
return true;
}else{
return 0;
}
}
};
_b.DOM.getPos=function(e){
var e=this.gE(e);
var obj=e;
var _2f6=0;
if(obj.offsetParent){
while(obj.offsetParent){
_2f6+=obj.offsetLeft;
obj=obj.offsetParent;
}
}else{
if(obj.x){
_2f6+=obj.x;
}
}
var obj=e;
var _2f7=0;
if(obj.offsetParent){
while(obj.offsetParent){
_2f7+=obj.offsetTop;
obj=obj.offsetParent;
}
}else{
if(obj.y){
_2f7+=obj.y;
}
}
return {x:_2f6,y:_2f7};
};
if(typeof (_b.Fader)=="undefined"){
_b.Fader={};
}
_b.Fader=function(ele,from,to,_2fb,_2fc){
if(!ele){
return 0;
}
this.e=ele;
this.from=from;
this.to=to;
this.cb=_2fc;
this.nDur=_2fb;
this.nInt=50;
this.nTime=0;
var p=this;
this.nID=setInterval(function(){
p._fade();
},this.nInt);
};
_b.Fader.prototype._fade=function(){
this.nTime+=this.nInt;
var ieop=Math.round(this._tween(this.nTime,this.from,this.to,this.nDur)*100);
var op=ieop/100;
if(this.e.filters){
try{
this.e.filters.item("DXImageTransform.Microsoft.Alpha").opacity=ieop;
}
catch(e){
this.e.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+ieop+")";
}
}else{
this.e.style.opacity=op;
}
if(this.nTime==this.nDur){
clearInterval(this.nID);
if(this.cb!=undefined){
this.cb();
}
}
};
_b.Fader.prototype._tween=function(t,b,c,d){
return b+((c-b)*(t/d));
};
dojo.provide("dojo.regexp");
dojo.evalObjPath("dojo.regexp.us",true);
dojo.regexp.tld=function(_304){
_304=(typeof _304=="object")?_304:{};
if(typeof _304.allowCC!="boolean"){
_304.allowCC=true;
}
if(typeof _304.allowInfra!="boolean"){
_304.allowInfra=true;
}
if(typeof _304.allowGeneric!="boolean"){
_304.allowGeneric=true;
}
var _305="arpa";
var _306="aero|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|xxx|jobs|mobi|post";
var ccRE="ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|"+"bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|"+"ec|ee|eg|er|eu|es|et|fi|fj|fk|fm|fo|fr|ga|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|"+"gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kr|kw|ky|kz|"+"la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|"+"my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|"+"re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sk|sl|sm|sn|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|"+"tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw";
var a=[];
if(_304.allowInfra){
a.push(_305);
}
if(_304.allowGeneric){
a.push(_306);
}
if(_304.allowCC){
a.push(ccRE);
}
var _309="";
if(a.length>0){
_309="("+a.join("|")+")";
}
return _309;
};
dojo.regexp.ipAddress=function(_30a){
_30a=(typeof _30a=="object")?_30a:{};
if(typeof _30a.allowDottedDecimal!="boolean"){
_30a.allowDottedDecimal=true;
}
if(typeof _30a.allowDottedHex!="boolean"){
_30a.allowDottedHex=true;
}
if(typeof _30a.allowDottedOctal!="boolean"){
_30a.allowDottedOctal=true;
}
if(typeof _30a.allowDecimal!="boolean"){
_30a.allowDecimal=true;
}
if(typeof _30a.allowHex!="boolean"){
_30a.allowHex=true;
}
if(typeof _30a.allowIPv6!="boolean"){
_30a.allowIPv6=true;
}
if(typeof _30a.allowHybrid!="boolean"){
_30a.allowHybrid=true;
}
var _30b="((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";
var _30c="(0[xX]0*[\\da-fA-F]?[\\da-fA-F]\\.){3}0[xX]0*[\\da-fA-F]?[\\da-fA-F]";
var _30d="(0+[0-3][0-7][0-7]\\.){3}0+[0-3][0-7][0-7]";
var _30e="(0|[1-9]\\d{0,8}|[1-3]\\d{9}|4[01]\\d{8}|42[0-8]\\d{7}|429[0-3]\\d{6}|"+"4294[0-8]\\d{5}|42949[0-5]\\d{4}|429496[0-6]\\d{3}|4294967[01]\\d{2}|42949672[0-8]\\d|429496729[0-5])";
var _30f="0[xX]0*[\\da-fA-F]{1,8}";
var _310="([\\da-fA-F]{1,4}\\:){7}[\\da-fA-F]{1,4}";
var _311="([\\da-fA-F]{1,4}\\:){6}"+"((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";
var a=[];
if(_30a.allowDottedDecimal){
a.push(_30b);
}
if(_30a.allowDottedHex){
a.push(_30c);
}
if(_30a.allowDottedOctal){
a.push(_30d);
}
if(_30a.allowDecimal){
a.push(_30e);
}
if(_30a.allowHex){
a.push(_30f);
}
if(_30a.allowIPv6){
a.push(_310);
}
if(_30a.allowHybrid){
a.push(_311);
}
var _313="";
if(a.length>0){
_313="("+a.join("|")+")";
}
return _313;
};
dojo.regexp.host=function(_314){
_314=(typeof _314=="object")?_314:{};
if(typeof _314.allowIP!="boolean"){
_314.allowIP=true;
}
if(typeof _314.allowLocal!="boolean"){
_314.allowLocal=false;
}
if(typeof _314.allowPort!="boolean"){
_314.allowPort=true;
}
var _315="([0-9a-zA-Z]([-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?\\.)+"+dojo.regexp.tld(_314);
var _316=(_314.allowPort)?"(\\:"+dojo.regexp.integer({signed:false})+")?":"";
var _317=_315;
if(_314.allowIP){
_317+="|"+dojo.regexp.ipAddress(_314);
}
if(_314.allowLocal){
_317+="|localhost";
}
return "("+_317+")"+_316;
};
dojo.regexp.url=function(_318){
_318=(typeof _318=="object")?_318:{};
if(typeof _318.scheme=="undefined"){
_318.scheme=[true,false];
}
var _319=dojo.regexp.buildGroupRE(_318.scheme,function(q){
if(q){
return "(https?|ftps?)\\://";
}
return "";
});
var _31b="(/([^?#\\s/]+/)*)?([^?#\\s/]+(\\?[^?#\\s/]*)?(#[A-Za-z][\\w.:-]*)?)?";
return _319+dojo.regexp.host(_318)+_31b;
};
dojo.regexp.emailAddress=function(_31c){
_31c=(typeof _31c=="object")?_31c:{};
if(typeof _31c.allowCruft!="boolean"){
_31c.allowCruft=false;
}
_31c.allowPort=false;
var _31d="([\\da-z]+[-._+&'])*[\\da-z]+";
var _31e=_31d+"@"+dojo.regexp.host(_31c);
if(_31c.allowCruft){
_31e="<?(mailto\\:)?"+_31e+">?";
}
return _31e;
};
dojo.regexp.emailAddressList=function(_31f){
_31f=(typeof _31f=="object")?_31f:{};
if(typeof _31f.listSeparator!="string"){
_31f.listSeparator="\\s;,";
}
var _320=dojo.regexp.emailAddress(_31f);
var _321="("+_320+"\\s*["+_31f.listSeparator+"]\\s*)*"+_320+"\\s*["+_31f.listSeparator+"]?\\s*";
return _321;
};
dojo.regexp.integer=function(_322){
_322=(typeof _322=="object")?_322:{};
if(typeof _322.signed=="undefined"){
_322.signed=[true,false];
}
if(typeof _322.separator=="undefined"){
_322.separator="";
}else{
if(typeof _322.groupSize=="undefined"){
_322.groupSize=3;
}
}
var _323=dojo.regexp.buildGroupRE(_322.signed,function(q){
return q?"[-+]":"";
});
var _325=dojo.regexp.buildGroupRE(_322.separator,function(sep){
if(sep==""){
return "(0|[1-9]\\d*)";
}
var grp=_322.groupSize,grp2=_322.groupSize2;
if(typeof grp2!="undefined"){
var _329="(0|[1-9]\\d{0,"+(grp2-1)+"}(["+sep+"]\\d{"+grp2+"})*["+sep+"]\\d{"+grp+"})";
return ((grp-grp2)>0)?"("+_329+"|(0|[1-9]\\d{0,"+(grp-1)+"}))":_329;
}
return "(0|[1-9]\\d{0,"+(grp-1)+"}(["+sep+"]\\d{"+grp+"})*)";
});
return _323+_325;
};
dojo.regexp.realNumber=function(_32a){
_32a=(typeof _32a=="object")?_32a:{};
if(typeof _32a.places!="number"){
_32a.places=Infinity;
}
if(typeof _32a.decimal!="string"){
_32a.decimal=".";
}
if(typeof _32a.fractional=="undefined"){
_32a.fractional=[true,false];
}
if(typeof _32a.exponent=="undefined"){
_32a.exponent=[true,false];
}
if(typeof _32a.eSigned=="undefined"){
_32a.eSigned=[true,false];
}
var _32b=dojo.regexp.integer(_32a);
var _32c=dojo.regexp.buildGroupRE(_32a.fractional,function(q){
var re="";
if(q&&(_32a.places>0)){
re="\\"+_32a.decimal;
if(_32a.places==Infinity){
re="("+re+"\\d+)?";
}else{
if(_32a.places==1){
re="("+re+"\\d)?";
}else{
re=re+"\\d{1,"+_32a.places+"}";
}
}
}
return re;
});
var _32f=dojo.regexp.buildGroupRE(_32a.exponent,function(q){
if(q){
return "([eE]"+dojo.regexp.integer({signed:_32a.eSigned})+")";
}
return "";
});
return "("+_32b+")?"+_32c+_32f;
};
dojo.regexp.currency=function(_331){
_331=(typeof _331=="object")?_331:{};
if(typeof _331.signed=="undefined"){
_331.signed=[true,false];
}
if(typeof _331.symbol=="undefined"){
_331.symbol="$";
}
if(typeof _331.placement!="string"){
_331.placement="before";
}
if(typeof _331.signPlacement!="string"){
_331.signPlacement="before";
}
if(typeof _331.separator=="undefined"){
_331.separator=",";
}
if(typeof _331.fractional=="undefined"&&typeof _331.cents!="undefined"){
dojo.deprecated("dojo.regexp.currency: flags.cents","use flags.fractional instead","0.5");
_331.fractional=_331.cents;
}
if(typeof _331.decimal!="string"){
_331.decimal=".";
}
var _332=dojo.regexp.buildGroupRE(_331.signed,function(q){
if(q){
return "[-+]";
}
return "";
});
var _334=dojo.regexp.buildGroupRE(_331.symbol,function(_335){
return "\\s?"+_335.replace(/([.$?*!=:|\\\/^])/g,"\\$1")+"\\s?";
});
switch(_331.signPlacement){
case "before":
_334=_332+_334;
break;
case "after":
_334=_334+_332;
break;
}
var _336=_331;
_336.signed=false;
_336.exponent=false;
var _337=dojo.regexp.realNumber(_336);
var _338;
switch(_331.placement){
case "before":
_338=_334+_337;
break;
case "after":
_338=_337+_334;
break;
}
switch(_331.signPlacement){
case "around":
_338="("+_338+"|"+"\\("+_338+"\\)"+")";
break;
case "begin":
_338=_332+_338;
break;
case "end":
_338=_338+_332;
break;
}
return _338;
};
dojo.regexp.us.state=function(_339){
_339=(typeof _339=="object")?_339:{};
if(typeof _339.allowTerritories!="boolean"){
_339.allowTerritories=true;
}
if(typeof _339.allowMilitary!="boolean"){
_339.allowMilitary=true;
}
var _33a="AL|AK|AZ|AR|CA|CO|CT|DE|DC|FL|GA|HI|ID|IL|IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|"+"NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY";
var _33b="AS|FM|GU|MH|MP|PW|PR|VI";
var _33c="AA|AE|AP";
if(_339.allowTerritories){
_33a+="|"+_33b;
}
if(_339.allowMilitary){
_33a+="|"+_33c;
}
return "("+_33a+")";
};
dojo.regexp.time=function(_33d){
dojo.deprecated("dojo.regexp.time","Use dojo.date.parse instead","0.5");
_33d=(typeof _33d=="object")?_33d:{};
if(typeof _33d.format=="undefined"){
_33d.format="h:mm:ss t";
}
if(typeof _33d.amSymbol!="string"){
_33d.amSymbol="AM";
}
if(typeof _33d.pmSymbol!="string"){
_33d.pmSymbol="PM";
}
var _33e=function(_33f){
_33f=_33f.replace(/([.$?*!=:|{}\(\)\[\]\\\/^])/g,"\\$1");
var amRE=_33d.amSymbol.replace(/([.$?*!=:|{}\(\)\[\]\\\/^])/g,"\\$1");
var pmRE=_33d.pmSymbol.replace(/([.$?*!=:|{}\(\)\[\]\\\/^])/g,"\\$1");
_33f=_33f.replace("hh","(0[1-9]|1[0-2])");
_33f=_33f.replace("h","([1-9]|1[0-2])");
_33f=_33f.replace("HH","([01][0-9]|2[0-3])");
_33f=_33f.replace("H","([0-9]|1[0-9]|2[0-3])");
_33f=_33f.replace("mm","([0-5][0-9])");
_33f=_33f.replace("m","([1-5][0-9]|[0-9])");
_33f=_33f.replace("ss","([0-5][0-9])");
_33f=_33f.replace("s","([1-5][0-9]|[0-9])");
_33f=_33f.replace("t","\\s?("+amRE+"|"+pmRE+")\\s?");
return _33f;
};
return dojo.regexp.buildGroupRE(_33d.format,_33e);
};
dojo.regexp.numberFormat=function(_342){
_342=(typeof _342=="object")?_342:{};
if(typeof _342.format=="undefined"){
_342.format="###-###-####";
}
var _343=function(_344){
_344=_344.replace(/([.$*!=:|{}\(\)\[\]\\\/^])/g,"\\$1");
_344=_344.replace(/\?/g,"\\d?");
_344=_344.replace(/#/g,"\\d");
return _344;
};
return dojo.regexp.buildGroupRE(_342.format,_343);
};
dojo.regexp.buildGroupRE=function(a,re){
if(!(a instanceof Array)){
return re(a);
}
var b=[];
for(var i=0;i<a.length;i++){
b.push(re(a[i]));
}
return "("+b.join("|")+")";
};
dojo.provide("dojo.validate.common");
dojo.validate.isText=function(_349,_34a){
_34a=(typeof _34a=="object")?_34a:{};
if(/^\s*$/.test(_349)){
return false;
}
if(typeof _34a.length=="number"&&_34a.length!=_349.length){
return false;
}
if(typeof _34a.minlength=="number"&&_34a.minlength>_349.length){
return false;
}
if(typeof _34a.maxlength=="number"&&_34a.maxlength<_349.length){
return false;
}
return true;
};
dojo.validate.isInteger=function(_34b,_34c){
var re=new RegExp("^"+dojo.regexp.integer(_34c)+"$");
return re.test(_34b);
};
dojo.validate.isRealNumber=function(_34e,_34f){
var re=new RegExp("^"+dojo.regexp.realNumber(_34f)+"$");
return re.test(_34e);
};
dojo.validate.isCurrency=function(_351,_352){
var re=new RegExp("^"+dojo.regexp.currency(_352)+"$");
return re.test(_351);
};
dojo.validate._isInRangeCache={};
dojo.validate.isInRange=function(_354,_355){
_354=_354.replace(dojo.lang.has(_355,"separator")?_355.separator:",","","g").replace(dojo.lang.has(_355,"symbol")?_355.symbol:"$","");
if(isNaN(_354)){
return false;
}
_355=(typeof _355=="object")?_355:{};
var max=(typeof _355.max=="number")?_355.max:Infinity;
var min=(typeof _355.min=="number")?_355.min:-Infinity;
var dec=(typeof _355.decimal=="string")?_355.decimal:".";
var _359=dojo.validate._isInRangeCache;
var _35a=_354+"max"+max+"min"+min+"dec"+dec;
if(typeof _359[_35a]!="undefined"){
return _359[_35a];
}
var _35b="[^"+dec+"\\deE+-]";
_354=_354.replace(RegExp(_35b,"g"),"");
if(_354.substring(1,0)=="."){
_354="0"+_354;
}
_354=_354.replace(/^([+-]?)(\D*)/,"$1");
_354=_354.replace(/(\D*)$/,"");
_35b="(\\d)["+dec+"](\\d)";
_354=_354.replace(RegExp(_35b,"g"),"$1.$2");
_354=Number(_354);
if(_354<min||_354>max){
_359[_35a]=false;
return false;
}
_359[_35a]=true;
return true;
};
dojo.validate.isNumberFormat=function(_35c,_35d){
var re=new RegExp("^"+dojo.regexp.numberFormat(_35d)+"$","i");
return re.test(_35c);
};
dojo.validate.isValidLuhn=function(_35f){
var sum,_361,_362;
if(typeof _35f!="string"){
_35f=String(_35f);
}
_35f=_35f.replace(/[- ]/g,"");
_361=_35f.length%2;
sum=0;
for(var i=0;i<_35f.length;i++){
_362=parseInt(_35f.charAt(i));
if(i%2==_361){
_362*=2;
}
if(_362>9){
_362-=9;
}
sum+=_362;
}
return !(sum%10);
};
dojo.provide("dojo.validate");
dojo.provide("circleup.widget.CUCurrencyTextbox");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Manager");
dojo.require("dojo.widget.Parse");
dojo.require("dojo.xml.Parse");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.func");
dojo.widget.defineWidget("circleup.widget.CUCurrencyTextbox",dojo.widget.HtmlWidget,function(){
this.flags={};
},{className:"",name:"",type:"text",trim:true,uppercase:false,lowercase:false,ucFirst:false,digit:false,htmlfloat:"none",htmlMarginLeft:"0px",templateString:"<div style='float:${this.htmlfloat};margin-left:${this.htmlMarginLeft};overflow:clip;'\n\t><span dojoAttachPoint='currencySign' style=\"display:inline;float:left;margin-right:3px;margin-top:3px;vertical-align: top;\">$</span\n\t><input dojoAttachPoint='textbox' \n\t        dojoAttachEvent='onblur;onfocus;onkeyup'\n\t        id='${this.widgetId}'\n\t        name='${this.name}'\n\t        style='float:left;width:${this.width};${this.inputStyle};'\n\t        maxlength='${this.maxlength}'\n\t        class='${this.className}'\n\t        type='${this.type}'\n\t        value=\"${this.deactiveMessage}\" \n\t><span dojoAttachPoint='validSpan' style=\"text-align:left;position:absolute;font-size:9px;width:50px;display:none;float:left;margin-left:5px;padding-left:2px;\" ></span\n\t><span dojoAttachPoint='invalidSpan' style=\"text-align:left;border:1px solid #cccccc;background-color:AntiqueWhite;position:absolute;color:red;font-size:9px;width:50px;display:none;float:left;margin-left:5px;margin-top:-2px;;padding-left:2px;\">invalid currency amount!</span\n\t><span dojoAttachPoint='missingSpan' style=\"text-align:left;border:1px solid #cccccc;background-color:AntiqueWhite;position:absolute;color:red;font-size:9px;width:50px;display:none;float:left;margin-left:5px;margin-top:-2px;;padding-left:2px;\">missing currency amount</span\n\t><span dojoAttachPoint='rangeSpan' style=\"text-align:left;border:1px solid #cccccc;background-color:AntiqueWhite;position:absolute;color:red;font-size:9px;width:50px;display:none;float:left;margin-left:5px;margin-top:-2px;;padding-left:2px;\">amounts must be between $5 and $999.99</span\n></div>\n",textbox:null,required:false,validIcon:"/assets/default/web/common/blank.gif",rangeClass:"range",invalidClass:"invalid",missingClass:"missing",classPrefix:"dojoValidate",inputStyle:"",width:"80px",maxlength:"",promptMessage:"",deactiveMessage:"",invalidMessage:"invalid",missingMessage:"",rangeMessage:"invalid",listenOnKeyPress:true,lastCheckedValue:null,lastCheckWasValid:true,isActive:false,currencySign:null,validSpan:null,invalidSpan:null,missingSpan:null,rangeSpan:null,fillInTemplate:function(){
this.textbox.isValid=function(){
this.isValid.call(this);
};
this.textbox.isMissing=function(){
this.isMissing.call(this);
};
this.textbox.isInRange=function(){
this.isInRange.call(this);
};
dojo.html.setClass(this.invalidSpan,this.invalidClass);
this.update();
this.filter();
if(dojo.render.html.ie){
dojo.html.addClass(this.domNode,"ie");
}
if(dojo.render.html.moz){
dojo.html.addClass(this.domNode,"moz");
}
if(dojo.render.html.opera){
dojo.html.addClass(this.domNode,"opera");
}
if(dojo.render.html.safari){
dojo.html.addClass(this.domNode,"safari");
}
if(this.isActive){
this.activate();
}else{
this.deactivate();
}
},filter:function(){
if(this.trim){
this.textbox.value=this.textbox.value.replace(/(^\s*|\s*$)/g,"");
}
if(this.uppercase){
this.textbox.value=this.textbox.value.toUpperCase();
}
if(this.lowercase){
this.textbox.value=this.textbox.value.toLowerCase();
}
if(this.ucFirst){
this.textbox.value=this.textbox.value.replace(/\b\w+\b/g,function(word){
return word.substring(0,1).toUpperCase()+word.substring(1).toLowerCase();
});
}
if(this.digit){
this.textbox.value=this.textbox.value.replace(/\D/g,"");
}
},mixInProperties:function(_365,frag){
circleup.widget.CUCurrencyTextbox.superclass.mixInProperties.apply(this,arguments);
if(_365["class"]){
this.className=_365["class"];
}
if((_365.signed=="true")||(_365.signed=="always")){
this.flags.signed=true;
}else{
if((_365.signed=="false")||(_365.signed=="never")){
this.flags.signed=false;
this.flags.min=0;
}else{
this.flags.signed=false;
}
}
this.flags.separator=[",",""];
if(_365.separator){
this.flags.separator.push(_365.separator);
}
if(_365.min){
this.flags.min=parseInt(_365.min);
}
if(_365.max){
this.flags.max=parseInt(_365.max);
}
if(_365.fractional){
this.flags.fractional=(_365.fractional=="true");
}else{
if(_365.cents){
dojo.deprecated("dojo.widget.IntegerTextbox","use fractional attr instead of cents","0.5");
this.flags.fractional=(_365.cents=="true");
}
}
this.flags.symbol=[""];
if(_365.symbol){
this.flags.symbol.push(_365.symbol);
}
if(_365.min){
this.flags.min=parseFloat(_365.min);
}
if(_365.max){
this.flags.max=parseFloat(_365.max);
}
if(_365.places){
this.flags.places=_365.places;
}
},activate:function(){
this.isActive=true;
this.currencySign.style.color="#000000";
this.textbox.style.display="";
this.textbox.disabled=false;
this.textbox.value=this.promptMessage;
this.textbox.style.color="#666666";
this.update();
},deactivate:function(){
this.isActive=false;
this.currencySign.style.color="#000000";
this.textbox.style.color="#666666";
this.textbox.value=this.deactiveMessage;
this.textbox.disabled=true;
this.missingSpan.style.display="none";
this.invalidSpan.style.display="none";
this.rangeSpan.style.display="none";
},remove:function(){
this.textbox.value="";
this.update();
this.deactivate();
},getAmount:function(){
var amt=parseFloat(this.getValue());
return amt;
},getValue:function(){
return this.textbox.value;
},setValue:function(_368){
if(this.isActive){
this.textbox.style.color="";
this.textbox.value=_368;
this.update();
}
},isValid:function(){
return dojo.validate.isCurrency(this.textbox.value,this.flags);
},isInRange:function(){
var _369=this.flags.separator;
this.flags.separator=",";
var _36a=dojo.validate.isInRange(this.textbox.value,this.flags);
this.flags.separator=_369;
return _36a;
},isEmpty:function(){
return (/^\s*$/.test(this.textbox.value));
},isMissing:function(){
return (this.required&&this.isEmpty());
},isPromptText:function(){
if((this.promptMessage==this.textbox.value)||(this.deactiveMessage==this.textbox.value)){
return true;
}else{
return false;
}
},update:function(){
if(this.isActive==false){
return;
}
this.lastCheckedValue=this.textbox.value;
this.validSpan.style.display="none";
this.missingSpan.style.display="none";
this.invalidSpan.style.display="none";
this.rangeSpan.style.display="none";
var _36b=this.isEmpty();
var _36c=true;
if(this.promptMessage!=this.textbox.value){
_36c=this.isValid();
}
this.lastCheckWasValid=_36c;
var _36d=this.isMissing();
if(_36d){
this.missingSpan.style.display="";
}else{
if(!_36b&&!_36c){
this.invalidSpan.style.display="";
}else{
if(!_36b&&!this.isPromptText()&&!this.isInRange()){
this.rangeSpan.style.display="";
}else{
if(!_36b){
this.validSpan.style.display="";
}
}
}
}
this.highlight();
this.listenOnKeyPress=true;
},updateClass:function(_36e){
var pre=this.classPrefix;
dojo.html.removeClass(this.textbox,pre+"Empty");
dojo.html.removeClass(this.textbox,pre+"Valid");
dojo.html.removeClass(this.textbox,pre+"Invalid");
dojo.html.addClass(this.textbox,pre+_36e);
},highlight:function(){
if(this.isEmpty()){
this.updateClass("Empty");
}else{
if(this.textbox.value==this.promptMessage){
this.updateClass("Empty");
}else{
if(this.isValid()&&this.isInRange()){
this.updateClass("Valid");
}else{
this.updateClass("Empty");
}
}
}
},onclick:function(evt){
},onfocus:function(evt){
if(!this.listenOnKeyPress){
this.updateClass("Empty");
this.textbox.value="";
}
if(this.textbox.value==this.promptMessage){
this.textbox.value="";
this.textbox.style.color="";
}
},onblur:function(evt){
this.filter();
this.update();
if(this.isEmpty()){
this.textbox.value=this.promptMessage;
this.textbox.style.color="#777777";
}
},onkeyup:function(evt){
if(this.listenOnKeyPress){
this.listenOnKeyPress=false;
if(this.lastCheckWasValid){
window.setTimeout(dojo.lang.hitch(this,"update"),900);
}else{
this.update();
}
}else{
if(this.textbox.value!=this.lastCheckedValue){
this.updateClass("Empty");
}
}
}});
dojo.provide("dojo.Deferred");
dojo.require("dojo.lang.func");
dojo.Deferred=function(_374){
this.chain=[];
this.id=this._nextId();
this.fired=-1;
this.paused=0;
this.results=[null,null];
this.canceller=_374;
this.silentlyCancelled=false;
};
dojo.lang.extend(dojo.Deferred,{getFunctionFromArgs:function(){
var a=arguments;
if((a[0])&&(!a[1])){
if(dojo.lang.isFunction(a[0])){
return a[0];
}else{
if(dojo.lang.isString(a[0])){
return dj_global[a[0]];
}
}
}else{
if((a[0])&&(a[1])){
return dojo.lang.hitch(a[0],a[1]);
}
}
return null;
},makeCalled:function(){
var _376=new dojo.Deferred();
_376.callback();
return _376;
},repr:function(){
var _377;
if(this.fired==-1){
_377="unfired";
}else{
if(this.fired==0){
_377="success";
}else{
_377="error";
}
}
return "Deferred("+this.id+", "+_377+")";
},toString:dojo.lang.forward("repr"),_nextId:(function(){
var n=1;
return function(){
return n++;
};
})(),cancel:function(){
if(this.fired==-1){
if(this.canceller){
this.canceller(this);
}else{
this.silentlyCancelled=true;
}
if(this.fired==-1){
this.errback(new Error(this.repr()));
}
}else{
if((this.fired==0)&&(this.results[0] instanceof dojo.Deferred)){
this.results[0].cancel();
}
}
},_pause:function(){
this.paused++;
},_unpause:function(){
this.paused--;
if((this.paused==0)&&(this.fired>=0)){
this._fire();
}
},_continue:function(res){
this._resback(res);
this._unpause();
},_resback:function(res){
this.fired=((res instanceof Error)?1:0);
this.results[this.fired]=res;
this._fire();
},_check:function(){
if(this.fired!=-1){
if(!this.silentlyCancelled){
dojo.raise("already called!");
}
this.silentlyCancelled=false;
return;
}
},callback:function(res){
this._check();
this._resback(res);
},errback:function(res){
this._check();
if(!(res instanceof Error)){
res=new Error(res);
}
this._resback(res);
},addBoth:function(cb,cbfn){
var _37f=this.getFunctionFromArgs(cb,cbfn);
if(arguments.length>2){
_37f=dojo.lang.curryArguments(null,_37f,arguments,2);
}
return this.addCallbacks(_37f,_37f);
},addCallback:function(cb,cbfn){
var _382=this.getFunctionFromArgs(cb,cbfn);
if(arguments.length>2){
_382=dojo.lang.curryArguments(null,_382,arguments,2);
}
return this.addCallbacks(_382,null);
},addErrback:function(cb,cbfn){
var _385=this.getFunctionFromArgs(cb,cbfn);
if(arguments.length>2){
_385=dojo.lang.curryArguments(null,_385,arguments,2);
}
return this.addCallbacks(null,_385);
return this.addCallbacks(null,cbfn);
},addCallbacks:function(cb,eb){
this.chain.push([cb,eb]);
if(this.fired>=0){
this._fire();
}
return this;
},_fire:function(){
var _388=this.chain;
var _389=this.fired;
var res=this.results[_389];
var self=this;
var cb=null;
while(_388.length>0&&this.paused==0){
var pair=_388.shift();
var f=pair[_389];
if(f==null){
continue;
}
try{
res=f(res);
_389=((res instanceof Error)?1:0);
if(res instanceof dojo.Deferred){
cb=function(res){
self._continue(res);
};
this._pause();
}
}
catch(err){
_389=1;
res=err;
}
}
this.fired=_389;
this.results[_389]=res;
if((cb)&&(this.paused)){
res.addBoth(cb);
}
}});
dojo.provide("dojo.widget.RichText");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.selection");
dojo.require("dojo.event.*");
dojo.require("dojo.string.extras");
dojo.require("dojo.uri.Uri");
if(!djConfig["useXDomain"]||djConfig["allowXdRichTextSave"]){
if(dojo.hostenv.post_load_){
(function(){
var _390=dojo.doc().createElement("textarea");
_390.id="dojo.widget.RichText.savedContent";
_390.style="display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;";
dojo.body().appendChild(_390);
})();
}else{
try{
dojo.doc().write("<textarea id=\"dojo.widget.RichText.savedContent\" "+"style=\"display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;\"></textarea>");
}
catch(e){
}
}
}
dojo.widget.defineWidget("dojo.widget.RichText",dojo.widget.HtmlWidget,function(){
this.contentPreFilters=[];
this.contentPostFilters=[];
this.contentDomPreFilters=[];
this.contentDomPostFilters=[];
this.editingAreaStyleSheets=[];
if(dojo.render.html.moz){
this.contentPreFilters.push(this._fixContentForMoz);
this.contentPreFilters.push(this._removeFormatting);
}
this._keyHandlers={};
if(dojo.Deferred){
this.onLoadDeferred=new dojo.Deferred();
}
},{inheritWidth:false,focusOnLoad:false,saveName:"",styleSheets:"",_content:"",height:"",minHeight:"1em",isClosed:true,isLoaded:false,useActiveX:false,relativeImageUrls:false,_SEPARATOR:"@@**%%__RICHTEXTBOUNDRY__%%**@@",onLoadDeferred:null,ieTabFix:true,ieAutoUrl:false,_hasFocus:false,clearFormatting:false,_pasteStart:-1,_lastText:null,_mozHack:false,_ieDelHack:true,fillInTemplate:function(){
dojo.event.topic.publish("dojo.widget.RichText::init",this);
this.open();
dojo.event.connect(this,"onKeyPressed",this,"afterKeyPress");
dojo.event.connect(this,"onKeyPress",this,"keyPress");
dojo.event.connect(this,"onKeyDown",this,"keyDown");
dojo.event.connect(this,"onKeyUp",this,"keyUp");
this.setupDefaultShortcuts();
},setupDefaultShortcuts:function(){
var ctrl=this.KEY_CTRL;
var exec=function(cmd,arg){
return arguments.length==1?function(){
this.execCommand(cmd);
}:function(){
this.execCommand(cmd,arg);
};
};
this.addKeyHandler("b",ctrl,exec("bold"));
this.addKeyHandler("i",ctrl,exec("italic"));
this.addKeyHandler("u",ctrl,exec("underline"));
this.addKeyHandler("a",ctrl,exec("selectall"));
this.addKeyHandler("s",ctrl,function(){
this.save(true);
});
this.addKeyHandler("1",ctrl,exec("formatblock","h1"));
this.addKeyHandler("2",ctrl,exec("formatblock","h2"));
this.addKeyHandler("3",ctrl,exec("formatblock","h3"));
this.addKeyHandler("4",ctrl,exec("formatblock","h4"));
this.addKeyHandler("\\",ctrl,exec("insertunorderedlist"));
if(!dojo.render.html.ie){
this.addKeyHandler("Z",ctrl,exec("redo"));
}
},events:["onBlur","onFocus","onKeyPress","onKeyDown","onKeyUp","onClick","onPaste","onInput","onMouseMove","onMouseDown","onMouseOut","onMouseOver","onMouseUp"],open:function(_395){
if(this.onLoadDeferred.fired>=0){
this.onLoadDeferred=new dojo.Deferred();
}
var h=dojo.render.html;
if(!this.isClosed){
this.close();
}
dojo.event.topic.publish("dojo.widget.RichText::open",this);
this._content="";
if((arguments.length==1)&&(_395["nodeName"])){
this.domNode=_395;
}
if((this.domNode["nodeName"])&&(this.domNode.nodeName.toLowerCase()=="textarea")){
this.textarea=this.domNode;
var html=this._preFilterContent(this.textarea.value);
this.domNode=dojo.doc().createElement("div");
dojo.html.copyStyle(this.domNode,this.textarea);
var _398=dojo.lang.hitch(this,function(){
with(this.textarea.style){
display="block";
position="absolute";
left=top="-1000px";
if(h.ie){
this.__overflow=overflow;
overflow="hidden";
}
}
});
if(h.ie){
setTimeout(_398,10);
}else{
_398();
}
if(!h.safari){
dojo.html.insertBefore(this.domNode,this.textarea);
}
if(this.textarea.form){
dojo.event.connect("before",this.textarea.form,"onsubmit",dojo.lang.hitch(this,function(){
this.textarea.value=this.getEditorContent();
}));
}
var _399=this;
dojo.event.connect(this,"postCreate",function(){
dojo.html.insertAfter(_399.textarea,_399.domNode);
});
}else{
var html=this._preFilterContent(dojo.string.trim(this.domNode.innerHTML));
}
html=(!html||html=="")?(dojo.render.html.ie)?"<span></span>":((dojo.render.html.opera)?"<p></p>":"<br>"):html;
var _39a=dojo.html.getContentBox(this.domNode);
this._oldHeight=_39a.height;
this._oldWidth=_39a.width;
this._firstChildContributingMargin=this._getContributingMargin(this.domNode,"top");
this._lastChildContributingMargin=this._getContributingMargin(this.domNode,"bottom");
this.savedContent=html;
this.domNode.innerHTML="";
this.editingArea=dojo.doc().createElement("div");
this.editingArea.style.cssText="display : table !important;display:inline-block !important;display:inline;";
this.domNode.appendChild(this.editingArea);
if((this.domNode["nodeName"])&&(this.domNode.nodeName=="LI")){
this.domNode.innerHTML=" <br>";
}
if(this.saveName!=""&&(!djConfig["useXDomain"]||djConfig["allowXdRichTextSave"])){
var _39b=dojo.doc().getElementById("dojo.widget.RichText.savedContent");
if(_39b.value!=""){
var _39c=_39b.value.split(this._SEPARATOR);
for(var i=0;i<_39c.length;i++){
var data=_39c[i].split(":");
if(data[0]==this.saveName){
html=data[1];
_39c.splice(i,1);
break;
}
}
}
dojo.event.connect("before",window,"onunload",this,"_saveContent");
}
if(h.ie70&&this.useActiveX){
dojo.debug("activeX in ie70 is not currently supported, useActiveX is ignored for now.");
this.useActiveX=false;
}
if(this.useActiveX&&h.ie){
var self=this;
setTimeout(function(){
self._drawObject(html);
},0);
}else{
if(h.ie||this._safariIsLeopard()){
this.iframe=dojo.doc().createElement("iframe");
this.iframe.src="javascript:void(0)";
this.editorObject=this.iframe;
with(this.iframe.style){
border="0";
width="100%";
}
this.iframe.frameBorder=0;
this.editingArea.appendChild(this.iframe);
this.window=this.iframe.contentWindow;
this.document=this.window.document;
this.document.open();
this.document.write("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><style>body{margin:0;padding:0;border:0;overflow:hidden;}"+((dojo.render.html.ie&&!this.ieAutoUrl)?"a{color:#323232;text-decoration:none;cursor:none;}":"")+"</style><script>"+"function getByTagName(tagName) { return document.getElementsByTagName(tagName); }"+"</script></head><body><div></div></body></html>");
this.document.close();
this.editNode=this.document.body.firstChild;
this.editNode.contentEditable=true;
with(this.iframe.style){
if(h.ie70){
if(this.height){
height=this.height;
}
if(this.minHeight){
minHeight=this.minHeight;
}
}else{
height=this.height?this.height:this.minHeight;
}
}
if(this.useActiveX&&h.ie){
var _3a0=["p","pre","address","h1","h2","h3","h4","h5","h6","ol","div","ul"];
var _3a1="";
for(var i in _3a0){
if(_3a0[i].charAt(1)!="l"){
_3a1+="<"+_3a0[i]+"><span>content</span></"+_3a0[i]+">";
}else{
_3a1+="<"+_3a0[i]+"><li>content</li></"+_3a0[i]+">";
}
}
with(this.editNode.style){
position="absolute";
left="-2000px";
top="-2000px";
outline="none";
}
this.editNode.innerHTML=_3a1;
var node=this.editNode.firstChild;
while(node){
dojo.withGlobal(this.window,"selectElement",dojo.html.selection,[node.firstChild]);
var _3a3=node.tagName.toLowerCase();
this._local2NativeFormatNames[_3a3]=this.queryCommandValue("formatblock");
this._native2LocalFormatNames[this._local2NativeFormatNames[_3a3]]=_3a3;
node=node.nextSibling;
}
}
with(this.editNode.style){
position="";
left="";
top="";
}
this.editNode.innerHTML=html;
if(this.height){
this.document.body.style.overflowY="auto";
}
this.editNode.style.height="100%";
dojo.lang.forEach(this.events,function(e){
dojo.event.connect(this.editNode,e.toLowerCase(),this,e);
},this);
this.onLoad();
dojo.event.connect(this.iframe,"onfocus",this,"_iframeFocus");
}else{
this._drawIframe(html);
this.editorObject=this.iframe;
}
}
if(this.domNode.nodeName=="LI"){
this.domNode.lastChild.style.marginTop="-1.2em";
}
dojo.html.addClass(this.domNode,"RichTextEditable");
this.isClosed=false;
},getElementsByTagName:function(_3a5){
return this.window.getByTagName(_3a5);
},getText:function(){
var text="";
if(typeof this.editNode!="undefined"){
var node=(dojo.render.html.safari||dojo.render.html.chrome)?this.editNode:this.editNode;
var html=(typeof node=="undefined"||typeof node.innerHTML=="undefined")?"":node.innerHTML;
text=circleup.widget.utils.getTextWithBr(html);
}
return text;
},getCaretPos:function(){
if(typeof this.window.getSelection!=="undefined"){
var _3a9=this.window.getSelection();
if(_3a9==null||_3a9.anchorNode==null){
return 0;
}
var _3aa=this.document.createRange();
_3aa.setStart(this.editNode,0);
_3aa.setEnd(_3a9.anchorNode,_3a9.anchorOffset);
var len=0;
try{
var div=dojo.doc().createElement("div");
div.appendChild(_3aa.cloneContents());
len=circleup.widget.utils.getTextWithBr(div.innerHTML).length;
delete div;
}
catch(e){
circleup.widget.utils.dumpProps(e);
}
return len;
}else{
if(dojo.render.html.ie){
var _3aa=this.document.selection.createRange();
var text=this.getText();
_3aa.moveStart("character",-(text.length+1));
var _3ae=_3aa.htmlText;
_3ae=circleup.widget.utils.getTextWithBr(_3ae);
pos=(_3ae.length<=text.length)?_3ae.length:text.length;
return pos;
}
}
},setCaretPos:function(_3af){
dojo.debug("RichText.setCaretPos : location="+_3af);
try{
this.setSelectedRange(_3af,_3af);
dojo.withGlobal(this.window,"collapse",dojo.html.selection,[false]);
}
catch(e){
circleup.widget.utils.dumpProps(e);
}
dojo.debug("RichText.setCaretPos : exit");
},setSelectedRange:function(_3b0,end){
dojo.debug("RichText.setSelectedRange : start="+_3b0+", end="+end+", hasFocus="+this._hasFocus);
if(!this._hasFocus){
this.focus();
}
if(this.window&&this.window.getSelection){
var _3b2=this.window.getSelection();
if(_3b2==null){
return;
}
if(_3b2.rangeCount>0){
_3b2.removeAllRanges();
}
var _3b3=this.document.createRange();
this._lastText=null;
var _3b4=this._getAnchorOffset(this.editNode,_3b0);
if(!_3b4.found&&this._lastText!=null){
_3b4.anchor=this._lastText;
_3b4.anchorOffset=(this._lastText.nodeType==3)?circleup.widget.utils.getUnescapedText(this._lastText).length-1:0;
}
_3b3.setStart(_3b4.anchor,_3b4.anchorOffset);
if(_3b0==end){
_3b3.setEnd(_3b4.anchor,_3b4.anchorOffset);
}else{
this._lastText=null;
var _3b5=this._getAnchorOffset(this.editNode,end);
if(!_3b5.found&&this._lastText!=null){
_3b5.anchor=this._lastText;
_3b5.anchorOffset=(this._lastText.nodeType==3)?circleup.widget.utils.getUnescapedText(this._lastText).length-1:0;
}
_3b3.setEnd(_3b5.anchor,_3b5.anchorOffset);
}
_3b2.addRange(_3b3);
}else{
if(dojo.render.html.ie){
dojo.withGlobal(this.window,"selectElementChildren",dojo.html.selection,[this.editNode]);
var _3b3=this.document.selection.createRange();
var text=this.getText();
var len=text.length;
dojo.debug("RichText._setSelectedRange : len="+len);
_3b3.moveEnd("character",end-len);
_3b3.moveStart("character",_3b0);
_3b3.select();
dojo.debug("RichText._setSelectedRange : html='"+_3b3.htmlText+"'");
}
}
},_getLenWithBr:function(html){
return circleup.widget.utils.getTextWithBr(html).length;
},_getAnchorOffset:function(ele,pos){
var len=0;
var br=false;
var _3bd=0;
var _3be=false;
var _3bf=false;
if(ele.nodeType==3){
this._lastText=ele;
var text=circleup.widget.utils.getUnescapedText(ele);
text=(text==null||typeof text=="undefined")?"":text;
len=text.length;
_3bf=(pos<=len);
_3bd=pos;
}else{
if(ele.tagName=="BR"||(ele.tagName=="A"&&ele.getAttribute("br")=="true")){
this._lastText=ele;
len=1;
br=true;
_3bf=(pos==0);
}else{
len=this._getLenWithBr(ele.innerHTML);
_3bf=(pos<=len);
}
}
_3be=(_3bf&&(ele.nodeType==3||br));
var _3c1={found:_3be,br:br,anchor:ele,anchorLength:len,anchorOffset:_3bd};
if(_3bf&&!_3be){
for(var i=0;i<ele.childNodes.length;i++){
var _3c3=this._getAnchorOffset(ele.childNodes[i],pos);
if(_3c3.found){
_3c1=_3c3;
break;
}else{
pos-=_3c3.anchorLength;
}
}
}
return _3c1;
},_hasCollapseableMargin:function(_3c4,side){
if(dojo.html.getPixelValue(_3c4,"border-"+side+"-width",false)){
return false;
}else{
if(dojo.html.getPixelValue(_3c4,"padding-"+side,false)){
return false;
}else{
return true;
}
}
},_getContributingMargin:function(_3c6,_3c7){
if(_3c7=="top"){
var _3c8="previousSibling";
var _3c9="nextSibling";
var _3ca="firstChild";
var _3cb="margin-top";
var _3cc="margin-bottom";
}else{
var _3c8="nextSibling";
var _3c9="previousSibling";
var _3ca="lastChild";
var _3cb="margin-bottom";
var _3cc="margin-top";
}
var _3cd=dojo.html.getPixelValue(_3c6,_3cb,false);
function isSignificantNode(_3ce){
return !(_3ce.nodeType==3&&dojo.string.isBlank(_3ce.data))&&dojo.html.getStyle(_3ce,"display")!="none"&&!dojo.html.isPositionAbsolute(_3ce);
}
var _3cf=0;
var _3d0=_3c6[_3ca];
while(_3d0){
while((!isSignificantNode(_3d0))&&_3d0[_3c9]){
_3d0=_3d0[_3c9];
}
_3cf=Math.max(_3cf,dojo.html.getPixelValue(_3d0,_3cb,false));
if(!this._hasCollapseableMargin(_3d0,_3c7)){
break;
}
_3d0=_3d0[_3ca];
}
if(!this._hasCollapseableMargin(_3c6,_3c7)){
return parseInt(_3cf);
}
var _3d1=0;
var _3d2=_3c6[_3c8];
while(_3d2){
if(isSignificantNode(_3d2)){
_3d1=dojo.html.getPixelValue(_3d2,_3cc,false);
break;
}
_3d2=_3d2[_3c8];
}
if(!_3d2){
_3d1=dojo.html.getPixelValue(_3c6.parentNode,_3cb,false);
}
if(_3cf>_3cd){
return parseInt(Math.max((_3cf-_3cd)-_3d1,0));
}else{
return 0;
}
},_drawIframe:function(html){
var _3d4=Boolean(dojo.render.html.moz&&(typeof window.XML=="undefined"));
if(!this.iframe){
var _3d5=(new dojo.uri.Uri(dojo.doc().location)).host;
this.iframe=dojo.doc().createElement("iframe");
with(this.iframe){
style.border="none";
style.lineHeight="0";
style.verticalAlign="bottom";
scrolling=this.height?"auto":"no";
}
}
if(djConfig["useXDomain"]&&!djConfig["dojoRichTextFrameUrl"]){
dojo.debug("dojo.widget.RichText: When using cross-domain Dojo builds,"+" please save src/widget/templates/richtextframe.html to your domain and set djConfig.dojoRichTextFrameUrl"+" to the path on your domain to richtextframe.html");
}
this.iframe.src=(djConfig["dojoRichTextFrameUrl"]||dojo.uri.moduleUri("dojo.widget","templates/richtextframe.html"))+((dojo.doc().domain!=_3d5)?("#"+dojo.doc().domain):"");
this.iframe.width=this.inheritWidth?this._oldWidth:"100%";
if(this.height){
this.iframe.style.height=this.height;
}else{
var _3d6=this._oldHeight;
if(this._hasCollapseableMargin(this.domNode,"top")){
_3d6+=this._firstChildContributingMargin;
}
if(this._hasCollapseableMargin(this.domNode,"bottom")){
_3d6+=this._lastChildContributingMargin;
}
this.iframe.height=_3d6;
}
var _3d7=dojo.doc().createElement("div");
_3d7.innerHTML=html;
this.editingArea.appendChild(_3d7);
if(this.relativeImageUrls){
var imgs=_3d7.getElementsByTagName("img");
for(var i=0;i<imgs.length;i++){
imgs[i].src=(new dojo.uri.Uri(dojo.global().location,imgs[i].src)).toString();
}
html=_3d7.innerHTML;
}
var _3da=dojo.html.firstElement(_3d7);
var _3db=dojo.html.lastElement(_3d7);
if(_3da){
_3da.style.marginTop=this._firstChildContributingMargin+"px";
}
if(_3db){
_3db.style.marginBottom=this._lastChildContributingMargin+"px";
}
this.editingArea.appendChild(this.iframe);
if(dojo.render.html.safari){
this.iframe.src=this.iframe.src;
}
var _3dc=false;
var _3dd=dojo.lang.hitch(this,function(){
if(!_3dc){
_3dc=true;
}else{
return;
}
if(!this.editNode){
if(this.iframe.contentWindow){
this.window=this.iframe.contentWindow;
this.document=this.iframe.contentWindow.document;
}else{
if(this.iframe.contentDocument){
this.window=this.iframe.contentDocument.window;
this.document=this.iframe.contentDocument;
}
}
var _3de=(function(_3df){
return function(_3e0){
return dojo.html.getStyle(_3df,_3e0);
};
})(this.domNode);
var font=_3de("font-weight")+" "+_3de("font-size")+" "+_3de("font-family");
dojo.html.insertCssText("body,html{background:transparent;padding:0;margin:0;}"+"body{top:0;left:0;right:0;"+(((this.height)||(dojo.render.html.opera))?"":"position:fixed;")+"font:"+font+";"+"min-height:"+this.minHeight+";"+"p{margin: 1em 0 !important;}"+"body > *:first-child{padding-top:0 !important;margin-top:"+this._firstChildContributingMargin+"px !important;}"+"body > *:last-child{padding-bottom:0 !important;margin-bottom:"+this._lastChildContributingMargin+"px !important;}"+"li > ul:-moz-first-node, li > ol:-moz-first-node{padding-top:1.2em;}\n"+"li{min-height:1.2em;}"+"",this.document);
dojo.html.removeNode(_3d7);
this.document.body.innerHTML=html;
if(_3d4||dojo.render.html.safari||dojo.render.html.opera){
this.document.designMode="on";
}
this.onLoad();
}else{
dojo.html.removeNode(_3d7);
this.editNode.innerHTML=html;
this.onDisplayChanged();
}
});
if(this.editNode){
_3dd();
}else{
if(dojo.render.html.moz){
this.iframe.onload=function(){
setTimeout(_3dd,250);
};
}else{
this.iframe.onload=_3dd;
}
}
},_applyEditingAreaStyleSheets:function(){
var _3e2=[];
if(this.styleSheets){
_3e2=this.styleSheets.split(";");
this.styleSheets="";
}
_3e2=_3e2.concat(this.editingAreaStyleSheets);
this.editingAreaStyleSheets=[];
if(_3e2.length>0){
for(var i=0;i<_3e2.length;i++){
var url=_3e2[i];
if(url){
this.addStyleSheet(dojo.uri.dojoUri(url));
}
}
}
},addStyleSheet:function(uri){
var url=uri.toString();
if(dojo.lang.find(this.editingAreaStyleSheets,url)>-1){
dojo.debug("dojo.widget.RichText.addStyleSheet: Style sheet "+url+" is already applied to the editing area!");
return;
}
if(url.charAt(0)=="."||(url.charAt(0)!="/"&&!uri.host)){
url=(new dojo.uri.Uri(dojo.global().location,url)).toString();
}
this.editingAreaStyleSheets.push(url);
if(this.document.createStyleSheet){
this.document.createStyleSheet(url);
}else{
var head=this.document.getElementsByTagName("head")[0];
var _3e8=this.document.createElement("link");
with(_3e8){
rel="stylesheet";
type="text/css";
href=url;
}
head.appendChild(_3e8);
}
},removeStyleSheet:function(uri){
var url=uri.toString();
if(url.charAt(0)=="."||(url.charAt(0)!="/"&&!uri.host)){
url=(new dojo.uri.Uri(dojo.global().location,url)).toString();
}
var _3eb=dojo.lang.find(this.editingAreaStyleSheets,url);
if(_3eb==-1){
dojo.debug("dojo.widget.RichText.removeStyleSheet: Style sheet "+url+" is not applied to the editing area so it can not be removed!");
return;
}
delete this.editingAreaStyleSheets[_3eb];
var _3ec=this.document.getElementsByTagName("link");
for(var i=0;i<_3ec.length;i++){
if(_3ec[i].href==url){
if(dojo.render.html.ie){
_3ec[i].href="";
}
dojo.html.removeNode(_3ec[i]);
break;
}
}
},_drawObject:function(html){
this.object=dojo.html.createExternalElement(dojo.doc(),"object");
with(this.object){
classid="clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A";
width=this.inheritWidth?this._oldWidth:"100%";
style.height=this.height?this.height:(this._oldHeight+"px");
Scrollbars=this.height?true:false;
Appearance=this._activeX.appearance.flat;
}
this.editorObject=this.object;
this.editingArea.appendChild(this.object);
this.object.attachEvent("DocumentComplete",dojo.lang.hitch(this,"onLoad"));
dojo.lang.forEach(this.events,function(e){
this.object.attachEvent(e.toLowerCase(),dojo.lang.hitch(this,e));
},this);
this.object.DocumentHTML="<!doctype HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"+"<html><title></title>"+"<style type=\"text/css\">"+"    body,html { padding: 0; margin: 0; }"+(this.height?"":"    body,  { overflow: hidden; }")+"</style>"+"<body><div>"+html+"<div></body></html>";
this._cacheLocalBlockFormatNames();
},_local2NativeFormatNames:{},_native2LocalFormatNames:{},_cacheLocalBlockFormatNames:function(){
if(!this._native2LocalFormatNames["p"]){
var obj=this.object;
var _3f1=false;
if(!obj){
try{
obj=dojo.html.createExternalElement(dojo.doc(),"object");
obj.classid="clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A";
dojo.body().appendChild(obj);
obj.DocumentHTML="<html><head></head><body></body></html>";
}
catch(e){
_3f1=true;
}
}
try{
var _3f2=new ActiveXObject("DEGetBlockFmtNamesParam.DEGetBlockFmtNamesParam");
obj.ExecCommand(this._activeX.command["getblockformatnames"],0,_3f2);
var _3f3=new VBArray(_3f2.Names);
var _3f4=_3f3.toArray();
var _3f5=["p","pre","address","h1","h2","h3","h4","h5","h6","ol","ul","","","","","div"];
for(var i=0;i<_3f5.length;++i){
if(_3f5[i].length>0){
this._local2NativeFormatNames[_3f4[i]]=_3f5[i];
this._native2LocalFormatNames[_3f5[i]]=_3f4[i];
}
}
}
catch(e){
_3f1=true;
}
if(obj&&!this.object){
dojo.body().removeChild(obj);
}
}
return !_3f1;
},_isResized:function(){
return false;
},onLoad:function(e){
this.isLoaded=true;
if(this.object){
this.document=this.object.DOM;
this.window=this.document.parentWindow;
this.editNode=this.document.body.firstChild;
this.editingArea.style.height=this.height?this.height:this.minHeight;
if(!this.height){
this.connect(this,"onDisplayChanged","_updateHeight");
}
this.window._frameElement=this.object;
}else{
if(this.iframe&&!dojo.render.html.ie){
this.editNode=this.document.body;
if(!this.height){
this.connect(this,"onDisplayChanged","_updateHeight");
}
try{
this.document.execCommand("useCSS",false,true);
this.document.execCommand("styleWithCSS",false,false);
}
catch(e2){
}
if(dojo.render.html.safari){
this.interval=setInterval(dojo.lang.hitch(this,"onDisplayChanged"),750);
}else{
if(dojo.render.html.mozilla||dojo.render.html.opera){
var doc=this.document;
var _3f9=dojo.event.browser.addListener;
var self=this;
dojo.lang.forEach(this.events,function(e){
var l=_3f9(self.document,e.substr(2).toLowerCase(),dojo.lang.hitch(self,e));
if(e=="onBlur"){
var _3fd={unBlur:function(e){
dojo.event.browser.removeListener(doc,"blur",l);
}};
dojo.event.connect("before",self,"close",_3fd,"unBlur");
}
});
}
}
}else{
if(dojo.render.html.ie){
if(!this.height){
this.connect(this,"onDisplayChanged","_updateHeight");
}
this.editNode.style.zoom=1;
this.editNode.style.height="100%";
}
}
}
this._applyEditingAreaStyleSheets();
if(this.focusOnLoad){
this.focus();
}
this.onDisplayChanged(e);
if(this.onLoadDeferred){
this.onLoadDeferred.callback(true);
}
},onKeyDown:function(e){
this._onKeyDown(e);
},_onKeyDown:function(e){
if(dojo.render.html.moz){
dojo.debug("innerhtml="+this.editNode.innerHTML);
if(this.editNode.innerHTML.replace(/<[\/]?span[^>]*>/g,"").match(/^(<br[^.]*>)+$/)&&e.keyCode!=e.KEY_BACKSPACE){
dojo.debug("RichText.onKeyPressed : mozHack - adding &nbsp;");
this.execCommand("inserthtml","&nbsp;");
this.setCaretPos(0);
this._mozHack=true;
}
}
if((!e)&&(this.object)){
e=dojo.event.browser.fixEvent(this.window.event);
}
if(this.ieTabFix&&dojo.render.html.ie&&e.keyCode==e.KEY_TAB){
e.preventDefault();
e.stopPropagation();
this.execCommand((e.shiftKey?"outdent":"indent"));
}else{
if(dojo.render.html.ie){
dojo.debug("RichText.onKeyDown : keyCode="+e.keyCode);
if((65<=e.keyCode)&&(e.keyCode<=90)){
this._ieDelHack=true;
e.charCode=e.keyCode;
this.onKeyPress(e);
}else{
if(e.keyCode==e.KEY_ENTER){
this._ieDelHack=true;
dojo.debug("RichText.onKeyDown : adding <br>"+this.editNode.innerHTML);
var _401=this.document.selection.createRange();
_401.pasteHTML("<a br=\"true\"></a>");
}else{
if(e.keyCode==e.KEY_BACKSPACE){
var _401=this.document.selection.createRange();
dojo.debug("range.text='"+_401.text+"'");
if(this._ieDelHack&&_401.text.length<=1){
dojo.debug("RichText._onKeyDown, ieDelHack");
this._ieDelHack=false;
var pos=this.getCaretPos();
html=this.editNode.innerHTML;
html=html.replace(/<\/p>\s*<p>/ig,"</p><p>").replace(/<a\s*href="mailto:[^"]*"[^>]*>(.*)<\/a[^>]*>/ig,"$1").replace(/<a\s*br="true">\s*<\/a>/gi,"<br>").replace(/<p><span><br><\/span>&nbsp;<\/p>/ig,"<br>").replace(/<[\/]?p[^>]*>/ig,"");
this.editNode.innerHTML=html;
this.setCaretPos(pos);
}
}else{
this._ieDelHack=true;
}
}
}
}else{
if(dojo.render.html.opera){
if(e.keyCode==e.KEY_ENTER){
this.execCommand("inserthtml","<br>");
dojo.debug("RichText._onKeyDown : adding <br> innerHTML="+this.editNode.innerHTML);
dojo.event.browser.stopEvent(e);
}
}
}
}
},onKeyUp:function(e){
},onInput:function(e){
return;
},KEY_CTRL:1,onKeyPress:function(e){
if((!e)&&(this.object)){
e=dojo.event.browser.fixEvent(this.window.event);
}
var _406=e.ctrlKey?this.KEY_CTRL:0;
if(this._keyHandlers[e.key]){
var _407=this._keyHandlers[e.key],i=0,_409;
while(_409=_407[i++]){
if(_406==_409.modifiers){
e.preventDefault();
_409.handler.call(this);
break;
}
}
}
dojo.lang.setTimeout(this,this.onKeyPressed,1,e);
},addKeyHandler:function(key,_40b,_40c){
if(!(this._keyHandlers[key] instanceof Array)){
this._keyHandlers[key]=[];
}
this._keyHandlers[key].push({modifiers:_40b||0,handler:_40c});
},onKeyPressed:function(e){
dojo.debug("onKeyPressed");
if(dojo.render.html.ie){
if(!this.ieAutoUrl){
if(e.key=="<"||e.key==">"){
var _40e=this.document.selection.createRange();
_40e.moveStart("character",-1);
_40e.pasteHTML("<span>"+((e.key=="<")?"&lt;":"&gt;")+"</span>");
_40e.collapse(false);
}else{
if(e.key==","){
var _40e=this.document.selection.createRange();
_40e.moveStart("character",-1);
_40e.pasteHTML("<span comma='true'>,</span>");
_40e.collapse(false);
}
}
}
}else{
if(dojo.render.html.safari||dojo.render.html.chrome){
if(e.keyCode==e.KEY_ENTER){
this.execCommand("inserthtml","<a br=\"true\"></a>");
}
}else{
if(this._mozHack){
var text=this.getText();
dojo.debug("mozHack, len="+text.length);
var _410=(text.length>2)?text.length-2:1;
var end=(text.length>2)?text.length:2;
this.setSelectedRange(_410,end);
this.execCommand("delete");
this.setCaretPos(_410);
this._mozHack=false;
}
}
}
this.onDisplayChanged();
},onClick:function(e){
this.onDisplayChanged(e);
},onBlur:function(e){
this._hasFocus=false;
dojo.debug("RichText.onBlur");
},_iframeFocus:function(e){
if(this._hasFocus&&!dojo.render.html.moz){
dojo.debug("RichText.iframeFocus : Grabbing back focus, e="+e);
this.focus();
}
},onPaste:function(e){
dojo.debug("RichText.onPaste : Enter");
if(dojo.render.html.moz){
dojo.debug("innerhtml="+this.editNode.innerHTML);
if(this.editNode.innerHTML.replace(/<[\/]?span[^>]*>/g,"").match(/^(<br[^.]*>)+$/)){
dojo.debug("RichText.onPaste : mozHack - adding &nbsp;");
this.execCommand("inserthtml","&nbsp;");
this.setCaretPos(0);
this._mozHack=true;
}
}
dojo.lang.setTimeout(this,this._onPaste,1,e);
},_onPaste:function(e){
try{
dojo.debug("RichText._onPaste : Enter, clearFormatting="+this.clearFormatting+", ieAutoUrl="+this.ieAutoUrl);
if(this.clearFormatting){
this.replaceEditorContent(this._removeFormatting(this.getEditorContent()));
}
if(dojo.render.html.ie&&!this.ieAutoUrl){
this.execCommand("selectall");
this.execCommand("unlink");
}else{
if(this._mozHack){
var text=this.getText();
dojo.debug("mozHack, len="+text.length);
var _418=(text.length>2)?text.length-2:1;
var end=(text.length>2)?text.length:2;
this.setSelectedRange(_418,end);
this.execCommand("delete");
this.setCaretPos(_418);
this._mozHack=false;
}
}
if(this.clearFormatting||(dojo.render.html.ie&&!this.ieAutoUrl)){
dojo.withGlobal(this.window,"collapse",dojo.html.selection,[false]);
}
}
catch(e){
dojo.debug(e);
}
},ieUnlink:function(){
try{
var _41a=this.getElementsByTagName("a");
dojo.lang.forEach(_41a,function(a){
a.href="javascript:void(0)";
},this);
}
catch(e){
circleup.widget.utils.dumpProps(e);
}
},onMouseDown:function(e){
},onMouseOut:function(e){
},onMouseMove:function(e){
},onMouseOver:function(e){
},onMouseUp:function(e){
},_initialFocus:true,onFocus:function(e){
dojo.debug("RichText.onFocus : Enter, _initialFocus="+this._initialFocus);
this._hasFocus=true;
if(this._initialFocus){
this._initialFocus=false;
}
dojo.body().style.display="none";
dojo.body().style.display="";
if(dojo.render.html.safari){
this.iframe.focus();
}
var text=this.editNode.innerText||this.editNode.textContent||this.editNode.innerHTML.replace(/<\/?[^>]+>/gi,"");
if(dojo.string.trim(text)==""){
this.placeCursorAtStart();
}
},blur:function(){
if(this.iframe){
this.window.blur();
}else{
if(this.object){
this.document.body.blur();
}else{
if(this.editNode){
this.editNode.blur();
}
}
}
},focus:function(){
dojo.debug("RichText.focus : Enter");
if(this.iframe&&!dojo.render.html.ie){
if(typeof this.window=="undefined"){
window.setTimeout(dojo.lang.hitch(this,"focus"),50);
return;
}
try{
this.window.focus();
}
catch(e){
circleup.widget.utils.dumpProps(e);
}
}else{
if(this.object){
this.document.focus();
}else{
if(this.editNode&&this.editNode.focus){
dojo.debug("RichText.focus : Calling editNode.focus");
this.editNode.focus();
}else{
dojo.debug("Have no idea how to focus into the editor!");
}
}
}
},onDisplayChanged:function(e){
},_activeX:{command:{bold:5000,italic:5023,underline:5048,justifycenter:5024,justifyleft:5025,justifyright:5026,cut:5003,copy:5002,paste:5032,"delete":5004,undo:5049,redo:5033,removeformat:5034,selectall:5035,unlink:5050,indent:5018,outdent:5031,insertorderedlist:5030,insertunorderedlist:5051,inserttable:5022,insertcell:5019,insertcol:5020,insertrow:5021,deletecells:5005,deletecols:5006,deleterows:5007,mergecells:5029,splitcell:5047,setblockformat:5043,getblockformat:5011,getblockformatnames:5012,setfontname:5044,getfontname:5013,setfontsize:5045,getfontsize:5014,setbackcolor:5042,getbackcolor:5010,setforecolor:5046,getforecolor:5015,findtext:5008,font:5009,hyperlink:5016,image:5017,lockelement:5027,makeabsolute:5028,sendbackward:5036,bringforward:5037,sendbelowtext:5038,bringabovetext:5039,sendtoback:5040,bringtofront:5041,properties:5052},ui:{"default":0,prompt:1,noprompt:2},status:{notsupported:0,disabled:1,enabled:3,latched:7,ninched:11},appearance:{flat:0,inset:1},state:{unchecked:0,checked:1,gray:2}},_normalizeCommand:function(cmd){
var drh=dojo.render.html;
var _426=cmd.toLowerCase();
if(_426=="formatblock"){
if(drh.safari){
_426="heading";
}
}else{
if(this.object){
switch(_426){
case "createlink":
_426="hyperlink";
break;
case "insertimage":
_426="image";
break;
}
}else{
if(_426=="hilitecolor"&&!drh.mozilla){
_426="backcolor";
}
}
}
return _426;
},_safariIsLeopard:function(){
var _427=false;
if(dojo.render.html.safari){
var tmp=dojo.render.html.UA.split("AppleWebKit/")[1];
var ver=parseFloat(tmp.split(" ")[0]);
if(ver>=420){
_427=true;
}
}
return _427;
},queryCommandAvailable:function(_42a){
var ie=1;
var _42c=1<<1;
var _42d=1<<2;
var _42e=1<<3;
var _42f=1<<4;
var _430=this._safariIsLeopard();
function isSupportedBy(_431){
return {ie:Boolean(_431&ie),mozilla:Boolean(_431&_42c),safari:Boolean(_431&_42d),safari420:Boolean(_431&_42f),opera:Boolean(_431&_42e)};
}
var _432=null;
switch(_42a.toLowerCase()){
case "bold":
case "italic":
case "underline":
case "subscript":
case "superscript":
case "fontname":
case "fontsize":
case "forecolor":
case "hilitecolor":
case "justifycenter":
case "justifyfull":
case "justifyleft":
case "justifyright":
case "delete":
case "selectall":
_432=isSupportedBy(_42c|ie|_42d|_42e);
break;
case "createlink":
case "unlink":
case "removeformat":
case "inserthorizontalrule":
case "insertimage":
case "insertorderedlist":
case "insertunorderedlist":
case "indent":
case "outdent":
case "formatblock":
case "inserthtml":
case "undo":
case "redo":
case "strikethrough":
_432=isSupportedBy(_42c|ie|_42e|_42f);
break;
case "blockdirltr":
case "blockdirrtl":
case "dirltr":
case "dirrtl":
case "inlinedirltr":
case "inlinedirrtl":
_432=isSupportedBy(ie);
break;
case "cut":
case "copy":
case "paste":
_432=isSupportedBy(ie|_42c|_42f);
break;
case "inserttable":
_432=isSupportedBy(_42c|(this.object?ie:0));
break;
case "insertcell":
case "insertcol":
case "insertrow":
case "deletecells":
case "deletecols":
case "deleterows":
case "mergecells":
case "splitcell":
_432=isSupportedBy(this.object?ie:0);
break;
default:
return false;
}
return (dojo.render.html.ie&&_432.ie)||(dojo.render.html.mozilla&&_432.mozilla)||(dojo.render.html.safari&&_432.safari)||(_430&&_432.safari420)||(dojo.render.html.opera&&_432.opera);
},execCommand:function(_433,_434){
var _435;
dojo.debug("RichText.execCommand : cmd="+_433+", _hasFocus="+this._hasFocus);
if(!this._hasFocus){
this.focus();
}
_433=this._normalizeCommand(_433);
if(_434!=undefined){
if(_433=="heading"){
throw new Error("unimplemented");
}else{
if(_433=="formatblock"){
if(this.object){
_434=this._native2LocalFormatNames[_434];
}else{
if(dojo.render.html.ie){
_434="<"+_434+">";
}
}
}
}
}
if(this.object){
switch(_433){
case "hilitecolor":
_433="setbackcolor";
break;
case "forecolor":
case "backcolor":
case "fontsize":
case "fontname":
_433="set"+_433;
break;
case "formatblock":
_433="setblockformat";
}
if(_433=="strikethrough"){
_433="inserthtml";
var _436=this.document.selection.createRange();
if(!_436.htmlText){
return;
}
_434=_436.htmlText.strike();
}else{
if(_433=="inserthorizontalrule"){
_433="inserthtml";
_434="<hr>";
}
}
if(_433=="inserthtml"){
var _436=this.document.selection.createRange();
if(this.document.selection.type.toUpperCase()=="CONTROL"){
for(var i=0;i<_436.length;i++){
_436.item(i).outerHTML=_434;
}
}else{
if(!this.ieAutoUrl){
_434=_434.replace(/((&lt;|<)?(\s|&nbsp;)*([\w\.]+@[\w\.]+)(\s|&nbsp;)*(&gt;|>)?)/gi,"<span>$2$3</span><a href='javascript:void(0)'>$4</a><span>$5$6</span>");
_434=_434.replace(/,/g,"<a href='javascript:void(0)'>,</a>");
}
_436.pasteHTML(_434);
_436.select();
}
_435=true;
}else{
if(arguments.length==1){
_435=this.object.ExecCommand(this._activeX.command[_433],this._activeX.ui.noprompt);
}else{
_435=this.object.ExecCommand(this._activeX.command[_433],this._activeX.ui.noprompt,_434);
}
}
}else{
if(_433=="inserthtml"){
if(dojo.render.html.ie){
if(!this.ieAutoUrl){
_434=_434.replace(/((&lt;|<)?(\s|&nbsp;)*([\w\.]+@[\w\.]+)(\s|&nbsp;)*(&gt;|>)?)/gi,"<span>$2$3</span><a href='javascript:void(0)'>$4</a><span>$5$6</span>");
_434=_434.replace(/,/g,"<a href='javascript:void(0)'>,</a>");
}
var _438=this.document.selection.createRange();
_438.pasteHTML(_434);
_438.select();
return true;
}else{
return this.document.execCommand(_433,false,_434);
}
}else{
if((_433=="unlink")&&(this.queryCommandEnabled("unlink"))&&(dojo.render.html.mozilla)){
var _439=this.window.getSelection();
var _43a=_439.getRangeAt(0);
var _43b=_43a.startContainer;
var _43c=_43a.startOffset;
var _43d=_43a.endContainer;
var _43e=_43a.endOffset;
var a=dojo.withGlobal(this.window,"getAncestorElement",dojo.html.selection,["a"]);
dojo.withGlobal(this.window,"selectElement",dojo.html.selection,[a]);
_435=this.document.execCommand("unlink",false,null);
var _43a=this.document.createRange();
_43a.setStart(_43b,_43c);
_43a.setEnd(_43d,_43e);
_439.removeAllRanges();
_439.addRange(_43a);
return _435;
}else{
if((_433=="hilitecolor")&&(dojo.render.html.mozilla)){
this.document.execCommand("useCSS",false,false);
_435=this.document.execCommand(_433,false,_434);
this.document.execCommand("useCSS",false,true);
}else{
if((dojo.render.html.ie)&&((_433=="backcolor")||(_433=="forecolor"))){
_434=arguments.length>1?_434:null;
_435=this.document.execCommand(_433,false,_434);
}else{
_434=arguments.length>1?_434:null;
if(_434||_433!="createlink"){
_435=this.document.execCommand(_433,false,_434);
}
}
}
}
}
}
this.onDisplayChanged();
return _435;
},queryCommandEnabled:function(_440){
_440=this._normalizeCommand(_440);
if(this.object){
switch(_440){
case "hilitecolor":
_440="setbackcolor";
break;
case "forecolor":
case "backcolor":
case "fontsize":
case "fontname":
_440="set"+_440;
break;
case "formatblock":
_440="setblockformat";
break;
case "strikethrough":
_440="bold";
break;
case "inserthorizontalrule":
return true;
}
if(typeof this._activeX.command[_440]=="undefined"){
return false;
}
var _441=this.object.QueryStatus(this._activeX.command[_440]);
return ((_441!=this._activeX.status.notsupported)&&(_441!=this._activeX.status.disabled));
}else{
if(dojo.render.html.mozilla){
if(_440=="unlink"){
return dojo.withGlobal(this.window,"hasAncestorElement",dojo.html.selection,["a"]);
}else{
if(_440=="inserttable"){
return true;
}
}
}
var elem=(dojo.render.html.ie)?this.document.selection.createRange():this.document;
return elem.queryCommandEnabled(_440);
}
},queryCommandState:function(_443){
_443=this._normalizeCommand(_443);
if(this.object){
if(_443=="forecolor"){
_443="setforecolor";
}else{
if(_443=="backcolor"){
_443="setbackcolor";
}else{
if(_443=="strikethrough"){
return dojo.withGlobal(this.window,"hasAncestorElement",dojo.html.selection,["strike"]);
}else{
if(_443=="inserthorizontalrule"){
return false;
}
}
}
}
if(typeof this._activeX.command[_443]=="undefined"){
return null;
}
var _444=this.object.QueryStatus(this._activeX.command[_443]);
return ((_444==this._activeX.status.latched)||(_444==this._activeX.status.ninched));
}else{
return this.document.queryCommandState(_443);
}
},queryCommandValue:function(_445){
_445=this._normalizeCommand(_445);
if(this.object){
switch(_445){
case "forecolor":
case "backcolor":
case "fontsize":
case "fontname":
_445="get"+_445;
return this.object.execCommand(this._activeX.command[_445],this._activeX.ui.noprompt);
case "formatblock":
var _446=this.object.execCommand(this._activeX.command["getblockformat"],this._activeX.ui.noprompt);
if(_446){
return this._local2NativeFormatNames[_446];
}
}
}else{
if(dojo.render.html.ie&&_445=="formatblock"){
return this._local2NativeFormatNames[this.document.queryCommandValue(_445)]||this.document.queryCommandValue(_445);
}
return this.document.queryCommandValue(_445);
}
},placeCursorAtStart:function(){
this.setCaretPos(0);
},placeCursorAtEnd:function(){
var text=this.getText().replace(/\n/g,"");
this.setCaretPos(text.length);
},replaceEditorContent:function(html){
html=this._preFilterContent(html);
html=(!html||html=="")?(dojo.render.html.ie)?"<span></span>":((dojo.render.html.opera)?"<p></p>":"<br>"):html;
dojo.debug("RichText.replaceEditorContent, html="+html);
if(this.isClosed){
this.domNode.innerHTML=html;
}else{
if(this.window&&this.window.getSelection&&!dojo.render.html.moz){
var pos=(this._hasFocus)?this.getCaretPos():0;
var _44a=(dojo.render.html.opera)?this.editNode:this.document.body.firstChild;
dojo.lang.forEach(this.events,function(e){
dojo.event.MethodJoinPoint.getForMethod(_44a,e.toLowerCase()).disconnect();
},this);
_44a.innerHTML=html.replace(/<br><\/span>$/i,"<br>&nbsp;</span>");
dojo.debug("RichText.replaceEditorContent : innerHTML="+_44a.innerHTML);
dojo.lang.forEach(this.events,function(e){
dojo.event.connect(_44a,e.toLowerCase(),this,e);
},this);
if(this._hasFocus){
this.setCaretPos(pos);
}
}else{
if((this.window&&this.window.getSelection)||(this.document&&this.document.selection)){
try{
var pos=(this._hasFocus)?this.getCaretPos():0;
if(dojo.render.html.ie&&!this.ieAutoUrl){
html=html.replace(/((&lt;|<)?(\s|&nbsp;)*([\w]+@[\w]+)(\s|&nbsp;)*(&gt;|>)?)/gi,"<span>$2$3</span><a href='javascript:void(0)'>$4</a><span>$5$6</span>");
html=html.replace(/,/g,"<span comma='true'>,</span>");
}
this.editNode.innerHTML=html;
if(this._hasFocus){
this.setCaretPos(pos);
}
}
catch(e){
circleup.widget.utils.dumpProps(e);
}
}
}
}
},_preFilterContent:function(html){
var ec=html;
dojo.lang.forEach(this.contentPreFilters,function(ef){
ec=ef(ec);
});
if(this.contentDomPreFilters.length>0){
var dom=dojo.doc().createElement("div");
dom.style.display="none";
dojo.body().appendChild(dom);
dom.innerHTML=ec;
dojo.lang.forEach(this.contentDomPreFilters,function(ef){
dom=ef(dom);
});
ec=dom.innerHTML;
dojo.body().removeChild(dom);
}
return ec;
},_postFilterContent:function(html){
var ec=html;
if(this.contentDomPostFilters.length>0){
var dom=this.document.createElement("div");
dom.innerHTML=ec;
dojo.lang.forEach(this.contentDomPostFilters,function(ef){
dom=ef(dom);
});
ec=dom.innerHTML;
}
dojo.lang.forEach(this.contentPostFilters,function(ef){
ec=ef(ec);
});
return ec;
},_lastHeight:0,_updateHeight:function(){
if(!this.isLoaded){
return;
}
if(this.height){
return;
}
var _457=dojo.html.getBorderBox(this.editNode).height;
if(!_457){
_457=dojo.html.getBorderBox(this.document.body).height;
}
if(_457==0){
dojo.debug("Can not figure out the height of the editing area!");
return;
}
this._lastHeight=_457;
this.editorObject.style.height=this._lastHeight+"px";
this.window.scrollTo(0,0);
},_saveContent:function(e){
var _459=dojo.doc().getElementById("dojo.widget.RichText.savedContent");
_459.value+=this._SEPARATOR+this.saveName+":"+this.getEditorContent();
},getEditorContent:function(){
var ec="";
try{
ec=(this._content.length>0)?this._content:this.editNode.innerHTML;
if(dojo.string.trim(ec)=="&nbsp;"){
ec="";
}
}
catch(e){
}
if(dojo.render.html.ie&&!this.object){
var re=new RegExp("(?:<p>&nbsp;</p>[\n\r]*)+$","i");
ec=ec.replace(re,"");
}
ec=this._postFilterContent(ec);
if(this.relativeImageUrls){
var _45c=dojo.global().location.protocol+"//"+dojo.global().location.host;
var _45d=dojo.global().location.pathname;
if(_45d.match(/\/$/)){
}else{
var _45e=_45d.split("/");
if(_45e.length){
_45e.pop();
}
_45d=_45e.join("/")+"/";
}
var _45f=new RegExp("(<img[^>]* src=[\"'])("+_45c+"("+_45d+")?)","ig");
ec=ec.replace(_45f,"$1");
}
return ec;
},close:function(save,_461){
if(this.isClosed){
return false;
}
if(arguments.length==0){
save=true;
}
this._content=this._postFilterContent(this.editNode.innerHTML);
var _462=(this.savedContent!=this._content);
if(this.interval){
clearInterval(this.interval);
}
if(dojo.render.html.ie&&!this.object){
dojo.event.browser.clean(this.editNode);
}
if(this.iframe){
delete this.iframe;
}
if(this.textarea){
with(this.textarea.style){
position="";
left=top="";
if(dojo.render.html.ie){
overflow=this.__overflow;
this.__overflow=null;
}
}
if(save){
this.textarea.value=this._content;
}else{
this.textarea.value=this.savedContent;
}
dojo.html.removeNode(this.domNode);
this.domNode=this.textarea;
}else{
if(save){
if(dojo.render.html.moz){
var nc=dojo.doc().createElement("span");
this.domNode.appendChild(nc);
nc.innerHTML=this.editNode.innerHTML;
}else{
this.domNode.innerHTML=this._content;
}
}else{
this.domNode.innerHTML=this.savedContent;
}
}
dojo.html.removeClass(this.domNode,"RichTextEditable");
this.isClosed=true;
this.isLoaded=false;
delete this.editNode;
if(this.window._frameElement){
this.window._frameElement=null;
}
this.window=null;
this.document=null;
this.object=null;
this.editingArea=null;
this.editorObject=null;
return _462;
},destroyRendering:function(){
},destroy:function(){
this.destroyRendering();
if(!this.isClosed){
this.close(false);
}
dojo.widget.RichText.superclass.destroy.call(this);
},connect:function(_464,_465,_466){
dojo.event.connect(_464,_465,this,_466);
},disconnect:function(_467,_468,_469){
dojo.event.disconnect(_467,_468,this,_469);
},disconnectAllWithRoot:function(_46a){
dojo.deprecated("disconnectAllWithRoot","is deprecated. No need to disconnect manually","0.5");
},_fixContentForMoz:function(html){
html=html.replace(/<strong([ \>])/gi,"<b$1");
html=html.replace(/<\/strong>/gi,"</b>");
html=html.replace(/<em([ \>])/gi,"<i$1");
html=html.replace(/<\/em>/gi,"</i>");
return html;
},_removeFormatting:function(html){
if(this.clearFormatting){
html=circleup.widget.utils.getTextWithBr(html);
html=html.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br>").replace(/ /g,"&nbsp;");
}
return html;
}});
dojo.provide("circleup.widget.ResizableTextArea");
dojo.require("circleup.widget.Resizable");
var sizing={INHERIT:"inherit",BORDER:"border",CONTENT:"content"};
var templates={textarea:{templateString:"<div id=\"${this.widgetId}\"\n     style=\"${this.cssStyle}\">\n\t<div dojoAttachPoint=\"_wrapper\" \n\t     style=\"display:table !important;display:inline-block !important;display:inline;padding:0px;margin:0px;border:0px;line-spacing:0px;\">\n\t\t<textarea dojoAttachPoint=\"containerNode\" \n\t\t          id=\"${this.widgetId}_TA\"\n\t\t          name=\"${this.widgetId}_TA\"\n\t\t          class=\"${this.cssClass} resizable\" \n\t\t          style=\"resize:none;margin:0px;float:left;\"></textarea></div></div>\n"},richtextarea:{templateString:"<div id=\"${this.widgetId}\"\n     style=\"${this.cssStyle}\"\n     class=\"${this.cssClass}\">\n\t<div dojoAttachPoint=\"_wrapper\"\t\n\t     style=\"display:table !important;display:inline-block !important;display:inline;padding:0px;margin:0px;border:0px;line-spacing:0px;\">\n\t    <div dojoType=\"RichText\" \n\t\t     id=\"${this.widgetId}_TA\"\n\t\t     widgetId=\"${this.widgetId}_TA\"\n\t\t     class=\"resizable_rich_textarea resizable\"\n\t\t     style=\"height:0px;\"\n\t\t     styleSheets=\"${this._styleSheets}\"\n\t\t     height=\"0px\"\n\t\t     ieTabFix=\"false\"\n\t\t     clearFormatting=\"${this.clearFormatting}\"\n\t\t     dojoAttachPoint=\"containerNode\"></div>\n\t</div>\n</div>\n"}};
dojo.widget.fillFromTemplateCache(templates.textarea);
dojo.widget.fillFromTemplateCache(templates.richtextarea);
dojo.widget.defineWidget("circleup.widget.ResizableTextArea",[dojo.widget.HtmlWidget,circleup.widget.Resizable],{isContainer:true,resizable:true,readonly:false,disabled:false,width:"",height:"",cssStyle:"",cssClass:"",richText:false,parseComponents:false,sizing:sizing.INHERIT,clearFormatting:false,_wrapper:null,_styleSheets:djConfig.staticHost+"/assets/css/layout.css;"+djConfig.staticHost+"/assets/css/widgets.css",_richText:null,_textAreaDim:null,_textAreaDim2:null,_hasFocus:false,postMixInProperties:function(args,frag){
this.templateString=this._getTemplate();
if(this.richText){
register(this.widgetId+"_TA",this.widgetId);
}
},_getTemplate:function(){
return (this.richText)?templates.richtextarea.templateString:templates.textarea.templateString;
},fillInTemplate:function(args,frag){
var _471=(this.richText)?this.domNode:this.containerNode;
if(this.width!=""){
_471.style.width=this.width;
}
if(this.height!=""){
_471.style.height=this.height;
}
this._sizeContainer();
},postCreate:function(){
if(this.richText){
this._richText=dojo.widget.byId(this.widgetId+"_TA");
}
this._sizeTextarea();
},_sizeContainer:function(){
var _472=(this.richText)?this.domNode:this.containerNode;
var _473=_472.parentElement?_472.parentElement:_472.parentNode;
with(_472.style){
position="absolute";
left="0px";
top="0px";
display="";
visibility="hidden";
}
dojo.body().appendChild(_472);
if(this.richText){
_472.style.paddingRight="0px";
}
if(this.sizing==sizing.BORDER&&!dojo.html.isBorderBox(_472)){
var dim=dojo.html.getContentBox(_472);
dojo.html.setMarginBox(_472,dim);
}else{
if(this.sizing==sizing.CONTENT&&dojo.html.isBorderBox(_472)){
var dim=dojo.html.getBorderBox(_472);
dojo.html.setContentBox(_472,dim);
}
}
var dim=dojo.html.getBorderBox(_472);
var dim2=dojo.html.getPadBorder(this.containerNode);
this._textAreaDim={width:dim.width-dim2.width,height:dim.height-dim2.height};
this._textAreaDim2=dim;
dojo.dom.prependChild(_472,_473);
with(_472.style){
position="";
left="";
top="";
visibility="";
}
},_sizeTextarea:function(){
this.resizeBar=this._wrapper;
this.resizeContainer=this._wrapper;
if(this.readonly){
this.containerNode.readonly=this.readonly;
}
if(this.disabled){
this.containerNode.disabled=this.disabled;
}
if(this.richText){
dojo.html.addClass(this._richText.iframe,"resizable");
dojo.html.setMarginBox(this.containerNode,this._textAreaDim2);
dojo.html.setContentBox(this._richText.iframe,{width:this._textAreaDim.width-2,height:this._textAreaDim.height-2});
this.domNode.style.height="";
this.domNode.style.width="";
dojo.event.connect(this._richText,"onKeyPress",this,"onKeyPress");
dojo.event.connect(this._richText,"onKeyUp",this,"onKeyUp");
dojo.event.connect(this._richText,"onKeyDown",this,"onKeyDown");
dojo.event.connect(this._richText,"onInput",this,"onInput");
dojo.event.connect(this._richText,"onFocus",this,"onFocus");
dojo.event.connect(this._richText,"onBlur",this,"onBlur");
dojo.event.connect(this._richText,"onPaste",this,"onPaste");
dojo.event.connect(this._richText,"onMouseDown",this,"onMouseDown");
dojo.event.connect(this._richText,"onMouseMove",this,"onMouseMove");
dojo.event.connect(this._richText,"onMouseUp",this,"onMouseUp");
}else{
dojo.event.connect(this.containerNode,"onkeypress",this,"onKeyPress");
dojo.event.connect(this.containerNode,"onkeyup",this,"onKeyUp");
dojo.event.connect(this.containerNode,"onkeydwon",this,"onKeyDown");
dojo.event.connect(this.containerNode,"onfocus",this,"onFocus");
dojo.event.connect(this.containerNode,"onblur",this,"onBlur");
dojo.event.connect(this.containerNode,"oninput",this,"onInput");
dojo.event.connect(this.containerNode,"onpaste",this,"onPaste");
dojo.event.connect(this.containerNode,"onmousedown",this,"onMouseDown");
dojo.event.connect(this.containerNode,"onmousemove",this,"onMouseMove");
dojo.event.connect(this.containerNode,"onmouseup",this,"onMouseUp");
}
this._setResizable();
this._setHandle(this._textAreaDim2.width);
},_setHandle:function(_476){
this.resizeHandle.domNode.style.cssText="display:block;float:left;position:relative;margin-top:-13px;left:"+(_476-13)+"px;clear:both;";
},focus:function(){
dojo.debug("ResizableTextArea.focus, _hasFocus="+this._hasFocus);
try{
if(this.richText){
if(!this._hasFocus){
dojo.debug("ResizableTextArea.focus");
this._richText.focus();
}
}else{
}
}
catch(e){
}
},blur:function(){
dojo.debug("ResizableTextArea.blur, _hasFocus="+this._hasFocus);
try{
if(this.richText){
if(this._hasFocus){
this._richText.blur();
}
}else{
}
}
catch(e){
}
},getValue:function(){
if(this.richText){
return this._richText.getEditorContent();
}else{
return this.containerNode.value;
}
},getText:function(){
if(this.richText){
return this._richText.getText();
}else{
return this.containerNode.value;
}
},setValue:function(val){
if(this.richText){
this._richText.replaceEditorContent(val);
}else{
this.containerNode.value=val;
}
},getCaretPos:function(){
var pos=0;
if(this.richText){
pos=this._richText.getCaretPos();
}else{
if(dojo.lang.isNumber(this.containerNode.selectionStart)){
return this.containerNode.selectionStart;
}else{
if(dojo.render.html.ie){
var tr=document.selection.createRange().duplicate();
var ntr=this.containerNode.createTextRange();
tr.move("character",0);
ntr.move("character",0);
try{
ntr.setEndPoint("EndToEnd",tr);
return String(ntr.text).replace(/\r/g,"").length;
}
catch(e){
return 0;
}
}
}
}
return pos;
},setCaretPos:function(pos){
this._richText.setCaretPos(pos);
return pos;
},pasteAtRange:function(_47c,end,_47e,_47f){
dojo.debug("ResizableTextArea.pasteAtRange : start="+_47c+", end="+end+", value="+_47e+", collapse="+_47f);
this.setSelectedRange(_47c,end);
this.paste(_47e);
if(_47f){
this.collapse(false);
}
},formatRange:function(_480,end,_482,_483){
this.setSelectedRange(_480,end);
this._richText.execCommand("formatblock",_482);
if(_483){
this.collapse(false);
}
},paste:function(_484){
if(this.richText){
this._richText.execCommand("inserthtml",_484);
}else{
}
},collapse:function(_485){
if(this.richText){
dojo.withGlobal(this._richText.window,"collapse",dojo.html.selection,[_485]);
}
},setSelectedRange:function(_486,end){
if(this.richText){
this._richText.setSelectedRange(_486,end);
}else{
if(!end){
end=this.containerNode.value.length;
}
if(this.containerNode.setSelectionRange){
this.containerNode.focus();
this.containerNode.setSelectionRange(_486,end);
}else{
if(this.containerNode.createTextRange){
var _488=this.containerNode.createTextRange();
with(_488){
collapse(true);
moveEnd("character",end);
moveStart("character",_486);
select();
}
}else{
this.containerNode.value=this.containerNode.value;
this.containerNode.blur();
this.containerNode.focus();
var dist=parseInt(this.containerNode.value.length)-end;
var _48a=String.fromCharCode(37);
var tcc=_48a.charCodeAt(0);
for(var x=0;x<dist;x++){
var te=document.createEvent("KeyEvents");
te.initKeyEvent("keypress",true,true,null,false,false,false,false,tcc,tcc);
this.containerNode.dispatchEvent(te);
}
}
}
}
},onResizeEnd:function(e,dim){
this.resizing=false;
resizeRect.style.display="none";
this._resizeTA(dim.delta);
},_resizeTA:function(_490){
circleup.widget.utils.resizeElements(this.resizeContainer,_490);
var dim=dojo.html.getBorderBox(this.containerNode);
this._setHandle(dim.width);
this.domNode.style.display="none";
this.domNode.style.display="";
if(this._onResize){
this._onResize();
}
},setWidth:function(_492){
var dim=dojo.html.getBorderBox(this.containerNode);
var _494={dx:_492-dim.width,dy:0};
this._resizeTA(_494);
},onInput:function(e){
},onMouseDown:function(e){
},onMouseMove:function(e){
},onMouseUp:function(e){
},onKeyPress:function(e){
},onKeyUp:function(e){
},onKeyDown:function(e){
},onFocus:function(e){
dojo.debug("ResizableTextArea.onFocus");
if(this.richText&&!this._hasFocus&&(!dojo.render.html.ie||dojo.render.html.ie80)){
this.containerNode.style.borderWidth="2px";
this.containerNode.style.padding="3px 0px 6px 3px";
}
this._hasFocus=true;
},onBlur:function(e){
dojo.debug("ResizableTextArea.onBlur");
if(this.richText&&this._hasFocus&&(!dojo.render.html.ie||dojo.render.html.ie80)){
this.containerNode.style.borderWidth="1px";
this.containerNode.style.padding="4px 1px 7px 4px";
}
this._hasFocus=false;
},onPaste:function(e){
}});
dojo.provide("dojo.widget.html.stabile");
dojo.widget.html.stabile={_sqQuotables:new RegExp("([\\\\'])","g"),_depth:0,_recur:false,depthLimit:2};
dojo.widget.html.stabile.getState=function(id){
dojo.widget.html.stabile.setup();
return dojo.widget.html.stabile.widgetState[id];
};
dojo.widget.html.stabile.setState=function(id,_4a1,_4a2){
dojo.widget.html.stabile.setup();
dojo.widget.html.stabile.widgetState[id]=_4a1;
if(_4a2){
dojo.widget.html.stabile.commit(dojo.widget.html.stabile.widgetState);
}
};
dojo.widget.html.stabile.setup=function(){
if(!dojo.widget.html.stabile.widgetState){
var text=dojo.widget.html.stabile._getStorage().value;
dojo.widget.html.stabile.widgetState=text?dj_eval("("+text+")"):{};
}
};
dojo.widget.html.stabile.commit=function(_4a4){
dojo.widget.html.stabile._getStorage().value=dojo.widget.html.stabile.description(_4a4);
};
dojo.widget.html.stabile.description=function(v,_4a6){
var _4a7=dojo.widget.html.stabile._depth;
var _4a8=function(){
return this.description(this,true);
};
try{
if(v===void (0)){
return "undefined";
}
if(v===null){
return "null";
}
if(typeof (v)=="boolean"||typeof (v)=="number"||v instanceof Boolean||v instanceof Number){
return v.toString();
}
if(typeof (v)=="string"||v instanceof String){
var v1=v.replace(dojo.widget.html.stabile._sqQuotables,"\\$1");
v1=v1.replace(/\n/g,"\\n");
v1=v1.replace(/\r/g,"\\r");
return "'"+v1+"'";
}
if(v instanceof Date){
return "new Date("+d.getFullYear+","+d.getMonth()+","+d.getDate()+")";
}
var d;
if(v instanceof Array||v.push){
if(_4a7>=dojo.widget.html.stabile.depthLimit){
return "[ ... ]";
}
d="[";
var _4ab=true;
dojo.widget.html.stabile._depth++;
for(var i=0;i<v.length;i++){
if(_4ab){
_4ab=false;
}else{
d+=",";
}
d+=arguments.callee(v[i],_4a6);
}
return d+"]";
}
if(v.constructor==Object||v.toString==_4a8){
if(_4a7>=dojo.widget.html.stabile.depthLimit){
return "{ ... }";
}
if(typeof (v.hasOwnProperty)!="function"&&v.prototype){
throw new Error("description: "+v+" not supported by script engine");
}
var _4ab=true;
d="{";
dojo.widget.html.stabile._depth++;
for(var key in v){
if(v[key]==void (0)||typeof (v[key])=="function"){
continue;
}
if(_4ab){
_4ab=false;
}else{
d+=", ";
}
var kd=key;
if(!kd.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)){
kd=arguments.callee(key,_4a6);
}
d+=kd+": "+arguments.callee(v[key],_4a6);
}
return d+"}";
}
if(_4a6){
if(dojo.widget.html.stabile._recur){
var _4af=Object.prototype.toString;
return _4af.apply(v,[]);
}else{
dojo.widget.html.stabile._recur=true;
return v.toString();
}
}else{
throw new Error("Unknown type: "+v);
return "'unknown'";
}
}
finally{
dojo.widget.html.stabile._depth=_4a7;
}
};
dojo.widget.html.stabile._getStorage=function(){
if(dojo.widget.html.stabile.dataField){
return dojo.widget.html.stabile.dataField;
}
var form=document.forms._dojo_form;
return dojo.widget.html.stabile.dataField=form?form.stabile:{value:""};
};
dojo.provide("dojo.widget.ComboBox");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.string");
dojo.require("dojo.widget.PopupContainer");
dojo.declare("dojo.widget.incrementalComboBoxDataProvider",null,function(_4b1){
this.searchUrl=_4b1.dataUrl;
this._cache={};
this._inFlight=false;
this._lastRequest=null;
this.allowCache=false;
},{_addToCache:function(_4b2,data){
if(this.allowCache){
this._cache[_4b2]=data;
}
},startSearch:function(_4b4,_4b5){
if(this._inFlight){
}
var tss=encodeURIComponent(_4b4);
var _4b7=dojo.string.substituteParams(this.searchUrl,{"searchString":tss});
var _4b8=this;
var _4b9=this._lastRequest=dojo.io.bind({url:_4b7,method:"get",mimetype:"text/json",preventCache:true,load:function(type,data,evt){
_4b8._inFlight=false;
if(!dojo.lang.isArray(data)){
var _4bd=[];
for(var key in data){
_4bd.push([data[key],key]);
}
data=_4bd;
}
_4b8._addToCache(_4b4,data);
if(_4b9==_4b8._lastRequest){
_4b5(data);
}
}});
this._inFlight=true;
}});
dojo.declare("dojo.widget.basicComboBoxDataProvider",null,function(_4bf,node){
this._data=[];
this.searchLimit=30;
this.searchType="STARTSTRING";
this.caseSensitive=false;
if(!dj_undef("dataUrl",_4bf)&&!dojo.string.isBlank(_4bf.dataUrl)){
this._getData(_4bf.dataUrl);
}else{
if((node)&&(node.nodeName.toLowerCase()=="select")){
var opts=node.getElementsByTagName("option");
var ol=opts.length;
var data=[];
for(var x=0;x<ol;x++){
var text=opts[x].textContent||opts[x].innerText||opts[x].innerHTML;
var _4c6=[String(text),String(opts[x].value)];
data.push(_4c6);
if(opts[x].selected){
_4bf.setAllValues(_4c6[0],_4c6[1]);
}
}
this.setData(data);
}
}
},{_getData:function(url){
dojo.io.bind({url:url,load:dojo.lang.hitch(this,function(type,data,evt){
if(!dojo.lang.isArray(data)){
var _4cb=[];
for(var key in data){
_4cb.push([data[key],key]);
}
data=_4cb;
}
this.setData(data);
}),mimetype:"text/json"});
},startSearch:function(_4cd,_4ce){
this._performSearch(_4cd,_4ce);
},_performSearch:function(_4cf,_4d0){
var st=this.searchType;
var ret=[];
if(!this.caseSensitive){
_4cf=_4cf.toLowerCase();
}
for(var x=0;x<this._data.length;x++){
if((this.searchLimit>0)&&(ret.length>=this.searchLimit)){
break;
}
var _4d4=new String((!this.caseSensitive)?this._data[x][0].toLowerCase():this._data[x][0]);
if(_4d4.length<_4cf.length){
continue;
}
if(st=="STARTSTRING"){
if(_4cf==_4d4.substr(0,_4cf.length)){
ret.push(this._data[x]);
}
}else{
if(st=="SUBSTRING"){
if(_4d4.indexOf(_4cf)>=0){
ret.push(this._data[x]);
}
}else{
if(st=="STARTWORD"){
var idx=_4d4.indexOf(_4cf);
if(idx==0){
ret.push(this._data[x]);
}
if(idx<=0){
continue;
}
var _4d6=false;
while(idx!=-1){
if(" ,/(".indexOf(_4d4.charAt(idx-1))!=-1){
_4d6=true;
break;
}
idx=_4d4.indexOf(_4cf,idx+1);
}
if(!_4d6){
continue;
}else{
ret.push(this._data[x]);
}
}
}
}
}
_4d0(ret);
},setData:function(_4d7){
this._data=_4d7;
}});
dojo.widget.defineWidget("dojo.widget.ComboBox",dojo.widget.HtmlWidget,{forceValidOption:false,searchType:"stringstart",dataProvider:null,autoComplete:true,searchDelay:200,dataUrl:"",fadeTime:0,maxListLength:8,mode:"local",selectedResult:null,floatStyle:"none",dataProviderClass:"",showButton:true,widthPercent:1,buttonSrc_enabled:dojo.uri.moduleUri("dojo.widget","templates/images/combo_box_arrow.png"),buttonSrc_hover:dojo.uri.moduleUri("dojo.widget","templates/images/combo_box_arrow.hover.png"),buttonSrc_pressed:dojo.uri.moduleUri("dojo.widget","templates/images/combo_box_arrow.pressed.png"),buttonSrc_disabled:dojo.uri.moduleUri("dojo.widget","templates/images/combo_box_arrow.disabled.png"),buttonSrc:"",dropdownToggle:"plain",value:"",enabled:true,searchOnPaste:false,_isOver:false,_hasFocus:false,_onPopUp:false,_onArrow:false,templateString:"<div style=\"display:inline;float:${this.floatStyle}\" \n><span class=\"dojoComboBox dojoComboBoxOuter\"\n     dojoAttachPoint=\"_comboBoxWrapper\"\n><div style=\"display:table !important;display:inline;\"><input type=\"text\" \n        autocomplete=\"off\" \n\t\tid=\"${this.widgetId}_input\" \n        class=\"dojoComboBox\" \n        value=\"${this.value}\"\n\t\tdojoAttachEvent=\"onkeydown:_onKeyDown; onkeypress:_onKeyPress; onkeyup: onKeyUp; onpaste: onPaste; compositionEnd; onResize; onFocus : _onFocus; onBlur : _onBlur\"\n\t\tdojoAttachPoint=\"textInputNode\"\n><img\tclass=\"dojoComboBox\"\n        dojoAttachPoint=\"downArrowNode\"\n\t\tdojoAttachEvent=\"onMouseUp:_onArrowMouseUp; onResize; onMouseOver: _onArrowMouseOver; onMouseOut: _onArrowMouseOut; onMouseDown : _handleArrowClick;\"\n\t\tsrc=\"${this.buttonSrc}\"></div></span><input style=\"display:none\"  tabindex=\"-1\" name=\"\" value=\"${this.value}\" \n\t\tdojoAttachPoint=\"comboBoxValue\" \n><input style=\"display:none\"  tabindex=\"-1\" name=\"\" value=\"\" \n\t\tdojoAttachPoint=\"comboBoxSelectionValue\"\n></div>\n",_comboBoxWrapper:null,setValue:function(_4d8){
this.comboBoxValue.value=_4d8;
if(this.textInputNode.value!=_4d8){
this.textInputNode.value=_4d8;
dojo.widget.html.stabile.setState(this.widgetId,this.getState(),true);
this.onValueChanged(_4d8);
}
},onValueChanged:function(_4d9){
},onSelection:function(_4da){
},onEnter:function(){
},getValue:function(){
return this.comboBoxValue.value;
},getState:function(){
return {value:this.getValue()};
},setState:function(_4db){
this.setValue(_4db.value);
},enable:function(){
this.disabled=false;
this.textInputNode.removeAttribute("disabled");
this.downArrowNode.src=this.buttonSrc_enabled;
dojo.html.removeClass(this.domNode,"disabled");
},disable:function(){
this.disabled=true;
this.textInputNode.setAttribute("disabled",true);
this.downArrowNode.src=this.buttonSrc_disabled;
dojo.html.addClass(this.domNode,"disabled");
},focus:function(){
this.textInputNode.focus();
},_getCaretPos:function(_4dc){
if(dojo.lang.isNumber(_4dc.selectionStart)){
return _4dc.selectionStart;
}else{
if(dojo.render.html.ie){
var tr=document.selection.createRange().duplicate();
var ntr=_4dc.createTextRange();
tr.move("character",0);
ntr.move("character",0);
try{
ntr.setEndPoint("EndToEnd",tr);
return String(ntr.text).replace(/\r/g,"").length;
}
catch(e){
return 0;
}
}
}
},_setCaretPos:function(_4df,_4e0){
_4e0=parseInt(_4e0);
this._setSelectedRange(_4df,_4e0,_4e0);
dojo.debug("_setCaretPos, loc="+_4e0);
},_setSelectedRange:function(_4e1,_4e2,end){
if(!end){
end=_4e1.value.length;
}
if(_4e1.setSelectionRange){
_4e1.focus();
_4e1.setSelectionRange(_4e2,end);
}else{
if(_4e1.createTextRange){
var _4e4=_4e1.createTextRange();
with(_4e4){
collapse(true);
moveEnd("character",end);
moveStart("character",_4e2);
select();
}
}else{
_4e1.value=_4e1.value;
_4e1.blur();
_4e1.focus();
var dist=parseInt(_4e1.value.length)-end;
var _4e6=String.fromCharCode(37);
var tcc=_4e6.charCodeAt(0);
for(var x=0;x<dist;x++){
var te=document.createEvent("KeyEvents");
te.initKeyEvent("keypress",true,true,null,false,false,false,false,tcc,tcc);
_4e1.dispatchEvent(te);
}
}
}
},_onKeyPress:function(evt){
dojo.debug("ResizableComboBox.onKeyPress, evt.key="+evt.key);
dojo.debug("keypress : key="+evt.key+",keycode="+evt.keyCode+",cancelBubble="+evt.cancelBubble);
this._handleKeyEvents(evt);
},_onKeyDown:function(evt){
dojo.debug("_onKeyDown");
if(dojo.render.html.safari||dojo.render.html.chrome||dojo.render.html.ie){
dojo.debug("keydown : key="+evt.key+",keycode="+evt.keyCode);
if(typeof evt.key=="undefined"){
evt.key=evt.keyCode;
}
if(typeof evt.keyCode!="string"){
this._handleKeyEvents(evt);
}
}else{
if(dojo.render.html.opera){
if(typeof evt.key=="undefined"&&evt.keyCode==evt.KEY_ENTER){
evt.key=evt.keyCode;
this._handleKeyEvents(evt);
}
}else{
if(dojo.render.html.moz){
if(evt.keyCode==evt.KEY_UP_ARROW||evt.keyCode==KEY_DOWN_ARROW){
dojo.event.browser.stopEvent(evt);
}
}
}
}
},_handleKeyEvents:function(evt){
dojo.debug("key="+evt.key+",keycode="+evt.keyCode);
if(evt.ctrlKey||evt.altKey||evt.metaKey||!evt.key){
return true;
}
this._prev_key_backspace=false;
this._prev_key_esc=false;
var k=dojo.event.browser.keys;
var _4ee=true;
switch(evt.key){
case k.KEY_DOWN_ARROW:
dojo.debug("KEY_DOWN_ARROW");
if(!this.popupWidget.isShowingNow){
this._startSearchFromInput();
}
this._highlightNextOption();
dojo.event.browser.stopEvent(evt);
return;
case k.KEY_UP_ARROW:
dojo.debug("KEY_UP_ARROW");
this._highlightPrevOption();
dojo.event.browser.stopEvent(evt);
return;
case k.KEY_TAB:
if(this.searchTimer){
clearTimeout(this.searchTimer);
}
window.setTimeout(dojo.lang.hitch(this,"_hideResultList"),1);
return;
case k.KEY_ENTER:
if(this.popupWidget.isShowingNow){
if(this._highlighted_option){
this._selectOption();
this._hideResultList();
dojo.event.browser.stopEvent(evt);
return;
}else{
this._hideResultList();
}
}else{
this.onEnter(evt);
}
case k.KEY_ESCAPE:
this._hideResultList();
this._prev_key_esc=true;
return;
case k.KEY_BACKSPACE:
this._prev_key_backspace=true;
if(!this.textInputNode.value.length){
this.setAllValues("","");
this._hideResultList();
_4ee=false;
}
break;
case k.KEY_RIGHT_ARROW:
case k.KEY_LEFT_ARROW:
_4ee=false;
break;
default:
if(evt.charCode==0){
_4ee=false;
}
}
if(this.searchTimer){
clearTimeout(this.searchTimer);
}
if(_4ee){
this._blurOptionNode();
this.searchTimer=setTimeout(dojo.lang.hitch(this,this._startSearchFromInput),this.searchDelay);
}
},compositionEnd:function(evt){
evt.key=evt.keyCode;
this._handleKeyEvents(evt);
},onKeyUp:function(evt){
dojo.debug("onKeyUp");
this.setValue(this.textInputNode.value);
if(dojo.render.html.moz){
if(evt.keyCode==evt.KEY_UP_ARROW||evt.keyCode==KEY_DOWN_ARROW){
dojo.event.browser.stopEvent(evt);
}
}
},onPaste:function(evt){
dojo.debug("onPaste");
setTimeout(dojo.lang.hitch(this,"_onPaste"),1);
},_onPaste:function(){
this.setValue(this.textInputNode.value);
if(this.searchOnPaste){
this._startSearchFromInput();
}
},_popupMouseDown:function(evt){
this._onPopUp=true;
},_popupMouseUp:function(evt){
this._onPopUp=false;
},setSelectedValue:function(_4f4){
this.comboBoxSelectionValue.value=_4f4;
},setAllValues:function(_4f5,_4f6){
this.setSelectedValue(_4f6);
this.setValue(_4f5);
},_onFocus:function(e){
dojo.debug("ComboBox.onFocus");
if(!this._hasFocus&&(!dojo.render.html.ie||dojo.render.html.ie80)){
this._comboBoxWrapper.style.borderWidth="2px";
this._comboBoxWrapper.style.padding=(this.showButton)?"1px":"2px";
}
this._hasFocus=true;
},_onBlur:function(e){
dojo.debug("ComboBox.onBlur");
if(this._onArrow||this._onPopUp){
dojo.debug("ComboBox._onArrow||_onPopUp");
return;
}
if(this._hasFocus&&(!dojo.render.html.ie||dojo.render.html.ie80)){
this._comboBoxWrapper.style.borderWidth="1px";
this._comboBoxWrapper.style.padding=(this.showButton)?"2px":"3px";
}
window.setTimeout(dojo.lang.hitch(this,"_tryHide"),50);
this._hasFocus=false;
},_tryHide:function(){
if(!this._hasFocus&&!this._onPopUp&&!this._onArrow&&this.popupWidget.isShowingNow){
if(this.searchTimer){
clearTimeout(this.searchTimer);
}
this._hideResultList();
}
},_focusOptionNode:function(node){
if(this._highlighted_option!=node){
this._blurOptionNode();
this._highlighted_option=node;
dojo.html.addClass(this._highlighted_option,"dojoComboBoxItemHighlight");
}
},_blurOptionNode:function(){
if(this._highlighted_option){
dojo.html.removeClass(this._highlighted_option,"dojoComboBoxItemHighlight");
this._highlighted_option=null;
}
},_highlightNextOption:function(){
if((!this._highlighted_option)||!this._highlighted_option.parentNode){
this._focusOptionNode(this.optionsListNode.firstChild);
}else{
if(this._highlighted_option.nextSibling){
this._focusOptionNode(this._highlighted_option.nextSibling);
}
}
dojo.html.scrollIntoView(this._highlighted_option);
},_highlightPrevOption:function(){
if(this._highlighted_option&&this._highlighted_option.previousSibling){
this._focusOptionNode(this._highlighted_option.previousSibling);
}else{
this._blurOptionNode();
this._highlighted_option=null;
return;
}
dojo.html.scrollIntoView(this._highlighted_option);
},_itemMouseOver:function(evt){
if(evt.target===this.optionsListNode){
return;
}
this._focusOptionNode(evt.target);
dojo.html.addClass(this._highlighted_option,"dojoComboBoxItemHighlight");
},_itemMouseOut:function(evt){
if(evt.target===this.optionsListNode){
return;
}
this._blurOptionNode();
},onResize:function(){
var _4fc=dojo.html.getContentBox(this.textInputNode);
if(_4fc.height<=0){
dojo.lang.setTimeout(this,"onResize",100);
return;
}
},buildRendering:function(args,frag){
this.buttonSrc=(this.disabled)?this.buttonSrc_disabled:this.buttonSrc_enabled;
dojo.widget.ComboBox.superclass.buildRendering.call(this,args,frag);
},fillInTemplate:function(args,frag){
if(!this.showButton){
this.downArrowNode.style.display="none";
}else{
dojo.html.addClass(this.domNode,"arrow");
}
var _501=this.getFragNodeRef(frag);
if(!this.name&&_501.name){
this.name=_501.name;
}
this.comboBoxValue.name=this.name;
this.comboBoxSelectionValue.name=this.name+"_selected";
dojo.html.copyStyle(this.textInputNode,_501);
var _502;
if(this.dataProviderClass){
if(typeof this.dataProviderClass=="string"){
_502=dojo.evalObjPath(this.dataProviderClass);
}else{
_502=this.dataProviderClass;
}
}else{
if(this.mode=="remote"){
_502=dojo.widget.incrementalComboBoxDataProvider;
}else{
_502=dojo.widget.basicComboBoxDataProvider;
}
}
this.dataProvider=new _502(this,this.getFragNodeRef(frag));
dojo.debug("ComboBox.fillInTemplate : dataProvider="+this.dataProvider);
this.popupWidget=new dojo.widget.createWidget("PopupContainer",{toggle:this.dropdownToggle,callParentFocus:false,closeOnScroll:false,toggleDuration:this.toggleDuration});
dojo.event.connect(this,"destroy",this.popupWidget,"destroy");
this.optionsListNode=this.popupWidget.domNode;
dojo.html.addClass(this.optionsListNode,"dojoComboBoxOptions");
dojo.event.connect(this.optionsListNode,"onmousedown",this,"_popupMouseDown");
dojo.event.connect(this.optionsListNode,"onmouseup",this,"_popupMouseUp");
dojo.event.connect(this.optionsListNode,"onclick",this,"_selectOption");
dojo.event.connect(this.optionsListNode,"onmouseover",this,"_onMouseOver");
dojo.event.connect(this.optionsListNode,"onmouseout",this,"_onMouseOut");
dojo.event.connect(this.optionsListNode,"onmouseover",this,"_itemMouseOver");
dojo.event.connect(this.optionsListNode,"onmouseout",this,"_itemMouseOut");
},_openResultList:function(_503){
dojo.debug("ComboBox._openResulList : results="+_503.length);
if(this.disabled){
return;
}
this._clearResultList();
if(!_503.length||!this._hasFocus){
this._hideResultList();
return;
}
if((this.autoComplete)&&(_503.length)&&(!this._prev_key_backspace)&&(this.textInputNode.value.length>0)){
var cpos=this._getCaretPos(this.textInputNode);
if((cpos+1)>this.textInputNode.value.length){
this.textInputNode.value+=_503[0][0].substr(cpos);
this._setSelectedRange(this.textInputNode,cpos,this.textInputNode.value.length);
}
}
while(_503.length){
var tr=_503.shift();
if(tr){
var td=document.createElement("div");
td.appendChild(document.createTextNode(tr[0]));
td.setAttribute("resultName",tr[0]);
td.setAttribute("resultValue",dojo.json.serialize(tr[1]));
td.className="dojoComboBoxItem";
this.optionsListNode.appendChild(td);
}
}
this._showResultList();
},_onMouseOver:function(evt){
if(!this._mouseover_list){
this._mouseover_list=true;
}
},_onMouseOut:function(evt){
var _509=evt.relatedTarget;
try{
if(!_509||_509.parentNode!=this.optionsListNode){
this._mouseover_list=false;
this._tryFocus();
}
}
catch(e){
}
},_isInputEqualToResult:function(_50a){
var _50b=this.textInputNode.value;
if(!this.dataProvider.caseSensitive){
_50b=_50b.toLowerCase();
_50a=_50a.toLowerCase();
}
return (_50b==_50a);
},_isValidOption:function(){
var tgt=dojo.html.firstElement(this.optionsListNode);
var _50d=false;
while(!_50d&&tgt){
if(this._isInputEqualToResult(tgt.getAttribute("resultName"))){
_50d=true;
}else{
tgt=dojo.html.nextElement(tgt);
}
}
return _50d;
},_selectOption:function(evt){
var tgt=null;
if(!evt){
evt={target:this._highlighted_option};
}
if(!dojo.html.isDescendantOf(evt.target,this.optionsListNode)){
if(!this.textInputNode.value.length){
return;
}
tgt=dojo.html.firstElement(this.optionsListNode);
if(!tgt||!this._isInputEqualToResult(tgt.getAttribute("resultName"))){
return;
}
}else{
tgt=evt.target;
}
while((tgt.nodeType!=1)||(!tgt.getAttribute("resultName"))){
tgt=tgt.parentNode;
if(tgt===dojo.body()){
return false;
}
}
this.selectedResult=[tgt.getAttribute("resultName"),tgt.getAttribute("resultValue")];
this.setAllValues(tgt.getAttribute("resultName"),tgt.getAttribute("resultValue"));
if(!evt.noHide){
this._hideResultList();
this._setSelectedRange(this.textInputNode,0,null);
}
this.onSelection(circleup.widget.utils.evalJson(tgt.getAttribute("resultValue")));
},_clearResultList:function(){
if(this.optionsListNode.innerHTML){
this.optionsListNode.innerHTML="";
}
},_hideResultList:function(){
dojo.event.topic.unsubscribe("drag.start",this,"_hideResultList");
this.popupWidget.close();
},_showResultList:function(){
dojo.debug("_showResultList : focus = "+this._hasFocus);
if(!this._hasFocus){
this._hideResultList();
return;
}
var _510=this.optionsListNode.childNodes;
if(_510.length){
var _511=Math.min(_510.length,this.maxListLength);
with(this.optionsListNode.style){
display="";
if(_511==_510.length){
height="";
}else{
var _512=dojo.html.getMarginBox(_510[0]).height;
height=_511*_512+"px";
if(_512==0){
window.setTimeout(dojo.lang.hitch(this,"_showResultList"),10);
}
}
width=(dojo.html.getMarginBox(this._comboBoxWrapper).width*this.widthPercent)+"px";
}
dojo.event.topic.subscribe("drag.start",this,"_hideResultList");
var self=this;
pos=this._getCaretPos(this.textInputNode);
this.popupWidget.open(this.domNode,this,this.downArrowNode);
window.setTimeout(function(){
var _514=self._getCaretPos(self.textInputNode);
if(pos>0&&_514==0){
self._tryFocus();
self._setCaretPos(self.textInputNode,pos);
}
},1);
}else{
this._hideResultList();
}
},_onArrowMouseOver:function(evt){
if(this.disabled){
dojo.event.browser.stopEvent(evt);
return;
}
this._isOver=true;
this.downArrowNode.src=this.buttonSrc_hover;
},_onArrowMouseOut:function(evt){
if(this.disabled){
dojo.event.browser.stopEvent(evt);
return;
}
this._isOver=false;
this.downArrowNode.src=this.buttonSrc_enabled;
},_onArrowMouseUp:function(evt){
if(this.disabled){
dojo.event.browser.stopEvent(evt);
return;
}
this.downArrowNode.src=(this._isOver)?this.buttonSrc_hover:this.buttonSrc_enabled;
this._onArrow=false;
this._tryFocus();
},_handleArrowClick:function(evt){
if(this.disabled){
dojo.event.browser.stopEvent(evt);
return;
}
this._onArrow=true;
this._tryFocus();
window.setTimeout(dojo.lang.hitch(this,"handleArrowClick"),1);
},handleArrowClick:function(){
this.downArrowNode.src=this.buttonSrc_pressed;
if(this.popupWidget.isShowingNow){
this._hideResultList();
}else{
this._startSearch("");
}
},_tryFocus:function(){
try{
this.textInputNode.focus();
}
catch(e){
}
},_startSearchFromInput:function(){
this._startSearch(this.textInputNode.value);
},_startSearch:function(key){
dojo.debug("ComboBox._startSearch = "+key);
this.dataProvider.startSearch(key,dojo.lang.hitch(this,"_openResultList"));
},postCreate:function(){
this.onResize();
this.disabled=!this.enabled;
if(this.disabled){
this.disable();
}else{
this.enable();
}
var s=dojo.widget.html.stabile.getState(this.widgetId);
if(s){
this.setState(s);
}
}});
dojo.provide("circleup.widget.ResizableComboBox");
dojo.widget.defineWidget("circleup.widget.ResizableComboBox",[circleup.widget.ResizableTextArea],{popupWidget:null,optionsListNode:null,autoComplete:false,searchType:"stringstart",dataProvider:null,autoComplete:true,searchDelay:100,dataUrl:"",maxListLength:8,selectedResult:null,toggleDuration:0,dropdownToggle:"plain",delimeters:/[,;\n]/,disabled:false,_currentCaretPos:-1,_startCaretPos:-1,_dirty:false,_key:null,_showingResults:false,fillInTemplate:function(args,frag){
this.dataProvider=new dojo.widget.incrementalComboBoxDataProvider(this,this.getFragNodeRef(frag));
this.popupWidget=new dojo.widget.createWidget("PopupContainer",{toggle:this.dropdownToggle,toggleDuration:this.toggleDuration,closeOnScroll:false,callParentFocus:false});
dojo.event.connect(this,"destroy",this.popupWidget,"destroy");
this.optionsListNode=this.popupWidget.domNode;
this.domNode.appendChild(this.optionsListNode);
dojo.html.addClass(this.optionsListNode,"dojoComboBoxOptions");
dojo.event.connect(this.optionsListNode,"onclick",this,"_onClick");
dojo.event.connect(this.optionsListNode,"onmouseover",this,"_onMouseOver");
dojo.event.connect(this.optionsListNode,"onmouseout",this,"_onMouseOut");
dojo.event.connect(this.optionsListNode,"onmouseover",this,"_itemMouseOver");
dojo.event.connect(this.optionsListNode,"onmouseout",this,"_itemMouseOut");
circleup.widget.ResizableComboBox.superclass.fillInTemplate.call(this,args,frag);
},postCreate:function(){
circleup.widget.ResizableComboBox.superclass.postCreate.call(this,arguments);
if(this.richText){
this._richText.onKeyDown=this.onKeyDown;
}
},isDropDownShowing:function(){
return this.popupWidget.isShowingNow;
},onKeyPress:function(evt){
if(dojo.render.html.safari||dojo.render.html.chrome){
setTimeout(dojo.lang.hitch(this,"_handleKeyEvents",evt),1);
}else{
if(dojo.render.html.ie){
var _51e=document.createEventObject(evt);
_51e=dojo.event.browser.fixEvent(_51e);
setTimeout(dojo.lang.hitch(this,"_handleKeyEvents",_51e),1);
}else{
if(dojo.render.html.moz){
if(evt.keyCode!=evt.KEY_UP_ARROW&&evt.keyCode!=evt.KEY_DOWN_ARROW){
setTimeout(dojo.lang.hitch(this,"_handleKeyEvents",evt),1);
}
}else{
if(!dojo.render.html.opera||evt.key!=evt.KEY_ENTER){
if(typeof evt.key=="string"||evt.key==evt.KEY_BACKSPACE){
setTimeout(dojo.lang.hitch(this,"_handleKeyEvents",evt),1);
}else{
this._handleKeyEvents(evt);
}
}
}
}
}
},onKeyDown:function(evt){
dojo.debug("ResizableComboBox.onKeyDown, evt.key="+evt.key);
if(dojo.render.html.safari||dojo.render.html.chrome){
if(typeof evt.key=="undefined"&&typeof evt.keyCode!="string"){
evt.key=evt.keyCode;
this._handleKeyEvents(evt);
}
this._richText._onKeyDown(evt);
}else{
if(dojo.render.html.ie){
if(typeof evt.key=="undefined"&&typeof evt.keyCode!="string"){
evt.key=evt.keyCode;
}
this._handleKeyEvents(evt);
if(!evt.cancelBubble||evt.returnValue){
this._richText._onKeyDown(evt);
}else{
}
}else{
if(dojo.render.html.opera){
if(typeof evt.key=="undefined"&&typeof evt.keyCode!="string"){
evt.key=evt.keyCode;
}
if(evt.keyCode==evt.KEY_ENTER){
this._handleKeyEvents(evt);
}
if(!evt.cancelBubble){
dojo.debug("ResizableComboBox.onKeyDown : calling richText...");
this._richText._onKeyDown(evt);
}else{
dojo.debug("ResizableComboBox.onKeyDown : cancelling, evt.cancelBubble="+evt.cancelBubble+", evt.returnValue="+evt.returnValue);
}
}else{
if(dojo.render.html.moz){
if(evt.keyCode==evt.KEY_UP_ARROW||evt.keyCode==evt.KEY_DOWN_ARROW){
evt.key=evt.keyCode;
this._handleKeyEvents(evt);
}
if(!evt.cancelBubble){
dojo.debug("ResizableComboBox.onKeyDown : calling richText...");
this._richText._onKeyDown(evt);
}else{
dojo.debug("ResizableComboBox.onKeyDown : cancelling, evt.cancelBubble="+evt.cancelBubble+", evt.returnValue="+evt.returnValue);
}
}else{
this._richText._onKeyDown(evt);
}
}
}
}
},onResizeStart:function(){
this._hideResultList();
circleup.widget.ResizableComboBox.superclass.onResizeStart.call(this,arguments);
},onKeyUp:function(evt){
},onMouseDown:function(evt){
this._dirty=true;
},compositionEnd:function(evt){
evt.key=evt.keyCode;
},_handleKeyEvents:function(evt){
if(typeof evt.key=="undefined"){
return;
}
if(evt.ctrlKey||evt.altKey||evt.metaKey||!evt.key){
return true;
}
this._prev_key_backspace=false;
this._prev_key_esc=false;
var k=dojo.event.browser.keys;
var _525=false;
switch(evt.key){
case k.KEY_DOWN_ARROW:
if(this.popupWidget.isShowingNow){
this._highlightNextOption();
dojo.event.browser.stopEvent(evt);
}
return;
break;
case k.KEY_UP_ARROW:
if(this.popupWidget.isShowingNow){
this._highlightPrevOption();
dojo.event.browser.stopEvent(evt);
}
return;
break;
case k.KEY_TAB:
dojo.debug("ResizableComboBox._handleKeyEvents KEY_TAB");
window.setTimeout(dojo.lang.hitch(this,"_hideResultList"),1);
break;
case k.KEY_ENTER:
dojo.debug("ResizableComboBox._handleKeyEvents KEY_ENTER, isShowingNow="+this.popupWidget.isShowingNow+", _highlighted_option ="+this._highlighted_option);
this._dirty=true;
if(this.popupWidget.isShowingNow){
if(this._highlighted_option){
this.selectOption();
dojo.debug("ResizableComboxBox._handleKeyEvents.KEY_ENTER : _hideResultList, stopping...");
this._hideResultList();
dojo.event.browser.stopEvent(evt);
return;
}else{
dojo.debug("ResizableComboxBox._handleKeyEvents.KEY_ENTER : _hideResultList");
this._hideResultList();
}
}
return;
case " ":
dojo.debug("ResizableComboBox._handleKeyEvents ' '");
if(this.popupWidget.isShowingNow&&this._highlighted_option){
dojo.event.browser.stopEvent(evt);
this.selectOption();
dojo.debug("ResizableComboxBox._handleKeyEvents.' ' : _hideResultList");
this._hideResultList();
return;
}
_525=true;
break;
case k.KEY_ESCAPE:
this._hideResultList();
this._prev_key_esc=true;
return;
case k.KEY_RIGHT_ARROW:
case k.KEY_LEFT_ARROW:
_525=false;
this._dirty=true;
break;
case k.KEY_BACKSPACE:
this._prev_key_backspace=true;
this._dirty=true;
default:
if(evt.type=="keyup"||evt.type=="keypress"){
_525=this._handleKeyPress(evt);
}else{
if(evt.type=="keydown"&&evt.key==k.KEY_BACKSPACE){
_525=this._handleKeyPress(evt);
}else{
_525=false;
}
}
}
if(this.searchTimer){
clearTimeout(this.searchTimer);
}
if(_525&&this._startCaretPos>-1){
this._blurOptionNode();
this.searchTimer=setTimeout(dojo.lang.hitch(this,this._startSearchFromInput,this._startCaretPos),this.searchDelay);
}
return;
},_handleKeyPress:function(evt){
var _527=false;
if(evt.key!=dojo.event.browser.keys.KEY_BACKSPACE&&typeof evt.key=="string"&&this._isDelimeter(evt.key)){
var pos=this.getCaretPos();
this._startCaretPos=pos;
this._dirty=false;
_527=false;
this._hideResultList();
}else{
if(this._startCaretPos==-1||this._dirty){
_527=true;
this._dirty=false;
var pos=this._getStartCaretPos();
if(this._startCaretPos!=pos){
this._startCaretPos=pos;
this._closeResultList();
}
}else{
_527=true;
}
}
return _527;
},_startSearchFromInput:function(pos){
if(this._startCaretPos>-1){
var _52a=this.getText();
_52a=_52a.substring(pos);
var _52b=_52a.regexIndexOf(this.delimeters);
_52a=(_52b==-1)?_52a:_52a.substring(0,_52b);
this._startSearch(dojo.string.trim(_52a),pos);
}
},_startSearch:function(_52c,pos){
if(_52c!=""){
this.dataProvider.startSearch(_52c,dojo.lang.hitch(this,"_openResultList",_52c,pos));
}else{
this._hideResultList();
}
},_isDelimeter:function(_52e){
return (_52e.regexIndexOf(this.delimeters)>-1);
},_getStartCaretPos:function(){
var pos=this.getCaretPos();
var text=this.getText();
var _531=text.substring(0,pos);
var _532=_531.regexLastIndexOf(this.delimeters);
pos=(_532==-1)?0:_532;
return pos;
},_focusOptionNode:function(node){
if(this._highlighted_option!=node){
this._blurOptionNode();
this._highlighted_option=node;
dojo.html.addClass(this._highlighted_option,"dojoComboBoxItemHighlight");
}
},_blurOptionNode:function(){
if(this._highlighted_option){
dojo.html.removeClass(this._highlighted_option,"dojoComboBoxItemHighlight");
this._highlighted_option=null;
}
},_highlightNextOption:function(){
if((!this._highlighted_option)||!this._highlighted_option.parentNode){
this._focusOptionNode(this.optionsListNode.firstChild);
}else{
if(this._highlighted_option.nextSibling){
this._focusOptionNode(this._highlighted_option.nextSibling);
}
}
dojo.html.scrollIntoView(this._highlighted_option);
},_highlightPrevOption:function(){
if(this._highlighted_option&&this._highlighted_option.previousSibling){
this._focusOptionNode(this._highlighted_option.previousSibling);
}else{
this._blurOptionNode();
this._highlighted_option=null;
return;
}
dojo.html.scrollIntoView(this._highlighted_option);
},_itemMouseOver:function(evt){
if(evt.target===this.optionsListNode){
return;
}
this._focusOptionNode(evt.target);
dojo.html.addClass(this._highlighted_option,"dojoComboBoxItemHighlight");
},_itemMouseOut:function(evt){
if(evt.target===this.optionsListNode){
return;
}
this._blurOptionNode();
},_onClick:function(evt){
dojo.debug("ResizableComboxBox._onClick : enter");
this.focus();
window.setTimeout(dojo.lang.hitch(this,"selectOption"),50);
dojo.event.browser.stopEvent(evt);
},selectOption:function(){
this._selectOption();
this.onSelection();
},onSelection:function(){
},_selectOption:function(evt){
this._showingResults=true;
var tgt=null;
if(!evt){
evt={target:this._highlighted_option};
}
if(!dojo.html.isDescendantOf(evt.target,this.optionsListNode)){
val=this.getText();
if(!text.value.length){
return;
}
tgt=dojo.html.firstElement(this.optionsListNode);
if(!tgt||!this._isInputEqualToResult(tgt.getAttribute("resultName"))){
return;
}
}else{
tgt=evt.target;
}
while((tgt.nodeType!=1)||(!tgt.getAttribute("resultName"))){
tgt=tgt.parentNode;
if(tgt===dojo.body()){
return false;
}
}
this.selectedResult=[tgt.getAttribute("resultName"),tgt.getAttribute("resultValue")];
var pos=parseInt(tgt.getAttribute("pos"));
var text=this.getText();
var _53b=text.substring(pos);
var _53c=_53b.regexIndexOf(this.delimeters);
_53c=(_53c==-1)?text.length:pos+_53c;
this.pasteAtRange(pos,_53c,tgt.getAttribute("resultName"),true);
this._showingResults=false;
if(!evt.noHide){
this._hideResultList();
}
},_clearResultList:function(){
if(this.optionsListNode.innerHTML){
this.optionsListNode.innerHTML="";
}
},_hideResultList:function(){
dojo.event.topic.unsubscribe("drag.start",this,"_hideResultList");
setTimeout(dojo.lang.hitch(this,this._closeResultList),10);
},_closeResultList:function(){
this.popupWidget.close();
},_showResultList:function(){
this._showingResults=true;
var _53d=this.optionsListNode.childNodes;
if(_53d.length){
var _53e=Math.min(_53d.length,this.maxListLength);
with(this.optionsListNode.style){
display="";
if(_53e==_53d.length){
height="";
}else{
height=_53e*dojo.html.getBorderBox(_53d[0]).height+"px";
}
width=(dojo.html.getBorderBox(this.domNode).width*0.75)+"px";
}
dojo.event.topic.subscribe("drag.start",this,"_hideResultList");
if(dojo.render.html.moz){
var _53f=this.isDropDownShowing();
var pos=(!_53f)?this.getCaretPos():-1;
this.popupWidget.open(this._wrapper,this);
if(!_53f){
window.focus();
this.focus();
this.setCaretPos(pos);
}
this._showingResults=false;
}else{
if(dojo.render.html.safari||dojo.render.html.chrome){
var self=this;
var _53f=this.isDropDownShowing();
window.setTimeout(function(){
var pos=(!_53f)?self.getCaretPos():-1;
dojo.debug("ResizableComboBox._showResultList : pos1 = "+pos);
self.popupWidget.open(self._wrapper,self);
window.setTimeout(function(){
if(!_53f){
self.setCaretPos(pos);
}
dojo.debug("ResizableComboBox._showResultList : pos2 = "+pos);
self._showingResults=false;
},1);
},1);
}else{
this.popupWidget.open(this._wrapper,this);
this._showingResults=false;
}
}
}else{
this._closeResultList();
this._showingResults=false;
}
},_openResultList:function(_543,pos,_545){
if(this.disabled||!this._hasFocus){
return;
}
this._clearResultList();
if(!_545.length){
this._hideResultList();
}
val=this.getText();
if((this.autoComplete)&&(_545.length)&&(!this._prev_key_backspace)&&(val.length>0)){
var cpos=val.length;
if((cpos+1)>val.length){
this.setValue(val+_545[0][0].substr(cpos));
}
}
var even=true;
while(_545.length){
var tr=_545.shift();
if(tr){
var td=document.createElement("div");
var _54a="("+_543+")";
var _54b=new RegExp(_54a,"i");
var html=tr[0].replace(_54b,"<b>$1</b>");
td.innerHTML=html;
td.setAttribute("resultName",tr[0]);
td.setAttribute("resultValue",tr[1]);
td.setAttribute("pos",pos);
td.className="dojoComboBoxItem "+((even)?"dojoComboBoxItemEven":"dojoComboBoxItemOdd");
even=(!even);
this.optionsListNode.appendChild(td);
}
}
this._showResultList();
}});
dojo.provide("dojo.widget.InlineEditBox");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.gfx.color");
dojo.require("dojo.string");
dojo.require("dojo.html.layout");
dojo.widget.defineWidget("dojo.widget.InlineEditBox",dojo.widget.HtmlWidget,function(){
this.history=[];
},{templateString:"<form class=\"inlineEditBox\" style=\"display: none\" dojoAttachPoint=\"form\" dojoAttachEvent=\"onSubmit:saveEdit; onReset:cancelEdit; onKeyUp: checkForValueChange;\">\n\t<input type=\"text\" dojoAttachPoint=\"text\" style=\"display: none;\" />\n\t<textarea dojoAttachPoint=\"textarea\" style=\"display: none;\"></textarea>\n\t<input type=\"submit\" value=\"Save\" dojoAttachPoint=\"submitButton\" />\n\t<input type=\"reset\" value=\"Cancel\" dojoAttachPoint=\"cancelButton\" />\n</form>\n",templateCssString:".editLabel {\n\tfont-size : small;\n\tpadding : 0 5px;\n\tdisplay : none;\n}\n\n.editableRegionDisabled {\n\tcursor : pointer;\n\t_cursor : hand;\n}\n\n.editableRegion {\n\tbackground-color : #ffc !important;\n\tcursor : pointer;\n\t_cursor : hand;\n}\n\n.editableRegion .editLabel {\n\tdisplay : inline;\n}\n\n.editableTextareaRegion .editLabel {\n\tdisplay : block;\n}\n\n.inlineEditBox {\n\t/*background-color : #ffc;*/\n\tdisplay : inline;\n}\n",templateCssString:".editLabel {\n\tfont-size : small;\n\tpadding : 0 5px;\n\tdisplay : none;\n}\n\n.editableRegionDisabled {\n\tcursor : pointer;\n\t_cursor : hand;\n}\n\n.editableRegion {\n\tbackground-color : #ffc !important;\n\tcursor : pointer;\n\t_cursor : hand;\n}\n\n.editableRegion .editLabel {\n\tdisplay : inline;\n}\n\n.editableTextareaRegion .editLabel {\n\tdisplay : block;\n}\n\n.inlineEditBox {\n\t/*background-color : #ffc;*/\n\tdisplay : inline;\n}\n",templateCssPath:dojo.uri.moduleUri("dojo.widget","templates/InlineEditBox.css"),mode:"text",name:"",minWidth:100,minHeight:200,editing:false,value:"",textValue:"",defaultText:"",postMixInProperties:function(){
if(this.textValue){
dojo.deprecated("InlineEditBox: Use value parameter instead of textValue; will be removed in 0.5");
this.value=this.textValue;
}
if(this.defaultText){
dojo.deprecated("InlineEditBox: Use value parameter instead of defaultText; will be removed in 0.5");
this.value=this.defaultText;
}
},postCreate:function(args,frag){
this.editable=this.getFragNodeRef(frag);
dojo.html.insertAfter(this.editable,this.form);
dojo.event.connect(this.editable,"onmouseover",this,"onMouseOver");
dojo.event.connect(this.editable,"onmouseout",this,"onMouseOut");
dojo.event.connect(this.editable,"onclick",this,"_beginEdit");
if(this.value){
this.editable.innerHTML=this.value;
return;
}else{
this.value=dojo.string.trim(this.editable.innerHTML);
this.editable.innerHTML=this.value;
}
},onMouseOver:function(){
if(!this.editing){
if(this.disabled){
dojo.html.addClass(this.editable,"editableRegionDisabled");
}else{
dojo.html.addClass(this.editable,"editableRegion");
if(this.mode=="textarea"){
dojo.html.addClass(this.editable,"editableTextareaRegion");
}
}
}
},onMouseOut:function(){
if(!this.editing){
dojo.html.removeClass(this.editable,"editableRegion");
dojo.html.removeClass(this.editable,"editableTextareaRegion");
dojo.html.removeClass(this.editable,"editableRegionDisabled");
}
},_beginEdit:function(e,val){
if(this.editing||this.disabled){
return;
}
this.onMouseOut();
this.editing=true;
var ee=this[this.mode.toLowerCase()];
ee.style.fontSize=dojo.html.getStyle(this.editable,"font-size");
ee.style.fontWeight=dojo.html.getStyle(this.editable,"font-weight");
ee.style.fontStyle=dojo.html.getStyle(this.editable,"font-style");
var bb=dojo.html.getBorderBox(this.editable);
ee.style.width=Math.max(bb.width,this.minWidth)+"px";
if(this.mode.toLowerCase()=="textarea"){
ee.style.display="block";
ee.style.height=Math.max(bb.height,this.minHeight)+"px";
}else{
ee.style.display="";
}
this.form.style.display="";
ee.focus();
val=(typeof val=="undefined"||val==null)?this.value:val;
ee.value=dojo.string.trim(val);
this.submitButton.disabled=true;
},saveEdit:function(e){
e.preventDefault();
e.stopPropagation();
var ee=this[this.mode.toLowerCase()];
if((this.value!=ee.value)&&(dojo.string.trim(ee.value)!="")){
this.doFade=true;
this.history.push(this.value);
this.onSave(ee.value,this.value,this.name);
this.value=ee.value;
this.editable.innerHTML="";
var _555=document.createTextNode(this.value);
this.editable.appendChild(_555);
}else{
this.doFade=false;
}
this._finishEdit(e);
},_stopEditing:function(){
this.editing=false;
this.form.style.display="none";
this.editable.style.display="";
return true;
},cancelEdit:function(e){
this._stopEditing();
this.onCancel();
return true;
},_finishEdit:function(e){
this._stopEditing();
if(this.doFade){
dojo.lfx.highlight(this.editable,dojo.gfx.color.hex2rgb("#ffc"),700).play(300);
}
this.doFade=false;
},setText:function(txt){
dojo.deprecated("setText() is deprecated, call setValue() instead, will be removed in 0.5");
this.setValue(txt);
},setValue:function(txt){
txt=""+txt;
var tt=dojo.string.trim(txt);
this.value=tt;
this.editable.innerHTML=tt;
},undo:function(){
if(this.history.length>0){
var _55b=this.value;
var _55c=this.history.pop();
this.editable.innerHTML=_55c;
this.value=_55c;
this.onUndo(_55c);
this.onSave(_55c,_55b,this.name);
}
},onChange:function(_55d,_55e){
},onSave:function(_55f,_560,name){
},onCancel:function(){
},checkForValueChange:function(){
var ee=this[this.mode.toLowerCase()];
if((this.value!=ee.value)&&(dojo.string.trim(ee.value)!="")){
this.submitButton.disabled=false;
}
this.onChange(this.value,ee.value);
},disable:function(){
this.submitButton.disabled=true;
this.cancelButton.disabled=true;
var ee=this[this.mode.toLowerCase()];
ee.disabled=true;
dojo.widget.InlineEditBox.superclass.disable.apply(this,arguments);
},enable:function(){
this.checkForValueChange();
this.cancelButton.disabled=false;
var ee=this[this.mode.toLowerCase()];
ee.disabled=false;
dojo.widget.InlineEditBox.superclass.enable.apply(this,arguments);
}});
dojo.provide("circleup.widget.EditableCell");
dojo.widget.defineWidget("circleup.widget.EditableCell",dojo.widget.InlineEditBox,{templateString:"<div id=\"${this.widgetId}\"\n     class=\"EditableCell\">\n\t<input type=\"text\" \n\t       class=\"tabStop\" \n\t       dojoAttachPoint=\"_tabStop\"\n\t       dojoAttachEvent=\"onFocus:onTabFocus;onBlur:onTabBlur;onKeyDown:onKeyDown;onKeyPress:onKeyPress;onKeyUp:onKeyUp;\"/>\n\t<form class=\"inlineEditBox\" \n\t      style=\"display: none\" \n\t      dojoAttachPoint=\"form\" \n\t      dojoAttachEvent=\"onSubmit:onSaveFocus; onReset:cancelEdit; onKeyUp: checkForValueChange;\">\n\t\t<input type=\"text\" \n\t       dojoAttachPoint=\"text\" \n\t       dojoAttachEvent=\"onBlur:onSaveBlur;onPaste:onPaste;onKeyDown:onInputKeyDown;\"\n\t       style=\"display: none;\" />\n\t\t<textarea dojoAttachPoint=\"textarea\" style=\"display: none;\"></textarea>\n\t\t<input type=\"submit\" value=\"Save\" dojoAttachPoint=\"submitButton\" style=\"display:none;\" />\n\t\t<input type=\"reset\" value=\"Cancel\" dojoAttachPoint=\"cancelButton\" style=\"display:none;\" />\n\t</form>\n    <span dojoAttachPoint=\"editable\"\n          dojoAttachEvent=\"onMouseOver:onMouseOver;onMouseOut:onMouseOut;onDblClick:onDblClick;onMouseDown:onMouseDown;\">${this.value}</span>\n\n</div>\n",row:0,col:0,minWidth:0,td:null,_tabStop:null,hasFocus:false,editableText:null,isSelected:false,postCreate:function(){
},saveEdit:function(e){
circleup.widget.EditableCell.superclass.saveEdit.call(this,e);
this.onSave(e);
},select:function(){
this.isSelected=true;
dojo.html.addClass(this.domNode,"editableRegionSelected");
},unselect:function(){
this.isSelected=true;
dojo.html.removeClass(this.domNode,"editableRegionSelected");
},onTabBlur:function(e){
this.hasFocus=false;
},onTabFocus:function(e){
this.hasFocus=true;
},onMouseDown:function(e){
},onMouseOver:function(){
if(!this.editing){
if(this.disabled){
dojo.html.addClass(this.domNode,"editableRegionDisabled");
}else{
dojo.html.addClass(this.domNode,"editableRegion");
if(this.mode=="textarea"){
dojo.html.addClass(this.domNode,"editableTextareaRegion");
}
}
}
},onMouseOut:function(){
if(!this.editing){
dojo.html.removeClass(this.domNode,"editableRegion");
dojo.html.removeClass(this.domNode,"editableTextareaRegion");
dojo.html.removeClass(this.domNode,"editableRegionDisabled");
}
},_beginEdit:function(e,val){
if(this.editing||this.disabled){
return;
}
this.onMouseOut();
this.editing=true;
dojo.html.addClass(this.td,"editableRegionEditing");
var ee=this[this.mode.toLowerCase()];
ee.style.fontSize=dojo.html.getStyle(this.editable,"font-size");
ee.style.fontWeight=dojo.html.getStyle(this.editable,"font-weight");
ee.style.fontStyle=dojo.html.getStyle(this.editable,"font-style");
var bb=dojo.html.getBorderBox(this.domNode);
ee.style.width=Math.max(bb.width,this.minWidth)+"px";
if(this.mode.toLowerCase()=="textarea"){
ee.style.display="block";
ee.style.height=Math.max(bb.height,this.minHeight)+"px";
}else{
ee.style.display="";
}
this.form.style.display="";
ee.focus();
this.hasFocus=false;
val=(typeof val=="undefined"||val==null)?this.value:val;
ee.value=dojo.string.trim(val);
this.submitButton.disabled=true;
},onSaveFocus:function(e){
},onSaveBlur:function(e){
},onKeyDown:function(e){
},onKeyUp:function(e){
},onKeyPress:function(e){
dojo.debug("EditableCell.onKeyPress : enter, id = "+this.widgetId);
if(e.keyCode!=e.KEY_TAB&&e.keyCode!=e.KEY_LEFT_ARROW&&e.keyCode!=e.KEY_RIGHT_ARROW&&e.keyCode!=e.KEY_UP_ARROW&&e.keyCode!=e.KEY_DOWN_ARROW){
if(e.keyCode==e.KEY_ENTER){
this._beginEdit(e);
}else{
var self=this;
var ex=e;
window.setTimeout(function(){
self._beginEdit(ex,self._tabStop.value);
self._tabStop.value="";
},1);
}
}
},onInputKeyDown:function(e){
dojo.debug("EditableCell.onInputKeyDown : enter, id = "+this.widgetId);
if(e.keyCode==e.KEY_ESCAPE){
var self=this;
window.setTimeout(function(){
self[self.mode.toLowerCase()].value=self.value;
self.cancelEdit(e);
},1);
}
},focus:function(){
try{
this._tabStop.focus();
}
catch(e){
alert(e);
}
},onPaste:function(e){
alert(this.text.value);
},onCancel:function(){
},onSave:function(e){
},_finishEdit:function(e){
this._stopEditing();
this.doFade=false;
dojo.html.removeClass(this.td,"editableRegionEditing");
},onDblClick:function(e){
this.onMouseDown(e);
window.setTimeout(dojo.lang.hitch(this,"_beginEdit",e,null),50);
dojo.event.browser.stopEvent(e);
}});
dojo.provide("circleup.widget.EditableGrid");
dojo.widget.defineWidget("circleup.widget.EditableGrid",dojo.widget.HtmlWidget,{isContainer:true,headers:[],rows:[],cssClass:"EditableGrid",cssStyle:"",_table:null,_active:null,_ignoreFocus:false,templateString:"<div dojoattachpoint=\"containerNode\"\n     id=\"${this.widgetId}\"\n     class=\"${this.cssClass}\"\n     style=\"${this.cssStyle}\">\n     <input type=\"text\" \n            class=\"tabStop\"\n            dojoAttachEvent=\"onFocus:_onTableOut\"></input>\n     <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody dojoattachpoint=\"_table\"></tbody></table>\n     <input type=\"text\" \n            class=\"tabStop\"\n            dojoAttachEvent=\"onFocus:_onTableOut\"></input>\n</div>\n",postCreate:function(){
var _57a=this._table.insertRow(-1);
var self=this;
dojo.lang.forEach(this.headers,function(_57c){
var th=document.createElement("th");
th.innerHTML=_57c;
_57a.appendChild(th);
});
var _57e=0;
dojo.lang.forEach(this.rows,function(row){
var _580=self._table.insertRow(-1);
if(_57e==0){
dojo.html.addClass(_580,"first");
}
if(_57e==self.rows.length-1){
dojo.html.addClass(_580,"last");
}
if(_57e%2==0){
dojo.html.addClass(_580,"odd");
}else{
dojo.html.addClass(_580,"even");
}
var _581=0;
dojo.lang.forEach(row,function(cell){
var td=document.createElement("td");
if(_581==0){
dojo.html.addClass(td,"first");
}
if(_581==row.length-1){
dojo.html.addClass(td,"last");
}
if(_581%2==0){
dojo.html.addClass(td,"odd");
}else{
dojo.html.addClass(td,"even");
}
var _584=td.firstChild;
self.containerNode=td;
var id=self.widgetId+"_cell."+_57e+"."+_581;
var _586=dojo.widget.createWidget("circleup:EditableCell",{id:id,widgetId:id,td:td,value:cell,row:_57e,col:_581});
self.addChild(_586);
_580.appendChild(self.containerNode);
dojo.event.connect(_586,"onTabFocus",dojo.lang.hitch(self,"_onTabFocus",_586));
dojo.event.connect(_586,"onKeyDown",dojo.lang.hitch(self,"_onKeyDown",_586));
dojo.event.connect(_586,"onMouseDown",dojo.lang.hitch(self,"_onCellSelected",_586));
dojo.event.connect(_586,"onCancel",dojo.lang.hitch(self,"_onCellCanceled",_586));
dojo.event.connect(_586,"onSaveFocus",dojo.lang.hitch(self,"_onCellSaveFocus",_586));
dojo.event.connect(_586,"onSaveBlur",dojo.lang.hitch(self,"_onCellSaveBlur",_586));
_581++;
});
_57e++;
});
},_setActive:function(_587,e){
dojo.debug("EditableGrid._setActive : enter, current = "+((this._active==null)?"null":this._active.widgetId)+", active="+((_587==null)?"null":_587.widgetId));
if(this._active!=null&&this._active!=_587){
this._active.saveEdit(e);
this._active.unselect();
}
if(_587!=null){
_587.select();
if(!_587.hasFocus){
this._ignoreFocus=true;
window.setTimeout(function(){
_587.focus();
},1);
}
}
this._active=_587;
},_moveLeft:function(_589,e){
var row=_589.row;
var cell=_589.col;
if(cell>0){
cell--;
}else{
if(row>0){
row--;
}else{
return;
}
cell=this.headers.length-1;
}
_589=dojo.widget.byId(this.widgetId+"_cell."+row+"."+cell);
this._setActive(_589,e);
},_moveRight:function(_58d,e){
var row=_58d.row;
var cell=_58d.col;
if(cell<this.headers.length-1){
cell++;
}else{
if(row<this.rows.length-1){
row++;
}else{
return;
}
cell=0;
}
_58d=dojo.widget.byId(this.widgetId+"_cell."+row+"."+cell);
this._setActive(_58d,e);
},_moveUp:function(_591,e){
var row=_591.row;
var cell=_591.col;
if(row>0){
row--;
}else{
return;
}
_591=dojo.widget.byId(this.widgetId+"_cell."+row+"."+cell);
this._setActive(_591,e);
},_moveDown:function(_595,e){
var row=_595.row;
var cell=_595.col;
if(row<this.rows.length-1){
row++;
}else{
return;
}
_595=dojo.widget.byId(this.widgetId+"_cell."+row+"."+cell);
this._setActive(_595,e);
},_onKeyDown:function(_599,e){
dojo.debug("EditableGrid._onKeyDown : enter, id = "+_599.widgetId+", keyCode="+e.keyCode);
if(e.keyCode==e.KEY_LEFT_ARROW){
this._moveLeft(_599,e);
}else{
if(e.keyCode==e.KEY_RIGHT_ARROW){
this._moveRight(_599,e);
}else{
if(e.keyCode==e.KEY_UP_ARROW){
this._moveUp(_599,e);
}else{
if(e.keyCode==e.KEY_DOWN_ARROW){
this._moveDown(_599,e);
}
}
}
}
},_onTabFocus:function(_59b,e){
dojo.debug("EditableGrid._onTabFocus : enter, id = "+_59b.widgetId+", _ignoreFocus="+this._ignoreFocus);
if(this._ignoreFocus){
this._ignoreFocus=false;
return;
}
if(this._active!=null&&this._active==_59b){
dojo.debug("EditableGrid._onTabFocus : back tab");
this._moveLeft(_59b,e);
}else{
this._setActive(_59b,e);
}
},_onTableOut:function(e){
this._setActive(null,e);
},_onCellSelected:function(_59e,e){
this._setActive(_59e,e);
},_onCellCanceled:function(_5a0,e){
dojo.debug("EditableGrid._onCellCanceled : enter, id = "+_5a0.widgetId);
this._setActive(_5a0,e);
},_onCellSaveFocus:function(_5a2,e){
dojo.debug("EditableGrid._onCellSaveFocus : enter, id = "+_5a2.widgetId);
_5a2.saveEdit(e);
this._setActive(_5a2,e);
},_onCellSaveBlur:function(_5a4,e){
dojo.debug("EditableGrid._onCellSaveBlur : enter, id = "+_5a4.widgetId);
_5a4.saveEdit(e);
}});
dojo.provide("circleup.widget.Minimizer");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.lfx.*");
dojo.widget.defineWidget("circleup.widget.Minimizer",dojo.widget.HtmlWidget,{isContainer:false,widgetsInTemplate:false,isExpanded:true,elementId:"",minimizeLabel:"minimize",maximizeLabel:"maximize",minimizeDuration:250,cssStyle:"",_minimizeButton:null,_maximizeButton:null,_element:null,_inProgress:false,templateString:"<a dojoonclick=\"_expand\"\n   id=\"${this.widgetId}_maximizer\"\n   style=\"${this.cssStyle}\" \n   href=\"#\"\n   dojoattachpoint=\"_maximizeButton\">${this.maximizeLabel}</a>\n",postCreate:function(){
this._element=dojo.byId(this.elementId);
if(this._element==null){
dojo.debug("element "+this.elementId+" not found, failing silently...");
return;
}
var span=document.createElement("span");
span.id=this.elementId+"_minimizer";
this._element.appendChild(span);
span.innerHTML="<a href='#'>"+this.minimizeLabel+"</a>";
this._minimizeButton=span.firstChild;
dojo.event.connect(this._minimizeButton,"onclick",this,"_close");
if(!this.isExpanded){
dojo.debug("hiding "+this.elementId);
dojo.html.hide(this._element);
}else{
dojo.debug("not hiding "+this.elementId);
}
this._setMaximizeVisibility();
},close:function(){
if(!this.inProgress&&this.isExpanded){
this.inProgress=true;
dojo.lfx.wipeOut(this._element,this.minimizeDuration,null,dojo.lang.hitch(this,"_onClose")).play();
}
},_close:function(e){
this.close();
dojo.event.browser.stopEvent(e);
},expand:function(){
if(!this.inProgress&&!this.isExpanded){
this.inProgress=true;
dojo.lfx.wipeIn(this._element,this.minimizeDuration,null,dojo.lang.hitch(this,"_onExpand")).play();
}
},_expand:function(e){
this.expand();
dojo.event.browser.stopEvent(e);
},onClose:function(){
},onExpand:function(){
},_onClose:function(){
this.inProgress=false;
this.isExpanded=false;
this._setMaximizeVisibility();
this.onClose();
},_onExpand:function(){
this.inProgress=false;
this.isExpanded=true;
if(this.scrollIntoView){
var ele=this._element;
window.setTimeout(function(){
dojo.html.scrollIntoView(ele);
},100);
}
this._setMaximizeVisibility();
this.onExpand();
},toggleExpand:function(){
if(djConfig.onAnalyticsEvent){
var _5aa=(this.isExpanded)?"Collapse":"Expand";
djConfig.onAnalyticsEvent("EVENT",{"category":"Minimizer","action":_5aa,"opt_label":this.widgetId});
}
if(this.isExpanded){
this.close();
}else{
this.expand();
}
},_setMaximizeVisibility:function(){
if(this.isExpanded){
this._maximizeButton.style.display="none";
}else{
this._maximizeButton.style.display="";
}
}});
dojo.kwCompoundRequire({common:["circleup.widget.Utils","circleup.widget.ScalableImage","circleup.widget.AttachmentPopup","circleup.widget.UserPopup","circleup.widget.DropdownContainer","circleup.widget.PopupManager","circleup.widget.DialogManager","circleup.widget.Movable","circleup.widget.MovableDialog","circleup.widget.Dialog","circleup.widget.AjaxDialog","circleup.widget.AssetPopup","circleup.widget.CUDialog","circleup.widget.MsgDialog","circleup.widget.ConfirmDialog","circleup.widget.BoundedForm","circleup.widget.FormPane","circleup.widget.CircleNode","circleup.widget.ContactNode","circleup.widget.PreviewPane","circleup.widget.Singleton","circleup.widget.QuestionBox","circleup.widget.FileUploadDialog","circleup.widget.Attachments","circleup.widget.CUButton","circleup.widget.Themes","circleup.widget.LoginDialog","circleup.widget.DropdownMenu","circleup.widget.CircleTree","circleup.widget.AutoCompleteSuggestionBox","circleup.widget.CUTabContainer","circleup.widget.Shimmable","circleup.widget.UserVoice","circleup.widget.AjaxAnchor","circleup.widget.CUCurrencyTextbox","circleup.widget.Expander","circleup.widget.Resizable","circleup.widget.ResizableTextArea","circleup.widget.ResizableComboBox","circleup.widget.ChannelClaimDialog","circleup.widget.EditableCell","circleup.widget.EditableGrid","circleup.widget.Minimizer","circleup.widget.MobileNumberInput"],browser:[]});
dojo.provide("circleup.widget.*");
dojo.provide("payments.widget.Global");
var PaymentType={OFFLINE:"OFFLINE",ONLINE:"ONLINE"};
var PaymentEvents={USER:"USER",ENROLLMENT_REQUIRED:"ENROLLMENT_REQUIRED",HEADLESS:"HEADLESS"};
payments.widget.global={};
payments.widget.global.setGlobals=function(_5ab){
dojo.debug("Global setGlobal : "+_5ab);
for(var _5ac in _5ab){
paymentsGlobal[_5ac]=_5ab[_5ac];
}
};
payments.widget.global.initGlobal=function(){
dojo.debug("Global initGlobal : ");
payments.widget.global.setGlobals(defaultPaymentsGlobal);
};
paymentsGlobal={};
defaultPaymentsGlobal={msgDialogId:"cuDialog",providersDS:[],enrollmentDS:{CashCheck:false,Amazon:false},selectionDS:{CashCheck:true,Amazon:true},providerConfigDS:{Amazon:{feeArguments:{}}}};
payments.widget.global.initGlobal();
dojo.provide("payments.widget.AmazonPaymentForm");
function paymentCallback(data){
window.focus();
dojo.widget.byId("amazonPaymentForm").paymentCallback(data);
}
dojo.widget.defineWidget("payments.widget.AmazonPaymentForm",dojo.widget.HtmlWidget,{isContainer:true,widgetsInTemplate:true,parseComponents:true,widgetId:"amazonPaymentForm",dialogTitleStr:"Pay quickly with SmartPay!",msgDialogId:"qbMsgDialog",overlayTopOffset:31,anchor:null,_paymentWindow:null,_dialog:null,referenceKey:"",href:"/payments/paymentDialog.do",_status:"",_paymentStatus:{"PS":true,"PF":false,"PI":true,"PR":false,"A":false,"ME":false,"SE":false,"UN":false,"OFFLINE":true},templateString:"<div id=\"amazonPaymentForm\" dojoattachpoint=\"containerNode\">\n    <div dojoattachpoint=\"_dialog\" \n        dojoType=\"circleup:CUDialog\" \n        widgetId=\"${this.widgetId}_Dialog\" \n        dialogTitleStr=\"${this.dialogTitleStr}\" \n        cacheContent=\"false\"\n        scriptSeparation=\"false\"\n        loadingMessage=\"<table><tr><td/></tr></table><div style='height:330px;width:510px;'><div style='position:relative;top:150px;font-weight:bold;font-family:Verdana,Arial;font-size:20px;color:#aaaaaa;text-align:center;'>Loading...</div></div>\"\n        href=\"${this.href}\"> \n    </div>\n</div>\n",postCreate:function(){
this._dialog.show();
dojo.event.connect(this._dialog,"onHide",this,"_onHide");
},paymentCallback:function(data){
this._status=(data==="undefined"||data.status==="undefined")?"UN":data.status;
if((this._paymentStatus[this._status]==false)&&(this._status!="A")){
var msg=(data.message!=="")?data.message:"An error occured during the payment process";
this.showError("Payment Error",msg);
}
this._onPaymentCallback();
},showError:function(_5b0,msg){
var _5b2=dojo.widget.byId(this.msgDialogId);
_5b2.dialogTitleStr=_5b0;
dojo.event.connect(_5b2,"onHide",this,"_onPaymentCallback");
_5b2.showError("<div style='width:350px;'>"+msg+"</div>");
},onPaymentCallback:function(_5b3,_5b4){
},close:function(){
this._disconnect();
this._dialog.hide();
},_onPaymentCallback:function(){
this._disconnect();
this.onPaymentCallback(this._paymentStatus[this._status],this._status);
},_onHide:function(){
this._disconnect();
this.onPaymentCallback(this._paymentStatus["UN"],this._status);
},_disconnect:function(){
var _5b5=dojo.widget.byId(this.msgDialogId);
dojo.event.disconnect(_5b5,"onHide",this,"_onPaymentCallback");
dojo.event.disconnect(this._dialog,"onHide",this,"_onHide");
}});
dojo.provide("payments.widget.PayNow");
dojo.require("dojo.widget.HtmlWidget");
function activatePayNow(_5b6){
dojo.widget.byId(_5b6).activatePaymentForm();
}
dojo.widget.defineWidget("payments.widget.PayNow",[dojo.widget.HtmlWidget],{referenceKey:"",_paymentForm:null,activatePaymentForm:function(){
if(this._paymentForm!=null){
this._paymentForm.destroy();
}
this._paymentForm=dojo.widget.createWidget("payments:AmazonPaymentForm",{cssStyle:"",anchor:this.domNode.parentNode,href:"/payments/paymentDialog.do?referenceKey="+this.referenceKey});
this.addChild(this._paymentForm);
dojo.event.connect(this._paymentForm,"onPaymentCallback",this,"paymentComplete");
},paymentComplete:function(_5b7,_5b8){
this._paymentForm.close();
this.removeChild(this._paymentForm);
this.onPaymentComplete(_5b7,_5b8);
},onPaymentComplete:function(_5b9,_5ba){
}});
dojo.provide("payments.widget.AbstractPaymentProvider");
dojo.require("payments.widget.Global");
var PaymentProviders={};
var Providers={};
payments.widget.AbstractPaymentProvider=function(){
this.name="override";
this.provider="override";
this.label="override";
this.title="override";
this.help="override";
this.type=PaymentType.OFFLINE;
this.requiresEnrollment=false;
this.locked=false;
this.msgDialogId=paymentsGlobal.msgDialogId;
this.postCreate=function(){
};
this.isEnrolled=function(){
return paymentsGlobal.enrollmentDS[this.name];
};
this.setEnrolled=function(_5bb){
paymentsGlobal.enrollmentDS[this.name]=_5bb;
};
this.isLocked=function(){
return this.locked;
};
this.isSelected=function(){
return paymentsGlobal.selectionDS[this.name];
};
this.setSelected=function(_5bc){
paymentsGlobal.selectionDS[this.name]=_5bc;
};
this.enroll=function(_5bd){
};
this._getConfigDS=function(){
return paymentsGlobal.providerConfigDS[this.name];
};
this.asXML=function(){
xml="<PaymentProvider";
xml+=" name=\""+this.name+"\"";
xml+=" type=\""+this.type+"\"";
xml+=" provider=\""+this.provider+"\"";
xml+=" isSelected=\""+this.isSelected()+"\"";
xml+=" isEnrolled=\""+this.isEnrolled()+"\"";
xml+="/>";
return xml;
};
};
dojo.provide("payments.widget.ProviderManager");
dojo.require("payments.widget.AbstractPaymentProvider");
payments.widget.ProviderManager=function(){
this.providers={};
this.buildProviders=function(_5be){
for(i=0;i<_5be.length;i++){
this.buildProvider(_5be[i]);
}
};
this.buildProvider=function(_5bf){
var _5c0=dojo.lang.mixin(new payments.widget.AbstractPaymentProvider(),_5bf.provider);
_5c0.postCreate();
this.addProvider(_5bf.name,_5c0);
};
this.addProvider=function(name,_5c2){
this.providers[name]=_5c2;
};
this.removeProvider=function(_5c3){
this.providers[_5c3.name]=null;
};
};
dojo.provide("payments.widget.CollectionsController");
var ts=new Date().valueOf();
var learnMoreUrl="/help/smartpay/learnmore";
dojo.widget.defineWidget("payments.widget.CollectionsController",dojo.widget.HtmlWidget,{widgetId:"CollectionsController",isContainer:true,widgetsInTemplate:true,parseComponents:false,msgDialogId:paymentsGlobal.msgDialogId,learnMoreUrl:learnMoreUrl,dataSet:null,_providerManger:new payments.widget.ProviderManager(),_paymentOptions:null,templateString:"<div dojoattachpoint=\"containerNode\">\n\t<div id=\"${this.widgetId}_options\">\n\t\t<b>How do you want to be paid?</b>\n\t\t<span class=\"learnMore\"\n\t\t      dojoOnClick=\"_learnMore\"\n\t\t      style=\"margin-left:5px;\">(what's this?)</span>\n\t\t<div id=\"${this.widgetId}_paymentOptions\"\n\t\t     dojoAttachPoint=\"_paymentOptions\">\n\t\t</div>\n\t</div>\n</div>\n",buildRendering:function(args,frag){
this.dataSet=(this.dataSet==null)?paymentsGlobal.providersDS:this.dataSet;
register(this.widgetId+"_expander",this.widgetId);
payments.widget.CollectionsController.superclass.buildRendering.apply(this,arguments);
},postCreate:function(){
this._init();
},lauchPaymentProviderActivationFlow:function(){
var _5c6=this._providerManger.providers;
for(p in _5c6){
var _5c7=_5c6[p];
if(_5c7.requiresEnrollment&&!_5c7.isEnrolled()){
this._enroll(_5c7,PaymentEvents.ENROLLMENT_REQUIRED);
break;
}
}
},onEnrollmentSuccess:function(){
},onEnrollmentAbort:function(){
},onEnrollmentError:function(){
},_init:function(){
this._providerManger.buildProviders(this.dataSet);
var _5c8=this._providerManger.providers;
dojo.debug("CollectionsController._init : enter");
for(provider in _5c8){
this._insertProvider(_5c8[provider]);
}
dojo.debug("CollectionsController._init : exit");
},_insertProvider:function(_5c9){
var _5ca="";
var _5cb=this.widgetId+"_"+_5c9.name+"_checkbox";
_5ca="<label style=\"margin-left:13px;\" for=\""+_5cb+"\"><input id=\""+_5cb+"\" type=\"checkbox\" style=\"border:0px;\"/>";
_5ca+="<span style=\"margin-left:5px;\">"+_5c9.label+"</span>";
_5ca+="</label>";
var div=document.createElement("div");
div.innerHTML=_5ca;
this._paymentOptions.appendChild(div);
var _5cd=dojo.byId(_5cb);
_5cd.checked=_5c9.isSelected();
_5cd.disabled=_5c9.isLocked();
dojo.event.connect(_5cd,"onclick",dojo.lang.hitch(this,"_providerClicked",_5c9));
if(_5c9.requiresEnrollment&&!_5c9.isEnrolled()){
var span=document.createElement("span");
span.id=this.widgetId+"_"+_5c9.name+"_enrollment";
span.style.cssText="color:#0000ff;text-decoration:underline;margin-left:5px;cursor:pointer;";
span.innerHTML="(sign&nbsp;up&nbsp;to&nbsp;enable&nbsp;this&nbsp;option)";
div.appendChild(span);
dojo.event.connect(span,"onmousedown",dojo.lang.hitch(this,"_enroll",_5c9,PaymentEvents.USER));
}
},_providerClicked:function(_5cf,_5d0){
if(djConfig.onAnalyticsEvent){
djConfig.onAnalyticsEvent("EVENT",{"category":"CollectionsController","action":"_providerClicked","opt_label":"provider","opt_value":_5cf.name});
}
_5cf.setSelected(_5d0.target.checked);
},_enroll:function(_5d1,_5d2){
if(djConfig.onAnalyticsEvent){
djConfig.onAnalyticsEvent("EVENT",{"category":"CollectionsController","action":"_enroll","opt_label":"provider","opt_value":_5d1.name});
}
this._connect(_5d1);
_5d1.enroll(_5d2);
},_learnMore:function(_5d3){
var w=window.open(this.learnMoreUrl,"Help","width=372px,height=400px,menubar=no,scrollbars=no,location=no,status=no,resizable=no,directories=no,toolbar=no");
w.focus();
},_connect:function(_5d5){
dojo.event.connect(_5d5,"onSuccess",dojo.lang.hitch(this,"_onEnrollmentSuccess",_5d5));
dojo.event.connect(_5d5,"onAbort",dojo.lang.hitch(this,"_onEnrollmentAbort",_5d5));
dojo.event.connect(_5d5,"onError",dojo.lang.hitch(this,"_onEnrollmentError",_5d5));
},_disconnect:function(_5d6){
dojo.event.MethodJoinPoint.getForMethod(_5d6,"onSuccess").disconnect();
dojo.event.MethodJoinPoint.getForMethod(_5d6,"onAbort").disconnect();
dojo.event.MethodJoinPoint.getForMethod(_5d6,"onError").disconnect();
},_onEnrollmentSuccess:function(_5d7,_5d8,_5d9){
dojo.debug("CollectionsController._onEnrollmentSuccess");
_5d7.setEnrolled(true);
var span=dojo.byId(this.widgetId+"_"+_5d7.name+"_enrollment");
dojo.event.MethodJoinPoint.getForMethod(span,"onmousedown").disconnect();
span.parentNode.removeChild(span);
delete span;
this._disconnect(_5d7);
this.onEnrollmentSuccess();
},_onEnrollmentAbort:function(_5db,_5dc,_5dd){
dojo.debug("CollectionsController._onEnrollmentAbort");
this._disconnect(_5db);
this.onEnrollmentAbort();
},_onEnrollmentError:function(_5de,_5df,_5e0){
dojo.debug("CollectionsController._onEnrollmentError");
this._disconnect(_5de);
this.onEnrollmentError();
},asXML:function(){
xml="";
var _5e1=this._providerManger.providers;
for(provider in _5e1){
var prv=_5e1[provider];
if(prv.isSelected()){
xml+=_5e1[provider].asXML();
}
}
return xml;
}});
dojo.provide("payments.widget.Payable");
dojo.require("payments.widget.Global");
dojo.require("payments.widget.CollectionsController");
dojo.widget.defineWidget("payments.widget.Payable",null,{payable:true,showPayableButton:true,showPaymentMethods:false,_isPayable:false,_isPayableShowing:false,_activationButton:null,_paymentProvider:null,_autoActivate:true,_userDS:null,msgDialogId:"msgDialog",_paymentDiv:null,_collectionsCtrl:null,_whatIsThisText:"<div style='width:280px;margin-bottom:10px'>SmartPay is the fast, easy and secure way to collect money"+" by email from your group or team, letting everyone conveniently pay by credit or debit card online.</div>"+"<div style='width:280px;margin-bottom:10px;'>Use it for coach or teacher gifts, team parties and all of the"+" other things you collect by cash and check today.  With SmartPay, you send a SmartMessage to the members of your"+" group telling them how much money you need to collect. They reply using their regular Amazon login and pay with"+" a credit card already on file in their Amazon.com account.</div><div style='width:280px;margin-bottom:10px;'>You get"+" the money in your Amazon Payments account immediately and it's available to your bank account in 24 hours!</div>"+"<div style='width:280px'><b>SmartPay is FREE to the person collecting the money and to the group or team.</b>  The "+"individual members of your group who choose to use it pay only a small convenience fee.</div>",activatePayable:function(_5e3){
dojo.lang.forEach(this.children,function(_5e4){
try{
_5e4.activatePayable(_5e3);
}
catch(e){
}
});
if(this.showPaymentMethods){
this._paymentDiv.style.display="";
}else{
this._paymentDiv.style.display="none";
}
if(_5e3){
if(this._activationButton){
this._activationButton.src="/assets/default/web/smartpay/btn_smartpay_activated.gif";
}
}else{
if(this._activationButton){
this._activationButton.src="/assets/default/web/smartpay/btn_smartpay_activate.gif";
}
}
this._isPayable=_5e3;
},onShow:function(){
if(this._collectionsCtrl!=null){
this._collectionsCtrl.onShow();
}
},_initPayable:function(_5e5,_5e6){
this._userDS=(typeof _5e6==="undefined")?null:_5e6;
this._isPayable=((typeof _5e5==="undefined")||(typeof _5e5.isPayable==="undefined")||(!dojo.lang.isBoolean(_5e5.isPayable)))?false:_5e5.isPayable;
this._collectionsCtrl=dojo.widget.createWidget("payments:CollectionsController",{id:this.widgetId+"_payment",widgetId:this.widgetId+"_payment"},this._paymentDiv,"last");
dojo.event.connect(this._collectionsCtrl,"onEnrollmentSuccess",this,"onEnrollmentSuccess");
dojo.event.connect(this._collectionsCtrl,"onEnrollmentAbort",this,"onEnrollmentAbort");
dojo.event.connect(this._collectionsCtrl,"onEnrollmentError",this,"onEnrollmentError");
},_isPayableChange:function(){
this.activatePayable(!this._isPayable);
},onEnrollmentSuccess:function(){
},onEnrollmentAbort:function(){
},onEnrollmentError:function(){
},showPayable:function(_5e7){
if(this._isPayableShowing==false){
var _5e8=this.widgetId+"_payable";
var div=document.createElement("div");
div.style.cssText="display:block;";
div.innerHTML="<div style=\"float:left;\"><img id=\""+_5e8+"\" onmouseout=\"this.style.cursor='default';\" onmouseover=\"this.style.cursor='pointer';\" src=\"/assets/default/web/smartpay/btn_smartpay_activate.gif\" border=\"0\" alt=\"\"/></div><div style=\"float:left;width:80px;margin-left:10px;\"><a id=\"whatIsThisLink\" style=\"text-decoration:underline;font-size:10px;cursor:pointer\">What is this?</a></div>";
_5e7.appendChild(div);
this._activationButton=dojo.byId(_5e8);
dojo.event.connect(this._activationButton,"onclick",this,"_isPayableChange");
var _5ea=dojo.byId("whatIsThisLink");
dojo.event.connect(_5ea,"onclick",this,"_showWhatIsThis");
this._isPayableShowing=true;
this.activatePayable(this._isPayable);
}
},lauchPaymentProviderActivationFlow:function(){
this._collectionsCtrl.lauchPaymentProviderActivationFlow();
},_showWhatIsThis:function(){
dojo.widget.byId(this.msgDialogId).showMsgWithTitleAndCssClass(this._whatIsThisText,"About SmartPay","info dialog");
},paymentXML:function(){
var _5eb="";
if(this._isPayable){
_5eb="<PayableOrder currency=\"USD\">";
_5eb+=this._collectionsCtrl.asXML();
_5eb+="</PayableOrder>";
}
return _5eb;
}});
dojo.provide("payments.widget.PayableItem");
dojo.widget.defineWidget("payments.widget.PayableItem",null,{isPayable:false,payableItemSize:10,_payableItemDiv:null,_payableItem:null,_payablePlaceHolder:null,_isPayableInput:null,_dlrs:null,_setPayableItem:function(){
dojo.debug("PayableItem _setPayableItem : "+this.isPayable+"");
if(this.isPayable){
if(this._payableItem==null){
var _5ec=this.widgetId+"_payableinput";
if(!this._payableItemDiv){
this._payableItemDiv=document.createElement("div");
this._payablePlaceHolder.appendChild(this._payableItemDiv);
this._payableItemDiv.innerHTML="<input style=\"outline:none;float:left;border:0px;\" id=\""+_5ec+"\" type=\"checkbox\" />";
this._isPayableInput=dojo.byId(_5ec);
dojo.event.connect(this._isPayableInput,"onclick",this,"_isPayableChange");
this._payableItem=dojo.widget.createWidget("circleup:CUCurrencyTextbox",{widgetId:this.widgetId+"_payableItem",places:2,min:"5",max:"999.99",htmlfloat:"left",htmlMarginLeft:"5px",inputStyle:"width:90px;height:"+this.payableItemHeight+"px",promptMessage:"Input Amount",deactiveMessage:"Collect Money"},this._isPayableInput,"after");
}else{
this._payableItem=dojo.widget.createWidget("circleup:CUCurrencyTextbox",{widgetId:this.widgetId+"_payableItem",places:2,size:this.payableItemSize,min:"5",max:"999.99",isActive:true,htmlfloat:"right",promptMessage:"Input Amount",deactiveMessage:"Collect Money"},this._payableItemDiv);
}
}else{
this._payableItemDiv.style.display="";
}
}
},setPayableItemDataSet:function(ds){
if((typeof ds!=="undefined")&&(ds!=null)&&(typeof ds.amount!=="undefined")){
if(ds.amount!=null){
if(this._isPayableInput){
this._isPayableInput.checked=true;
this._isPayableChange();
}
if(ds.amount!=""){
this._payableItem.setValue(ds.amount);
}
}
}
},_removePayableItem:function(){
this.isPayable=false;
if(this._payableItemDiv!=null){
this._payableItemDiv.style.display="none";
}
},_onPayableInputClicked:function(){
if(!this._isPayableInput.checked){
this._isPayableInput.checked=true;
this._isPayableChange();
}
},_isPayableChange:function(){
if(this._isPayableInput.checked){
this._payableItem.activate();
this.activatePayable(true);
}else{
this._payableItem.deactivate();
}
},activatePayable:function(_5ee){
this.isPayable=_5ee;
if(!this.isPayable){
this._removePayableItem();
}else{
this._setPayableItem();
}
},paymentXML:function(){
var _5ef="";
if((this.isPayable)&&(this._payableItem.isActive)){
_5ef="<PayableItem ";
_5ef+="index=\""+this.index+"\" ";
_5ef+="amount=\""+this._payableItem.getValue()+"\"/>";
}
return _5ef;
}});
dojo.provide("payments.widget.AmazonPaymentProvider");
dojo.require("payments.widget.Global");
var enrollmentContent={USER:{templateString:"<div style=\"width:450px;padding:10px 20px 10px 20px;background-color:#ffffff;position:relative;\">\n    <h1>To collect credit and debit card payments online using SmartPay, you will need to sign-up for Amazon Payments.</h1>\n    <div class=\"msg_text\">\n        <p style=\"padding:0px;\">SmartPay uses Amazon.com's world class payment services for payments.\n        After you sign-up, others can easily pay you online by credit or debit card.</p>\n    </div>\n\n    <div class=\"msg_text\">\n        <p style=\"padding:0px;\"><b>It's FREE, EASY and only takes minutes to sign-up</b>.</p>\n    </div>\n\n    <div>\n        <i>\n        Note: You do not have to have a business or have a group bank account to sign up, just sign up as an individual.\n        <a href=\"/help/smartpay\" target=\"_blank\">Print instructions</a> or\n        <a href=\"/smartpay/media?campaignSrc=internal&video=jump\" target=\"_blank\">watch this video</a> for more info.</i>\n    </div>\n\n    <img src=\"http://g-ecx.images-amazon.com/images/G/01/cba/b/s2.gif\"\n         border=\"0\"\n         style=\"height:85px;width:159px;margin-left:10px;margin-top:10px;\"/>\n\n    <div dojoType=\"circleup:CUButton\"\n         widgetId=\"amazonEnrollButton\"\n         cssStyle=\"position:absolute;right:58px;bottom:72px;\">Sign&nbsp;Up&nbsp;for&nbsp;FREE</div>\n\n    <div style=\"padding-top:23px;padding-left:25px;\">\n        <a href=\"/smartpay/partner/default/?campaignSrc=internal&tab=OfferTab\" target=\"_blank\">See Details</a>\n        <a href=\"/smartpay/faq/?campaignSrc=internal\" target=\"_blank\" style=\"padding-left:10px;\">Frequently Asked Questions</a>\n        <a href=\"/smartpay/partner/default/?campaignSrc=internal\" target=\"_blank\" style=\"padding-left:10px;\">Visit Site</a>\n        <a href=\"mailto:smartpay@circleup.com\" style=\"padding-left:10px;\">Contact Us</a>\n    </div>\n</div>\n",title:"Signup Required - Amazon Payments"},ENROLLMENT_REQUIRED:{templateString:"<div style=\"width:450px;padding:10px 20px 10px 20px;background-color:#ffffff;position:relative;\">\n\t<h1>To send a SmartMessage that can accept Amazon Payments, you need to complete the sign up process.</h1>\n\n    <div class=\"msg_text\">\n        <p style=\"padding:0px;\">SmartPay uses Amazon.com's world class payment services for payments.  \n        After you sign-up, others can easily pay you online by credit or debit card.</p>\n    </div>\n    \n    <div class=\"msg_text\">\n        <p style=\"padding:0px;\"><b>It's FREE, EASY and only takes minutes to sign-up</b>.</p>\n    </div>\n    \n    <div>\n        <i>\n        Note: You do not have to have a business or have a group bank account to sign up, just sign up as an individual.  \n        <a href=\"/help/smartpay\" target=\"_blank\">Print instructions</a> or\n        <a href=\"/smartpay/media?campaignSrc=internal&video=jump\" target=\"_blank\">watch this video</a> for more info.</i>\n    </div>\n\n\t<ul>\n\t\t<li>\n\t\t\tClick the <b>\"Sign Up\"</b> button to proceed to the Amazon Payment enrollment process.  \n\t\t\tYour message will be sent when complete.\n\t\t</li>\n\t\t<li>\n\t\t\tIf you do not want to accept online payments: close this window, \n\t\t\tuncheck the Amazon Payments option and click Send.\n\t\t</li>\n\t</ul>\n\t<img src=\"http://g-ecx.images-amazon.com/images/G/01/cba/b/s2.gif\" \n\t     border=\"0\" \n\t     style=\"height:85px;width:159px;margin-left:10px;margin-top:10px;\"/>\t\n\n    <div dojoType=\"circleup:CUButton\"\n         widgetId=\"amazonEnrollButton\"\n         cssStyle=\"position:absolute;right:58px;bottom:72px;\">Sign&nbsp;Up&nbsp;for&nbsp;FREE</div>\n         \n    <div style=\"padding-top:23px;padding-left:25px;\">\n        <a href=\"/smartpay/partner/default/?campaignSrc=internal&tab=OfferTab\" target=\"_blank\">See Details</a>\n        <a href=\"/smartpay/faq/?campaignSrc=internal\" target=\"_blank\" style=\"padding-left:10px;\">Frequently Asked Questions</a>\n        <a href=\"/smartpay/partner/default/?campaignSrc=internal\" target=\"_blank\" style=\"padding-left:10px;\">Visit Site</a> \n        <a href=\"mailto:smartpay@circleup.com\" style=\"padding-left:10px;\">Contact Us</a>\n    </div>\n</div>\n",title:"Send Message - Signup Required - Amazon Payments"}};
dojo.widget.fillFromTemplateCache(enrollmentContent.USER);
dojo.widget.fillFromTemplateCache(enrollmentContent.ENROLLMENT_REQUIRED);
var successContent={USER:{templateString:"<div class=\"success dialog\"\n     style='width: 350px;'>\n\t<span class='label'>\n\t\tCongratulations! You're nearly done. Just one more step to enroll in SmartPay...\n\t</span>\n\t<span class='msg_text'>\n\t\t<b>Important:</b> Look for an email from Amazon with the subject line &ldquo;Verify Your E-mail Address&rdquo;. You \n\t\t<span style='text-decoration: underline;'>must</span> click on the link within this email to complete your enrollment in SmartPay! \n\t</span>\n\t<div dojoType=\"circleup:CUButton\"\n\t     id=\"amazonSuccessOkButton\"\n\t     widgetId=\"amazonSuccessOkButton\"\n\t     cssStyle=\"display:block;margin:20px auto 0px;\">Ok</div>\n</div>\n",title:"Signup Successful - Amazon Payments"},ENROLLMENT_REQUIRED:{templateString:"<div class=\"success dialog\"\n     style='width: 350px;'>\n\t<span class='label'>\n\t\tCongratulations! You're nearly done. Just one more step to enroll in SmartPay...\n\t</span>\n\t<span class='msg_text'>\n\t\t<b>Important:</b> Look for an email from Amazon with the subject line &ldquo;Verify Your E-mail Address&rdquo;. You \n\t\t<span style='text-decoration: underline;'>must</span> click on the link within this email to complete your enrollment in SmartPay!\n\t\t<br>In the meantime, click <b>\"Ok\"</b> to send your message.  But remember - you must complete enrollment before you will be able to collect \n\t\tonline.\n\t</span>\n\t<div dojoType=\"circleup:CUButton\"\n\t     id=\"amazonSuccessOkButton\"\n\t     widgetId=\"amazonSuccessOkButton\"\n\t     cssStyle=\"display:block;margin:20px auto 0px;\">Ok</div>\n</div>\n",title:"Signup Successful - Amazon Payments"}};
dojo.widget.fillFromTemplateCache(successContent.USER);
dojo.widget.fillFromTemplateCache(successContent.ENROLLMENT_REQUIRED);
var errorContent={USER:{templateString:"<div class=\"error dialog\"\n     style='width: 350px;'>\n\t<span class='label'>\n\t\tOops, something unexpected happened while enrolling with Amazon Payments\n\t</span>\n\t<span class='msg_text'>\n\t\tPlease try again.  If you continue to receive this message, contact \n\t\t<a href='mailto:eddie@circleup.com?subject=Request for support'>CircleUp support</a>\n\t</span>\n\t<div dojoType=\"circleup:CUButton\"\n\t     id=\"amazonErrorOkButton\"\n\t     widgetId=\"amazonErrorOkButton\"\n\t     cssStyle=\"display:block;margin:20px auto 0px;\">Ok</div>\n</div>\n",title:"Signup Error - Amazon Payments"},ENROLLMENT_REQUIRED:{templateString:"<div class=\"error dialog\"\n     style='width: 350px;'>\n\t<span class='label'>\n\t\tOops, something unexpected happened while enrolling with Amazon Payments.  Your message hasn't been sent.\n\t</span>\n\t<span class='msg_text'>\n\t\tPlease try again.  If you continue to receive this message, contact \n\t\t<a href='mailto:eddie@circleup.com?subject=Request for support'>CircleUp support</a>\n\t</span>\n\t<div dojoType=\"circleup:CUButton\"\n\t     id=\"amazonErrorOkButton\"\n\t     widgetId=\"amazonErrorOkButton\"\n\t     cssStyle=\"display:block;margin:20px auto 0px;\">Ok</div>\n</div>\n",title:"Signup Error - Amazon Payments"}};
dojo.widget.fillFromTemplateCache(errorContent.USER);
dojo.widget.fillFromTemplateCache(errorContent.ENROLLMENT_REQUIRED);
paymentsGlobal.providersDS.push({name:"Amazon",provider:{name:"Amazon",provider:"AmazonPaymentProvider",label:"Online by credit or debit card and a regular Amazon.com account",description:"Pay online with an Amazon account",type:PaymentType.ONLINE,requiresEnrollment:true,_approvalStatus:{"SR":true,"DISMISS":false,"A":false,"CE":false,"NP":false,"NM":false,"UN":false},enroll:function(_5f0){
if(djConfig.onAnalyticsEvent){
djConfig.onAnalyticsEvent("EVENT",{"category":"AmazonPaymentProvider","action":"enrollment_start","opt_label":this.name,"opt_value":_5f0});
}
if(_5f0==PaymentEvents.HEADLESS){
this._enroll(_5f0);
}else{
this._renderEnrollmentContent(_5f0);
}
},onSuccess:function(_5f1,_5f2){
dojo.debug("AmazonPaymentProvider.onSuccess");
},onError:function(_5f3,_5f4){
dojo.debug("AmazonPaymentProvider.onError");
},onAbort:function(_5f5,_5f6){
dojo.debug("AmazonPaymentProvider.onAbort");
},_paymentApprovalCallback:function(_5f7,data){
dojo.debug("AmazonPaymentProvider.paymentApprovalCallback : Enter");
dojo.event.MethodJoinPoint.getForMethod(window,"paymentApprovalCallback").disconnect();
var _5f9=(data==="undefined"||data.status==="undefined")?"UN":data.status;
var _5fa=(data==="undefined"||data.message==="undefined")?"":data.message;
if(djConfig.onAnalyticsEvent){
djConfig.onAnalyticsEvent("EVENT",{"category":"AmazonPaymentProvider","action":"enrollment_finish","opt_label":this.name,"opt_value":_5f9});
}
if(_5f9=="A"||_5f9=="DISMISS"){
this.onAbort("A");
}else{
var dlg=dojo.widget.byId(this.msgDialogId);
var _5fc=dojo.widget.byId("amazonEnrollButton");
dojo.event.MethodJoinPoint.getForMethod(dlg,"onHide").disconnect();
dojo.event.MethodJoinPoint.getForMethod(_5fc,"onClick").disconnect();
if(this._approvalStatus[_5f9]==false){
if(_5f7==PaymentEvents.HEADLESS){
this.onError(_5f9,_5f7,_5fa);
}else{
this._showOnError(_5f9,_5f7,_5fa);
}
}else{
if(_5f7==PaymentEvents.HEADLESS){
this.onSuccess(_5f9,_5f7);
}else{
this._showOnSuccess(_5f9,_5f7);
}
}
}
dojo.debug("AmazonPaymentProvider.paymentApprovalCallback : Exit");
},_renderEnrollmentContent:function(_5fd){
var _5fe=enrollmentContent[_5fd].templateString;
var _5ff=enrollmentContent[_5fd].title;
var dlg=dojo.widget.byId(this.msgDialogId);
dlg.setContent(_5fe);
dlg.setTitle(_5ff);
dlg.show();
var _601=dojo.widget.byId("amazonEnrollButton");
dojo.event.connect(dlg,"onHide",dojo.lang.hitch(this,"_paymentApprovalCallback",_5fd,{status:"DISMISS"}));
dojo.event.connect(_601,"onClick",dojo.lang.hitch(this,"_enroll",_5fd));
},_enroll:function(_602){
dojo.event.topic.subscribe("onLoading",dojo.lang.hitch(this,"_submitAmazonForm",_602));
var _603=(dojo.render.html.ie)?"location=yes":"toolbar=yes";
window.open("/payments/loading","approvalTargetWindow","width=950px,height=770px,scrollbars=yes,resizable=yes,"+_603);
},_refreshForm:function(){
try{
dojo.io.bind({method:"GET",preventCache:true,mimetype:"text/json",url:"/payments/amazon/feeAcceptParameters",load:dojo.lang.hitch(this,"_refreshFormReady")});
}
catch(e){
}
},_refreshFormReady:function(src,data){
var _606=this._getConfigDS();
_606.feeArguments=data;
},_submitAmazonForm:function(_607,_608){
dojo.event.topic.unsubscribe("onLoading");
var _609=this._getConfigDS();
var _60a="<form";
_60a+=" action='"+_609.feeArguments.url+"'";
_60a+=" method='POST'";
_60a+=" target='approvalTargetWindow'";
_60a+=" id='payApprovalForm'";
_60a+=" name='payApprovalForm'";
_60a+=">";
_60a+=this._insertInput("awsSignature",_609.feeArguments["awsSignature"]);
_60a+=this._insertInput("callerKey",_609.feeArguments["callerKey"]);
_60a+=this._insertInput("callerReference",_609.feeArguments["callerReference"]);
_60a+=this._insertInput("collectEmailAddress",_609.feeArguments["collectEmailAddress"]);
_60a+=this._insertInput("maxFixedFee",_609.feeArguments["maxFixedFee"]);
_60a+=this._insertInput("maxVariableFee",_609.feeArguments["maxVariableFee"]);
_60a+=this._insertInput("pipelineName",_609.feeArguments["pipelineName"]);
_60a+=this._insertInput("recipientPaysFee",_609.feeArguments["recipientPaysFee"]);
_60a+=this._insertInput("returnUrl",_609.feeArguments["returnUrl"]);
_60a+="</form>";
_608.window.document.write(_60a);
var form=_608.window.document.getElementById("payApprovalForm");
this._connectWindowCallback(_607);
form.submit();
_608.window.focus();
try{
setTimeout(dojo.lang.hitch(this,"_refreshForm"),5000);
}
catch(e){
}
},_connectWindowCallback:function(_60c){
dojo.event.connect(window,"paymentApprovalCallback",dojo.lang.hitch(this,"_paymentApprovalCallback",_60c));
},_insertInput:function(name,_60e){
return "<input type='hidden' name='"+name+"' value='"+_60e+"'></input>";
},_showOnError:function(_60f,_610,_611){
var _612=_611;
if(_611==="undefined"||_611==null||_611==""){
_612=errorContent[_610].templateString;
}
var _613=errorContent[_610].title;
var dlg=dojo.widget.byId(this.msgDialogId);
dlg.setContent(_612);
dlg.setTitle(_613);
dlg.show();
var _615=dojo.widget.byId("amazonErrorOkButton");
dojo.event.connect(dlg,"onHide",dojo.lang.hitch(this,"_onError",_60f,_610));
dojo.event.connect(_615,"onClick",function(){
dlg.hide();
});
},_onError:function(_616,_617){
var dlg=dojo.widget.byId(this.msgDialogId);
var _619=dojo.widget.byId("amazonErrorOkButton");
dojo.event.MethodJoinPoint.getForMethod(dlg,"onHide").disconnect();
dojo.event.MethodJoinPoint.getForMethod(_619,"onClick").disconnect();
this.onError(_616,_617);
},_showOnSuccess:function(_61a,_61b){
var _61c=successContent[_61b].templateString;
var _61d=successContent[_61b].title;
var dlg=dojo.widget.byId(this.msgDialogId);
dlg.setContent(_61c);
dlg.setTitle(_61d);
dlg.show();
var _61f=dojo.widget.byId("amazonSuccessOkButton");
dojo.event.connect(dlg,"onHide",dojo.lang.hitch(this,"_onSuccess",_61a,_61b));
dojo.event.connect(_61f,"onClick",function(){
dlg.hide();
});
},_onSuccess:function(_620,_621){
var dlg=dojo.widget.byId(this.msgDialogId);
var _623=dojo.widget.byId("amazonSuccessOkButton");
dojo.event.MethodJoinPoint.getForMethod(dlg,"onHide").disconnect();
dojo.event.MethodJoinPoint.getForMethod(_623,"onClick").disconnect();
this.onSuccess(_620,_621);
}}});
dojo.provide("payments.widget.CashCheckPaymentProvider");
dojo.require("payments.widget.Global");
paymentsGlobal.providersDS.push({name:"CashCheck",provider:{name:"CashCheck",provider:"CashCheckProvider",label:"Cash or Check",description:"Pay with cash or check",locked:true}});
dojo.kwCompoundRequire({common:["payments.widget.Global","payments.widget.PayNow","payments.widget.Payable","payments.widget.PayableItem","payments.widget.AbstractPaymentProvider","payments.widget.AmazonPaymentProvider","payments.widget.CashCheckPaymentProvider","payments.widget.ProviderManager","payments.widget.CollectionsController"],browser:[]});
dojo.provide("payments.widget.*");
dojo.provide("addressing.widget.Global");
addressing.widget.global={};
addressing.widget.global.setGlobals=function(_624){
dojo.debug("Global setGlobal : "+_624);
for(var _625 in _624){
addressingGlobal[_625]=_624[_625];
}
};
addressing.widget.global.initGlobal=function(){
dojo.debug("Global initGlobal : ");
addressing.widget.global.setGlobals(addrDefaultGlobal);
};
addressingGlobal={};
addrDefaultGlobal={addressingWidgetId:"addressingWidget",groupNameSelectionWidgetId:"groupNameSelectionWidget",addContactsId:"addContactsWidget",confirmDialogId:"qcConfirmDialog",addressingDialogId:"addressingDialog",addressingUrl:"/addressing/content/",addressingDS:{"selectedCircles":[],"draftId":null,"distributionGroup":""},vc:"default",siteId:"CIRCLEUP",loc:""};
addressing.widget.global.initGlobal();
dojo.provide("composer.widget.Global");
composer.widget.global={};
composer.widget.global.S4=function(){
return (((1+Math.random())*65536)|0).toString(16).substring(1);
};
composer.widget.global.guid=function(){
return (composer.widget.global.S4()+composer.widget.global.S4()+"-"+composer.widget.global.S4()+"-"+composer.widget.global.S4()+"-"+composer.widget.global.S4()+"-"+composer.widget.global.S4()+composer.widget.global.S4()+composer.widget.global.S4());
};
composer.widget.global.setGlobals=function(_626){
dojo.debug("Global setGlobal : "+_626);
for(var _627 in _626){
qcGlobal[_627]=_626[_627];
}
};
composer.widget.global.initGlobal=function(){
dojo.debug("Global initGlobal : ");
composer.widget.global.setGlobals(defaultGlobal);
};
qcGlobal={};
defaultGlobal={distId:composer.widget.global.guid(),draftId:"",composerWidgetId:"composerWidget",addressingWidgetId:"composer_Addressing",qhWidgetId:"composer_QuestionHeader",permissionsWidgetId:"permissionsWidget",deliveryWidgetId:"deliveryWidget",paymentWidgetId:"paymentWidget",fileUploadDialogId:"fileUploadDialog",previewPaneId:"previewBorder",msgDialogId:"msgDialog",confirmDialogId:"qcConfirmDialog",cuDialogId:"cuDialog",composerUrl:"/composer/content/",distributeUrl:"/composer/distribute.do",saveUrl:"/composer/save.do",resultsUrl:"/results?page=1&distGuid=",testItUrl:"/composer/testIt.do",templateUrl:"/composer/templates/",saveMsg:"",testItMsg:"",unsavedMsg:"",showTemplateDialog:true,maxHeight:null,selectedQuestionType:"MultipleChoice",questionHeaderDS:{"subject":"","message":"","privacy":"PRIVATE","isPayable":false,"forwarding":"dont forward","showResponses":true,"attachments":[]},addressingDS:{"selectedCircles":[],"distId":null},multipleChoiceDS:{"choices":[{"value":"","attachments":[]},{"value":"","attachments":[]}],"writeIn":false},rankDS:{"choices":[{"value":"","attachments":[]},{"value":"","attachments":[]},{"value":"","attachments":[]},{"value":"","attachments":[]}],"writeIn":false},rateDS:{"choices":[{"value":"","attachments":[]}],"writeIn":false},announcementDS:{},yesNoDS:{"writeIn":false},trueFalseDS:{"writeIn":false},suggestionsDS:{},contactInfoDS:{"selected":["First Name","Last Name","Street Address","City","State/Prov","Country","ZIP/Postal code","Mobile Number","Phone Number","Fax","Notes","Email","AIM","Y!M"]},updateGroupMembersDS:{"selected":["First Name","Last Name","Email","Mobile Number","Voice Number","Street","City","State/Prov","Country","ZIP/Postal code"]},updateGroupMembersFields:["First Name","Last Name","Email","Mobile Number","Voice Number","Street","City","State/Prov","Country","ZIP/Postal code"],updateGroupMembersMandatorFields:["First Name","Last Name","Email"],updateGroupMembersCheckedFields:["First Name","Last Name","Email","Mobile Number","Voice Number"],rosterInfoDS:{"selected":["First Name","Last Name","Email","Member Type","Address","City","State/Prov","Country","ZIP/Postal code","Phone Number","Birthday","Gender","Height","Weight","School","eTeamz Display Name"]},rosterFields:["First Name","Last Name","Email","Member Type","Address","City","State/Prov","Country","ZIP/Postal code","Phone Number","Birthday","Gender","Height","Weight","School","eTeamz Display Name"],rosterMandatoryFields:["First Name","Last Name","Email","Member Type"],tableDS:{"rowHeaders":[],"colHeaders":[]},orderFormDS:{"choices":[{"value":"","attachments":[]}],"writeIn":false},permissionsDS:{"state":12},announcement:"ANNOUNCEMENT",contactInfo:"SENDME_YOUR_INFO",updateGroupMembers:"UPDATE_GROUP_MEMBERS",multipleChoice:"MULTIPLE_CHOICE",rank:"RANK",rate:"RATE",suggestions:"MULTIPLE_SUGGESTION",table:"TABLE",tf:"TRUE_FALSE",yn:"YES_NO",roster:"UPDATE_ROSTER_INFO",orderForm:"ORDER_FORM",vc:"default",siteId:"CIRCLEUP",loc:""};
composer.widget.global.initGlobal();
var titleMap={};
var labelMap={};
var iconMap={};
titleMap[qcGlobal.multipleChoice]="Choices&nbsp;/&nbsp;Options";
titleMap[qcGlobal.announcement]="Announcement";
titleMap[qcGlobal.suggestions]="Ask&nbsp;for&nbsp;Suggestions,&nbsp;Files&nbsp;and&nbsp;Photos";
titleMap[qcGlobal.table]="Rows&nbsp;and&nbsp;Columns";
titleMap[qcGlobal.contactInfo]="Send&nbsp;Me&nbsp;Your&nbsp;Contact&nbsp;Information";
titleMap[qcGlobal.updateGroupMembers]="Collect&nbsp;Contact&nbsp;Info";
titleMap[qcGlobal.rate]="Rate&nbsp;these&nbsp;Options";
titleMap[qcGlobal.rank]="Rank&nbsp;these&nbsp;Options";
titleMap[qcGlobal.yn]="Yes&nbsp;/&nbsp;No";
titleMap[qcGlobal.tf]="True&nbsp;/&nbsp;False";
titleMap[qcGlobal.roster]="Update&nbsp;Your&nbsp;Roster&nbsp;Information";
titleMap[qcGlobal.orderForm]="Order&nbsp;Form";
labelMap[qcGlobal.multipleChoice]="Choices";
labelMap[qcGlobal.announcement]="Announcement";
labelMap[qcGlobal.suggestions]="Suggestions<br/>Files&nbsp;&&nbsp;Photos";
labelMap[qcGlobal.table]="Rows &<br>Columns";
labelMap[qcGlobal.contactInfo]="Contact<br>Info";
labelMap[qcGlobal.rate]="Rating";
labelMap[qcGlobal.rank]="Ranking";
labelMap[qcGlobal.yn]="Yes or<br/>No";
labelMap[qcGlobal.tf]="True or False";
labelMap[qcGlobal.updateGroupMembers]="Collect<br/>Contact Info";
labelMap[qcGlobal.roster]="Update Roster";
labelMap[qcGlobal.orderForm]="Order Form";
iconMap[qcGlobal.multipleChoice]=qcGlobal.multipleChoice+".jpg";
iconMap[qcGlobal.announcement]=qcGlobal.announcement+".jpg";
iconMap[qcGlobal.suggestions]=qcGlobal.suggestions+".jpg";
iconMap[qcGlobal.table]=qcGlobal.table+".jpg";
iconMap[qcGlobal.contactInfo]=qcGlobal.contactInfo+".jpg";
iconMap[qcGlobal.updateGroupMembers]=qcGlobal.updateGroupMembers+".jpg";
iconMap[qcGlobal.rate]=qcGlobal.rate+".jpg";
iconMap[qcGlobal.rank]=qcGlobal.rank+".jpg";
iconMap[qcGlobal.yn]=qcGlobal.yn+".jpg";
iconMap[qcGlobal.tf]=qcGlobal.tf+".jpg";
iconMap[qcGlobal.roster]=qcGlobal.roster+".jpg";
iconMap[qcGlobal.orderForm]=qcGlobal.orderForm+".jpg";
dojo.provide("composer.widget.Composer");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("composer.widget.Composer",dojo.widget.HtmlWidget,{widgetId:qcGlobal.composerWidgetId,distId:-1,isContainer:true,widgetsInTemplate:true,parseComponents:false,suppressDialogsOnLaunch:false,isLoaded:false,to:"",vc:"default",siteId:"CIRCLEUP",groupid:"",loc:qcGlobal.loc,netid:"",sub_level:"",showEditing:true,userAttributes:null,templateCssStyle:"width:580px;height:auto !important;height:492px;min-height:492px;",optionsId:"composer_Options",enableDragging:"true",positioning:"CENTERED",composerUrl:qcGlobal.composerUrl,distributeUrl:qcGlobal.distributeUrl,saveUrl:qcGlobal.saveUrl,testItUrl:qcGlobal.testItUrl,templateUrl:qcGlobal.templateUrl,templateString:"<div>\n\t<div dojoType=\"circleup:CUDialog\" \n\t     id=\"${this.widgetId}_templateDialog\" \n\t     widgetId=\"${this.widgetId}_templateDialog\" \n\t     bind=\"false\"\n\t     followScroll=\"false\"\n\t     preload=\"false\"\n\t     parseComponents=\"false\"\n\t     deferParsing=\"false\"\n\t     executeScripts=\"true\"\n\t     cacheContent=\"false\"\n\t     refreshOnShow=\"true\"\n\t     positioning=\"FIXED\"\n\t     isLoaded=\"false\"\n\t     dialogTitleStr=\"Select a Template\"\n\t     href=\"${this.templateUrl}\"\n\t     dojoAttachPoint=\"_templateDialog\"\n\t     enableDragging=\"${this.enableDragging}\"\n\t     positioning=\"${this.positioning}\"\n\t     useShim=\"false\"\n\t     top=\"20px\"\n\t     left=\"auto\"\n\t     loadingMessage=\"&lt;table&gt;&lt;tr&gt;&lt;td/&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div style='height:450px;width:550px;'&gt;&lt;div style='position:relative;top:40%;font-weight:bold;font-family:Verdana,Arial;font-size:20px;color:#aaaaaa;text-align:center;height:100%;width:100%;'&gt;Loading...&lt;/div&gt;&lt;/div&gt;\"\n\t     style=\"display:none;\"></div>\n\t<div dojoType=\"ContentPane\" \n\t     id=\"${this.widgetId}_composerPane\" \n\t     widgetId=\"${this.widgetId}_composerPane\" \n\t     adjustPaths=\"false\"\n\t     isLoaded=\"${this.isLoaded}\"\n\t     parseContent=\"true\"\n\t     parseComponents=\"false\"\n\t     deferParsing=\"false\"\n\t     preload=\"false\"\t    \n\t     cacheContent=\"false\" \n\t     scriptSeparation=\"false\"\n\t     executeScripts=\"true\"\n\t     loadingMessage=\"\"\n\t     href=\"${this.composerUrl}\"\n\t     dojoattachpoint=\"_composerPane\"\n\t     class=\"composerFrame\"\n\t     style=\"position:relative;z-index:1;display:none;\">\n\t     <div dojoattachpoint=\"containerNode\"></div>\n\t</div>\n</div>\n",loadingMessage:djConfig.loadingMsg,_overlay:null,_addressing:null,_msgDialog:null,_confirmDialog:null,_questionForm:null,_questionFormPane:null,_questionHeader:null,_templateDialog:null,_qtConatiner:null,_fuDialog:null,_qtController:null,_testItButton:null,_permissions:null,_delivery:null,_state:"",_isDirty:false,_prompt:false,_firstShow:true,_templateRequest:false,_draftRequest:false,_previewPending:false,_composerPane:null,_optionsExpander:null,buildRendering:function(args,frag){
register(this.widgetId+"_templateDialog",this.widgetId);
register(this.widgetId+"_composerPane",this.widgetId);
if(this.composerUrl.indexOf("?")>0){
this.composerUrl+="&parentId="+this.widgetId+"_composerPane"+"&to="+this.to+"&vc="+this.vc+"&siteId="+this.siteId+"&loc="+this.loc+"&groupid="+this.groupid+"&netid="+this.netid+"&sub_level="+this.sub_level+"&showEditing="+this.showEditing;
}else{
this.composerUrl+="?parentId="+this.widgetId+"_composerPane"+"&to="+this.to+"&vc="+this.vc+"&siteId="+this.siteId+"&loc="+this.loc+"&groupid="+this.groupid+"&netid="+this.netid+"&sub_level="+this.sub_level+"&showEditing="+this.showEditing;
}
if(this.to!=""){
this.suppressDialogsOnLaunch=true;
}
composer.widget.Composer.superclass.buildRendering.apply(this,arguments);
},postCreate:function(){
this._templateDialog.dialogFrame.style.cssText=this.templateCssStyle;
dojo.event.connect(this._composerPane,"onLoad",this,"_composerLoaded");
dojo.event.topic.subscribe("template.selected",this,"_onTemplateSelected");
dojo.event.topic.subscribe("template.error",this,"_onTemplateError");
dojo.event.topic.subscribe("template.close",this,"closeTemplateDialog");
dojo.event.topic.unsubscribe("answerpattern.onchange",this,"_onAnswerPatternChanged");
dojo.event.topic.subscribe("answerpattern.onchange",this,"_onAnswerPatternChanged");
dojo.event.topic.unsubscribe("templates.showTemplates",this,"_showTemplates");
dojo.event.topic.subscribe("templates.showTemplates",this,"_showTemplates");
this._overlay=dojo.byId("composerOverlay");
if(this.isLoaded){
this._composerLoaded();
}
},_composerLoaded:function(){
this.isLoaded=true;
this.distId=qcGlobal.distId;
this._addressing=dojo.widget.byId(addressingGlobal.addressingWidgetId);
this._msgDialog=dojo.widget.byId(qcGlobal.msgDialogId);
this._confirmDialog=dojo.widget.byId(qcGlobal.confirmDialogId);
this._cuDialog=dojo.widget.byId(qcGlobal.cuDialogId);
this._fuDialog=dojo.widget.byId(qcGlobal.fileUploadDialogId);
this._permissions=dojo.widget.byId(qcGlobal.permissionsWidgetId);
try{
this._delivery=dojo.widget.byId(qcGlobal.deliveryWidgetId);
}
catch(e){
}
this._questionForm=dojo.byId("questionForm");
this._questionFormPane=dojo.widget.byId("questionFormPane");
this._questionHeader=dojo.widget.byId(qcGlobal.qhWidgetId);
this._qtContainer=dojo.widget.byId("qtContainer");
this._distButton=dojo.widget.byId("distButton");
this._saveButton=dojo.widget.byId("saveButton");
this._qtController=dojo.widget.byId("qtController");
this._testItButton=dojo.widget.byId("testItButton");
this._templateButton=dojo.byId("composer_templateButton");
this._optionsExpander=dojo.widget.byId("composer_optionsExpander");
dojo.event.connect(this._addressing,"onError",this,"openErrorDialog");
dojo.event.connect(this._distButton,"onClick",this,"distribute");
dojo.event.connect(this._saveButton,"onClick",this,"_save");
dojo.event.connect(this._testItButton,"onClick",this,"_testIt");
dojo.event.connect(this._questionFormPane,"onData",this,"_handleResponse");
dojo.event.connect(this._questionFormPane,"onError",this,"_handleError");
dojo.event.connect(this._questionHeader._subject,"onSelection",this,"_onReload");
dojo.event.connect(this._confirmDialog,"onOk",this,"onOk");
dojo.event.connect(this._confirmDialog,"onCancel",this,"onCancel");
dojo.event.connect(this._templateDialog,"onLoad",this,"_ieHack");
dojo.event.connect(this._optionsExpander,"onClose",this,"_updateOptionsSettings");
dojo.event.connect(this._optionsExpander,"onExpand",this,"_updateOptionsSettings");
if(this._templateButton){
dojo.event.connect(this._templateButton,"onmousedown",this,"showTemplateDialog");
}
this._announcementSelected(this._qtContainer.selectedChildWidget.questionType.type==qcGlobal.announcement);
this._overlay.style.display="none";
this.domNode.style.height=null;
this.domNode.style.width=null;
this._composerPane.domNode.style.zIndex="";
this._composerPane.domNode.style.position="static";
this._composerPane.domNode.style.visibility="visible";
this._composerPane.domNode.style.display="";
if(this._addressing.isLoading){
dojo.event.connect(this._addressing,"addressingLoaded",this,"_setState");
}else{
this._setState();
}
this.onLoad();
if(this._firstShow){
this._firstShow=false;
if(!this.suppressDialogsOnLaunch&&!this._templateRequest&&!this._draftRequest&&qcGlobal.showTemplateDialog){
this.showTemplateDialog();
}else{
window.setTimeout(function(){
try{
dojo.widget.byId("questionHeader").focus();
}
catch(e){
}
},50);
}
}else{
window.setTimeout(function(){
try{
dojo.widget.byId("questionHeader").focus();
}
catch(e){
}
},50);
}
},showLoading:function(){
this._overlay.style.display="";
this._composerPane.domNode.style.zIndex="";
this._composerPane.domNode.style.position="static";
this._composerPane.domNode.style.visibility="hidden";
this._composerPane.domNode.style.display="none";
},onReload:function(id){
},_onReload:function(msg){
this.editTemplate(msg.id);
this.onReload(msg.id);
},show:function(){
if(!this.isLoaded){
var url=this.composerUrl;
this._load(url,false);
}
},editTemplate:function(_62d){
var url=this.composerUrl;
if(_62d!=null){
url+="&templateId="+_62d;
}
this._load(url);
this._templateRequest=true;
},editDraft:function(_62f){
this._firstShow=false;
var url=this.composerUrl;
if(_62f!=null){
url+="&draftId="+_62f;
this._draftRequest=true;
}
this._load(url);
},_addressingProcessed:function(data){
if(this._delivery){
try{
this._delivery.updateDeliveryCounts(data);
}
catch(e){
}
}
},_load:function(url,_633){
this.isLoaded=false;
var _633=(arguments.length==1)?false:_633;
this.showLoading();
this._destroy();
composer.widget.global.initGlobal();
this._composerPane.cacheContent=_633;
this._composerPane.setUrl(url);
if(_633){
window.setTimeout(dojo.lang.hitch(this._composerPane,"refresh"),10);
}else{
this._composerPane.refresh();
}
this.onLoadStart();
this._templateRequest=false;
},onLoadStart:function(){
},onLoad:function(){
},openAddressingDialog:function(){
if(this._addressing!=null){
this._addressing.openGroupAddressing();
}
},openErrorDialog:function(msg){
this._msgDialog.showError(msg);
},openMsgDialog:function(msg){
this._msgDialog.showMsg(msg);
},openSuccessDialog:function(msg){
this._cuDialog.setTitle("Success");
this._cuDialog.setContent(msg);
this._cuDialog.show();
},isDirty:function(){
return this._isDirty;
},showConfirmDialog:function(msg){
this._confirmDialog.showMsg(msg);
},closeConfirmDialog:function(){
dojo.event.MethodJoinPoint.getForMethod(this._confirmDialog,"onCancel").disconnect();
dojo.event.MethodJoinPoint.getForMethod(this._confirmDialog,"onOk").disconnect();
this._confirmDialog.hide();
},closeMsgDialog:function(){
this._msgDialog.hide();
},_showTemplates:function(_638){
this.showTemplateDialog(_638);
},showTemplateDialog:function(_639){
if(typeof (_639)=="undefined"||(_639==null)){
_639="";
}
this._templateDialog.setUrl(this.templateUrl+"?vc="+this.vc+"&siteId="+this.siteId+"&groupid="+this.groupid+"&loc="+this.loc+"&parentId="+this._templateDialog.widgetId+"&netid="+this.netid+"&sub_level="+this.sub_level+"&templateSection="+_639);
this._templateDialog.show();
this._ieHack();
},closeTemplateDialog:function(){
this._templateDialog.hide();
},distribute:function(){
if(this._addressing.isDirty()){
circleup.widget.utils.lockScreen();
window.setTimeout(dojo.lang.hitch(this,"distribute"),100);
dojo.debug("Composer.distribute : Waiting for response from syntax");
return;
}
if(this._addressing.hasErrors()){
circleup.widget.utils.unlockScreen();
this.openErrorDialog("<span class='label'>Sorry, we cannot send your message.</span><span class='msg_text'>Some addresses were not recognized.<br>Please correct them and try again.</span>");
}else{
if(this._addressing.hasSharedCircles()&&this._addressing.isGroupNameSelected()){
circleup.widget.utils.unlockScreen();
this._confirmSharedCircles();
}else{
this._invoke(this.distributeUrl);
}
}
},save:function(){
this._invoke(this.saveUrl);
},testIt:function(){
this._invoke(this.testItUrl);
},preview:function(){
if(this._addressing.isDirty()){
window.setTimeout(dojo.lang.hitch(this,"preview"),100);
dojo.debug("Composer.preview : Waiting for response from syntax");
return;
}
dojo.widget.byId("previewTab").reset();
dojo.byId("previewDistribution").value=this.asXML();
var form=dojo.byId("previewForm");
form.submit();
},_save:function(){
this._prompt=true;
this.save();
},_testIt:function(){
this._prompt=true;
this.testIt();
},_invoke:function(url){
if(this._addressing.isDirty()){
window.setTimeout(dojo.lang.hitch(this,"_invoke",url),100);
dojo.debug("Composer._invoke : Waiting for response from syntax");
return;
}
dojo.byId("distribution").value=this.asXML();
var form=dojo.byId("questionForm");
this._questionForm.action=url;
this._questionForm.submit();
},_onTemplateSelected:function(evt){
this.closeTemplateDialog();
this._onReload(evt);
},_onTemplateError:function(evt){
this.openErrorDialog(evt.msg);
},_onAnswerPatternChanged:function(type){
try{
this._announcementSelected(type==qcGlobal.announcement);
}
catch(e){
}
},destroy:function(){
this._destroy();
dojo.event.topic.unsubscribe("template.selected",this,"_onTemplateSelected");
dojo.event.topic.unsubscribe("template.error",this,"_onTemplateError");
dojo.event.topic.unsubscribe("template.close",this,"closeTemplateDialog");
dojo.event.topic.unsubscribe("answerpattern.onchange",this,"_onAnswerPatternChanged");
dojo.event.topic.unsubscribe("templates.showTemplates",this,"_showTemplates");
composer.widget.Composer.superclass.destroy.call(this);
},_destroy:function(){
if(this._composerPane.isLoaded){
try{
dojo.event.disconnect(this._addressing,"onError",this,"openErrorDialog");
dojo.event.disconnect(this._distButton,"onClick",this,"distribute");
dojo.event.disconnect(this._saveButton,"onClick",this,"save");
dojo.event.disconnect(this._testItButton,"onClick",this,"testIt");
dojo.event.disconnect(this._questionFormPane,"onData",this,"_handleResponse");
dojo.event.disconnect(this._questionFormPane,"onError",this,"_handleError");
dojo.event.disconnect(this._questionHeader._subject,"onSelection",this,"onReload");
dojo.event.disconnect(this._confirmDialog,"onOk",this,"onOk");
dojo.event.disconnect(this._confirmDialog,"onCancel",this,"onCancel");
if(this._templateButton){
dojo.event.disconnect(this._templateButton,"onmousedown",this,"showTemplateDialog");
}
}
catch(e){
}
}
this._addressing=null;
this._msgDialog=null;
this._cuDialog=null;
this._questionFormPane=null;
this._questionHeader=null;
this._permissions=null;
this._qtController=null;
this._qtContainer=null;
this._distButton=null;
this._fuDialog=null;
this._confirmDialog=null;
this._composerPane.isLoaded=false;
},asXML:function(){
var _640;
if(this._composerPane.isLoaded){
_640="<Distribution distId=\""+this.distId+"\" >";
_640+=this._questionHeader.asXML();
try{
_640+=this._delivery.asXML();
}
catch(e){
}
_640+=this._getOptionsAsXML();
_640+=this._permissions.asXML();
_640+=this._addressing.asXML(SelectOption.SELECTED_NODES_PARENT_CHILDREN);
_640+=this._qtContainer.selectedChildWidget.asXML();
_640+="</Distribution>";
}else{
_640="<Distribution/>";
}
return _640;
},onDistribution:function(_641){
},onSave:function(_642){
},onTestIt:function(_643){
},_handleError:function(type,_645){
var _646=djConfig.unknownErrorMsg;
if(type==BoundedFormErrors.PENDING_REQUEST){
dojo.debug("Composer._handleError : double click");
}else{
if(typeof _645=="undefined"||typeof _645.message=="undefined"){
this.openErrorDialog(_646);
}else{
var msg=_645.message.replace("XMLHttpTransport Error: 403 ","");
if(msg=="OK"){
this.openErrorDialog(_646);
}else{
this.openErrorDialog(msg);
}
}
}
},hasUnsavedChanges:function(){
return (this._composerPane.isLoaded)?this._state!=this.asXML():false;
},_setState:function(){
dojo.event.disconnect(this._addressing,"addressingLoaded",this,"_setState");
this._state=this.asXML();
},_confirmSave:function(){
dojo.event.connect(this._confirmDialog,"onCancel",this,"_onSave");
dojo.event.connect(this._confirmDialog,"onOk",this,"closeConfirmDialog");
this.showConfirmDialog(qcGlobal.saveMsg);
},_confirmTestIt:function(){
dojo.event.connect(this._confirmDialog,"onCancel",this,"_onTestIt");
dojo.event.connect(this._confirmDialog,"onOk",this,"closeConfirmDialog");
this.showConfirmDialog(qcGlobal.testItMsg);
},_confirmSharedCircles:function(){
dojo.event.connect(this._confirmDialog,"onCancel",this,"closeConfirmDialog");
dojo.event.connect(this._confirmDialog,"onOk",dojo.lang.hitch(this,function(){
this.closeConfirmDialog();
this._invoke(this.distributeUrl);
}));
this.showConfirmDialog("<span class='label'>You have selected a shared Circle.</span>"+"<span class='msg_text'>Contacts from a shared Circle won't be added to <b>"+this._addressing.getGroupName()+"</b>.  Do you want to continue?</span>");
},_onSave:function(){
this.closeConfirmDialog();
this.onSave(this.distId);
},_onTestIt:function(){
this.closeConfirmDialog();
this.onTestIt(this.distId);
},_handleResponse:function(data){
var _649=circleup.widget.utils.evalJson(data);
if(_649.rc==="success"){
this._isDirty=true;
this.distId=_649.msg;
this._setState();
switch(_649.action){
case "DISTRIBUTION":
this.onDistribution(this.distId);
break;
case "SAVE_DISTRIBUTION":
if(this._prompt){
this._prompt=false;
this._confirmSave(this.distId);
}else{
this.onSave(this.distId);
}
break;
case "TEST_IT":
if(this._prompt){
this._prompt=false;
this._confirmTestIt(this.distId);
}else{
this.onTestIt(this.distId);
}
break;
default:
dojo.debug("Composer._handleResponse : Unhandled type = "+_649.action);
break;
}
}else{
this._checkServiceFailedResponse(_649);
}
},_checkServiceFailedResponse:function(_64a){
if((typeof _64a.errorCode!=="undefined")&&(_64a.errorCode=="err.paymentprovider.notactivated")){
var _64b=this._qtContainer.selectedChildWidget.questionType;
_64b.lauchPaymentProviderActivationFlow();
dojo.event.connect(_64b,"onEnrollmentSuccess",this,"_enrollmentSuccess");
dojo.event.connect(_64b,"onEnrollmentError",this,"_unsubscribeEnrollment");
dojo.event.connect(_64b,"onEnrollmentAbort",this,"_unsubscribeEnrollment");
}else{
if(typeof _64a.msg!=="undefined"){
this.openErrorDialog(_64a.msg);
}else{
this._handleError();
}
}
},_enrollmentSuccess:function(){
this._unsubscribeEnrollment();
this.distribute();
},_offline:function(){
this._unsubscribePayment();
this.distribute();
},_unsubscribeEnrollment:function(){
var _64c=this._qtContainer.selectedChildWidget.questionType;
dojo.event.disconnect(_64c,"onEnrollmentSuccess",this,"_enrollmentSuccess");
dojo.event.disconnect(_64c,"onEnrollmentError",this,"_unsubscribeEnrollment");
dojo.event.disconnect(_64c,"onEnrollmentAbort",this,"_unsubscribeEnrollment");
},_ieHack:function(){
window.setTimeout(function(){
var div=dojo.byId("qcTemplateQuestions");
if(div!=null){
div.style.display="none";
div.style.display="";
}
},50);
},_getOptionsAsXML:function(){
var _64e="<Options>";
var div=dojo.byId(this.optionsId);
if(div!=null){
var _650=div.getElementsByTagName("fieldset");
dojo.lang.forEach(_650,function(_651){
_64e+="<Group id=\""+_651.id+"\">";
var _652=_651.getElementsByTagName("input");
dojo.lang.forEach(_652,function(_653){
if(dojo.html.hasClass(_653,"composer_Option_Input")&&(typeof _653.disabled=="undefined"||_653.disabled==false)){
var val=(_653.type=="checkbox")?_653.checked:_653.value;
_64e+="<"+_653.name+"><![CDATA["+val+"]]></"+_653.name+">";
}
});
_64e+="</Group>";
});
}
_64e+="</Options>";
return _64e;
},_updateOptionsSettings:function(){
try{
dojo.io.bind({method:"POST",content:{preferenceName:"COMPOSER_OPTIONS_STATE",preferenceVal:this._optionsExpander.isExpanded},url:"/user/updateUserPreference.do"});
}
catch(e){
}
},_announcementSelected:function(_655){
if(_655){
if(this._delivery!=null){
this._delivery.enable();
}
var _656=dojo.byId("composer_OptionsAutoSend");
if(_656){
_656.disabled=true;
var _657=dojo.byId("composer_OptionsAutoSend_label");
_657.style.fontStyle="italic";
_657.style.color="#999999";
}
}else{
if(this._delivery!=null){
this._delivery.disable();
}
var _656=dojo.byId("composer_OptionsAutoSend");
if(_656){
_656.disabled=false;
var _657=dojo.byId("composer_OptionsAutoSend_label");
_657.style.fontStyle="normal";
_657.style.color="";
}
}
}});
dojo.provide("composer.widget.Launcher");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("circleup.widget.Utils");
dojo.require("circleup.widget.CUButton");
var launcherNormalImg=circleup.widget.utils.asset("composer.widget","template/images/ComposerButton_small.normal.gif");
var launcherHoverImg=circleup.widget.utils.asset("composer.widget","template/images/ComposerButton_small.hover.gif");
var launcherSmartPayNormalImg=circleup.widget.utils.asset("composer.widget","template/images/ComposerSmartPayButton_small.normal.gif");
var launcherSmartPayHoverImg=circleup.widget.utils.asset("composer.widget","template/images/ComposerSmartPayButton_small.hover.gif");
var suggestionsImg=circleup.widget.utils.asset("composer.widget","template/images/suggestions.png");
function loadLauncherImages(){
circleup.widget.utils.preloadImages(launcherNormalImg,launcherHoverImg,launcherSmartPayNormalImg,launcherSmartPayHoverImg,suggestionsImg);
for(prop in iconMap){
circleup.widget.utils.preloadImages(djConfig.staticHost+"/assets/default/icons/answerpatterns/16x16/"+iconMap[prop],djConfig.staticHost+"/assets/default/icons/answerpatterns/32x32/"+iconMap[prop]);
}
circleup.widget.utils.preloadImages(djConfig.staticHost+"/assets/default/web/smartpay/btn_smartpay_activate.gif",djConfig.staticHost+"/assets/default/web/widget/universe/icon_cu.png");
}
dojo.addOnLoad(function(){
window.setTimeout(loadLauncherImages,500);
});
dojo.widget.defineWidget("composer.widget.Launcher",dojo.widget.HtmlWidget,{isContainer:true,widgetsInTemplate:true,parseComponents:false,suppressDialogsOnLaunch:false,enableDragging:"true",positioning:"FIXED",showButton:true,to:"",vc:"default",siteId:"CIRCLEUP",groupid:"",loc:"",netid:"",sub_level:"",top:"20px",left:"auto",title:"Compose a SmartMessage",buttonCaption:"New SmartMessage",buttonTheme:djConfig.theme,useButton:false,templateCssStyle:"width:580px;height:492px;",resultsUrl:qcGlobal.resultsUrl,cssStyle:"",distId:"",templateString:"<div style=\"${this.cssStyle}\" \n     dojoattachpoint=\"containerNode\">\n\t<div dojoType=\"circleup:ConfirmDialog\" \n\t     id=\"${this.widgetId}_confirmDialog\"\n\t     widgetId=\"${this.widgetId}_confirmDialog\"\n\t     type=\"yn\"\n\t     dojoAttachPoint=\"_confirmDialog\" \n\t     style=\"display:none;\">\n\t</div>\n\t<img src=\"${this._buttonImgNormal}\" \n\t     style=\"display:none;\"\n\t     onmouseover=\"this.src='${this._buttonImgHover}';this.style.cursor='pointer';\"\n\t     onmouseout=\"this.src='${this._buttonImgNormal}';this.style.cursor='default';\"\n\t     dojoAttachPoint=\"_buttonImg\"/>\n\t<div dojoType=\"circleup:CUButton\"\n\t     id=\"${this.widgetId}_button\"\n\t     widgetId=\"${this.widgetId}_button\"\n\t     style=\"display:none\"\n\t     dojoAttachPoint=\"_button\">${this.buttonCaption}</div>\n\t<div dojoType=\"circleup:CUDialog\" \n\t     id=\"${this.widgetId}_container\"\n\t     widgetId=\"${this.widgetId}_container\"\n\t     bind=\"false\" \n\t     autoHide=\"false\"\n\t     loadingMessage=\"\"\n\t     parseComponents=\"false\"\n\t     preload=\"false\"\n\t     followScroll=\"false\"\n\t     refreshOnShow=\"false\"\n         enableDragging=\"${this.enableDragging}\"\n         positioning=\"${this.positioning}\"\n         top=\"${this.top}\"\n         left=\"${this.left}\"\n         scriptSeparation=\"false\"\n         dialogTitleStr=\"${this.title}\"\n         style=\"display:none;\"\n         deferParsing=\"false\"\n\t     dojoattachpoint=\"_composerContainer\">\n\t</div>\n</div>\n",buttonType:"normal",_buttonImgNormal:launcherNormalImg,_buttonImgHover:launcherHoverImg,_button:null,_buttonImg:null,_composerContainer:null,_composer:null,_confirmDialog:null,buildRendering:function(args,frag){
register(this.widgetId+"_confirmDialog",this.widgetId);
register(this.widgetId+"_container",this.widgetId);
if(this.showButton&&this.useButton){
register(this.widgetId+"_button",this.widgetId);
}
if(this.buttonType=="SmartPay"){
this._buttonImgNormal=launcherSmartPayNormalImg;
this._buttonImgHover=launcherSmartPayHoverImg;
}
composer.widget.Launcher.superclass.buildRendering.apply(this,arguments);
},postMixInProperties:function(args,frag){
if(this.buttonTheme==null){
this.buttonTheme=Themes.CU;
}
dojo.dom.removeChildren(this.getFragNodeRef(frag));
composer.widget.Launcher.superclass.postMixInProperties.call(this,arguments);
},postCreate:function(){
if(this.showButton){
if(this.useButton){
dojo.event.connect(this._button,"onClick",this,"onClick");
}else{
dojo.event.connect(this._buttonImg,"onmousedown",this,"onClick");
this._buttonImg.style.display="";
}
}
dojo.addOnUnload(this,"destroy");
},onShow:function(){
},save:function(){
if(this._composer!=null){
this._composer.save();
}
djConfig.onAnalyticsEvent("EVENT",{"category":"Composer","action":"Save","opt_label":this.title});
},testIt:function(){
if(this._composer!=null){
this._composer.testIt();
}
djConfig.onAnalyticsEvent("EVENT",{"category":"Composer","action":"Test It","opt_label":this.title});
},openErrorDialog:function(msg){
if(this._composer!=null){
this._composer.openErrorDialog(msg);
}
},openMsgDialog:function(msg){
if(this._composer!=null){
this._composer.openMsgDialog(msg);
}
},show:function(){
this.distId="";
this._initComposer();
this._composerContainer.show();
this._composer.show();
this.onShow();
djConfig.onAnalyticsEvent("EVENT",{"category":"Composer","action":"Open","opt_label":this.title});
},editTemplate:function(_65e){
this.distId=_65e;
this._initComposer();
this._composerContainer.show();
this._composer.editTemplate(_65e);
this.onShow();
djConfig.onAnalyticsEvent("EVENT",{"category":"Composer","action":"Edit Template","opt_label":this.distId});
},editDraft:function(_65f){
this.distId=_65f;
this._initComposer();
this._composerContainer.show();
this._composer.editDraft(_65f);
this.onShow();
djConfig.onAnalyticsEvent("EVENT",{"category":"Composer","action":"Edit Draft","opt_label":this.distId});
},hide:function(){
dojo.event.disconnect(this._composerContainer,"onHide",this,"_checkUnsavedChanges");
this._confirmDialog.hide();
if(this._composerContainer.isShowing()){
this._composerContainer.hide();
this.onHide();
}
djConfig.onAnalyticsEvent("EVENT",{"category":"Composer","action":"Close","opt_label":this.title});
},onHide:function(){
},onClick:function(){
this.show();
},onDistribution:function(_660){
this.hide();
},_onDistribution:function(_661){
this.distId=_661;
this.onDistribution(this.distId);
},hasUnsavedChanges:function(){
return this._composer.hasUnsavedChanges();
},isDirty:function(){
return this._composer.isDirty();
},onSave:function(_662){
this.hide();
},_onSave:function(_663){
this.distId=_663;
this.onSave(_663);
},onTestIt:function(_664){
this.hide();
},_onTestIt:function(_665){
this.distId=_665;
this.onTestIt(_665);
},onLoad:function(){
this._composerContainer.onLoad();
},onLoadStart:function(){
this._composerContainer.onResized();
},reset:function(){
this.distId="";
},destroy:function(){
if(this.showButton){
if(this.useButton){
dojo.event.disconnect(this._button,"onClick",this,"onClick");
}else{
dojo.event.disconnect(this._buttonImg,"onmousedown",this,"onClick");
}
}
this._destroyComposer();
if(this._composerContainer!=null){
this._composerContainer.destroy();
this._composerContainer=null;
}
composer.widget.Launcher.superclass.destroy.call(this,arguments);
},_checkUnsavedChanges:function(){
if(this.hasUnsavedChanges()){
dojo.event.connect(this._confirmDialog,"onOk",this,"_saveChanges");
dojo.event.connect(this._confirmDialog,"onCancel",this,"_dontSaveChanges");
this._confirmDialog.showMsg(qcGlobal.unsavedMsg);
}else{
this.hide();
}
},_saveChanges:function(){
dojo.event.disconnect(this._confirmDialog,"onOk",this,"_saveChanges");
dojo.event.disconnect(this._confirmDialog,"onCancel",this,"_dontSaveChanges");
this._confirmDialog.hide();
this.save();
},_dontSaveChanges:function(){
dojo.event.disconnect(this._confirmDialog,"onOk",this,"_saveChanges");
dojo.event.disconnect(this._confirmDialog,"onCancel",this,"_dontSaveChanges");
this.hide();
},_initComposer:function(){
this.onShow();
dojo.event.connect(this._composerContainer,"onHide",this,"_checkUnsavedChanges");
this._destroyComposer();
composer.widget.global.initGlobal();
this._composer=dojo.widget.createWidget("composer:Composer",{widgetId:this.widgetId+"_"+qcGlobal.composerWidgetId,suppressDialogsOnLaunch:this.suppressDialogsOnLaunch,to:this.to,vc:this.vc,siteId:this.siteId,groupid:this.groupid,loc:this.loc,netid:this.netid,sub_level:this.sub_level,templateCssStyle:this.templateCssStyle});
this._composerContainer.addChild(this._composer);
dojo.event.connect(this._composer,"onDistribution",this,"_onDistribution");
dojo.event.connect(this._composer,"onSave",this,"_onSave");
dojo.event.connect(this._composer,"onTestIt",this,"_onTestIt");
dojo.event.connect(this._composer,"onLoadStart",this,"onLoadStart");
dojo.event.connect(this._composer,"onLoad",this,"onLoad");
},_destroyComposer:function(){
if(this._composer!=null){
dojo.event.disconnect(this._composer,"onDistribution",this,"_onDistribution");
dojo.event.disconnect(this._composer,"onSave",this,"_onSave");
dojo.event.disconnect(this._composer,"onTestIt",this,"_onTestIt");
dojo.event.disconnect(this._composer,"onLoad",this,"onLoad");
dojo.event.disconnect(this._composer,"onLoadStart",this,"onLoadStart");
this._composerContainer.removeChild(this._composer);
this._composer.destroy();
this._composer=null;
}
this._isDirty=false;
},_preload:function(){
var _666=qcGlobal.composerUrl;
if(_666.indexOf("?")>0){
_666+="&parentId="+this._getComposerId()+"_composerPane"+"&to="+this.to+"&vc="+this.vc+"&siteId="+this.siteId+"&loc="+this.loc+"&groupid="+this.groupid+"&netid="+this.netid+"&sub_level="+this.sub_level;
}else{
_666+="?parentId="+this._getComposerId()+"_composerPane"+"&to="+this.to+"&vc="+this.vc+"&siteId="+this.siteId+"&loc="+this.loc+"&groupid="+this.groupid+"&netid="+this.netid+"&sub_level="+this.sub_level;
}
_666+="&ts="+djConfig.timeStamp;
dojo.io.bind({url:_666,useCache:true,encoding:"utf-8",preventCache:false,mimetype:"text/html"});
},_getComposerId:function(){
return this.widgetId+"_"+qcGlobal.composerWidgetId;
}});
dojo.provide("composer.widget.EmbeddedLauncher");
dojo.widget.defineWidget("composer.widget.EmbeddedLauncher",composer.widget.Launcher,{templateString:"<div style=\"${this.cssStyle}\" \n     dojoattachpoint=\"containerNode\">\n\t<img src=\"${this._buttonImgNormal}\" \n\t     style=\"display:none;\"\n\t     id=\"${this.widgetId}_img\"\n\t     onmouseover=\"this.src='${this._buttonImgHover}';this.style.cursor='pointer';\"\n\t     onmouseout=\"this.src='${this._buttonImgNormal}';this.style.cursor='default';\"\n\t     dojoAttachPoint=\"_buttonImg\"/>\n\t<div dojoType=\"circleup:CUButton\"\n\t     id=\"${this.widgetId}_button\"\n\t     widgetId=\"${this.widgetId}_button\"\n\t     style=\"display:none\"\n\t     dojoAttachPoint=\"_button\">${this.buttonCaption}</div>\n</div>\n",page:"",composerUrl:"/composer/",vc:"embedded",show:function(){
this._show(this.composerUrl);
},editTemplate:function(_667){
if(this.composerUrl.indexOf("?")>0){
var url=this.composerUrl+"&ts="+new Date().valueOf();
}else{
var url=this.composerUrl+"?ts="+new Date().valueOf();
}
if(_667!=null){
url+="&templateId="+_667;
}
this._show(url);
},editDraft:function(_669){
var url=this.composerUrl+"?ts="+new Date().valueOf();
if(_669!=null){
url+="&draftId="+_669;
}
this._show(url);
},_show:function(url){
this.onShow();
if(url.indexOf("?")>0){
url+="&";
}else{
url+="?";
}
url+="vc="+this.vc+"&siteId="+this.siteId+"&loc="+this.loc+"&groupid="+this.groupid+"&netid="+this.netid+"&sub_level="+this.sub_level;
if(this.page!=""){
url+="&return="+escape(this.page);
}
circleup.widget.utils.redirect(url);
},_getComposerId:function(){
return "questionComposer";
}});
