fastman2 2.8.1 → 2.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/jsbridgeman.js +1 -1
  2. package/package.json +1 -1
package/jsbridgeman.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.fastman=t():e.fastman=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=17)}({1:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){var t=document.createElement("a");t.setAttribute("href",e);var n=t.href;return t=null,n},i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(e){return!(null!=e&&(e.length||e.length>0))},a=function(e){if(e){if(1==e.length)return e;var t=e.substring(e.length-1,e.length);return(e.length>=3?"**":"*")+t}return e};t.getAbsoluteUrl=o,t._extends=i,t.isEmpty=r,t.maskName=a},17:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onApiRequest=t.pageWillAppear=t.onRequest=t.onDynamicLink=t.subscribeNotify=t.onNotify=t.onPushView=t.onNavigationBar=t.onRefresh=t.onBack=t.ready=t.wrapNotOkPayload=t.wrapOkPayload=void 0;var o=n(1),i=n(8),r=navigator.userAgent,a=r.match(/(Android);?[\s\/]+([\d.]+)?/),c=r.match(/(iPad).*OS\s([\d_]+)/),l=r.match(/(iPod)(.*OS\s([\d_]+))?/),f=!c&&r.match(/(iPhone\sOS)\s([\d_]+)/),u=!!r.toLowerCase().match(/DFYJ/i),s=function(e){return e.init(function(e,t){t&&t(data)}),e},d=function(e){var t=function(t){(0,i.log)("[ready] <-"),e(t)};if((0,i.log)("[ready] ->"),u)if(c||f||l){if(window.WebViewJavascriptBridge)return t(WebViewJavascriptBridge);if(window.WVJBCallbacks)return window.WVJBCallbacks.push(t);window.WVJBCallbacks=[t];var n=document.createElement("iframe");n.style.display="none",n.src="https://__bridge_loaded__",document.documentElement.appendChild(n),setTimeout(function(){document.documentElement.removeChild(n)},0)}else a?window.WebViewJavascriptBridge?t(s(WebViewJavascriptBridge)):document.addEventListener("WebViewJavascriptBridgeReady",function(){t(s(WebViewJavascriptBridge))},!1):t();else t()},p=function(){},y=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}},g=function(){return{code:arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,info:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error"}},b=function(e){var t={complete:p};t=(0,o._extends)({},t,e),(0,i.log)("onBack->"+JSON.stringify(t)),WebViewJavascriptBridge.callHandler("back",t,function(e){(0,i.log)("onBack<-"+JSON.stringify(e)),t.complete(e)})},v=function(e){var t={complete:p};t=(0,o._extends)({},t,e),(0,i.log)("onRefresh->"+JSON.stringify(t)),WebViewJavascriptBridge.callHandler("refresh",t,function(e){(0,i.log)("onRefresh<-"+JSON.stringify(e)),t.complete(e)})},k=function(e){var t={complete:p};t=(0,o._extends)({},t,e),(0,i.log)("onNavigationBar->"+JSON.stringify(t)),WebViewJavascriptBridge.callHandler("navigationBar",t,function(e){(0,i.log)("onNavigationBar<-"+JSON.stringify(e)),t.complete(e)})},w=function(e){var t={title:""};t=(0,o._extends)({},t,e),t.uri&&(-1!=t.uri.indexOf("http")||-1!=t.uri.indexOf("https")||(t.uri=(0,o.getAbsoluteUrl)(t.uri))),(0,i.log)("onPushView->"+JSON.stringify(t)),WebViewJavascriptBridge.callHandler("pushView",t,function(e){(0,i.log)("onPushView<-"+JSON.stringify(e))})},J=function(e){"function"==typeof e&&WebViewJavascriptBridge.registerHandler("pageWillAppear",e)},h=function(e){var t={type:"javascriptNotify"};t=(0,o._extends)({},t,e),(0,i.log)("onNotify->"+JSON.stringify(t)),WebViewJavascriptBridge.callHandler("notify",t,function(e){(0,i.log)("onNotify<-"+JSON.stringify(e))})},m={},O=function(e,t){if("function"==typeof t){var n=e;"sae_video"==n&&(n="notify"),m[n]=t,(0,i.log)("subscribeNotify->"+e),WebViewJavascriptBridge.registerHandler(n,function(e){(0,i.log)("subscribeNotify<-"+JSON.stringify(e)),Object.prototype.toString.call(e).toLocaleLowerCase()=="[object String]".toLocaleLowerCase()&&(e=JSON.parse(e)),m[n]&&m[n](e)})}},N=function(e){var t={url:""};t=(0,o._extends)({},t,e),(0,i.log)("onDynamicLink->"+JSON.stringify(t)),WebViewJavascriptBridge.callHandler("dynamicLink",t,function(e){(0,i.log)("onDynamicLink<-"+JSON.stringify(e))})},_={},S=!1,B=function(e,t){switch(arguments.length){case 1:return parseInt(Math.random()*e+1,10);case 2:return parseInt(Math.random()*(t-e+1)+e,10);default:return 0}},V=[],W=function e(){var t=B(1e3,9999);return-1!==V.indexOf(t)?e(t):(V.push(t),t)},x=function(e,t,n,o){var r={type:e||"1",payload:t||{},callbackId:W()};_[e+"-ok"]="function"==typeof n?n:p,_[e+"-notok"]="function"==typeof o?o:p,_[e+"_"+r.callbackId+"-ok"]="function"==typeof n?n:p,_[e+"_"+r.callbackId+"-notok"]="function"==typeof o?o:p,(0,i.log)("onRequest->"+JSON.stringify(r)),WebViewJavascriptBridge.callHandler("request",r,function(e){"string"==typeof e&&(e=JSON.parse(e)),(0,i.log)("onRequest<-"+JSON.stringify(e)),e.error||"true"===e.error?e.callbackId&&"function"==typeof _[e.type+"_"+e.callbackId+"-notok"]?_[e.type+"_"+e.callbackId+"-notok"](g(-1,e.info)):"function"==typeof _[e.type+"-notok"]&&_[e.type+"-notok"](g(-1,e.info)):e.callbackId&&"function"==typeof _[e.type+"_"+e.callbackId+"-ok"]?(c||f||l||e.payload)&&_[e.type+"_"+e.callbackId+"-ok"](y(e.payload)):"function"==typeof _[e.type+"-ok"]&&(c||f||l||e.payload)&&_[e.type+"-ok"](y(e.payload))}),S||(WebViewJavascriptBridge.registerHandler("request",function(e){"string"==typeof e&&(e=JSON.parse(e)),e.error||"true"===e.error?e.callbackId&&"function"==typeof _[e.type+"_"+e.callbackId+"-notok"]?_[e.type+"_"+e.callbackId+"-notok"](g(-1,e.info)):"function"==typeof _[e.type+"-notok"]&&_[e.type+"-notok"](g(-1,e.info)):e.callbackId&&"function"==typeof _[e.type+"_"+e.callbackId+"-ok"]?_[e.type+"_"+e.callbackId+"-ok"](y(e.payload)):"function"==typeof _[e.type+"-ok"]&&_[e.type+"-ok"](y(e.payload))}),S=!0)},I=function(e,t,n,r){if((0,o.isEmpty)(e))throw new Error("functionNo is required ...");var a={funcId:e,payload:t||{}};(0,i.log)("onApiRequest->"+JSON.stringify(a)),WebViewJavascriptBridge.callHandler("apiRequest",a,function(e){if((0,i.log)("onApiRequest<-"+JSON.stringify(e)),"string"==typeof e&&(e=JSON.parse(e)),c||f||l){if(e.error||"true"===e.error)e.payload?"function"==typeof r&&r(g(e.payload.code,e.payload.info)):"function"==typeof r&&r(g(-1,e.info));else if("function"==typeof n){var t={};e.payload&&(t="string"==typeof e.payload.data?JSON.parse(e.payload.data):e.payload.data),n(y(t))}}else if(e.error||"true"===e.error)"function"==typeof r&&r(g(-1,e.info));else{var o={};o="string"==typeof e.payload.data?JSON.parse(e.payload.data):e.payload.data?e.payload.data:{},"0"!=e.payload.code?"function"==typeof r&&r(g(e.payload.code,e.payload.info)):"function"==typeof n&&n(y(o))}})};t.wrapOkPayload=y,t.wrapNotOkPayload=g,t.ready=d,t.onBack=b,t.onRefresh=v,t.onNavigationBar=k,t.onPushView=w,t.onNotify=h,t.subscribeNotify=O,t.onDynamicLink=N,t.onRequest=x,t.pageWillAppear=J,t.onApiRequest=I},8:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){var e=new Date;e.getDate();return(e.getHours()<10?"0"+e.getHours():e.getHours())+":"+(e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes())+":"+(e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds())+"."+e.getMilliseconds()},i=function(e){e&&(e=o()+"[赢家]: "+e)},r=function(e){e&&(e=o()+"[赢家]: "+e)};t.log=i,t.errorlog=r}})});
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.fastman=t():e.fastman=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=17)}({1:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){var t=document.createElement("a");t.setAttribute("href",e);var n=t.href;return t=null,n},i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(e){return!(null!=e&&(e.length||e.length>0))},a=function(e){if(e){if(1==e.length)return e;var t=e.substring(e.length-1,e.length);return(e.length>=3?"**":"*")+t}return e};t.getAbsoluteUrl=o,t._extends=i,t.isEmpty=r,t.maskName=a},17:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onApiRequest=t.pageWillAppear=t.onRequest=t.onDynamicLink=t.subscribeNotify=t.onNotify=t.onPushView=t.onNavigationBar=t.onRefresh=t.onBack=t.ready=t.wrapNotOkPayload=t.wrapOkPayload=void 0;var o=n(1),i=n(8),r=navigator.userAgent,a=r.match(/(Android);?[\s\/]+([\d.]+)?/),c=r.match(/(iPad).*OS\s([\d_]+)/),l=r.match(/(iPod)(.*OS\s([\d_]+))?/),f=!c&&r.match(/(iPhone\sOS)\s([\d_]+)/),u=!!r.toLowerCase().match(/DFYJ/i),s=function(e){return e.init(function(e,t){t&&t(data)}),e},d=function(e){var t=function(t){(0,i.log)("[ready] <-"),e(t)};if((0,i.log)("[ready] ->"),u)if(c||f||l){if(window.WebViewJavascriptBridge)return t(WebViewJavascriptBridge);if(window.WVJBCallbacks)return window.WVJBCallbacks.push(t);window.WVJBCallbacks=[t];var n=document.createElement("iframe");n.style.display="none",n.src="https://__bridge_loaded__",document.documentElement.appendChild(n),setTimeout(function(){document.documentElement.removeChild(n)},0)}else a?window.WebViewJavascriptBridge?t(s(WebViewJavascriptBridge)):document.addEventListener("WebViewJavascriptBridgeReady",function(){t(s(WebViewJavascriptBridge))},!1):t();else t()},p=function(){},y=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}},g=function(){return{code:arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,info:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error"}},b=function(e){var t={complete:p};t=(0,o._extends)({},t,e),(0,i.log)("onBack->"+JSON.stringify(t)),WebViewJavascriptBridge.callHandler("back",t,function(e){(0,i.log)("onBack<-"+JSON.stringify(e)),t.complete(e)})},v=function(e){var t={complete:p};t=(0,o._extends)({},t,e),(0,i.log)("onRefresh->"+JSON.stringify(t)),WebViewJavascriptBridge.callHandler("refresh",t,function(e){(0,i.log)("onRefresh<-"+JSON.stringify(e)),t.complete(e)})},k=function(e){var t={complete:p};t=(0,o._extends)({},t,e),(0,i.log)("onNavigationBar->"+JSON.stringify(t)),WebViewJavascriptBridge.callHandler("navigationBar",t,function(e){(0,i.log)("onNavigationBar<-"+JSON.stringify(e)),t.complete(e)})},w=function(e){var t={title:""};t=(0,o._extends)({},t,e),t.uri&&(-1!=t.uri.indexOf("http")||-1!=t.uri.indexOf("https")||(t.uri=(0,o.getAbsoluteUrl)(t.uri))),(0,i.log)("onPushView->"+JSON.stringify(t)),WebViewJavascriptBridge.callHandler("pushView",t,function(e){(0,i.log)("onPushView<-"+JSON.stringify(e))})},h=function(e){"function"==typeof e&&WebViewJavascriptBridge.registerHandler("pageWillAppear",e)},m=function(e){var t={type:"javascriptNotify"};t=(0,o._extends)({},t,e),(0,i.log)("onNotify->"+JSON.stringify(t)),WebViewJavascriptBridge.callHandler("notify",t,function(e){(0,i.log)("onNotify<-"+JSON.stringify(e))})},J={},O=function(e,t){if("function"==typeof t){var n=e;"sae_video"==n&&(n="notify"),J[n]=t,(0,i.log)("subscribeNotify->"+e),WebViewJavascriptBridge.registerHandler(n,function(e){(0,i.log)("subscribeNotify<-"+JSON.stringify(e)),Object.prototype.toString.call(e).toLocaleLowerCase()=="[object String]".toLocaleLowerCase()&&(e=JSON.parse(e)),J[n]&&J[n](e)})}},N=function(e){var t={url:""};t=(0,o._extends)({},t,e),(0,i.log)("onDynamicLink->"+JSON.stringify(t)),WebViewJavascriptBridge.callHandler("dynamicLink",t,function(e){(0,i.log)("onDynamicLink<-"+JSON.stringify(e))})},_={},B=!1,S=function(e,t){switch(arguments.length){case 1:return parseInt(Math.random()*e+1,10);case 2:return parseInt(Math.random()*(t-e+1)+e,10);default:return 0}},V=[],W=function e(){var t=S(1e3,9999);return-1!==V.indexOf(t)?e(t):(V.push(t),t)},x=function(e,t,n,o){var i={type:e||"1",payload:t||{},callbackId:W()};_[e+"-ok"]="function"==typeof n?n:p,_[e+"-notok"]="function"==typeof o?o:p,_[e+"_"+i.callbackId+"-ok"]="function"==typeof n?n:p,_[e+"_"+i.callbackId+"-notok"]="function"==typeof o?o:p,WebViewJavascriptBridge.callHandler("request",i,function(e){"string"==typeof e&&(e=JSON.parse(e)),e.error||"true"===e.error?e.callbackId&&"function"==typeof _[e.type+"_"+e.callbackId+"-notok"]?_[e.type+"_"+e.callbackId+"-notok"](g(-1,e.info)):"function"==typeof _[e.type+"-notok"]&&_[e.type+"-notok"](g(-1,e.info)):e.callbackId&&"function"==typeof _[e.type+"_"+e.callbackId+"-ok"]?(c||f||l||e.payload)&&_[e.type+"_"+e.callbackId+"-ok"](y(e.payload)):"function"==typeof _[e.type+"-ok"]&&(c||f||l||e.payload)&&_[e.type+"-ok"](y(e.payload))}),B||(WebViewJavascriptBridge.registerHandler("request",function(e){"string"==typeof e&&(e=JSON.parse(e)),e.error||"true"===e.error?e.callbackId&&"function"==typeof _[e.type+"_"+e.callbackId+"-notok"]?_[e.type+"_"+e.callbackId+"-notok"](g(-1,e.info)):"function"==typeof _[e.type+"-notok"]&&_[e.type+"-notok"](g(-1,e.info)):e.callbackId&&"function"==typeof _[e.type+"_"+e.callbackId+"-ok"]?_[e.type+"_"+e.callbackId+"-ok"](y(e.payload)):"function"==typeof _[e.type+"-ok"]&&_[e.type+"-ok"](y(e.payload))}),B=!0)},I=function(e,t,n,r){if((0,o.isEmpty)(e))throw new Error("functionNo is required ...");var a={funcId:e,payload:t||{}};(0,i.log)("onApiRequest->"+JSON.stringify(a)),WebViewJavascriptBridge.callHandler("apiRequest",a,function(e){if((0,i.log)("onApiRequest<-"+JSON.stringify(e)),"string"==typeof e&&(e=JSON.parse(e)),c||f||l){if(e.error||"true"===e.error)e.payload?"function"==typeof r&&r(g(e.payload.code,e.payload.info)):"function"==typeof r&&r(g(-1,e.info));else if("function"==typeof n){var t={};e.payload&&(t="string"==typeof e.payload.data?JSON.parse(e.payload.data):e.payload.data),n(y(t))}}else if(e.error||"true"===e.error)"function"==typeof r&&r(g(-1,e.info));else{var o={};o="string"==typeof e.payload.data?JSON.parse(e.payload.data):e.payload.data?e.payload.data:{},"0"!=e.payload.code?"function"==typeof r&&r(g(e.payload.code,e.payload.info)):"function"==typeof n&&n(y(o))}})};t.wrapOkPayload=y,t.wrapNotOkPayload=g,t.ready=d,t.onBack=b,t.onRefresh=v,t.onNavigationBar=k,t.onPushView=w,t.onNotify=m,t.subscribeNotify=O,t.onDynamicLink=N,t.onRequest=x,t.pageWillAppear=h,t.onApiRequest=I},8:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){var e=new Date;e.getDate();return(e.getHours()<10?"0"+e.getHours():e.getHours())+":"+(e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes())+":"+(e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds())+"."+e.getMilliseconds()},i=function(e){e&&(e=o()+"[赢家]: "+e)},r=function(e){e&&(e=o()+"[赢家]: "+e)};t.log=i,t.errorlog=r}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastman2",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "description": "a hybird app framework",
5
5
  "main": "index.js",
6
6
  "scripts": {