PageSourceSearch

https://la15nord.com/components/com_jcomments/js/jcomments-v2.0.js

js la15nord.com collected 2026-10-04 02:09:05 UTC 26,433 bytes, 361 lines download raw bytes

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){t.className=t.className.replace('error','').replace('selected').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){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){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
103	initTags: function(){
104		if (this.bbc==null||this.bbc.length==0){
105			this.bbc={};
106			this.bbc['b']={id:'bbcode-b',open:'[b]',close:'[/b]',key:'B',ctrl:'ctrl',hint:'Bold'};
107			this.bbc['i']={id:'bbcode-i',open:'[i]',close:'[/i]',key:'I',ctrl:'ctrl',hint:'Italic'};
108			this.bbc['u']={id:'bbcode-u',open:'[u]',close:'[/u]',key:'u',ctrl:'ctrl',hint:'Underline'};
109			this.bbc['s']={id:'bbcode-s',open:'[s]',close:'[/s]',key:null,ctrl:null,hint:'Strikeout'};
110			this.bbc['img']={id:'bbcode-img',open:'[img]',close:'[/img]',key:null,ctrl:null,hint:'Image'};
111			this.bbc['url']={id:'bbcode-url',open:'[url]',close:'[/url]',key:null,ctrl:null,hint:'Link'};
112			this.bbc['hide']={id:'bbcode-hide',open:'[hide]',close:'[/hide]',key:null,ctrl:null,hint:'Hidden'};
113			this.bbc['quote']={id:'bbcode-quote',open:'[quote]',close:'[/quote]',key:'Q',ctrl:'ctrl',hint:'Quote'};
114			this.bbc['list']={id:'bbcode-list',open:'[list][*]',close:'[/list]',key:'L',ctrl:'ctrl',hint:'List'};
115		}
116	},
117
118	createButton: function(i,t,c,f){
119		var e=document.createElement('a');e.style.display='block';e.setAttribute('href','#');
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) {
126		if(this.ta){
127			this.initTags();
128			var tag=this.bbc[id],th=this;
129			if(!tag){return;}
130        	        if(this.bbcPanel==null){
131				this.bbcPanel=document.createElement('span');
132		       		this.bbcPanel.className='bbcode';
133		       		this.bbcPanel.style.display='block';
134				this.ta.parentNode.insertBefore(this.bbcPanel,this.ta);
135	                }
136	                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;};
137	                tag.e=this.createButton(tag.id,(h!=null?h:tag.hint),tag.id,f);
138       			this.bbcPanel.appendChild(tag.e);
139       			this.tags[tag.id]=tag;
140		}
141	},
142
143	initSmiles: function(p){this.smilesPath=p;
144		if(this.ta){
145        	        this.smilesPanel=document.createElement('div');this.smilesPanel.className=this.bbcPanel?'smilespanel':'smiles';
146			if(this.bbcPanel){
147	        	        this.smilesPanel.setAttribute('style','display: none;');
148				this.smilesPanel.onclick=function(){this.style.display='none';};
149				var jc=this,f=function(e){
150					var sp=jc.smilesPanel,p=jc.getElementPos(e);
151					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;}
152					return false;
153				};
154       				this.bbcPanel.appendChild(this.createButton(null,null,'bbcode-smile',f));
155			}
156        	        this.ta.parentNode.insertBefore(this.smilesPanel, this.bbcPanel?this.bbcPanel:this.ta);
157		}
158	},
159
160	addSmile: function(code,image){
161		if(this.ta){
162			if(!this.smilesPath||!this.smilesPanel){return;}
163       			var th=this,e=document.createElement('img');
164       			e.setAttribute('src',this.smilesPath+'/'+image);
165       			e.setAttribute('alt',code);
166       			e.className='smile';
167	       		e.onclick=function(){th.insertText(' '+code+' ');};
168       			this.smilesPanel.appendChild(e);
169		}
170	},
171	addCounter: function(m,pre,post,className){
172		if(this.ta){
173			if(pre!=null){this.l10n.counterPre=pre;}if(post!=null){this.l10n.counterPost=post;}
174			var ch=document.createElement('span');ch.className=className!=null?className:'';
175			var t1=document.createTextNode(this.l10n.counterPre+' '),t2=document.createTextNode(' '+this.l10n.counterPost);
176			var c=document.createElement('span');ch.appendChild(t1);ch.appendChild(c);ch.appendChild(t2);
177			if(this.resizable){if(this.grippie!=null){this.grippie.appendChild(ch);}}
178			else{var d=document.createElement('div');d.className='counterpanel';this.ta.parentNode.insertBefore(d,this.ta.nextSibling);d.appendChild(ch);}
179			this.counter={e:c,max:m};
180			this.updateCounter();
181		}
182	},
183	addGrippie: function() {
184		this.offset=null;this.dragging=false;
185		this.grippie=document.createElement('div');this.grippie.className='grippie';
186		this.ta.parentNode.insertBefore(this.grippie,this.ta.nextSibling);
187	        var th=this;this.events.add(this.grippie,'mousedown',function(e){return th.onMouseDown(e);});
188	},
189	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){}}},
190	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};},
191	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;},
192	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;},
193	onMouseUp: function(e){this.dragging=false;},
194	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;}
195};
196
197JCommentsForm.prototype = {
198	id:null,
199	form: null,
200	events: null,
201	editor: null,
202	elements: {},
203	store: new Array('name','email','homepage'),
204	fadeTimer: null,
205
206	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','comment'));this.restoreValues();this.setCaptcha();},
207	setCaptcha: function(){this.captchaImage=this.$(this.id+'-captcha-image');this.register('captcha');},
208	setEditor: function(e){this.editor=e;},
209	setElements: function(e){for(i=0;i<e.length; i++){try{this.register(e[i]);}catch(e){}}},
210	$:function(e){return JComments.prototype.$(e);},
211	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);});}},
212	message: function(m,c){
213		clearTimeout(this.fadeTimer);var fe=this.$('comments-form-message');
214		if(!fe){fe=JComments.prototype.createElement('div','comments-form-message','');
215		if(this.form){JComments.prototype.moveElement(fe,this.form,this.form.firstChild);}else{return;}}
216		if(!c){c='info';}fe.className='comments-form-message-'+c;
217		fe.innerHTML=m;	fe.style.display='block';JComments.prototype.setOpacity(fe.id,100);
218		this.fadeTimer=setTimeout(function(){JComments.prototype.fade('comments-form-message', 100, 0, 1000);}, 3000);
219	},
220	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');},
221	clear: function(n){
222		if(n==null){if(this.form!=null){this.form.reset();}return;}
223		switch(n){
224			case 'comment':if(this.editor!=null){this.editor.clear();}break;
225			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;
226			default:var e=this.elements[n];if(e){e.value='';}break;					
227		}
228	},
229	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();}}},
230	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);},
231	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);}},
232	remove: function(i){var e=this.$(i);if(e){e.value=0;e.parentNode.removeChild(e);}},
233	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;}}},
234	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;}}},
235	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){}}},
236	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){}}},
237	submit: function(){},
238	keypressed: function(e){}
239};
240
241JCommentsIndicator.prototype = {
242	e: null,
243	init: function(){if(this.e==null){this.e=document.createElement('div');this.e.className='busy';}},
244	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);}}},
245	show: function(){this.e.style.display='block';},
246	hide: function(){this.e.style.display='none';},
247	start: function(p,b){this.move(p,b);this.show();},
248	stop: function(){this.hide();}
249};
250
251JComments.prototype = {
252
253        oi:null,
254        og:null,
255        debug: false,
256	requestURI: '',
257	oldRequestURI: '',
258	busy: null,
259	form: null,
260	cache: {},
261	mode:'add',
262	readyList: [],
263	isReady: false,
264
265	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();this.requestURI=r;var th=this;jtajax.startLoading=function(){th.busy.show();};jtajax.finishLoading=function(){th.busy.hide();};},
266	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();},
267	setList: function(l){this.list_id=l;},
268	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;},
269	$: function(id){if(!id){return null;}var e=document.getElementById(id);if(!e&&document.all){e=document.all[id];}return e;},
270	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;},
271
272	initOnReady : function(){if(this.isReadyInited) return;this.isReadyInited=1;var jc=this;
273	      	if(this.browser.mozilla||this.browser.opera){JCommentsEvents.prototype.add(document, 'DOMContentLoaded',jc.ready);}
274        	else if(this.browser.msie) {(function(){try{document.documentElement.doScroll('left');}catch(e){setTimeout(arguments.callee, 50);return;}jc.ready();})();}
275        	else if(this.browser.safari){(function(){if(jc.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}jc.ready();})();}
276         	JCommentsEvents.prototype.add(window, 'load', function(){jc.ready(jc);});
277	},
278
279	onReady: function(f){if(this.isReady){f();}else{var jc=this;
279jc.readyList.push(f);jc.initOnReady();}},
280	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;},
281	
282	setAntiCache: function(c,p,f){this.aca=c;this.acp=p;this.acf=f;this.onReady(this.loadComments);},
283	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');}}},
284
285	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=/";},
286	getCookie: function(n){var re=new RegExp( "(\;|^)[^;]*(" + "jc_"+n + ")\=([^;]*)(;|$)" );var r=re.exec(document.cookie);return r != null ? r[3] : '';},
287	removeCookie: function(n){this.setCookie(n,"",-1);},
288
289	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);}}},
290	scrollToList: function(){this.scrollTo(this.list_id);},
291	scrollToForm: function(id){this.scrollTo(this.form_id);},
292	scrollToComment: function(id){this.scrollTo('comment-'+id);},
293
294	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);}}}},
295	createElement: function(t,i,c){var e=document.createElement(t);if(i){e.setAttribute('id',i);}if(c){e.className=c;}return e;},
296
297	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++;}}},
298	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+")";}},
299	error:function(m,n,c){if(this.form!=null){this.form.error(m,n,c);}},
300	message:function(m,c){if(this.form!=null){this.form.message(m,'info');}},
301	clear:function(n){if(this.form!=null){this.form.clear(n);}},
302	insertText:function(t){if(this.form!=null){this.form.insertText('comment',t);}else{var jc=this;window.setTimeout(function(){jc.insertText(t);},500);return;}},
303
304	busyList: function(){if(this.list_id){var l=this.$(this.list_id);if(l){this.busy.move(l.parentNode,l);}}},
305	busyForm: function(){if(this.form_id){var f=this.$(this.form_id);if(f){this.busy.move(f.parentNode,f);}}},
306	busyComment: function(i){this.busy.move(this.$('comment-item-'+i),null);},
307
308	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);},
309	editComment: function(i){this.busyComment(i);var a=arguments;if(this.form==null){a=new Array(i,1);}return this.ajax('JCommentsEditComment', a);},
310	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);},
311	cancelReply: function(){if(this.form){this.form.remove('comment-parent-id-hidden');this.restoreForm(false);}},
312	quoteComment: function(i){var a=arguments;if(this.form==null){a=new Array(i,1);}return this.ajax('JCommentsQuoteComment',a);},
313	publishComment: function(i){if(this.form){this.restoreForm();}this.busyComment(i); return this.ajax('JCommentsPublishComment',arguments);},
314	deleteComment: function(i){this.busyComment(i); return this.ajax('JCommentsDeleteComment',arguments);},
315	jump2email: function(i){return this.ajax('JCommentsJump2email',arguments);},
316	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;}}},
317	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);}}
317else{l.innerHTML=l.innerHTML+t;}this.restoreForm(true);},
318	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);}},
319	voteComment: function(i){var v=this.$('comment-vote-holder-'+i);if(v){v.innerHTML='';this.busy.start(v,null);}return this.ajax('JCommentsVoteComment',arguments);},
320	updateVote: function(i,t){this.busy.stop();var c=this.$('comment-vote-holder-'+i);if(c){c.innerHTML=t;}},
321	showComment: function(id){return this.ajax('JCommentsShowComment',arguments);},
322	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);},
323	showForm: function(i,g,t){if(this.form){this.moveElement(this.form.form,this.$(t));return;}this.busyForm(); return this.ajax('JCommentsShowForm',arguments);},
324	showEdit: function(id,n,e,h,t){
325		var jc=this;
326	        if(this.form==null){window.setTimeout(function(){jc.showEdit(id,n,e,h,t);},500);return;}
327		if((!this.cache[id])||(this.cache[id]=='')){this.cache[id]=this.$('comment-body-'+id).innerHTML;}
328		this.busy.stop();
329		var f=this.form,ff=this.form.form,c=this.$('comment-item-'+id);
330		if(ff!=null&&c!=null){
331			f.add('id','comment-id-hidden-'+id,id);f.setText('name', n);f.setText('email', e);f.setText('homepage', h);f.setText('comment', t);
332			var d=this.$('comments-inline-edit');
333			if(d){d.parentNode.removeChild(d);}else{d=this.createElement('div','comments-inline-edit','comments-inline-edit');}c.appendChild(d);this.moveElement(ff,d);
334			this.setMode('edit',id);var te=this.$('comment-toolbar-'+id);if(te){te.style.display='none';}
335			this.scrollTo('comments-inline-edit');
336			this.form.focus('comment');
337		}
338	},
339	showReply: function(id,q){
340		this.busyComment(id);
341		var jc=this,c=this.$('comment-item-'+id),d=this.$('comments-inline-edit');
342		if(d){d.parentNode.removeChild(d);}else{d=this.createElement('div','comments-inline-edit','comments-inline-edit');}c.appendChild(d);
343		if(!this.form){
344			var t='comments-inline-edit',h=this.$('comments-form-link');if(h){t='comments-form-link';}
345			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);}};
346		}else{
347			var f=this.form,ff=this.form.form,p=this.$('comment-parent-id-hidden');
348			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);}}
349		}
350	},
351	formLoaded: function(){},
352	restoreForm: function(c){var f=this.form;if(f!=null){var ff=this.form.form,jc=this;this.busy.stop();
353		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;}
354		this.moveElement(ff,a.parentNode,a);var d=this.$('comments-inline-edit');if(d){d.parentNode.removeChild(d);}this.setMode('add',null);}
355	}},
356
357	subscribe: function(o,g){return this.ajax('JCommentsSubscribe',arguments);},
358	unsubscribe: function(o,g){return this.ajax('JCommentsUnsubscribe',arguments);},
359	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();}},
360	go: function(l){window.open(l);return;}
361};

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.