1 line
162 KiB
JavaScript
1 line
162 KiB
JavaScript
|
if(!window.plus||window.plus&&!window.plus.isReady){var plusType=typeof window.plus;"function"==plusType||"object"==plusType?(window.plus.isReady=!0,navigator.plus=window.__html5plus__=window.plus):window.__html5plus__=window.plus=navigator.plus={isReady:!0}}!function(e){var t=e.tools={__UUID__:0,UNKNOWN:-1,IOS:0,ANDROID:1,platform:-1,debug:!1,UUID:function(e){return e+this.__UUID__+++(new Date).valueOf()},extend:function(e,t){for(var n in t)e[n]=t[n]},typeName:function(e){return Object.prototype.toString.call(e).slice(8,-1)},isDate:function(e){return"Date"==t.typeName(e)},isArray:function(e){return"Array"==t.typeName(e)},isDebug:function(){return e.tools.debug},stringify:function(e){return window.JSON3?window.JSON3.stringify(e):JSON.stringify(e)},isNumber:function(e){return"number"==typeof e||e instanceof Number},getElementOffsetInWebview:function(e,t){for(var n=0,i=e;i;)n+=i[t],i=i.offsetParent;return n},getElementOffsetXInWebview:function(e){return t.getElementOffsetInWebview(e,"offsetLeft")},getElementOffsetYInWebview:function(e){return t.getElementOffsetInWebview(e,"offsetTop")},execJSfile:function(e){var t=document.createElement("script");t.type="text/javascript",t.src=e,function e(t){var n=document.head,i=document.body;n?n.insertBefore(t,n.firstChild):i?i.insertBefore(t,i.firstChild):setTimeout(function(){e(t)},100)}(t)},copyObjProp2Obj:function(e,t,n){var i=n instanceof Array;for(var o in t){var r=!0;if(i)for(var c=0;c<n.length;c++)if(o==n[c]){r=!1;break}r?e[o]=t[o]:r=!0}},clone:function(e){if(!e||"function"==typeof e||t.isDate(e)||"object"!=typeof e)return e;var n,i;if(t.isArray(e)){for(n=[],i=0;i<e.length;++i)n.push(t.clone(e[i]));return n}for(i in n={},e)i in n&&n[i]==e[i]||(n[i]=t.clone(e[i]));return n}};t.debug=!(!window.__nativeparamer__||!window.__nativeparamer__.debug),t.platform=window._____platform_____}(window.plus),function(plus){window.__prompt__=window.prompt;var T=plus.tools,B=plus.bridge={NO_RESULT:0,OK:1,CLASS_NOT_FOUND_EXCEPTION:2,ILLEGAL_ACCESS_EXCEPTION:3,INSTANTIATION_EXCEPTION:4,MALFORMED_URL_EXCEPTION:5,IO_EXCEPTION:6,INVALID_ACTION:7,JSON_EXCEPTION:8,ERROR:9,callbacks:{},isInEvalJs:0,exec:function(e,t,n,i,o){if(n&&n.push(i),T.IOS==T.platform){if(window.webkit&&window.webkit.messageHandlers)return void window.webkit.messageHandlers.plus.postMessage(T.stringify([window.__HtMl_Id__,e,t,i||null,n]));"function"==typeof __dc_plus_Command_&&__dc_plus_Command_(T.stringify([window.__HtMl_Id__,e,t,i||null,n]))}else T.ANDROID==T.platform&&(o||window._____platform_os_version_____&&window._____platform_os_version_____<21?window.__prompt__(T.stringify(n),"pdr:"+T.stringify([e,t,!0])):window._bridge.prompt(T.stringify(n),"pdr:"+T.stringify([e,t,!0])))},execSync2:function(e,t,n,i,o){try{if(T.IOS==T.platform&&"function"==typeof __dc__plusGo){var r=T.stringify([window.__HtMl_Id__,e,t,null,n]),c=__dc__plusGo(r);return i?i(c):window.eval(c)}}catch(n){console.log("sf:"+t+"-"+e)}return B.execSync(e,t,n,i,o)},execSync:function(service,action,args,fn,force){if(T.IOS==T.platform){if("function"==typeof __dc__plusGo){var json=T.stringify([window.__HtMl_Id__,service,action,null,args]),ret=__dc__plusGo(json);return fn?fn(ret):window.eval(ret)}try{if(window.webkit&&window.webkit.messageHandlers){var json=T.stringify([window.__HtMl_Id__,service,action,null,args]),retValue=prompt(json,"__dc__plusGo:");return fn?fn(retValue):window.eval(retValue)}}catch(e){console.log("sf:"+action+"-"+service)}return window.eval(sync.responseText)}var ret;if(T.ANDROID==T.platform)return ret=force||window._____platform_os_version_____&&window._____platform_os_version_____<21?window.__prompt__(T.stringify(args),"pdr:"+T.stringify([service,action,!1])):window._bridge.prompt(T.stringify(args),"pdr:"+T.stringify([service,action,!1])),fn?fn(ret):eval(ret)},callbackFromNative:function(e,t){var n=B.callbacks[e];n&&(t.status==B.OK&&n.success?n.success&&n.success(t.message):n.fail&&n.fail(t.message),t.keepCallback||delete B.callbacks[e])},callbackId:function(e,t){var n=T.UUID("plus");return B.callbacks[n]={success:e,fail:t},n}}}(window.plus),plus.
|