\n
${i18n.t(\"blocks:resources:panel:drag\")}
\n \n `\n\n const panel = $(markup);\n panel.find('[data-field=\"caption\"]').val(data.caption);\n panel.find('[data-field=\"link\"]').val(data.link);\n var context = this;\n\n $('.remove a', panel).on('click', function(e) {\n e.preventDefault();\n $(this).closest('.field').remove();\n context.afterPanelDelete();\n });\n\n this.afterPanelRender(data, panel);\n\n return panel;\n },\n\n editorHTML: function() {\n return `
`\n },\n\n altTextHTML: function(index, data) {\n const { isDecorative, altText, altTextBackup, placeholderAttr, disabledAttr } = this._altTextData(data);\n return `\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
`\n },\n\n zpr_key: 'zpr_link'\n });\n})();\n","import Core from 'spotlight/core'\n\n(function() {\n var BLOCK_REPLACER_CONTROL_TEMPLATE = function(block) {\n var el = document.createElement('button');\n el.className = \"st-block-controls__button\";\n el.setAttribute('data-type', block.type);\n el.type = \"button\";\n\n var img = document.createElement('svg');\n img.className = \"st-icon\";\n img.setAttribute('role', 'img');\n\n var use = document.createElement('use');\n use.setAttributeNS('https://www.w3.org/1999/xlink', 'href', SirTrevor.config.defaults.iconUrl + \"#\" + block.icon_name);\n img.appendChild(use);\n el.appendChild(img);\n el.appendChild(document.createTextNode(block.title()));\n\n return el.outerHTML;\n };\n\n function generateBlocksHTML(Blocks, availableTypes) {\n var groups = {};\n for(var i in availableTypes) {\n var type = availableTypes[i];\n if (Blocks.hasOwnProperty(type) && Blocks[type].prototype.toolbarEnabled) {\n var blockGroup;\n\n if ($.isFunction(Blocks[type].prototype.blockGroup)) {\n blockGroup = Blocks[type].prototype.blockGroup();\n } else {\n blockGroup = Blocks[type].prototype.blockGroup;\n }\n\n if (blockGroup == 'undefined' || blockGroup === undefined) {\n blockGroup = i18n.t(\"blocks:group:undefined\");\n }\n\n groups[blockGroup] = groups[blockGroup] || [];\n groups[blockGroup].push(BLOCK_REPLACER_CONTROL_TEMPLATE(Blocks[type].prototype));\n }\n }\n\n function generateBlock(groups, key) {\n var group = groups[key];\n var groupEl = $(\"
\");\n var buttons = group.reduce(function(memo, btn) {\n return memo += btn;\n }, \"\");\n groupEl.append(buttons);\n return groupEl[0].outerHTML;\n }\n\n var standardWidgets = generateBlock(groups, i18n.t(\"blocks:group:undefined\"));\n\n var exhibitWidgets = Object.keys(groups).map(function(key) {\n if (key !== i18n.t(\"blocks:group:undefined\")) {\n return generateBlock(groups, key);\n }\n }).filter(function (element) {\n return element != null;\n });\n\n var blocks = [standardWidgets].concat(exhibitWidgets).join(\"
\");\n return blocks;\n }\n\n function render(Blocks, availableTypes) {\n var el = document.createElement('div');\n el.className = \"st-block-controls__buttons\";\n el.innerHTML = generateBlocksHTML.apply(null, arguments);\n\n var elButtons = document.createElement('div');\n elButtons.className = \"spotlight-block-controls\";\n elButtons.appendChild(el);\n return elButtons;\n }\n\n Core.BlockControls = function() { };\n Core.BlockControls.create = function(editor) {\n // REFACTOR - should probably not know about blockManager\n var el = render(SirTrevor.Blocks, editor.blockManager.blockTypes);\n\n function hide() {\n var parent = el.parentNode;\n if (!parent) { return; }\n parent.removeChild(el);\n parent.classList.remove(\"st-block--controls-active\");\n return parent;\n }\n\n function destroy() {\n SirTrevor = null;\n el = null;\n }\n\n function insert(e) {\n e.stopPropagation();\n\n var parent = this.parentNode;\n if (!parent || hide() === parent) { return; }\n $('.st-block__inner', parent).after(el);\n parent.classList.add(\"st-block--controls-active\");\n }\n\n function replaceBlock() {\n SirTrevor.mediator.trigger(\n \"block:replace\", el.parentNode, this.getAttribute('data-type')\n );\n }\n\n $(editor.wrapper).delegate(\".st-block-replacer\", \"click\", insert);\n $(editor.wrapper).delegate(\".st-block-controls__button\", \"click\", insert);\n\n return {\n el: el,\n hide: hide,\n destroy: destroy\n };\n };\n})();\n","import Core from 'spotlight/core'\n\nCore.BlockLimits = function(editor) {\n this.editor = editor;\n};\n\nCore.BlockLimits.prototype.enforceLimits = function(editor) {\n this.addEditorCallbacks(editor);\n this.checkGlobalBlockTypeLimit()();\n};\n\nCore.BlockLimits.prototype.addEditorCallbacks = function(editor) {\n SirTrevor.EventBus.on('block:create:new', this.checkBlockTypeLimitOnAdd());\n SirTrevor.EventBus.on('block:remove', this.checkGlobalBlockTypeLimit());\n};\n\nCore.BlockLimits.prototype.checkBlockTypeLimitOnAdd = function() {\n var editor = this.editor;\n\n return function(block) {\n var control = $(\".st-block-controls__button[data-type='\" + block.type + \"']\", editor.blockControls.el);\n\n control.prop(\"disabled\", !editor.blockManager.canCreateBlock(block.class()));\n };\n};\n\nCore.BlockLimits.prototype.checkGlobalBlockTypeLimit = function() {\n // we don't know what type of block was created or removed.. So, try them all.\n var editor = this.editor;\n\n return function() {\n $.each(editor.blockManager.blockTypes, function(i, type) {\n var block_type = SirTrevor.Blocks[type].prototype;\n\n var control = $(editor.blockControls.el).find(\".st-block-controls__button[data-type='\" + block_type.type + \"']\");\n control.prop(\"disabled\", !editor.blockManager.canCreateBlock(type));\n });\n };\n};\n","SirTrevor.Locales.en.blocks = $.extend(SirTrevor.Locales.en.blocks, {\n autocompleteable: {\n placeholder: \"Enter a title...\"\n },\n\n browse: {\n title: \"Browse Categories\",\n description: \"This widget highlights browse categories. Each highlighted category links to the corresponding browse category results page.\",\n item_counts: \"Include item counts?\"\n },\n\n browse_group_categories: {\n autocomplete: \"Enter a browse group title...\",\n title: \"Browse Group Categories\",\n description: \"This widget displays all browse categories associated with a selected browse group as a horizontally-scrolling row. Each selected browse group is displayed as a separate row. Each displayed category in a group links to the corresponding browse category results page.\",\n item_counts: \"Include category item counts?\"\n },\n\n link_to_search: {\n title: \"Saved Searches\",\n description: \"This widget highlights saved searches. Each highlighted saved search links to the search results page generated by the saved search parameters. Any saved search listed on the Curation > Browse categories page, whether published or not, can be highlighted as a saved search.\",\n item_counts: \"Include item counts?\"\n },\n\n iframe: {\n title: \"IFrame\",\n description: \"This widget embeds iframe-based embed code into pages\",\n placeholder: \"Enter embed code here. It should begin with e.g. '