app-methods
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -1,2 +0,2 @@ | ||
/*! app.js v0.0.7 | https://www.npmjs.com/package/app-methods */ | ||
/*! app.js v0.0.8 | https://www.npmjs.com/package/app-methods */ | ||
'use strict'; | ||
@@ -791,3 +791,3 @@ | ||
} else { | ||
resolve(res.token); | ||
resolve(res); | ||
} | ||
@@ -794,0 +794,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
/*! app.js v0.0.7 | https://www.npmjs.com/package/app-methods */ | ||
/*! app.js v0.0.8 | https://www.npmjs.com/package/app-methods */ | ||
/* global App:false */ | ||
@@ -787,3 +787,3 @@ /** | ||
} else { | ||
resolve(res.token); | ||
resolve(res); | ||
} | ||
@@ -790,0 +790,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
/*! app.js v0.0.7 | https://www.npmjs.com/package/app-methods */ | ||
/*! app.js v0.0.8 | https://www.npmjs.com/package/app-methods */ | ||
(function (global, factory) { | ||
@@ -793,3 +793,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
} else { | ||
resolve(res.token); | ||
resolve(res); | ||
} | ||
@@ -796,0 +796,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
/*! app.js v0.0.7 | https://www.npmjs.com/package/app-methods */ | ||
!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 a(){return window.navigator.userAgent.toLowerCase().indexOf("android")>-1}function o(){return window.navigator.userAgent.toLowerCase().indexOf("needle")>-1}function r(){return window.navigator.userAgent.toLowerCase().indexOf("iphone")>-1}function c(){return"object"==typeof weex}function d(e,n,t){if(c()){var i="msg_"+j+++"_"+(new Date).getTime();return A[i]=t,void weex.requireModule("NeedleNativeModule").execute({id:i,name:e,params:n})}if(a()&&window.__needleClientTunnel){var i="msg_"+j+++"_"+(new Date).getTime();A[i]=t,window.__needleClientTunnel.read(JSON.stringify({id:i,name:e,params:n}))}else window.WebViewJavascriptBridge?u(e,n,t):O.push({name:e,params:n,callback:t})}function l(){return!!window.WebViewJavascriptBridge||!!window.__needleClientTunnel||c()}function u(e,n,t){!!window.WebViewJavascriptBridge&&window.WebViewJavascriptBridge.callHandler(e,n,function(i){var o=a()?JSON.parse(i):i;t&&o&&(o.err?t(o.err,null):(t(null,o.res),window.__needle__debug&&console.log("Plugin name:",e,", Params:",n,", Response:",o)))})}function s(e,n){return c()?void(W[e]=n):a()&&window.__needleClientTunnel?void(W[e]=n):(k[e]={eventName:e,callback:n},void(window.WebViewJavascriptBridge?WebViewJavascriptBridge.registerHandler(e,function(n){f(e,n)}):J.push({eventName:e,callback:n})))}function f(e,n){var t=k[e];t&&t.callback(n)}function p(){O.forEach(function(e){u(e.name,e.params,e.callback)}),O=[]}function w(){J.forEach(function(e){!!WebViewJavascriptBridge&&WebViewJavascriptBridge.registerHandler(e.eventName,function(n){f(e.eventName,n)})}),J=[]}function v(){w(),p();var e=document.createEvent("Events");e.initEvent("needleReady"),document.dispatchEvent(e)}function g(){S.container.close()}function h(){S.container.hideTitleBar()}function m(){S.container.showTitleBar()}function b(){return new Promise(function(e,n){S.execute("xy.auth",{},function(t,i){t?n(t):e(i.token)})})}function y(){return n(),X.hideBar&&X.hideBar()}function B(){return t(),X.showBar&&X.showBar()}function x(){return i(),X.exit&&X.exit()}function _(){return X.getToken&&X.getToken()}var T=Object.freeze({hideBar:n,showBar:t,exit:i});"object"==typeof weex&&(window={navigator:{userAgent:weex.config.env.platform+" Needle/Weex"}});var O=[],k={},J=[];if(c()){var N=weex.requireModule("globalEvent");N.addEventListener("_needleEvent",function(e){var n=e.eventName,t=e.data;if("object"==typeof e.data)t=e.data;else try{t=JSON.parse(e.data)}catch(e){}var i=W[n];setTimeout(function(){!!i&&i(t)},0)}),N.addEventListener("_needleCall",function(e){var n=e.data;if("object"==typeof e.data)n=e.data;else try{n=JSON.parse(e.data)}catch(e){}var t=A[n.id];n=n.result,setTimeout(function(){t&&n&&(n.err?t(n.err,null):t(null,n.res)),delete A[n.id]},0)})}var j=0,A={},W={};c()||(window.__needleBrowserTunnel={read:function(e){var n=JSON.parse(e),t=A[n.id];n=n.result,setTimeout(function(){t&&n&&(n.err?t(n.err,null):t(null,n.res)),delete A[n.id]},0)},on:function(e,n){var t=n;try{t=JSON.parse(n)}catch(e){}var i=W[e];setTimeout(function(){!!i&&i(t)},0)}});var E={getEnvInfo:function(e){d("needle.app.env",{},e)},isAppInstalled:function(e,n){d("needle.app.installation",e,n)},sendSMS:function(e,n){d("needle.app.sms",e,n)},getLocation:function(e){d("needle.app.location",{},e)},openUri:function(e,n){d("needle.app.uri",e,n)},clearWebsiteCache:function(e){d("needle.app.web.cache.clear",{},e)}},C={toast:function(e){d("needle.container.toast",e,null)},close:function(){d("needle.container.window",{type:"close"},null)},reload:function(e,n){var e=e||{};e.type="reload",d("needle.container.window",e,n)},goBack:function(e){d("needle.container.window",{type:"back"},e)},showLoading:function(){d("needle.container.loading",{type:"show"},null)},hideLoading:function(){d("needle.container.loading",{type:"hide"},null)},setTitle:function(e,n){var e=e||{};e.type="set",d("needle.container.title",e,null)},getTitle:function(e){d("needle.container.title",{type:"get"},e)},showTitleBar:function(e){d("needle.container.titleBar",{type:"show"},e)},hideTitleBar:function(e){d("needle.container.titleBar",{type:"hide"},e)},registerMenu:function(e,n){d("needle.container.menu",e,null),s("needle.container.menu.onclick",n)},registerBottomMenu:function(e,n){d("needle.container.bottomMenu",e,null),s("needle.container.bottomMenu.onclick",n)}},L={pick:function(e,n){d("needle.image.picker",e,n)},preview:function(e,n){d("needle.image.previewer",e,n)},save:function(e,n){d("needle.image.save",e,n)}},V={set:function(e,n){var e=e||{};e.method="set",d("needle.cache",e,n)},get:function(e,n){var e=e||{};e.method="get",d("needle.cache",e,n)},delete:function(e,n){var e=e||{};e.method="delete",d("needle.cache",e,n)},deleteAll:function(e){var n=n||{};n.method="clear",d("needle.cache",n,e)}};c()||(window.WebViewJavascriptBridge?v():document.addEventListener("WebViewJavascriptBridgeReady",v,!1));var M,S={version:"0.3.0",isAndroid:a,isIOS:r,isNeedle:o,isWeex:c,isReady:l,execute:d,on:s,app:E,container:C,image:L,cache:V},P=Object.freeze({exit:g,hideBar:h,showBar:m,getToken:b}),z=function(){},R=window.dd;if(R){var q=new Promise(function(e){R.ready(e)});M=function(){q.then(function(){R.biz.navigation.close()})}}else M=z;var H,I=Object.freeze({get exit(){return M}}),D=Object.freeze({ping:T,xy:P,ding:I}),U=navigator.userAgent.toLowerCase(),F={xy:"eve",ping:"qichat",ding:"dingtalk"},G=Object.prototype.hasOwnProperty;for(var K in F)if(G.call(F,K)&&U.indexOf(F[K])>=0){H=K;break}H||window.App&&window.App.hideBar&&(H="ping");var Q=H||"other",X=D[Q]||{};e.platform=Q,e.hideBar=y,e.showBar=B,e.exit=x,e.getToken=_,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
/*! app.js v0.0.8 | https://www.npmjs.com/package/app-methods */ | ||
!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 a(){return window.navigator.userAgent.toLowerCase().indexOf("android")>-1}function o(){return window.navigator.userAgent.toLowerCase().indexOf("needle")>-1}function r(){return window.navigator.userAgent.toLowerCase().indexOf("iphone")>-1}function c(){return"object"==typeof weex}function d(e,n,t){if(c()){var i="msg_"+j+++"_"+(new Date).getTime();return A[i]=t,void weex.requireModule("NeedleNativeModule").execute({id:i,name:e,params:n})}if(a()&&window.__needleClientTunnel){var i="msg_"+j+++"_"+(new Date).getTime();A[i]=t,window.__needleClientTunnel.read(JSON.stringify({id:i,name:e,params:n}))}else window.WebViewJavascriptBridge?u(e,n,t):O.push({name:e,params:n,callback:t})}function l(){return!!window.WebViewJavascriptBridge||!!window.__needleClientTunnel||c()}function u(e,n,t){!!window.WebViewJavascriptBridge&&window.WebViewJavascriptBridge.callHandler(e,n,function(i){var o=a()?JSON.parse(i):i;t&&o&&(o.err?t(o.err,null):(t(null,o.res),window.__needle__debug&&console.log("Plugin name:",e,", Params:",n,", Response:",o)))})}function s(e,n){return c()?void(W[e]=n):a()&&window.__needleClientTunnel?void(W[e]=n):(k[e]={eventName:e,callback:n},void(window.WebViewJavascriptBridge?WebViewJavascriptBridge.registerHandler(e,function(n){f(e,n)}):J.push({eventName:e,callback:n})))}function f(e,n){var t=k[e];t&&t.callback(n)}function p(){O.forEach(function(e){u(e.name,e.params,e.callback)}),O=[]}function w(){J.forEach(function(e){!!WebViewJavascriptBridge&&WebViewJavascriptBridge.registerHandler(e.eventName,function(n){f(e.eventName,n)})}),J=[]}function v(){w(),p();var e=document.createEvent("Events");e.initEvent("needleReady"),document.dispatchEvent(e)}function g(){S.container.close()}function h(){S.container.hideTitleBar()}function m(){S.container.showTitleBar()}function b(){return new Promise(function(e,n){S.execute("xy.auth",{},function(t,i){t?n(t):e(i)})})}function y(){return n(),X.hideBar&&X.hideBar()}function B(){return t(),X.showBar&&X.showBar()}function x(){return i(),X.exit&&X.exit()}function _(){return X.getToken&&X.getToken()}var T=Object.freeze({hideBar:n,showBar:t,exit:i});"object"==typeof weex&&(window={navigator:{userAgent:weex.config.env.platform+" Needle/Weex"}});var O=[],k={},J=[];if(c()){var N=weex.requireModule("globalEvent");N.addEventListener("_needleEvent",function(e){var n=e.eventName,t=e.data;if("object"==typeof e.data)t=e.data;else try{t=JSON.parse(e.data)}catch(e){}var i=W[n];setTimeout(function(){!!i&&i(t)},0)}),N.addEventListener("_needleCall",function(e){var n=e.data;if("object"==typeof e.data)n=e.data;else try{n=JSON.parse(e.data)}catch(e){}var t=A[n.id];n=n.result,setTimeout(function(){t&&n&&(n.err?t(n.err,null):t(null,n.res)),delete A[n.id]},0)})}var j=0,A={},W={};c()||(window.__needleBrowserTunnel={read:function(e){var n=JSON.parse(e),t=A[n.id];n=n.result,setTimeout(function(){t&&n&&(n.err?t(n.err,null):t(null,n.res)),delete A[n.id]},0)},on:function(e,n){var t=n;try{t=JSON.parse(n)}catch(e){}var i=W[e];setTimeout(function(){!!i&&i(t)},0)}});var E={getEnvInfo:function(e){d("needle.app.env",{},e)},isAppInstalled:function(e,n){d("needle.app.installation",e,n)},sendSMS:function(e,n){d("needle.app.sms",e,n)},getLocation:function(e){d("needle.app.location",{},e)},openUri:function(e,n){d("needle.app.uri",e,n)},clearWebsiteCache:function(e){d("needle.app.web.cache.clear",{},e)}},C={toast:function(e){d("needle.container.toast",e,null)},close:function(){d("needle.container.window",{type:"close"},null)},reload:function(e,n){var e=e||{};e.type="reload",d("needle.container.window",e,n)},goBack:function(e){d("needle.container.window",{type:"back"},e)},showLoading:function(){d("needle.container.loading",{type:"show"},null)},hideLoading:function(){d("needle.container.loading",{type:"hide"},null)},setTitle:function(e,n){var e=e||{};e.type="set",d("needle.container.title",e,null)},getTitle:function(e){d("needle.container.title",{type:"get"},e)},showTitleBar:function(e){d("needle.container.titleBar",{type:"show"},e)},hideTitleBar:function(e){d("needle.container.titleBar",{type:"hide"},e)},registerMenu:function(e,n){d("needle.container.menu",e,null),s("needle.container.menu.onclick",n)},registerBottomMenu:function(e,n){d("needle.container.bottomMenu",e,null),s("needle.container.bottomMenu.onclick",n)}},L={pick:function(e,n){d("needle.image.picker",e,n)},preview:function(e,n){d("needle.image.previewer",e,n)},save:function(e,n){d("needle.image.save",e,n)}},V={set:function(e,n){var e=e||{};e.method="set",d("needle.cache",e,n)},get:function(e,n){var e=e||{};e.method="get",d("needle.cache",e,n)},delete:function(e,n){var e=e||{};e.method="delete",d("needle.cache",e,n)},deleteAll:function(e){var n=n||{};n.method="clear",d("needle.cache",n,e)}};c()||(window.WebViewJavascriptBridge?v():document.addEventListener("WebViewJavascriptBridgeReady",v,!1));var M,S={version:"0.3.0",isAndroid:a,isIOS:r,isNeedle:o,isWeex:c,isReady:l,execute:d,on:s,app:E,container:C,image:L,cache:V},P=Object.freeze({exit:g,hideBar:h,showBar:m,getToken:b}),z=function(){},R=window.dd;if(R){var q=new Promise(function(e){R.ready(e)});M=function(){q.then(function(){R.biz.navigation.close()})}}else M=z;var H,I=Object.freeze({get exit(){return M}}),D=Object.freeze({ping:T,xy:P,ding:I}),U=navigator.userAgent.toLowerCase(),F={xy:"eve",ping:"qichat",ding:"dingtalk"},G=Object.prototype.hasOwnProperty;for(var K in F)if(G.call(F,K)&&U.indexOf(F[K])>=0){H=K;break}H||window.App&&window.App.hideBar&&(H="ping");var Q=H||"other",X=D[Q]||{};e.platform=Q,e.hideBar=y,e.showBar=B,e.exit=x,e.getToken=_,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "app-methods", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"main": "dist/app.common.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/app.esm.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
70166