if(!window.gTools){
window.gTools=new Object();
}
if(!gTools.safeString){
gTools.safeString=function(_1){
if(typeof _1=="string"){
return _1;
}
if(_1==0){
return "0";
}
if(!_1){
return "";
}
return ""+_1;
};
}
if(!gTools.toQuoteHTML){
gTools.toQuoteHTML=function(_2){
return this.safeString(_2).replace(/"/g,"&quot;");
};
}
if(!gTools.toTextbox){
gTools.toTextbox=function(_3){
var t=this.safeString(_3);
t=t.replace(/</g,"&lt;");
t=t.replace(/>/g,"&gt;");
t=t.replace(/"/g,"&quot;");
return t;
};
}
if(!gTools.toHTML){
gTools.toHTML=function(_5){
var t=this.safeString(_5);
t=t.replace(/</g,"&lt;");
t=t.replace(/>/g,"&gt;");
t=t.replace(/"/g,"&quot;");
t=t.replace(/\ \ /g," &nbsp;");
t=t.replace(/\n/g,"<br>");
return t;
};
}
var gScratchpad=new function(){
if(window.gScratchpad){
return;
}
window.gScratchpad=this;
this.me="window.gScratchpad";
this.areas=new Object();
this.pads=new Object();
this.bars=new Object();
this.sections=new Object();
this.saving=0;
this.loading=0;
this.dirty=0;
this.uid=(new Date()).getTime();
this.loadPad=function(_7){
if(!_7||!_7.id){
throw "Invalid data";
}
var _8=this.pads["p"+_7.id];
if(_8){
return _8;
}
return new this.Pad(_7);
};
};
gScratchpad.Pad=function(_9){
var i;
if(!_9||!_9.id){
throw "Invalid data";
}
for(i in _9){
if(typeof _9[i]!="function"){
this[i]=_9[i];
}
}
gScratchpad.pads["p"+_9.id]=this;
this.me="gScratchpad.pads.p"+_9.id;
this.saving=0;
this.loading=0;
this.dirty=false;
this.revision=0;
this.blowdartid=null;
this.errcount=0;
this.notifylist=new Object();
this.addNotify=function(_b,_c,_d){
var n={"id":gScratchpad.uid++,"obj":_b,"func":_c,"context":_d};
this.notifylist[n.id]=n;
return n.id;
};
this.removeNotify=function(id){
if(this.notifylist[id]){
delete this.notifylist[id];
}
};
this.notify=function(){
if(this.notifyid){
clearTimeout(this.notifyid);
this.notifyid=null;
}
var i,n;
for(i in this.notifylist){
n=this.notifylist[i];
if(typeof n!="function"&&typeof n.obj[n.func]=="function"){
n.obj[n.func](this,n.id,n.context);
}
}
};
this.setNotify=function(){
if(!this.notifyid){
this.notifyid=setTimeout(this.me+".notify();",1);
}
};
this.detach=function(){
if(this.curarea){
if(this.data&&(this.data.length!=this.curarea.dtextarea.value.length||this.data!=this.curarea.dtextarea.value)){
this.data=this.curarea.dtextarea.value;
if(!this.dirty){
this.dirty=true;
gScratchpad.dirty++;
this.setNotify();
}
}
this.save();
this.curarea.pad=null;
this.curarea.setRedraw();
this.curarea=null;
}
};
this.attach=function(_12){
if(_12){
_12.attach(this);
}
};
this.load=function(){
if(arguments.length>0&&arguments[0]){
this.clear();
}
if((!this.data&&this.data!="")&&this.blowdartid==null){
this.blowdartid=gPHPBlowdart.send("scratchpad.get",{"obj":this,"func":"cb_load","timeout":1},this.id);
this.loading++;
gScratchpad.loading++;
if(this.curarea){
this.curarea.setRedraw();
}
this.setNotify();
}
};
this.cb_load=function(_13,err,_15){
this.blowdartid=null;
if(this.loading>0){
this.loading--;
}
if(gScratchpad.loading>0){
gScratchpad.loading--;
}
if(err){
this.errcount++;
if(this.curarea){
setTimeout(this.me+".load()",2000);
}
return;
}
this.setNotify();
this.data=(_13?_13:"");
this.revision++;
this.cur_revision=this.revision;
if(this.curarea){
this.curarea.setRedraw();
}
};
this.change=function(){
var _16=(arguments.length>0?arguments[0]:0);
if(!this.dirty&&this.curarea){
var v=this.curarea.getText();
if(!this.dirty){
if((this.data.length!=v.length)||(this.data.text!=v)){
this.dirty=true;
gScratchpad.dirty++;
this.setNotify();
}
}
}
if(this.dirty){
if(_16<=0){
this.save();
}else{
this.settimeout(_16);
}
}
};
this.cb_save=function(_18,err,_1a){
var i,e;
if(_18&&_18.length){
for(i=0;i<_18.length;i++){
if((e=document.getElementById("ad"+(i+1)))){
e.innerHTML=_18[i];
}
}
}
this.saveid=this.insave=0;
if(this.saving>0){
this.saving--;
}
if(gScratchpad.saving>0){
gScratchpad.saving--;
}
this.setNotify();
};
this.save=function(){
var _1d=false;
if(this.timeoutid){
clearTimeout(this.timeoutid);
this.timeoutid=0;
}
if(this.dirty){
this.dirty=false;
if(gScratchpad.dirty>0){
gScratchpad.dirty--;
}
if(this.curarea){
var v=this.curarea.getText();
if(v!=this.data){
this.data=v;
this.insave=true;
}else{
this.insave=false;
}
this.setNotify();
}
}else{
this.insave=false;
}
if(this.insave&&!this.saveid){
this.saveid=gPHPBlowdart.send("scratchpad.put",{"obj":this,"func":"cb_save","timeout":10},this.id,this.data);
this.saving++;
gScratchpad.saving++;
this.setNotify();
}else{
if(this.insave){
_1d=true;
}
}
if(_1d){
this.settimeout(1000);
}
};
this.settimeout=function(_1f){
this.changetime=(new Date()).getTime()+_1f;
if(this.timeoutid){
clearTimeout(this.timeoutid);
}
this.timeoutid=setTimeout(this.me+".cb_timeout();",_1f);
};
this.cb_timeout=function(){
var t=this.changetime-(new Date()).getTime();
if(t>0){
this.settimeout(t);
return;
}
this.timeoutid=null;
this.save();
};
this.init=true;
};
gScratchpad.Area=function(div,pad){
if(!window.gScratchpad){
window.gScratchpad=new Scratchpad();
}
if(!window.LTX){
window.LTX=function(d){
return d;
};
}
this.html_blank="<span style=\"font-weight: normal; font-size: 12px;\">Start typing here now...</span>";
this.id=(div.id?div.id:"scratchpad_"+(new Date()).getTime());
this.me="gScratchpad.areas."+this.id;
gScratchpad.areas[this.id]=this;
this.dmain=div;
this.minh=div.offsetHeight;
this.savew=div.style.width;
this.saveow=""+div.offsetWidth+"px";
this.adjust=true;
div.style.position="relative";
div.style.top="0px";
div.style.left="0px";
div.innerHTML="";
var dt=this.dtext=document.createElement("DIV");
if("0px"!=this.saveow){
dt.style.width=this.saveow;
}else{
dt.style.width=this.savew;
}
dt.style.overflow="hidden";
dt.style.padding="3px 0px 3px 0px";
dt.style.visibility="hidden";
div.appendChild(dt);
var df=this.dfloat=document.createElement("DIV");
df.style.position="absolute";
df.style.left=df.style.top="0px";
df.style.width="100%";
df.style.left="0px";
df.style.top="0px";
div.appendChild(df);
var t=this.dtextarea=document.createElement("TEXTAREA");
t.style.border="0px";
t.style.width="100%";
t.style.overflow="auto";
t.wrap="soft";
t.rows=6;
this.ta_onkeyup=new Function(this.me+".dtextarea_onkeyup(arguments[0])");
this.ta_onfocus=new Function(this.me+".dtextarea_onfocus(arguments[0])");
this.ta_onblur=new Function(this.me+".dtextarea_onblur(arguments[0]);");
this.ta_id=this.me+"_textarea";
df.appendChild(t);
this.cur_displaystate=null;
this.getText=function(){
return this.dtextarea.value;
};
this.displayMessage=function(){
this.dtext.onclick=null;
if(arguments.length>0){
this.dtext.innerHTML=arguments[0];
this.dfloat.style.display="none";
this.dtext.style.height="100%";
var val=Math.floor((this.dtext.offsetHeight-this.minh)/2);
if(val<0){
val=0;
}
this.dtext.style.padding=""+val+"px 0px 0px 0px";
this.dtext.style.visibility="";
}else{
this.dfloat.style.display="";
this.dtext.innerHTML="";
this.dtext.style.height="";
this.dtext.style.padding="0px 0px 0px 0px";
this.dtext.style.visibility="hidden";
}
};
this.maketextarea=function(d){
this.dtextarea_adjust(gTools.toHTML(d));
this.dfloat.innerHTML="<textarea class=\"padtextarea\" id=\""+this.ta_id+"\" wrap=\"soft\" rows=\"6\" style=\"width: 100%; border: 0px; overflow: auto;\">"+gTools.toTextbox(d)+"</textarea>";
var e=this.dfloat.getElementsByTagName("TEXTAREA")[0];
e.onkeyup=this.ta_onkeyup;
e.onfocus=this.ta_onfocus;
e.onblur=this.ta_onblur;
this.dtextarea=e;
this.dtextarea_adjust();
return this.dtextarea.value;
};
this.setDisplayState=function(_2a){
if(_2a==this.cur_displaystate){
return;
}
switch(_2a){
default:
_2a="off";
case "off":
this.maketextarea("");
this.displayMessage(this.html_disabled?this.html_disabled:"<table width=\"100%\" height=\"100%\"><tr><td valign=\"center\" align=\"center\"><center><div style=\"width: 200px;\">"+(new gHTMLWidgets.htmlRoundBox()).create("<br/><center>"+LTX("Disabled")+"</center><br/>","pink","pink")+"</center></div></td></tr></table>");
break;
case "loading":
this.maketextarea("");
this.displayMessage(this.html_loading?this.html_loading:"<table width=\"100%\" height=\"100%\"><tr><td valign=\"center\" align=\"center\"><center><div style=\"width: 200px;\">"+"<font class=\"load\">Loading...</font>"+"</center></div></td></tr></table>");
break;
case "pad":
this.displayMessage();
break;
case "blank":
this.maketextarea("");
this.displayMessage(this.html_blank?this.html_blank:"");
this.dtext.onclick=new Function(this.me+".cb_activate(this);");
this.dtext.className="padtextarea";
break;
}
this.cur_displaystate=_2a;
};
this.cb_activate=function(e){
e.onclick=null;
this.activate=true;
this.setRedraw();
};
this.dtextarea_adjust=function(){
if(this.adjust){
this.dtext.innerHTML=gTools.toHTML(this.dtextarea.value)+"<BR>&nbsp;<BR>&nbsp;";
var nh=(this.dtext.offsetHeight-6);
var _2d=document.getElementById("tdpad1");
var _2e=document.getElementById("tdpad2");
var _2f=document.getElementById("tdpad3");
var _30=document.getElementById("spacerline");
var _31=document.getElementById("wordid");
var pad=document.getElementById("scratchpad");
var _33=document.getElementById("padmain");
if(nh<this.minh-6){
this.dmain.style.height=""+this.minh+"px";
nh=this.minh-6;
}else{
this.dmain.style.height="";
}
if(nh>0){
this.dtextarea.style.height=""+nh+"px";
}
_2e.style.height=""+nh+"px";
spaceh=_33.offsetHeight-50;
_30.style.height=""+spaceh+"px";
}
};
this.cb_change=function(){
if(this.changeid){
if(this.changeid){
window.clearTimeout(this.changeid);
this.changeid=null;
}
}
this.dtextarea_adjust();
if(this.section&&this.section.cb_change){
this.section.cb_change();
}
};
this.dtextarea_onkeyup=function(ev){
if(this.pad){
this.pad.change(1000);
if(!this.changeid){
this.changeid=window.setTimeout(this.me+".cb_change()",1000);
}
}
};
this.dtextarea_onfocus=function(ev){
this.dtextarea_adjust();
};
this.dtextarea_onblur=function(ev){
if(this.pad){
this.pad.change(1);
}
};
this.attach=function(pad){
if(this.pad){
if(this.pad==pad){
return;
}
this.pad.detach();
}
this.pad=pad;
pad.curarea=this;
pad.load();
this.setRedraw();
};
this.redraw=function(){
if(this.redrawID){
window.clearTimeout(this.redrawID);
this.redrawID=null;
}
if(arguments.length>0?arguments[1]:false){
this.cur_padid=0;
}
if(this.pad){
if(this.pad.id!=this.cur_padid||this.pad.revision!=this.cur_revision){
this.cur_padid=this.pad.id;
this.cur_revision=this.pad.id;
if(typeof this.pad.data=="string"){
if(this.pad.data==""&&!this.activate){
this.setDisplayState("blank");
}else{
this.setDisplayState("pad");
var d=(typeof this.pad.data=="string"?this.pad.data:"");
this.pad.data=this.maketextarea(d);
if(this.activate){
var err;
try{
this.dtextarea.focus();
}
catch(err){
}
this.activate=false;
}
}
}else{
this.setDisplayState("loading");
}
}
}else{
this.setDisplayState("off");
}
};
this.setRedraw=function(){
if(this.redrawID){
return;
}
this.redrawID=window.setTimeout(this.me+".redraw();",1);
};
if(arguments.length>1){
this.attach(arguments[1]);
}
this.setRedraw();
};
gScratchpad.Section=function(id,_3b,_3c){
this.id=id;
this.info=_3c;
gScratchpad.sections[id]=this;
this.me="gScratchpad.sections."+id;
if(!this.info.maxsize){
this.info.maxsize=3000;
}
this.darea=document.getElementById(id+"_area");
this.area=new gScratchpad.Area(this.darea);
this.area.section=this;
this.area.html_disabled=_3c.html_disabled;
this.area.html_loading=_3c.html_loading;
this.area.html_blank=_3c.html_blank;
if(this.info.height){
this.area.minh=this.info.height;
}
this.dbar=document.getElementById(id+"_bar");
this.bar=gScratchpad.bars[id+"_bar"];
this.bar.setShowCallback=new Function(this.me+".cb_setShow(arguments[0]);");
this.dbusy=document.getElementById(this.id+"_busy");
this.busy=false;
this.dmenu_td=document.getElementById(this.id+"_menu_td");
this.dcharacters=document.getElementById(this.id+"_characters");
this.cb_setShow=function(s){
if(s){
this.initData(this.data);
}
this.area.dtextarea_adjust();
};
this.cb_button=function(id){
this.bar.selectButton(id);
var pad=gScratchpad.pads[id];
this.area.attach(pad);
if(this.info.cookie){
SetCookie(this.info.cookie,id,24*7*26);
}
};
this.cb_notify=function(pad){
this.setRedraw();
};
this.cb_change=function(){
if(!this.area.dtextarea||(this.area.pad&&this.area.pad.loading)){
if(this.cleft!="loading"){
this.cleft="loading";
this.dcharacters.innerHTML="&nbsp;";
}
}else{
var len=(arguments.length>0?arguments[0]:this.info.maxsize-this.area.dtextarea.value.length);
if(this.cleft!=len){
if(arguments.length==0&&((this.cleft>0&&len<=0)||(this.cleft<=0&&len>0))){
this.setRedraw();
}
this.cleft=len;
this.dcharacters.innerHTML=(len<0?"<nobr><b><span class=\"titlebox-title\">"+format(LTX("Scratchpad full: %1%"),len)+"</span></b></nobr>":"<nobr>"+format(gLocale.Characters,len)+"</nobr>");
}
}
};
this.setRedraw=function(){
if(this.redrawid){
return;
}
this.redrawid=window.setTimeout(this.me+".redraw();",1);
};
this.redraw=function(){
if(this.redrawid){
window.clearTimeout(this.redrawid);
this.redrawid=0;
}
var _42=false,s=(this.area.pad&&this.area.pad.dirty?"dirty":"normal");
var len=this.info.maxsize-this.area.dtextarea.value.length;
if(gScratchpad.loading>0){
_42=true;
}
if(gScratchpad.saving>0){
s="dirty";
_42=true;
}else{
if((len<=0)&&s!="dirty"){
s="error";
}
}
this.bar.setState(s);
this.cb_change(len);
if(this.busy!=_42){
this.busy=_42;
this.dbusy.style.display=(_42?"":"none");
}
};
this.redoButtons=function(){
var _45=null,_46=null;
var def=GetCookie(this.info.cookie);
this.bar.removeAllButtons();
var p=new Array();
for(i=0;i<3&&i<this.data.order.length;i++){
pad=gScratchpad.pads["p"+this.data.order[i]];
if(pad){
if(def=="p"+pad.id){
_45=pad;
}
if(pad.id==this.data.selected){
_46=pad;
}
this.bar.addButton("p"+pad.id,pad.title,this,"cb_button");
p.push(pad.id);
}
}
var n,j;
for(n=0;p.length<3&&n<this.data.scratchpads.length;n++){
pad=this.data.scratchpads[n];
for(j=0;j<p.length;j++){
if(pad.id==p[j]){
pad=null;
break;
}
}
if(pad){
if(def=="p"+pad.id){
_45=pad;
}
if(pad.id==this.data.selected){
_46=pad;
}
this.bar.addButton("p"+pad.id,pad.title,this,"cb_button");
p.push(pad.id);
}
}
return (_45?_45:_46);
};
this.select=function(id){
var i,j;
for(i=0;i<this.data.scratchpads.length;i++){
if(id==this.data.scratchpads[i].id){
for(j=0;j<this.data.order.length;j++){
if(id==this.data.order[j]){
this.data.order.splice(j,1);
break;
}
}
this.data.order.unshift(id);
this.data.order=_3b.order.slice(0,3);
this.redoButtons();
this.cb_button("p"+id);
this.bar.setShow(1);
break;
}
}
};
this.initData=function(_4e){
this.data=_4e;
var i,pad,_51;
for(i=0;i<this.data.scratchpads.length;i++){
pad=gScratchpad.loadPad(_4e.scratchpads[i]);
pad.addNotify(this,"cb_notify");
}
_51=this.redoButtons();
if(this.bar.cstate==1){
if(!_51){
_51=gScratchpad.pads["p"+_4e.order[0]];
}
if(!_51){
_51=_4e.scratchpads[0];
}
if(_51){
this.cb_button("p"+_51.id);
}
}
this.setRedraw();
};
this.dialogs=new Object();
this.forms=new Object();
this.initdialogs=function(){
this.initdialog=function(){
};
eval("this.dialogs.add = gPop_"+this.id+"_dialog_add;");
eval("this.dialogs.list = gPop_"+this.id+"_dialog_list;");
eval("this.dialogs.rename = gPop_"+this.id+"_dialog_rename;");
eval("this.dialogs.log = gPop_"+this.id+"_dialog_log;");
eval("this.dialogs.revision = gPop_"+this.id+"_dialog_revision;");
};
this.beginAddDialog=function(){
this.initdialogs();
this.dialogs.add.setParams("ok",gLocale.Add_but,this.me+".cb_addDialog();");
this.dialogs.add.showPopup();
this.forms.add=document[this.id+"_form_add"];
this.forms.add.name.value="";
try{
this.forms.add.name.focus();
}
catch(err){
}
};
this.cb_addDialog=function(){
var _52=gTools.trim(this.forms.add.name.value);
if(_52==""){
showWarningMessage(this.info.warn_blank);
return false;
}
this.dialogs.add.hidePopup();
gBlowdart.send("scratchpad.create",{"obj":this,"func":"cb_adding","timeout":1},this.data.projectid,_52);
showWaitMessage(gLocale.AddingScratchpad+"&hellip;");
};
this.cb_adding=function(_53,err,_55){
if(_53==null){
hideWaitMessage();
showWarningMessage("Cannot add the scratchpad at this time");
}else{
window.location.replace(unescape(window.location.pathname));
}
};
this.listdialog=function(_56,_57){
this.initdialogs();
var i,j,_5a=2,w=""+Math.floor(100/_5a)+"%";
var r="<div style=\"padding-bottom: 8px\" class=\"dlgLabel\">"+_56+"</div>"+"<div class=\"ProjectNavigator\"><table width=100%\" cellpadding=\"2\" cellspacing=\"0\">";
var t=Math.floor((this.data.scratchpads.length+1)/_5a);
for(i=0;i<t;i++){
r+="<tr>";
for(j=i;j<this.data.scratchpads.length;j+=t){
r+="<td width=\""+w+"\"><a href=\"javascript:;\" onclick=\""+this.me+"."+_57+"("+this.data.scratchpads[j].id+");\"><div class=\"t buttonlink\" style=\"white-space: nowrap;\">"+gTools.toHTML(this.data.scratchpads[j].title)+"</div></a></td>";
}
r+="</tr>";
}
r+="</table></div>";
if(document.getElementById(this.id+"_dialog_list_body")){
document.getElementById(this.id+"_dialog_list_body").innerHTML="";
}
this.dialogs.list.showPopup();
document.getElementById(this.id+"_dialog_list_body").innerHTML=r;
};
this.beginRenameDialog=function(){
if(this.data.scratchpads.length==1){
this.cb_renamedialog(this.data.scratchpads[0].id);
}else{
this.listdialog(LTX("Rename scratchpad..."),"cb_renamedialog");
}
};
this.cb_renamedialog=function(id){
this.initdialogs();
this.dialogs.list.hidePopup();
var pad=this.getpad(id);
if(!pad){
return;
}
this.dialogs.rename.setParams("ok",gLocale.Rename,this.me+".cb_renamedialog2();");
this.dialogs.rename.showPopup();
document.getElementById(this.id+"_area_rename_from").innerHTML="<b>"+format(this.info.text_renameto,pad.title)+"</b>";
this.forms.rename=document[this.id+"_form_rename"];
this.forms.rename.name.value="";
this.forms.rename.scratchpad_id.value=""+pad.id;
try{
this.forms.rename.name.focus();
}
catch(err){
}
};
this.cb_renamedialog2=function(){
var _60=gTools.trim(this.forms.rename.name.value);
if(_60==""){
showWarningMessage(this.info.warn_blank);
return false;
}
this.dialogs.rename.hidePopup();
gBlowdart.send("scratchpad.rename",{"obj":this,"func":"cb_rename","timeout":1},parseInt(this.forms.rename.scratchpad_id.value),_60);
showWaitMessage(gLocale.RenamingScratchpad+"&hellip;");
};
this.cb_rename=function(_61,err,_63){
if(!_61){
hideWaitMessage();
showWarningMessage("Cannot rename this scratchpad at this time");
}else{
window.location.replace(unescape(window.location.pathname));
}
};
this.beginDeleteDialog=function(){
this.listdialog(LTX("What scratchpad do you wish to delete?"),"cb_deletedialog");
};
this.cb_deletedialog=function(id){
this.initdialogs();
this.dialogs.list.hidePopup();
var pad=this.getpad(id);
if(!pad){
return;
}
if(!confirm(format(LTX("Are you sure you want to delete \"%1%\"?"),pad.title))){
return;
}
gBlowdart.send("scratchpad.delete",{"obj":this,"func":"cb_delete","timeout":1},id);
showWaitMessage(gLocale.DeletingScratchpad+"&hellip;");
};
this.cb_delete=function(_66,err,_68){
if(err){
_66=LTX("Unable to delete this scratchpad at this time.");
}
if(typeof _66=="string"){
hideWaitMessage();
alert(_66);
}else{
window.location.replace(unescape(window.location.pathname));
}
};
this.beginLogDialog=function(){
if(this.data.scratchpads.length==1){
this.cb_logdialog(id);
}else{
this.listdialog(LTX("Get log for scratchpad..."),"cb_logdialog");
}
};
this.cb_logdialog=function(id){
this.initdialogs();
this.dialogs.list.hidePopup();
var pad=this.getpad(id);
if(!pad){
return;
}
this.dialogs.log.showPopup();
var _6b=document.getElementById(this.id+"_item_loading");
var _6c=document.getElementById(this.id+"_dialog_log_body");
_6c.innerHTML=_6b.innerHTML;
_6c.style.paddingTop="40px";
gBlowdart.send("scratchpad.log.get",{"obj":this,"func":"cb_logdisplay","timeout":1},id,null,null);
};
this.cb_logdisplay=function(_6d,err,_6f){
this.initdialogs();
var _70=document.getElementById(this.id+"_dialog_log_body");
if(_6d==null||err){
_70.style.paddingTop="40px";
_6d="<center>"+LTX("Unable retrieve the log for this scratchpad")+"</center>";
}else{
if(typeof _6d=="object"&&typeof _6d.length=="number"){
_70.style.paddingTop="0px";
var i,obj,r=_6d;
_6d="<center><table cellspacing=\"0\" cellpadding=\"3\"><th width=\"100\" style=\"text-align: center; border-bottom: 1px solid #C0C0C0;\">"+LTX("Title")+"</th><th width=\"200\" style=\"text-align: center; border-bottom: 1px solid #C0C0C0;\">"+LTX("Time")+"</th><th style=\"text-align: center; border-bottom: 1px solid #C0C0C0;\" >"+LTX("Characters")+"</th><th width=\"80\" style=\"border-bottom: 1px solid #C0C0C0;\">&nbsp</th>";
for(i=0;i<r.length;i++){
obj=r[i];
_6d+="<tr><td><nobr>"+gTools.toHTML(obj.title)+"</nobr></td><td style=\"white-space: nowrap; text-align: center;\">"+obj.htmltime+"</td>"+"<td style=\"text-align: center;\">"+formatNumber(obj.length)+"</td>"+"<td style=\"text-align: right;\" class=\"bluebuttonlink\"><a href=\"javascript:;\" onclick=\""+this.me+".beginRevision("+obj.id+","+obj.revisionid+")\">"+LTX("View")+"</a></td></tr></center>";
}
_6d+="</table></center>";
}
}
_70.innerHTML=_6d;
};
this.beginRevision=function(id,_75){
this.initdialogs();
this.dialogs.revision.showPopup();
var _76=document.getElementById(this.id+"_item_loading");
var _77=document.getElementById(this.id+"_dialog_revision_body");
_77.innerHTML=_76.innerHTML;
_77.style.paddingTop="40px";
gBlowdart.send("scratchpad.revision.get",{"obj":this,"func":"cb_revisiondisplay","timeout":1},id,_75);
};
this.cb_revisiondisplay=function(_78,err,_7a){
this.initdialogs();
this.dialogs.log.hidePopup();
this.dialogs.revision.showPopup();
var _7b=document.getElementById(this.id+"_dialog_revision_body");
if(_78==null){
_7b.style.paddingTop="30px";
_7b.innerHTML="<center>"+LTX("Cannot get the revision at this time")+"</center";
}else{
_7b.style.paddingTop="0px";
_7b.innerHTML=(gTools.trim(_78)==""?"&nbsp;":gTools.toHTML(_78));
}
};
this.cb_revisioncancel=function(){
this.dialogs.revision.hidePopup();
this.dialogs.log.showPopup();
};
this.getpad=function(id){
var i,pad=null;
for(i=0;i<this.data.scratchpads.length;i++){
if(id==this.data.scratchpads[i].id){
pad=this.data.scratchpads[i];
break;
}
}
return pad;
};
this.cb_spellcheck=function(_7f){
if(this.area.pad){
this.area.pad.change(1000);
}
if(_7f!="apply"){
g_callback=null;
}
};
this.spellcheck=function(){
g_callback=new Function(this.me+".cb_spellcheck(arguments[0]);");
g_speller.initAll(new Array(this.area.dtextarea.id));
};
this.initData(_3b);
if(this.dmenu_td){
this.dmenu_td.style.visibility="";
}
this.dbar.style.display="";
};

