PageSourceSearch

https://haugness.be/webacappella_tools.js?v=blf

js haugness.be collected 2026-10-03 02:27:14 UTC 9,329 bytes, 264 lines download raw bytes

1//hack
2//waJSQuery est utilisé par WA pa la place de jQuery pour eviter tout conflit avec des scripts externe
3//webacappella_tools.js est utilisé en meme temps par les sites WA et pour l'admin
4try
5{
6	if (waJSQuery==undefined)
7	{
8		waJSQuery = jQuery
9	}	
10}
11catch(e)
12{
13	waJSQuery = jQuery
14}
15
16
17// add support for Object.keys for old browser
18if ( !Object.keys ) {
19    Object.keys = function( obj ) {
20        var keys = [], k;
21        for ( k in obj ) {
22            if ( Object.prototype.hasOwnProperty.call( obj, k ) ) {
23                keys.push( k );
24            }
25        }
26		
27        return keys;
28    };
29}
30
31if ( !String.prototype.format ) {
32	String.prototype.format = function() {
33		var _formatted = this;
34		
35		for ( var _i = 0; _i < arguments.length; _i++ ) {
36			var _regexp = new RegExp( '\\{'+ _i+'\\}', 'gi' );
37			_formatted = _formatted.replace( _regexp, arguments[ _i ] );
38		}
39		
40		return _formatted;
41	};
42}
43
44if ( !String.prototype.startsWith ) {
45	String.prototype.startsWith = function( str ) {
46		return this.slice( 0, str.length ) == str;
47	};
48}
49
50if ( !String.prototype.endsWith ) {
51	String.prototype.endsWith = function( str ) {
52		return this.slice( -str.length ) == str;
53	};
54}
55
56function _objectKeysCount( _object ) {
57	return _object == undefined ? 0 : Object.keys( _object ).length;
58}
59
60function _toJSON( _data, _silent ) {
61	var _result = new Object();
62	
63	if ( _silent == undefined ) {
64		_silent = true;
65	}
66	
67	_result.success = false;
68	_result.error = 'Unknown error';
69	
70	if ( _data.indexOf( '<?php' ) > -1 ) {
71		if ( _silent != true ) {
72			_result.error = Translator.tr( 'Error:No php on server' );
73			WA_Dialog.alert( _result.error );
74		}
75		
76		return _result;
77	}
78	
79	try {
80
81		///
82        _result.json = waJSQuery.parseJSON( _data );
83		_result.success = _result.json.success;
84		_result.error = _result.json.error;
85	}
86	catch( e ) {
87		_result.success = false;
88		_result.error = e.message;
89    }
90	
91	if ( _result.json == null ) {
92		if ( _silent != true ) {
93			_result.error = Translator.tr( 'Error:Malformed response !' );
94			WA_Dialog.alert( _result.error );
95		}
96	}
97	else {
98		if ( _result.success != true ) {
99			if ( _silent != true ) {
100				WA_Dialog.alert( _result.error_message );
101			}
102		}
103	}
104	
105	return _result;
106}
107
108function _HTMLEntities( _text ) {
109	//_text = _text.replace(/"/g,'&quot;'); // 34 22
110	_text = _text.replace(/&/g,'&amp;'); // 38 26
111	_text = _text.replace(/\'/g,'&#39;'); // 39 27
112	_text = _text.replace(/</g,'&lt;'); // 60 3C
113	_text = _text.replace(/>/g,'&gt;'); // 62 3E
114	_text = _text.replace(/\^/g,'&circ;'); // 94 5E
115	_text = _text.replace(/‘/g,'&lsquo;'); // 145 91
116	_text = _text.replace(/’/g,'&rsquo;'); // 146 92
117	_text = _text.replace(/“/g,'&ldquo;'); // 147 93
118	_text = _text.replace(/”/g,'&rdquo;'); // 148 94
119	_text = _text.replace(/•/g,'&bull;'); // 149 95
120	_text = _text.replace(/–/g,'&ndash;'); // 150 96
121	_text = _text.replace(/—/g,'&mdash;'); // 151 97
122	_text = _text.replace(/˜/g,'&tilde;'); // 152 98
123	_text = _text.replace(/™/g,'&trade;'); // 153 99
124	_text = _text.replace(/Å¡/g,'&scaron;'); // 154 9A
125	_text = _text.replace(/›/g,'&rsaquo;'); // 155 9B
126	_text = _text.replace(/œ/g,'&oelig;'); // 156 9C
127	_text = _text.replace(//g,'&#357;'); // 157 9D
128	_text = _text.replace(/ž/g,'&#382;'); // 158 9E
129	_text = _text.replace(/Ÿ/g,'&Yuml;'); // 159 9F
130	// _text = _text.replace(/ /g,'&nbsp;'); // 160 A0
131	_text = _text.replace(/¡/g,'&iexcl;'); // 161 A1
132	_text = _text.replace(/¢/g,'&cent;'); // 162 A2
133	_text = _text.replace(/£/g,'&pound;'); // 163 A3
134	//_text = _text.replace(/ /g,'&curren;'); // 164 A4
135	_text = _text.replace(/Â¥/g,'&yen;'); // 165 A5
136	_text = _text.replace(/¦/g,'&brvbar;'); // 166 A6
137	_text = _text.replace(/§/g,'&sect;'); // 167 A7
138	_text = _text.replace(/¨/g,'&uml;'); // 168 A8
139	_text = _text.replace(/©/g,'&copy;'); // 169 A9
140	_text = _text.replace(/ª/g,'&ordf;'); // 170 AA
141	_text = _text.replace(/«/g,'&laquo;'); // 171 AB
142	_text = _text.replace(/¬/g,'&not;'); // 172 AC
143	_text = _text.replace(/­/g,'&shy;'); // 173 AD
144	_text = _text.replace(/®/g,'&reg;'); // 174 AE
145	_text = _text.replace(/¯/g,'&macr;'); // 175 AF
146	_text = _text.replace(/°/g,'&deg;'); // 176 B0
147	_text = _text.replace(/±/g,'&plusmn;'); // 177 B1
148	_text = _text.replace(/²/g,'&sup2;'); // 178 B2
149	_text = _text.replace(/³/g,'&sup3;'); // 179 B3
150	_text = _text.replace(/´/g,'&acute;'); // 180 B4
151	_text = _text.replace(/µ/g,'&micro;'); // 181 B5
152	_text = _text.replace(/¶/g,'&para'); // 182 B6
153	_text = _text.replace(/·/g,'&middot;'); // 183 B7
154	_text = _text.replace(/¸/g,'&cedil;'); // 184 B8
155	_text = _text.replace(/¹/g,'&sup1;'); // 185 B9
156	_text = _text.replace(/º/g,'&ordm;'); // 186 BA
157	_text = _text.replace(/»/g,'&raquo;'); // 187 BB
158	_text = _text.replace(/¼/g,'&frac14;'); // 188 BC
159	_text = _text.replace(/½/g,'&frac12;'); // 189 BD
160	_text = _text.replace(/¾/g,'&frac34;'); // 190 BE
161	_text = _text.replace(/¿/g,'&iquest;'); // 191 BF
162	_text = _text.replace(/À/g,'&Agrave;'); // 192 C0
163	_text = _text.replace(/Á/g,'&Aacute;'); // 193 C1
164	_text = _text.replace(/Â/g,'&Acirc;'); // 194 C2
165	_text = _text.replace(/Ã/g,'&Atilde;'); // 195 C3
166	_text = _text.replace(/Ä/g,'&Auml;'); // 196 C4
167	_text = _text.replace(/Å/g,'&Aring;'); // 197 C5
168	_text = _text.replace(/Æ/g,'&AElig;'); // 198 C6
169	_text = _text.replace(/Ç/g,'&Ccedil;'); // 199 C7
170	_text = _text.replace(/È/g,'&Egrave;'); // 200 C8
171	_text = _text.replace(/É/g,'&Eacute;'); // 201 C9
172	_text = _text.replace(/Ê/g,'&Ecirc;'); // 202 CA
173	_text = _text.replace(/Ë/g,'&Euml;'); // 203 CB
174	_text = _text.replace(/Ì/g,'&Igrave;'); // 204 CC
175	_text = _text.replace(/Í/g,'&Iacute;'); // 205 CD
176	_text = _text.replace(/Î/g,'&Icirc;'); // 206 CE
177	_text = _text.replace(/Ï/g,'&Iuml;'); // 207 CF
178	_text = _text.replace(/Ð/g,'&ETH;'); // 208 D0
179	_text = _text.replace(/Ñ/g,'&Ntilde;'); // 209 D1
180	_text = _text.replace(/Ò/g,'&Ograve;'); // 210 D2
181	_text = _text.replace(/Ó/g,'&Oacute;'); // 211 D3
182	_text = _text.replace(/Ô/g,'&Ocirc;'); // 212 D4
183	_text = _text.replace(/Õ/g,'&Otilde;'); // 213 D5
184	_text = _text.replace(/Ö/g,'&Ouml;'); // 214 D6
185	_text = _text.replace(/×/g,'&times;'); // 215 D7
186	_text = _text.replace(/Ø/g,'&Oslash;'); // 216 D8
187	_text = _text.replace(/Ù/g,'&Ugrave;'); // 217 D9
188	_text = _text.replace(/Ú/g,'&Uacute;'); // 218 DA
189	_text = _text.replace(/Û/g,'&Ucirc;'); // 219 DB
190	_text = _text.replace(/Ü/g,'&Uuml;'); // 220 DC
191	_text = _text.replace(/Ý/g,'&Yacute;'); // 221 DD
192	_text = _text.replace(/Þ/g,'&THORN;'); // 222 DE
193	_text = _text.replace(/ß/g,'&szlig;'); // 223 DF
194	_text = _text.replace(/à/g,'&aacute;'); // 224 E0
195	_text = _text.replace(/á/g,'&aacute;'); // 225 E1
196	_text = _text.replace(/â/g,'&acirc;'); // 226 E2
197	_text = _text.replace(/ã/g,'&atilde;'); // 227 E3
198	_text = _text.replace(/ä/g,'&auml;'); // 228 E4
199	_text = _text.replace(/Ã¥/g,'&aring;'); // 229 E5
200	_text = _text.replace(/æ/g,'&aelig;'); // 230 E6
201	_text = _text.replace(/ç/g,'&ccedil;'); // 231 E7
202	_text = _text.replace(/è/g,'&egrave;'); // 232 E8
203	_text = _text.replace(/é/g,'&eacute;'); // 233 E9
204	_text = _text.replace(/ê/g,'&ecirc;'); // 234 EA
205	_text = _text.replace(/ë/g,'&euml;'); // 235 EB
206	_text = _text.replace(/ì/g,'&igrave;'); // 236 EC
207	_text = _text.replace(/í/g,'&iacute;'); // 237 ED
208	_text = _text.replace(/î/g,'&icirc;'); // 238 EE
209	_text = _text.replace(/ï/g,'&iuml;'); // 239 EF
210	_text = _text.replace(/ð/g,'&eth;'); // 240 F0
211	_text = _text.replace(/ñ/g,'&ntilde;'); // 241 F1
212	_text = _text.replace(/ò/g,'&ograve;'); // 242 F2
213	_text = _text.replace(/ó/g,'&oacute;'); // 243 F3
214	_text = _text.replace(/ô/g,'&ocirc;'); // 244 F4
215	_text = _text.replace(/õ/g,'&otilde;'); // 245 F5
216	_text = _text.replace(/ö/g,'&ouml;'); // 246 F6
217	_text = _text.replace(/÷/g,'&divide;'); // 247 F7
218	_text = _text.replace(/ø/g,'&oslash;'); // 248 F8
219	_text = _text.replace(/ù/g,'&ugrave;'); // 249 F9
220	_text = _text.replace(/ú/g,'&uacute;'); // 250 FA
221	_text = _text.replace(/û/g,'&ucirc;'); // 251 FB
222	_text = _text.replace(/ü/g,'&uuml;'); // 252 FC
223	_text = _text.replace(/ý/g,'&yacute;'); // 253 FD
224	_text = _text.replace(/þ/g,'&thorn;'); // 254 FE
225	_text = _text.replace(/ÿ/g,'&yuml;'); // 255 FF
226	return _text;
227}
228
229// parseUri 1.2.2
230// (c) Steven Levithan <stevenlevithan.com>
231// MIT License
232
233function _parseUri( _str ) {
234	var	_o   = _parseUri.options,
235		_m   = _o.parser[ _o.strictMode ? "strict" : "loose" ].exec( _str ),
236		_uri = {},
237		_i   = 14;
238
239	while ( _i-- ) {
240		_uri[ _o.key[ _i ] ] = _m[ _i ] || "";
241	}
242
243	_uri[ _o.q.name ] = {};
244	_uri[ _o.key[ 12 ] ].replace( _o.q.parser, function( $0, $1, $2 ) {
245		if ( $1 ) {
246			_uri[ _o.q.name ][ $1 ] = $2;
247		}
248	} ) ;
249
250	return _uri;
251};
252
253_parseUri.options = {
254	strictMode: false,
255	key: [ "source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor" ],
256	q:   {
257		name:   "queryKey",
258		parser: /(?:^|&)([^&=]*)=?([^&]*)/g
259	},
260	parser: {
261		strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
262		loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
263	}
264};

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.