N°7552 - Move CKEditor from to npm dependencies

This commit is contained in:
Stephen Abello
2024-07-24 14:19:52 +02:00
parent 35a7d907cd
commit 054fd8798b
126 changed files with 210 additions and 7981 deletions

View File

@@ -1,49 +0,0 @@
Software License Agreement
==========================
Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
Online builder code samples are licensed under the terms of the MIT License (see Appendix A):
http://en.wikipedia.org/wiki/MIT_License
CKEditor 5 collaboration features are only available under a commercial license. [Contact us](https://ckeditor.com/contact/) for more details.
Free 30-days trials of CKEditor 5 collaboration features are available:
* https://ckeditor.com/collaboration/ - Real-time collaboration (with all features).
* https://ckeditor.com/collaboration/comments/ - Inline comments feature (without real-time collaborative editing).
* https://ckeditor.com/collaboration/track-changes/ - Track changes feature (without real-time collaborative editing).
Trademarks
----------
CKEditor is a trademark of CKSource Holding sp. z o.o. All other brand
and product names are trademarks, registered trademarks or service
marks of their respective holders.
---
Appendix A: The MIT License
---------------------------
The MIT License (MIT)
Copyright (c) 2014-2024, CKSource Holding sp. z o.o.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -1,36 +0,0 @@
# CKEditor 5 editor customized for iTop
## Installation
In order to build the editor you need to install all dependencies first. To do it, open the terminal in the project directory and type:
```
npm install
```
Make sure that you have the `node` and `npm` installed first. If not, then follow the instructions on the [Node.js documentation page](https://nodejs.org/en/).
## Adding or removing plugins
If you need to add additional CKEditor plugins, you can install them in the build. Just follow the [Adding a plugin to an editor tutorial](https://ckeditor.com/docs/ckeditor5/latest/installation/plugins/installing-plugins.html#adding-a-plugin-to-an-editor)
If you need to build your own plugins check CKEditor's documentation or `src/plugins/` for examples.
## Rebuilding editor
If you have already done the [Installation](#installation) and [Adding or removing plugins](#adding-or-removing-plugins) steps, you're ready to rebuild the editor by running the following command:
```
npm run build
```
This will build the CKEditor 5 to the `build` directory.
## Import your changes to iTop
In order to update iTop CKEditor's build you need to push your changes to github.
Then run the following command in iTop's root directory:
```
npm install https://github.com/Combodo/ckeditor5-itop-build.git
```

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(e){const t=e.af=e.af||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require <kbd>Fn</kbd>)":"","%0 of %1":"%0 van %1",Accept:"",Accessibility:"","Accessibility help":"","Align center":"Belyn in die middel","Align left":"Belyn links","Align right":"Belyn regs",Aquamarine:"","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"",Black:"","Block quote":"Verwysingsaanhaling",Blue:"",Bold:"Vet","Bold text":"",Cancel:"Kanselleer",Clear:"","Click to edit block":"",Close:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"Bronkode","Code block":"","Content editing keystrokes":"","Dim grey":"","Drag to move":"","Dropdown toolbar":"","Edit block":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor dialog":"","Editor editing area: %0":"","Editor menu bar":"","Editor toolbar":"","Entering %0 code snippet":"","Entering code snippet":"","Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content.":"",Green:"",Grey:"","Help Contents. To close this dialog press ESC.":"",HEX:"","Insert code block":"Voeg bronkodeblok in",Italic:"Kursief","Italic text":"",Justify:"Belyn beide kante","Leaving %0 code snippet":"","Leaving code snippet":"","Light blue":"","Light green":"","Light grey":"",MENU_BAR_MENU_EDIT:"Wysig",MENU_BAR_MENU_FILE:"",MENU_BAR_MENU_FONT:"",MENU_BAR_MENU_FORMAT:"",MENU_BAR_MENU_HELP:"",MENU_BAR_MENU_INSERT:"",MENU_BAR_MENU_TEXT:"",MENU_BAR_MENU_TOOLS:"",MENU_BAR_MENU_VIEW:"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus in and out of an active dialog window":"","Move focus to the menu bar, navigate between menu bars":"","Move focus to the toolbar, navigate between toolbars":"","Move out of an inline code style":"","Navigate through the toolbar or menu bar":"",Next:"","No results found":"","No searchable items":"","Open the accessibility help dialog":"",Orange:"","Plain text":"Gewone skrif",'Please enter a valid color (e.g. "ff0000").':"","Press %0 for help.":"",Previous:"",Purple:"",Red:"","Remove color":"Verwyder kleur","Remove Format":"Verwyder formatering","Restore default":"Herstel verstek","Rich Text Editor":"",Save:"Stoor","Show more items":"Wys meer items",Strikethrough:"Deurstreep","Strikethrough text":"",Subscript:"Onderskrif",Superscript:"Boskrif","Text alignment":"Teksbelyning","Text alignment toolbar":"Teksbelyning nutsbank","These keyboard shortcuts allow for quick access to content editing features.":"","Toggle caption off":"","Toggle caption on":"",Turquoise:"",Underline:"Onderstreep","Underline text":"","Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.":"","User interface and content navigation keystrokes":"",White:"",Yellow:""}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(e){const t=e.ast=e.ast||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require <kbd>Fn</kbd>)":"","%0 of %1":"",Accept:"",Accessibility:"","Accessibility help":"",Aquamarine:"","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"",Black:"",Blue:"",Bold:"Negrina","Bold text":"","Break text":"","Bulleted List":"Llista con viñetes","Bulleted list styles toolbar":"",Cancel:"Encaboxar","Caption for image: %0":"","Caption for the image":"","Centered image":"","Change image text alternative":"",Circle:"",Clear:"","Click to edit block":"",Close:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"","Content editing keystrokes":"","Create link":"",Custom:"","Custom image size":"",Decimal:"","Decimal with leading zero":"","Decrease list item indent":"","Dim grey":"",Disc:"",Downloadable:"","Drag to move":"","Dropdown toolbar":"","Edit block":"","Edit link":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor dialog":"","Editor editing area: %0":"","Editor menu bar":"","Editor toolbar":"","Enter image caption":"","Entering a to-do list":"","Error during image upload":"","Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content.":"","Full size image":"Imaxen a tamañu completu",Green:"",Grey:"","Help Contents. To close this dialog press ESC.":"",HEX:"","Image from computer":"","Image resize list":"","Image toolbar":"","Image upload complete":"","image widget":"complementu d'imaxen","In line":"","Increase list item indent":"",Insert:"","Insert image":"","Insert image via URL":"","Invalid start index value.":"",Italic:"Cursiva","Italic text":"","Keystrokes that can be used in a list":"","Leaving a to-do list":"","Left aligned image":"","Light blue":"","Light green":"","Light grey":"",Link:"Enllazar","Link image":"","Link URL":"URL del enllaz","Link URL must not be empty.":"","List properties":"","Lower-latin":"","Lowerroman":"",MENU_BAR_MENU_EDIT:"",MENU_BAR_MENU_FILE:"",MENU_BAR_MENU_FONT:"",MENU_BAR_MENU_FORMAT:"",MENU_BAR_MENU_HELP:"",MENU_BAR_MENU_INSERT:"",MENU_BAR_MENU_TEXT:"",MENU_BAR_MENU_TOOLS:"",MENU_BAR_MENU_VIEW:"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus in and out of an active dialog window":"","Move focus to the menu bar, navigate between menu bars":"","Move focus to the toolbar, navigate between toolbars":"","Move out of a link":"","Move out of an inline code style":"","Navigate through the toolbar or menu bar":"",Next:"","No results found":"","No searchable items":"","Numbered List":"Llista numberada","Numbered list styles toolbar":"","Open in a new tab":"","Open link in new tab":"","Open the accessibility help dialog":"",Orange:"",Original:"",'Please enter a valid color (e.g. "ff0000").':"","Press %0 for help.":"",Previous:"",Purple:"",Red:"",Redo:"Refacer","Remove color":"","Replace from computer":"","Replace image":"","Replace image from computer":"","Resize image":"","Resize image (in %0)":"","Resize image to %0":"","Resize image to the original size":"","Restore default":"","Reversed order":"","Rich Text Editor":"Editor de testu arriquecíu","Right aligned image":"",Save:"Guardar","Show more items":"","Side image":"Imaxen llateral",Square:"","Start at":"","Start index must be greater than 0.":"",Strikethrough:"","Strikethrough text":"",Subscript:"",Superscript:"","Text alternative":"","The value must not be empty.":"","The value should be a plain number.":"","These keyboard shortcuts allow for quick access to content editing features.":"","This link has no URL":"","To-do List":"","Toggle caption off":"","Toggle caption on":"","Toggle the circle list style":"","Toggle the decimal list style":"","Toggle the decimal with leading zero list style":"","Toggle the disc list style":"","Toggle the lowerlatin list style":"","Toggle the lowerroman list style":"","Toggle the square list style":"","Toggle the upperlatin list style":"","Toggle the upperroman list style":"",Turquoise:"",Underline:"","Underline text":"",Undo:"Desfacer",Unlink:"Desenllazar",Update:"","Update image URL":"","Upload failed":"","Upload from computer":"","Upload image from computer":"","Uploading image":"","Upper-latin":"","Upper-roman":"","Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.":"","User interface and content navigation keystrokes":"",White:"","Wrap text":"",Yellow:""}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(e){const t=e.bs=e.bs||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require <kbd>Fn</kbd>)":"","%0 of %1":"%0 od %1",Accept:"",Accessibility:"","Accessibility help":"","Align center":"Centrirati","Align left":"Lijevo poravnanje","Align right":"Desno poravnanje",Aquamarine:"","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"",Big:"",Black:"","Block quote":"Citat",Blue:"",Bold:"Podebljano","Bold text":"","Break text":"",Cancel:"Poništi","Caption for image: %0":"","Caption for the image":"","Centered image":"Centrirana slika","Change image text alternative":"Promijeni ALT atribut za sliku","Choose heading":"Odaberi naslov",Clear:"","Click to edit block":"",Close:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"Kod","Code block":"","Content editing keystrokes":"",Custom:"","Custom image size":"",Default:"Zadani","Dim grey":"","Document colors":"","Drag to move":"","Dropdown toolbar":"","Edit block":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor dialog":"","Editor editing area: %0":"","Editor menu bar":"","Editor toolbar":"","Enter image caption":"Unesi naziv slike","Entering %0 code snippet":"","Entering code snippet":"","Error during image upload":"","Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content.":"","Font Background Color":"Boja pozadine","Font Color":"Boja","Font Family":"Font","Font Size":"Veličina fonta","Full size image":"",Green:"",Grey:"",Heading:"Naslov","Heading 1":"Naslov 1","Heading 2":"Naslov 2","Heading 3":"Naslov 3","Heading 4":"Naslov 4","Heading 5":"Naslov 5","Heading 6":"Naslov 6","Help Contents. To close this dialog press ESC.":"",HEX:"","Horizontal line":"Horizontalna linija",Huge:"","Image from computer":"","Image resize list":"Lista veličina slike","Image toolbar":"","Image upload complete":"","image widget":"","In line":"",Insert:"Umetni","Insert code block":"Umetni kod blok","Insert image":"Umetni sliku","Insert image via URL":"Umetni sliku preko URLa",Italic:"Zakrivljeno","Italic text":"",Justify:"","Leaving %0 code snippet":"","Leaving code snippet":"","Left aligned image":"Lijevo poravnata slika","Light blue":"","Light green":"","Light grey":"",MENU_BAR_MENU_EDIT:"Uredi",MENU_BAR_MENU_FILE:"",MENU_BAR_MENU_FONT:"",MENU_BAR_MENU_FORMAT:"",MENU_BAR_MENU_HELP:"",MENU_BAR_MENU_INSERT:"Umetni",MENU_BAR_MENU_TEXT:"",MENU_BAR_MENU_TOOLS:"",MENU_BAR_MENU_VIEW:"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus in and out of an active dialog window":"","Move focus to the menu bar, navigate between menu bars":"","Move focus to the toolbar, navigate between toolbars":"","Move out of an inline code style":"","Navigate through the toolbar or menu bar":"",Next:"","No results found":"","No searchable items":"","Open the accessibility help dialog":"",Orange:"",Original:"Original",Paragraph:"Paragraf","Plain text":"Tekst",'Please enter a valid color (e.g. "ff0000").':"","Press %0 for help.":"",Previous:"",Purple:"",Red:"","Remove color":"Ukloni boju","Replace from computer":"","Replace image":"","Replace image from computer":"","Resize image":"Promijeni veličinu slike","Resize image (in %0)":"","Resize image to %0":"","Resize image to the original size":"Postavi originalnu veličinu slike","Restore default":"Vrati na zadano","Rich Text Editor":"","Right aligned image":"Desno poravnata slika",Save:"Sačuvaj","Show more items":"Prikaži više stavki","Side image":"",Small:"",Strikethrough:"Precrtano","Strikethrough text":"",Subscript:"",Superscript:"","Text alignment":"Poravnanje teksta","Text alignment toolbar":"Traka za poravnanje teksta","Text alternative":"ALT atribut","The value must not be empty.":"","The value should be a plain number.":"","These keyboard shortcuts allow for quick access to content editing features.":"",Tiny:"","Toggle caption off":"","Toggle caption on":"",Turquoise:"","Type or paste your content here.":"Unesite ili zalijepite vaš sadržaj ovdje","Type your title":"Unesite naslov",Underline:"Podcrtano","Underline text":"",Update:"Ažuriraj","Update image URL":"Ažuriraj URL slike","Upload failed":"Učitavanje slike nije uspjelo","Upload from computer":"","Upload image from computer":"","Uploading image":"","Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.":"","User interface and content navigation keystrokes":"",White:"","Wrap text":"Prelomi tekst",Yellow:""}),t.getPluralForm=function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(e){const t=e.eo=e.eo||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require <kbd>Fn</kbd>)":"","%0 of %1":"",Accept:"",Accessibility:"","Accessibility help":"",Aquamarine:"","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"",Black:"",Blue:"",Bold:"grasa","Bold text":"","Break text":"","Bulleted List":"Bula Listo","Bulleted list styles toolbar":"",Cancel:"Nuligi","Caption for image: %0":"","Caption for the image":"","Centered image":"","Change image text alternative":"Ŝanĝu la alternativan tekston de la bildo","Choose heading":"Elektu ĉapon",Circle:"",Clear:"","Click to edit block":"",Close:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"","Content editing keystrokes":"","Create link":"",Custom:"","Custom image size":"",Decimal:"","Decimal with leading zero":"","Decrease list item indent":"","Dim grey":"",Disc:"",Downloadable:"","Drag to move":"","Dropdown toolbar":"","Edit block":"","Edit link":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor dialog":"","Editor editing area: %0":"","Editor menu bar":"","Editor toolbar":"","Enter image caption":"Skribu klarigon pri la bildo","Entering a to-do list":"","Error during image upload":"","Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content.":"","Full size image":"Bildo kun reala dimensio",Green:"",Grey:"",Heading:"Ĉapo","Heading 1":"Ĉapo 1","Heading 2":"Ĉapo 2","Heading 3":"Ĉapo 3","Heading 4":"","Heading 5":"","Heading 6":"","Help Contents. To close this dialog press ESC.":"",HEX:"","Image from computer":"","Image resize list":"","Image toolbar":"","Image upload complete":"","image widget":"bilda fenestraĵo","In line":"","Increase list item indent":"",Insert:"","Insert image":"Enmetu bildon","Insert image via URL":"","Invalid start index value.":"",Italic:"kursiva","Italic text":"","Keystrokes that can be used in a list":"","Leaving a to-do list":"","Left aligned image":"","Light blue":"","Light green":"","Light grey":"",Link:"Ligilo","Link image":"","Link URL":"URL de la ligilo","Link URL must not be empty.":"","List properties":"","Lower-latin":"","Lowerroman":"",MENU_BAR_MENU_EDIT:"",MENU_BAR_MENU_FILE:"",MENU_BAR_MENU_FONT:"",MENU_BAR_MENU_FORMAT:"",MENU_BAR_MENU_HELP:"",MENU_BAR_MENU_INSERT:"",MENU_BAR_MENU_TEXT:"",MENU_BAR_MENU_TOOLS:"",MENU_BAR_MENU_VIEW:"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus in and out of an active dialog window":"","Move focus to the menu bar, navigate between menu bars":"","Move focus to the toolbar, navigate between toolbars":"","Move out of a link":"","Move out of an inline code style":"","Navigate through the toolbar or menu bar":"",Next:"","No results found":"","No searchable items":"","Numbered List":"Numerita Listo","Numbered list styles toolbar":"","Open in a new tab":"","Open link in new tab":"","Open the accessibility help dialog":"",Orange:"",Original:"",Paragraph:"Paragrafo",'Please enter a valid color (e.g. "ff0000").':"","Press %0 for help.":"",Previous:"",Purple:"",Red:"",Redo:"Refari","Remove color":"","Replace from computer":"","Replace image":"","Replace image from computer":"","Resize image":"","Resize image (in %0)":"","Resize image to %0":"","Resize image to the original size":"","Restore default":"","Reversed order":"","Rich Text Editor":"Redaktilo de Riĉa Teksto","Right aligned image":"",Save:"Konservi","Show more items":"","Side image":"Flanka biildo",Square:"","Start at":"","Start index must be greater than 0.":"",Strikethrough:"","Strikethrough text":"",Subscript:"",Superscript:"","Text alternative":"Alternativa teksto","The value must not be empty.":"","The value should be a plain number.":"","These keyboard shortcuts allow for quick access to content editing features.":"","This link has no URL":"","To-do List":"","Toggle caption off":"","Toggle caption on":"","Toggle the circle list style":"","Toggle the decimal list style":"","Toggle the decimal with leading zero list style":"","Toggle the disc list style":"","Toggle the lowerlatin list style":"","Toggle the lowerroman list style":"","Toggle the square list style":"","Toggle the upperlatin list style":"","Toggle the upperroman list style":"",Turquoise:"","Type or paste your content here.":"","Type your title":"",Underline:"","Underline text":"",Undo:"Malfari",Unlink:"Malligi",Update:"","Update image URL":"","Upload failed":"","Upload from computer":"","Upload image from computer":"","Uploading image":"","Upper-latin":"","Upper-roman":"","Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.":"","User interface and content navigation keystrokes":"",White:"","Wrap text":"",Yellow:""}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

View File

@@ -1 +0,0 @@
!function(e){const t=e["es-co"]=e["es-co"]||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require <kbd>Fn</kbd>)":"","%0 of %1":"%0 de %1",Accept:"",Accessibility:"","Accessibility help":"","Align center":"Centrar","Align left":"Alinear a la izquierda","Align right":"Alinear a la derecha",Aquamarine:"","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"",Big:"Grande",Black:"","Block quote":"Cita de bloque",Blue:"","Blue marker":"Marcador azul",Bold:"Negrita","Bold text":"","Break text":"",Cancel:"Cancelar","Caption for image: %0":"","Caption for the image":"","Centered image":"","Change image text alternative":"",Clear:"","Click to edit block":"",Close:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"Código","Code block":"","Content editing keystrokes":"","Copy selected content":"Copiar contenido seleccionado",Custom:"","Custom image size":"",Default:"Por defecto","Dim grey":"","Document colors":"Colores del documento","Drag to move":"","Dropdown toolbar":"","Edit block":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor dialog":"","Editor editing area: %0":"","Editor menu bar":"","Editor toolbar":"","Enter image caption":"","Entering %0 code snippet":"","Entering code snippet":"","Error during image upload":"","Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content.":"","Font Background Color":"Color de fondo de fuente","Font Color":"Color de fuente","Font Family":"Familia de fuente","Font Size":"Tamaño de fuente","Full size image":"",Green:"","Green marker":"Marcador verde","Green pen":"Pincel verde",Grey:"","Help Contents. To close this dialog press ESC.":"",HEX:"",Highlight:"Resaltar",Huge:"Enorme","Image from computer":"","Image resize list":"","Image toolbar":"","Image upload complete":"","image widget":"","In line":"",Insert:"Insertar","Insert code block":"Insertar bloque de código","Insert image":"","Insert image via URL":"",Italic:"Cursiva","Italic text":"Texto en cursiva",Justify:"Justificar","Leaving %0 code snippet":"","Leaving code snippet":"","Left aligned image":"","Light blue":"","Light green":"","Light grey":"",MENU_BAR_MENU_EDIT:"Editar",MENU_BAR_MENU_FILE:"",MENU_BAR_MENU_FONT:"",MENU_BAR_MENU_FORMAT:"",MENU_BAR_MENU_HELP:"",MENU_BAR_MENU_INSERT:"Insertar",MENU_BAR_MENU_TEXT:"",MENU_BAR_MENU_TOOLS:"",MENU_BAR_MENU_VIEW:"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus in and out of an active dialog window":"","Move focus to the menu bar, navigate between menu bars":"","Move focus to the toolbar, navigate between toolbars":"","Move out of an inline code style":"","Navigate through the toolbar or menu bar":"",Next:"","No results found":"","No searchable items":"","Open the accessibility help dialog":"",Orange:"",Original:"","Paste content":"Pegar contenido","Paste content as plain text":"Pegar contenido como texto plano","Pink marker":"Marcador rosa","Plain text":"Texto plano",'Please enter a valid color (e.g. "ff0000").':"","Press %0 for help.":"",Previous:"",Purple:"",Red:"","Red pen":"Pincel rojo","Remove color":"Quitar color","Remove highlight":"Quitar resaltado","Replace from computer":"","Replace image":"","Replace image from computer":"","Resize image":"","Resize image (in %0)":"","Resize image to %0":"","Resize image to the original size":"","Restore default":"Restaurar valores predeterminados","Rich Text Editor":"","Right aligned image":"",Save:"Guardar","Show more items":"Mostrar más elementos","Side image":"",Small:"Pequeña",Strikethrough:"Tachado","Strikethrough text":"",Subscript:"Subíndice",Superscript:"Superíndice","Text alignment":"Alineación de texto","Text alignment toolbar":"Herramientas de alineación de texto","Text alternative":"","Text highlight toolbar":"Herramientas de resaltado de texto","The value must not be empty.":"","The value should be a plain number.":"","These keyboard shortcuts allow for quick access to content editing features.":"",Tiny:"Diminuta","Toggle caption off":"","Toggle caption on":"",Turquoise:"",Underline:"Subrayado","Underline text":"",Update:"","Update image URL":"","Upload failed":"","Upload from computer":"","Upload image from computer":"","Upload in progress":"Carga en progreso","Uploading image":"","Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.":"","User interface and content navigation keystrokes":"",White:"","Wrap text":"",Yellow:"","Yellow marker":"Marcador amarillo"}),t.getPluralForm=function(e){return 1==e?0:0!=e&&e%1e6==0?1:2}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(e){const t=e.gu=e.gu||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"",Accept:"","Block quote":" વિચાર ટાંકો",Bold:"ઘાટુ - બોલ્ડ્","Bold text":"",Cancel:"",Clear:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"","Content editing keystrokes":"","Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content.":"",Italic:"ત્રાંસુ - ઇટલિક્","Italic text":"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus to the menu bar, navigate between menu bars":"","Move focus to the toolbar, navigate between toolbars":"","Move out of an inline code style":"","Navigate through the toolbar or menu bar":"","Open the accessibility help dialog":"","Remove color":"","Restore default":"",Save:"","Show more items":"",Strikethrough:"","Strikethrough text":"",Subscript:"",Superscript:"","These keyboard shortcuts allow for quick access to content editing features.":"","Toggle caption off":"","Toggle caption on":"",Underline:"નીચે લિટી - અન્ડરલાઇન્","Underline text":"","Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.":"","User interface and content navigation keystrokes":""}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(e){const t=e.hy=e.hy||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"",Accept:"","Align cell text to the bottom":"","Align cell text to the center":"","Align cell text to the left":"","Align cell text to the middle":"","Align cell text to the right":"","Align cell text to the top":"","Align table to the left":"","Align table to the right":"",Alignment:"",Background:"",Bold:"Թավագիր","Bold text":"",Border:"",Cancel:"Չեղարկել","Cell properties":"","Center table":"","Choose heading":"",Clear:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"Կոդ",Color:"","Color picker":"",Column:"Սյունակ","Content editing keystrokes":"","Create link":"",Dashed:"","Delete column":"","Delete row":"",Dimensions:"",Dotted:"",Double:"",Downloadable:"","Edit link":"Խմբագրել հղումը","Enter table caption":"","Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content.":"",Groove:"","Header column":"","Header row":"",Heading:"","Heading 1":"Վերնագիր 1","Heading 2":"Վերնագիր 2","Heading 3":"Վերնագիր 3","Heading 4":"","Heading 5":"","Heading 6":"",Height:"","Horizontal text alignment toolbar":"","Insert a new table row (when in the last cell of a table)":"","Insert column left":"","Insert column right":"","Insert row above":"","Insert row below":"","Insert table":"",Inset:"",Italic:"Շեղագիր","Italic text":"","Justify cell text":"","Keystrokes that can be used in a table cell":"",Link:"Հղում","Link image":"","Link URL":"","Link URL must not be empty.":"","Merge cell down":"","Merge cell left":"","Merge cell right":"","Merge cell up":"","Merge cells":"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus to the menu bar, navigate between menu bars":"","Move focus to the toolbar, navigate between toolbars":"","Move out of a link":"","Move out of an inline code style":"","Move the selection to the next cell":"","Move the selection to the previous cell":"","Navigate through the table":"","Navigate through the toolbar or menu bar":"",None:"","Open in a new tab":"","Open link in new tab":"","Open the accessibility help dialog":"",Outset:"",Padding:"",Paragraph:"","Remove color":"","Restore default":"",Ridge:"",Row:"",Save:"","Select column":"","Select row":"","Show more items":"",Solid:"","Split cell horizontally":"","Split cell vertically":"",Strikethrough:"Գծանշել","Strikethrough text":"",Style:"",Subscript:"Ենթատեքստ",Superscript:"Գերագիր",Table:"","Table alignment toolbar":"","Table cell text alignment":"","Table properties":"","Table toolbar":"",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':"",'The value is invalid. Try "10px" or "2em" or simply "2".':"","These keyboard shortcuts allow for quick access to content editing features.":"","This link has no URL":"","Toggle caption off":"","Toggle caption on":"","Type or paste your content here.":"","Type your title":"",Underline:"Ընդգծել","Underline text":"",Unlink:"","Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.":"","User interface and content navigation keystrokes":"","Vertical text alignment toolbar":"",Width:""}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(n){const t=n.kk=n.kk||{};t.dictionary=Object.assign(t.dictionary||{},{"Align center":"Ортадан туралау","Align left":"Солға туралау","Align right":"Оңға туралау",Justify:"","Text alignment":"Мәтінді туралау","Text alignment toolbar":"Мәтінді туралау құралдар тақтасы"}),t.getPluralForm=function(n){return 1!=n}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(e){const t=e.oc=e.oc||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"",Accept:"",Bold:"Gras","Bold text":"",Cancel:"Anullar",Clear:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"","Content editing keystrokes":"","Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content.":"",Italic:"Italica","Italic text":"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus to the menu bar, navigate between menu bars":"","Move focus to the toolbar, navigate between toolbars":"","Move out of an inline code style":"","Navigate through the toolbar or menu bar":"","Open the accessibility help dialog":"","Remove color":"","Restore default":"",Save:"Enregistrar","Show more items":"",Strikethrough:"","Strikethrough text":"",Subscript:"",Superscript:"","These keyboard shortcuts allow for quick access to content editing features.":"","Toggle caption off":"","Toggle caption on":"",Underline:"","Underline text":"","Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.":"","User interface and content navigation keystrokes":""}),t.getPluralForm=function(e){return e>1}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(e){const t=e.si=e.si||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"",Accept:"",Bold:"තදකුරු","Bold text":"","Break text":"","Bulleted List":"බුලටිත ලැයිස්තුව","Bulleted list styles toolbar":"",Cancel:"","Caption for image: %0":"","Caption for the image":"","Centered image":"","Change image text alternative":"",Circle:"",Clear:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"","Content editing keystrokes":"",Custom:"","Custom image size":"",Decimal:"","Decimal with leading zero":"","Decrease list item indent":"",Disc:"","Enter image caption":"","Entering a to-do list":"","Error during image upload":"","Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content.":"","Full size image":"","Image from computer":"","Image resize list":"","Image toolbar":"","Image upload complete":"","image widget":"","In line":"","Increase list item indent":"",Insert:"","Insert image":"පින්තූරය ඇතුල් කරන්න","Insert image via URL":"","Invalid start index value.":"",Italic:"ඇලකුරු","Italic text":"","Keystrokes that can be used in a list":"","Leaving a to-do list":"","Left aligned image":"","List properties":"","Lower-latin":"","Lowerroman":"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus to the menu bar, navigate between menu bars":"","Move focus to the toolbar, navigate between toolbars":"","Move out of an inline code style":"","Navigate through the toolbar or menu bar":"","Numbered List":"අංකිත ලැයිස්තුව","Numbered list styles toolbar":"","Open the accessibility help dialog":"",Original:"",Redo:"නැවත කරන්න","Remove color":"","Replace from computer":"","Replace image":"","Replace image from computer":"","Resize image":"","Resize image (in %0)":"","Resize image to %0":"","Resize image to the original size":"","Restore default":"","Reversed order":"","Right aligned image":"",Save:"","Show more items":"","Side image":"",Square:"","Start at":"","Start index must be greater than 0.":"",Strikethrough:"","Strikethrough text":"",Subscript:"",Superscript:"","Text alternative":"","The value must not be empty.":"","The value should be a plain number.":"","These keyboard shortcuts allow for quick access to content editing features.":"","To-do List":"","Toggle caption off":"","Toggle caption on":"","Toggle the circle list style":"","Toggle the decimal list style":"","Toggle the decimal with leading zero list style":"","Toggle the disc list style":"","Toggle the lowerlatin list style":"","Toggle the lowerroman list style":"","Toggle the square list style":"","Toggle the upperlatin list style":"","Toggle the upperroman list style":"",Underline:"","Underline text":"",Undo:"අහෝසි කරන්න",Update:"","Update image URL":"","Upload failed":"උඩුගත කිරීම අසාර්ථක විය","Upload from computer":"","Upload image from computer":"","Uploading image":"","Upper-latin":"","Upper-roman":"","Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.":"","User interface and content navigation keystrokes":"","Wrap text":""}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -1,61 +0,0 @@
{
"name": "ckeditor5-itop-build",
"author": "Combodo",
"description": "iTop CKEditor 5",
"version": "0.0.1",
"license": "SEE LICENSE IN LICENSE.md",
"private": true,
"main": "./build/ckeditor.js",
"types": "./build/ckeditor.d.ts",
"dependencies": {
"@ckeditor/ckeditor5-alignment": "~41.4",
"@ckeditor/ckeditor5-basic-styles": "~41.4",
"@ckeditor/ckeditor5-block-quote": "~41.4",
"@ckeditor/ckeditor5-ckbox": "~41.4",
"@ckeditor/ckeditor5-code-block": "~41.4",
"@ckeditor/ckeditor5-editor-classic": "~41.4",
"@ckeditor/ckeditor5-essentials": "~41.4",
"@ckeditor/ckeditor5-font": "~41.4",
"@ckeditor/ckeditor5-heading": "~41.4",
"@ckeditor/ckeditor5-highlight": "~41.4",
"@ckeditor/ckeditor5-horizontal-line": "~41.4",
"@ckeditor/ckeditor5-html-support": "~41.4",
"@ckeditor/ckeditor5-image": "~41.4",
"@ckeditor/ckeditor5-indent": "~41.4",
"@ckeditor/ckeditor5-link": "~41.4",
"@ckeditor/ckeditor5-list": "~41.4",
"@ckeditor/ckeditor5-mention": "~41.4",
"@ckeditor/ckeditor5-paragraph": "~41.4",
"@ckeditor/ckeditor5-paste-from-office": "~41.4",
"@ckeditor/ckeditor5-remove-format": "~41.4",
"@ckeditor/ckeditor5-source-editing": "~41.4",
"@ckeditor/ckeditor5-table": "~41.4",
"@ckeditor/ckeditor5-typing": "~41.4",
"@ckeditor/ckeditor5-ui": "~41.4",
"@ckeditor/ckeditor5-undo": "~41.4",
"ws": ">=7.5.10"
},
"devDependencies": {
"@ckeditor/ckeditor5-core": "~41.4",
"@ckeditor/ckeditor5-dev-translations": "~32.1",
"@ckeditor/ckeditor5-dev-utils": "~32.1",
"@ckeditor/ckeditor5-theme-lark": "~41.4",
"css-loader": "~5.2",
"mini-css-extract-plugin": "^2.9.0",
"postcss": "~8.4",
"postcss-loader": "~4.3",
"raw-loader": "~4.0",
"style-loader": "~2.0",
"terser-webpack-plugin": "~4.2",
"ts-loader": "~9.5",
"typescript": "~5.0",
"webpack": "~5.91",
"webpack-cli": "~4.10"
},
"scripts": {
"styles": "cp -r src/resources/styles/ build/styles",
"build": "webpack --mode production && npm run styles",
"dev": "webpack --mode development --watch && npm run styles",
"postbuild": "tsc --declaration --declarationDir build --stripInternal --emitDeclarationOnly"
}
}

View File

@@ -1,183 +0,0 @@
/**
* @license Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
* This file is licensed under the terms of the MIT License (see LICENSE.md).
*/
:root {
/* We are defining variables in case of missing comments plugin.
* See case 2: https://github.com/cksource/ckeditor5-online-builder/issues/80. */
--ck-user-avatar-background: hsl(210, 52%, 44%);
--ck-user-avatar-color: hsl(0, 0%, 100%);
}
* {
box-sizing: border-box;
}
body, html {
margin: 0;
}
#overlay {
font-family: Helvetica;
width: 100%;
height: 100%;
position: fixed;
top: 0;
bottom: 0;
left: 0;
background: #333;
display: flex;
flex-direction: column;
align-items: center;
padding: 4vh 4vw;
overflow: auto;
z-index: 9999;
}
#overlay.hidden {
display: none;
}
#overlay .body {
font-size: 14px;
width: 100%;
max-width: 800px;
background: white;
padding: 40px;
border-radius: 3px;
box-shadow: 0 0 15px 5px #000;
}
#overlay h2 {
margin-top: 0;
text-align: center;
}
#overlay p {
text-align: center;
margin-bottom: 1.5em;
width: 100%;
}
#overlay a {
color: hsl(219, 100%, 50%);
text-decoration: none;
}
#overlay a:hover {
text-decoration: underline;
}
#overlay .body>div {
display: flex;
align-items: center;
margin: 15px 0;
}
#overlay .body>div label {
width: 180px;
font-weight: bold;
}
#overlay .body>div input {
width: 100%;
padding: 8px;
font-size: 1em;
}
button#start {
display: block;
width: 100%;
max-width: 300px;
margin: 20px auto 0;
padding: 15px;
background: hsl(104, 44%, 48%);
color: white;
font-weight: bold;
border: 0;
border-radius: 3px;
font-size: 1em;
cursor: pointer;
transition: 250ms ease background;
}
button#start:hover {
background: hsl(104, 44%, 41%);
}
#overlay #additional {
display: none;
flex-wrap: wrap;
}
#overlay #additional.visible {
display: flex;
}
#overlay.warning #additional>p {
color: red;
}
#overlay.warning #user-container {
border-color: red;
}
#overlay #user-container {
width: 100%;
border: 1px solid hsl(0, 0%, 85%);
}
#overlay #user-container div {
display: flex;
cursor: pointer;
align-items: center;
height: 48px;
padding: 10px;
background: hsl(0, 0%, 97%);
transition: 250ms ease background;
}
#overlay #user-container div:nth-child( odd) {
background: #fff;
}
#overlay #user-container div:hover {
background: hsl(0, 0%, 92%);
}
#overlay #user-container div.active {
background: hsl(133, 50%, 84%);
}
#overlay #user-container img, #overlay #user-container .pseudo-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
border: 2px solid var(--ck-user-avatar-background);
margin-right: 10px;
background: var(--ck-user-avatar-color);
}
#overlay #user-container .pseudo-avatar {
font-size: 0.9em;
text-align: center;
line-height: 30px;
background: var(--ck-user-avatar-background);
color: var(--ck-user-avatar-color);
}
#overlay #user-container .pseudo-avatar.anonymous {
background-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2020%2020%22%3E%0A%20%20%3Cpath%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M9.8%2020H2c0-5.7%205-5.7%206-7l.2-.8c-1.6-.8-2.7-2.7-2.7-5%200-2.8%202-5.2%204.3-5.2S14%204.4%2014%207.3c0%202.2-1%204-2.6%205l.2.6c1.2%201.3%206%201.4%206%207H9.8z%22%2F%3E%0A%3C%2Fsvg%3E)
}
.role {
font-size: 11px;
border: 1px solid #3570aa;
border-radius: 4px;
color: #3570aa;
padding: 2px 5px;
margin-left: 10px;
font-weight: bold;
margin-top: 2px;
}

