public_html/layouts/resources/ProgressIndicator.min.js.map
{"version":3,"file":"ProgressIndicator.min.js","sources":["ProgressIndicator.js"],"sourcesContent":["/*+***********************************************************************************\n * The contents of this file are subject to the vtiger CRM Public License Version 1.0\n * (\"License\"); You may not use this file except in compliance with the License\n * The Original Code is: vtiger CRM Open Source\n * The Initial Developer of the Original Code is vtiger.\n * Portions created by vtiger are Copyright (C) vtiger.\n * All Rights Reserved.\n *************************************************************************************/\n'use strict';\n\n(function ($) {\n\tvar ProgressIndicatorHelper = function () {\n\t\tvar thisInstance = this;\n\n\t\tthis.defaults = {\n\t\t\tposition: 'append',\n\t\t\tmode: 'show',\n\t\t\tblockInfo: {\n\t\t\t\telementToBlock: 'body'\n\t\t\t},\n\t\t\tmessage: ''\n\t\t};\n\n\t\tthis.imageContainerCss = {\n\t\t\t'text-align': 'center'\n\t\t};\n\n\t\tthis.blockOverlayCSS = {\n\t\t\topacity: 0.8,\n\t\t\t'background-color': '#fff'\n\t\t};\n\n\t\tthis.blockCss = {\n\t\t\tborder: '',\n\t\t\t'background-color': '',\n\t\t\t'background-clip': 'border-box',\n\t\t\t'border-radius': '2px'\n\t\t};\n\n\t\tthis.showTopCSS = {\n\t\t\twidth: '25%',\n\t\t\tleft: '37.5%',\n\t\t\tposition: 'fixed',\n\t\t\ttop: '4.5%',\n\t\t\t'z-index': '100000'\n\t\t};\n\n\t\tthis.showOnTop = false;\n\n\t\tthis.init = function (element, options = {}) {\n\t\t\tthisInstance.options = $.extend(true, this.defaults, options);\n\t\t\tthisInstance.blockOverlayCSS = Object.assign(\n\t\t\t\tthisInstance.blockOverlayCSS,\n\t\t\t\toptions.blockOverlayCSS ? options.blockOverlayCSS : {}\n\t\t\t);\n\t\t\tthisInstance.container = element;\n\t\t\tthisInstance.position = options.position;\n\t\t\tif (typeof options.imageContainerCss !== 'undefined') {\n\t\t\t\tthisInstance.imageContainerCss = $.extend(true, this.imageContainerCss, options.imageContainerCss);\n\t\t\t}\n\t\t\tif (this.isBlockMode()) {\n\t\t\t\tthisInstance.elementToBlock = $(thisInstance.options.blockInfo.elementToBlock);\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tthis.initActions = function () {\n\t\t\tif (this.options.mode == 'show') {\n\t\t\t\tthis.show();\n\t\t\t} else if (this.options.mode == 'hide') {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t};\n\n\t\tthis.isPageBlockMode = function () {\n\t\t\tif (typeof this.elementToBlock !== 'undefined' && this.elementToBlock.is('body')) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\tthis.isBlockMode = function () {\n\t\t\tif (typeof this.options.blockInfo !== 'undefined' && this.options.blockInfo.enabled == true) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\tthis.show = function () {\n\t\t\tvar className = 'bigLoading';\n\t\t\tif (this.options.smallLoadingImage == true) {\n\t\t\t\tclassName = 'smallLoading';\n\t\t\t}\n\t\t\tif (this.isBlockMode()) {\n\t\t\t\tclassName = className + ' blockProgressContainer';\n\t\t\t}\n\t\t\tvar imageHtml =\n\t\t\t\t'<div class=\"imageHolder ' +\n\t\t\t\tclassName +\n\t\t\t\t'\">' +\n\t\t\t\t'<div class=\"sk-cube-grid\"><div class=\"sk-cube sk-cube1\"></div>' +\n\t\t\t\t'<div class=\"sk-cube sk-cube2\"></div>' +\n\t\t\t\t'<div class=\"sk-cube sk-cube3\"></div><div class=\"sk-cube sk-cube4\"></div><div class=\"sk-cube sk-cube5\"></div>' +\n\t\t\t\t'<div class=\"sk-cube sk-cube6\"></div><div class=\"sk-cube sk-cube7\"></div><div class=\"sk-cube sk-cube8\"></div>' +\n\t\t\t\t'<div class=\"sk-cube sk-cube9\"></div></div></div>';\n\t\t\tvar jQImageHtml = jQuery(imageHtml).css(this.imageContainerCss);\n\n\t\t\tvar jQMessage = thisInstance.options.message;\n\t\t\tif (jQMessage !== false) {\n\t\t\t\tif (jQMessage.length == 0) {\n\t\t\t\t\tjQMessage = app.vtranslate('JS_LOADING_PLEASE_WAIT');\n\t\t\t\t}\n\t\t\t\tif (!(jQMessage instanceof jQuery)) {\n\t\t\t\t\tjQMessage = jQuery('<span></span>').html(jQMessage);\n\t\t\t\t}\n\t\t\t\tvar messageContainer = jQuery('<div class=\"message\"></div>').append(jQMessage);\n\t\t\t}\n\t\t\tjQImageHtml.append(messageContainer);\n\t\t\tif (this.isBlockMode()) {\n\t\t\t\tjQImageHtml.addClass('blockMessageContainer');\n\t\t\t}\n\n\t\t\tswitch (thisInstance.position) {\n\t\t\t\tcase 'prepend':\n\t\t\t\t\tthisInstance.container.prepend(jQImageHtml);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'html':\n\t\t\t\t\tthisInstance.container.html(jQImageHtml);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'replace':\n\t\t\t\t\tthisInstance.container.replaceWith(jQImageHtml);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthisInstance.container.append(jQImageHtml);\n\t\t\t}\n\t\t\tif (this.isBlockMode()) {\n\t\t\t\tthisInstance.blockedElement = thisInstance.elementToBlock;\n\t\t\t\tif (thisInstance.isPageBlockMode()) {\n\t\t\t\t\t$.blockUI({\n\t\t\t\t\t\tmessage: thisInstance.container,\n\t\t\t\t\t\toverlayCSS: thisInstance.blockOverlayCSS,\n\t\t\t\t\t\tcss: thisInstance.blockCss,\n\t\t\t\t\t\tonBlock: thisInstance.options.blockInfo.onBlock\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthisInstance.elementToBlock.block({\n\t\t\t\t\t\tmessage: thisInstance.container,\n\t\t\t\t\t\toverlayCSS: thisInstance.blockOverlayCSS,\n\t\t\t\t\t\tcss: thisInstance.blockCss\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (thisInstance.showOnTop) {\n\t\t\t\tthis.container.css(this.showTopCSS).appendTo('body');\n\t\t\t}\n\t\t};\n\n\t\tthis.hide = function () {\n\t\t\t$('.imageHolder', this.container).remove();\n\t\t\tif (typeof this.blockedElement !== 'undefined') {\n\t\t\t\tif (this.isPageBlockMode()) {\n\t\t\t\t\t$.unblockUI();\n\t\t\t\t} else {\n\t\t\t\t\tthis.blockedElement.unblock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.container.removeData('progressIndicator');\n\t\t};\n\t};\n\n\t$.fn.progressIndicator = function (options) {\n\t\tlet element = this;\n\t\tif (this.length <= 0) {\n\t\t\telement = jQuery('body');\n\t\t}\n\t\treturn element.each(function (index, element) {\n\t\t\tlet jQueryObject = $(element),\n\t\t\t\tprogressIndicatorInstance;\n\t\t\tif (typeof jQueryObject.data('progressIndicator') !== 'undefined') {\n\t\t\t\tprogressIndicatorInstance = jQueryObject.data('progressIndicator');\n\t\t\t} else {\n\t\t\t\tprogressIndicatorInstance = new ProgressIndicatorHelper();\n\t\t\t\tjQueryObject.data('progressIndicator', progressIndicatorInstance);\n\t\t\t}\n\t\t\tprogressIndicatorInstance.init(jQueryObject, options).initActions();\n\t\t});\n\t};\n\n\t$.progressIndicator = function (options) {\n\t\tvar progressImageContainer = jQuery('<div></div>');\n\t\tvar progressIndicatorInstance = new ProgressIndicatorHelper();\n\t\tprogressIndicatorInstance.init(progressImageContainer, options);\n\t\tif (!progressIndicatorInstance.isBlockMode()) {\n\t\t\tprogressIndicatorInstance.showOnTop = true;\n\t\t}\n\t\tprogressIndicatorInstance.initActions();\n\t\treturn progressImageContainer.data('progressIndicator', progressIndicatorInstance);\n\t};\n\n\t//Change the z-index of the block overlay value\n\t$.blockUI.defaults.baseZ = 10000;\n})(jQuery);\n"],"names":["$","ProgressIndicatorHelper","thisInstance","defaults","position","mode","blockInfo","elementToBlock","message","imageContainerCss","\"text-align\"","blockOverlayCSS","opacity","\"background-color\"","blockCss","border","\"background-clip\"","\"border-radius\"","showTopCSS","width","left","top","\"z-index\"","showOnTop","init","element","options","arguments","length","extend","Object","assign","container","isBlockMode","initActions","show","hide","isPageBlockMode","is","enabled","className","smallLoadingImage","imageHtml","jQImageHtml","jQuery","css","jQMessage","app","vtranslate","html","messageContainer","append","addClass","prepend","replaceWith","blockedElement","blockUI","overlayCSS","onBlock","block","appendTo","remove","unblockUI","unblock","removeData","fn","progressIndicator","each","index","progressIndicatorInstance","jQueryObject","data","progressImageContainer","baseZ"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFACA,YAAY,CAEZ,CAAC,SAAUA,CAAC,CAAE,CACb,IAAIC,uBAAuB,CAAG,UAAY,CACzC,IAAIC,YAAY,CAAG,IAAI,CAEvB,IAAI,CAACC,QAAQ,CAAG,CACfC,QAAQ,CAAE,QAAQ,CAClBC,IAAI,CAAE,MAAM,CACZC,SAAS,CAAE,CACVC,cAAc,CAAE,MACjB,CAAC,CACDC,OAAO,CAAE,EACV,CAAC,CAED,IAAI,CAACC,iBAAiB,CAAG,CACxBC,YAAA,CAAc,QACf,CAAC,CAED,IAAI,CAACC,eAAe,CAAG,CACtBC,OAAO,CAAE,EAAG,CACZC,kBAAA,CAAoB,MACrB,CAAC,CAED,IAAI,CAACC,QAAQ,CAAG,CACfC,MAAM,CAAE,EAAE,CACVF,kBAAA,CAAoB,EAAE,CACtBG,iBAAA,CAAmB,YAAY,CAC/BC,eAAA,CAAiB,KAClB,CAAC,CAED,IAAI,CAACC,UAAU,CAAG,CACjBC,KAAK,CAAE,KAAK,CACZC,IAAI,CAAE,OAAO,CACbhB,QAAQ,CAAE,OAAO,CACjBiB,GAAG,CAAE,MAAM,CACXC,SAAA,CAAW,QACZ,CAAC,CAED,IAAI,CAACC,SAAS,CAAA,CAAA,CAAQ,CAEtB,IAAI,CAACC,IAAI,CAAG,SAAUC,OAAO,CAAgB,CAAd,IAAAC,OAAO,CAAAC,CAAAA,CAAAA,SAAA,CAAAC,MAAA,WAAAD,SAAA,CAAA,CAAA,CAAA,CAAAA,SAAA,CAAG,CAAA,CAAA,CAAA,EAAE,CAc1C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