1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[730,829],{829(t,s,e){e.d(s,{default:()=>n});class n{constructor(t,s){this.props={},this.props.name=t.name,this.props.url=t.url,this.props.icon=t.icon,this.props.class=t.class,this.props.subscription=t.subscription,this.manager=s}renderHtml(){this.element=document.createElement("div"),this.element.classList.add("shortcut"),this.element.innerHTML='<span class="icon fa fa-'+this.props.icon+'"></span> <p>'+this.props.name+"</p>";var t=document.createElement("p");return t.innerHTML='<button class="btn btn-sm btn-danger"><span class="fa fa-trash-can"></span></button>',this.element.appendChild(t),t.addEventListener("click",function(){this.manager.remove(this)}.bind(this)),this.element}remove(){this.element.parentNode.removeChild(this.element)}}},730(t,s,e){e.d(s,{default:()=>i});var n=e(829);class i{constructor(t){this.shortcuts=[],this.count=0,this.shortcutList=document.querySelector("#shortcut-list"),this.shortcutsInput=document.querySelector("#shortcuts-input");var s=document.querySelector("#add-shortcut");t.addEventListener("submit",function(){window.biblys.adminBar.clearShortcutsCache()}),s.addEventListener("change",()=>{var t=s.options[s.selectedIndex],e=t.dataset;if(""!=t.value){var i=new n.default({name:t.value,icon:e.icon,url:e.url,class:e.class,subscription:e.subscription},this);this.add(i),this.selectedIndex=0}}),this.loadFromInput()}add(t){this.count>=12?window._alert("Vous ne pouvez pas ajouter plus de 12 raccourcis."):(this.shortcuts.push(t),this.count++,this.shortcutList.appendChild(t.renderHtml()),this.updateInput())}remove(t){for(var s=0,e=this.shortcuts.length;s<e;s++)this.shortcuts[s]==t&&(this.shortcuts.splice(s,1),t.remove(),this.updateInput(),this.count--)}updateInput(){var t=this.shortcuts.map(function(t){return t.props});this.shortcutsInput.value=JSON.stringify(t),window.biblys.adminBar&&window.biblys.adminBar.loadPreviewFromInput(t)}loadFromInput(){try{var t=JSON.parse(this.shortcutsInput.value)}catch(t){return}this.shortcutsInput.value="",t.forEach(function(t){this.add(new n.default({name:t.name,icon:t.icon,url:t.url,class:t.class,subscription:t.subscription},this))}.bind(this))}}document.addEventListener("DOMContentLoaded",function(){})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.