zalo-js-bridge
Advanced tools
Comparing version 1.4.9 to 1.6.1
@@ -69,3 +69,3 @@ import ZaloBridge from './utils/native-bridge' | ||
* "scheme_url": "zalo-1396017800851131651://[any_uri_in_there]", | ||
* "url": "http://app.zaloapp.com/id908617867?pid=zalo&c=gamecenter" | ||
* "ur l": "http://app.zaloapp.com/id908617867?pid=zalo&c=gamecenter" | ||
* }, | ||
@@ -119,3 +119,7 @@ * "wp_data": { | ||
static queryLocationHide(title, touserid, callback) { | ||
return ZaloBridge.jsCall(Action.querylocationhide, { title, touserid }, callback); | ||
var params = {}; | ||
params.title = title; | ||
params.touserid = touserid; | ||
params.zapp = ZaloBridge.getAppId(); | ||
return ZaloBridge.jsCall(Action.querylocationhide, params, callback); | ||
} | ||
@@ -171,4 +175,4 @@ | ||
* @example | ||
* ZJSBridge.Device.viewQr(123456, "ABC", e => {console.log(e)}) | ||
* @param {number} uid | ||
* ZJSBridge.Device.viewQr("123456", "ABC", e => {console.log(e)}) | ||
* @param {string} uid | ||
* @param {string} dpn | ||
@@ -191,4 +195,5 @@ * @param {void} callback Hàm callback trả về kết quả sau khi gọi action | ||
*/ | ||
static keepScreen(uid, dpn, callback) { | ||
return ZaloBridge.jsCall(Action.keepscreen, { uid, dpn }, callback); | ||
static keepScreen(keep_screen_on, callback) { | ||
const value = Number(keep_screen_on) | ||
return ZaloBridge.jsCall(Action.keepscreen, { keep_screen_on: value }, callback); | ||
} | ||
@@ -195,0 +200,0 @@ } |
@@ -11,3 +11,3 @@ import ZaloBridge from './utils/native-bridge' | ||
* @example | ||
* ZJSBridge.Zalo.changeTitleHeader("new title", e => {console.log(e)}) | ||
* ZJSBridge.H5.changeTitleHeader("new title", e => {console.log(e)}) | ||
* @param {string} title Tiêu đề của webview muốn đổi | ||
@@ -23,3 +23,3 @@ * @param {void} callback Hàm callback trả về kết quả sau khi gọi action | ||
* @example | ||
* ZJSBridge.Zalo.changeTitleHeader("new title", e => {console.log(e)}) | ||
* ZJSBridge.H5.changeTitleHeader("new title", e => {console.log(e)}) | ||
* @param {string} title Tiêu đề của webview muốn đổi | ||
@@ -35,13 +35,19 @@ * @param {void} callback Hàm callback trả về kết quả sau khi gọi action | ||
* @example | ||
* ZJSBridge.Zalo.configLeftButton(options, e => {console.log(e)}) | ||
* ZJSBridge.H5.configLeftButton(options, e => {console.log(e)}) | ||
* @param {object} options Option của left button muốn thay đổi | ||
* ``` | ||
* { | ||
* "buttonType": 1, // 0 back, 1 close, 2 both | ||
* "dataConfig": { | ||
* "confirmToExit": 2, | ||
* "buttonType": 1, | ||
* "dataConfig": { | ||
* "confirmToExit": 1, | ||
* "dialogMessage": "đây là custom thông báo đóng" | ||
* } | ||
* } | ||
* } | ||
* ``` | ||
* - "buttonType": | ||
* - 0: back - thực hiện hành vi quay về trang trước đó đã xem như history. | ||
* - 1: close - thực hiện hành vi thoái hẳn ra khỏi trang web. | ||
* - 2: both - tùy vào action mà user thực hiện vào nut back hay close mà phát sinh sự kiện tương ứng. <br> Ban đầu mới vào trang web thì chỉ hiện nút back, khi duyệt web có độ sâu history lớn hơn 1 thì sẽ hiện thêm nút close. | ||
* - "confirmToExit": | ||
* - 1: Show dialog | ||
* @param {void} callback Hàm callback trả về kết quả sau khi gọi action | ||
@@ -162,3 +168,3 @@ * | ||
* @example | ||
* ZJSBridge.Zalo.changeColorHeader("#6400bfff", e => {console.log(e)}) | ||
* ZJSBridge.H5.changeColorHeader("#6400bfff", e => {console.log(e)}) | ||
* @param {string} color Color header của webview muốn đổi | ||
@@ -165,0 +171,0 @@ * @param {void} callback Hàm callback trả về kết quả sau khi gọi action |
@@ -123,16 +123,28 @@ import ZaloBridge from './utils/native-bridge' | ||
* ``` | ||
* {"type":11, | ||
* { | ||
* "type":11, | ||
* "photoUrl":"http://dev.org.zads.zdn.vn/2a16c7fefbbb12e54baa", | ||
* "gifUrl":"http://dev.org.zads.zdn.vn/fc88fe60c2252b7b7234", | ||
* "width":480, | ||
* "height":270} | ||
* "height":270 | ||
* } | ||
* ``` | ||
* - Chia sẻ Video | ||
* ``` | ||
* {"type":12, | ||
* { | ||
* "type": 12, | ||
* "videoThumb":"http://dev.org.zads.zdn.vn/fc88fe60c2252b7b7234", | ||
* "videoUrl":"http://dev.org.zads.zdn.vn/fc88fe60c2252b7b7234", | ||
* "width":480, | ||
* "height":270} | ||
* "height":270 | ||
* } | ||
* ``` | ||
* - Chia sẻ link | ||
* ``` | ||
* { | ||
* "type": 4, | ||
* "link": "", | ||
* "chatOnly": 1, // tắt bật share lên nhật ký | ||
* } | ||
* ``` | ||
* @param {void} callback Hàm callback trả về kết quả sau khi gọi action | ||
@@ -370,3 +382,3 @@ */ | ||
* { | ||
* "uid": xxx, | ||
* "uId": xxx, | ||
* "type": 0 | 1, | ||
@@ -373,0 +385,0 @@ * "appId": xxx (appIdNoise), |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("ZJSBridge",[],t):"object"==typeof exports?exports.ZJSBridge=t():e.ZJSBridge=t()}(window,(function(){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(a,o,function(t){return e[t]}.bind(null,o));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./",n(n.s=2)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={getdownloadedsticker:"action.get.downloaded.sticker",opensharesticker:"action.open.share.sticker",openprofile:"action.open.profile",openfeeddetail:"action.open.feeddetail",openfriendrada:"action.open.friendrada",openinapp:"action.open.inapp",openoutapp:"action.open.outapp",openpage:"action.open.page",openphotodetail:"action.open.photodetail",opengalary:"action.open.galary",opengamecenter:"action.open.gamecenter",opengamenews:"action.open.gamenews",opentabcontact:"action.open.tab.contact",opentabsocial:"action.open.tab.social",openfriendsuggest:"action.open.friendsuggest",opengrouplist:"action.open.grouplist",opennearby:"action.open.nearby",openroom:"action.open.room",openstickerstore:"action.open.stickerstore",opencreatechat:"action.open.createchat",copylinkcatesticker:"action.copy.link.catesticker",requestbuysticker:"action.request.buy.sticker",openchat:"action.open.chat",opentabchat:"action.open.tab.chat",openChatGroup:"action.open.chatgroup",openaddfriend:"action.open.addfriend",opentabmore:"action.open.tab.more",openpostfeed:"action.open.postfeed",openlogindevices:"action.open.logindevices",opensendsticker:"action.open.sendsticker",reportabuse:"action.report.abuse",followoa:"action.follow.oa",unfollowoa:"action.unfollow.oa",opengamedetail:"action.open.gamedetail",opensharesheet:"action.open.sharesheet",changetitleheader:"action.change.title.header",clearcachewebview:"action.webview.clearcache",confirmcache:"action.webview.confirmcache",isvisible:"action.webview.isvisible",networktype:"action.webview.networktype",changebuttonheader:"action.change.button.header",createoptionmenu:"action.create.options.menu",createshortcut:"action.create.shortcut",changeleftbuttonbar:"action.change.actionbar.leftbutton.type",closewindow:"action.window.close",checkResError:"action.webview.checkResError",requestPayment:"action.iap.requestpayment",getzbrowserstats:"action.zbrowser.getstats",jsbridge:"action.zbrowser.jsbridge",bioauthen:"action.prompt.authentication",changeColorHeader:"action.change.actionbar.color",openappstore:"action.open.appstore",getlocation:"action.get.location",querylocationhide:"action.query.location.hide",showtoast:"action.show.toast",openapp:"action.open.app",hidekeyboard:"action.hide.keyboard",openphone:"action.open.phone",openqr:"action.open.qr",opensms:"action.open.sms",viewqr:"action.view.myqr",keepscreen:"action.keep.screen",autorotate:"action.change.autorotate",checkappinstalled:"action.check.app.installed",queryshow:"action.query.show",queryhide:"action.query.hide",openinapprw:"action.open.inapprw",gettrackingstatus:"action.zalorun.getTrackingStatus",settrackingstatus:"action.zalorun.setTrackingStatus",getdaystep:"action.zalorun.getDayStep",forcesubmitdata:"action.zalorun.forceSubmitData",setweight:"action.zalorun.setWeight",getAdIdClient:"action.get.adidclient",openProfileExt:"action.open.profile.ext",downloadcate:"action.download.cate",login:"action.jump.login"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=n(0),u=(a=r)&&a.__esModule?a:{default:a};var i=new(function(){function e(t){var n,a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.appId=t||this.getToken("zapp"),this.accessTk=this.getToken("zacc_session")||"DEFAULT_ACCESS_TOKEN",this.jsAccessTk=this.getToken("zlink3rd"),this.jsCallFuncCallbacks={},this.listenerEvent={},this.userAgent=navigator.userAgent||navigator.vendor||window.opera,this.device=(n=this.userAgent,a=n.toLowerCase(),{isWP:/iemobile/.test(a),isAndroid:/android/i.test(a)&&!/iemobile/.test(a),isIOS:/iphone|ipad|ipod/.test(a)&&!/iemobile/.test(a),isMobile:/android|iphone|ipad|ipod|iemobile/.test(a)})}return l(e,[{key:"setAccessToken",value:function(e){this.accessTk=e}},{key:"loginCallback",value:function(e){console.log(e)}},{key:"login",value:function(){alert("call login: "+this.appId+" ZJSBridge.onLoginCallback"),ZaloJavaScriptInterface.login(this.appId,"ZJSBridge.onLoginCallback")}},{key:"getAppId",value:function(){return this.appId}},{key:"isObject",value:function(e){return"object"===(void 0===e?"undefined":o(e))}},{key:"isEmpty",value:function(e){return!e||0===e.trim().length}},{key:"isString",value:function(e){return"string"==typeof e||null!=e&&("object"===(void 0===e?"undefined":o(e))&&(!!e.constructor&&null!==e.constructor.toString().match(/string/i)))}},{key:"parseJSON",value:function(e){return this.isObject(JSON)&&JSON.parse&&this.isString(e)?JSON.parse(e):"object"===(void 0===e?"undefined":o(e))?e:new Function("return "+e)()}},{key:"readCookie",value:function(e){var t=document.cookie;if(t&&(t=t.split("; "))&&t.length>0)for(var n=e.length+1,a=t.length-1;a>=0;a--){var o=t[a];if(o&&0===o.indexOf(e)&&(o=o.substring(n,o.length)))return o=o.replace(/["']/g,"")}return null}},{key:"getCurrHost",value:function(){var e=window.location.host;return e?0===e.indexOf("www.")?e.replace("www.","")+"_":e+"_":""}},{key:"getCurrHostRootZaloMe",value:function(){var e=window.location.host;if(e){if(e.indexOf("zalo.me")>=0)return"zalo.me_";if(e.indexOf("baomoi.com")>=0)return"baomoi.com_";if(e.indexOf("mp3.zing.vn")>=0)return"mp3.zing.vn_";if(e.indexOf("zaloapp.com")>=0)return"zaloapp.com_"}return""}},{key:"isZaloBrowser",value:function(){return window.navigator.userAgent.includes("Zalo")}},{key:"readCookieByDomain",value:function(e){return this.readCookie(this.getCurrHost()+e)}},{key:"readCookieByRootDomain",value:function(e){return this.readCookie(this.getCurrHostRootZaloMe()+e)}},{key:"readCookieFallback",value:function(e){var t=this.readCookieByDomain(e);return t||(t=this.readCookieByRootDomain(e))?t:this.readCookie(e)}},{key:"serialize",value:function(e){if(this.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=new Array;for(var n=e.length,a=0;a<n;a++)t.push(this.serialize(e[a]));return"["+t.join(",")+"]"}if("object"===(void 0===e?"undefined":o(e))){for(var l in t=new Array,e)t.push('"'+l+'":'+this.serialize(e[l]));return"{"+t.join(",")+"}"}return e.toString()}},{key:"getToken",value:function(e){return this.readCookieFallback(e)}},{key:"defaulCallBackJSCall",value:function(e){null!=e&&(e=this.parseJSON(e))}},{key:"onJSCall",value:function(e){try{if(console.log("jscallback: ",e),e=this.parseJSON(e),this.jsCallFuncCallbacks[e.action])this.jsCallFuncCallbacks[e.action].call(this,e),this.jsCallFuncCallbacks[e.action]=null,delete this.jsCallFuncCallbacks[e.action]}catch(e){console.log(e)}}},{key:"isFunction",value:function(e){return"function"==typeof e}},{key:"getFeatureId",value:function(){return this.readCookieFallback("fid")}},{key:"jsCallback",value:function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n)}},{key:"registerListenerEvent",value:function(e,t){console.log("register "+e+" : "+t),this.listenerEvent[e]=t}},{key:"zalo_h5_event_handler",value:function(e,t,n){if(console.log("eventId: "+e+", eventName: "+t+", eventData: "+n),this.listenerEvent[t]){var a=this.listenerEvent[t];this.jsCallback(e,t,a)}}},{key:"jsCall",value:function(e,t,n){var a=this;try{var o=3;if(!this.device.isMobile||this.isEmpty(e))return this.onJSCall({error_code:-13,error_message:"params invalid!",data:{device:this.device.isMobile,jsToken:this.jsAccessTk,access_token:this.accessTk},action:e}),!1;null==t&&(t={}),this.isFunction(t)&&void 0===n&&(n=t,t={}),n||(n=this.defaultCallback);var l={error_code:-14,error_message:"request Timeout!",data:{},action:e};this.jsCallFuncCallbacks[e]=n,e!==u.default.downloadcate&&e!==u.default.openpostfeed&&e!==u.default.opensharesheet&&e!==u.default.openqr&&e!==u.default.requestPayment&&e!==u.default.jsbridge&&e!==u.default.getAdIdClient&&setTimeout((function(){a.onJSCall(l)}),8e3);try{return t=this.serialize(t),this.device.isIOS?ZaloJavaScriptInterface.jsCall(this.jsAccessTk,e,this.accessTk,t,ZJSBridge.onJSCall):ZaloJavaScriptInterface.jsCall(this.jsAccessTk,e,this.accessTk,t,"ZJSBridge.onJSCall")}catch(a){if(!(o-- >0))return l={error_code:-5,error_message:"Not ready!",data:{userAgent:this.userAgent,options:t,jsToken:this.jsAccessTk,access_token:this.accessTk},action:e,js_error:a},this.onJSCall(l),!1;setTimeout(this.jsCall,500,e,this.accessTk,t,n)}}catch(e){console.log(e)}return!1}}]),e}())(window.zAppID);t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.login=t.onLoginCallback=t.onJSCall=t.Misc=t.H5=t.Device=t.Zalo=void 0;var a=c(n(0)),o=c(n(3)),l=c(n(4)),r=c(n(5)),u=c(n(6)),i=c(n(1));function c(e){return e&&e.__esModule?e:{default:e}}function s(e){i.default.loginCallback(e)}window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){i.default.zalo_h5_event_handler(e,t,n)}},t.Zalo=o.default,t.Device=l.default,t.H5=r.default,t.Misc=u.default,t.onJSCall=function(e){i.default.onJSCall(e)},t.onLoginCallback=s,t.login=function(){i.default.jsCall(a.default.login,{},s)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=r(n(1)),l=r(n(0));function r(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return a(e,null,[{key:"getAccessToken",value:function(){return o.default.accessTk?o.default.accessTk:"no token"}},{key:"setAccessToken",value:function(e){return e?o.default.setAccessToken(e):"no token"}},{key:"openTabContact",value:function(e){return console.log("openTabContact"),o.default.jsCall(l.default.opentabcontact,{},e)}},{key:"getDownloadedSticker",value:function(e){return console.log("getDownloadedSticker"),o.default.jsCall(l.default.getDownloadedSticker,{},e)}},{key:"openShareSticker",value:function(e,t){return o.default.jsCall(l.default.opensharesticker,{cateDetailsInfo:e},t)}},{key:"openInApp",value:function(e,t){return o.default.jsCall(l.default.openinapp,{url:e},t)}},{key:"openOutApp",value:function(e,t){return o.default.jsCall(l.default.openoutapp,{url:e},t)}},{key:"openPostFeed",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openpostfeed,e,t)}},{key:"openShareSheet",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.opensharesheet,e,t)}},{key:"registerListenerEvent",value:function(e,t){o.default.registerListenerEvent(e,t)}},{key:"openProfile",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openprofile,e,t)}},{key:"openFeedDetail",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openfeeddetail,e,t)}},{key:"openFriendRada",value:function(e){return o.default.jsCall(l.default.openfriendrada,{},e)}},{key:"openPage",value:function(e){return o.default.jsCall(l.default.openpage,{},e)}},{key:"openPhotoDetail",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openphotodetail,e,t)}},{key:"openGalary",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.opengalary,e,t)}},{key:"openGameCenter",value:function(e){return o.default.jsCall(l.default.opengamecenter,{},e)}},{key:"openGameNews",value:function(e){return o.default.jsCall(l.default.opengamenews,{},e)}},{key:"openTabSocial",value:function(e){return o.default.jsCall(l.default.opentabsocial,{},e)}},{key:"openFriendSuggest",value:function(e){return o.default.jsCall(l.default.openfriendsuggest,{},e)}},{key:"openGroupList",value:function(e){return o.default.jsCall(l.default.opengrouplist,{},e)}},{key:"openNearby",value:function(e){return o.default.jsCall(l.default.opennearby,{},e)}},{key:"openRoom",value:function(e){return o.default.jsCall(l.default.openroom,{},e)}},{key:"openStickerStore",value:function(e){return o.default.jsCall(l.default.openstickerstore,{},e)}},{key:"openCreateChat",value:function(e){return o.default.jsCall(l.default.opencreatechat,{},e)}},{key:"copyLinkCateSticker",value:function(e){return o.default.jsCall(l.default.copylinkcatesticker,{},e)}},{key:"openChat",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openchat,e,t)}},{key:"openTabChat",value:function(e){return o.default.jsCall(l.default.opentabchat,{},e)}},{key:"openAddFriend",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openaddfriend,e,t)}},{key:"openTabMore",value:function(e){return o.default.jsCall(l.default.opentabmore,{},e)}},{key:"openLoginDevices",value:function(e){return o.default.jsCall(l.default.openlogindevices,{},e)}},{key:"openSendSticker",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.opensendsticker,e,t)}},{key:"reportAbuse",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.reportabuse,e,t)}},{key:"followOA",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.followoa,e,t)}},{key:"unfollowOA",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.unfollowoa,e,t)}},{key:"openGameDetail",value:function(e,t){return o.default.jsCall(l.default.opengamedetail,e,t)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=r(n(1)),l=r(n(0));function r(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return a(e,null,[{key:"openAppStore",value:function(e){return o.default.jsCall(l.default.openappstore,e)}},{key:"getLocation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments[2];return o.default.jsCall(l.default.getlocation,{silent_request:e,permission_description:t},n)}},{key:"openApp",value:function(e){return o.default.jsCall(l.default.openapp,e)}},{key:"configRotate",value:function(e,t){return o.default.jsCall(l.default.autorotate,{autoRotate:e},t)}},{key:"showToast",value:function(e,t){return o.default.jsCall(l.default.showtoast,{toast:e},t)}},{key:"queryLocationHide",value:function(e,t,n){return o.default.jsCall(l.default.querylocationhide,{title:e,touserid:t},n)}},{key:"hideKeyboard",value:function(e){return o.default.jsCall(l.default.hidekeyboard,{},e)}},{key:"openPhone",value:function(e){return o.default.jsCall(l.default.openphone,e)}},{key:"openQr",value:function(e){return o.default.jsCall(l.default.openqr,{},e)}},{key:"openSMS",value:function(e,t){return o.default.jsCall(l.default.opensms,{content:e,phoneCode:t})}},{key:"viewQr",value:function(e,t,n){return o.default.jsCall(l.default.viewqr,{uid:e,dpn:t},n)}},{key:"keepScreen",value:function(e,t,n){return o.default.jsCall(l.default.keepscreen,{uid:e,dpn:t},n)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=r(n(1)),l=r(n(0));function r(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return a(e,null,[{key:"changeTitleHeader",value:function(e,t){return o.default.jsCall(l.default.changetitleheader,{title:e},t)}},{key:"clearCacheWebview",value:function(e,t){return o.default.jsCall(l.default.clearcachewebview,{title:e},t)}},{key:"configLeftButton",value:function(e,t){if(!e||!e.buttonType&&!e.homeConfig)throw"data is invalid";return o.default.jsCall(l.default.changeleftbuttonbar,e,t)}},{key:"configRightMenu",value:function(e,t,n,a,r){var u={};return u.supportToolBar=t,u.reset=n,u.menuListItems=e,u.zapp=o.default.getAppId(),u.callback=a,o.default.jsCall(l.default.createoptionmenu,u,r)}},{key:"closeWebview",value:function(e){return o.default.jsCall(l.default.closewindow,{},e)}},{key:"openBioAuthentication",value:function(e,t){return o.default.jsCall(l.default.bioauthen,e,t)}},{key:"jsBridge",value:function(e,t){return o.default.jsCall(l.default.jsbridge,e,t)}},{key:"changeColorHeader",value:function(e,t){return o.default.jsCall(l.default.changeColorHeader,{data:e},t)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=r(n(1)),l=r(n(0));function r(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return a(e,null,[{key:"checkAppInstalled",value:function(e,t){return o.default.jsCall(l.default.checkappinstalled,e,t)}},{key:"queryShow",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.queryshow,e,t)}},{key:"queryHide",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.queryhide,e,t)}},{key:"openInAppRw",value:function(e,t){return o.default.jsCall(l.default.openinapprw,e,t)}},{key:"getTrackingStatus",value:function(e){return o.default.jsCall(l.default.gettrackingstatus,{},e)}},{key:"setTrackingStatus",value:function(e,t){return o.default.jsCall(l.default.settrackingstatus,e,t)}},{key:"getDayStep",value:function(e){return o.default.jsCall(l.default.getdaystep,{},e)}},{key:"forceSubmitData",value:function(e){return o.default.jsCall(l.default.forcesubmitdata,{},e)}},{key:"setWeight",value:function(e,t){return o.default.jsCall(l.default.setweight,e,t)}},{key:"openProfileExt",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openProfileExt,e,t)}},{key:"downloadCate",value:function(e,t){return o.default.jsCall(l.default.downloadcate,e,t)}}]),e}();t.default=u}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("ZJSBridge",[],t):"object"==typeof exports?exports.ZJSBridge=t():e.ZJSBridge=t()}(window,(function(){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(a,o,function(t){return e[t]}.bind(null,o));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./",n(n.s=2)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={getdownloadedsticker:"action.get.downloaded.sticker",opensharesticker:"action.open.share.sticker",openprofile:"action.open.profile",openfeeddetail:"action.open.feeddetail",openfriendrada:"action.open.friendrada",openinapp:"action.open.inapp",openoutapp:"action.open.outapp",openpage:"action.open.page",openphotodetail:"action.open.photodetail",opengalary:"action.open.galary",opengamecenter:"action.open.gamecenter",opengamenews:"action.open.gamenews",opentabcontact:"action.open.tab.contact",opentabsocial:"action.open.tab.social",openfriendsuggest:"action.open.friendsuggest",opengrouplist:"action.open.grouplist",opennearby:"action.open.nearby",openroom:"action.open.room",openstickerstore:"action.open.stickerstore",opencreatechat:"action.open.createchat",copylinkcatesticker:"action.copy.link.catesticker",requestbuysticker:"action.request.buy.sticker",openchat:"action.open.chat",opentabchat:"action.open.tab.chat",openChatGroup:"action.open.chatgroup",openaddfriend:"action.open.addfriend",opentabmore:"action.open.tab.more",openpostfeed:"action.open.postfeed",openlogindevices:"action.open.logindevices",opensendsticker:"action.open.sendsticker",reportabuse:"action.report.abuse",followoa:"action.follow.oa",unfollowoa:"action.unfollow.oa",opengamedetail:"action.open.gamedetail",opensharesheet:"action.open.sharesheet",changetitleheader:"action.change.title.header",clearcachewebview:"action.webview.clearcache",confirmcache:"action.webview.confirmcache",isvisible:"action.webview.isvisible",networktype:"action.webview.networktype",changebuttonheader:"action.change.button.header",createoptionmenu:"action.create.options.menu",createshortcut:"action.create.shortcut",changeleftbuttonbar:"action.change.actionbar.leftbutton.type",closewindow:"action.window.close",checkResError:"action.webview.checkResError",requestPayment:"action.iap.requestpayment",getzbrowserstats:"action.zbrowser.getstats",jsbridge:"action.zbrowser.jsbridge",bioauthen:"action.prompt.authentication",changeColorHeader:"action.change.actionbar.color",openappstore:"action.open.appstore",getlocation:"action.get.location",querylocationhide:"action.query.location.hide",showtoast:"action.show.toast",openapp:"action.open.app",hidekeyboard:"action.hide.keyboard",openphone:"action.open.phone",openqr:"action.open.qr",opensms:"action.open.sms",viewqr:"action.view.myqr",keepscreen:"action.keep.screen",autorotate:"action.change.autorotate",checkappinstalled:"action.check.app.installed",queryshow:"action.query.show",queryhide:"action.query.hide",openinapprw:"action.open.inapprw",gettrackingstatus:"action.zalorun.getTrackingStatus",settrackingstatus:"action.zalorun.setTrackingStatus",getdaystep:"action.zalorun.getDayStep",forcesubmitdata:"action.zalorun.forceSubmitData",setweight:"action.zalorun.setWeight",getAdIdClient:"action.get.adidclient",openProfileExt:"action.open.profile.ext",downloadcate:"action.download.cate",login:"action.jump.login"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=n(0),u=(a=r)&&a.__esModule?a:{default:a};var i=new(function(){function e(t){var n,a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.appId=t||this.getToken("zapp"),this.accessTk=this.getToken("zacc_session")||"DEFAULT_ACCESS_TOKEN",this.jsAccessTk=this.getToken("zlink3rd"),this.jsCallFuncCallbacks={},this.listenerEvent={},this.userAgent=navigator.userAgent||navigator.vendor||window.opera,this.device=(n=this.userAgent,a=n.toLowerCase(),{isWP:/iemobile/.test(a),isAndroid:/android/i.test(a)&&!/iemobile/.test(a),isIOS:/iphone|ipad|ipod/.test(a)&&!/iemobile/.test(a),isMobile:/android|iphone|ipad|ipod|iemobile/.test(a)})}return l(e,[{key:"setAccessToken",value:function(e){this.accessTk=e}},{key:"loginCallback",value:function(e){console.log(e)}},{key:"login",value:function(){alert("call login: "+this.appId+" ZJSBridge.onLoginCallback"),ZaloJavaScriptInterface.login(this.appId,"ZJSBridge.onLoginCallback")}},{key:"getAppId",value:function(){return this.appId}},{key:"isObject",value:function(e){return"object"===(void 0===e?"undefined":o(e))}},{key:"isEmpty",value:function(e){return!e||0===e.trim().length}},{key:"isString",value:function(e){return"string"==typeof e||null!=e&&("object"===(void 0===e?"undefined":o(e))&&(!!e.constructor&&null!==e.constructor.toString().match(/string/i)))}},{key:"parseJSON",value:function(e){return this.isObject(JSON)&&JSON.parse&&this.isString(e)?JSON.parse(e):"object"===(void 0===e?"undefined":o(e))?e:new Function("return "+e)()}},{key:"readCookie",value:function(e){var t=document.cookie;if(t&&(t=t.split("; "))&&t.length>0)for(var n=e.length+1,a=t.length-1;a>=0;a--){var o=t[a];if(o&&0===o.indexOf(e)&&(o=o.substring(n,o.length)))return o=o.replace(/["']/g,"")}return null}},{key:"getCurrHost",value:function(){var e=window.location.host;return e?0===e.indexOf("www.")?e.replace("www.","")+"_":e+"_":""}},{key:"getCurrHostRootZaloMe",value:function(){var e=window.location.host;if(e){if(e.indexOf("zalo.me")>=0)return"zalo.me_";if(e.indexOf("baomoi.com")>=0)return"baomoi.com_";if(e.indexOf("mp3.zing.vn")>=0)return"mp3.zing.vn_";if(e.indexOf("zaloapp.com")>=0)return"zaloapp.com_"}return""}},{key:"isZaloBrowser",value:function(){return window.navigator.userAgent.includes("Zalo")}},{key:"readCookieByDomain",value:function(e){return this.readCookie(this.getCurrHost()+e)}},{key:"readCookieByRootDomain",value:function(e){return this.readCookie(this.getCurrHostRootZaloMe()+e)}},{key:"readCookieFallback",value:function(e){var t=this.readCookieByDomain(e);return t||(t=this.readCookieByRootDomain(e))?t:this.readCookie(e)}},{key:"serialize",value:function(e){if(this.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=new Array;for(var n=e.length,a=0;a<n;a++)t.push(this.serialize(e[a]));return"["+t.join(",")+"]"}if("object"===(void 0===e?"undefined":o(e))){for(var l in t=new Array,e)t.push('"'+l+'":'+this.serialize(e[l]));return"{"+t.join(",")+"}"}return e.toString()}},{key:"getToken",value:function(e){return this.readCookieFallback(e)}},{key:"defaulCallBackJSCall",value:function(e){null!=e&&(e=this.parseJSON(e))}},{key:"onJSCall",value:function(e){try{if(console.log("jscallback: ",e),e=this.parseJSON(e),this.jsCallFuncCallbacks[e.action])this.jsCallFuncCallbacks[e.action].call(this,e),this.jsCallFuncCallbacks[e.action]=null,delete this.jsCallFuncCallbacks[e.action]}catch(e){console.log(e)}}},{key:"isFunction",value:function(e){return"function"==typeof e}},{key:"getFeatureId",value:function(){return this.readCookieFallback("fid")}},{key:"jsCallback",value:function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n)}},{key:"registerListenerEvent",value:function(e,t){console.log("register "+e+" : "+t),this.listenerEvent[e]=t}},{key:"zalo_h5_event_handler",value:function(e,t,n){if(console.log("eventId: "+e+", eventName: "+t+", eventData: "+n),this.listenerEvent[t]){var a=this.listenerEvent[t];this.jsCallback(e,t,a)}}},{key:"jsCall",value:function(e,t,n){var a=this;try{var o=3;if(!this.device.isMobile||this.isEmpty(e))return this.onJSCall({error_code:-13,error_message:"params invalid!",data:{device:this.device.isMobile,jsToken:this.jsAccessTk,access_token:this.accessTk},action:e}),!1;null==t&&(t={}),this.isFunction(t)&&void 0===n&&(n=t,t={}),n||(n=this.defaultCallback);var l={error_code:-14,error_message:"request Timeout!",data:{},action:e};this.jsCallFuncCallbacks[e]=n,e!==u.default.downloadcate&&e!==u.default.openpostfeed&&e!==u.default.opensharesheet&&e!==u.default.openqr&&e!==u.default.requestPayment&&e!==u.default.jsbridge&&e!==u.default.getAdIdClient&&setTimeout((function(){a.onJSCall(l)}),8e3);try{return t=this.serialize(t),this.device.isIOS?ZaloJavaScriptInterface.jsCall(this.jsAccessTk,e,this.accessTk,t,ZJSBridge.onJSCall):ZaloJavaScriptInterface.jsCall(this.jsAccessTk,e,this.accessTk,t,"ZJSBridge.onJSCall")}catch(a){if(!(o-- >0))return l={error_code:-5,error_message:"Not ready!",data:{userAgent:this.userAgent,options:t,jsToken:this.jsAccessTk,access_token:this.accessTk},action:e,js_error:a},this.onJSCall(l),!1;setTimeout(this.jsCall,500,e,this.accessTk,t,n)}}catch(e){console.log(e)}return!1}}]),e}())(window.zAppID);t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.login=t.onLoginCallback=t.onJSCall=t.Misc=t.H5=t.Device=t.Zalo=void 0;var a=c(n(0)),o=c(n(3)),l=c(n(4)),r=c(n(5)),u=c(n(6)),i=c(n(1));function c(e){return e&&e.__esModule?e:{default:e}}function s(e){i.default.loginCallback(e)}window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){i.default.zalo_h5_event_handler(e,t,n)}},t.Zalo=o.default,t.Device=l.default,t.H5=r.default,t.Misc=u.default,t.onJSCall=function(e){i.default.onJSCall(e)},t.onLoginCallback=s,t.login=function(){i.default.jsCall(a.default.login,{},s)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=r(n(1)),l=r(n(0));function r(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return a(e,null,[{key:"getAccessToken",value:function(){return o.default.accessTk?o.default.accessTk:"no token"}},{key:"setAccessToken",value:function(e){return e?o.default.setAccessToken(e):"no token"}},{key:"openTabContact",value:function(e){return console.log("openTabContact"),o.default.jsCall(l.default.opentabcontact,{},e)}},{key:"getDownloadedSticker",value:function(e){return console.log("getDownloadedSticker"),o.default.jsCall(l.default.getDownloadedSticker,{},e)}},{key:"openShareSticker",value:function(e,t){return o.default.jsCall(l.default.opensharesticker,{cateDetailsInfo:e},t)}},{key:"openInApp",value:function(e,t){return o.default.jsCall(l.default.openinapp,{url:e},t)}},{key:"openOutApp",value:function(e,t){return o.default.jsCall(l.default.openoutapp,{url:e},t)}},{key:"openPostFeed",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openpostfeed,e,t)}},{key:"openShareSheet",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.opensharesheet,e,t)}},{key:"registerListenerEvent",value:function(e,t){o.default.registerListenerEvent(e,t)}},{key:"openProfile",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openprofile,e,t)}},{key:"openFeedDetail",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openfeeddetail,e,t)}},{key:"openFriendRada",value:function(e){return o.default.jsCall(l.default.openfriendrada,{},e)}},{key:"openPage",value:function(e){return o.default.jsCall(l.default.openpage,{},e)}},{key:"openPhotoDetail",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openphotodetail,e,t)}},{key:"openGalary",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.opengalary,e,t)}},{key:"openGameCenter",value:function(e){return o.default.jsCall(l.default.opengamecenter,{},e)}},{key:"openGameNews",value:function(e){return o.default.jsCall(l.default.opengamenews,{},e)}},{key:"openTabSocial",value:function(e){return o.default.jsCall(l.default.opentabsocial,{},e)}},{key:"openFriendSuggest",value:function(e){return o.default.jsCall(l.default.openfriendsuggest,{},e)}},{key:"openGroupList",value:function(e){return o.default.jsCall(l.default.opengrouplist,{},e)}},{key:"openNearby",value:function(e){return o.default.jsCall(l.default.opennearby,{},e)}},{key:"openRoom",value:function(e){return o.default.jsCall(l.default.openroom,{},e)}},{key:"openStickerStore",value:function(e){return o.default.jsCall(l.default.openstickerstore,{},e)}},{key:"openCreateChat",value:function(e){return o.default.jsCall(l.default.opencreatechat,{},e)}},{key:"copyLinkCateSticker",value:function(e){return o.default.jsCall(l.default.copylinkcatesticker,{},e)}},{key:"openChat",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openchat,e,t)}},{key:"openTabChat",value:function(e){return o.default.jsCall(l.default.opentabchat,{},e)}},{key:"openAddFriend",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openaddfriend,e,t)}},{key:"openTabMore",value:function(e){return o.default.jsCall(l.default.opentabmore,{},e)}},{key:"openLoginDevices",value:function(e){return o.default.jsCall(l.default.openlogindevices,{},e)}},{key:"openSendSticker",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.opensendsticker,e,t)}},{key:"reportAbuse",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.reportabuse,e,t)}},{key:"followOA",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.followoa,e,t)}},{key:"unfollowOA",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.unfollowoa,e,t)}},{key:"openGameDetail",value:function(e,t){return o.default.jsCall(l.default.opengamedetail,e,t)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=r(n(1)),l=r(n(0));function r(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return a(e,null,[{key:"openAppStore",value:function(e){return o.default.jsCall(l.default.openappstore,e)}},{key:"getLocation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments[2];return o.default.jsCall(l.default.getlocation,{silent_request:e,permission_description:t},n)}},{key:"openApp",value:function(e){return o.default.jsCall(l.default.openapp,e)}},{key:"configRotate",value:function(e,t){return o.default.jsCall(l.default.autorotate,{autoRotate:e},t)}},{key:"showToast",value:function(e,t){return o.default.jsCall(l.default.showtoast,{toast:e},t)}},{key:"queryLocationHide",value:function(e,t,n){var a={};return a.title=e,a.touserid=t,a.zapp=o.default.getAppId(),o.default.jsCall(l.default.querylocationhide,a,n)}},{key:"hideKeyboard",value:function(e){return o.default.jsCall(l.default.hidekeyboard,{},e)}},{key:"openPhone",value:function(e){return o.default.jsCall(l.default.openphone,e)}},{key:"openQr",value:function(e){return o.default.jsCall(l.default.openqr,{},e)}},{key:"openSMS",value:function(e,t){return o.default.jsCall(l.default.opensms,{content:e,phoneCode:t})}},{key:"viewQr",value:function(e,t,n){return o.default.jsCall(l.default.viewqr,{uid:e,dpn:t},n)}},{key:"keepScreen",value:function(e,t){var n=Number(e);return o.default.jsCall(l.default.keepscreen,{keep_screen_on:n},t)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=r(n(1)),l=r(n(0));function r(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return a(e,null,[{key:"changeTitleHeader",value:function(e,t){return o.default.jsCall(l.default.changetitleheader,{title:e},t)}},{key:"clearCacheWebview",value:function(e,t){return o.default.jsCall(l.default.clearcachewebview,{title:e},t)}},{key:"configLeftButton",value:function(e,t){if(!e||!e.buttonType&&!e.homeConfig)throw"data is invalid";return o.default.jsCall(l.default.changeleftbuttonbar,e,t)}},{key:"configRightMenu",value:function(e,t,n,a,r){var u={};return u.supportToolBar=t,u.reset=n,u.menuListItems=e,u.zapp=o.default.getAppId(),u.callback=a,o.default.jsCall(l.default.createoptionmenu,u,r)}},{key:"closeWebview",value:function(e){return o.default.jsCall(l.default.closewindow,{},e)}},{key:"openBioAuthentication",value:function(e,t){return o.default.jsCall(l.default.bioauthen,e,t)}},{key:"jsBridge",value:function(e,t){return o.default.jsCall(l.default.jsbridge,e,t)}},{key:"changeColorHeader",value:function(e,t){return o.default.jsCall(l.default.changeColorHeader,{data:e},t)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=r(n(1)),l=r(n(0));function r(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return a(e,null,[{key:"checkAppInstalled",value:function(e,t){return o.default.jsCall(l.default.checkappinstalled,e,t)}},{key:"queryShow",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.queryshow,e,t)}},{key:"queryHide",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.queryhide,e,t)}},{key:"openInAppRw",value:function(e,t){return o.default.jsCall(l.default.openinapprw,e,t)}},{key:"getTrackingStatus",value:function(e){return o.default.jsCall(l.default.gettrackingstatus,{},e)}},{key:"setTrackingStatus",value:function(e,t){return o.default.jsCall(l.default.settrackingstatus,e,t)}},{key:"getDayStep",value:function(e){return o.default.jsCall(l.default.getdaystep,{},e)}},{key:"forceSubmitData",value:function(e){return o.default.jsCall(l.default.forcesubmitdata,{},e)}},{key:"setWeight",value:function(e,t){return o.default.jsCall(l.default.setweight,e,t)}},{key:"openProfileExt",value:function(e,t){return e.zapp=o.default.getAppId(),o.default.jsCall(l.default.openProfileExt,e,t)}},{key:"downloadCate",value:function(e,t){return o.default.jsCall(l.default.downloadcate,e,t)}}]),e}();t.default=u}])})); | ||
//# sourceMappingURL=lib.js.map |
function hideAllButCurrent(){ | ||
//by default all submenut items are hidden | ||
//but we need to rehide them for search | ||
document.querySelectorAll("nav > .nav-content > ul > li > ul li").forEach(function(parent) { | ||
document.querySelectorAll("nav > ul > li > ul li").forEach(function(parent) { | ||
parent.style.display = "none"; | ||
@@ -10,3 +10,3 @@ }); | ||
var file = window.location.pathname.split("/").pop().replace(/\.html/, ''); | ||
document.querySelectorAll("nav > .nav-content > ul > li > a").forEach(function(parent) { | ||
document.querySelectorAll("nav > ul > li > a").forEach(function(parent) { | ||
var href = parent.attributes.href.value.replace(/\.html/, ''); | ||
@@ -13,0 +13,0 @@ if (file === href) { |
function scrollToNavItem() { | ||
var path = window.location.href.split('/').pop().replace(/\.html/, ''); | ||
document.querySelectorAll('nav .nav-content a').forEach(function(link) { | ||
document.querySelectorAll('nav a').forEach(function(link) { | ||
var href = link.attributes.href.value.replace(/\.html/, ''); | ||
@@ -5,0 +5,0 @@ if (path === href) { |
@@ -15,3 +15,3 @@ | ||
document.querySelectorAll("nav > .nav-content > ul > li:not(.level-hide)").forEach(function(elem) { | ||
document.querySelectorAll("nav > ul > li:not(.level-hide)").forEach(function(elem) { | ||
elem.style.display = "block"; | ||
@@ -25,3 +25,3 @@ }); | ||
//menu by default should be opened | ||
document.querySelectorAll("nav > .nav-content > ul > li > ul li").forEach(function(elem) { | ||
document.querySelectorAll("nav > ul > li > ul li").forEach(function(elem) { | ||
elem.style.display = "block"; | ||
@@ -35,11 +35,11 @@ }); | ||
//show all parents | ||
document.querySelectorAll("nav > .nav-content > ul > li").forEach(function(elem) { | ||
document.querySelectorAll("nav > ul > li").forEach(function(elem) { | ||
elem.style.display = "block"; | ||
}); | ||
//hide all results | ||
document.querySelectorAll("nav > .nav-content > ul > li > ul li").forEach(function(elem) { | ||
document.querySelectorAll("nav > ul > li > ul li").forEach(function(elem) { | ||
elem.style.display = "none"; | ||
}); | ||
//show results matching filter | ||
document.querySelectorAll("nav > .nav-content > ul > li > ul a").forEach(function(elem) { | ||
document.querySelectorAll("nav > ul > li > ul a").forEach(function(elem) { | ||
if (!contains(elem.parentNode, search)) { | ||
@@ -51,3 +51,3 @@ return; | ||
//hide parents without children | ||
document.querySelectorAll("nav > .nav-content > ul > li").forEach(function(parent) { | ||
document.querySelectorAll("nav > ul > li").forEach(function(parent) { | ||
var countSearchA = 0; | ||
@@ -54,0 +54,0 @@ parent.querySelectorAll("a").forEach(function(elem) { |
44
jsdoc.js
@@ -1,8 +0,32 @@ | ||
var fs = require('fs') | ||
'use strict'; | ||
var fs = require('fs'); | ||
var request = require('sync-request'); | ||
const currentVersion = fs.readFileSync('./version.txt', 'utf-8'); | ||
let tagInfo = []; | ||
const res = request('GET', "https://zalogit2.zing.vn/api/v4/projects/3506/repository/tags", { | ||
headers: { | ||
'PRIVATE-TOKEN': 'NZ9st9h_5BiBv4puzGtp' | ||
}, | ||
}); | ||
if (res.statusCode == 200) { | ||
const data = JSON.parse(res.body) | ||
data.forEach(item => { | ||
if (item.release) { | ||
tagInfo.push({ | ||
'version': item.release.tag_name, | ||
'description': item.release.description | ||
}) | ||
} | ||
}) | ||
} | ||
module.exports = { | ||
"name": "ZaloJsBridge", | ||
"brand": "ZaloJSBridge", | ||
"mainpagetitle": "ZaloJSBridge", | ||
"version": currentVersion, | ||
"tagInfo": tagInfo, | ||
"recurseDepth": 10, | ||
@@ -14,3 +38,3 @@ "tags": { | ||
], | ||
"allowUnknownTags": true | ||
"allowUnknownTags": false | ||
}, | ||
@@ -24,7 +48,6 @@ "sourceType": "module", | ||
"plugins": [ | ||
"plugins/markdown", | ||
"./custom-tags.js" | ||
"plugins/markdown" | ||
], | ||
"opts": { | ||
"template": "./docdash", | ||
"template": "node_modules/docdash-custom", | ||
"encoding": "utf8", | ||
@@ -34,3 +57,4 @@ "destination": "docs", | ||
"verbose": true, | ||
"tutorials": "./pages" | ||
"tutorials": "./pages/tutorials", | ||
"homePage": "./README.md" | ||
}, | ||
@@ -43,6 +67,6 @@ "templates": { | ||
"outputSourceFiles": false, | ||
"layoutFile": "./pages/layout.tmpl" | ||
} | ||
}, | ||
"docdash": { | ||
"sort": true, | ||
"meta": { | ||
@@ -58,3 +82,5 @@ "title": "Zalo JS Bridge", | ||
"search": true, | ||
"footer": "" | ||
} | ||
} | ||
} | ||
{ | ||
"name": "zalo-js-bridge", | ||
"version": "1.4.9", | ||
"version": "1.6.1", | ||
"description": "A Javascript Framework for WebApp", | ||
@@ -45,3 +45,2 @@ "engines": { | ||
"babel-register": "6.26.0", | ||
"better-docs": "^2.3.0", | ||
"chai": "4.2.0", | ||
@@ -55,2 +54,3 @@ "chalk": "4.0.0", | ||
"docdash": "1.2.0", | ||
"docdash-custom": "^1.1.4", | ||
"enzyme": "3.11.0", | ||
@@ -86,2 +86,3 @@ "eslint": "7.1.0", | ||
"style-loader": "1.2.1", | ||
"sync-request": "^6.1.0", | ||
"url-loader": "4.1.0", | ||
@@ -88,0 +89,0 @@ "webpack": "4.43.0", |
@@ -1,1 +0,10 @@ | ||
# ZaloJSBridge | ||
This SDK allows you to intergrate with Zalo native app. [Getting started](./tutorial-1_installation.html) | ||
## Stable versions | ||
The most recent version is recommended in production. | ||
|Version|Release Note| | ||
|:-:|-| | ||
<% for(var i=0; i< tagInfo.length; i++) {%>|[v<%= tagInfo[i].version %>](https://h5.zdn.vn/jssdk/<%= tagInfo[i].version %>/docs/index.html)<% if (version == tagInfo[i].version) { %> ✓ <% } %>|<%- tagInfo[i].description.replace(/\n/g, "") %>| | ||
<% } %> |
@@ -1,1 +0,1 @@ | ||
1.4.9 | ||
1.6.1 |
@@ -11,3 +11,3 @@ // For info about this file refer to webpack and webpack-hot-middleware documentation | ||
const currentVersion = fs.readFileSync('./version.txt', 'utf-8'); | ||
const currentVersion = fs.readFileSync('./release-version.txt', 'utf-8'); | ||
@@ -63,2 +63,26 @@ export default { | ||
new HtmlWebpackPlugin({ | ||
template: 'public/example.docs.ejs', | ||
templateParameters: { | ||
'time': Math.round((new Date()).getTime() / 1000), | ||
}, | ||
inject: false, | ||
chunks: ['main'], | ||
minify: { | ||
removeComments: true, | ||
collapseWhitespace: true, | ||
removeRedundantAttributes: true, | ||
useShortDoctype: true, | ||
removeEmptyAttributes: true, | ||
removeStyleLinkTypeAttributes: true, | ||
keepClosingSlash: true, | ||
minifyJS: true, | ||
minifyCSS: true, | ||
minifyURLs: true | ||
}, | ||
// Note that you can add custom options here if you need to handle other custom logic in index.html | ||
// To track JavaScript errors via TrackJS, sign up for a free trial at TrackJS.com and enter your token below. | ||
trackJSToken: '', | ||
filename: '../../pages/tutorials/3_examples.html' | ||
}), | ||
new HtmlWebpackPlugin({ | ||
template: 'public/index.docs.ejs', | ||
@@ -65,0 +89,0 @@ templateParameters: { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 13 instances in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 13 instances in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
43974624
507
0
100
109224
11
55
39