Showing
2 changed files
with
927 additions
and
0 deletions
static/dist/yas-jssdk/1.0.15/yas-debug.js
0 → 100644
1 | +;(function() { | ||
2 | +var yohojson2_100_json2_debug, yas_jssdk_1015_src_config_debug, yas_jssdk_1015_src_cross_debug, yas_jssdk_1015_src_event_debug, yas_jssdk_1015_src_util_debug, yas_jssdk_1015_src_cookie_debug, yas_jssdk_1015_src_ya_debug, yas_jssdk_1015_yas_debug; | ||
3 | +yohojson2_100_json2_debug = function () { | ||
4 | + /* | ||
5 | + json2.js | ||
6 | + 2015-05-03 | ||
7 | + | ||
8 | + Public Domain. | ||
9 | + | ||
10 | + NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | ||
11 | + | ||
12 | + See http://www.JSON.org/js.html | ||
13 | + | ||
14 | + | ||
15 | + This code should be minified before deployment. | ||
16 | + See http://javascript.crockford.com/jsmin.html | ||
17 | + | ||
18 | + USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO | ||
19 | + NOT CONTROL. | ||
20 | + | ||
21 | + | ||
22 | + This file creates a global JSON object containing two methods: stringify | ||
23 | + and parse. This file is provides the ES5 JSON capability to ES3 systems. | ||
24 | + If a project might run on IE8 or earlier, then this file should be included. | ||
25 | + This file does nothing on ES5 systems. | ||
26 | + | ||
27 | + JSON.stringify(value, replacer, space) | ||
28 | + value any JavaScript value, usually an object or array. | ||
29 | + | ||
30 | + replacer an optional parameter that determines how object | ||
31 | + values are stringified for objects. It can be a | ||
32 | + function or an array of strings. | ||
33 | + | ||
34 | + space an optional parameter that specifies the indentation | ||
35 | + of nested structures. If it is omitted, the text will | ||
36 | + be packed without extra whitespace. If it is a number, | ||
37 | + it will specify the number of spaces to indent at each | ||
38 | + level. If it is a string (such as '\t' or ' '), | ||
39 | + it contains the characters used to indent at each level. | ||
40 | + | ||
41 | + This method produces a JSON text from a JavaScript value. | ||
42 | + | ||
43 | + When an object value is found, if the object contains a toJSON | ||
44 | + method, its toJSON method will be called and the result will be | ||
45 | + stringified. A toJSON method does not serialize: it returns the | ||
46 | + value represented by the name/value pair that should be serialized, | ||
47 | + or undefined if nothing should be serialized. The toJSON method | ||
48 | + will be passed the key associated with the value, and this will be | ||
49 | + bound to the value | ||
50 | + | ||
51 | + For example, this would serialize Dates as ISO strings. | ||
52 | + | ||
53 | + Date.prototype.toJSON = function (key) { | ||
54 | + function f(n) { | ||
55 | + // Format integers to have at least two digits. | ||
56 | + return n < 10 | ||
57 | + ? '0' + n | ||
58 | + : n; | ||
59 | + } | ||
60 | + | ||
61 | + return this.getUTCFullYear() + '-' + | ||
62 | + f(this.getUTCMonth() + 1) + '-' + | ||
63 | + f(this.getUTCDate()) + 'T' + | ||
64 | + f(this.getUTCHours()) + ':' + | ||
65 | + f(this.getUTCMinutes()) + ':' + | ||
66 | + f(this.getUTCSeconds()) + 'Z'; | ||
67 | + }; | ||
68 | + | ||
69 | + You can provide an optional replacer method. It will be passed the | ||
70 | + key and value of each member, with this bound to the containing | ||
71 | + object. The value that is returned from your method will be | ||
72 | + serialized. If your method returns undefined, then the member will | ||
73 | + be excluded from the serialization. | ||
74 | + | ||
75 | + If the replacer parameter is an array of strings, then it will be | ||
76 | + used to select the members to be serialized. It filters the results | ||
77 | + such that only members with keys listed in the replacer array are | ||
78 | + stringified. | ||
79 | + | ||
80 | + Values that do not have JSON representations, such as undefined or | ||
81 | + functions, will not be serialized. Such values in objects will be | ||
82 | + dropped; in arrays they will be replaced with null. You can use | ||
83 | + a replacer function to replace those with JSON values. | ||
84 | + JSON.stringify(undefined) returns undefined. | ||
85 | + | ||
86 | + The optional space parameter produces a stringification of the | ||
87 | + value that is filled with line breaks and indentation to make it | ||
88 | + easier to read. | ||
89 | + | ||
90 | + If the space parameter is a non-empty string, then that string will | ||
91 | + be used for indentation. If the space parameter is a number, then | ||
92 | + the indentation will be that many spaces. | ||
93 | + | ||
94 | + Example: | ||
95 | + | ||
96 | + text = JSON.stringify(['e', {pluribus: 'unum'}]); | ||
97 | + // text is '["e",{"pluribus":"unum"}]' | ||
98 | + | ||
99 | + | ||
100 | + text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); | ||
101 | + // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' | ||
102 | + | ||
103 | + text = JSON.stringify([new Date()], function (key, value) { | ||
104 | + return this[key] instanceof Date | ||
105 | + ? 'Date(' + this[key] + ')' | ||
106 | + : value; | ||
107 | + }); | ||
108 | + // text is '["Date(---current time---)"]' | ||
109 | + | ||
110 | + | ||
111 | + JSON.parse(text, reviver) | ||
112 | + This method parses a JSON text to produce an object or array. | ||
113 | + It can throw a SyntaxError exception. | ||
114 | + | ||
115 | + The optional reviver parameter is a function that can filter and | ||
116 | + transform the results. It receives each of the keys and values, | ||
117 | + and its return value is used instead of the original value. | ||
118 | + If it returns what it received, then the structure is not modified. | ||
119 | + If it returns undefined then the member is deleted. | ||
120 | + | ||
121 | + Example: | ||
122 | + | ||
123 | + // Parse the text. Values that look like ISO date strings will | ||
124 | + // be converted to Date objects. | ||
125 | + | ||
126 | + myData = JSON.parse(text, function (key, value) { | ||
127 | + var a; | ||
128 | + if (typeof value === 'string') { | ||
129 | + a = | ||
130 | + /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); | ||
131 | + if (a) { | ||
132 | + return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], | ||
133 | + +a[5], +a[6])); | ||
134 | + } | ||
135 | + } | ||
136 | + return value; | ||
137 | + }); | ||
138 | + | ||
139 | + myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { | ||
140 | + var d; | ||
141 | + if (typeof value === 'string' && | ||
142 | + value.slice(0, 5) === 'Date(' && | ||
143 | + value.slice(-1) === ')') { | ||
144 | + d = new Date(value.slice(5, -1)); | ||
145 | + if (d) { | ||
146 | + return d; | ||
147 | + } | ||
148 | + } | ||
149 | + return value; | ||
150 | + }); | ||
151 | + | ||
152 | + | ||
153 | + This is a reference implementation. You are free to copy, modify, or | ||
154 | + redistribute. | ||
155 | + */ | ||
156 | + /*jslint | ||
157 | + eval, for, this | ||
158 | + */ | ||
159 | + /*property | ||
160 | + JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, | ||
161 | + getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, | ||
162 | + lastIndex, length, parse, prototype, push, replace, slice, stringify, | ||
163 | + test, toJSON, toString, valueOf | ||
164 | + */ | ||
165 | + // Create a JSON object only if one does not already exist. We create the | ||
166 | + // methods in a closure to avoid creating global variables. | ||
167 | + if (typeof JSON !== 'object') { | ||
168 | + JSON = {}; | ||
169 | + } | ||
170 | + (function () { | ||
171 | + 'use strict'; | ||
172 | + var rx_one = /^[\],:{}\s]*$/, rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, rx_four = /(?:^|:|,)(?:\s*\[)+/g, rx_escapable = /[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; | ||
173 | + function f(n) { | ||
174 | + // Format integers to have at least two digits. | ||
175 | + return n < 10 ? '0' + n : n; | ||
176 | + } | ||
177 | + function this_value() { | ||
178 | + return this.valueOf(); | ||
179 | + } | ||
180 | + if (typeof Date.prototype.toJSON !== 'function') { | ||
181 | + Date.prototype.toJSON = function () { | ||
182 | + return isFinite(this.valueOf()) ? this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z' : null; | ||
183 | + }; | ||
184 | + Boolean.prototype.toJSON = this_value; | ||
185 | + Number.prototype.toJSON = this_value; | ||
186 | + String.prototype.toJSON = this_value; | ||
187 | + } | ||
188 | + var gap, indent, meta, rep; | ||
189 | + function quote(string) { | ||
190 | + // If the string contains no control characters, no quote characters, and no | ||
191 | + // backslash characters, then we can safely slap some quotes around it. | ||
192 | + // Otherwise we must also replace the offending characters with safe escape | ||
193 | + // sequences. | ||
194 | + rx_escapable.lastIndex = 0; | ||
195 | + return rx_escapable.test(string) ? '"' + string.replace(rx_escapable, function (a) { | ||
196 | + var c = meta[a]; | ||
197 | + return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); | ||
198 | + }) + '"' : '"' + string + '"'; | ||
199 | + } | ||
200 | + function str(key, holder) { | ||
201 | + // Produce a string from holder[key]. | ||
202 | + var i, | ||
203 | + // The loop counter. | ||
204 | + k, | ||
205 | + // The member key. | ||
206 | + v, | ||
207 | + // The member value. | ||
208 | + length, mind = gap, partial, value = holder[key]; | ||
209 | + // If the value has a toJSON method, call it to obtain a replacement value. | ||
210 | + if (value && typeof value === 'object' && typeof value.toJSON === 'function') { | ||
211 | + value = value.toJSON(key); | ||
212 | + } | ||
213 | + // If we were called with a replacer function, then call the replacer to | ||
214 | + // obtain a replacement value. | ||
215 | + if (typeof rep === 'function') { | ||
216 | + value = rep.call(holder, key, value); | ||
217 | + } | ||
218 | + // What happens next depends on the value's type. | ||
219 | + switch (typeof value) { | ||
220 | + case 'string': | ||
221 | + return quote(value); | ||
222 | + case 'number': | ||
223 | + // JSON numbers must be finite. Encode non-finite numbers as null. | ||
224 | + return isFinite(value) ? String(value) : 'null'; | ||
225 | + case 'boolean': | ||
226 | + case 'null': | ||
227 | + // If the value is a boolean or null, convert it to a string. Note: | ||
228 | + // typeof null does not produce 'null'. The case is included here in | ||
229 | + // the remote chance that this gets fixed someday. | ||
230 | + return String(value); | ||
231 | + // If the type is 'object', we might be dealing with an object or an array or | ||
232 | + // null. | ||
233 | + case 'object': | ||
234 | + // Due to a specification blunder in ECMAScript, typeof null is 'object', | ||
235 | + // so watch out for that case. | ||
236 | + if (!value) { | ||
237 | + return 'null'; | ||
238 | + } | ||
239 | + // Make an array to hold the partial results of stringifying this object value. | ||
240 | + gap += indent; | ||
241 | + partial = []; | ||
242 | + // Is the value an array? | ||
243 | + if (Object.prototype.toString.apply(value) === '[object Array]') { | ||
244 | + // The value is an array. Stringify every element. Use null as a placeholder | ||
245 | + // for non-JSON values. | ||
246 | + length = value.length; | ||
247 | + for (i = 0; i < length; i += 1) { | ||
248 | + partial[i] = str(i, value) || 'null'; | ||
249 | + } | ||
250 | + // Join all of the elements together, separated with commas, and wrap them in | ||
251 | + // brackets. | ||
252 | + v = partial.length === 0 ? '[]' : gap ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : '[' + partial.join(',') + ']'; | ||
253 | + gap = mind; | ||
254 | + return v; | ||
255 | + } | ||
256 | + // If the replacer is an array, use it to select the members to be stringified. | ||
257 | + if (rep && typeof rep === 'object') { | ||
258 | + length = rep.length; | ||
259 | + for (i = 0; i < length; i += 1) { | ||
260 | + if (typeof rep[i] === 'string') { | ||
261 | + k = rep[i]; | ||
262 | + v = str(k, value); | ||
263 | + if (v) { | ||
264 | + partial.push(quote(k) + (gap ? ': ' : ':') + v); | ||
265 | + } | ||
266 | + } | ||
267 | + } | ||
268 | + } else { | ||
269 | + // Otherwise, iterate through all of the keys in the object. | ||
270 | + for (k in value) { | ||
271 | + if (Object.prototype.hasOwnProperty.call(value, k)) { | ||
272 | + v = str(k, value); | ||
273 | + if (v) { | ||
274 | + partial.push(quote(k) + (gap ? ': ' : ':') + v); | ||
275 | + } | ||
276 | + } | ||
277 | + } | ||
278 | + } | ||
279 | + // Join all of the member texts together, separated with commas, | ||
280 | + // and wrap them in braces. | ||
281 | + v = partial.length === 0 ? '{}' : gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : '{' + partial.join(',') + '}'; | ||
282 | + gap = mind; | ||
283 | + return v; | ||
284 | + } | ||
285 | + } | ||
286 | + // If the JSON object does not yet have a stringify method, give it one. | ||
287 | + if (typeof JSON.stringify !== 'function') { | ||
288 | + meta = { | ||
289 | + // table of character substitutions | ||
290 | + '\b': '\\b', | ||
291 | + '\t': '\\t', | ||
292 | + '\n': '\\n', | ||
293 | + '\f': '\\f', | ||
294 | + '\r': '\\r', | ||
295 | + '"': '\\"', | ||
296 | + '\\': '\\\\' | ||
297 | + }; | ||
298 | + JSON.stringify = function (value, replacer, space) { | ||
299 | + // The stringify method takes a value and an optional replacer, and an optional | ||
300 | + // space parameter, and returns a JSON text. The replacer can be a function | ||
301 | + // that can replace values, or an array of strings that will select the keys. | ||
302 | + // A default replacer method can be provided. Use of the space parameter can | ||
303 | + // produce text that is more easily readable. | ||
304 | + var i; | ||
305 | + gap = ''; | ||
306 | + indent = ''; | ||
307 | + // If the space parameter is a number, make an indent string containing that | ||
308 | + // many spaces. | ||
309 | + if (typeof space === 'number') { | ||
310 | + for (i = 0; i < space; i += 1) { | ||
311 | + indent += ' '; | ||
312 | + } | ||
313 | + } else if (typeof space === 'string') { | ||
314 | + indent = space; | ||
315 | + } | ||
316 | + // If there is a replacer, it must be a function or an array. | ||
317 | + // Otherwise, throw an error. | ||
318 | + rep = replacer; | ||
319 | + if (replacer && typeof replacer !== 'function' && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { | ||
320 | + throw new Error('JSON.stringify'); | ||
321 | + } | ||
322 | + // Make a fake root object containing our value under the key of ''. | ||
323 | + // Return the result of stringifying the value. | ||
324 | + return str('', { '': value }); | ||
325 | + }; | ||
326 | + } | ||
327 | + // If the JSON object does not yet have a parse method, give it one. | ||
328 | + if (typeof JSON.parse !== 'function') { | ||
329 | + JSON.parse = function (text, reviver) { | ||
330 | + // The parse method takes a text and an optional reviver function, and returns | ||
331 | + // a JavaScript value if the text is a valid JSON text. | ||
332 | + var j; | ||
333 | + function walk(holder, key) { | ||
334 | + // The walk method is used to recursively walk the resulting structure so | ||
335 | + // that modifications can be made. | ||
336 | + var k, v, value = holder[key]; | ||
337 | + if (value && typeof value === 'object') { | ||
338 | + for (k in value) { | ||
339 | + if (Object.prototype.hasOwnProperty.call(value, k)) { | ||
340 | + v = walk(value, k); | ||
341 | + if (v !== undefined) { | ||
342 | + value[k] = v; | ||
343 | + } else { | ||
344 | + delete value[k]; | ||
345 | + } | ||
346 | + } | ||
347 | + } | ||
348 | + } | ||
349 | + return reviver.call(holder, key, value); | ||
350 | + } | ||
351 | + // Parsing happens in four stages. In the first stage, we replace certain | ||
352 | + // Unicode characters with escape sequences. JavaScript handles many characters | ||
353 | + // incorrectly, either silently deleting them, or treating them as line endings. | ||
354 | + text = String(text); | ||
355 | + rx_dangerous.lastIndex = 0; | ||
356 | + if (rx_dangerous.test(text)) { | ||
357 | + text = text.replace(rx_dangerous, function (a) { | ||
358 | + return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); | ||
359 | + }); | ||
360 | + } | ||
361 | + // In the second stage, we run the text against regular expressions that look | ||
362 | + // for non-JSON patterns. We are especially concerned with '()' and 'new' | ||
363 | + // because they can cause invocation, and '=' because it can cause mutation. | ||
364 | + // But just to be safe, we want to reject all unexpected forms. | ||
365 | + // We split the second stage into 4 regexp operations in order to work around | ||
366 | + // crippling inefficiencies in IE's and Safari's regexp engines. First we | ||
367 | + // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we | ||
368 | + // replace all simple value tokens with ']' characters. Third, we delete all | ||
369 | + // open brackets that follow a colon or comma or that begin the text. Finally, | ||
370 | + // we look to see that the remaining characters are only whitespace or ']' or | ||
371 | + // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. | ||
372 | + if (rx_one.test(text.replace(rx_two, '@').replace(rx_three, ']').replace(rx_four, ''))) { | ||
373 | + // In the third stage we use the eval function to compile the text into a | ||
374 | + // JavaScript structure. The '{' operator is subject to a syntactic ambiguity | ||
375 | + // in JavaScript: it can begin a block or an object literal. We wrap the text | ||
376 | + // in parens to eliminate the ambiguity. | ||
377 | + j = eval('(' + text + ')'); | ||
378 | + // In the optional fourth stage, we recursively walk the new structure, passing | ||
379 | + // each name/value pair to a reviver function for possible transformation. | ||
380 | + return typeof reviver === 'function' ? walk({ '': j }, '') : j; | ||
381 | + } | ||
382 | + // If the text is not JSON parseable, then a SyntaxError is thrown. | ||
383 | + throw new SyntaxError('JSON.parse'); | ||
384 | + }; | ||
385 | + } | ||
386 | + }()); | ||
387 | +}(); | ||
388 | +yas_jssdk_1015_src_config_debug = function (exports) { | ||
389 | + exports = { | ||
390 | + version: '1.0', | ||
391 | + yasPath: '/web/', | ||
392 | + yasDomain: getDomain(), | ||
393 | + yasImgDomain: 'http://analytics.m.yohobuy.com/yas.gif' | ||
394 | + }; | ||
395 | + function getDomain() { | ||
396 | + var domainArr = document.domain.split('.'); | ||
397 | + var length = domainArr.length; | ||
398 | + if (length > 1 && isNaN(domainArr[length - 1])) { | ||
399 | + return '.' + domainArr[length - 2] + '.' + domainArr[length - 1]; | ||
400 | + } else { | ||
401 | + return document.domain; | ||
402 | + } | ||
403 | + } | ||
404 | + return exports; | ||
405 | +}(); | ||
406 | +yas_jssdk_1015_src_cross_debug = function (exports) { | ||
407 | + /** | ||
408 | + * 跨域发送信息工具库 | ||
409 | + */ | ||
410 | + var config = yas_jssdk_1015_src_config_debug; | ||
411 | + var yasPath = config.yasPath; | ||
412 | + var yasImgDomain = config.yasImgDomain; | ||
413 | + //发送图片方式 | ||
414 | + exports.imgSend = function (param, callback) { | ||
415 | + var image = new Image(1, 1); | ||
416 | + image.src = yasImgDomain + yasPath + '?' + param; | ||
417 | + image.onload = function () { | ||
418 | + image.onload = null; | ||
419 | + if (callback) { | ||
420 | + callback(); | ||
421 | + } | ||
422 | + }; | ||
423 | + }; | ||
424 | + return exports; | ||
425 | +}({}); | ||
426 | +yas_jssdk_1015_src_event_debug = function (exports) { | ||
427 | + exports.addEventHandler = function (target, type, func) { | ||
428 | + if (target.addEventListener) | ||
429 | + target.addEventListener(type, func, false); | ||
430 | + else if (target.attachEvent) | ||
431 | + target.attachEvent('on' + type, func); | ||
432 | + else | ||
433 | + target['on' + type] = func; | ||
434 | + }; | ||
435 | + exports.removeEventHandler = function (target, type, func) { | ||
436 | + if (target.removeEventListener) | ||
437 | + target.removeEventListener(type, func, false); | ||
438 | + else if (target.detachEvent) | ||
439 | + target.detachEvent('on' + type, func); | ||
440 | + else | ||
441 | + delete target['on' + type]; | ||
442 | + }; | ||
443 | + return exports; | ||
444 | +}({}); | ||
445 | +yas_jssdk_1015_src_util_debug = function (exports) { | ||
446 | + var config = yas_jssdk_1015_src_config_debug; | ||
447 | + var yasPath = config.yaPath; | ||
448 | + var yasDomain = config.yasDomain; | ||
449 | + exports.flashChecker = function () { | ||
450 | + var hasFlash = 0; | ||
451 | + var flashVersion = 0; | ||
452 | + var isIE = 0; | ||
453 | + var swf = null; | ||
454 | + if (isIE) { | ||
455 | + swf = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); | ||
456 | + if (swf) { | ||
457 | + hasFlash = 1; | ||
458 | + flashVersion = swf.GetVariable('$version'); | ||
459 | + } | ||
460 | + } else { | ||
461 | + if (navigator.plugins && navigator.plugins.length > 0) { | ||
462 | + swf = navigator.plugins['Shockwave Flash']; | ||
463 | + if (swf) { | ||
464 | + hasFlash = 1; | ||
465 | + flashVersion = swf.description.replace('Shockwave Flash', ''); | ||
466 | + } | ||
467 | + } | ||
468 | + } | ||
469 | + return { | ||
470 | + f: hasFlash, | ||
471 | + v: flashVersion | ||
472 | + }; | ||
473 | + }; | ||
474 | + exports.Hash = function (str) { | ||
475 | + var hash = 1, charCode = 0, idx; | ||
476 | + if (str) { | ||
477 | + hash = 0; | ||
478 | + for (idx = str.length - 1; idx >= 0; idx--) { | ||
479 | + charCode = str.charCodeAt(idx); | ||
480 | + hash = (hash << 6 & 268435455) + charCode + (charCode << 14); | ||
481 | + charCode = hash & 266338304; | ||
482 | + if (charCode !== 0) { | ||
483 | + hash = hash ^ charCode >> 21; | ||
484 | + } | ||
485 | + } | ||
486 | + } | ||
487 | + return hash; | ||
488 | + }; | ||
489 | + exports.Random = function () { | ||
490 | + return Math.round(Math.random() * 2147483647); | ||
491 | + }; | ||
492 | + exports.hashClientInfo = function () { | ||
493 | + var navigator = window.navigator; | ||
494 | + var history_length = window.history.length; | ||
495 | + var arr = [ | ||
496 | + navigator.appName, | ||
497 | + navigator.version, | ||
498 | + navigator.language, | ||
499 | + navigator.platform, | ||
500 | + navigator.userAgent, | ||
501 | + navigator.javaEnabled(), | ||
502 | + window.screen, | ||
503 | + window.screen.colorDepth, | ||
504 | + window.document.cookie ? window.document.cookie : '', | ||
505 | + window.document.referrer ? window.document.referrer : '' | ||
506 | + ]; | ||
507 | + navigator = arr.join(''); | ||
508 | + for (var len = navigator.length; history_length > 0;) { | ||
509 | + navigator += history_length-- ^ len++; | ||
510 | + } | ||
511 | + return exports.Hash(navigator); | ||
512 | + }; | ||
513 | + exports.merge = function (obj1, obj2) { | ||
514 | + var ret = {}; | ||
515 | + for (var attr in obj1) { | ||
516 | + ret[attr] = obj1[attr]; | ||
517 | + } | ||
518 | + for (var attr2 in obj2) { | ||
519 | + ret[attr2] = obj2[attr2]; | ||
520 | + } | ||
521 | + return ret; | ||
522 | + }; | ||
523 | + exports.genParam = function (obj) { | ||
524 | + var arr = []; | ||
525 | + for (var key in obj) { | ||
526 | + arr.push(key + '=' + obj[key]); | ||
527 | + } | ||
528 | + return arr.join('&'); | ||
529 | + }; | ||
530 | + exports.trim = function (text) { | ||
531 | + if (String.prototype.trim) { | ||
532 | + return text === null ? '' : String.prototype.trim.call(text); | ||
533 | + } else { | ||
534 | + var trimLeft = /^\s+/; | ||
535 | + var trimRight = /\s+$/; | ||
536 | + var ret = ''; | ||
537 | + if (text) { | ||
538 | + ret = text.toString().replace(trimLeft, ''); | ||
539 | + ret = ret.replace(trimRight, ''); | ||
540 | + return ret; | ||
541 | + } | ||
542 | + } | ||
543 | + }; | ||
544 | + exports.getGeo = function (callback) { | ||
545 | + if (window.navigator.geolocation) { | ||
546 | + var options = { enableHighAccuracy: true }; | ||
547 | + window.navigator.geolocation.getCurrentPosition(handleSuccess, handleError, options); | ||
548 | + } else { | ||
549 | + callback(false); | ||
550 | + } | ||
551 | + function handleSuccess(position) { | ||
552 | + var lng = position.coords.longitude; | ||
553 | + var lat = position.coords.latitude; | ||
554 | + callback(lat, lng); | ||
555 | + } | ||
556 | + function handleError(error) { | ||
557 | + callback(false); | ||
558 | + } | ||
559 | + }; | ||
560 | + return exports; | ||
561 | +}({}); | ||
562 | +yas_jssdk_1015_src_cookie_debug = function (exports) { | ||
563 | + var util = yas_jssdk_1015_src_util_debug; | ||
564 | + exports = function (name, value, options) { | ||
565 | + if (typeof value != 'undefined') { | ||
566 | + options = options || {}; | ||
567 | + if (value === null) { | ||
568 | + value = ''; | ||
569 | + options.expires = -1; | ||
570 | + } | ||
571 | + var expires = ''; | ||
572 | + if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { | ||
573 | + var date; | ||
574 | + if (typeof options.expires == 'number') { | ||
575 | + date = new Date(); | ||
576 | + date.setTime(date.getTime() + options.expires * 24 * 60 * 60 * 1000); | ||
577 | + } else { | ||
578 | + date = options.expires; | ||
579 | + } | ||
580 | + expires = '; expires=' + date.toUTCString(); | ||
581 | + } | ||
582 | + var path = options.path ? '; path=' + options.path : ''; | ||
583 | + var domain = options.domain ? '; domain=' + options.domain : ''; | ||
584 | + var secure = options.secure ? '; secure' : ''; | ||
585 | + document.cookie = [ | ||
586 | + name, | ||
587 | + '=', | ||
588 | + encodeURIComponent(value), | ||
589 | + expires, | ||
590 | + path, | ||
591 | + domain, | ||
592 | + secure | ||
593 | + ].join(''); | ||
594 | + } else { | ||
595 | + var cookieValue = null; | ||
596 | + if (document.cookie) { | ||
597 | + var cookies = document.cookie.split(';'); | ||
598 | + for (var i = 0; i < cookies.length; i++) { | ||
599 | + var cookie = util.trim(cookies[i]); | ||
600 | + if (cookie.substring(0, name.length + 1) == name + '=') { | ||
601 | + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); | ||
602 | + break; | ||
603 | + } | ||
604 | + } | ||
605 | + } | ||
606 | + return cookieValue; | ||
607 | + } | ||
608 | + }; | ||
609 | + return exports; | ||
610 | +}(); | ||
611 | +yas_jssdk_1015_src_ya_debug = function (exports) { | ||
612 | + yohojson2_100_json2_debug; | ||
613 | + var util = yas_jssdk_1015_src_util_debug; | ||
614 | + var cookies = yas_jssdk_1015_src_cookie_debug; | ||
615 | + var cross = yas_jssdk_1015_src_cross_debug; | ||
616 | + var ev = yas_jssdk_1015_src_event_debug; | ||
617 | + var config = yas_jssdk_1015_src_config_debug; | ||
618 | + var version = config.version; | ||
619 | + var yasPath = config.yaPath; | ||
620 | + var yasDomain = config.yasDomain; | ||
621 | + var appInfo = { | ||
622 | + h: document.domain, | ||
623 | + p: window.location.port, | ||
624 | + u: window.location.pathname, | ||
625 | + ft: 0, | ||
626 | + fst: 0, | ||
627 | + sv: '', | ||
628 | + ab: cookies('ab_5') || '' | ||
629 | + }; | ||
630 | + var VisitorId = getVisitorId(); | ||
631 | + var custInfo = { | ||
632 | + ak: '', | ||
633 | + cd: VisitorId.cid, | ||
634 | + vd: new Date().getTime() + VisitorId.cid, | ||
635 | + ud: '', | ||
636 | + rf: document.referrer, | ||
637 | + ckf: VisitorId.isNew | ||
638 | + }; | ||
639 | + var custOpInfo = { | ||
640 | + mp: '', | ||
641 | + ev: '', | ||
642 | + st: 0 | ||
643 | + }; | ||
644 | + var flash = util.flashChecker(); | ||
645 | + var browserInfo = { | ||
646 | + sr: window.screen.width + 'x' + window.screen.height, | ||
647 | + wr: window.screen.availWidth + 'x' + window.screen.availHeight, | ||
648 | + sd: window.screen.colorDepth, | ||
649 | + ln: window.navigator.language ? window.navigator.language : window.navigator.browserLanguage, | ||
650 | + sy: window.navigator.platform, | ||
651 | + ce: window.navigator.cookieEnabled, | ||
652 | + fv: flash.f ? flash.v : 0 | ||
653 | + }; | ||
654 | + var _yas = function (initTime, version, tid, uid, geo, selector) { | ||
655 | + custInfo.ak = tid; | ||
656 | + appInfo.sv = version; | ||
657 | + custInfo.ud = uid ? uid : ''; | ||
658 | + if (cookies('_yasgeo')) { | ||
659 | + var geoInfo = cookies('_yasgeo').split(','); | ||
660 | + custInfo.la = geoInfo[0]; | ||
661 | + custInfo.lo = geoInfo[1]; | ||
662 | + cookies('_yasgeo', null, { | ||
663 | + path: '/', | ||
664 | + domain: config.yasDomain, | ||
665 | + expires: 365 * 200 | ||
666 | + }); | ||
667 | + } | ||
668 | + var beginTime = new Date().getTime(); | ||
669 | + var sendFlag = null; | ||
670 | + var isOver3sSend = false; | ||
671 | + appInfo.ft = beginTime - initTime; | ||
672 | + ev.addEventHandler(window, 'load', function (e) { | ||
673 | + var endTime = new Date().getTime(); | ||
674 | + appInfo.fst = endTime - initTime; | ||
675 | + ev.removeEventHandler(window, 'load', arguments.callee); | ||
676 | + window.clearTimeout(sendFlag); | ||
677 | + if (!isOver3sSend) { | ||
678 | + send(); | ||
679 | + } | ||
680 | + }); | ||
681 | + sendFlag = window.setTimeout(function () { | ||
682 | + appInfo.fst = 0; | ||
683 | + appInfo.fse = '>3s'; | ||
684 | + isOver3sSend = true; | ||
685 | + send(); | ||
686 | + }, 3000); | ||
687 | + if (geo) { | ||
688 | + util.getGeo(function (lat, lng) { | ||
689 | + if (lat) { | ||
690 | + cookies('_yasgeo', lat + ',' + lng, { | ||
691 | + path: '/', | ||
692 | + domain: yasDomain, | ||
693 | + expires: 365 * 200 | ||
694 | + }); | ||
695 | + } | ||
696 | + }); | ||
697 | + } | ||
698 | + if (selector && selector[0]) { | ||
699 | + for (var i = 0, length = selector.length; i < length; i++) { | ||
700 | + selector[i].setAttribute('yoho_index', i + 1); | ||
701 | + } | ||
702 | + } else { | ||
703 | + ev.addEventHandler(document, 'click', function (e) { | ||
704 | + e = e || window.event; | ||
705 | + var target = e.target || e.srcElement; | ||
706 | + if (target && (target.nodeName === 'A' || target.nodeName === 'IMG' && target.parentNode.nodeName === 'A')) { | ||
707 | + var pos = getMouseEventPosition(e); | ||
708 | + var str = pos.x + ',' + pos.y + ',' + e.type; | ||
709 | + var yoho_index = target.getAttribute('yoho_index') || target.parentNode.getAttribute('yoho_index'); | ||
710 | + if (yoho_index) { | ||
711 | + str += ',' + yoho_index; | ||
712 | + } | ||
713 | + cookies('_yasmp', str, { | ||
714 | + path: '/', | ||
715 | + domain: yasDomain, | ||
716 | + expires: 365 * 200 | ||
717 | + }); | ||
718 | + } | ||
719 | + ix = 0; | ||
720 | + }); | ||
721 | + } | ||
722 | + onerror = handleErr; | ||
723 | + var txt = ''; | ||
724 | + function handleErr(msg, url, l) { | ||
725 | + txt = 'This page contains error! \n\n'; | ||
726 | + txt += 'Error message is\uFF1A' + msg + '\n'; | ||
727 | + txt += 'URL is: ' + url + '\n'; | ||
728 | + txt += 'Line is\uFF1A' + l + '\n\n'; | ||
729 | + var errString = JSON.stringify({ 'er': txt }); | ||
730 | + cookies('_yaserror', errString, { | ||
731 | + path: '/', | ||
732 | + domain: yasDomain, | ||
733 | + expires: 365 * 200 | ||
734 | + }); | ||
735 | + return false; | ||
736 | + } | ||
737 | + }; | ||
738 | + function send(callback) { | ||
739 | + var info = util.merge(appInfo, custInfo); | ||
740 | + info = util.merge(info, browserInfo); | ||
741 | + var mpJson = getMousePosition(); | ||
742 | + if (mpJson) { | ||
743 | + info = util.merge(info, mpJson); | ||
744 | + cookies('_yasmp', null, { | ||
745 | + path: '/', | ||
746 | + domain: config.yasDomain, | ||
747 | + expires: 365 * 200 | ||
748 | + }); | ||
749 | + } | ||
750 | + var _custJsonStr = cookies('_yascustjson'); | ||
751 | + if (_custJsonStr) { | ||
752 | + var custJson = JSON.parse(_custJsonStr); | ||
753 | + info = util.merge(info, custJson); | ||
754 | + cookies('_yascustjson', null, { | ||
755 | + path: '/', | ||
756 | + domain: config.yasDomain, | ||
757 | + expires: 365 * 200 | ||
758 | + }); | ||
759 | + } | ||
760 | + var _yasErrorStr = cookies('_yaserror'); | ||
761 | + if (_yasErrorStr) { | ||
762 | + var errorJson = JSON.parse(_yasErrorStr); | ||
763 | + info = util.merge(info, errorJson); | ||
764 | + cookies('_yaserror', null, { | ||
765 | + path: '/', | ||
766 | + domain: config.yasDomain, | ||
767 | + expires: 365 * 200 | ||
768 | + }); | ||
769 | + } | ||
770 | + var param = util.genParam(info); | ||
771 | + callback = callback ? callback : function () { | ||
772 | + }; | ||
773 | + cross.imgSend(param, callback); | ||
774 | + var _yasev = cookies('_yasev'); | ||
775 | + if (_yasev) { | ||
776 | + cross.imgSend(_yasev, function () { | ||
777 | + cookies('_yasev', null, { | ||
778 | + path: '/', | ||
779 | + domain: config.yasDomain, | ||
780 | + expires: 365 * 200 | ||
781 | + }); | ||
782 | + }); | ||
783 | + } | ||
784 | + } | ||
785 | + function getVisitorId() { | ||
786 | + var cid = cookies('_yasvd'); | ||
787 | + if (cid) { | ||
788 | + return { | ||
789 | + cid: cid, | ||
790 | + isNew: 'N' | ||
791 | + }; | ||
792 | + } | ||
793 | + cid = util.Random() ^ util.hashClientInfo() & 2147483647; | ||
794 | + cookies('_yasvd', cid, { | ||
795 | + path: '/', | ||
796 | + domain: yasDomain, | ||
797 | + expires: 365 * 200 | ||
798 | + }); | ||
799 | + return { | ||
800 | + cid: cid, | ||
801 | + isNew: 'Y' | ||
802 | + }; | ||
803 | + } | ||
804 | + function getMousePosition() { | ||
805 | + var mp = cookies('_yasmp'); | ||
806 | + if (mp) { | ||
807 | + var mpObject = mp.split(','); | ||
808 | + if (mpObject.length === 3) { | ||
809 | + return { | ||
810 | + x: mpObject[0], | ||
811 | + y: mpObject[1], | ||
812 | + et: mpObject[2] | ||
813 | + }; | ||
814 | + } else if (mpObject.length === 4) { | ||
815 | + return { | ||
816 | + x: mpObject[0], | ||
817 | + y: mpObject[1], | ||
818 | + et: mpObject[2], | ||
819 | + ix: mpObject[3] | ||
820 | + }; | ||
821 | + } | ||
822 | + } | ||
823 | + return null; | ||
824 | + } | ||
825 | + function getMouseEventPosition(e) { | ||
826 | + var x = 0, y = 0; | ||
827 | + if (e.pageX || e.pageY) { | ||
828 | + x = e.pageX; | ||
829 | + y = e.pageY; | ||
830 | + } else if (e.clientX || e.clientY) { | ||
831 | + x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; | ||
832 | + y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; | ||
833 | + } | ||
834 | + x -= window.screen.width / 2; | ||
835 | + y = window.screen.height / 2 - y; | ||
836 | + return { | ||
837 | + x: x, | ||
838 | + y: y | ||
839 | + }; | ||
840 | + } | ||
841 | + var evTimes = 0; | ||
842 | + _yas.add = function (trackType, input, action, label, value) { | ||
843 | + if (evTimes > 3) { | ||
844 | + cross.imgSend(cookies('_yasev'), function () { | ||
845 | + cookies('_yasev', null, { | ||
846 | + path: '/', | ||
847 | + domain: config.yasDomain, | ||
848 | + expires: 365 * 200 | ||
849 | + }); | ||
850 | + evTimes = 0; | ||
851 | + _addEv2Cookies(trackType, input, action, label, value); | ||
852 | + }); | ||
853 | + } else { | ||
854 | + _addEv2Cookies(trackType, input, action, label, value); | ||
855 | + } | ||
856 | + }; | ||
857 | + function _addEv2Cookies(trackType, input, action, label, value) { | ||
858 | + var ev = cookies('_yasev'); | ||
859 | + if (ev) { | ||
860 | + ev += '&'; | ||
861 | + } else { | ||
862 | + ev = ''; | ||
863 | + } | ||
864 | + cookies('_yasev', ev + 'vd=' + custInfo.vd + '&t=' + trackType + '&i=' + input + '&l=' + label + '&v=' + value, { | ||
865 | + path: '/', | ||
866 | + domain: yasDomain, | ||
867 | + expires: 365 * 200 | ||
868 | + }); | ||
869 | + evTimes++; | ||
870 | + } | ||
871 | + _yas.sendMouseEvent = function (e, flag) { | ||
872 | + e = e || window.event; | ||
873 | + var pos = getMouseEventPosition(e); | ||
874 | + if (!flag) { | ||
875 | + cookies('_yasmp', pos.x + ',' + pos.y + ',' + e.type, { | ||
876 | + path: '/', | ||
877 | + domain: yasDomain, | ||
878 | + expires: 365 * 200 | ||
879 | + }); | ||
880 | + } else { | ||
881 | + var mp = { | ||
882 | + x: pos.x, | ||
883 | + y: pos.y, | ||
884 | + et: e.type | ||
885 | + }; | ||
886 | + var info = util.merge(appInfo, custInfo); | ||
887 | + info = util.merge(info, browserInfo); | ||
888 | + info = util.merge(info, mp); | ||
889 | + var param = util.genParam(info); | ||
890 | + cross.imgSend(param, function () { | ||
891 | + }); | ||
892 | + } | ||
893 | + }; | ||
894 | + _yas.sendCustomInfo = function (json, flag) { | ||
895 | + if (!flag) { | ||
896 | + var string = JSON.stringify(json); | ||
897 | + cookies('_yascustjson', string, { | ||
898 | + path: '/', | ||
899 | + domain: yasDomain, | ||
900 | + expires: 365 * 200 | ||
901 | + }); | ||
902 | + } else { | ||
903 | + var info = util.merge(appInfo, custInfo); | ||
904 | + info = util.merge(info, browserInfo); | ||
905 | + info = util.merge(info, json); | ||
906 | + var param = util.genParam(info); | ||
907 | + cross.imgSend(param, function () { | ||
908 | + }); | ||
909 | + } | ||
910 | + }; | ||
911 | + exports = _yas; | ||
912 | + return exports; | ||
913 | +}(); | ||
914 | +yas_jssdk_1015_yas_debug = function (exports) { | ||
915 | + var yasJssdk = yas_jssdk_1015_src_ya_debug; | ||
916 | + if (window.YohoAcquisitionObject) { | ||
917 | + var yas = window.YohoAcquisitionObject; | ||
918 | + if (window[yas].p) { | ||
919 | + yasJssdk.apply(this, window[yas].p); | ||
920 | + window[yas] = yasJssdk; | ||
921 | + } | ||
922 | + } | ||
923 | + exports = yasJssdk; | ||
924 | + return exports; | ||
925 | +}(); | ||
926 | +}()); |
static/dist/yas-jssdk/1.0.15/yas.js
0 → 100644
1 | +!function(){var yohojson2_100_json2,yas_jssdk_1015_src_config,yas_jssdk_1015_src_cross,yas_jssdk_1015_src_event,yas_jssdk_1015_src_util,yas_jssdk_1015_src_cookie,yas_jssdk_1015_src_ya,yas_jssdk_1015_yas;yohojson2_100_json2=function(){"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(e){return 10>e?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,function(e){var n=meta[e];return"string"==typeof n?n:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,n){var t,r,o,a,i,s=gap,u=n[e];switch(u&&"object"==typeof u&&"function"==typeof u.toJSON&&(u=u.toJSON(e)),"function"==typeof rep&&(u=rep.call(n,e,u)),typeof u){case"string":return quote(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":return String(u);case"object":if(!u)return"null";if(gap+=indent,i=[],"[object Array]"===Object.prototype.toString.apply(u)){for(a=u.length,t=0;a>t;t+=1)i[t]=str(t,u)||"null";return o=0===i.length?"[]":gap?"[\n"+gap+i.join(",\n"+gap)+"\n"+s+"]":"["+i.join(",")+"]",gap=s,o}if(rep&&"object"==typeof rep)for(a=rep.length,t=0;a>t;t+=1)"string"==typeof rep[t]&&(r=rep[t],o=str(r,u),o&&i.push(quote(r)+(gap?": ":":")+o));else for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(o=str(r,u),o&&i.push(quote(r)+(gap?": ":":")+o));return o=0===i.length?"{}":gap?"{\n"+gap+i.join(",\n"+gap)+"\n"+s+"}":"{"+i.join(",")+"}",gap=s,o}}var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;"function"!=typeof JSON.stringify&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(e,n,t){var r;if(gap="",indent="","number"==typeof t)for(r=0;t>r;r+=1)indent+=" ";else"string"==typeof t&&(indent=t);if(rep=n,n&&"function"!=typeof n&&("object"!=typeof n||"number"!=typeof n.length))throw new Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,n){var t,r,o=e[n];if(o&&"object"==typeof o)for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(r=walk(o,t),void 0!==r?o[t]=r:delete o[t]);return reviver.call(e,n,o)}var j;if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()}(),yas_jssdk_1015_src_config=function(e){function n(){var e=document.domain.split("."),n=e.length;return n>1&&isNaN(e[n-1])?"."+e[n-2]+"."+e[n-1]:document.domain}return e={version:"1.0",yasPath:"/web/",yasDomain:n(),yasImgDomain:"http://analytics.m.yohobuy.com/yas.gif"}}(),yas_jssdk_1015_src_cross=function(e){var n=yas_jssdk_1015_src_config,t=n.yasPath,r=n.yasImgDomain;return e.imgSend=function(e,n){var o=new Image(1,1);o.src=r+t+"?"+e,o.onload=function(){o.onload=null,n&&n()}},e}({}),yas_jssdk_1015_src_event=function(e){return e.addEventHandler=function(e,n,t){e.addEventListener?e.addEventListener(n,t,!1):e.attachEvent?e.attachEvent("on"+n,t):e["on"+n]=t},e.removeEventHandler=function(e,n,t){e.removeEventListener?e.removeEventListener(n,t,!1):e.detachEvent?e.detachEvent("on"+n,t):delete e["on"+n]},e}({}),yas_jssdk_1015_src_util=function(e){{var n=yas_jssdk_1015_src_config;n.yaPath,n.yasDomain}return e.flashChecker=function(){var e=0,n=0,t=0,r=null;return t?(r=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),r&&(e=1,n=r.GetVariable("$version"))):navigator.plugins&&navigator.plugins.length>0&&(r=navigator.plugins["Shockwave Flash"],r&&(e=1,n=r.description.replace("Shockwave Flash",""))),{f:e,v:n}},e.Hash=function(e){var n,t=1,r=0;if(e)for(t=0,n=e.length-1;n>=0;n--)r=e.charCodeAt(n),t=(t<<6&268435455)+r+(r<<14),r=266338304&t,0!==r&&(t^=r>>21);return t},e.Random=function(){return Math.round(2147483647*Math.random())},e.hashClientInfo=function(){var n=window.navigator,t=window.history.length,r=[n.appName,n.version,n.language,n.platform,n.userAgent,n.javaEnabled(),window.screen,window.screen.colorDepth,window.document.cookie?window.document.cookie:"",window.document.referrer?window.document.referrer:""];n=r.join("");for(var o=n.length;t>0;)n+=t--^o++;return e.Hash(n)},e.merge=function(e,n){var t={};for(var r in e)t[r]=e[r];for(var o in n)t[o]=n[o];return t},e.genParam=function(e){var n=[];for(var t in e)n.push(t+"="+e[t]);return n.join("&")},e.trim=function(e){if(String.prototype.trim)return null===e?"":String.prototype.trim.call(e);var n=/^\s+/,t=/\s+$/,r="";return e?(r=e.toString().replace(n,""),r=r.replace(t,"")):void 0},e.getGeo=function(e){function n(n){var t=n.coords.longitude,r=n.coords.latitude;e(r,t)}function t(){e(!1)}if(window.navigator.geolocation){var r={enableHighAccuracy:!0};window.navigator.geolocation.getCurrentPosition(n,t,r)}else e(!1)},e}({}),yas_jssdk_1015_src_cookie=function(e){var n=yas_jssdk_1015_src_util;return e=function(e,t,r){if("undefined"==typeof t){var o=null;if(document.cookie)for(var a=document.cookie.split(";"),i=0;i<a.length;i++){var s=n.trim(a[i]);if(s.substring(0,e.length+1)==e+"="){o=decodeURIComponent(s.substring(e.length+1));break}}return o}r=r||{},null===t&&(t="",r.expires=-1);var u="";if(r.expires&&("number"==typeof r.expires||r.expires.toUTCString)){var c;"number"==typeof r.expires?(c=new Date,c.setTime(c.getTime()+24*r.expires*60*60*1e3)):c=r.expires,u="; expires="+c.toUTCString()}var f=r.path?"; path="+r.path:"",d=r.domain?"; domain="+r.domain:"",l=r.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(t),u,f,d,l].join("")}}(),yas_jssdk_1015_src_ya=function(e){function n(e){var n=i.merge(l,g);n=i.merge(n,v);var t=r();t&&(n=i.merge(n,t),s("_yasmp",null,{path:"/",domain:f.yasDomain,expires:73e3}));var o=s("_yascustjson");if(o){var a=JSON.parse(o);n=i.merge(n,a),s("_yascustjson",null,{path:"/",domain:f.yasDomain,expires:73e3})}var c=s("_yaserror");if(c){var d=JSON.parse(c);n=i.merge(n,d),s("_yaserror",null,{path:"/",domain:f.yasDomain,expires:73e3})}var p=i.genParam(n);e=e?e:function(){},u.imgSend(p,e);var _=s("_yasev");_&&u.imgSend(_,function(){s("_yasev",null,{path:"/",domain:f.yasDomain,expires:73e3})})}function t(){var e=s("_yasvd");return e?{cid:e,isNew:"N"}:(e=i.Random()^2147483647&i.hashClientInfo(),s("_yasvd",e,{path:"/",domain:d,expires:73e3}),{cid:e,isNew:"Y"})}function r(){var e=s("_yasmp");if(e){var n=e.split(",");if(3===n.length)return{x:n[0],y:n[1],et:n[2]};if(4===n.length)return{x:n[0],y:n[1],et:n[2],ix:n[3]}}return null}function o(e){var n=0,t=0;return e.pageX||e.pageY?(n=e.pageX,t=e.pageY):(e.clientX||e.clientY)&&(n=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,t=e.clientY+document.body.scrollTop+document.documentElement.scrollTop),n-=window.screen.width/2,t=window.screen.height/2-t,{x:n,y:t}}function a(e,n,t,r,o){var a=s("_yasev");a?a+="&":a="",s("_yasev",a+"vd="+g.vd+"&t="+e+"&i="+n+"&l="+r+"&v="+o,{path:"/",domain:d,expires:73e3}),m++}var i=yas_jssdk_1015_src_util,s=yas_jssdk_1015_src_cookie,u=yas_jssdk_1015_src_cross,c=yas_jssdk_1015_src_event,f=yas_jssdk_1015_src_config,d=(f.version,f.yaPath,f.yasDomain),l={h:document.domain,p:window.location.port,u:window.location.pathname,ft:0,fst:0,sv:"",ab:s("ab_5")||""},p=t(),g={ak:"",cd:p.cid,vd:(new Date).getTime()+p.cid,ud:"",rf:document.referrer,ckf:p.isNew},_=i.flashChecker(),v={sr:window.screen.width+"x"+window.screen.height,wr:window.screen.availWidth+"x"+window.screen.availHeight,sd:window.screen.colorDepth,ln:window.navigator.language?window.navigator.language:window.navigator.browserLanguage,sy:window.navigator.platform,ce:window.navigator.cookieEnabled,fv:_.f?_.v:0},y=function(e,t,r,a,u,p){function _(e,n,t){j="This page contains error! \n\n",j+="Error message is\uff1a"+e+"\n",j+="URL is: "+n+"\n",j+="Line is\uff1a"+t+"\n\n";var r=JSON.stringify({er:j});return s("_yaserror",r,{path:"/",domain:d,expires:73e3}),!1}if(g.ak=r,l.sv=t,g.ud=a?a:"",s("_yasgeo")){var v=s("_yasgeo").split(",");g.la=v[0],g.lo=v[1],s("_yasgeo",null,{path:"/",domain:f.yasDomain,expires:73e3})}var y=(new Date).getTime(),m=null,h=!1;if(l.ft=y-e,c.addEventHandler(window,"load",function(){var t=(new Date).getTime();l.fst=t-e,c.removeEventHandler(window,"load",arguments.callee),window.clearTimeout(m),h||n()}),m=window.setTimeout(function(){l.fst=0,l.fse=">3s",h=!0,n()},3e3),u&&i.getGeo(function(e,n){e&&s("_yasgeo",e+","+n,{path:"/",domain:d,expires:73e3})}),p&&p[0])for(var w=0,x=p.length;x>w;w++)p[w].setAttribute("yoho_index",w+1);else c.addEventHandler(document,"click",function(e){e=e||window.event;var n=e.target||e.srcElement;if(n&&("A"===n.nodeName||"IMG"===n.nodeName&&"A"===n.parentNode.nodeName)){var t=o(e),r=t.x+","+t.y+","+e.type,a=n.getAttribute("yoho_index")||n.parentNode.getAttribute("yoho_index");a&&(r+=","+a),s("_yasmp",r,{path:"/",domain:d,expires:73e3})}ix=0});onerror=_;var j=""},m=0;return y.add=function(e,n,t,r,o){m>3?u.imgSend(s("_yasev"),function(){s("_yasev",null,{path:"/",domain:f.yasDomain,expires:73e3}),m=0,a(e,n,t,r,o)}):a(e,n,t,r,o)},y.sendMouseEvent=function(e,n){e=e||window.event;var t=o(e);if(n){var r={x:t.x,y:t.y,et:e.type},a=i.merge(l,g);a=i.merge(a,v),a=i.merge(a,r);var c=i.genParam(a);u.imgSend(c,function(){})}else s("_yasmp",t.x+","+t.y+","+e.type,{path:"/",domain:d,expires:73e3})},y.sendCustomInfo=function(e,n){if(n){var t=i.merge(l,g);t=i.merge(t,v),t=i.merge(t,e);var r=i.genParam(t);u.imgSend(r,function(){})}else{var o=JSON.stringify(e);s("_yascustjson",o,{path:"/",domain:d,expires:73e3})}},e=y}(),yas_jssdk_1015_yas=function(e){var n=yas_jssdk_1015_src_ya;if(window.YohoAcquisitionObject){var t=window.YohoAcquisitionObject;window[t].p&&(n.apply(this,window[t].p),window[t]=n)}return e=n}()}(); |
-
Please register or login to post a comment