YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/SMSNotifier/resources/MassSMS.min.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */"use strict";$.Class("SMSNotifier_MassSMS_Js",{},{/** Modal container */container:!1,/** Message field */messageField:!1,/**
         * Register save
         */registerSave:function registerSave(){var _this=this;this.container.find(".js-modal__save").on("click",function(e){e.preventDefault();var form=_this.container.find("form");if(form.validationEngine("validate")){var progress=$.progressIndicator({message:app.vtranslate("JS_SAVE_LOADER_INFO"),blockInfo:{enabled:!0}});AppConnector.request(form.serializeFormData()).done(function(response){app.showNotify({textTrusted:!1,text:response.result.message+" (".concat(response.result.count,")"),type:"info"}),app.hideModalWindow();}).fail(function(){app.showNotify({title:app.vtranslate("JS_ERROR"),type:"error"});}).always(function(){progress.progressIndicator({mode:"hide"});});}});},/**
         * Register templates
         */registerTemplate:function registerTemplate(){var _this2=this,templateField=this.container.find("select#template");templateField.on("change",function(e){e.target.value&&_this2.messageField.val(e.target.value);});},/**
         * Register modal events
         * @param {jQuery} modalContainer
         */registerEvents:function registerEvents(modalContainer){this.container=modalContainer,this.messageField=this.container.find("[name=\"message\"]"),this.registerTemplate(),this.registerSave(),new App.Fields.Text.Completions(this.messageField,{completionsCollection:{emojis:!0},autolink:!1}),App.Fields.MultiImage.register(this.container);}});
//# sourceMappingURL=MassSMS.min.js.map