PageSourceSearch

https://www.aiisen.org/global/javascript/common.js?v=20260909_20191008

js aiisen.org collected 2026-09-25 03:52:03 UTC 8,660 bytes, 429 lines download raw bytes

1function set_focus(d, el)
2{
3	if (!el)	// if form element not set - do nothing
4		return;
5
6	if ((x = findObj(e, d)) != null) {
7		if (x.focus)
8			x.focus();
9		if (x.select)
10			x.select();
11	}
12}
13
14function syn(s)
15{
16	if (!s || !s.options || !s.options.length)
17		return false;
18
19	if (s.options[s.options.length - 1].selected)
20		s.options[s.options.length - 1].selected = false;
21}
22
23function plesk_scroll(w)
24{
25	var nav = navigator.appName;
26	var ver = parseInt(navigator.appVersion);
27	if ((nav.indexOf('Netscape') != -1) && (ver == 4) && w.document.location.hash) {
28		var aname = w.document.location.hash.substr(1);
29		var an = w.document.anchors[aname];
30		if (an)
31			w.scrollTo(an.x, an.y);
32	}
33}
34
35function MM_reloadPage(init)	// reloads the window if Nav4 resized
36{
37	if (init == true)
38		with (navigator) {
39			if ((appName == 'Netscape') && (parseInt(appVersion) == 4)) {
40				document.MM_pgW = innerWidth;
41				document.MM_pgH = innerHeight;
42				onresize = MM_reloadPage;
43			}
44		}
45	else
46		if ((innerWidth != document.MM_pgW) || (innerHeight != document.MM_pgH))
47			location.reload();
48}
49
50function getButtonName(name)
51{
52    re = /^bname_([A-Za-z0-9-]+)$/;
53    return name.replace(re,"$1");
54}
55
56
57function isFramed()
58{
59	return !opt_no_frames && top.workFrame && top.leftFrame && top.topFrame;
60}
61
62function setActiveButtonByName(name)
63{
64	try {
65		return top.leftFrame.setActiveNode(name);
66	} catch (e) {
67		return false;
68	}
69}
70
71function setActiveButton(o)
72{
73	try {
74		return top.leftFrame.setActiveNode(o.id);
75	} catch (e) {
76		return false;
77	}
78}
79
80function setScrollInIE()
81{
82	try {
83		var navL = top.leftFrame.document.getElementById ('navArea');
84		top.leftFrame.document.body.scroll = (navL.clientHeight > top.leftFrame.document.documentElement.clientHeight || navL.clientWidth > top.leftFrame.document.documentElement.clientWidth) ? 'yes' : 'no';
85	} catch (e) {
86		return false;
87	}
88}
89
90//---------------------------------- redirect
91
92function go_to(href)
93{
94	return go_to_workframe(href);
95}
96
97function go_to_workframe(href)
98{
99	_go_to(isFramed() ? top.workFrame : this, href);
100}
101
102function refresh_leftframe()
103{
104	_refresh(top.leftFrame);
105}
106
107function go_to_leftframe(href)
108{
109	_go_to(top.leftFrame, href);
110}
111
112function refresh_topframe()
113{
114	_refresh(top.topFrame);
115}
116
117function go_to_topframe(href)
118{
119	_go_to(top.topFrame, href);
120}
121
122function go_to_top(href)
123{
124	_go_to(top, href);
125}
126
127function _refresh(target)
128{
129	try {
130		target.location.reload();
131	} catch (e) {
132		alert (e);
133	}
134}
135
136function _go_to(target, href)
137{
138	try {
139		target.location = href;
140	} catch (e) {
141	}
142}
143
144//---------------------------------- conhelp & help
145
146function SetConHelp(conhelp_name, direct)
147{
148	try {
149		return top.leftFrame._SetConHelp(conhelp_name, direct);
150	} catch (e) {
151		return false;
152	}
153}
154
155function SetContext(context)
156{
157	SetHelpModule('');
158
159	if (opt_integrated_mode && !opt_no_frames)
160		return top.SetContext(context)
161
162	try {!$
163		if (context)
164			top._context = context;
165	} catch (e) {
166		return false;
167	}
168
169	return SetConHelp();
170}
171
172function SetHelpModule(module)
173{
174	if (opt_integrated_mode && !opt_no_frames && top.SetHelpModule)
175		return top.SetHelpModule(module)
176
177	try {
178		top._help_module = module;
179	} catch (e) {
180		return false;
181	}
182
183	return true;
184}
185
186function GetContext()
187{
188	try {
189		return top._context;
190	} catch (e) {
191		return false;
192	}
193}
194
195function GetHelpPrefix()
196{
197	try {
198		return top._help_prefix;
199	} catch (e) {
200		return false;
201	}
202}
203
204function GetHelpModule()
205{
206	try {
207		return top._help_module;
208	} catch (e) {
209		return false;
210	}
211}
212
213function mouse_move(context, direct)
214{
215	if (!opt_integrated_mode || opt_no_frames) {
216		return SetConHelp(context, direct);
217	} else {
218		try {
219			return top.mouse_move(context);
220		} catch (e) {
221			return false;
222		}
223	}
224}
225
226function lon(target)
227{
228
229	try {
230		if (undefined == target)
231			target = this;
232
233		if (undefined == target._lon_disabled_arr)
234			target._lon_disabled_arr = new Array();
235		else if (target._lon_disabled_arr.length > 0)
236			return true;
237
238		target.document.getElementById("loaderContainer").style.display = "";
239		var select_arr = target.document.getElementsByTagName("select");
240
241		for (var i = 0; i < select_arr.length; i++) {
242			select_arr[i].disabled = true;
243			_lon_disabled_arr.pop(select_arr[i]);
244			var clone = target.document.createElement("input");
245			clone.type = "hidden";
246			clone.name = select_arr[i].name;
247			var values = new Array();
248			for (var n = 0; n < select_arr[i].length; n++) {
249				if (select_arr[i][n].selected) {
250					values[values.length] = select_arr[i][n].value;
251				}
252			}
253			clone.value = values.join(",");
254			select_arr[i].parentNode.insertBefore(clone, select_arr[i]);
255		}
256	} catch (e) {
257		return false;
258	}
259	return true;
260}
261
262function loff(target)
263{
264	try {
265		if (undefined == target)
266			target = this;
267
268		target.document.getElementById("loaderContainer").style.display = "none";
269		if (undefined == target._lon_disabled_arr)
270			return true;
271
272		for (;_lon_disabled_arr.legth > 0;) {
273			var select = _lon_disabled_arr.push();
274			select.disabled = false;
275
276			var clones_arr = target.document.getElementsByName(select.name);
277			for (var n = 0; n < clones_arr.length; n++) {
278				if ("hidden" == clones_arr[n].type)
279					clones_arr[n].parent.removeChild(clones_arr[n]);
280			}
281		}
282	} catch (e) {
283		return false;
284	}
285	return true;
286}
287
288/**
289 * Wrapper pour les appels ajax crossdomain.
290 * Sous IE 8 et 9 le post est transformé en GET (le comportement peu être changé mais je n'ai pas réussi a transmettres des paramètres en POST)  
291 * 
292 * @param method - POST or GET
293 * @param url - url to call
294 * @param params - data to send
295 * @param callback_success - callback on success
296 * @returns false on IE7 and less
297 */
298function crossDomainAjax(method, url, params, callback_success, callback_done)
299{
300	var isIE10Up = false;
301
302	// IE10
303	if (navigator.appVersion.indexOf("MSIE 10") !== -1)
304		isIE10Up = true;
305
306	// IE11
307	if (navigator.userAgent.indexOf("Trident") !== -1 && navigator.userAgent.indexOf("rv:11") !== -1)
308		isIE10Up = true;
309
310	// IE8 & 9 only Cross domain JSON GET request
311	if (!isIE10Up && 'XDomainRequest' in window && window.XDomainRequest !== null)
312	{
313        var xdr = new XDomainRequest(); // Use Microsoft XDR
314        xdr.open('GET', url + (url.indexOf('?') > 0 ? '&' : '?' ) + params);
315        xdr.onload = function () {
316			if (typeof callback_success == 'function')
317	            callback_success(); // internal function
318
319			if (typeof callback_done == 'function')
320				callback_done(); // internal function
321        };
322
323        xdr.onerror = function() {
324            _result = false;
325        };
326        xdr.ontimeout = function() {
327        	_result = false;
328        };
329
330        xdr.send();
331	}
332
333	// IE7 and lower can't do cross domain
334	else if (!isIE10Up && navigator.userAgent.indexOf('MSIE') != -1 && parseInt(navigator.userAgent.match(/MSIE ([\d.]+)/)[1], 10) < 8)
335	{
336		return false;
337	}
338
339	// Do normal jQuery AJAX for everything else
340	else {
341		$.support.cors = true;
342		$.ajax(
343				{
344					url: url,
345					type: method,
346					xhrFields: {withCredentials: true},
347					crossDomain: true,
348					data: params,
349					success : 
350						function (data)
351						{
352							if (typeof callback_success == 'function')
353								callback_success(data);
354						},
355					complete :
356						function (data)
357						{
358							if (typeof callback_done == 'function')
359								callback_done(data);
360						}
361				}
362			);
363    }
364    
365    return true;
366}
367
368
369
370/**
371* @return : js $_GET array
372*/
373
374function $_GET(param) {
375	var vars = {};
376	window.location.href.replace( location.hash, '' ).replace( 
377		/[?&]+([^=&]+)=?([^&]*)?/gi,
378		function( m, key, value ) {
379			vars[key] = value !== undefined ? value : '';
380		}
381	);
382
383	if ( param ) {
384		return vars[param] ? vars[param] : null;
385	}
386	return vars;
387}
388
389$( function(){
390	if( '1' === $_GET('mdp') && $('.fancyForgotPass').size()){
391		$('.fancyForgotPass').eq(0).trigger('click');
392	}
393})
394
395
396
397
398
399/* Forums */
400$( function() {
401	var trs = $('#groupe_forum,.groupe_forum_table').find('tr:visible').filter( function() {
402		return $.trim($(this).text()) != ''  ;
403	});
404	
405	Array.prototype.forEach.call( trs, child => {
406		var wrapper = document.createElement('div');
407		wrapper.classList.add('forum-row');
408		child.parentNode.insertBefore(wrapper, child);
409		
410		Array.prototype.forEach.call(child, td => {
411			td.classList.add('td-');
412		});
413		
414		wrapper.appendChild(child);
415	});
416});
417
418function copyToClipboard(elementId, imageId, text) {
419	const $temp = $("<input>");
420	$("body").append($temp);
421	console.log($('#' + elementId).text());
422	$temp.val($('#' + elementId).text()).select();
423	document.execCommand("copy");
424	const $image = $('#' + imageId);
425	$image.removeClass('fa-copy');
426	$image.addClass('fa-paste');
427	$image.find(">:first-child").text(text);
428	$temp.remove();
429}

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.