From 02bf646a73bdf1894c4f419f155f6ec83e60a9e3 Mon Sep 17 00:00:00 2001 From: jasonweng Date: Fri, 3 Sep 2021 15:42:15 +0800 Subject: [PATCH] compile media box JS --- views/assets/javascripts/media_box.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/assets/javascripts/media_box.js b/views/assets/javascripts/media_box.js index 665dce6..83fc88c 100644 --- a/views/assets/javascripts/media_box.js +++ b/views/assets/javascripts/media_box.js @@ -1 +1 @@ -"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?e(require("jquery")):e(jQuery)}(function(g){var a=g("body"),e=g(document),n="qor.medialibrary.select",t="click."+n,i="enable."+n,o="reload.qor.bottomsheets",s=".qor-select__select-icon",m=".qor-field__mediabox-list",y=".qor-field__mediabox-item",d=".qor-field__mediabox-data",r="is_selected",l="is_deleted",v="textarea.qor-file__options",c="qor-bottomsheets__mediabox";function h(e,t){this.$element=g(e),this.options=g.extend({},h.DEFAULTS,g.isPlainObject(t)&&t),this.init()}return h.prototype={constructor:h,init:function(){var e=this.$element;this.SELECT_MEDIABOX_UNDO_TEMPLATE=e.find('[name="media-box-undo-delete"]').html(),this.bind(),this.initSelectedMedia()},bind:function(){e.off(o).on(o,".".concat(c),this.reloadData.bind(this)),this.$element.off(t).off("change.qor.cropper").on(t,"[data-mediabox-url]",this.openBottomSheets.bind(this)).on(t,".qor-cropper__toggle--delete",this.deleteSelected.bind(this)).on(t,".qor-cropper__toggle--undo",this.undoDeleteSelected.bind(this)).on("change.qor.cropper",v,this.imageCrop.bind(this))},unbind:function(){e.off(o,".".concat(c)),this.$element.off(t).off("change.qor.cropper")},deleteSelected:function(e){var t=g(e.target);return t.closest(y).addClass(l).append(this.SELECT_MEDIABOX_UNDO_TEMPLATE).find(".qor-file__list").hide(),this.updateMediaLibraryData(t.closest(m)),this.$element.find(d).data("isDeleted",!0),!1},undoDeleteSelected:function(e){var t=g(e.target);return t.closest(y).removeClass(l).find(".qor-file__list").show(),this.updateMediaLibraryData(t.closest(m)),t.closest(".qor-fieldset__alert").remove(),this.$element.find(d).data("isDeleted",!1),!1},imageCrop:function(e){var t=g(e.target).closest(y);this.syncImageCrop(t,this.resetImages)},openBottomSheets:function(e){var t,i=g(e.target).closest("[data-mediabox-url]"),o=i.data();o.isDisabled||(this.BottomSheets=a.data("qor.bottomsheets"),this.bottomsheetsData=o,this.$parent=t=i.closest(".qor-field__mediabox"),this.$selectFeild=t.find(m),o.url=o.mediaboxUrl,this.SELECT_MANY_SELECTED_ICON=g('[name="media-box-select-many-selected-icon"]').html(),this.SELECT_MANY_HINT=g('[name="media-box-select-many-hint"]').html(),this.TEMPLATE_IMAGE=t.find('[name="media-box-template"]').html(),this.TEMPLATE_FILE=t.find('[name="media-box-file-template"]').html(),this.TEMPLATE_UPLOADEDVIDEO=t.find('[name="media-box-uploadedvideo-template"]').html(),this.TEMPLATE_VIDEOLINK=t.find('[name="media-box-videolink-template"]').html(),this.SELECT_MEDIABOX_UNDO_TEMPLATE=t.find('[name="media-box-undo-delete"]').html(),this.BottomSheets.open(o,this.handleSelectMany.bind(this)))},initSelectedMedia:function(){var e,t=this.$element,i=t.find(y),o=JSON.parse(t.find(d).val());if(o)for(var a=0;a
').appendTo(e).trigger("enable.qor.material")},updateDatas:function(e){"1"!=this.bottomsheetsData.maxItem&&this.updateHint(this.getSelectedItemData()),this.updateMediaLibraryData(null,e)},destroy:function(){this.unbind(),this.$element.removeData(n)}},h.plugin=function(o){return this.each(function(){var e,t=g(this),i=t.data(n);if(!i){if(/destroy/.test(o))return;t.data(n,i=new h(this,o))}"string"==typeof o&&g.isFunction(e=i[o])&&e.apply(i)})},g(function(){var t='[data-toggle="qor.mediabox"]';g(document).on("disable.qor.medialibrary.select",function(e){h.plugin.call(g(t,e.target),"destroy")}).on(i,function(e){h.plugin.call(g(t,e.target))}).triggerHandler(i)}),h}); \ No newline at end of file +"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?e(require("jquery")):e(jQuery)}(function(g){var o=g("body"),e=g(document),n="qor.medialibrary.select",t="click."+n,i="enable."+n,a="reload.qor.bottomsheets",s=".qor-select__select-icon",c=".qor-field__mediabox-list",y=".qor-field__mediabox-item",d=".qor-field__mediabox-data",r="is_selected",l="is_deleted",v="textarea.qor-file__options",m="qor-bottomsheets__mediabox";function h(e,t){this.$element=g(e),this.options=g.extend({},h.DEFAULTS,g.isPlainObject(t)&&t),this.init()}return h.prototype={constructor:h,init:function(){var e=this.$element;this.SELECT_MEDIABOX_UNDO_TEMPLATE=e.find('[name="media-box-undo-delete"]').html(),this.bind(),this.initSelectedMedia()},bind:function(){e.off(a).on(a,".".concat(m),this.reloadData.bind(this)),this.$element.off(t).off("change.qor.cropper").on(t,"[data-mediabox-url]",this.openBottomSheets.bind(this)).on(t,".qor-cropper__toggle--delete",this.deleteSelected.bind(this)).on(t,".qor-cropper__toggle--undo",this.undoDeleteSelected.bind(this)).on("change.qor.cropper",v,this.imageCrop.bind(this))},unbind:function(){e.off(a,".".concat(m)),this.$element.off(t).off("change.qor.cropper")},deleteSelected:function(e){var t=g(e.target);return t.closest(y).addClass(l).append(this.SELECT_MEDIABOX_UNDO_TEMPLATE).find(".qor-file__list").hide(),this.updateMediaLibraryData(t.closest(c)),this.$element.find(d).data("isDeleted",!0),g("body").trigger("itemRemoved.medialibrary",this),!1},undoDeleteSelected:function(e){var t=g(e.target);return t.closest(y).removeClass(l).find(".qor-file__list").show(),this.updateMediaLibraryData(t.closest(c)),t.closest(".qor-fieldset__alert").remove(),this.$element.find(d).data("isDeleted",!1),!1},imageCrop:function(e){var t=g(e.target).closest(y);this.syncImageCrop(t,this.resetImages)},openBottomSheets:function(e){var t,i=g(e.target).closest("[data-mediabox-url]"),a=i.data();a.isDisabled||(this.BottomSheets=o.data("qor.bottomsheets"),this.bottomsheetsData=a,this.$parent=t=i.closest(".qor-field__mediabox"),this.$selectFeild=t.find(c),a.url=a.mediaboxUrl,this.SELECT_MANY_SELECTED_ICON=g('[name="media-box-select-many-selected-icon"]').html(),this.SELECT_MANY_HINT=g('[name="media-box-select-many-hint"]').html(),this.TEMPLATE_IMAGE=t.find('[name="media-box-template"]').html(),this.TEMPLATE_FILE=t.find('[name="media-box-file-template"]').html(),this.TEMPLATE_UPLOADEDVIDEO=t.find('[name="media-box-uploadedvideo-template"]').html(),this.TEMPLATE_VIDEOLINK=t.find('[name="media-box-videolink-template"]').html(),this.SELECT_MEDIABOX_UNDO_TEMPLATE=t.find('[name="media-box-undo-delete"]').html(),this.BottomSheets.open(a,this.handleSelectMany.bind(this)))},initSelectedMedia:function(){var e,t=this.$element,i=t.find(y),a=JSON.parse(t.find(d).val());if(a)for(var o=0;o
').appendTo(e).trigger("enable.qor.material")},updateDatas:function(e){"1"!=this.bottomsheetsData.maxItem&&this.updateHint(this.getSelectedItemData()),this.updateMediaLibraryData(null,e)},destroy:function(){this.unbind(),this.$element.removeData(n)}},h.plugin=function(a){return this.each(function(){var e,t=g(this),i=t.data(n);if(!i){if(/destroy/.test(a))return;t.data(n,i=new h(this,a))}"string"==typeof a&&g.isFunction(e=i[a])&&e.apply(i)})},g(function(){var t='[data-toggle="qor.mediabox"]';g(document).on("disable.qor.medialibrary.select",function(e){h.plugin.call(g(t,e.target),"destroy")}).on(i,function(e){h.plugin.call(g(t,e.target))}).triggerHandler(i)}),h}); \ No newline at end of file