From fdbcdc502c6cdcc03ba8fdcf3cac1ba1b8226eb3 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Fri, 19 Aug 2022 13:51:00 +0200 Subject: [PATCH] Compiled js/css files & Updated *.min and *.map files --- .../Default/modules/Base/resources/Widget/Comments.min.js | 2 +- .../Default/modules/Base/resources/Widget/Comments.min.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public_html/layouts/Default/modules/Base/resources/Widget/Comments.min.js b/public_html/layouts/Default/modules/Base/resources/Widget/Comments.min.js index 54a1efd3..6d9dbb59 100644 --- a/public_html/layouts/Default/modules/Base/resources/Widget/Comments.min.js +++ b/public_html/layouts/Default/modules/Base/resources/Widget/Comments.min.js @@ -8,7 +8,7 @@ function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.g * Show replies */},{key:"registerShowReplies",value:function registerShowReplies(){var _this3=this;this.container.on("click",".js-show-replies",function(e){var element=$(e.currentTarget),url=e.currentTarget.dataset.url;_this3.getContent(url).done(function(result){element.closest(".js-post-container_body").append(result),element.addClass("d-none");});});}/** * Add comments - */},{key:"registerAddComments",value:function registerAddComments(){var _this4=this,form=this.container.find(".js-add-comment-block form");form.validationEngine(_objectSpread({binded:!1},app.validationEngineOptions)),form.on("submit",function(e){if(e.preventDefault(),form.validationEngine("validate")){var commentContent=form.find(".js-comment-content"),commentContentValue=commentContent.html();if(""===commentContentValue)return commentContent.validationEngine("showPrompt",app.translate("JS_LBL_COMMENT_VALUE_CANT_BE_EMPTY"),"error","bottomLeft",!0),!1;var formData=form.serializeFormData();formData.commentcontent=commentContentValue,AppConnector.request(formData).done(function(){form.find("[name=\"commentcontent\"]").empty(),_this4.loadContent();});}}),this.container.on("submit",".js-reply-comment-block form",function(e){e.preventDefault();var formReply=$(e.currentTarget);formReply.validationEngine(_objectSpread({binded:!1},app.validationEngineOptions)),formReply.validationEngine("validate")&&AppConnector.request(formReply.serializeFormData()).done(function(){formReply.find("[name=\"commentcontent\"]").val("");var postContainer=formReply.closest(".js-post-container"),url=postContainer.find(".js-show-replies:first").data("url");_this4.getContent(url).done(function(result){postContainer.find(".js-post-container").remove(),postContainer.find(".js-post-cancel").trigger("click"),postContainer.find(".js-post-container_body").append(result),postContainer.find(".js-show-replies").addClass("d-none");});});});}},{key:"registerReply",value:function registerReply(){this.container.on("click",".js-post-reply,.js-post-cancel",function(e){var postContainer=$(e.currentTarget).closest(".js-post-container"),replyBlock=postContainer.find(".js-reply-comment-block:first"),replyBtn=postContainer.find(".js-post-reply:first");replyBlock.toggleClass("d-none"),replyBtn.toggleClass("d-none");});}/** + */},{key:"registerAddComments",value:function registerAddComments(){var _this4=this,form=this.container.find(".js-add-comment-block form");form.validationEngine(_objectSpread({binded:!1},app.validationEngineOptions)),form.on("submit",function(e){if(e.preventDefault(),form.validationEngine("validate")){var commentContent=form.find(".js-comment-content"),commentContentValue=commentContent.html();if(""===commentContentValue)return commentContent.validationEngine("showPrompt",app.translate("JS_LBL_COMMENT_VALUE_CANT_BE_EMPTY"),"error","bottomLeft",!0),!1;var formData=form.serializeFormData();formData.commentcontent=commentContentValue,AppConnector.request(formData).done(function(){form.find("[name=\"commentcontent\"]").empty(),_this4.loadContent();});}}),this.container.on("submit",".js-reply-comment-block form",function(e){e.preventDefault();var formReply=$(e.currentTarget);if(formReply.validationEngine(_objectSpread({binded:!1},app.validationEngineOptions)),formReply.validationEngine("validate")){var commentContent=formReply.find(".js-comment-content"),commentContentValue=commentContent.html();if(""===commentContentValue)return commentContent.validationEngine("showPrompt",app.translate("JS_LBL_COMMENT_VALUE_CANT_BE_EMPTY"),"error","bottomLeft",!0),!1;var formData=formReply.serializeFormData();formData.commentcontent=commentContentValue,AppConnector.request(formData).done(function(){formReply.find("[name=\"commentcontent\"]").val("");var postContainer=formReply.closest(".js-post-container");_this4.getContent(postContainer.find(".js-show-replies:first").data("url")).done(function(result){postContainer.find(".js-post-container").remove(),postContainer.find(".js-post-cancel").trigger("click"),postContainer.find(".js-post-container_body").append(result),postContainer.find(".js-show-replies").addClass("d-none");});});}});}},{key:"registerReply",value:function registerReply(){this.container.on("click",".js-post-reply,.js-post-cancel",function(e){var postContainer=$(e.currentTarget).closest(".js-post-container"),replyBlock=postContainer.find(".js-reply-comment-block:first"),replyBtn=postContainer.find(".js-post-reply:first");replyBlock.toggleClass("d-none"),replyBtn.toggleClass("d-none");});}/** * Register events * @param {jQuery} container */},{key:"registerEvents",value:function registerEvents(container){this.container=container,this.loadContent(),this.registerChangePage(),this.registerShowReplies(),this.registerAddComments(),this.registerReply();}}]),_class}(); diff --git a/public_html/layouts/Default/modules/Base/resources/Widget/Comments.min.js.map b/public_html/layouts/Default/modules/Base/resources/Widget/Comments.min.js.map index 4f5d3367..e1aca57a 100644 --- a/public_html/layouts/Default/modules/Base/resources/Widget/Comments.min.js.map +++ b/public_html/layouts/Default/modules/Base/resources/Widget/Comments.min.js.map @@ -1 +1 @@ -{"version":3,"file":"Comments.min.js","sources":["Comments.js"],"sourcesContent":["/* {[The file is published on the basis of YetiForce Public License 5.0 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */\nwindow.Base_Widget_Comments_Js = class {\n\tconstructor() {\n\t\tthis.container = null;\n\t}\n\t/**\n\t * Load widget content\n\t */\n\tloadContent(page = 1) {\n\t\tconst deferred = $.Deferred();\n\t\tlet url = this.container.data('url');\n\t\tif (url) {\n\t\t\turl += page ? `&page=${page}` : '';\n\t\t\tlet progressInstance = $.progressIndicator({\n\t\t\t\tposition: 'html',\n\t\t\t\tblockInfo: {\n\t\t\t\t\tenabled: true,\n\t\t\t\t\telementToBlock: this.container\n\t\t\t\t},\n\t\t\t\tmessage: ' '\n\t\t\t});\n\t\t\tAppConnector.request(url)\n\t\t\t\t.done((responseData) => {\n\t\t\t\t\tthis.container.find('.js-widget-container_content').html(responseData);\n\t\t\t\t\tprogressInstance.progressIndicator({ mode: 'hide' });\n\t\t\t\t\tdeferred.resolve();\n\t\t\t\t})\n\t\t\t\t.fail(function (e, er) {\n\t\t\t\t\tapp.errorLog(e, er);\n\t\t\t\t\tprogressInstance.progressIndicator({ mode: 'hide' });\n\t\t\t\t\tdeferred.reject();\n\t\t\t\t});\n\t\t} else {\n\t\t\tdeferred.reject();\n\t\t}\n\t\treturn deferred.promise();\n\t}\n\tgetContent(url = null) {\n\t\tconst deferred = $.Deferred();\n\t\tif (url) {\n\t\t\tlet progressInstance = $.progressIndicator({\n\t\t\t\tposition: 'html',\n\t\t\t\tblockInfo: {\n\t\t\t\t\tenabled: true,\n\t\t\t\t\telementToBlock: this.container\n\t\t\t\t},\n\t\t\t\tmessage: ' '\n\t\t\t});\n\t\t\tAppConnector.request(url)\n\t\t\t\t.done((responseData) => {\n\t\t\t\t\tprogressInstance.progressIndicator({ mode: 'hide' });\n\t\t\t\t\tdeferred.resolve(responseData);\n\t\t\t\t})\n\t\t\t\t.fail(function (e, er) {\n\t\t\t\t\tapp.errorLog(e, er);\n\t\t\t\t\tprogressInstance.progressIndicator({ mode: 'hide' });\n\t\t\t\t\tdeferred.reject(false);\n\t\t\t\t});\n\t\t} else {\n\t\t\tdeferred.reject();\n\t\t}\n\t\treturn deferred.promise();\n\t}\n\n\t/**\n\t * Change page event\n\t */\n\tregisterChangePage() {\n\t\tthis.container.on('click', '.js-change-page', (e) => {\n\t\t\tlet page = e.currentTarget.dataset.page;\n\t\t\tthis.loadContent(page);\n\t\t});\n\t}\n\n\t/**\n\t * Show replies\n\t */\n\tregisterShowReplies() {\n\t\tthis.container.on('click', '.js-show-replies', (e) => {\n\t\t\tlet element = $(e.currentTarget);\n\t\t\tlet url = e.currentTarget.dataset.url;\n\t\t\tthis.getContent(url).done((result) => {\n\t\t\t\telement.closest('.js-post-container_body').append(result);\n\t\t\t\telement.addClass('d-none');\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t * Add comments\n\t */\n\tregisterAddComments() {\n\t\tlet form = this.container.find('.js-add-comment-block form');\n\t\tform.validationEngine({ binded: false, ...app.validationEngineOptions });\n\t\tform.on('submit', (e) => {\n\t\t\te.preventDefault();\n\t\t\tif (form.validationEngine('validate')) {\n\t\t\t\tlet commentContent = form.find('.js-comment-content');\n\t\t\t\tlet commentContentValue = commentContent.html();\n\t\t\t\tif ('' === commentContentValue) {\n\t\t\t\t\tcommentContent.validationEngine(\n\t\t\t\t\t\t'showPrompt',\n\t\t\t\t\t\tapp.translate('JS_LBL_COMMENT_VALUE_CANT_BE_EMPTY'),\n\t\t\t\t\t\t'error',\n\t\t\t\t\t\t'bottomLeft',\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tlet formData = form.serializeFormData();\n\t\t\t\tformData['commentcontent'] = commentContentValue;\n\t\t\t\tAppConnector.request(formData).done((response) => {\n\t\t\t\t\tform.find('[name=\"commentcontent\"]').empty();\n\t\t\t\t\tthis.loadContent();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tthis.container.on('submit', '.js-reply-comment-block form', (e) => {\n\t\t\te.preventDefault();\n\t\t\tlet formReply = $(e.currentTarget);\n\t\t\tformReply.validationEngine({ binded: false, ...app.validationEngineOptions });\n\t\t\tif (formReply.validationEngine('validate')) {\n\t\t\t\tAppConnector.request(formReply.serializeFormData()).done((response) => {\n\t\t\t\t\tformReply.find('[name=\"commentcontent\"]').val('');\n\t\t\t\t\tlet postContainer = formReply.closest('.js-post-container');\n\t\t\t\t\tlet url = postContainer.find('.js-show-replies:first').data('url');\n\t\t\t\t\tthis.getContent(url).done((result) => {\n\t\t\t\t\t\tpostContainer.find('.js-post-container').remove();\n\t\t\t\t\t\tpostContainer.find('.js-post-cancel').trigger('click');\n\t\t\t\t\t\tpostContainer.find('.js-post-container_body').append(result);\n\t\t\t\t\t\tpostContainer.find('.js-show-replies').addClass('d-none');\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\tregisterReply() {\n\t\tthis.container.on('click', '.js-post-reply,.js-post-cancel', (e) => {\n\t\t\tlet postContainer = $(e.currentTarget).closest('.js-post-container'),\n\t\t\t\treplyBlock = postContainer.find('.js-reply-comment-block:first'),\n\t\t\t\treplyBtn = postContainer.find('.js-post-reply:first');\n\t\t\treplyBlock.toggleClass('d-none');\n\t\t\treplyBtn.toggleClass('d-none');\n\t\t});\n\t}\n\n\t/**\n\t * Register events\n\t * @param {jQuery} container\n\t */\n\n\tregisterEvents(container) {\n\t\tthis.container = container;\n\t\tthis.loadContent();\n\t\tthis.registerChangePage();\n\t\tthis.registerShowReplies();\n\t\tthis.registerAddComments();\n\t\tthis.registerReply();\n\t}\n};\n"],"names":["window","Base_Widget_Comments_Js","container","page","deferred","$","Deferred","url","data","progressIndicator","position","blockInfo","enabled","elementToBlock","message","AppConnector","request","done","responseData","find","html","progressInstance","mode","resolve","fail","e","er","app","errorLog","reject","promise","on","currentTarget","dataset","loadContent","getContent","result","element","closest","append","addClass","form","validationEngine","binded","validationEngineOptions","preventDefault","commentContentValue","commentContent","translate","formData","serializeFormData","empty","formReply","val","postContainer","remove","trigger","replyBlock","replyBtn","toggleClass","registerChangePage","registerShowReplies","registerAddComments","registerReply"],"mappings":";;ilDAAA,kKACAA,MAAM,CAACC,uBAAP,cACC,UAAA,CAAA,SAAA,MAAA,EAAc,8BACb,IAAKC,CAAAA,SAAL,CAAiB,KACjB,CACD;AACD;AACA,IANA,OAOC,YAAA,CAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,aAAA,CAAA,KAAA,CAAA,SAAA,WAAA,EAAsB,CAAVC,IAAAA,KAAAA,CAAAA,IAAAA,CAAAA,IAAU,CAAH,CAAA,CAAA,SAAA,CAAA,MAAA,EAAA,KAAA,CAAA,GAAA,SAAA,CAAA,CAAA,CAAA,CAAA,SAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CACfC,QAAQ,CAAGC,CAAC,CAACC,QAAF,EADI,CAEjBC,GAAG,CAAG,IAAA,CAAKL,SAAL,CAAeM,IAAf,CAAoB,KAApB,CAFW,C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aAAa,CAACnC,IAAd,CAAmB,yBAAnB,CAAA,CAA8CoB,MAA9C,CAAqDH,MAArD,CAHqC,CAIrCkB,aAAa,CAACnC,IAAd,CAAmB,kBAAnB,CAAA,CAAuCqB,QAAvC,CAAgD,QAAhD,EACA,CALD,EAMA,CAVD,EAYD,CAjBD,EAkBA,CAtIF,CAuIC,CAAA,CAAA,GAAA,CAAA,eAAA,CAAA,KAAA,CAAA,SAAA,aAAA,EAAgB,CACf,IAAKtC,CAAAA,SAAL,CAAe6B,EAAf,CAAkB,OAAlB,CAA2B,gCAA3B,CAA6D,SAACN,CAAD,CAAO,CACnE,IAAiB,aAAA,CAAGpB,CAAC,CAACoB,CAAC,CAACO,aAAH,CAAD,CAAmBM,OAAnB,CAA2B,oBAA3B,CAApB,CACCmB,UAAU,CAAGH,aAAa,CAACnC,IAAd,CAAmB,+BAAnB,CADd,CAECuC,QAAQ,CAAGJ,aAAa,CAACnC,IAAd,CAAmB,sBAAnB,CAFZ,CAGAsC,UAAU,CAACE,WAAX,CAAuB,QAAvB,CAJmE,CAKnED,QAAQ,CAACC,WAAT,CAAqB,QAArB,EACA,CAND,EAOA,CAED;AACD;AACA;AACA,KAEC,CAAA,CAAA,GAAA,CAAA,gBAAA,CAAA,KAAA,CAAA,SAAA,cAAA,CAAezD,SAAf,CAA0B,CACzB,IAAA,CAAKA,SAAL,CAAiBA,SADQ,CAEzB,IAAKgC,CAAAA,WAAL,EAFyB,CAGzB,IAAA,CAAK0B,kBAAL,EAHyB,CAIzB,IAAA,CAAKC,mBAAL,EAJyB,CAKzB,IAAA,CAAKC,mBAAL,EALyB,CAMzB,IAAA,CAAKC,aAAL,GACA,CA7JF;;"} \ No newline at end of file +{"version":3,"file":"Comments.min.js","sources":["Comments.js"],"sourcesContent":["/* {[The file is published on the basis of YetiForce Public License 5.0 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */\nwindow.Base_Widget_Comments_Js = class {\n\tconstructor() {\n\t\tthis.container = null;\n\t}\n\t/**\n\t * Load widget content\n\t */\n\tloadContent(page = 1) {\n\t\tconst deferred = $.Deferred();\n\t\tlet url = this.container.data('url');\n\t\tif (url) {\n\t\t\turl += page ? `&page=${page}` : '';\n\t\t\tlet progressInstance = $.progressIndicator({\n\t\t\t\tposition: 'html',\n\t\t\t\tblockInfo: {\n\t\t\t\t\tenabled: true,\n\t\t\t\t\telementToBlock: this.container\n\t\t\t\t},\n\t\t\t\tmessage: ' '\n\t\t\t});\n\t\t\tAppConnector.request(url)\n\t\t\t\t.done((responseData) => {\n\t\t\t\t\tthis.container.find('.js-widget-container_content').html(responseData);\n\t\t\t\t\tprogressInstance.progressIndicator({ mode: 'hide' });\n\t\t\t\t\tdeferred.resolve();\n\t\t\t\t})\n\t\t\t\t.fail(function (e, er) {\n\t\t\t\t\tapp.errorLog(e, er);\n\t\t\t\t\tprogressInstance.progressIndicator({ mode: 'hide' });\n\t\t\t\t\tdeferred.reject();\n\t\t\t\t});\n\t\t} else {\n\t\t\tdeferred.reject();\n\t\t}\n\t\treturn deferred.promise();\n\t}\n\tgetContent(url = null) {\n\t\tconst deferred = $.Deferred();\n\t\tif (url) {\n\t\t\tlet progressInstance = $.progressIndicator({\n\t\t\t\tposition: 'html',\n\t\t\t\tblockInfo: {\n\t\t\t\t\tenabled: true,\n\t\t\t\t\telementToBlock: this.container\n\t\t\t\t},\n\t\t\t\tmessage: ' '\n\t\t\t});\n\t\t\tAppConnector.request(url)\n\t\t\t\t.done((responseData) => {\n\t\t\t\t\tprogressInstance.progressIndicator({ mode: 'hide' });\n\t\t\t\t\tdeferred.resolve(responseData);\n\t\t\t\t})\n\t\t\t\t.fail(function (e, er) {\n\t\t\t\t\tapp.errorLog(e, er);\n\t\t\t\t\tprogressInstance.progressIndicator({ mode: 'hide' });\n\t\t\t\t\tdeferred.reject(false);\n\t\t\t\t});\n\t\t} else {\n\t\t\tdeferred.reject();\n\t\t}\n\t\treturn deferred.promise();\n\t}\n\n\t/**\n\t * Change page event\n\t */\n\tregisterChangePage() {\n\t\tthis.container.on('click', '.js-change-page', (e) => {\n\t\t\tlet page = e.currentTarget.dataset.page;\n\t\t\tthis.loadContent(page);\n\t\t});\n\t}\n\n\t/**\n\t * Show replies\n\t */\n\tregisterShowReplies() {\n\t\tthis.container.on('click', '.js-show-replies', (e) => {\n\t\t\tlet element = $(e.currentTarget);\n\t\t\tlet url = e.currentTarget.dataset.url;\n\t\t\tthis.getContent(url).done((result) => {\n\t\t\t\telement.closest('.js-post-container_body').append(result);\n\t\t\t\telement.addClass('d-none');\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t * Add comments\n\t */\n\tregisterAddComments() {\n\t\tconst form = this.container.find('.js-add-comment-block form');\n\t\tform.validationEngine({ binded: false, ...app.validationEngineOptions });\n\t\tform.on('submit', (e) => {\n\t\t\te.preventDefault();\n\t\t\tif (form.validationEngine('validate')) {\n\t\t\t\tlet commentContent = form.find('.js-comment-content');\n\t\t\t\tlet commentContentValue = commentContent.html();\n\t\t\t\tif ('' === commentContentValue) {\n\t\t\t\t\tcommentContent.validationEngine(\n\t\t\t\t\t\t'showPrompt',\n\t\t\t\t\t\tapp.translate('JS_LBL_COMMENT_VALUE_CANT_BE_EMPTY'),\n\t\t\t\t\t\t'error',\n\t\t\t\t\t\t'bottomLeft',\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tlet formData = form.serializeFormData();\n\t\t\t\tformData['commentcontent'] = commentContentValue;\n\t\t\t\tAppConnector.request(formData).done((response) => {\n\t\t\t\t\tform.find('[name=\"commentcontent\"]').empty();\n\t\t\t\t\tthis.loadContent();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tthis.container.on('submit', '.js-reply-comment-block form', (e) => {\n\t\t\te.preventDefault();\n\t\t\tlet formReply = $(e.currentTarget);\n\t\t\tformReply.validationEngine({ binded: false, ...app.validationEngineOptions });\n\t\t\tif (formReply.validationEngine('validate')) {\n\t\t\t\tlet commentContent = formReply.find('.js-comment-content');\n\t\t\t\tlet commentContentValue = commentContent.html();\n\t\t\t\tif ('' === commentContentValue) {\n\t\t\t\t\tcommentContent.validationEngine(\n\t\t\t\t\t\t'showPrompt',\n\t\t\t\t\t\tapp.translate('JS_LBL_COMMENT_VALUE_CANT_BE_EMPTY'),\n\t\t\t\t\t\t'error',\n\t\t\t\t\t\t'bottomLeft',\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tlet formData = formReply.serializeFormData();\n\t\t\t\tformData['commentcontent'] = commentContentValue;\n\t\t\t\tAppConnector.request(formData).done((_response) => {\n\t\t\t\t\tformReply.find('[name=\"commentcontent\"]').val('');\n\t\t\t\t\tconst postContainer = formReply.closest('.js-post-container');\n\t\t\t\t\tthis.getContent(postContainer.find('.js-show-replies:first').data('url')).done((result) => {\n\t\t\t\t\t\tpostContainer.find('.js-post-container').remove();\n\t\t\t\t\t\tpostContainer.find('.js-post-cancel').trigger('click');\n\t\t\t\t\t\tpostContainer.find('.js-post-container_body').append(result);\n\t\t\t\t\t\tpostContainer.find('.js-show-replies').addClass('d-none');\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\tregisterReply() {\n\t\tthis.container.on('click', '.js-post-reply,.js-post-cancel', (e) => {\n\t\t\tlet postContainer = $(e.currentTarget).closest('.js-post-container'),\n\t\t\t\treplyBlock = postContainer.find('.js-reply-comment-block:first'),\n\t\t\t\treplyBtn = postContainer.find('.js-post-reply:first');\n\t\t\treplyBlock.toggleClass('d-none');\n\t\t\treplyBtn.toggleClass('d-none');\n\t\t});\n\t}\n\n\t/**\n\t * Register events\n\t * @param {jQuery} container\n\t */\n\n\tregisterEvents(container) {\n\t\tthis.container = container;\n\t\tthis.loadContent();\n\t\tthis.registerChangePage();\n\t\tthis.registerShowReplies();\n\t\tthis.registerAddComments();\n\t\tthis.registerReply();\n\t}\n};\n"],"names":["window","Base_Widget_Comments_Js","container","page","deferred","$","Deferred","url","data","progressIndicator","position","blockInfo","enabled","elementToBlock","message","AppConnector","request","done","responseData","find","html","progressInstance","mode","resolve","fail","e","er","app","errorLog","reject","promise","on","currentTarget","dataset","loadContent","getContent","result","element","closest","append","addClass","form","validationEngine","binded","validationEngineOptions","preventDefault","commentContentValue","commentContent","translate","serializeFormData","formData","empty","formReply","val","postContainer","remove","trigger","replyBlock","replyBtn","toggleClass","registerChangePage","registerShowReplies","registerAddComments","registerReply"],"mappings":";;ilDAAA,kKACAA,MAAM,CAACC,uBAAP,cACC,UAAA,CAAA,SAAA,MAAA,EAAc,8BACb,IAAKC,CAAAA,SAAL,CAAiB,KACjB,CACD;AACD;AACA,IANA,OAOC,YAAA,CAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,aAAA,CAAA,KAAA,CAAA,SAAA,WAAA,EAAsB,CAAVC,IAAAA,KAAAA,CAAAA,IAAAA,CAAAA,IAAU,CAAH,CAAA,CAAA,SAAA,CAAA,MAAA,EAAA,KAAA,CAAA,GAAA,SAAA,CAAA,CAAA,CAAA,CAAA,SAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CACfC,QAAQ,CAAGC,CAAC,CAACC,QAAF,EADI,CAEjBC,GAAG,CAAG,IAAA,CAAKL,SAAL,CAAeM,IAAf,CAAoB,KAApB,CAFW,CAGrB,GAAID,GAAJ,CAAS,CACRA,GAAG,EAAIJ,IAAI,CAAYA,QAAAA,CAAAA,MAAAA,CAAAA,IAAZ,CAAqB,CAAA,EADxB,CAER,IAAoB,gBAAA,CAAGE,CAAC,CAACI,iBAAF,CAAoB,CAC1CC,QAAQ,CAAE,MADgC,CAE1CC,SAAS,CAAE,CACVC,OAAO,CAAA,CAAA,CADG,CAEVC,cAAc,CAAE,IAAA,CAAKX,SAFX,CAF+B,CAM1CY,OAAO,CAAE,GANiC,CAApB,CAAvB,CAQAC,YAAY,CAACC,OAAb,CAAqBT,GAArB,CACEU,CAAAA,IADF,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