diff options
| author | Marcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de> | 2022-08-30 03:06:50 +0000 |
|---|---|---|
| committer | Marcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de> | 2022-08-30 03:06:50 +0000 |
| commit | 4573c1c71b7c38cb5dfdb68222fa501109b262cf (patch) | |
| tree | f82d10b7f7abe745426f2fc9754e2f9249bd77cf /resources/assets/javascripts/cke | |
| parent | b6e68eada103fd3a8eca55c3751a778da9d5f624 (diff) | |
StEP00368: Update des CKEditors auf v5
Closes #1083, #1226, #1154, and #1088
Merge request studip/studip!641
Diffstat (limited to 'resources/assets/javascripts/cke')
20 files changed, 1713 insertions, 0 deletions
diff --git a/resources/assets/javascripts/cke/StudipSettings.js b/resources/assets/javascripts/cke/StudipSettings.js new file mode 100644 index 0000000..db92c05 --- /dev/null +++ b/resources/assets/javascripts/cke/StudipSettings.js @@ -0,0 +1,138 @@ +import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { createDropdown, ButtonView, View } from 'ckeditor5/src/ui'; +import { $gettext } from '../lib/gettext.js'; + +const settings = { + url: STUDIP.URLHelper.resolveURL('dispatch.php/wysiwyg/settings/users/current'), + save: function (data) { + return $.ajax({ + url: this.url, + type: 'PUT', + contentType: 'application/json', + data: JSON.stringify(data), + }); + }, +}; + +const gearsIcon = + '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 54 54"><path d="M50.58,22.76l-.95-.4a3.12,3.12,0,0,1,0-5.8l.95-.41h0a.69.69,0,0,0,.37-.89h0l-.7-1.69-1.13-2.75A.71.71,0,0,0,49,10.6a.67.67,0,0,0-.74-.15h0l-.95.39a3.05,3.05,0,0,1-3.43-.65,3.15,3.15,0,0,1-.65-3.45l.4-1a.69.69,0,0,0-.36-.89L38.82,3.05a.67.67,0,0,0-.88.37l-.41,1a3.08,3.08,0,0,1-5.75,0l-.41-1a.68.68,0,0,0-.89-.37L26.07,4.9a.68.68,0,0,0-.37.89l.39,1A3.1,3.1,0,0,1,22,10.85h0l-.95-.4a.68.68,0,0,0-.89.37l-1.83,4.44a.69.69,0,0,0,.37.89l1,.41a3.12,3.12,0,0,1,0,5.79l-.95.42a.69.69,0,0,0-.38.89l1.83,4.44a.7.7,0,0,0,.89.37l1-.4a3.05,3.05,0,0,1,3.42.65,3.12,3.12,0,0,1,.64,3.45h0l-.4,1a.68.68,0,0,0,.37.89l4.41,1.84a.68.68,0,0,0,.89-.36l.4-1a3.08,3.08,0,0,1,5.76,0l.4,1a.68.68,0,0,0,.89.36L43.23,34a.68.68,0,0,0,.37-.89l-.4-1h0a3.15,3.15,0,0,1,.65-3.45,3.06,3.06,0,0,1,3.42-.65h0l.95.4a.69.69,0,0,0,.89-.37L51,23.65A.69.69,0,0,0,50.58,22.76ZM36.89,24.9a5.84,5.84,0,0,1-7.65-3.19A5.91,5.91,0,0,1,32.41,14a5.84,5.84,0,0,1,7.65,3.18A5.91,5.91,0,0,1,36.89,24.9Z"/><path d="M25.82,37.11H25.1a2.14,2.14,0,0,1-2-1.33,2.21,2.21,0,0,1,.5-2.41l.51-.51a.5.5,0,0,0,0-.68l-2.36-2.38a.46.46,0,0,0-.67,0l-.52.52a2.16,2.16,0,0,1-2.39.5,2.19,2.19,0,0,1-1.33-2.06V28a.47.47,0,0,0-.47-.48H13a.48.48,0,0,0-.48.47v.73a2.16,2.16,0,0,1-3.72,1.56h0l-.51-.52a.46.46,0,0,0-.67,0L5.24,32.17a.48.48,0,0,0,0,.68l.5.51a2.19,2.19,0,0,1,.5,2.41,2.14,2.14,0,0,1-2,1.33H3.48a.48.48,0,0,0-.48.48V41a.48.48,0,0,0,.48.48H4.2a2.15,2.15,0,0,1,2,1.34,2.17,2.17,0,0,1-.5,2.4h0l-.51.52a.48.48,0,0,0,0,.67l2.36,2.38a.46.46,0,0,0,.67,0l.52-.51a2.16,2.16,0,0,1,2.39-.5A2.18,2.18,0,0,1,12.5,49.8v.72h0A.49.49,0,0,0,13,51h3.34a.47.47,0,0,0,.48-.48h0V49.8a2.18,2.18,0,0,1,1.33-2.06,2.16,2.16,0,0,1,2.39.5l.51.52a.46.46,0,0,0,.67,0l2.37-2.38a.48.48,0,0,0,0-.67l-.51-.53a2.19,2.19,0,0,1-.5-2.4,2.15,2.15,0,0,1,2-1.34h.72A.48.48,0,0,0,26.3,41V37.59A.47.47,0,0,0,25.82,37.11ZM14.65,43.39a4.12,4.12,0,1,1,4.09-4.12A4.1,4.1,0,0,1,14.65,43.39Z"/></svg>'; + +export class StudipSettings extends Plugin { + init() { + this.editor.ui.componentFactory.add('studipSettings', (locale) => { + const dropdownView = createDropdown(locale); + + dropdownView.buttonView.set({ + label: $gettext('Stud.IP Einstellungen'), + icon: gearsIcon, + tooltip: true, + }); + + dropdownView.render(); + + const studipSettingsView = new StudipSettingsView(locale); + dropdownView.panelView.children.add(studipSettingsView); + studipSettingsView.on('wysiwyg:change', (eventInfo, disabled) => { + this._save(studipSettingsView, disabled).then(() => (dropdownView.isOpen = false)); + }); + + return dropdownView; + }); + } + + _save(view, disabled) { + view.functional = false; + + return settings + .save({ disabled }) + .fail(function (xhr) { + console.error("couldn't save changes"); + }) + .always(() => { + view.functional = true; + }); + } +} + +class StudipSettingsView extends View { + constructor(locale) { + super(locale); + + const bind = this.bindTemplate; + this.set({ + checked: false, + functional: true, + }); + + const button = createButton(); + this.button = button; + button.on('execute', () => { + this.fire('wysiwyg:change', this.checked); + }); + + this.on('checking', (...args) => { + this.checked = !this.checked; + }); + + this.setTemplate({ + tag: 'form', + attributes: { + class: ['default ck-studip-settings-form'], + tabindex: '-1', + style: 'max-width: 20em; padding: 1em;', + }, + children: [createCheckbox(), createHelpText(), button], + }); + + function createCheckbox() { + return { + tag: 'label', + children: [ + { + tag: 'input', + attributes: { + id: 'disable', + type: 'checkbox', + checked: bind.to('checked'), + style: 'margin-right: 0.5em' + }, + on: { + change: bind.to('checking'), + }, + }, + { + text: $gettext('WYSIWYG Editor ausschalten'), + }, + ], + }; + } + + function createHelpText() { + return { + tag: 'p', + attributes: { + style: 'white-space: normal; font-size: 1em; line-height: 1.5em; margin-bottom: 1em;', + }, + children: [ + { + text: $gettext( + 'Mit dieser Einstellung kรถnnen Sie den WYSIWYG Editor ausschalten. Dadurch mรผssen Sie gegebenenfalls Texte in HTML schreiben. Der Editor wird erst vollstรคndig entfernt, wenn die Seite neu geladen wird.' + ), + }, + ], + }; + } + + function createButton() { + const button = new ButtonView(locale); + + button.set({ + label: $gettext('Speichern'), + withText: true, + isEnabled: bind.to('functional'), + }); + + return button; + } + } +} diff --git a/resources/assets/javascripts/cke/StudipUpload.js b/resources/assets/javascripts/cke/StudipUpload.js new file mode 100644 index 0000000..58297da --- /dev/null +++ b/resources/assets/javascripts/cke/StudipUpload.js @@ -0,0 +1,41 @@ +class StudipUploadAdapter { + constructor(loader) { + this.loader = loader; + } + + upload() { + return this.loader.file.then( + (file) => + new Promise((resolve, reject) => { + var data = new FormData(); + data.append('files[]', file); + + $.ajax({ + url: STUDIP.URLHelper.getURL('dispatch.php/wysiwyg/upload'), + type: 'POST', + data: data, + contentType: false, + async: false, + processData: false, + cache: false, + dataType: 'json', + error: function (err) { + reject(err); + }, + success: function (data) { + resolve({ default: data.files[0].url }); + }, + }); + }) + ); + } + + // Aborts the upload process. + abort() {} +} + +export default function StudipUpload(editor) { + editor.plugins.get('FileRepository').createUploadAdapter = (loader) => { + return new StudipUploadAdapter(loader); + }; +} diff --git a/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiFood.js b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiFood.js new file mode 100644 index 0000000..eabb1c2 --- /dev/null +++ b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiFood.js @@ -0,0 +1,129 @@ +export default function SpecialCharactersEmojiFood( editor ) { + editor.plugins.get( 'SpecialCharacters' ).addItems( 'Emoji Food', [ + { title: 'grapes', character: '๐' }, + { title: 'melon', character: '๐' }, + { title: 'watermelon', character: '๐' }, + { title: 'tangerine', character: '๐' }, + { title: 'lemon', character: '๐' }, + { title: 'banana', character: '๐' }, + { title: 'pineapple', character: '๐' }, + { title: 'mango', character: '๐ฅญ' }, + { title: 'red apple', character: '๐' }, + { title: 'green apple', character: '๐' }, + { title: 'pear', character: '๐' }, + { title: 'peach', character: '๐' }, + { title: 'cherries', character: '๐' }, + { title: 'strawberry', character: '๐' }, + { title: 'blueberries', character: '๐ซ' }, + { title: 'kiwi fruit', character: '๐ฅ' }, + { title: 'tomato', character: '๐
' }, + { title: 'olive', character: '๐ซ' }, + { title: 'coconut', character: '๐ฅฅ' }, + { title: 'avocado', character: '๐ฅ' }, + { title: 'eggplant', character: '๐' }, + { title: 'potato', character: '๐ฅ' }, + { title: 'carrot', character: '๐ฅ' }, + { title: 'ear of corn', character: '๐ฝ' }, + { title: 'hot pepper', character: '๐ถ' }, + { title: 'bell pepper', character: '๐ซ' }, + { title: 'cucumber', character: '๐ฅ' }, + { title: 'leafy green', character: '๐ฅฌ' }, + { title: 'broccoli', character: '๐ฅฆ' }, + { title: 'garlic', character: '๐ง' }, + { title: 'onion', character: '๐ง
' }, + { title: 'mushroom', character: '๐' }, + { title: 'peanuts', character: '๐ฅ' }, + { title: 'chestnut', character: '๐ฐ' }, + + { character: '๐', title: 'bread' }, + { character: '๐ฅ', title: 'croissant' }, + { character: '๐ฅ', title: 'baguette bread' }, + { character: '๐ซ', title: 'flatbread' }, + { character: '๐ฅจ', title: 'pretzel' }, + { character: '๐ฅฏ', title: 'bagel' }, + { character: '๐ฅ', title: 'pancakes' }, + { character: '๐ง', title: 'waffle' }, + { character: '๐ง', title: 'cheese wedge' }, + { character: '๐', title: 'meat on bone' }, + { character: '๐', title: 'poultry leg' }, + { character: '๐ฅฉ', title: 'cut of meat' }, + { character: '๐ฅ', title: 'bacon' }, + { character: '๐', title: 'hamburger' }, + { character: '๐', title: 'french fries' }, + { character: '๐', title: 'pizza' }, + { character: '๐ญ', title: 'hot dog' }, + { character: '๐ฅช', title: 'sandwich' }, + { character: '๐ฎ', title: 'taco' }, + { character: '๐ฏ', title: 'burrito' }, + { character: '๐ซ', title: 'tamale' }, + { character: '๐ฅ', title: 'stuffed flatbread' }, + { character: '๐ง', title: 'falafel' }, + { character: '๐ฅ', title: 'egg' }, + { character: '๐ณ', title: 'cooking' }, + { character: '๐ฅ', title: 'shallow pan of food' }, + { character: '๐ฒ', title: 'pot of food' }, + { character: '๐ซ', title: 'fondue' }, + { character: '๐ฅฃ', title: 'bowl with spoon' }, + { character: '๐ฅ', title: 'green salad' }, + { character: '๐ฟ', title: 'popcorn' }, + { character: '๐ง', title: 'butter' }, + { character: '๐ง', title: 'salt' }, + { character: '๐ฅซ', title: 'canned food' }, + { character: '๐ฑ', title: 'bento box' }, + { character: '๐', title: 'rice cracker' }, + { character: '๐', title: 'rice ball' }, + { character: '๐', title: 'cooked rice' }, + { character: '๐', title: 'curry rice' }, + { character: '๐', title: 'steaming bowl' }, + { character: '๐', title: 'spaghetti' }, + { character: '๐ ', title: 'roasted sweet potato' }, + { character: '๐ข', title: 'oden' }, + { character: '๐ฃ', title: 'sushi' }, + { character: '๐ค', title: 'fried shrimp' }, + { character: '๐ฅ', title: 'fish cake with swirl' }, + { character: '๐ฅฎ', title: 'moon cake' }, + { character: '๐ก', title: 'dango' }, + { character: '๐ฅ', title: 'dumpling' }, + { character: '๐ฅ ', title: 'fortune cookie' }, + { character: '๐ฅก', title: 'takeout box' }, + { character: '๐ฆ', title: 'soft ice cream' }, + { character: '๐ง', title: 'shaved ice' }, + { character: '๐จ', title: 'ice cream' }, + { character: '๐ฉ', title: 'doughnut' }, + { character: '๐ช', title: 'cookie' }, + { character: '๐', title: 'birthday cake' }, + { character: '๐ฐ', title: 'shortcake' }, + { character: '๐ง', title: 'cupcake' }, + { character: '๐ฅง', title: 'pie' }, + { character: '๐ซ', title: 'chocolate bar' }, + { character: '๐ฌ', title: 'candy' }, + { character: '๐ญ', title: 'lollipop' }, + { character: '๐ฎ', title: 'custard' }, + { character: '๐ฏ', title: 'honey pot' }, + { character: '๐ผ', title: 'baby bottle' }, + { character: '๐ฅ', title: 'glass of milk' }, + { character: 'โ', title: 'hot beverage' }, + { character: '๐ซ', title: 'teapot' }, + { character: '๐ต', title: 'teacup without handle' }, + { character: '๐ถ', title: 'sake' }, + { character: '๐พ', title: 'bottle with popping cork' }, + { character: '๐ท', title: 'wine glass' }, + { character: '๐ธ', title: 'cocktail glass' }, + { character: '๐น', title: 'tropical drink' }, + { character: '๐บ', title: 'beer mug' }, + { character: '๐ป', title: 'clinking beer mugs' }, + { character: '๐ฅ', title: 'clinking glasses' }, + { character: '๐ฅ', title: 'tumbler glass' }, + { character: '๐ฅค', title: 'cup with straw' }, + { character: '๐ง', title: 'bubble tea' }, + { character: '๐ง', title: 'beverage box' }, + { character: '๐ง', title: 'mate' }, + { character: '๐ง', title: 'ice' }, + { character: '๐ฅข', title: 'chopsticks' }, + { character: '๐ฝ', title: 'fork and knife with plate' }, + { character: '๐ด', title: 'fork and knife' }, + { character: '๐ฅ', title: 'spoon' }, + { character: '๐ช', title: 'kitchen knife' }, + { character: '๐บ', title: 'amphora' }, + ] ); +}
\ No newline at end of file diff --git a/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiNature.js b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiNature.js new file mode 100644 index 0000000..50ee133 --- /dev/null +++ b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiNature.js @@ -0,0 +1,178 @@ +export default function SpecialCharactersEmojiNature( editor ) { + editor.plugins.get( 'SpecialCharacters' ).addItems( 'Emoji Nature', [ + { title: 'dog face', character: '๐ถ' }, + { title: 'cat face', character: '๐ฑ' }, + { title: 'mouse face', character: '๐ญ' }, + { title: 'hamster', character: '๐น' }, + { title: 'rabbit face', character: '๐ฐ' }, + { title: 'horse face', character: '๐ด' }, + { title: 'unicorn', character: '๐ฆ' }, + { title: 'fox', character: '๐ฆ' }, + { title: 'wolf', character: '๐บ' }, + { title: 'raccoon', character: '๐ฆ' }, + { title: 'bear', character: '๐ป' }, + { title: 'panda', character: '๐ผ' }, + { title: 'polar bear', character: '๐ปโโ๏ธ' }, + { title: 'koala', character: '๐จ' }, + { title: 'tiger face', character: '๐ฏ' }, + { title: 'lion', character: '๐ฆ' }, + { title: 'cow face', character: '๐ฎ' }, + { title: 'pig face', character: '๐ท' }, + { title: 'frog', character: '๐ธ' }, + { title: 'dragon face', character: '๐ฒ' }, + { title: 'monkey face', character: '๐ต' }, + { title: 'see-no-evil monkey', character: '๐' }, + { title: 'hear-no-evil monkey', character: '๐' }, + { title: 'speak-no-evil monkey', character: '๐' }, + { title: 'chicken', character: '๐' }, + { title: 'rooster', character: '๐' }, + { title: 'hatching chick', character: '๐ฃ' }, + { title: 'baby chick', character: '๐ค' }, + { title: 'front-facing baby chick', character: '๐ฅ' }, + { title: 'bird', character: '๐ฆ' }, + { title: 'penguin', character: '๐ง' }, + { title: 'dove', character: '๐' }, + { title: 'eagle', character: '๐ฆ
' }, + { title: 'duck', character: '๐ฆ' }, + { title: 'swan', character: '๐ฆข' }, + { title: 'owl', character: '๐ฆ' }, + { title: 'dodo', character: '๐ฆค' }, + { title: 'flamingo', character: '๐ฆฉ' }, + { title: 'peacock', character: '๐ฆ' }, + { title: 'parrot', character: '๐ฆ' }, + { title: 'turkey', character: '๐ฆ' }, + { title: 'feather', character: '๐ชถ' }, + { title: 'snail', character: '๐' }, + { title: 'butterfly', character: '๐ฆ' }, + { title: 'bug', character: '๐' }, + { title: 'ant', character: '๐' }, + { title: 'honeybee', character: '๐' }, + { title: 'beetle', character: '๐ชฒ' }, + { title: 'lady beetle', character: '๐' }, + { title: 'cricket', character: '๐ฆ' }, + { title: 'cockroach', character: '๐ชณ' }, + { title: 'spider', character: '๐ท' }, + { title: 'spider web', character: '๐ธ' }, + { title: 'scorpion', character: '๐ฆ' }, + { title: 'mosquito', character: '๐ฆ' }, + { title: 'fly', character: '๐ชฐ' }, + { title: 'worm', character: '๐ชฑ' }, + { title: 'microbe', character: '๐ฆ ' }, + { title: 'crocodile', character: '๐' }, + { title: 'turtle', character: '๐ข' }, + { title: 'lizard', character: '๐ฆ' }, + { title: 'snake', character: '๐' }, + { title: 'dragon', character: '๐' }, + { title: 'sauropod', character: '๐ฆ' }, + { title: 'T-Rex', character: '๐ฆ' }, + { title: 'spouting whale', character: '๐ณ' }, + { title: 'whale', character: '๐' }, + { title: 'dolphin', character: '๐ฌ' }, + { title: 'seal', character: '๐ฆญ' }, + { title: 'fish', character: '๐' }, + { title: 'tropical fish', character: '๐ ' }, + { title: 'blowfish', character: '๐ก' }, + { title: 'shark', character: '๐ฆ' }, + { title: 'octopus', character: '๐' }, + { title: 'spiral shell', character: '๐' }, + { title: 'crab', character: '๐ฆ' }, + { title: 'lobster', character: '๐ฆ' }, + { title: 'shrimp', character: '๐ฆ' }, + { title: 'squid', character: '๐ฆ' }, + { title: 'monkey', character: '๐' }, + { title: 'gorilla', character: '๐ฆ' }, + { title: 'orangutan', character: '๐ฆง' }, + { title: 'dog', character: '๐' }, + { title: 'cat', character: '๐' }, + { title: 'black cat', character: '๐โโฌ' }, + { title: 'tiger', character: '๐
' }, + { title: 'leopard', character: '๐' }, + { title: 'horse', character: '๐' }, + { title: 'zebra', character: '๐ฆ' }, + { title: 'deer', character: '๐ฆ' }, + { title: 'bison', character: '๐ฆฌ' }, + { title: 'ox', character: '๐' }, + { title: 'water buffalo', character: '๐' }, + { title: 'cow', character: '๐' }, + { title: 'pig', character: '๐' }, + { title: 'boar', character: '๐' }, + { title: 'ram', character: '๐' }, + { title: 'ewe', character: '๐' }, + { title: 'goat', character: '๐' }, + { title: 'camel', character: '๐ช' }, + { title: 'two-hump camel', character: '๐ซ' }, + { title: 'llama', character: '๐ฆ' }, + { title: 'giraffe', character: '๐ฆ' }, + { title: 'elephant', character: '๐' }, + { title: 'mammoth', character: '๐ฆฃ' }, + { title: 'rhinoceros', character: '๐ฆ' }, + { title: 'hippopotamus', character: '๐ฆ' }, + { title: 'mouse', character: '๐' }, + { title: 'rat', character: '๐' }, + { title: 'rabbit', character: '๐' }, + { title: 'chipmunk', character: '๐ฟ' }, + { title: 'beaver', character: '๐ฆซ' }, + { title: 'hedgehog', character: '๐ฆ' }, + { title: 'bat', character: '๐ฆ' }, + { title: 'sloth', character: '๐ฆฅ' }, + { title: 'otter', character: '๐ฆฆ' }, + { title: 'skunk', character: '๐ฆจ' }, + { title: 'kangaroo', character: '๐ฆ' }, + { title: 'badger', character: '๐ฆก' }, + { title: 'paw prints', character: '๐พ' }, + { title: 'bouquet', character: '๐' }, + { title: 'cherry blossom', character: '๐ธ' }, + { title: 'white flower', character: '๐ฎ' }, + { title: 'rosette', character: '๐ต' }, + { title: 'rose', character: '๐น' }, + { title: 'wilted flower', character: '๐ฅ' }, + { title: 'hibiscus', character: '๐บ' }, + { title: 'sunflower', character: '๐ป' }, + { title: 'blossom', character: '๐ผ' }, + { title: 'tulip', character: '๐ท' }, + { title: 'seedling', character: '๐ฑ' }, + { title: 'potted plant', character: '๐ชด' }, + { title: 'evergreen tree', character: '๐ฒ' }, + { title: 'Christmas tree', character: '๐' }, + { title: 'deciduous tree', character: '๐ณ' }, + { title: 'palm tree', character: '๐ด' }, + { title: 'cactus', character: '๐ต' }, + { title: 'sheaf of rice', character: '๐พ' }, + { title: 'herb', character: '๐ฟ' }, + { title: 'shamrock', character: 'โ๏ธ' }, + { title: 'four leaf clover', character: '๐' }, + { title: 'maple leaf', character: '๐' }, + { title: 'fallen leaf', character: '๐' }, + { title: 'leaf fluttering in wind', character: '๐' }, + { title: 'tanabata tree', character: '๐' }, + { title: 'mushroom', character: '๐' }, + { title: 'sun', character: 'โ๏ธ' }, + { title: 'sun with face', character: '๐' }, + { title: 'full moon face', character: '๐' }, + { title: 'first quarter moon face', character: '๐' }, + { title: 'last quarter moon face', character: '๐' }, + { title: 'globe showing Europe-Africa', character: '๐' }, + { title: 'globe showing Americas', character: '๐' }, + { title: 'globe showing Asia-Australia', character: '๐' }, + { title: 'ringed planet', character: '๐ช' }, + { title: 'glowing star', character: 'โญ' }, + { title: 'comet', character: 'โ๏ธ' }, + { title: 'shooting star', character: '๐ ' }, + { title: 'sun behind cloud', character: 'โ
' }, + { title: 'cloud with lightning and rain', character: 'โ' }, + { title: 'sun behind small cloud', character: '๐ค' }, + { title: 'sun behind large cloud', character: '๐ฅ' }, + { title: 'sun behind rain cloud', character: '๐ฆ' }, + { title: 'cloud with rain', character: '๐ง' }, + { title: 'cloud with snow', character: '๐จ' }, + { title: 'cloud with lightning', character: '๐ฉ' }, + { title: 'fog', character: '๐ซ' }, + { title: 'tornado', character: '๐ช' }, + { title: 'rainbow', character: '๐' }, + { title: 'snowflake', character: 'โ๏ธ' }, + { title: 'snowman', character: 'โ๏ธ' }, + { title: 'snowman', character: 'โ' }, + { title: 'fire', character: '๐ฅ' }, + { title: 'water wave', character: '๐' }, + ] ); +} diff --git a/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiObjects.js b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiObjects.js new file mode 100644 index 0000000..69442cd --- /dev/null +++ b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiObjects.js @@ -0,0 +1,5 @@ +export default function SpecialCharactersEmojiObjects( editor ) { + editor.plugins.get( 'SpecialCharacters' ).addItems( 'Emoji Objects', [ + { title: '', character: '' }, + ] ); +}
\ No newline at end of file diff --git a/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiPeople.js b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiPeople.js new file mode 100644 index 0000000..45c6224 --- /dev/null +++ b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiPeople.js @@ -0,0 +1,192 @@ +export default function SpecialCharactersEmojiPeople( editor ) { + editor.plugins.get( 'SpecialCharacters' ).addItems( 'Emoji People', [ + { title: 'smiley grinning face', character: '๐' }, + { title: 'smiley grinning face with big eyes', character: '๐' }, + { title: 'smiley grinning face with smiling eyes', character: '๐' }, + { title: 'smiley beaming face with smiling eyes', character: '๐' }, + { title: 'smiley grinning squinting face', character: '๐' }, + { title: 'smiley grinning face with sweat', character: '๐
' }, + { title: 'smiley face with tears of joy', character: '๐' }, + { title: 'smiley rolling on the floor laughing', character: '๐คฃ' }, + { title: 'smiley slightly smiling face', character: '๐' }, + { title: 'smiley upside-down face', character: '๐' }, + { title: 'smiley winking face', character: '๐' }, + { title: 'smiley smiling face with smiling eyes', character: '๐' }, + { title: 'smiley smiling face with halo', character: '๐' }, + { title: 'smiley smiling face with hearts', character: '๐ฅฐ' }, + { title: 'smiley smiling face with heart-eyes', character: '๐' }, + { title: 'smiley star-struck', character: '๐คฉ' }, + { title: 'smiley face blowing a kiss', character: '๐' }, + { title: 'smiley kissing face', character: '๐' }, + { title: 'smiley kissing face with smiling eyes', character: '๐' }, + { title: 'smiley kissing face with closed eyes', character: '๐' }, + { title: 'smiley smiling face with tear', character: '๐ฅฒ' }, + { title: 'smiley face savoring food', character: '๐' }, + { title: 'smiley face with tongue', character: '๐' }, + { title: 'smiley squinting face with tongue', character: '๐' }, + { title: 'smiley winking face with tongue', character: '๐' }, + { title: 'smiley zany face', character: '๐คช' }, + { title: 'smiley money-mouth face', character: '๐ค' }, + { title: 'smiley smiling face with open hands', character: '๐ค' }, + { title: 'smiley face with hand over mouth', character: '๐คญ' }, + { title: 'smiley shushing face', character: '๐คซ' }, + { title: 'smiley thinking face', character: '๐ค' }, + { title: 'smiley zipper-mouth face', character: '๐ค' }, + { title: 'smiley face with raised eyebrow', character: '๐คจ' }, + { title: 'smiley neutral face', character: '๐' }, + { title: 'smiley expressionless face', character: '๐' }, + { title: 'smiley face without mouth', character: '๐ถ' }, + { title: 'smiley face in clouds', character: '๐ถโ๐ซ๏ธ' }, + { title: 'smiley smirking face', character: '๐' }, + { title: 'smiley unamused face', character: '๐' }, + { title: 'smiley face with rolling eyes', character: '๐' }, + { title: 'smiley grimacing face', character: '๐ฌ' }, + { title: 'smiley face exhaling', character: '๐ฎโ๐จ' }, + { title: 'smiley lying face', character: '๐คฅ' }, + { title: 'smiley relieved face', character: '๐' }, + { title: 'smiley pensive face', character: '๐' }, + { title: 'smiley sleepy face', character: '๐ช' }, + { title: 'smiley drooling face', character: '๐คค' }, + { title: 'smiley sleeping face', character: '๐ด' }, + { title: 'smiley face with medical mask', character: '๐ท' }, + { title: 'smiley face with thermometer', character: '๐ค' }, + { title: 'smiley face with head-bandage', character: '๐ค' }, + { title: 'smiley nauseated face', character: '๐คข' }, + { title: 'smiley face vomiting', character: '๐คฎ' }, + { title: 'smiley sneezing face', character: '๐คง' }, + { title: 'smiley hot face', character: '๐ฅต' }, + { title: 'smiley cold face', character: '๐ฅถ' }, + { title: 'smiley woozy face', character: '๐ฅด' }, + { title: 'smiley face with crossed-out eyes', character: '๐ต' }, + { title: 'smiley face with spiral eyes', character: '๐ตโ๐ซ' }, + { title: 'smiley exploding head', character: '๐คฏ' }, + { title: 'smiley cowboy hat face', character: '๐ค ' }, + { title: 'smiley partying face', character: '๐ฅณ' }, + { title: 'smiley disguised face', character: '๐ฅธ' }, + { title: 'smiley smiling face with sunglasses', character: '๐' }, + { title: 'smiley nerd face', character: '๐ค' }, + { title: 'smiley face with monocle', character: '๐ง' }, + { title: 'smiley confused face', character: '๐' }, + { title: 'smiley worried face', character: '๐' }, + { title: 'smiley slightly frowning face', character: '๐' }, + { title: 'smiley frowning face', character: 'โน๏ธ' }, + { title: 'smiley face with open mouth', character: '๐ฎ' }, + { title: 'smiley hushed face', character: '๐ฏ' }, + { title: 'smiley astonished face', character: '๐ฒ' }, + { title: 'smiley flushed face', character: '๐ณ' }, + { title: 'smiley pleading face', character: '๐ฅบ' }, + { title: 'smiley frowning face with open mouth', character: '๐ฆ' }, + { title: 'smiley anguished face', character: '๐ง' }, + { title: 'smiley fearful face', character: '๐จ' }, + { title: 'smiley anxious face with sweat', character: '๐ฐ' }, + { title: 'smiley sad but relieved face', character: '๐ฅ' }, + { title: 'smiley crying face', character: '๐ข' }, + { title: 'smiley loudly crying face', character: '๐ญ' }, + { title: 'smiley face screaming in fear', character: '๐ฑ' }, + { title: 'smiley confounded face', character: '๐' }, + { title: 'smiley persevering face', character: '๐ฃ' }, + { title: 'smiley disappointed face', character: '๐' }, + { title: 'smiley downcast face with sweat', character: '๐' }, + { title: 'smiley weary face', character: '๐ฉ' }, + { title: 'smiley tired face', character: '๐ซ' }, + { title: 'smiley yawning face', character: '๐ฅฑ' }, + { title: 'smiley face with steam from nose', character: '๐ค' }, + { title: 'smiley pouting face', character: '๐ ' }, + { title: 'smiley angry face', character: '๐ก' }, + { title: 'smiley face with symbols on mouth', character: '๐คฌ' }, + { title: 'smiley smiling face with horns', character: '๐' }, + { title: 'smiley angry face with horns', character: '๐ฟ' }, + { title: 'skull', character: '๐' }, + { title: 'skull and crossbones', character: 'โ ๏ธ' }, + { title: 'pile of poo', character: '๐ฉ' }, + { title: 'smiley clown face', character: '๐คก' }, + { title: 'ogre', character: '๐น' }, + { title: 'goblin', character: '๐บ' }, + { title: 'jack-o-lantern', character: '๐' }, + { title: 'ghost', character: '๐ป' }, + { title: 'alien', character: '๐ฝ' }, + { title: 'alien monster', character: '๐พ' }, + { title: 'robot', character: '๐ค' }, + { title: 'smiley grinning cat', character: '๐บ' }, + { title: 'smiley grinning cat with smiling eyes', character: '๐ธ' }, + { title: 'smiley cat with tears of joy', character: '๐น' }, + { title: 'smiley smiling cat with heart-eyes', character: '๐ป' }, + { title: 'smiley cat with wry smile', character: '๐ผ' }, + { title: 'smiley kissing cat', character: '๐ฝ' }, + { title: 'smiley weary cat', character: '๐' }, + { title: 'smiley crying cat', character: '๐ฟ' }, + { title: 'smiley pouting cat', character: '๐พ' }, + { title: 'see-no-evil monkey', character: '๐' }, + { title: 'hear-no-evil monkey', character: '๐' }, + { title: 'speak-no-evil monkey', character: '๐' }, + { title: 'waving hand', character: '๐' }, + { title: 'raised back of hand', character: '๐ค' }, + { title: 'hand with fingers splayed', character: '๐' }, + { title: 'raised hand', character: 'โ' }, + { title: 'vulcan salute', character: '๐' }, + { title: 'OK hand', character: '๐' }, + { title: 'pinched fingers', character: '๐ค' }, + { title: 'pinching hand', character: '๐ค' }, + { title: 'victory hand', character: 'โ๏ธ' }, + { title: 'crossed fingers', character: '๐ค' }, + { title: 'love-you gesture', character: '๐ค' }, + { title: 'sign of the horns', character: '๐ค' }, + { title: 'call me hand', character: '๐ค' }, + { title: 'backhand index pointing left', character: '๐' }, + { title: 'backhand index pointing right', character: '๐' }, + { title: 'backhand index pointing up', character: '๐' }, + { title: 'backhand index pointing down', character: '๐' }, + { title: 'index pointing up', character: 'โ๏ธ' }, + { title: 'thumbs up', character: '๐' }, + { title: 'thumbs down', character: '๐' }, + { title: 'raised fist', character: 'โ' }, + { title: 'clapping hands', character: '๐' }, + { title: 'raising hands', character: '๐' }, + { title: 'open hands', character: '๐' }, + { title: 'palms up together', character: '๐คฒ' }, + { title: 'handshake', character: '๐ค' }, + { title: 'folded hands', character: '๐' }, + { title: 'writing hand', character: 'โ๏ธ' }, + { title: 'selfie', character: '๐คณ' }, + { title: 'flexed biceps', character: '๐ช' }, + { title: 'ear', character: '๐' }, + { title: 'nose', character: '๐' }, + { title: 'eyes', character: '๐' }, + { title: 'baby', character: '๐ถ' }, + { title: 'child', character: '๐ง' }, + { title: 'boy', character: '๐ฆ' }, + { title: 'girl', character: '๐ง' }, + { title: 'person', character: '๐ง' }, + { title: 'man', character: '๐จ' }, + { title: 'woman', character: '๐ฉ' }, + { title: 'person frowning', character: '๐' }, + { title: 'man frowning', character: '๐โโ๏ธ' }, + { title: 'woman frowning', character: '๐โโ๏ธ' }, + { title: 'person pouting', character: '๐' }, + { title: 'man pouting', character: '๐โโ๏ธ' }, + { title: 'woman pouting', character: '๐โโ๏ธ' }, + { title: 'person gesturing NO', character: '๐
' }, + { title: 'man gesturing NO', character: '๐
โโ๏ธ' }, + { title: 'woman gesturing NO', character: '๐
โโ๏ธ' }, + { title: 'person gesturing OK', character: '๐' }, + { title: 'man gesturing OK', character: '๐โโ๏ธ' }, + { title: 'woman gesturing OK', character: '๐โโ๏ธ' }, + { title: 'person tipping hand', character: '๐' }, + { title: 'man tipping hand', character: '๐โโ๏ธ' }, + { title: 'woman tipping hand', character: '๐โโ๏ธ' }, + { title: 'person raising hand', character: '๐' }, + { title: 'man raising hand', character: '๐โโ๏ธ' }, + { title: 'woman raising hand', character: '๐โโ๏ธ' }, + { title: 'person facepalming', character: '๐คฆ' }, + { title: 'man facepalming', character: '๐คฆโโ๏ธ' }, + { title: 'woman facepalming', character: '๐คฆโโ๏ธ' }, + { title: 'person shrugging', character: '๐คท' }, + { title: 'man shrugging', character: '๐คทโโ๏ธ' }, + { title: 'woman shrugging', character: '๐คทโโ๏ธ' }, + { title: 'speaking head', character: '๐ฃ' }, + { title: 'bust in silhouette', character: '๐ค' }, + { title: 'busts in silhouette', character: '๐ฅ' }, + { title: 'people hugging', character: '๐ซ' }, + { title: 'footprints', character: '๐ฃ' }, + ] ); +} diff --git a/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiSport.js b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiSport.js new file mode 100644 index 0000000..997ad1c --- /dev/null +++ b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiSport.js @@ -0,0 +1,5 @@ +export default function SpecialCharactersEmojiSport( editor ) { + editor.plugins.get( 'SpecialCharacters' ).addItems( 'Emoji Sport', [ + { title: '', character: '' }, + ] ); +}
\ No newline at end of file diff --git a/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiSymbols.js b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiSymbols.js new file mode 100644 index 0000000..d6da0eb --- /dev/null +++ b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiSymbols.js @@ -0,0 +1,224 @@ +export default function SpecialCharactersEmojiSymbols( editor ) { + editor.plugins.get( 'SpecialCharacters' ).addItems( 'Emoji Symbols', [ + { title: 'red heart', character: 'โค๏ธ' }, + { title: 'orange heart', character: '๐งก' }, + { title: 'yellow heart', character: '๐' }, + { title: 'green heart', character: '๐' }, + { title: 'blue heart', character: '๐' }, + { title: 'purple heart', character: '๐' }, + { title: 'brown heart', character: '๐ค' }, + { title: 'black heart', character: '๐ค' }, + { title: 'white heart', character: '๐ค' }, + { title: 'heart with arrow', character: '๐' }, + { title: 'heart with ribbon', character: '๐' }, + { title: 'sparkling heart', character: '๐' }, + { title: 'growing heart', character: '๐' }, + { title: 'beating heart', character: '๐' }, + { title: 'revolving hearts', character: '๐' }, + { title: 'two hearts', character: '๐' }, + { title: 'heart exclamation', character: 'โฃ๏ธ' }, + { title: 'broken heart', character: '๐' }, + { title: 'heart on fire', character: 'โค๏ธโ๐ฅ' }, + { title: 'mending heart', character: 'โค๏ธโ๐ฉน' }, + { title: 'heart decoration', character: '๐' }, + { title: 'place of worship', character: '๐' }, + { title: 'atom symbol', character: 'โ๏ธ' }, + { title: 'om', character: '๐' }, + { title: 'star of David', character: 'โก๏ธ' }, + { title: 'wheel of dharma', character: 'โธ๏ธ' }, + { title: 'yin yang', character: 'โฏ๏ธ' }, + { title: 'latin cross', character: 'โ๏ธ' }, + { title: 'orthodox cross', character: 'โฆ๏ธ' }, + { title: 'star and crescent', character: 'โช๏ธ' }, + { title: 'peace symbol', character: 'โฎ๏ธ' }, + { title: 'menorah', character: '๐' }, + { title: 'dotted six-pointed star', character: '๐ฏ' }, + { title: 'Aries', character: 'โ' }, + { title: 'Taurus', character: 'โ' }, + { title: 'Gemini', character: 'โ' }, + { title: 'Cancer', character: 'โ' }, + { title: 'Leo', character: 'โ' }, + { title: 'Virgo', character: 'โ' }, + { title: 'Libra', character: 'โ' }, + { title: 'Scorpio', character: 'โ' }, + { title: 'Sagittarius', character: 'โ' }, + { title: 'Capricorn', character: 'โ' }, + { title: 'Aquarius', character: 'โ' }, + { title: 'Pisces', character: 'โ' }, + { title: 'Ophiuchus', character: 'โ' }, + { title: 'ATM sign', character: '๐ง' }, + { title: 'litter in bin sign', character: '๐ฎ' }, + { title: 'potable water', character: '๐ฐ' }, + { title: 'wheelchair symbol', character: 'โฟ๏ธ' }, + { title: 'menโs room', character: '๐น' }, + { title: 'womenโs room', character: '๐บ' }, + { title: 'restroom', character: '๐ป' }, + { title: 'baby symbol', character: '๐ผ' }, + { title: 'water closet', character: '๐พ' }, + { title: 'passport control', character: '๐' }, + { title: 'customs', character: '๐' }, + { title: 'baggage claim', character: '๐' }, + { title: 'left luggage', character: '๐
' }, + { title: 'warning', character: 'โ ๏ธ' }, + { title: 'children crossing', character: '๐ธ' }, + { title: 'no entry', character: 'โ๏ธ' }, + { title: 'prohibited', character: '๐ซ' }, + { title: 'no bicycles', character: '๐ณ' }, + { title: 'no smoking', character: '๐ญ' }, + { title: 'no littering', character: '๐ฏ' }, + { title: 'non-potable water', character: '๐ฑ' }, + { title: 'no pedestrians', character: '๐ท' }, + { title: 'no mobile phones', character: '๐ต' }, + { title: 'no one under eighteen', character: '๐' }, + { title: 'radioactive', character: 'โข๏ธ' }, + { title: 'biohazard', character: 'โฃ๏ธ' }, + { title: 'up arrow', character: 'โฌ๏ธ' }, + { title: 'up-right arrow', character: 'โ๏ธ' }, + { title: 'right arrow', character: 'โก๏ธ' }, + { title: 'down-right arrow', character: 'โ๏ธ' }, + { title: 'down arrow', character: 'โฌ๏ธ' }, + { title: 'down-left arrow', character: 'โ๏ธ' }, + { title: 'left arrow', character: 'โฌ
๏ธ' }, + { title: 'up-left arrow', character: 'โ๏ธ' }, + { title: 'up-down arrow', character: 'โ๏ธ' }, + { title: 'left-right arrow', character: 'โ๏ธ' }, + { title: 'right arrow curving left', character: 'โฉ๏ธ' }, + { title: 'left arrow curving right', character: 'โช๏ธ' }, + { title: 'right arrow curving up', character: 'โคด๏ธ' }, + { title: 'right arrow curving down', character: 'โคต๏ธ' }, + { title: 'clockwise vertical arrows', character: '๐' }, + { title: 'counterclockwise arrows button', character: '๐' }, + { title: 'shuffle tracks button', character: '๐' }, + { title: 'repeat button', character: '๐' }, + { title: 'repeat single button', character: '๐' }, + { title: 'play button', character: 'โถ๏ธ' }, + { title: 'fast-forward button', character: 'โฉ' }, + { title: 'next track button', character: 'โญ๏ธ' }, + { title: 'play or pause button', character: 'โฏ๏ธ' }, + { title: 'reverse button', character: 'โ๏ธ' }, + { title: 'fast reverse button', character: 'โช' }, + { title: 'last track button', character: 'โฎ๏ธ' }, + { title: 'upwards button', character: '๐ผ' }, + { title: 'fast up button', character: 'โซ' }, + { title: 'downwards button', character: '๐ฝ' }, + { title: 'fast down button', character: 'โฌ' }, + { title: 'pause button', character: 'โธ๏ธ' }, + { title: 'stop button', character: 'โน๏ธ' }, + { title: 'record button', character: 'โบ๏ธ' }, + { title: 'eject button', character: 'โ๏ธ' }, + { title: 'cinema', character: '๐ฆ' }, + { title: 'dim button', character: '๐
' }, + { title: 'bright button', character: '๐' }, + { title: 'antenna bars', character: '๐ถ' }, + { title: 'vibration mode', character: '๐ณ' }, + { title: 'mobile phone off', character: '๐ด' }, + { title: 'female sign', character: 'โ๏ธ' }, + { title: 'male sign', character: 'โ๏ธ' }, + { title: 'transgender symbol', character: 'โง๏ธ' }, + { title: 'multiply', character: 'โ๏ธ' }, + { title: 'plus', character: 'โ๏ธ' }, + { title: 'minus', character: 'โ๏ธ' }, + { title: 'divide', character: 'โ๏ธ' }, + { title: 'infinity', character: 'โพ๏ธ' }, + { title: 'double exclamation mark', character: 'โผ๏ธ' }, + { title: 'exclamation question mark', character: 'โ๏ธ' }, + { title: 'red question mark', character: 'โ๏ธ' }, + { title: 'red exclamation mark', character: 'โ๏ธ' }, + { title: 'white question mark', character: 'โ๏ธ' }, + { title: 'white exclamation mark', character: 'โ๏ธ' }, + { title: 'wavy dash', character: 'ใฐ๏ธ' }, + { title: 'currency exchange', character: '๐ฑ' }, + { title: 'heavy dollar sign', character: '๐ฒ' }, + { title: 'medical symbol', character: 'โ๏ธ' }, + { title: 'recycling symbol', character: 'โป๏ธ' }, + { title: 'fleur-de-lis', character: 'โ๏ธ' }, + { title: 'trident emblem', character: '๐ฑ' }, + { title: 'name badge', character: '๐' }, + { title: 'Japanese symbol for beginner', character: '๐ฐ' }, + { title: 'hollow red circle', character: 'โญ๏ธ' }, + { title: 'check mark button', character: 'โ
๏ธ' }, + { title: 'check box with check', character: 'โ๏ธ' }, + { title: 'check mark', character: 'โ๏ธ' }, + { title: 'cross mark', character: 'โ๏ธ' }, + { title: 'cross mark button', character: 'โ๏ธ' }, + { title: 'curly loop', character: 'โฐ๏ธ' }, + { title: 'double curly loop', character: 'โฟ๏ธ' }, + { title: 'part alternation mark', character: 'ใฝ๏ธ' }, + { title: 'eight-spoked asterisk', character: 'โณ๏ธ' }, + { title: 'eight-pointed star', character: 'โด๏ธ' }, + { title: 'sparkle', character: 'โ๏ธ' }, + { title: 'copyright', character: 'ยฉ๏ธ' }, + { title: 'registered', character: 'ยฎ๏ธ' }, + { title: 'trade mark', character: 'โข๏ธ' }, + { title: 'keycap: #', character: '#๏ธโฃ' }, + { title: 'keycap: *', character: '*๏ธโฃ' }, + { title: 'keycap: 0', character: '0๏ธโฃ' }, + { title: 'keycap: 1', character: '1๏ธโฃ' }, + { title: 'keycap: 2', character: '2๏ธโฃ' }, + { title: 'keycap: 3', character: '3๏ธโฃ' }, + { title: 'keycap: 4', character: '4๏ธโฃ' }, + { title: 'keycap: 5', character: '5๏ธโฃ' }, + { title: 'keycap: 6', character: '6๏ธโฃ' }, + { title: 'keycap: 7', character: '7๏ธโฃ' }, + { title: 'keycap: 8', character: '8๏ธโฃ' }, + { title: 'keycap: 9', character: '9๏ธโฃ' }, + { title: 'keycap: 10', character: '๐' }, + { title: 'input latin uppercase', character: '๐ ' }, + { title: 'input latin lowercase', character: '๐ก' }, + { title: 'input numbers', character: '๐ข' }, + { title: 'input symbols', character: '๐ฃ' }, + { title: 'input latin letters', character: '๐ค' }, + { title: 'A button (blood type)', character: '๐
ฐ๏ธ' }, + { title: 'AB button (blood type)', character: '๐๏ธ' }, + { title: 'B button (blood type)', character: '๐
ฑ๏ธ' }, + { title: 'O button (blood type)', character: '๐
พ๏ธ' }, + { title: 'CL button', character: '๐๏ธ' }, + { title: 'COOL button', character: '๐๏ธ' }, + { title: 'FREE button', character: '๐๏ธ' }, + { title: 'information', character: 'โน๏ธ' }, + { title: 'ID button', character: '๐๏ธ' }, + { title: 'circled M', character: 'โ๏ธ' }, + { title: 'NEW button', character: '๐๏ธ' }, + { title: 'NG button', character: '๐๏ธ' }, + { title: 'OK button', character: '๐๏ธ' }, + { title: 'P button', character: '๐
ฟ๏ธ' }, + { title: 'SOS button', character: '๐๏ธ' }, + { title: 'UP! button', character: '๐๏ธ' }, + { title: 'VS button', character: '๐๏ธ' }, + { title: 'red circle', character: '๐ด' }, + { title: 'orange circle', character: '๐ ' }, + { title: 'yellow circle', character: '๐ก' }, + { title: 'green circle', character: '๐ข' }, + { title: 'blue circle', character: '๐ต' }, + { title: 'purple circle', character: '๐ฃ' }, + { title: 'brown circle', character: '๐ค' }, + { title: 'white circle', character: 'โช๏ธ' }, + { title: 'black circle', character: 'โซ๏ธ' }, + { title: 'red square', character: '๐ฅ' }, + { title: 'orange square', character: '๐ง' }, + { title: 'yellow square', character: '๐จ' }, + { title: 'green square', character: '๐ฉ' }, + { title: 'blue square', character: '๐ฆ' }, + { title: 'purple square', character: '๐ช' }, + { title: 'brown square', character: '๐ซ' }, + { title: 'black large square', character: 'โฌ๏ธ' }, + { title: 'white large square', character: 'โฌ๏ธ' }, + { title: 'black medium square', character: 'โผ๏ธ' }, + { title: 'white medium square', character: 'โป๏ธ' }, + { title: 'black medium-small square', character: 'โพ๏ธ' }, + { title: 'white medium-small square', character: 'โฝ๏ธ' }, + { title: 'black small square', character: 'โช๏ธ' }, + { title: 'white small square', character: 'โซ๏ธ' }, + { title: 'large orange diamond', character: '๐ถ๏ธ' }, + { title: 'large blue diamond', character: '๐ท๏ธ' }, + { title: 'small orange diamond', character: '๐ธ๏ธ' }, + { title: 'small blue diamond', character: '๐น๏ธ' }, + { title: 'red triangle pointed up', character: '๐บ๏ธ' }, + { title: 'red triangle pointed down', character: '๐ป' }, + { title: 'diamond with a dot', character: '๐ ' }, + { title: 'radio button', character: '๐' }, + { title: 'white square button', character: '๐ฒ' }, + { title: 'black square button', character: '๐ณ' }, + + ] ); +} diff --git a/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiTraffic.js b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiTraffic.js new file mode 100644 index 0000000..e036ea6 --- /dev/null +++ b/resources/assets/javascripts/cke/special_characters/SpecialCharactersEmojiTraffic.js @@ -0,0 +1,214 @@ +export default function SpecialCharactersEmojiTraffic( editor ) { + editor.plugins.get( 'SpecialCharacters' ).addItems( 'Emoji Traffic', [ + { title: 'globe showing Europe-Africa', character: '๐' }, + { title: 'globe showing Americas', character: '๐' }, + { title: 'globe showing Asia-Australia', character: '๐' }, + { title: 'globe with meridians', character: '๐' }, + { title: 'world map', character: '๐บ' }, + { title: 'compass', character: '๐งญ' }, + { title: 'snow-capped mountain', character: '๐' }, + { title: 'mountain', character: 'โฐ' }, + { title: 'volcano', character: '๐' }, + { title: 'mount fuji', character: '๐ป' }, + { title: 'camping', character: '๐' }, + { title: 'beach with umbrella', character: '๐' }, + { title: 'desert', character: '๐' }, + { title: 'desert island', character: '๐' }, + { title: 'national park', character: '๐' }, + { title: 'stadium', character: '๐' }, + { title: 'classical building', character: '๐' }, + { title: 'building construction', character: '๐' }, + { title: 'brick', character: '๐งฑ' }, + { title: 'rock', character: '๐ชจ' }, + { title: 'wood', character: '๐ชต' }, + { title: 'hut', character: '๐' }, + { title: 'houses', character: '๐' }, + { title: 'derelict house', character: '๐' }, + { title: 'house', character: '๐ ' }, + { title: 'house with garden', character: '๐ก' }, + { title: 'office building', character: '๐ข' }, + { title: 'post office', character: '๐ค' }, + { title: 'hospital', character: '๐ฅ' }, + { title: 'bank', character: '๐ฆ' }, + { title: 'hotel', character: '๐จ' }, + { title: 'convenience store', character: '๐ช' }, + { title: 'school', character: '๐ซ' }, + { title: 'department store', character: '๐ฌ' }, + { title: 'factory', character: '๐ญ' }, + { title: 'Japanese castle', character: '๐ฏ' }, + { title: 'castle', character: '๐ฐ' }, + { title: 'wedding', character: '๐' }, + { title: 'Tokyo tower', character: '๐ผ' }, + { title: 'Statue of Liberty', character: '๐ฝ' }, + { title: 'church', character: 'โช' }, + { title: 'mosque', character: '๐' }, + { title: 'hindu temple', character: '๐' }, + { title: 'synagogue', character: '๐' }, + { title: 'shinto shrine', character: 'โฉ' }, + { title: 'kaaba', character: '๐' }, + { title: 'fountain', character: 'โฒ' }, + { title: 'tent', character: 'โบ' }, + { title: 'foggy', character: '๐' }, + { title: 'night with stars', character: '๐' }, + { title: 'cityscape', character: '๐' }, + { title: 'sunrise over mountains', character: '๐' }, + { title: 'sunrise', character: '๐
' }, + { title: 'cityscape at dusk', character: '๐' }, + { title: 'sunset', character: '๐' }, + { title: 'bridge at night', character: '๐' }, + { title: 'hot springs', character: 'โจ๏ธ' }, + { title: 'carousel horse', character: '๐ ' }, + { title: 'ferris wheel', character: '๐ก' }, + { title: 'roller coaster', character: '๐ข' }, + { title: 'barber pole', character: '๐' }, + { title: 'circus tent', character: '๐ช' }, + { title: 'locomotive', character: '๐' }, + { title: 'railway car', character: '๐' }, + { title: 'high-speed train', character: '๐' }, + { title: 'bullet train', character: '๐
' }, + { title: 'train', character: '๐' }, + { title: 'metro', character: '๐' }, + { title: 'light rail', character: '๐' }, + { title: 'station', character: '๐' }, + { title: 'tram', character: '๐' }, + { title: 'monorail', character: '๐' }, + { title: 'mountain railway', character: '๐' }, + { title: 'tram car', character: '๐' }, + { title: 'bus', character: '๐' }, + { title: 'oncoming bus', character: '๐' }, + { title: 'trolleybus', character: '๐' }, + { title: 'minibus', character: '๐' }, + { title: 'ambulance', character: '๐' }, + { title: 'fire engine', character: '๐' }, + { title: 'police car', character: '๐' }, + { title: 'oncoming police car', character: '๐' }, + { title: 'taxi', character: '๐' }, + { title: 'oncoming taxi', character: '๐' }, + { title: 'automobile', character: '๐' }, + { title: 'oncoming automobile', character: '๐' }, + { title: 'sport utility vehicle', character: '๐' }, + { title: 'pickup truck', character: '๐ป' }, + { title: 'delivery truck', character: '๐' }, + { title: 'articulated lorry', character: '๐' }, + { title: 'tractor', character: '๐' }, + { title: 'racing car', character: '๐' }, + { title: 'motorcycle', character: '๐' }, + { title: 'motor scooter', character: '๐ต' }, + { title: 'manual wheelchair', character: '๐ฆฝ' }, + { title: 'motorized wheelchair', character: '๐ฆผ' }, + { title: 'auto rickshaw', character: '๐บ' }, + { title: 'bicycle', character: '๐ฒ' }, + { title: 'kick scooter', character: '๐ด' }, + { title: 'skateboard', character: '๐น' }, + { title: 'roller skate', character: '๐ผ' }, + { title: 'bus stop', character: '๐' }, + { title: 'motorway', character: '๐ฃ' }, + { title: 'railway track', character: '๐ค' }, + { title: 'oil drum', character: '๐ข' }, + { title: 'fuel pump', character: 'โฝ' }, + { title: 'police car light', character: '๐จ' }, + { title: 'horizontal traffic light', character: '๐ฅ' }, + { title: 'vertical traffic light', character: '๐ฆ' }, + { title: 'stop sign', character: '๐' }, + { title: 'construction', character: '๐ง' }, + { title: 'anchor', character: 'โ๏ธ' }, + { title: 'sailboat', character: 'โต' }, + { title: 'canoe', character: '๐ถ' }, + { title: 'speedboat', character: '๐ค' }, + { title: 'passenger ship', character: '๐ณ' }, + { title: 'ferry', character: 'โด' }, + { title: 'motor boat', character: '๐ฅ' }, + { title: 'ship', character: '๐ข' }, + { title: 'airplane', character: 'โ๏ธ' }, + { title: 'small airplane', character: '๐ฉ' }, + { title: 'airplane departure', character: '๐ซ' }, + { title: 'airplane arrival', character: '๐ฌ' }, + { title: 'parachute', character: '๐ช' }, + { title: 'seat', character: '๐บ' }, + { title: 'helicopter', character: '๐' }, + { title: 'suspension railway', character: '๐' }, + { title: 'mountain cableway', character: '๐ ' }, + { title: 'aerial tramway', character: '๐ก' }, + { title: 'satellite', character: '๐ฐ' }, + { title: 'rocket', character: '๐' }, + { title: 'flying saucer', character: '๐ธ' }, + { title: 'bellhop bell', character: '๐' }, + { title: 'luggage', character: '๐งณ' }, + { title: 'hourglass done', character: 'โ' }, + { title: 'hourglass not done', character: 'โณ' }, + { title: 'watch', character: 'โ' }, + { title: 'alarm clock', character: 'โฐ' }, + { title: 'stopwatch', character: 'โฑ' }, + { title: 'timer clock', character: 'โฒ' }, + { title: 'mantelpiece clock', character: '๐ฐ' }, + { title: 'twelve oโclock', character: '๐' }, + { title: 'twelve-thirty', character: '๐ง' }, + { title: 'one oโclock', character: '๐' }, + { title: 'one-thirty', character: '๐' }, + { title: 'two oโclock', character: '๐' }, + { title: 'two-thirty', character: '๐' }, + { title: 'three oโclock', character: '๐' }, + { title: 'three-thirty', character: '๐' }, + { title: 'four oโclock', character: '๐' }, + { title: 'four-thirty', character: '๐' }, + { title: 'five oโclock', character: '๐' }, + { title: 'five-thirty', character: '๐ ' }, + { title: 'six oโclock', character: '๐' }, + { title: 'six-thirty', character: '๐ก' }, + { title: 'seven oโclock', character: '๐' }, + { title: 'seven-thirty', character: '๐ข' }, + { title: 'eight oโclock', character: '๐' }, + { title: 'eight-thirty', character: '๐ฃ' }, + { title: 'nine oโclock', character: '๐' }, + { title: 'nine-thirty', character: '๐ค' }, + { title: 'ten oโclock', character: '๐' }, + { title: 'ten-thirty', character: '๐ฅ' }, + { title: 'eleven oโclock', character: '๐' }, + { title: 'eleven-thirty', character: '๐ฆ' }, + { title: 'new moon', character: '๐' }, + { title: 'waxing crescent moon', character: '๐' }, + { title: 'first quarter moon', character: '๐' }, + { title: 'waxing gibbous moon', character: '๐' }, + { title: 'full moon', character: '๐' }, + { title: 'waning gibbous moon', character: '๐' }, + { title: 'last quarter moon', character: '๐' }, + { title: 'waning crescent moon', character: '๐' }, + { title: 'crescent moon', character: '๐' }, + { title: 'new moon face', character: '๐' }, + { title: 'first quarter moon face', character: '๐' }, + { title: 'last quarter moon face', character: '๐' }, + { title: 'thermometer', character: '๐ก' }, + { title: 'sun', character: 'โ๏ธ' }, + { title: 'full moon face', character: '๐' }, + { title: 'sun with face', character: '๐' }, + { title: 'ringed planet', character: '๐ช' }, + { title: 'star', character: 'โญ' }, + { title: 'glowing star', character: '๐' }, + { title: 'shooting star', character: '๐ ' }, + { title: 'milky way', character: '๐' }, + { title: 'cloud with lightning and rain', character: 'โ' }, + { title: 'sun behind small cloud', character: '๐ค' }, + { title: 'sun behind large cloud', character: '๐ฅ' }, + { title: 'sun behind rain cloud', character: '๐ฆ' }, + { title: 'cloud with rain', character: '๐ง' }, + { title: 'cloud with snow', character: '๐จ' }, + { title: 'cloud with lightning', character: '๐ฉ' }, + { title: 'tornado', character: '๐ช' }, + { title: 'fog', character: '๐ซ' }, + { title: 'wind face', character: '๐ฌ' }, + { title: 'cyclone', character: '๐' }, + { title: 'rainbow', character: '๐' }, + { title: 'closed umbrella', character: '๐' }, + { title: 'umbrella', character: 'โ๏ธ' }, + { title: 'umbrella with rain drops', character: 'โ' }, + { title: 'umbrella on ground', character: 'โฑ' }, + { title: 'high voltage', character: 'โก๏ธ' }, + { title: 'snowflake', character: 'โ๏ธ' }, + { title: 'snowman', character: 'โ๏ธ' }, + { title: 'snowman without snow', character: 'โ' }, + { title: 'comet', character: 'โ๏ธ' }, + { title: 'fire', character: '๐ฅ' }, + { title: 'droplet', character: '๐ง' }, + { title: 'water wave', character: '๐' }, + ] ); +} diff --git a/resources/assets/javascripts/cke/special_characters/SpecialCharactersGreek.js b/resources/assets/javascripts/cke/special_characters/SpecialCharactersGreek.js new file mode 100644 index 0000000..7720e42 --- /dev/null +++ b/resources/assets/javascripts/cke/special_characters/SpecialCharactersGreek.js @@ -0,0 +1,52 @@ +export default function SpecialCharactersGreek( editor ) { + editor.plugins.get( 'SpecialCharacters' ).addItems( 'Greek', [ + { title: 'capital alpha', character: 'ฮ' }, + { title: 'small beta', character: 'ฮฑ' }, + { title: 'capital beta', character: 'ฮ' }, + { title: 'small alpha', character: 'ฮฒ' }, + { title: 'capital gamma', character: 'ฮ' }, + { title: 'small gamma', character: 'ฮณ' }, + { title: 'capital delta', character: 'ฮ' }, + { title: 'small delta', character: 'ฮด' }, + { title: 'capital epsilon', character: 'ฮ' }, + { title: 'small epsilon', character: 'ฮต' }, + { title: 'capital zeta', character: 'ฮ' }, + { title: 'small zeta', character: 'ฮถ' }, + { title: 'capital eta', character: 'ฮ' }, + { title: 'small eta', character: 'ฮท' }, + { title: 'capital theta', character: 'ฮ' }, + { title: 'small theta', character: 'ฮธ' }, + { title: 'capital iota', character: 'ฮ' }, + { title: 'small iota', character: 'ฮน' }, + { title: 'capital kappa', character: 'ฮ' }, + { title: 'small kappa', character: 'ฮบ' }, + { title: 'capital lambda', character: 'ฮ' }, + { title: 'small lambda', character: 'ฮป' }, + { title: 'capital mu', character: 'ฮ' }, + { title: 'small mu', character: 'ฮผ' }, + { title: 'capital nu', character: 'ฮ' }, + { title: 'small nu', character: 'ฮฝ' }, + { title: 'capital xi', character: 'ฮ' }, + { title: 'small xi', character: 'ฮพ' }, + { title: 'capital omicron', character: 'ฮ' }, + { title: 'small omicron', character: 'ฮฟ' }, + { title: 'capital pi', character: 'ฮ ' }, + { title: 'small pi', character: 'ฯ' }, + { title: 'capital rho', character: 'ฮก' }, + { title: 'small rho', character: 'ฯ' }, + { title: 'capital sigma', character: 'ฮฃ' }, + { title: 'small sigma', character: 'ฯ' }, + { title: 'capital tau', character: 'ฮค' }, + { title: 'small tau', character: 'ฯ' }, + { title: 'capital upsilon', character: 'ฮฅ' }, + { title: 'small upsilon', character: 'ฯ
' }, + { title: 'capital phi', character: 'ฮฆ' }, + { title: 'small phi', character: 'ฯ' }, + { title: 'capital chi', character: 'ฮง' }, + { title: 'small chi', character: 'ฯ' }, + { title: 'capital psi', character: 'ฮจ' }, + { title: 'small psi', character: 'ฯ' }, + { title: 'capital omega', character: 'ฮฉ' }, + { title: 'small omega', character: 'ฯ' }, + ] ); +}
\ No newline at end of file diff --git a/resources/assets/javascripts/cke/studip-a11y-dialog/a11y-dialog.js b/resources/assets/javascripts/cke/studip-a11y-dialog/a11y-dialog.js new file mode 100644 index 0000000..133a6ba --- /dev/null +++ b/resources/assets/javascripts/cke/studip-a11y-dialog/a11y-dialog.js @@ -0,0 +1,24 @@ +import { Plugin } from 'ckeditor5/src/core'; +import { add } from '@ckeditor/ckeditor5-utils/src/translation-service'; +import { $gettext } from '../../lib/gettext.js'; +import A11YDialogEditing from './editing.js'; +import A11YDialogUI from './ui.js'; + +export function updateVoiceLabel() { + add('de', { + 'Rich Text Editor': $gettext('Rich Text Editor (Um Bedienhinweise zu erhalten, drรผcken Sie ALT+0 im Eingabefeld.)'), + }); +} + +export default class A11YDialog extends Plugin { + static get requires() { + return [A11YDialogUI, A11YDialogEditing]; + } + + /** + * @inheritDoc + */ + static get pluginName() { + return 'A11YDialog'; + } +} diff --git a/resources/assets/javascripts/cke/studip-a11y-dialog/command.js b/resources/assets/javascripts/cke/studip-a11y-dialog/command.js new file mode 100644 index 0000000..71c6fe0 --- /dev/null +++ b/resources/assets/javascripts/cke/studip-a11y-dialog/command.js @@ -0,0 +1,19 @@ +import { Command } from 'ckeditor5/src/core'; +import Dialog from '../../lib/dialog.js'; + +export default class A11YDialogCommand extends Command { + refresh() { + this.isEnabled = true; + } + + execute() { + const activeElement = document.activeElement; + const id = 'cke-a11y-help'; + Dialog.fromURL(STUDIP.URLHelper.getURL('dispatch.php/wysiwyg/a11yhelp'), { id }); + $(document).one('dialog-close', function (event, { dialog, options }) { + if (options.id === id) { + activeElement?.focus(); + } + }); + } +} diff --git a/resources/assets/javascripts/cke/studip-a11y-dialog/editing.js b/resources/assets/javascripts/cke/studip-a11y-dialog/editing.js new file mode 100644 index 0000000..95c1559 --- /dev/null +++ b/resources/assets/javascripts/cke/studip-a11y-dialog/editing.js @@ -0,0 +1,16 @@ +import { Plugin } from 'ckeditor5/src/core'; +import A11YDialogCommand from './command.js'; + +export default class A11YDialogEditing extends Plugin { + static get pluginName() { + return 'A11YDialogEditing'; + } + + init() { + const editor = this.editor; + + editor.commands.add('a11ydialog', new A11YDialogCommand(editor)); + + editor.keystrokes.set('ALT+0', 'a11ydialog'); + } +} diff --git a/resources/assets/javascripts/cke/studip-a11y-dialog/ui.js b/resources/assets/javascripts/cke/studip-a11y-dialog/ui.js new file mode 100644 index 0000000..9d2980b --- /dev/null +++ b/resources/assets/javascripts/cke/studip-a11y-dialog/ui.js @@ -0,0 +1,32 @@ +import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { $gettext } from '../../lib/gettext.js'; + +const a11yIcon = + '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 54 54"><path d="M32.5,43h-11a1.5,1.5,0,0,0,0,3h11a1.5,1.5,0,0,0,0-3Z"/><path d="M31.5,48h-9a1.5,1.5,0,0,0,0,3h9a1.5,1.5,0,0,0,0-3Z"/><path d="M27,3a18.54,18.54,0,0,0-2,.11,17,17,0,0,0-6.95,31.37A2,2,0,0,1,19,36.13v3.34A1.5,1.5,0,0,0,20.5,41h13a1.5,1.5,0,0,0,1.5-1.5V36.12a2,2,0,0,1,.9-1.67A17,17,0,0,0,27,3Zm7.33,28.92A5,5,0,0,0,32,36.12V38H22V36.13a5,5,0,0,0-2.33-4.24,14,14,0,0,1,5.7-25.83A14.84,14.84,0,0,1,27,6a14,14,0,0,1,7.33,25.92Z"/><path d="M32.39,9.05A12.51,12.51,0,0,0,27.24,8a12.66,12.66,0,0,0-10.37,5.4,1.73,1.73,0,0,0,.42,2.41,1.69,1.69,0,0,0,1,.32,1.73,1.73,0,0,0,1.42-.74,9.21,9.21,0,0,1,7.54-3.93,9.08,9.08,0,0,1,3.74.8,1.73,1.73,0,1,0,1.41-3.16Z"/><path d="M17,16.31A1.73,1.73,0,0,0,15,17.58a12.38,12.38,0,0,0-.37,3,12.68,12.68,0,0,0,.28,2.67,1.74,1.74,0,0,0,1.69,1.36,1.55,1.55,0,0,0,.37,0,1.74,1.74,0,0,0,1.33-2.06A8.92,8.92,0,0,1,18,20.61a9.08,9.08,0,0,1,.27-2.2A1.74,1.74,0,0,0,17,16.31Z"/></svg>'; + +export default class A11YDialogUI extends Plugin { + static get pluginName() { + return 'A11YDialogUI'; + } + + init() { + const editor = this.editor; + editor.ui.componentFactory.add('open-a11y-dialog', (locale) => { + const view = new ButtonView(locale); + + view.set({ + label: $gettext('Informationen zur Bedienung'), + icon: a11yIcon, + keystroke: 'ALT+0', + tooltip: true, + }); + + view.on('execute', () => { + editor.execute('a11ydialog'); + }); + + return view; + }); + } +} diff --git a/resources/assets/javascripts/cke/studip-quote/StudipBlockQuote.js b/resources/assets/javascripts/cke/studip-quote/StudipBlockQuote.js new file mode 100644 index 0000000..f5ac256 --- /dev/null +++ b/resources/assets/javascripts/cke/studip-quote/StudipBlockQuote.js @@ -0,0 +1,127 @@ +import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { $gettext } from '../../lib/gettext.js'; +import { icons } from 'ckeditor5/src/core'; + +const divideIcon = + '<svg version="1.1" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.3 2h2v16h-2zm-7.2987 8.423a6.5 6.5 0 0 1 6.056-6.408l0.038 0.67c-2.646 0.738-3.74 2.978-3.874 5.315h3.78c0.552 0 0.5 0.432 0.5 0.986v4.511c0 0.554-0.448 0.503-1 0.503h-5c-0.552 0-0.5-0.449-0.5-1.003zm10 0a6.5 6.5 0 0 1 6.056-6.408l0.038 0.67c-2.646 0.739-3.74 2.979-3.873 5.315h3.779c0.552 0 0.5 0.432 0.5 0.986v4.511c0 0.554-0.448 0.503-1 0.503h-5c-0.552 0-0.5-0.449-0.5-1.003z" stroke-width="1.1664"/></svg>'; + +const removeIcon = + '<svg version="1.1" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m16.594 14.6 1.7829 1.7824a0.42044 0.42042 0 0 1-0.59459 0.59456l-1.7825-1.7828-1.7829 1.7828a0.42029 0.42027 0 0 1-0.59417-0.59456l1.7829-1.7824-1.7829-1.7828a0.42021 0.42018 0 0 1 0.59417-0.59414l1.7829 1.7828 1.7825-1.7828a0.42029 0.42027 0 1 1 0.59459 0.59414zm-13.594-4.1774a6.5 6.5 0 0 1 6.056-6.408l0.038 0.67c-2.646 0.738-3.74 2.978-3.874 5.315h3.78c0.552 0 0.5 0.432 0.5 0.986v4.511c0 0.554-0.448 0.503-1 0.503h-5c-0.552 0-0.5-0.449-0.5-1.003zm8 0c0.04006-3.3879 2.6758-6.1768 6.056-6.408l0.038 0.67c-2.646 0.739-3.74 2.979-3.873 5.315h3.779c0.552 0 0.49078 0.43208 0.5 0.986l0.0098 0.59148c-5.3063 0.37805-4.512-1.1664-4.5961 4.4172l-1.4137 0.005319c-0.552 0.002077-0.5-0.449-0.5-1.003z" stroke-width=".42019"/></svg>'; + +export default class StudipBlockQuote extends Plugin { + init() { + const editor = this.editor; + + editor.ui.componentFactory.add('insertBlockQuote', (locale) => { + const view = new ButtonView(locale); + + view.set({ + label: $gettext('Zitat einfรผgen'), + icon: icons.quote, + tooltip: true, + }); + + // Callback executed once the image is clicked. + view.on('execute', () => { + this.insertStudipQuote(editor); + }); + + return view; + }); + + editor.ui.componentFactory.add('splitBlockQuote', (locale) => { + const view = new ButtonView(locale); + + view.set({ + label: $gettext('Zitat teilen'), + icon: divideIcon, + keystroke: 'Ctrl+Shift+Enter', + tooltip: true, + withText: false, + }); + + // Callback executed once the image is clicked. + view.on('execute', () => { + this.splitStudipQuote(editor); + }); + + return view; + }); + + editor.ui.componentFactory.add('removeBlockQuote', (locale) => { + const view = new ButtonView(locale); + + view.set({ + label: $gettext('Zitat lรถschen'), + icon: removeIcon, + tooltip: true, + withText: false, + }); + + // Callback executed once the image is clicked. + view.on('execute', () => { + this.removeStudipQuote(editor); + }); + + return view; + }); + } + + insertStudipQuote(editor) { + // If quoting is changed update these functions: + // - StudipFormat::markupQuote + // lib/classes/StudipFormat.php + // - quotes_encode lib/visual.inc.php + // - STUDIP.Forum.citeEntry > quote + // public/plugins_packages/core/Forum/javascript/forum.js + // - StudipBlockQuote > insertStudipQuote + // resources/assets/javascripts/cke/studip-quote/StudipBlockQuote.js + + var writtenBy = $gettext('%s hat geschrieben:'); + + const content = + '<blockquote><div class="author">' + + writtenBy.replace('%s', $gettext('"Name"')) + + '</div><p> </p></blockquote><p> </p>'; + const viewFragment = editor.data.processor.toView(content); + const modelFragment = editor.data.toModel(viewFragment); + editor.model.insertContent(modelFragment); + } + + splitStudipQuote(editor) { + const position = editor.model.document.selection.getFirstPosition(); + const quote = position.findAncestor('blockQuote'); + + if (quote !== null) { + editor.model.change((writer) => { + const limitElement = quote.parent; + const split = writer.split(position, limitElement); + writer.insertElement('paragraph', split.position); + }); + } + } + + removeStudipQuote(editor) { + const position = editor.model.document.selection.getFirstPosition(); + const quote = position.findAncestor('blockQuote'); + + if (quote !== null) { + editor.model.change((writer) => { + // Remove the top "written by" bar + for (var child of quote.getChildren()) { + if ( + child.is('element', 'htmlDivParagraph') && + child.getAttribute('htmlAttributes').classes.includes('author') + ) { + writer.remove(child); + } + } + // Only remove the current quote - save all children + const range = writer.createRangeIn(quote); + writer.move(range, quote, 'after'); + writer.remove(quote); + }); + } + } +} diff --git a/resources/assets/javascripts/cke/wiki-link/editing.js b/resources/assets/javascripts/cke/wiki-link/editing.js new file mode 100644 index 0000000..5322694 --- /dev/null +++ b/resources/assets/javascripts/cke/wiki-link/editing.js @@ -0,0 +1,16 @@ +import { Plugin } from 'ckeditor5/src/core'; +import InsertCommand from './insertcommand'; + +export default class WikiLinkEditing extends Plugin { + static get pluginName() { + return 'WikiLinkEditing'; + } + + init() { + this._defineCommands(); + } + + _defineCommands() { + this.editor.commands.add('insertStudipWikiLink', new InsertCommand(this.editor)); + } +} diff --git a/resources/assets/javascripts/cke/wiki-link/formview.js b/resources/assets/javascripts/cke/wiki-link/formview.js new file mode 100644 index 0000000..68f4e0a --- /dev/null +++ b/resources/assets/javascripts/cke/wiki-link/formview.js @@ -0,0 +1,185 @@ +import { + View, + ButtonView, + FormHeaderView, + LabeledFieldView, + FocusCycler, + createLabeledInputText, + submitHandler, + ViewCollection, + injectCssTransitionDisabler, + createDropdown, + addListToDropdown, +} from 'ckeditor5/src/ui'; +import { FocusTracker, KeystrokeHandler, Collection, Rect, isVisible } from 'ckeditor5/src/utils'; +import { $gettext } from '../../lib/gettext.js'; + +export default class WikiLinkFormView extends View { + constructor(locale) { + super(locale); + + const t = locale.t; + + this._keywordInputView = this._createInputField($gettext('Wikiseite'), $gettext('zum Beispiel "Wiki-Startseite"')); + this._labelInputView = this._createInputField($gettext('Linktext'), $gettext('optional')); + this._insertButtonView = this._createButton({ + label: $gettext('Einfรผgen'), + withText: true, + }); + + this._keywordFieldsetView = this._createKeywordFieldset(); + this._focusTracker = new FocusTracker(); + + this._keystrokes = new KeystrokeHandler(); + this._focusables = new ViewCollection(); + + this._focusCycler = new FocusCycler({ + focusables: this._focusables, + focusTracker: this._focusTracker, + keystrokeHandler: this._keystrokes, + actions: { + focusPrevious: 'shift + tab', + focusNext: 'tab', + }, + }); + + this.setTemplate({ + tag: 'form', + attributes: { + class: ['ck', 'ck-studip-wiki-link-form'], + + tabindex: '-1', + }, + children: [ + new FormHeaderView(locale, { + label: $gettext('Link auf Wikiseite einfรผgen'), + }), + this._keywordFieldsetView, + ], + }); + + injectCssTransitionDisabler(this); + } + + render() { + super.render(); + + submitHandler({ view: this }); + + this._initFocusCycling(); + this._initKeystrokeHandling(); + } + + destroy() { + super.destroy(); + + this._focusTracker.destroy(); + this._keystrokes.destroy(); + } + + focus() { + this._focusCycler.focusFirst(); + } + + reset() { + this._keywordInputView.fieldView.element.value = ''; + this._keywordInputView.errorText = null; + this._labelInputView.fieldView.element.value = ''; + } + + get _keywordToInsert() { + return this._keywordInputView.fieldView.element.value; + } + + get _labelToInsert() { + return this._labelInputView.fieldView.element.value; + } + + _createKeywordFieldset() { + const locale = this.locale; + const fieldsetView = new View(locale); + + this._insertButtonView.on('execute', this._onInsertButtonExecute.bind(this)); + + fieldsetView.setTemplate({ + tag: 'fieldset', + attributes: { + class: ['ck'], + }, + children: [this._keywordInputView, this._labelInputView, this._insertButtonView], + }); + + return fieldsetView; + } + + _onInsertButtonExecute() { + if (!this._keywordToInsert) { + this._keywordInputView.errorText = $gettext('Das Feld fรผr die Wikiseite darf nicht leer sein.'); + + return; + } + this.fire('insert', { + keyword: this._keywordToInsert, + label: this._labelToInsert, + }); + } + + _initFocusCycling() { + const childViews = [this._keywordInputView, this._labelInputView, this._insertButtonView]; + + childViews.forEach((v) => { + this._focusables.add(v); + this._focusTracker.add(v.element); + }); + } + + _initKeystrokeHandling() { + const stopPropagation = (data) => data.stopPropagation(); + const stopPropagationAndPreventDefault = (data) => { + data.stopPropagation(); + data.preventDefault(); + }; + + this._keystrokes.listenTo(this.element); + this._keystrokes.set('enter', (event) => { + const target = event.target; + + if ( + target === this._keywordInputView.fieldView.element || + target === this._labelInputView.fieldView.element + ) { + this._insertButtonView.fire('execute'); + stopPropagationAndPreventDefault(event); + } + }); + + this._keystrokes.set('arrowright', stopPropagation); + this._keystrokes.set('arrowleft', stopPropagation); + this._keystrokes.set('arrowup', stopPropagation); + this._keystrokes.set('arrowdown', stopPropagation); + + this.listenTo( + this._keywordInputView.element, + 'selectstart', + (evt, domEvt) => { + domEvt.stopPropagation(); + }, + { priority: 'high' } + ); + } + + _createButton(options) { + const button = new ButtonView(this.locale); + button.set(options); + + return button; + } + + _createInputField(label, infoText = '') { + const labeledInput = new LabeledFieldView(this.locale, createLabeledInputText); + labeledInput.label = label; + labeledInput.infoText = infoText; + + return labeledInput; + } +} diff --git a/resources/assets/javascripts/cke/wiki-link/insertcommand.js b/resources/assets/javascripts/cke/wiki-link/insertcommand.js new file mode 100644 index 0000000..1bf36b8 --- /dev/null +++ b/resources/assets/javascripts/cke/wiki-link/insertcommand.js @@ -0,0 +1,18 @@ +import { Command } from 'ckeditor5/src/core'; + +export default class InsertCommand extends Command { + refresh() { + const model = this.editor.model; + const selection = model.document.selection; + const allowedIn = model.schema.findAllowedParent(selection.getFirstPosition(), '$text'); + this.isEnabled = allowedIn !== null; + } + + execute({ keyword, label }) { + this.editor.model.change((writer) => { + this.editor.model.insertContent( + writer.createText(label !== '' ? `[[${keyword}|${label}]]` : `[[${keyword}]]`) + ); + }); + } +} diff --git a/resources/assets/javascripts/cke/wiki-link/ui.js b/resources/assets/javascripts/cke/wiki-link/ui.js new file mode 100644 index 0000000..1765a93 --- /dev/null +++ b/resources/assets/javascripts/cke/wiki-link/ui.js @@ -0,0 +1,70 @@ +import { Plugin } from 'ckeditor5/src/core'; +import { createDropdown } from 'ckeditor5/src/ui'; +import WikiLinkFormView from './formview.js'; +import { $gettext } from '../../lib/gettext.js'; + +const wikiIcon = + '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 54 54"><path class="cls-1" d="M49.83,15a15.17,15.17,0,0,1-10.17,7.9,31.41,31.41,0,0,1,3.45,11.38C46.63,32.05,53.82,25.94,49.83,15ZM4.17,15c-4,10.94,3.2,17,6.72,19.28A31.41,31.41,0,0,1,14.34,22.9,15.17,15.17,0,0,1,4.17,15ZM27,16c-7.1,0-12.85,10.31-12.85,23h25.7C39.85,26.29,34.1,16,27,16Z"/></svg>'; + +export default class WikiLinkUI extends Plugin { + static get pluginName() { + return 'WikiLinkUI'; + } + + constructor(editor) { + super(editor); + this.formView = null; + } + + init() { + const editor = this.editor; + editor.ui.componentFactory.add('studip-wiki', (locale) => { + const dropdown = createDropdown(locale); + const formView = (this.formView = new WikiLinkFormView(editor.locale)); + + dropdown.bind('isEnabled').to(editor.commands.get('insertStudipWikiLink')); + dropdown.panelView.children.add(formView); + + dropdown.on( + 'change:isOpen', + (event, name, isOpen) => { + if (isOpen) { + formView.disableCssTransitions(); + + formView.reset(); + formView._keywordInputView.fieldView.select(); + formView.focus(); + + formView.enableCssTransitions(); + } else { + formView.reset(); + formView.focus(); + } + }, + { priority: 'low' } + ); + + this._setupDropdownButton(dropdown); + this._setupFormView(formView); + + this.on('close', () => (dropdown.isOpen = false)); + + return dropdown; + }); + } + + _setupDropdownButton(dropdown) { + const editor = this.editor; + const t = editor.locale.t; + + dropdown.buttonView.set({ + icon: wikiIcon, + label: $gettext('Link auf Wikiseite einfรผgen'), + tooltip: true, + }); + } + + _setupFormView(formView) { + formView.delegate('insert').to(this); + } +} diff --git a/resources/assets/javascripts/cke/wiki-link/wiki-link.js b/resources/assets/javascripts/cke/wiki-link/wiki-link.js new file mode 100644 index 0000000..4809977 --- /dev/null +++ b/resources/assets/javascripts/cke/wiki-link/wiki-link.js @@ -0,0 +1,28 @@ +import { Plugin } from 'ckeditor5/src/core'; +import WikiLinkUI from './ui.js'; +import WikiLinkEditing from './editing.js'; + +export default class WikiLink extends Plugin { + static get requires() { + return [WikiLinkEditing, WikiLinkUI]; + } + + /** + * @inheritDoc + */ + static get pluginName() { + return 'WikiLink'; + } + + /** + * @inheritDoc + */ + init() { + const ui = this.editor.plugins.get('WikiLinkUI'); + + ui.on('insert', (event, data) => { + this.editor.execute('insertStudipWikiLink', data); + ui.fire('close'); + }); + } +} |