View File

@@ -1,65 +0,0 @@
/**
* @license Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
* This file is licensed under the terms of the MIT License (see LICENSE.md).
*/
/* eslint-env browser */
( function() {
const LOCAL_STORAGE_KEY = 'CKEDITOR_CS_CONFIG';
function createDialog() {
const overlay = document.createElement( 'div' );
overlay.id = 'overlay';
overlay.innerHTML = `
<form class="body">
<h2>Connect CKEditor5 Premium Features</h2>
<p>If you do not have CKEditor5 license key yet, <a href="https://ckeditor.com/docs/trial/latest/guides/overview.html" target="_blank">see the documentation</a>.</p>
<div>
<label for="license-key">CKEditor5 License Key</label>
<input id="license-key">
</div>
<h2>Connect CKBox</h2>
<div>
<label for="ckbox-token-url">CKBox token URL</label>
<input id="ckbox-token-url">
</div>
<button id="start" type="submit">Start</button>
</form>`;
document.body.appendChild( overlay );
const config = getStoredConfig();
const licenseKeyInput = document.getElementById( 'license-key' );
licenseKeyInput.value = config.licenseKey || '';
const ckboxTokenUrlInput = document.getElementById( 'ckbox-token-url' );
ckboxTokenUrlInput.value = config.ckboxTokenUrl || '';
return new Promise( resolve => {
overlay.querySelector( 'form' ).addEventListener( 'submit', event => {
event.preventDefault();
config.licenseKey = licenseKeyInput.value;
config.ckboxTokenUrl = ckboxTokenUrlInput.value;
overlay.remove();
storeConfig( config );
resolve( config );
} );
} );
}
function getStoredConfig() {
return JSON.parse( localStorage.getItem( LOCAL_STORAGE_KEY ) || '{}' );
}
function storeConfig( config ) {
localStorage.setItem( LOCAL_STORAGE_KEY, JSON.stringify( config ) );
}
window.createDialog = createDialog;
}() );

