From 94bf1ff84479ef688159dd68bcfbe7dcdb0cb87e Mon Sep 17 00:00:00 2001 From: Alexander Kellner Date: Wed, 18 Dec 2024 09:01:31 +0100 Subject: [PATCH] [TASK] Remove outdated CKEditor 4 plugin --- .../luxEmail4LinkOld/dialogs/dialog.js | 99 ------------------- .../luxEmail4LinkOld/icons/email4link.svg | 1 - .../luxEmail4LinkOld/lang/de.js | 10 -- .../luxEmail4LinkOld/lang/en.js | 10 -- .../luxEmail4LinkOld/plugin.js | 72 -------------- 5 files changed, 192 deletions(-) delete mode 100644 Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/dialogs/dialog.js delete mode 100644 Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/icons/email4link.svg delete mode 100644 Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/de.js delete mode 100644 Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/en.js delete mode 100644 Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/plugin.js diff --git a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/dialogs/dialog.js b/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/dialogs/dialog.js deleted file mode 100644 index ce78abb0..00000000 --- a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/dialogs/dialog.js +++ /dev/null @@ -1,99 +0,0 @@ -CKEDITOR.dialog.add('luxEmail4LinkDialog', function (editor) { - /** - * pendant to jQuery function "closest" - * - * @param elementType - * @param currentSelection - * @returns {*} - */ - var getParentElement = function (elementType, currentSelection) { - var parentElements = currentSelection.getParents(); - for (var i = 0; i < parentElements.length; i++) { - if (parentElements[i].getName() === elementType) { - return parentElements[i]; - } - } - return null; - }; - - /** - * @returns {boolean} - */ - var isLuxenterpriseExisting = function() { - var http = new XMLHttpRequest(); - http.open('HEAD', '/typo3conf/ext/luxenterprise/Resources/Public/Icons/lux.svg', false); - http.send(); - return http.status !== 404; - } - - return { - title: editor.lang.luxEmail4Link.dialog, - minWidth: 800, - minHeight: 500, - contents: [ - { - id: 'general', - label: 'Settings', - elements: [ - { - type: 'text', - id: 'title', - label: editor.lang.luxEmail4Link.dialogTitle, - validate: CKEDITOR.dialog.validate.notEmpty(editor.lang.luxEmail4Link.validationNotEmpty), - required: true, - commit: function (data) { - data.title = this.getValue(); - } - }, - { - type: 'textarea', - id: 'text', - minHeight: 300, - label: editor.lang.luxEmail4Link.dialogText, - commit: function (data) { - data.text = this.getValue(); - } - }, - { - type: 'checkbox', - id: 'sendEmail', - label: editor.lang.luxEmail4Link.dialogSendEmail, - commit: function (data) { - data.sendEmail = this.getValue(); - } - }, - { - type: 'html', - html: '

' + editor.lang.luxEmail4Link.dialogExplanation + '

' - }, - { - type: 'html', - html: '

' + editor.lang.luxEmail4Link.dialogPoweredBy + '

' - } - ] - } - ], - - // If editor submits the dialog - onOk: function () { - var data = {}; - this.commitContent(data); - var parent = getParentElement('a', editor.getSelection().getStartElement()); - parent.setAttribute('data-lux-email4link-title', data.title); - parent.setAttribute('data-lux-email4link-text', data.text); - parent.setAttribute('data-lux-email4link-sendEmail', data.sendEmail); - }, - - // On opening dialog box - onShow: function () { - var parent = getParentElement('a', editor.getSelection().getStartElement()); - this.setValueOf('general', 'title', parent.getAttribute('data-lux-email4link-title') || ''); - this.setValueOf('general', 'text', parent.getAttribute('data-lux-email4link-text') || ''); - var sendEmailStatus = parent.getAttribute('data-lux-email4link-sendEmail') || ''; - this.setValueOf('general', 'sendEmail', sendEmailStatus === 'true'); - if (isLuxenterpriseExisting()) { - document.getElementById('poweredbylux').style.display = 'none'; - } - } - }; -}); diff --git a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/icons/email4link.svg b/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/icons/email4link.svg deleted file mode 100644 index c1c83068..00000000 --- a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/icons/email4link.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/de.js b/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/de.js deleted file mode 100644 index 74620ec5..00000000 --- a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/de.js +++ /dev/null @@ -1,10 +0,0 @@ -CKEDITOR.plugins.setLang('luxEmail4Link', 'de', { - button: 'Link in email4link wandeln', - dialog: 'Besucher um E-Mail-Adresse für Link bitten', - dialogTitle: 'Überschrift', - dialogText: 'Informationstext für Besucher', - dialogSendEmail: 'Dokument per E-Mail versenden (nur Links auf Dateien)', - dialogExplanation: 'Hinweis: Mit dem Feature "email4link" erhöhen Sie die Identifikationsrate Ihrer Leads.', - dialogPoweredBy: '"Powered by Lux" mit luxenterprise ausblenden', - validationNotEmpty: 'Feld darf nicht leer sein' -}); diff --git a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/en.js b/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/en.js deleted file mode 100644 index ee523e32..00000000 --- a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/en.js +++ /dev/null @@ -1,10 +0,0 @@ -CKEDITOR.plugins.setLang('luxEmail4Link', 'en', { - button: 'Convert a link to email4link', - dialog: 'Ask visitor for his/her email address to get the link', - dialogTitle: 'Title', - dialogText: 'Text as information for the visitor', - dialogSendEmail: 'Send document as email (only for filelinks)', - dialogExplanation: 'Note: To increase rate of identification, you can use the feature "email4link".', - dialogPoweredBy: 'Hide "Powered by Lux" with luxenterprise', - validationNotEmpty: 'Feld darf nicht leer sein' -}); diff --git a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/plugin.js b/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/plugin.js deleted file mode 100644 index 830cb5b0..00000000 --- a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/plugin.js +++ /dev/null @@ -1,72 +0,0 @@ -CKEDITOR.plugins.add('luxEmail4Link', { - lang: [ - 'en', 'de' - ], - init: function(editor) { - - /** - * Add buttons - * - * @param context - * @returns {void} - */ - var addButtons = function (context) { - editor.ui.addButton('Email4Link', { - label: editor.lang.luxEmail4Link.button, - command: 'luxEmail4Link', - toolbar: 'links', - icon: context.path + 'icons/email4link.svg' - }); - }; - - /** - * Add click events to buttons - * - * @param context - * @returns {void} - */ - var addButtonListeners = function(context) { - editor.addCommand('luxEmail4Link', new CKEDITOR.dialogCommand('luxEmail4LinkDialog')); - CKEDITOR.dialog.add('luxEmail4LinkDialog', context.path + 'dialogs/dialog.js'); - }; - - addButtons(this); - addButtonListeners(this); - - // Disable button on start - editor.on('instanceReady', function(event) { - editor.getCommand('luxEmail4Link').setState(CKEDITOR.TRISTATE_DISABLED); - }); - - // Enable or disable button depending on selection - editor.on('selectionChange', function(event) { - var parent = getParentElement('a', editor.getSelection().getStartElement()); - if (parent !== null) { - if (parent.getAttribute('data-lux-email4link-title') === null) { - editor.getCommand('luxEmail4Link').setState(CKEDITOR.TRISTATE_OFF); - } else { - editor.getCommand('luxEmail4Link').setState(CKEDITOR.TRISTATE_ON); - } - } else { - editor.getCommand('luxEmail4Link').setState(CKEDITOR.TRISTATE_DISABLED); - } - }); - - /** - * pendant to jQuery function "closest" - * - * @param elementType - * @param currentSelection - * @returns {*} - */ - var getParentElement = function(elementType, currentSelection) { - var parentElements = currentSelection.getParents(); - for (var i = 0; i < parentElements.length; i++) { - if (parentElements[i].getName() === elementType) { - return parentElements[i]; - } - } - return null; - }; - } -});