├── .gitignore ├── README.md ├── ckeditor ├── ckeditor.js ├── ckeditor.js.map └── translations │ ├── af.js │ ├── ar.js │ ├── ast.js │ ├── az.js │ ├── bg.js │ ├── bn.js │ ├── bs.js │ ├── ca.js │ ├── cs.js │ ├── da.js │ ├── de-ch.js │ ├── de.js │ ├── el.js │ ├── en-au.js │ ├── en-gb.js │ ├── eo.js │ ├── es-co.js │ ├── es.js │ ├── et.js │ ├── eu.js │ ├── fa.js │ ├── fi.js │ ├── fr.js │ ├── gl.js │ ├── gu.js │ ├── he.js │ ├── hi.js │ ├── hr.js │ ├── hu.js │ ├── hy.js │ ├── id.js │ ├── it.js │ ├── ja.js │ ├── jv.js │ ├── kk.js │ ├── km.js │ ├── kn.js │ ├── ko.js │ ├── ku.js │ ├── lt.js │ ├── lv.js │ ├── ms.js │ ├── nb.js │ ├── ne.js │ ├── nl.js │ ├── no.js │ ├── oc.js │ ├── pl.js │ ├── pt-br.js │ ├── pt.js │ ├── ro.js │ ├── ru.js │ ├── si.js │ ├── sk.js │ ├── sl.js │ ├── sq.js │ ├── sr-latn.js │ ├── sr.js │ ├── sv.js │ ├── th.js │ ├── ti.js │ ├── tk.js │ ├── tr.js │ ├── tt.js │ ├── ug.js │ ├── uk.js │ ├── ur.js │ ├── uz.js │ ├── vi.js │ ├── zh-cn.js │ └── zh.js ├── ckeditor5 ├── .gitignore ├── LICENSE.md ├── README.md ├── build │ └── ckeditor.d.ts ├── package-lock.json ├── package.json ├── sample │ ├── index.html │ ├── script.js │ └── styles.css ├── src │ └── ckeditor.ts ├── tsconfig.json ├── tsconfig.types.json └── webpack.config.js ├── composer.json ├── h5peditor-ajax.class.php ├── h5peditor-ajax.interface.php ├── h5peditor-file.class.php ├── h5peditor-storage.interface.php ├── h5peditor.class.php ├── images ├── add.png ├── binary-file.png ├── collapse.png ├── cropper │ ├── cancel.svg │ ├── confirm.svg │ ├── crop.svg │ ├── rotate-left.svg │ └── rotate-right.svg ├── down.png ├── expand.png ├── order.png ├── remove.png ├── transparent-background.png └── webm-file.png ├── language ├── ar.js ├── bs.js ├── cs.js ├── de.js ├── el.js ├── en.js ├── es-cr.js ├── es-mx.js ├── es.js ├── et.js ├── eu.js ├── fi.js ├── fr.js ├── gl.js ├── it.js ├── ko.js ├── nb.js ├── nl.js ├── nn.js ├── pl.js ├── pt-br.js ├── pt.js ├── ru.js ├── sl.js ├── sv.js ├── tr.js ├── zh-cn.js ├── zh-hans.js └── zh.js ├── libs ├── cropper.css ├── cropper.js └── zebra_datepicker.min.js ├── package-lock.json ├── package.json ├── scripts ├── h5p-hub-client.js ├── h5peditor-av.js ├── h5peditor-boolean.js ├── h5peditor-coordinates.js ├── h5peditor-dimensions.js ├── h5peditor-editor.js ├── h5peditor-file-uploader.js ├── h5peditor-file.js ├── h5peditor-form.js ├── h5peditor-fullscreen-bar.js ├── h5peditor-group.js ├── h5peditor-html.js ├── h5peditor-image-popup.js ├── h5peditor-image.js ├── h5peditor-init.js ├── h5peditor-library-list-cache.js ├── h5peditor-library-selector.js ├── h5peditor-library.js ├── h5peditor-list-editor.js ├── h5peditor-list.js ├── h5peditor-metadata-author-widget.js ├── h5peditor-metadata-changelog-widget.js ├── h5peditor-metadata.js ├── h5peditor-none.js ├── h5peditor-number.js ├── h5peditor-pre-save.js ├── h5peditor-select.js ├── h5peditor-selector-hub.js ├── h5peditor-selector-legacy.js ├── h5peditor-semantic-structure.js ├── h5peditor-text.js ├── h5peditor-textarea.js └── h5peditor.js ├── styles ├── css │ ├── a1aff8c82bc779d09357.png │ ├── ae8568c2320881fd5899.png │ ├── application.css │ ├── cke-contents.css │ ├── fonts.css │ ├── fonts │ │ ├── h5p-fullscreen-bar.eot │ │ ├── h5p-fullscreen-bar.svg │ │ ├── h5p-fullscreen-bar.ttf │ │ ├── h5p-fullscreen-bar.woff │ │ ├── h5p-hub.eot │ │ ├── h5p-hub.svg │ │ ├── h5p-hub.ttf │ │ ├── h5p-hub.woff │ │ ├── h5p-metadata-icons.eot │ │ ├── h5p-metadata-icons.svg │ │ ├── h5p-metadata-icons.ttf │ │ └── h5p-metadata-icons.woff │ ├── h5p-hub-client.css │ └── libs │ │ ├── icons.png │ │ └── zebra_datepicker.min.css └── scss │ ├── _copy-paste.scss │ ├── _deprecated.scss │ ├── _form-field.scss │ ├── _form-groups.scss │ ├── _fullscreen-bar.scss │ ├── _h5peditor-image-edit-popup.scss │ ├── _h5peditor-image-edit.scss │ ├── _metadata-author-widget.scss │ ├── _metadata-changelog-widget.scss │ ├── _metadata-form.scss │ ├── _metadata-popup.scss │ ├── _mixins.scss │ ├── _tutorial-and-example-links.scss │ ├── _utils.scss │ ├── _variables.scss │ ├── application.scss │ └── cke-contents.scss └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .sass-cache 3 | /styles/nbproject/private/ 4 | vendor 5 | .idea 6 | node_modules/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | H5P Editor PHP Library 2 | ========== 3 | 4 | A general library that is supposed to be used in most PHP implementations of H5P. 5 | 6 | ## License 7 | 8 | All code is licensed under MIT License 9 | 10 | Open Sans font is licensed under Apache license, Version 2.0 11 | 12 | ## Compiling scss to css 13 | 14 | You first need to install ruby and compass: 15 | - `sudo apt update` 16 | - `sudo apt install ruby-full` 17 | - `sudo apt install build-essential` 18 | - `sudo gem install compass` 19 | 20 | Then cd to `h5p-editor-php-library/styles` and compile the scss files: 21 | - `compass watch` to continuely compile changes 22 | - or `compass clean && compass compile` to delete the css files and compile new ones 23 | -------------------------------------------------------------------------------- /ckeditor/translations/af.js: -------------------------------------------------------------------------------- 1 | !function(e){const t=e.af=e.af||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require Fn)":"","%0 of %1":"%0 van %1",Accept:"",Accessibility:"","Accessibility help":"","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 center":"Belyn in die middel","Align left":"Belyn links","Align right":"Belyn regs","Align table to the left":"","Align table to the right":"",Alignment:"",Aquamarine:"",Background:"","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"",Big:"",Black:"","Block quote":"Verwysingsaanhaling",Blue:"","Blue marker":"",Bold:"Vet","Bold text":"",Border:"","Break text":"","Bulleted List":"","Bulleted list styles toolbar":"",Cancel:"Kanselleer","Caption for image: %0":"","Caption for the image":"","Cell properties":"","Center table":"","Centered image":"","Change image text alternative":"","Choose heading":"",Circle:"",Clear:"","Click to edit block":"",Close:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"Bronkode","Code block":"",Color:"","Color picker":"",Column:"","Content editing keystrokes":"","Copy selected content":"","Create link":"",Custom:"","Custom image size":"",Dashed:"",Decimal:"","Decimal with leading zero":"","Decrease indent":"","Decrease list item indent":"",Default:"","Delete column":"","Delete row":"","Dim grey":"",Dimensions:"",Disc:"","Document colors":"",Dotted:"",Double:"",Downloadable:"","Drag to move":"","Dropdown menu":"","Dropdown toolbar":"","Edit block":"","Edit link":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor dialog":"","Editor menu bar":"","Editor toolbar":"","Enter image caption":"","Enter table caption":"","Entering %0 code snippet":"","Entering a to-do list":"","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":"","Font Color":"","Font Family":"","Font Size":"","From computer":"","Full size image":"",Green:"","Green marker":"","Green pen":"",Grey:"",Groove:"","Header column":"","Header row":"",Heading:"","Heading 1":"","Heading 2":"","Heading 3":"","Heading 4":"","Heading 5":"","Heading 6":"",Height:"","Help Contents. To close this dialog press ESC.":"",HEX:"",Highlight:"","Horizontal line":"","Horizontal text alignment toolbar":"","HTML object":"",Huge:"",Image:"","Image from computer":"","Image resize list":"","Image toolbar":"","Image upload complete":"","Image via URL":"","image widget":"","In line":"","Increase indent":"","Increase list item indent":"","Insert a hard break (a new paragraph)":"","Insert a new paragraph directly after a widget":"","Insert a new paragraph directly before a widget":"","Insert a new table row (when in the last cell of a table)":"","Insert a soft break (a <br> element)":"","Insert code block":"Voeg bronkodeblok in","Insert column left":"","Insert column right":"","Insert image":"","Insert image via URL":"","Insert media":"","Insert paragraph after block":"","Insert paragraph before block":"","Insert row above":"","Insert row below":"","Insert table":"","Insert via URL":"",Inset:"","Invalid start index value.":"",Italic:"Kursief","Italic text":"",Justify:"Belyn beide kante","Justify cell text":"","Keystrokes that can be used in a list":"","Keystrokes that can be used in a table cell":"","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"","Leaving %0 code snippet":"","Leaving a to-do list":"","Leaving code snippet":"","Left aligned image":"","Light blue":"","Light green":"","Light grey":"",Link:"","Link image":"","Link URL":"","Link URL must not be empty.":"","List properties":"","Lower-latin":"","Lower–roman":"",Media:"","Media toolbar":"","Media URL":"","media widget":"",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:"","Merge cell down":"","Merge cell left":"","Merge cell right":"","Merge cell up":"","Merge cells":"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus from an editable area back to the parent widget":"","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":"","Move the caret to allow typing directly after a widget":"","Move the caret to allow typing directly before a widget":"","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":"",Next:"","No results found":"","No searchable items":"",None:"","Numbered List":"","Numbered list styles toolbar":"","Open in a new tab":"","Open link in new tab":"","Open media in new tab":"","Open the accessibility help dialog":"",Orange:"",Original:"",Outset:"",Padding:"",Paragraph:"","Paste content":"","Paste content as plain text":"","Paste the media URL in the input.":"","Pink marker":"","Plain text":"Gewone skrif",'Please enter a valid color (e.g. "ff0000").':"","Press %0 for help.":"","Press Enter to type after or press Shift + Enter to type before the widget":"",Previous:"",Purple:"",Red:"","Red pen":"",Redo:"","Remove color":"Verwyder kleur","Remove Format":"Verwyder formatering","Remove highlight":"","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":"Herstel verstek","Reversed order":"","Revert autoformatting action":"","Rich Text Editor":"","Rich Text Editor. Editing area: %0":"",Ridge:"","Right aligned image":"",Row:"",Save:"Stoor","Select all":"","Select column":"","Select row":"","Show more items":"Wys meer items","Side image":"",Small:"",Solid:"","Split cell horizontally":"","Split cell vertically":"",Square:"","Start at":"","Start index must be greater than 0.":"",Strikethrough:"Deurstreep","Strikethrough text":"",Style:"",Subscript:"Onderskrif",Superscript:"Boskrif",Table:"","Table alignment toolbar":"","Table cell text alignment":"","Table properties":"","Table toolbar":"","Text alignment":"Teksbelyning","Text alignment toolbar":"Teksbelyning nutsbank","Text alternative":"","Text highlight toolbar":"",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':"","The URL must not be empty.":"",'The value is invalid. Try "10px" or "2em" or simply "2".':"","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":"","This media URL is not supported.":"",Tiny:"","Tip: Paste the URL into the content to embed faster.":"","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 lower–latin list style":"","Toggle the lower–roman list style":"","Toggle the square list style":"","Toggle the upper–latin list style":"","Toggle the upper–roman list style":"",Turquoise:"","Type or paste your content here.":"","Type your title":"",Underline:"Onderstreep","Underline text":"",Undo:"",Unlink:"","Update image URL":"","Upload failed":"","Upload from computer":"","Upload image from computer":"","Upload in progress":"","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":"","Vertical text alignment toolbar":"","Via URL":"",White:"","Widget toolbar":"",Width:"","Wrap text":"",Yellow:"","Yellow marker":"","You have no image upload permissions.":""}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); -------------------------------------------------------------------------------- /ckeditor/translations/ast.js: -------------------------------------------------------------------------------- 1 | !function(e){const t=e.ast=e.ast||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require Fn)":"","%0 of %1":"",Accept:"",Accessibility:"","Accessibility help":"","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 center":"","Align left":"","Align right":"","Align table to the left":"","Align table to the right":"",Alignment:"",Aquamarine:"",Background:"","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"",Big:"",Black:"","Block quote":"",Blue:"","Blue marker":"",Bold:"Negrina","Bold text":"",Border:"","Break text":"","Bulleted List":"Llista con viñetes","Bulleted list styles toolbar":"",Cancel:"Encaboxar","Caption for image: %0":"","Caption for the image":"","Cell properties":"","Center table":"","Centered image":"","Change image text alternative":"","Choose heading":"",Circle:"",Clear:"","Click to edit block":"",Close:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"","Code block":"",Color:"","Color picker":"",Column:"","Content editing keystrokes":"","Copy selected content":"","Create link":"",Custom:"","Custom image size":"",Dashed:"",Decimal:"","Decimal with leading zero":"","Decrease indent":"","Decrease list item indent":"",Default:"","Delete column":"","Delete row":"","Dim grey":"",Dimensions:"",Disc:"","Document colors":"",Dotted:"",Double:"",Downloadable:"","Drag to move":"","Dropdown menu":"","Dropdown toolbar":"","Edit block":"","Edit link":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor dialog":"","Editor menu bar":"","Editor toolbar":"","Enter image caption":"","Enter table caption":"","Entering %0 code snippet":"","Entering a to-do list":"","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":"","Font Color":"","Font Family":"","Font Size":"","From computer":"","Full size image":"Imaxen a tamañu completu",Green:"","Green marker":"","Green pen":"",Grey:"",Groove:"","Header column":"","Header row":"",Heading:"","Heading 1":"","Heading 2":"","Heading 3":"","Heading 4":"","Heading 5":"","Heading 6":"",Height:"","Help Contents. To close this dialog press ESC.":"",HEX:"",Highlight:"","Horizontal line":"","Horizontal text alignment toolbar":"","HTML object":"",Huge:"",Image:"","Image from computer":"","Image resize list":"","Image toolbar":"","Image upload complete":"","Image via URL":"","image widget":"complementu d'imaxen","In line":"","Increase indent":"","Increase list item indent":"","Insert a hard break (a new paragraph)":"","Insert a new paragraph directly after a widget":"","Insert a new paragraph directly before a widget":"","Insert a new table row (when in the last cell of a table)":"","Insert a soft break (a <br> element)":"","Insert code block":"","Insert column left":"","Insert column right":"","Insert image":"","Insert image via URL":"","Insert media":"","Insert paragraph after block":"","Insert paragraph before block":"","Insert row above":"","Insert row below":"","Insert table":"","Insert via URL":"",Inset:"","Invalid start index value.":"",Italic:"Cursiva","Italic text":"",Justify:"","Justify cell text":"","Keystrokes that can be used in a list":"","Keystrokes that can be used in a table cell":"","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"","Leaving %0 code snippet":"","Leaving a to-do list":"","Leaving code snippet":"","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":"","Lower–roman":"",Media:"","Media toolbar":"","Media URL":"","media widget":"",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:"","Merge cell down":"","Merge cell left":"","Merge cell right":"","Merge cell up":"","Merge cells":"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus from an editable area back to the parent widget":"","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":"","Move the caret to allow typing directly after a widget":"","Move the caret to allow typing directly before a widget":"","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":"",Next:"","No results found":"","No searchable items":"",None:"","Numbered List":"Llista numberada","Numbered list styles toolbar":"","Open in a new tab":"","Open link in new tab":"","Open media in new tab":"","Open the accessibility help dialog":"",Orange:"",Original:"",Outset:"",Padding:"",Paragraph:"","Paste content":"","Paste content as plain text":"","Paste the media URL in the input.":"","Pink marker":"","Plain text":"",'Please enter a valid color (e.g. "ff0000").':"","Press %0 for help.":"","Press Enter to type after or press Shift + Enter to type before the widget":"",Previous:"",Purple:"",Red:"","Red pen":"",Redo:"Refacer","Remove color":"","Remove Format":"","Remove highlight":"","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":"","Revert autoformatting action":"","Rich Text Editor":"Editor de testu arriquecíu","Rich Text Editor. Editing area: %0":"",Ridge:"","Right aligned image":"",Row:"",Save:"Guardar","Select all":"","Select column":"","Select row":"","Show more items":"","Side image":"Imaxen llateral",Small:"",Solid:"","Split cell horizontally":"","Split cell vertically":"",Square:"","Start at":"","Start index must be greater than 0.":"",Strikethrough:"","Strikethrough text":"",Style:"",Subscript:"",Superscript:"",Table:"","Table alignment toolbar":"","Table cell text alignment":"","Table properties":"","Table toolbar":"","Text alignment":"","Text alignment toolbar":"","Text alternative":"","Text highlight toolbar":"",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':"","The URL must not be empty.":"",'The value is invalid. Try "10px" or "2em" or simply "2".':"","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":"","This media URL is not supported.":"",Tiny:"","Tip: Paste the URL into the content to embed faster.":"","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 lower–latin list style":"","Toggle the lower–roman list style":"","Toggle the square list style":"","Toggle the upper–latin list style":"","Toggle the upper–roman list style":"",Turquoise:"","Type or paste your content here.":"","Type your title":"",Underline:"","Underline text":"",Undo:"Desfacer",Unlink:"Desenllazar","Update image URL":"","Upload failed":"","Upload from computer":"","Upload image from computer":"","Upload in progress":"","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":"","Vertical text alignment toolbar":"","Via URL":"",White:"","Widget toolbar":"",Width:"","Wrap text":"",Yellow:"","Yellow marker":"","You have no image upload permissions.":""}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); -------------------------------------------------------------------------------- /ckeditor/translations/gu.js: -------------------------------------------------------------------------------- 1 | !function(e){const t=e.gu=e.gu||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require Fn)":"","%0 of %1":"",Accept:"",Accessibility:"","Accessibility help":"","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 center":"","Align left":"","Align right":"","Align table to the left":"","Align table to the right":"",Alignment:"",Aquamarine:"",Background:"","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"",Big:"",Black:"","Block quote":" વિચાર ટાંકો",Blue:"","Blue marker":"",Bold:"ઘાટુ - બોલ્ડ્","Bold text":"",Border:"","Break text":"","Bulleted List":"","Bulleted list styles toolbar":"",Cancel:"","Caption for image: %0":"","Caption for the image":"","Cell properties":"","Center table":"","Centered image":"","Change image text alternative":"","Choose heading":"",Circle:"",Clear:"","Click to edit block":"",Close:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"","Code block":"",Color:"","Color picker":"",Column:"","Content editing keystrokes":"","Copy selected content":"","Create link":"",Custom:"","Custom image size":"",Dashed:"",Decimal:"","Decimal with leading zero":"","Decrease indent":"","Decrease list item indent":"",Default:"","Delete column":"","Delete row":"","Dim grey":"",Dimensions:"",Disc:"","Document colors":"",Dotted:"",Double:"",Downloadable:"","Drag to move":"","Dropdown menu":"","Dropdown toolbar":"","Edit block":"","Edit link":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor dialog":"","Editor menu bar":"","Editor toolbar":"","Enter image caption":"","Enter table caption":"","Entering %0 code snippet":"","Entering a to-do list":"","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":"","Font Color":"","Font Family":"","Font Size":"","From computer":"","Full size image":"",Green:"","Green marker":"","Green pen":"",Grey:"",Groove:"","Header column":"","Header row":"",Heading:"","Heading 1":"","Heading 2":"","Heading 3":"","Heading 4":"","Heading 5":"","Heading 6":"",Height:"","Help Contents. To close this dialog press ESC.":"",HEX:"",Highlight:"","Horizontal line":"","Horizontal text alignment toolbar":"","HTML object":"",Huge:"",Image:"","Image from computer":"","Image resize list":"","Image toolbar":"","Image upload complete":"","Image via URL":"","image widget":"","In line":"","Increase indent":"","Increase list item indent":"","Insert a hard break (a new paragraph)":"","Insert a new paragraph directly after a widget":"","Insert a new paragraph directly before a widget":"","Insert a new table row (when in the last cell of a table)":"","Insert a soft break (a <br> element)":"","Insert code block":"","Insert column left":"","Insert column right":"","Insert image":"","Insert image via URL":"","Insert media":"","Insert paragraph after block":"","Insert paragraph before block":"","Insert row above":"","Insert row below":"","Insert table":"","Insert via URL":"",Inset:"","Invalid start index value.":"",Italic:"ત્રાંસુ - ઇટલિક્","Italic text":"",Justify:"","Justify cell text":"","Keystrokes that can be used in a list":"","Keystrokes that can be used in a table cell":"","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"","Leaving %0 code snippet":"","Leaving a to-do list":"","Leaving code snippet":"","Left aligned image":"","Light blue":"","Light green":"","Light grey":"",Link:"","Link image":"","Link URL":"","Link URL must not be empty.":"","List properties":"","Lower-latin":"","Lower–roman":"",Media:"","Media toolbar":"","Media URL":"","media widget":"",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:"","Merge cell down":"","Merge cell left":"","Merge cell right":"","Merge cell up":"","Merge cells":"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus from an editable area back to the parent widget":"","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":"","Move the caret to allow typing directly after a widget":"","Move the caret to allow typing directly before a widget":"","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":"",Next:"","No results found":"","No searchable items":"",None:"","Numbered List":"","Numbered list styles toolbar":"","Open in a new tab":"","Open link in new tab":"","Open media in new tab":"","Open the accessibility help dialog":"",Orange:"",Original:"",Outset:"",Padding:"",Paragraph:"","Paste content":"","Paste content as plain text":"","Paste the media URL in the input.":"","Pink marker":"","Plain text":"",'Please enter a valid color (e.g. "ff0000").':"","Press %0 for help.":"","Press Enter to type after or press Shift + Enter to type before the widget":"",Previous:"",Purple:"",Red:"","Red pen":"",Redo:"","Remove color":"","Remove Format":"","Remove highlight":"","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":"","Revert autoformatting action":"","Rich Text Editor":"","Rich Text Editor. Editing area: %0":"",Ridge:"","Right aligned image":"",Row:"",Save:"","Select all":"","Select column":"","Select row":"","Show more items":"","Side image":"",Small:"",Solid:"","Split cell horizontally":"","Split cell vertically":"",Square:"","Start at":"","Start index must be greater than 0.":"",Strikethrough:"","Strikethrough text":"",Style:"",Subscript:"",Superscript:"",Table:"","Table alignment toolbar":"","Table cell text alignment":"","Table properties":"","Table toolbar":"","Text alignment":"","Text alignment toolbar":"","Text alternative":"","Text highlight toolbar":"",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':"","The URL must not be empty.":"",'The value is invalid. Try "10px" or "2em" or simply "2".':"","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":"","This media URL is not supported.":"",Tiny:"","Tip: Paste the URL into the content to embed faster.":"","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 lower–latin list style":"","Toggle the lower–roman list style":"","Toggle the square list style":"","Toggle the upper–latin list style":"","Toggle the upper–roman list style":"",Turquoise:"","Type or paste your content here.":"","Type your title":"",Underline:"નીચે લિટી - અન્ડરલાઇન્","Underline text":"",Undo:"",Unlink:"","Update image URL":"","Upload failed":"","Upload from computer":"","Upload image from computer":"","Upload in progress":"","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":"","Vertical text alignment toolbar":"","Via URL":"",White:"","Widget toolbar":"",Width:"","Wrap text":"",Yellow:"","Yellow marker":"","You have no image upload permissions.":""}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); -------------------------------------------------------------------------------- /ckeditor/translations/hy.js: -------------------------------------------------------------------------------- 1 | !function(e){const t=e.hy=e.hy||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require Fn)":"","%0 of %1":"",Accept:"",Accessibility:"","Accessibility help":"","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 center":"","Align left":"","Align right":"","Align table to the left":"","Align table to the right":"",Alignment:"",Aquamarine:"",Background:"","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"",Big:"",Black:"","Block quote":"",Blue:"","Blue marker":"",Bold:"Թավագիր","Bold text":"",Border:"","Break text":"","Bulleted List":"","Bulleted list styles toolbar":"",Cancel:"Չեղարկել","Caption for image: %0":"","Caption for the image":"","Cell properties":"","Center table":"","Centered image":"","Change image text alternative":"","Choose heading":"",Circle:"",Clear:"","Click to edit block":"",Close:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"Կոդ","Code block":"",Color:"","Color picker":"",Column:"Սյունակ","Content editing keystrokes":"","Copy selected content":"","Create link":"",Custom:"","Custom image size":"",Dashed:"",Decimal:"","Decimal with leading zero":"","Decrease indent":"","Decrease list item indent":"",Default:"","Delete column":"","Delete row":"","Dim grey":"",Dimensions:"",Disc:"","Document colors":"",Dotted:"",Double:"",Downloadable:"","Drag to move":"","Dropdown menu":"","Dropdown toolbar":"","Edit block":"","Edit link":"Խմբագրել հղումը","Editor block content toolbar":"","Editor contextual toolbar":"","Editor dialog":"","Editor menu bar":"","Editor toolbar":"","Enter image caption":"","Enter table caption":"","Entering %0 code snippet":"","Entering a to-do list":"","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":"","Font Color":"","Font Family":"","Font Size":"","From computer":"","Full size image":"",Green:"","Green marker":"","Green pen":"",Grey:"",Groove:"","Header column":"","Header row":"",Heading:"","Heading 1":"Վերնագիր 1","Heading 2":"Վերնագիր 2","Heading 3":"Վերնագիր 3","Heading 4":"","Heading 5":"","Heading 6":"",Height:"","Help Contents. To close this dialog press ESC.":"",HEX:"",Highlight:"","Horizontal line":"","Horizontal text alignment toolbar":"","HTML object":"",Huge:"",Image:"","Image from computer":"","Image resize list":"","Image toolbar":"","Image upload complete":"","Image via URL":"","image widget":"","In line":"","Increase indent":"","Increase list item indent":"","Insert a hard break (a new paragraph)":"","Insert a new paragraph directly after a widget":"","Insert a new paragraph directly before a widget":"","Insert a new table row (when in the last cell of a table)":"","Insert a soft break (a <br> element)":"","Insert code block":"","Insert column left":"","Insert column right":"","Insert image":"","Insert image via URL":"","Insert media":"","Insert paragraph after block":"","Insert paragraph before block":"","Insert row above":"","Insert row below":"","Insert table":"","Insert via URL":"",Inset:"","Invalid start index value.":"",Italic:"Շեղագիր","Italic text":"",Justify:"","Justify cell text":"","Keystrokes that can be used in a list":"","Keystrokes that can be used in a table cell":"","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"","Leaving %0 code snippet":"","Leaving a to-do list":"","Leaving code snippet":"","Left aligned image":"","Light blue":"","Light green":"","Light grey":"",Link:"Հղում","Link image":"","Link URL":"","Link URL must not be empty.":"","List properties":"","Lower-latin":"","Lower–roman":"",Media:"","Media toolbar":"","Media URL":"","media widget":"",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:"","Merge cell down":"","Merge cell left":"","Merge cell right":"","Merge cell up":"","Merge cells":"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus from an editable area back to the parent widget":"","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":"","Move the caret to allow typing directly after a widget":"","Move the caret to allow typing directly before a widget":"","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":"",Next:"","No results found":"","No searchable items":"",None:"","Numbered List":"","Numbered list styles toolbar":"","Open in a new tab":"","Open link in new tab":"","Open media in new tab":"","Open the accessibility help dialog":"",Orange:"",Original:"",Outset:"",Padding:"",Paragraph:"","Paste content":"","Paste content as plain text":"","Paste the media URL in the input.":"","Pink marker":"","Plain text":"",'Please enter a valid color (e.g. "ff0000").':"","Press %0 for help.":"","Press Enter to type after or press Shift + Enter to type before the widget":"",Previous:"",Purple:"",Red:"","Red pen":"",Redo:"","Remove color":"","Remove Format":"","Remove highlight":"","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":"","Revert autoformatting action":"","Rich Text Editor":"","Rich Text Editor. Editing area: %0":"",Ridge:"","Right aligned image":"",Row:"",Save:"","Select all":"","Select column":"","Select row":"","Show more items":"","Side image":"",Small:"",Solid:"","Split cell horizontally":"","Split cell vertically":"",Square:"","Start at":"","Start index must be greater than 0.":"",Strikethrough:"Գծանշել","Strikethrough text":"",Style:"",Subscript:"Ենթատեքստ",Superscript:"Գերագիր",Table:"","Table alignment toolbar":"","Table cell text alignment":"","Table properties":"","Table toolbar":"","Table underline":"","Text alignment":"","Text alignment toolbar":"","Text alternative":"","Text highlight toolbar":"",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':"","The URL must not be empty.":"",'The value is invalid. Try "10px" or "2em" or simply "2".':"","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":"","This media URL is not supported.":"",Tiny:"","Tip: Paste the URL into the content to embed faster.":"","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 lower–latin list style":"","Toggle the lower–roman list style":"","Toggle the square list style":"","Toggle the upper–latin list style":"","Toggle the upper–roman list style":"",Turquoise:"","Type or paste your content here.":"","Type your title":"",Underline:"Ընդգծել","Underline text":"",Undo:"",Unlink:"","Update image URL":"","Upload failed":"","Upload from computer":"","Upload image from computer":"","Upload in progress":"","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":"","Vertical text alignment toolbar":"","Via URL":"",White:"","Widget toolbar":"",Width:"","Wrap text":"",Yellow:"","Yellow marker":"","You have no image upload permissions.":""}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); -------------------------------------------------------------------------------- /ckeditor/translations/kk.js: -------------------------------------------------------------------------------- 1 | !function(e){const t=e.kk=e.kk||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require Fn)":"","%0 of %1":"",Accept:"",Accessibility:"","Accessibility help":"","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 center":"Ортадан туралау","Align left":"Солға туралау","Align right":"Оңға туралау","Align table to the left":"","Align table to the right":"",Alignment:"",Aquamarine:"",Background:"","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"",Big:"",Black:"","Block quote":"",Blue:"","Blue marker":"",Bold:"","Bold text":"",Border:"","Break text":"","Bulleted List":"","Bulleted list styles toolbar":"",Cancel:"","Caption for image: %0":"","Caption for the image":"","Cell properties":"","Center table":"","Centered image":"","Change image text alternative":"","Choose heading":"",Circle:"",Clear:"","Click to edit block":"",Close:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"","Code block":"",Color:"","Color picker":"",Column:"","Content editing keystrokes":"","Copy selected content":"","Create link":"",Custom:"","Custom image size":"",Dashed:"",Decimal:"","Decimal with leading zero":"","Decrease indent":"","Decrease list item indent":"",Default:"","Delete column":"","Delete row":"","Dim grey":"",Dimensions:"",Disc:"","Document colors":"",Dotted:"",Double:"",Downloadable:"","Drag to move":"","Dropdown menu":"","Dropdown toolbar":"","Edit block":"","Edit link":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor dialog":"","Editor menu bar":"","Editor toolbar":"","Enter image caption":"","Enter table caption":"","Entering %0 code snippet":"","Entering a to-do list":"","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":"","Font Color":"","Font Family":"","Font Size":"","From computer":"","Full size image":"",Green:"","Green marker":"","Green pen":"",Grey:"",Groove:"","Header column":"","Header row":"",Heading:"","Heading 1":"","Heading 2":"","Heading 3":"","Heading 4":"","Heading 5":"","Heading 6":"",Height:"","Help Contents. To close this dialog press ESC.":"",HEX:"",Highlight:"","Horizontal line":"","Horizontal text alignment toolbar":"","HTML object":"",Huge:"",Image:"","Image from computer":"","Image resize list":"","Image toolbar":"","Image upload complete":"","Image via URL":"","image widget":"","In line":"","Increase indent":"","Increase list item indent":"","Insert a hard break (a new paragraph)":"","Insert a new paragraph directly after a widget":"","Insert a new paragraph directly before a widget":"","Insert a new table row (when in the last cell of a table)":"","Insert a soft break (a <br> element)":"","Insert code block":"","Insert column left":"","Insert column right":"","Insert image":"","Insert image via URL":"","Insert media":"","Insert paragraph after block":"","Insert paragraph before block":"","Insert row above":"","Insert row below":"","Insert table":"","Insert via URL":"",Inset:"","Invalid start index value.":"",Italic:"","Italic text":"",Justify:"","Justify cell text":"","Keystrokes that can be used in a list":"","Keystrokes that can be used in a table cell":"","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"","Leaving %0 code snippet":"","Leaving a to-do list":"","Leaving code snippet":"","Left aligned image":"","Light blue":"","Light green":"","Light grey":"",Link:"","Link image":"","Link URL":"","Link URL must not be empty.":"","List properties":"","Lower-latin":"","Lower–roman":"",Media:"","Media toolbar":"","Media URL":"","media widget":"",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:"","Merge cell down":"","Merge cell left":"","Merge cell right":"","Merge cell up":"","Merge cells":"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus from an editable area back to the parent widget":"","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":"","Move the caret to allow typing directly after a widget":"","Move the caret to allow typing directly before a widget":"","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":"",Next:"","No results found":"","No searchable items":"",None:"","Numbered List":"","Numbered list styles toolbar":"","Open in a new tab":"","Open link in new tab":"","Open media in new tab":"","Open the accessibility help dialog":"",Orange:"",Original:"",Outset:"",Padding:"",Paragraph:"","Paste content":"","Paste content as plain text":"","Paste the media URL in the input.":"","Pink marker":"","Plain text":"",'Please enter a valid color (e.g. "ff0000").':"","Press %0 for help.":"","Press Enter to type after or press Shift + Enter to type before the widget":"",Previous:"",Purple:"",Red:"","Red pen":"",Redo:"","Remove color":"","Remove Format":"","Remove highlight":"","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":"","Revert autoformatting action":"","Rich Text Editor":"","Rich Text Editor. Editing area: %0":"",Ridge:"","Right aligned image":"",Row:"",Save:"","Select all":"","Select column":"","Select row":"","Show more items":"","Side image":"",Small:"",Solid:"","Split cell horizontally":"","Split cell vertically":"",Square:"","Start at":"","Start index must be greater than 0.":"",Strikethrough:"","Strikethrough text":"",Style:"",Subscript:"",Superscript:"",Table:"","Table alignment toolbar":"","Table cell text alignment":"","Table properties":"","Table toolbar":"","Text alignment":"Мәтінді туралау","Text alignment toolbar":"Мәтінді туралау құралдар тақтасы","Text alternative":"","Text highlight toolbar":"",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':"","The URL must not be empty.":"",'The value is invalid. Try "10px" or "2em" or simply "2".':"","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":"","This media URL is not supported.":"",Tiny:"","Tip: Paste the URL into the content to embed faster.":"","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 lower–latin list style":"","Toggle the lower–roman list style":"","Toggle the square list style":"","Toggle the upper–latin list style":"","Toggle the upper–roman list style":"",Turquoise:"","Type or paste your content here.":"","Type your title":"",Underline:"","Underline text":"",Undo:"",Unlink:"","Update image URL":"","Upload failed":"","Upload from computer":"","Upload image from computer":"","Upload in progress":"","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":"","Vertical text alignment toolbar":"","Via URL":"",White:"","Widget toolbar":"",Width:"","Wrap text":"",Yellow:"","Yellow marker":"","You have no image upload permissions.":""}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); -------------------------------------------------------------------------------- /ckeditor/translations/oc.js: -------------------------------------------------------------------------------- 1 | !function(e){const t=e.oc=e.oc||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require Fn)":"","%0 of %1":"",Accept:"",Accessibility:"","Accessibility help":"","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 center":"","Align left":"","Align right":"","Align table to the left":"","Align table to the right":"",Alignment:"",Aquamarine:"",Background:"","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"",Big:"",Black:"","Block quote":"",Blue:"","Blue marker":"",Bold:"Gras","Bold text":"",Border:"","Break text":"","Bulleted List":"","Bulleted list styles toolbar":"",Cancel:"Anullar","Caption for image: %0":"","Caption for the image":"","Cell properties":"","Center table":"","Centered image":"","Change image text alternative":"","Choose heading":"",Circle:"",Clear:"","Click to edit block":"",Close:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"","Code block":"",Color:"","Color picker":"",Column:"","Content editing keystrokes":"","Copy selected content":"","Create link":"",Custom:"","Custom image size":"",Dashed:"",Decimal:"","Decimal with leading zero":"","Decrease indent":"","Decrease list item indent":"",Default:"","Delete column":"","Delete row":"","Dim grey":"",Dimensions:"",Disc:"","Document colors":"",Dotted:"",Double:"",Downloadable:"","Drag to move":"","Dropdown menu":"","Dropdown toolbar":"","Edit block":"","Edit link":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor dialog":"","Editor menu bar":"","Editor toolbar":"","Enter image caption":"","Enter table caption":"","Entering %0 code snippet":"","Entering a to-do list":"","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":"","Font Color":"","Font Family":"","Font Size":"","From computer":"","Full size image":"",Green:"","Green marker":"","Green pen":"",Grey:"",Groove:"","Header column":"","Header row":"",Heading:"","Heading 1":"","Heading 2":"","Heading 3":"","Heading 4":"","Heading 5":"","Heading 6":"",Height:"","Help Contents. To close this dialog press ESC.":"",HEX:"",Highlight:"","Horizontal line":"","Horizontal text alignment toolbar":"","HTML object":"",Huge:"",Image:"","Image from computer":"","Image resize list":"","Image toolbar":"","Image upload complete":"","Image via URL":"","image widget":"","In line":"","Increase indent":"","Increase list item indent":"","Insert a hard break (a new paragraph)":"","Insert a new paragraph directly after a widget":"","Insert a new paragraph directly before a widget":"","Insert a new table row (when in the last cell of a table)":"","Insert a soft break (a <br> element)":"","Insert code block":"","Insert column left":"","Insert column right":"","Insert image":"","Insert image via URL":"","Insert media":"","Insert paragraph after block":"","Insert paragraph before block":"","Insert row above":"","Insert row below":"","Insert table":"","Insert via URL":"",Inset:"","Invalid start index value.":"",Italic:"Italica","Italic text":"",Justify:"","Justify cell text":"","Keystrokes that can be used in a list":"","Keystrokes that can be used in a table cell":"","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"","Leaving %0 code snippet":"","Leaving a to-do list":"","Leaving code snippet":"","Left aligned image":"","Light blue":"","Light green":"","Light grey":"",Link:"","Link image":"","Link URL":"","Link URL must not be empty.":"","List properties":"","Lower-latin":"","Lower–roman":"",Media:"","Media toolbar":"","Media URL":"","media widget":"",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:"","Merge cell down":"","Merge cell left":"","Merge cell right":"","Merge cell up":"","Merge cells":"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus from an editable area back to the parent widget":"","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":"","Move the caret to allow typing directly after a widget":"","Move the caret to allow typing directly before a widget":"","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":"",Next:"","No results found":"","No searchable items":"",None:"","Numbered List":"","Numbered list styles toolbar":"","Open in a new tab":"","Open link in new tab":"","Open media in new tab":"","Open the accessibility help dialog":"",Orange:"",Original:"",Outset:"",Padding:"",Paragraph:"","Paste content":"","Paste content as plain text":"","Paste the media URL in the input.":"","Pink marker":"","Plain text":"",'Please enter a valid color (e.g. "ff0000").':"","Press %0 for help.":"","Press Enter to type after or press Shift + Enter to type before the widget":"",Previous:"",Purple:"",Red:"","Red pen":"",Redo:"","Remove color":"","Remove Format":"","Remove highlight":"","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":"","Revert autoformatting action":"","Rich Text Editor":"","Rich Text Editor. Editing area: %0":"",Ridge:"","Right aligned image":"",Row:"",Save:"Enregistrar","Select all":"","Select column":"","Select row":"","Show more items":"","Side image":"",Small:"",Solid:"","Split cell horizontally":"","Split cell vertically":"",Square:"","Start at":"","Start index must be greater than 0.":"",Strikethrough:"","Strikethrough text":"",Style:"",Subscript:"",Superscript:"",Table:"","Table alignment toolbar":"","Table cell text alignment":"","Table properties":"","Table toolbar":"","Text alignment":"","Text alignment toolbar":"","Text alternative":"","Text highlight toolbar":"",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':"","The URL must not be empty.":"",'The value is invalid. Try "10px" or "2em" or simply "2".':"","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":"","This media URL is not supported.":"",Tiny:"","Tip: Paste the URL into the content to embed faster.":"","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 lower–latin list style":"","Toggle the lower–roman list style":"","Toggle the square list style":"","Toggle the upper–latin list style":"","Toggle the upper–roman list style":"",Turquoise:"","Type or paste your content here.":"","Type your title":"",Underline:"","Underline text":"",Undo:"",Unlink:"","Update image URL":"","Upload failed":"","Upload from computer":"","Upload image from computer":"","Upload in progress":"","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":"","Vertical text alignment toolbar":"","Via URL":"",White:"","Widget toolbar":"",Width:"","Wrap text":"",Yellow:"","Yellow marker":"","You have no image upload permissions.":""}),t.getPluralForm=function(e){return e>1}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); -------------------------------------------------------------------------------- /ckeditor/translations/si.js: -------------------------------------------------------------------------------- 1 | !function(e){const t=e.si=e.si||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require Fn)":"","%0 of %1":"",Accept:"",Accessibility:"","Accessibility help":"","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 center":"","Align left":"","Align right":"","Align table to the left":"","Align table to the right":"",Alignment:"",Aquamarine:"",Background:"","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"",Big:"",Black:"","Block quote":"",Blue:"","Blue marker":"",Bold:"තදකුරු","Bold text":"",Border:"","Break text":"","Bulleted List":"බුලටිත ලැයිස්තුව","Bulleted list styles toolbar":"",Cancel:"","Caption for image: %0":"","Caption for the image":"","Cell properties":"","Center table":"","Centered image":"","Change image text alternative":"","Choose heading":"",Circle:"",Clear:"","Click to edit block":"",Close:"","Close contextual balloons, dropdowns, and dialogs":"",Code:"","Code block":"",Color:"","Color picker":"",Column:"","Content editing keystrokes":"","Copy selected content":"","Create link":"",Custom:"","Custom image size":"",Dashed:"",Decimal:"","Decimal with leading zero":"","Decrease indent":"","Decrease list item indent":"",Default:"","Delete column":"","Delete row":"","Dim grey":"",Dimensions:"",Disc:"","Document colors":"",Dotted:"",Double:"",Downloadable:"","Drag to move":"","Dropdown menu":"","Dropdown toolbar":"","Edit block":"","Edit link":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor dialog":"","Editor menu bar":"","Editor toolbar":"","Enter image caption":"","Enter table caption":"","Entering %0 code snippet":"","Entering a to-do list":"","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":"","Font Color":"","Font Family":"","Font Size":"","From computer":"","Full size image":"",Green:"","Green marker":"","Green pen":"",Grey:"",Groove:"","Header column":"","Header row":"",Heading:"","Heading 1":"","Heading 2":"","Heading 3":"","Heading 4":"","Heading 5":"","Heading 6":"",Height:"","Help Contents. To close this dialog press ESC.":"",HEX:"",Highlight:"","Horizontal line":"","Horizontal text alignment toolbar":"","HTML object":"",Huge:"",Image:"","Image from computer":"","Image resize list":"","Image toolbar":"","Image upload complete":"","Image via URL":"","image widget":"","In line":"","Increase indent":"","Increase list item indent":"","Insert a hard break (a new paragraph)":"","Insert a new paragraph directly after a widget":"","Insert a new paragraph directly before a widget":"","Insert a new table row (when in the last cell of a table)":"","Insert a soft break (a <br> element)":"","Insert code block":"","Insert column left":"","Insert column right":"","Insert image":"පින්තූරය ඇතුල් කරන්න","Insert image via URL":"","Insert media":"","Insert paragraph after block":"","Insert paragraph before block":"","Insert row above":"","Insert row below":"","Insert table":"","Insert via URL":"",Inset:"","Invalid start index value.":"",Italic:"ඇලකුරු","Italic text":"",Justify:"","Justify cell text":"","Keystrokes that can be used in a list":"","Keystrokes that can be used in a table cell":"","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"","Leaving %0 code snippet":"","Leaving a to-do list":"","Leaving code snippet":"","Left aligned image":"","Light blue":"","Light green":"","Light grey":"",Link:"","Link image":"","Link URL":"","Link URL must not be empty.":"","List properties":"","Lower-latin":"","Lower–roman":"",Media:"","Media toolbar":"","Media URL":"","media widget":"",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:"","Merge cell down":"","Merge cell left":"","Merge cell right":"","Merge cell up":"","Merge cells":"","Move focus between form fields (inputs, buttons, etc.)":"","Move focus from an editable area back to the parent widget":"","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":"","Move the caret to allow typing directly after a widget":"","Move the caret to allow typing directly before a widget":"","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":"",Next:"","No results found":"","No searchable items":"",None:"","Numbered List":"අංකිත ලැයිස්තුව","Numbered list styles toolbar":"","Open in a new tab":"","Open link in new tab":"","Open media in new tab":"","Open the accessibility help dialog":"",Orange:"",Original:"",Outset:"",Padding:"",Paragraph:"","Paste content":"","Paste content as plain text":"","Paste the media URL in the input.":"","Pink marker":"","Plain text":"",'Please enter a valid color (e.g. "ff0000").':"","Press %0 for help.":"","Press Enter to type after or press Shift + Enter to type before the widget":"",Previous:"",Purple:"",Red:"","Red pen":"",Redo:"නැවත කරන්න","Remove color":"","Remove Format":"","Remove highlight":"","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":"","Revert autoformatting action":"","Rich Text Editor":"","Rich Text Editor. Editing area: %0":"",Ridge:"","Right aligned image":"",Row:"",Save:"","Select all":"","Select column":"","Select row":"","Show more items":"","Side image":"",Small:"",Solid:"","Split cell horizontally":"","Split cell vertically":"",Square:"","Start at":"","Start index must be greater than 0.":"",Strikethrough:"","Strikethrough text":"",Style:"",Subscript:"",Superscript:"",Table:"","Table alignment toolbar":"","Table cell text alignment":"","Table properties":"","Table toolbar":"","Text alignment":"","Text alignment toolbar":"","Text alternative":"","Text highlight toolbar":"",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':"","The URL must not be empty.":"",'The value is invalid. Try "10px" or "2em" or simply "2".':"","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":"","This media URL is not supported.":"",Tiny:"","Tip: Paste the URL into the content to embed faster.":"","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 lower–latin list style":"","Toggle the lower–roman list style":"","Toggle the square list style":"","Toggle the upper–latin list style":"","Toggle the upper–roman list style":"",Turquoise:"","Type or paste your content here.":"","Type your title":"",Underline:"","Underline text":"",Undo:"අහෝසි කරන්න",Unlink:"","Update image URL":"","Upload failed":"උඩුගත කිරීම අසාර්ථක විය","Upload from computer":"","Upload image from computer":"","Upload in progress":"","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":"","Vertical text alignment toolbar":"","Via URL":"",White:"","Widget toolbar":"",Width:"","Wrap text":"",Yellow:"","Yellow marker":"","You have no image upload permissions.":""}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); -------------------------------------------------------------------------------- /ckeditor5/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /ckeditor5/LICENSE.md: -------------------------------------------------------------------------------- 1 | Software License Agreement 2 | ========================== 3 | 4 | Copyright (c) 2014-2023, CKSource Holding sp. z o.o. All rights reserved. 5 | 6 | Online builder code samples are licensed under the terms of the MIT License (see Appendix A): 7 | 8 | http://en.wikipedia.org/wiki/MIT_License 9 | 10 | CKEditor 5 collaboration features are only available under a commercial license. [Contact us](https://ckeditor.com/contact/) for more details. 11 | 12 | Free 30-days trials of CKEditor 5 collaboration features are available: 13 | * https://ckeditor.com/collaboration/ - Real-time collaboration (with all features). 14 | * https://ckeditor.com/collaboration/comments/ - Inline comments feature (without real-time collaborative editing). 15 | * https://ckeditor.com/collaboration/track-changes/ - Track changes feature (without real-time collaborative editing). 16 | 17 | Trademarks 18 | ---------- 19 | 20 | CKEditor is a trademark of CKSource Holding sp. z o.o. All other brand 21 | and product names are trademarks, registered trademarks or service 22 | marks of their respective holders. 23 | 24 | --- 25 | 26 | Appendix A: The MIT License 27 | --------------------------- 28 | 29 | The MIT License (MIT) 30 | 31 | Copyright (c) 2014-2023, CKSource Holding sp. z o.o. 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is 38 | furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in 41 | all copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 49 | THE SOFTWARE. 50 | -------------------------------------------------------------------------------- /ckeditor5/README.md: -------------------------------------------------------------------------------- 1 | # CKEditor 5 editor generated with the online builder 2 | 3 | This repository presents a CKEditor 5 editor build generated by the [Online builder tool](https://ckeditor.com/ckeditor-5/online-builder) 4 | 5 | ## Quick start 6 | 7 | 1. Open the `sample/index.html` page in the browser. 8 | 9 | 2. Fill the prompt with the license key. If you do not have the license key yet [contact us](https://ckeditor.com/contact/). 10 | 11 | ## Configuring build 12 | 13 | Changes like changing toolbar items, changing order of icons or customizing plugin configurations should be relatively easy to make. Open the `sample/index.html` file and edit the script that initialized the CKEditor 5. Save the file and refresh the browser. That's all. 14 | 15 | *Note:* If you have any problems with browser caching use the `Ctrl + R` or `Cmd + R` shortcut depending on your system. 16 | 17 | However if you want to remove or add a plugin to the build you need to follow the next step of this guide. 18 | 19 | Note that it is also possible to go back to the [Online builder tool](https://ckeditor.com/ckeditor-5/online-builder) and pick other set of plugins. But we encourage you to try the harder way and to learn the principles of Node.js and CKEditor 5 ecosystems that will allow you to do more cool things in the future! 20 | 21 | ### Installation 22 | 23 | In order to rebuild the application you need to install all dependencies first. To do it, open the terminal in the project directory and type: 24 | 25 | ``` 26 | npm install 27 | ``` 28 | 29 | 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/). 30 | 31 | ### Adding or removing plugins 32 | 33 | Now you can install additional plugin in the build. Just follow the [Adding a plugin to an editor tutorial](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/installing-plugins.html#adding-a-plugin-to-an-editor) 34 | 35 | ### Rebuilding editor 36 | 37 | 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: 38 | 39 | ``` 40 | npm run build 41 | ``` 42 | 43 | This will build the CKEditor 5 to the `build` directory. You can open your browser and you should be able to see the changes you've made in the code. If not, then try to refresh also the browser cache by typing `Ctrl + R` or `Cmd + R` depending on your system. 44 | 45 | ## What's next? 46 | 47 | Follow the guides available on https://ckeditor.com/docs/ckeditor5/latest/framework/index.html and enjoy the document editing. 48 | 49 | ## FAQ 50 | | Where is the place to report bugs and feature requests? 51 | 52 | You can create an issue on https://github.com/ckeditor/ckeditor5/issues including the build id - `9e9snf1zg4kp-d2cnyyo44cbm`. Make sure that the question / problem is unique, please look for a possibly asked questions in the search box. Duplicates will be closed. 53 | 54 | | Where can I learn more about the CKEditor 5 framework? 55 | 56 | Here: https://ckeditor.com/docs/ckeditor5/latest/framework/ 57 | 58 | | Is it possible to use online builder with common frameworks like React, Vue or Angular? 59 | 60 | Not yet, but it these integrations will be available at some point in the future. 61 | -------------------------------------------------------------------------------- /ckeditor5/build/ckeditor.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Copyright (c) 2014-2023, CKSource Holding sp. z o.o. All rights reserved. 3 | * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license 4 | */ 5 | import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic'; 6 | import { Alignment } from '@ckeditor/ckeditor5-alignment'; 7 | import { Autoformat } from '@ckeditor/ckeditor5-autoformat'; 8 | import { Bold, Code, Italic, Strikethrough, Subscript, Superscript, Underline } from '@ckeditor/ckeditor5-basic-styles'; 9 | import { BlockQuote } from '@ckeditor/ckeditor5-block-quote'; 10 | import { CodeBlock } from '@ckeditor/ckeditor5-code-block'; 11 | import type { EditorConfig } from '@ckeditor/ckeditor5-core'; 12 | import { Essentials } from '@ckeditor/ckeditor5-essentials'; 13 | import { FontBackgroundColor, FontColor, FontFamily, FontSize } from '@ckeditor/ckeditor5-font'; 14 | import { Heading } from '@ckeditor/ckeditor5-heading'; 15 | import { Highlight } from '@ckeditor/ckeditor5-highlight'; 16 | import { HorizontalLine } from '@ckeditor/ckeditor5-horizontal-line'; 17 | import { GeneralHtmlSupport } from '@ckeditor/ckeditor5-html-support'; 18 | import { Image, ImageCaption, ImageStyle, ImageToolbar, ImageUpload } from '@ckeditor/ckeditor5-image'; 19 | import { Indent, IndentBlock } from '@ckeditor/ckeditor5-indent'; 20 | import { AutoLink, Link } from '@ckeditor/ckeditor5-link'; 21 | import { List } from '@ckeditor/ckeditor5-list'; 22 | import { MediaEmbed } from '@ckeditor/ckeditor5-media-embed'; 23 | import { Paragraph } from '@ckeditor/ckeditor5-paragraph'; 24 | import { PasteFromOffice } from '@ckeditor/ckeditor5-paste-from-office'; 25 | import { RemoveFormat } from '@ckeditor/ckeditor5-remove-format'; 26 | import { SelectAll } from '@ckeditor/ckeditor5-select-all'; 27 | import { Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar } from '@h5p/ckeditor5-table'; 28 | import { TextTransformation } from '@ckeditor/ckeditor5-typing'; 29 | declare class Editor extends ClassicEditor { 30 | static builtinPlugins: (typeof Alignment | typeof AutoLink | typeof Autoformat | typeof BlockQuote | typeof Bold | typeof Code | typeof CodeBlock | typeof Essentials | typeof FontBackgroundColor | typeof FontColor | typeof FontFamily | typeof FontSize | typeof GeneralHtmlSupport | typeof Heading | typeof Highlight | typeof HorizontalLine | typeof Image | typeof ImageCaption | typeof ImageStyle | typeof ImageToolbar | typeof ImageUpload | typeof Indent | typeof IndentBlock | typeof Italic | typeof Link | typeof List | typeof MediaEmbed | typeof Paragraph | typeof PasteFromOffice | typeof RemoveFormat | typeof SelectAll | typeof Strikethrough | typeof Subscript | typeof Superscript | typeof Table | typeof TableCaption | typeof TableCellProperties | typeof TableColumnResize | typeof TableProperties | typeof TableToolbar | typeof TextTransformation | typeof Underline)[]; 31 | static defaultConfig: EditorConfig; 32 | } 33 | export default Editor; 34 | -------------------------------------------------------------------------------- /ckeditor5/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ckeditor5-custom-build", 3 | "author": "CKSource", 4 | "description": "A custom CKEditor 5 build made by the CKEditor 5 online builder.", 5 | "version": "0.0.1", 6 | "license": "SEE LICENSE IN LICENSE.md", 7 | "private": true, 8 | "main": "./build/ckeditor.js", 9 | "types": "./build/ckeditor.d.ts", 10 | "dependencies": { 11 | "@ckeditor/ckeditor5-alignment": "43.3.0", 12 | "@ckeditor/ckeditor5-autoformat": "43.3.0", 13 | "@ckeditor/ckeditor5-basic-styles": "43.3.0", 14 | "@ckeditor/ckeditor5-block-quote": "43.3.0", 15 | "@ckeditor/ckeditor5-code-block": "43.3.0", 16 | "@ckeditor/ckeditor5-editor-classic": "43.3.0", 17 | "@ckeditor/ckeditor5-essentials": "43.3.0", 18 | "@ckeditor/ckeditor5-font": "43.3.0", 19 | "@ckeditor/ckeditor5-heading": "43.3.0", 20 | "@ckeditor/ckeditor5-highlight": "43.3.0", 21 | "@ckeditor/ckeditor5-horizontal-line": "43.3.0", 22 | "@ckeditor/ckeditor5-html-support": "43.3.0", 23 | "@ckeditor/ckeditor5-image": "43.3.0", 24 | "@ckeditor/ckeditor5-indent": "43.3.0", 25 | "@ckeditor/ckeditor5-link": "43.3.0", 26 | "@ckeditor/ckeditor5-list": "43.3.0", 27 | "@ckeditor/ckeditor5-media-embed": "43.3.0", 28 | "@ckeditor/ckeditor5-paragraph": "43.3.0", 29 | "@ckeditor/ckeditor5-paste-from-office": "43.3.0", 30 | "@ckeditor/ckeditor5-remove-format": "43.3.0", 31 | "@ckeditor/ckeditor5-select-all": "43.3.0", 32 | "@ckeditor/ckeditor5-typing": "43.3.0", 33 | "@h5p/ckeditor5-table": "github:h5p/h5p-ckeditor-table#0.0.13" 34 | }, 35 | "devDependencies": { 36 | "@ckeditor/ckeditor5-core": "43.3.0", 37 | "@ckeditor/ckeditor5-dev-translations": "^32.1.2", 38 | "@ckeditor/ckeditor5-dev-utils": "^32.1.2", 39 | "@ckeditor/ckeditor5-theme-lark": "43.3.0", 40 | "css-loader": "^5.2.7", 41 | "postcss": "^8.4.29", 42 | "postcss-loader": "^4.3.0", 43 | "raw-loader": "^4.0.2", 44 | "style-loader": "^2.0.0", 45 | "terser-webpack-plugin": "^4.2.3", 46 | "ts-loader": "^9.4.4", 47 | "typescript": "5.0.4", 48 | "webpack": "^5.95.0", 49 | "webpack-cli": "^4.10.0" 50 | }, 51 | "scripts": { 52 | "build": "webpack --mode production", 53 | "postbuild": "tsc --declaration --declarationDir build --stripInternal --emitDeclarationOnly" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ckeditor5/sample/index.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | CKEditor 5 ClassicEditor build 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