View File

@@ -1,110 +0,0 @@
<!DOCTYPE html><!--
Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
This file is licensed under the terms of the MIT License (see LICENSE.md).
-->
<html lang="en" dir="ltr">
<head>
<title>CKEditor 5 ClassicEditor build</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="https://c.cksource.com/a/1/logos/ckeditor5.png">
<link rel="stylesheet" type="text/css" href="styles.css">
<link href="configuration-dialog/configuration-dialog.css" rel="stylesheet" type="text/css">
</head>
<body data-editor="ClassicEditor" data-collaboration="false" data-revision-history="false">
<header>
<div class="centered">
<h1><a href="https://ckeditor.com/ckeditor-5/" target="_blank" rel="noopener noreferrer"><img src="https://c.cksource.com/a/1/logos/ckeditor5.svg" alt="CKEditor 5 logo">CKEditor 5</a></h1>
<nav>
<ul>
<li><a href="https://ckeditor.com/docs/ckeditor5/" target="_blank" rel="noopener noreferrer">Documentation</a></li>
<li><a href="https://ckeditor.com/" target="_blank" rel="noopener noreferrer">Website</a></li>
</ul>
</nav>
</div>
</header>
<div class="message">
<div class="centered">
<h2>CKEditor 5 online builder demo - ClassicEditor build</h2>
</div>
</div>
<div class="centered">
<div class="row row-editor">
<div class="editor-container">
<div class="editor">
<h2>Bilingual Personality Disorder</h2>
<figure class="image image-style-side"><img src="https://c.cksource.com/a/1/img/docs/sample-image-bilingual-personality-disorder.jpg">
<figcaption>One language, one person.</figcaption>
</figure>
<p>
This may be the first time you hear about this made-up disorder but
it actually isnt so far from the truth. Even the studies that were conducted almost half a century show that
<strong>the language you speak has more effects on you than you realize</strong>.
</p>
<p>
One of the very first experiments conducted on this topic dates back to 1964.
<a href="https://www.researchgate.net/publication/9440038_Language_and_TAT_content_in_bilinguals">In the experiment</a>
designed by linguist Ervin-Tripp who is an authority expert in psycholinguistic and sociolinguistic studies,
adults who are bilingual in English in French were showed series of pictures and were asked to create 3-minute stories.
In the end participants emphasized drastically different dynamics for stories in English and French.
</p>
<p>
Another ground-breaking experiment which included bilingual Japanese women married to American men in San Francisco were
asked to complete sentences. The goal of the experiment was to investigate whether or not human feelings and thoughts
are expressed differently in <strong>different language mindsets</strong>.
Here is a sample from the the experiment:
</p>
<table>
<thead>
<tr>
<th></th>
<th>English</th>
<th>Japanese</th>
</tr>
</thead>
<tbody>
<tr>
<td>Real friends should</td>
<td>Be very frank</td>
<td>Help each other</td>
</tr>
<tr>
<td>I will probably become</td>
<td>A teacher</td>
<td>A housewife</td>
</tr>
<tr>
<td>When there is a conflict with family</td>
<td>I do what I want</td>
<td>It's a time of great unhappiness</td>
</tr>
</tbody>
</table>
<p>
More recent <a href="https://books.google.pl/books?id=1LMhWGHGkRUC">studies</a> show, the language a person speaks affects
their cognition, behaviour, emotions and hence <strong>their personality</strong>.
This shouldnt come as a surprise
<a href="https://en.wikipedia.org/wiki/Lateralization_of_brain_function">since we already know</a> that different regions
of the brain become more active depending on the persons activity at hand. Since structure, information and especially
<strong>the culture</strong> of languages varies substantially and the language a person speaks is an essential element of daily life.
</p>
</div>
</div>
</div>
</div>
<footer>
<p><a href="https://ckeditor.com/ckeditor-5/" target="_blank" rel="noopener">CKEditor 5</a>
Rich text editor of tomorrow, available today
</p>
<p>Copyright © 2003-2024,
<a href="https://cksource.com/" target="_blank" rel="noopener">CKSource</a>
Holding sp. z o.o. All rights reserved.
</p>
</footer>
<script src="https://cdn.ckbox.io/CKBox/2.4.0/ckbox.js"></script>
<script src="../build/ckeditor.js"></script>
<script src="configuration-dialog/configuration-dialog.js"></script>
<script src="script.js"></script>
</body>
</html>

