public_html/layouts/basic/modules/SMSNotifier/resources/Edit.min.js.map
{"version":3,"file":"Edit.min.js","sources":["Edit.js"],"sourcesContent":["/* {[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]} */\n'use strict';\n\nVtiger_Edit_Js(\n\t'SMSNotifier_Edit_Js',\n\t{},\n\t{\n\t\t/**\n\t\t * Load variables panel\n\t\t * @param {jQuery} form\n\t\t */\n\t\tloadVariablePanel: function (form) {\n\t\t\tlet panel = form.find('#variablePanel');\n\t\t\tlet reletedField = form.find('[name=\"related_to\"]');\n\t\t\tlet sourceRecord = parseInt(reletedField.val());\n\t\t\tlet sourceModule = reletedField.closest('.fieldValue ').find('input[name=\"popupReferenceModule\"]').val();\n\t\t\tif (!sourceRecord) {\n\t\t\t\tpanel.html('');\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpanel.progressIndicator();\n\t\t\tAppConnector.request({\n\t\t\t\tmodule: 'SMSNotifier',\n\t\t\t\trecord: app.getRecordId(),\n\t\t\t\tview: 'VariablePanel',\n\t\t\t\ttype: 'sms',\n\t\t\t\tsourceRecord: sourceRecord,\n\t\t\t\tselectedModule: sourceModule\n\t\t\t})\n\t\t\t\t.done((response) => {\n\t\t\t\t\tpanel.html(response);\n\t\t\t\t\tthis.afterLoadVariablePanel(panel);\n\t\t\t\t\tApp.Tools.VariablesPanel.registerRefreshCompanyVariables(panel);\n\t\t\t\t})\n\t\t\t\t.fail(() => {\n\t\t\t\t\tpanel.progressIndicator({ mode: 'hide' });\n\t\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Events after load variables panel\n\t\t * @param {jQuery} html\n\t\t */\n\t\tafterLoadVariablePanel: function (html) {\n\t\t\tApp.Fields.Picklist.showSelect2ElementView(html.find('select.select2'));\n\t\t\tApp.Fields.Text.registerCopyClipboard(html);\n\t\t},\n\t\t/**\n\t\t * Register variables panel events\n\t\t * @param {jQuery} form\n\t\t */\n\t\tregisterVariablePanelEvent: function (form) {\n\t\t\tif (typeof form === 'undefined') {\n\t\t\t\tform = this.getForm();\n\t\t\t}\n\t\t\tform\n\t\t\t\t.find('[name=\"message\"]')\n\t\t\t\t.closest('.js-block-content')\n\t\t\t\t.prepend('<div id=\"variablePanel\" class=\"row px-0 borderBottom bc-gray-lighter mt-n1\"></div>');\n\t\t\tthis.loadVariablePanel(form);\n\t\t\tform.find('[name=\"target\"]').on('change', () => {\n\t\t\t\tthis.loadVariablePanel(form);\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Register phone change\n\t\t */\n\t\tregisterPhoneChange: function () {\n\t\t\tthis.getForm()\n\t\t\t\t.find('.js-phone-change')\n\t\t\t\t.on('click', function (e) {\n\t\t\t\t\tlet phoneField = $(e.currentTarget).closest('.fieldValue').find('input[name]');\n\t\t\t\t\tlet value = e.currentTarget.dataset.value;\n\t\t\t\t\tif (phoneField.length && value) {\n\t\t\t\t\t\tphoneField.val(value).trigger('focusout');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Register basic events\n\t\t * @param {jQuery} container\n\t\t */\n\t\tregisterBasicEvents: function (container) {\n\t\t\tthis._super(container);\n\t\t\tthis.registerVariablePanelEvent(container);\n\t\t\tApp.Tools.VariablesPanel.registerRefreshCompanyVariables(container);\n\t\t\tApp.Tools.VariablesPanel.refreshCompanyVariables(container);\n\t\t\tnew App.Fields.Text.Completions(container.find('[name=\"message\"]'), {\n\t\t\t\tcompletionsCollection: { emojis: true },\n\t\t\t\tautolink: false\n\t\t\t});\n\t\t\tthis.registerPhoneChange();\n\t\t}\n\t}\n);\n"],"names":["Vtiger_Edit_Js","loadVariablePanel","form","_this","panel","find","reletedField","sourceRecord","parseInt","val","sourceModule","closest","progressIndicator","AppConnector","request","module","record","app","getRecordId","view","type","selectedModule","done","response","html","afterLoadVariablePanel","App","Tools","VariablesPanel","registerRefreshCompanyVariables","fail","mode","Fields","Picklist","showSelect2ElementView","Text","registerCopyClipboard","registerVariablePanelEvent","_this2","getForm","prepend","on","registerPhoneChange","e","phoneField","$","currentTarget","value","dataset","length","trigger","registerBasicEvents","container","_super","refreshCompanyVariables","Completions","completionsCollection","emojis","autolink"],"mappings":";;AAAA,kKACA,YAAY,CAEZA,cAAc,CACb,qBAAqB,CACrB,EAAE,CACF;AAED;AACA;AACA,KACEC,iBAAiB,CAAE,SAAAA,iBAAUC,CAAAA,IAAI,CAAE,CAAAC,IAAAA,KAAA,CAC9BC,IAAAA,CAAAA,KAAK,CAAGF,IAAI,CAACG,IAAI,CAAC,gBAAgB,CAAC,CACnCC,YAAY,CAAGJ,IAAI,CAACG,IAAI,CAAC,uBAAqB,CAAC,CAC/CE,YAAY,CAAGC,QAAQ,CAACF,YAAY,CAACG,GAAG,EAAE,CAAC,CAC3CC,YAAY,CAAGJ,YAAY,CAACK,OAAO,CAAC,cAAc,CAAC,CAACN,IAAI,CAAC,sCAAoC,CAAC,CAACI,GAAG,EAAE,QACnGF,YAAY,CAKjBH,KAAAA,KAAK,CAACQ,iBAAiB,EAAE,CACzBC,YAAY,CAACC,OAAO,CAAC,CACpBC,MAAM,CAAE,aAAa,CACrBC,MAAM,CAAEC,GAAG,CAACC,WAAW,EAAE,CACzBC,IAAI,CAAE,eAAe,CACrBC,IAAI,CAAE,KAAK,CACXb,YAAY,CAAEA,YAAY,CAC1Bc,cAAc,CAAEX,YACjB,CAAC,CAAC,CACAY,IAAI,CAAC,SAACC,QAAQ,CAAK,CACnBnB,KAAK,CAACoB,IAAI,CAACD,QAAQ,CAAC,CACpBpB,KAAI,CAACsB,sBAAsB,CAACrB,KAAK,CAAC,CAClCsB,GAAG,CAACC,KAAK,CAACC,cAAc,CAACC,+BAA+B,CAACzB,KAAK,EAC/D,CAAC,CAAC,CACD0B,IAAI,CAAC,UAAM,CACX1B,KAAK,CAACQ,iBAAiB,CAAC,CAAEmB,IAAI,CAAE,MAAO,CAAC,EACzC,CAAC,CAAC,CApBF3B,EAAAA,KAAK,CAACoB,IAAI,CAAC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