This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** @inner Event对象兼容处理 */ | |
| fix: function (event) { | |
| if (event.target) return event; | |
| var event2 = { | |
| target: event.srcElement || document, | |
| preventDefault: function () {event.returnValue = false}, | |
| stopPropagation: function () {event.cancelBubble = true} | |
| }; | |
| // IE6/7/8 在原生window.event对象写入数据会导致内存无法回收,应当采用拷贝 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var baseElement = h.getElementsByTagName('base')[0]; | |
| node = document.createElement('script'); | |
| node.charset = this._charset || 'utf-8'; | |
| node.onload = node.onreadystatechange = function () { | |
| if (!node.readyState || node.readyState == 'complete' || node.readyState == 'loaded') { | |
| node.onload = node.onreadystatechange = null; | |
| if (node.parentNode) { | |
| h.removeChild(node); | |
| } | |
| callback(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| optmz = function (st) { | |
| return function (fns, tm) { | |
| var aargs; | |
| if (typeof fns == 'string') { | |
| return st(fns, tm); | |
| } else { | |
| aargs = Array.prototype.slice.call(arguments, 2); | |
| return st(function () { | |
| fns.apply(null, aargs); | |
| }, tm); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getRealLen: function (s, isUTF8) { | |
| if (typeof(s) != 'string') { | |
| return 0; | |
| } | |
| if (!isUTF8) { | |
| return s.replace(QZFL.string.RegExps.getRealLen.r0, "**").length; | |
| } else { | |
| var cc = s.replace(QZFL.string.RegExps.getRealLen.r1, ""); | |
| return(s.length - cc.length) + (encodeURI(cc).length / 3); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var _Queue = function (key, queue) { | |
| if (this instanceof arguments.callee) { | |
| this._qz_queuekey = key; | |
| return this; | |
| } | |
| if (_o.getType(queue = queue || []) == "array") { | |
| _queue[key] = queue; | |
| } | |
| return new _Queue(key); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var url = node.hasAttribute ? // non-IE6/7 | |
| node.src : | |
| // see http://msdn.microsoft.com/en-us/library/ms536429(VS.85).aspx | |
| node.getAttribute('src', 4); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| var timer = null; | |
| $(window).resize(function () { | |
| if (timer) { | |
| clearTimeout(timer); | |
| } | |
| timer = setTimeout(function () { | |
| $(window).trigger('windowResize'); | |
| timer = null; | |
| }, 100); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getRelatedTarget: function (ev) { | |
| ev = QZFL.event.getEvent(ev); | |
| var t = ev.relatedTarget; | |
| if (!t)if (ev.type == "mouseout")t = ev.toElement; else if (ev.type == "mouseover")t = ev.fromElement; else; | |
| return t | |
| }, onDomReady: function (fn) { | |
| var _s = QZFL.event.onDomReady; | |
| QZFL.event._bindReady(); | |
| _s.pool.push(fn) | |
| }, _bindReady: function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LIB.setTimeout = function (callback, timeout, context, args) { | |
| return setTimeout(function () { | |
| callback.apply(context, args || []) | |
| }, timeout) | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| baidu.sio._createScriptTag = function (b, a, c) { | |
| b.setAttribute("type", "text/javascript"); | |
| c && b.setAttribute("charset", c); | |
| b.setAttribute("src", a); | |
| document.getElementsByTagName("head")[0].appendChild(b) | |
| }; | |
| baidu.sio._removeScriptTag = function (b) { | |
| if (b.clearAttributes) { | |
| b.clearAttributes() | |
| } else { |