View File

@@ -1,25 +0,0 @@
createDialog().then( config => {
return ClassicEditor
.create( document.querySelector( '.editor' ), {
licenseKey: config.licenseKey,
ckbox: {
tokenUrl: config.ckboxTokenUrl
}
} )
.then( editor => {
window.editor = editor;
} )
.catch( handleSampleError );
} );
function handleSampleError( error ) {
const issueUrl = 'https://github.com/ckeditor/ckeditor5/issues';
const message = [
'Oops, something went wrong!',
`Please, report the following error on ${ issueUrl } with the build id "432vyqcgng9n-qwbrzeekei95" and the error stack trace:`
].join( '\n' );
console.error( message );
console.error( error );
}

View File

@@ -1,514 +0,0 @@
/**
* @license Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
* This file is licensed under the terms of the MIT License (see LICENSE.md).
*/
:root {
--ck-sample-base-spacing: 2em;
--ck-sample-color-white: #fff;
--ck-sample-color-green: #279863;
--ck-sample-color-blue: #1a9aef;
--ck-sample-container-width: 1285px;
--ck-sample-sidebar-width: 350px;
--ck-sample-editor-min-height: 400px;
--ck-sample-editor-z-index: 10;
}
/* --------- EDITOR STYLES ---------------------------------------------------------------------------------------- */
.editor__editable,
/* Classic build. */
main .ck-editor[role='application'] .ck.ck-content,
/* Decoupled document build. */
.ck.editor__editable[role='textbox'],
.ck.ck-editor__editable[role='textbox'],
/* Inline & Balloon build. */
.ck.editor[role='textbox'] {
width: 100%;
background: #fff;
font-size: 1em;
line-height: 1.6em;
min-height: var(--ck-sample-editor-min-height);
padding: 1.5em 2em;
}
.ck.ck-editor__editable {
background: #fff;
border: 1px solid hsl(0, 0%, 70%);
width: 100%;
}
/* Because of sidebar `position: relative`, Edge is overriding the outline of a focused editor. */
.ck.ck-editor__editable {
position: relative;
z-index: var(--ck-sample-editor-z-index);
}
.editor-container {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
position: relative;
width: 100%;
justify-content: center;
}
.editor-container--with-sidebar > .ck.ck-editor {
width: calc( 100% - var(--ck-sample-sidebar-width) );
}
/* --------- DECOUPLED (DOCUMENT) BUILD. ---------------------------------------------*/
body[data-editor='DecoupledEditor'] .document-editor__toolbar {
width: 100%;
}
body[data-editor='DecoupledEditor'] .collaboration-demo__editable,
body[data-editor='DecoupledEditor'] .row-editor .editor {
/* A pixel is added for each of the border. */
width: calc(21cm + 2px);
min-height: calc(29.7cm + 2px);
/* To avoid having extra scrolls inside the editor container. */
height: fit-content;
padding: 2cm 1.2cm;
margin: 2.5rem;
border: 1px hsl( 0, 0%, 82.7% ) solid;
background-color: var(--ck-sample-color-white);
box-shadow: 0 0 5px hsla( 0, 0%, 0%, .1 );
box-sizing: border-box;
}
body[data-editor='DecoupledEditor'] .row-editor {
display: flex;
position: relative;
justify-content: center;
overflow-y: auto;
background-color: #f2f2f2;
border: 1px solid hsl(0, 0%, 77%);
/* Limit the max-height of the editor to avoid scrolling from bottom to top to see the toolbar. */
max-height: 700px;
}
body[data-editor='DecoupledEditor'] .sidebar {
background: transparent;
border: 0;
box-shadow: none;
}
/* --------- COMMENTS & TRACK CHANGES FEATURE ---------------------------------------------------------------------- */
.sidebar {
padding: 0 15px;
position: relative;
min-width: var(--ck-sample-sidebar-width);
max-width: var(--ck-sample-sidebar-width);
font-size: 20px;
border: 1px solid hsl(0, 0%, 77%);
background: hsl(0, 0%, 98%);
border-left: 0;
overflow: hidden;
min-height: 100%;
flex-grow: 1;
}
/* Do not inherit styles related to the editable editor content. See line 25.*/
.sidebar .ck-content[role='textbox'],
.ck.ck-annotation-wrapper .ck-content[role='textbox'] {
min-height: unset;
width: unset;
padding: 0;
background: transparent;
}
.sidebar.narrow {
min-width: 60px;
flex-grow: 0;
}
.sidebar.hidden {
display: none !important;
}
#sidebar-display-toggle {
position: absolute;
z-index: 1;
width: 30px;
height: 30px;
text-align: center;
left: 15px;
top: 30px;
border: 0;
padding: 0;
color: hsl( 0, 0%, 50% );
transition: 250ms ease color;
background-color: transparent;
}
#sidebar-display-toggle:hover {
color: hsl( 0, 0%, 30% );
cursor: pointer;
}
#sidebar-display-toggle:focus,
#sidebar-display-toggle:active {
outline: none;
border: 1px solid #a9d29d;
}
#sidebar-display-toggle svg {
fill: currentColor;
}
/* --------- COLLABORATION FEATURES (USERS) ------------------------------------------------------------------------ */
.row-presence {
width: 100%;
border: 1px solid hsl(0, 0%, 77%);
border-bottom: 0;
background: hsl(0, 0%, 98%);
padding: var(--ck-spacing-small);
/* Make `border-bottom` as `box-shadow` to not overlap with the editor border. */
box-shadow: 0 1px 0 0 hsl(0, 0%, 77%);
/* Make `z-index` bigger than `.editor` to properly display tooltips. */
z-index: 20;
}
.ck.ck-presence-list {
flex: 1;
padding: 1.25rem .75rem;
}
.presence .ck.ck-presence-list__counter {
order: 2;
margin-left: var(--ck-spacing-large)
}
/* --------- REAL TIME COLLABORATION FEATURES (SHARE TOPBAR CONTAINER) --------------------------------------------- */
.collaboration-demo__row {
display: flex;
position: relative;
justify-content: center;
overflow-y: auto;
background-color: #f2f2f2;
border: 1px solid hsl(0, 0%, 77%);
}
body[data-editor='InlineEditor'] .collaboration-demo__row {
border: 0;
}
.collaboration-demo__container {
max-width: var(--ck-sample-container-width);
margin: 0 auto;
padding: 1.25rem;
}
.presence, .collaboration-demo__row {
transition: .2s opacity;
}
.collaboration-demo__topbar {
background: #fff;
border: 1px solid var(--ck-color-toolbar-border);
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 0;
border-radius: 4px 4px 0 0;
}
.collaboration-demo__topbar .btn {
margin-right: 1em;
outline-offset: 2px;
outline-width: 2px;
background-color: var( --ck-sample-color-blue );
}
.collaboration-demo__topbar .btn:focus,
.collaboration-demo__topbar .btn:hover {
border-color: var( --ck-sample-color-blue );
}
.collaboration-demo__share {
display: flex;
align-items: center;
padding: 1.25rem .75rem
}
.collaboration-demo__share-description p {
margin: 0;
font-weight: bold;
font-size: 0.9em;
}
.collaboration-demo__share input {
height: auto;
font-size: 0.9em;
min-width: 220px;
margin: 0 10px;
border-radius: 4px;
border: 1px solid var(--ck-color-toolbar-border)
}
.collaboration-demo__share button,
.collaboration-demo__share input {
height: 40px;
padding: 5px 10px;
}
.collaboration-demo__share button {
position: relative;
}
.collaboration-demo__share button:focus {
outline: none;
}
.collaboration-demo__share button[data-tooltip]::before,
.collaboration-demo__share button[data-tooltip]::after {
position: absolute;
visibility: hidden;
opacity: 0;
pointer-events: none;
transition: all .15s cubic-bezier(.5,1,.25,1);
z-index: 1;
}
.collaboration-demo__share button[data-tooltip]::before {
content: attr(data-tooltip);
padding: 5px 15px;
border-radius: 3px;
background: #111;
color: #fff;
text-align: center;
font-size: 11px;
top: 100%;
left: 50%;
margin-top: 5px;
transform: translateX(-50%);
}
.collaboration-demo__share button[data-tooltip]::after {
content: '';
border: 5px solid transparent;
width: 0;
font-size: 0;
line-height: 0;
top: 100%;
left: 50%;
transform: translateX(-50%);
border-bottom: 5px solid #111;
border-top: none;
}
.collaboration-demo__share button[data-tooltip]:hover:before,
.collaboration-demo__share button[data-tooltip]:hover:after {
visibility: visible;
opacity: 1;
}
.collaboration-demo--ready {
overflow: visible;
height: auto;
}
.collaboration-demo--ready .presence,
.collaboration-demo--ready .collaboration-demo__row {
opacity: 1;
}
/* --------- PAGINATION FEATURE ------------------------------------------------------------------------------------ */
/* Pagination view line must be stacked at least at the same level as the editor,
otherwise it will be hidden underneath. */
.ck.ck-pagination-view-line {
z-index: var(--ck-sample-editor-z-index);
}
/* --------- REVISION HISTORY FEATURE ------------------------------------------------------------------------------ */
.revision-viewer-container {
display: none;
max-width: 100%;
word-wrap: break-word;
}
.revision-viewer-sidebar {
position: relative;
min-width: 310px;
overflow: hidden;
background: var(--ck-color-toolbar-background);
border: 1px solid var(--ck-color-toolbar-border);
margin-left: -1px;
}
/* A case when Pagination and Revision History features are enabled in the editor. */
/* Move the square with page number from the Pagination plugin to the left side, so that it does not cover the RH sidebar. */
body[data-revision-history='true'] .ck.ck-pagination-view-line::after {
transform: translateX(-100%) !important;
left: -1px !important;
right: unset !important;
}
/* --------- DOCUMENT OUTLINE FEATURE ------------------------------------------------------------------------------ */
.document-outline-container {
max-height: 80vh;
overflow-y: auto;
margin-bottom: 1em;
}
.document-outline-container .ck.ck-document-outline {
min-height: 100%;
border: 1px solid var(--ck-color-base-border);
background-color: hsl(0, 0%, 96%);
}
/* --------- SAMPLE GENERIC STYLES (not related to CKEditor) ------------------------------------------------------- */
body, html {
padding: 0;
margin: 0;
font-family: sans-serif, Arial, Verdana, "Trebuchet MS", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 16px;
line-height: 1.5;
}
body {
height: 100%;
color: #2D3A4A;
}
body * {
box-sizing: border-box;
}
a {
color: #38A5EE;
}
header .centered {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
min-height: 8em;
}
header h1 a {
font-size: 20px;
display: flex;
align-items: center;
color: #2D3A4A;
text-decoration: none;
}
header h1 img {
display: block;
height: 64px;
}
header nav ul {
margin: 0;
padding: 0;
list-style-type: none;
}
header nav ul li {
display: inline-block;
}
header nav ul li + li {
margin-left: 1em;
}
header nav ul li a {
font-weight: bold;
text-decoration: none;
color: #2D3A4A;
}
header nav ul li a:hover {
text-decoration: underline;
}
main .message {
padding: 0 0 var(--ck-sample-base-spacing);
background: var(--ck-sample-color-green);
color: var(--ck-sample-color-white);
}
main .message::after {
content: "";
z-index: -1;
display: block;
height: 10em;
width: 100%;
background: var(--ck-sample-color-green);
position: absolute;
left: 0;
}
main .message h2 {
position: relative;
padding-top: 1em;
font-size: 2em;
}
.centered {
max-width: var(--ck-sample-container-width);
margin: 0 auto;
padding: 0 var(--ck-sample-base-spacing);
}
.row {
display: flex;
position: relative;
}
.btn {
cursor: pointer;
padding: 8px 16px;
font-size: 1rem;
user-select: none;
border-radius: 4px;
transition: color .2s ease-in-out,background-color .2s ease-in-out,border-color .2s ease-in-out,opacity .2s ease-in-out;
background-color: var(--ck-sample-color-button-blue);
border-color: var(--ck-sample-color-button-blue);
color: var(--ck-sample-color-white);
display: inline-block;
}
.btn--tiny {
padding: 6px 12px;
font-size: .8rem;
}
footer {
margin: calc(2*var(--ck-sample-base-spacing)) var(--ck-sample-base-spacing);
font-size: .8em;
text-align: center;
color: rgba(0,0,0,.4);
}
/* --------- RWD --------------------------------------------------------------------------------------------------- */
@media screen and ( max-width: 800px ) {
:root {
--ck-sample-base-spacing: 1em;
}
header h1 {
width: 100%;
}
header h1 img {
height: 40px;
}
header nav ul {
text-align: right;
}
main .message h2 {
font-size: 1.5em;
}
}

