'use strict';(()=>{CKEDITOR.plugins.add('dclink',{init(editor){editor.addCommand('dcLinkCommand',{exec(_editor){$.toolbarPopup('index.php?process=LinkPopup&plugin_id=dcCKEditor');},});editor.ui.addButton('dcLink',{label:dotclear.msg.link_title,command:'dcLinkCommand',toolbar:'insert',icon:`${this.path}icons/icon.svg`,});editor.on('doubleclick',(e)=>{const element=CKEDITOR.plugins.link.getSelectedLink(editor)||e.data.element;if(!(!element.isReadOnly()&&element.is('a')&&!element.hasClass('media-link')&&!element.hasClass('ref-post'))){return;}
editor.getSelection().selectElement(element);let popup_url='index.php?process=LinkPopup&plugin_id=dcCKEditor';if(element.getAttribute('href')){popup_url+=`&href=${element.getAttribute('href')}`;}
if(element.getAttribute('hreflang')){popup_url+=`&hreflang=${element.getAttribute('hreflang')}`;}
if(element.getAttribute('title')){popup_url+=`&title=${element.getAttribute('title')}`;}
$.toolbarPopup(popup_url);return false;});},});})();