1function JCommentsEvents(){} 2function JCommentsInput(){} 3function JCommentsIndicator(){this.init();} 4function JCommentsForm(id,editor){this.init(id,editor);} 5function JCommentsEditor(textarea,resizable){this.init(textarea,resizable);} 6function JComments(oi,og,r){this.init(oi,og,r);} 7 8JCommentsEvents.prototype = { 9 add: function(o,e,f){if(o.addEventListener){o.addEventListener(e,f,false);return true;}else if(o.attachEvent){var r=o.attachEvent("on"+e,f);return r;}else{return false;}}, 10 remove: function(o,e,f){if(o.removeEventListener){o.removeEventListener(e,f,false);}else if(o.detachEvent){o.detachEvent( "on"+e,o[e+f] );o[e+f]=null;o["e"+e+f]=null;}}, 11 cancel: function(e){if(e.stopPropagation){e.cancelBubble=true;e.preventDefault();e.stopPropagation();}e.returnValue=false;return false;}, 12 target: function(e){var t;if(!e)e=window.event;if(e.target)t=e.target;else if(e.srcElement)t=e.srcElement;if(t.nodeType==3)t=t.parentNode;return t;} 13}; 14 15JCommentsInput.prototype = { 16 register: function(el){if(el){var th=this,events=new JCommentsEvents();events.add(el,'focus',function(e){return th.onFocus(e);});events.add(el,'blur',function(e){return th.onBlur(e);});}}, 17 unregister: function(el){if(el){var th=this,events=new JCommentsEvents();events.remove(el,'focus',function(e){return th.onFocus(e);});events.remove(el,'blur',function(e){return th.onBlur(e);});}}, 18 onFocus: function(e){var t=JCommentsEvents.prototype.target(e);if(t!=null){t.className=t.className.replace('error','')+' selected';}}, 19 onBlur: function(e){var t=JCommentsEvents.prototype.target(e);if(t!=null){var c=t.className.replace('error','');c=c.replace('error','');c=c.replace('selected','');t.className=c.replace(/^\s+/g,"");}} 20}; 21 22JCommentsEditor.prototype = { 23 ta: null, 24 l10n: {}, 25 tags: {}, 26 smiles: {}, 27 events: null, 28 counter: null, 29 focused: false, 30 resizable: true, 31 32 init: function(textareaID, r) { 33 this.ta=JComments.prototype.$(textareaID); 34 this.panelElements={}; 35 this.l10n={counterPre:'',counterPost:' symbols left',enterValue: 'Enter value'}; 36 this.resizable=r; 37 this.events=new JCommentsEvents(); 38 this.defaultHeight=this.ta.clientHeight; 39 this.defaultRows=this.ta.rows; 40 if(this.resizable){this.addGrippie();} 41 this.isWebkit=/webkit/.test(navigator.userAgent.toLowerCase()); 42 43 var th = this; 44 this.events.add(document,!window.opera&&document.all?'keydown':'keypress',function(e){return th.onKeyPress(e);}); 45 this.events.add(this.ta,'click',function(e){th.closeSmiles();return th.storeCaret(this.ta);}); 46 this.events.add(this.ta,'select',function(e){return th.storeCaret(this.ta);}); 47 this.events.add(this.ta,'change',function(e){th.onChange(); return th.storeCaret(this.ta);}); 48 this.events.add(this.ta,'keyup',function(e){return th.onChange();}); 49 this.events.add(this.ta,'focus',function(e){th.closeSmiles(); return th.focused=true;}); 50 this.events.add(this.ta,'blur',function(e){return th.focused=false;}); 51 }, 52 onKeyPress: function(e) { 53 if (!this.focused){return;} 54 var r=false,k=String.fromCharCode(e.keyCode?e.keyCode:e.charCode),t=null; 55 for(var id in this.tags){ 56 t=this.tags[id]; 57 if(!t.key||k.toUpperCase()!=t.key.toUpperCase())continue; 58 if(t.ctrl&&!e[t.ctrl+"Key"])continue; 59 this.insertTag(id); 60 return this.events.cancel(e); 61 } 62 return e.returnValue; 63 }, 64 defined: function(v){return (typeof(v)!="undefined");}, 65 clear: function(){this.ta.value='';if(this.defaultHeight){this.ta.style.height=this.defaultHeight+'px';}this.updateCounter();}, 66 focus: function(){this.ta.focus();}, 67 storeCaret: function(){var ta=this.ta;if(ta.createTextRange)ta.caretPos=document.selection.createRange().duplicate();}, 68 getElementPos: function(e){var p={left:0,top:0,right:0,bottom:0};while(e!=null){p.left+=e.offsetLeft;p.top+=e.offsetTop;e=e.offsetParent;}p.right+=p.left;p.bottom+=p.top;return p;}, 69 getSelection: function(){var ta=this.ta,s='';if(document.selection&&document.selection.createRange){s=document.selection.createRange().text;}else{s=ta.value.substr(ta.selectionStart,ta.selectionEnd-ta.selectionStart);}return s;}, 70 insertText: function(text) { 71 var ta=this.ta; 72 if(this.defined(ta.caretPos)&&ta.createTextRange){ta.focus();var sel=document.selection.createRange();sel.text=sel.text+text;ta.focus();} 73 else if(this.defined(ta.selectionStart)){ 74 var ss=ta.value.substr(0, ta.selectionStart); 75 var se=ta.value.substr(ta.selectionEnd),sp=ta.scrollTop; 76 ta.value=ss+text+se; 77 if(ta.setSelectionRange){ta.focus();ta.setSelectionRange(ss.length+text.length,ss.length+text.length);} 78 ta.scrollTop=sp; 79 } else {ta.value+=text;ta.focus(ta.value.length-1);} 80 }, 81 surroundText: function(t1,t2) { 82 var ta=this.ta; 83 if (this.defined(ta.caretPos) && ta.createTextRange){ 84 var cp=ta.caretPos,tl=cp.text.length; 85 cp.text=cp.text.charAt(cp.text.length-1)==' '?t1+cp.text+t2+' ':t1+cp.text+t2; 86 if(tl==0){cp.moveStart("character",-t2.length);cp.moveEnd("character",-t2.length);cp.select();} 87 else{ta.focus(cp);} 88 }else if(this.defined(ta.selectionStart)){ 89 var ss=ta.value.substr(0,ta.selectionStart),se=ta.value.substr(ta.selectionEnd); 90 var sl=ta.value.substr(ta.selectionStart,ta.selectionEnd-ta.selectionStart); 91 var nc=ta.selectionStart,sp=ta.scrollTop; 92 ta.value=ss+t1+sl+t2+se; 93 if(ta.setSelectionRange){ 94 if(sl.length==0){ta.setSelectionRange(nc+t1.length,nc+t1.length);} 95 else{ta.setSelectionRange(nc,nc+t1.length+sl.length+t2.length);} 96 ta.focus(); 97 } 98 ta.scrollTop=sp; 99 }else{ta.value+=t1+t2;ta.focus(ta.value.length-1);} 100 }, 101 insertTag: function(id) {var tag=this.tags[id],ta=this.ta,s='';if(!tag)return;s=this.getSelection();if(s.length>0){this.surroundText(tag.open,tag.close);}}, 102 initTags: function(){ 103 if (this.bbc==null||this.bbc.length==0){ 104 this.bbc={}; 105 this.bbc['b']={id:'bbcode-b',open:'[b]',close:'[/b]',key:'B',ctrl:'ctrl',hint:'Bold'}; 106 this.bbc['i']={id:'bbcode-i',open:'[i]',close:'[/i]',key:'I',ctrl:'ctrl',hint:'Italic'}; 107 this.bbc['u']={id:'bbcode-u',open:'[u]',close:'[/u]',key:'u',ctrl:'ctrl',hint:'Underline'}; 108 this.bbc['s']={id:'bbcode-s',open:'[s]',close:'[/s]',key:null,ctrl:null,hint:'Strikeout'}; 109 this.bbc['img']={id:'bbcode-img',open:'[img]',close:'[/img]',key:null,ctrl:null,hint:'Image'}; 110 this.bbc['url']={id:'bbcode-url',open:'[url]',close:'[/url]',key:null,ctrl:null,hint:'Link'}; 111 this.bbc['hide']={id:'bbcode-hide',open:'[hide]',close:'[/hide]',key:null,ctrl:null,hint:'Hidden'}; 112 this.bbc['quote']={id:'bbcode-quote',open:'[quote]',close:'[/quote]',key:'Q',ctrl:'ctrl',hint:'Quote'}; 113 this.bbc['list']={id:'bbcode-list',open:'[list][*]',close:'[/list]',key:'L',ctrl:'ctrl',hint:'List'}; 114 } 115 }, 116 117 createButton: function(i,t,c,f,img){ 118 var e;if(img==null||img==""){e=document.createElement('a');e.style.display='block';e.setAttribute('href','#');} 119 else{e=document.createElement('img');if(t){e.setAttribute('alt',t);}e.setAttribute('src',img);if(!c){c='custombbcode'};} 120 if(i){e.setAttribute('id',i);}if(t){e.setAttribute('title',t);}if(c){e.className=c;} 121 var ee=e;e.onclick=(f!=null?function(){f(ee); return false;}:function(){return false;}); 122 return e; 123 }, 124 125 addButton: function(id,h,p,ot,ct,css,img) { 126 if(this.ta){ 127 this.initTags();
128 var tag=this.bbc[id],th=this; 129 if(!tag){ 130 if(ot&&ct) { 131 this.bbc[id]={id:id,open:ot,close:ct,key:null,ctrl:null,hint:h}; 132 tag=this.bbc[id]; 133 } else { return; } 134 } 135 if(this.bbcPanel==null){ 136 this.bbcPanel=document.createElement('span'); 137 this.bbcPanel.className='bbcode'; 138 this.bbcPanel.style.display='block'; 139 this.ta.parentNode.insertBefore(this.bbcPanel,this.ta); 140 } 141 var f=function(){var s=th.getSelection();if(s.length>0){th.surroundText(tag.open,tag.close);}else{var v=prompt(p,'');if(null!=v && ''!=v){th.insertText(tag.open+v+tag.close);}}return false;}; 142 tag.e=this.createButton(tag.id,(h!=null?h:tag.hint),(css?css:tag.id),f,img); 143 this.bbcPanel.appendChild(tag.e); 144 this.tags[tag.id]=tag; 145 } 146 }, 147 148 initSmiles: function(p){this.smilesPath=p; 149 if(this.ta){ 150 this.smilesPanel=document.createElement('div'); 151 if(this.bbcPanel){ 152 document.body.appendChild(this.smilesPanel); 153 this.smilesPanel.id='comments-form-smilespanel'; 154 this.smilesPanel.setAttribute('style','display:none;top:0;left:0;position:absolute;'); 155 this.smilesPanel.onclick=function(){this.style.display='none';}; 156 var jc=this,f=function(e){ 157 var sp=jc.smilesPanel,p=jc.getElementPos(e); 158 if(sp){var sps=sp.style;sps.display=(sps.display=='none'||sps.display==''?'block':'none');sps.left=p.left+"px";sps.top=p.bottom+e.offsetHeight+"px";sps.zIndex=99;} 159 return false; 160 }; 161 this.bbcPanel.appendChild(this.createButton(null,null,'bbcode-smile',f)); 162 } else { 163 this.smilesPanel.className='smiles';this.ta.parentNode.insertBefore(this.smilesPanel, this.ta); 164 } 165 } 166 }, 167 closeSmiles: function(){if(this.smilesPanel&&this.bbcPanel){this.smilesPanel.style.display='none';}}, 168 169 addSmile: function(code,image){ 170 if(this.ta){ 171 if(!this.smilesPath||!this.smilesPanel){return;} 172 var th=this,e=document.createElement('img'); 173 e.setAttribute('src',this.smilesPath+'/'+image); 174 e.setAttribute('alt',code); 175 e.className='smile'; 176 e.onclick=function(){th.insertText(' '+code+' ');}; 177 this.smilesPanel.appendChild(e); 178 } 179 }, 180 addCounter: function(m,pre,post,className){ 181 if(this.ta){ 182 if(pre!=null){this.l10n.counterPre=pre;}if(post!=null){this.l10n.counterPost=post;} 183 var ch=document.createElement('span');ch.className=className!=null?className:''; 184 var t1=document.createTextNode(this.l10n.counterPre+' '),t2=document.createTextNode(' '+this.l10n.counterPost); 185 var c=document.createElement('span');ch.appendChild(t1);ch.appendChild(c);ch.appendChild(t2); 186 if(this.resizable){if(this.grippie!=null){this.grippie.appendChild(ch);}} 187 else{var d=document.createElement('div');d.className='counterpanel';this.ta.parentNode.insertBefore(d,this.ta.nextSibling);d.appendChild(ch);} 188 this.counter={e:c,max:m}; 189 this.updateCounter(); 190 } 191 }, 192 addGrippie: function() { 193 this.offset=null;this.dragging=false; 194 this.grippie=document.createElement('div');this.grippie.className='grippie'; 195 this.ta.parentNode.insertBefore(this.grippie,this.ta.nextSibling); 196 var th=this;this.events.add(this.grippie,'mousedown',function(e){return th.onMouseDown(e);}); 197 }, 198 updateCounter: function(){if(this.counter!=null){var ta=this.ta,e=this.counter.e;try{var n=document.createElement(e.tagName),v=this.counter.max-ta.value.length;n.innerHTML=(v>=0)?v:0;e.parentNode.replaceChild(n,e);this.counter.e=n;}catch(ex){}}}, 199 mousePosition: function(e){var px=0,py=0;if(!e){e=window.event;}if(e.pageX||e.pageY){px=e.pageX;py=e.pageY;}else if(e.clientX||e.clientY){px=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;py=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}return {x:px,y:py};}, 200 onChange: function(){this.updateCounter();if(this.ta&&!this.isWebkit){var l=this.ta.value.split('\n');this.ta.rows=(l.length<this.defaultRows)?this.defaultRows:l.length+1;}return false;}, 201 onMouseDown: function(e){this.offset=this.mousePosition(e).y;this.height=this.ta.clientHeight;this.dragging=true;var th=this;this.events.add(document,'mousemove',function(e){return th.onMouseMove(e);});this.events.add(document,'mouseup',function(e){return th.onMouseUp(e);});return false;}, 202 onMouseUp: function(e){this.dragging=false;}, 203 onMouseMove: function(e){if(this.dragging)this.ta.style.height=Math.max(this.defaultHeight, this.height+this.mousePosition(e).y-this.offset)+'px';return false;} 204}; 205 206JCommentsForm.prototype = { 207 id:null, 208 form: null, 209 events: null, 210 editor: null, 211 elements: {}, 212 store: new Array('name','email','homepage'), 213 fadeTimer: null, 214 215 init: function(id,editor){var f=this;this.id=id;this.form=this.$(id);this.editor=editor;this.events=new JCommentsEvents();this.setElements(new Array('name','email','homepage','title','comment'));this.restoreValues();this.setCaptcha();}, 216 setCaptcha: function(){this.captchaImage=this.$(this.id+'-captcha-image');this.register('captcha');}, 217 setEditor: function(e){this.editor=e;}, 218 setElements: function(e){for(i=0;i<e.length; i++){try{this.register(e[i]);}catch(e){}}}, 219 $:function(e){return JComments.prototype.$(e);}, 220 register: function(n){var f=this,e=this.$(this.id+'-'+n);if(e){this.elements[n]=e;JCommentsInput.prototype.register(e);this.events.add(e,!window.opera&&document.all?'keydown':'keypress',function(e){return f.keypress(e);});}}, 221 message: function(m,c){ 222 clearTimeout(this.fadeTimer);var fe=this.$('comments-form-message'); 223 if(!fe){fe=JComments.prototype.createElement('div','comments-form-message',''); 224 if(this.form){JComments.prototype.moveElement(fe,this.form,this.form.firstChild);}else{return;}} 225 if(!c){c='info';}fe.className='comments-form-message-'+c; 226 fe.innerHTML=m; fe.style.display='block';JComments.prototype.setOpacity(fe.id,100); 227 this.fadeTimer=setTimeout(function(){JComments.prototype.fade('comments-form-message', 100, 0, 1000);}, 3000); 228 }, 229 error: function(m,n,c){var e=this.elements[n];if(e){e.focus();e.className='error';if(c)e.value='';}this.message(m,'error');}, 230 clear: function(n){ 231 if(n==null){if(this.form!=null){this.form.reset();}return;} 232 switch(n){ 233 case 'comment':if(this.editor!=null){this.editor.clear();}break; 234 case 'captcha':var cim=this.captchaImage,cin=this.elements['captcha'];if(cim){cim.src=cim.src.replace(/&ac=\d+/g, '&ac='+new String(Math.floor(Math.random()*100000)));}if(cin){cin.value='';}break; 235 default:var e=this.elements[n];if(e){e.value='';}break; 236 } 237 }, 238 focus:function(n){var e;if(n==null){for(var nm in this.elements){e=this.elements[nm];if(e){e.focus();break;}}}else{e=this.elements[n];if(e){e.focus();}}}, 239 keypress: function(e){if(e.ctrlKey &&(e.keyCode==13||(e.type=='keypress'&&e.keyCode==10))){this.submit();e.returnValue=false;return this.events.cancel(e);}return this.keypressed(e);}, 240 add: function(n,i,v){if(this.form!=null){var e=document.createElement('input');e.setAttribute('type', 'hidden');e.setAttribute('name', n);e.setAttribute('id', i);e.setAttribute('value', v);this.form.appendChild(e);}}, 241 remove: function(i){var e=this.$(i);if(e){e.value=0;e.parentNode.removeChild(e);}}, 242 setText: function(n,t){if(n=='comment'){if(this.editor!=null){this.editor.clear();this.editor.insertText(t);}}else{var e=this.elements[n];if(e){e.value=t;}}}, 243 insertText: function(n,t){if(n=='comment'){if(this.editor!=null){this.editor.insertText(t);}}else{var e=this.elements[n];if(e){e.value+=t;}}}, 244 storeValues: function(){for(var i=0;i<this.store.length; i++){try{var el=JComments.prototype.$(this.id+'-'+this.store[i]);if(el){JComments.prototype.setCookie(this.store[i],encodeURIComponent(el.value),14);}}catch(e){}}}, 245 restoreValues: function(){for(var i=0;i<this.store.length; i++){try{var el=JComments.prototype.$(this.id+'-'+this.store[i]);if(el){el.value=decodeURIComponent(JComments.prototype.getCookie(this.store[i]));}}catch(e){}}}, 246 submit: function(){}, 247 keypressed: function(e){} 248}; 249 250JCommentsIndicator.prototype = { 251 e: null, 252 init: function(){if(this.e==null){this.e=document.createElement('div');this.e.className='busy';}}, 253 move: function(p,b){if(p){if(this.e.parentNode){this.e.parentNode.removeChild(this.e);}if(b){p.insertBefore(this.e,b);}else{p.appendChild(this.e);}}}, 254 show: function(){this.e.style.display='block';}, 255 hide: function(){this.e.style.display='none';}, 256 start: function(p,b){this.move(p,b);this.show();}, 257 stop: function(){this.hide();} 258}; 259 260JComments.prototype = { 261 262 oi:null, 263 og:null, 264 debug: false, 265 requestURI: '', 266 oldRequestURI: '', 267 busy: null, 268 form: null, 269 cache: {}, 270 mode:'add', 271 readyList: [], 272 isReady: false, 273 274 init: function(oi,og,r){var ua=navigator.userAgent.toLowerCase();this.browser={safari: /webkit/.test(ua),opera: /opera/.test(ua),msie: /msie/.test(ua) && !(/opera/.test(ua)),mozilla: /mozilla/.test(ua) && !(/(compatible|webkit)/.test(ua))};this.oi=oi;this.og=og;this.busy=new JCommentsIndicator(); 275 var h=location.hostname,d,i1,i2;i1=r.indexOf('://');if(i1!=-1){i2=r.indexOf('/',i1+3);if(i2!=-1){d=r.substring(i1+3,i2);if(d!=h){r=r.replace(d,h);}}}this.requestURI=r;var th=this;jtajax.startLoading=function(){th.busy.show();};jtajax.finishLoading=function(){th.busy.hide();};}, 276 setForm: function(f){this.form=f;this.form_id=f.id;this.setMode('add',null);var jc=this;this.form.submit=function(){jc.saveComment();};this.form.keypressed=function(e){if(e.keyCode==27&&jc.mode=='reply'){jc.restoreForm(false);}};this.formLoaded();}, 277 setList: function(l){this.list_id=l;}, 278 setMode: function(m,i){var b=this.$('comments-form-cancel'),jc=this;if(b!=null){b.style.display=(m!='add')?'':'none';b.onclick=(m=='edit'?function(){jc.cancelEdit(i);}:(m=='reply'?function(){jc.cancelReply();}:null));}this.mode=m;}, 279 $: function(id){if(!id){return null;}var e=document.getElementById(id);if(!e&&document.all){e=document.all[id];}return e;}, 280 ajax: function(f,a,fid){var r,prevURI;try{prevURI=jtajax.options.url;jtajax.setup({url:this.requestURI});r=jtajax.call(f,a,'post',fid);jtajax.options.url=prevURI;}catch(e){jtajax.options.url=prevURI;}return r;}, 281 initOnReady : function(){if(this.isReadyInited) return;this.isReadyInited=1;var jc=this; 282 if(this.browser.mozilla||this.browser.opera){JCommentsEvents.prototype.add(document, 'DOMContentLoaded',jc.ready);} 283 else if(this.browser.msie) {(function(){try{document.documentElement.doScroll('left');}catch(e){setTimeout(arguments.callee, 50);return;}jc.ready();})();} 284 else if(this.browser.safari){(function(){if(jc.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}jc.ready();})();} 285 JCommentsEvents.prototype.add(window, 'load', function(){jc.ready(jc);}); 286 }, 287 onReady: function(f){if(this.isReady){f();}else{var jc=this;
287jc.readyList.push(f);jc.initOnReady();}}, 288 ready: function(){var jc=window.jcomments;if(jc.isReady||jc.readyList==null) return;jc.isReady=1;for(var i=0,len=jc.readyList.length;i<len;i++){try{jc.readyList[i]();}catch(e){}}jc.readyList=null;}, 289 setAntiCache: function(c,p,f){this.aca=c;this.acp=p;this.acf=f;this.onReady(this.loadComments);}, 290 loadComments: function(){var jc=window.jcomments;var l=document.location.href,lc=true,i=l.lastIndexOf('#comment-');jc.clear('captcha');if(jc.aca){if(i!=0){var c=l.substring(i+9,l.length);if(!isNaN(c)){lc=false;jc.showComment(c);}}}if(jc.acp){if(lc==true){jc.showPage(jc.oi,jc.og,0);}}if(jc.acf){if(l.lastIndexOf('#addcomment')!=-1){jc.showForm(jc.oi,jc.og,'comments-form-link');}}}, 291 setCookie: function(n,v,d){var e='';if(d){var dt=new Date();dt.setTime(dt.getTime()+(d*24*60*60*1000));e="; expires="+dt.toGMTString();}document.cookie = "jc_"+n+"="+v+e+"; path=/";}, 292 getCookie: function(n){var re=new RegExp( "(\;|^)[^;]*(" + "jc_"+n + ")\=([^;]*)(;|$)" );var r=re.exec(document.cookie);return r != null ? r[3] : '';}, 293 removeCookie: function(n){this.setCookie(n,"",-1);}, 294 scrollTo: function(n){if(n!=null){var e=this.$(n);if(e){t=e.offsetTop;for(var p=e.offsetParent;p;p=p.offsetParent){t+=p.offsetTop;}scrollTo(0,t);}}}, 295 scrollToList: function(){this.scrollTo(this.list_id);}, 296 scrollToForm: function(id){this.scrollTo(this.form_id);}, 297 scrollToComment: function(id){this.scrollTo('comment-'+id);}, 298 moveElement: function(e,p,b){if(e){if(p){if(e.parentNode){e.parentNode.removeChild(e);}if(b){p.insertBefore(e,b);}else{p.appendChild(e);}}}}, 299 createElement: function(t,i,c){var e=document.createElement(t);if(i){e.setAttribute('id',i);}if(c){e.className=c;}return e;}, 300 fade: function(id,s,e,m){var speed=Math.round(m/100),timer=0;if(s>e){for(i=s;i>=e;i--){setTimeout("JComments.prototype.setOpacity('"+id+"',"+i+")",(timer*speed));timer++;}var o=JComments.prototype.$(id);if(o){setTimeout(function(){o.style.display='none';},((s-e)*speed));}}else if(s<e){for(i=s;i<=e;i++){setTimeout("JComments.prototype.setOpacity('"+id+"',"+i+")",(timer*speed));timer++;}}}, 301 setOpacity: function(id,opacity){var e=this.$(id);if(e){var s=e.style;s.opacity=(opacity/100);s.MozOpacity=(opacity/100);s.KhtmlOpacity=(opacity / 100);s.filter="alpha(opacity="+opacity+")";}}, 302 error:function(m,n,c){if(this.form!=null){this.form.error(m,n,c);}}, 303 message:function(m,c){if(this.form!=null){this.form.message(m,'info');}}, 304 clear:function(n){if(this.form!=null){this.form.clear(n);}}, 305 insertText:function(t){if(this.form!=null){this.form.insertText('comment',t);}else{var jc=this;window.setTimeout(function(){jc.insertText(t);},500);return;}}, 306 busyList: function(){if(this.list_id){var l=this.$(this.list_id);if(l){this.busy.move(l.parentNode,l);}}}, 307 busyForm: function(){if(this.form_id){var f=this.$(this.form_id);if(f){this.busy.move(f.parentNode,f);}}}, 308 busyComment: function(i){this.busy.move(this.$('comment-item-'+i),null);}, 309 saveComment: function(i){var f='';if(this.mode!='edit'){f='JCommentsAddComment';this.busyForm();if(this.form){this.form.storeValues();}this.busy.show();}else{f='JCommentsSaveComment';this.busy.show();}return this.ajax(f,null, this.form_id);}, 310 editComment: function(i){this.busyComment(i);var a=arguments;if(this.form==null){a=new Array(i,1);}return this.ajax('JCommentsEditComment', a);}, 311 cancelEdit: function(i){if((!this.cache[i])||(this.cache[i]=='')){this.$('comment-body-'+i).innerHTML=this.cache[i];this.cache[i]='';}if(this.form){this.form.remove('comment-id-hidden-'+i);this.restoreForm(true);}var t=this.$('comment-toolbar-'+i);if(t){t.style.display='';}return this.ajax('JCommentsCancelComment',arguments);}, 312 cancelReply: function(){if(this.form){this.form.remove('comment-parent-id-hidden');this.restoreForm(false);}}, 313 quoteComment: function(i){var a=arguments;if(this.form==null){a=new Array(i,1);}return this.ajax('JCommentsQuoteComment',a);}, 314 publishComment: function(i){if(this.form){this.restoreForm();}this.busyComment(i); return this.ajax('JCommentsPublishComment',arguments);}, 315 deleteComment: function(i){this.busyComment(i); return this.ajax('JCommentsDeleteComment',arguments);}, 316 jump2email: function(i){return this.ajax('JCommentsJump2email',arguments);}, 317 updateList: function(t,m){if(this.list_id){var l=this.$(this.list_id);if(!l){l=this.$('comments');m='a';}switch(m){case 'a':l.innerHTML=l.innerHTML+t;break;case 'p':l.innerHTML=t+l.innerHTML;break;case 'r':l.parentNode.innerHTML=t;break;}}}, 318 updateTree: function(t,r){var l;if(r==null){l=this.$('comments');if(l){l.innerHTML=t;}return;}l=this.$('comments-list-'+r);if(!l){var p=this.$('comment-item-'+r);if(p){this.busyComment(r);l=this.createElement('div','comments-list-'+r,'comments-list');l.innerHTML=t;p.parentNode.insertBefore(l,p.nextSibling);}}
318else{l.innerHTML=l.innerHTML+t;}this.restoreForm(true);}, 319 updateComment: function(id,t){if(t==''){var c=this.$('comment-item-'+id);c.parentNode.removeChild(c);var l=this.$('comments-list-'+id);if(l){l.parentNode.removeChild(l);} return;}this.$('comment-body-'+id).innerHTML=t;var te=this.$('comment-toolbar-'+id);if(te){te.style.display='';}if(this.form){this.form.remove('comment-id-hidden-'+id);this.restoreForm(true);}}, 320 voteComment: function(i){var v=this.$('comment-vote-holder-'+i);if(v){v.innerHTML='';this.busy.start(v,null);}return this.ajax('JCommentsVoteComment',arguments);}, 321 updateVote: function(i,t){this.busy.stop();var c=this.$('comment-vote-holder-'+i);if(c){c.innerHTML=t;}}, 322 showComment: function(id){return this.ajax('JCommentsShowComment',arguments);}, 323 showPage: function(i,g,p){if(this.form){this.restoreForm();}var l=this.$(this.list_id);if(!l){l=this.$(this.list_id+'-0');if(l){this.list_id=this.list_id+'-0';}}this.busyList();return this.ajax('JCommentsShowPage',arguments);}, 324 showForm: function(i,g,t){if(this.form){this.moveElement(this.form.form,this.$(t));return;}this.busyForm(); return this.ajax('JCommentsShowForm',arguments);}, 325 showEdit: function(id,n,e,h,t,txt){ 326 var jc=this; 327 if(this.form==null){window.setTimeout(function(){jc.showEdit(id,n,e,h,t,txt);},500);return;} 328 if((!this.cache[id])||(this.cache[id]=='')){this.cache[id]=this.$('comment-body-'+id).innerHTML;} 329 this.busy.stop(); 330 var f=this.form,ff=this.form.form,c=this.$('comment-item-'+id); 331 if(ff!=null&&c!=null){ 332 f.add('id','comment-id-hidden-'+id,id);f.setText('name', n);f.setText('email', e);f.setText('homepage', h);f.setText('title', t);f.setText('comment', txt); 333 var d=this.$('comments-inline-edit'); 334 if(d){d.parentNode.removeChild(d);}else{d=this.createElement('div','comments-inline-edit','comments-inline-edit');}c.appendChild(d);this.moveElement(ff,d); 335 this.setMode('edit',id);var te=this.$('comment-toolbar-'+id);if(te){te.style.display='none';} 336 this.scrollTo('comments-inline-edit'); 337 this.form.focus('comment'); 338 } 339 }, 340 showReply: function(id,q){ 341 this.busyComment(id); 342 var jc=this,c=this.$('comment-item-'+id),d=this.$('comments-inline-edit'); 343 if(d){d.parentNode.removeChild(d);}else{d=this.createElement('div','comments-inline-edit','comments-inline-edit');}c.appendChild(d); 344 if(!this.form){ 345 var t='comments-inline-edit',h=this.$('comments-form-link');if(h){t='comments-form-link';} 346 this.showForm(this.oi, this.og,t);var pid=id;this.formLoaded=function(){var f=jc.form;if(f!=null){f.add('parent','comment-parent-id-hidden',pid);}jc.setMode('reply',pid);jc.moveElement(jc.form.form,jc.$('comments-inline-edit'));jc.form.focus();if(q){jc.quoteComment(id);}}; 347 }else{ 348 var f=this.form,ff=this.form.form,p=this.$('comment-parent-id-hidden'); 349 if(ff!=null&&c!=null){if(!p){f.add('parent','comment-parent-id-hidden',id);}else{p.value=id;}this.moveElement(ff,d);this.setMode('reply',id);this.form.focus();if(q){this.quoteComment(id);}} 350 } 351 }, 352 formLoaded: function(){}, 353 restoreForm: function(c){var f=this.form;if(f!=null){var ff=this.form.form,jc=this;this.busy.stop(); 354 if(ff!=null){if(c){f.clear(null);}f.restoreValues();var a=this.$('addcomments'),p=this.$('comment-parent-id-hidden');if(p){p.value=0;} 355 this.moveElement(ff,a.parentNode,a);var d=this.$('comments-inline-edit');if(d){d.parentNode.removeChild(d);}this.setMode('add',null);} 356 }}, 357 358 subscribe: function(o,g){return this.ajax('JCommentsSubscribe',arguments);}, 359 unsubscribe: function(o,g){return this.ajax('JCommentsUnsubscribe',arguments);}, 360 updateSubscription: function(m,t){var e=this.$('comments-subscription');if(e){var jc=this;e.innerHTML=t;e.onclick=m?function(){jc.unsubscribe(jc.oi,jc.og);return false;}:function(){jc.subscribe(jc.oi,jc.og);return false;};e.blur();}}, 361 go: function(l){window.open(l);return;} 362}; 363
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.