View File

@@ -1,114 +0,0 @@
/**
* @license Copyright (c) 2014-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor.js';
import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat.js';
import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote.js';
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold.js';
import CKFinder from '@ckeditor/ckeditor5-ckfinder/src/ckfinder.js';
import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js';
import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices.js';
import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock.js';
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials.js';
import Heading from '@ckeditor/ckeditor5-heading/src/heading.js';
import HorizontalLine from '@ckeditor/ckeditor5-horizontal-line/src/horizontalline.js';
import Image from '@ckeditor/ckeditor5-image/src/image.js';
import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption.js';
import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle.js';
import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar.js';
import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload.js';
import Indent from '@ckeditor/ckeditor5-indent/src/indent.js';
import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic.js';
import Link from '@ckeditor/ckeditor5-link/src/link.js';
import List from '@ckeditor/ckeditor5-list/src/list.js';
import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed.js';
import Mention from '@ckeditor/ckeditor5-mention/src/mention.js';
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph.js';
import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js';
import Table from '@ckeditor/ckeditor5-table/src/table.js';
import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar.js';
import TextTransformation from '@ckeditor/ckeditor5-typing/src/texttransformation.js';
import FullScreen from '@pikulinpw/ckeditor5-fullscreen';
// change scss variables
import './console.css';
class Editor extends ClassicEditor {}
// Plugins to include in the build.
Editor.builtinPlugins = [
Autoformat,
BlockQuote,
Bold,
CKFinder,
CKFinderUploadAdapter,
CloudServices,
CodeBlock,
Essentials,
Heading,
HorizontalLine,
Image,
ImageCaption,
ImageStyle,
ImageToolbar,
ImageUpload,
Indent,
Italic,
Link,
List,
MediaEmbed,
Mention,
Paragraph,
PasteFromOffice,
Table,
TableToolbar,
TextTransformation
];
// Editor configuration.
Editor.defaultConfig = {
toolbar: {
items: [
'redo',
'|',
'undo',
'link',
'imageUpload',
'|',
'bulletedList',
'numberedList',
'blockQuote',
'codeBlock',
'insertTable',
'mediaEmbed',
'-',
'heading',
'bold',
'italic',
'|',
'outdent',
'indent',
'horizontalLine'
],
shouldNotGroupWhenFull: true
},
language: 'en',
image: {
toolbar: [
'imageTextAlternative',
'imageStyle:inline',
'imageStyle:block',
'imageStyle:side'
]
},
table: {
contentToolbar: [
'tableColumn',
'tableRow',
'mergeTableCells'
]
}
};
export default Editor;

View File

@@ -1,350 +0,0 @@
/**
* @license Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic';
import { Alignment } from '@ckeditor/ckeditor5-alignment';
import {
Bold,
Italic,
Strikethrough,
Subscript,
Superscript,
Underline
} from '@ckeditor/ckeditor5-basic-styles';
import { BlockQuote } from '@ckeditor/ckeditor5-block-quote';
import { CodeBlock } from '@ckeditor/ckeditor5-code-block';
import type { EditorConfig } from '@ckeditor/ckeditor5-core';
import { Essentials } from '@ckeditor/ckeditor5-essentials';
import { FontBackgroundColor, FontColor, FontFamily, FontSize } from '@ckeditor/ckeditor5-font';
import { Heading, Title } from '@ckeditor/ckeditor5-heading';
import { Highlight } from '@ckeditor/ckeditor5-highlight';
import { HorizontalLine } from '@ckeditor/ckeditor5-horizontal-line';
import { GeneralHtmlSupport } from '@ckeditor/ckeditor5-html-support';
import {
Image,
ImageCaption,
ImageResize,
ImageStyle,
ImageToolbar,
ImageUpload,
PictureEditing
} from '@ckeditor/ckeditor5-image';
import { Indent, IndentBlock } from '@ckeditor/ckeditor5-indent';
import { AutoLink, Link, LinkImage } from '@ckeditor/ckeditor5-link';
import { List, ListProperties } from '@ckeditor/ckeditor5-list';
import { Mention } from '@ckeditor/ckeditor5-mention';
import { Paragraph } from '@ckeditor/ckeditor5-paragraph';
import {PasteFromOffice} from "@ckeditor/ckeditor5-paste-from-office";
import {
Table,
TableCaption,
TableCellProperties,
TableColumnResize,
TableProperties,
TableToolbar
} from '@ckeditor/ckeditor5-table';
import { Undo } from '@ckeditor/ckeditor5-undo';
import { RemoveFormat } from '@ckeditor/ckeditor5-remove-format';
import { SourceEditing } from '@ckeditor/ckeditor5-source-editing';
// Combodo plugins
import AppendITopClasses from "./plugins/append-itop-classes/append-itop-classes.plugin";
import KeyboardShortcut from "./plugins/keyboard-shortcut/keyboard-shortcut.plugin";
import MentionsMarkup from "./plugins/mentions-markup/mentions-markup.plugin";
import TriggerUpdateOnReady from "./plugins/trigger-update-on-ready/trigger-update-on-ready.plugin";
import Maximize from './plugins/maximize/maximize.plugin';
import ObjectShortcut from './plugins/object-shortcut/object-shortcut.plugin';
import DetectChanges from "./plugins/detect-change/detect-change.plugin";
import UpdateInputOnChange from "./plugins/update-input-on-change/update-input-on-change.plugin";
import Disabler from "./plugins/disabler/disabler.plugin";
import InsertHtml from './plugins/insert-html/insert-html.plugin';
import InsertCarriageReturnAfterBlock from "./plugins/insert-carriage-return-after-block/insert-carriage-return-after-block.plugin";
// You can read more about extending the build with additional plugins in the "Installing plugins" guide.
// See https://ckeditor.com/docs/ckeditor5/latest/installation/plugins/installing-plugins.html for details.
// iTop default theme
import './resources/styles/default-theme.css';
const transformationsConfig = {
// Remove the 'ellipsis' transformation loaded by the 'typography' group.
remove: [ 'ellipsis' ]
}
// Colors to be used in the different palettes (font color, table cell background color, table cell border color, ...)
const colorsPalette = [
{
color: '#000000',
label: 'Black'
},
{
color: '#4D4D4D',
label: 'Dim grey'
},
{
color: '#999999',
label: 'Grey'
},
{
color: '#E6E6E6',
label: 'Light grey'
},
{
color: '#FFFFFF',
label: 'White'
},
{
color: '#E64D4D',
label: 'Red'
},
{
color: '#E6994D',
label: 'Orange'
},
{
color: '#E6E64D',
label: 'Yellow'
},
{
color: '#99E64D',
label: 'Light green'
},
{
color: '#4DE64D',
label: 'Green'
},
{
color: '#4DE699',
label: 'Aquamarine'
},
{
color: '#4DE6E6',
label: 'Turquoise'
},
{
color: '#4D99E6',
label: 'Light blue'
},
{
color: '#4D4DE6',
label: 'Blue'
},
{
color: '#994DE6',
label: 'Purple'
},
];
class Editor extends ClassicEditor {
public static override builtinPlugins = [
Alignment,
AutoLink,
BlockQuote,
Bold,
CodeBlock,
Essentials,
FontBackgroundColor,
FontColor,
FontFamily,
FontSize,
GeneralHtmlSupport,
Heading,
Highlight,
HorizontalLine,
Image,
ImageCaption,
ImageResize,
ImageStyle,
ImageToolbar,
ImageUpload,
Indent,
IndentBlock,
Italic,
Link,
List,
Mention,
Paragraph,
PasteFromOffice,
Strikethrough,
Table,
TableCaption,
TableCellProperties,
TableColumnResize,
TableProperties,
TableToolbar,
Underline,
Undo,
RemoveFormat,
SourceEditing,
// combodo plugins
AppendITopClasses,
KeyboardShortcut,
MentionsMarkup,
TriggerUpdateOnReady,
Maximize,
// ObjectShortcut, // wait a clean implementation before adding it (mentions plugin allow this feature)
InsertHtml,
DetectChanges,
UpdateInputOnChange,
Disabler,
InsertCarriageReturnAfterBlock
];
// default configuration editor
public static override defaultConfig: EditorConfig = {
toolbar: {
items: [
'maximize',
'|',
'undo',
'redo',
'|',
'heading',
'|',
'alignment',
'|',
{
label: 'Fonts',
icon: 'text',
items: ['fontfamily', 'fontSize', 'fontColor']
},
'|',
'bold',
'italic',
'underline',
'highlight' ,
{
label: 'More styles',
items: ['strikethrough', 'RemoveFormat']
},
'|',
'horizontalLine',
'link',
'imageUpload',
'codeBlock',
'bulletedList',
'numberedList',
'insertTable',
'|',
'SourceEditing',
],
shouldNotGroupWhenFull: true
},
language: 'en',
fontColor: {
// Colors are redefined to be in HEX instead of RGB in order to be supported by mail clients
colors: colorsPalette,
},
image: {
toolbar: [
'resizeImage:25',
'resizeImage:50',
'resizeImage:original',
'|',
'toggleImageCaption',
],
resizeOptions: [
{
name: 'resizeImage:original',
value: null,
icon: 'original'
},
{
name: 'resizeImage:25',
value: '25',
icon: 'small'
},
{
name: 'resizeImage:50',
value: '50',
icon: 'medium'
},
],
},
table: {
contentToolbar: [
'tableColumn',
'tableRow',
'mergeTableCells',
'|',
'tableCellProperties',
'tableProperties',
'|',
'toggleTableCaption'
],
tableCellProperties: {
borderColors: colorsPalette,
backgroundColors: colorsPalette,
},
},
htmlSupport: {
allow: [
{
name: /.*/,
attributes: true,
classes: true,
styles: true
}
]
},
link: {
defaultProtocol: 'http://'
},
highlight: {
options: [
{ model: 'yellowMarker', class: 'marker-yellow', title: 'Yellow marker', color: '#FDFD77', type: 'marker' },
{ model: 'greenMarker', class: 'marker-green', title: 'Green marker', color: '#62f962', type: 'marker' },
{ model: 'pinkMarker', class: 'marker-pink', title: 'Pink marker', color: '#FC7899', type: 'marker' },
{ model: 'blueMarker', class: 'marker-blue', title: 'Blue marker', color: '#72CCFD', type: 'marker' },
]
},
codeBlock: {
// Languages defined here are only the values of the dropdown list
// It needs to be aligned with languages imports for highlight.js in the code-blocks-highlight-js.plugin.ts
languages: [
{language: 'plaintext', label: 'Plain text'}, // Default
{language: 'abap', label: 'ABAP'},
{language: 'apache', label: 'Apache'},
{language: 'bash', label: 'Bash'},
{language: 'cs', label: 'C#'},
{language: 'cpp', label: 'C++'},
{language: 'css', label: 'CSS'},
{language: 'ciscocli', label: 'Cisco CLI'},
{language: 'coffeescript', label: 'CoffeeScript'},
{language: 'curl', label: 'cURL'},
{language: 'diff', label: 'Diff'},
{language: 'dnszonefile', label: 'DNS Zone File'},
{language: 'html', label: 'HTML'},
{language: 'http', label: 'HTTP'},
{language: 'ini', label: 'Ini'},
{language: 'json', label: 'JSON'},
{language: 'java', label: 'Java'},
{language: 'javascript', label: 'JavaScript'},
{language: 'makefile', label: 'Makefile'},
{language: 'markdown', label: 'Markdown'},
{language: 'nginx', label: 'Nginx'},
{language: 'objectivec', label: 'Objective C'},
{language: 'php', label: 'PHP'},
{language: 'perl', label: 'Perl'},
{language: 'python', label: 'Python'},
{language: 'ruby', label: 'Ruby'},
{language: 'rust', label: 'Rust'},
{language: 'scss', label: 'SCSS'},
{language: 'sql', label: 'SQL'},
{language: 'toml', label: 'TOML'},
{language: 'twig', label: 'TWIG'},
{language: 'typescript', label: 'TypeScript'},
{language: 'vba', label: 'VBA'},
{language: 'vbscript', label: 'VBScript'},
{language: 'xml', label: 'XML'},
{language: 'yaml', label: 'YAML'}
]
},
};
}
export default Editor;