CKEditor 5 logoCKEditor 5

18 | 24 |
25 |
26 |
27 |
28 |

CKEditor 5 online builder demo - ClassicEditor build

29 |
30 |
31 |
32 |
33 |
34 |
35 |

Bilingual Personality Disorder

36 |
37 |
One language, one person.
38 |
39 |

40 | This may be the first time you hear about this made-up disorder but 41 | it actually isn’t so far from the truth. Even the studies that were conducted almost half a century show that 42 | the language you speak has more effects on you than you realize. 43 |

44 |

45 | One of the very first experiments conducted on this topic dates back to 1964. 46 | In the experiment 47 | designed by linguist Ervin-Tripp who is an authority expert in psycholinguistic and sociolinguistic studies, 48 | adults who are bilingual in English in French were showed series of pictures and were asked to create 3-minute stories. 49 | In the end participants emphasized drastically different dynamics for stories in English and French. 50 |

51 |

52 | Another ground-breaking experiment which included bilingual Japanese women married to American men in San Francisco were 53 | asked to complete sentences. The goal of the experiment was to investigate whether or not human feelings and thoughts 54 | are expressed differently in different language mindsets. 55 | Here is a sample from the the experiment: 56 |

57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 |
EnglishJapanese
Real friends shouldBe very frankHelp each other
I will probably becomeA teacherA housewife
When there is a conflict with familyI do what I wantIt's a time of great unhappiness
83 |

