app-methods
Advanced tools
Comparing version 0.0.1 to 0.0.2
/*! | ||
* app.js v0.0.1 | ||
* app.js v0.0.2 | ||
* Released by https://github.com/lmk123 | ||
@@ -4,0 +4,0 @@ */ |
/*! | ||
* app.js v0.0.1 | ||
* app.js v0.0.2 | ||
* Released by https://github.com/lmk123 | ||
@@ -4,0 +4,0 @@ */ |
/*! | ||
* app.js v0.0.1 | ||
* app.js v0.0.2 | ||
* Released by https://github.com/lmk123 | ||
@@ -4,0 +4,0 @@ */ |
/*! | ||
* app.js v0.0.1 | ||
* app.js v0.0.2 | ||
* Released by https://github.com/lmk123 | ||
*/ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.app=e.app||{})}(this,function(e){"use strict";function n(){try{App.hideBar()}catch(e){}}function t(){try{App.showBar()}catch(e){}}function i(){try{App.close()}catch(e){}}function o(){u.then(function(){yasuo.page.finish()})}function r(){u.then(function(){yasuo.page.hideBar()})}function a(){u.then(function(){yasuo.page.showBar()})}function c(){u=new Promise(function(e){document.addEventListener("yasuoReady",e)}),d()}function d(){function e(e,n,i){window.WebViewJavascriptBridge.callHandler(e,n,function(e){if(i){var n=t?JSON.parse(e):e;n.err?i(n.err,null):n.res&&i(null,n.res)}})}function n(n,t){var i={};i.data=JSON.stringify(n)||"",e("Toast",JSON.stringify(i),t)}var t=h.indexOf("android")>-1,i=h.indexOf("iphone")>-1,o={showBar:function(){e("TitleBar","show",null)},hideBar:function(){e("TitleBar","hide",null)},finish:function(){e("Page","finish",null)},showLoading:function(n,t){n=n||{},n.mode="show",e("Loading",n,t)},hideLoading:function(n,t){n=n||{},n.mode="hide",e("Loading",n,t)}},r={getTime:function(n,t){n=n||{},n.mode="time",e("TimePicker",n,t)},getDate:function(n,t){n=n||{},n.mode="date",e("TimePicker",n,t)},getTimeDate:function(n,t){n=n||{},n.mode="time_date",e("TimePicker",n,t)}},a={hide:function(n,t){n=n||{},n.mode="hide",e("Keyboard",n,t)},show:function(n,t){n=n||{},n.mode="show",e("Keyboard",n,t)}},c={getPicture:function(n,t){n=n||{},n.mode="image",e("Camera",n,t)},getAlbum:function(n,t){n=n||{},n.mode="album",e("Camera",n,t)}},d={transfer:function(n,t){e("File",n,t)}},u={checkVersion:function(n){var t={};t.mode="checkVersion",e("App",t,n)},info:function(n){var t={};t.mode="info",e("App",t,n)},hotUpdate:function(n){var t={};t.mode="hotupdate",e("App",t,n)}},f=function(n){e("Device",{},n)},s={logout:function(n){var t={};t.mode="logout",e("User",t,n)},clearToken:function(n){var t={};t.mode="clear",e("User",t,n)}},v=window.yasuo={init:function(e){window.WebViewJavascriptBridge.init(e)},isAndroid:function(){return t},isIOS:function(){return i},showToast:n,camera:c,keyboard:a,timePicker:r,page:o,file:d,network:function(n){e("NetworkInfo",{},n)},app:u,device:f,user:s,version:"0.0.1"};document.addEventListener("WebViewJavascriptBridgeReady",function(){var e=window.WebViewJavascriptBridge;if(e){var n=document.createEvent("Events");n.initEvent("yasuoReady"),document.dispatchEvent(n),v.init();var t=document.createEvent("Events");t.initEvent("Keyboard.hide");var i=document.createEvent("Events");i.initEvent("Keyboard.show"),e.registerHandler("Keyboard.hide",function(e,n){document.dispatchEvent(t)}),e.registerHandler("Keyboard.show",function(e,n){document.dispatchEvent(i)});var o=document.createEvent("Events");o.initEvent("onLandscapeScreen"),e.registerHandler("onLandscapeScreen",function(e,n){document.dispatchEvent(o)});var r=document.createEvent("Events");r.initEvent("onPortraitScreen"),e.registerHandler("onPortraitScreen",function(e,n){document.dispatchEvent(r)});var a=document.createEvent("Events");a.initEvent("networkStateChange"),e.registerHandler("networkStateChange",function(e,n){a.data=e,document.dispatchEvent(a)})}})}var u,f,s=Object.freeze({hideBar:n,showBar:t,exit:i}),h=navigator.userAgent.toLowerCase(),v=Object.freeze({exit:o,hideBar:r,showBar:a,init:c}),p=function(){},m=Object.freeze({hideBar:p,showBar:p,exit:p}),g=Object.freeze({ping:s,xy:v,other:m});f=h.indexOf("ping")>=0?"ping":h.indexOf("eve")>=0?"xy":"other";var w=f,l=g[w];l.init&&l.init();var y=l.hideBar,E=l.showBar,B=l.exit;e.platform=w,e.hideBar=y,e.showBar=E,e.exit=B,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "app-methods", | ||
"version": "0.0.1", | ||
"main": "dist/app-bridge.common.js", | ||
"module": "dist/app-bridge.esm.js", | ||
"unpkg": "dist/app-bridge.js", | ||
"version": "0.0.2", | ||
"main": "dist/app.common.js", | ||
"module": "dist/app.esm.js", | ||
"unpkg": "dist/app.js", | ||
"files": [ | ||
@@ -8,0 +8,0 @@ "dist" |
31621