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,'"'); // 34 22 110 _text = _text.replace(/&/g,'&'); // 38 26 111 _text = _text.replace(/\'/g,'''); // 39 27 112 _text = _text.replace(/</g,'<'); // 60 3C 113 _text = _text.replace(/>/g,'>'); // 62 3E 114 _text = _text.replace(/\^/g,'ˆ'); // 94 5E 115 _text = _text.replace(/â/g,'‘'); // 145 91 116 _text = _text.replace(/â/g,'’'); // 146 92 117 _text = _text.replace(/â/g,'“'); // 147 93 118 _text = _text.replace(/â/g,'”'); // 148 94 119 _text = _text.replace(/â¢/g,'•'); // 149 95 120 _text = _text.replace(/â/g,'–'); // 150 96 121 _text = _text.replace(/â/g,'—'); // 151 97 122 _text = _text.replace(/Ë/g,'˜'); // 152 98 123 _text = _text.replace(/â¢/g,'™'); // 153 99 124 _text = _text.replace(/Å¡/g,'š'); // 154 9A 125 _text = _text.replace(/âº/g,'›'); // 155 9B 126 _text = _text.replace(/Å/g,'œ'); // 156 9C 127 _text = _text.replace(/Â/g,'ť'); // 157 9D 128 _text = _text.replace(/ž/g,'ž'); // 158 9E 129 _text = _text.replace(/Ÿ/g,'Ÿ'); // 159 9F 130 // _text = _text.replace(/ /g,' '); // 160 A0 131 _text = _text.replace(/¡/g,'¡'); // 161 A1 132 _text = _text.replace(/¢/g,'¢'); // 162 A2 133 _text = _text.replace(/£/g,'£'); // 163 A3 134 //_text = _text.replace(/ /g,'¤'); // 164 A4 135 _text = _text.replace(/Â¥/g,'¥'); // 165 A5 136 _text = _text.replace(/¦/g,'¦'); // 166 A6 137 _text = _text.replace(/§/g,'§'); // 167 A7 138 _text = _text.replace(/¨/g,'¨'); // 168 A8 139 _text = _text.replace(/©/g,'©'); // 169 A9 140 _text = _text.replace(/ª/g,'ª'); // 170 AA 141 _text = _text.replace(/«/g,'«'); // 171 AB 142 _text = _text.replace(/¬/g,'¬'); // 172 AC 143 _text = _text.replace(/Â/g,'­'); // 173 AD 144 _text = _text.replace(/®/g,'®'); // 174 AE 145 _text = _text.replace(/¯/g,'¯'); // 175 AF 146 _text = _text.replace(/°/g,'°'); // 176 B0 147 _text = _text.replace(/±/g,'±'); // 177 B1 148 _text = _text.replace(/²/g,'²'); // 178 B2 149 _text = _text.replace(/³/g,'³'); // 179 B3 150 _text = _text.replace(/´/g,'´'); // 180 B4 151 _text = _text.replace(/µ/g,'µ'); // 181 B5 152 _text = _text.replace(/¶/g,'¶'); // 182 B6 153 _text = _text.replace(/·/g,'·'); // 183 B7 154 _text = _text.replace(/¸/g,'¸'); // 184 B8 155 _text = _text.replace(/¹/g,'¹'); // 185 B9 156 _text = _text.replace(/º/g,'º'); // 186 BA 157 _text = _text.replace(/»/g,'»'); // 187 BB 158 _text = _text.replace(/¼/g,'¼'); // 188 BC 159 _text = _text.replace(/½/g,'½'); // 189 BD 160 _text = _text.replace(/¾/g,'¾'); // 190 BE 161 _text = _text.replace(/¿/g,'¿'); // 191 BF 162 _text = _text.replace(/Ã/g,'À'); // 192 C0 163 _text = _text.replace(/Ã/g,'Á'); // 193 C1 164 _text = _text.replace(/Ã/g,'Â'); // 194 C2 165 _text = _text.replace(/Ã/g,'Ã'); // 195 C3 166 _text = _text.replace(/Ã/g,'Ä'); // 196 C4 167 _text = _text.replace(/à /g,'Å'); // 197 C5 168 _text = _text.replace(/Ã/g,'Æ'); // 198 C6 169 _text = _text.replace(/Ã/g,'Ç'); // 199 C7 170 _text = _text.replace(/Ã/g,'È'); // 200 C8 171 _text = _text.replace(/Ã/g,'É'); // 201 C9 172 _text = _text.replace(/Ã/g,'Ê'); // 202 CA 173 _text = _text.replace(/Ã/g,'Ë'); // 203 CB 174 _text = _text.replace(/Ã/g,'Ì'); // 204 CC 175 _text = _text.replace(/Ã/g,'Í'); // 205 CD 176 _text = _text.replace(/Ã/g,'Î'); // 206 CE 177 _text = _text.replace(/Ã/g,'Ï'); // 207 CF 178 _text = _text.replace(/Ã/g,'Ð'); // 208 D0 179 _text = _text.replace(/Ã/g,'Ñ'); // 209 D1 180 _text = _text.replace(/Ã/g,'Ò'); // 210 D2 181 _text = _text.replace(/Ã/g,'Ó'); // 211 D3 182 _text = _text.replace(/Ã/g,'Ô'); // 212 D4 183 _text = _text.replace(/Ã/g,'Õ'); // 213 D5 184 _text = _text.replace(/Ã/g,'Ö'); // 214 D6 185 _text = _text.replace(/Ã/g,'×'); // 215 D7 186 _text = _text.replace(/Ã/g,'Ø'); // 216 D8 187 _text = _text.replace(/Ã/g,'Ù'); // 217 D9 188 _text = _text.replace(/Ã/g,'Ú'); // 218 DA 189 _text = _text.replace(/Ã/g,'Û'); // 219 DB 190 _text = _text.replace(/Ã/g,'Ü'); // 220 DC 191 _text = _text.replace(/Ã/g,'Ý'); // 221 DD 192 _text = _text.replace(/Ã/g,'Þ'); // 222 DE 193 _text = _text.replace(/Ã/g,'ß'); // 223 DF 194 _text = _text.replace(/à /g,'á'); // 224 E0 195 _text = _text.replace(/á/g,'á'); // 225 E1 196 _text = _text.replace(/â/g,'â'); // 226 E2 197 _text = _text.replace(/ã/g,'ã'); // 227 E3 198 _text = _text.replace(/ä/g,'ä'); // 228 E4 199 _text = _text.replace(/Ã¥/g,'å'); // 229 E5 200 _text = _text.replace(/æ/g,'æ'); // 230 E6 201 _text = _text.replace(/ç/g,'ç'); // 231 E7 202 _text = _text.replace(/è/g,'è'); // 232 E8 203 _text = _text.replace(/é/g,'é'); // 233 E9 204 _text = _text.replace(/ê/g,'ê'); // 234 EA 205 _text = _text.replace(/ë/g,'ë'); // 235 EB 206 _text = _text.replace(/ì/g,'ì'); // 236 EC 207 _text = _text.replace(/Ã/g,'í'); // 237 ED 208 _text = _text.replace(/î/g,'î'); // 238 EE 209 _text = _text.replace(/ï/g,'ï'); // 239 EF 210 _text = _text.replace(/ð/g,'ð'); // 240 F0 211 _text = _text.replace(/ñ/g,'ñ'); // 241 F1 212 _text = _text.replace(/ò/g,'ò'); // 242 F2 213 _text = _text.replace(/ó/g,'ó'); // 243 F3 214 _text = _text.replace(/ô/g,'ô'); // 244 F4 215 _text = _text.replace(/õ/g,'õ'); // 245 F5 216 _text = _text.replace(/ö/g,'ö'); // 246 F6 217 _text = _text.replace(/÷/g,'÷'); // 247 F7 218 _text = _text.replace(/ø/g,'ø'); // 248 F8 219 _text = _text.replace(/ù/g,'ù'); // 249 F9 220 _text = _text.replace(/ú/g,'ú'); // 250 FA 221 _text = _text.replace(/û/g,'û'); // 251 FB 222 _text = _text.replace(/ü/g,'ü'); // 252 FC 223 _text = _text.replace(/ý/g,'ý'); // 253 FD 224 _text = _text.replace(/þ/g,'þ'); // 254 FE 225 _text = _text.replace(/ÿ/g,'ÿ'); // 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.