dojo.provide("dojo.html.util");
dojo.html.getElementWindow=function(_678){
return dojo.html.getDocumentWindow(_678.ownerDocument);
};
dojo.html.getDocumentWindow=function(doc){
if(dojo.render.html.safari&&!doc._parentWindow){
var fix=function(win){
win.document._parentWindow=win;
for(var i=0;i=left&&_68f.x<=_695&&_68f.y>=top&&_68f.y<=_693);
};
dojo.html.renderedTextContent=function(node){
node=dojo.byId(node);
var _697="";
if(node==null){
return _697;
}
for(var i=0;i]/i).test(txt.replace(/^\s+/))){
txt="";
_6a0="cell";
}else{
if((/^]/i).test(txt.replace(/^\s+/))){
txt="";
_6a0="row";
}else{
if((/^<(thead|tbody|tfoot)[\s\r\n>]/i).test(txt.replace(/^\s+/))){
txt="";
_6a0="section";
}
}
}
tn.innerHTML=txt;
if(tn["normalize"]){
tn.normalize();
}
var _6a1=null;
switch(_6a0){
case "cell":
_6a1=tn.getElementsByTagName("tr")[0];
break;
case "row":
_6a1=tn.getElementsByTagName("tbody")[0];
break;
case "section":
_6a1=tn.getElementsByTagName("table")[0];
break;
default:
_6a1=tn;
break;
}
var _6a2=[];
for(var x=0;x<_6a1.childNodes.length;x++){
_6a2.push(_6a1.childNodes[x].cloneNode(true));
}
tn.style.display="none";
dojo.html.destroyNode(tn);
return _6a2;
};
dojo.html.placeOnScreen=function(node,_6a5,_6a6,_6a7,_6a8,_6a9,_6aa){
if(_6a5 instanceof Array||typeof _6a5=="array"){
_6aa=_6a9;
_6a9=_6a8;
_6a8=_6a7;
_6a7=_6a6;
_6a6=_6a5[1];
_6a5=_6a5[0];
}
if(_6a9 instanceof String||typeof _6a9=="string"){
_6a9=_6a9.split(",");
}
if(!isNaN(_6a7)){
_6a7=[Number(_6a7),Number(_6a7)];
}else{
if(!(_6a7 instanceof Array||typeof _6a7=="array")){
_6a7=[0,0];
}
}
var _6ab=dojo.html.getScroll().offset;
var view=dojo.html.getViewport();
node=dojo.byId(node);
var _6ad=node.style.display;
node.style.display="";
var bb=dojo.html.getBorderBox(node);
var w=bb.width;
var h=bb.height;
node.style.display=_6ad;
if(!(_6a9 instanceof Array||typeof _6a9=="array")){
_6a9=["TL"];
}
var _6b1,_6b2,_6b3=Infinity,_6b4;
for(var _6b5=0;_6b5<_6a9.length;++_6b5){
var _6b6=_6a9[_6b5];
var _6b7=true;
var tryX=_6a5-(_6b6.charAt(1)=="L"?0:w)+_6a7[0]*(_6b6.charAt(1)=="L"?1:-1);
var tryY=_6a6-(_6b6.charAt(0)=="T"?0:h)+_6a7[1]*(_6b6.charAt(0)=="T"?1:-1);
if(_6a8){
tryX-=_6ab.x;
tryY-=_6ab.y;
}
if(tryX<0){
tryX=0;
_6b7=false;
}
if(tryY<0){
tryY=0;
_6b7=false;
}
var x=tryX+w;
if(x>view.width){
x=view.width-w;
_6b7=false;
}else{
x=tryX;
}
x=Math.max(_6a7[0],x)+_6ab.x;
var y=tryY+h;
if(y>view.height){
y=view.height-h;
_6b7=false;
}else{
y=tryY;
}
y=Math.max(_6a7[1],y)+_6ab.y;
if(_6b7){
_6b1=x;
_6b2=y;
_6b3=0;
_6b4=_6b6;
break;
}else{
var dist=Math.pow(x-tryX-_6ab.x,2)+Math.pow(y-tryY-_6ab.y,2);
if(_6b3>dist){
_6b3=dist;
_6b1=x;
_6b2=y;
_6b4=_6b6;
}
}
}
if(!_6aa){
node.style.left=_6b1+"px";
node.style.top=_6b2+"px";
}
return {left:_6b1,top:_6b2,x:_6b1,y:_6b2,dist:_6b3,corner:_6b4};
};
dojo.html.placeOnScreenAroundElement=function(node,_6be,_6bf,_6c0,_6c1,_6c2){
var best,_6c4=Infinity;
_6be=dojo.byId(_6be);
var _6c5=_6be.style.display;
_6be.style.display="";
var mb=dojo.html.getElementBox(_6be,_6c0);
var _6c7=mb.width;
var _6c8=mb.height;
var _6c9=dojo.html.getAbsolutePosition(_6be,true,_6c0);
_6be.style.display=_6c5;
for(var _6ca in _6c1){
var pos,_6cc,_6cd;
var _6ce=_6c1[_6ca];
_6cc=_6c9.x+(_6ca.charAt(1)=="L"?0:_6c7);
_6cd=_6c9.y+(_6ca.charAt(0)=="T"?0:_6c8);
pos=dojo.html.placeOnScreen(node,_6cc,_6cd,_6bf,true,_6ce,true);
if(pos.dist==0){
best=pos;
break;
}else{
if(_6c4>pos.dist){
_6c4=pos.dist;
best=pos;
}
}
}
if(!_6c2){
node.style.left=best.left+"px";
node.style.top=best.top+"px";
}
return best;
};
dojo.html.scrollIntoView=function(node){
if(!node){
return;
}
if(dojo.render.html.ie){
if(dojo.html.getBorderBox(node.parentNode).height<=node.parentNode.scrollHeight){
node.scrollIntoView(false);
}
}else{
if(dojo.render.html.mozilla){
node.scrollIntoView(false);
}else{
var _6d0=node.parentNode;
var _6d1=_6d0.scrollTop+dojo.html.getBorderBox(_6d0).height;
var _6d2=node.offsetTop+dojo.html.getMarginBox(node).height;
if(_6d1<_6d2){
_6d0.scrollTop+=(_6d2-_6d1);
}else{
if(_6d0.scrollTop>node.offsetTop){
_6d0.scrollTop-=(_6d0.scrollTop-node.offsetTop);
}
}
}
}
};
dojo.provide("dojo.gfx.color");
dojo.gfx.color.Color=function(r,g,b,a){
if(dojo.lang.isArray(r)){
this.r=r[0];
this.g=r[1];
this.b=r[2];
this.a=r[3]||1;
}else{
if(dojo.lang.isString(r)){
var rgb=dojo.gfx.color.extractRGB(r);
this.r=rgb[0];
this.g=rgb[1];
this.b=rgb[2];
this.a=g||1;
}else{
if(r instanceof dojo.gfx.color.Color){
this.r=r.r;
this.b=r.b;
this.g=r.g;
this.a=r.a;
}else{
this.r=r;
this.g=g;
this.b=b;
this.a=a;
}
}
}
};
dojo.gfx.color.Color.fromArray=function(arr){
return new dojo.gfx.color.Color(arr[0],arr[1],arr[2],arr[3]);
};
dojo.extend(dojo.gfx.color.Color,{toRgb:function(_6d9){
if(_6d9){
return this.toRgba();
}else{
return [this.r,this.g,this.b];
}
},toRgba:function(){
return [this.r,this.g,this.b,this.a];
},toHex:function(){
return dojo.gfx.color.rgb2hex(this.toRgb());
},toCss:function(){
return "rgb("+this.toRgb().join()+")";
},toString:function(){
return this.toHex();
},blend:function(_6da,_6db){
var rgb=null;
if(dojo.lang.isArray(_6da)){
rgb=_6da;
}else{
if(_6da instanceof dojo.gfx.color.Color){
rgb=_6da.toRgb();
}else{
rgb=new dojo.gfx.color.Color(_6da).toRgb();
}
}
return dojo.gfx.color.blend(this.toRgb(),rgb,_6db);
}});
dojo.gfx.color.named={white:[255,255,255],black:[0,0,0],red:[255,0,0],green:[0,255,0],lime:[0,255,0],blue:[0,0,255],navy:[0,0,128],gray:[128,128,128],silver:[192,192,192]};
dojo.gfx.color.blend=function(a,b,_6df){
if(typeof a=="string"){
return dojo.gfx.color.blendHex(a,b,_6df);
}
if(!_6df){
_6df=0;
}
_6df=Math.min(Math.max(-1,_6df),1);
_6df=((_6df+1)/2);
var c=[];
for(var x=0;x<3;x++){
c[x]=parseInt(b[x]+((a[x]-b[x])*_6df));
}
return c;
};
dojo.gfx.color.blendHex=function(a,b,_6e4){
return dojo.gfx.color.rgb2hex(dojo.gfx.color.blend(dojo.gfx.color.hex2rgb(a),dojo.gfx.color.hex2rgb(b),_6e4));
};
dojo.gfx.color.extractRGB=function(_6e5){
var hex="0123456789abcdef";
_6e5=_6e5.toLowerCase();
if(_6e5.indexOf("rgb")==0){
var _6e7=_6e5.match(/rgba*\((\d+), *(\d+), *(\d+)/i);
var ret=_6e7.splice(1,3);
return ret;
}else{
var _6e9=dojo.gfx.color.hex2rgb(_6e5);
if(_6e9){
return _6e9;
}else{
return dojo.gfx.color.named[_6e5]||[255,255,255];
}
}
};
dojo.gfx.color.hex2rgb=function(hex){
var _6eb="0123456789ABCDEF";
var rgb=new Array(3);
if(hex.indexOf("#")==0){
hex=hex.substring(1);
}
hex=hex.toUpperCase();
if(hex.replace(new RegExp("["+_6eb+"]","g"),"")!=""){
return null;
}
if(hex.length==3){
rgb[0]=hex.charAt(0)+hex.charAt(0);
rgb[1]=hex.charAt(1)+hex.charAt(1);
rgb[2]=hex.charAt(2)+hex.charAt(2);
}else{
rgb[0]=hex.substring(0,2);
rgb[1]=hex.substring(2,4);
rgb[2]=hex.substring(4);
}
for(var i=0;i0){
this.duration=_70b;
}
if(_70e){
this.repeatCount=_70e;
}
if(rate){
this.rate=rate;
}
if(_70a){
dojo.lang.forEach(["handler","beforeBegin","onBegin","onEnd","onPlay","onStop","onAnimate"],function(item){
if(_70a[item]){
this.connect(item,_70a[item]);
}
},this);
}
if(_70d&&dojo.lang.isFunction(_70d)){
this.easing=_70d;
}
};
dojo.inherits(dojo.lfx.Animation,dojo.lfx.IAnimation);
dojo.lang.extend(dojo.lfx.Animation,{_startTime:null,_endTime:null,_timer:null,_percent:0,_startRepeatCount:0,play:function(_711,_712){
if(_712){
clearTimeout(this._timer);
this._active=false;
this._paused=false;
this._percent=0;
}else{
if(this._active&&!this._paused){
return this;
}
}
this.fire("handler",["beforeBegin"]);
this.fire("beforeBegin");
if(_711>0){
setTimeout(dojo.lang.hitch(this,function(){
this.play(null,_712);
}),_711);
return this;
}
this._startTime=new Date().valueOf();
if(this._paused){
this._startTime-=(this.duration*this._percent/100);
}
this._endTime=this._startTime+this.duration;
this._active=true;
this._paused=false;
var step=this._percent/100;
var _714=this.curve.getValue(step);
if(this._percent==0){
if(!this._startRepeatCount){
this._startRepeatCount=this.repeatCount;
}
this.fire("handler",["begin",_714]);
this.fire("onBegin",[_714]);
}
this.fire("handler",["play",_714]);
this.fire("onPlay",[_714]);
this._cycle();
return this;
},pause:function(){
clearTimeout(this._timer);
if(!this._active){
return this;
}
this._paused=true;
var _715=this.curve.getValue(this._percent/100);
this.fire("handler",["pause",_715]);
this.fire("onPause",[_715]);
return this;
},gotoPercent:function(pct,_717){
clearTimeout(this._timer);
this._active=true;
this._paused=true;
this._percent=pct;
if(_717){
this.play();
}
return this;
},stop:function(_718){
clearTimeout(this._timer);
var step=this._percent/100;
if(_718){
step=1;
}
var _71a=this.curve.getValue(step);
this.fire("handler",["stop",_71a]);
this.fire("onStop",[_71a]);
this._active=false;
this._paused=false;
return this;
},status:function(){
if(this._active){
return this._paused?"paused":"playing";
}else{
return "stopped";
}
return this;
},_cycle:function(){
clearTimeout(this._timer);
if(this._active){
var curr=new Date().valueOf();
var step=(curr-this._startTime)/(this._endTime-this._startTime);
if(step>=1){
step=1;
this._percent=100;
}else{
this._percent=step*100;
}
if((this.easing)&&(dojo.lang.isFunction(this.easing))){
step=this.easing(step);
}
var _71d=this.curve.getValue(step);
this.fire("handler",["animate",_71d]);
this.fire("onAnimate",[_71d]);
if(step<1){
this._timer=setTimeout(dojo.lang.hitch(this,"_cycle"),this.rate);
}else{
this._active=false;
this.fire("handler",["end"]);
this.fire("onEnd");
if(this.repeatCount>0){
this.repeatCount--;
this.play(null,true);
}else{
if(this.repeatCount==-1){
this.play(null,true);
}else{
if(this._startRepeatCount){
this.repeatCount=this._startRepeatCount;
this._startRepeatCount=0;
}
}
}
}
}
return this;
}});
dojo.lfx.Combine=function(_71e){
dojo.lfx.IAnimation.call(this);
this._anims=[];
this._animsEnded=0;
var _71f=arguments;
if(_71f.length==1&&(dojo.lang.isArray(_71f[0])||dojo.lang.isArrayLike(_71f[0]))){
_71f=_71f[0];
}
dojo.lang.forEach(_71f,function(anim){
this._anims.push(anim);
anim.connect("onEnd",dojo.lang.hitch(this,"_onAnimsEnded"));
},this);
};
dojo.inherits(dojo.lfx.Combine,dojo.lfx.IAnimation);
dojo.lang.extend(dojo.lfx.Combine,{_animsEnded:0,play:function(_721,_722){
if(!this._anims.length){
return this;
}
this.fire("beforeBegin");
if(_721>0){
setTimeout(dojo.lang.hitch(this,function(){
this.play(null,_722);
}),_721);
return this;
}
if(_722||this._anims[0].percent==0){
this.fire("onBegin");
}
this.fire("onPlay");
this._animsCall("play",null,_722);
return this;
},pause:function(){
this.fire("onPause");
this._animsCall("pause");
return this;
},stop:function(_723){
this.fire("onStop");
this._animsCall("stop",_723);
return this;
},_onAnimsEnded:function(){
this._animsEnded++;
if(this._animsEnded>=this._anims.length){
this.fire("onEnd");
}
return this;
},_animsCall:function(_724){
var args=[];
if(arguments.length>1){
for(var i=1;i0){
setTimeout(dojo.lang.hitch(this,function(){
this.play(null,_730);
}),_72f);
return this;
}
if(_731){
if(this._currAnim==0){
this.fire("handler",["begin",this._currAnim]);
this.fire("onBegin",[this._currAnim]);
}
this.fire("onPlay",[this._currAnim]);
_731.play(null,_730);
}
return this;
},pause:function(){
if(this._anims[this._currAnim]){
this._anims[this._currAnim].pause();
this.fire("onPause",[this._currAnim]);
}
return this;
},playPause:function(){
if(this._anims.length==0){
return this;
}
if(this._currAnim==-1){
this._currAnim=0;
}
var _732=this._anims[this._currAnim];
if(_732){
if(!_732._active||_732._paused){
this.play();
}else{
this.pause();
}
}
return this;
},stop:function(){
var _733=this._anims[this._currAnim];
if(_733){
_733.stop();
this.fire("onStop",[this._currAnim]);
}
return _733;
},_playNext:function(){
if(this._currAnim==-1||this._anims.length==0){
return this;
}
this._currAnim++;
if(this._anims[this._currAnim]){
this._anims[this._currAnim].play(null,true);
}
return this;
}});
dojo.lfx.combine=function(_734){
var _735=arguments;
if(dojo.lang.isArray(arguments[0])){
_735=arguments[0];
}
if(_735.length==1){
return _735[0];
}
return new dojo.lfx.Combine(_735);
};
dojo.lfx.chain=function(_736){
var _737=arguments;
if(dojo.lang.isArray(arguments[0])){
_737=arguments[0];
}
if(_737.length==1){
return _737[0];
}
return new dojo.lfx.Chain(_737);
};
dojo.provide("dojo.html.color");
dojo.html.getBackgroundColor=function(node){
node=dojo.byId(node);
var _739;
do{
_739=dojo.html.getStyle(node,"background-color");
if(_739.toLowerCase()=="rgba(0, 0, 0, 0)"){
_739="transparent";
}
if(node==document.getElementsByTagName("body")[0]){
node=null;
break;
}
node=node.parentNode;
}while(node&&dojo.lang.inArray(["transparent",""],_739));
if(_739=="transparent"){
_739=[255,255,255,0];
}else{
_739=dojo.gfx.color.extractRGB(_739);
}
return _739;
};
dojo.provide("dojo.lfx.html");
dojo.lfx.html._byId=function(_73a){
if(!_73a){
return [];
}
if(dojo.lang.isArrayLike(_73a)){
if(!_73a.alreadyChecked){
var n=[];
dojo.lang.forEach(_73a,function(node){
n.push(dojo.byId(node));
});
n.alreadyChecked=true;
return n;
}else{
return _73a;
}
}else{
var n=[];
n.push(dojo.byId(_73a));
n.alreadyChecked=true;
return n;
}
};
dojo.lfx.html.propertyAnimation=function(_73d,_73e,_73f,_740,_741){
_73d=dojo.lfx.html._byId(_73d);
var _742={"propertyMap":_73e,"nodes":_73d,"duration":_73f,"easing":_740||dojo.lfx.easeDefault};
var _743=function(args){
if(args.nodes.length==1){
var pm=args.propertyMap;
if(!dojo.lang.isArray(args.propertyMap)){
var parr=[];
for(var _747 in pm){
pm[_747].property=_747;
parr.push(pm[_747]);
}
pm=args.propertyMap=parr;
}
dojo.lang.forEach(pm,function(prop){
if(dj_undef("start",prop)){
if(prop.property!="opacity"){
prop.start=parseInt(dojo.html.getComputedStyle(args.nodes[0],prop.property));
}else{
prop.start=dojo.html.getOpacity(args.nodes[0]);
}
}
});
}
};
var _749=function(_74a){
var _74b=[];
dojo.lang.forEach(_74a,function(c){
_74b.push(Math.round(c));
});
return _74b;
};
var _74d=function(n,_74f){
n=dojo.byId(n);
if(!n||!n.style){
return;
}
for(var s in _74f){
try{
if(s=="opacity"){
dojo.html.setOpacity(n,_74f[s]);
}else{
n.style[s]=_74f[s];
}
}
catch(e){
dojo.debug(e);
}
}
};
var _751=function(_752){
this._properties=_752;
this.diffs=new Array(_752.length);
dojo.lang.forEach(_752,function(prop,i){
if(dojo.lang.isFunction(prop.start)){
prop.start=prop.start(prop,i);
}
if(dojo.lang.isFunction(prop.end)){
prop.end=prop.end(prop,i);
}
if(dojo.lang.isArray(prop.start)){
this.diffs[i]=null;
}else{
if(prop.start instanceof dojo.gfx.color.Color){
prop.startRgb=prop.start.toRgb();
prop.endRgb=prop.end.toRgb();
}else{
this.diffs[i]=prop.end-prop.start;
}
}
},this);
this.getValue=function(n){
var ret={};
dojo.lang.forEach(this._properties,function(prop,i){
var _759=null;
if(dojo.lang.isArray(prop.start)){
}else{
if(prop.start instanceof dojo.gfx.color.Color){
_759=(prop.units||"rgb")+"(";
for(var j=0;j3){
_7ce.pop();
}
var rgb=new dojo.gfx.color.Color(_7c8);
var _7d3=new dojo.gfx.color.Color(_7ce);
var anim=dojo.lfx.propertyAnimation(node,{"background-color":{start:rgb,end:_7d3}},_7c9,_7ca,{"beforeBegin":function(){
if(_7d0){
node.style.backgroundImage="none";
}
node.style.backgroundColor="rgb("+rgb.toRgb().join(",")+")";
},"onEnd":function(){
if(_7d0){
node.style.backgroundImage=_7d0;
}
if(_7d1){
node.style.backgroundColor="transparent";
}
if(_7cb){
_7cb(node,anim);
}
}});
_7cc.push(anim);
});
return dojo.lfx.combine(_7cc);
};
dojo.lfx.html.unhighlight=function(_7d5,_7d6,_7d7,_7d8,_7d9){
_7d5=dojo.lfx.html._byId(_7d5);
var _7da=[];
dojo.lang.forEach(_7d5,function(node){
var _7dc=new dojo.gfx.color.Color(dojo.html.getBackgroundColor(node));
var rgb=new dojo.gfx.color.Color(_7d6);
var _7de=dojo.html.getStyle(node,"background-image");
var anim=dojo.lfx.propertyAnimation(node,{"background-color":{start:_7dc,end:rgb}},_7d7,_7d8,{"beforeBegin":function(){
if(_7de){
node.style.backgroundImage="none";
}
node.style.backgroundColor="rgb("+_7dc.toRgb().join(",")+")";
},"onEnd":function(){
if(_7d9){
_7d9(node,anim);
}
}});
_7da.push(anim);
});
return dojo.lfx.combine(_7da);
};
dojo.lang.mixin(dojo.lfx,dojo.lfx.html);
dojo.provide("dojo.lfx.*");
dojo.provide("dojo.lfx.toggle");
dojo.lfx.toggle.plain={show:function(node,_7e1,_7e2,_7e3){
dojo.html.show(node);
if(dojo.lang.isFunction(_7e3)){
_7e3();
}
},hide:function(node,_7e5,_7e6,_7e7){
dojo.html.hide(node);
if(dojo.lang.isFunction(_7e7)){
_7e7();
}
}};
dojo.lfx.toggle.fade={show:function(node,_7e9,_7ea,_7eb){
dojo.lfx.fadeShow(node,_7e9,_7ea,_7eb).play();
},hide:function(node,_7ed,_7ee,_7ef){
dojo.lfx.fadeHide(node,_7ed,_7ee,_7ef).play();
}};
dojo.lfx.toggle.wipe={show:function(node,_7f1,_7f2,_7f3){
dojo.lfx.wipeIn(node,_7f1,_7f2,_7f3).play();
},hide:function(node,_7f5,_7f6,_7f7){
dojo.lfx.wipeOut(node,_7f5,_7f6,_7f7).play();
}};
dojo.lfx.toggle.explode={show:function(node,_7f9,_7fa,_7fb,_7fc){
dojo.lfx.explode(_7fc||{x:0,y:0,width:0,height:0},node,_7f9,_7fa,_7fb).play();
},hide:function(node,_7fe,_7ff,_800,_801){
dojo.lfx.implode(node,_801||{x:0,y:0,width:0,height:0},_7fe,_7ff,_800).play();
}};
dojo.provide("dojo.widget.HtmlWidget");
dojo.declare("dojo.widget.HtmlWidget",dojo.widget.DomWidget,{templateCssPath:null,templatePath:null,lang:"",toggle:"plain",toggleDuration:150,initialize:function(args,frag){
},postMixInProperties:function(args,frag){
if(this.lang===""){
this.lang=null;
}
this.toggleObj=dojo.lfx.toggle[this.toggle.toLowerCase()]||dojo.lfx.toggle.plain;
},createNodesFromText:function(txt,wrap){
return dojo.html.createNodesFromText(txt,wrap);
},destroyRendering:function(_808){
try{
if(this.bgIframe){
this.bgIframe.remove();
delete this.bgIframe;
}
if(!_808&&this.domNode){
dojo.event.browser.clean(this.domNode);
}
dojo.html.destroyNode(this.domNode);
delete this.domNode;
}
catch(e){
}
},isShowing:function(){
return dojo.html.isShowing(this.domNode);
},toggleShowing:function(){
if(this.isShowing()){
this.hide();
}else{
this.show();
}
},show:function(){
if(this.isShowing()){
return;
}
this.animationInProgress=true;
this.toggleObj.show(this.domNode,this.toggleDuration,null,dojo.lang.hitch(this,this.onShow),this.explodeSrc);
},onShow:function(){
this.animationInProgress=false;
this.checkSize();
},hide:function(){
if(!this.isShowing()){
return;
}
this.animationInProgress=true;
this.toggleObj.hide(this.domNode,this.toggleDuration,null,dojo.lang.hitch(this,this.onHide),this.explodeSrc);
},onHide:function(){
this.animationInProgress=false;
},_isResized:function(w,h){
if(!this.isShowing()){
return false;
}
var wh=dojo.html.getMarginBox(this.domNode);
var _80c=w||wh.width;
var _80d=h||wh.height;
if(this.width==_80c&&this.height==_80d){
return false;
}
this.width=_80c;
this.height=_80d;
return true;
},checkSize:function(){
if(!this._isResized()){
return;
}
this.onResized();
},resizeTo:function(w,h){
dojo.html.setMarginBox(this.domNode,{width:w,height:h});
if(this.isShowing()){
this.onResized();
}
},resizeSoon:function(){
if(this.isShowing()){
dojo.lang.setTimeout(this,this.onResized,0);
}
},onResized:function(){
dojo.lang.forEach(this.children,function(_810){
if(_810.checkSize){
_810.checkSize();
}
});
}});
dojo.provide("dojo.widget.*");
dojo.provide("dojo.AdapterRegistry");
dojo.AdapterRegistry=function(_811){
this.pairs=[];
this.returnWrappers=_811||false;
};
dojo.lang.extend(dojo.AdapterRegistry,{register:function(name,_813,wrap,_815,_816){
var type=(_816)?"unshift":"push";
this.pairs[type]([name,_813,wrap,_815]);
},match:function(){
for(var i=0;i=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 _828=this.getFunctionFromArgs(cb,cbfn);
if(arguments.length>2){
_828=dojo.lang.curryArguments(null,_828,arguments,2);
}
return this.addCallbacks(_828,_828);
},addCallback:function(cb,cbfn){
var _82b=this.getFunctionFromArgs(cb,cbfn);
if(arguments.length>2){
_82b=dojo.lang.curryArguments(null,_82b,arguments,2);
}
return this.addCallbacks(_82b,null);
},addErrback:function(cb,cbfn){
var _82e=this.getFunctionFromArgs(cb,cbfn);
if(arguments.length>2){
_82e=dojo.lang.curryArguments(null,_82e,arguments,2);
}
return this.addCallbacks(null,_82e);
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 _831=this.chain;
var _832=this.fired;
var res=this.results[_832];
var self=this;
var cb=null;
while(_831.length>0&&this.paused==0){
var pair=_831.shift();
var f=pair[_832];
if(f==null){
continue;
}
try{
res=f(res);
_832=((res instanceof Error)?1:0);
if(res instanceof dojo.Deferred){
cb=function(res){
self._continue(res);
};
this._pause();
}
}
catch(err){
_832=1;
res=err;
}
}
this.fired=_832;
this.results[_832]=res;
if((cb)&&(this.paused)){
res.addBoth(cb);
}
}});
dojo.provide("dojo.dnd.DragAndDrop");
dojo.declare("dojo.dnd.DragSource",null,{type:"",onDragEnd:function(){
},onDragStart:function(){
},onSelected:function(){
},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(){
},onDragMove:function(){
},onDragOver:function(){
},onDragOut:function(){
},onDragEnd:function(){
},onDragLeave:this.onDragOut,onDragEnter:this.onDragOver,ondragout:this.onDragOut,ondragover:this.onDragOver});
dojo.declare("dojo.dnd.DropTarget",null,{acceptsType:function(type){
if(!dojo.lang.inArray(this.acceptedTypes,"*")){
if(!dojo.lang.inArray(this.acceptedTypes,type)){
return false;
}
}
return true;
},accepts:function(_83b){
if(!dojo.lang.inArray(this.acceptedTypes,"*")){
for(var i=0;i<_83b.length;i++){
if(!dojo.lang.inArray(this.acceptedTypes,_83b[i].type)){
return false;
}
}
}
return true;
},unregister:function(){
dojo.dnd.dragManager.unregisterDropTarget(this);
},onDragOver:function(){
},onDragOut:function(){
},onDragMove:function(){
},onDropStart:function(){
},onDrop:function(){
},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(){
},dropTargets:[],registerDropTarget:function(){
},lastDragTarget:null,currentDragTarget:null,onKeyDown:function(){
},onMouseOut:function(){
},onMouseMove:function(){
},onMouseUp:function(){
}});
dojo.provide("dojo.dnd.HtmlDragManager");
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:[],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 _840=dp+"Idx_"+(this.dsCounter++);
ds.dragSourceId=_840;
this.dragSources[_840]=ds;
ds.domNode.setAttribute(dp,_840);
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 _843=ds.dragSourceId;
delete ds.dragSourceId;
delete this.dragSources[_843];
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 _846=dojo.lang.find(this.dropTargets,dt,true);
if(_846>=0){
this.dropTargets.splice(_846,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 _84c=e.target.nodeType==dojo.html.TEXT_NODE?e.target.parentNode:e.target;
if(dojo.html.isTag(_84c,"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,_84f){
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(_850){
var ret=null;
if(!_850){
return;
}
if(this.currentDropTarget){
e.dragObject=_850;
var ce=this.currentDropTarget.domNode.childNodes;
if(ce.length>0){
e.dropTarget=ce[0];
while(e.dropTarget==_850.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{
_850.dragSource.onDragEnd(e);
}
catch(err){
var _853={};
for(var i in e){
if(i=="type"){
_853.type="mouseup";
continue;
}
_853[i]=e[i];
}
_850.dragSource.onDragEnd(_853);
}
},function(){
_850.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;ithis.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(_863){
if(!_863){
return;
}
var tdo=_863.onDragStart(e);
if(tdo){
tdo.onDragStart(e);
tdo.dragOffset.y+=dy;
tdo.dragOffset.x+=dx;
tdo.dragSource=_863;
this.dragObjects.push(tdo);
}
},this);
this.previousDropTarget=null;
this.cacheTargetLocations();
}
dojo.lang.forEach(this.dragObjects,function(_865){
if(_865){
_865.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 _868=this.findBestTarget(e);
if(_868.target===null){
if(this.currentDropTarget){
this.currentDropTarget.onDragOut(e);
this.previousDropTarget=this.currentDropTarget;
this.currentDropTarget=null;
}
this.dropAcceptable=false;
return;
}
if(this.currentDropTarget!==_868.target){
if(this.currentDropTarget){
this.previousDropTarget=this.currentDropTarget;
this.currentDropTarget.onDragOut(e);
}
this.currentDropTarget=_868.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 _86a=this;
var _86b=new Object();
_86b.target=null;
_86b.points=null;
dojo.lang.every(this.dropTargetDimensions,function(_86c){
if(!_86a.isInsideBox(e,_86c)){
return true;
}
_86b.target=_86c[2];
_86b.points=_86c;
return Boolean(_86a.nestedTargets);
});
return _86b;
},isInsideBox:function(e,_86e){
if((e.pageX>_86e[0][0])&&(e.pageX<_86e[1][0])&&(e.pageY>_86e[0][1])&&(e.pageY<_86e[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.provide("dojo.html.selection");
dojo.html.selectionType={NONE:0,TEXT:1,CONTROL:2};
dojo.html.clearSelection=function(){
var _873=dojo.global();
var _874=dojo.doc();
try{
if(_873["getSelection"]){
if(dojo.render.html.safari){
_873.getSelection().collapse();
}else{
_873.getSelection().removeAllRanges();
}
}else{
if(_874.selection){
if(_874.selection.empty){
_874.selection.empty();
}else{
if(_874.selection.clear){
_874.selection.clear();
}
}
}
}
return true;
}
catch(e){
dojo.debug(e);
return false;
}
};
dojo.html.disableSelection=function(_875){
_875=dojo.byId(_875)||dojo.body();
var h=dojo.render.html;
if(h.mozilla){
_875.style.MozUserSelect="none";
}else{
if(h.safari){
_875.style.KhtmlUserSelect="none";
}else{
if(h.ie){
_875.unselectable="on";
}else{
return false;
}
}
}
return true;
};
dojo.html.enableSelection=function(_877){
_877=dojo.byId(_877)||dojo.body();
var h=dojo.render.html;
if(h.mozilla){
_877.style.MozUserSelect="";
}else{
if(h.safari){
_877.style.KhtmlUserSelect="";
}else{
if(h.ie){
_877.unselectable="off";
}else{
return false;
}
}
}
return true;
};
dojo.html.selectInputText=function(_879){
var _87a=dojo.global();
var _87b=dojo.doc();
_879=dojo.byId(_879);
if(_87b["selection"]&&dojo.body()["createTextRange"]){
var _87c=_879.createTextRange();
_87c.moveStart("character",0);
_87c.moveEnd("character",_879.value.length);
_87c.select();
}else{
if(_87a["getSelection"]){
var _87d=_87a.getSelection();
_879.setSelectionRange(0,_879.value.length);
}
}
_879.focus();
};
dojo.lang.mixin(dojo.html.selection,{getType:function(){
if(dojo.doc()["selection"]){
return dojo.html.selectionType[dojo.doc().selection.type.toUpperCase()];
}else{
var _87e=dojo.html.selectionType.TEXT;
var oSel;
try{
oSel=dojo.global().getSelection();
}
catch(e){
}
if(oSel&&oSel.rangeCount==1){
var _880=oSel.getRangeAt(0);
if(_880.startContainer==_880.endContainer&&(_880.endOffset-_880.startOffset)==1&&_880.startContainer.nodeType!=dojo.dom.TEXT_NODE){
_87e=dojo.html.selectionType.CONTROL;
}
}
return _87e;
}
},isCollapsed:function(){
var _881=dojo.global();
var _882=dojo.doc();
if(_882["selection"]){
return _882.selection.createRange().text=="";
}else{
if(_881["getSelection"]){
var _883=_881.getSelection();
if(dojo.lang.isString(_883)){
return _883=="";
}else{
return _883.isCollapsed||_883.toString()=="";
}
}
}
},getSelectedElement:function(){
if(dojo.html.selection.getType()==dojo.html.selectionType.CONTROL){
if(dojo.doc()["selection"]){
var _884=dojo.doc().selection.createRange();
if(_884&&_884.item){
return dojo.doc().selection.createRange().item(0);
}
}else{
var _885=dojo.global().getSelection();
return _885.anchorNode.childNodes[_885.anchorOffset];
}
}
},getParentElement:function(){
if(dojo.html.selection.getType()==dojo.html.selectionType.CONTROL){
var p=dojo.html.selection.getSelectedElement();
if(p){
return p.parentNode;
}
}else{
if(dojo.doc()["selection"]){
return dojo.doc().selection.createRange().parentElement();
}else{
var _887=dojo.global().getSelection();
if(_887){
var node=_887.anchorNode;
while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE){
node=node.parentNode;
}
return node;
}
}
}
},getSelectedText:function(){
if(dojo.doc()["selection"]){
if(dojo.html.selection.getType()==dojo.html.selectionType.CONTROL){
return null;
}
return dojo.doc().selection.createRange().text;
}else{
var _889=dojo.global().getSelection();
if(_889){
return _889.toString();
}
}
},getSelectedHtml:function(){
if(dojo.doc()["selection"]){
if(dojo.html.selection.getType()==dojo.html.selectionType.CONTROL){
return null;
}
return dojo.doc().selection.createRange().htmlText;
}else{
var _88a=dojo.global().getSelection();
if(_88a&&_88a.rangeCount){
var frag=_88a.getRangeAt(0).cloneContents();
var div=document.createElement("div");
div.appendChild(frag);
return div.innerHTML;
}
return null;
}
},hasAncestorElement:function(_88d){
return (dojo.html.selection.getAncestorElement.apply(this,arguments)!=null);
},getAncestorElement:function(_88e){
var node=dojo.html.selection.getSelectedElement()||dojo.html.selection.getParentElement();
while(node){
if(dojo.html.selection.isTag(node,arguments).length>0){
return node;
}
node=node.parentNode;
}
return null;
},isTag:function(node,tags){
if(node&&node.tagName){
for(var i=0;i";
this.iframe=dojo.doc().createElement(html);
this.iframe.tabIndex=-1;
if(node){
node.appendChild(this.iframe);
this.domNode=node;
}else{
dojo.body().appendChild(this.iframe);
this.iframe.style.display="none";
}
}
};
dojo.lang.extend(dojo.html.BackgroundIframe,{iframe:null,onResized:function(){
if(this.iframe&&this.domNode&&this.domNode.parentNode){
var _8b0=dojo.html.getMarginBox(this.domNode);
if(_8b0.width==0||_8b0.height==0){
dojo.lang.setTimeout(this,this.onResized,100);
return;
}
this.iframe.style.width=_8b0.width+"px";
this.iframe.style.height=_8b0.height+"px";
}
},size:function(node){
if(!this.iframe){
return;
}
var _8b2=dojo.html.toCoordinateObject(node,true,dojo.html.boxSizing.BORDER_BOX);
with(this.iframe.style){
width=_8b2.width+"px";
height=_8b2.height+"px";
left=_8b2.left+"px";
top=_8b2.top+"px";
}
},setZIndex:function(node){
if(!this.iframe){
return;
}
if(dojo.dom.isNode(node)){
this.iframe.style.zIndex=dojo.html.getStyle(node,"z-index")-1;
}else{
if(!isNaN(node)){
this.iframe.style.zIndex=node;
}
}
},show:function(){
if(this.iframe){
this.iframe.style.display="block";
}
},hide:function(){
if(this.iframe){
this.iframe.style.display="none";
}
},remove:function(){
if(this.iframe){
dojo.html.removeNode(this.iframe,true);
delete this.iframe;
this.iframe=null;
}
}});
dojo.provide("dojo.dnd.HtmlDragAndDrop");
dojo.declare("dojo.dnd.HtmlDragSource",dojo.dnd.DragSource,{dragClass:"",onDragStart:function(){
var _8b4=new dojo.dnd.HtmlDragObject(this.dragObject,this.type);
if(this.dragClass){
_8b4.dragClass=this.dragClass;
}
if(this.constrainToContainer){
_8b4.constrainTo(this.constrainingContainer||this.domNode.parentNode);
}
return _8b4;
},setDragHandle:function(node){
node=dojo.byId(node);
dojo.dnd.dragManager.unregisterDragSource(this);
this.domNode=node;
dojo.dnd.dragManager.registerDragSource(this);
},setDragTarget:function(node){
this.dragObject=node;
},constrainTo:function(_8b7){
this.constrainToContainer=true;
if(_8b7){
this.constrainingContainer=_8b7;
}
},onSelected:function(){
for(var i=0;ithis.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 _8da=dojo.html.getAbsolutePosition(this.dragClone,true);
var _8db={left:this.dragStartPosition.x+1,top:this.dragStartPosition.y+1};
var anim=dojo.lfx.slideTo(this.dragClone,_8db,500,dojo.lfx.easeOut);
var _8dd=this;
dojo.event.connect(anim,"onEnd",function(e){
dojo.lang.setTimeout(function(){
dojo.html.removeNode(_8dd.dragClone);
_8dd.dragClone=null;
},200);
});
anim.play();
break;
}
dojo.event.topic.publish("dragEnd",{source:this});
},constrainTo:function(_8df){
this.constrainToContainer=true;
if(_8df){
this.constrainingContainer=_8df;
}else{
this.constrainingContainer=this.domNode.parentNode;
}
}},function(node,type){
this.domNode=dojo.byId(node);
this.type=type;
this.constrainToContainer=false;
this.dragSource=null;
this.register();
});
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,_8e4;i=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,_8eb){
var i=this._getNodeUnderMouse(e);
if(!this.dropIndicator){
this.createDropIndicator();
}
var _8ed=this.vertical?dojo.html.gravity.WEST:dojo.html.gravity.NORTH;
var hide=false;
if(i<0){
if(this.childBoxes.length){
var _8ef=(dojo.html.gravity(this.childBoxes[0].node,e)&_8ed);
if(_8ef){
hide=true;
}
}else{
var _8ef=true;
}
}else{
var _8f0=this.childBoxes[i];
var _8ef=(dojo.html.gravity(_8f0.node,e)&_8ed);
if(_8f0.node===_8eb[0].dragSource.domNode){
hide=true;
}else{
var _8f1=_8ef?(i>0?this.childBoxes[i-1]:_8f0):(i]*>([\s\S]*?)<\/title>/i;
while(_971=_97b.exec(s)){
_96e.push(_971[1]);
s=s.substring(0,_971.index)+s.substr(_971.index+_971[0].length);
}
if(this.adjustPaths){
var _97c=/<[a-z][a-z0-9]*[^>]*\s(?:(?:src|href|style)=[^>])+[^>]*>/i;
var _97d=/\s(src|href|style)=(['"]?)([\w()\[\]\/.,\\'"-:;#=&?\s@]+?)\2/i;
var _97e=/^(?:[#]|(?:(?:https?|ftps?|file|javascript|mailto|news):))/;
while(tag=_97c.exec(s)){
str+=s.substring(0,tag.index);
s=s.substring((tag.index+tag[0].length),s.length);
tag=tag[0];
_978="";
while(attr=_97d.exec(tag)){
path="";
_97a=attr[3];
switch(attr[1].toLowerCase()){
case "src":
case "href":
if(_97e.exec(_97a)){
path=_97a;
}else{
path=(new dojo.uri.Uri(url,_97a).toString());
}
break;
case "style":
path=dojo.html.fixPathsInCssText(_97a,url);
break;
default:
path=_97a;
}
fix=" "+attr[1]+"="+attr[2]+path+attr[2];
_978+=tag.substring(0,attr.index)+fix;
tag=tag.substring((attr.index+attr[0].length),tag.length);
}
str+=_978+tag;
}
s=str+s;
}
_97b=/(?:<(style)[^>]*>([\s\S]*?)<\/style>|]*rel=['"]?stylesheet['"]?[^>]*)>)/i;
while(_971=_97b.exec(s)){
if(_971[1]&&_971[1].toLowerCase()=="style"){
_974.push(dojo.html.fixPathsInCssText(_971[2],url));
}else{
if(attr=_971[3].match(/href=(['"]?)([^'">]*)\1/i)){
_974.push({path:attr[2]});
}
}
s=s.substring(0,_971.index)+s.substr(_971.index+_971[0].length);
}
var _97b=/")+"XXEDITOR_SCRIPTXX\">";
}). replace(/<\/object>/gi,String.fromCharCode(0xed)).
replace(/
\n";
}
}
dojo.widget.Editor2Plugin.TableOperation._reinsertTable(this._editor,_b48,Math.max(_b45-1,0),_b44.cellIndex);
}
},getText:function(){
return "Delete Row";
}});
dojo.lang.declare("dojo.widget.Editor2Plugin.insertcolafterCommand",dojo.widget.Editor2Command,{execute:function(){
dojo.widget.Editor2Plugin.TableOperation._insertCol(this._editor,true);
},getText:function(){
return "Insert Column After";
}});
dojo.lang.declare("dojo.widget.Editor2Plugin.insertcolbeforeCommand",dojo.widget.Editor2Command,{execute:function(){
dojo.widget.Editor2Plugin.TableOperation._insertCol(this._editor,false);
},getText:function(){
return "Insert Column Before";
}});
dojo.lang.declare("dojo.widget.Editor2Plugin.deletecolsCommand",dojo.widget.Editor2Command,{execute:function(){
var _b52=dojo.withGlobal(this._editor.window,"getAncestorElement",dojo.html.selection,["td","th"]);
if(_b52!=null){
var _b53=dojo.withGlobal(this._editor.window,"getAncestorElement",dojo.html.selection,["table"]);
var _b54=_b52.parentNode.rowIndex;
var _b55=dojo.widget.Editor2Plugin.TableOperation._cellColumnNumber(_b53,_b52);
if(dojo.widget.Editor2Plugin.TableOperation._countColumns(_b53)<2){
alert("Cannot delete the last column!");
return;
}
var _b56="";
var rows=_b53.rows;
var cs,rs,_b5a,_b5b=[];
for(var nrow=0;nrow\n";
var _b5d=dojo.widget.Editor2Plugin.TableOperation._getCellChildren(rows[nrow]);
for(var i=0;i<_b5d.length;i++){
cs=_b5d[i].colSpan;
rs=_b5d[i].rowSpan;
_b5a=_b5d[i].cellIndex;
if(_b5b[nrow]!=-1){
if(_b5b[nrow]!=undefined){
_b5a+=_b5b[nrow];
}
if(_b5a<=_b55&&_b5a+cs>_b55){
cs--;
}
if(_b5a<_b55){
for(var j=1;j\n";
}
dojo.widget.Editor2Plugin.TableOperation._reinsertTable(this._editor,_b56,_b54,Math.max(_b52.cellIndex-1,0));
}
},getText:function(){
return "Delete Column";
}});
dojo.lang.declare("dojo.widget.Editor2Plugin.mergecellsCommand", dojo.widget.Editor2Command, {
execute: function(){
var table = dojo.withGlobal(this._editor.window, "getAncestorElement", dojo.html.selection, ['table']);
var sel, mergingCell, selWidth=0, selHeight=0, rownum=-1,i,j,k,colnum=0;
if (dojo.render.html.moz) {
sel=this._editor.window.getSelection();
var xx;
i=0;
try {
while(range= sel.getRangeAt(i++)) {
var cell = range.startContainer.childNodes[range.startOffset];
if(cell.nodeName.toLowerCase().match(/^t[dh]$/)) {
xx=dojo.widget.Editor2Plugin.TableOperation._cellColumnNumber(table,cell);
if(rownum==-1) {rownum=cell.parentNode.rowIndex;colnum=xx;} else {
colnum=Math.min(colnum,xx);
rownum=Math.min(rownum,cell.parentNode.rowIndex);
}
selWidth=Math.max((xx+cell.colSpan)-colnum,selWidth);
selHeight=Math.max((cell.parentNode.rowIndex+cell.rowSpan)-rownum,selHeight);
if(colnum==xx && rownum==cell.parentNode.rowIndex){
mergingCell=cell;
}
}
}
} catch(e) {//no more cells
}
}
if(!mergingCell) {
if(mergingCell=dojo.withGlobal(this._editor.window, "getAncestorElement", dojo.html.selection, ['td','th'])) {;
rownum=mergingCell.parentNode.rowIndex;
colnum=dojo.widget.Editor2Plugin.TableOperation._cellColumnNumber(table,mergingCell);
} else {alert('Please select a table cell'); return;}
}
if(selWidth<=mergingCell.colSpan && selHeight<=mergingCell.rowSpan) {
var cc=dojo.widget.Editor2Plugin.TableOperation._countColumns(table);
selWidth=parseInt(prompt('How many columns do you want to merge?', Math.max((colnum0)) {return;}
selHeight=parseInt(prompt('How many rows do you want to merge?',Math.max((mergingCell.parentNode.rowIndex < table.rows.length-1 ? 2:1),mergingCell.rowSpan)));
if(!(selHeight>0)) {return;}
if(selWidth<=mergingCell.colSpan && selHeight<=mergingCell.rowSpan) return;
if(selWidth+colnum>cc || selHeight+rownum>table.rows.length) {
alert('Not enough rows or columns in table!');return;
}
}
var tbodyHTML=[]; tbodyHTML[1]=''; tbodyHTML[2]='';
var mergedHTML='';
var rows=table.rows;
var cs,rs,colpos,inMerge,nv,chNodes;
var xpad=[];
for(var nrow=rownum ; nrow\n";
chNodes=dojo.widget.Editor2Plugin.TableOperation._getCellChildren(rows[nrow]);
colpos=0;
for(i=0; i\n";
// dojo.widget.Editor2Plugin.TableOperation.debugMap(xpad);
}
mergedHTML = tbodyHTML[1]+ dojo.widget.Editor2Plugin.TableOperation._nodeHTML(mergingCell,selHeight,selWidth,mergedHTML)+tbodyHTML[2];
dojo.widget.Editor2Plugin.TableOperation._reinsertTable(this._editor,mergedHTML,rownum,colnum);
},
getText: function(){return 'Merge Cells';}
});
dojo.lang.declare("dojo.widget.Editor2Plugin.splitcellsCommand",dojo.widget.Editor2Command,{execute:function(){
dojo.widget.Editor2Plugin.TableOperation._splitCells(this._editor,1,1);
},getText:function(){
return "Split Merged Cell";
},getState:function(){
var _b79=dojo.withGlobal(this._editor.window,"getAncestorElement",dojo.html.selection,["td","th"]);
return (_b79&&(_b79.rowSpan>1||_b79.colSpan>1)?dojo.widget.Editor2Manager.commandState.Enabled:dojo.widget.Editor2Manager.commandState.Disabled);
}});
dojo.lang.declare("dojo.widget.Editor2Plugin.splitrowsCommand",dojo.widget.Editor2Command,{execute:function(){
dojo.widget.Editor2Plugin.TableOperation._splitCells(this._editor,1,null);
},getText:function(){
return "Split Merged Row";
},getState:function(){
var _b7a=dojo.withGlobal(this._editor.window,"getAncestorElement",dojo.html.selection,["td","th"]);
return (_b7a&&(_b7a.rowSpan>1)?dojo.widget.Editor2Manager.commandState.Enabled:dojo.widget.Editor2Manager.commandState.Disabled);
}});
dojo.lang.declare("dojo.widget.Editor2Plugin.splitcolsCommand",dojo.widget.Editor2Command,{execute:function(){
dojo.widget.Editor2Plugin.TableOperation._splitCells(this._editor,null,1);
},getText:function(){
return "Split Merged Column";
},getState:function(){
var _b7b=dojo.withGlobal(this._editor.window,"getAncestorElement",dojo.html.selection,["td","th"]);
return (_b7b&&(_b7b.colSpan>1)?dojo.widget.Editor2Manager.commandState.Enabled:dojo.widget.Editor2Manager.commandState.Disabled);
}});
dojo.lang.declare("dojo.widget.Editor2Plugin.togglethCommand",dojo.widget.Editor2Command,{execute:function(){
var xpad=[],_b7d=0;
if(dojo.render.html.moz){
var sel=this._editor.window.getSelection();
var i=0,_b80;
try{
while(range=sel.getRangeAt(i++)){
var cell=range.startContainer.childNodes[range.startOffset];
if(cell.nodeName.toLowerCase().match(/^t[dh]$/)){
_b80=cell.parentNode.rowIndex;
if(xpad[_b80]===undefined){
xpad[_b80]=[];
}
xpad[_b80][cell.cellIndex]=true;
_b7d++;
if(!_b82){
var _b82=cell,_b83=_b80;
}
}
}
}
catch(e){
}
}
if(_b7d==0){
var _b82=dojo.withGlobal(this._editor.window,"getAncestorElement",dojo.html.selection,["td","th"]);
if(!_b82){
alert("Please select a table cell");
return;
}
var _b83=_b82.parentNode.rowIndex;
xpad[_b83]=[];
xpad[_b83][_b82.cellIndex]=true;
}
var _b84=dojo.withGlobal(this._editor.window,"getAncestorElement",dojo.html.selection,["table"]);
var _b85="",_b86;
var rows=_b84.rows;
for(var nrow=0;nrow\n";
var _b89=dojo.widget.Editor2Plugin.TableOperation._getCellChildren(rows[nrow]);
for(var i=0;i<_b89.length;i++){
_b86=(xpad[nrow]&&xpad[nrow][i])?(_b89[i].nodeName.toLowerCase()=="td"?"th":"td"):null;
_b85+=dojo.widget.Editor2Plugin.TableOperation._nodeHTML(_b89[i],null,null,true,_b86);
}
_b85+="\n\t\t\n";
}
dojo.widget.Editor2Plugin.TableOperation._reinsertTable(this._editor,_b85,_b83,_b82.cellIndex);
},getText:function(){
return "Toggle Heading-Cell";
},getState:function(){
return (dojo.withGlobal(this._editor.window,"getAncestorElement",dojo.html.selection,["th"])?dojo.widget.Editor2Manager.commandState.Latched:dojo.widget.Editor2Manager.commandState.Enabled);
}});
dojo.widget.Editor2Plugin.TableOperation={commandList:["inserttable","toggletableborder","deletetable","tableproperties","trproperties","tdproperties","insertrowbelow","insertrowabove","deleterows","insertcolafter","insertcolbefore","deletecols","mergecells","splitcells","splitrows","splitcols","toggleth","dialogbordercolorpicker","dialogtextcolorpicker","dialogbgcolorpicker"],getCommand:function(_b8a,name){
if(name=="tabledialog"){
return new dojo.widget.Editor2DialogCommand(_b8a,"tabledialog",{contentFile:"dojo.widget.Editor2Plugin.InsertTableDialog",contentClass:"Editor2InsertTableDialog",title:"Edit Table",width:"660px",height:"450px"});
}
if(dojo.lang.find(dojo.widget.Editor2Plugin.TableOperation.commandList,name)>-1){
return new dojo.widget.Editor2Plugin[name+"Command"](_b8a,name);
}
},getToolbarItem:function(name){
var item;
if(dojo.lang.find(dojo.widget.Editor2Plugin.TableOperation.commandList,name)>-1){
item=new dojo.widget.Editor2ToolbarButton(name);
}
return item;
},getContextMenuGroup:function(name,_b8f){
return new dojo.widget.Editor2Plugin.TableContextMenuGroup(_b8f);
},callTableDialog:function(_b90,mode){
var di=_b90.getCommand("tabledialog");
di.mode=mode;
di.execute();
},showIETableBorder:function(dom){
var _b94=dom.getElementsByTagName("table");
dojo.lang.forEach(_b94,function(t){
dojo.html.addClass(t,"dojoShowIETableBorders");
});
return dom;
},removeIEFakeClass:function(dom){
var _b97=dom.getElementsByTagName("table");
dojo.lang.forEach(_b97,function(t){
dojo.html.removeClass(t,"dojoShowIETableBorders");
});
return dom;
},_getAttributesHTML:function(dom,_b9a){
var _b9b="",_b9c,val,_b9e,i;
if(dom && (_b9c=dom.attributes)) {
if(!_b9a){
_b9a=[];
}
_b9a.push("disabled","tabindex","cols","datapagesize","hidefocus","contenteditable","_moz_resizing");
if(dojo.render.html.ie){
_b9a.push("style");
}
for(i=0;i<_b9c.length;i++){
val=_b9c[i].value;
_b9e=_b9c[i].name.toLowerCase();
if(val.length&&val!="null"&&(_b9e!="nowrap"||val!="false")){
if(!_b9a||(dojo.lang.find(_b9a,_b9e)==-1)){
_b9b+=_b9e+"=\""+val+"\" ";
}
}
}
if(dojo.render.html.ie){
var sty=dom.style;
if(sty){
sty=sty.cssText;
if(sty.length){
_b9b+="style=\""+sty+"\" ";
}
}
}
_b9b=_b9b.substr(0,_b9b.length-1);
return _b9b;} else return "";
},_nodeHTML:function(cell,_ba2,_ba3,_ba4,_ba5){
return (cell.nodeType==3?
cell.nodeValue:
"<"+(_ba5?_ba5:cell.nodeName.toLowerCase())+" "+((_ba2&&_ba3)?this._getAttributesHTML(cell,["colspan","rowspan"]):_ba2?this._getAttributesHTML(cell,["rowspan"]):_ba3?this._getAttributesHTML(cell,["colspan"]):this._getAttributesHTML(cell))+(_ba2>1?" rowspan=\""+_ba2+"\"":"")+(_ba3>1?" colspan=\""+_ba3+"\"":"")+">"+(_ba4===true?cell.innerHTML:_ba4===false?"
":_ba4)+""+(_ba5?_ba5:cell.nodeName.toLowerCase())+">");
},_getCellChildren:function(row){
var _ba7=[];
for(var i=0;i\n";
var _bc0=_bbe.childNodes,_bc1;
for(var i=0;i<_bc0.length;i++){
_bc1=_bc0[i].nodeName.toLowerCase();
if(_bc0[i].nodeType!=3&&_bc1!="tbody"&&_bc1!="tr"){
_bbf+=this._nodeHTML(_bc0[i],null,null,true);
}
}
}
_bbf+="\t\n";
if(!_bbb){
_bbb="";
var rows=_bbe.rows;
for(var nrow=0;nrow"+rows[nrow].innerHTML+"\n\t\t\n";
}
}
if(row===undefined||row===null||col===undefined||col===null){
var _bc5=dojo.withGlobal(_bba.window,"getAncestorElement",dojo.html.selection,["td","th"]);
if(row===undefined||row===null){
row=(_bc5?_bc5.parentNode.cellIndex:0);
}
if(col===undefined||col===null){
col=(_bc5?_bc5.cellIndex:0);
}
}
dojo.withGlobal(_bba.window,"selectElement",dojo.html.selection,[_bbe]);
var _bc6,_bc7;
if(_bbe.previousSibling){
_bc7=_bbe.previousSibling;
}else{
_bc6=_bbe.parentNode;
}
if(dojo.render.html.ie){
_bba.execCommand("delete");
}
_bba.execCommand("inserthtml",_bbf+_bbb+"\t\n");
if(_bc7){
_bbe=_bc7.nextSibling;
}else{
_bbe=_bc6.firstChild;
}
if(_bbe&&_bbe.nodeName.toLowerCase()=="table"){
var _bc8=this._getCellChildren(_bbe.rows[row]);
for(var i=0;i<_bc8.length;i++){
if((_bc8[i].cellIndex+_bc8[i].colSpan)>col){
var _bc9=_bc8[i];
if(!dojo.render.html.ie){
_bc9=_bc9.lastChild;
}
dojo.withGlobal(_bba.window,"selectElement",dojo.html.selection,[_bc9]);
dojo.withGlobal(_bba.window,"collapse",dojo.html.selection,[true]);
break;
}
}
}
_bba._updateHeight();
},_insertRow:function(_bca,_bcb){
var _bcc=dojo.withGlobal(_bca.window,"getAncestorElement",dojo.html.selection,["td","th"]);
if(_bcc!=null){
var _bcd=_bcc.cellIndex;
var _bce=_bcc.parentNode.rowIndex;
if(_bcb){
_bce+=_bcc.rowSpan;
}
var _bcf=dojo.withGlobal(_bca.window,"getAncestorElement",dojo.html.selection,["table"]);
var _bd0="";
var _bd1=this._countColumns(_bcf);
var rows=_bcf.rows;
for(var nrow=0;nrow\n";
for(i=0;i<_bd1;i++){
_bd0+="
| ";
}
_bd0+="\n\t\t";
}
if(nrow\n";
var _bd5=this._getCellChildren(rows[nrow]);
for(var i=0;i<_bd5.length;i++){
var rs=_bd5[i].rowSpan;
if(nrow<_bce&&nrow+rs>_bce){
rs++;
_bd1-=_bd5[i].colSpan;
}
_bd0+=this._nodeHTML(_bd5[i],rs,null,true);
}
_bd0+="\n\t\t\n";
}
}
this._reinsertTable(_bca,_bd0,_bce,_bcd);
}
},_insertCol:function(_bd7,_bd8){
var _bd9=dojo.withGlobal(_bd7.window,"getAncestorElement",dojo.html.selection,["td","th"]);
if(_bd9!=null){
var _bda=_bd9.parentNode.rowIndex;
var _bdb=dojo.withGlobal(_bd7.window,"getAncestorElement",dojo.html.selection,["table"]);
var _bdc=this._cellColumnNumber(_bdb,_bd9);
if(_bd8){
_bdc+=_bd9.colSpan;
}
var _bdd="";
var rows=_bdb.rows;
var cs,rs,done,_be2,_be3=[],skip;
for(var nrow=0;nrow\n";
var _be6=this._getCellChildren(rows[nrow]);
for(var i=0;i<_be6.length;i++){
cs=_be6[i].colSpan;
rs=_be6[i].rowSpan;
_be2=_be6[i].cellIndex;
if(_be3[nrow]!=undefined){
_be2+=_be3[nrow];
}
if(_be2==_bdc){
_bdd+="
| ";
done=true;
}
if(_be2>_bdc){
skip=true;
}
if(_be2<_bdc){
for(var j=1;j_bdc){
cs++;
skip=true;
}
_bdd+=this._nodeHTML(_be6[i],null,cs,true);
}
if(!done&&!skip){
_bdd+="
| ";
}
_bdd+="\n\t\t\n";
}
this._reinsertTable(_bd7,_bdd,_bda,_bd9.cellIndex);
}
},_splitCells:function(_be9,_bea,_beb){
var _bec=dojo.withGlobal(_be9.window,"getAncestorElement",dojo.html.selection,["td","th"]);
if(_bec!=null){
var _bed=_bec.cellIndex;
var _bee=_bec.parentNode.rowIndex;
var _bef=dojo.withGlobal(_be9.window,"getAncestorElement",dojo.html.selection,["table"]);
var _bf0=this._cellColumnNumber(_bef,_bec);
var _bf1="";
var rows=_bef.rows;
var cs,rs,_bf5,done,_bf7=[];
for(var nrow=0;nrow\n";
var _bf9=this._getCellChildren(rows[nrow]);
done=false;
_bf5=0;
for(var i=0;i<_bf9.length;i++){
cs=_bf9[i].colSpan;
rs=_bf9[i].rowSpan;
_bf5=_bf9[i].cellIndex;
if(_bf7[nrow]!=undefined){
_bf5+=_bf7[nrow];
}
if(_bf5==_bf0&&(nrow==_bee||(_bea&&nrow>=_bee&&nrow<_bee+_bec.rowSpan))){
for(var j=0;j<(_beb?_bec.colSpan:1);j++){
_bf1+=this._nodeHTML(_bec,_bea,_beb,(j==0&&nrow==_bee));
}
done=true;
}
if(_bf5!=_bf0||nrow!=_bee){
_bf1+=this._nodeHTML(_bf9[i],null,cs,true);
if(_bf5<_bf0){
for(var j=1;j=_bee&&nrow<_bee+_bec.rowSpan))){
for(var j=0;j<(_beb?_bec.colSpan:1);j++){
_bf1+=this._nodeHTML(_bec,_bea,_beb,(j==0&&nrow==_bee));
}
}
_bf1+="\n\t\t\n";
}
this._reinsertTable(_be9,_bf1,_bee,_bf0);
}
}};
dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.TableOperation.getCommand);
dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.TableOperation.getToolbarItem);
if(dojo.widget.Editor2Plugin.ContextMenuManager){
dojo.widget.Editor2Plugin.ContextMenuManager.registerGroup("Table",dojo.widget.Editor2Plugin.TableOperation.getContextMenuGroup);
dojo.declare("dojo.widget.Editor2Plugin.TableContextMenuGroup",dojo.widget.Editor2Plugin.SimpleContextMenuGroup,{createItems:function(){
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem",{caption:"Delete Table",command:"deletetable"}));
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem",{caption:"Table Property",command:"inserttable",iconClass:"TB_Button_Icon TB_Button_Table"}));
},checkVisibility:function(){
var _bfc=dojo.widget.Editor2Manager.getCurrentInstance();
var _bfd=dojo.withGlobal(_bfc.window,"hasAncestorElement",dojo.html.selection,["table"]);
if(dojo.withGlobal(_bfc.window,"hasAncestorElement",dojo.html.selection,["table"])){
this.items[0].show();
this.items[1].show();
return true;
}else{
this.items[0].hide();
this.items[1].hide();
return false;
}
}});
}
dojo.provide("dojo.widget.ColorPalette");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.display");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget(
"dojo.widget.ColorPalette",
dojo.widget.HtmlWidget,
{
palette: "7x10",
_palettes: {
"7x10": [["fff", "fcc", "fc9", "ff9", "ffc", "9f9", "9ff", "cff", "ccf", "fcf"],
["ccc", "f66", "f96", "ff6", "ff3", "6f9", "3ff", "6ff", "99f", "f9f"],
["c0c0c0", "f00", "f90", "fc6", "ff0", "3f3", "6cc", "3cf", "66c", "c6c"],
["999", "c00", "f60", "fc3", "fc0", "3c0", "0cc", "36f", "63f", "c3c"],
["666", "900", "c60", "c93", "990", "090", "399", "33f", "60c", "939"],
["333", "600", "930", "963", "660", "060", "366", "009", "339", "636"],
["000", "300", "630", "633", "330", "030", "033", "006", "309", "303"]],
"3x4": [["ffffff"/*white*/, "00ff00"/*lime*/, "008000"/*green*/, "0000ff"/*blue*/],
["c0c0c0"/*silver*/, "ffff00"/*yellow*/, "ff00ff"/*fuchsia*/, "000080"/*navy*/],
["808080"/*gray*/, "ff0000"/*red*/, "800080"/*purple*/, "000000"/*black*/]]
//["00ffff"/*aqua*/, "808000"/*olive*/, "800000"/*maroon*/, "008080"/*teal*/]];
},
buildRendering: function () {
this.domNode = document.createElement("table");
dojo.html.disableSelection(this.domNode);
dojo.event.connect(this.domNode, "onmousedown", function (e) {
e.preventDefault();
});
with (this.domNode) { // set the table's properties
cellPadding = "0"; cellSpacing = "1"; border = "1";
style.backgroundColor = "white";
}
var colors = this._palettes[this.palette];
for (var i = 0; i < colors.length; i++) {
var tr = this.domNode.insertRow(-1);
for (var j = 0; j < colors[i].length; j++) {
if (colors[i][j].length == 3) {
colors[i][j] = colors[i][j].replace(/(.)(.)(.)/, "$1$1$2$2$3$3");
}
var td = tr.insertCell(-1);
with (td.style) {
backgroundColor = "#" + colors[i][j];
border = "1px solid gray";
width = height = "15px";
fontSize = "1px";
}
td.color = "#" + colors[i][j];
td.onmouseover = function (e) { this.style.borderColor = "white"; }
td.onmouseout = function (e) { this.style.borderColor = "gray"; }
dojo.event.connect(td, "onmousedown", this, "onClick");
td.innerHTML = " ";
}
}
},
onClick: function(/*Event*/ e) {
this.onColorSelect(e.currentTarget.color);
e.currentTarget.style.borderColor = "gray";
},
onColorSelect: function(color){
}
});
dojo.provide("dojo.widget.PopupContainer");
dojo.require("dojo.html.style");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.selection");
dojo.require("dojo.html.iframe");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.declare(
"dojo.widget.PopupContainerBase",
null,
function(){
this.queueOnAnimationFinish = [];
},
{
isContainer: true,
templateString: '',
isShowingNow: false,
currentSubpopup: null,
beginZIndex: 1000,
parentPopup: null,
parent: null,
popupIndex: 0,
aroundBox: dojo.html.boxSizing.BORDER_BOX,
openedForWindow: null,
processKey: function(/*Event*/evt){
return false;
},
applyPopupBasicStyle: function(){
with(this.domNode.style){
display = 'none';
position = 'absolute';
}
},
aboutToShow: function() {
},
open: function(/*Integer*/x, /*Integer*/y, /*DomNode*/parent, /*Object*/explodeSrc, /*String?*/orient, /*Array?*/padding){
if (this.isShowingNow){ return; }
if(this.animationInProgress){
this.queueOnAnimationFinish.push(this.open, arguments);
return;
}
this.aboutToShow();
var around = false, node, aroundOrient;
if(typeof x == 'object'){
node = x;
aroundOrient = explodeSrc;
explodeSrc = parent;
parent = y;
around = true;
}
this.parent = parent;
dojo.body().appendChild(this.domNode);
explodeSrc = explodeSrc || parent["domNode"] || [];
var parentPopup = null;
this.isTopLevel = true;
while(parent){
if(parent !== this && (parent.setOpenedSubpopup != undefined && parent.applyPopupBasicStyle != undefined)){
parentPopup = parent;
this.isTopLevel = false;
parentPopup.setOpenedSubpopup(this);
break;
}
parent = parent.parent;
}
this.parentPopup = parentPopup;
this.popupIndex = parentPopup ? parentPopup.popupIndex + 1 : 1;
if(this.isTopLevel){
var button = dojo.html.isNode(explodeSrc) ? explodeSrc : null;
dojo.widget.PopupManager.opened(this, button);
}
if(this.isTopLevel && !dojo.withGlobal(this.openedForWindow||dojo.global(), dojo.html.selection.isCollapsed)){
this._bookmark = dojo.withGlobal(this.openedForWindow||dojo.global(), dojo.html.selection.getBookmark);
}else{
this._bookmark = null;
}
if(explodeSrc instanceof Array){
explodeSrc = {left: explodeSrc[0], top: explodeSrc[1], width: 0, height: 0};
}
with(this.domNode.style){
display="";
zIndex = this.beginZIndex + this.popupIndex;
}
if(around){
this.move(node, padding, aroundOrient);
}else{
this.move(x, y, padding, orient);
}
this.domNode.style.display="none";
this.explodeSrc = explodeSrc;
this.show();
this.isShowingNow = true;
},
move: function(/*Int*/x, /*Int*/y, /*Integer?*/padding, /*String?*/orient){
var around = (typeof x == "object");
if(around){
var aroundOrient=padding;
var node=x;
padding=y;
if(!aroundOrient){ //By default, attempt to open above the aroundNode, or below
aroundOrient = {'BL': 'TL', 'TL': 'BL'};
}
dojo.html.placeOnScreenAroundElement(this.domNode, node, padding, this.aroundBox, aroundOrient);
}else{
if(!orient){ orient = 'TL,TR,BL,BR';}
dojo.html.placeOnScreen(this.domNode, x, y, padding, true, orient);
}
},
close: function(/*Boolean?*/force){
if(force){
this.domNode.style.display="none";
}
if(this.animationInProgress){
this.queueOnAnimationFinish.push(this.close, []);
return;
}
this.closeSubpopup(force);
this.hide();
if(this.bgIframe){
this.bgIframe.hide();
this.bgIframe.size({left: 0, top: 0, width: 0, height: 0});
}
if(this.isTopLevel){
dojo.widget.PopupManager.closed(this);
}
this.isShowingNow = false;
if(this.parent){
setTimeout(
dojo.lang.hitch(this,
function(){
try{
if(this.parent['focus']){
this.parent.focus();
}else{
this.parent.domNode.focus();
}
}catch(e){dojo.debug("No idea how to focus to parent", e);}
}
),
10
);
}
if(this._bookmark && dojo.withGlobal(this.openedForWindow||dojo.global(), dojo.html.selection.isCollapsed)){
if(this.openedForWindow){
this.openedForWindow.focus()
}
dojo.withGlobal(this.openedForWindow||dojo.global(), "moveToBookmark", dojo.html.selection, [this._bookmark]);
}
this._bookmark = null;
},
closeAll: function(/*Boolean?*/force){
if (this.parentPopup){
this.parentPopup.closeAll(force);
}else{
this.close(force);
}
},
setOpenedSubpopup: function(/*Widget*/popup) {
this.currentSubpopup = popup;
},
closeSubpopup: function(/*Boolean?*/force) {
if(this.currentSubpopup == null){ return; }
this.currentSubpopup.close(force);
this.currentSubpopup = null;
},
onShow: function() {
dojo.widget.PopupContainer.superclass.onShow.apply(this, arguments);
this.openedSize={w: this.domNode.style.width, h: this.domNode.style.height};
if(dojo.render.html.ie){
if(!this.bgIframe){
this.bgIframe = new dojo.html.BackgroundIframe();
this.bgIframe.setZIndex(this.domNode);
}
this.bgIframe.size(this.domNode);
this.bgIframe.show();
}
this.processQueue();
},
processQueue: function() {
if (!this.queueOnAnimationFinish.length) return;
var func = this.queueOnAnimationFinish.shift();
var args = this.queueOnAnimationFinish.shift();
func.apply(this, args);
},
onHide: function() {
dojo.widget.HtmlWidget.prototype.onHide.call(this);
if(this.openedSize){
with(this.domNode.style){
width=this.openedSize.w;
height=this.openedSize.h;
}
}
this.processQueue();
}
});
dojo.widget.defineWidget(
"dojo.widget.PopupContainer",
[dojo.widget.HtmlWidget, dojo.widget.PopupContainerBase], {
});
dojo.widget.PopupManager = new function(){
this.currentMenu = null;
this.currentButton = null; // button that opened current menu (if any)
this.currentFocusMenu = null; // the (sub)menu which receives key events
this.focusNode = null;
this.registeredWindows = [];
this.registerWin = function(/*Window*/win){
if(!win.__PopupManagerRegistered)
{
dojo.event.connect(win.document, 'onmousedown', this, 'onClick');
dojo.event.connect(win, "onscroll", this, "onClick");
dojo.event.connect(win.document, "onkey", this, 'onKey');
win.__PopupManagerRegistered = true;
this.registeredWindows.push(win);
}
};
this.registerAllWindows = function(/*Window*/targetWindow){
if(!targetWindow) { //see comment below
targetWindow = dojo.html.getDocumentWindow(window.top && window.top.document || window.document);
}
this.registerWin(targetWindow);
for (var i = 0; i < targetWindow.frames.length; i++){
try{
var win = dojo.html.getDocumentWindow(targetWindow.frames[i].document);
if(win){
this.registerAllWindows(win);
}
}catch(e){ /* squelch error for cross domain iframes */ }
}
};
this.unRegisterWin = function(/*Window*/win){
if(win.__PopupManagerRegistered)
{
dojo.event.disconnect(win.document, 'onmousedown', this, 'onClick');
dojo.event.disconnect(win, "onscroll", this, "onClick");
dojo.event.disconnect(win.document, "onkey", this, 'onKey');
win.__PopupManagerRegistered = false;
}
};
this.unRegisterAllWindows = function(){
for(var i=0;i