View File

@@ -1,34 +0,0 @@
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
/**
* AppendITopClasses Plugin.
*
* Appends ibo-is-html-content (backoffice) & ipb-is-html-content (portal) classes
*/
export default class AppendITopClasses extends Plugin {
static get pluginName() {
return 'AppendITopClasses';
}
init() {
// retrieve editor instance
const oEditor = this.editor;
// appends ibo-is-html-content (backoffice) & ipb-is-html-content (portal) classes
oEditor.editing.view.change( oWriter => {
const oRootElement = oEditor.editing.view.document.getRoot();
if(oRootElement !== null){
// Add the proper class depending on the GUI we are in
const sGUIType = document.body.getAttribute('data-gui-type');
if (sGUIType === 'backoffice') {
oWriter.addClass( 'ibo-is-html-content', oRootElement);
} else if (sGUIType === 'portal') {
oWriter.addClass('ipb-is-html-content', oRootElement);
}
}
});
}
}

View File

@@ -1,41 +0,0 @@
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
import iTopDataProcessor from "./itop-data-processor";
import InsertCarriageReturnAfterBlock from "../insert-carriage-return-after-block/insert-carriage-return-after-block.plugin";
/**
* DetectChanges Plugin.
*
*/
export default class DetectChanges extends Plugin {
private readonly _processor: iTopDataProcessor | undefined;
constructor( editor: Editor ) {
super( editor );
const sInitialValue:string = editor.config.get('detectChanges.initialValue') as string;
// If the initial value is not set or empty, we don't need to do anything
if( !sInitialValue || sInitialValue === '') {
return;
}
// Initialize our own data processor
const oProcessor = new iTopDataProcessor( editor.data.viewDocument, sInitialValue, editor.getData() ) as iTopDataProcessor;
editor.data.processor = oProcessor;
this._processor = oProcessor;
}
init() {
const editor = this.editor;// Listen for the dataReady event only once
editor.model.document.once('change:data', () => {
if(this._processor ) {
this._processor.setTransformedInitialValue(editor.getData());
}
});
}
static get pluginName() {
return 'DetectChanges';
}
// Needed as InsertCarriageReturnAfterBlock will possibly change data on initialization if there's a block in the content, so we need to make sure it's loaded first
static get requires() {
return [ InsertCarriageReturnAfterBlock ];
}
}