84 | More recent studies show, the language a person speaks affects 85 | their cognition, behaviour, emotions and hence their personality. 86 | This shouldn’t come as a surprise 87 | since we already know that different regions 88 | of the brain become more active depending on the person’s activity at hand. Since structure, information and especially 89 | the culture of languages varies substantially and the language a person speaks is an essential element of daily life. 90 |

91 |
92 |
93 |
94 |
95 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /ckeditor5/sample/script.js: -------------------------------------------------------------------------------- 1 | ClassicEditor 2 | .create( document.querySelector( '.editor' ), { 3 | // Editor configuration. 4 | } ) 5 | .then( editor => { 6 | window.editor = editor; 7 | } ) 8 | .catch( handleSampleError ); 9 | 10 | function handleSampleError( error ) { 11 | const issueUrl = 'https://github.com/ckeditor/ckeditor5/issues'; 12 | 13 | const message = [ 14 | 'Oops, something went wrong!', 15 | `Please, report the following error on ${ issueUrl } with the build id "9e9snf1zg4kp-d2cnyyo44cbm" and the error stack trace:` 16 | ].join( '\n' ); 17 | 18 | console.error( message ); 19 | console.error( error ); 20 | } 21 | -------------------------------------------------------------------------------- /ckeditor5/src/ckeditor.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Copyright (c) 2014-2023, CKSource Holding sp. z o.o. All rights reserved. 3 | * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license 4 | */ 5 | 6 | import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic'; 7 | 8 | import { Alignment } from '@ckeditor/ckeditor5-alignment'; 9 | import { Autoformat } from '@ckeditor/ckeditor5-autoformat'; 10 | import { 11 | Bold, 12 | Code, 13 | Italic, 14 | Strikethrough, 15 | Subscript, 16 | Superscript, 17 | Underline 18 | } from '@ckeditor/ckeditor5-basic-styles'; 19 | import { BlockQuote } from '@ckeditor/ckeditor5-block-quote'; 20 | import { CodeBlock } from '@ckeditor/ckeditor5-code-block'; 21 | import type { EditorConfig } from '@ckeditor/ckeditor5-core'; 22 | import { Essentials } from '@ckeditor/ckeditor5-essentials'; 23 | import { FontBackgroundColor, FontColor, FontFamily, FontSize } from '@ckeditor/ckeditor5-font'; 24 | import { Heading } from '@ckeditor/ckeditor5-heading'; 25 | import { Highlight } from '@ckeditor/ckeditor5-highlight'; 26 | import { HorizontalLine } from '@ckeditor/ckeditor5-horizontal-line'; 27 | import { GeneralHtmlSupport } from '@ckeditor/ckeditor5-html-support'; 28 | import { 29 | Image, 30 | ImageCaption, 31 | ImageStyle, 32 | ImageToolbar, 33 | ImageUpload 34 | } from '@ckeditor/ckeditor5-image'; 35 | import { Indent, IndentBlock } from '@ckeditor/ckeditor5-indent'; 36 | import { AutoLink, Link } from '@ckeditor/ckeditor5-link'; 37 | import { List } from '@ckeditor/ckeditor5-list'; 38 | import { MediaEmbed } from '@ckeditor/ckeditor5-media-embed'; 39 | import { Paragraph } from '@ckeditor/ckeditor5-paragraph'; 40 | import { PasteFromOffice } from '@ckeditor/ckeditor5-paste-from-office'; 41 | import { RemoveFormat } from '@ckeditor/ckeditor5-remove-format'; 42 | import { SelectAll } from '@ckeditor/ckeditor5-select-all'; 43 | import { 44 | Table, 45 | TableCaption, 46 | TableCellProperties, 47 | TableColumnResize, 48 | TableProperties, 49 | TableToolbar 50 | } from '@h5p/ckeditor5-table'; 51 | import { TextTransformation } from '@ckeditor/ckeditor5-typing'; 52 | 53 | // You can read more about extending the build with additional plugins in the "Installing plugins" guide. 54 | // See https://ckeditor.com/docs/ckeditor5/latest/installation/plugins/installing-plugins.html for details. 55 | 56 | class Editor extends ClassicEditor { 57 | public static override builtinPlugins = [ 58 | Alignment, 59 | AutoLink, 60 | Autoformat, 61 | BlockQuote, 62 | Bold, 63 | Code, 64 | CodeBlock, 65 | Essentials, 66 | FontBackgroundColor, 67 | FontColor, 68 | FontFamily, 69 | FontSize, 70 | GeneralHtmlSupport, 71 | Heading, 72 | Highlight, 73 | HorizontalLine, 74 | Image, 75 | ImageCaption, 76 | ImageStyle, 77 | ImageToolbar, 78 | ImageUpload, 79 | Indent, 80 | IndentBlock, 81 | Italic, 82 | Link, 83 | List, 84 | MediaEmbed, 85 | Paragraph, 86 | PasteFromOffice, 87 | RemoveFormat, 88 | SelectAll, 89 | Strikethrough, 90 | Subscript, 91 | Superscript, 92 | Table, 93 | TableCaption, 94 | TableCellProperties, 95 | TableColumnResize, 96 | TableProperties, 97 | TableToolbar, 98 | TextTransformation, 99 | Underline 100 | ]; 101 | 102 | public static override defaultConfig: EditorConfig = { 103 | toolbar: { 104 | items: [ 105 | 'heading', 106 | '|', 107 | 'bold', 108 | 'italic', 109 | 'underline', 110 | 'link', 111 | '|', 112 | 'bulletedList', 113 | 'numberedList', 114 | '|', 115 | 'outdent', 116 | 'indent', 117 | '|', 118 | 'imageUpload', 119 | 'blockQuote', 120 | 'insertTable', 121 | 'undo', 122 | 'redo' 123 | ] 124 | }, 125 | language: 'en', 126 | image: { 127 | toolbar: [ 128 | 'imageTextAlternative', 129 | 'toggleImageCaption', 130 | 'imageStyle:inline', 131 | 'imageStyle:block', 132 | 'imageStyle:side' 133 | ] 134 | }, 135 | table: { 136 | contentToolbar: [ 137 | 'toggleTableCaption', 138 | 'tableColumn', 139 | 'tableRow', 140 | 'mergeTableCells', 141 | 'tableCellProperties', 142 | 'tableProperties' 143 | ] 144 | } 145 | }; 146 | } 147 | 148 | export default Editor; 149 | -------------------------------------------------------------------------------- /ckeditor5/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": [ 4 | "DOM", 5 | "DOM.Iterable" 6 | ], 7 | "noImplicitAny": true, 8 | "noImplicitOverride": true, 9 | "strict": true, 10 | "module": "es6", 11 | "target": "es2019", 12 | "sourceMap": true, 13 | "allowJs": true, 14 | "moduleResolution": "node", 15 | "skipLibCheck": true 16 | }, 17 | "include": [ 18 | "./src" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /ckeditor5/tsconfig.types.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "emitDeclarationOnly": true, 6 | "declarationDir": "build", 7 | "stripInternal": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ckeditor5/webpack.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Copyright (c) 2014-2023, CKSource Holding sp. z o.o. All rights reserved. 3 | * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license 4 | */ 5 | 6 | 'use strict'; 7 | 8 | /* eslint-env node */ 9 | 10 | const path = require( 'path' ); 11 | const webpack = require( 'webpack' ); 12 | const { bundler, styles } = require( '@ckeditor/ckeditor5-dev-utils' ); 13 | const { CKEditorTranslationsPlugin } = require( '@ckeditor/ckeditor5-dev-translations' ); 14 | const TerserWebpackPlugin = require( 'terser-webpack-plugin' ); 15 | 16 | module.exports = { 17 | devtool: 'source-map', 18 | performance: { hints: false }, 19 | 20 | entry: path.resolve( __dirname, 'src', 'ckeditor.ts' ), 21 | 22 | output: { 23 | // The name under which the editor will be exported. 24 | library: 'ClassicEditor', 25 | 26 | path: path.resolve( __dirname, '..', 'ckeditor' ), 27 | filename: 'ckeditor.js', 28 | libraryTarget: 'umd', 29 | libraryExport: 'default' 30 | }, 31 | 32 | optimization: { 33 | minimizer: [ 34 | new TerserWebpackPlugin( { 35 | sourceMap: true, 36 | terserOptions: { 37 | output: { 38 | // Preserve CKEditor 5 license comments. 39 | comments: /^!/ 40 | } 41 | }, 42 | extractComments: false 43 | } ) 44 | ] 45 | }, 46 | 47 | plugins: [ 48 | new CKEditorTranslationsPlugin( { 49 | // UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format. 50 | // When changing the built-in language, remember to also change it in the editor's configuration (src/ckeditor.ts). 51 | language: 'en', 52 | additionalLanguages: 'all' 53 | } ), 54 | new webpack.BannerPlugin( { 55 | banner: bundler.getLicenseBanner(), 56 | raw: true 57 | } ) 58 | ], 59 | 60 | resolve: { 61 | extensions: [ '.ts', '.js', '.json' ] 62 | }, 63 | 64 | module: { 65 | rules: [ { 66 | test: /\.svg$/, 67 | use: [ 'raw-loader' ] 68 | }, { 69 | test: /\.ts$/, 70 | use: 'ts-loader' 71 | }, { 72 | test: /\.css$/, 73 | use: [ { 74 | loader: 'style-loader', 75 | options: { 76 | injectType: 'singletonStyleTag', 77 | attributes: { 78 | 'data-cke': true 79 | } 80 | } 81 | }, { 82 | loader: 'css-loader' 83 | }, { 84 | loader: 'postcss-loader', 85 | options: { 86 | postcssOptions: styles.getPostCssConfig( { 87 | themeImporter: { 88 | themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ) 89 | }, 90 | minify: true 91 | } ) 92 | } 93 | } ] 94 | } ] 95 | } 96 | }; 97 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "h5p/h5p-editor", 3 | "type": "library", 4 | "description": "H5P Editor functionality in PHP", 5 | "keywords": ["h5p","hvp","editor","interactive","content","quiz"], 6 | "homepage": "https://h5p.org", 7 | "license": "GPL-3.0", 8 | "authors": [ 9 | { 10 | "name": "Svein-Tore Griff With", 11 | "email": "with@joubel.com", 12 | "homepage": "http://joubel.com", 13 | "role": "CEO" 14 | }, 15 | { 16 | "name": "Frode Petterson", 17 | "email": "frode.petterson@joubel.com", 18 | "homepage": "http://joubel.com", 19 | "role": "Developer" 20 | } 21 | ], 22 | "require": { 23 | "php": ">=7.0.0" 24 | }, 25 | "autoload": { 26 | "files": [ 27 | "h5peditor.class.php", 28 | "h5peditor-file.class.php", 29 | "h5peditor-ajax.class.php", 30 | "h5peditor-storage.interface.php", 31 | "h5peditor-ajax.interface.php" 32 | ] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /h5peditor-ajax.interface.php: -------------------------------------------------------------------------------- 1 | . 48 | * @param string $language_code 49 | * @return array 50 | */ 51 | public function getTranslations($libraries, $language_code); 52 | } 53 | -------------------------------------------------------------------------------- /h5peditor-file.class.php: -------------------------------------------------------------------------------- 1 | interface = $interface; 22 | 23 | // Create a new result object. 24 | $this->result = new stdClass(); 25 | 26 | // Get the field. 27 | $this->field = json_decode($field); 28 | 29 | // Handle temporarily uploaded form file 30 | if (function_exists('finfo_file')) { 31 | $finfo = finfo_open(FILEINFO_MIME_TYPE); 32 | $this->type = finfo_file($finfo, $_FILES['file']['tmp_name']); 33 | finfo_close($finfo); 34 | } 35 | elseif (function_exists('mime_content_type')) { 36 | // Deprecated, only when finfo isn't available. 37 | $this->type = mime_content_type($_FILES['file']['tmp_name']); 38 | } 39 | else { 40 | $this->type = $_FILES['file']['type']; 41 | } 42 | 43 | $this->extension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION); 44 | $this->size = $_FILES['file']['size']; 45 | } 46 | 47 | /** 48 | * Indicates if an uploaded file was found or not. 49 | * 50 | * @return boolean 51 | */ 52 | public function isLoaded() { 53 | return is_object($this->result); 54 | } 55 | 56 | /** 57 | * Check current file up agains mime types and extensions in the given list. 58 | * 59 | * @param array $mimes List to check against. 60 | * @return boolean 61 | */ 62 | public function check($mimes) { 63 | $ext = strtolower($this->extension); 64 | foreach ($mimes as $mime => $extension) { 65 | if (is_array($extension)) { 66 | // Multiple extensions 67 | if (in_array($ext, $extension)) { 68 | $this->type = $mime; 69 | return TRUE; 70 | } 71 | } 72 | elseif (/*$this->type === $mime && */$ext === $extension) { 73 | // TODO: Either remove everything that has to do with mime types, or make it work 74 | // Currently we're experiencing trouble with mime types on different servers... 75 | $this->type = $mime; 76 | return TRUE; 77 | } 78 | } 79 | return FALSE; 80 | } 81 | 82 | /** 83 | * Validate the file. 84 | * 85 | * @return boolean 86 | */ 87 | public function validate() { 88 | if (isset($this->result->error)) { 89 | return FALSE; 90 | } 91 | 92 | // Check for field type. 93 | if (!isset($this->field->type)) { 94 | $this->result->error = $this->interface->t('Unable to get field type.'); 95 | return FALSE; 96 | } 97 | 98 | $whitelist = explode(' ', $this->interface->getWhitelist( 99 | FALSE, 100 | H5PCore::$defaultContentWhitelist, 101 | H5PCore::$defaultLibraryWhitelistExtras 102 | )); 103 | 104 | // Check if mime type is allowed. 105 | $isValidMime = !isset($this->field->mimes) || in_array($this->type, $this->field->mimes); 106 | $isPhp = substr($this->extension, 0, 3) === 'php'; 107 | $isWhitelisted = in_array(strtolower($this->extension), $whitelist); 108 | if (!$isValidMime || !$isWhitelisted || $isPhp) { 109 | $this->result->error = $this->interface->t("File type isn't allowed."); 110 | return FALSE; 111 | } 112 | 113 | // Type specific validations. 114 | switch ($this->field->type) { 115 | default: 116 | $this->result->error = $this->interface->t('Invalid field type.'); 117 | return FALSE; 118 | 119 | case 'image': 120 | $allowed = array( 121 | 'image/png' => 'png', 122 | 'image/jpeg' => array('jpg', 'jpeg'), 123 | 'image/gif' => 'gif', 124 | ); 125 | if (!$this->check($allowed)) { 126 | $this->result->error = $this->interface->t('Invalid image file format. Use jpg, png or gif.'); 127 | return FALSE; 128 | } 129 | 130 | // Image size from temp file 131 | $image = @getimagesize($_FILES['file']['tmp_name']); 132 | 133 | if (!$image) { 134 | $this->result->error = $this->interface->t('File is not an image.'); 135 | return FALSE; 136 | } 137 | 138 | $this->result->width = $image[0]; 139 | $this->result->height = $image[1]; 140 | $this->result->mime = $this->type; 141 | break; 142 | 143 | case 'audio': 144 | $allowed = array( 145 | 'audio/mpeg' => 'mp3', 146 | 'audio/mp3' => 'mp3', 147 | 'audio/mp4' => 'm4a', 148 | 'audio/x-wav' => 'wav', 149 | 'audio/wav' => 'wav', 150 | //'application/ogg' => 'ogg', 151 | 'audio/ogg' => 'ogg', 152 | //'video/ogg' => 'ogg', 153 | ); 154 | if (!$this->check($allowed)) { 155 | $this->result->error = $this->interface->t('Invalid audio file format. Use mp3 or wav.'); 156 | return FALSE; 157 | 158 | } 159 | 160 | $this->result->mime = $this->type; 161 | break; 162 | 163 | case 'video': 164 | $allowed = array( 165 | 'video/mp4' => 'mp4', 166 | 'video/webm' => 'webm', 167 | // 'application/ogg' => 'ogv', 168 | 'video/ogg' => 'ogv', 169 | ); 170 | if (!$this->check($allowed)) { 171 | $this->result->error = $this->interface->t('Invalid video file format. Use mp4 or webm.'); 172 | return FALSE; 173 | } 174 | 175 | $this->result->mime = $this->type; 176 | break; 177 | 178 | case 'file': 179 | // TODO: Try to get file extension for type and check that it matches the current extension. 180 | $this->result->mime = $this->type; 181 | } 182 | 183 | return TRUE; 184 | } 185 | 186 | /** 187 | * Get the type of the current file. 188 | * 189 | * @return string 190 | */ 191 | public function getType() { 192 | return $this->field->type; 193 | } 194 | 195 | /** 196 | * Get the name of the current file. 197 | * 198 | * @return string 199 | */ 200 | public function getName() { 201 | static $name; 202 | 203 | if (empty($name)) { 204 | $name = uniqid($this->field->name . '-'); 205 | 206 | $matches = array(); 207 | preg_match('/([a-z0-9]{1,})$/i', $_FILES['file']['name'], $matches); 208 | if (isset($matches[0])) { 209 | $name .= '.' . $matches[0]; 210 | } 211 | } 212 | 213 | return $name; 214 | } 215 | 216 | /** 217 | * Get result from file processing. 218 | */ 219 | public function getResult() { 220 | return json_encode($this->result); 221 | } 222 | 223 | /** 224 | * Print result from file processing. 225 | */ 226 | public function printResult() { 227 | $this->result->path = $this->getType() . 's/' . $this->getName() . '#tmp'; 228 | 229 | // text/plain is used to support IE 230 | header('Cache-Control: no-cache'); 231 | header('Content-Type: text/plain; charset=utf-8'); 232 | 233 | print $this->getResult(); 234 | } 235 | } 236 | -------------------------------------------------------------------------------- /h5peditor-storage.interface.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 36 | 38 | 40 | 43 | 44 | 45 | 52 | -------------------------------------------------------------------------------- /images/cropper/confirm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 36 | 38 | 40 | 43 | 44 | 45 | 58 | -------------------------------------------------------------------------------- /images/cropper/crop.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 36 | 38 | 40 | 43 | 44 | 45 | 52 | -------------------------------------------------------------------------------- /images/cropper/rotate-left.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 36 | 38 | 41 | 46 | 51 | 56 | 59 | 64 | 65 | 84 | -------------------------------------------------------------------------------- /images/cropper/rotate-right.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 36 | 38 | 41 | 46 | 51 | 56 | 61 | 66 | 67 | 86 | -------------------------------------------------------------------------------- /images/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h5p/h5p-editor-php-library/f3a60ec2bdbe410cb2b11e8f8cb4cf206c41364b/images/down.png -------------------------------------------------------------------------------- /images/expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h5p/h5p-editor-php-library/f3a60ec2bdbe410cb2b11e8f8cb4cf206c41364b/images/expand.png -------------------------------------------------------------------------------- /images/order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h5p/h5p-editor-php-library/f3a60ec2bdbe410cb2b11e8f8cb4cf206c41364b/images/order.png -------------------------------------------------------------------------------- /images/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h5p/h5p-editor-php-library/f3a60ec2bdbe410cb2b11e8f8cb4cf206c41364b/images/remove.png -------------------------------------------------------------------------------- /images/transparent-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h5p/h5p-editor-php-library/f3a60ec2bdbe410cb2b11e8f8cb4cf206c41364b/images/transparent-background.png -------------------------------------------------------------------------------- /images/webm-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h5p/h5p-editor-php-library/f3a60ec2bdbe410cb2b11e8f8cb4cf206c41364b/images/webm-file.png -------------------------------------------------------------------------------- /libs/cropper.css: -------------------------------------------------------------------------------- 1 | .cropper-inline { 2 | display: inline-block; 3 | } 4 | .cropper-hidden { 5 | display: none; 6 | } 7 | .cropper-buttons { 8 | background-color: #2f323a; 9 | text-align: center; 10 | padding: 35px; 11 | user-select: none; 12 | } 13 | .cropper-button { 14 | position: relative; 15 | border: 3px solid #2f323a; 16 | border-radius: 11px; 17 | margin: 0 5px 0 5px; 18 | padding: 10px; 19 | display: inline-grid; 20 | align-items: center; 21 | grid-template-columns: 23px auto; 22 | column-gap: 5px; 23 | } 24 | .cropper-image-button { 25 | column-gap: 0; 26 | } 27 | .cropper-button:hover { 28 | background-color: #111111; 29 | border: 3px solid #9096a8; 30 | cursor: pointer; 31 | } 32 | .cropper-icon { 33 | display: inline-block; 34 | min-width: 23px; 35 | height: 23px; 36 | background-repeat: no-repeat; 37 | } 38 | .cropper-rotate-left { 39 | background-image: url("../images/cropper/rotate-left.svg"); 40 | } 41 | .cropper-rotate-right { 42 | background-image: url("../images/cropper/rotate-right.svg"); 43 | } 44 | .cropper-crop { 45 | background-image: url("../images/cropper/crop.svg"); 46 | } 47 | .cropper-confirm { 48 | background-image: url("../images/cropper/confirm.svg"); 49 | } 50 | .cropper-confirm-text { 51 | color: #a0e9a3; 52 | } 53 | .cropper-cancel { 54 | background-image: url("../images/cropper/cancel.svg"); 55 | } 56 | .cropper-cancel-text { 57 | color: #fcaaaa; 58 | } 59 | .cropper-canvas-container { 60 | position: relative; 61 | } 62 | .cropper-canvas-container canvas { 63 | display: block; 64 | } 65 | .cropper-selector-border { 66 | width: 100%; 67 | height: 100%; 68 | position: relative; 69 | left: -1px; 70 | top: -1px; 71 | border: 1px solid #3c7eff; 72 | display: grid; 73 | grid-template-areas: 74 | "top-left top top-righ" 75 | "center-left center center-right" 76 | "bottom-left bottom bottom-right"; 77 | grid-template-rows: calc(100% / 3 - 1px) calc(100% / 3) calc(100% / 3 - 1px); 78 | grid-template-columns: calc(100% / 3 - 1px) calc(100% / 3) calc(100% / 3 - 1px); 79 | } 80 | .cropper-selector-border div { 81 | border: dashed #3c7eff; 82 | border-width: 0; 83 | } 84 | .cropper-selector-border .cropper-border-top-left { 85 | border-width: 0 1px 1px 0; 86 | } 87 | .cropper-selector-border .cropper-border-top { 88 | border-width: 0 0 1px 0; 89 | } 90 | .cropper-selector-border .cropper-border-top-right { 91 | border-width: 0 0 1px 1px; 92 | } 93 | .cropper-selector-border .cropper-border-center-left { 94 | border-width: 0 1px 0 0; 95 | } 96 | .cropper-selector-border .cropper-border-center-right { 97 | border-width: 0 0 0 1px; 98 | } 99 | .cropper-selector-border .cropper-border-bottom-left { 100 | border-width: 1px 1px 0 0; 101 | } 102 | .cropper-selector-border .cropper-border-bottom { 103 | border-width: 1px 0 0 0; 104 | } 105 | .cropper-selector-border .cropper-border-bottom-right { 106 | border-width: 1px 0 0 1px; 107 | } 108 | .cropper-selector { 109 | display: none; 110 | position: absolute; 111 | width: 50px; 112 | height: 50px; 113 | left: 0px; 114 | top: 0px; 115 | background-color: transparent; 116 | cursor: move; 117 | } 118 | .cropper-selector .cropper-handle { 119 | position: absolute; 120 | background-color: white; 121 | width: 8px; 122 | height: 8px; 123 | border: 1px solid #3c7eff; 124 | border-radius: 5px; 125 | transition: opacity 0.25s ease-out; 126 | } 127 | .cropper-selector .cropper-top-left { 128 | left: -5px; 129 | top: -5px; 130 | cursor: nw-resize; 131 | } 132 | .cropper-selector .cropper-top { 133 | left: calc(50% - 16px); 134 | top: -4px; 135 | width: 30px; 136 | height: 6px; 137 | cursor: n-resize; 138 | } 139 | .cropper-selector .cropper-top-right { 140 | right: -5px; 141 | top: -5px; 142 | cursor: ne-resize; 143 | } 144 | .cropper-selector .cropper-left { 145 | left: -4px; 146 | top: calc(50% - 16px); 147 | width: 6px; 148 | height: 30px; 149 | cursor: w-resize; 150 | } 151 | .cropper-selector .cropper-right { 152 | right: -4px; 153 | top: calc(50% - 16px); 154 | width: 6px; 155 | height: 30px; 156 | cursor: e-resize; 157 | } 158 | .cropper-selector .cropper-bottom-left { 159 | left: -5px; 160 | bottom: -5px; 161 | cursor: sw-resize; 162 | } 163 | .cropper-selector .cropper-bottom { 164 | left: calc(50% - 16px); 165 | bottom: -4px; 166 | width: 30px; 167 | height: 6px; 168 | cursor: s-resize; 169 | } 170 | .cropper-selector .cropper-bottom-right { 171 | right: -5px; 172 | bottom: -5px; 173 | cursor: se-resize; 174 | } 175 | .cropper-mask { 176 | position: absolute; 177 | background-color: #2f323a; 178 | opacity: 0.5; 179 | display: none; 180 | } 181 | .cropper-h5p-tooltip { 182 | bottom: unset; 183 | top: -30px; 184 | border-radius: 5px; 185 | animation: none; 186 | z-index: 999; 187 | } 188 | .h5p-editing-image-popup { 189 | border: 1px solid #9e9e9e; 190 | } 191 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "h5p-editor-php-library", 3 | "version": "1.0.0", 4 | "description": "A general library that is supposed to be used in most PHP implementations of H5P.", 5 | "scripts": { 6 | "build": "webpack && rm styles/css/index.js", 7 | "watch": "webpack --watch" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "SEE LICENSE IN README.md", 12 | "devDependencies": { 13 | "copy-webpack-plugin": "^12.0.2", 14 | "css-loader": "^6.10.0", 15 | "h5p-image-cropper": "github:h5p/h5p-image-cropper", 16 | "mini-css-extract-plugin": "^2.8.1", 17 | "sass": "^1.72.0", 18 | "sass-loader": "^14.1.1", 19 | "style-loader": "^3.3.4", 20 | "webpack": "^5.94.0", 21 | "webpack-cli": "^5.1.4", 22 | "zebra_datepicker": "1.9.11" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /scripts/h5peditor-boolean.js: -------------------------------------------------------------------------------- 1 | /* global ns */ 2 | /** 3 | * Creates a boolean field for the editor. 4 | * 5 | * @param {mixed} parent 6 | * @param {object} field 7 | * @param {mixed} params 8 | * @param {function} setValue 9 | * @returns {ns.Boolean} 10 | */ 11 | ns.Boolean = function (parent, field, params, setValue) { 12 | if (params === undefined) { 13 | this.value = false; 14 | setValue(field, this.value); 15 | } 16 | else { 17 | this.value = params; 18 | } 19 | 20 | this.field = field; 21 | this.setValue = setValue; 22 | 23 | // Setup event dispatching on change 24 | this.changes = []; 25 | this.triggerListeners = function (value) { 26 | // Run callbacks 27 | for (var i = 0; i < this.changes.length; i++) { 28 | this.changes[i](value); 29 | } 30 | }; 31 | }; 32 | 33 | /** 34 | * Create HTML for the boolean field. 35 | */ 36 | ns.Boolean.prototype.createHtml = function () { 37 | const id = ns.getNextFieldId(this.field); 38 | const checked = (this.value !== undefined && this.value) ? ' checked' : ''; 39 | let content = ' that.field.max[property]) { 176 | that.$errors.append(ns.createError(ns.t('core', 'exceedsMax', {':property': property, ':max': that.field.max[property]}))); 177 | return false; 178 | } 179 | 180 | coordinates[property] = value; 181 | }); 182 | 183 | return ns.checkErrors(this.$errors, this.$inputs, coordinates); 184 | }; 185 | 186 | /** 187 | * Remove this item. 188 | */ 189 | ns.Coordinates.prototype.remove = function () { 190 | this.$item.remove(); 191 | }; 192 | 193 | // Tell the editor what widget we are. 194 | ns.widgets.coordinates = ns.Coordinates; 195 | -------------------------------------------------------------------------------- /scripts/h5peditor-dimensions.js: -------------------------------------------------------------------------------- 1 | /* global ns */ 2 | /** 3 | * Adds a dimensions field to the form. 4 | * 5 | * TODO: Make it possible to lock width/height ratio. 6 | * 7 | * @param {mixed} parent 8 | * @param {object} field 9 | * @param {mixed} params 10 | * @param {function} setValue 11 | * @returns {ns.Dimensions} 12 | */ 13 | ns.Dimensions = function (parent, field, params, setValue) { 14 | var that = this; 15 | 16 | this.parent = parent; 17 | this.field = field; 18 | this.changes = []; 19 | 20 | // Find image field to get max size from. 21 | H5PEditor.followField(parent, field.max, function (file) { 22 | that.setMax(file); 23 | }); 24 | 25 | // Find image field to get default size from. 26 | H5PEditor.followField(parent, field['default'], function (file) { 27 | // Make sure we don't set size if we have one in the default params. 28 | if (params.width === undefined) { 29 | that.setSize(file); 30 | } 31 | }); 32 | 33 | this.params = params; 34 | this.setValue = setValue; 35 | 36 | // Remove default field from params to avoid saving it. 37 | if (this.params.field) { 38 | this.params.field = undefined; 39 | } 40 | }; 41 | 42 | /** 43 | * Set max dimensions. 44 | * 45 | * @param {Object} file 46 | * @returns {unresolved} 47 | */ 48 | ns.Dimensions.prototype.setMax = function (file) { 49 | if (file === undefined) { 50 | return; 51 | } 52 | 53 | this.max = { 54 | width: parseInt(file.width), 55 | height: parseInt(file.height) 56 | }; 57 | }; 58 | 59 | /** 60 | * Set current dimensions. 61 | * 62 | * @param {string} width 63 | * @param {string} height 64 | * @returns {undefined} 65 | */ 66 | ns.Dimensions.prototype.setSize = function (file) { 67 | if (file === undefined) { 68 | return; 69 | } 70 | 71 | this.params = { 72 | width: parseInt(file.width), 73 | height: parseInt(file.height) 74 | }; 75 | this.setValue(this.field, this.params); 76 | 77 | this.$inputs.filter(':eq(0)').val(file.width).next().val(file.height); 78 | 79 | for (var i = 0; i < this.changes.length; i++) { 80 | this.changes[i](file.width, file.height); 81 | } 82 | }; 83 | 84 | /** 85 | * Append the field to the given wrapper. 86 | * 87 | * @param {jQuery} $wrapper 88 | * @returns {undefined} 89 | */ 90 | ns.Dimensions.prototype.appendTo = function ($wrapper) { 91 | var that = this; 92 | 93 | this.$item = ns.$(this.createHtml()).appendTo($wrapper); 94 | this.$inputs = this.$item.find('input'); 95 | this.$errors = this.$item.children('.h5p-errors'); 96 | 97 | this.$inputs.change(function () { 98 | // Validate 99 | var value = that.validate(); 100 | 101 | if (value) { 102 | // Set param 103 | that.params = value; 104 | that.setValue(that.field, value); 105 | 106 | for (var i = 0; i < that.changes.length; i++) { 107 | that.changes[i](value.width, value.height); 108 | } 109 | } 110 | }).click(function () { 111 | return false; 112 | }); 113 | }; 114 | 115 | /** 116 | * Create HTML for the field. 117 | */ 118 | ns.Dimensions.prototype.createHtml = function () { 119 | const id = ns.getNextFieldId(this.field); 120 | const descriptionId = (this.field.description !== undefined ? ns.getDescriptionId(id) : undefined) 121 | 122 | var input = 123 | ns.createText(this.params !== undefined ? this.params.width : undefined, 15, ns.t('core', 'width'), id, descriptionId) + 124 | ' x ' + 125 | ns.createText(this.params !== undefined ? this.params.height : undefined, 15, ns.t('core', 'height'), undefined, descriptionId); 126 | 127 | return ns.createFieldMarkup(this.field, input, id); 128 | }; 129 | 130 | /** 131 | * Validate the current text field. 132 | */ 133 | ns.Dimensions.prototype.validate = function () { 134 | var that = this; 135 | var size = {}; 136 | 137 | this.$errors.html(''); 138 | 139 | this.$inputs.each(function (i) { 140 | var $input = ns.$(this); 141 | var value = H5P.trim($input.val()); 142 | var property = i ? 'height' : 'width'; 143 | var propertyTranslated = ns.t('core', property); 144 | 145 | if ((that.field.optional === undefined || !that.field.optional) && !value.length) { 146 | that.$errors.append(ns.createError(ns.t('core', 'requiredProperty', {':property': propertyTranslated}))); 147 | return false; 148 | } 149 | else if (!value.match(new RegExp('^[0-9]+$'))) { 150 | that.$errors.append(ns.createError(ns.t('core', 'onlyNumbers', {':property': propertyTranslated}))); 151 | return false; 152 | } 153 | 154 | value = parseInt(value); 155 | if (that.max !== undefined && value > that.max[property]) { 156 | that.$errors.append(ns.createError(ns.t('core', 'exceedsMax', {':property': propertyTranslated, ':max': that.max[property]}))); 157 | return false; 158 | } 159 | 160 | size[property] = value; 161 | }); 162 | 163 | return ns.checkErrors(this.$errors, this.$inputs, size); 164 | }; 165 | 166 | /** 167 | * Remove this item. 168 | */ 169 | ns.Dimensions.prototype.remove = function () { 170 | this.$item.remove(); 171 | }; 172 | 173 | // Tell the editor what widget we are. 174 | ns.widgets.dimensions = ns.Dimensions; 175 | -------------------------------------------------------------------------------- /scripts/h5peditor-file-uploader.js: -------------------------------------------------------------------------------- 1 | H5PEditor.FileUploader = (function ($, EventDispatcher) { 2 | 3 | /** 4 | * File Upload API for H5P 5 | * 6 | * @class H5PEditor.FileUploader 7 | * @extends H5P.EventDispatcher 8 | * @param {Object} field Required for validating the uploaded file 9 | */ 10 | function FileUploader(field) { 11 | var self = this; 12 | 13 | // Initialize event inheritance 14 | EventDispatcher.call(self); 15 | 16 | /** 17 | * Triggers the actual upload of the file. 18 | * 19 | * @param {Blob|File} file 20 | * @param {string} filename Required due to validation 21 | */ 22 | self.upload = function (file, filename) { 23 | var formData = new FormData(); 24 | formData.append('file', file, filename); 25 | formData.append('field', JSON.stringify(field)); 26 | formData.append('contentId', H5PEditor.contentId || 0); 27 | 28 | // Submit the form 29 | var request = new XMLHttpRequest(); 30 | request.upload.onprogress = function (e) { 31 | if (e.lengthComputable) { 32 | self.trigger('uploadProgress', (e.loaded / e.total)); 33 | } 34 | }; 35 | request.onload = function () { 36 | var result; 37 | var uploadComplete = { 38 | error: null, 39 | data: null 40 | }; 41 | 42 | try { 43 | result = JSON.parse(request.responseText); 44 | } 45 | catch (err) { 46 | H5P.error(err); 47 | // Add error data to event object 48 | uploadComplete.error = H5PEditor.t('core', 'fileToLarge'); 49 | } 50 | 51 | if (result !== undefined) { 52 | if (result.error !== undefined) { 53 | uploadComplete.error = result.error; 54 | } 55 | if (result.success === false) { 56 | uploadComplete.error = (result.message ? result.message : H5PEditor.t('core', 'unknownFileUploadError')); 57 | } 58 | } 59 | 60 | if (uploadComplete.error === null) { 61 | // No problems, add response data to event object 62 | uploadComplete.data = result; 63 | } 64 | 65 | // Allow the widget to process the result 66 | self.trigger('uploadComplete', uploadComplete); 67 | }; 68 | 69 | request.open('POST', H5PEditor.getAjaxUrl('files'), true); 70 | request.send(formData); 71 | self.trigger('upload'); 72 | }; 73 | 74 | /** 75 | * Upload the list of file objects. 76 | * TODO: Future improvement, iterate for multiple files 77 | * 78 | * @param {File[]} files 79 | */ 80 | self.uploadFiles = function (files) { 81 | self.upload(files[0], files[0].name); 82 | }; 83 | 84 | /** 85 | * Open the file selector and trigger upload upon selecting file. 86 | */ 87 | self.openFileSelector = function () { 88 | // Create a file selector 89 | const input = document.createElement('input'); 90 | input.type = 'file'; 91 | input.setAttribute('accept', determineAllowedMimeTypes()); 92 | input.style='display:none'; 93 | input.addEventListener('change', function () { 94 | // When files are selected, upload them 95 | self.uploadFiles(this.files); 96 | document.body.removeChild(input); 97 | }); 98 | 99 | document.body.appendChild(input); 100 | // Open file selector 101 | input.click(); 102 | }; 103 | 104 | /** 105 | * Determine allowed file mimes. Used to make it easier to find and 106 | * select the correct file. 107 | * 108 | * @return {string} 109 | */ 110 | const determineAllowedMimeTypes = function () { 111 | if (field.mimes) { 112 | return field.mimes.join(','); 113 | } 114 | 115 | switch (field.type) { 116 | case 'image': 117 | return 'image/jpeg,image/png,image/gif'; 118 | case 'audio': 119 | return 'audio/mpeg,audio/x-wav,audio/ogg,audio/mp4'; 120 | case 'video': 121 | return 'video/mp4,video/webm,video/ogg'; 122 | } 123 | } 124 | } 125 | 126 | // Extends the event dispatcher 127 | FileUploader.prototype = Object.create(EventDispatcher.prototype); 128 | FileUploader.prototype.constructor = FileUploader; 129 | 130 | return FileUploader; 131 | })(H5P.jQuery, H5P.EventDispatcher); 132 | -------------------------------------------------------------------------------- /scripts/h5peditor-fullscreen-bar.js: -------------------------------------------------------------------------------- 1 | /* global H5PEditor */ 2 | H5PEditor.FullscreenBar = (function ($) { 3 | function FullscreenBar ($mainForm, library) { 4 | 5 | const title = H5PEditor.libraryCache[library] ? H5PEditor.libraryCache[library].title : library; 6 | const iconId = library.split(' ')[0].split('.')[1].toLowerCase(); 7 | 8 | let isInFullscreen = false; 9 | let exitSemiFullscreen; 10 | 11 | $mainForm.addClass('h5peditor-form-manager'); 12 | 13 | // Add fullscreen bar 14 | const $bar = ns.$('
', { 15 | 'class': 'h5peditor-form-manager-head' 16 | }) 17 | 18 | const $breadcrumb = ns.$('
', { 19 | 'class': 'h5peditor-form-manager-breadcrumb', 20 | appendTo: $bar 21 | }); 22 | 23 | const $title = ns.$('
', { 24 | 'class': 'h5peditor-form-manager-title ' + iconId, 25 | text: title, 26 | appendTo: $breadcrumb 27 | }); 28 | 29 | const fullscreenButton = createButton('fullscreen', '', function () { 30 | if (isInFullscreen) { 31 | // Trigger semi-fullscreen exit 32 | exitSemiFullscreen(); 33 | } 34 | else { 35 | // Trigger semi-fullscreen enter 36 | exitSemiFullscreen = H5PEditor.semiFullscreen($mainForm, function () { 37 | fullscreenButton.setAttribute('aria-label', H5PEditor.t('core', 'exitFullscreenButtonLabel')); 38 | isInFullscreen = true; 39 | }, function () { 40 | fullscreenButton.setAttribute('aria-label', H5PEditor.t('core', 'enterFullscreenButtonLabel')) 41 | isInFullscreen = false; 42 | }); 43 | } 44 | }, H5PEditor.t('core', 'enterFullscreenButtonLabel')); 45 | 46 | // Create 'Proceed to save' button 47 | const proceedButton = createButton('proceed', H5PEditor.t('core', 'proceedButtonLabel'), function () { 48 | exitSemiFullscreen(); 49 | }); 50 | 51 | $bar.append(proceedButton); 52 | $bar.append(fullscreenButton); 53 | $mainForm.prepend($bar); 54 | } 55 | 56 | /** 57 | * Helper for creating buttons. 58 | * 59 | * @private 60 | * @param {string} id 61 | * @param {string} text 62 | * @param {function} clickHandler 63 | * @param {string} ariaLabel 64 | * @return {Element} 65 | */ 66 | const createButton = function (id, text, clickHandler, ariaLabel) { 67 | if (ariaLabel === undefined) { 68 | ariaLabel = text; 69 | } 70 | 71 | const button = document.createElement('button'); 72 | button.setAttribute('type', 'button'); 73 | button.classList.add('h5peditor-form-manager-button'); 74 | button.classList.add('h5peditor-form-manager-' + id); 75 | button.setAttribute('aria-label', ariaLabel); 76 | button.addEventListener('click', clickHandler); 77 | 78 | // Create special inner filler to avoid focus from pointer devices. 79 | const content = document.createElement('span'); 80 | content.classList.add('h5peditor-form-manager-button-inner'); 81 | content.innerText = text 82 | content.tabIndex = -1; 83 | button.appendChild(content); 84 | 85 | return button; 86 | }; 87 | 88 | return FullscreenBar; 89 | }(ns.jQuery)); 90 | -------------------------------------------------------------------------------- /scripts/h5peditor-init.js: -------------------------------------------------------------------------------- 1 | (function ($, ns) { 2 | H5PEditor.init = function ($form, $type, $upload, $create, $editor, $library, $params, $maxScore, $title, cancelSubmitCallback) { 3 | H5PEditor.$ = H5P.jQuery; 4 | H5PEditor.basePath = H5PIntegration.editor.libraryUrl; 5 | H5PEditor.fileIcon = H5PIntegration.editor.fileIcon; 6 | H5PEditor.ajaxPath = H5PIntegration.editor.ajaxPath; 7 | H5PEditor.filesPath = H5PIntegration.editor.filesPath; 8 | H5PEditor.apiVersion = H5PIntegration.editor.apiVersion; 9 | H5PEditor.contentLanguage = H5PIntegration.editor.language; 10 | 11 | // Semantics describing what copyright information can be stored for media. 12 | H5PEditor.copyrightSemantics = H5PIntegration.editor.copyrightSemantics; 13 | H5PEditor.metadataSemantics = H5PIntegration.editor.metadataSemantics; 14 | 15 | // Required styles and scripts for the editor 16 | H5PEditor.assets = H5PIntegration.editor.assets; 17 | 18 | // Required for assets 19 | H5PEditor.baseUrl = ''; 20 | H5PEditor.enableContentHub = H5PIntegration.editor.enableContentHub; 21 | 22 | if (H5PIntegration.editor.nodeVersionId !== undefined) { 23 | H5PEditor.contentId = H5PIntegration.editor.nodeVersionId; 24 | } 25 | 26 | if (H5PIntegration.editor.hub !== undefined) { 27 | H5PIntegration.Hub = { 28 | contentSearchUrl: H5PIntegration.editor.hub.contentSearchUrl 29 | }; 30 | } 31 | 32 | var h5peditor; 33 | $create.hide(); 34 | var library = $library.val(); 35 | 36 | $type.change(function () { 37 | if ($type.filter(':checked').val() === 'upload') { 38 | $create.hide(); 39 | $upload.show(); 40 | } 41 | else { 42 | $upload.hide(); 43 | if (h5peditor === undefined) { 44 | h5peditor = new ns.Editor(library, $params.val(), $editor[0]); 45 | } 46 | $create.show(); 47 | } 48 | }); 49 | 50 | if ($type.filter(':checked').val() === 'upload') { 51 | $type.change(); 52 | } 53 | else { 54 | $type.filter('input[value="create"]').attr('checked', true).change(); 55 | } 56 | 57 | // Duplicate the submit button input because it is not posted when calling $form.submit() 58 | const $submitters = $form.find('input[type="submit"]'); 59 | let isCanceling = false; 60 | $submitters.click(function () { 61 | // Create hidden input and give it the value 62 | const name = $(this).prop('name'); 63 | const value = $(this).prop('value'); 64 | $('').appendTo($form); 65 | 66 | // Allow caller to cancel validation and submission of form on button click 67 | if (cancelSubmitCallback) { 68 | isCanceling = cancelSubmitCallback($(this)); 69 | } 70 | }); 71 | 72 | let formIsUpdated = false; 73 | $form.submit(function (event) { 74 | if ($type.length && $type.filter(':checked').val() === 'upload') { 75 | return; // Old file upload 76 | } 77 | 78 | if (isCanceling) { 79 | return; 80 | } 81 | 82 | if (h5peditor !== undefined && !formIsUpdated) { 83 | 84 | // Get content from editor 85 | h5peditor.getContent(function (content) { 86 | 87 | // Set the title field to the metadata title if the field exists 88 | $title.val(content.title); 89 | 90 | // Set main library 91 | $library.val(content.library); 92 | 93 | // Set params 94 | $params.val(content.params); 95 | 96 | // Submit form data 97 | formIsUpdated = true; 98 | $form.submit(); 99 | }); 100 | 101 | // Stop default submit 102 | event.preventDefault(); 103 | } 104 | }); 105 | }; 106 | 107 | H5PEditor.getAjaxUrl = function (action, parameters) { 108 | var url = H5PIntegration.editor.ajaxPath + action; 109 | 110 | if (parameters !== undefined) { 111 | var separator = url.indexOf('?') === -1 ? '?' : '&'; 112 | for (var property in parameters) { 113 | if (parameters.hasOwnProperty(property)) { 114 | url += separator + property + '=' + parameters[property]; 115 | separator = '&'; 116 | } 117 | } 118 | } 119 | 120 | return url; 121 | }; 122 | })(H5P.jQuery, H5PEditor); 123 | -------------------------------------------------------------------------------- /scripts/h5peditor-library-list-cache.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The library list cache 3 | * 4 | * @type Object 5 | */ 6 | var llc = H5PEditor.LibraryListCache = { 7 | libraryCache: {}, 8 | librariesComingIn: {}, 9 | librariesMissing: {}, 10 | que: [] 11 | }; 12 | 13 | /** 14 | * Get data for a list of libraries 15 | * 16 | * @param {Array} libraries - list of libraries to load info for (uber names) 17 | * @param {Function} handler - Callback when list of libraries is loaded 18 | * @param {Function} [thisArg] - Context for the callback function 19 | */ 20 | llc.getLibraries = function (libraries, handler, thisArg) { 21 | // Determine whether we're dealing with simple library strings or objects 22 | libraries = libraries.map(function (option) { 23 | return (typeof option === 'object') ? option.name : option; 24 | }); 25 | 26 | var cachedLibraries = []; 27 | var status = 'hasAll'; 28 | for (var i = 0; i < libraries.length; i++) { 29 | if (libraries[i] in llc.libraryCache) { 30 | // Libraries that are missing on the server are set to null... 31 | if (llc.libraryCache[libraries[i]] !== null) { 32 | cachedLibraries.push(llc.libraryCache[libraries[i]]); 33 | } 34 | } 35 | else if (libraries[i] in llc.librariesComingIn) { 36 | if (status === 'hasAll') { 37 | status = 'onTheWay'; 38 | } 39 | } 40 | else { 41 | status = 'requestThem'; 42 | llc.librariesComingIn[libraries[i]] = true; 43 | } 44 | } 45 | switch (status) { 46 | case 'hasAll': 47 | handler.call(thisArg, cachedLibraries); 48 | break; 49 | case 'onTheWay': 50 | llc.que.push({libraries: libraries, handler: handler, thisArg: thisArg}); 51 | break; 52 | case 'requestThem': 53 | var ajaxParams = { 54 | type: "POST", 55 | url: H5PEditor.getAjaxUrl('libraries'), 56 | success: function (data) { 57 | llc.setLibraries(data, libraries); 58 | handler.call(thisArg, data); 59 | llc.runQue(); 60 | }, 61 | data: { 62 | 'libraries': libraries 63 | }, 64 | dataType: "json" 65 | }; 66 | H5PEditor.$.ajax(ajaxParams); 67 | break; 68 | } 69 | }; 70 | 71 | /** 72 | * Call all qued handlers 73 | */ 74 | llc.runQue = function () { 75 | var l = llc.que.length; 76 | for (var i = 0; i < l; i++) { 77 | var handlerObject = llc.que.shift(); 78 | llc.getLibraries(handlerObject.libraries, handlerObject.handler, handlerObject.thisArg); 79 | } 80 | }; 81 | 82 | /** 83 | * We've got new libraries from the server, save them 84 | * 85 | * @param {Array} libraries - Libraries with info from server 86 | * @param {Array} requestedLibraries - List of what libraries we requested 87 | */ 88 | llc.setLibraries = function (libraries, requestedLibraries) { 89 | var reqLibraries = requestedLibraries.slice(); 90 | for (var i = 0; i < libraries.length; i++) { 91 | llc.libraryCache[libraries[i].uberName] = libraries[i]; 92 | if (libraries[i].uberName in llc.librariesComingIn) { 93 | delete llc.librariesComingIn[libraries[i].uberName]; 94 | } 95 | var index = reqLibraries.indexOf(libraries[i].uberName); 96 | if (index > -1) { 97 | reqLibraries.splice(index, 1); 98 | } 99 | } 100 | for (i = 0; i < reqLibraries.length; i++) { 101 | llc.libraryCache[reqLibraries[i]] = null; 102 | if (reqLibraries[i] in llc.librariesComingIn) { 103 | delete llc.librariesComingIn[libraries[i]]; 104 | } 105 | } 106 | }; 107 | 108 | /** 109 | * Creates a default content title, based on the title of the library 110 | * @param {String} uberName " ." 111 | * @return {String} 112 | */ 113 | llc.getDefaultTitle = function (uberName) { 114 | var libraryMetadata = llc.libraryCache[uberName]; 115 | var title = libraryMetadata && libraryMetadata.title ? libraryMetadata.title : ''; 116 | return H5PEditor.t('core', 'untitled').replace(':libraryTitle', title); 117 | }; 118 | -------------------------------------------------------------------------------- /scripts/h5peditor-metadata-author-widget.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a widget to add author information to a form 3 | * 4 | * @param {object} semantics 5 | * @param {object} params 6 | * @param {object} group 7 | * @param {mixed} parent used in processSemanticsChunk() 8 | * @returns {ns.Coordinates} 9 | */ 10 | H5PEditor.metadataAuthorWidget = function (semantics, params, $wrapper, parent) { 11 | if (!params.authors) { 12 | params.authors = []; 13 | } 14 | 15 | const $ = H5PEditor.$; 16 | 17 | const widget = $(''); 18 | 19 | var $authorData = $('
'); 20 | widget.append($authorData); 21 | 22 | H5PEditor.processSemanticsChunk(semantics, {}, $authorData, parent); 23 | 24 | // Get references to the fields 25 | var nameField = H5PEditor.findField('name', parent); 26 | var roleField = H5PEditor.findField('role', parent); 27 | 28 | var $button = $('
' + 29 | '' + 32 | '
').children('button').click(function (event) { 33 | 34 | // Temporarily set name as mandatory to get the error messages only when 35 | // clicking the Add Author button 36 | nameField.field.optional = false; 37 | var name = nameField.validate(); 38 | nameField.field.optional = true; 39 | var role = roleField.validate(); 40 | 41 | if (!name) { 42 | return; 43 | } 44 | 45 | // Don't add author if already in list with the same role 46 | const authorDuplicate = params.authors.some(function (author) { 47 | return author.name === name && author.role === role; 48 | }); 49 | if (authorDuplicate) { 50 | resetForm(); 51 | return; 52 | } 53 | 54 | addAuthor(name, role); 55 | }).end(); 56 | $authorData.append($button); 57 | 58 | var authorListWrapper = $('
    '); 59 | widget.append(authorListWrapper); 60 | renderAuthorList(); 61 | 62 | widget.appendTo($wrapper); 63 | 64 | /** 65 | * Add an author to the list of authors 66 | * @param {string} [name] 67 | * @param {string} [role] 68 | */ 69 | function addAuthor(name, role) { 70 | params.authors.push({ 71 | name: name, 72 | role: role 73 | }); 74 | 75 | renderAuthorList(); 76 | resetForm(); 77 | } 78 | 79 | /** 80 | * Add default/current author to list of authors 81 | * 82 | * @param {string} fallbackName Name to fallback to if there is no valid name chosen already 83 | * @param {string} fallbackRole Role to fallback to if there is no valid role chosen already 84 | */ 85 | function addDefaultAuthor(fallbackName, fallbackRole) { 86 | var name = nameField.validate(); 87 | 88 | if (!name) { 89 | name = fallbackName; 90 | } 91 | 92 | var role = roleField.validate(); 93 | 94 | if (!role) { 95 | role = fallbackRole; 96 | } 97 | 98 | addAuthor(name, role); 99 | } 100 | 101 | /** 102 | * Resets the form 103 | */ 104 | function resetForm() { 105 | nameField.$input.val(''); 106 | } 107 | 108 | /** 109 | * Remove author from list. 110 | * 111 | * @param {object} author - Author to be removed. 112 | * @param {string} author.name - Author name. 113 | * @param {string} author.role - Author role. 114 | */ 115 | function removeAuthor(author) { 116 | params.authors = params.authors.filter(function (e) { 117 | return (e !== author); 118 | }); 119 | 120 | renderAuthorList(); 121 | } 122 | 123 | function renderAuthorList() { 124 | var wrapper = widget.find('.h5p-author-list-wrapper'); 125 | wrapper.empty(); 126 | 127 | const authorList = $('
      '); 128 | params.authors.forEach(function (author) { 129 | // Name and role 130 | var listItem = $('
    • ', { 131 | html: H5PEditor.htmlspecialchars(author.name), 132 | append: $('', { 133 | 'class': 'h5p-metadata-role', 134 | html: author.role 135 | }) 136 | }); 137 | 138 | // The delete-button 139 | $('