rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
return{title:i.lang.flash.title,minWidth:420,minHeight:310,onShow:function(){var z=this;z.fakeImage=z.objectNode=z.embedNode=null;l=new CKEDITOR.dom.element('embeded',i.document);var n=z.getSelectedElement();if(n&&n.getAttribute('_cke_real_element_type')&&n.getAttribute('_cke_real_element_type')=='flash'){z.fakeImage=n;var o=i.restoreRealElement(n),p=null,q=null,r={};if(o.getName()=='cke:object'){p=o;var s=p.getElementsByTag('embed','cke');if(s.count()>0)q=s.getItem(0);var t=p.getElementsByTag('param','cke');for(var u=0,v=t.count();u<v;u++){var w=t.getItem(u),x=w.getAttribute('name'),y=w.getAttribute('value');r[x]=y;}}else if(o.getName()=='cke:embed')q=o;z.objectNode=p;z.embedNode=q;z.setupContent(p,q,r,n);}},onOk:function(){var x=this;var n=null,o=null,p=null;if(!x.fakeImage){if(j){n=CKEDITOR.dom.element.createFromHtml('<cke:object></cke:object>',i.document);var q={classid:'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',codebase:'http: | return{title:i.lang.flash.title,minWidth:420,minHeight:310,onShow:function(){var z=this;z.fakeImage=z.objectNode=z.embedNode=null;l=new CKEDITOR.dom.element('embed',i.document);var n=z.getSelectedElement();if(n&&n.getAttribute('_cke_real_element_type')&&n.getAttribute('_cke_real_element_type')=='flash'){z.fakeImage=n;var o=i.restoreRealElement(n),p=null,q=null,r={};if(o.getName()=='cke:object'){p=o;var s=p.getElementsByTag('embed','cke');if(s.count()>0)q=s.getItem(0);var t=p.getElementsByTag('param','cke');for(var u=0,v=t.count();u<v;u++){var w=t.getItem(u),x=w.getAttribute('name'),y=w.getAttribute('value');r[x]=y;}}else if(o.getName()=='cke:embed')q=o;z.objectNode=p;z.embedNode=q;z.setupContent(p,q,r,n);}},onOk:function(){var x=this;var n=null,o=null,p=null;if(!x.fakeImage){if(j){n=CKEDITOR.dom.element.createFromHtml('<cke:object></cke:object>',i.document);var q={classid:'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',codebase:'http: | return{title:i.lang.flash.title,minWidth:420,minHeight:310,onShow:function(){var z=this;z.fakeImage=z.objectNode=z.embedNode=null;l=new CKEDITOR.dom.element('embeded',i.document);var n=z.getSelectedElement();if(n&&n.getAttribute('_cke_real_element_type')&&n.getAttribute('_cke_real_element_type')=='flash'){z.fakeImage=n;var o=i.restoreRealElement(n),p=null,q=null,r={};if(o.getName()=='cke:object'){p=o;var s=p.getElementsByTag('embed','cke');if(s.count()>0)q=s.getItem(0);var t=p.getElementsByTag('param','cke');for(var u=0,v=t.count();u<v;u++){var w=t.getItem(u),x=w.getAttribute('name'),y=w.getAttribute('value');r[x]=y;}}else if(o.getName()=='cke:embed')q=o;z.objectNode=p;z.embedNode=q;z.setupContent(p,q,r,n);}},onOk:function(){var x=this;var n=null,o=null,p=null;if(!x.fakeImage){if(j){n=CKEDITOR.dom.element.createFromHtml('<cke:object></cke:object>',i.document);var q={classid:'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',codebase:'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'};n.setAttributes(q);}if(k){o=CKEDITOR.dom.element.createFromHtml('<cke:embed></cke:embed>',i.document);o.setAttributes({type:'application/x-shockwave-flash',pluginspage:'http://www.macromedia.com/go/getflashplayer'});if(n)o.appendTo(n);}}else{n=x.objectNode;o=x.embedNode;}if(n){p={};var r=n.getElementsByTag('param','cke');for(var s=0,t=r.count();s<t;s++)p[r.getItem(s).getAttribute('name')]=r.getItem(s);}var u={},v={};x.commitContent(n,o,p,u,v);var w=i.createFakeElement(n||o,'cke_flash','flash',true);w.setAttributes(v);w.setStyles(u);if(x.fakeImage){w.replace(x.fakeImage);i.getSelection().selectElement(w);}else i.insertElement(w);},onHide:function(){if(this.preview)this.preview.setHtml('');},contents:[{id:'info',label:i.lang.common.generalTab,accessKey:'I',elements:[{type:'vbox',padding:0,children:[{type:'hbox',widths:['280px','110px'],align:'right',children:[{id:'src',type:'text',label:i.lang.common.url,required:true,validate:CKEDITOR.dialog.validate.notEmpty(i.lang.flash.validateSrc),setup:g,commit:h,onLoad:function(){var n=this.getDialog(),o=function(p){l.setAttribute('src',p);n.preview.setHtml('<embed height="100%" width="100%" src="'+CKEDITOR.tools.htmlEncode(l.getAttribute('src'))+'" type="application/x-shockwave-flash"></embed>');};n.preview=n.getContentElement('info','preview').getElement().getChild(3);this.on('change',function(p){if(p.data&&p.data.value)o(p.data.value);});this.getInputElement().on('change',function(p){o(this.getValue());},this); |
return this[fn ? "bind" : "trigger"]("oninvalid", fn); | return this[fn ? "bind" : "trigger"]("OI", fn); | $.fn.oninvalid = function( fn ){ return this[fn ? "bind" : "trigger"]("oninvalid", fn); }; |
keyCode = e.keyCode; | document.onkeydown = function (e){ var activeEl = document.activeElement, keyCode; /// Are there input boxes selected (not including images)? If so, this function should not be executed. ///NOTE: In the future, other elements, such as, TEXTAREA or buttons, may also need to be detected. if (activeEl.tagName == "INPUT" && activeEl.type != "image") { return; } /// Get the global event object for IE compatibility. /*@cc_on e = event; @*/ /// If a special key is also pressed, do not capture the storke. ///TODO: Determine if this works on Mac with the Command key. ///NOTE: It may be that the Command key is keyCode 91, and may need to be caught by another keydown event. ///NOTE: The meta key does not seem to be detected, and may need to do this checking manually, like for the Mac. if (e.ctrlKey || e.altKey || e.metaKey) { return; } keyCode = e.keyCode; /// Is the user pressing a key that should probably be entered into the input box? If so, highlight the query box so that the keystrokes will be captured. ///NOTE: 8 = Backspace /// 13 = Enter /// 32 = Space /// 48-90 = Alphanumeric /// 96-111 = Numpad keys /// 186-254 = Punctuation ///TODO: Determine if capturing Backspace and/Space is confusing because they have alternate functions (the back button and page down, respectively). /// One possible solution is to allow Shift, Ctrl, or Alt + Backspace or Space to be the normal action. if (keyCode == 8 || keyCode == 13 || keyCode == 32 || (keyCode > 47 && keyCode < 91) || (keyCode > 95 && keyCode < 112) || (keyCode > 185 && keyCode < 255)) { ///TODO: Determine which input box to select when split screen mode is implamented. /// One option would be to have a global select object. document.getElementById("q1").focus(); }}; |
|
if (e.ctrlKey || e.altKey || e.metaKey) { | if ((e.ctrlKey && keyCode != 86)|| e.altKey || e.metaKey) { | document.onkeydown = function (e){ var activeEl = document.activeElement, keyCode; /// Are there input boxes selected (not including images)? If so, this function should not be executed. ///NOTE: In the future, other elements, such as, TEXTAREA or buttons, may also need to be detected. if (activeEl.tagName == "INPUT" && activeEl.type != "image") { return; } /// Get the global event object for IE compatibility. /*@cc_on e = event; @*/ /// If a special key is also pressed, do not capture the storke. ///TODO: Determine if this works on Mac with the Command key. ///NOTE: It may be that the Command key is keyCode 91, and may need to be caught by another keydown event. ///NOTE: The meta key does not seem to be detected, and may need to do this checking manually, like for the Mac. if (e.ctrlKey || e.altKey || e.metaKey) { return; } keyCode = e.keyCode; /// Is the user pressing a key that should probably be entered into the input box? If so, highlight the query box so that the keystrokes will be captured. ///NOTE: 8 = Backspace /// 13 = Enter /// 32 = Space /// 48-90 = Alphanumeric /// 96-111 = Numpad keys /// 186-254 = Punctuation ///TODO: Determine if capturing Backspace and/Space is confusing because they have alternate functions (the back button and page down, respectively). /// One possible solution is to allow Shift, Ctrl, or Alt + Backspace or Space to be the normal action. if (keyCode == 8 || keyCode == 13 || keyCode == 32 || (keyCode > 47 && keyCode < 91) || (keyCode > 95 && keyCode < 112) || (keyCode > 185 && keyCode < 255)) { ///TODO: Determine which input box to select when split screen mode is implamented. /// One option would be to have a global select object. document.getElementById("q1").focus(); }}; |
keyCode = e.keyCode; | document.onkeydown = function (e){ var activeEl = document.activeElement, keyCode; /// Are there input boxes selected (not including images)? If so, this function should not be executed. ///NOTE: In the future, other elements, such as, TEXTAREA or buttons, may also need to be detected. if (activeEl.tagName == "INPUT" && activeEl.type != "image") { return; } /// Get the global event object for IE compatibility. /*@cc_on e = event; @*/ /// If a special key is also pressed, do not capture the storke. ///TODO: Determine if this works on Mac with the Command key. ///NOTE: It may be that the Command key is keyCode 91, and may need to be caught by another keydown event. ///NOTE: The meta key does not seem to be detected, and may need to do this checking manually, like for the Mac. if (e.ctrlKey || e.altKey || e.metaKey) { return; } keyCode = e.keyCode; /// Is the user pressing a key that should probably be entered into the input box? If so, highlight the query box so that the keystrokes will be captured. ///NOTE: 8 = Backspace /// 13 = Enter /// 32 = Space /// 48-90 = Alphanumeric /// 96-111 = Numpad keys /// 186-254 = Punctuation ///TODO: Determine if capturing Backspace and/Space is confusing because they have alternate functions (the back button and page down, respectively). /// One possible solution is to allow Shift, Ctrl, or Alt + Backspace or Space to be the normal action. if (keyCode == 8 || keyCode == 13 || keyCode == 32 || (keyCode > 47 && keyCode < 91) || (keyCode > 95 && keyCode < 112) || (keyCode > 185 && keyCode < 255)) { ///TODO: Determine which input box to select when split screen mode is implamented. /// One option would be to have a global select object. document.getElementById("q1").focus(); }}; |
|
if (keyCode == 8 || keyCode == 13 || keyCode == 32 || (keyCode > 47 && keyCode < 91) || (keyCode > 95 && keyCode < 112) || keyCode > 185) { | if (keyCode == 8 || keyCode == 13 || keyCode == 32 || (keyCode > 47 && keyCode < 91) || (keyCode > 95 && keyCode < 112) || (keyCode > 185 && keyCode < 255)) { | document.onkeydown = function (e){ var activeEl = document.activeElement, keyCode; /// Are there input boxes selected (not including images)? If so, this function should not be executed. ///NOTE: In the future, other elements, such as, TEXTAREA or buttons, may also need to be detected. if (activeEl.tagName == "INPUT" && activeEl.type != "image") { return; } /// Get the global event object for IE compatibility. /*@cc_on e = event; @*/ keyCode = e.keyCode; /// Is the user pressing a key that should probably be entered into the input box? If so, highlight the query box so that the keystrokes will be captured. ///NOTE: 8 = Backspace /// 13 = Enter /// 32 = Space /// 48-90 = Alphanumeric /// 96-111 = Numpad keys /// 186+ = Punctuation ///TODO: Determine if capturing Backspace and/Space is confusing because they have alternate functions (the back button and page down, respectively). /// One possible solution is to allow Shift, Ctrl, or Alt + Backspace or Space to be the normal action. if (keyCode == 8 || keyCode == 13 || keyCode == 32 || (keyCode > 47 && keyCode < 91) || (keyCode > 95 && keyCode < 112) || keyCode > 185) { ///TODO: Determine which input box to select when split screen mode is implamented. /// One option would be to have a global select object. document.getElementById("q1").focus(); }}; |
var currentEl = event.target || event.srcElement; | var currentEl = WT.target(event); | el.onkeydown=function(e) { var event = e||window.event; var leftKey = 37, upKey = 38, rightKey = 39, downKey = 40; if (event.keyCode == 9) { WT.cancelEvent(event); /* Find next/prev input element, first by row, then by column */ var item = getItem(event); if (!item.el) return; var col = item.el.parentNode, rowi = indexOf(item.el), coli = indexOf(col), cols = col.parentNode.childNodes.length, rows = col.childNodes.length, back = event.shiftKey, wrapped = false; var i = rowi, j; for (;;) { for (; back ? i >= 0 : i < rows; i = (back ? i-1 : i+1)) { if (i == rowi && !wrapped) j = back ? coli - 1 : coli + 1; else j = back ? cols - 1 : 0; for (; back ? j >= 0 : j < cols; j = (back ? j-1 : j+1)) { /* We have wrapped and arrived back at the beginning */ if (i == rowi && j == coli) return; col = col.parentNode.childNodes[j]; var elij = col.childNodes[i]; var inputs = $(elij).find(":input"); if (inputs.size() > 0) { setTimeout(function() { inputs.focus(); }, 0); return; } } } i = back ? rows - 1 : 0; wrapped = true; } } /* If keycode is up/down/right/left */ else if (event.keyCode >= leftKey && event.keyCode <= downKey) { var currentEl = event.target || event.srcElement; //do not allow arrow navigation from select if (currentEl.nodeName == 'select') return; var item = getItem(event); if (!item.el) return; var col = item.el.parentNode, rowi = indexOf(item.el), coli = indexOf(col), cols = col.parentNode.childNodes.length, rows = col.childNodes.length; switch (event.keyCode) { case rightKey: if (WT.hasTag(currentEl,'INPUT') && currentEl.type == 'text') { var range = WT.getSelectionRange(currentEl); if (range.start != currentEl.value.length) return; } coli++; break; case upKey: rowi--; break; case leftKey: if (WT.hasTag(currentEl,'INPUT') && currentEl.type == 'text') { var range = WT.getSelectionRange(currentEl); if (range.start != 0) return; } coli--; break; case downKey: rowi++; break; default: return; } WT.cancelEvent(event); if (rowi > -1 && rowi < rows && coli > -1 && coli < cols) { col = col.parentNode.childNodes[coli]; var elToSelect = col.childNodes[rowi]; var inputs = $(elToSelect).find(":input"); if (inputs.size() > 0) { setTimeout(function() { inputs.focus(); }, 0); return; } } } }; |
j,b,-2,-1)};this.scrolled=function(a,b,c,d){s=a;t=b;u=c;v=d};var m=null;j.handleDragDrop=function(a,b,c,d,k){if(m){m.className=m.classNameOrig;m=null}if(a!="end"){var g=q(c);if(!g.selected&&g.drop)if(a=="drop")n.emit(j,{name:"dropEvent",eventObject:b,event:c},g.rowIdx,g.columnId,d,k);else{b.className="Wt-valid-drop";m=g.el;m.classNameOrig=m.className;m.className+=" Wt-drop-site"}else b.className=""}};j.onkeydown=function(a){var b=a||window.event;if(b.keyCode==9){i.cancelEvent(b);var c=q(b);if(c.el){a= c.el.parentNode;c=r(c.el);var d=r(a),k=a.parentNode.childNodes.length,g=a.childNodes.length;b=b.shiftKey;for(var h=false,e=c,l;;){for(;b?e>=0:e<g;e=b?e-1:e+1)for(l=e==c&&!h?b?d-1:d+1:b?k-1:0;b?l>=0:l<k;l=b?l-1:l+1){if(e==c&&l==d)return;a=a.parentNode.childNodes[l];var o=$(a.childNodes[e]).find(":input");if(o.size()>0){setTimeout(function(){o.focus()},0);return}}e=b?g-1:0;h=true}}}else if(b.keyCode>=37&&b.keyCode<=40){h=b.target||b.srcElement;if(h.nodeName!="select"){c=q(b);if(c.el){a=c.el.parentNode; c=r(c.el);d=r(a);k=a.parentNode.childNodes.length;g=a.childNodes.length;switch(b.keyCode){case 39:if(i.hasTag(h,"INPUT")&&h.type=="text"){e=i.getSelectionRange(h);if(e.start!=h.value.length)return}d++;break;case 38:c--;break;case 37:if(i.hasTag(h,"INPUT")&&h.type=="text"){e=i.getSelectionRange(h);if(e.start!=0)return}d--;break;case 40:c++;break;default:return}i.cancelEvent(b);if(c>-1&&c<g&&d>-1&&d<k){a=a.parentNode.childNodes[d];o=$(a.childNodes[c]).find(":input");o.size()>0&&setTimeout(function(){o.focus()}, 0)}}}}};this.autoJavaScript=function(){if(j.parentNode==null){j=f=p=null;this.autoJavaScript=function(){}}else if(!i.isHidden(j)){var a=j.offsetWidth-i.px(j,"borderLeftWidth")-i.px(j,"borderRightWidth"),b=f.offsetWidth-f.clientWidth;a-=b;if(a>200&&a!=f.tw){f.tw=a;f.style.width=a+b+"px";p.style.width=a+"px"}}}}); | a;t=b;u=c;v=d};var m=null;h.handleDragDrop=function(a,b,c,d,k){if(m){m.className=m.classNameOrig;m=null}if(a!="end"){var g=q(c);if(!g.selected&&g.drop)if(a=="drop")n.emit(h,{name:"dropEvent",eventObject:b,event:c},g.rowIdx,g.columnId,d,k);else{b.className="Wt-valid-drop";m=g.el;m.classNameOrig=m.className;m.className+=" Wt-drop-site"}else b.className=""}};h.onkeydown=function(a){var b=a||window.event;if(b.keyCode==9){i.cancelEvent(b);var c=q(b);if(c.el){a=c.el.parentNode;c=r(c.el);var d=r(a),k=a.parentNode.childNodes.length, g=a.childNodes.length;b=b.shiftKey;for(var j=false,e=c,l;;){for(;b?e>=0:e<g;e=b?e-1:e+1)for(l=e==c&&!j?b?d-1:d+1:b?k-1:0;b?l>=0:l<k;l=b?l-1:l+1){if(e==c&&l==d)return;a=a.parentNode.childNodes[l];var o=$(a.childNodes[e]).find(":input");if(o.size()>0){setTimeout(function(){o.focus()},0);return}}e=b?g-1:0;j=true}}}else if(b.keyCode>=37&&b.keyCode<=40){j=b.target||b.srcElement;if(j.nodeName!="select"){c=q(b);if(c.el){a=c.el.parentNode;c=r(c.el);d=r(a);k=a.parentNode.childNodes.length;g=a.childNodes.length; switch(b.keyCode){case 39:if(i.hasTag(j,"INPUT")&&j.type=="text"){e=i.getSelectionRange(j);if(e.start!=j.value.length)return}d++;break;case 38:c--;break;case 37:if(i.hasTag(j,"INPUT")&&j.type=="text"){e=i.getSelectionRange(j);if(e.start!=0)return}d--;break;case 40:c++;break;default:return}i.cancelEvent(b);if(c>-1&&c<g&&d>-1&&d<k){a=a.parentNode.childNodes[d];o=$(a.childNodes[c]).find(":input");o.size()>0&&setTimeout(function(){o.focus()},0)}}}}};this.autoJavaScript=function(){if(h.parentNode==null){h= | j,b,-2,-1)};this.scrolled=function(a,b,c,d){s=a;t=b;u=c;v=d};var m=null;j.handleDragDrop=function(a,b,c,d,k){if(m){m.className=m.classNameOrig;m=null}if(a!="end"){var g=q(c);if(!g.selected&&g.drop)if(a=="drop")n.emit(j,{name:"dropEvent",eventObject:b,event:c},g.rowIdx,g.columnId,d,k);else{b.className="Wt-valid-drop";m=g.el;m.classNameOrig=m.className;m.className+=" Wt-drop-site"}else b.className=""}};j.onkeydown=function(a){var b=a||window.event;if(b.keyCode==9){i.cancelEvent(b);var c=q(b);if(c.el){a=c.el.parentNode;c=r(c.el);var d=r(a),k=a.parentNode.childNodes.length,g=a.childNodes.length;b=b.shiftKey;for(var h=false,e=c,l;;){for(;b?e>=0:e<g;e=b?e-1:e+1)for(l=e==c&&!h?b?d-1:d+1:b?k-1:0;b?l>=0:l<k;l=b?l-1:l+1){if(e==c&&l==d)return;a=a.parentNode.childNodes[l];var o=$(a.childNodes[e]).find(":input");if(o.size()>0){setTimeout(function(){o.focus()},0);return}}e=b?g-1:0;h=true}}}else if(b.keyCode>=37&&b.keyCode<=40){h=b.target||b.srcElement;if(h.nodeName!="select"){c=q(b);if(c.el){a=c.el.parentNode;c=r(c.el);d=r(a);k=a.parentNode.childNodes.length;g=a.childNodes.length;switch(b.keyCode){case 39:if(i.hasTag(h,"INPUT")&&h.type=="text"){e=i.getSelectionRange(h);if(e.start!=h.value.length)return}d++;break;case 38:c--;break;case 37:if(i.hasTag(h,"INPUT")&&h.type=="text"){e=i.getSelectionRange(h);if(e.start!=0)return}d--;break;case 40:c++;break;default:return}i.cancelEvent(b);if(c>-1&&c<g&&d>-1&&d<k){a=a.parentNode.childNodes[d];o=$(a.childNodes[c]).find(":input");o.size()>0&&setTimeout(function(){o.focus()},0)}}}}};this.autoJavaScript=function(){if(j.parentNode==null){j=f=p=null;this.autoJavaScript=function(){}}else if(!i.isHidden(j)){var a=j.offsetWidth-i.px(j,"borderLeftWidth")-i.px(j,"borderRightWidth"),b=f.offsetWidth-f.clientWidth;a-=b;if(a>200&&a!=f.tw){f.tw=a;f.style.width=a+b+"px";p.style.width=a+"px"}}}}); |
if (e.ctrlKey || e.altKey || e.metaKey) { return; } | document.onkeydown = function (e){ var activeEl = document.activeElement, keyCode; /// Are there input boxes selected (not including images)? If so, this function should not be executed. ///NOTE: In the future, other elements, such as, TEXTAREA or buttons, may also need to be detected. if (activeEl.tagName == "INPUT" && activeEl.type != "image") { return; } /// Get the global event object for IE compatibility. /*@cc_on e = event; @*/ keyCode = e.keyCode; /// Is the user pressing a key that should probably be entered into the input box? If so, highlight the query box so that the keystrokes will be captured. ///NOTE: 8 = Backspace /// 13 = Enter /// 32 = Space /// 48-90 = Alphanumeric /// 96-111 = Numpad keys /// 186-254 = Punctuation ///TODO: Determine if capturing Backspace and/Space is confusing because they have alternate functions (the back button and page down, respectively). /// One possible solution is to allow Shift, Ctrl, or Alt + Backspace or Space to be the normal action. if (keyCode == 8 || keyCode == 13 || keyCode == 32 || (keyCode > 47 && keyCode < 91) || (keyCode > 95 && keyCode < 112) || (keyCode > 185 && keyCode < 255)) { ///TODO: Determine which input box to select when split screen mode is implamented. /// One option would be to have a global select object. document.getElementById("q1").focus(); }}; |
|
var node = onlineList.firstChild; | var node = onlineList.getFirst(); | online : function() { //management of the online users list var onlineList ; //Actual Display List var lastId; var loadingRid; var currentRid = -1; var labelList = function() { var node = onlineList.firstChild; if (node) { var i = 0; do { node.removeClass('rowEven'); node.removeClass('rowOdd'); if( i%2 == 0) { node.addClass('rowEven'); } else { node.addClass('rowOdd'); } i++; } while (node = node.nextSibling); } }; var addUser = function (user) { var div =$('U'+user.uid); // Does this already exist? if(div) div.destroy(); //So remove him, because we need to recreate from scratch div = new Element('div', {'id': 'U'+user.uid}); var span = displayUser(user,div); if (user.wid && user.wid.toInt() != 0 ) { //This user is in a private room so maybe we don't display him if (user.uid != me.uid) { //Not me, but I might be in a whisper with them var whisperBox = $('W'+user.wid); if (!whisperBox) { return null; //not in any whisper box, so don't display } } span.addClass('priv'); //makes them Italic to show its private } else { if (room.type === 'M') { if (user.question) { span.addClass('ask'); } if (me.uid == user.uid) { if (user.question) { div.store('question',user.question); div.addClass('hasQuestion'); } } } } if (user.uid != me.uid && me.whisperer && ((me.role != 'B' && user.role != 'B') || ( me.role === 'B' && user.role === 'B' ))) { //BBs cannot be in whispers div.firstChild.addClass('whisperer'); div.addEvent('keydown', function(e) { if(!e.control) return; if(e.key == 'w') { e.stop(); var whisperBoxes = $$('.whisperBox'); if (whisperBoxes.every(function(whisperBox,i) { var widStr = whisperBox.get('id'); var whisperers = whisperBox.getElement('.whisperList').getChildren(); //gets users in whisper if (whisperers.length == 1) { //we only want to worry about this if only other person if (whisperers[0].get('id').substr(widStr.length+1).toInt() == user.uid) { return false; } } return true; })){ //If we get here we have not found that we already in a one on one whisper with this person, so now we have to create a new Whisper var getNewWhisperReq = new ServerReq('newwhisper.php',function(response) { if(response.wid != 0) { var user = response.user user.uid = user.uid.toInt(); var whisper = createWhisperBox(response.wid.toInt(),user); } }); getNewWhisperReq.transmit({'wuid':user.uid}); } } }); } var qtext = div.retrieve('question'); if (qtext) { div.inject(onlineList,'top') } else { div.inject(onlineList,'bottom'); } labelList(); return div; }; var removeUser = function (div) { //remove any question it might have var question = $('Q'+div.get('id').substr(1)); if (question) { question.destroy(); } div.destroy(); //removes from list labelList(); }; onlineReq = new ServerReq('online.php',function(response) { onlineList.removeClass('loading'); onlineList.addClass(room.type); currentRid = loadingRid; loadingRid = -1; onlineList.empty(); var users = response.online; if (users.length > 0 ) { users.each(function(user) { user.uid = user.uid.toInt(); addUser(user); }); } lastId = response.lastid.toInt(); MBchat.updateables.poller.setLastId(lastId); }); return { init: function () { onlineList = $('onlineList'); //Actual Display List lastId = null; currentRid = -1; }, show : function (rid) { onlineList.empty(); onlineList.erase('class'); onlineList.addClass('loading'); onlineReq.transmit({'rid':rid }); currentRid = -1; loadingRid = rid; }, getCurrentRid: function() { return currentRid; }, processMessage: function (msg) { if(!lastId) return; //not processing messages yet var lid = msg.lid; if (lastId < lid) { lastId = lid; userDiv = $('U'+msg.user.uid); var whisperer; switch (msg.type) { case 'LO' : case 'LT' : if (me.uid == msg.user.uid) { //Trying to log me off - log in again loginReq.transmit($merge({'mbchat':version},MooTools, {'browser':Browser.Engine.name+Browser.Engine.version, 'platform':Browser.Platform.name})); } else { if (userDiv) { removeUser(userDiv) } } break; case 'LX' : if (me.uid == msg.user.uid) { MBchat.logout(); //and go back to the forum window.location = 'forum.php' ; } break; case 'RX' : if (currentRid == 0) { if (!userDiv) { userDiv = addUser(msg.user); if (privateRoom != 0) { whisperer = $('W'+privateRoom+'U'+msg.user.uid); //Are we in a whisper if (whisperer) userDiv.addClass('priv'); } } } else { if (userDiv) { if (privateRoom == 0 ) { removeUser(userDiv); } else { if (!userDiv.hasClass('priv')) { removeUser(userDiv); //Only remove if not in the private room with this person } } } } break; case 'LI' : if (!userDiv && msg.rid == currentRid) { addUser(msg.user); //Can't be in a whisper so don't look } break; case 'RE' : if (currentRid != 0) { if (!userDiv && msg.rid == currentRid) { var user = msg.user; user.question = msg.message; userDiv = addUser(user); if (privateRoom != 0) { whisperer = $('W'+privateRoom+'U'+user.uid); //Are we in a whisper if (whisperer) userDiv.addClass('priv'); } } } else { if (userDiv) { if (privateRoom == 0 ) { removeUser(userDiv); } else { if (!userDiv.hasClass('priv')) { removeUser(userDiv); //Only remove if not in the private room with this person } } } } break; case 'MQ' : // User asks a question if(msg.rid == currentRid) { if (room.type == 'M' && (me.mod == 'M' || me.uid == msg.user.uid)) { var user = msg.user; user.question = msg.message; userDiv = addUser(user); } var span = userDiv.getElement('span'); span.addClass('ask'); } break; case 'MR' : case 'ME' : if(msg.rid == currentRid) { //A message from a user must mean he no longer has a question outstanding var span = userDiv.getElement('span'); span.removeClass('ask'); if (room.type == 'M' && (me.mod == 'M' || me.uid == msg.user.uid)) { addUser(msg.user); //there will be no question } } break; case 'RM' : // becomes moderator case 'RN' : // stops being moderator if(msg.rid == currentRid) { if (me.uid == msg.user.uid) { if (msg.user.role == 'M') { me.mod = 'M' } else { me.mod = 'N' } } // Given user is changing from mod to not or visa vera, need to remove and then re-add addUser(msg.user); } break; case 'PE' : var whisperBox = $('W' + msg.rid); if(userDiv) { //only relevent if we have this user if (msg.user.uid != me.uid) { //Not me, but I might be in a whisper with them if (!whisperBox) { MBchat.updateables.message.displayMessage(lastId,msg.time,chatBot,chatBotMessage(msg.user.name+' Leaves the Room')); removeUser(userDiv); } else { userDiv.addClass('priv'); } } else { if (room.rid == 0) { var messageList=$('chatList'); //I'm in entrance hall so have to make it look like a room messageList.removeClass('whisper'); messageList.addClass('chat'); $('inputContainer').set('styles',{ 'display':'block'}); $('entranceHall').set('styles',{'display':'none'}); } $('roomNameContainer').empty(); var el = new Element('h1',{'class':'privateRoom'}) .set('text', 'Private Room') .inject('roomNameContainer'); //remove P markers from all whisper boxes var privateMarkers= $$('.private'); privateMarkers.addClass('nonprivate'); privateMarkers.removeClass('private'); privateRoom = msg.rid.toInt(); var fellowWhisperers = whisperBox.getElement('.whisperList').getChildren(); var users = $('onlineList').getChildren(); users.each( function(user) { if (fellowWhisperers.some(function(item){ return this.get('id').substr(1) == item.get('id').substr(whisperBox.get('id').length+1); },user)) { user.addClass('priv'); } }); userDiv.addClass('priv'); $('messageText').focus(); whisperBox.setStyle('display','none'); $('content').setStyles(contentSize); } } else { // Add user to list if in a whisper (otherwise doesn't) var user = msg.user; user.wid = msg.rid; addUser(user); } break; case 'PX' : if (msg.user.uid == me.uid) { $('roomNameContainer').empty(); var el = new Element('h1') .set('text', room.name) .inject('roomNameContainer'); //Put private markers back on all whisper boxes var privateMarkers= $$('.nonprivate'); privateMarkers.addClass('private'); privateMarkers.removeClass('nonprivate'); MBchat.updateables.online.show(room.rid); //reshow the online list from scratch $('messageText').focus(); if (room.rid == 0) { var messageList=$('chatList'); //need to restore entrance hall messageList.removeClass('chat'); messageList.addClass('whisper'); $('inputContainer').set('styles',{ 'display':'none'}); $('entranceHall').set('styles',{'display':'block'}); } if($('W'+privateRoom)) { //need to make a whisper box with my whisperers in it (if still here). $('W'+privateRoom).setStyle('display','block'); } $('content').setStyles(contentSize); privateRoom = 0; } else { MBchat.updateables.message.displayMessage(lastId,msg.time,chatBot,chatBotMessage(msg.user.name+' Enters the Room')); addUser(msg.user); } break; case 'WJ' : if(privateRoom == msg.rid) { //only interested in people joining my private room userDiv = addUser(msg.user); userDiv.addClass('priv'); } break; case 'WL' : if(privateRoom == msg.rid) { //only interested in people leaving my private room userDiv.removeClass('priv');//TODO might need system that records with this user was only there because of the whisper and remove him completely } break; default : // ignore anything else break; } } } }; }(), |
} while (node = node.nextSibling); | } while (node = node.getNext()); | online : function() { //management of the online users list var onlineList ; //Actual Display List var lastId; var loadingRid; var currentRid = -1; var labelList = function() { var node = onlineList.firstChild; if (node) { var i = 0; do { node.removeClass('rowEven'); node.removeClass('rowOdd'); if( i%2 == 0) { node.addClass('rowEven'); } else { node.addClass('rowOdd'); } i++; } while (node = node.nextSibling); } }; var addUser = function (user) { var div =$('U'+user.uid); // Does this already exist? if(div) div.destroy(); //So remove him, because we need to recreate from scratch div = new Element('div', {'id': 'U'+user.uid}); var span = displayUser(user,div); if (user.wid && user.wid.toInt() != 0 ) { //This user is in a private room so maybe we don't display him if (user.uid != me.uid) { //Not me, but I might be in a whisper with them var whisperBox = $('W'+user.wid); if (!whisperBox) { return null; //not in any whisper box, so don't display } } span.addClass('priv'); //makes them Italic to show its private } else { if (room.type === 'M') { if (user.question) { span.addClass('ask'); } if (me.uid == user.uid) { if (user.question) { div.store('question',user.question); div.addClass('hasQuestion'); } } } } if (user.uid != me.uid && me.whisperer && ((me.role != 'B' && user.role != 'B') || ( me.role === 'B' && user.role === 'B' ))) { //BBs cannot be in whispers div.firstChild.addClass('whisperer'); div.addEvent('keydown', function(e) { if(!e.control) return; if(e.key == 'w') { e.stop(); var whisperBoxes = $$('.whisperBox'); if (whisperBoxes.every(function(whisperBox,i) { var widStr = whisperBox.get('id'); var whisperers = whisperBox.getElement('.whisperList').getChildren(); //gets users in whisper if (whisperers.length == 1) { //we only want to worry about this if only other person if (whisperers[0].get('id').substr(widStr.length+1).toInt() == user.uid) { return false; } } return true; })){ //If we get here we have not found that we already in a one on one whisper with this person, so now we have to create a new Whisper var getNewWhisperReq = new ServerReq('newwhisper.php',function(response) { if(response.wid != 0) { var user = response.user user.uid = user.uid.toInt(); var whisper = createWhisperBox(response.wid.toInt(),user); } }); getNewWhisperReq.transmit({'wuid':user.uid}); } } }); } var qtext = div.retrieve('question'); if (qtext) { div.inject(onlineList,'top') } else { div.inject(onlineList,'bottom'); } labelList(); return div; }; var removeUser = function (div) { //remove any question it might have var question = $('Q'+div.get('id').substr(1)); if (question) { question.destroy(); } div.destroy(); //removes from list labelList(); }; onlineReq = new ServerReq('online.php',function(response) { onlineList.removeClass('loading'); onlineList.addClass(room.type); currentRid = loadingRid; loadingRid = -1; onlineList.empty(); var users = response.online; if (users.length > 0 ) { users.each(function(user) { user.uid = user.uid.toInt(); addUser(user); }); } lastId = response.lastid.toInt(); MBchat.updateables.poller.setLastId(lastId); }); return { init: function () { onlineList = $('onlineList'); //Actual Display List lastId = null; currentRid = -1; }, show : function (rid) { onlineList.empty(); onlineList.erase('class'); onlineList.addClass('loading'); onlineReq.transmit({'rid':rid }); currentRid = -1; loadingRid = rid; }, getCurrentRid: function() { return currentRid; }, processMessage: function (msg) { if(!lastId) return; //not processing messages yet var lid = msg.lid; if (lastId < lid) { lastId = lid; userDiv = $('U'+msg.user.uid); var whisperer; switch (msg.type) { case 'LO' : case 'LT' : if (me.uid == msg.user.uid) { //Trying to log me off - log in again loginReq.transmit($merge({'mbchat':version},MooTools, {'browser':Browser.Engine.name+Browser.Engine.version, 'platform':Browser.Platform.name})); } else { if (userDiv) { removeUser(userDiv) } } break; case 'LX' : if (me.uid == msg.user.uid) { MBchat.logout(); //and go back to the forum window.location = 'forum.php' ; } break; case 'RX' : if (currentRid == 0) { if (!userDiv) { userDiv = addUser(msg.user); if (privateRoom != 0) { whisperer = $('W'+privateRoom+'U'+msg.user.uid); //Are we in a whisper if (whisperer) userDiv.addClass('priv'); } } } else { if (userDiv) { if (privateRoom == 0 ) { removeUser(userDiv); } else { if (!userDiv.hasClass('priv')) { removeUser(userDiv); //Only remove if not in the private room with this person } } } } break; case 'LI' : if (!userDiv && msg.rid == currentRid) { addUser(msg.user); //Can't be in a whisper so don't look } break; case 'RE' : if (currentRid != 0) { if (!userDiv && msg.rid == currentRid) { var user = msg.user; user.question = msg.message; userDiv = addUser(user); if (privateRoom != 0) { whisperer = $('W'+privateRoom+'U'+user.uid); //Are we in a whisper if (whisperer) userDiv.addClass('priv'); } } } else { if (userDiv) { if (privateRoom == 0 ) { removeUser(userDiv); } else { if (!userDiv.hasClass('priv')) { removeUser(userDiv); //Only remove if not in the private room with this person } } } } break; case 'MQ' : // User asks a question if(msg.rid == currentRid) { if (room.type == 'M' && (me.mod == 'M' || me.uid == msg.user.uid)) { var user = msg.user; user.question = msg.message; userDiv = addUser(user); } var span = userDiv.getElement('span'); span.addClass('ask'); } break; case 'MR' : case 'ME' : if(msg.rid == currentRid) { //A message from a user must mean he no longer has a question outstanding var span = userDiv.getElement('span'); span.removeClass('ask'); if (room.type == 'M' && (me.mod == 'M' || me.uid == msg.user.uid)) { addUser(msg.user); //there will be no question } } break; case 'RM' : // becomes moderator case 'RN' : // stops being moderator if(msg.rid == currentRid) { if (me.uid == msg.user.uid) { if (msg.user.role == 'M') { me.mod = 'M' } else { me.mod = 'N' } } // Given user is changing from mod to not or visa vera, need to remove and then re-add addUser(msg.user); } break; case 'PE' : var whisperBox = $('W' + msg.rid); if(userDiv) { //only relevent if we have this user if (msg.user.uid != me.uid) { //Not me, but I might be in a whisper with them if (!whisperBox) { MBchat.updateables.message.displayMessage(lastId,msg.time,chatBot,chatBotMessage(msg.user.name+' Leaves the Room')); removeUser(userDiv); } else { userDiv.addClass('priv'); } } else { if (room.rid == 0) { var messageList=$('chatList'); //I'm in entrance hall so have to make it look like a room messageList.removeClass('whisper'); messageList.addClass('chat'); $('inputContainer').set('styles',{ 'display':'block'}); $('entranceHall').set('styles',{'display':'none'}); } $('roomNameContainer').empty(); var el = new Element('h1',{'class':'privateRoom'}) .set('text', 'Private Room') .inject('roomNameContainer'); //remove P markers from all whisper boxes var privateMarkers= $$('.private'); privateMarkers.addClass('nonprivate'); privateMarkers.removeClass('private'); privateRoom = msg.rid.toInt(); var fellowWhisperers = whisperBox.getElement('.whisperList').getChildren(); var users = $('onlineList').getChildren(); users.each( function(user) { if (fellowWhisperers.some(function(item){ return this.get('id').substr(1) == item.get('id').substr(whisperBox.get('id').length+1); },user)) { user.addClass('priv'); } }); userDiv.addClass('priv'); $('messageText').focus(); whisperBox.setStyle('display','none'); $('content').setStyles(contentSize); } } else { // Add user to list if in a whisper (otherwise doesn't) var user = msg.user; user.wid = msg.rid; addUser(user); } break; case 'PX' : if (msg.user.uid == me.uid) { $('roomNameContainer').empty(); var el = new Element('h1') .set('text', room.name) .inject('roomNameContainer'); //Put private markers back on all whisper boxes var privateMarkers= $$('.nonprivate'); privateMarkers.addClass('private'); privateMarkers.removeClass('nonprivate'); MBchat.updateables.online.show(room.rid); //reshow the online list from scratch $('messageText').focus(); if (room.rid == 0) { var messageList=$('chatList'); //need to restore entrance hall messageList.removeClass('chat'); messageList.addClass('whisper'); $('inputContainer').set('styles',{ 'display':'none'}); $('entranceHall').set('styles',{'display':'block'}); } if($('W'+privateRoom)) { //need to make a whisper box with my whisperers in it (if still here). $('W'+privateRoom).setStyle('display','block'); } $('content').setStyles(contentSize); privateRoom = 0; } else { MBchat.updateables.message.displayMessage(lastId,msg.time,chatBot,chatBotMessage(msg.user.name+' Enters the Room')); addUser(msg.user); } break; case 'WJ' : if(privateRoom == msg.rid) { //only interested in people joining my private room userDiv = addUser(msg.user); userDiv.addClass('priv'); } break; case 'WL' : if(privateRoom == msg.rid) { //only interested in people leaving my private room userDiv.removeClass('priv');//TODO might need system that records with this user was only there because of the whisper and remove him completely } break; default : // ignore anything else break; } } } }; }(), |
div.firstChild.addClass('whisperer'); | div.getFirst().addClass('whisperer'); | online : function() { //management of the online users list var onlineList ; //Actual Display List var lastId; var loadingRid; var currentRid = -1; var labelList = function() { var node = onlineList.firstChild; if (node) { var i = 0; do { node.removeClass('rowEven'); node.removeClass('rowOdd'); if( i%2 == 0) { node.addClass('rowEven'); } else { node.addClass('rowOdd'); } i++; } while (node = node.nextSibling); } }; var addUser = function (user) { var div =$('U'+user.uid); // Does this already exist? if(div) div.destroy(); //So remove him, because we need to recreate from scratch div = new Element('div', {'id': 'U'+user.uid}); var span = displayUser(user,div); if (user.wid && user.wid.toInt() != 0 ) { //This user is in a private room so maybe we don't display him if (user.uid != me.uid) { //Not me, but I might be in a whisper with them var whisperBox = $('W'+user.wid); if (!whisperBox) { return null; //not in any whisper box, so don't display } } span.addClass('priv'); //makes them Italic to show its private } else { if (room.type === 'M') { if (user.question) { span.addClass('ask'); } if (me.uid == user.uid) { if (user.question) { div.store('question',user.question); div.addClass('hasQuestion'); } } } } if (user.uid != me.uid && me.whisperer && ((me.role != 'B' && user.role != 'B') || ( me.role === 'B' && user.role === 'B' ))) { //BBs cannot be in whispers div.firstChild.addClass('whisperer'); div.addEvent('keydown', function(e) { if(!e.control) return; if(e.key == 'w') { e.stop(); var whisperBoxes = $$('.whisperBox'); if (whisperBoxes.every(function(whisperBox,i) { var widStr = whisperBox.get('id'); var whisperers = whisperBox.getElement('.whisperList').getChildren(); //gets users in whisper if (whisperers.length == 1) { //we only want to worry about this if only other person if (whisperers[0].get('id').substr(widStr.length+1).toInt() == user.uid) { return false; } } return true; })){ //If we get here we have not found that we already in a one on one whisper with this person, so now we have to create a new Whisper var getNewWhisperReq = new ServerReq('newwhisper.php',function(response) { if(response.wid != 0) { var user = response.user user.uid = user.uid.toInt(); var whisper = createWhisperBox(response.wid.toInt(),user); } }); getNewWhisperReq.transmit({'wuid':user.uid}); } } }); } var qtext = div.retrieve('question'); if (qtext) { div.inject(onlineList,'top') } else { div.inject(onlineList,'bottom'); } labelList(); return div; }; var removeUser = function (div) { //remove any question it might have var question = $('Q'+div.get('id').substr(1)); if (question) { question.destroy(); } div.destroy(); //removes from list labelList(); }; onlineReq = new ServerReq('online.php',function(response) { onlineList.removeClass('loading'); onlineList.addClass(room.type); currentRid = loadingRid; loadingRid = -1; onlineList.empty(); var users = response.online; if (users.length > 0 ) { users.each(function(user) { user.uid = user.uid.toInt(); addUser(user); }); } lastId = response.lastid.toInt(); MBchat.updateables.poller.setLastId(lastId); }); return { init: function () { onlineList = $('onlineList'); //Actual Display List lastId = null; currentRid = -1; }, show : function (rid) { onlineList.empty(); onlineList.erase('class'); onlineList.addClass('loading'); onlineReq.transmit({'rid':rid }); currentRid = -1; loadingRid = rid; }, getCurrentRid: function() { return currentRid; }, processMessage: function (msg) { if(!lastId) return; //not processing messages yet var lid = msg.lid; if (lastId < lid) { lastId = lid; userDiv = $('U'+msg.user.uid); var whisperer; switch (msg.type) { case 'LO' : case 'LT' : if (me.uid == msg.user.uid) { //Trying to log me off - log in again loginReq.transmit($merge({'mbchat':version},MooTools, {'browser':Browser.Engine.name+Browser.Engine.version, 'platform':Browser.Platform.name})); } else { if (userDiv) { removeUser(userDiv) } } break; case 'LX' : if (me.uid == msg.user.uid) { MBchat.logout(); //and go back to the forum window.location = 'forum.php' ; } break; case 'RX' : if (currentRid == 0) { if (!userDiv) { userDiv = addUser(msg.user); if (privateRoom != 0) { whisperer = $('W'+privateRoom+'U'+msg.user.uid); //Are we in a whisper if (whisperer) userDiv.addClass('priv'); } } } else { if (userDiv) { if (privateRoom == 0 ) { removeUser(userDiv); } else { if (!userDiv.hasClass('priv')) { removeUser(userDiv); //Only remove if not in the private room with this person } } } } break; case 'LI' : if (!userDiv && msg.rid == currentRid) { addUser(msg.user); //Can't be in a whisper so don't look } break; case 'RE' : if (currentRid != 0) { if (!userDiv && msg.rid == currentRid) { var user = msg.user; user.question = msg.message; userDiv = addUser(user); if (privateRoom != 0) { whisperer = $('W'+privateRoom+'U'+user.uid); //Are we in a whisper if (whisperer) userDiv.addClass('priv'); } } } else { if (userDiv) { if (privateRoom == 0 ) { removeUser(userDiv); } else { if (!userDiv.hasClass('priv')) { removeUser(userDiv); //Only remove if not in the private room with this person } } } } break; case 'MQ' : // User asks a question if(msg.rid == currentRid) { if (room.type == 'M' && (me.mod == 'M' || me.uid == msg.user.uid)) { var user = msg.user; user.question = msg.message; userDiv = addUser(user); } var span = userDiv.getElement('span'); span.addClass('ask'); } break; case 'MR' : case 'ME' : if(msg.rid == currentRid) { //A message from a user must mean he no longer has a question outstanding var span = userDiv.getElement('span'); span.removeClass('ask'); if (room.type == 'M' && (me.mod == 'M' || me.uid == msg.user.uid)) { addUser(msg.user); //there will be no question } } break; case 'RM' : // becomes moderator case 'RN' : // stops being moderator if(msg.rid == currentRid) { if (me.uid == msg.user.uid) { if (msg.user.role == 'M') { me.mod = 'M' } else { me.mod = 'N' } } // Given user is changing from mod to not or visa vera, need to remove and then re-add addUser(msg.user); } break; case 'PE' : var whisperBox = $('W' + msg.rid); if(userDiv) { //only relevent if we have this user if (msg.user.uid != me.uid) { //Not me, but I might be in a whisper with them if (!whisperBox) { MBchat.updateables.message.displayMessage(lastId,msg.time,chatBot,chatBotMessage(msg.user.name+' Leaves the Room')); removeUser(userDiv); } else { userDiv.addClass('priv'); } } else { if (room.rid == 0) { var messageList=$('chatList'); //I'm in entrance hall so have to make it look like a room messageList.removeClass('whisper'); messageList.addClass('chat'); $('inputContainer').set('styles',{ 'display':'block'}); $('entranceHall').set('styles',{'display':'none'}); } $('roomNameContainer').empty(); var el = new Element('h1',{'class':'privateRoom'}) .set('text', 'Private Room') .inject('roomNameContainer'); //remove P markers from all whisper boxes var privateMarkers= $$('.private'); privateMarkers.addClass('nonprivate'); privateMarkers.removeClass('private'); privateRoom = msg.rid.toInt(); var fellowWhisperers = whisperBox.getElement('.whisperList').getChildren(); var users = $('onlineList').getChildren(); users.each( function(user) { if (fellowWhisperers.some(function(item){ return this.get('id').substr(1) == item.get('id').substr(whisperBox.get('id').length+1); },user)) { user.addClass('priv'); } }); userDiv.addClass('priv'); $('messageText').focus(); whisperBox.setStyle('display','none'); $('content').setStyles(contentSize); } } else { // Add user to list if in a whisper (otherwise doesn't) var user = msg.user; user.wid = msg.rid; addUser(user); } break; case 'PX' : if (msg.user.uid == me.uid) { $('roomNameContainer').empty(); var el = new Element('h1') .set('text', room.name) .inject('roomNameContainer'); //Put private markers back on all whisper boxes var privateMarkers= $$('.nonprivate'); privateMarkers.addClass('private'); privateMarkers.removeClass('nonprivate'); MBchat.updateables.online.show(room.rid); //reshow the online list from scratch $('messageText').focus(); if (room.rid == 0) { var messageList=$('chatList'); //need to restore entrance hall messageList.removeClass('chat'); messageList.addClass('whisper'); $('inputContainer').set('styles',{ 'display':'none'}); $('entranceHall').set('styles',{'display':'block'}); } if($('W'+privateRoom)) { //need to make a whisper box with my whisperers in it (if still here). $('W'+privateRoom).setStyle('display','block'); } $('content').setStyles(contentSize); privateRoom = 0; } else { MBchat.updateables.message.displayMessage(lastId,msg.time,chatBot,chatBotMessage(msg.user.name+' Enters the Room')); addUser(msg.user); } break; case 'WJ' : if(privateRoom == msg.rid) { //only interested in people joining my private room userDiv = addUser(msg.user); userDiv.addClass('priv'); } break; case 'WL' : if(privateRoom == msg.rid) { //only interested in people leaving my private room userDiv.removeClass('priv');//TODO might need system that records with this user was only there because of the whisper and remove him completely } break; default : // ignore anything else break; } } } }; }(), |
div.inject(onlineList,'top') | div.inject.delay(10,div,[onlineList,'top']); | online : function() { //management of the online users list var onlineList ; //Actual Display List var lastId; var loadingRid; var currentRid = -1; var labelList = function() { var node = onlineList.firstChild; if (node) { var i = 0; do { node.removeClass('rowEven'); node.removeClass('rowOdd'); if( i%2 == 0) { node.addClass('rowEven'); } else { node.addClass('rowOdd'); } i++; } while (node = node.nextSibling); } }; var addUser = function (user) { var div =$('U'+user.uid); // Does this already exist? if(div) div.destroy(); //So remove him, because we need to recreate from scratch div = new Element('div', {'id': 'U'+user.uid}); var span = displayUser(user,div); if (user.wid && user.wid.toInt() != 0 ) { //This user is in a private room so maybe we don't display him if (user.uid != me.uid) { //Not me, but I might be in a whisper with them var whisperBox = $('W'+user.wid); if (!whisperBox) { return null; //not in any whisper box, so don't display } } span.addClass('priv'); //makes them Italic to show its private } else { if (room.type === 'M') { if (user.question) { span.addClass('ask'); } if (me.uid == user.uid) { if (user.question) { div.store('question',user.question); div.addClass('hasQuestion'); } } } } if (user.uid != me.uid && me.whisperer && ((me.role != 'B' && user.role != 'B') || ( me.role === 'B' && user.role === 'B' ))) { //BBs cannot be in whispers div.firstChild.addClass('whisperer'); div.addEvent('keydown', function(e) { if(!e.control) return; if(e.key == 'w') { e.stop(); var whisperBoxes = $$('.whisperBox'); if (whisperBoxes.every(function(whisperBox,i) { var widStr = whisperBox.get('id'); var whisperers = whisperBox.getElement('.whisperList').getChildren(); //gets users in whisper if (whisperers.length == 1) { //we only want to worry about this if only other person if (whisperers[0].get('id').substr(widStr.length+1).toInt() == user.uid) { return false; } } return true; })){ //If we get here we have not found that we already in a one on one whisper with this person, so now we have to create a new Whisper var getNewWhisperReq = new ServerReq('newwhisper.php',function(response) { if(response.wid != 0) { var user = response.user user.uid = user.uid.toInt(); var whisper = createWhisperBox(response.wid.toInt(),user); } }); getNewWhisperReq.transmit({'wuid':user.uid}); } } }); } var qtext = div.retrieve('question'); if (qtext) { div.inject(onlineList,'top') } else { div.inject(onlineList,'bottom'); } labelList(); return div; }; var removeUser = function (div) { //remove any question it might have var question = $('Q'+div.get('id').substr(1)); if (question) { question.destroy(); } div.destroy(); //removes from list labelList(); }; onlineReq = new ServerReq('online.php',function(response) { onlineList.removeClass('loading'); onlineList.addClass(room.type); currentRid = loadingRid; loadingRid = -1; onlineList.empty(); var users = response.online; if (users.length > 0 ) { users.each(function(user) { user.uid = user.uid.toInt(); addUser(user); }); } lastId = response.lastid.toInt(); MBchat.updateables.poller.setLastId(lastId); }); return { init: function () { onlineList = $('onlineList'); //Actual Display List lastId = null; currentRid = -1; }, show : function (rid) { onlineList.empty(); onlineList.erase('class'); onlineList.addClass('loading'); onlineReq.transmit({'rid':rid }); currentRid = -1; loadingRid = rid; }, getCurrentRid: function() { return currentRid; }, processMessage: function (msg) { if(!lastId) return; //not processing messages yet var lid = msg.lid; if (lastId < lid) { lastId = lid; userDiv = $('U'+msg.user.uid); var whisperer; switch (msg.type) { case 'LO' : case 'LT' : if (me.uid == msg.user.uid) { //Trying to log me off - log in again loginReq.transmit($merge({'mbchat':version},MooTools, {'browser':Browser.Engine.name+Browser.Engine.version, 'platform':Browser.Platform.name})); } else { if (userDiv) { removeUser(userDiv) } } break; case 'LX' : if (me.uid == msg.user.uid) { MBchat.logout(); //and go back to the forum window.location = 'forum.php' ; } break; case 'RX' : if (currentRid == 0) { if (!userDiv) { userDiv = addUser(msg.user); if (privateRoom != 0) { whisperer = $('W'+privateRoom+'U'+msg.user.uid); //Are we in a whisper if (whisperer) userDiv.addClass('priv'); } } } else { if (userDiv) { if (privateRoom == 0 ) { removeUser(userDiv); } else { if (!userDiv.hasClass('priv')) { removeUser(userDiv); //Only remove if not in the private room with this person } } } } break; case 'LI' : if (!userDiv && msg.rid == currentRid) { addUser(msg.user); //Can't be in a whisper so don't look } break; case 'RE' : if (currentRid != 0) { if (!userDiv && msg.rid == currentRid) { var user = msg.user; user.question = msg.message; userDiv = addUser(user); if (privateRoom != 0) { whisperer = $('W'+privateRoom+'U'+user.uid); //Are we in a whisper if (whisperer) userDiv.addClass('priv'); } } } else { if (userDiv) { if (privateRoom == 0 ) { removeUser(userDiv); } else { if (!userDiv.hasClass('priv')) { removeUser(userDiv); //Only remove if not in the private room with this person } } } } break; case 'MQ' : // User asks a question if(msg.rid == currentRid) { if (room.type == 'M' && (me.mod == 'M' || me.uid == msg.user.uid)) { var user = msg.user; user.question = msg.message; userDiv = addUser(user); } var span = userDiv.getElement('span'); span.addClass('ask'); } break; case 'MR' : case 'ME' : if(msg.rid == currentRid) { //A message from a user must mean he no longer has a question outstanding var span = userDiv.getElement('span'); span.removeClass('ask'); if (room.type == 'M' && (me.mod == 'M' || me.uid == msg.user.uid)) { addUser(msg.user); //there will be no question } } break; case 'RM' : // becomes moderator case 'RN' : // stops being moderator if(msg.rid == currentRid) { if (me.uid == msg.user.uid) { if (msg.user.role == 'M') { me.mod = 'M' } else { me.mod = 'N' } } // Given user is changing from mod to not or visa vera, need to remove and then re-add addUser(msg.user); } break; case 'PE' : var whisperBox = $('W' + msg.rid); if(userDiv) { //only relevent if we have this user if (msg.user.uid != me.uid) { //Not me, but I might be in a whisper with them if (!whisperBox) { MBchat.updateables.message.displayMessage(lastId,msg.time,chatBot,chatBotMessage(msg.user.name+' Leaves the Room')); removeUser(userDiv); } else { userDiv.addClass('priv'); } } else { if (room.rid == 0) { var messageList=$('chatList'); //I'm in entrance hall so have to make it look like a room messageList.removeClass('whisper'); messageList.addClass('chat'); $('inputContainer').set('styles',{ 'display':'block'}); $('entranceHall').set('styles',{'display':'none'}); } $('roomNameContainer').empty(); var el = new Element('h1',{'class':'privateRoom'}) .set('text', 'Private Room') .inject('roomNameContainer'); //remove P markers from all whisper boxes var privateMarkers= $$('.private'); privateMarkers.addClass('nonprivate'); privateMarkers.removeClass('private'); privateRoom = msg.rid.toInt(); var fellowWhisperers = whisperBox.getElement('.whisperList').getChildren(); var users = $('onlineList').getChildren(); users.each( function(user) { if (fellowWhisperers.some(function(item){ return this.get('id').substr(1) == item.get('id').substr(whisperBox.get('id').length+1); },user)) { user.addClass('priv'); } }); userDiv.addClass('priv'); $('messageText').focus(); whisperBox.setStyle('display','none'); $('content').setStyles(contentSize); } } else { // Add user to list if in a whisper (otherwise doesn't) var user = msg.user; user.wid = msg.rid; addUser(user); } break; case 'PX' : if (msg.user.uid == me.uid) { $('roomNameContainer').empty(); var el = new Element('h1') .set('text', room.name) .inject('roomNameContainer'); //Put private markers back on all whisper boxes var privateMarkers= $$('.nonprivate'); privateMarkers.addClass('private'); privateMarkers.removeClass('nonprivate'); MBchat.updateables.online.show(room.rid); //reshow the online list from scratch $('messageText').focus(); if (room.rid == 0) { var messageList=$('chatList'); //need to restore entrance hall messageList.removeClass('chat'); messageList.addClass('whisper'); $('inputContainer').set('styles',{ 'display':'none'}); $('entranceHall').set('styles',{'display':'block'}); } if($('W'+privateRoom)) { //need to make a whisper box with my whisperers in it (if still here). $('W'+privateRoom).setStyle('display','block'); } $('content').setStyles(contentSize); privateRoom = 0; } else { MBchat.updateables.message.displayMessage(lastId,msg.time,chatBot,chatBotMessage(msg.user.name+' Enters the Room')); addUser(msg.user); } break; case 'WJ' : if(privateRoom == msg.rid) { //only interested in people joining my private room userDiv = addUser(msg.user); userDiv.addClass('priv'); } break; case 'WL' : if(privateRoom == msg.rid) { //only interested in people leaving my private room userDiv.removeClass('priv');//TODO might need system that records with this user was only there because of the whisper and remove him completely } break; default : // ignore anything else break; } } } }; }(), |
div.inject(onlineList,'bottom'); | div.inject.delay(10,div,[onlineList,'bottom']); | online : function() { //management of the online users list var onlineList ; //Actual Display List var lastId; var loadingRid; var currentRid = -1; var labelList = function() { var node = onlineList.firstChild; if (node) { var i = 0; do { node.removeClass('rowEven'); node.removeClass('rowOdd'); if( i%2 == 0) { node.addClass('rowEven'); } else { node.addClass('rowOdd'); } i++; } while (node = node.nextSibling); } }; var addUser = function (user) { var div =$('U'+user.uid); // Does this already exist? if(div) div.destroy(); //So remove him, because we need to recreate from scratch div = new Element('div', {'id': 'U'+user.uid}); var span = displayUser(user,div); if (user.wid && user.wid.toInt() != 0 ) { //This user is in a private room so maybe we don't display him if (user.uid != me.uid) { //Not me, but I might be in a whisper with them var whisperBox = $('W'+user.wid); if (!whisperBox) { return null; //not in any whisper box, so don't display } } span.addClass('priv'); //makes them Italic to show its private } else { if (room.type === 'M') { if (user.question) { span.addClass('ask'); } if (me.uid == user.uid) { if (user.question) { div.store('question',user.question); div.addClass('hasQuestion'); } } } } if (user.uid != me.uid && me.whisperer && ((me.role != 'B' && user.role != 'B') || ( me.role === 'B' && user.role === 'B' ))) { //BBs cannot be in whispers div.firstChild.addClass('whisperer'); div.addEvent('keydown', function(e) { if(!e.control) return; if(e.key == 'w') { e.stop(); var whisperBoxes = $$('.whisperBox'); if (whisperBoxes.every(function(whisperBox,i) { var widStr = whisperBox.get('id'); var whisperers = whisperBox.getElement('.whisperList').getChildren(); //gets users in whisper if (whisperers.length == 1) { //we only want to worry about this if only other person if (whisperers[0].get('id').substr(widStr.length+1).toInt() == user.uid) { return false; } } return true; })){ //If we get here we have not found that we already in a one on one whisper with this person, so now we have to create a new Whisper var getNewWhisperReq = new ServerReq('newwhisper.php',function(response) { if(response.wid != 0) { var user = response.user user.uid = user.uid.toInt(); var whisper = createWhisperBox(response.wid.toInt(),user); } }); getNewWhisperReq.transmit({'wuid':user.uid}); } } }); } var qtext = div.retrieve('question'); if (qtext) { div.inject(onlineList,'top') } else { div.inject(onlineList,'bottom'); } labelList(); return div; }; var removeUser = function (div) { //remove any question it might have var question = $('Q'+div.get('id').substr(1)); if (question) { question.destroy(); } div.destroy(); //removes from list labelList(); }; onlineReq = new ServerReq('online.php',function(response) { onlineList.removeClass('loading'); onlineList.addClass(room.type); currentRid = loadingRid; loadingRid = -1; onlineList.empty(); var users = response.online; if (users.length > 0 ) { users.each(function(user) { user.uid = user.uid.toInt(); addUser(user); }); } lastId = response.lastid.toInt(); MBchat.updateables.poller.setLastId(lastId); }); return { init: function () { onlineList = $('onlineList'); //Actual Display List lastId = null; currentRid = -1; }, show : function (rid) { onlineList.empty(); onlineList.erase('class'); onlineList.addClass('loading'); onlineReq.transmit({'rid':rid }); currentRid = -1; loadingRid = rid; }, getCurrentRid: function() { return currentRid; }, processMessage: function (msg) { if(!lastId) return; //not processing messages yet var lid = msg.lid; if (lastId < lid) { lastId = lid; userDiv = $('U'+msg.user.uid); var whisperer; switch (msg.type) { case 'LO' : case 'LT' : if (me.uid == msg.user.uid) { //Trying to log me off - log in again loginReq.transmit($merge({'mbchat':version},MooTools, {'browser':Browser.Engine.name+Browser.Engine.version, 'platform':Browser.Platform.name})); } else { if (userDiv) { removeUser(userDiv) } } break; case 'LX' : if (me.uid == msg.user.uid) { MBchat.logout(); //and go back to the forum window.location = 'forum.php' ; } break; case 'RX' : if (currentRid == 0) { if (!userDiv) { userDiv = addUser(msg.user); if (privateRoom != 0) { whisperer = $('W'+privateRoom+'U'+msg.user.uid); //Are we in a whisper if (whisperer) userDiv.addClass('priv'); } } } else { if (userDiv) { if (privateRoom == 0 ) { removeUser(userDiv); } else { if (!userDiv.hasClass('priv')) { removeUser(userDiv); //Only remove if not in the private room with this person } } } } break; case 'LI' : if (!userDiv && msg.rid == currentRid) { addUser(msg.user); //Can't be in a whisper so don't look } break; case 'RE' : if (currentRid != 0) { if (!userDiv && msg.rid == currentRid) { var user = msg.user; user.question = msg.message; userDiv = addUser(user); if (privateRoom != 0) { whisperer = $('W'+privateRoom+'U'+user.uid); //Are we in a whisper if (whisperer) userDiv.addClass('priv'); } } } else { if (userDiv) { if (privateRoom == 0 ) { removeUser(userDiv); } else { if (!userDiv.hasClass('priv')) { removeUser(userDiv); //Only remove if not in the private room with this person } } } } break; case 'MQ' : // User asks a question if(msg.rid == currentRid) { if (room.type == 'M' && (me.mod == 'M' || me.uid == msg.user.uid)) { var user = msg.user; user.question = msg.message; userDiv = addUser(user); } var span = userDiv.getElement('span'); span.addClass('ask'); } break; case 'MR' : case 'ME' : if(msg.rid == currentRid) { //A message from a user must mean he no longer has a question outstanding var span = userDiv.getElement('span'); span.removeClass('ask'); if (room.type == 'M' && (me.mod == 'M' || me.uid == msg.user.uid)) { addUser(msg.user); //there will be no question } } break; case 'RM' : // becomes moderator case 'RN' : // stops being moderator if(msg.rid == currentRid) { if (me.uid == msg.user.uid) { if (msg.user.role == 'M') { me.mod = 'M' } else { me.mod = 'N' } } // Given user is changing from mod to not or visa vera, need to remove and then re-add addUser(msg.user); } break; case 'PE' : var whisperBox = $('W' + msg.rid); if(userDiv) { //only relevent if we have this user if (msg.user.uid != me.uid) { //Not me, but I might be in a whisper with them if (!whisperBox) { MBchat.updateables.message.displayMessage(lastId,msg.time,chatBot,chatBotMessage(msg.user.name+' Leaves the Room')); removeUser(userDiv); } else { userDiv.addClass('priv'); } } else { if (room.rid == 0) { var messageList=$('chatList'); //I'm in entrance hall so have to make it look like a room messageList.removeClass('whisper'); messageList.addClass('chat'); $('inputContainer').set('styles',{ 'display':'block'}); $('entranceHall').set('styles',{'display':'none'}); } $('roomNameContainer').empty(); var el = new Element('h1',{'class':'privateRoom'}) .set('text', 'Private Room') .inject('roomNameContainer'); //remove P markers from all whisper boxes var privateMarkers= $$('.private'); privateMarkers.addClass('nonprivate'); privateMarkers.removeClass('private'); privateRoom = msg.rid.toInt(); var fellowWhisperers = whisperBox.getElement('.whisperList').getChildren(); var users = $('onlineList').getChildren(); users.each( function(user) { if (fellowWhisperers.some(function(item){ return this.get('id').substr(1) == item.get('id').substr(whisperBox.get('id').length+1); },user)) { user.addClass('priv'); } }); userDiv.addClass('priv'); $('messageText').focus(); whisperBox.setStyle('display','none'); $('content').setStyles(contentSize); } } else { // Add user to list if in a whisper (otherwise doesn't) var user = msg.user; user.wid = msg.rid; addUser(user); } break; case 'PX' : if (msg.user.uid == me.uid) { $('roomNameContainer').empty(); var el = new Element('h1') .set('text', room.name) .inject('roomNameContainer'); //Put private markers back on all whisper boxes var privateMarkers= $$('.nonprivate'); privateMarkers.addClass('private'); privateMarkers.removeClass('nonprivate'); MBchat.updateables.online.show(room.rid); //reshow the online list from scratch $('messageText').focus(); if (room.rid == 0) { var messageList=$('chatList'); //need to restore entrance hall messageList.removeClass('chat'); messageList.addClass('whisper'); $('inputContainer').set('styles',{ 'display':'none'}); $('entranceHall').set('styles',{'display':'block'}); } if($('W'+privateRoom)) { //need to make a whisper box with my whisperers in it (if still here). $('W'+privateRoom).setStyle('display','block'); } $('content').setStyles(contentSize); privateRoom = 0; } else { MBchat.updateables.message.displayMessage(lastId,msg.time,chatBot,chatBotMessage(msg.user.name+' Enters the Room')); addUser(msg.user); } break; case 'WJ' : if(privateRoom == msg.rid) { //only interested in people joining my private room userDiv = addUser(msg.user); userDiv.addClass('priv'); } break; case 'WL' : if(privateRoom == msg.rid) { //only interested in people leaving my private room userDiv.removeClass('priv');//TODO might need system that records with this user was only there because of the whisper and remove him completely } break; default : // ignore anything else break; } } } }; }(), |
if(me.can(BLIND) { | if(me.can(BLIND)) { | online : function() { //management of the online users list var onlineList ; //Actual Display List var lastId; var loadingRid; var currentRid = -1; var labelList = function() { var node = onlineList.getFirst(); if (node) { var i = 0; do { node.removeClass('rowEven'); node.removeClass('rowOdd'); if( i%2 == 0) { node.addClass('rowEven'); } else { node.addClass('rowOdd'); } i++; } while (node = node.getNext()); } }; var addUser = function (user) { var div =$('U'+user.uid); // Does this already exist? if(div) div.destroy(); //So remove him, because we need to recreate from scratch if(me.can(BLIND)) { div = new Element('input',{type:'button',id: 'U'+user.uid,value:user.name}); } else { div = new Element('div', {'id': 'U'+user.uid}); } var span = displayUser(user,div); if (user.wid && user.wid.toInt() != 0 ) { //This user is in a private room so maybe we don't display him if (user.uid != me.uid) { //Not me, but I might be in a whisper with them var whisperBox = $('W'+user.wid); if (!whisperBox) { return null; //not in any whisper box, so don't display } } span.addClass('priv'); //makes them Italic to show its private } else { if (room.type === 3) { if (me.is('M')) { if (user.uid != me.uid) { if (user.question) { span.addClass('ask'); div.store('question',user.question); div.addClass('hasQuestion'); } // I am a moderator in a moderated room - therefore I need to be able to moderate others div.addEvents({ 'click' : function(e) { if (e.control) { //Promote to moderator if (user.role != 'M') { //but only if not already one var request = new ServerReq('client/promote.php', function (response) {// MBchat.updateables.poller.pollResponse(response); }).transmit({ 'lid':MBchat.updateables.poller.getLastId(), 'rid':room.rid, 'puid':user.uid}); } } else { var qtext = div.retrieve('question'); if (qtext) { // only send one if there is one var request = new ServerReq('client/release.php',function (response) {// MBchat.updateables.poller.pollResponse(response); }).transmit({ 'lid':MBchat.updateables.poller.getLastId(), 'rid':room.rid, 'quid':user.uid}); } } }, 'mouseenter' : function(e) { var span = div.getElement('span'); if (!(span.hasClass('M') || span.hasClass('H') || span.hasClass('G') || span.hasClass('S'))) { var question = new Element('div', {'id' : 'Q'+user.uid}); var qtext = div.retrieve('question'); if (qtext) { qtext = replaceHyperLinks (qtext); //replace Hperlinks qtext = replaceEmoticons(qtext); //Then replace emoticons. question.set('html', '<p><b>Click to Release Question<br/>', 'Control Click to Promote</b></p>', '<p>',qtext,'</p>'); question.setStyles({'top': e.client.y, 'left':e.client.x - 200}); } else { question.set('html','<p><b>Control Click to Promote</b></p>'); question.setStyles({'top': e.client.y, 'left':e.client.x }); } question.inject(document.body); } }, 'mouseleave' : function(e) { div.removeClass('hasQuestion'); var question = $('Q'+user.uid); if (question) { question.destroy(); } } }); div.getFirst().addClass('whisperer'); //Adds cursor pointer } else { div.addEvent('click', function(e) { e.stop(); if(e.control && e.alt) { var request = new ServerReq('client/demote.php',function (response) {// MBchat.updateables.poller.pollResponse(response); }).transmit({ 'lid':MBchat.updateables.poller.getLastId(), 'rid':room.rid}); } }); } } else { if (user.question) { span.addClass('ask'); } if (me.uid == user.uid) { if (user.question) { div.store('question',user.question); div.addClass('hasQuestion'); } div.addEvents({ 'mouseenter' : function(e) { var span = div.getElement('span'); if (!(span.hasClass('M') || span.hasClass('H') || span.hasClass('G') || span.hasClass('S'))) { var question = new Element('div', {'id' : 'Q'+div.get('id').substr(1)}); var qtext = div.retrieve('question'); if (qtext) { qtext = replaceHyperLinks (qtext); //replace Hperlinks qtext = replaceEmoticons(qtext); //Then replace emoticons. question.set('html','<p>',qtext,'</p>'); question.setStyles({'top': e.client.y, 'left':e.client.x - 200}); div.addClass('hasQuestion'); question.inject(document.body); } } }, 'mouseleave' : function(e) { var question = $( 'Q'+div.get('id').substr(1)); if (question) { question.destroy(); } } }); } } } } // Figure out if we can whisper together if (user.uid != me.uid && !me.can(NO_WHISPER) && (crossWhisper || ((!me.is('B') && user.role != 'B') || ( me.is('B') && user.role === 'B' ))) ) { var ww = function(e) { MBchat.updateables.whispers.whisperWith(user,span,e); }; if(me.can(BLIND) { div.addEvent('click',ww); div.addClass('whisperer'); } else { span.addEvent('mousedown',ww); div.getFirst().addClass('whisperer'); } } var qtext = div.retrieve('question'); if (qtext) { div.inject(onlineList,'top') } else { div.inject(onlineList,'bottom'); } labelList(); return div; }; |
var removeUser = function (div) { var question = $('Q'+div.get('id').substr(1)); if (question) { question.destroy(); } div.destroy(); labelList(); }; onlineReq = new ServerReq('client/online.php',function(response) { onlineList.removeClass('loading'); onlineList.addClass(room.type); currentRid = loadingRid; loadingRid = -1; onlineList.empty(); var users = response.online; if (users.length > 0 ) { users.each(function(user) { user.uid = user.uid.toInt(); addUser(user); }); } lastId = response.lastid; }); return { init: function () { onlineList = $('onlineList'); lastId = null; currentRid = -1; }, show : function (rid) { onlineList.empty(); onlineList.erase('class'); onlineList.addClass('loading'); onlineReq.transmit({'rid':rid }); currentRid = -1; loadingRid = rid; }, getCurrentRid: function() { return currentRid; }, processMessage: function (msg) { if(!lastId) return; var lid = msg.lid; if (lastId < lid) { lastId = lid; userDiv = $('U'+msg.user.uid); var whisperer; switch (msg.type) { case 'LO' : case 'LT' : if (me.uid == msg.user.uid) { window.location('./client/index.php'); } else { if (userDiv) { removeUser(userDiv) } } break; case 'LX' : if (me.uid == msg.user.uid) { MBchat.logout(); } break; case 'RX' : if (currentRid == 0) { if (!userDiv) { userDiv = addUser(msg.user); if (privateRoom != 0) { whisperer = $('W'+privateRoom+'U'+msg.user.uid); if (whisperer) userDiv.addClass('priv'); } } } else { if (userDiv) { if (privateRoom == 0 ) { removeUser(userDiv); } else { if (!userDiv.hasClass('priv')) { removeUser(userDiv); } } } } break; case 'LI' : if (!userDiv && msg.rid == currentRid) { addUser(msg.user); } break; case 'RE' : if (currentRid != 0) { if (!userDiv && msg.rid == currentRid) { var user = msg.user; user.question = msg.message; userDiv = addUser(user); if (privateRoom != 0) { whisperer = $('W'+privateRoom+'U'+user.uid); if (whisperer) userDiv.addClass('priv'); } } } else { if (userDiv) { if (privateRoom == 0 ) { removeUser(userDiv); } else { if (!userDiv.hasClass('priv')) { removeUser(userDiv); } } } } break; case 'MQ' : if(msg.rid == currentRid) { if (room.type == 'M' && (me.mod == 'M' || me.uid == msg.user.uid)) { var user = msg.user; user.question = msg.message; userDiv = addUser(user); } var span = userDiv.getElement('span'); span.addClass('ask'); } break; case 'MR' : case 'ME' : if(msg.rid == currentRid) { if(userDiv) { userDiv.getElement('span').removeClass('ask'); } if (room.type == 'M' && (me.mod == 'M' || me.uid == msg.user.uid)) { addUser(msg.user); } } break; case 'RM' : case 'RN' : if(msg.rid == currentRid) { if (me.uid == msg.user.uid) { if (msg.user.role == 'M') { me.mod = 'M' } else { me.mod = 'N' } } addUser(msg.user); } break; case 'PE' : var whisperBox = $('W' + msg.rid); if(userDiv) { if (msg.user.uid != me.uid) { if (!whisperBox) { MBchat.updateables.message.displayMessage(lastId,msg.time,chatBot,chatBotMessage(msg.user.name+' Leaves the Room')); MBchat.sounds.roomMove(); removeUser(userDiv); } else { userDiv.addClass('priv'); } } else { if (room.rid == 0) { var messageList=$('chatList'); messageList.removeClass('whisper'); messageList.addClass('chat'); $('inputContainer').set('styles',{ 'display':'block'}); $('emoticonContainer').set('styles',{ 'display':'block'}); $('entranceHall').set('styles',{'display':'none'}); var exit = $('exit'); exit.addClass('exit-r'); exit.removeClass('exit-f'); } $('roomNameContainer').empty(); var el = new Element('h1',{'class':'privateRoom'}) .set('text', 'Private Room') .inject('roomNameContainer'); var privateMarkers= $$('.private'); privateMarkers.addClass('nonprivate'); privateMarkers.removeClass('private'); privateRoom = msg.rid.toInt(); var fellowWhisperers = whisperBox.getElement('.whisperList').getChildren(); var users = $('onlineList').getChildren(); users.each( function(user) { if (fellowWhisperers.some(function(item){ return this.get('id').substr(1) == item.get('id').substr(whisperBox.get('id').length+1); },user)) { user.addClass('priv'); } }); userDiv.addClass('priv'); $('messageText').focus(); MBchat.sounds.resetTimer(); whisperBox.setStyle('display','none'); $('content').setStyles(contentSize); MBchat.sounds.roomMove(); } } else { var user = msg.user; user.wid = msg.rid; addUser(user); } break; case 'PX' : if (msg.user.uid == me.uid) { $('roomNameContainer').empty(); var el = new Element('h1') .set('text', room.name) .inject('roomNameContainer'); var privateMarkers= $$('.nonprivate'); privateMarkers.addClass('private'); privateMarkers.removeClass('nonprivate'); MBchat.updateables.online.show(room.rid); $('messageText').focus(); if (room.rid == 0) { var messageList=$('chatList'); messageList.removeClass('chat'); messageList.addClass('whisper'); $('inputContainer').set('styles',{ 'display':'none'}); $('emoticonContainer').set('styles',{ 'display':'none'}); $('entranceHall').set('styles',{'display':'block'}); var exit = $('exit'); exit.addClass('exit-f'); exit.removeClass('exit-r'); } MBchat.sounds.resetTimer(); if($('W'+privateRoom)) { $('W'+privateRoom).setStyle('display','block'); } $('content').setStyles(contentSize); privateRoom = 0; } else { MBchat.updateables.message.displayMessage(lastId,msg.time,chatBot,chatBotMessage(msg.user.name+' Enters the Room')); addUser(msg.user); } MBchat.sounds.roomMove(); break; case 'WJ' : if(privateRoom == msg.rid) { userDiv = addUser(msg.user); userDiv.addClass('priv'); } break; case 'WL' : if(privateRoom == msg.rid) { userDiv.removeClass('priv'); } break; default : break; } } } }; }(), | online : function() { //management of the online users list var onlineList ; //Actual Display List var lastId; var loadingRid; var currentRid = -1; var labelList = function() { var node = onlineList.getFirst(); if (node) { var i = 0; do { node.removeClass('rowEven'); node.removeClass('rowOdd'); if( i%2 == 0) { node.addClass('rowEven'); } else { node.addClass('rowOdd'); } i++; } while (node = node.getNext()); } }; var addUser = function (user) { var div =$('U'+user.uid); // Does this already exist? if(div) div.destroy(); //So remove him, because we need to recreate from scratch if(me.can(BLIND)) { div = new Element('input',{type:'button',id: 'U'+user.uid,value:user.name}); } else { div = new Element('div', {'id': 'U'+user.uid}); } var span = displayUser(user,div); if (user.wid && user.wid.toInt() != 0 ) { //This user is in a private room so maybe we don't display him if (user.uid != me.uid) { //Not me, but I might be in a whisper with them var whisperBox = $('W'+user.wid); if (!whisperBox) { return null; //not in any whisper box, so don't display } } span.addClass('priv'); //makes them Italic to show its private } else { if (room.type === 3) { if (me.is('M')) { if (user.uid != me.uid) { if (user.question) { span.addClass('ask'); div.store('question',user.question); div.addClass('hasQuestion'); } // I am a moderator in a moderated room - therefore I need to be able to moderate others div.addEvents({ 'click' : function(e) { if (e.control) { //Promote to moderator if (user.role != 'M') { //but only if not already one var request = new ServerReq('client/promote.php', function (response) {// MBchat.updateables.poller.pollResponse(response); }).transmit({ 'lid':MBchat.updateables.poller.getLastId(), 'rid':room.rid, 'puid':user.uid}); } } else { var qtext = div.retrieve('question'); if (qtext) { // only send one if there is one var request = new ServerReq('client/release.php',function (response) {// MBchat.updateables.poller.pollResponse(response); }).transmit({ 'lid':MBchat.updateables.poller.getLastId(), 'rid':room.rid, 'quid':user.uid}); } } }, 'mouseenter' : function(e) { var span = div.getElement('span'); if (!(span.hasClass('M') || span.hasClass('H') || span.hasClass('G') || span.hasClass('S'))) { var question = new Element('div', {'id' : 'Q'+user.uid}); var qtext = div.retrieve('question'); if (qtext) { qtext = replaceHyperLinks (qtext); //replace Hperlinks qtext = replaceEmoticons(qtext); //Then replace emoticons. question.set('html', '<p><b>Click to Release Question<br/>', 'Control Click to Promote</b></p>', '<p>',qtext,'</p>'); question.setStyles({'top': e.client.y, 'left':e.client.x - 200}); } else { question.set('html','<p><b>Control Click to Promote</b></p>'); question.setStyles({'top': e.client.y, 'left':e.client.x }); } question.inject(document.body); } }, 'mouseleave' : function(e) { div.removeClass('hasQuestion'); var question = $('Q'+user.uid); if (question) { question.destroy(); } } }); div.getFirst().addClass('whisperer'); //Adds cursor pointer } else { div.addEvent('click', function(e) { e.stop(); if(e.control && e.alt) { var request = new ServerReq('client/demote.php',function (response) {// MBchat.updateables.poller.pollResponse(response); }).transmit({ 'lid':MBchat.updateables.poller.getLastId(), 'rid':room.rid}); } }); } } else { if (user.question) { span.addClass('ask'); } if (me.uid == user.uid) { if (user.question) { div.store('question',user.question); div.addClass('hasQuestion'); } div.addEvents({ 'mouseenter' : function(e) { var span = div.getElement('span'); if (!(span.hasClass('M') || span.hasClass('H') || span.hasClass('G') || span.hasClass('S'))) { var question = new Element('div', {'id' : 'Q'+div.get('id').substr(1)}); var qtext = div.retrieve('question'); if (qtext) { qtext = replaceHyperLinks (qtext); //replace Hperlinks qtext = replaceEmoticons(qtext); //Then replace emoticons. question.set('html','<p>',qtext,'</p>'); question.setStyles({'top': e.client.y, 'left':e.client.x - 200}); div.addClass('hasQuestion'); question.inject(document.body); } } }, 'mouseleave' : function(e) { var question = $( 'Q'+div.get('id').substr(1)); if (question) { question.destroy(); } } }); } } } } // Figure out if we can whisper together if (user.uid != me.uid && !me.can(NO_WHISPER) && (crossWhisper || ((!me.is('B') && user.role != 'B') || ( me.is('B') && user.role === 'B' ))) ) { var ww = function(e) { MBchat.updateables.whispers.whisperWith(user,span,e); }; if(me.can(BLIND) { div.addEvent('click',ww); div.addClass('whisperer'); } else { span.addEvent('mousedown',ww); div.getFirst().addClass('whisperer'); } } var qtext = div.retrieve('question'); if (qtext) { div.inject(onlineList,'top') } else { div.inject(onlineList,'bottom'); } labelList(); return div; }; |
|
obs.addObserver(this, "current_view_check_status", false); | obs.addObserver(this, "view_opened", false); | onLoad : function() { try { var obs = DafizillaCommon.getObserverService(); obs.addObserver(this, "current_view_check_status", false); obs.addObserver(this, "view_closed", false); obs.addObserver(this, "tabswitcher_pref_changed", false); this.prefs = new TabSwitcherPrefs(); this.init(); this.addListeners(); } catch (err) { alert("gEditPosition onLoad " + err); } }, |
alert("gEditPosition onLoad " + err); | DafizillaCommon.exception(err); | onLoad : function() { try { var obs = DafizillaCommon.getObserverService(); obs.addObserver(this, "current_view_check_status", false); obs.addObserver(this, "view_closed", false); obs.addObserver(this, "tabswitcher_pref_changed", false); this.prefs = new TabSwitcherPrefs(); this.init(); this.addListeners(); } catch (err) { alert("gEditPosition onLoad " + err); } }, |
playEmbedded = new PlayEmbedded(); | window.onload = function() { playEmbedded = new PlayEmbedded();}; |
|
function onLoad(){if(window.WtScriptLoaded){_$_WT_CLASS_$_.history.initialize("Wt-history-field","Wt-history-iframe");_$_APP_CLASS_$_._p_.load()}else window.isLoaded=true}; | response:F,setCloseMessage:q};this.WT=_$_WT_CLASS_$_;this.emit=I}),WtSignalEmit=_$_APP_CLASS_$_.emit;window.WtScriptLoaded=false;function onLoad(){if(window.WtScriptLoaded){_$_WT_CLASS_$_.history.initialize("Wt-history-field","Wt-history-iframe");_$_APP_CLASS_$_._p_.load()}else window.isLoaded=true}; | function onLoad(){if(window.WtScriptLoaded){_$_WT_CLASS_$_.history.initialize("Wt-history-field","Wt-history-iframe");_$_APP_CLASS_$_._p_.load()}else window.isLoaded=true}; |
addTimerEvent:L,load:i,handleResponse:D,setServerPush:u,dragStart:h,dragDrag:X,dragEnd:C,capture:o.capture,onHashChange:t,setHash:B,ImagePreloader:p,autoJavaScript:function(){_$_AUTO_JAVASCRIPT_$_()},response:I};this.WT=_$_WT_CLASS_$_;this.emit=M}),WtSignalEmit=_$_APP_CLASS_$_.emit;window.WtScriptLoaded=false;function onLoad(){if(window.WtScriptLoaded){_$_WT_CLASS_$_.history.initialize("Wt-history-field","Wt-history-iframe");_$_APP_CLASS_$_._p_.load()}else window.isLoaded=true}; | response:H};this.WT=_$_WT_CLASS_$_;this.emit=L}),WtSignalEmit=_$_APP_CLASS_$_.emit;window.WtScriptLoaded=false;function onLoad(){if(window.WtScriptLoaded){_$_WT_CLASS_$_.history.initialize("Wt-history-field","Wt-history-iframe");_$_APP_CLASS_$_._p_.load()}else window.isLoaded=true}; | addTimerEvent:L,load:i,handleResponse:D,setServerPush:u,dragStart:h,dragDrag:X,dragEnd:C,capture:o.capture,onHashChange:t,setHash:B,ImagePreloader:p,autoJavaScript:function(){_$_AUTO_JAVASCRIPT_$_()},response:I};this.WT=_$_WT_CLASS_$_;this.emit=M}),WtSignalEmit=_$_APP_CLASS_$_.emit;window.WtScriptLoaded=false;function onLoad(){if(window.WtScriptLoaded){_$_WT_CLASS_$_.history.initialize("Wt-history-field","Wt-history-iframe");_$_APP_CLASS_$_._p_.load()}else window.isLoaded=true}; |
setCloseMessage:p};this.WT=_$_WT_CLASS_$_;this.emit=I}),WtSignalEmit=_$_APP_CLASS_$_.emit;window.WtScriptLoaded=false;function onLoad(){if(window.WtScriptLoaded){_$_WT_CLASS_$_.history.initialize("Wt-history-field","Wt-history-iframe");_$_APP_CLASS_$_._p_.load()}else window.isLoaded=true}; | setServerPush:o,dragStart:ca,dragDrag:g,dragEnd:Z,capture:n.capture,onHashChange:t,setHash:D,ImagePreloader:H,autoJavaScript:function(){_$_AUTO_JAVASCRIPT_$_()},response:F,setCloseMessage:p};this.WT=_$_WT_CLASS_$_;this.emit=I}),WtSignalEmit=_$_APP_CLASS_$_.emit;window.WtScriptLoaded=false;function onLoad(){if(window.WtScriptLoaded){_$_WT_CLASS_$_.history.initialize("Wt-history-field","Wt-history-iframe");_$_APP_CLASS_$_._p_.load()}else window.isLoaded=true}; | setCloseMessage:p};this.WT=_$_WT_CLASS_$_;this.emit=I}),WtSignalEmit=_$_APP_CLASS_$_.emit;window.WtScriptLoaded=false;function onLoad(){if(window.WtScriptLoaded){_$_WT_CLASS_$_.history.initialize("Wt-history-field","Wt-history-iframe");_$_APP_CLASS_$_._p_.load()}else window.isLoaded=true}; |
function onLoad(){if(window.WtScriptLoaded){_$_WT_CLASS_$_.history.initialize("Wt-history-field","Wt-history-iframe");_$_APP_CLASS_$_._p_.load()}else window.isLoaded=true}; | w}),WtSignalEmit=_$_APP_CLASS_$_.emit;window.WtScriptLoaded=false;function onLoad(){if(window.WtScriptLoaded){_$_WT_CLASS_$_.history.initialize("Wt-history-field","Wt-history-iframe");_$_APP_CLASS_$_._p_.load()}else window.isLoaded=true}; | function onLoad(){if(window.WtScriptLoaded){_$_WT_CLASS_$_.history.initialize("Wt-history-field","Wt-history-iframe");_$_APP_CLASS_$_._p_.load()}else window.isLoaded=true}; |
a._djScaytConfig={baseUrl:y,addOnLoad:[function(){a.fireOnce('scaytReady');}],isDebug:false};a.document.getHead().append(a.document.createElement('script',{attributes:{type:'text/javascript',src:x}}));return null;},parseUrl:function(u){var v;if(u.match&&(v=u.match(/(.*)[\/\\](.*?\.\w+)$/)))return{path:v[1],file:v[2]};else return u;}};var r=j.scayt,s=function(u,v,w,x,y,z,A){u.addCommand(x,y);u.addMenuItem(x,{label:w,command:x,group:z,order:A});},t={preserveState:true,editorFocus:false,exec:function(u){if(r.isScaytReady(u)){var v=r.isScaytEnabled(u);this.setState(v?2:1);var w=r.getScayt(u);w.setDisabled(v);}else if(!u.config.scayt_autoStartup&&r.engineLoaded>=0){this.setState(0);u.on('showScaytState',function(){this.removeListener();this.setState(r.isScaytEnabled(u)?1:2);},this);r.loadEngine(u);}}};j.add('scayt',{requires:['menubutton'],beforeInit:function(u){u.config.menu_groups='scayt_suggest,scayt_moresuggest,scayt_control,'+u.config.menu_groups;},init:function(u){var v={},w={},x=u.addCommand(l,t);a.dialog.add(l,a.getUrl(this.path+'dialogs/options.js'));var y=u.config.scayt_uiTabs||'1,1,1',z=[];y=y.split(',');for(var A=0,B=3;A<B;A++){var C=parseInt(y[A]||'1',10);z.push(C);}var D='scaytButton';u.addMenuGroup(D);var E={};E.scaytToggle={label:u.lang.scayt.enable,command:l,group:D};if(z[0]==1)E.scaytOptions={label:u.lang.scayt.options,group:D,onClick:function(){m='options';u.openDialog(l);}};if(z[1]==1)E.scaytLangs={label:u.lang.scayt.langs,group:D,onClick:function(){m='langs';u.openDialog(l);}};if(z[2]==1)E.scaytDict={label:u.lang.scayt.dictionariesTab,group:D,onClick:function(){m='dictionaries';u.openDialog(l);}};E.scaytAbout={label:u.lang.scayt.about,group:D,onClick:function(){m='about';u.openDialog(l);}};z[3]=1;r.uiTabs=z;u.addMenuItems(E);u.ui.add('Scayt',5,{label:u.lang.scayt.title,title:u.lang.scayt.title,className:'cke_button_scayt',onRender:function(){x.on('state',function(){this.setState(x.state);},this);},onMenu:function(){var G=r.isScaytEnabled(u);u.getMenuItem('scaytToggle').label=u.lang.scayt[G?'disable':'enable'];return{scaytToggle:2,scaytOptions:G&&r.uiTabs[0]?2:0,scaytLangs:G&&r.uiTabs[1]?2:0,scaytDict:G&&r.uiTabs[2]?2:0,scaytAbout:G&&r.uiTabs[3]?2:0};}});if(u.contextMenu&&u.addMenuItems)u.contextMenu.addListener(function(){if(!r.isScaytEnabled(u))return null;var G=r.getScayt(u),H=G.getScaytNode();if(!H)return null;var I=G.getWord(H);if(!I)return null;var J=G.getLang(),K={},L=window.scayt.getSuggestion(I,J);if(!L||!L.length)return null;for(A in v){delete u._.menuItems[A]; | a.dialog.add('colordialog',this.path+'dialogs/colordialog.js');}};j.add('colordialog',j.colordialog);})();j.add('contextmenu',{requires:['menu'],beforeInit:function(l){l.contextMenu=new j.contextMenu(l);l.addCommand('contextMenu',{exec:function(){l.contextMenu.show(l.document.getBody());}});}});j.contextMenu=e.createClass({$:function(l){this.id='cke_'+e.getNextNumber();this.editor=l;this._.listeners=[];this._.functionId=e.addFunction(function(m){this._.panel.hide();l.focus();l.execCommand(m);},this);this.definition={panel:{className:l.skinClass+' cke_contextmenu',attributes:{'aria-label':l.lang.contextmenu.options}}};},_:{onMenu:function(l,m,n,o){var p=this._.menu,q=this.editor;if(p){p.hide();p.removeAll();}else{p=this._.menu=new a.menu(q,this.definition);p.onClick=e.bind(function(z){p.hide();if(z.onClick)z.onClick();else if(z.command)q.execCommand(z.command);},this);p.onEscape=function(z){var A=this.parent;if(A){A._.panel.hideChild();var B=A._.panel._.panel._.currentBlock,C=B._.focusIndex;B._.markItem(C);}else if(z==27){this.hide();q.focus();}return false;};}var r=this._.listeners,s=[],t=this.editor.getSelection(),u=t&&t.getStartElement();p.onHide=e.bind(function(){p.onHide=null;if(c){var z=q.getSelection();z&&z.unlock();}this.onHide&&this.onHide();},this);for(var v=0;v<r.length;v++){var w=r[v](u,t);if(w)for(var x in w){var y=this.editor.getMenuItem(x);if(y){y.state=w[x];p.add(y);}}}p.items.length&&p.show(l,m||(q.lang.dir=='rtl'?2:1),n,o);}},proto:{addTarget:function(l,m){if(b.opera){var n;l.on('mousedown',function(r){r=r.data;if(r.$.button!=2){if(r.getKeystroke()==1000+1)l.fire('contextmenu',r);return;}if(m&&(r.$.ctrlKey||r.$.metaKey))return;var s=r.getTarget();if(!n){var t=s.getDocument();n=t.createElement('input');n.$.type='button';t.getBody().append(n);}n.setAttribute('style','position:absolute;top:'+(r.$.clientY-2)+'px;left:'+(r.$.clientX-2)+'px;width:5px;height:5px;opacity:0.01');});l.on('mouseup',function(r){if(n){n.remove();n=undefined;l.fire('contextmenu',r.data);}});}l.on('contextmenu',function(r){var s=r.data;if(m&&(b.webkit?o:s.$.ctrlKey||s.$.metaKey))return;if(c){var t=this.editor.getSelection();t&&t.lock();}s.preventDefault();var u=s.getTarget().getDocument().getDocumentElement(),v=s.$.clientX,w=s.$.clientY;e.setTimeout(function(){this.show(u,null,v,w);},0,this);},this);if(b.webkit){var o,p=function(r){o=r.data.$.ctrlKey||r.data.$.metaKey;},q=function(){o=0;};l.on('keydown',p);l.on('keyup',q);l.on('contextmenu',q);}},addListener:function(l){this._.listeners.push(l); | a._djScaytConfig={baseUrl:y,addOnLoad:[function(){a.fireOnce('scaytReady');}],isDebug:false};a.document.getHead().append(a.document.createElement('script',{attributes:{type:'text/javascript',src:x}}));return null;},parseUrl:function(u){var v;if(u.match&&(v=u.match(/(.*)[\/\\](.*?\.\w+)$/)))return{path:v[1],file:v[2]};else return u;}};var r=j.scayt,s=function(u,v,w,x,y,z,A){u.addCommand(x,y);u.addMenuItem(x,{label:w,command:x,group:z,order:A});},t={preserveState:true,editorFocus:false,exec:function(u){if(r.isScaytReady(u)){var v=r.isScaytEnabled(u);this.setState(v?2:1);var w=r.getScayt(u);w.setDisabled(v);}else if(!u.config.scayt_autoStartup&&r.engineLoaded>=0){this.setState(0);u.on('showScaytState',function(){this.removeListener();this.setState(r.isScaytEnabled(u)?1:2);},this);r.loadEngine(u);}}};j.add('scayt',{requires:['menubutton'],beforeInit:function(u){u.config.menu_groups='scayt_suggest,scayt_moresuggest,scayt_control,'+u.config.menu_groups;},init:function(u){var v={},w={},x=u.addCommand(l,t);a.dialog.add(l,a.getUrl(this.path+'dialogs/options.js'));var y=u.config.scayt_uiTabs||'1,1,1',z=[];y=y.split(',');for(var A=0,B=3;A<B;A++){var C=parseInt(y[A]||'1',10);z.push(C);}var D='scaytButton';u.addMenuGroup(D);var E={};E.scaytToggle={label:u.lang.scayt.enable,command:l,group:D};if(z[0]==1)E.scaytOptions={label:u.lang.scayt.options,group:D,onClick:function(){m='options';u.openDialog(l);}};if(z[1]==1)E.scaytLangs={label:u.lang.scayt.langs,group:D,onClick:function(){m='langs';u.openDialog(l);}};if(z[2]==1)E.scaytDict={label:u.lang.scayt.dictionariesTab,group:D,onClick:function(){m='dictionaries';u.openDialog(l);}};E.scaytAbout={label:u.lang.scayt.about,group:D,onClick:function(){m='about';u.openDialog(l);}};z[3]=1;r.uiTabs=z;u.addMenuItems(E);u.ui.add('Scayt',5,{label:u.lang.scayt.title,title:u.lang.scayt.title,className:'cke_button_scayt',onRender:function(){x.on('state',function(){this.setState(x.state);},this);},onMenu:function(){var G=r.isScaytEnabled(u);u.getMenuItem('scaytToggle').label=u.lang.scayt[G?'disable':'enable'];return{scaytToggle:2,scaytOptions:G&&r.uiTabs[0]?2:0,scaytLangs:G&&r.uiTabs[1]?2:0,scaytDict:G&&r.uiTabs[2]?2:0,scaytAbout:G&&r.uiTabs[3]?2:0};}});if(u.contextMenu&&u.addMenuItems)u.contextMenu.addListener(function(){if(!r.isScaytEnabled(u))return null;var G=r.getScayt(u),H=G.getScaytNode();if(!H)return null;var I=G.getWord(H);if(!I)return null;var J=G.getLang(),K={},L=window.scayt.getSuggestion(I,J);if(!L||!L.length)return null;for(A in v){delete u._.menuItems[A]; |
if(!F){_$_$endif_$_();var m={},i=y.length;m.object=c;m.signal=d;m.event=e;m.feedback=j;y[i]=g(m,i);q();n();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function q(){_$_$if_WEB_SOCKETS_$_();if(I.state!=2)if(window.WebSocket===undefined)I.state=2;else{var c=I.socket;if(c==null||c.readyState>1)if(c!=null&&I.state==0)I.state=2;else{c=ha.substr(ha.indexOf("?"));c="ws"+location.protocol.substr(4)+" function(d){I.state=1;o(0,d.data,null)}}if(c.readyState==1){r();return}}_$_$endif_$_();if(F!=null&&O!=null){clearTimeout(O);F.abort();F=null}if(F==null)if(S==null){S=setTimeout(function(){r()},h.updateDelay);la=(new Date).getTime()}else if(ba){clearTimeout(S);r()}else if((new Date).getTime()-la>h.updateDelay){clearTimeout(S);r()}}function B(c){fa=c;k._p_.comm.responseReceived(c)}function r(){if(!F){S=null;if(R){if(!ma){if(confirm("The application was quited, do you want to restart?"))document.location= | " | if(!F){_$_$endif_$_();var m={},i=y.length;m.object=c;m.signal=d;m.event=e;m.feedback=j;y[i]=g(m,i);q();n();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function q(){_$_$if_WEB_SOCKETS_$_();if(I.state!=2)if(window.WebSocket===undefined)I.state=2;else{var c=I.socket;if(c==null||c.readyState>1)if(c!=null&&I.state==0)I.state=2;else{c=ha.substr(ha.indexOf("?"));c="ws"+location.protocol.substr(4)+"//"+location.hostname+":"+location.port+location.pathname+c;I.socket=c=new WebSocket(c);c.onmessage=function(d){I.state=1;o(0,d.data,null)}}if(c.readyState==1){r();return}}_$_$endif_$_();if(F!=null&&O!=null){clearTimeout(O);F.abort();F=null}if(F==null)if(S==null){S=setTimeout(function(){r()},h.updateDelay);la=(new Date).getTime()}else if(ba){clearTimeout(S);r()}else if((new Date).getTime()-la>h.updateDelay){clearTimeout(S);r()}}function B(c){fa=c;k._p_.comm.responseReceived(c)}function r(){if(!F){S=null;if(R){if(!ma){if(confirm("The application was quited, do you want to restart?"))document.location= |
show_cursor(); | page.onmousedown = function (e) { /// Was the right mouse button clicked? ///TODO: Determine how to detect when the menu comes up on a Mac? ///NOTE: In the future, it may be necessary to map the mouse buttons to variables because most are different on IE; however, the right mouse button is always 2. if (e.button == 2) { /// Since the right mouse button usually brings up a menu, the user will likely want to see the cursor indefinitely. show_cursor(); } else { /// Other types of clicks should show the mouse cursor briefly but still hide it again. hide_cursor_delayed(); } }; |
|
G;++C){A=y.childNodes[C];if(A.className=="Wt-vrh"){A.ci=E-1;A.onmousedown=function(c){o(this,this.ci,c||window.event)}}else E+=A.colSpan}++x}}r.resizeInitialized=true}}); | G;++C){A=y.childNodes[C];if(A.className=="Wt-vrh"){A.ci=E-1;A.onmousedown=function(c){m(this,this.ci,c||window.event)}}else E+=A.colSpan}++x}}r.resizeInitialized=true}}); | G;++C){A=y.childNodes[C];if(A.className=="Wt-vrh"){A.ci=E-1;A.onmousedown=function(c){o(this,this.ci,c||window.event)}}else E+=A.colSpan}++x}}r.resizeInitialized=true}}); |
G;++C){A=y.childNodes[C];if(A.className=="Wt-vrh"){A.ci=E-1;A.onmousedown=function(c){k(this,this.ci,c||window.event)}}else E+=A.colSpan}++x}}p.resizeInitialized=true}});WT_DECLARE_APP_MEMBER(1,"layouts",[]);WT_DECLARE_APP_MEMBER(2,"layoutsAdjust",function(a){if(a){if(a=$("#"+a).get(0))a.dirty=true}else if(!this.adjusting){this.adjusting=true;var s;for(s=0;s<this.layouts.length;++s){a=this.layouts[s];if(!a.adjust()){this.WT.arrayRemove(this.layouts,s);--s}}this.adjusting=false}}); | H;++D){B=z.childNodes[D];if(B.className=="Wt-vrh"){B.ci=F-1;B.onmousedown=function(c){m(this,this.ci,c||window.event)}}else F+=B.colSpan}++y}}r.resizeInitialized=true}}); | G;++C){A=y.childNodes[C];if(A.className=="Wt-vrh"){A.ci=E-1;A.onmousedown=function(c){k(this,this.ci,c||window.event)}}else E+=A.colSpan}++x}}p.resizeInitialized=true}});WT_DECLARE_APP_MEMBER(1,"layouts",[]);WT_DECLARE_APP_MEMBER(2,"layoutsAdjust",function(a){if(a){if(a=$("#"+a).get(0))a.dirty=true}else if(!this.adjusting){this.adjusting=true;var s;for(s=0;s<this.layouts.length;++s){a=this.layouts[s];if(!a.adjust()){this.WT.arrayRemove(this.layouts,s);--s}}this.adjusting=false}}); |
WT_DECLARE_WT_MEMBER(1,"WDialog",function(g,b){function k(a){var c=a||window.event;a=d.pageCoordinates(c);c=d.windowCoordinates(c);var e=d.windowSize();if(c.x>0&&c.x<e.x&&c.y>0&&c.y<e.y){j=true;b.style.left=d.pxself(b,"left")+a.x-h+"px";b.style.top=d.pxself(b,"top")+a.y-i+"px";h=a.x;i=a.y}}jQuery.data(b,"obj",this);var l=this,f=$(b).find(".titlebar").first().get(0),d=g.WT,h,i,j=false;if(f){f.onmousedown=function(a){a=a||window.event;d.capture(f);a=d.pageCoordinates(a);h=a.x;i=a.y;f.onmousemove=k}; | WT_DECLARE_WT_MEMBER(1,"WDialog",function(g,b){function k(a){var c=a||window.event;a=d.pageCoordinates(c);c=d.windowCoordinates(c);var e=d.windowSize();if(c.x>0&&c.x<e.x&&c.y>0&&c.y<e.y){h=true;b.style.left=d.pxself(b,"left")+a.x-i+"px";b.style.top=d.pxself(b,"top")+a.y-j+"px";i=a.x;j=a.y}}jQuery.data(b,"obj",this);var l=this,f=$(b).find(".titlebar").first().get(0),d=g.WT,i,j,h=false;if(b.style.left!=""||b.style.top!="")h=true;if(f){f.onmousedown=function(a){a=a||window.event;d.capture(f);a=d.pageCoordinates(a); i=a.x;j=a.y;f.onmousemove=k};f.onmouseup=function(){f.onmousemove=null;d.capture(null)}}this.centerDialog=function(){if(b.parentNode==null){b=f=null;this.centerDialog=function(){}}else if(b.style.display!="none"){if(!h){var a=d.windowSize(),c=b.offsetWidth,e=b.offsetHeight;b.style.left=Math.round((a.x-c)/2+(d.isIE6?document.documentElement.scrollLeft:0))+"px";b.style.top=Math.round((a.y-e)/2+(d.isIE6?document.documentElement.scrollTop:0))+"px";b.style.marginLeft="0px";b.style.marginTop="0px";b.style.width!= | WT_DECLARE_WT_MEMBER(1,"WDialog",function(g,b){function k(a){var c=a||window.event;a=d.pageCoordinates(c);c=d.windowCoordinates(c);var e=d.windowSize();if(c.x>0&&c.x<e.x&&c.y>0&&c.y<e.y){j=true;b.style.left=d.pxself(b,"left")+a.x-h+"px";b.style.top=d.pxself(b,"top")+a.y-i+"px";h=a.x;i=a.y}}jQuery.data(b,"obj",this);var l=this,f=$(b).find(".titlebar").first().get(0),d=g.WT,h,i,j=false;if(f){f.onmousedown=function(a){a=a||window.event;d.capture(f);a=d.pageCoordinates(a);h=a.x;i=a.y;f.onmousemove=k}; |
WT_DECLARE_WT_MEMBER(1,"WDialog",function(g,b){function k(a){a=c.pageCoordinates(a||window.event);j=true;b.style.left=c.pxself(b,"left")+a.x-h+"px";b.style.top=c.pxself(b,"top")+a.y-i+"px";h=a.x;i=a.y}jQuery.data(b,"obj",this);var l=this,e=$(b).find(".titlebar").first().get(0),c=g.WT,h,i,j=false;if(e){e.onmousedown=function(a){a=a||window.event;c.capture(e);a=c.pageCoordinates(a);h=a.x;i=a.y;e.onmousemove=k};e.onmouseup=function(){e.onmousemove=null;c.capture(null)}}this.centerDialog=function(){if(b.parentNode== | f.onmouseup=function(){f.onmousemove=null;d.capture(null)}}this.centerDialog=function(){if(b.parentNode==null){b=f=null;this.centerDialog=function(){}}else if(b.style.display!="none"){if(!j){var a=d.windowSize(),c=b.offsetWidth,e=b.offsetHeight;b.style.left=Math.round((a.x-c)/2+(d.isIE6?document.documentElement.scrollLeft:0))+"px";b.style.top=Math.round((a.y-e)/2+(d.isIE6?document.documentElement.scrollTop:0))+"px";b.style.marginLeft="0px";b.style.marginTop="0px";b.style.width!=null&&b.style.height!= | WT_DECLARE_WT_MEMBER(1,"WDialog",function(g,b){function k(a){a=c.pageCoordinates(a||window.event);j=true;b.style.left=c.pxself(b,"left")+a.x-h+"px";b.style.top=c.pxself(b,"top")+a.y-i+"px";h=a.x;i=a.y}jQuery.data(b,"obj",this);var l=this,e=$(b).find(".titlebar").first().get(0),c=g.WT,h,i,j=false;if(e){e.onmousedown=function(a){a=a||window.event;c.capture(e);a=c.pageCoordinates(a);h=a.x;i=a.y;e.onmousemove=k};e.onmouseup=function(){e.onmousemove=null;c.capture(null)}}this.centerDialog=function(){if(b.parentNode== |
var droppedOnPageID = $(refNode).attr('id').replace('page-', ''); | if(typeof refNode == 'undefined') droppedOnPageID = 0; else var droppedOnPageID = $(refNode).attr('id').replace('page-', '') | onMove: function(node, refNode, type, tree, rollback) { // get pageID that has to be moved var currentPageID = $(node).attr('id').replace('page-', ''); // get pageID wheron the page has been dropped var droppedOnPageID = $(refNode).attr('id').replace('page-', ''); // make the call $.ajax({ url: '/backend/ajax.php?module=pages&action=move&language={$LANGUAGE}', data: 'id=' + currentPageID + '&dropped_on='+ droppedOnPageID +'&type='+ type, success: function(json, textStatus) { if(json.code != 200) { if(jsBackend.debug) alert(textStatus); // show message jsBackend.messages.add('error', '{$errCantBeMoved|addslashes}'); // rollback $.tree.rollback(rollback); } else { // show message jsBackend.messages.add('success', '{$msgPageIsMoved|addslashes}'.replace('%1$s', json.data.title)); } } }); }, |
jsBackend.layout.showMessage('error', 'page can\'t be moved'); | jsBackend.layout.showMessage('error', '{$errCantBeMoved}'); | onMove: function(node, refNode, type, tree, rollback) { // get pageID that has to be moved var currentPageID = $(node).attr('id').replace('page-', ''); // get pageID wheron the page has been dropped var droppedOnPageID = $(refNode).attr('id').replace('page-', ''); // make the call $.ajax({ type: 'POST', dataType: 'json', url: '/backend/ajax.php?module=pages&action=move&language={$LANGUAGE}', data: 'id=' + currentPageID + '&dropped_on='+ droppedOnPageID +'&type='+ type, error: function(XMLHttpRequest, textStatus, errorThrown) { if(jsBackend.debug) alert(textStatus); }, success: function(json, textStatus) { if(json.code != 200) { if(jsBackend.debug) alert(textStatus); // show message jsBackend.layout.showMessage('error', 'page can\'t be moved'); // @todo label // rollback $.tree.rollback(rollback); } else { // show message jsBackend.layout.showMessage('success', 'page moved'); // @todo label } }, }); }, |
jsBackend.layout.showMessage('success', 'page moved'); | jsBackend.layout.showMessage('success', '{$msgPageIsMoved}'); | onMove: function(node, refNode, type, tree, rollback) { // get pageID that has to be moved var currentPageID = $(node).attr('id').replace('page-', ''); // get pageID wheron the page has been dropped var droppedOnPageID = $(refNode).attr('id').replace('page-', ''); // make the call $.ajax({ type: 'POST', dataType: 'json', url: '/backend/ajax.php?module=pages&action=move&language={$LANGUAGE}', data: 'id=' + currentPageID + '&dropped_on='+ droppedOnPageID +'&type='+ type, error: function(XMLHttpRequest, textStatus, errorThrown) { if(jsBackend.debug) alert(textStatus); }, success: function(json, textStatus) { if(json.code != 200) { if(jsBackend.debug) alert(textStatus); // show message jsBackend.layout.showMessage('error', 'page can\'t be moved'); // @todo label // rollback $.tree.rollback(rollback); } else { // show message jsBackend.layout.showMessage('success', 'page moved'); // @todo label } }, }); }, |
jsBackend.layout.showMessage('error', 'page can\'t be moved'); | onMove: function(node, refNode, type, tree, rollback) { // get pageID that has to be moved var currentPageID = $(node).attr('id').replace('page-', ''); // get pageID wheron the page has been dropped var droppedOnPageID = $(refNode).attr('id').replace('page-', ''); // make the call @todo Tijs, check: http://docs.jquery.com/Ajax/jQuery.ajaxSetup! $.ajax({ type: 'POST', dataType: 'json', url: '/backend/ajax.php?module=pages&action=move&language={$LANGUAGE}', data: 'id=' + currentPageID + '&dropped_on='+ droppedOnPageID +'&type='+ type, error: function(XMLHttpRequest, textStatus, errorThrown) { if(jsBackend.debug) alert(textStatus); }, success: function(json, textStatus) { if(json.code != 200) { if(jsBackend.debug) alert(textStatus); // show error // @todo show errormessage // rollback $.tree.rollback(rollback); } else { // @todo show succesmessage } }, }); }, |
|
jsBackend.layout.showMessage('success', 'page moved'); | onMove: function(node, refNode, type, tree, rollback) { // get pageID that has to be moved var currentPageID = $(node).attr('id').replace('page-', ''); // get pageID wheron the page has been dropped var droppedOnPageID = $(refNode).attr('id').replace('page-', ''); // make the call @todo Tijs, check: http://docs.jquery.com/Ajax/jQuery.ajaxSetup! $.ajax({ type: 'POST', dataType: 'json', url: '/backend/ajax.php?module=pages&action=move&language={$LANGUAGE}', data: 'id=' + currentPageID + '&dropped_on='+ droppedOnPageID +'&type='+ type, error: function(XMLHttpRequest, textStatus, errorThrown) { if(jsBackend.debug) alert(textStatus); }, success: function(json, textStatus) { if(json.code != 200) { if(jsBackend.debug) alert(textStatus); // show error // @todo show errormessage // rollback $.tree.rollback(rollback); } else { // @todo show succesmessage } }, }); }, |
|
jsBackend.messages.add('success', '{$msgPageIsMoved}'); | jsBackend.messages.add('success', '{$msgPageIsMoved|addslashes}'.replace('%1$s', 'tet')); | onMove: function(node, refNode, type, tree, rollback) { // get pageID that has to be moved var currentPageID = $(node).attr('id').replace('page-', ''); // get pageID wheron the page has been dropped var droppedOnPageID = $(refNode).attr('id').replace('page-', ''); // make the call $.ajax({ url: '/backend/ajax.php?module=pages&action=move&language={$LANGUAGE}', data: 'id=' + currentPageID + '&dropped_on='+ droppedOnPageID +'&type='+ type, success: function(json, textStatus) { if(json.code != 200) { if(jsBackend.debug) alert(textStatus); // show message jsBackend.messages.add('error', '{$errCantBeMoved}'); // rollback $.tree.rollback(rollback); } else { // show message jsBackend.messages.add('success', '{$msgPageIsMoved}'); } } }); }, |
jsBackend.messages.add('success', '{$msgPageIsMoved|addslashes}'.replace('%1$s', 'tet')); | jsBackend.messages.add('success', '{$msgPageIsMoved|addslashes}'.replace('%1$s', json.data.title)); | onMove: function(node, refNode, type, tree, rollback) { // get pageID that has to be moved var currentPageID = $(node).attr('id').replace('page-', ''); // get pageID wheron the page has been dropped var droppedOnPageID = $(refNode).attr('id').replace('page-', ''); // make the call $.ajax({ url: '/backend/ajax.php?module=pages&action=move&language={$LANGUAGE}', data: 'id=' + currentPageID + '&dropped_on='+ droppedOnPageID +'&type='+ type, success: function(json, textStatus) { if(json.code != 200) { if(jsBackend.debug) alert(textStatus); // show message jsBackend.messages.add('error', '{$errCantBeMoved}'); // rollback $.tree.rollback(rollback); } else { // show message jsBackend.messages.add('success', '{$msgPageIsMoved|addslashes}'.replace('%1$s', 'tet')); // @todo tijs - 'tet' moet uiteraard de naam van de pagina worden. } } }); }, |
window.keeFoxInst.KFLog.warn("Problem authenticating with KeePass. The error code is: " + resultWrapper.result); | window.keefox_org.Logger.warn("Problem authenticating with KeePass. The error code is: " + resultWrapper.result); | this.onNotify = function(topic, message) { if (topic == "transport-status-connected") { //TODO: what thread is this calback called on? if not main, then need to call back to that thread to avoid GUI DOM update crashes //TODO: calculate base64 representations of the security codes required to identify this RPC client this.request(this, "Authenticate", [this.clientVersion, "KeeFox Firefox add-on", this.getClientIdSignatureBase64(), this.getUniqueClientIdBase64()], function rpc_callback(resultWrapper) { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); if (resultWrapper.result == 0) // successfully authorised by remote RPC server { window.setTimeout(function () { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); window.keeFoxInst._keeFoxStorage.set("KeePassRPCActive", true); // is this the right place to do this? window.keeFoxInst._keeFoxVariableInit();//window.keefox_org.toolbar, window); window.keeFoxInst._refreshKPDB();//_keeFoxInitialToolBarSetup(window.keefox_org.toolbar, window); }, 100); // 0.1 second delay before we try to do the KeeFox connection startup stuff } else { //TODO: handle error codes better window.keeFoxInst.KFLog.warn("Problem authenticating with KeePass. The error code is: " + resultWrapper.result); window.keeFoxInst._pauseKeeFox(); } //TODO: set confirmation that the connection is established and authenticated? }, this.requestId); } } |
} else if (topic == "connect-failed") { | this.onNotify = function(topic, message) { if (topic == "transport-status-connected") { //TODO: what thread is this calback called on? if not main, then need to call back to that thread to avoid GUI DOM update crashes //TODO: calculate base64 representations of the security codes required to identify this RPC client this.request(this, "Authenticate", [this.clientVersion, "KeeFox Firefox add-on", this.getClientIdSignatureBase64(), this.getUniqueClientIdBase64()], function rpc_callback(resultWrapper) { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); if (resultWrapper.result == 0) // successfully authorised by remote RPC server { window.setTimeout(function () { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); window.keeFoxInst._keeFoxStorage.set("KeePassRPCActive", true); // is this the right place to do this? window.keeFoxInst._keeFoxVariableInit();//window.keefox_org.toolbar, window); window.keeFoxInst._refreshKPDB();//_keeFoxInitialToolBarSetup(window.keefox_org.toolbar, window); }, 100); // 0.1 second delay before we try to do the KeeFox connection startup stuff } else { //TODO: handle error codes better window.keeFoxInst.KFLog.warn("Problem authenticating with KeePass. The error code is: " + resultWrapper.result); window.keeFoxInst._pauseKeeFox(); } //TODO: set confirmation that the connection is established and authenticated? }, this.requestId); } } |
|
window.keeFoxInst._keeFoxVariableInit(window.keeFoxToolbar, window); window.keeFoxInst._keeFoxInitialToolBarSetup(window.keeFoxToolbar, window); | window.keeFoxInst._keeFoxVariableInit(); window.keeFoxInst._refreshKPDB(); | this.onNotify = function(topic, message) { if (topic == "transport-status-connected") { //TODO: what thread is this calback called on? if not main, then need to call back to that thread to avoid GUI DOM update crashes //TODO: calculate base64 representations of the security codes required to identify this RPC client this.request(this, "Authenticate", [this.clientVersion, "KeeFox Firefox add-on", this.getClientIdSignatureBase64(), this.getUniqueClientIdBase64()], function rpc_callback(resultWrapper) { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); if (resultWrapper.result == 0) // successfully authorised by remote RPC server { window.setTimeout(function () { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); window.keeFoxInst._keeFoxStorage.set("KeePassRPCActive", true); // is this the right place to do this? window.keeFoxInst._keeFoxVariableInit(window.keeFoxToolbar, window); window.keeFoxInst._keeFoxInitialToolBarSetup(window.keeFoxToolbar, window); }, 100); // 0.1 second delay before we try to do the KeeFox connection startup stuff } else { //TODO: handle error codes } //TODO: set confirmation that the connection is established and authenticated? }, this.requestId); } } |
} else { | } else { window.keeFoxInst.KFLog.warn("Problem authenticating with KeePass. The error code is: " + resultWrapper.result); window.keeFoxInst._pauseKeeFox(); | this.onNotify = function(topic, message) { if (topic == "transport-status-connected") { //TODO: what thread is this calback called on? if not main, then need to call back to that thread to avoid GUI DOM update crashes //TODO: calculate base64 representations of the security codes required to identify this RPC client this.request(this, "Authenticate", [this.clientVersion, "KeeFox Firefox add-on", this.getClientIdSignatureBase64(), this.getUniqueClientIdBase64()], function rpc_callback(resultWrapper) { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); if (resultWrapper.result == 0) // successfully authorised by remote RPC server { window.setTimeout(function () { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); window.keeFoxInst._keeFoxStorage.set("KeePassRPCActive", true); // is this the right place to do this? window.keeFoxInst._keeFoxVariableInit(window.keeFoxToolbar, window); window.keeFoxInst._keeFoxInitialToolBarSetup(window.keeFoxToolbar, window); }, 100); // 0.1 second delay before we try to do the KeeFox connection startup stuff } else { //TODO: handle error codes } //TODO: set confirmation that the connection is established and authenticated? }, this.requestId); } } |
F.fakeObj=false;var C=F.getParentEditor(),D=C.getSelection(),E=null;if((E=b.getSelectedLink(C))&&E.hasAttribute('href'))D.selectElement(E);else if((E=D.getSelectedElement())&&E.is('img')&&E.getAttribute('_cke_real_element_type')&&E.getAttribute('_cke_real_element_type')=='anchor'){F.fakeObj=E;E=C.restoreRealElement(F.fakeObj);D.selectElement(F.fakeObj);}else E=null;F.setupContent(p.apply(F,[C,E]));},onOk:function(){var C={href:'javascript:void(0)/*'+CKEDITOR.tools.getNextNumber()+'*/'},D=[],E={href:C.href},F=this,G=this.getParentEditor();this.commitContent(E);switch(E.type||'url'){case 'url':var H=E.url&&E.url.protocol!=undefined?E.url.protocol:'http: ab.type=CKEDITOR.STYLE_INLINE;ab.apply(G.document);if(E.adv&&E.adv.advId){var ac=this.getParentEditor().document.$.getElementsByTagName('a');for(W=0;W<ac.length;W++){if(ac[W].href==C.href){ac[W].id=E.adv.advId;break;}}}}else{var ad=this._.selectedElement,ae=ad.getAttribute('_cke_saved_href'),af=ad.getHtml();if(CKEDITOR.env.ie&&C.name!=ad.getAttribute('name')){var ag=new CKEDITOR.dom.element('<a name="'+CKEDITOR.tools.htmlEncode(C.name)+'">',G.document);Y=G.getSelection();ad.moveChildren(ag);ad.copyAttributes(ag,{name:1});ag.replace(ad);ad=ag;Y.selectElement(ad);}ad.setAttributes(C);ad.removeAttributes(D);if(ae==af)ad.setHtml(C._cke_saved_href);if(ad.getAttribute('name'))ad.addClass('cke_anchor');else ad.removeClass('cke_anchor');if(this.fakeObj)G.createFakeElement(ad,'cke_anchor','anchor').replace(this.fakeObj);delete this._.selectedElement;}},onLoad:function(){if(!a.config.linkShowAdvancedTab)this.hidePage('advanced');if(!a.config.linkShowTargetTab)this.hidePage('target');},onFocus:function(){var C=this.getContentElement('info','linkType'),D;if(C&&C.getValue()=='url'){D=this.getContentElement('info','url');D.select();}}};}); | F.fakeObj=false;var C=F.getParentEditor(),D=C.getSelection(),E=null;if((E=b.getSelectedLink(C))&&E.hasAttribute('href'))D.selectElement(E);else if((E=D.getSelectedElement())&&E.is('img')&&E.getAttribute('_cke_real_element_type')&&E.getAttribute('_cke_real_element_type')=='anchor'){F.fakeObj=E;E=C.restoreRealElement(F.fakeObj);D.selectElement(F.fakeObj);}else E=null;F.setupContent(p.apply(F,[C,E]));},onOk:function(){var C={href:'javascript:void(0)/*'+CKEDITOR.tools.getNextNumber()+'*/'},D=[],E={href:C.href},F=this,G=this.getParentEditor();this.commitContent(E);switch(E.type||'url'){case 'url':var H=E.url&&E.url.protocol!=undefined?E.url.protocol:'http: }var ab=new CKEDITOR.style({element:'a',attributes:C});ab.type=CKEDITOR.STYLE_INLINE;ab.apply(G.document);if(E.adv&&E.adv.advId){var ac=this.getParentEditor().document.$.getElementsByTagName('a');for(W=0;W<ac.length;W++){if(ac[W].href==C.href){ac[W].id=E.adv.advId;break;}}}}else{var ad=this._.selectedElement,ae=ad.getAttribute('_cke_saved_href'),af=ad.getHtml();if(CKEDITOR.env.ie&&C.name!=ad.getAttribute('name')){var ag=new CKEDITOR.dom.element('<a name="'+CKEDITOR.tools.htmlEncode(C.name)+'">',G.document);Y=G.getSelection();ad.moveChildren(ag);ad.copyAttributes(ag,{name:1});ag.replace(ad);ad=ag;Y.selectElement(ad);}ad.setAttributes(C);ad.removeAttributes(D);if(ae==af||E.type=='email'&&af.indexOf('@')!=-1)ad.setHtml(E.type=='email'?E.email.address:C._cke_saved_href);if(ad.getAttribute('name'))ad.addClass('cke_anchor');else ad.removeClass('cke_anchor');if(this.fakeObj)G.createFakeElement(ad,'cke_anchor','anchor').replace(this.fakeObj);delete this._.selectedElement;}},onLoad:function(){if(!a.config.linkShowAdvancedTab)this.hidePage('advanced');if(!a.config.linkShowTargetTab)this.hidePage('target');},onFocus:function(){var C=this.getContentElement('info','linkType'),D;if(C&&C.getValue()=='url'){D=this.getContentElement('info','url');D.select();}}};}); | F.fakeObj=false;var C=F.getParentEditor(),D=C.getSelection(),E=null;if((E=b.getSelectedLink(C))&&E.hasAttribute('href'))D.selectElement(E);else if((E=D.getSelectedElement())&&E.is('img')&&E.getAttribute('_cke_real_element_type')&&E.getAttribute('_cke_real_element_type')=='anchor'){F.fakeObj=E;E=C.restoreRealElement(F.fakeObj);D.selectElement(F.fakeObj);}else E=null;F.setupContent(p.apply(F,[C,E]));},onOk:function(){var C={href:'javascript:void(0)/*'+CKEDITOR.tools.getNextNumber()+'*/'},D=[],E={href:C.href},F=this,G=this.getParentEditor();this.commitContent(E);switch(E.type||'url'){case 'url':var H=E.url&&E.url.protocol!=undefined?E.url.protocol:'http://',I=E.url&&E.url.url||'';C._cke_saved_href=I.indexOf('/')===0?I:H+I;break;case 'anchor':var J=E.anchor&&E.anchor.name,K=E.anchor&&E.anchor.id;C._cke_saved_href='#'+(J||K||'');break;case 'email':var L,M=E.email,N=M.address;switch(y){case '':case 'encode':var O=encodeURIComponent(M.subject||''),P=encodeURIComponent(M.body||''),Q=[];O&&Q.push('subject='+O);P&&Q.push('body='+P);Q=Q.length?'?'+Q.join('&'):'';if(y=='encode'){L=["javascript:void(location.href='mailto:'+",B(N)];Q&&L.push("+'",x(Q),"'");L.push(')');}else L=['mailto:',N,Q];break;default:var R=N.split('@',2);M.name=R[0];M.domain=R[1];L=['javascript:',A(M)];}C._cke_saved_href=L.join('');break;}if(E.target)if(E.target.type=='popup'){var S=["window.open(this.href, '",E.target.name||'',"', '"],T=['resizable','status','location','toolbar','menubar','fullscreen','scrollbars','dependent'],U=T.length,V=function(ah){if(E.target[ah])T.push(ah+'='+E.target[ah]);};for(var W=0;W<U;W++)T[W]=T[W]+(E.target[T[W]]?'=yes':'=no');V('width');V('left');V('height');V('top');S.push(T.join(','),"'); return false;");C._cke_pa_onclick=S.join('');}else{if(E.target.type!='notSet'&&E.target.name)C.target=E.target.name;else D.push('target');D.push('_cke_pa_onclick','onclick');}if(E.adv){var X=function(ah,ai){var aj=E.adv[ah];if(aj)C[ai]=aj;else D.push(ai);};if(this._.selectedElement)X('advId','id');X('advLangDir','dir');X('advAccessKey','accessKey');X('advName','name');X('advLangCode','lang');X('advTabIndex','tabindex');X('advTitle','title');X('advContentType','type');X('advCSSClasses','class');X('advCharset','charset');X('advStyles','style');}if(!this._.selectedElement){var Y=G.getSelection(),Z=Y.getRanges();if(Z.length==1&&Z[0].collapsed){var aa=new CKEDITOR.dom.text(C._cke_saved_href,G.document);Z[0].insertNode(aa);Z[0].selectNodeContents(aa);Y.selectRanges(Z);}var ab=new CKEDITOR.style({element:'a',attributes:C});ab.type=CKEDITOR.STYLE_INLINE;ab.apply(G.document);if(E.adv&&E.adv.advId){var ac=this.getParentEditor().document.$.getElementsByTagName('a');for(W=0;W<ac.length;W++){if(ac[W].href==C.href){ac[W].id=E.adv.advId;break;}}}}else{var ad=this._.selectedElement,ae=ad.getAttribute('_cke_saved_href'),af=ad.getHtml();if(CKEDITOR.env.ie&&C.name!=ad.getAttribute('name')){var ag=new CKEDITOR.dom.element('<a name="'+CKEDITOR.tools.htmlEncode(C.name)+'">',G.document);Y=G.getSelection();ad.moveChildren(ag);ad.copyAttributes(ag,{name:1});ag.replace(ad);ad=ag;Y.selectElement(ad);}ad.setAttributes(C);ad.removeAttributes(D);if(ae==af)ad.setHtml(C._cke_saved_href);if(ad.getAttribute('name'))ad.addClass('cke_anchor');else ad.removeClass('cke_anchor');if(this.fakeObj)G.createFakeElement(ad,'cke_anchor','anchor').replace(this.fakeObj);delete this._.selectedElement;}},onLoad:function(){if(!a.config.linkShowAdvancedTab)this.hidePage('advanced');if(!a.config.linkShowTargetTab)this.hidePage('target');},onFocus:function(){var C=this.getContentElement('info','linkType'),D;if(C&&C.getValue()=='url'){D=this.getContentElement('info','url');D.select();}}};}); |
if(l&&l!=1)this.setValue(l);},commit:function(k){var l=parseInt(this.getValue(),10);if(l&&l!=1)k.setAttribute('colSpan',this.getValue());else k.removeAttribute('colSpan');}},i(),{type:'hbox',padding:0,widths:['80%','20%'],children:[{type:'text',id:'bgColor',label:c.bgColor,labelLayout:'horizontal',widths:['70%','30%'],'default':'',setup:function(k){var l=k.getAttribute('bgColor'),m=k.getStyle('background-color');this.setValue(m||l);},commit:function(k){var l=this.getValue();if(l)k.setStyle('background-color',this.getValue());else k.removeStyle('background-color');k.removeAttribute('bgColor');}},{type:'button',id:'bgColorChoose',label:c.chooseColor,style:'margin-left: 10px',onClick:function(){var k=this;j('colordialog',function(l){k.getDialog().getContentElement('info','bgColor').setValue(l.getContentElement('picker','selectedColor').getValue());});}}]},i(),{type:'hbox',padding:0,widths:['80%','20%'],children:[{type:'text',id:'borderColor',label:c.borderColor,labelLayout:'horizontal',widths:['70%','30%'],'default':'',setup:function(k){var l=k.getAttribute('borderColor'),m=k.getStyle('border-color');this.setValue(m||l);},commit:function(k){var l=this.getValue();if(l)k.setStyle('border-color',this.getValue());else k.removeStyle('border-color');k.removeAttribute('borderColor');}},{type:'button',id:'borderColorChoose',label:c.chooseColor,style:'margin-left: 10px',onClick:function(){var k=this;j('colordialog',function(l){k.getDialog().getContentElement('info','borderColor').setValue(l.getContentElement('picker','selectedColor').getValue());});}}]}]}]}]}],onShow:function(){var k=this;k.cells=CKEDITOR.plugins.tabletools.getSelectedCells(k._.editor.getSelection());k.setupContent(k.cells[0]);},onOk:function(){var k=this._.editor.getSelection(),l=k.createBookmarks(),m=this.cells;for(var n=0;n<m.length;n++)this.commitContent(m[n]);k.selectBookmarks(l);}};}); | if(l&&l!=1)this.setValue(l);},commit:function(k){var l=parseInt(this.getValue(),10);if(l&&l!=1)k.setAttribute('colSpan',this.getValue());else k.removeAttribute('colSpan');}},i,{type:'hbox',padding:0,widths:['80%','20%'],children:[{type:'text',id:'bgColor',label:c.bgColor,labelLayout:'horizontal',widths:['70%','30%'],'default':'',setup:function(k){var l=k.getAttribute('bgColor'),m=k.getStyle('background-color');this.setValue(m||l);},commit:function(k){var l=this.getValue();if(l)k.setStyle('background-color',this.getValue());else k.removeStyle('background-color');k.removeAttribute('bgColor');}},{type:'button',id:'bgColorChoose',label:c.chooseColor,style:'margin-left: 10px',onClick:function(){var k=this;j('colordialog',function(l){k.getDialog().getContentElement('info','bgColor').setValue(l.getContentElement('picker','selectedColor').getValue());});}}]},i,{type:'hbox',padding:0,widths:['80%','20%'],children:[{type:'text',id:'borderColor',label:c.borderColor,labelLayout:'horizontal',widths:['70%','30%'],'default':'',setup:function(k){var l=k.getAttribute('borderColor'),m=k.getStyle('border-color');this.setValue(m||l);},commit:function(k){var l=this.getValue();if(l)k.setStyle('border-color',this.getValue());else k.removeStyle('border-color');k.removeAttribute('borderColor');}},{type:'button',id:'borderColorChoose',label:c.chooseColor,style:'margin-left: 10px',onClick:function(){var k=this;j('colordialog',function(l){k.getDialog().getContentElement('info','borderColor').setValue(l.getContentElement('picker','selectedColor').getValue());});}}]}]}]}]}],onShow:function(){var k=this;k.cells=CKEDITOR.plugins.tabletools.getSelectedCells(k._.editor.getSelection());k.setupContent(k.cells[0]);},onOk:function(){var q=this;var k=q._.editor.getSelection(),l=k.createBookmarks(),m=q.cells;for(var n=0;n<m.length;n++)q.commitContent(m[n]);k.selectBookmarks(l);var o=k.getStartElement(),p=new CKEDITOR.dom.elementPath(o);q._.editor._.selectionPreviousPath=p;q._.editor.fire('selectionChange',{selection:k,path:p,element:o});}};}); | if(l&&l!=1)this.setValue(l);},commit:function(k){var l=parseInt(this.getValue(),10);if(l&&l!=1)k.setAttribute('colSpan',this.getValue());else k.removeAttribute('colSpan');}},i(),{type:'hbox',padding:0,widths:['80%','20%'],children:[{type:'text',id:'bgColor',label:c.bgColor,labelLayout:'horizontal',widths:['70%','30%'],'default':'',setup:function(k){var l=k.getAttribute('bgColor'),m=k.getStyle('background-color');this.setValue(m||l);},commit:function(k){var l=this.getValue();if(l)k.setStyle('background-color',this.getValue());else k.removeStyle('background-color');k.removeAttribute('bgColor');}},{type:'button',id:'bgColorChoose',label:c.chooseColor,style:'margin-left: 10px',onClick:function(){var k=this;j('colordialog',function(l){k.getDialog().getContentElement('info','bgColor').setValue(l.getContentElement('picker','selectedColor').getValue());});}}]},i(),{type:'hbox',padding:0,widths:['80%','20%'],children:[{type:'text',id:'borderColor',label:c.borderColor,labelLayout:'horizontal',widths:['70%','30%'],'default':'',setup:function(k){var l=k.getAttribute('borderColor'),m=k.getStyle('border-color');this.setValue(m||l);},commit:function(k){var l=this.getValue();if(l)k.setStyle('border-color',this.getValue());else k.removeStyle('border-color');k.removeAttribute('borderColor');}},{type:'button',id:'borderColorChoose',label:c.chooseColor,style:'margin-left: 10px',onClick:function(){var k=this;j('colordialog',function(l){k.getDialog().getContentElement('info','borderColor').setValue(l.getContentElement('picker','selectedColor').getValue());});}}]}]}]}]}],onShow:function(){var k=this;k.cells=CKEDITOR.plugins.tabletools.getSelectedCells(k._.editor.getSelection());k.setupContent(k.cells[0]);},onOk:function(){var k=this._.editor.getSelection(),l=k.createBookmarks(),m=this.cells;for(var n=0;n<m.length;n++)this.commitContent(m[n]);k.selectBookmarks(l);}};}); |
q.push(u);}q.sort(l);}s&&s();});};m.ui.addRichCombo('Styles',{label:o.label,title:o.panelTitle,className:'cke_styles',panel:{css:m.skin.editor.css.concat(n.contentsCss),multiSelect:true,attributes:{'aria-label':o.panelTitle}},init:function(){var s=this;r(function(){var t,u,v;for(var w=0;w<q.length;w++){t=q[w];u=t._name;var x=t.type;if(x!=v){s.startGroup(o['panelTitle'+String(x)]);v=x;}s.add(u,t.type==3?u:t.buildPreview(),u);}s.commit();s.onOpen();});},onClick:function(s){m.focus();m.fire('saveSnapshot');var t=p[s],u=m.getSelection(),v=new d.elementPath(u.getStartElement());if(t.type==2&&t.checkActive(v))t.remove(m.document);else t.apply(m.document);m.fire('saveSnapshot');},onRender:function(){m.on('selectionChange',function(s){var t=this.getValue(),u=s.data.path,v=u.elements;for(var w=0,x;w<v.length;w++){x=v[w];for(var y in p){if(p[y].checkElementRemovable(x,true)){if(y!=t)this.setValue(y);return;}}}this.setValue('');},this);},onOpen:function(){var z=this;if(c||b.webkit)m.focus();var s=m.getSelection(),t=s.getSelectedElement(),u=new d.elementPath(t||s.getStartElement()),v=[0,0,0,0];z.showAll();z.unmarkAll();for(var w in p){var x=p[w],y=x.type;if(x.checkActive(u))z.mark(w);else if(y==3&&!x.checkApplicable(u)){z.hideItem(w);v[y]--;}v[y]++;}if(!v[1])z.hideGroup(o['panelTitle'+String(1)]);if(!v[2])z.hideGroup(o['panelTitle'+String(2)]);if(!v[3])z.hideGroup(o['panelTitle'+String(3)]);}});m.on('instanceReady',function(){r();});}});function l(m,n){var o=m.type,p=n.type;return o==p?0:o==3?-1:p==3?1:p==1?1:-1;};})();j.add('table',{init:function(l){var m=j.table,n=l.lang.table;l.addCommand('table',new a.dialogCommand('table'));l.addCommand('tableProperties',new a.dialogCommand('tableProperties'));l.ui.addButton('Table',{label:n.toolbar,command:'table'});a.dialog.add('table',this.path+'dialogs/table.js');a.dialog.add('tableProperties',this.path+'dialogs/table.js');if(l.addMenuItems)l.addMenuItems({table:{label:n.menu,command:'tableProperties',group:'table',order:5},tabledelete:{label:n.deleteTable,command:'tableDelete',group:'table',order:1}});if(l.contextMenu)l.contextMenu.addListener(function(o,p){if(!o)return null;var q=o.is('table')||o.hasAscendant('table');if(q)return{tabledelete:2,table:2};return null;});}});(function(){function l(F,G){if(c)F.removeAttribute(G);else delete F[G];};var m=/^(?:td|th)$/;function n(F){var G=F.createBookmarks(),H=F.getRanges(),I=[],J={};function K(S){if(I.length>0)return;if(S.type==1&&m.test(S.getName())&&!S.getCustomData('selected_cell')){h.setMarker(J,S,'selected_cell',true); | l.fire('ariaWidget',o);o.on('blur',function(){l.focusManager.blur();});o.on('focus',function(){l.focusManager.focus();});l.mayBeDirty=true;this.loadData(r);var t=l.keystrokeHandler;if(t)t.attach(o);setTimeout(function(){l.mode='source';l.fire('mode');},b.gecko||b.webkit?100:0);},loadData:function(q){o.setValue(q);l.fire('dataReady');},getData:function(){return o.getValue();},getSnapshotData:function(){return o.getValue();},unload:function(q){o.clearCustomData();l.textarea=o=null;if(p){l.removeListener('resize',p);n.removeListener('resize',p);}if(c&&b.version<8)q.removeStyle('position');},focus:function(){o.focus();}});});l.addCommand('source',m.commands.source);if(l.ui.addButton)l.ui.addButton('Source',{label:l.lang.source,command:'source'});l.on('mode',function(){l.getCommand('source').setState(l.mode=='source'?1:2);});}});j.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:false,exec:function(l){if(l.mode=='wysiwyg')l.fire('saveSnapshot');l.getCommand('source').setState(0);l.setMode(l.mode=='source'?'wysiwyg':'source');},canUndo:false}}};(function(){j.add('stylescombo',{requires:['richcombo','styles'],init:function(m){var n=m.config,o=m.lang.stylesCombo,p={},q=[];function r(s){m.getStylesSet(function(t){if(!q.length){var u,v;for(var w=0;w<t.length;w++){var x=t[w];v=x.name;u=p[v]=new a.style(x);u._name=v;u._.enterMode=n.enterMode;q.push(u);}q.sort(l);}s&&s();});};m.ui.addRichCombo('Styles',{label:o.label,title:o.panelTitle,className:'cke_styles',panel:{css:m.skin.editor.css.concat(n.contentsCss),multiSelect:true,attributes:{'aria-label':o.panelTitle}},init:function(){var s=this;r(function(){var t,u,v;for(var w=0;w<q.length;w++){t=q[w];u=t._name;var x=t.type;if(x!=v){s.startGroup(o['panelTitle'+String(x)]);v=x;}s.add(u,t.type==3?u:t.buildPreview(),u);}s.commit();s.onOpen();});},onClick:function(s){m.focus();m.fire('saveSnapshot');var t=p[s],u=m.getSelection(),v=new d.elementPath(u.getStartElement());if(t.type==2&&t.checkActive(v))t.remove(m.document);else if(t.type==3&&t.checkActive(v))t.remove(m.document);else t.apply(m.document);m.fire('saveSnapshot');},onRender:function(){m.on('selectionChange',function(s){var t=this.getValue(),u=s.data.path,v=u.elements;for(var w=0,x;w<v.length;w++){x=v[w];for(var y in p){if(p[y].checkElementRemovable(x,true)){if(y!=t)this.setValue(y);return;}}}this.setValue('');},this);},onOpen:function(){var z=this;if(c||b.webkit)m.focus();var s=m.getSelection(),t=s.getSelectedElement(),u=new d.elementPath(t||s.getStartElement()),v=[0,0,0,0]; z.showAll();z.unmarkAll();for(var w in p){var x=p[w],y=x.type;if(x.checkActive(u))z.mark(w);else if(y==3&&!x.checkApplicable(u)){z.hideItem(w);v[y]--;}v[y]++;}if(!v[1])z.hideGroup(o['panelTitle'+String(1)]);if(!v[2])z.hideGroup(o['panelTitle'+String(2)]);if(!v[3])z.hideGroup(o['panelTitle'+String(3)]);}});m.on('instanceReady',function(){r();});}});function l(m,n){var o=m.type,p=n.type;return o==p?0:o==3?-1:p==3?1:p==1?1:-1;};})();j.add('table',{init:function(l){var m=j.table,n=l.lang.table;l.addCommand('table',new a.dialogCommand('table'));l.addCommand('tableProperties',new a.dialogCommand('tableProperties'));l.ui.addButton('Table',{label:n.toolbar,command:'table'});a.dialog.add('table',this.path+'dialogs/table.js');a.dialog.add('tableProperties',this.path+'dialogs/table.js');if(l.addMenuItems)l.addMenuItems({table:{label:n.menu,command:'tableProperties',group:'table',order:5},tabledelete:{label:n.deleteTable,command:'tableDelete',group:'table',order:1}});l.on('doubleclick',function(o){var p=o.data.element;if(p.is('table'))o.data.dialog='tableProperties';});if(l.contextMenu)l.contextMenu.addListener(function(o,p){if(!o||o.isReadOnly())return null;var q=o.is('table')||o.hasAscendant('table');if(q)return{tabledelete:2,table:2};return null;});}});(function(){function l(F,G){if(c)F.removeAttribute(G);else delete F[G];};var m=/^(?:td|th)$/;function n(F){var G=F.createBookmarks(),H=F.getRanges(),I=[],J={};function K(S){if(I.length>0)return;if(S.type==1&&m.test(S.getName())&&!S.getCustomData('selected_cell')){h.setMarker(J,S,'selected_cell',true);I.push(S);}};for(var L=0;L<H.length;L++){var M=H[L];if(M.collapsed){var N=M.getCommonAncestor(),O=N.getAscendant('td',true)||N.getAscendant('th',true);if(O)I.push(O);}else{var P=new d.walker(M),Q;P.guard=K;while(Q=P.next()){var R=Q.getParent();if(R&&m.test(R.getName())&&!R.getCustomData('selected_cell')){h.setMarker(J,R,'selected_cell',true);I.push(R);}}}}h.clearAllMarkers(J);F.selectBookmarks(G);return I;};function o(F){var G=0,H=F.length-1,I={},J,K,L;while(J=F[G++])h.setMarker(I,J,'delete_cell',true);G=0;while(J=F[G++]){if((K=J.getPrevious())&&!K.getCustomData('delete_cell')||(K=J.getNext())&&!K.getCustomData('delete_cell')){h.clearAllMarkers(I);return K;}}h.clearAllMarkers(I);L=F[0].getParent();if(L=L.getPrevious())return L.getLast();L=F[H].getParent();if(L=L.getNext())return L.getChild(0);return null;};function p(F){var G=F.cells;for(var H=0;H<G.length;H++){G[H].innerHTML='';if(!c)new h(G[H]).appendBogus();}};function q(F,G){var H=F.getStartElement().getAscendant('tr'); | q.push(u);}q.sort(l);}s&&s();});};m.ui.addRichCombo('Styles',{label:o.label,title:o.panelTitle,className:'cke_styles',panel:{css:m.skin.editor.css.concat(n.contentsCss),multiSelect:true,attributes:{'aria-label':o.panelTitle}},init:function(){var s=this;r(function(){var t,u,v;for(var w=0;w<q.length;w++){t=q[w];u=t._name;var x=t.type;if(x!=v){s.startGroup(o['panelTitle'+String(x)]);v=x;}s.add(u,t.type==3?u:t.buildPreview(),u);}s.commit();s.onOpen();});},onClick:function(s){m.focus();m.fire('saveSnapshot');var t=p[s],u=m.getSelection(),v=new d.elementPath(u.getStartElement());if(t.type==2&&t.checkActive(v))t.remove(m.document);else t.apply(m.document);m.fire('saveSnapshot');},onRender:function(){m.on('selectionChange',function(s){var t=this.getValue(),u=s.data.path,v=u.elements;for(var w=0,x;w<v.length;w++){x=v[w];for(var y in p){if(p[y].checkElementRemovable(x,true)){if(y!=t)this.setValue(y);return;}}}this.setValue('');},this);},onOpen:function(){var z=this;if(c||b.webkit)m.focus();var s=m.getSelection(),t=s.getSelectedElement(),u=new d.elementPath(t||s.getStartElement()),v=[0,0,0,0];z.showAll();z.unmarkAll();for(var w in p){var x=p[w],y=x.type;if(x.checkActive(u))z.mark(w);else if(y==3&&!x.checkApplicable(u)){z.hideItem(w);v[y]--;}v[y]++;}if(!v[1])z.hideGroup(o['panelTitle'+String(1)]);if(!v[2])z.hideGroup(o['panelTitle'+String(2)]);if(!v[3])z.hideGroup(o['panelTitle'+String(3)]);}});m.on('instanceReady',function(){r();});}});function l(m,n){var o=m.type,p=n.type;return o==p?0:o==3?-1:p==3?1:p==1?1:-1;};})();j.add('table',{init:function(l){var m=j.table,n=l.lang.table;l.addCommand('table',new a.dialogCommand('table'));l.addCommand('tableProperties',new a.dialogCommand('tableProperties'));l.ui.addButton('Table',{label:n.toolbar,command:'table'});a.dialog.add('table',this.path+'dialogs/table.js');a.dialog.add('tableProperties',this.path+'dialogs/table.js');if(l.addMenuItems)l.addMenuItems({table:{label:n.menu,command:'tableProperties',group:'table',order:5},tabledelete:{label:n.deleteTable,command:'tableDelete',group:'table',order:1}});if(l.contextMenu)l.contextMenu.addListener(function(o,p){if(!o)return null;var q=o.is('table')||o.hasAscendant('table');if(q)return{tabledelete:2,table:2};return null;});}});(function(){function l(F,G){if(c)F.removeAttribute(G);else delete F[G];};var m=/^(?:td|th)$/;function n(F){var G=F.createBookmarks(),H=F.getRanges(),I=[],J={};function K(S){if(I.length>0)return;if(S.type==1&&m.test(S.getName())&&!S.getCustomData('selected_cell')){h.setMarker(J,S,'selected_cell',true); |
if (this.transport != null && this.transport.isAlive()) this.onConnect(); else log.error("Connection attempt failed. Is The KeePassRPC server running?"); | var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); var rpc = window.keeFoxInst.KeePassRPC; log.debug("Creating an onConnectDelayTimer. " + rpc.transport); rpc.onConnectDelayTimer = Components.classes["@mozilla.org/timer;1"] .createInstance(Components.interfaces.nsITimer); rpc.onConnectDelayTimer.initWithCallback(rpc.onConnectDelayTimerAction, 1000, Components.interfaces.nsITimer.TYPE_ONE_SHOT); | onOutputStreamReady: function() { if (this.transport != null && this.transport.isAlive()) this.onConnect(); // else handle stream errors without risking double reaction to legitimate disconnection else log.error("Connection attempt failed. Is The KeePassRPC server running?"); }, |
log.debug("onOutputStreamReady started"); | onOutputStreamReady: function() { //this.pendingConnection = true; //return; var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); //window.keeFoxInst.KeePassRPC.reconnectSoon.next(); var rpc = window.keeFoxInst.KeePassRPC; log.debug("Creating an onConnectDelayTimer. " + rpc.transport); // Create a timer rpc.onConnectDelayTimer = Components.classes["@mozilla.org/timer;1"] .createInstance(Components.interfaces.nsITimer); log.debug("onConnectDelayTimer instance created"); rpc.onConnectDelayTimer.initWithCallback(rpc.onConnectDelayTimerAction, 1000, Components.interfaces.nsITimer.TYPE_ONE_SHOT); //TODO: does the timer stay in scope? log.debug("onConnectDelayTimer ended"); }, |
|
log.debug("Creating an onConnectDelayTimer. " + rpc.transport); rpc.onConnectDelayTimer = Components.classes["@mozilla.org/timer;1"] .createInstance(Components.interfaces.nsITimer); log.debug("onConnectDelayTimer instance created"); rpc.onConnectDelayTimer.initWithCallback(rpc.onConnectDelayTimerAction, 1000, Components.interfaces.nsITimer.TYPE_ONE_SHOT); log.debug("onConnectDelayTimer ended"); | if (rpc.transport == undefined || rpc.transport == null) { log.error("Transport invalid!"); } else { log.debug("onConnectDelayTimerAction connected"); rpc.onConnect(); } log.debug("onOutputStreamReady ended"); | onOutputStreamReady: function() { //this.pendingConnection = true; //return; var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); //window.keeFoxInst.KeePassRPC.reconnectSoon.next(); var rpc = window.keeFoxInst.KeePassRPC; log.debug("Creating an onConnectDelayTimer. " + rpc.transport); // Create a timer rpc.onConnectDelayTimer = Components.classes["@mozilla.org/timer;1"] .createInstance(Components.interfaces.nsITimer); log.debug("onConnectDelayTimer instance created"); rpc.onConnectDelayTimer.initWithCallback(rpc.onConnectDelayTimerAction, 1000, Components.interfaces.nsITimer.TYPE_ONE_SHOT); //TODO: does the timer stay in scope? log.debug("onConnectDelayTimer ended"); }, |
editGranularityWidget = document.getElementById("editGranularity"); editClearNextStackWidget = document.getElementById("editClearNextStack"); editRememberCurrentPosWidget = document.getElementById("editRememberCurrentPos"); | function OnPreferencePageInitalize(prefset) { maxSizeEditPositionStackWidget = document.getElementById("maxSizeEditPositionStack"); maxVisibleMenuItemsWidget = document.getElementById("maxVisibleMenuItems");} |
|
editShowMarkersWidget = document.getElementById("editShowMarkers"); editCompatibilityWidget = document.getElementById("editCompatibility"); | function OnPreferencePageInitalize(prefset) { maxSizeEditPositionStackWidget = document.getElementById("maxSizeEditPositionStack"); maxVisibleMenuItemsWidget = document.getElementById("maxVisibleMenuItems"); editGranularityWidget = document.getElementById("editGranularity"); editClearNextStackWidget = document.getElementById("editClearNextStack"); editRememberCurrentPosWidget = document.getElementById("editRememberCurrentPos");} |
|
editGranularityWidget.value = prefs.editGranularity; editClearNextStackWidget.checked = prefs.editClearNextStack; editRememberCurrentPosWidget.checked = prefs.editRememberCurrentPos; | function OnPreferencePageLoading(prefset) { prefs.load(); maxSizeEditPositionStackWidget.value = prefs.maxSizeEditPositionStack; maxVisibleMenuItemsWidget.value = prefs.maxVisibleMenuItems;} |
|
editShowMarkersWidget.checked = prefs.editShowMarkers; editCompatibilityWidget.checked = prefs.editCompatibility; | function OnPreferencePageLoading(prefset) { prefs.load(); maxSizeEditPositionStackWidget.value = prefs.maxSizeEditPositionStack; maxVisibleMenuItemsWidget.value = prefs.maxVisibleMenuItems; editGranularityWidget.value = prefs.editGranularity; editClearNextStackWidget.checked = prefs.editClearNextStack; editRememberCurrentPosWidget.checked = prefs.editRememberCurrentPos;} |
|
prefs.editGranularity = editGranularityWidget.value; prefs.editClearNextStack = editClearNextStackWidget.checked; prefs.editRememberCurrentPos = editRememberCurrentPosWidget.checked; | function OnPreferencePageOK(prefset) { prefs.maxSizeEditPositionStack = maxSizeEditPositionStackWidget.value; prefs.maxVisibleMenuItems = maxVisibleMenuItemsWidget.value; prefs.save(); var obs = DafizillaCommon.getObserverService(); obs.notifyObservers(null, "tabswitcher_pref_changed", null); return true;} |
|
prefs.editShowMarkers = editShowMarkersWidget.checked; prefs.editCompatibility = editCompatibilityWidget.checked; | function OnPreferencePageOK(prefset) { prefs.maxSizeEditPositionStack = maxSizeEditPositionStackWidget.value; prefs.maxVisibleMenuItems = maxVisibleMenuItemsWidget.value; prefs.editGranularity = editGranularityWidget.value; prefs.editClearNextStack = editClearNextStackWidget.checked; prefs.editRememberCurrentPos = editRememberCurrentPosWidget.checked; prefs.save(); var obs = DafizillaCommon.getObserverService(); obs.notifyObservers(null, "tabswitcher_pref_changed", null); return true;} |
|
z()}}function m(){if(!t){var j=a(),o=history.length;P&&clearInterval(P);P=setInterval(function(){var p,w;p=a();w=history.length;if(p!==j){j=p;o=w;f(j);b()}else if(w!==o&&r){j=p;o=w;p=E[o-1];f(p);b()}},50)}}function x(){var j;j=I.value.split("|");if(j.length>1){D=j[0];y=j[1]}if(j.length>2)E=j[2].split(",");if(t)k();else{m();B=true;z!=null&&z()}}var r=false,t=false,A=false,z=null,F=null,I=null,B=false,P=null,E=[],D,y,J=function(){};return{onReady:function(j){if(B)setTimeout(function(){j()},0);else z= | z()}}function m(){if(!t){var j=a(),o=history.length;Q&&clearInterval(Q);Q=setInterval(function(){var p,w;p=a();w=history.length;if(p!==j){j=p;o=w;f(j);b()}else if(w!==o&&r){j=p;o=w;p=E[o-1];f(p);b()}},50)}}function x(){var j;j=I.value.split("|");if(j.length>1){D=j[0];y=j[1]}if(j.length>2)E=j[2].split(",");if(t)k();else{m();B=true;z!=null&&z()}}var r=false,t=false,A=false,z=null,F=null,I=null,B=false,Q=null,E=[],D,y,J=function(){};return{onReady:function(j){if(B)setTimeout(function(){j()},0);else z= | z()}}function m(){if(!t){var j=a(),o=history.length;P&&clearInterval(P);P=setInterval(function(){var p,w;p=a();w=history.length;if(p!==j){j=p;o=w;f(j);b()}else if(w!==o&&r){j=p;o=w;p=E[o-1];f(p);b()}},50)}}function x(){var j;j=I.value.split("|");if(j.length>1){D=j[0];y=j[1]}if(j.length>2)E=j[2].split(",");if(t)k();else{m();B=true;z!=null&&z()}}var r=false,t=false,A=false,z=null,F=null,I=null,B=false,P=null,E=[],D,y,J=function(){};return{onReady:function(j){if(B)setTimeout(function(){j()},0);else z=j},_initialize:function(){I!=null&&x()},_initTimeout:function(){m()},register:function(j,o){if(!B){y=D=escape(j);J=o}},initialize:function(j,o){if(!B){var p=navigator.vendor||"";if(p!=="KDE")if(typeof window.opera!=="undefined")A=true;else if(typeof document.all!=="undefined")t=true;else if(p.indexOf("Apple Computer, Inc.")>-1)r=true;if(typeof j==="string")j=document.getElementById(j);if(!(!j||j.tagName.toUpperCase()!=="TEXTAREA"&&(j.tagName.toUpperCase()!=="INPUT"||j.type!=="hidden"&&j.type!=="text"))){I= |
a(),p=history.length;G&&clearInterval(G);G=setInterval(function(){var r,y;r=a();y=history.length;if(r!==l){l=r;p=y;e(l);b()}else if(y!==p&&u){l=r;p=y;r=M[p-1];e(r);b()}},50)}}function K(){var l;l=F.value.split("|");if(l.length>1){L=l[0];E=l[1]}if(l.length>2)M=l[2].split(",");if(q)i();else{n();I=true;x!=null&&x()}}var u=false,q=false,D=false,x=null,A=null,F=null,I=false,G=null,M=[],L,E,N=function(){};return{onReady:function(l){if(I)setTimeout(function(){l()},0);else x=l},_initialize:function(){F!= | x){x=G;j(G)}},50);H=true;w!=null&&w()}}function n(){if(!q){var l=a(),p=history.length;F&&clearInterval(F);F=setInterval(function(){var r,x;r=a();x=history.length;if(r!==l){l=r;p=x;e(l);b()}else if(x!==p&&u){l=r;p=x;r=L[p-1];e(r);b()}},50)}}function J(){var l;l=E.value.split("|");if(l.length>1){K=l[0];D=l[1]}if(l.length>2)L=l[2].split(",");if(q)i();else{n();H=true;w!=null&&w()}}var u=false,q=false,C=false,w=null,z=null,E=null,H=false,F=null,L=[],K,D,M=function(){};return{onReady:function(l){if(H)setTimeout(function(){l()}, 0);else w=l},_initialize:function(){E!=null&&J()},_initTimeout:function(){n()},register:function(l,p){if(!H){D=K=escape(l);M=p}},initialize:function(l,p){if(!H){var r=navigator.vendor||"";if(r!=="KDE")if(typeof window.opera!=="undefined")C=true;else if(typeof document.all!=="undefined")q=true;else if(r.indexOf("Apple Computer, Inc.")>-1)u=true;if(typeof l==="string")l=document.getElementById(l);if(!(!l||l.tagName.toUpperCase()!=="TEXTAREA"&&(l.tagName.toUpperCase()!=="INPUT"||l.type!=="hidden"&&l.type!== | a(),p=history.length;G&&clearInterval(G);G=setInterval(function(){var r,y;r=a();y=history.length;if(r!==l){l=r;p=y;e(l);b()}else if(y!==p&&u){l=r;p=y;r=M[p-1];e(r);b()}},50)}}function K(){var l;l=F.value.split("|");if(l.length>1){L=l[0];E=l[1]}if(l.length>2)M=l[2].split(",");if(q)i();else{n();I=true;x!=null&&x()}}var u=false,q=false,D=false,x=null,A=null,F=null,I=false,G=null,M=[],L,E,N=function(){};return{onReady:function(l){if(I)setTimeout(function(){l()},0);else x=l},_initialize:function(){F!= |
alert("Error " + ajax.status + ":\n" + ajax.responseText); | window.alert("Error " + ajax.status + ":\n" + ajax.responseText); | ajax.onreadystatechange = function () { if (ajax.readyState == 4) { if (ajax.status == 200) { /// This is run when the results are returned properly. ///NOTE: JSON.parse() is at least currently (November 2009) twice as slow as eval(), and it does not work because of problems parsing the character combination slash plus single quote (\'). Two slashes may work. ///TODO: Add error handling for parsing. handler(eval("(" + ajax.responseText + ")"), extra_data); } else { /// Was the abort unintentional? if (ajax.status !== 0) { ///FIXME: Do meaningful error handling. alert("Error " + ajax.status + ":\n" + ajax.responseText); } } } }; |
n.setAttribute("src",d);n.onload=function(){G(d)};n.onreadystatechange=function(){if(n.readyState=="complete"||n.readyState=="loaded")G(d)};document.getElementsByTagName("head")[0].appendChild(n)}}function H(d,c){this.callback=c;this.work=d.length;this.images=[];if(d.length==0)c(this.images);else for(c=0;c<d.length;c++)this.preload(d[c])}function l(d){if(d.ieAlternativeExecuted)return"0";q.emit(d.parentNode,"IeAltnernative");d.style.width="";d.ieAlternativeExecuted=true;return"0"}function p(d){window.onbeforeunload= | e===undefined?2:e;if(t>1)C(d,c,t-1);else{alert("Fatal error: failed loading "+d);U()}}var n=false;if(c!="")try{n=!eval("typeof "+c+" === 'undefined'")}catch(i){n=false}if(n)G(d);else{var p=document.createElement("script");p.setAttribute("src",d);p.onload=function(){G(d)};p.onerror=j;p.onreadystatechange=function(){if(p.readyState=="loaded")j();else p.readyState=="complete"&&G(d)};document.getElementsByTagName("head")[0].appendChild(p)}}function H(d,c){this.callback=c;this.work=d.length;this.images= | n.setAttribute("src",d);n.onload=function(){G(d)};n.onreadystatechange=function(){if(n.readyState=="complete"||n.readyState=="loaded")G(d)};document.getElementsByTagName("head")[0].appendChild(n)}}function H(d,c){this.callback=c;this.work=d.length;this.images=[];if(d.length==0)c(this.images);else for(c=0;c<d.length;c++)this.preload(d[c])}function l(d){if(d.ieAlternativeExecuted)return"0";q.emit(d.parentNode,"IeAltnernative");d.style.width="";d.ieAlternativeExecuted=true;return"0"}function p(d){window.onbeforeunload= |
h.setAttribute("src",c);h.onload=function(){Z(c)};h.onreadystatechange=function(){if(h.readyState=="complete"||h.readyState=="loaded")Z(c)};document.getElementsByTagName("head")[0].appendChild(h)}}function N(c,d){this.callback=d;this.work=c.length;this.images=[];if(c.length==0)d(this.images);else for(d=0;d<c.length;d++)this.preload(c[d])}var da=this,q=_$_WT_CLASS_$_,$=0,aa=0,L=null,T={object:null,sourceId:null,mimeType:null,dropOffsetX:null,dragOffsetY:null,dropTarget:null,objectPrevStyle:null},Q= | d+" === 'undefined'")}catch(g){e=false}if(e)Z(c);else{var h=document.createElement("script");h.setAttribute("src",c);h.onload=function(){Z(c)};h.onreadystatechange=function(){if(h.readyState=="complete"||h.readyState=="loaded")Z(c)};document.getElementsByTagName("head")[0].appendChild(h)}}function O(c,d){this.callback=d;this.work=c.length;this.images=[];if(c.length==0)d(this.images);else for(d=0;d<c.length;d++)this.preload(c[d])}var ea=this,q=_$_WT_CLASS_$_,$=0,aa=0,L=null,T={object:null,sourceId:null, | h.setAttribute("src",c);h.onload=function(){Z(c)};h.onreadystatechange=function(){if(h.readyState=="complete"||h.readyState=="loaded")Z(c)};document.getElementsByTagName("head")[0].appendChild(h)}}function N(c,d){this.callback=d;this.work=c.length;this.images=[];if(c.length==0)d(this.images);else for(d=0;d<c.length;d++)this.preload(c[d])}var da=this,q=_$_WT_CLASS_$_,$=0,aa=0,L=null,T={object:null,sourceId:null,mimeType:null,dropOffsetX:null,dragOffsetY:null,dropTarget:null,objectPrevStyle:null},Q= |
p.onreadystatechange=function(){var t=p.readyState;if(t=="loaded")h.isOpera?M(c):j();else t=="complete"&&M(c)};document.getElementsByTagName("head")[0].appendChild(p)}}function x(c,d){this.callback=d;this.work=c.length;this.images=[];if(c.length==0)d(this.images);else for(d=0;d<c.length;d++)this.preload(c[d])}function D(c){if(c.ieAlternativeExecuted)return"0";k.emit(c.parentNode,"IeAltnernative");c.style.width="";c.ieAlternativeExecuted=true;return"0"}function Y(c){window.onbeforeunload=c&&c!=""? | p.setAttribute("src",c);p.onload=function(){M(c)};p.onerror=j;p.onreadystatechange=function(){var t=p.readyState;if(t=="loaded")h.isOpera?M(c):j();else t=="complete"&&M(c)};document.getElementsByTagName("head")[0].appendChild(p)}}function x(c,d){this.callback=d;this.work=c.length;this.images=[];if(c.length==0)d(this.images);else for(d=0;d<c.length;d++)this.preload(c[d])}function D(c){if(c.ieAlternativeExecuted)return"0";k.emit(c.parentNode,"IeAltnernative");c.style.width="";c.ieAlternativeExecuted= | p.onreadystatechange=function(){var t=p.readyState;if(t=="loaded")h.isOpera?M(c):j();else t=="complete"&&M(c)};document.getElementsByTagName("head")[0].appendChild(p)}}function x(c,d){this.callback=d;this.work=c.length;this.images=[];if(c.length==0)d(this.images);else for(d=0;d<c.length;d++)this.preload(c[d])}function D(c){if(c.ieAlternativeExecuted)return"0";k.emit(c.parentNode,"IeAltnernative");c.style.width="";c.ieAlternativeExecuted=true;return"0"}function Y(c){window.onbeforeunload=c&&c!=""? |
if (s.readyState == 'complete' || s.readyState == 'loaded') { | if (s.readyState == 'loaded') onerror(); else if (s.readyState == 'complete') | s.onreadystatechange = function() { if (s.readyState == 'complete' || s.readyState == 'loaded') { jsLoaded(uri); } }; |
} | s.onreadystatechange = function() { if (s.readyState == 'complete' || s.readyState == 'loaded') { jsLoaded(uri); } }; |
|
false}if(f)N(d);else{var m=document.createElement("script");m.setAttribute("src",d);m.onload=function(){N(d)};m.onreadystatechange=function(){if(m.readyState=="complete"||m.readyState=="loaded")N(d)};document.getElementsByTagName("head")[0].appendChild(m)}}function p(d,c){this.callback=c;this.work=d.length;this.images=[];if(d.length==0)c(this.images);else for(c=0;c<d.length;c++)this.preload(d[c])}function r(d){if(d.ieAlternativeExecuted)return"0";y.emit(d.parentNode,"IeAltnernative");d.style.width= | setTimeout(m.tm,c);else{m.timer=null;m.tm=null}m.onclick&&m.onclick()}},h=o.getElement(d);h.timer=setTimeout(k,c);h.tm=k}function D(d,c){setTimeout(function(){if(R[d]===true)c();else R[d]=c},20)}function M(d){if(R[d]!==true){typeof R[d]!=="undefined"&&R[d]();R[d]=true}}function l(d,c){var f=false;if(c!="")try{f=!eval("typeof "+c+" === 'undefined'")}catch(k){f=false}if(f)M(d);else{var h=document.createElement("script");h.setAttribute("src",d);h.onload=function(){M(d)};h.onreadystatechange=function(){if(h.readyState== "complete"||h.readyState=="loaded")M(d)};document.getElementsByTagName("head")[0].appendChild(h)}}function p(d,c){this.callback=c;this.work=d.length;this.images=[];if(d.length==0)c(this.images);else for(c=0;c<d.length;c++)this.preload(d[c])}function r(d){if(d.ieAlternativeExecuted)return"0";x.emit(d.parentNode,"IeAltnernative");d.style.width="";d.ieAlternativeExecuted=true;return"0"}var x=this,o=_$_WT_CLASS_$_,G=0,da=0,O=null,Y={object:null,sourceId:null,mimeType:null,dropOffsetX:null,dragOffsetY:null, | false}if(f)N(d);else{var m=document.createElement("script");m.setAttribute("src",d);m.onload=function(){N(d)};m.onreadystatechange=function(){if(m.readyState=="complete"||m.readyState=="loaded")N(d)};document.getElementsByTagName("head")[0].appendChild(m)}}function p(d,c){this.callback=c;this.work=d.length;this.images=[];if(d.length==0)c(this.images);else for(c=0;c<d.length;c++)this.preload(d[c])}function r(d){if(d.ieAlternativeExecuted)return"0";y.emit(d.parentNode,"IeAltnernative");d.style.width= |
else{var i=document.createElement("script");i.setAttribute("src",d);i.onload=function(){S(d)};i.onreadystatechange=function(){if(i.readyState=="complete"||i.readyState=="loaded")S(d)};document.getElementsByTagName("head")[0].appendChild(i)}}function g(d,c){this.callback=c;this.work=d.length;this.images=[];if(d.length==0)c(this.images);else for(c=0;c<d.length;c++)this.preload(d[c])}var p=this,n=_$_WT_CLASS_$_,y=0,M=0,w=null,V={object:null,sourceId:null,mimeType:null,dropOffsetX:null,dragOffsetY:null, | setTimeout(j.tm,c);else{j.timer=null;j.tm=null}j.onclick()}},i=g.getElement(d);i.timer=setTimeout(h,c);i.tm=h}function I(d,c){setTimeout(function(){if(Q[d]===true)c();else Q[d]=c},20)}function y(d){if(Q[d]!==true){typeof Q[d]!=="undefined"&&Q[d]();Q[d]=true}}function S(d,c){var e=false;if(c!="")try{e=!eval("typeof "+c+" === 'undefined'")}catch(h){e=false}if(e)y(d);else{var i=document.createElement("script");i.setAttribute("src",d);i.onload=function(){y(d)};i.onreadystatechange=function(){if(i.readyState== "complete"||i.readyState=="loaded")y(d)};document.getElementsByTagName("head")[0].appendChild(i)}}function K(d,c){this.callback=c;this.work=d.length;this.images=[];if(d.length==0)c(this.images);else for(c=0;c<d.length;c++)this.preload(d[c])}var V=this,g=_$_WT_CLASS_$_,o=0,p=0,s=null,J={object:null,sourceId:null,mimeType:null,dropOffsetX:null,dragOffsetY:null,dropTarget:null,objectPrevStyle:null,xy:null},B=_$_FORM_OBJECTS_$_,Z=[],z=[],ia=_$_RELATIVE_URL_$_,ba=false,ga=false,da=false,G=null,M=null, | else{var i=document.createElement("script");i.setAttribute("src",d);i.onload=function(){S(d)};i.onreadystatechange=function(){if(i.readyState=="complete"||i.readyState=="loaded")S(d)};document.getElementsByTagName("head")[0].appendChild(i)}}function g(d,c){this.callback=c;this.work=d.length;this.images=[];if(d.length==0)c(this.images);else for(c=0;c<d.length;c++)this.preload(d[c])}var p=this,n=_$_WT_CLASS_$_,y=0,M=0,w=null,V={object:null,sourceId:null,mimeType:null,dropOffsetX:null,dragOffsetY:null, |
if (ajax.status != 0) { | if (ajax.status !== 0) { | ajax.onreadystatechange = function () { if (ajax.readyState == 4) { if (ajax.status == 200) { /// This is run when the results are returned properly. ///NOTE: JSON.parse() is at least currently (November 2009) twice as slow as eval(), and it does not work because of problems parsing the character combination slash plus single quote (\'). Two slashes may work. ///TODO: Add error handling for parsing. handler(eval(ajax.responseText)); } else { /// Was the abort unintentional? if (ajax.status != 0) { ///FIXME: Do meaningful error handling. alert("Error " + ajax.status + ":\n" + ajax.responseText); } } } }; |
resizeHandler(); | if(document['resizeHandler']) { resizeHandler(); } | function OnResize(){ adjust(); resizeHandler();} |
a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var j=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";j;j=j.nextSibling)if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}n.emit(h,"columnResized",d,l)}jQuery.data(h,"obj",this);var i=n.WT,s=0,t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft= | a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var j=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";j;j=j.nextSibling)if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}n.emit(h,"columnResized",d,parseInt(l))}jQuery.data(h,"obj",this);var i=n.WT,s=0,t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft= | a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var j=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";j;j=j.nextSibling)if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}n.emit(h,"columnResized",d,l)}jQuery.data(h,"obj",this);var i=n.WT,s=0,t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft=f.scrollLeft;if(f.scrollTop<u||f.scrollTop>v||f.scrollLeft<s||f.scrollLeft>t)n.emit(h,"scrolled",f.scrollLeft,f.scrollTop,f.clientWidth,f.clientHeight)};this.mouseDown=function(a,b){i.capture(null);a=q(b);h.getAttribute("drag")==="true"&&a.selected&&n._p_.dragStart(h,b)};this.resizeHandleMDown=function(a,b){var c=a.parentNode.parentNode,d=-(i.pxself(c,"width")-1);new i.SizeHandle(i,"h",a.offsetWidth,h.offsetHeight,d,1E4,"Wt-hsh",function(k){w(c,k)},a,h,b,-2,-1)};this.scrolled=function(a,b,c,d){s= |
A.showPopup();a=null}if(!a||a.style.display=="none"){a=v||j;a.parentNode.scrollTop=0;n=a.id}a.className="sel";F(a)}};this.editKeyUp=function(a,b){if(i!=null)if(c(a))if(!((b.keyCode==13||b.keyCode==9)&&f.style.display=="none"))if(b.keyCode==27||b.keyCode==37||b.keyCode==39){f.style.display="none";if(b.keyCode==27){i=null;$(a).hasClass("Wt-suggest-dropdown")?d():a.blur()}}else if(a.value!=D)A.refilter();else(a=n?e.getElement(n):null)&&F(a)};f.lastChild.onclick=o;f.lastChild.onscroll=function(){if(B){clearTimeout(B); var a=e.getElement(i);a&&a.focus()}};this.delayHide=function(a){B=setTimeout(function(){B=null;if(f&&(a==null||i==a.id))d()},300)}}); | 0;n=a.id}a.className="sel";F(a)}};this.editKeyUp=function(a,b){if(i!=null)if(c(a))if(!((b.keyCode==13||b.keyCode==9)&&f.style.display=="none"))if(b.keyCode==27||b.keyCode==37||b.keyCode==39){f.style.display="none";if(b.keyCode==27){i=null;$(a).hasClass("Wt-suggest-dropdown")?d():a.blur()}}else if(a.value!=D)A.refilter();else(a=n?e.getElement(n):null)&&F(a)};f.lastChild.onclick=o;f.lastChild.onscroll=function(){if(B){clearTimeout(B);var a=e.getElement(i);a&&a.focus()}};this.delayHide=function(a){B= | A.showPopup();a=null}if(!a||a.style.display=="none"){a=v||j;a.parentNode.scrollTop=0;n=a.id}a.className="sel";F(a)}};this.editKeyUp=function(a,b){if(i!=null)if(c(a))if(!((b.keyCode==13||b.keyCode==9)&&f.style.display=="none"))if(b.keyCode==27||b.keyCode==37||b.keyCode==39){f.style.display="none";if(b.keyCode==27){i=null;$(a).hasClass("Wt-suggest-dropdown")?d():a.blur()}}else if(a.value!=D)A.refilter();else(a=n?e.getElement(n):null)&&F(a)};f.lastChild.onclick=o;f.lastChild.onscroll=function(){if(B){clearTimeout(B);var a=e.getElement(i);a&&a.focus()}};this.delayHide=function(a){B=setTimeout(function(){B=null;if(f&&(a==null||i==a.id))d()},300)}}); |
t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft=f.scrollLeft;if(f.scrollTop<u||f.scrollTop>v||f.scrollLeft<s||f.scrollLeft>t)n.emit(j,"scrolled",f.scrollLeft,f.scrollTop,f.clientWidth,f.clientHeight)};this.mouseDown=function(a,b){i.capture(null);a=q(b);j.getAttribute("drag")==="true"&&a.selected&&n._p_.dragStart(j,b)};this.resizeHandleMDown=function(a,b){var c=a.parentNode.parentNode,d=-(i.pxself(c,"width")-1);new i.SizeHandle(i,"h",a.offsetWidth,j.offsetHeight,d,1E4,"Wt-hsh",function(k){w(c,k)},a, | a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var j=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";j;j=j.nextSibling)if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}n.emit(h,"columnResized",d,l)}jQuery.data(h,"obj",this);var i=n.WT,s=0,t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft= f.scrollLeft;if(f.scrollTop<u||f.scrollTop>v||f.scrollLeft<s||f.scrollLeft>t)n.emit(h,"scrolled",f.scrollLeft,f.scrollTop,f.clientWidth,f.clientHeight)};this.mouseDown=function(a,b){i.capture(null);a=q(b);h.getAttribute("drag")==="true"&&a.selected&&n._p_.dragStart(h,b)};this.resizeHandleMDown=function(a,b){var c=a.parentNode.parentNode,d=-(i.pxself(c,"width")-1);new i.SizeHandle(i,"h",a.offsetWidth,h.offsetHeight,d,1E4,"Wt-hsh",function(k){w(c,k)},a,h,b,-2,-1)};this.scrolled=function(a,b,c,d){s= | t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft=f.scrollLeft;if(f.scrollTop<u||f.scrollTop>v||f.scrollLeft<s||f.scrollLeft>t)n.emit(j,"scrolled",f.scrollLeft,f.scrollTop,f.clientWidth,f.clientHeight)};this.mouseDown=function(a,b){i.capture(null);a=q(b);j.getAttribute("drag")==="true"&&a.selected&&n._p_.dragStart(j,b)};this.resizeHandleMDown=function(a,b){var c=a.parentNode.parentNode,d=-(i.pxself(c,"width")-1);new i.SizeHandle(i,"h",a.offsetWidth,j.offsetHeight,d,1E4,"Wt-hsh",function(k){w(c,k)},a, |
console.log('kak'); | onSelect: function(node, tree) { // get current and new URL var currentPageURL = window.location.pathname + window.location.search; var newPageURL = $(node).find('a').attr('href'); // only redirect if destination isn't the current one. if(typeof newPageURL != 'undefined' && newPageURL != currentPageURL) window.location = newPageURL; }, |
|
console.log('kak'); | onSelect: function(node, tree) { // get current and new URL var currentPageURL = window.location.pathname + window.location.search; var newPageURL = $(node).find('a').attr('href'); console.log('kak'); // only redirect if destination isn't the current one. if(typeof newPageURL != 'undefined' && newPageURL != currentPageURL) window.location = newPageURL; }, |
|
(function(){CKEDITOR.dialog.add('pastetext',function(a){return{title:a.lang.pasteText.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?368:350,minHeight:240,onShow:function(){this.getContentElement('general','content').getInputElement().setValue('');},onOk:function(){var b=this.getContentElement('general','content').getInputElement().getValue(),c=this.getParentEditor();setTimeout(function(){c.fire('paste',{text:b});},0);},contents:[{label:a.lang.common.generalTab,id:'general',elements:[{type:'html',id:'pasteMsg',html:'<div style="white-space:normal;width:340px;">'+a.lang.clipboard.pasteMsg+'</div>'},{type:'html',id:'content',style:'width:340px;height:170px',html:'<textarea style="width:346px;height:170px;resize: none;border:1px solid black;background-color:white"></textarea>',onLoad:function(){var b=this.getDialog().getContentElement('general','pasteMsg').getElement(),c=this.getElement();c.setAttribute('aria-labelledby',b.$.id);},focus:function(){this.getElement().focus();}}]}]};});})(); | while(n<o){m.push('<tr>');for(var r=0;r<k;r++,n++){if(p=l[n]){q='';p=p.replace(/\((.*?)\)/,function(s,t){q=t;return '';});q=q||p;m.push('<td class="cke_dark_background" style="cursor: default" role="presentation"><a href="javascript: void(0);" role="option" aria-posinset="'+(n+1)+'"',' aria-setsize="'+o+'"',' aria-labelledby="cke_specialchar_label_'+n+'"',' style="cursor: inherit; display: block; height: 1.25em; margin-top: 0.25em; text-align: center;" title="',CKEDITOR.tools.htmlEncode(q),'" onkeydown="CKEDITOR.tools.callFunction( '+j+', event, this )"'+' onclick="CKEDITOR.tools.callFunction('+f+', this); return false;"'+' tabindex="-1">'+'<span style="margin: 0 auto;cursor: inherit">'+p+'</span>'+'<span class="cke_voice_label" id="cke_specialchar_label_'+n+'">'+q+'</span></a>');}else m.push('<td class="cke_dark_background"> ');m.push('</td>');}m.push('</tr>');}m.push('</tbody></table>','<span id="specialchar_table_label" class="cke_voice_label">'+c.options+'</span>');this.getContentElement('info','charContainer').getElement().setHtml(m.join(''));},contents:[{id:'info',label:a.lang.common.generalTab,title:a.lang.common.generalTab,padding:0,align:'top',elements:[{type:'hbox',align:'top',widths:['320px','90px'],children:[{type:'html',id:'charContainer',html:'',onMouseover:h,onMouseout:i,focus:function(){var k=this.getElement().getElementsByTag('a').getItem(0);setTimeout(function(){k.focus();h(null,k);});},onShow:function(){var k=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){k.focus();h(null,k);});},onLoad:function(k){b=k.sender;}},{type:'hbox',align:'top',widths:['100%'],children:[{type:'vbox',align:'top',children:[{type:'html',html:'<div></div>'},{type:'html',id:'charPreview',className:'cke_dark_background',style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'<div> </div>'},{type:'html',id:'htmlPreview',className:'cke_dark_background',style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'<div> </div>'}]}]}]}]}]};}); | (function(){CKEDITOR.dialog.add('pastetext',function(a){return{title:a.lang.pasteText.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?368:350,minHeight:240,onShow:function(){this.getContentElement('general','content').getInputElement().setValue('');},onOk:function(){var b=this.getContentElement('general','content').getInputElement().getValue(),c=this.getParentEditor();setTimeout(function(){c.fire('paste',{text:b});},0);},contents:[{label:a.lang.common.generalTab,id:'general',elements:[{type:'html',id:'pasteMsg',html:'<div style="white-space:normal;width:340px;">'+a.lang.clipboard.pasteMsg+'</div>'},{type:'html',id:'content',style:'width:340px;height:170px',html:'<textarea style="width:346px;height:170px;resize: none;border:1px solid black;background-color:white"></textarea>',onLoad:function(){var b=this.getDialog().getContentElement('general','pasteMsg').getElement(),c=this.getElement();c.setAttribute('aria-labelledby',b.$.id);},focus:function(){this.getElement().focus();}}]}]};});})(); |
else this.getElement().hide();}}],setup:function(C){if(!this.getDialog().getContentElement('info','linkType'))this.getElement().hide();}},{type:'vbox',id:'emailOptions',padding:1,children:[{type:'text',id:'emailAddress',label:a.lang.link.emailAddress,required:true,validate:function(){var C=this.getDialog();if(!C.getContentElement('info','linkType')||C.getValueOf('info','linkType')!='email')return true;var D=CKEDITOR.dialog.validate.notEmpty(a.lang.link.noEmail);return D.apply(this);},setup:function(C){if(C.email)this.setValue(C.email.address);var D=this.getDialog().getContentElement('info','linkType');if(D&&D.getValue()=='email')this.select();},commit:function(C){if(!C.email)C.email={};C.email.address=this.getValue();}},{type:'text',id:'emailSubject',label:a.lang.link.emailSubject,setup:function(C){if(C.email)this.setValue(C.email.subject);},commit:function(C){if(!C.email)C.email={};C.email.subject=this.getValue();}},{type:'textarea',id:'emailBody',label:a.lang.link.emailBody,rows:3,'default':'',setup:function(C){if(C.email)this.setValue(C.email.body);},commit:function(C){if(!C.email)C.email={};C.email.body=this.getValue();}}],setup:function(C){if(!this.getDialog().getContentElement('info','linkType'))this.getElement().hide();}}]},{id:'target',label:a.lang.link.target,title:a.lang.link.target,elements:[{type:'hbox',widths:['50%','50%'],children:[{type:'select',id:'linkTargetType',label:a.lang.common.target,'default':'notSet',style:'width : 100%;',items:[[a.lang.common.notSet,'notSet'],[a.lang.link.targetFrame,'frame'],[a.lang.link.targetPopup,'popup'],[a.lang.common.targetNew,'_blank'],[a.lang.common.targetTop,'_top'],[a.lang.common.targetSelf,'_self'],[a.lang.common.targetParent,'_parent']],onChange:c,setup:function(C){if(C.target)this.setValue(C.target.type);},commit:function(C){if(!C.target)C.target={};C.target.type=this.getValue();}},{type:'text',id:'linkTargetName',label:a.lang.link.targetFrameName,'default':'',setup:function(C){if(C.target)this.setValue(C.target.name);},commit:function(C){if(!C.target)C.target={};C.target.name=this.getValue().replace(/\W/gi,'');}}]},{type:'vbox',width:260,align:'center',padding:2,id:'popupFeatures',children:[{type:'fieldset',label:a.lang.link.popupFeatures,children:[{type:'hbox',children:[{type:'checkbox',id:'resizable',label:a.lang.link.popupResizable,setup:r,commit:u},{type:'checkbox',id:'status',label:a.lang.link.popupStatusBar,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'location',label:a.lang.link.popupLocationBar,setup:r,commit:u},{type:'checkbox',id:'toolbar',label:a.lang.link.popupToolbar,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'menubar',label:a.lang.link.popupMenuBar,setup:r,commit:u},{type:'checkbox',id:'fullscreen',label:a.lang.link.popupFullScreen,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'scrollbars',label:a.lang.link.popupScrollBars,setup:r,commit:u},{type:'checkbox',id:'dependent',label:a.lang.link.popupDependent,setup:r,commit:u}]},{type:'hbox',children:[{type:'text',widths:['30%','70%'],labelLayout:'horizontal',label:a.lang.link.popupWidth,id:'width',setup:r,commit:u},{type:'text',labelLayout:'horizontal',widths:['55%','45%'],label:a.lang.link.popupLeft,id:'left',setup:r,commit:u}]},{type:'hbox',children:[{type:'text',labelLayout:'horizontal',widths:['30%','70%'],label:a.lang.link.popupHeight,id:'height',setup:r,commit:u},{type:'text',labelLayout:'horizontal',label:a.lang.link.popupTop,widths:['55%','45%'],id:'top',setup:r,commit:u}]}]}]}]},{id:'upload',label:a.lang.link.upload,title:a.lang.link.upload,hidden:true,filebrowser:'uploadButton',elements:[{type:'file',id:'upload',label:a.lang.common.upload,style:'height:40px',size:29},{type:'fileButton',id:'uploadButton',label:a.lang.common.uploadSubmit,filebrowser:'info:url','for':['upload','upload']}]},{id:'advanced',label:a.lang.link.advanced,title:a.lang.link.advanced,elements:[{type:'vbox',padding:1,children:[{type:'hbox',widths:['45%','35%','20%'],children:[{type:'text',id:'advId',label:a.lang.link.id,setup:s,commit:v},{type:'select',id:'advLangDir',label:a.lang.link.langDir,'default':'',style:'width:110px',items:[[a.lang.common.notSet,''],[a.lang.link.langDirLTR,'ltr'],[a.lang.link.langDirRTL,'rtl']],setup:s,commit:v},{type:'text',id:'advAccessKey',width:'80px',label:a.lang.link.acccessKey,maxLength:1,setup:s,commit:v}]},{type:'hbox',widths:['45%','35%','20%'],children:[{type:'text',label:a.lang.link.name,id:'advName',setup:s,commit:v},{type:'text',label:a.lang.link.langCode,id:'advLangCode',width:'110px','default':'',setup:s,commit:v},{type:'text',label:a.lang.link.tabIndex,id:'advTabIndex',width:'80px',maxLength:5,setup:s,commit:v}]}]},{type:'vbox',padding:1,children:[{type:'hbox',widths:['45%','55%'],children:[{type:'text',label:a.lang.link.advisoryTitle,'default':'',id:'advTitle',setup:s,commit:v},{type:'text',label:a.lang.link.advisoryContentType,'default':'',id:'advContentType',setup:s,commit:v}]},{type:'hbox',widths:['45%','55%'],children:[{type:'text',label:a.lang.link.cssClasses,'default':'',id:'advCSSClasses',setup:s,commit:v},{type:'text',label:a.lang.link.charset,'default':'',id:'advCharset',setup:s,commit:v}]},{type:'hbox',children:[{type:'text',label:a.lang.link.styles,'default':'',id:'advStyles',setup:s,commit:v}]}]}]}],onShow:function(){var F=this; F.fakeObj=false;var C=F.getParentEditor(),D=C.getSelection(),E=null;if((E=b.getSelectedLink(C))&&E.hasAttribute('href'))D.selectElement(E);else if((E=D.getSelectedElement())&&E.is('img')&&E.getAttribute('_cke_real_element_type')&&E.getAttribute('_cke_real_element_type')=='anchor'){F.fakeObj=E;E=C.restoreRealElement(F.fakeObj);D.selectElement(F.fakeObj);}else E=null;F.setupContent(p.apply(F,[C,E]));},onOk:function(){var C={href:'javascript:void(0)/*'+CKEDITOR.tools.getNextNumber()+'*/'},D=[],E={href:C.href},F=this,G=this.getParentEditor();this.commitContent(E);switch(E.type||'url'){case 'url':var H=E.url&&E.url.protocol!=undefined?E.url.protocol:'http: | else this.getElement().hide();}}],setup:function(C){if(!this.getDialog().getContentElement('info','linkType'))this.getElement().hide();}},{type:'vbox',id:'emailOptions',padding:1,children:[{type:'text',id:'emailAddress',label:a.lang.link.emailAddress,required:true,validate:function(){var C=this.getDialog();if(!C.getContentElement('info','linkType')||C.getValueOf('info','linkType')!='email')return true;var D=CKEDITOR.dialog.validate.notEmpty(a.lang.link.noEmail);return D.apply(this);},setup:function(C){if(C.email)this.setValue(C.email.address);var D=this.getDialog().getContentElement('info','linkType');if(D&&D.getValue()=='email')this.select();},commit:function(C){if(!C.email)C.email={};C.email.address=this.getValue();}},{type:'text',id:'emailSubject',label:a.lang.link.emailSubject,setup:function(C){if(C.email)this.setValue(C.email.subject);},commit:function(C){if(!C.email)C.email={};C.email.subject=this.getValue();}},{type:'textarea',id:'emailBody',label:a.lang.link.emailBody,rows:3,'default':'',setup:function(C){if(C.email)this.setValue(C.email.body);},commit:function(C){if(!C.email)C.email={};C.email.body=this.getValue();}}],setup:function(C){if(!this.getDialog().getContentElement('info','linkType'))this.getElement().hide();}}]},{id:'target',label:a.lang.link.target,title:a.lang.link.target,elements:[{type:'hbox',widths:['50%','50%'],children:[{type:'select',id:'linkTargetType',label:a.lang.common.target,'default':'notSet',style:'width : 100%;',items:[[a.lang.common.notSet,'notSet'],[a.lang.link.targetFrame,'frame'],[a.lang.link.targetPopup,'popup'],[a.lang.common.targetNew,'_blank'],[a.lang.common.targetTop,'_top'],[a.lang.common.targetSelf,'_self'],[a.lang.common.targetParent,'_parent']],onChange:c,setup:function(C){if(C.target)this.setValue(C.target.type);c.call(this);},commit:function(C){if(!C.target)C.target={};C.target.type=this.getValue();}},{type:'text',id:'linkTargetName',label:a.lang.link.targetFrameName,'default':'',setup:function(C){if(C.target)this.setValue(C.target.name);},commit:function(C){if(!C.target)C.target={};C.target.name=this.getValue().replace(/\W/gi,'');}}]},{type:'vbox',width:260,align:'center',padding:2,id:'popupFeatures',children:[{type:'fieldset',label:a.lang.link.popupFeatures,children:[{type:'hbox',children:[{type:'checkbox',id:'resizable',label:a.lang.link.popupResizable,setup:r,commit:u},{type:'checkbox',id:'status',label:a.lang.link.popupStatusBar,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'location',label:a.lang.link.popupLocationBar,setup:r,commit:u},{type:'checkbox',id:'toolbar',label:a.lang.link.popupToolbar,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'menubar',label:a.lang.link.popupMenuBar,setup:r,commit:u},{type:'checkbox',id:'fullscreen',label:a.lang.link.popupFullScreen,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'scrollbars',label:a.lang.link.popupScrollBars,setup:r,commit:u},{type:'checkbox',id:'dependent',label:a.lang.link.popupDependent,setup:r,commit:u}]},{type:'hbox',children:[{type:'text',widths:['30%','70%'],labelLayout:'horizontal',label:a.lang.link.popupWidth,id:'width',setup:r,commit:u},{type:'text',labelLayout:'horizontal',widths:['55%','45%'],label:a.lang.link.popupLeft,id:'left',setup:r,commit:u}]},{type:'hbox',children:[{type:'text',labelLayout:'horizontal',widths:['30%','70%'],label:a.lang.link.popupHeight,id:'height',setup:r,commit:u},{type:'text',labelLayout:'horizontal',label:a.lang.link.popupTop,widths:['55%','45%'],id:'top',setup:r,commit:u}]}]}]}]},{id:'upload',label:a.lang.link.upload,title:a.lang.link.upload,hidden:true,filebrowser:'uploadButton',elements:[{type:'file',id:'upload',label:a.lang.common.upload,style:'height:40px',size:29},{type:'fileButton',id:'uploadButton',label:a.lang.common.uploadSubmit,filebrowser:'info:url','for':['upload','upload']}]},{id:'advanced',label:a.lang.link.advanced,title:a.lang.link.advanced,elements:[{type:'vbox',padding:1,children:[{type:'hbox',widths:['45%','35%','20%'],children:[{type:'text',id:'advId',label:a.lang.link.id,setup:s,commit:v},{type:'select',id:'advLangDir',label:a.lang.link.langDir,'default':'',style:'width:110px',items:[[a.lang.common.notSet,''],[a.lang.link.langDirLTR,'ltr'],[a.lang.link.langDirRTL,'rtl']],setup:s,commit:v},{type:'text',id:'advAccessKey',width:'80px',label:a.lang.link.acccessKey,maxLength:1,setup:s,commit:v}]},{type:'hbox',widths:['45%','35%','20%'],children:[{type:'text',label:a.lang.link.name,id:'advName',setup:s,commit:v},{type:'text',label:a.lang.link.langCode,id:'advLangCode',width:'110px','default':'',setup:s,commit:v},{type:'text',label:a.lang.link.tabIndex,id:'advTabIndex',width:'80px',maxLength:5,setup:s,commit:v}]}]},{type:'vbox',padding:1,children:[{type:'hbox',widths:['45%','55%'],children:[{type:'text',label:a.lang.link.advisoryTitle,'default':'',id:'advTitle',setup:s,commit:v},{type:'text',label:a.lang.link.advisoryContentType,'default':'',id:'advContentType',setup:s,commit:v}]},{type:'hbox',widths:['45%','55%'],children:[{type:'text',label:a.lang.link.cssClasses,'default':'',id:'advCSSClasses',setup:s,commit:v},{type:'text',label:a.lang.link.charset,'default':'',id:'advCharset',setup:s,commit:v}]},{type:'hbox',children:[{type:'text',label:a.lang.link.styles,'default':'',id:'advStyles',setup:s,commit:v}]}]}]}],onShow:function(){var F=this; F.fakeObj=false;var C=F.getParentEditor(),D=C.getSelection(),E=null;if((E=b.getSelectedLink(C))&&E.hasAttribute('href'))D.selectElement(E);else if((E=D.getSelectedElement())&&E.is('img')&&E.getAttribute('_cke_real_element_type')&&E.getAttribute('_cke_real_element_type')=='anchor'){F.fakeObj=E;E=C.restoreRealElement(F.fakeObj);D.selectElement(F.fakeObj);}else E=null;F.setupContent(p.apply(F,[C,E]));},onOk:function(){var C={href:'javascript:void(0)/*'+CKEDITOR.tools.getNextNumber()+'*/'},D=[],E={href:C.href},F=this,G=this.getParentEditor();this.commitContent(E);switch(E.type||'url'){case 'url':var H=E.url&&E.url.protocol!=undefined?E.url.protocol:'http: | else this.getElement().hide();}}],setup:function(C){if(!this.getDialog().getContentElement('info','linkType'))this.getElement().hide();}},{type:'vbox',id:'emailOptions',padding:1,children:[{type:'text',id:'emailAddress',label:a.lang.link.emailAddress,required:true,validate:function(){var C=this.getDialog();if(!C.getContentElement('info','linkType')||C.getValueOf('info','linkType')!='email')return true;var D=CKEDITOR.dialog.validate.notEmpty(a.lang.link.noEmail);return D.apply(this);},setup:function(C){if(C.email)this.setValue(C.email.address);var D=this.getDialog().getContentElement('info','linkType');if(D&&D.getValue()=='email')this.select();},commit:function(C){if(!C.email)C.email={};C.email.address=this.getValue();}},{type:'text',id:'emailSubject',label:a.lang.link.emailSubject,setup:function(C){if(C.email)this.setValue(C.email.subject);},commit:function(C){if(!C.email)C.email={};C.email.subject=this.getValue();}},{type:'textarea',id:'emailBody',label:a.lang.link.emailBody,rows:3,'default':'',setup:function(C){if(C.email)this.setValue(C.email.body);},commit:function(C){if(!C.email)C.email={};C.email.body=this.getValue();}}],setup:function(C){if(!this.getDialog().getContentElement('info','linkType'))this.getElement().hide();}}]},{id:'target',label:a.lang.link.target,title:a.lang.link.target,elements:[{type:'hbox',widths:['50%','50%'],children:[{type:'select',id:'linkTargetType',label:a.lang.common.target,'default':'notSet',style:'width : 100%;',items:[[a.lang.common.notSet,'notSet'],[a.lang.link.targetFrame,'frame'],[a.lang.link.targetPopup,'popup'],[a.lang.common.targetNew,'_blank'],[a.lang.common.targetTop,'_top'],[a.lang.common.targetSelf,'_self'],[a.lang.common.targetParent,'_parent']],onChange:c,setup:function(C){if(C.target)this.setValue(C.target.type);},commit:function(C){if(!C.target)C.target={};C.target.type=this.getValue();}},{type:'text',id:'linkTargetName',label:a.lang.link.targetFrameName,'default':'',setup:function(C){if(C.target)this.setValue(C.target.name);},commit:function(C){if(!C.target)C.target={};C.target.name=this.getValue().replace(/\W/gi,'');}}]},{type:'vbox',width:260,align:'center',padding:2,id:'popupFeatures',children:[{type:'fieldset',label:a.lang.link.popupFeatures,children:[{type:'hbox',children:[{type:'checkbox',id:'resizable',label:a.lang.link.popupResizable,setup:r,commit:u},{type:'checkbox',id:'status',label:a.lang.link.popupStatusBar,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'location',label:a.lang.link.popupLocationBar,setup:r,commit:u},{type:'checkbox',id:'toolbar',label:a.lang.link.popupToolbar,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'menubar',label:a.lang.link.popupMenuBar,setup:r,commit:u},{type:'checkbox',id:'fullscreen',label:a.lang.link.popupFullScreen,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'scrollbars',label:a.lang.link.popupScrollBars,setup:r,commit:u},{type:'checkbox',id:'dependent',label:a.lang.link.popupDependent,setup:r,commit:u}]},{type:'hbox',children:[{type:'text',widths:['30%','70%'],labelLayout:'horizontal',label:a.lang.link.popupWidth,id:'width',setup:r,commit:u},{type:'text',labelLayout:'horizontal',widths:['55%','45%'],label:a.lang.link.popupLeft,id:'left',setup:r,commit:u}]},{type:'hbox',children:[{type:'text',labelLayout:'horizontal',widths:['30%','70%'],label:a.lang.link.popupHeight,id:'height',setup:r,commit:u},{type:'text',labelLayout:'horizontal',label:a.lang.link.popupTop,widths:['55%','45%'],id:'top',setup:r,commit:u}]}]}]}]},{id:'upload',label:a.lang.link.upload,title:a.lang.link.upload,hidden:true,filebrowser:'uploadButton',elements:[{type:'file',id:'upload',label:a.lang.common.upload,style:'height:40px',size:29},{type:'fileButton',id:'uploadButton',label:a.lang.common.uploadSubmit,filebrowser:'info:url','for':['upload','upload']}]},{id:'advanced',label:a.lang.link.advanced,title:a.lang.link.advanced,elements:[{type:'vbox',padding:1,children:[{type:'hbox',widths:['45%','35%','20%'],children:[{type:'text',id:'advId',label:a.lang.link.id,setup:s,commit:v},{type:'select',id:'advLangDir',label:a.lang.link.langDir,'default':'',style:'width:110px',items:[[a.lang.common.notSet,''],[a.lang.link.langDirLTR,'ltr'],[a.lang.link.langDirRTL,'rtl']],setup:s,commit:v},{type:'text',id:'advAccessKey',width:'80px',label:a.lang.link.acccessKey,maxLength:1,setup:s,commit:v}]},{type:'hbox',widths:['45%','35%','20%'],children:[{type:'text',label:a.lang.link.name,id:'advName',setup:s,commit:v},{type:'text',label:a.lang.link.langCode,id:'advLangCode',width:'110px','default':'',setup:s,commit:v},{type:'text',label:a.lang.link.tabIndex,id:'advTabIndex',width:'80px',maxLength:5,setup:s,commit:v}]}]},{type:'vbox',padding:1,children:[{type:'hbox',widths:['45%','55%'],children:[{type:'text',label:a.lang.link.advisoryTitle,'default':'',id:'advTitle',setup:s,commit:v},{type:'text',label:a.lang.link.advisoryContentType,'default':'',id:'advContentType',setup:s,commit:v}]},{type:'hbox',widths:['45%','55%'],children:[{type:'text',label:a.lang.link.cssClasses,'default':'',id:'advCSSClasses',setup:s,commit:v},{type:'text',label:a.lang.link.charset,'default':'',id:'advCharset',setup:s,commit:v}]},{type:'hbox',children:[{type:'text',label:a.lang.link.styles,'default':'',id:'advStyles',setup:s,commit:v}]}]}]}],onShow:function(){var F=this;F.fakeObj=false;var C=F.getParentEditor(),D=C.getSelection(),E=null;if((E=b.getSelectedLink(C))&&E.hasAttribute('href'))D.selectElement(E);else if((E=D.getSelectedElement())&&E.is('img')&&E.getAttribute('_cke_real_element_type')&&E.getAttribute('_cke_real_element_type')=='anchor'){F.fakeObj=E;E=C.restoreRealElement(F.fakeObj);D.selectElement(F.fakeObj);}else E=null;F.setupContent(p.apply(F,[C,E]));},onOk:function(){var C={href:'javascript:void(0)/*'+CKEDITOR.tools.getNextNumber()+'*/'},D=[],E={href:C.href},F=this,G=this.getParentEditor();this.commitContent(E);switch(E.type||'url'){case 'url':var H=E.url&&E.url.protocol!=undefined?E.url.protocol:'http://',I=E.url&&E.url.url||'';C._cke_saved_href=I.indexOf('/')===0?I:H+I;break;case 'anchor':var J=E.anchor&&E.anchor.name,K=E.anchor&&E.anchor.id;C._cke_saved_href='#'+(J||K||'');break;case 'email':var L,M=E.email,N=M.address;switch(y){case '':case 'encode':var O=encodeURIComponent(M.subject||''),P=encodeURIComponent(M.body||''),Q=[];O&&Q.push('subject='+O);P&&Q.push('body='+P);Q=Q.length?'?'+Q.join('&'):'';if(y=='encode'){L=["javascript:void(location.href='mailto:'+",B(N)];Q&&L.push("+'",x(Q),"'");L.push(')');}else L=['mailto:',N,Q];break;default:var R=N.split('@',2);M.name=R[0];M.domain=R[1];L=['javascript:',A(M)];}C._cke_saved_href=L.join('');break;}if(E.target)if(E.target.type=='popup'){var S=["window.open(this.href, '",E.target.name||'',"', '"],T=['resizable','status','location','toolbar','menubar','fullscreen','scrollbars','dependent'],U=T.length,V=function(ah){if(E.target[ah])T.push(ah+'='+E.target[ah]);};for(var W=0;W<U;W++)T[W]=T[W]+(E.target[T[W]]?'=yes':'=no');V('width');V('left');V('height');V('top');S.push(T.join(','),"'); return false;");C._cke_pa_onclick=S.join('');}else{if(E.target.type!='notSet'&&E.target.name)C.target=E.target.name;else D.push('target');D.push('_cke_pa_onclick','onclick');}if(E.adv){var X=function(ah,ai){var aj=E.adv[ah];if(aj)C[ai]=aj;else D.push(ai);};if(this._.selectedElement)X('advId','id');X('advLangDir','dir');X('advAccessKey','accessKey');X('advName','name');X('advLangCode','lang');X('advTabIndex','tabindex');X('advTitle','title');X('advContentType','type');X('advCSSClasses','class');X('advCharset','charset');X('advStyles','style');}if(!this._.selectedElement){var Y=G.getSelection(),Z=Y.getRanges();if(Z.length==1&&Z[0].collapsed){var aa=new CKEDITOR.dom.text(C._cke_saved_href,G.document);Z[0].insertNode(aa);Z[0].selectNodeContents(aa);Y.selectRanges(Z);}var ab=new CKEDITOR.style({element:'a',attributes:C}); |
x.data=a.fire('scaytDialog',{});x.options=x.data.scayt_control.option();x.sLang=x.data.scayt_control.sLang;if(!x.data||!x.data.scayt||!x.data.scayt_control){alert('Error loading application service');x.hide();return;}var y=0;if(b)x.data.scayt.getCaption(a.langCode||'en',function(z){if(y++>0)return;c=z;q.apply(x);r.apply(x);b=false;});else r.apply(x);x.selectPage(x.data.tab);},onOk:function(){var x=this.data.scayt_control;x.option(this.options);var y=this.chosed_lang;x.setLang(y);x.refresh();},onCancel:function(){var x=k();for(f in x)x[f].checked=false;m(l(),'');},contents:g},p=CKEDITOR.plugins.scayt.getScayt(a);e=CKEDITOR.plugins.scayt.uiTabs;for(f in e){if(e[f]==1)g[g.length]=n[f];}if(e[2]==1)h=true;var q=function(){var x=this,y=x.data.scayt.getLangList(),z=['dic_create','dic_delete','dic_rename','dic_restore'],A=j,B;if(h){for(B=0;B<z.length;B++){var C=z[B];d.getById(C).setHtml('<span class="cke_dialog_ui_button">'+c['button_'+C]+'</span>');}d.getById('dic_info').setHtml(c.dic_info);}if(e[0]==1)for(B in A){var D='label_'+A[B],E=d.getById(D);if('undefined'!=typeof E&&'undefined'!=typeof c[D]&&'undefined'!=typeof x.options[A[B]]){E.setHtml(c[D]);var F=E.getParent();F.$.style.display='block';}}var G='<p>'+c.about_throwt_image+'</p>'+'<p>'+c.version+x.data.scayt.version.toString()+'</p>'+'<p>'+c.about_throwt_copy+'</p>';d.getById('scayt_about').setHtml(G);var H=function(R,S){var T=d.createElement('label');T.setAttribute('for','cke_option'+R);T.setHtml(S[R]);if(x.sLang==R)x.chosed_lang=R;var U=d.createElement('div'),V=CKEDITOR.dom.element.createFromHtml('<input id="cke_option'+R+'" type="radio" '+(x.sLang==R?'checked="checked"':'')+' value="'+R+'" name="scayt_lang" />');V.on('click',function(){this.$.checked=true;x.chosed_lang=R;});U.append(V);U.append(T);return{lang:S[R],code:R,radio:U};},I=[];if(e[1]==1){for(B in y.rtl)I[I.length]=H(B,y.ltr);for(B in y.ltr)I[I.length]=H(B,y.ltr);I.sort(function(R,S){return S.lang>R.lang?-1:1;});var J=d.getById('scayt_lcol'),K=d.getById('scayt_rcol');for(B=0;B<I.length;B++){var L=B<I.length/2?J:K;L.append(I[B].radio);}}var M={};M.dic_create=function(R,S,T){var U=T[0]+','+T[1],V=c.err_dic_create,W=c.succ_dic_create;window.scayt.createUserDictionary(S,function(X){v(U);u(T[1]);W=W.replace('%s',X.dname);t(W);},function(X){V=V.replace('%s',X.dname);s(V+'( '+(X.message||'')+')');});};M.dic_rename=function(R,S){var T=c.err_dic_rename||'',U=c.succ_dic_rename||'';window.scayt.renameUserDictionary(S,function(V){U=U.replace('%s',V.dname); | x.data=a.fire('scaytDialog',{});x.options=x.data.scayt_control.option();x.sLang=x.data.scayt_control.sLang;if(!x.data||!x.data.scayt||!x.data.scayt_control){alert('Error loading application service');x.hide();return;}var y=0;if(b)x.data.scayt.getCaption(a.langCode||'en',function(z){if(y++>0)return;c=z;q.apply(x);r.apply(x);b=false;});else r.apply(x);x.selectPage(x.data.tab);},onOk:function(){var x=this.data.scayt_control;x.option(this.options);var y=this.chosed_lang;x.setLang(y);x.refresh();},onCancel:function(){var x=k();for(f in x)x[f].checked=false;m(l(),'');},contents:g},p=CKEDITOR.plugins.scayt.getScayt(a);e=CKEDITOR.plugins.scayt.uiTabs;for(f in e){if(e[f]==1)g[g.length]=n[f];}if(e[2]==1)h=true;var q=function(){var x=this,y=x.data.scayt.getLangList(),z=['dic_create','dic_delete','dic_rename','dic_restore'],A=j,B;if(h){for(B=0;B<z.length;B++){var C=z[B];d.getById(C).setHtml('<span class="cke_dialog_ui_button">'+c['button_'+C]+'</span>');}d.getById('dic_info').setHtml(c.dic_info);}if(e[0]==1)for(B in A){var D='label_'+A[B],E=d.getById(D);if('undefined'!=typeof E&&'undefined'!=typeof c[D]&&'undefined'!=typeof x.options[A[B]]){E.setHtml(c[D]);var F=E.getParent();F.$.style.display='block';}}var G='<p><img src="'+window.scayt.getAboutInfo().logoURL+'" /></p>'+'<p>'+c.version+window.scayt.getAboutInfo().version.toString()+'</p>'+'<p>'+c.about_throwt_copy+'</p>';d.getById('scayt_about').setHtml(G);var H=function(R,S){var T=d.createElement('label');T.setAttribute('for','cke_option'+R);T.setHtml(S[R]);if(x.sLang==R)x.chosed_lang=R;var U=d.createElement('div'),V=CKEDITOR.dom.element.createFromHtml('<input id="cke_option'+R+'" type="radio" '+(x.sLang==R?'checked="checked"':'')+' value="'+R+'" name="scayt_lang" />');V.on('click',function(){this.$.checked=true;x.chosed_lang=R;});U.append(V);U.append(T);return{lang:S[R],code:R,radio:U};},I=[];if(e[1]==1){for(B in y.rtl)I[I.length]=H(B,y.ltr);for(B in y.ltr)I[I.length]=H(B,y.ltr);I.sort(function(R,S){return S.lang>R.lang?-1:1;});var J=d.getById('scayt_lcol'),K=d.getById('scayt_rcol');for(B=0;B<I.length;B++){var L=B<I.length/2?J:K;L.append(I[B].radio);}}var M={};M.dic_create=function(R,S,T){var U=T[0]+','+T[1],V=c.err_dic_create,W=c.succ_dic_create;window.scayt.createUserDictionary(S,function(X){v(U);u(T[1]);W=W.replace('%s',X.dname);t(W);},function(X){V=V.replace('%s',X.dname);s(V+'( '+(X.message||'')+')');});};M.dic_rename=function(R,S){var T=c.err_dic_rename||'',U=c.succ_dic_rename||'';window.scayt.renameUserDictionary(S,function(V){U=U.replace('%s',V.dname); | CKEDITOR.dialog.add('scaytcheck',function(a){var b=true,c,d=CKEDITOR.document,e=[],f,g=[],h=false,i=['dic_create,dic_restore','dic_rename,dic_delete'],j=['mixedCase','mixedWithDigits','allCaps','ignoreDomainNames'];function k(){return document.forms.optionsbar.options;};function l(){return document.forms.languagesbar.scayt_lang;};function m(x,y){if(!x)return;var z=x.length;if(z==undefined){x.checked=x.value==y.toString();return;}for(var A=0;A<z;A++){x[A].checked=false;if(x[A].value==y.toString())x[A].checked=true;}};var n=[{id:'options',label:a.lang.scayt.optionsTab,elements:[{type:'html',id:'options',html:'<form name="optionsbar"><div class="inner_options">\t<div class="messagebox"></div>\t<div style="display:none;">\t\t<input type="checkbox" name="options" id="allCaps" />\t\t<label for="allCaps" id="label_allCaps"></label>\t</div>\t<div style="display:none;">\t\t<input name="options" type="checkbox" id="ignoreDomainNames" />\t\t<label for="ignoreDomainNames" id="label_ignoreDomainNames"></label>\t</div>\t<div style="display:none;">\t<input name="options" type="checkbox" id="mixedCase" />\t\t<label for="mixedCase" id="label_mixedCase"></label>\t</div>\t<div style="display:none;">\t\t<input name="options" type="checkbox" id="mixedWithDigits" />\t\t<label for="mixedWithDigits" id="label_mixedWithDigits"></label>\t</div></div></form>'}]},{id:'langs',label:a.lang.scayt.languagesTab,elements:[{type:'html',id:'langs',html:'<form name="languagesbar"><div class="inner_langs">\t<div class="messagebox"></div>\t <div style="float:left;width:45%;margin-left:5px;" id="scayt_lcol" ></div> <div style="float:left;width:45%;margin-left:15px;" id="scayt_rcol"></div></div></form>'}]},{id:'dictionaries',label:a.lang.scayt.dictionariesTab,elements:[{type:'html',style:'',id:'dictionaries',html:'<form name="dictionarybar"><div class="inner_dictionary" style="text-align:left; white-space:normal; width:320px; overflow: hidden;">\t<div style="margin:5px auto; width:80%;white-space:normal; overflow:hidden;" id="dic_message"> </div>\t<div style="margin:5px auto; width:80%;white-space:normal;"> <span class="cke_dialog_ui_labeled_label" >Dictionary name</span><br>\t\t<span class="cke_dialog_ui_labeled_content" >\t\t\t<div class="cke_dialog_ui_input_text">\t\t\t\t<input id="dic_name" type="text" class="cke_dialog_ui_input_text"/>\t\t</div></span></div>\t\t<div style="margin:5px auto; width:80%;white-space:normal;">\t\t\t<a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_create">\t\t\t\t</a>\t\t\t<a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_delete">\t\t\t\t</a>\t\t\t<a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_rename">\t\t\t\t</a>\t\t\t<a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_restore">\t\t\t\t</a>\t\t</div>\t<div style="margin:5px auto; width:95%;white-space:normal;" id="dic_info"></div></div></form>'}]},{id:'about',label:a.lang.scayt.aboutTab,elements:[{type:'html',id:'about',style:'margin: 5px 5px;',html:'<div id="scayt_about"></div>'}]}],o={title:a.lang.scayt.title,minWidth:360,minHeight:220,onShow:function(){var x=this;x.data=a.fire('scaytDialog',{});x.options=x.data.scayt_control.option();x.sLang=x.data.scayt_control.sLang;if(!x.data||!x.data.scayt||!x.data.scayt_control){alert('Error loading application service');x.hide();return;}var y=0;if(b)x.data.scayt.getCaption(a.langCode||'en',function(z){if(y++>0)return;c=z;q.apply(x);r.apply(x);b=false;});else r.apply(x);x.selectPage(x.data.tab);},onOk:function(){var x=this.data.scayt_control;x.option(this.options);var y=this.chosed_lang;x.setLang(y);x.refresh();},onCancel:function(){var x=k();for(f in x)x[f].checked=false;m(l(),'');},contents:g},p=CKEDITOR.plugins.scayt.getScayt(a);e=CKEDITOR.plugins.scayt.uiTabs;for(f in e){if(e[f]==1)g[g.length]=n[f];}if(e[2]==1)h=true;var q=function(){var x=this,y=x.data.scayt.getLangList(),z=['dic_create','dic_delete','dic_rename','dic_restore'],A=j,B;if(h){for(B=0;B<z.length;B++){var C=z[B];d.getById(C).setHtml('<span class="cke_dialog_ui_button">'+c['button_'+C]+'</span>');}d.getById('dic_info').setHtml(c.dic_info);}if(e[0]==1)for(B in A){var D='label_'+A[B],E=d.getById(D);if('undefined'!=typeof E&&'undefined'!=typeof c[D]&&'undefined'!=typeof x.options[A[B]]){E.setHtml(c[D]);var F=E.getParent();F.$.style.display='block';}}var G='<p>'+c.about_throwt_image+'</p>'+'<p>'+c.version+x.data.scayt.version.toString()+'</p>'+'<p>'+c.about_throwt_copy+'</p>';d.getById('scayt_about').setHtml(G);var H=function(R,S){var T=d.createElement('label');T.setAttribute('for','cke_option'+R);T.setHtml(S[R]);if(x.sLang==R)x.chosed_lang=R;var U=d.createElement('div'),V=CKEDITOR.dom.element.createFromHtml('<input id="cke_option'+R+'" type="radio" '+(x.sLang==R?'checked="checked"':'')+' value="'+R+'" name="scayt_lang" />');V.on('click',function(){this.$.checked=true;x.chosed_lang=R;});U.append(V);U.append(T);return{lang:S[R],code:R,radio:U};},I=[];if(e[1]==1){for(B in y.rtl)I[I.length]=H(B,y.ltr);for(B in y.ltr)I[I.length]=H(B,y.ltr);I.sort(function(R,S){return S.lang>R.lang?-1:1;});var J=d.getById('scayt_lcol'),K=d.getById('scayt_rcol');for(B=0;B<I.length;B++){var L=B<I.length/2?J:K;L.append(I[B].radio);}}var M={};M.dic_create=function(R,S,T){var U=T[0]+','+T[1],V=c.err_dic_create,W=c.succ_dic_create;window.scayt.createUserDictionary(S,function(X){v(U);u(T[1]);W=W.replace('%s',X.dname);t(W);},function(X){V=V.replace('%s',X.dname);s(V+'( '+(X.message||'')+')');});};M.dic_rename=function(R,S){var T=c.err_dic_rename||'',U=c.succ_dic_rename||'';window.scayt.renameUserDictionary(S,function(V){U=U.replace('%s',V.dname); |
if (key == 8 || key == 9) { | if (key == 8 || key == 46) { | function onShow(ev) { ev.type = "onShow"; fire.trigger(ev); $(document).bind("keydown.d", function(e) { if (e.ctrlKey) { return true; } var key = e.keyCode; // backspace or delete clears the value if (key == 8 || key == 9) { input.val(""); return self.hide(e); } // esc or tab key exits if (key == 27 || key == 9) { return self.hide(e); } if ($(KEYS).index(key) >= 0) { if (!opened) { self.show(e); return e.preventDefault(); } var days = $("#" + css.weeks + " a"), el = $("." + css.focus), index = days.index(el); el.removeClass(css.focus); if (key == 74 || key == 40) { index += 7; } else if (key == 75 || key == 38) { index -= 7; } else if (key == 76 || key == 39) { index += 1; } else if (key == 72 || key == 37) { index -= 1; } if (index > 41) { self.addMonth(); el = $("#" + css.weeks + " a:eq(" + (index-42) + ")"); } else if (index < 0) { self.addMonth(-1); el = $("#" + css.weeks + " a:eq(" + (index+42) + ")"); } else { el = days.eq(index); } el.addClass(css.focus); return e.preventDefault(); } // pageUp / pageDown if (key == 34) { return self.addMonth(); } if (key == 33) { return self.addMonth(-1); } // home if (key == 36) { return self.today(); } // enter if (key == 13) { if (!$(e.target).is("select")) { $("." + css.focus).click(); } } return $([16, 17, 18, 9]).index(key) >= 0; }); // click outside dateinput $(document).bind("click.d", function(e) { var el = e.target; if (!$(el).parents("#" + css.root).length && el != input[0] && (!trigger || el != trigger[0])) { self.hide(e); } }); } |
if ($([75, 76, 38, 39, 74, 72, 40, 37]).index(key) >= 0) { | if ($(KEYS).index(key) >= 0) { | function onShow(ev) { ev.type = "onShow"; fire.trigger(ev); $(document).bind("keydown.d", function(e) { var key = e.keyCode; // esc key if (key == 27) { return self.hide(e); } // h=72, j=74, k=75, l=76, down=40, left=37, up=38, right=39 if ($([75, 76, 38, 39, 74, 72, 40, 37]).index(key) >= 0) { if (root.is(":hidden")) { self.show(e); return e.preventDefault(); } var days = $("#" + css.weeks + " a"), el = $("." + css.focus), index = days.index(el); el.removeClass(css.focus); if (key == 74 || key == 40) { index += 7; } else if (key == 75 || key == 38) { index -= 7; } else if (key == 76 || key == 39) { index += 1; } else if (key == 72 || key == 37) { index -= 1; } if (index == -1) { self.prev(); el = $("#" + css.weeks + " a:last"); } else if (index == 35) { self.next(); el = $("#" + css.weeks + " a:first"); } else { el = days.eq(index); } el.addClass(css.focus); return e.preventDefault(); } // pageUp / pageDown if (key == 34) { return self.next(); } if (key == 33) { return self.prev(); } // home if (key == 36) { return self.today(); } // enter if (key == 13) { if (!$(e.target).is("select")) { pick($("." + css.focus).data("date"), conf, e); } } return $([16, 17, 18, 9]).index(key) >= 0; }); // click outside dateinput $(window).bind("click.d", function(e) { var el = e.target; if (!$(el).parents("#" + css.root).length && el != input[0] && (!trigger || el != trigger[0])) { self.hide(e); } }); } |
$(document).bind("keydown.dp", function(e) { | $(document).bind("keydown.d", function(e) { | function onShow(ev) { ev.type = "onShow"; fire.trigger(ev); $(document).bind("keydown.dp", function(e) { var key = e.keyCode; // esc key if (key == 27) { return self.hide(e); } // h=72, j=74, k=75, l=76, down=40, left=37, up=38, right=39 if ($([75, 76, 38, 39, 74, 72, 40, 37]).index(key) >= 0) { if (root.is(":hidden")) { self.show(e); return e.preventDefault(); } var days = $("#" + css.weeks + " a"), el = $("." + css.focus), index = days.index(el); el.removeClass(css.focus); if (key == 74 || key == 40) { index += 7; } else if (key == 75 || key == 38) { index -= 7; } else if (key == 76 || key == 39) { index += 1; } else if (key == 72 || key == 37) { index -= 1; } if (index == -1) { self.prev(); el = $("#" + css.weeks + " a:last"); } else if (index == 35) { self.next(); el = $("#" + css.weeks + " a:first"); } else { el = days.eq(index); } el.addClass(css.focus); return e.preventDefault(); } // pageUp / pageDown if (key == 34) { return self.next(); } if (key == 33) { return self.prev(); } // home if (key == 36) { return self.today(); } // enter if (key == 13) { if (!$(e.target).is("select")) { pick($("." + css.focus).data("date"), conf, e); } } return $([16, 17, 18, 9]).index(key) >= 0; }); // click outside dateinput $(window).bind("click.dp", function(e) { var el = e.target; if (!$(el).parents("#" + css.root).length && el != input[0] && el != trigger[0]) { self.hide(e); } }); } |
$(window).bind("click.dp", function(e) { | $(window).bind("click.d", function(e) { | function onShow(ev) { ev.type = "onShow"; fire.trigger(ev); $(document).bind("keydown.dp", function(e) { var key = e.keyCode; // esc key if (key == 27) { return self.hide(e); } // h=72, j=74, k=75, l=76, down=40, left=37, up=38, right=39 if ($([75, 76, 38, 39, 74, 72, 40, 37]).index(key) >= 0) { if (root.is(":hidden")) { self.show(e); return e.preventDefault(); } var days = $("#" + css.weeks + " a"), el = $("." + css.focus), index = days.index(el); el.removeClass(css.focus); if (key == 74 || key == 40) { index += 7; } else if (key == 75 || key == 38) { index -= 7; } else if (key == 76 || key == 39) { index += 1; } else if (key == 72 || key == 37) { index -= 1; } if (index == -1) { self.prev(); el = $("#" + css.weeks + " a:last"); } else if (index == 35) { self.next(); el = $("#" + css.weeks + " a:first"); } else { el = days.eq(index); } el.addClass(css.focus); return e.preventDefault(); } // pageUp / pageDown if (key == 34) { return self.next(); } if (key == 33) { return self.prev(); } // home if (key == 36) { return self.today(); } // enter if (key == 13) { if (!$(e.target).is("select")) { pick($("." + css.focus).data("date"), conf, e); } } return $([16, 17, 18, 9]).index(key) >= 0; }); // click outside dateinput $(window).bind("click.dp", function(e) { var el = e.target; if (!$(el).parents("#" + css.root).length && el != input[0] && el != trigger[0]) { self.hide(e); } }); } |
if (!$(el).parents("#" + css.root).length && el != input[0] && el != trigger[0]) { | if (!$(el).parents("#" + css.root).length && el != input[0] && (!trigger || el != trigger[0])) { | function onShow(ev) { ev.type = "onShow"; fire.trigger(ev); $(document).bind("keydown.dp", function(e) { var key = e.keyCode; // esc key if (key == 27) { return self.hide(e); } // h=72, j=74, k=75, l=76, down=40, left=37, up=38, right=39 if ($([75, 76, 38, 39, 74, 72, 40, 37]).index(key) >= 0) { if (root.is(":hidden")) { self.show(e); return e.preventDefault(); } var days = $("#" + css.weeks + " a"), el = $("." + css.focus), index = days.index(el); el.removeClass(css.focus); if (key == 74 || key == 40) { index += 7; } else if (key == 75 || key == 38) { index -= 7; } else if (key == 76 || key == 39) { index += 1; } else if (key == 72 || key == 37) { index -= 1; } if (index == -1) { self.prev(); el = $("#" + css.weeks + " a:last"); } else if (index == 35) { self.next(); el = $("#" + css.weeks + " a:first"); } else { el = days.eq(index); } el.addClass(css.focus); return e.preventDefault(); } // pageUp / pageDown if (key == 34) { return self.next(); } if (key == 33) { return self.prev(); } // home if (key == 36) { return self.today(); } // enter if (key == 13) { if (!$(e.target).is("select")) { pick($("." + css.focus).data("date"), conf, e); } } return $([16, 17, 18, 9]).index(key) >= 0; }); // click outside dateinput $(window).bind("click.dp", function(e) { var el = e.target; if (!$(el).parents("#" + css.root).length && el != input[0] && el != trigger[0]) { self.hide(e); } }); } |
select($("." + css.focus).data("date"), conf, e); | $("." + css.focus).click(); | function onShow(ev) { ev.type = "onShow"; fire.trigger(ev); $(document).bind("keydown.d", function(e) { var key = e.keyCode; // esc key if (key == 27) { return self.hide(e); } if ($(KEYS).index(key) >= 0) { if (!opened) { self.show(e); return e.preventDefault(); } var days = $("#" + css.weeks + " a"), el = $("." + css.focus), index = days.index(el); el.removeClass(css.focus); if (key == 74 || key == 40) { index += 7; } else if (key == 75 || key == 38) { index -= 7; } else if (key == 76 || key == 39) { index += 1; } else if (key == 72 || key == 37) { index -= 1; } if (index == -1) { self.addMonth(-1); el = $("#" + css.weeks + " a:last"); } else if (index == 35) { self.addMonth(); el = $("#" + css.weeks + " a:first"); } else { el = days.eq(index); } el.addClass(css.focus); return e.preventDefault(); } // pageUp / pageDown if (key == 34) { return self.addMonth(); } if (key == 33) { return self.addMonth(-1); } // home if (key == 36) { return self.today(); } // enter if (key == 13) { if (!$(e.target).is("select")) { select($("." + css.focus).data("date"), conf, e); } } return $([16, 17, 18, 9]).index(key) >= 0; }); // click outside dateinput $(document).bind("click.d", function(e) { var el = e.target; if (!$(el).parents("#" + css.root).length && el != input[0] && (!trigger || el != trigger[0])) { self.hide(e); } }); } |
if (index == -1) { self.addMonth(-1); el = $("#" + css.weeks + " a:last"); } else if (index == 35) { self.addMonth(); el = $("#" + css.weeks + " a:first"); | if (index > 41) { self.addMonth(); el = $("#" + css.weeks + " a:eq(" + (index-42) + ")"); } else if (index < 0) { self.addMonth(-1); el = $("#" + css.weeks + " a:eq(" + (index+42) + ")"); | function onShow(ev) { ev.type = "onShow"; fire.trigger(ev); $(document).bind("keydown.d", function(e) { var key = e.keyCode; // backspace clears the value if (key == 8) { input.val(""); return self.hide(e); } // esc key if (key == 27) { return self.hide(e); } if ($(KEYS).index(key) >= 0) { if (!opened) { self.show(e); return e.preventDefault(); } var days = $("#" + css.weeks + " a"), el = $("." + css.focus), index = days.index(el); el.removeClass(css.focus); if (key == 74 || key == 40) { index += 7; } else if (key == 75 || key == 38) { index -= 7; } else if (key == 76 || key == 39) { index += 1; } else if (key == 72 || key == 37) { index -= 1; } if (index == -1) { self.addMonth(-1); el = $("#" + css.weeks + " a:last"); } else if (index == 35) { self.addMonth(); el = $("#" + css.weeks + " a:first"); } else { el = days.eq(index); } el.addClass(css.focus); return e.preventDefault(); } // pageUp / pageDown if (key == 34) { return self.addMonth(); } if (key == 33) { return self.addMonth(-1); } // home if (key == 36) { return self.today(); } // enter if (key == 13) { if (!$(e.target).is("select")) { $("." + css.focus).click(); } } return $([16, 17, 18, 9]).index(key) >= 0; }); // click outside dateinput $(document).bind("click.d", function(e) { var el = e.target; if (!$(el).parents("#" + css.root).length && el != input[0] && (!trigger || el != trigger[0])) { self.hide(e); } }); } |
if (root.is(":hidden")) { | if (!opened) { | function onShow(ev) { ev.type = "onShow"; fire.trigger(ev); $(document).bind("keydown.d", function(e) { var key = e.keyCode; // esc key if (key == 27) { return self.hide(e); } if ($(KEYS).index(key) >= 0) { if (root.is(":hidden")) { self.show(e); return e.preventDefault(); } var days = $("#" + css.weeks + " a"), el = $("." + css.focus), index = days.index(el); el.removeClass(css.focus); if (key == 74 || key == 40) { index += 7; } else if (key == 75 || key == 38) { index -= 7; } else if (key == 76 || key == 39) { index += 1; } else if (key == 72 || key == 37) { index -= 1; } if (index == -1) { self.addMonth(-1); el = $("#" + css.weeks + " a:last"); } else if (index == 35) { self.addMonth(); el = $("#" + css.weeks + " a:first"); } else { el = days.eq(index); } el.addClass(css.focus); return e.preventDefault(); } // pageUp / pageDown if (key == 34) { return self.addMonth(); } if (key == 33) { return self.addMonth(-1); } // home if (key == 36) { return self.today(); } // enter if (key == 13) { if (!$(e.target).is("select")) { select($("." + css.focus).data("date"), conf, e); } } return $([16, 17, 18, 9]).index(key) >= 0; }); // click outside dateinput $(document).bind("click.d", function(e) { var el = e.target; if (!$(el).parents("#" + css.root).length && el != input[0] && (!trigger || el != trigger[0])) { self.hide(e); } }); } |
if (key == 8) { | if (key == 8 || key == 9) { | function onShow(ev) { ev.type = "onShow"; fire.trigger(ev); $(document).bind("keydown.d", function(e) { if (e.ctrlKey) { return true; } var key = e.keyCode; // backspace clears the value if (key == 8) { input.val(""); return self.hide(e); } // esc key if (key == 27) { return self.hide(e); } if ($(KEYS).index(key) >= 0) { if (!opened) { self.show(e); return e.preventDefault(); } var days = $("#" + css.weeks + " a"), el = $("." + css.focus), index = days.index(el); el.removeClass(css.focus); if (key == 74 || key == 40) { index += 7; } else if (key == 75 || key == 38) { index -= 7; } else if (key == 76 || key == 39) { index += 1; } else if (key == 72 || key == 37) { index -= 1; } if (index > 41) { self.addMonth(); el = $("#" + css.weeks + " a:eq(" + (index-42) + ")"); } else if (index < 0) { self.addMonth(-1); el = $("#" + css.weeks + " a:eq(" + (index+42) + ")"); } else { el = days.eq(index); } el.addClass(css.focus); return e.preventDefault(); } // pageUp / pageDown if (key == 34) { return self.addMonth(); } if (key == 33) { return self.addMonth(-1); } // home if (key == 36) { return self.today(); } // enter if (key == 13) { if (!$(e.target).is("select")) { $("." + css.focus).click(); } } return $([16, 17, 18, 9]).index(key) >= 0; }); // click outside dateinput $(document).bind("click.d", function(e) { var el = e.target; if (!$(el).parents("#" + css.root).length && el != input[0] && (!trigger || el != trigger[0])) { self.hide(e); } }); } |
if (key == 27) { return self.hide(e); } | if (key == 27 || key == 9) { return self.hide(e); } | function onShow(ev) { ev.type = "onShow"; fire.trigger(ev); $(document).bind("keydown.d", function(e) { if (e.ctrlKey) { return true; } var key = e.keyCode; // backspace clears the value if (key == 8) { input.val(""); return self.hide(e); } // esc key if (key == 27) { return self.hide(e); } if ($(KEYS).index(key) >= 0) { if (!opened) { self.show(e); return e.preventDefault(); } var days = $("#" + css.weeks + " a"), el = $("." + css.focus), index = days.index(el); el.removeClass(css.focus); if (key == 74 || key == 40) { index += 7; } else if (key == 75 || key == 38) { index -= 7; } else if (key == 76 || key == 39) { index += 1; } else if (key == 72 || key == 37) { index -= 1; } if (index > 41) { self.addMonth(); el = $("#" + css.weeks + " a:eq(" + (index-42) + ")"); } else if (index < 0) { self.addMonth(-1); el = $("#" + css.weeks + " a:eq(" + (index+42) + ")"); } else { el = days.eq(index); } el.addClass(css.focus); return e.preventDefault(); } // pageUp / pageDown if (key == 34) { return self.addMonth(); } if (key == 33) { return self.addMonth(-1); } // home if (key == 36) { return self.today(); } // enter if (key == 13) { if (!$(e.target).is("select")) { $("." + css.focus).click(); } } return $([16, 17, 18, 9]).index(key) >= 0; }); // click outside dateinput $(document).bind("click.d", function(e) { var el = e.target; if (!$(el).parents("#" + css.root).length && el != input[0] && (!trigger || el != trigger[0])) { self.hide(e); } }); } |
var kfMTH = new KFmainThreadHandler(this.source, "finished", "", this.mainWindow, this.browserWindow); kfMTH.run(); | if (this.persist.result == NS_OK) { var kfMTH = new KFmainThreadHandler(this.source, "finished", "", this.mainWindow, this.browserWindow); kfMTH.run(); } else { var kfMTH = new KFmainThreadHandler(this.source, "failed", "", this.mainWindow, this.browserWindow); kfMTH.run(); } | onStateChange: function(aWebProgress, aRequest, aStatus, aMessage) { if (aStatus & Components.interfaces.nsIWebProgressListener.STATE_STOP) { //var main = Components.classes["@mozilla.org/thread-manager;1"].getService().mainThread; //main.dispatch(new KFmainThreadHandler(this.source, "finished", "", this.mainWindow, this.browserWindow), main.DISPATCH_NORMAL); var kfMTH = new KFmainThreadHandler(this.source, "finished", "", this.mainWindow, this.browserWindow); kfMTH.run(); } } |
if (this.persist.result == NS_OK) { | if (this.persist.result == 0) { | onStateChange: function(aWebProgress, aRequest, aStatus, aMessage) { if (aStatus & Components.interfaces.nsIWebProgressListener.STATE_STOP) { if (this.persist.result == NS_OK) { var kfMTH = new KFmainThreadHandler(this.source, "finished", "", this.mainWindow, this.browserWindow); kfMTH.run(); } else {//TODO: different for cancelled? var kfMTH = new KFmainThreadHandler(this.source, "failed", "", this.mainWindow, this.browserWindow); kfMTH.run(); } } } |
} else { | } else if (this.persist.result == 2152398850) { var kfMTH = new KFmainThreadHandler(this.source, "cancelled", "", this.mainWindow, this.browserWindow); kfMTH.run(); } else { | onStateChange: function(aWebProgress, aRequest, aStatus, aMessage) { if (aStatus & Components.interfaces.nsIWebProgressListener.STATE_STOP) { if (this.persist.result == NS_OK) { var kfMTH = new KFmainThreadHandler(this.source, "finished", "", this.mainWindow, this.browserWindow); kfMTH.run(); } else {//TODO: different for cancelled? var kfMTH = new KFmainThreadHandler(this.source, "failed", "", this.mainWindow, this.browserWindow); kfMTH.run(); } } } |
var raw_query = q_obj.value, | var raw_query = q_obj.value; | searchForm.onsubmit = function () { var raw_query = q_obj.value, /// Is the query is the same as the explanation? If so, do not submit the query; just draw attention to the query box. if (raw_query == BF.lang.query_explanation) { q_obj.focus(); } else { query_manager.run(raw_query); } ///NOTE: Must return false in order to stop the form submission. return false; }; |
}.bind(this) | }.bind(this), | onSuccess: function(){ var child = this.ele.getElement('.children'); if (child.getStyle('display') == "block") { child.dissolve(); } var ul = $("sort_children_{id}".substitute({"id": this.id})); ul.erase("html"); this.linksLoaded = false; indicateSuccess(); }.bind(this) |
$('paul_failed_tests').appendChild(new Element('option').update(fname)); | $('paul_failed_tests').appendChild(new Element('option').innerHTML = fname); | var onSuccess = function(resp) { var arr = resp.responseText.split('/'); var fname = arr[arr.length-1]; fname = fname.split(' ')[0]; $('paul_failed_tests').appendChild(new Element('option').update(fname)); abc_contents_output[fname] = { abc: editArea.get(), out: "Unknown: reload page to see this data." }; }; |
c.widgetCoordinates(g,i.touches[0]);else{f=c.widgetCoordinates(g,i);c.capture(null);c.capture(a)}k-=c.px(g,"marginLeft");l-=c.px(g,"marginTop");d.x+=k-e.x;d.y+=l-e.y;f.x-=k-e.x;f.y-=l-e.y;a.style.left=d.x+"px";a.style.top=d.y+"px";a.className=r;h.appendChild(a);c.cancelEvent(i);a.onmousemove=h.ontouchmove=function(b){var o=n(b);if(j=="h")a.style.left=d.x+o+"px";else a.style.top=d.y+o+"px";c.cancelEvent(b)};a.onmouseup=h.ontouchend=function(b){if(a.parentNode!=null){a.parentNode.removeChild(a);s(n(b)); h.ontouchmove=null}}}); | if(i.touches)f=b.widgetCoordinates(g,i.touches[0]);else{f=b.widgetCoordinates(g,i);b.capture(null);b.capture(a)}k-=b.px(g,"marginLeft");l-=b.px(g,"marginTop");d.x+=k-e.x;d.y+=l-e.y;f.x-=k-e.x;f.y-=l-e.y;a.style.left=d.x+"px";a.style.top=d.y+"px";a.className=r;h.appendChild(a);b.cancelEvent(i);a.onmousemove=h.ontouchmove=function(c){var o=n(c);if(j=="h")a.style.left=d.x+o+"px";else a.style.top=d.y+o+"px";b.cancelEvent(c)};a.onmouseup=h.ontouchend=function(c){if(a.parentNode!=null){a.parentNode.removeChild(a); s(n(c));h.ontouchmove=null}}}); | c.widgetCoordinates(g,i.touches[0]);else{f=c.widgetCoordinates(g,i);c.capture(null);c.capture(a)}k-=c.px(g,"marginLeft");l-=c.px(g,"marginTop");d.x+=k-e.x;d.y+=l-e.y;f.x-=k-e.x;f.y-=l-e.y;a.style.left=d.x+"px";a.style.top=d.y+"px";a.className=r;h.appendChild(a);c.cancelEvent(i);a.onmousemove=h.ontouchmove=function(b){var o=n(b);if(j=="h")a.style.left=d.x+o+"px";else a.style.top=d.y+o+"px";c.cancelEvent(b)};a.onmouseup=h.ontouchend=function(b){if(a.parentNode!=null){a.parentNode.removeChild(a);s(n(b));h.ontouchmove=null}}}); |
c.widgetCoordinates(g,i.touches[0]);else{f=c.widgetCoordinates(g,i);c.capture(null);c.capture(a)}k-=c.px(g,"marginLeft");l-=c.px(g,"marginTop");d.x+=k-e.x;d.y+=l-e.y;f.x-=k-e.x;f.y-=l-e.y;a.style.left=d.x+"px";a.style.top=d.y+"px";a.className=r;h.appendChild(a);c.cancelEvent(i);a.onmousemove=h.ontouchmove=function(b){var o=n(b);if(j=="h")a.style.left=d.x+o+"px";else a.style.top=d.y+o+"px";c.cancelEvent(b)};a.onmouseup=h.ontouchend=function(b){if(a.parentNode!=null){a.parentNode.removeChild(a);s(n(b)); | if(i.touches)f=b.widgetCoordinates(g,i.touches[0]);else{f=b.widgetCoordinates(g,i);b.capture(null);b.capture(a)}k-=b.px(g,"marginLeft");l-=b.px(g,"marginTop");d.x+=k-e.x;d.y+=l-e.y;f.x-=k-e.x;f.y-=l-e.y;a.style.left=d.x+"px";a.style.top=d.y+"px";a.className=r;h.appendChild(a);b.cancelEvent(i);a.onmousemove=h.ontouchmove=function(c){var o=n(c);if(j=="h")a.style.left=d.x+o+"px";else a.style.top=d.y+o+"px";b.cancelEvent(c)};a.onmouseup=h.ontouchend=function(c){if(a.parentNode!=null){a.parentNode.removeChild(a); | c.widgetCoordinates(g,i.touches[0]);else{f=c.widgetCoordinates(g,i);c.capture(null);c.capture(a)}k-=c.px(g,"marginLeft");l-=c.px(g,"marginTop");d.x+=k-e.x;d.y+=l-e.y;f.x-=k-e.x;f.y-=l-e.y;a.style.left=d.x+"px";a.style.top=d.y+"px";a.className=r;h.appendChild(a);c.cancelEvent(i);a.onmousemove=h.ontouchmove=function(b){var o=n(b);if(j=="h")a.style.left=d.x+o+"px";else a.style.top=d.y+o+"px";c.cancelEvent(b)};a.onmouseup=h.ontouchend=function(b){if(a.parentNode!=null){a.parentNode.removeChild(a);s(n(b)); |
l.firstChild,o,y,A,z;y=o=0;for(A=t.rows.length;o<A;o++){z=t.rows[o];if(z.className=="Wt-hrh"){var x=z.firstChild;x.ri=y-1;x.onmousedown=x.ontouchstart=function(e){f(this,this.ri,e||window.event)}}else{var C,E,G;E=C=0;for(G=z.childNodes.length;C<G;++C){x=z.childNodes[C];if(x.className=="Wt-vrh"){x.ci=E-1;x.onmousedown=x.ontouchstart=function(e){i(this,this.ci,e||window.event)}}else E+=x.colSpan}++y}}d.resizeInitialized=true}}); | l.firstChild,p,y,A,z;y=p=0;for(A=t.rows.length;p<A;p++){z=t.rows[p];if(z.className=="Wt-hrh"){var x=z.firstChild;x.ri=y-1;x.onmousedown=x.ontouchstart=function(e){f(this,this.ri,e||window.event)}}else{var C,E,G;E=C=0;for(G=z.childNodes.length;C<G;++C){x=z.childNodes[C];if(x.className=="Wt-vrh"){x.ci=E-1;x.onmousedown=x.ontouchstart=function(e){g(this,this.ci,e||window.event)}}else E+=x.colSpan}++y}}d.resizeInitialized=true}}); | l.firstChild,o,y,A,z;y=o=0;for(A=t.rows.length;o<A;o++){z=t.rows[o];if(z.className=="Wt-hrh"){var x=z.firstChild;x.ri=y-1;x.onmousedown=x.ontouchstart=function(e){f(this,this.ri,e||window.event)}}else{var C,E,G;E=C=0;for(G=z.childNodes.length;C<G;++C){x=z.childNodes[C];if(x.className=="Wt-vrh"){x.ci=E-1;x.onmousedown=x.ontouchstart=function(e){i(this,this.ci,e||window.event)}}else E+=x.colSpan}++y}}d.resizeInitialized=true}}); |
l.firstChild,o,y,A,z;y=o=0;for(A=t.rows.length;o<A;o++){z=t.rows[o];if(z.className=="Wt-hrh"){var x=z.firstChild;x.ri=y-1;x.onmousedown=x.ontouchstart=function(e){h(this,this.ri,e||window.event)}}else{var C,E,G;E=C=0;for(G=z.childNodes.length;C<G;++C){x=z.childNodes[C];if(x.className=="Wt-vrh"){x.ci=E-1;x.onmousedown=x.ontouchstart=function(e){g(this,this.ci,e||window.event)}}else E+=x.colSpan}++y}}d.resizeInitialized=true}}); | l.firstChild,o,y,A,z;y=o=0;for(A=t.rows.length;o<A;o++){z=t.rows[o];if(z.className=="Wt-hrh"){var x=z.firstChild;x.ri=y-1;x.onmousedown=x.ontouchstart=function(e){f(this,this.ri,e||window.event)}}else{var C,E,G;E=C=0;for(G=z.childNodes.length;C<G;++C){x=z.childNodes[C];if(x.className=="Wt-vrh"){x.ci=E-1;x.onmousedown=x.ontouchstart=function(e){i(this,this.ci,e||window.event)}}else E+=x.colSpan}++y}}d.resizeInitialized=true}}); | l.firstChild,o,y,A,z;y=o=0;for(A=t.rows.length;o<A;o++){z=t.rows[o];if(z.className=="Wt-hrh"){var x=z.firstChild;x.ri=y-1;x.onmousedown=x.ontouchstart=function(e){h(this,this.ri,e||window.event)}}else{var C,E,G;E=C=0;for(G=z.childNodes.length;C<G;++C){x=z.childNodes[C];if(x.className=="Wt-vrh"){x.ci=E-1;x.onmousedown=x.ontouchstart=function(e){g(this,this.ci,e||window.event)}}else E+=x.colSpan}++y}}d.resizeInitialized=true}}); |
l.firstChild,s,y,A,z;y=s=0;for(A=q.rows.length;s<A;s++){z=q.rows[s];if(z.className=="Wt-hrh"){var x=z.firstChild;x.ri=y-1;x.onmousedown=x.ontouchstart=function(e){c(this,this.ri,e||window.event)}}else{var C,E,G;E=C=0;for(G=z.childNodes.length;C<G;++C){x=z.childNodes[C];if(x.className=="Wt-vrh"){x.ci=E-1;x.onmousedown=x.ontouchstart=function(e){f(this,this.ci,e||window.event)}}else E+=x.colSpan}++y}}g.resizeInitialized=true}}); | l.firstChild,q,v,A,z;v=q=0;for(A=s.rows.length;q<A;q++){z=s.rows[q];if(z.className=="Wt-hrh"){var y=z.firstChild;y.ri=v-1;y.onmousedown=y.ontouchstart=function(e){c(this,this.ri,e||window.event)}}else{var C,E,G;E=C=0;for(G=z.childNodes.length;C<G;++C){y=z.childNodes[C];if(y.className=="Wt-vrh"){y.ci=E-1;y.onmousedown=y.ontouchstart=function(e){f(this,this.ci,e||window.event)}}else E+=y.colSpan}++v}}g.resizeInitialized=true}}); | l.firstChild,s,y,A,z;y=s=0;for(A=q.rows.length;s<A;s++){z=q.rows[s];if(z.className=="Wt-hrh"){var x=z.firstChild;x.ri=y-1;x.onmousedown=x.ontouchstart=function(e){c(this,this.ri,e||window.event)}}else{var C,E,G;E=C=0;for(G=z.childNodes.length;C<G;++C){x=z.childNodes[C];if(x.className=="Wt-vrh"){x.ci=E-1;x.onmousedown=x.ontouchstart=function(e){f(this,this.ci,e||window.event)}}else E+=x.colSpan}++y}}g.resizeInitialized=true}}); |
z.childNodes.length;C<G;++C){x=z.childNodes[C];if(x.className=="Wt-vrh"){x.ci=E-1;x.onmousedown=x.ontouchstart=function(c){m(this,this.ci,c||window.event)}}else E+=x.colSpan}++y}}r.resizeInitialized=true}}); | l.firstChild,o,y,A,z;y=o=0;for(A=t.rows.length;o<A;o++){z=t.rows[o];if(z.className=="Wt-hrh"){var x=z.firstChild;x.ri=y-1;x.onmousedown=x.ontouchstart=function(e){h(this,this.ri,e||window.event)}}else{var C,E,G;E=C=0;for(G=z.childNodes.length;C<G;++C){x=z.childNodes[C];if(x.className=="Wt-vrh"){x.ci=E-1;x.onmousedown=x.ontouchstart=function(e){g(this,this.ci,e||window.event)}}else E+=x.colSpan}++y}}d.resizeInitialized=true}}); | z.childNodes.length;C<G;++C){x=z.childNodes[C];if(x.className=="Wt-vrh"){x.ci=E-1;x.onmousedown=x.ontouchstart=function(c){m(this,this.ci,c||window.event)}}else E+=x.colSpan}++y}}r.resizeInitialized=true}}); |
window.location = 'index.html#nexus-search;quick~' + v; | var panel = Sonatype.view.mainTabPanel.addOrShowTab('nexus-search', Sonatype.repoServer.SearchPanel, { title : 'Search' }); panel.startQuickSearch(v); | onTriggerClick: function(a,b,c){ var v = this.getRawValue(); if (v.length > 0) { // var panel = Sonatype.view.mainTabPanel.addOrShowTab( // 'nexus-search', Sonatype.repoServer.SearchPanel, { title: 'Search' } ); // panel.startQuickSearch( v ); window.location = 'index.html#nexus-search;quick~' + v; } } |
if ($("#preview").length && isLoad) { | if ($("#ticket.ticketdraft").length && isLoad) { | function onTypeChanged(evt) { var tt_name = $("#field-type").val(); if (! tt_name){ tt_name = $("#field-type", ttTypeCache["Default"]).val(); } if (!queryResult) { return; } if (evt.type == "change" && isLoad == false) { var answer = confirm("${_('Replace ticket content with template?')}"); if (!answer) { return; } } if ($("#preview").length && isLoad) { // reset isLoad isLoad = false; return; } // reset isLoad isLoad = false; var ticketType = queryResult.field_value_mapping[tt_name]; if (!ticketType) { ticketType = queryResult.field_value_mapping['default']; } _updateTargetElem(ticketType); } |
var obs = DafizillaCommon.getObserverService(); obs.removeObserver(this, "current_view_check_status"); obs.removeObserver(this, "view_closed"); obs.removeObserver(this, "tabswitcher_pref_changed"); this.removeListeners(); | try { var obs = DafizillaCommon.getObserverService(); if (this.prefs.editCompatibility) { obs.removeObserver(this, "current_view_check_status"); }; obs.removeObserver(this, "view_opened"); obs.removeObserver(this, "view_closed"); obs.removeObserver(this, "tabswitcher_pref_changed"); this.removeListeners(); } catch (err) { DafizillaCommon.exception(err); } | onUnLoad : function() { var obs = DafizillaCommon.getObserverService(); obs.removeObserver(this, "current_view_check_status"); obs.removeObserver(this, "view_closed"); obs.removeObserver(this, "tabswitcher_pref_changed"); this.removeListeners(); }, |
false,ga=false,K=null,L=null,W=null,X=0,ha=false,Q=null,ba=null,ka=(new Date).getTime(),ia,ea=0,R={};H.prototype.preload=function(d){var c=new Image;this.images.push(c);c.onload=H.prototype.onload;c.onerror=H.prototype.onload;c.onabort=H.prototype.onload;c.imagePreloader=this;c.src=d};H.prototype.onload=function(){var d=this.imagePreloader;--d.work==0&&d.callback(d.images)};m.history.register(_$_INITIAL_HASH_$_,t);window.onunload=function(){q.emit(q,"Wt-unload");v()};this._p_={ieAlternative:l,loadScript:C, | c.imagePreloader=this;c.src=d};H.prototype.onload=function(){var d=this.imagePreloader;--d.work==0&&d.callback(d.images)};m.history.register(_$_INITIAL_HASH_$_,u);window.onunload=function(){r.emit(r,"Wt-unload");w()};this._p_={ieAlternative:l,loadScript:C,onJsLoad:M,setTitle:b,update:z,quit:U,setFormObjects:function(d){W=d},saveDownPos:x,addTimerEvent:V,load:f,handleResponse:v,setServerPush:o,dragStart:ca,dragDrag:g,dragEnd:Z,capture:m.capture,onHashChange:u,setHash:D,ImagePreloader:H,autoJavaScript:function(){_$_AUTO_JAVASCRIPT_$_()}, | false,ga=false,K=null,L=null,W=null,X=0,ha=false,Q=null,ba=null,ka=(new Date).getTime(),ia,ea=0,R={};H.prototype.preload=function(d){var c=new Image;this.images.push(c);c.onload=H.prototype.onload;c.onerror=H.prototype.onload;c.onabort=H.prototype.onload;c.imagePreloader=this;c.src=d};H.prototype.onload=function(){var d=this.imagePreloader;--d.work==0&&d.callback(d.images)};m.history.register(_$_INITIAL_HASH_$_,t);window.onunload=function(){q.emit(q,"Wt-unload");v()};this._p_={ieAlternative:l,loadScript:C, |
[],la=_$_RELATIVE_URL_$_,R=false,ja=false,ga=false,K=null,N=null,X=null,Y=0,ha=false,S=null,ca=null,ka=(new Date).getTime(),ia,ea=0,T={};D.prototype.preload=function(d){var c=new Image;this.images.push(c);c.onload=D.prototype.onload;c.onerror=D.prototype.onload;c.onabort=D.prototype.onload;c.imagePreloader=this;c.src=d};D.prototype.onload=function(){var d=this.imagePreloader;--d.work==0&&d.callback(d.images)};g.history.register(_$_INITIAL_HASH_$_,w);window.onunload=function(){E.emit(E,"Wt-unload"); s()};this._p_={ieAlternative:L,loadScript:Q,onJsLoad:J,setTitle:W,update:H,quit:P,setFormObjects:function(d){B=d},saveDownPos:x,addTimerEvent:I,load:ba,handleResponse:l,setServerPush:e,dragStart:Z,dragDrag:V,dragEnd:O,capture:g.capture,onHashChange:w,setHash:G,ImagePreloader:D,autoJavaScript:function(){_$_AUTO_JAVASCRIPT_$_()},response:q,setCloseMessage:C};this.WT=_$_WT_CLASS_$_;this.emit=y}),WtSignalEmit=_$_APP_CLASS_$_.emit;window.WtScriptLoaded=false; | [],la=_$_RELATIVE_URL_$_,R=false,ja=false,ga=false,J=null,N=null,X=null,Y=0,ha=false,S=null,ca=null,ka=(new Date).getTime(),ia,ea=0,T={};D.prototype.preload=function(d){var c=new Image;this.images.push(c);c.onload=D.prototype.onload;c.onerror=D.prototype.onload;c.onabort=D.prototype.onload;c.imagePreloader=this;c.src=d};D.prototype.onload=function(){var d=this.imagePreloader;--d.work==0&&d.callback(d.images)};g.history.register(_$_INITIAL_HASH_$_,w);window.onunload=function(){E.emit(E,"Wt-unload"); s()};this._p_={ieAlternative:L,loadScript:Q,onJsLoad:K,setTitle:W,update:H,quit:P,setFormObjects:function(d){B=d},saveDownPos:x,addTimerEvent:I,load:ba,handleResponse:l,setServerPush:e,dragStart:Z,dragDrag:V,dragEnd:O,capture:g.capture,onHashChange:w,setHash:G,ImagePreloader:D,autoJavaScript:function(){_$_AUTO_JAVASCRIPT_$_()},response:q,setCloseMessage:C};this.WT=_$_WT_CLASS_$_;this.emit=y}),WtSignalEmit=_$_APP_CLASS_$_.emit;window.WtScriptLoaded=false; | [],la=_$_RELATIVE_URL_$_,R=false,ja=false,ga=false,K=null,N=null,X=null,Y=0,ha=false,S=null,ca=null,ka=(new Date).getTime(),ia,ea=0,T={};D.prototype.preload=function(d){var c=new Image;this.images.push(c);c.onload=D.prototype.onload;c.onerror=D.prototype.onload;c.onabort=D.prototype.onload;c.imagePreloader=this;c.src=d};D.prototype.onload=function(){var d=this.imagePreloader;--d.work==0&&d.callback(d.images)};g.history.register(_$_INITIAL_HASH_$_,w);window.onunload=function(){E.emit(E,"Wt-unload");s()};this._p_={ieAlternative:L,loadScript:Q,onJsLoad:J,setTitle:W,update:H,quit:P,setFormObjects:function(d){B=d},saveDownPos:x,addTimerEvent:I,load:ba,handleResponse:l,setServerPush:e,dragStart:Z,dragDrag:V,dragEnd:O,capture:g.capture,onHashChange:w,setHash:G,ImagePreloader:D,autoJavaScript:function(){_$_AUTO_JAVASCRIPT_$_()},response:q,setCloseMessage:C};this.WT=_$_WT_CLASS_$_;this.emit=y}),WtSignalEmit=_$_APP_CLASS_$_.emit;window.WtScriptLoaded=false; |