View File

@@ -1,44 +0,0 @@
import {HtmlDataProcessor,
type ViewDocument,
type ViewDocumentFragment
} from 'ckeditor5/src/engine.js';
export default class iTopDataProcessor extends HtmlDataProcessor {
/**
* HTML data processor used to process HTML if we detect changes
* @private
*/
private _htmlDP: HtmlDataProcessor;
/**
* Initial value of the editor, we'll return it if we don't detect any changes
* @private
*/
private readonly _initialValue: string;
/**
* Transformed initial value of the editor, we'll use it to detect changes
* @private
*/
private _transformedInitialValue: string;
/**
* Creates a new instance of the Markdown data processor class.
*/
constructor( document: ViewDocument, initialValue: string, transformedInitialValue: string) {
super( document );
this._htmlDP = new HtmlDataProcessor( document );
this._initialValue = initialValue;
// It'll probably be empty on the first call, we'll set it later
this._transformedInitialValue = transformedInitialValue;
}
setTransformedInitialValue( transformedInitialValue: string ) {
this._transformedInitialValue = transformedInitialValue;
}
override toData( viewFragment: ViewDocumentFragment ): string {
const html = this._htmlDP.toData( viewFragment );
if( html === this._transformedInitialValue ) {
return this._initialValue;
}
return html;
}
}

View File

@@ -1,55 +0,0 @@
import { Plugin } from '@ckeditor/ckeditor5-core';
import {ClassicEditor} from "@ckeditor/ckeditor5-editor-classic";
export default class Disabler extends Plugin {
static get pluginName() {
return 'Disabler';
}
init() {
// retrieve editor instance
const oEditor:ClassicEditor = this.editor as ClassicEditor;
// perform disabling when editor ui is ready
oEditor.ui.on('ready', () => {
Disabler.processDisabling(oEditor, oInputElement);
});
// perform disabling when input is updated
const oInputElement = oEditor.sourceElement as HTMLInputElement;
// @ts-ignore
$('#' + oInputElement.id).on('update', function(){
Disabler.processDisabling(oEditor, oInputElement);
});
}
/**
* Process ckeditor disabling.
*
* @param oEditor
* @param oInputElement
*/
static processDisabling(oEditor:ClassicEditor, oInputElement:HTMLInputElement){
// @ts-ignore
const oElement = $(oEditor.ui.element);
if(typeof oElement.block === 'function') {
if (oInputElement.disabled) {
oElement.block({message: '', blockMsgClass: '', enableValidation : true, baseZ: 9999, overlayCSS: { backgroundColor: '#ccd6e066'}});
} else {
oElement.unblock();
}
}
// handle ckeditor read only mode
if(oInputElement.disabled){
oEditor.enableReadOnlyMode('ibo');
}
else{
oEditor.disableReadOnlyMode('ibo');
}
}
}

View File

@@ -1,41 +0,0 @@
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import Node from '@ckeditor/ckeditor5-engine/src/model/node';
export default class InsertCarriageReturnAfterBlock extends Plugin {
init() {
const editor = this.editor;
// Array of block elements type to check for
const blockElements = ['codeBlock', 'div', 'pre'];
// This function checks if the inserted element is one of the block elements we want a newline after
const isBlockElement = (node: Node | null) => {
return node ? blockElements.some(element => node.is('element', element)) : false;
};
// Listen to changes in the model
editor.model.document.on('change:data', (evt, batch) => {
if (batch.isLocal) {
const changes = Array.from(editor.model.document.differ.getChanges());
const currentCursorPosition = editor.model.document.selection.getFirstPosition();
// Iterate over the changes and insert a newline after the block element when needed
changes.forEach(change => {
if (change.type === 'insert' && isBlockElement(change.position.nodeAfter)) {
editor.model.change(writer => {
const position = change.position.getShiftedBy(change.length);
// Insert a newline after the block element
editor.execute( 'insertParagraph', {
position: position,
} );
});
}
});
// Restore the cursor position (most likely in the created block)
editor.model.change(writer => {
writer.setSelection(currentCursorPosition);
});
}
});
}
}

View File

@@ -1,13 +0,0 @@
import { Command } from 'ckeditor5/src/core';
/**
* InsertHtmlCommand Command.
*
*/
export default class InsertHtmlCommand extends Command {
override execute( sContent:string ) {
this.editor.setData(this.editor.getData() + sContent);
}
}

View File

@@ -1,23 +0,0 @@
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import InsertHtmlCommand from "./insert-html.command";
/**
* InsertHtml Plugin.
*
*/
export default class InsertHtml extends Plugin {
static get pluginName() {
return 'InsertHtmlContent';
}
init() {
// retrieve editor instance
const oEditor = this.editor;
// appends ibo-is-html-content class
oEditor.commands.add( 'insert-html', new InsertHtmlCommand(oEditor) );
}
}

View File

@@ -1,30 +0,0 @@
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
/**
* KeyboardShortcut Plugin.
*
* - Dispatch submit event on the closest editor form when Ctrl+Enter pressed
*/
export default class KeyboardShortcut extends Plugin {
static get pluginName() {
return 'KeyboardShortcut';
}
init() {
// retrieve editor instance
const oEditor = this.editor;
// Dispatch submit event on the closest editor form when Ctrl+Enter pressed
oEditor.keystrokes.set('Ctrl+Enter', (data, stop) => {
if (oEditor.ui.element !== null) {
const oForm = oEditor.ui.element.closest('form');
if (oForm !== null) {
const oEvent = new Event("submit");
oForm.dispatchEvent(oEvent);
}
}
});
}
};

View File

@@ -1,110 +0,0 @@
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
// plugin icons
const sMaximizeIconSVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M448 344v112a23.9 23.9 0 0 1 -24 24H312c-21.4' +
' 0-32.1-25.9-17-41l36.2-36.2L224 295.6 116.8 402.9 153 439c15.1 15.1 4.4 41-17 41H24a23.9 23.9 0 0 1 -24-24V344c0-21.4 25.9-32.1 41-17l36.2 36.2L184.5 256 77.2 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.9 23.9 0 0 1 24-24h112c21.4 0 32.1 25.9 17 41l-36.2 36.2L224 216.4l107.2-107.3L295 73c-15.1-15.1-4.4-41 17-41h112a23.9 23.9 0 0 1 24 24v112c0 21.4-25.9 32.1-41 17l-36.2-36.2L263.5 256l107.3 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"/></svg>';
const sMinimizeIconSVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M200 288H88c-21.4 0-32.1 25.8-17 41l32.9 31-99.2' +
' 99.3c-6.2 6.2-6.2 16.4 0 22.6l25.4 25.4c6.2 6.2 16.4 6.2 22.6 0L152 408l31.1 33c15.1 15.1 40.9 4.4 40.9-17V312c0-13.3-10.7-24-24-24zm112-64h112c21.4 0 32.1-25.9 17-41l-33-31 99.3-99.3c6.2-6.2 6.2-16.4 0-22.6L481.9 4.7c-6.2-6.2-16.4-6.2-22.6 0L360 104l-31.1-33C313.8 55.9 288 66.6 288 88v112c0 13.3 10.7 24 24 24zm96 136l33-31.1c15.1-15.1 4.4-40.9-17-40.9H312c-13.3 0-24 10.7-24 24v112c0 21.4 25.9 32.1 41 17l31-32.9 99.3 99.3c6.2 6.2 16.4 6.2 22.6 0l25.4-25.4c6.2-6.2 6.2-16.4 0-22.6L408 360zM183 71.1L152 104 52.7 4.7c-6.2-6.2-16.4-6.2-22.6 0L4.7 30.1c-6.2 6.2-6.2 16.4 0 22.6L104 152l-33 31.1C55.9 198.2 66.6 224 88 224h112c13.3 0 24-10.7 24-24V88c0-21.3-25.9-32-41-16.9z"/></svg>';
export default class Maximize extends Plugin {
static get pluginName() {
return 'Maximize';
}
init() {
// retrieve editor instance
const oEditor = this.editor;
// add maximize button
oEditor.ui.componentFactory.add('maximize', () => {
// button
const oButton = new ButtonView();
oButton.set({
icon: sMaximizeIconSVG,
isToggleable: true
});
this.listenTo(oButton, 'execute', () => {
if (oEditor.ui.element !== null) {
if (oButton.isOn) {
// remove classes
document.documentElement.classList.remove('ck-maximize_html_editor')
document.body.classList.remove('ck-maximize_body_editor')
let oParentElement: HTMLElement = oEditor.ui.element;
while (oParentElement.parentElement !== null) {
oParentElement = oParentElement.parentElement;
oParentElement.classList.remove('ck-maximize_parent_editor');
}
oEditor.ui.element.classList.remove('ck-maximize_editor');
oEditor.ui.element.children[2].classList.remove('ck-maximize_editor_main');
oButton.icon = sMaximizeIconSVG;
} else {
// add classes to make editor full screen
document.documentElement.classList.add('ck-maximize_html_editor')
document.body.classList.add('ck-maximize_body_editor')
let oParentElement: HTMLElement = oEditor.ui.element;
while (oParentElement.parentElement !== null) {
oParentElement = oParentElement.parentElement;
oParentElement.classList.add('ck-maximize_parent_editor');
}
oEditor.ui.element.classList.add('ck-maximize_editor');
oEditor.ui.element.children[2].classList.add('ck-maximize_editor_main');
let oStyle = document.createElement('style');
// CSS rules definitions for each classes
oStyle.innerHTML = `
.ck-maximize_editor_main > * {
height: 100% !important;
width: 100% !important;
}
.ck-maximize_editor_main {
flex-grow: 1;
display: flex;
flex-direction: column;
}
.ck-maximize_parent_editor {
position: fixed !important;
overflow: visible !important;
z-index: 1050 !important;
margin: 0 !important;
}
.ck-maximize_body_editor {
width: 0 !important;
height: 0 !important;
overflow: hidden !important;
}
.ck-maximize_html_editor {
position: fixed !important;
width: 0 !important;
height: 0 !important;
}
.ck-maximize_editor {
position: fixed !important;
top: 0 !important;
left: 0 !important;
margin: 0 !important;
padding: 0 !important;
width: 100vw !important;
height: 100vh !important;
overflow: auto !important;
z-index: 1050 !important;
display: flex;
flex-direction: column;
}`;
document.head.appendChild(oStyle);
oButton.icon = sMinimizeIconSVG;
}
// setfocus on editor (else focus remains on the button)
oEditor.editing.view.focus()
oButton.isOn = !oButton.isOn;
}
});
return oButton;
});
}
}

