diff --git a/app/assets/javascripts/spotlight/application.js b/app/assets/javascripts/spotlight/application.js index 1a60dcfeea..a14fcf6120 100644 --- a/app/assets/javascripts/spotlight/application.js +++ b/app/assets/javascripts/spotlight/application.js @@ -10,5 +10,5 @@ //= require handlebars //= require tiny-slider //= require typeahead.bundle.min.js - +//= require nestable //= require spotlight/spotlight \ No newline at end of file diff --git a/app/assets/javascripts/spotlight/spotlight.esm.js b/app/assets/javascripts/spotlight/spotlight.esm.js index d841561bfc..94e85c10dc 100644 --- a/app/assets/javascripts/spotlight/spotlight.esm.js +++ b/app/assets/javascripts/spotlight/spotlight.esm.js @@ -176,650 +176,6 @@ class UserIndex { } } -/*! - * Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/ - * Dual-licensed under the BSD or MIT licenses - */ -(function($, window, document, undefined$1) -{ - var hasTouch = 'ontouchstart' in window; - - /** - * Detect CSS pointer-events property - * events are normally disabled on the dragging element to avoid conflicts - * https://github.com/ausi/Feature-detection-technique-for-pointer-events/blob/master/modernizr-pointerevents.js - */ - var hasPointerEvents = (function() - { - var el = document.createElement('div'), - docEl = document.documentElement; - if (!('pointerEvents' in el.style)) { - return false; - } - el.style.pointerEvents = 'auto'; - el.style.pointerEvents = 'x'; - docEl.appendChild(el); - var supports = window.getComputedStyle && window.getComputedStyle(el, '').pointerEvents === 'auto'; - docEl.removeChild(el); - return !!supports; - })(); - - var eStart = hasTouch ? 'touchstart' : 'mousedown', - eMove = hasTouch ? 'touchmove' : 'mousemove', - eEnd = hasTouch ? 'touchend' : 'mouseup', - eCancel = hasTouch ? 'touchcancel' : 'mouseup'; - - var defaults = { - listNodeName : 'ol', - itemNodeName : 'li', - rootClass : 'dd', - listClass : 'dd-list', - itemClass : 'dd-item', - dragClass : 'dd-dragel', - handleClass : 'dd-handle', - collapsedClass : 'dd-collapsed', - placeClass : 'dd-placeholder', - noDragClass : 'dd-nodrag', - noChildrenClass : 'dd-nochildren', - emptyClass : 'dd-empty', - expandBtnHTML : '', - collapseBtnHTML : '', - group : 0, - maxDepth : 5, - threshold : 20, - reject : [], - //method for call when an item has been successfully dropped - //method has 1 argument in which sends an object containing all - //necessary details - dropCallback : null, - // When a node is dragged it is moved to its new location. - // You can set the next option to true to create a copy of the node that is dragged. - cloneNodeOnDrag : false, - // When the node is dragged and released outside its list delete it. - dragOutsideToDelete : false - }; - - function Plugin(element, options) - { - this.w = $(document); - this.el = $(element); - this.options = $.extend({}, defaults, options); - this.init(); - } - - Plugin.prototype = { - - init: function() - { - var list = this; - - list.reset(); - - list.el.data('nestable-group', this.options.group); - - list.placeEl = $('
'); - - $.each(this.el.find(list.options.itemNodeName), function(k, el) { - list.setParent($(el)); - }); - - list.el.on('click', 'button', function(e) - { - if (list.dragEl || (!hasTouch && e.button !== 0)) { - return; - } - var target = $(e.currentTarget), - action = target.data('action'), - item = target.parent(list.options.itemNodeName); - if (action === 'collapse') { - list.collapseItem(item); - } - if (action === 'expand') { - list.expandItem(item); - } - }); - - var onStartEvent = function(e) - { - var handle = $(e.target); - - list.nestableCopy = handle.closest('.'+list.options.rootClass).clone(true); - - if (!handle.hasClass(list.options.handleClass)) { - if (handle.closest('.' + list.options.noDragClass).length) { - return; - } - handle = handle.closest('.' + list.options.handleClass); - } - if (!handle.length || list.dragEl || (!hasTouch && e.which !== 1) || (hasTouch && e.touches.length !== 1)) { - return; - } - e.preventDefault(); - list.dragStart(hasTouch ? e.touches[0] : e); - }; - - var onMoveEvent = function(e) - { - if (list.dragEl) { - e.preventDefault(); - list.dragMove(hasTouch ? e.touches[0] : e); - } - }; - - var onEndEvent = function(e) - { - if (list.dragEl) { - e.preventDefault(); - list.dragStop(hasTouch ? e.touches[0] : e); - } - }; - - if (hasTouch) { - list.el[0].addEventListener(eStart, onStartEvent, false); - window.addEventListener(eMove, onMoveEvent, false); - window.addEventListener(eEnd, onEndEvent, false); - window.addEventListener(eCancel, onEndEvent, false); - } else { - list.el.on(eStart, onStartEvent); - list.w.on(eMove, onMoveEvent); - list.w.on(eEnd, onEndEvent); - } - - var destroyNestable = function() - { - if (hasTouch) { - list.el[0].removeEventListener(eStart, onStartEvent, false); - window.removeEventListener(eMove, onMoveEvent, false); - window.removeEventListener(eEnd, onEndEvent, false); - window.removeEventListener(eCancel, onEndEvent, false); - } else { - list.el.off(eStart, onStartEvent); - list.w.off(eMove, onMoveEvent); - list.w.off(eEnd, onEndEvent); - } - - list.el.off('click'); - list.el.unbind('destroy-nestable'); - - list.el.data("nestable", null); - - var buttons = list.el[0].getElementsByTagName('button'); - - $(buttons).remove(); - }; - - list.el.bind('destroy-nestable', destroyNestable); - }, - - destroy: function () - { - this.expandAll(); - this.el.trigger('destroy-nestable'); - }, - - serialize: function() - { - var data, - list = this; - const step = function(level, depth) - { - var array = [ ], - items = level.children(list.options.itemNodeName); - items.each(function() - { - var li = $(this), - item = $.extend({}, li.data()), - sub = li.children(list.options.listNodeName); - if (sub.length) { - item.children = step(sub); - } - array.push(item); - }); - return array; - }; - var el; - - if (list.el.is(list.options.listNodeName)) { - el = list.el; - } else { - el = list.el.find(list.options.listNodeName).first(); - } - data = step(el); - return data; - }, - - reset: function() - { - this.mouse = { - offsetX : 0, - offsetY : 0, - startX : 0, - startY : 0, - lastX : 0, - lastY : 0, - nowX : 0, - nowY : 0, - distX : 0, - distY : 0, - dirAx : 0, - dirX : 0, - dirY : 0, - lastDirX : 0, - lastDirY : 0, - distAxX : 0, - distAxY : 0 - }; - this.moving = false; - this.dragEl = null; - this.dragRootEl = null; - this.dragDepth = 0; - this.dragItem = null; - this.hasNewRoot = false; - this.pointEl = null; - this.sourceRoot = null; - this.isOutsideRoot = false; - }, - - expandItem: function(li) - { - li.removeClass(this.options.collapsedClass); - li.children('[data-action="expand"]').hide(); - li.children('[data-action="collapse"]').show(); - li.children(this.options.listNodeName).show(); - this.el.trigger('expand', [li]); - li.trigger('expand'); - }, - - collapseItem: function(li) - { - var lists = li.children(this.options.listNodeName); - if (lists.length) { - li.addClass(this.options.collapsedClass); - li.children('[data-action="collapse"]').hide(); - li.children('[data-action="expand"]').show(); - li.children(this.options.listNodeName).hide(); - } - this.el.trigger('collapse', [li]); - li.trigger('collapse'); - }, - - expandAll: function() - { - var list = this; - list.el.find(list.options.itemNodeName).each(function() { - list.expandItem($(this)); - }); - }, - - collapseAll: function() - { - var list = this; - list.el.find(list.options.itemNodeName).each(function() { - list.collapseItem($(this)); - }); - }, - - setParent: function(li) - { - if (li.children(this.options.listNodeName).length) { - li.prepend($(this.options.expandBtnHTML)); - li.prepend($(this.options.collapseBtnHTML)); - } - if( (' ' + li[0].className + ' ').indexOf(' ' + defaults.collapsedClass + ' ') > -1 ) - { - li.children('[data-action="collapse"]').hide(); - } else { - li.children('[data-action="expand"]').hide(); - } - }, - - unsetParent: function(li) - { - li.removeClass(this.options.collapsedClass); - li.children('[data-action]').remove(); - li.children(this.options.listNodeName).remove(); - }, - - dragStart: function(e) - { - var mouse = this.mouse, - target = $(e.target), - dragItem = target.closest('.' + this.options.handleClass).closest(this.options.itemNodeName); - - this.sourceRoot = target.closest('.' + this.options.rootClass); - - this.dragItem = dragItem; - - this.placeEl.css('height', dragItem.height()); - - mouse.offsetX = e.offsetX !== undefined$1 ? e.offsetX : e.pageX - target.offset().left; - mouse.offsetY = e.offsetY !== undefined$1 ? e.offsetY : e.pageY - target.offset().top; - mouse.startX = mouse.lastX = e.pageX; - mouse.startY = mouse.lastY = e.pageY; - - this.dragRootEl = this.el; - - this.dragEl = $(document.createElement(this.options.listNodeName)).addClass(this.options.listClass + ' ' + this.options.dragClass); - this.dragEl.css('width', dragItem.width()); - - // fix for zepto.js - //dragItem.after(this.placeEl).detach().appendTo(this.dragEl); - if(this.options.cloneNodeOnDrag) { - dragItem.after(dragItem.clone()); - } else { - dragItem.after(this.placeEl); - } - dragItem[0].parentNode.removeChild(dragItem[0]); - dragItem.appendTo(this.dragEl); - - $(document.body).append(this.dragEl); - this.dragEl.css({ - 'left' : e.pageX - mouse.offsetX, - 'top' : e.pageY - mouse.offsetY - }); - // total depth of dragging item - var i, depth, - items = this.dragEl.find(this.options.itemNodeName); - for (i = 0; i < items.length; i++) { - depth = $(items[i]).parents(this.options.listNodeName).length; - if (depth > this.dragDepth) { - this.dragDepth = depth; - } - } - }, - - dragStop: function(e) - { - // fix for zepto.js - //this.placeEl.replaceWith(this.dragEl.children(this.options.itemNodeName + ':first').detach()); - var el = this.dragEl.children(this.options.itemNodeName).first(); - el[0].parentNode.removeChild(el[0]); - - if(this.isOutsideRoot && this.options.dragOutsideToDelete) - { - var parent = this.placeEl.parent(); - this.placeEl.remove(); - if (!parent.children().length) { - this.unsetParent(parent.parent()); - } - // If all nodes where deleted, create a placeholder element. - if (!this.dragRootEl.find(this.options.itemNodeName).length) - { - this.dragRootEl.append(''); - } - } - else - { - this.placeEl.replaceWith(el); - } - - if (!this.moving) - { - $(this.dragItem).trigger('click'); - } - - var i; - var isRejected = false; - for (i = 0; i < this.options.reject.length; i++) - { - var reject = this.options.reject[i]; - if (reject.rule.apply(this.dragRootEl)) - { - var nestableDragEl = el.clone(true); - this.dragRootEl.html(this.nestableCopy.children().clone(true)); - if (reject.action) { - reject.action.apply(this.dragRootEl, [nestableDragEl]); - } - - isRejected = true; - break; - } - } - - if (!isRejected) - { - this.dragEl.remove(); - this.el.trigger('change'); - - //Let's find out new parent id - var parentItem = el.parent().parent(); - var parentId = null; - if(parentItem !== null && !parentItem.is('.' + this.options.rootClass)) - parentId = parentItem.data('id'); - - if($.isFunction(this.options.dropCallback)) - { - var details = { - sourceId : el.data('id'), - destId : parentId, - sourceEl : el, - destParent : parentItem, - destRoot : el.closest('.' + this.options.rootClass), - sourceRoot : this.sourceRoot - }; - this.options.dropCallback.call(this, details); - } - - if (this.hasNewRoot) { - this.dragRootEl.trigger('change'); - } - - this.reset(); - } - }, - - dragMove: function(e) - { - var list, parent, prev, next, depth, - opt = this.options, - mouse = this.mouse; - - this.dragEl.css({ - 'left' : e.pageX - mouse.offsetX, - 'top' : e.pageY - mouse.offsetY - }); - - // mouse position last events - mouse.lastX = mouse.nowX; - mouse.lastY = mouse.nowY; - // mouse position this events - mouse.nowX = e.pageX; - mouse.nowY = e.pageY; - // distance mouse moved between events - mouse.distX = mouse.nowX - mouse.lastX; - mouse.distY = mouse.nowY - mouse.lastY; - // direction mouse was moving - mouse.lastDirX = mouse.dirX; - mouse.lastDirY = mouse.dirY; - // direction mouse is now moving (on both axis) - mouse.dirX = mouse.distX === 0 ? 0 : mouse.distX > 0 ? 1 : -1; - mouse.dirY = mouse.distY === 0 ? 0 : mouse.distY > 0 ? 1 : -1; - // axis mouse is now moving on - var newAx = Math.abs(mouse.distX) > Math.abs(mouse.distY) ? 1 : 0; - - // do nothing on first move - if (!this.moving) { - mouse.dirAx = newAx; - this.moving = true; - return; - } - - // calc distance moved on this axis (and direction) - if (mouse.dirAx !== newAx) { - mouse.distAxX = 0; - mouse.distAxY = 0; - } else { - mouse.distAxX += Math.abs(mouse.distX); - if (mouse.dirX !== 0 && mouse.dirX !== mouse.lastDirX) { - mouse.distAxX = 0; - } - mouse.distAxY += Math.abs(mouse.distY); - if (mouse.dirY !== 0 && mouse.dirY !== mouse.lastDirY) { - mouse.distAxY = 0; - } - } - mouse.dirAx = newAx; - - /** - * move horizontal - */ - if (mouse.dirAx && mouse.distAxX >= opt.threshold) { - // reset move distance on x-axis for new phase - mouse.distAxX = 0; - prev = this.placeEl.prev(opt.itemNodeName); - // increase horizontal level if previous sibling exists and is not collapsed - if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass) && !prev.hasClass(opt.noChildrenClass)) { - // cannot increase level when item above is collapsed - list = prev.find(opt.listNodeName).last(); - // check if depth limit has reached - depth = this.placeEl.parents(opt.listNodeName).length; - if (depth + this.dragDepth <= opt.maxDepth) { - // create new sub-level if one doesn't exist - if (!list.length) { - list = $('<' + opt.listNodeName + '/>').addClass(opt.listClass); - list.append(this.placeEl); - prev.append(list); - this.setParent(prev); - } else { - // else append to next level up - list = prev.children(opt.listNodeName).last(); - list.append(this.placeEl); - } - } - } - // decrease horizontal level - if (mouse.distX < 0) { - // we can't decrease a level if an item preceeds the current one - next = this.placeEl.next(opt.itemNodeName); - if (!next.length) { - parent = this.placeEl.parent(); - this.placeEl.closest(opt.itemNodeName).after(this.placeEl); - if (!parent.children().length) { - this.unsetParent(parent.parent()); - } - } - } - } - - var isEmpty = false; - - // find list item under cursor - if (!hasPointerEvents) { - this.dragEl[0].style.visibility = 'hidden'; - } - - this.pointEl = $(document.elementFromPoint(e.pageX - document.documentElement.scrollLeft, e.pageY - (window.pageYOffset || document.documentElement.scrollTop))); - - // Check if the node is dragged outside of its list. - if(this.dragRootEl.has(this.pointEl).length) { - this.isOutsideRoot = false; - this.dragEl[0].style.opacity = 1; - } else { - this.isOutsideRoot = true; - this.dragEl[0].style.opacity = 0.5; - } - - // find parent list of item under cursor - var pointElRoot = this.pointEl.closest('.' + opt.rootClass), - isNewRoot = this.dragRootEl.data('nestable-id') !== pointElRoot.data('nestable-id'); - - this.isOutsideRoot = !pointElRoot.length; - - if (!hasPointerEvents) { - this.dragEl[0].style.visibility = 'visible'; - } - if (this.pointEl.hasClass(opt.handleClass)) { - this.pointEl = this.pointEl.closest( opt.itemNodeName ); - } - - if (opt.maxDepth == 1 && !this.pointEl.hasClass(opt.itemClass)) { - this.pointEl = this.pointEl.closest("." + opt.itemClass); - } - - if (this.pointEl.hasClass(opt.emptyClass)) { - isEmpty = true; - } - else if (!this.pointEl.length || !this.pointEl.hasClass(opt.itemClass)) { - return; - } - - /** - * move vertical - */ - if (!mouse.dirAx || isNewRoot || isEmpty) { - // check if groups match if dragging over new root - if (isNewRoot && opt.group !== pointElRoot.data('nestable-group')) { - return; - } - // check depth limit - depth = this.dragDepth - 1 + this.pointEl.parents(opt.listNodeName).length; - if (depth > opt.maxDepth) { - return; - } - var before = e.pageY < (this.pointEl.offset().top + this.pointEl.height() / 2); - parent = this.placeEl.parent(); - // if empty create new list to replace empty placeholder - if (isEmpty) { - list = $(document.createElement(opt.listNodeName)).addClass(opt.listClass); - list.append(this.placeEl); - this.pointEl.replaceWith(list); - } - else if (before) { - this.pointEl.before(this.placeEl); - } - else { - this.pointEl.after(this.placeEl); - } - if (!parent.children().length) { - this.unsetParent(parent.parent()); - } - if (!this.dragRootEl.find(opt.itemNodeName).length) { - this.dragRootEl.append(''); - } - // parent root list has changed - this.dragRootEl = pointElRoot; - if (isNewRoot) { - this.hasNewRoot = this.el[0] !== this.dragRootEl[0]; - } - } - } - - }; - - $.fn.nestable = function(params) - { - var lists = this, - retval = this; - - var generateUid = function (separator) { - var delim = separator || "-"; - - function S4() { - return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); - } - - return (S4() + S4() + delim + S4() + delim + S4() + delim + S4() + delim + S4() + S4() + S4()); - }; - - lists.each(function() - { - var plugin = $(this).data("nestable"); - - if (!plugin) { - $(this).data("nestable", new Plugin(this, params)); - $(this).data("nestable-id", generateUid()); - } else { - if (typeof params === 'string' && typeof plugin[params] === 'function') { - retval = plugin[params](); - } - } - }); - - return retval || lists; - }; - -})(window.jQuery || window.Zepto, window, document); - /* https://gist.github.com/pjambet/3710461 */ @@ -7112,9 +6468,6 @@ SirTrevor.Locales.en.blocks = $.extend(SirTrevor.Locales.en.blocks, { } }); -// import '../../../../vendor/assets/javascripts/sir-trevor' - - class AdminIndex { connect() { new AddAnother().connect(); diff --git a/app/assets/javascripts/spotlight/spotlight.esm.js.map b/app/assets/javascripts/spotlight/spotlight.esm.js.map index f2bf8d423f..557f6f029e 100644 --- a/app/assets/javascripts/spotlight/spotlight.esm.js.map +++ b/app/assets/javascripts/spotlight/spotlight.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"spotlight.esm.js","sources":["../../../javascript/spotlight/user/analytics.es6","../../../javascript/spotlight/user/browse_group_categories.es6","../../../javascript/spotlight/user/carousel.es6","../../../javascript/spotlight/user/clear_form_button.es6","../../../javascript/spotlight/user/report_a_problem.es6","../../../javascript/spotlight/user/zpr_links.es6","../../../javascript/spotlight/user/index.js","../../../../vendor/assets/javascripts/nestable.js","../../../../vendor/assets/javascripts/parameterize.js","../../../../vendor/assets/javascripts/bootstrap-tagsinput.js","../../../../vendor/assets/javascripts/jquery.serializejson.js","../../../../vendor/assets/javascripts/leaflet-iiif.js","../../../../vendor/assets/javascripts/Leaflet.Editable.js","../../../../vendor/assets/javascripts/Path.Drag.js","../../../javascript/spotlight/admin/add_another.es6","../../../javascript/spotlight/admin/add_new_button.es6","../../../javascript/spotlight/admin/appearance.es6","../../../javascript/spotlight/admin/blacklight_configuration.es6","../../../javascript/spotlight/admin/copy_email_addresses.es6","../../../javascript/spotlight/admin/iiif.js","../../../javascript/spotlight/admin/add_image_selector.es6","../../../javascript/spotlight/admin/crop.js","../../../javascript/spotlight/admin/croppable.es6","../../../javascript/spotlight/admin/edit_in_place.es6","../../../javascript/spotlight/admin/exhibit_tag_autocomplete.es6","../../../javascript/spotlight/admin/exhibits.es6","../../../javascript/spotlight/admin/form_observer.es6","../../../javascript/spotlight/admin/locks.es6","../../../javascript/spotlight/admin/multi_image_selector.js","../../../javascript/spotlight/spotlight.js","../../../javascript/spotlight/admin/pages.es6","../../../javascript/spotlight/admin/progress_monitor.es6","../../../javascript/spotlight/admin/readonly_checkbox.es6","../../../javascript/spotlight/admin/search_typeahead.js","../../../javascript/spotlight/admin/select_related_input.es6","../../../javascript/spotlight/admin/spotlight_nestable.js","../../../javascript/spotlight/admin/tabs.es6","../../../javascript/spotlight/admin/translation_progress.es6","../../../javascript/spotlight/admin/checkbox_submit.es6","../../../javascript/spotlight/admin/visibility_toggle.es6","../../../javascript/spotlight/admin/users.es6","../../../javascript/spotlight/admin/block_mixins/autocompleteable.js","../../../javascript/spotlight/admin/block_mixins/formable.js","../../../javascript/spotlight/admin/block_mixins/plustextable.js","../../../javascript/spotlight/admin/blocks/block.js","../../../javascript/spotlight/admin/blocks/resources_block.js","../../../javascript/spotlight/admin/blocks/browse_block.js","../../../javascript/spotlight/admin/blocks/browse_group_categories_block.js","../../../javascript/spotlight/admin/blocks/iframe_block.js","../../../javascript/spotlight/admin/blocks/link_to_search_block.js","../../../javascript/spotlight/admin/blocks/oembed_block.js","../../../javascript/spotlight/admin/blocks/pages_block.js","../../../javascript/spotlight/admin/blocks/rule_block.js","../../../javascript/spotlight/admin/blocks/search_result_block.js","../../../javascript/spotlight/admin/blocks/solr_documents_base_block.js","../../../javascript/spotlight/admin/blocks/solr_documents_block.js","../../../javascript/spotlight/admin/blocks/solr_documents_carousel_block.js","../../../javascript/spotlight/admin/blocks/solr_documents_embed_block.js","../../../javascript/spotlight/admin/blocks/solr_documents_features_block.js","../../../javascript/spotlight/admin/blocks/solr_documents_grid_block.js","../../../javascript/spotlight/admin/blocks/uploaded_items_block.js","../../../javascript/spotlight/admin/sir-trevor/block_controls.js","../../../javascript/spotlight/admin/sir-trevor/block_limits.js","../../../javascript/spotlight/admin/sir-trevor/locales.js","../../../javascript/spotlight/admin/index.js","../../../javascript/spotlight/index.js"],"sourcesContent":["export default class {\n connect() {\n if (window._gaq != null) {\n return _gaq.push(['_trackPageview']);\n } else if (window.pageTracker != null) {\n return pageTracker._trackPageview();\n }\n }\n}","export default class {\n connect() {\n var $container, slider;\n\n function init() {\n var data = $container.data();\n var sidebar = $container.data().sidebar;\n var items = data.browseGroupCategoriesCount;\n var dir = $('html').attr('dir');\n var controls = $container.parent().find('.browse-group-categories-controls')[0];\n\n slider = tns({\n container: $container[0],\n controlsContainer: controls,\n loop: false,\n nav: false,\n items: 1,\n slideBy: 'page',\n textDirection: dir,\n responsive: {\n 576: {\n items: itemCount(items, sidebar)\n }\n }\n });\n }\n\n // Destroy the slider instance, as tns will change the dom elements, causing some issues with turbolinks\n function setupDestroy() {\n document.addEventListener('turbolinks:before-cache', function() {\n if (slider && slider.destroy) {\n slider.destroy();\n }\n });\n }\n\n function itemCount(items, sidebar) {\n if (items < 3) {\n return items;\n }\n return sidebar ? 3 : 4;\n }\n\n return $('[data-browse-group-categories-carousel]').each(function() {\n $container = $(this);\n init();\n setupDestroy();\n });\n }\n}\n","export default class {\n connect() {\n $('.carousel').carousel();\n }\n}\n","export default class {\n connect() {\n var $clearBtn = $('.btn-reset');\n var $input = $clearBtn.parent().prev('input');\n var btnCheck = function(){\n if ($input.val() !== '') {\n $clearBtn.css('display', 'inline-block');\n } else {\n $clearBtn.css('display', 'none');\n }\n };\n\n btnCheck();\n $input.on('keyup', function() {\n btnCheck();\n });\n\n $clearBtn.on('click', function(event) {\n event.preventDefault();\n $input.val('');\n });\n }\n}\n","export default class {\n connect(){\n var container, target;\n\n function init() {\n const target_val = container.attr('data-target')\n if (!target_val) \n return\n\n target = $(\"#\" + target_val); \n container.on('click', open);\n target.find('[data-behavior=\"cancel-link\"]').on('click', close);\n }\n\n function open(event) {\n event.preventDefault();\n target.slideToggle('slow');\n }\n\n function close(event) {\n event.preventDefault();\n target.slideUp('fast');\n }\n\n return $('[data-behavior=\"contact-link\"]').each(function() { \n container = $(this);\n init();\n });\n }\n}","export default class {\n connect() {\n $('.zpr-link').on('click', function() {\n var modalDialog = $('#blacklight-modal .modal-dialog');\n var modalContent = modalDialog.find('.modal-content')\n modalDialog.removeClass('modal-lg')\n modalDialog.addClass('modal-xl')\n modalContent.html('');\n var controls = `${i18n.t(\"blocks:textable:align:title\")}
\n \n \n \n \n