cronapi-js 3.2.0-SP.1 → 3.2.0-SP.11
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.
- package/cronapi.js +38 -32
- package/dist/cronapi.min.js +1 -1
- package/package.json +1 -1
package/cronapi.js
CHANGED
|
@@ -8052,38 +8052,44 @@ function cronapi() {
|
|
|
8052
8052
|
return breadcrumb;
|
|
8053
8053
|
};
|
|
8054
8054
|
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8055
|
+
/**
|
|
8056
|
+
* @type function
|
|
8057
|
+
* @name {{listBreadcrumb}}
|
|
8058
|
+
* @description {{listBreadcrumbDesc}}
|
|
8059
|
+
* @param {ObjectType.BOOLEAN} root {{listBreadcrumbRoot}}
|
|
8060
|
+
* @param {ObjectType.STRING} title {{listBreadcrumbTitle}}
|
|
8061
|
+
* @param {ObjectType.STRING} link {{listBreadcrumbLink}}
|
|
8062
|
+
* @param {ObjectType.STRING} icon {{listBreadcrumbIcon}}
|
|
8063
|
+
* @returns {ObjectType.STRING}
|
|
8064
|
+
*/
|
|
8065
|
+
this.cronapi.breadcrumb.listBreadcrumb = function ( /** @type {ObjectType.BOOLEAN} @description {{listBreadcrumbRoot}} @blockType util_dropdown @keys true|false @values {{yes}}|{{no}} */ root, /** @type {ObjectType.STRING} @description {{listBreadcrumbTitle}} */ title, /** @type {ObjectType.STRING} @description {{listBreadcrumbIcon}} @blockType util_dropdown @keys calendar|home|download|save|pencil|trash|eye|link|undo|redo|search|zoom-in|zoom-out|cart|print|bell|warning-circle|warning-triangle|info-circle|user|star|heart|plus|minus|check|x|filter|sort-asc|sort-desc|upload|download-light|lock|unlock|folder|folder-open|cloud|play|pause|stop|arrow-up|arrow-right|arrow-down|arrow-left|chevron-up|chevron-right|chevron-down|chevron-left|level-up|level-down|info|envelope|comment|cog|gears|wrench|settings|paperclip|camera|images|clipboard|table|code|chart|chart-pie|chart-line|chart-bar|book|edit|hand|file|file-add|file-remove|folder-add|folder-remove|heart-outline|star-outline|checkbox|radiobutton|thumbs-up|thumbs-down|eye-slash|playlist|volume-up|volume-down|volume-mute|fullscreen|grid|layout|music-notes|camera|gear|map-marker|pin|video @values Calendar|Home|Download|Save|Edit|Delete|Eye|Link|Undo|Redo|Search|Zoom In|Zoom Out|Cart|Print|Bell|Warning Circle|Warning Triangle|Info Circle|User|Star|Heart|Plus|Minus|Check|X|Filter|Sort Ascending|Sort Descending|Upload|Download Light|Lock|Unlock|Folder|Folder Open|Cloud|Play|Pause|Stop|Arrow Up|Arrow Right|Arrow Down|Arrow Left|Chevron Up|Chevron Right|Chevron Down|Chevron Left|Level Up|Level Down|Info|Envelope|Comment|Cog|Gears|Wrench|Settings|Paperclip|Camera|Images|Clipboard|Table|Code|Chart|Chart Pie|Chart Line|Chart Bar|Book|Edit|Hand|File|Add File|Remove File|Add Folder|Remove Folder|Heart Outline|Star Outline|Checkbox|Radio Button|Thumbs Up|Thumbs Down|Eye Slash|Playlist|Volume Up|Volume Down|Volume Mute|Fullscreen|Grid|Layout|Music Notes|Camera|Gear|Map Marker|Pin|Video */ icon, /** @type {ObjectType.STATEMENT} @description {{listBreadcrumbLink}} */ link) {
|
|
8066
|
+
let json = {};
|
|
8067
|
+
|
|
8068
|
+
|
|
8069
|
+
if (root === 'true' || root === true) {
|
|
8070
|
+
json.type = "rootitem";
|
|
8071
|
+
} else {
|
|
8072
|
+
json.type = "item";
|
|
8073
|
+
}
|
|
8074
|
+
|
|
8075
|
+
|
|
8076
|
+
json.text = title;
|
|
8077
|
+
json.showText = true;
|
|
8078
|
+
json.href = "javascript:void(0);";
|
|
8079
|
+
|
|
8080
|
+
|
|
8081
|
+
if (link) json.action = link;
|
|
8082
|
+
|
|
8083
|
+
|
|
8084
|
+
if (icon) {
|
|
8085
|
+
json.icon = icon;
|
|
8086
|
+
json.showIcon = true;
|
|
8087
|
+
} else {
|
|
8088
|
+
json.showIcon = false;
|
|
8089
|
+
}
|
|
8090
|
+
console.log(json);
|
|
8091
|
+
return json;
|
|
8092
|
+
};
|
|
8087
8093
|
|
|
8088
8094
|
/**
|
|
8089
8095
|
* @category Websocket
|
package/dist/cronapi.min.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
#=text#
|
|
20
20
|
</div>
|
|
21
21
|
</div>
|
|
22
|
-
</div>`);kendo.chat.Templates.kendoChatHtmlTemplate||kendo.chat.registerTemplate("kendoChatHtmlTemplate",l);let p=[];if(Array.isArray(a))for(let n in a){let t={contentType:"kendoChatHtmlTemplate",content:{text:s(a[n])}};p.push(t)}else{let n={contentType:"kendoChatHtmlTemplate",content:{text:s(a)}};p.push(n)}getChat(n).then(n=>{if(n)n.renderAttachments({attachments:p,attachmentLayout:o},t),r();else{let n=this.cronapi.$translate.instant("chatElementNotPresent");this.cronapi.$scope.Notification.error(n),c(n)}})},this.cronapi.chat.renderChatSuggestedActions=function(n,t,a,o){getChat(n).then(n=>{if(n)n.renderSuggestedActions(Array.isArray(t)?t:[t]),a();else{let n=this.cronapi.$translate.instant("chatElementNotPresent");this.cronapi.$scope.Notification.error(n),o(n)}})},this.cronapi.chat.renderChatUserTypingIndicator=function(n,t,a,o){getChat(n).then(n=>{if(n)n.renderUserTypingIndicator(t),a();else{let n=this.cronapi.$translate.instant("chatElementNotPresent");this.cronapi.$scope.Notification.error(n),o(n)}})},this.cronapi.chat.clearChatUserTypingIndicator=function(n,t,a,o){getChat(n).then(n=>{if(n)n.clearUserTypingIndicator(t),a();else{let n=this.cronapi.$translate.instant("chatElementNotPresent");this.cronapi.$scope.Notification.error(n),o(n)}})},this.cronapi.chat.removeChatTypingIndicator=function(n,t,a){getChat(n).then(n=>{if(n)n.removeTypingIndicator(),t();else{let n=this.cronapi.$translate.instant("chatElementNotPresent");this.cronapi.$scope.Notification.error(n),a(n)}})},this.cronapi.util.setCookie=function(n,t,a,o){function r(n){return"seconds"===n?l=1e3:"minutes"===n?l=6e4:"hours"===n?l=36e5:"days"==n&&(l=864e5),l}let c=new Date,s=new Date,l=0;const p=86400000;this.cronapi.logic.isNullOrEmpty(o)||0==o?s.setTime(c.getTime()+86400000):s.setTime(c.getTime()+parseInt(o*r(a))),document.cookie=encodeURIComponent(n)+"="+encodeURIComponent(t)+"; expires="+s.toGMTString()},this.cronapi.util.getCookie=function(n){function t(){return document.cookie.split("; ")}function a(n,t){return n.find(n=>n.startsWith(t+"="))}function o(n){return"undefined"==typeof n?null:n.split("=").pop()}const r=t(),c=a(r,n);return o(c)},this.cronapi.util.checkSavedCookies=function(n){var t=document.cookie.split(";");return t.forEach(function(n){let[a,o]=n.split("=");t[a.trim()]=o}),t.cookieEssencial},this.cronapi.authentication={},this.cronapi.authentication.login=function(n,t,a){this.cronapi.social.login(n,t,a)},this.cronapi.authentication.changePassword=function(){let n,t,a;this.cronapi.screen.getValueOfField("vars.newPassword")===this.cronapi.screen.getValueOfField("vars.confirmationPassword")?(a=this.cronapi.screen.getValueOfField("vars.oldPassword"),n=this.cronapi.screen.getValueOfField("vars.newPassword"),t=this.cronapi.screen.getValueOfField("vars.confirmationPassword"),this.cronapi.screen.showLoading(),this.cronapi.logic.isNullOrEmpty(this.cronapi.screen.getHostapp())?(this.cronapi.screen.hide(),this.cronapi.screen.notify("error","HostApp is Required")):this.cronapi.util.getURLFromOthers("POST","application/x-www-form-urlencoded",this.cronapi.screen.getHostapp()+""+"changePassword",this.cronapi.object.createObjectFromString(["{ \"oldPassword\": \"",a,"\" , \"newPassword\": \"",n,"\" , \"newPasswordConfirmation\": \"",t,"\" } "].join("")),this.cronapi.object.createObjectFromString(["{ \"X-AUTH-TOKEN\": \"",this.cronapi.util.getUserToken(),"\" } "].join("")),async n=>{this.cronapi.screen.hide(),this.cronapi.screen.notify("info",this.cronapi.i18n.translate("Home.view.passwordChanged",[]));try{await this.cronapi.client("blockly.js.blockly.auth.ChangePassword.closeModal").run()}catch(n){this.cronapi.screen.hideIonicModal("changePassword")}finally{this.cronapi.screen.changeValueOfField("vars.oldPassword",""),this.cronapi.screen.changeValueOfField("vars.newPassword",""),this.cronapi.screen.changeValueOfField("vars.confirmationPassword","")}},n=>{"403"==this.cronapi.object.getProperty(n,"status")||"401"==this.cronapi.object.getProperty(n,"status")?this.cronapi.screen.notify("error",this.cronapi.i18n.translate("Login.view.invalidPassword",[])):this.cronapi.screen.notify("error",this.cronapi.object.getProperty(n,"responseJSON.message")),this.cronapi.screen.hide()})):this.cronapi.screen.notify("error",this.cronapi.i18n.translate("Login.view.invalidPassword",[]))},this.cronapi.authentication.signup=async function(n,t,a,o){let r=this.cronapi.authentication.isValidSignup,c,s,l,p;const d=this?.blockly?.js?.blockly?.UserControl?.isValidSignup,u=this?.blockly?.js?.blockly?.auth?.UserControl?.isValidSignup;angular.isFunction(d)?r=d:angular.isFunction(u)&&(r=u),(await r(n,t,a,o))&&this.cronapi.util.callServerBlocklyAsynchronous("blockly.UserControl:signUp",async n=>{c=n,s=this.cronapi.json.createObjectFromString(c),l=this.cronapi.json.getProperty(s,"code"),p=this.cronapi.json.getProperty(s,"message"),"201"==l?(window.cordova&&window.ionic?this.cronapi.screen.changeView("#/app/login",[]):this.cronapi.screen.changeView("#/login",[]),this.cronapi.screen.notify("success",this.cronapi.i18n.translate("UserSuccessfullyRegistered",[]))):this.cronapi.logic.isNullOrEmpty(p)?this.cronapi.screen.notify("error",this.cronapi.i18n.translate("General.ErrorNotSpecified",[])):this.cronapi.screen.notify("warning",p)},n,t,a)},this.cronapi.authentication.mutualSignup=async function(){let n;this.cronapi.util.getURLFromOthers("POST","application/x-www-form-urlencoded",this.cronapi.util.getBaseUrl()+""+"/mutual/register",this.cronapi.object.createObjectFromString(["{ \"token\": \"",this.cronapi.util.getUserToken(),"\" } "].join("")),null,async t=>{n=t,this.cronapi.screen.notify("info",this.cronapi.i18n.translate("Home.view.tokenRegistered",[]))},async t=>{n=t,this.cronapi.screen.notify("error",this.cronapi.object.getProperty(n,"responseJSON.message"))})},this.cronapi.authentication.mutualLogin=async function(){let n;this.cronapi.util.getURLFromOthers("POST","application/x-www-form-urlencoded",this.cronapi.util.getBaseUrl()+""+"/mutual/register",this.cronapi.object.createObjectFromString(["{ \"token\": \"",this.cronapi.util.getUserToken(),"\" } "].join("")),null,async t=>{n=t,this.cronapi.screen.notify("info",this.cronapi.i18n.translate("Home.view.tokenRegistered",[]))},async t=>{n=t,this.cronapi.screen.notify("error",this.cronapi.object.getProperty(n,"responseJSON.message"))})},this.cronapi.authentication.isValidSignup=function(n,t,a,o){let r=!0;return this.cronapi.logic.isNullOrEmpty(n)&&(this.cronapi.screen.notify("error",this.cronapi.i18n.translate("UsernameCanNotBeEmpty",[])),r=!1),this.cronapi.logic.isNullOrEmpty(t)&&(this.cronapi.screen.notify("error",this.cronapi.i18n.translate("EmailCanNotBeEmpty",[])),r=!1),this.cronapi.logic.isNullOrEmpty(a)&&(this.cronapi.screen.notify("error",this.cronapi.i18n.translate("PasswordCanNotBeEmpty",[])),r=!1),this.cronapi.logic.isNullOrEmpty(o)&&(this.cronapi.screen.notify("error",this.cronapi.i18n.translate("PasswordConfirmationCanNotBeEmpty",[])),r=!1),a!==o&&(this.cronapi.screen.notify("error",this.cronapi.i18n.translate("PasswordDoesNotMatch",[])),r=!1),r},this.cronapi.authentication.resetPassword=function(n){this.cronapi.logic.isNullOrEmpty(n)?this.cronapi.screen.notify("error",this.cronapi.i18n.translate("EmailCanNotBeEmpty",[])):this.cronapi.util.callServerBlocklyAsynchronous("blockly.UserControl:resetPassword",n=>{this.cronapi.screen.notify("success",this.cronapi.i18n.translate("ForgotPasswordSent",[])),this.cronapi.screen.hideModal("forgotPasswordModal")},n,!1)},this.cronapi.authentication.resetPasswordWithOTP=function(n){this.cronapi.logic.isNullOrEmpty(n)?this.cronapi.screen.notify("error",this.cronapi.i18n.translate("EmailCanNotBeEmpty",[])):(localStorage.removeItem("otpToken"),this.cronapi.util.callServerBlocklyAsynchronous("blockly.UserControl:resetPassword",n=>{localStorage.setItem("otpToken",n),this.cronapi.screen.changeView("#/app/login",[])},n,!0),this.cronapi.screen.notify("success",this.cronapi.i18n.translate("ForgotPasswordSent",[])))},this.cronapi.organizers={},this.cronapi.organizers.marker=function(){},this.cronapi.organizers.comment=function(){},this.cronapi.organizers.group=function(){},this.cronapi.map={},this.cronapi.map.createMap=function(n){return n},this.cronapi.map.setMapValueByKey=function(n,t,a){const o={[t]:a};n.push(o)},this.cronapi.map.setMapValueByPath=function(n,t,a){const o={},r=t.split("."),c=r.pop(),s=r.reduce((n,t)=>n[t]=n[t]||{},o);s[c]=a,n.push(o)},this.cronapi.map.getMapValueByPath=function(n,t){let a=null;return n.forEach(n=>{a=n;for(const o=t.split(".");o.length;){const n=o.shift();if(!a.hasOwnProperty(n))break;a=a[n]}}),a},this.cronapi.map.getMapValueByKey=function(n,t){let a=null;return n.forEach(n=>{n.hasOwnProperty(t)&&(a=n[t])}),a},this.cronapi.breadcrumb={},this.cronapi.breadcrumb.jsonBreadcrumb=function(n){let t=[];return n=Array.isArray(n)?n:[n],n.forEach(function(n){t.push(n)}),t},this.cronapi.breadcrumb.listBreadcrumb=function(n,t,a,o){let r={};return r.type="true"===n||!0===n?"rootitem":"item",r.text=t,r.showText=!0,r.href="javascript:void(0);",o&&(r.action=o),a?(r.icon=a,r.showIcon=!0):r.showIcon=!1,r},this.cronapi.websocket={},this.cronapi.websocket.connect=function(n,t,a,o){function r(){c.ws=new WebSocket(n),c.ws.onopen=()=>{t&&t(c.ws)},c.ws.onmessage=n=>{a&&a(n.data)},c.ws.onclose=n=>{c.__closed||(console.log("Socket is closed. Reconnect will be attempted in 1 second.",n.reason),setTimeout(()=>{r()},1e3))},c.ws.onerror=n=>{console.error("Socket encountered error: ",n.message),o&&o(n)}}let c={};return r(),c},this.cronapi.websocket.send=function(n,t){n&&!n.__closed&&n.ws.send(t)},this.cronapi.websocket.close=function(n){n&&!n.__closed&&(n.__closed=!0,n.ws.close())},this.cronapi.multimedia=this.cronapi.multimedia||{},this.cronapi.multimedia.recordAudio=async function(){let n={audio:!0};try{const t=await navigator.mediaDevices.getUserMedia(n),a=document.createElement("audio");a.srcObject=t,document.body.appendChild(a);const o=new MediaRecorder(t);return o.start(),o}catch(n){alert(n)}},this.cronapi.multimedia.pauseRecord=async function(n){"recording"===n.state?n.pause():n.resume()},this.cronapi.multimedia.stopRecord=async function(n){const t=new Promise(function(t,a){let o=[];n.ondataavailable=function(n){o.push(n.data)},n.onstop=function(){let n=new Blob(o,{type:"audio/mp3;"});t(n)},n.stop()}),a=await t;return a}}cronapi.bind(window)();try{module&&(module.exports={window})}catch(n){}
|
|
22
|
+
</div>`);kendo.chat.Templates.kendoChatHtmlTemplate||kendo.chat.registerTemplate("kendoChatHtmlTemplate",l);let p=[];if(Array.isArray(a))for(let n in a){let t={contentType:"kendoChatHtmlTemplate",content:{text:s(a[n])}};p.push(t)}else{let n={contentType:"kendoChatHtmlTemplate",content:{text:s(a)}};p.push(n)}getChat(n).then(n=>{if(n)n.renderAttachments({attachments:p,attachmentLayout:o},t),r();else{let n=this.cronapi.$translate.instant("chatElementNotPresent");this.cronapi.$scope.Notification.error(n),c(n)}})},this.cronapi.chat.renderChatSuggestedActions=function(n,t,a,o){getChat(n).then(n=>{if(n)n.renderSuggestedActions(Array.isArray(t)?t:[t]),a();else{let n=this.cronapi.$translate.instant("chatElementNotPresent");this.cronapi.$scope.Notification.error(n),o(n)}})},this.cronapi.chat.renderChatUserTypingIndicator=function(n,t,a,o){getChat(n).then(n=>{if(n)n.renderUserTypingIndicator(t),a();else{let n=this.cronapi.$translate.instant("chatElementNotPresent");this.cronapi.$scope.Notification.error(n),o(n)}})},this.cronapi.chat.clearChatUserTypingIndicator=function(n,t,a,o){getChat(n).then(n=>{if(n)n.clearUserTypingIndicator(t),a();else{let n=this.cronapi.$translate.instant("chatElementNotPresent");this.cronapi.$scope.Notification.error(n),o(n)}})},this.cronapi.chat.removeChatTypingIndicator=function(n,t,a){getChat(n).then(n=>{if(n)n.removeTypingIndicator(),t();else{let n=this.cronapi.$translate.instant("chatElementNotPresent");this.cronapi.$scope.Notification.error(n),a(n)}})},this.cronapi.util.setCookie=function(n,t,a,o){function r(n){return"seconds"===n?l=1e3:"minutes"===n?l=6e4:"hours"===n?l=36e5:"days"==n&&(l=864e5),l}let c=new Date,s=new Date,l=0;const p=86400000;this.cronapi.logic.isNullOrEmpty(o)||0==o?s.setTime(c.getTime()+86400000):s.setTime(c.getTime()+parseInt(o*r(a))),document.cookie=encodeURIComponent(n)+"="+encodeURIComponent(t)+"; expires="+s.toGMTString()},this.cronapi.util.getCookie=function(n){function t(){return document.cookie.split("; ")}function a(n,t){return n.find(n=>n.startsWith(t+"="))}function o(n){return"undefined"==typeof n?null:n.split("=").pop()}const r=t(),c=a(r,n);return o(c)},this.cronapi.util.checkSavedCookies=function(n){var t=document.cookie.split(";");return t.forEach(function(n){let[a,o]=n.split("=");t[a.trim()]=o}),t.cookieEssencial},this.cronapi.authentication={},this.cronapi.authentication.login=function(n,t,a){this.cronapi.social.login(n,t,a)},this.cronapi.authentication.changePassword=function(){let n,t,a;this.cronapi.screen.getValueOfField("vars.newPassword")===this.cronapi.screen.getValueOfField("vars.confirmationPassword")?(a=this.cronapi.screen.getValueOfField("vars.oldPassword"),n=this.cronapi.screen.getValueOfField("vars.newPassword"),t=this.cronapi.screen.getValueOfField("vars.confirmationPassword"),this.cronapi.screen.showLoading(),this.cronapi.logic.isNullOrEmpty(this.cronapi.screen.getHostapp())?(this.cronapi.screen.hide(),this.cronapi.screen.notify("error","HostApp is Required")):this.cronapi.util.getURLFromOthers("POST","application/x-www-form-urlencoded",this.cronapi.screen.getHostapp()+""+"changePassword",this.cronapi.object.createObjectFromString(["{ \"oldPassword\": \"",a,"\" , \"newPassword\": \"",n,"\" , \"newPasswordConfirmation\": \"",t,"\" } "].join("")),this.cronapi.object.createObjectFromString(["{ \"X-AUTH-TOKEN\": \"",this.cronapi.util.getUserToken(),"\" } "].join("")),async n=>{this.cronapi.screen.hide(),this.cronapi.screen.notify("info",this.cronapi.i18n.translate("Home.view.passwordChanged",[]));try{await this.cronapi.client("blockly.js.blockly.auth.ChangePassword.closeModal").run()}catch(n){this.cronapi.screen.hideIonicModal("changePassword")}finally{this.cronapi.screen.changeValueOfField("vars.oldPassword",""),this.cronapi.screen.changeValueOfField("vars.newPassword",""),this.cronapi.screen.changeValueOfField("vars.confirmationPassword","")}},n=>{"403"==this.cronapi.object.getProperty(n,"status")||"401"==this.cronapi.object.getProperty(n,"status")?this.cronapi.screen.notify("error",this.cronapi.i18n.translate("Login.view.invalidPassword",[])):this.cronapi.screen.notify("error",this.cronapi.object.getProperty(n,"responseJSON.message")),this.cronapi.screen.hide()})):this.cronapi.screen.notify("error",this.cronapi.i18n.translate("Login.view.invalidPassword",[]))},this.cronapi.authentication.signup=async function(n,t,a,o){let r=this.cronapi.authentication.isValidSignup,c,s,l,p;const d=this?.blockly?.js?.blockly?.UserControl?.isValidSignup,u=this?.blockly?.js?.blockly?.auth?.UserControl?.isValidSignup;angular.isFunction(d)?r=d:angular.isFunction(u)&&(r=u),(await r(n,t,a,o))&&this.cronapi.util.callServerBlocklyAsynchronous("blockly.UserControl:signUp",async n=>{c=n,s=this.cronapi.json.createObjectFromString(c),l=this.cronapi.json.getProperty(s,"code"),p=this.cronapi.json.getProperty(s,"message"),"201"==l?(window.cordova&&window.ionic?this.cronapi.screen.changeView("#/app/login",[]):this.cronapi.screen.changeView("#/login",[]),this.cronapi.screen.notify("success",this.cronapi.i18n.translate("UserSuccessfullyRegistered",[]))):this.cronapi.logic.isNullOrEmpty(p)?this.cronapi.screen.notify("error",this.cronapi.i18n.translate("General.ErrorNotSpecified",[])):this.cronapi.screen.notify("warning",p)},n,t,a)},this.cronapi.authentication.mutualSignup=async function(){let n;this.cronapi.util.getURLFromOthers("POST","application/x-www-form-urlencoded",this.cronapi.util.getBaseUrl()+""+"/mutual/register",this.cronapi.object.createObjectFromString(["{ \"token\": \"",this.cronapi.util.getUserToken(),"\" } "].join("")),null,async t=>{n=t,this.cronapi.screen.notify("info",this.cronapi.i18n.translate("Home.view.tokenRegistered",[]))},async t=>{n=t,this.cronapi.screen.notify("error",this.cronapi.object.getProperty(n,"responseJSON.message"))})},this.cronapi.authentication.mutualLogin=async function(){let n;this.cronapi.util.getURLFromOthers("POST","application/x-www-form-urlencoded",this.cronapi.util.getBaseUrl()+""+"/mutual/register",this.cronapi.object.createObjectFromString(["{ \"token\": \"",this.cronapi.util.getUserToken(),"\" } "].join("")),null,async t=>{n=t,this.cronapi.screen.notify("info",this.cronapi.i18n.translate("Home.view.tokenRegistered",[]))},async t=>{n=t,this.cronapi.screen.notify("error",this.cronapi.object.getProperty(n,"responseJSON.message"))})},this.cronapi.authentication.isValidSignup=function(n,t,a,o){let r=!0;return this.cronapi.logic.isNullOrEmpty(n)&&(this.cronapi.screen.notify("error",this.cronapi.i18n.translate("UsernameCanNotBeEmpty",[])),r=!1),this.cronapi.logic.isNullOrEmpty(t)&&(this.cronapi.screen.notify("error",this.cronapi.i18n.translate("EmailCanNotBeEmpty",[])),r=!1),this.cronapi.logic.isNullOrEmpty(a)&&(this.cronapi.screen.notify("error",this.cronapi.i18n.translate("PasswordCanNotBeEmpty",[])),r=!1),this.cronapi.logic.isNullOrEmpty(o)&&(this.cronapi.screen.notify("error",this.cronapi.i18n.translate("PasswordConfirmationCanNotBeEmpty",[])),r=!1),a!==o&&(this.cronapi.screen.notify("error",this.cronapi.i18n.translate("PasswordDoesNotMatch",[])),r=!1),r},this.cronapi.authentication.resetPassword=function(n){this.cronapi.logic.isNullOrEmpty(n)?this.cronapi.screen.notify("error",this.cronapi.i18n.translate("EmailCanNotBeEmpty",[])):this.cronapi.util.callServerBlocklyAsynchronous("blockly.UserControl:resetPassword",n=>{this.cronapi.screen.notify("success",this.cronapi.i18n.translate("ForgotPasswordSent",[])),this.cronapi.screen.hideModal("forgotPasswordModal")},n,!1)},this.cronapi.authentication.resetPasswordWithOTP=function(n){this.cronapi.logic.isNullOrEmpty(n)?this.cronapi.screen.notify("error",this.cronapi.i18n.translate("EmailCanNotBeEmpty",[])):(localStorage.removeItem("otpToken"),this.cronapi.util.callServerBlocklyAsynchronous("blockly.UserControl:resetPassword",n=>{localStorage.setItem("otpToken",n),this.cronapi.screen.changeView("#/app/login",[])},n,!0),this.cronapi.screen.notify("success",this.cronapi.i18n.translate("ForgotPasswordSent",[])))},this.cronapi.organizers={},this.cronapi.organizers.marker=function(){},this.cronapi.organizers.comment=function(){},this.cronapi.organizers.group=function(){},this.cronapi.map={},this.cronapi.map.createMap=function(n){return n},this.cronapi.map.setMapValueByKey=function(n,t,a){const o={[t]:a};n.push(o)},this.cronapi.map.setMapValueByPath=function(n,t,a){const o={},r=t.split("."),c=r.pop(),s=r.reduce((n,t)=>n[t]=n[t]||{},o);s[c]=a,n.push(o)},this.cronapi.map.getMapValueByPath=function(n,t){let a=null;return n.forEach(n=>{a=n;for(const o=t.split(".");o.length;){const n=o.shift();if(!a.hasOwnProperty(n))break;a=a[n]}}),a},this.cronapi.map.getMapValueByKey=function(n,t){let a=null;return n.forEach(n=>{n.hasOwnProperty(t)&&(a=n[t])}),a},this.cronapi.breadcrumb={},this.cronapi.breadcrumb.jsonBreadcrumb=function(n){let t=[];return n=Array.isArray(n)?n:[n],n.forEach(function(n){t.push(n)}),t},this.cronapi.breadcrumb.listBreadcrumb=function(n,t,a,o){let r={};return r.type="true"===n||!0===n?"rootitem":"item",r.text=t,r.showText=!0,r.href="javascript:void(0);",o&&(r.action=o),a?(r.icon=a,r.showIcon=!0):r.showIcon=!1,console.log(r),r},this.cronapi.websocket={},this.cronapi.websocket.connect=function(n,t,a,o){function r(){c.ws=new WebSocket(n),c.ws.onopen=()=>{t&&t(c.ws)},c.ws.onmessage=n=>{a&&a(n.data)},c.ws.onclose=n=>{c.__closed||(console.log("Socket is closed. Reconnect will be attempted in 1 second.",n.reason),setTimeout(()=>{r()},1e3))},c.ws.onerror=n=>{console.error("Socket encountered error: ",n.message),o&&o(n)}}let c={};return r(),c},this.cronapi.websocket.send=function(n,t){n&&!n.__closed&&n.ws.send(t)},this.cronapi.websocket.close=function(n){n&&!n.__closed&&(n.__closed=!0,n.ws.close())},this.cronapi.multimedia=this.cronapi.multimedia||{},this.cronapi.multimedia.recordAudio=async function(){let n={audio:!0};try{const t=await navigator.mediaDevices.getUserMedia(n),a=document.createElement("audio");a.srcObject=t,document.body.appendChild(a);const o=new MediaRecorder(t);return o.start(),o}catch(n){alert(n)}},this.cronapi.multimedia.pauseRecord=async function(n){"recording"===n.state?n.pause():n.resume()},this.cronapi.multimedia.stopRecord=async function(n){const t=new Promise(function(t,a){let o=[];n.ondataavailable=function(n){o.push(n.data)},n.onstop=function(){let n=new Blob(o,{type:"audio/mp3;"});t(n)},n.stop()}),a=await t;return a}}cronapi.bind(window)();try{module&&(module.exports={window})}catch(n){}
|
|
23
23
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ZXing={})}(this,(function(t){"use strict";
|
|
24
24
|
/*! *****************************************************************************
|
|
25
25
|
Copyright (c) Microsoft Corporation. All rights reserved.
|