test(n)?null:e.parseJSON(n))}catch(e){o=e}o?a(o,"parsererror",k,p,w):t(n,k,p,w)}else a(k.statusText||null,k.status?"error":"abort",k,p,w)}},!1===o(k,p))return k.abort(),a(null,"abort",k,p,w),k;if(p.xhrFields)for(c in p.xhrFields)k[c]=p.xhrFields[c];var T=!("async"in p)||p.async;for(c in k.open(p.type,p.url,T,p.username,p.password),D)N.apply(k,D[c]);return p.timeout>0&&(b=setTimeout((function(){k.onreadystatechange=r,k.abort(),a(null,"timeout",k,p,w)}),p.timeout)),k.send(p.data?p.data:null),k},e.get=function(n,o,t,a){return e.ajax(s.apply(null,arguments))},e.post=function(n,o,t,a){var i=s.apply(null,arguments);return i.type="POST",e.ajax(i)},e.getJSON=function(n,o,t){var a=s.apply(null,arguments);return a.dataType="json",e.ajax(a)},e.fn.load=function(n,o,t){if(!this.length)return this;var a,i=this,r=n.split(/\s/),d=s(n,o,t),l=d.success;return r.length>1&&(d.url=r[0],a=r[1]),d.success=function(n){i.html(a?e("<div>").html(n.replace(u,"")).find(a):n),l&&l.apply(i,arguments)},e.ajax(d),this};var _=encodeURIComponent;e.param=function(n,o){var t=[];return t.add=function(e,n){this.push(_(e)+"="+_(n))},function n(o,t,a,i){var r,d=e.isArray(t),s=e.isPlainObject(t);e.each(t,(function(t,l){r=e.type(l),i&&(t=a?i:i+"["+(s||"object"==r||"array"==r?t:"")+"]"),!i&&d?o.add(l.name,l.value):"array"==r||!a&&"object"==r?n(o,l,a,t):o.add(t,l)}))}(t,n,o),t.join("&").replace(/%20/g,"+")}}(a),(t=a).fn.serializeArray=function(){var e,n=[];return t([].slice.call(this.get(0).elements)).each((function(){var o=(e=t(this)).attr("type");"fieldset"!=this.nodeName.toLowerCase()&&!this.disabled&&"submit"!=o&&"reset"!=o&&"button"!=o&&("radio"!=o&&"checkbox"!=o||this.checked)&&n.push({name:e.attr("name"),value:e.val()})})),n},t.fn.serialize=function(){var e=[];return this.serializeArray().forEach((function(n){e.push(encodeURIComponent(n.name)+"="+encodeURIComponent(n.value))})),e.join("&")},t.fn.submit=function(e){if(e)this.bind("submit",e);else if(this.length){var n=t.Event("submit");this.eq(0).trigger(n),n.isDefaultPrevented()||this.get(0).submit()}return this},function(e){"__proto__"in{}||e.extend(e.zepto,{Z:function(n,o){return n=n||[],e.extend(n,e.fn),n.selector=o||"",n.__Z=!0,n},isZ:function(n){return"array"===e.type(n)&&"__Z"in n}});try{getComputedStyle(void 0)}catch(e){var n=getComputedStyle;window.getComputedStyle=function(e){try{return n(e)}catch(e){return null}}}}(a)},function(e,n){var o;(o=Zepto).extend(o.fn,{cookie:function(e,n,t){var a,i,r,d;return arguments.length>1&&"[object Object]"!==String(n)?(t=o.extend({},t),null==n&&(t.expires=-1),"number"==typeof t.expires&&(a=24*t.expires*60*60*1e3,(i=t.expires=new Date).setTime(i.getTime()+a)),n=String(n),document.cookie=[encodeURIComponent(e),"=",t.raw?n:encodeURIComponent(n),t.expires?"; expires="+t.expires.toUTCString():"",t.path?"; path="+t.path:"",t.domain?"; domain="+t.domain:"",t.secure?"; secure":""].join("")):(d=(t=n||{}).raw?function(e){return e}:decodeURIComponent,(r=new RegExp("(?:^|; )"+encodeURIComponent(e)+"=([^;]*)").exec(document.cookie))?d(r[1]):null)}})},function(e,n){window.JsBridge=function(e,n,o){(e=e||{}).SCENE_NONE=0,e.SCENE_DOWNLOADER=1,e.SCENE_DOWNLOADER_DETAIL=2|e.SCENE_DOWNLOADER,e.SCENE_DOWNLOADER_EXTERNAL=4|e.SCENE_DOWNLOADER,e.SCENE_DOWNLOADER_SDK=8|e.SCENE_DOWNLOADER,e.SCENE_MOBILEQ=16,e.SCENE_WECHAT=32,e.SCENE_MTT=4096,e.SCENE=e.SCENE_NONE,e._greaterThanOrEqual=function(e,n){e=String(e).split("."),n=String(n).split(".");try{for(var o=0,t=Math.max(e.length,n.length);o<t;o++){var a=isFinite(e[o])&&Number(e[o])||0,i=isFinite(n[o])&&Number(n[o])||0;if(a<i)return!1;if(a>i)return!0}}catch(e){return!1}return!0};var t=[],a={};e.callWithScheme=function(n){e._callWithScheme(n)},e._callWithScheme=function(e,n){for(var o,i=0;(o=t[i])&&o._busy;i++);o&&!o._busy||(o=function(){var e=document.createElement("iframe");return t.push(e),e.style.cssText="position:absolute;left:0;top:0;width:0;height:0;visibility:hidden;",e.frameBorder="0",document.body.appendChild(e),e}()),o._busy=!0,a[n]=o,o.src=e},e._callback=function(e){a[e]&&(a[e]._busy=!1,delete a[e])},e.ready=!1;var i=[];e.onReady=function(n){e.ready?n&&n():n&&i.push(n)},e._readyCallback=function(){if(console.log("ready timestamp",Date.now()-window.gTimeStamps[0]),!e.ready){e.ready=!0;for(var n,o=0;n=i[o];o++)n()}};var r=function e(n,o,t){this.args=n||{},this.callback=o,this.context=t,this.identifier=0,this.state=1,this.percentage=0,e._instances[this.args.packageName]=this,this._init()};return r._instances={},r.HAS_PERCENTAGE=!0,r.STATE_READY=1,r.STATE_QUEUING=2,r.STATE_DOWNLOADING=3,r.STATE_PAUSED=4,r.STATE_DOWNLOADED=5,r.STATE_INSTALLING=6,r.STATE_INSTALLED=7,r.STATE_FAILED=8,r.STATE_FAILED_OF_SDCARD=9,r.STATE_REMOVED=10,r.STATE_CANCAL=11,r._getDownloadState=function(e,n){return e=r._stateMap[e],n&&e==r.STATE_FAILED&&(e=r.STATE_READY),e},r.prototype._callback=function(e,n){if(e)switch(this.state=e,this.state){case r.STATE_READY:case r.STATE_FAILED:case r.STATE_FAILED_OF_SDCARD:case r.STATE_CANCAL:case r.STATE_REMOVED:this.percentage=0;break;case r.STATE_DOWNLOADED:case r.STATE_INSTALLING:case r.STATE_INSTALLED:this.percentage=100}n&&((this.state==r.STATE_DOWNLOADING||this.state==r.STATE_PAUSED)&&r.HAS_PERCENTAGE&&isFinite(n.percentage)&&(this.percentage=n.percentage),n.identifier&&(this.identifier!=n.identifier?(delete r._instances[this.identifier],r._instances[this.identifier=n.identifier]=this):r._instances[this.identifier]!=this&&(r._instances[this.identifier]=this))),this.callback&&this.callback.call(this,this.state,this.percentage,this.context,n)},r.prototype.doAction=function(){switch(this.state){case r.STATE_QUEUING:case r.STATE_DOWNLOADING:this.stop();break;case r.STATE_DOWNLOADED:this.install();break;case r.STATE_INSTALLED:this.args.isUpdate?this.start():e.startApp(this.args.packageName);break;default:this.start()}},r.prototype.dispose=function(){return delete r._instances[this.identifier],delete r._instances[this.args.packageName],!0},e.Download=r,e.SHARE_USER_SELECTION=0,e.SHARE_MOBILEQ=1,e.SAHRE_QZONE=2,e.SAHRE_WECHAT=3,e.SAHRE_WECHAT_TIMELINE=4,e.SHARE_USER_SELECTION_POPUP=5,e._shareInfo={iconUrl:"",jumpUrl:location.href,title:document.

Prev | Next
Pg.: 1 ... 19 20 21 22 23 24 25 26 27 28 29 ... 41


Back to home | File page

Subscribe | Register | Login | N