View File

@@ -1,69 +0,0 @@
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import {Element} from "@ckeditor/ckeditor5-engine";
/**
* MentionsMarkup Plugin.
*
* - Converter for mentions
*/
export default class MentionsMarkup extends Plugin {
static get pluginName() {
return 'MentionsMarkup';
}
init() {
// retrieve editor instance
const oEditor = this.editor;
// convert view > model
oEditor.conversion.for('upcast').elementToAttribute({
view: {
name: 'a',
attributes: {
href: true,
'data-role': true,
'data-object-class': true,
'data-object-id': true
}
},
model: {
key: 'mention',
value: (oViewItem: Element) => {
return oEditor.plugins.get( 'Mention' ).toMentionAttribute( oViewItem, {
link: oViewItem.getAttribute( 'href' ),
id: oViewItem.getAttribute( 'data-object-id' ),
class_name: oViewItem.getAttribute( 'data-object-class' ),
mention: 'object-mention',
} );
}
},
converterPriority: 'high'
} );
// convert model > view
oEditor.conversion.for( 'downcast' ).attributeToElement( {
model: 'mention',
view: ( oModelAttributeValue, { writer } ) => {
// Do not convert empty attributes (lack of value means no mention).
if ( !oModelAttributeValue ) {
return;
}
return writer.createAttributeElement( 'a', {
'data-role' : 'object-mention',
'data-object-class' : oModelAttributeValue.class_name,
'data-object-id' : oModelAttributeValue.id,
'href': oModelAttributeValue.link
}, {
priority: 20,
id: oModelAttributeValue.uid
} );
},
converterPriority: 'high'
} );
}
}

View File

@@ -1,92 +0,0 @@
/**
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/
import {
View,
LabeledFieldView,
createLabeledInputText,
ButtonView,
submitHandler,
} from '@ckeditor/ckeditor5-ui';
import { icons } from '@ckeditor/ckeditor5-core';
import{ Locale } from '@ckeditor/ckeditor5-utils';
export default class FormView extends View {
// input fields
oLabelInputView: LabeledFieldView;
oClassInputView: LabeledFieldView;
oReferenceInputView: LabeledFieldView;
// buttons
oSaveButtonView: ButtonView;
oCancelButtonView: ButtonView;
// child views
oChildViews: any;
constructor( oLocale: Locale ) {
super( oLocale );
// save button
this.oSaveButtonView = this._createButton( 'Save', icons.check, 'ck-button-save' );
this.oSaveButtonView.type = 'submit';
// cancel button
this.oCancelButtonView = this._createButton( 'Cancel', icons.cancel, 'ck-button-cancel' );
this.oCancelButtonView.delegate( 'execute' ).to( this, 'cancel' );
// create input fields
this.oLabelInputView = this._createInput( 'Label' );
this.oClassInputView = this._createInput( 'Object Class' );
this.oReferenceInputView = this._createInput( 'Object Reference' );
this.oChildViews = this.createCollection( [
this.oLabelInputView,
this.oClassInputView,
this.oReferenceInputView,
this.oSaveButtonView,
this.oCancelButtonView
] );
this.setTemplate( {
tag: 'form',
attributes: {
class: [ 'ck', 'ck-object-shortcut-form' ],
tabindex: '-1'
},
children: this.oChildViews
} );
}
override render() {
super.render();
// Submit the form when the user clicked the save button or pressed enter in the input.
submitHandler( {
view: this
} );
}
focus() {
this.oChildViews.first.focus();
}
_createInput( sLabel: string ) {
const oLabeledInput = new LabeledFieldView( this.locale, createLabeledInputText );
oLabeledInput.label = sLabel;
return oLabeledInput;
}
_createButton( sLabel: string, sIcon: string, sClassName: string ) {
const oButton = new ButtonView();
oButton.set( {
label: sLabel,
icon: sIcon,
tooltip: true,
class: sClassName
} );
return oButton;
}
}

View File

@@ -1,8 +0,0 @@
import { Plugin } from '@ckeditor/ckeditor5-core';
import ObjectShortcutUI from './object-shortcut.ui';
export default class ObjectShortcut extends Plugin {
static get requires() {
return [ObjectShortcutUI];
}
}

View File

@@ -1,144 +0,0 @@
import { Plugin } from '@ckeditor/ckeditor5-core';
import {ButtonView, ContextualBalloon, clickOutsideHandler} from '@ckeditor/ckeditor5-ui';
import FormView from './object-shortcut.form-view';
import './styles.css';
// plugin icon
const sPluginIconSVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48' +
' 48' +
' 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-32 252c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92H92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"/></svg>';
export default class ObjectShortcutUI extends Plugin {
static get requires() {
return [ ContextualBalloon ];
}
oBalloon: ContextualBalloon | undefined;
oFormView: FormView | undefined;
init() {
const editor = this.editor;
// Create the balloon and the form view.
this.oBalloon = this.editor.plugins.get( ContextualBalloon );
this.oFormView = this._createFormView();
editor.ui.componentFactory.add( 'object-shortcut', () => {
const oButton = new ButtonView();
oButton.label = editor.config.get('objectShortcut.buttonLabel') as string ?? 'Insert Object Shortcut';
oButton.tooltip = true;
oButton.icon = sPluginIconSVG;
// Show the UI on button click.
this.listenTo( oButton, 'execute', () => {
this._showUI();
} );
return oButton;
} );
}
_createFormView() {
const oEditor = this.editor;
const oFormView = new FormView( oEditor.locale );
// Execute the command after clicking the "Save" button.
this.listenTo( oFormView, 'submit', () => {
// Grab values from the abbreviation and title input fields.
let sLabel = '';
const oLabelElement = <HTMLInputElement>oFormView.oLabelInputView.fieldView.element;
if(oLabelElement !== null) {
sLabel = oLabelElement.value;
}
let sObjectClass = 'object class';
const oClassElement = <HTMLInputElement>oFormView.oClassInputView.fieldView.element;
if(oClassElement !== null) {
sObjectClass = oClassElement.value;
}
let sObjectReference = 'object reference';
const oReferenceElement = <HTMLInputElement>oFormView.oReferenceInputView.fieldView.element;
if(oReferenceElement !== null) {
sObjectReference = oReferenceElement.value;
}
oEditor.model.change( writer => {
const sText = `[[${sObjectClass}:${sObjectReference}${sLabel !== '' ? '|' + sLabel : ''}]]`;
oEditor.model.insertContent(writer.createText(sText));
} );
// Hide the form view after submit.
this._hideUI();
} );
// Hide the form view after clicking the "Cancel" button.
this.listenTo(oFormView, 'cancel', () => {
this._hideUI();
} );
const oBalloon = this.oBalloon;
if(oBalloon !== undefined && oBalloon.view.element !== null){
// Hide the form view when clicking outside the balloon.
clickOutsideHandler( {
emitter: oFormView,
activator: () => oBalloon.visibleView === oFormView,
contextElements: [ oBalloon.view.element ],
callback: () => this._hideUI()
} );
}
return oFormView;
}
_showUI() {
// show balloon
const pos = this._getBalloonPositionData();
if(this.oBalloon !== undefined && this.oFormView !== undefined && pos !== null && pos.oTarget !== null){
this.oBalloon.add( {
view: this.oFormView,
position: {
target: pos.oTarget
}
} );
}
// focus form view
if(this.oFormView !== undefined){
this.oFormView.focus();
}
}
_hideUI() {
if( this.oFormView !== undefined && this.oBalloon !== undefined){
if( this.oFormView.element !== null){
(<HTMLFormElement>this.oFormView.element).reset();
}
// remove balloon
this.oBalloon.remove( this.oFormView );
// Focus the editing view
this.editor.editing.view.focus();
}
}
_getBalloonPositionData(){
const oView = this.editor.editing.view;
const oViewDocument = oView.document;
let oTarget = null;
const oFirstRange = oViewDocument.selection.getFirstRange();
if(oFirstRange !== null) {
oTarget = () => oView.domConverter.viewRangeToDom(oFirstRange);
}
return {
oTarget
};
}
}

View File

@@ -1,28 +0,0 @@
.ck.ck-object-shortcut-form {
padding: var(--ck-spacing-large);
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: repeat(4, 1fr);
grid-column-gap: 0px;
grid-row-gap: var(--ck-spacing-standard);
}
.ck.ck-object-shortcut-form .ck.ck-labeled-field-view:nth-of-type(1) {
grid-area: 1 / 1 / 2 / 3;
}
.ck.ck-object-shortcut-form .ck.ck-labeled-field-view:nth-of-type(2) {
grid-area: 2 / 1 / 3 / 3;
}
.ck.ck-object-shortcut-form .ck.ck-labeled-field-view:nth-of-type(3) {
grid-area: 3 / 1 / 4 / 3;
}
.ck.ck-object-shortcut-form .ck-button:nth-of-type(1) {
grid-area: 4 / 1 / 5 / 2;
}
.ck.ck-object-shortcut-form .ck-button:nth-of-type(2) {
grid-area: 4 / 2 / 5 / 3;
}

View File

@@ -1,32 +0,0 @@
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
/**
* TriggerUpdateOnReady Plugin.
*
* - Trigger update event when editor is ready
*/
export default class TriggerUpdateOnReady extends Plugin {
static get pluginName() {
return 'TriggerUpdateOnReady';
}
init() {
// retrieve editor instance
const oEditor = this.editor;
// trigger update event when editor is ready
oEditor.ui.on('ready', () => {
if (oEditor.ui.element !== null) {
const oEvent = new Event("update");
oEditor.ui.element.dispatchEvent(oEvent);
}
for (const oElement of document.getElementsByClassName('ck-body-wrapper')) {
oElement.classList.add('ck-reset_all-excluded');
}
});
}
}

Some files were not shown because too many files have changed in this diff Show More