/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ (function() { 'use strict'; /** * sgCkeditor - A component for the CKEditor v4 * Based on https://github.com/jziggas/ng-ck/. * @memberof SOGo.Common * @example: */ function sgCkeditorConfigProvider() { // Default plugins that have successfully passed through Angular's $sanitize service var events = [ 'activeEnterModeChange', 'activeFilterChange', 'afterCommandExec', 'afterInsertHtml', 'afterPaste', 'afterPasteFromWord', 'afterSetData', 'afterUndoImage', 'ariaEditorHelpLabel', 'autogrow', 'beforeCommandExec', 'beforeDestroy', 'beforeGetData', 'beforeModeUnload', 'beforeSetMode', 'beforeUndoImage', 'blur', 'change', 'configLoaded', 'contentDirLoaded', 'contentDom', 'contentDomInvalidated', 'contentDomUnload', 'customConfigLoaded', 'dataFiltered', 'dataReady', 'destroy', 'dialogHide', 'dialogShow', 'dirChanged', 'doubleclick', 'dragend', 'dragstart', 'drop', 'elementsPathUpdate', 'fileUploadRequest', 'fileUploadResponse', 'floatingSpaceLayout', 'focus', 'getData', 'getSnapshot', 'insertElement', 'insertHtml', 'insertText', 'instanceReady', 'key', 'langLoaded', 'loadSnapshot', 'loaded', 'lockSnapshot', 'maximize', 'menuShow', 'mode', 'notificationHide', 'notificationShow', 'notificationUpdate', 'paste', 'pasteFromWord', 'pluginsLoaded', 'readOnly', 'removeFormatCleanup', 'required', 'resize', 'save', 'saveSnapshot', 'selectionChange', 'setData', 'stylesSet', 'template', 'toDataFormat', 'toHtml', 'unlockSnapshot', 'updateSnapshot', 'widgetDefinition' ]; var config = {};//angular.copy(defaultConfiguration); this.$get = function () { return { config: config, events: events } }; } var sgCkeditorComponent = { controllerAs: 'vm', require: { ngModelCtrl: 'ngModel' }, bindings: { checkTextLength: '', controller: sgCkeditorController }; var emojis = [ { title: 'Grinning Face', character: '๐Ÿ˜€' }, { title: 'Grinning Face with Big Eyes', character: '๐Ÿ˜ƒ' }, { title: 'Grinning Face with Smiling Eyes', character: '๐Ÿ˜„' }, { title: 'Beaming Face with Smiling Eyes', character: '๐Ÿ˜' }, { title: 'Grinning Squinting Face', character: '๐Ÿ˜†' }, { title: 'Grinning Face with Sweat', character: '๐Ÿ˜…' }, { title: 'Rolling on the Floor Laughing', character: '๐Ÿคฃ' }, { title: 'Face with Tears of Joy', character: '๐Ÿ˜‚' }, { title: 'Slightly Smiling Face', character: '๐Ÿ™‚' }, { title: 'Upside-Down Face', character: '๐Ÿ™ƒ' }, { title: 'Winking Face', character: '๐Ÿ˜‰' }, { title: 'Smiling Face with Smiling Eyes', character: '๐Ÿ˜Š' }, { title: 'Smiling Face with Halo', character: '๐Ÿ˜‡' }, { title: 'Smiling Face with Hearts', character: '๐Ÿฅฐ' }, { title: 'Smiling Face with Heart-Eyes', character: '๐Ÿ˜' }, { title: 'Star-Struck', character: '๐Ÿคฉ' }, { title: 'Face Blowing a Kiss', character: '๐Ÿ˜˜' }, { title: 'Kissing Face', character: '๐Ÿ˜—' }, { title: 'Smiling Face', character: 'โ˜บ๏ธ' }, { title: 'Kissing Face with Closed Eyes', character: '๐Ÿ˜š' }, { title: 'Kissing Face with Smiling Eyes', character: '๐Ÿ˜™' }, { title: 'Smiling Face with Tear', character: '๐Ÿฅฒ' }, { title: 'Face Savoring Food', character: '๐Ÿ˜‹' }, { title: 'Face with Tongue', character: '๐Ÿ˜›' }, { title: 'Winking Face with Tongue', character: '๐Ÿ˜œ' }, { title: 'Zany Face', character: '๐Ÿคช' }, { title: 'Squinting Face with Tongue', character: '๐Ÿ˜' }, { title: 'Money-Mouth Face', character: '๐Ÿค‘' }, { title: 'Hugging Face', character: '๐Ÿค—' }, { title: 'Face with Hand Over Mouth', character: '๐Ÿคญ' }, { title: 'Shushing Face', character: '๐Ÿคซ' }, { title: 'Thinking Face', character: '๐Ÿค”' }, { title: 'Zipper-Mouth Face', character: '๐Ÿค' }, { title: 'Face with Raised Eyebrow', character: '๐Ÿคจ' }, { title: 'Neutral Face', character: '๐Ÿ˜' }, { title: 'Expressionless Face', character: '๐Ÿ˜‘' }, { title: 'Face Without Mouth', character: '๐Ÿ˜ถ' }, { title: 'Smirking Face', character: '๐Ÿ˜' }, { title: 'Unamused Face', character: '๐Ÿ˜’' }, { title: 'Face with Rolling Eyes', character: '๐Ÿ™„' }, { title: 'Grimacing Face', character: '๐Ÿ˜ฌ' }, { title: 'Lying Face', character: '๐Ÿคฅ' }, { title: 'Relieved Face', character: '๐Ÿ˜Œ' }, { title: 'Pensive Face', character: '๐Ÿ˜”' }, { title: 'Sleepy Face', character: '๐Ÿ˜ช' }, { title: 'Drooling Face', character: '๐Ÿคค' }, { title: 'Sleeping Face', character: '๐Ÿ˜ด' }, { title: 'Face with Medical Mask', character: '๐Ÿ˜ท' }, { title: 'Face with Thermometer', character: '๐Ÿค’' }, { title: 'Face with Head-Bandage', character: '๐Ÿค•' }, { title: 'Nauseated Face', character: '๐Ÿคข' }, { title: 'Face Vomiting', character: '๐Ÿคฎ' }, { title: 'Sneezing Face', character: '๐Ÿคง' }, { title: 'Hot Face', character: '๐Ÿฅต' }, { title: 'Cold Face', character: '๐Ÿฅถ' }, { title: 'Woozy Face', character: '๐Ÿฅด' }, { title: 'Dizzy Face', character: '๐Ÿ˜ต' }, { title: 'Exploding Head', character: '๐Ÿคฏ' }, { title: 'Cowboy Hat Face', character: '๐Ÿค ' }, { title: 'Partying Face', character: '๐Ÿฅณ' }, { title: 'Disguised Face', character: '๐Ÿฅธ' }, { title: 'Smiling Face with Sunglasses', character: '๐Ÿ˜Ž' }, { title: 'Nerd Face', character: '๐Ÿค“' }, { title: 'Face with Monocle', character: '๐Ÿง' }, { title: 'Confused Face', character: '๐Ÿ˜•' }, { title: 'Worried Face', character: '๐Ÿ˜Ÿ' }, { title: 'Slightly Frowning Face', character: '๐Ÿ™' }, { title: 'Frowning Face', character: 'โ˜น๏ธ' }, { title: 'Face with Open Mouth', character: '๐Ÿ˜ฎ' }, { title: 'Hushed Face', character: '๐Ÿ˜ฏ' }, { title: 'Astonished Face', character: '๐Ÿ˜ฒ' }, { title: 'Flushed Face', character: '๐Ÿ˜ณ' }, { title: 'Pleading Face', character: '๐Ÿฅบ' }, { title: 'Frowning Face with Open Mouth', character: '๐Ÿ˜ฆ' }, { title: 'Anguished Face', character: '๐Ÿ˜ง' }, { title: 'Fearful Face', character: '๐Ÿ˜จ' }, { title: 'Anxious Face with Sweat', character: '๐Ÿ˜ฐ' }, { title: 'Sad but Relieved Face', character: '๐Ÿ˜ฅ' }, { title: 'Crying Face', character: '๐Ÿ˜ข' }, { title: 'Loudly Crying Face', character: '๐Ÿ˜ญ' }, { title: 'Face Screaming in Fear', character: '๐Ÿ˜ฑ' }, { title: 'Confounded Face', character: '๐Ÿ˜–' }, { title: 'Persevering Face', character: '๐Ÿ˜ฃ' }, { title: 'Disappointed Face', character: '๐Ÿ˜ž' }, { title: 'Downcast Face with Sweat', character: '๐Ÿ˜“' }, { title: 'Weary Face', character: '๐Ÿ˜ฉ' }, { title: 'Tired Face', character: '๐Ÿ˜ซ' }, { title: 'Yawning Face', character: '๐Ÿฅฑ' }, { title: 'Face with Steam From Nose', character: '๐Ÿ˜ค' }, { title: 'Pouting Face', character: '๐Ÿ˜ก' }, { title: 'Angry Face', character: '๐Ÿ˜ ' }, { title: 'Face with Symbols on Mouth', character: '๐Ÿคฌ' }, { title: 'Smiling Face with Horns', character: '๐Ÿ˜ˆ' }, { title: 'Angry Face with Horns', character: '๐Ÿ‘ฟ' }, { title: 'Skull', character: '๐Ÿ’€' }, { title: 'Skull and Crossbones', character: 'โ˜ ๏ธ' }, { title: 'Pile of Poo', character: '๐Ÿ’ฉ' }, { title: 'Clown Face', character: '๐Ÿคก' }, { title: 'Ogre', character: '๐Ÿ‘น' }, { title: 'Goblin', character: '๐Ÿ‘บ' }, { title: 'Ghost', character: '๐Ÿ‘ป' }, { title: 'Alien', character: '๐Ÿ‘ฝ' }, { title: 'Alien Monster', character: '๐Ÿ‘พ' }, { title: 'Robot', character: '๐Ÿค–' }, { title: 'Grinning Cat', character: '๐Ÿ˜บ' }, { title: 'Grinning Cat with Smiling Eyes', character: '๐Ÿ˜ธ' }, { title: 'Cat with Tears of Joy', character: '๐Ÿ˜น' }, { title: 'Smiling Cat with Heart-Eyes', character: '๐Ÿ˜ป' }, { title: 'Cat with Wry Smile', character: '๐Ÿ˜ผ' }, { title: 'Kissing Cat', character: '๐Ÿ˜ฝ' }, { title: 'Weary Cat', character: '๐Ÿ™€' }, { title: 'Crying Cat', character: '๐Ÿ˜ฟ' }, { title: 'Pouting Cat', character: '๐Ÿ˜พ' }, { title: 'Kiss Mark', 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: 'Middle Finger', 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: 'Oncoming Fist', character: '๐Ÿ‘Š' }, { title: 'Left-Facing Fist', character: '๐Ÿค›' }, { title: 'Right-Facing 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: 'Nail Polish', character: '๐Ÿ’…' }, { title: 'Selfie', character: '๐Ÿคณ' }, { title: 'Flexed Biceps', character: '๐Ÿ’ช' }, { title: 'Mechanical Arm', character: '๐Ÿฆพ' }, { title: 'Mechanical Leg', character: '๐Ÿฆฟ' }, { title: 'Leg', character: '๐Ÿฆต' }, { title: 'Foot', character: '๐Ÿฆถ' }, { title: 'Ear', character: '๐Ÿ‘‚' }, { title: 'Ear with Hearing Aid', character: '๐Ÿฆป' }, { title: 'Nose', character: '๐Ÿ‘ƒ' }, { title: 'Brain', character: '๐Ÿง ' }, { title: 'Anatomical Heart', character: '๐Ÿซ€' }, { title: 'Lungs', character: '๐Ÿซ' }, { title: 'Tooth', character: '๐Ÿฆท' }, { title: 'Bone', character: '๐Ÿฆด' }, { title: 'Eyes', character: '๐Ÿ‘€' }, { title: 'Eye', character: '๐Ÿ‘๏ธ' }, { title: 'Tongue', character: '๐Ÿ‘…' }, { title: 'Mouth', character: '๐Ÿ‘„' }, { title: 'Baby', character: '๐Ÿ‘ถ' }, { title: 'Child', character: '๐Ÿง’' }, { title: 'Boy', character: '๐Ÿ‘ฆ' }, { title: 'Girl', character: '๐Ÿ‘ง' }, { title: 'Person', character: '๐Ÿง‘' }, { title: 'Person: Blond Hair', character: '๐Ÿ‘ฑ' }, { title: 'Man', character: '๐Ÿ‘จ' }, { title: 'Person: Beard', character: '๐Ÿง”' }, { title: 'Man: Red Hair', character: '๐Ÿ‘จโ€๐Ÿฆฐ' }, { title: 'Man: Curly Hair', character: '๐Ÿ‘จโ€๐Ÿฆฑ' }, { title: 'Man: White Hair', character: '๐Ÿ‘จโ€๐Ÿฆณ' }, { title: 'Man: Bald', character: '๐Ÿ‘จโ€๐Ÿฆฒ' }, { title: 'Woman', character: '๐Ÿ‘ฉ' }, { title: 'Woman: Red Hair', character: '๐Ÿ‘ฉโ€๐Ÿฆฐ' }, { title: 'Person: Red Hair', character: '๐Ÿง‘โ€๐Ÿฆฐ' }, { title: 'Woman: Curly Hair', character: '๐Ÿ‘ฉโ€๐Ÿฆฑ' }, { title: 'Person: Curly Hair', character: '๐Ÿง‘โ€๐Ÿฆฑ' }, { title: 'Woman: White Hair', character: '๐Ÿ‘ฉโ€๐Ÿฆณ' }, { title: 'Person: White Hair', character: '๐Ÿง‘โ€๐Ÿฆณ' }, { title: 'Woman: Bald', character: '๐Ÿ‘ฉโ€๐Ÿฆฒ' }, { title: 'Person: Bald', character: '๐Ÿง‘โ€๐Ÿฆฒ' }, { title: 'Woman: Blond Hair', character: '๐Ÿ‘ฑโ€โ™€๏ธ' }, { title: 'Man: Blond Hair', character: '๐Ÿ‘ฑโ€โ™‚๏ธ' }, { title: 'Older Person', character: '๐Ÿง“' }, { title: 'Old Man', character: '๐Ÿ‘ด' }, { title: 'Old 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: 'Deaf Person', character: '๐Ÿง' }, { title: 'Deaf Man', character: '๐Ÿงโ€โ™‚๏ธ' }, { title: 'Deaf Woman', character: '๐Ÿงโ€โ™€๏ธ' }, { title: 'Person Bowing', character: '๐Ÿ™‡' }, { title: 'Man Bowing', character: '๐Ÿ™‡โ€โ™‚๏ธ' }, { title: 'Woman Bowing', 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: 'Health Worker', character: '๐Ÿง‘โ€โš•๏ธ' }, { title: 'Man Health Worker', character: '๐Ÿ‘จโ€โš•๏ธ' }, { title: 'Woman Health Worker', character: '๐Ÿ‘ฉโ€โš•๏ธ' }, { title: 'Student', character: '๐Ÿง‘โ€๐ŸŽ“' }, { title: 'Man Student', character: '๐Ÿ‘จโ€๐ŸŽ“' }, { title: 'Woman Student', character: '๐Ÿ‘ฉโ€๐ŸŽ“' }, { title: 'Teacher', character: '๐Ÿง‘โ€๐Ÿซ' }, { title: 'Man Teacher', character: '๐Ÿ‘จโ€๐Ÿซ' }, { title: 'Woman Teacher', character: '๐Ÿ‘ฉโ€๐Ÿซ' }, { title: 'Judge', character: '๐Ÿง‘โ€โš–๏ธ' }, { title: 'Man Judge', character: '๐Ÿ‘จโ€โš–๏ธ' }, { title: 'Woman Judge', character: '๐Ÿ‘ฉโ€โš–๏ธ' }, { title: 'Farmer', character: '๐Ÿง‘โ€๐ŸŒพ' }, { title: 'Man Farmer', character: '๐Ÿ‘จโ€๐ŸŒพ' }, { title: 'Woman Farmer', character: '๐Ÿ‘ฉโ€๐ŸŒพ' }, { title: 'Cook', character: '๐Ÿง‘โ€๐Ÿณ' }, { title: 'Man Cook', character: '๐Ÿ‘จโ€๐Ÿณ' }, { title: 'Woman Cook', character: '๐Ÿ‘ฉโ€๐Ÿณ' }, { title: 'Mechanic', character: '๐Ÿง‘โ€๐Ÿ”ง' }, { title: 'Man Mechanic', character: '๐Ÿ‘จโ€๐Ÿ”ง' }, { title: 'Woman Mechanic', character: '๐Ÿ‘ฉโ€๐Ÿ”ง' }, { title: 'Factory Worker', character: '๐Ÿง‘โ€๐Ÿญ' }, { title: 'Man Factory Worker', character: '๐Ÿ‘จโ€๐Ÿญ' }, { title: 'Woman Factory Worker', character: '๐Ÿ‘ฉโ€๐Ÿญ' }, { title: 'Office Worker', character: '๐Ÿง‘โ€๐Ÿ’ผ' }, { title: 'Man Office Worker', character: '๐Ÿ‘จโ€๐Ÿ’ผ' }, { title: 'Woman Office Worker', character: '๐Ÿ‘ฉโ€๐Ÿ’ผ' }, { title: 'Scientist', character: '๐Ÿง‘โ€๐Ÿ”ฌ' }, { title: 'Man Scientist', character: '๐Ÿ‘จโ€๐Ÿ”ฌ' }, { title: 'Woman Scientist', character: '๐Ÿ‘ฉโ€๐Ÿ”ฌ' }, { title: 'Technologist', character: '๐Ÿง‘โ€๐Ÿ’ป' }, { title: 'Man Technologist', character: '๐Ÿ‘จโ€๐Ÿ’ป' }, { title: 'Woman Technologist', character: '๐Ÿ‘ฉโ€๐Ÿ’ป' }, { title: 'Singer', character: '๐Ÿง‘โ€๐ŸŽค' }, { title: 'Man Singer', character: '๐Ÿ‘จโ€๐ŸŽค' }, { title: 'Woman Singer', character: '๐Ÿ‘ฉโ€๐ŸŽค' }, { title: 'Artist', character: '๐Ÿง‘โ€๐ŸŽจ' }, { title: 'Man Artist', character: '๐Ÿ‘จโ€๐ŸŽจ' }, { title: 'Woman Artist', character: '๐Ÿ‘ฉโ€๐ŸŽจ' }, { title: 'Pilot', character: '๐Ÿง‘โ€โœˆ๏ธ' }, { title: 'Man Pilot', character: '๐Ÿ‘จโ€โœˆ๏ธ' }, { title: 'Woman Pilot', character: '๐Ÿ‘ฉโ€โœˆ๏ธ' }, { title: 'Astronaut', character: '๐Ÿง‘โ€๐Ÿš€' }, { title: 'Man Astronaut', character: '๐Ÿ‘จโ€๐Ÿš€' }, { title: 'Woman Astronaut', character: '๐Ÿ‘ฉโ€๐Ÿš€' }, { title: 'Firefighter', character: '๐Ÿง‘โ€๐Ÿš’' }, { title: 'Man Firefighter', character: '๐Ÿ‘จโ€๐Ÿš’' }, { title: 'Woman Firefighter', character: '๐Ÿ‘ฉโ€๐Ÿš’' }, { title: 'Police Officer', character: '๐Ÿ‘ฎ' }, { title: 'Man Police Officer', character: '๐Ÿ‘ฎโ€โ™‚๏ธ' }, { title: 'Woman Police Officer', character: '๐Ÿ‘ฎโ€โ™€๏ธ' }, { title: 'Detective', character: '๐Ÿ•ต๏ธ' }, { title: 'Man Detective', character: '๐Ÿ•ต๏ธโ€โ™‚๏ธ' }, { title: 'Woman Detective', character: '๐Ÿ•ต๏ธโ€โ™€๏ธ' }, { title: 'Guard', character: '๐Ÿ’‚' }, { title: 'Man Guard', character: '๐Ÿ’‚โ€โ™‚๏ธ' }, { title: 'Woman Guard', character: '๐Ÿ’‚โ€โ™€๏ธ' }, { title: 'Ninja', character: '๐Ÿฅท' }, { title: 'Construction Worker', character: '๐Ÿ‘ท' }, { title: 'Man Construction Worker', character: '๐Ÿ‘ทโ€โ™‚๏ธ' }, { title: 'Woman Construction Worker', character: '๐Ÿ‘ทโ€โ™€๏ธ' }, { title: 'Prince', character: '๐Ÿคด' }, { title: 'Princess', character: '๐Ÿ‘ธ' }, { title: 'Person Wearing Turban', character: '๐Ÿ‘ณ' }, { title: 'Man Wearing Turban', character: '๐Ÿ‘ณโ€โ™‚๏ธ' }, { title: 'Woman Wearing Turban', character: '๐Ÿ‘ณโ€โ™€๏ธ' }, { title: 'Person With Skullcap', character: '๐Ÿ‘ฒ' }, { title: 'Woman with Headscarf', character: '๐Ÿง•' }, { title: 'Person in Tuxedo', character: '๐Ÿคต' }, { title: 'Man in Tuxedo', character: '๐Ÿคตโ€โ™‚๏ธ' }, { title: 'Woman in Tuxedo', character: '๐Ÿคตโ€โ™€๏ธ' }, { title: 'Person With Veil', character: '๐Ÿ‘ฐ' }, { title: 'Man with Veil', character: '๐Ÿ‘ฐโ€โ™‚๏ธ' }, { title: 'Woman with Veil', character: '๐Ÿ‘ฐโ€โ™€๏ธ' }, { title: 'Pregnant Woman', character: '๐Ÿคฐ' }, { title: 'Breast-Feeding', character: '๐Ÿคฑ' }, { title: 'Woman Feeding Baby', character: '๐Ÿ‘ฉโ€๐Ÿผ' }, { title: 'Man Feeding Baby', character: '๐Ÿ‘จโ€๐Ÿผ' }, { title: 'Person Feeding Baby', character: '๐Ÿง‘โ€๐Ÿผ' }, { title: 'Baby Angel', character: '๐Ÿ‘ผ' }, { title: 'Santa Claus', character: '๐ŸŽ…' }, { title: 'Mrs. Claus', character: '๐Ÿคถ' }, { title: 'Mx Claus', character: '๐Ÿง‘โ€๐ŸŽ„' }, { title: 'Superhero', character: '๐Ÿฆธ' }, { title: 'Man Superhero', character: '๐Ÿฆธโ€โ™‚๏ธ' }, { title: 'Woman Superhero', character: '๐Ÿฆธโ€โ™€๏ธ' }, { title: 'Supervillain', character: '๐Ÿฆน' }, { title: 'Man Supervillain', character: '๐Ÿฆนโ€โ™‚๏ธ' }, { title: 'Woman Supervillain', character: '๐Ÿฆนโ€โ™€๏ธ' }, { title: 'Mage', character: '๐Ÿง™' }, { title: 'Man Mage', character: '๐Ÿง™โ€โ™‚๏ธ' }, { title: 'Woman Mage', character: '๐Ÿง™โ€โ™€๏ธ' }, { title: 'Fairy', character: '๐Ÿงš' }, { title: 'Man Fairy', character: '๐Ÿงšโ€โ™‚๏ธ' }, { title: 'Woman Fairy', character: '๐Ÿงšโ€โ™€๏ธ' }, { title: 'Vampire', character: '๐Ÿง›' }, { title: 'Man Vampire', character: '๐Ÿง›โ€โ™‚๏ธ' }, { title: 'Woman Vampire', character: '๐Ÿง›โ€โ™€๏ธ' }, { title: 'Merperson', character: '๐Ÿงœ' }, { title: 'Merman', character: '๐Ÿงœโ€โ™‚๏ธ' }, { title: 'Mermaid', character: '๐Ÿงœโ€โ™€๏ธ' }, { title: 'Elf', character: '๐Ÿง' }, { title: 'Man Elf', character: '๐Ÿงโ€โ™‚๏ธ' }, { title: 'Woman Elf', character: '๐Ÿงโ€โ™€๏ธ' }, { title: 'Genie', character: '๐Ÿงž' }, { title: 'Man Genie', character: '๐Ÿงžโ€โ™‚๏ธ' }, { title: 'Woman Genie', character: '๐Ÿงžโ€โ™€๏ธ' }, { title: 'Zombie', character: '๐ŸงŸ' }, { title: 'Man Zombie', character: '๐ŸงŸโ€โ™‚๏ธ' }, { title: 'Woman Zombie', character: '๐ŸงŸโ€โ™€๏ธ' }, { title: 'Person Getting Massage', character: '๐Ÿ’†' }, { title: 'Man Getting Massage', character: '๐Ÿ’†โ€โ™‚๏ธ' }, { title: 'Woman Getting Massage', character: '๐Ÿ’†โ€โ™€๏ธ' }, { title: 'Person Getting Haircut', character: '๐Ÿ’‡' }, { title: 'Man Getting Haircut', character: '๐Ÿ’‡โ€โ™‚๏ธ' }, { title: 'Woman Getting Haircut', character: '๐Ÿ’‡โ€โ™€๏ธ' }, { title: 'Person Walking', character: '๐Ÿšถ' }, { title: 'Man Walking', character: '๐Ÿšถโ€โ™‚๏ธ' }, { title: 'Woman Walking', character: '๐Ÿšถโ€โ™€๏ธ' }, { title: 'Person Standing', character: '๐Ÿง' }, { title: 'Man Standing', character: '๐Ÿงโ€โ™‚๏ธ' }, { title: 'Woman Standing', character: '๐Ÿงโ€โ™€๏ธ' }, { title: 'Person Kneeling', character: '๐ŸงŽ' }, { title: 'Man Kneeling', character: '๐ŸงŽโ€โ™‚๏ธ' }, { title: 'Woman Kneeling', character: '๐ŸงŽโ€โ™€๏ธ' }, { title: 'Person with White Cane', character: '๐Ÿง‘โ€๐Ÿฆฏ' }, { title: 'Man with White Cane', character: '๐Ÿ‘จโ€๐Ÿฆฏ' }, { title: 'Woman with White Cane', character: '๐Ÿ‘ฉโ€๐Ÿฆฏ' }, { title: 'Person in Motorized Wheelchair', character: '๐Ÿง‘โ€๐Ÿฆผ' }, { title: 'Man in Motorized Wheelchair', character: '๐Ÿ‘จโ€๐Ÿฆผ' }, { title: 'Woman in Motorized Wheelchair', character: '๐Ÿ‘ฉโ€๐Ÿฆผ' }, { title: 'Person in Manual Wheelchair', character: '๐Ÿง‘โ€๐Ÿฆฝ' }, { title: 'Man in Manual Wheelchair', character: '๐Ÿ‘จโ€๐Ÿฆฝ' }, { title: 'Woman in Manual Wheelchair', character: '๐Ÿ‘ฉโ€๐Ÿฆฝ' }, { title: 'Person Running', character: '๐Ÿƒ' }, { title: 'Man Running', character: '๐Ÿƒโ€โ™‚๏ธ' }, { title: 'Woman Running', character: '๐Ÿƒโ€โ™€๏ธ' }, { title: 'Woman Dancing', character: '๐Ÿ’ƒ' }, { title: 'Man Dancing', character: '๐Ÿ•บ' }, { title: 'Person in Suit Levitating', character: '๐Ÿ•ด๏ธ' }, { title: 'People with Bunny Ears', character: '๐Ÿ‘ฏ' }, { title: 'Men with Bunny Ears', character: '๐Ÿ‘ฏโ€โ™‚๏ธ' }, { title: 'Women with Bunny Ears', character: '๐Ÿ‘ฏโ€โ™€๏ธ' }, { title: 'Person in Steamy Room', character: '๐Ÿง–' }, { title: 'Man in Steamy Room', character: '๐Ÿง–โ€โ™‚๏ธ' }, { title: 'Woman in Steamy Room', character: '๐Ÿง–โ€โ™€๏ธ' }, { title: 'Person in Lotus Position', character: '๐Ÿง˜' }, { title: 'People Holding Hands', character: '๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘' }, { title: 'Women Holding Hands', character: '๐Ÿ‘ญ' }, { title: 'Woman and Man Holding Hands', character: '๐Ÿ‘ซ' }, { title: 'Men Holding Hands', character: '๐Ÿ‘ฌ' }, { title: 'Kiss', character: '๐Ÿ’' }, { title: 'Kiss: Woman, Man', character: '๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘จ' }, { title: 'Kiss: Man, Man', character: '๐Ÿ‘จโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘จ' }, { title: 'Kiss: Woman, Woman', character: '๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘ฉ' }, { title: 'Couple with Heart', character: '๐Ÿ’‘' }, { title: 'Couple with Heart: Woman, Man', character: '๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ‘จ' }, { title: 'Couple with Heart: Man, Man', character: '๐Ÿ‘จโ€โค๏ธโ€๐Ÿ‘จ' }, { title: 'Couple with Heart: Woman, Woman', character: '๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ‘ฉ' }, { title: 'Family', character: '๐Ÿ‘ช' }, { title: 'Family: Man, Woman, Boy', character: '๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ' }, { title: 'Family: Man, Woman, Girl', character: '๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง' }, { title: 'Family: Man, Woman, Girl, Boy', character: '๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ' }, { title: 'Family: Man, Woman, Boy, Boy', character: '๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ' }, { title: 'Family: Man, Woman, Girl, Girl', character: '๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง' }, { title: 'Family: Man, Man, Boy', character: '๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘ฆ' }, { title: 'Family: Man, Man, Girl', character: '๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘ง' }, { title: 'Family: Man, Man, Girl, Boy', character: '๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ' }, { title: 'Family: Man, Man, Boy, Boy', character: '๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ' }, { title: 'Family: Man, Man, Girl, Girl', character: '๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ง' }, { title: 'Family: Woman, Woman, Boy', character: '๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ' }, { title: 'Family: Woman, Woman, Girl', character: '๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ง' }, { title: 'Family: Woman, Woman, Girl, Boy', character: '๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ' }, { title: 'Family: Woman, Woman, Boy, Boy', character: '๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ' }, { title: 'Family: Woman, Woman, Girl, Girl', character: '๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง' }, { title: 'Family: Man, Boy', character: '๐Ÿ‘จโ€๐Ÿ‘ฆ' }, { title: 'Family: Man, Boy, Boy', character: '๐Ÿ‘จโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ' }, { title: 'Family: Man, Girl', character: '๐Ÿ‘จโ€๐Ÿ‘ง' }, { title: 'Family: Man, Girl, Boy', character: '๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ' }, { title: 'Family: Man, Girl, Girl', character: '๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ง' }, { title: 'Family: Woman, Boy', character: '๐Ÿ‘ฉโ€๐Ÿ‘ฆ' }, { title: 'Family: Woman, Boy, Boy', character: '๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ' }, { title: 'Family: Woman, Girl', character: '๐Ÿ‘ฉโ€๐Ÿ‘ง' }, { title: 'Family: Woman, Girl, Boy', character: '๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ' }, { title: 'Family: Woman, Girl, Girl', character: '๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง' }, { title: 'Speaking Head', character: '๐Ÿ—ฃ๏ธ' }, { title: 'Bust in Silhouette', character: '๐Ÿ‘ค' }, { title: 'Busts in Silhouette', character: '๐Ÿ‘ฅ' }, { title: 'People Hugging', character: '๐Ÿซ‚' }, { title: 'Footprints', character: '๐Ÿ‘ฃ' }, { title: 'Luggage', character: '๐Ÿงณ' }, { title: 'Closed Umbrella', character: '๐ŸŒ‚' }, { title: 'Umbrella', character: 'โ˜‚๏ธ' }, { title: 'Jack-O-Lantern', character: '๐ŸŽƒ' }, { title: 'Thread', character: '๐Ÿงต' }, { title: 'Yarn', character: '๐Ÿงถ' }, { title: 'Glasses', character: '๐Ÿ‘“' }, { title: 'Sunglasses', character: '๐Ÿ•ถ๏ธ' }, { title: 'Goggles', character: '๐Ÿฅฝ' }, { title: 'Lab Coat', character: '๐Ÿฅผ' }, { title: 'Safety Vest', character: '๐Ÿฆบ' }, { title: 'Necktie', character: '๐Ÿ‘”' }, { title: 'T-Shirt', character: '๐Ÿ‘•' }, { title: 'Jeans', character: '๐Ÿ‘–' }, { title: 'Scarf', character: '๐Ÿงฃ' }, { title: 'Gloves', character: '๐Ÿงค' }, { title: 'Coat', character: '๐Ÿงฅ' }, { title: 'Socks', character: '๐Ÿงฆ' }, { title: 'Dress', character: '๐Ÿ‘—' }, { title: 'Kimono', character: '๐Ÿ‘˜' }, { title: 'Sari', character: '๐Ÿฅป' }, { title: 'One-Piece Swimsuit', character: '๐Ÿฉฑ' }, { title: 'Briefs', character: '๐Ÿฉฒ' }, { title: 'Shorts', character: '๐Ÿฉณ' }, { title: 'Bikini', character: '๐Ÿ‘™' }, { title: 'Womanโ€™s Clothes', character: '๐Ÿ‘š' }, { title: 'Purse', character: '๐Ÿ‘›' }, { title: 'Handbag', character: '๐Ÿ‘œ' }, { title: 'Clutch Bag', character: '๐Ÿ‘' }, { title: 'Backpack', character: '๐ŸŽ’' }, { title: 'Thong Sandal', character: '๐Ÿฉด' }, { title: 'Manโ€™s Shoe', character: '๐Ÿ‘ž' }, { title: 'Running Shoe', character: '๐Ÿ‘Ÿ' }, { title: 'Hiking Boot', character: '๐Ÿฅพ' }, { title: 'Flat Shoe', character: '๐Ÿฅฟ' }, { title: 'High-Heeled Shoe', character: '๐Ÿ‘ ' }, { title: 'Womanโ€™s Sandal', character: '๐Ÿ‘ก' }, { title: 'Ballet Shoes', character: '๐Ÿฉฐ' }, { title: 'Womanโ€™s Boot', character: '๐Ÿ‘ข' }, { title: 'Crown', character: '๐Ÿ‘‘' }, { title: 'Womanโ€™s Hat', character: '๐Ÿ‘’' }, { title: 'Top Hat', character: '๐ŸŽฉ' }, { title: 'Graduation Cap', character: '๐ŸŽ“' }, { title: 'Billed Cap', character: '๐Ÿงข' }, { title: 'Military Helmet', character: '๐Ÿช–' }, { title: 'Rescue Workerโ€™s Helmet', character: 'โ›‘๏ธ' }, { title: 'Lipstick', character: '๐Ÿ’„' }, { title: 'Ring', character: '๐Ÿ’' }, { title: 'Briefcase', character: '๐Ÿ’ผ' }, { title: 'Drop of Blood', character: '๐Ÿฉธ' } ]; sgCkeditorController.$inject = ['$element', 'sgCkeditorConfig']; function sgCkeditorController ($element, sgCkeditorConfig) { var vm = this; var config; var content; var editor; var editorChanged = false; var modelChanged = false; var editorChangedTimerValue = 2000; var editorChangedTimer = null; this.$onInit = function () { vm.ngModelCtrl.$render = function () { content = vm.ngModelCtrl.$viewValue; // Clean message with invalid HTML tags content = cleanDirtyHTMLElements(content, 50); if (vm.editor) { vm.editor.setData(content, { noSnapshot: true, callback: function () { vm.editor.fire('updateSnapshot') } }) } }; config = vm.config ? angular.merge(sgCkeditorConfig.config, vm.config) : sgCkeditorConfig.config; config.licenseKey = "GPL"; if (!config.toolbar) { config.toolbar = { "items": [ "bold", "italic", "underline", "|", "fontColor", "fontFamily", "fontSize", "removeFormat", "|", "numberedList", "bulletedList", "|", "outdent", "indent", "|", "blockQuote", "|", "alignment", "|", "link", "|", "insertTable", "specialCharacters", "imageUpload", "|", "undo", "redo", "sourceEditing", "htmlEmbed" ], "shouldNotGroupWhenFull": true } } config.htmlSupport = { allow: [ { name: /.*/, attributes: true, classes: true, styles: true } ] }; config.fontFamily = { supportAllValues: true, style: { element: 'span', attributes: { style: 'font-family' } } }; config.fontSize = { options: ['10px', '12px', '14px', '16px', '18px', '20px', '24px'], supportAllValues: true, style: { element: 'span', attributes: { style: 'font-size' } } }; config.htmlEmbed = { showPreviews: true }; config.mediaEmbed = { providers: [] }; config.image = { resizeUnit: "px", insert: { type: "inline" } }; config.disableNativeSpellChecker = false; vm.config = config; }; this.$postLink = function () { var editorElement = $element[0].children[0];; ClassicEditor .create(editorElement, vm.config) .then(editor => { vm.editor = editor; // Add Emoticons editor.plugins.get('SpecialCharacters').addItems('Emoji', emojis, { label: 'Emoticons' }); vm.editor.model.document.on('pasteState', function () { vm.onEditorChange(false); }); vm.editor.model.document.on('change:data', function () { vm.onEditorChange(false); }); vm.editor.model.document.on('paste', function () { vm.onEditorChange(false); }); vm.editor.editing.view.document.on('blur', function () { vm.onEditorChange(true); }); vm.editor.component = this; onInstanceReady(); if (content) { modelChanged = true vm.editor.setData(content, { noSnapshot: true, callback: function () { vm.editor.fire('updateSnapshot') } }); } }) .catch(error => { console.error(error); }); }; this.$onChanges = function (changes) { if ( changes.ngModel && changes.ngModel.currentValue !== changes.ngModel.previousValue ) { content = changes.ngModel.currentValue; if (vm.editor && !editorChanged) { if (content) { vm.editor.setData(content, { noSnapshot: true, callback: function () { vm.editor.fire('updateSnapshot') } }); modelChanged = true; } } editorChanged = false; } if (editor && changes.readOnly) { editor.setReadOnly(changes.readOnly.currentValue); } } this.$onDestroy = function () { var noUpdate = true; if (vm.editor) vm.editor.destroy(noUpdate); } this.onEditorChange = function(force) { if (editorChangedTimer) clearTimeout(editorChangedTimer); var refresh = function() { var html = vm.editor.getData(); var dom = document.createElement("DIV"); dom.innerHTML = html; var text = (dom.textContent || dom.innerText); if (text === '\n') { text = ''; } if (!modelChanged && html !== vm.ngModelCtrl.$viewValue) { editorChanged = true; vm.ngModelCtrl.$setViewValue(html); validate(vm.checkTextLength ? text : html); if (vm.onContentChanged) { vm.onContentChanged({ 'editor': vm.editor, 'html': html, 'text': text }); } } modelChanged = false; editorChangedTimer = null; }; if (force) { refresh(); } else { editorChangedTimer = setTimeout(refresh, editorChangedTimerValue); } } function onEditorPaste (event) { var html; if (event.data.type == 'html') { html = event.data.dataValue; // Remove images to avoid ghost image in Firefox; images will be handled by the Image Upload plugin event.data.dataValue = html.replace(/]*)?>/gi, ''); } } function onInstanceReady(event) { if (vm.onInstanceReady) { vm.onInstanceReady({ '$event': event, '$editor': vm.editor }); } vm.ngModelCtrl.$render(); } function validate(body) { if (vm.maxLength) { vm.ngModelCtrl.$setValidity('maxlength', body.length > vm.maxLength + 1); } if (vm.minLength) { vm.ngModelCtrl.$setValidity('minlength', body.length <= vm.minLength); } if (vm.required) { vm.ngModelCtrl.$setValidity('required', body.length > 0); } } function cleanDirtyHTMLElements(html, threshold) { var regex = /(<[^>^/]+>( )*<\/[^>]+>)/gm; var m; var duplicates = {}; while ((m = regex.exec(html)) !== null) { if (m[0]) { var hash = (m[0]).md5(); if (duplicates[hash]) { duplicates[hash].counter++; } else { duplicates[hash] = { code: m[0], counter: 1 }; } } } var i; var duplicatesKeys = Object.keys(duplicates); for (i = 0; i < duplicatesKeys.length; i++) { if (duplicates[duplicatesKeys[i]].counter >= threshold) { // Remove element html = html.replaceAll(duplicates[duplicatesKeys[i]].code, ''); console.log("Removed tag for cleaning : "); console.log(duplicates[duplicatesKeys[i]].code); } } return html; } } angular .module('sgCkeditor', []) .provider('sgCkeditorConfig', sgCkeditorConfigProvider) .component('sgCkeditor', sgCkeditorComponent); })();