diff --git a/e_lib/summernote/font/summernote.eot b/e_lib/summernote/font/summernote.eot new file mode 100644 index 00000000..4f5d02c2 Binary files /dev/null and b/e_lib/summernote/font/summernote.eot differ diff --git a/e_lib/summernote/font/summernote.ttf b/e_lib/summernote/font/summernote.ttf new file mode 100644 index 00000000..a5976dbf Binary files /dev/null and b/e_lib/summernote/font/summernote.ttf differ diff --git a/e_lib/summernote/font/summernote.woff b/e_lib/summernote/font/summernote.woff new file mode 100644 index 00000000..6c6dfaaa Binary files /dev/null and b/e_lib/summernote/font/summernote.woff differ diff --git a/e_lib/summernote/lang/summernote-ko-KR.js b/e_lib/summernote/lang/summernote-ko-KR.js new file mode 100644 index 00000000..6dfde797 --- /dev/null +++ b/e_lib/summernote/lang/summernote-ko-KR.js @@ -0,0 +1,155 @@ +(function($) { + $.extend($.summernote.lang, { + 'ko-KR': { + font: { + bold: '굵게', + italic: '기울임꼴', + underline: '밑줄', + clear: '글자 효과 없애기', + height: '줄간격', + name: '글꼴', + superscript: '위 첨자', + subscript: '아래 첨자', + strikethrough: '취소선', + size: '글자 크기' + }, + image: { + image: '사진', + insert: '사진 추가', + resizeFull: '100% 크기로 변경', + resizeHalf: '50% 크기로 변경', + resizeQuarter: '25% 크기로 변경', + floatLeft: '왼쪽 정렬', + floatRight: '오른쪽 정렬', + floatNone: '정렬하지 않음', + shapeRounded: '스타일: 둥근 모서리', + shapeCircle: '스타일: 원형', + shapeThumbnail: '스타일: 액자', + shapeNone: '스타일: 없음', + dragImageHere: '텍스트 혹은 사진을 이곳으로 끌어오세요', + dropImage: '텍스트 혹은 사진을 내려놓으세요', + selectFromFiles: '파일 선택', + maximumFileSize: 'Maximum file size', + maximumFileSizeError: 'Maximum file size exceeded.', + url: '사진 URL', + remove: '사진 삭제', + original: 'Original' + }, + video: { + video: '동영상', + videoLink: '동영상 링크', + insert: '동영상 추가', + url: '동영상 URL', + providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, Youku 사용 가능)' + }, + link: { + link: '링크', + insert: '링크 추가', + unlink: '링크 삭제', + edit: '수정', + textToDisplay: '링크에 표시할 내용', + url: '이동할 URL', + openInNewWindow: '새창으로 열기' + }, + table: { + table: '테이블', + addRowAbove: 'Add row above', + addRowBelow: 'Add row below', + addColLeft: 'Add column left', + addColRight: 'Add column right', + delRow: 'Delete row', + delCol: 'Delete column', + delTable: 'Delete table' + }, + hr: { + insert: '구분선 추가' + }, + style: { + style: '스타일', + p: '본문', + blockquote: '인용구', + pre: '코드', + h1: '제목 1', + h2: '제목 2', + h3: '제목 3', + h4: '제목 4', + h5: '제목 5', + h6: '제목 6' + }, + lists: { + unordered: '글머리 기호', + ordered: '번호 매기기' + }, + options: { + help: '도움말', + fullscreen: '전체 화면', + codeview: '코드 보기' + }, + paragraph: { + paragraph: '문단 정렬', + outdent: '내어쓰기', + indent: '들여쓰기', + left: '왼쪽 정렬', + center: '가운데 정렬', + right: '오른쪽 정렬', + justify: '양쪽 정렬' + }, + color: { + recent: '마지막으로 사용한 색', + more: '다른 색 선택', + background: '배경색', + foreground: '글자색', + transparent: '투명', + setTransparent: '투명', + reset: '취소', + resetToDefault: '기본 값으로 변경' + }, + shortcut: { + shortcuts: '키보드 단축키', + close: '닫기', + textFormatting: '글자 스타일 적용', + action: '기능', + paragraphFormatting: '문단 스타일 적용', + documentStyle: '문서 스타일 적용', + extraKeys: 'Extra keys' + }, + help: { + 'insertParagraph': 'Insert Paragraph', + 'undo': 'Undoes the last command', + 'redo': 'Redoes the last command', + 'tab': 'Tab', + 'untab': 'Untab', + 'bold': 'Set a bold style', + 'italic': 'Set a italic style', + 'underline': 'Set a underline style', + 'strikethrough': 'Set a strikethrough style', + 'removeFormat': 'Clean a style', + 'justifyLeft': 'Set left align', + 'justifyCenter': 'Set center align', + 'justifyRight': 'Set right align', + 'justifyFull': 'Set full align', + 'insertUnorderedList': 'Toggle unordered list', + 'insertOrderedList': 'Toggle ordered list', + 'outdent': 'Outdent on current paragraph', + 'indent': 'Indent on current paragraph', + 'formatPara': 'Change current block\'s format as a paragraph(P tag)', + 'formatH1': 'Change current block\'s format as H1', + 'formatH2': 'Change current block\'s format as H2', + 'formatH3': 'Change current block\'s format as H3', + 'formatH4': 'Change current block\'s format as H4', + 'formatH5': 'Change current block\'s format as H5', + 'formatH6': 'Change current block\'s format as H6', + 'insertHorizontalRule': 'Insert horizontal rule', + 'linkDialog.show': 'Show Link Dialog' + }, + history: { + undo: '실행 취소', + redo: '다시 실행' + }, + specialChar: { + specialChar: '특수문자', + select: '특수문자를 선택하세요' + } + } + }); +})(jQuery); diff --git a/e_lib/summernote/plugin/databasic/summernote-ext-databasic.css b/e_lib/summernote/plugin/databasic/summernote-ext-databasic.css new file mode 100644 index 00000000..6232dde9 --- /dev/null +++ b/e_lib/summernote/plugin/databasic/summernote-ext-databasic.css @@ -0,0 +1,16 @@ +.ext-databasic { + position: relative; + display: block; + min-height: 50px; + background-color: cyan; + text-align: center; + padding: 20px; + border: 1px solid white; + border-radius: 10px; +} + +.ext-databasic p { + color: white; + font-size: 1.2em; + margin: 0; +} diff --git a/e_lib/summernote/plugin/databasic/summernote-ext-databasic.js b/e_lib/summernote/plugin/databasic/summernote-ext-databasic.js new file mode 100644 index 00000000..efe0d4dc --- /dev/null +++ b/e_lib/summernote/plugin/databasic/summernote-ext-databasic.js @@ -0,0 +1,292 @@ +(function(factory) { + /* global define */ + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof module === 'object' && module.exports) { + // Node/CommonJS + module.exports = factory(require('jquery')); + } else { + // Browser globals + factory(window.jQuery); + } +}(function($) { + // pull in some summernote core functions + var ui = $.summernote.ui; + var dom = $.summernote.dom; + + // define the popover plugin + var DataBasicPlugin = function(context) { + var self = this; + var options = context.options; + var lang = options.langInfo; + + self.icon = ''; + + // add context menu button for dialog + context.memo('button.databasic', function() { + return ui.button({ + contents: self.icon, + tooltip: lang.databasic.insert, + click: context.createInvokeHandler('databasic.showDialog') + }).render(); + }); + + // add popover edit button + context.memo('button.databasicDialog', function() { + return ui.button({ + contents: self.icon, + tooltip: lang.databasic.edit, + click: context.createInvokeHandler('databasic.showDialog') + }).render(); + }); + + // add popover size buttons + context.memo('button.databasicSize100', function() { + return ui.button({ + contents: '100%', + tooltip: lang.image.resizeFull, + click: context.createInvokeHandler('editor.resize', '1') + }).render(); + }); + context.memo('button.databasicSize50', function() { + return ui.button({ + contents: '50%', + tooltip: lang.image.resizeHalf, + click: context.createInvokeHandler('editor.resize', '0.5') + }).render(); + }); + context.memo('button.databasicSize25', function() { + return ui.button({ + contents: '25%', + tooltip: lang.image.resizeQuarter, + click: context.createInvokeHandler('editor.resize', '0.25') + }).render(); + }); + + self.events = { + 'summernote.init': function(we, e) { + // update existing containers + $('data.ext-databasic', e.editable).each(function() { self.setContent($(this)); }); + // TODO: make this an undo snapshot... + }, + 'summernote.keyup summernote.mouseup summernote.change summernote.scroll': function() { + self.update(); + }, + 'summernote.dialog.shown': function() { + self.hidePopover(); + } + }; + + self.initialize = function() { + // create dialog markup + var $container = options.dialogsInBody ? $(document.body) : context.layoutInfo.editor; + + var body = '
' + + '' + + '' + + '
'; + var footer = ''; + + self.$dialog = ui.dialog({ + title: lang.databasic.name, + fade: options.dialogsFade, + body: body, + footer: footer + }).render().appendTo($container); + + // create popover + self.$popover = ui.popover({ + className: 'ext-databasic-popover' + }).render().appendTo('body'); + var $content = self.$popover.find('.popover-content'); + + context.invoke('buttons.build', $content, options.popover.databasic); + }; + + self.destroy = function() { + self.$popover.remove(); + self.$popover = null; + self.$dialog.remove(); + self.$dialog = null; + }; + + self.update = function() { + // Prevent focusing on editable when invoke('code') is executed + if (!context.invoke('editor.hasFocus')) { + self.hidePopover(); + return; + } + + var rng = context.invoke('editor.createRange'); + var visible = false; + + if (rng.isOnData()) { + var $data = $(rng.sc).closest('data.ext-databasic'); + + if ($data.length) { + var pos = dom.posFromPlaceholder($data[0]); + + self.$popover.css({ + display: 'block', + left: pos.left, + top: pos.top + }); + + // save editor target to let size buttons resize the container + context.invoke('editor.saveTarget', $data[0]); + + visible = true; + } + } + + // hide if not visible + if (!visible) { + self.hidePopover(); + } + }; + + self.hidePopover = function() { + self.$popover.hide(); + }; + + // define plugin dialog + self.getInfo = function() { + var rng = context.invoke('editor.createRange'); + + if (rng.isOnData()) { + var $data = $(rng.sc).closest('data.ext-databasic'); + + if ($data.length) { + // Get the first node on range(for edit). + return { + node: $data, + test: $data.attr('data-test') + }; + } + } + + return {}; + }; + + self.setContent = function($node) { + $node.html('

' + self.icon + ' ' + lang.databasic.name + ': ' + + $node.attr('data-test') + '

'); + }; + + self.updateNode = function(info) { + self.setContent(info.node + .attr('data-test', info.test)); + }; + + self.createNode = function(info) { + var $node = $(''); + + if ($node) { + // save node to info structure + info.node = $node; + // insert node into editor dom + context.invoke('editor.insertNode', $node[0]); + } + + return $node; + }; + + self.showDialog = function() { + var info = self.getInfo(); + var newNode = !info.node; + context.invoke('editor.saveRange'); + + self + .openDialog(info) + .then(function(dialogInfo) { + // [workaround] hide dialog before restore range for IE range focus + ui.hideDialog(self.$dialog); + context.invoke('editor.restoreRange'); + + // insert a new node + if (newNode) { + self.createNode(info); + } + + // update info with dialog info + $.extend(info, dialogInfo); + + self.updateNode(info); + }) + .fail(function() { + context.invoke('editor.restoreRange'); + }); + }; + + self.openDialog = function(info) { + return $.Deferred(function(deferred) { + var $inpTest = self.$dialog.find('.ext-databasic-test'); + var $saveBtn = self.$dialog.find('.ext-databasic-save'); + var onKeyup = function(event) { + if (event.keyCode === 13) { + $saveBtn.trigger('click'); + } + }; + + ui.onDialogShown(self.$dialog, function() { + context.triggerEvent('dialog.shown'); + + $inpTest.val(info.test).on('input', function() { + ui.toggleBtn($saveBtn, $inpTest.val()); + }).trigger('focus').on('keyup', onKeyup); + + $saveBtn + .text(info.node ? lang.databasic.edit : lang.databasic.insert) + .click(function(event) { + event.preventDefault(); + + deferred.resolve({ test: $inpTest.val() }); + }); + + // init save button + ui.toggleBtn($saveBtn, $inpTest.val()); + }); + + ui.onDialogHidden(self.$dialog, function() { + $inpTest.off('input keyup'); + $saveBtn.off('click'); + + if (deferred.state() === 'pending') { + deferred.reject(); + } + }); + + ui.showDialog(self.$dialog); + }); + }; + }; + + // Extends summernote + $.extend(true, $.summernote, { + plugins: { + databasic: DataBasicPlugin + }, + + options: { + popover: { + databasic: [ + ['databasic', ['databasicDialog', 'databasicSize100', 'databasicSize50', 'databasicSize25']] + ] + } + }, + + // add localization texts + lang: { + 'en-US': { + databasic: { + name: 'Basic Data Container', + insert: 'insert basic data container', + edit: 'edit basic data container', + testLabel: 'test input' + } + } + } + + }); +})); diff --git a/e_lib/summernote/plugin/hello/summernote-ext-hello.js b/e_lib/summernote/plugin/hello/summernote-ext-hello.js new file mode 100644 index 00000000..22e4f6ac --- /dev/null +++ b/e_lib/summernote/plugin/hello/summernote-ext-hello.js @@ -0,0 +1,81 @@ +(function(factory) { + /* global define */ + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof module === 'object' && module.exports) { + // Node/CommonJS + module.exports = factory(require('jquery')); + } else { + // Browser globals + factory(window.jQuery); + } +}(function($) { + // Extends plugins for adding hello. + // - plugin is external module for customizing. + $.extend($.summernote.plugins, { + /** + * @param {Object} context - context object has status of editor. + */ + 'hello': function(context) { + var self = this; + + // ui has renders to build ui elements. + // - you can create a button with `ui.button` + var ui = $.summernote.ui; + + // add hello button + context.memo('button.hello', function() { + // create button + var button = ui.button({ + contents: ' Hello', + tooltip: 'hello', + click: function() { + self.$panel.show(); + self.$panel.hide(500); + // invoke insertText method with 'hello' on editor module. + context.invoke('editor.insertText', 'hello'); + } + }); + + // create jQuery object from button instance. + var $hello = button.render(); + return $hello; + }); + + // This events will be attached when editor is initialized. + this.events = { + // This will be called after modules are initialized. + 'summernote.init': function(we, e) { + console.log('summernote initialized', we, e); + }, + // This will be called when user releases a key on editable. + 'summernote.keyup': function(we, e) { + console.log('summernote keyup', we, e); + } + }; + + // This method will be called when editor is initialized by $('..').summernote(); + // You can create elements for plugin + this.initialize = function() { + this.$panel = $('
').css({ + position: 'absolute', + width: 100, + height: 100, + left: '50%', + top: '50%', + background: 'red' + }).hide(); + + this.$panel.appendTo('body'); + }; + + // This methods will be called when editor is destroyed by $('..').summernote('destroy'); + // You should remove elements on `initialize`. + this.destroy = function() { + this.$panel.remove(); + this.$panel = null; + }; + } + }); +})); diff --git a/e_lib/summernote/plugin/specialchars/summernote-ext-specialchars.js b/e_lib/summernote/plugin/specialchars/summernote-ext-specialchars.js new file mode 100644 index 00000000..2ee4e512 --- /dev/null +++ b/e_lib/summernote/plugin/specialchars/summernote-ext-specialchars.js @@ -0,0 +1,312 @@ +(function(factory) { + /* global define */ + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof module === 'object' && module.exports) { + // Node/CommonJS + module.exports = factory(require('jquery')); + } else { + // Browser globals + factory(window.jQuery); + } +}(function($) { + $.extend($.summernote.plugins, { + 'specialchars': function(context) { + var self = this; + var ui = $.summernote.ui; + + var $editor = context.layoutInfo.editor; + var options = context.options; + var lang = options.langInfo; + + var KEY = { + UP: 38, + DOWN: 40, + LEFT: 37, + RIGHT: 39, + ENTER: 13 + }; + var COLUMN_LENGTH = 15; + var COLUMN_WIDTH = 35; + + var currentColumn = 0; + var currentRow = 0; + var totalColumn = 0; + var totalRow = 0; + + // special characters data set + var specialCharDataSet = [ + '"', '&', '<', '>', '¡', '¢', + '£', '¤', '¥', '¦', '§', + '¨', '©', 'ª', '«', '¬', + '®', '¯', '°', '±', '²', + '³', '´', 'µ', '¶', '·', + '¸', '¹', 'º', '»', '¼', + '½', '¾', '¿', '×', '÷', + 'ƒ', 'ˆ', '˜', '–', '—', + '‘', '’', '‚', '“', '”', + '„', '†', '‡', '•', '…', + '‰', '′', '″', '‹', '›', + '‾', '⁄', '€', 'ℑ', '℘', + 'ℜ', '™', 'ℵ', '←', '↑', + '→', '↓', '↔', '↵', '⇐', + '⇑', '⇒', '⇓', '⇔', '∀', + '∂', '∃', '∅', '∇', '∈', + '∉', '∋', '∏', '∑', '−', + '∗', '√', '∝', '∞', '∠', + '∧', '∨', '∩', '∪', '∫', + '∴', '∼', '≅', '≈', '≠', + '≡', '≤', '≥', '⊂', '⊃', + '⊄', '⊆', '⊇', '⊕', '⊗', + '⊥', '⋅', '⌈', '⌉', '⌊', + '⌋', '◊', '♠', '♣', '♥', + '♦' + ]; + + context.memo('button.specialchars', function() { + return ui.button({ + contents: '', + tooltip: lang.specialChar.specialChar, + click: function() { + self.show(); + } + }).render(); + }); + + /** + * Make Special Characters Table + * + * @member plugin.specialChar + * @private + * @return {jQuery} + */ + this.makeSpecialCharSetTable = function() { + var $table = $(''); + $.each(specialCharDataSet, function(idx, text) { + var $td = $('') : $table.find('tr').last(); + + var $button = ui.button({ + callback: function($node) { + $node.html(text); + $node.attr('title', text); + $node.attr('data-value', encodeURIComponent(text)); + $node.css({ + width: COLUMN_WIDTH, + 'margin-right': '2px', + 'margin-bottom': '2px' + }); + } + }).render(); + + $td.append($button); + + $tr.append($td); + if (idx % COLUMN_LENGTH === 0) { + $table.append($tr); + } + }); + + totalRow = $table.find('tr').length; + totalColumn = COLUMN_LENGTH; + + return $table; + }; + + this.initialize = function() { + var $container = options.dialogsInBody ? $(document.body) : $editor; + + var body = '
' + this.makeSpecialCharSetTable()[0].outerHTML + '
'; + + this.$dialog = ui.dialog({ + title: lang.specialChar.select, + body: body + }).render().appendTo($container); + }; + + this.show = function() { + var text = context.invoke('editor.getSelectedText'); + context.invoke('editor.saveRange'); + this.showSpecialCharDialog(text).then(function(selectChar) { + context.invoke('editor.restoreRange'); + + // build node + var $node = $('').html(selectChar)[0]; + + if ($node) { + // insert video node + context.invoke('editor.insertNode', $node); + } + }).fail(function() { + context.invoke('editor.restoreRange'); + }); + }; + + /** + * show image dialog + * + * @param {jQuery} $dialog + * @return {Promise} + */ + this.showSpecialCharDialog = function(text) { + return $.Deferred(function(deferred) { + var $specialCharDialog = self.$dialog; + var $specialCharNode = $specialCharDialog.find('.note-specialchar-node'); + var $selectedNode = null; + var ARROW_KEYS = [KEY.UP, KEY.DOWN, KEY.LEFT, KEY.RIGHT]; + var ENTER_KEY = KEY.ENTER; + + function addActiveClass($target) { + if (!$target) { + return; + } + $target.find('button').addClass('active'); + $selectedNode = $target; + } + + function removeActiveClass($target) { + $target.find('button').removeClass('active'); + $selectedNode = null; + } + + // find next node + function findNextNode(row, column) { + var findNode = null; + $.each($specialCharNode, function(idx, $node) { + var findRow = Math.ceil((idx + 1) / COLUMN_LENGTH); + var findColumn = ((idx + 1) % COLUMN_LENGTH === 0) ? COLUMN_LENGTH : (idx + 1) % COLUMN_LENGTH; + if (findRow === row && findColumn === column) { + findNode = $node; + return false; + } + }); + return $(findNode); + } + + function arrowKeyHandler(keyCode) { + // left, right, up, down key + var $nextNode; + var lastRowColumnLength = $specialCharNode.length % totalColumn; + + if (KEY.LEFT === keyCode) { + if (currentColumn > 1) { + currentColumn = currentColumn - 1; + } else if (currentRow === 1 && currentColumn === 1) { + currentColumn = lastRowColumnLength; + currentRow = totalRow; + } else { + currentColumn = totalColumn; + currentRow = currentRow - 1; + } + } else if (KEY.RIGHT === keyCode) { + if (currentRow === totalRow && lastRowColumnLength === currentColumn) { + currentColumn = 1; + currentRow = 1; + } else if (currentColumn < totalColumn) { + currentColumn = currentColumn + 1; + } else { + currentColumn = 1; + currentRow = currentRow + 1; + } + } else if (KEY.UP === keyCode) { + if (currentRow === 1 && lastRowColumnLength < currentColumn) { + currentRow = totalRow - 1; + } else { + currentRow = currentRow - 1; + } + } else if (KEY.DOWN === keyCode) { + currentRow = currentRow + 1; + } + + if (currentRow === totalRow && currentColumn > lastRowColumnLength) { + currentRow = 1; + } else if (currentRow > totalRow) { + currentRow = 1; + } else if (currentRow < 1) { + currentRow = totalRow; + } + + $nextNode = findNextNode(currentRow, currentColumn); + + if ($nextNode) { + removeActiveClass($selectedNode); + addActiveClass($nextNode); + } + } + + function enterKeyHandler() { + if (!$selectedNode) { + return; + } + + deferred.resolve(decodeURIComponent($selectedNode.find('button').attr('data-value'))); + $specialCharDialog.modal('hide'); + } + + function keyDownEventHandler(event) { + event.preventDefault(); + var keyCode = event.keyCode; + if (keyCode === undefined || keyCode === null) { + return; + } + // check arrowKeys match + if (ARROW_KEYS.indexOf(keyCode) > -1) { + if ($selectedNode === null) { + addActiveClass($specialCharNode.eq(0)); + currentColumn = 1; + currentRow = 1; + return; + } + arrowKeyHandler(keyCode); + } else if (keyCode === ENTER_KEY) { + enterKeyHandler(); + } + return false; + } + + // remove class + removeActiveClass($specialCharNode); + + // find selected node + if (text) { + for (var i = 0; i < $specialCharNode.length; i++) { + var $checkNode = $($specialCharNode[i]); + if ($checkNode.text() === text) { + addActiveClass($checkNode); + currentRow = Math.ceil((i + 1) / COLUMN_LENGTH); + currentColumn = (i + 1) % COLUMN_LENGTH; + } + } + } + + ui.onDialogShown(self.$dialog, function() { + $(document).on('keydown', keyDownEventHandler); + + self.$dialog.find('button').tooltip(); + + $specialCharNode.on('click', function(event) { + event.preventDefault(); + deferred.resolve(decodeURIComponent($(event.currentTarget).find('button').attr('data-value'))); + ui.hideDialog(self.$dialog); + }); + }); + + ui.onDialogHidden(self.$dialog, function() { + $specialCharNode.off('click'); + + self.$dialog.find('button').tooltip('destroy'); + + $(document).off('keydown', keyDownEventHandler); + + if (deferred.state() === 'pending') { + deferred.reject(); + } + }); + + ui.showDialog(self.$dialog); + }); + }; + } + }); +})); diff --git a/e_lib/summernote/summernote-bs4.css b/e_lib/summernote/summernote-bs4.css new file mode 100644 index 00000000..b0520764 --- /dev/null +++ b/e_lib/summernote/summernote-bs4.css @@ -0,0 +1 @@ +@font-face{font-family:"summernote";font-style:normal;font-weight:normal;src:url("./font/summernote.eot?dbafe969167589eda84514394d126413");src:url("./font/summernote.eot?#iefix") format("embedded-opentype"),url("./font/summernote.woff?dbafe969167589eda84514394d126413") format("woff"),url("./font/summernote.ttf?dbafe969167589eda84514394d126413") format("truetype")}[class^="note-icon-"]:before,[class*=" note-icon-"]:before{display:inline-block;font:normal normal normal 14px summernote;font-size:inherit;-webkit-font-smoothing:antialiased;text-decoration:inherit;text-rendering:auto;text-transform:none;vertical-align:middle;speak:none;-moz-osx-font-smoothing:grayscale}.note-icon-align-center:before,.note-icon-align-indent:before,.note-icon-align-justify:before,.note-icon-align-left:before,.note-icon-align-outdent:before,.note-icon-align-right:before,.note-icon-align:before,.note-icon-arrow-circle-down:before,.note-icon-arrow-circle-left:before,.note-icon-arrow-circle-right:before,.note-icon-arrow-circle-up:before,.note-icon-arrows-alt:before,.note-icon-arrows-h:before,.note-icon-arrows-v:before,.note-icon-bold:before,.note-icon-caret:before,.note-icon-chain-broken:before,.note-icon-circle:before,.note-icon-close:before,.note-icon-code:before,.note-icon-col-after:before,.note-icon-col-before:before,.note-icon-col-remove:before,.note-icon-eraser:before,.note-icon-font:before,.note-icon-frame:before,.note-icon-italic:before,.note-icon-link:before,.note-icon-magic:before,.note-icon-menu-check:before,.note-icon-minus:before,.note-icon-orderedlist:before,.note-icon-pencil:before,.note-icon-picture:before,.note-icon-question:before,.note-icon-redo:before,.note-icon-row-above:before,.note-icon-row-below:before,.note-icon-row-remove:before,.note-icon-special-character:before,.note-icon-square:before,.note-icon-strikethrough:before,.note-icon-subscript:before,.note-icon-summernote:before,.note-icon-superscript:before,.note-icon-table:before,.note-icon-text-height:before,.note-icon-trash:before,.note-icon-underline:before,.note-icon-undo:before,.note-icon-unorderedlist:before,.note-icon-video:before{display:inline-block;font-family:"summernote";font-style:normal;font-weight:normal;text-decoration:inherit}.note-icon-align-center:before{content:"\f101"}.note-icon-align-indent:before{content:"\f102"}.note-icon-align-justify:before{content:"\f103"}.note-icon-align-left:before{content:"\f104"}.note-icon-align-outdent:before{content:"\f105"}.note-icon-align-right:before{content:"\f106"}.note-icon-align:before{content:"\f107"}.note-icon-arrow-circle-down:before{content:"\f108"}.note-icon-arrow-circle-left:before{content:"\f109"}.note-icon-arrow-circle-right:before{content:"\f10a"}.note-icon-arrow-circle-up:before{content:"\f10b"}.note-icon-arrows-alt:before{content:"\f10c"}.note-icon-arrows-h:before{content:"\f10d"}.note-icon-arrows-v:before{content:"\f10e"}.note-icon-bold:before{content:"\f10f"}.note-icon-caret:before{content:"\f110"}.note-icon-chain-broken:before{content:"\f111"}.note-icon-circle:before{content:"\f112"}.note-icon-close:before{content:"\f113"}.note-icon-code:before{content:"\f114"}.note-icon-col-after:before{content:"\f115"}.note-icon-col-before:before{content:"\f116"}.note-icon-col-remove:before{content:"\f117"}.note-icon-eraser:before{content:"\f118"}.note-icon-font:before{content:"\f119"}.note-icon-frame:before{content:"\f11a"}.note-icon-italic:before{content:"\f11b"}.note-icon-link:before{content:"\f11c"}.note-icon-magic:before{content:"\f11d"}.note-icon-menu-check:before{content:"\f11e"}.note-icon-minus:before{content:"\f11f"}.note-icon-orderedlist:before{content:"\f120"}.note-icon-pencil:before{content:"\f121"}.note-icon-picture:before{content:"\f122"}.note-icon-question:before{content:"\f123"}.note-icon-redo:before{content:"\f124"}.note-icon-row-above:before{content:"\f125"}.note-icon-row-below:before{content:"\f126"}.note-icon-row-remove:before{content:"\f127"}.note-icon-special-character:before{content:"\f128"}.note-icon-square:before{content:"\f129"}.note-icon-strikethrough:before{content:"\f12a"}.note-icon-subscript:before{content:"\f12b"}.note-icon-summernote:before{content:"\f12c"}.note-icon-superscript:before{content:"\f12d"}.note-icon-table:before{content:"\f12e"}.note-icon-text-height:before{content:"\f12f"}.note-icon-trash:before{content:"\f130"}.note-icon-underline:before{content:"\f131"}.note-icon-undo:before{content:"\f132"}.note-icon-unorderedlist:before{content:"\f133"}.note-icon-video:before{content:"\f134"}.note-editor{position:relative}.note-editor .note-dropzone{position:absolute;z-index:100;display:none;color:#87cefa;background-color:#fff;opacity:.95}.note-editor .note-dropzone .note-dropzone-message{display:table-cell;font-size:28px;font-weight:700;text-align:center;vertical-align:middle}.note-editor .note-dropzone.hover{color:#098ddf}.note-editor.dragover .note-dropzone{display:table}.note-editor .note-editing-area{position:relative}.note-editor .note-editing-area .note-editable{outline:0}.note-editor .note-editing-area .note-editable sup{vertical-align:super}.note-editor .note-editing-area .note-editable sub{vertical-align:sub}.note-editor .note-editing-area img.note-float-left{margin-right:10px}.note-editor .note-editing-area img.note-float-right{margin-left:10px}.note-editor.note-frame{border:1px solid #a9a9a9}.note-editor.note-frame.codeview .note-editing-area .note-editable{display:none}.note-editor.note-frame.codeview .note-editing-area .note-codable{display:block}.note-editor.note-frame .note-editing-area{overflow:hidden}.note-editor.note-frame .note-editing-area .note-editable{padding:10px;overflow:auto;color:#000;word-wrap:break-word;background-color:#fff}.note-editor.note-frame .note-editing-area .note-editable[contenteditable="false"]{background-color:#e5e5e5}.note-editor.note-frame .note-editing-area .note-codable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-editor.note-frame.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%!important}.note-editor.note-frame.fullscreen .note-editable{background-color:#fff}.note-editor.note-frame.fullscreen .note-resizebar{display:none}.note-editor.note-frame .note-status-output{display:block;width:100%;height:20px;margin-bottom:0;font-size:14px;line-height:1.42857143;color:#000;border:0;border-top:1px solid #e2e2e2}.note-editor.note-frame .note-status-output:empty{height:0;border-top:0 solid transparent}.note-editor.note-frame .note-status-output .pull-right{float:right!important}.note-editor.note-frame .note-status-output .text-muted{color:#777}.note-editor.note-frame .note-status-output .text-primary{color:#286090}.note-editor.note-frame .note-status-output .text-success{color:#3c763d}.note-editor.note-frame .note-status-output .text-info{color:#31708f}.note-editor.note-frame .note-status-output .text-warning{color:#8a6d3b}.note-editor.note-frame .note-status-output .text-danger{color:#a94442}.note-editor.note-frame .note-status-output .alert{padding:7px 10px 2px 10px;margin:-7px 0 0 0;color:#000;background-color:#f5f5f5;border-radius:0}.note-editor.note-frame .note-status-output .alert .note-icon{margin-right:5px}.note-editor.note-frame .note-status-output .alert-success{color:#3c763d!important;background-color:#dff0d8!important}.note-editor.note-frame .note-status-output .alert-info{color:#31708f!important;background-color:#d9edf7!important}.note-editor.note-frame .note-status-output .alert-warning{color:#8a6d3b!important;background-color:#fcf8e3!important}.note-editor.note-frame .note-status-output .alert-danger{color:#a94442!important;background-color:#f2dede!important}.note-editor.note-frame .note-statusbar{background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.note-editor.note-frame .note-statusbar .note-resizebar{width:100%;height:9px;padding-top:1px;cursor:ns-resize}.note-editor.note-frame .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-editor.note-frame .note-statusbar.locked .note-resizebar{cursor:default}.note-editor.note-frame .note-statusbar.locked .note-resizebar .note-icon-bar{display:none}.note-editor.note-frame .note-placeholder{padding:10px}.note-popover.popover{display:none;max-width:none}.note-popover.popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-popover.popover .arrow{left:20px!important}.note-toolbar{position:relative;z-index:500}.note-popover .popover-content,.card-header.note-toolbar{padding:0 0 5px 5px;margin:0}.note-popover .popover-content>.btn-group,.card-header.note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-popover .popover-content .btn-group .note-table,.card-header.note-toolbar .btn-group .note-table{min-width:0;padding:5px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker,.card-header.note-toolbar .btn-group .note-table .note-dimension-picker{font-size:18px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher,.card-header.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted,.card-header.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted,.card-header.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .note-style .dropdown-style blockquote,.card-header.note-toolbar .note-style .dropdown-style blockquote,.note-popover .popover-content .note-style .dropdown-style pre,.card-header.note-toolbar .note-style .dropdown-style pre{padding:5px 10px;margin:0}.note-popover .popover-content .note-style .dropdown-style h1,.card-header.note-toolbar .note-style .dropdown-style h1,.note-popover .popover-content .note-style .dropdown-style h2,.card-header.note-toolbar .note-style .dropdown-style h2,.note-popover .popover-content .note-style .dropdown-style h3,.card-header.note-toolbar .note-style .dropdown-style h3,.note-popover .popover-content .note-style .dropdown-style h4,.card-header.note-toolbar .note-style .dropdown-style h4,.note-popover .popover-content .note-style .dropdown-style h5,.card-header.note-toolbar .note-style .dropdown-style h5,.note-popover .popover-content .note-style .dropdown-style h6,.card-header.note-toolbar .note-style .dropdown-style h6,.note-popover .popover-content .note-style .dropdown-style p,.card-header.note-toolbar .note-style .dropdown-style p{padding:0;margin:0}.note-popover .popover-content .note-color .dropdown-toggle,.card-header.note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-popover .popover-content .note-color .dropdown-menu,.card-header.note-toolbar .note-color .dropdown-menu{min-width:337px}.note-popover .popover-content .note-color .dropdown-menu .note-palette,.card-header.note-toolbar .note-color .dropdown-menu .note-palette{display:inline-block;width:160px;margin:0}.note-popover .popover-content .note-color .dropdown-menu .note-palette:first-child,.card-header.note-toolbar .note-color .dropdown-menu .note-palette:first-child{margin:0 5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-palette-title,.card-header.note-toolbar .note-color .dropdown-menu .note-palette .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-reset,.card-header.note-toolbar .note-color .dropdown-menu .note-palette .note-color-reset{width:100%;padding:0 3px;margin:3px;font-size:11px;cursor:pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-row,.card-header.note-toolbar .note-color .dropdown-menu .note-palette .note-color-row{height:20px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-reset:hover,.card-header.note-toolbar .note-color .dropdown-menu .note-palette .note-color-reset:hover{background:#eee}.note-popover .popover-content .note-para .dropdown-menu,.card-header.note-toolbar .note-para .dropdown-menu{min-width:216px;padding:5px}.note-popover .popover-content .note-para .dropdown-menu>div:first-child,.card-header.note-toolbar .note-para .dropdown-menu>div:first-child{margin-right:5px}.note-popover .popover-content .dropdown-menu,.card-header.note-toolbar .dropdown-menu{min-width:90px}.note-popover .popover-content .dropdown-menu.right,.card-header.note-toolbar .dropdown-menu.right{right:0;left:auto}.note-popover .popover-content .dropdown-menu.right::before,.card-header.note-toolbar .dropdown-menu.right::before{right:9px;left:auto!important}.note-popover .popover-content .dropdown-menu.right::after,.card-header.note-toolbar .dropdown-menu.right::after{right:10px;left:auto!important}.note-popover .popover-content .dropdown-menu.note-check a i,.card-header.note-toolbar .dropdown-menu.note-check a i{color:deepskyblue;visibility:hidden}.note-popover .popover-content .dropdown-menu.note-check a.checked i,.card-header.note-toolbar .dropdown-menu.note-check a.checked i{visibility:visible}.note-popover .popover-content .note-fontsize-10,.card-header.note-toolbar .note-fontsize-10{font-size:10px}.note-popover .popover-content .note-color-palette,.card-header.note-toolbar .note-color-palette{line-height:1}.note-popover .popover-content .note-color-palette div .note-color-btn,.card-header.note-toolbar .note-color-palette div .note-color-btn{width:20px;height:20px;padding:0;margin:0;border:1px solid #fff}.note-popover .popover-content .note-color-palette div .note-color-btn:hover,.card-header.note-toolbar .note-color-palette div .note-color-btn:hover{border:1px solid #000}.note-dialog>div{display:none}.note-dialog .form-group{margin-right:0;margin-left:0}.note-dialog .note-modal-form{margin:0}.note-dialog .note-image-dialog .note-dropzone{min-height:100px;margin-bottom:10px;font-size:30px;line-height:4;color:lightgray;text-align:center;border:4px dashed lightgray}@-moz-document url-prefix(){.note-image-input{height:auto}}.note-placeholder{position:absolute;display:none;color:gray}.note-handle .note-control-selection{position:absolute;display:none;border:1px solid black}.note-handle .note-control-selection>div{position:absolute}.note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:black;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid black}.note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid black}.note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:white;border:1px solid black}.note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-handle .note-control-selection .note-control-se.note-control-holder{cursor:default;border-top:0;border-left:none}.note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:#fff;background-color:#000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}.note-hint-popover{min-width:100px;padding:2px}.note-hint-popover .popover-content{max-height:150px;padding:3px;overflow:auto}.note-hint-popover .popover-content .note-hint-group .note-hint-item{display:block!important;padding:3px}.note-hint-popover .popover-content .note-hint-group .note-hint-item.active,.note-hint-popover .popover-content .note-hint-group .note-hint-item:hover{display:block;clear:both;font-weight:400;line-height:1.4;color:#fff;text-decoration:none;white-space:nowrap;cursor:pointer;background-color:#428bca;outline:0} \ No newline at end of file diff --git a/e_lib/summernote/summernote-bs4.js b/e_lib/summernote/summernote-bs4.js new file mode 100644 index 00000000..22d0ef21 --- /dev/null +++ b/e_lib/summernote/summernote-bs4.js @@ -0,0 +1,7323 @@ +/** + * Super simple wysiwyg editor v0.8.10 + * https://summernote.org + * + * Copyright 2013- Alan Hong. and other contributors + * summernote may be freely distributed under the MIT license. + * + * Date: 2018-02-20T00:34Z + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) : + typeof define === 'function' && define.amd ? define(['jquery'], factory) : + (factory(global.jQuery)); +}(this, (function ($$1) { 'use strict'; + +$$1 = $$1 && $$1.hasOwnProperty('default') ? $$1['default'] : $$1; + +var Renderer = /** @class */ (function () { + function Renderer(markup, children, options, callback) { + this.markup = markup; + this.children = children; + this.options = options; + this.callback = callback; + } + Renderer.prototype.render = function ($parent) { + var $node = $$1(this.markup); + if (this.options && this.options.contents) { + $node.html(this.options.contents); + } + if (this.options && this.options.className) { + $node.addClass(this.options.className); + } + if (this.options && this.options.data) { + $$1.each(this.options.data, function (k, v) { + $node.attr('data-' + k, v); + }); + } + if (this.options && this.options.click) { + $node.on('click', this.options.click); + } + if (this.children) { + var $container_1 = $node.find('.note-children-container'); + this.children.forEach(function (child) { + child.render($container_1.length ? $container_1 : $node); + }); + } + if (this.callback) { + this.callback($node, this.options); + } + if (this.options && this.options.callback) { + this.options.callback($node); + } + if ($parent) { + $parent.append($node); + } + return $node; + }; + return Renderer; +}()); +var renderer = { + create: function (markup, callback) { + return function () { + var options = typeof arguments[1] === 'object' ? arguments[1] : arguments[0]; + var children = $$1.isArray(arguments[0]) ? arguments[0] : []; + if (options && options.children) { + children = options.children; + } + return new Renderer(markup, children, options, callback); + }; + } +}; + +var editor = renderer.create('
'); +var toolbar = renderer.create('
'); +var editingArea = renderer.create('
'); +var codable = renderer.create('', - '
', - ].join('\n')), - $language = $modal.find('.language'), - $code = $modal.find('.code'); - - // Listen clicks on modal box buttons - $modal.on('tbwconfirm', function () { - trumbowyg.restoreRange(); - trumbowyg.execCmd('insertHTML', highlightIt($code.val(), $language.val())); - trumbowyg.execCmd('insertHTML', '


'); - - trumbowyg.closeModal(); - }); - - $modal.on('tbwcancel', function () { - trumbowyg.closeModal(); - }); - } - }; - } - - $.extend(true, $.trumbowyg, { - // Add some translations - langs: { - en: { - highlight: 'Code syntax highlight' - } - }, - // Add our plugin to Trumbowyg registred plugins - plugins: { - highlight: { - init: function (trumbowyg) { - // Fill current Trumbowyg instance with my plugin default options - trumbowyg.o.plugins.highlight = $.extend(true, {}, - defaultOptions, - trumbowyg.o.plugins.highlight || {} - ); - - // If my plugin is a button - trumbowyg.addBtnDef('highlight', buildButtonDef(trumbowyg)); - } - } - } - }); -})(jQuery, Prism); diff --git a/e_lib/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js b/e_lib/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js deleted file mode 100644 index feca0eef..00000000 --- a/e_lib/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(n,i){"use strict";function e(n,e){return['
',''+i.highlight(n,i.languages[e])+"","
"].join("")}function o(n){return{fn:function(){var o=n.openModal("Code",['
',' ","
",'
',' ',"
"].join("\n")),t=o.find(".language"),g=o.find(".code");o.on("tbwconfirm",function(){n.restoreRange(),n.execCmd("insertHTML",e(g.val(),t.val())),n.execCmd("insertHTML","


"),n.closeModal()}),o.on("tbwcancel",function(){n.closeModal()})}}}var t={};n.extend(!0,n.trumbowyg,{langs:{en:{highlight:"Code syntax highlight"}},plugins:{highlight:{init:function(i){i.o.plugins.highlight=n.extend(!0,{},t,i.o.plugins.highlight||{}),i.addBtnDef("highlight",o(i))}}}})}(jQuery,Prism); \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss b/e_lib/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss deleted file mode 100644 index 05dfb4a6..00000000 --- a/e_lib/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - * Default stylesheet for Trumbowyg editor plugin - * ------------------------ - * @link http://alex-d.github.io/Trumbowyg - * @license MIT - * @author Alexandre Demode (Alex-D) - * Twitter : @AlexandreDemode - * Website : alex-d.fr - */ - -.trumbowyg-highlight-form-group { - margin: 15px 10px; - - .trumbowyg-highlight-form-control { - width: 100%; - border: 1px solid #DEDEDE; - font-size: 14px; - padding: 7px; - - &.code { - height: 200px; - } - } -} diff --git a/e_lib/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css b/e_lib/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css deleted file mode 100644 index 6cb61516..00000000 --- a/e_lib/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - * Trumbowyg plugin stylesheet - * ------------------------ - * @link http://alex-d.github.io/Trumbowyg - * @license MIT - * @author Alexandre Demode (Alex-D) - * Twitter : @AlexandreDemode - * Website : alex-d.fr - */ - -.trumbowyg-highlight-form-group { - margin: 15px 10px; } - .trumbowyg-highlight-form-group .trumbowyg-highlight-form-control { - width: 100%; - border: 1px solid #DEDEDE; - font-size: 14px; - padding: 7px; } - .trumbowyg-highlight-form-group .trumbowyg-highlight-form-control.code { - height: 200px; } diff --git a/e_lib/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css b/e_lib/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css deleted file mode 100644 index 89fcd3df..00000000 --- a/e_lib/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css +++ /dev/null @@ -1,2 +0,0 @@ -/** Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ -.trumbowyg-highlight-form-group{margin:15px 10px}.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control{width:100%;border:1px solid #DEDEDE;font-size:14px;padding:7px}.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control.code{height:200px} \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/history/trumbowyg.history.js b/e_lib/trumbowyg/plugins/history/trumbowyg.history.js deleted file mode 100644 index 46f356f3..00000000 --- a/e_lib/trumbowyg/plugins/history/trumbowyg.history.js +++ /dev/null @@ -1,190 +0,0 @@ -/*/* =========================================================== - * trumbowyg.history.js v1.0 - * history plugin for Trumbowyg - * http://alex-d.github.com/Trumbowyg - * =========================================================== - * Author : Sven Dunemann [dunemann@forelabs.eu] - */ - -(function ($) { - 'use strict'; - $.extend(true, $.trumbowyg, { - langs: { - de: { - history: { - redo: 'Wiederholen', - undo: 'Rückgängig' - } - }, - en: { - history: { - redo: 'Redo', - undo: 'Undo' - } - }, - fr: { - history: { - redo: 'Annuler', - undo: 'Rétablir' - } - } - }, - plugins: { - history: { - init: function (t) { - t.o.plugins.history = $.extend(true, { - _stack: [], - _index: -1, - _focusEl: undefined - }, t.o.plugins.history || {}); - - var btnBuildDefRedo = { - title: t.lang.history.redo, - ico: 'redo', - key: 'Y', - fn: function () { - if (t.o.plugins.history._index < t.o.plugins.history._stack.length - 1) { - t.o.plugins.history._index += 1; - var index = t.o.plugins.history._index; - var newState = t.o.plugins.history._stack[index]; - - t.execCmd('html', newState); - // because of some semantic optimisations we have to save the state back - // to history - t.o.plugins.history._stack[index] = t.$ed.html(); - - carretToEnd(); - toggleButtonStates(); - } - } - }; - - var btnBuildDefUndo = { - title: t.lang.history.undo, - ico: 'undo', - key: 'Z', - fn: function () { - if (t.o.plugins.history._index > 0) { - t.o.plugins.history._index -= 1; - var index = t.o.plugins.history._index, - newState = t.o.plugins.history._stack[index]; - - t.execCmd('html', newState); - // because of some semantic optimisations we have to save the state back - // to history - t.o.plugins.history._stack[index] = t.$ed.html(); - - carretToEnd(); - toggleButtonStates(); - } - } - }; - - var pushToHistory = function () { - var index = t.o.plugins.history._index, - stack = t.o.plugins.history._stack, - latestState = stack.slice(-1)[0] || '

', - prevState = stack[index], - newState = t.$ed.html(), - focusEl = t.doc.getSelection().focusNode, - focusElText = '', - latestStateTagsList, - newStateTagsList, - prevFocusEl = t.o.plugins.history._focusEl; - - latestStateTagsList = $('
' + latestState + '
').find('*').map(function () { - return this.localName; - }); - newStateTagsList = $('
' + newState + '
').find('*').map(function () { - return this.localName; - }); - if (focusEl) { - t.o.plugins.history._focusEl = focusEl; - focusElText = focusEl.outerHTML || focusEl.textContent; - } - - if (newState !== prevState) { - // a new stack entry is defined when current insert ends on a whitespace character - // or count of node elements has been changed - // or focused element differs from previous one - if (focusElText.slice(-1).match(/\s/) || - !arraysAreIdentical(latestStateTagsList, newStateTagsList) || - t.o.plugins.history._index <= 0 || focusEl !== prevFocusEl) - { - t.o.plugins.history._index += 1; - // remove newer entries in history when something new was added - // because timeline was changes with interaction - t.o.plugins.history._stack = stack.slice( - 0, t.o.plugins.history._index - ); - // now add new state to modifed history - t.o.plugins.history._stack.push(newState); - } else { - // modify last stack entry - t.o.plugins.history._stack[index] = newState; - } - - toggleButtonStates(); - } - }; - - var toggleButtonStates = function () { - var index = t.o.plugins.history._index, - stackSize = t.o.plugins.history._stack.length, - undoState = (index > 0), - redoState = (stackSize !== 0 && index !== stackSize - 1); - - toggleButtonState('historyUndo', undoState); - toggleButtonState('historyRedo', redoState); - }; - - var toggleButtonState = function (btn, enable) { - var button = t.$box.find('.trumbowyg-' + btn + '-button'); - - if (enable) { - button.removeClass('trumbowyg-disable'); - } else if (!button.hasClass('trumbowyg-disable')) { - button.addClass('trumbowyg-disable'); - } - }; - - var arraysAreIdentical = function (a, b) { - if (a === b) { - return true; - } - if (a == null || b == null) { - return false; - } - if (a.length !== b.length) { - return false; - } - - for (var i = 0; i < a.length; i += 1) { - if (a[i] !== b[i]) { - return false; - } - } - return true; - }; - - var carretToEnd = function () { - var node = t.doc.getSelection().focusNode, - range = t.doc.createRange(); - - if (node.childNodes.length > 0) { - range.setStartAfter(node.childNodes[node.childNodes.length - 1]); - range.setEndAfter(node.childNodes[node.childNodes.length - 1]); - t.doc.getSelection().removeAllRanges(); - t.doc.getSelection().addRange(range); - } - }; - - t.$c.on('tbwinit tbwchange', pushToHistory); - - t.addBtnDef('historyRedo', btnBuildDefRedo); - t.addBtnDef('historyUndo', btnBuildDefUndo); - } - } - } - }); -})(jQuery); diff --git a/e_lib/trumbowyg/plugins/history/trumbowyg.history.min.js b/e_lib/trumbowyg/plugins/history/trumbowyg.history.min.js deleted file mode 100644 index 7d37a1d3..00000000 --- a/e_lib/trumbowyg/plugins/history/trumbowyg.history.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(i){"use strict";i.extend(!0,i.trumbowyg,{langs:{de:{history:{redo:"Wiederholen",undo:"Rückgängig"}},en:{history:{redo:"Redo",undo:"Undo"}},fr:{history:{redo:"Annuler",undo:"Rétablir"}}},plugins:{history:{init:function(o){o.o.plugins.history=i.extend(!0,{_stack:[],_index:-1,_focusEl:void 0},o.o.plugins.history||{});var t={title:o.lang.history.redo,ico:"redo",key:"Y",fn:function(){if(o.o.plugins.history._index0){o.o.plugins.history._index-=1;var i=o.o.plugins.history._index,t=o.o.plugins.history._stack[i];o.execCmd("html",t),o.o.plugins.history._stack[i]=o.$ed.html(),d(),e()}}},s=function(){var t,n,s=o.o.plugins.history._index,r=o.o.plugins.history._stack,d=r.slice(-1)[0]||"

",u=r[s],h=o.$ed.html(),c=o.doc.getSelection().focusNode,g="",a=o.o.plugins.history._focusEl;t=i("
"+d+"
").find("*").map(function(){return this.localName}),n=i("
"+h+"
").find("*").map(function(){return this.localName}),c&&(o.o.plugins.history._focusEl=c,g=c.outerHTML||c.textContent),h!==u&&(g.slice(-1).match(/\s/)||!l(t,n)||o.o.plugins.history._index<=0||c!==a?(o.o.plugins.history._index+=1,o.o.plugins.history._stack=r.slice(0,o.o.plugins.history._index),o.o.plugins.history._stack.push(h)):o.o.plugins.history._stack[s]=h,e())},e=function(){var i=o.o.plugins.history._index,t=o.o.plugins.history._stack.length,n=i>0,s=0!==t&&i!==t-1;r("historyUndo",n),r("historyRedo",s)},r=function(i,t){var n=o.$box.find(".trumbowyg-"+i+"-button");t?n.removeClass("trumbowyg-disable"):n.hasClass("trumbowyg-disable")||n.addClass("trumbowyg-disable")},l=function(i,o){if(i===o)return!0;if(null==i||null==o)return!1;if(i.length!==o.length)return!1;for(var t=0;t0&&(t.setStartAfter(i.childNodes[i.childNodes.length-1]),t.setEndAfter(i.childNodes[i.childNodes.length-1]),o.doc.getSelection().removeAllRanges(),o.doc.getSelection().addRange(t))};o.$c.on("tbwinit tbwchange",s),o.addBtnDef("historyRedo",t),o.addBtnDef("historyUndo",n)}}}})}(jQuery); \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js b/e_lib/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js deleted file mode 100644 index 74bc31cd..00000000 --- a/e_lib/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +++ /dev/null @@ -1,89 +0,0 @@ -/*/* =========================================================== - * trumbowyg.insertaudio.js v1.0 - * InsertAudio plugin for Trumbowyg - * http://alex-d.github.com/Trumbowyg - * =========================================================== - * Author : Adam Hess (AdamHess) - */ - -(function ($) { - 'use strict'; - - var insertAudioOptions = { - src: { - label: 'URL', - required: true - }, - autoplay: { - label: 'AutoPlay', - required: false, - type: 'checkbox' - }, - muted: { - label: 'Muted', - required: false, - type: 'checkbox' - }, - preload: { - label: 'preload options', - required: false - } - }; - - - $.extend(true, $.trumbowyg, { - langs: { - en: { - insertAudio: 'Insert Audio' - }, - fr: { - insertAudio: 'Insérer un son' - }, - ru: { - insertAudio: 'Вставить аудио' - }, - ja: { - insertAudio: '音声の挿入' - }, - tr: { - insertAudio: 'Ses Ekle' - } - }, - plugins: { - insertAudio: { - init: function (trumbowyg) { - var btnDef = { - fn: function () { - var insertAudioCallback = function (v) { - // controls should always be show otherwise the audio will - // be invisible defeating the point of a wysiwyg - var html = '
').addClass('note-specialchar-node'); + var $tr = (idx % COLUMN_LENGTH === 0) ? $('
'); - for (var i = 0; i < t.o.plugins.table.rows; i += 1) { - var row = $('').appendTo(tableSelect); - for (var j = 0; j < t.o.plugins.table.columns; j += 1) { - $('').appendTo(row); - } - } - tableSelect.find('td').on('mouseover', tableAnimate); - tableSelect.find('td').on('mousedown', tableBuild); - - $dropdown.append(tableSelect); - $dropdown.append($('
1x1
')); - } - - t.dropdown(btnName); - } - }; - - var tableAnimate = function(column_event) { - var column = $(column_event.target), - table = column.parents('table'), - colIndex = this.cellIndex, - rowIndex = this.parentNode.rowIndex; - - // reset all columns - table.find('td').removeClass('active'); - - for (var i = 0; i <= rowIndex; i += 1) { - for (var j = 0; j <= colIndex; j += 1) { - table.find("tr:nth-of-type("+(i+1)+")").find("td:nth-of-type("+(j+1)+")").addClass('active'); - } - } - - // set label - table.next('center').html((colIndex+1) + "x" + (rowIndex+1)); - }; - - var tableBuild = function(column_event) { - t.saveRange(); - - var tabler = $('
'); - if (t.o.plugins.table.styler) { - tabler.attr('class', t.o.plugins.table.styler); - } - - var column = $(column_event.target), - colIndex = this.cellIndex, - rowIndex = this.parentNode.rowIndex; - - for (var i = 0; i <= rowIndex; i += 1) { - var row = $('').appendTo(tabler); - for (var j = 0; j <= colIndex; j += 1) { - $('').appendTo(row); - } - } - - t.range.deleteContents(); - t.range.insertNode(tabler[0]); - t.$c.trigger('tbwchange'); - }; - - var addRow = { - title: t.lang['tableAddRow'], - text: t.lang['tableAddRow'], - ico: 'row-below', - - fn: function () { - t.saveRange(); - - var node = t.doc.getSelection().focusNode; - var table = $(node).closest('table'); - - if(table.length > 0) { - var row = $(''); - // add columns according to current columns count - for (var i = 0; i < table.find('tr')[0].childElementCount; i += 1) { - $('').appendTo(row); - } - // add row to table - row.appendTo(table); - } - - return true; - } - }; - - var addColumn = { - title: t.lang['tableAddColumn'], - text: t.lang['tableAddColumn'], - ico: 'col-right', - - fn: function () { - t.saveRange(); - - var node = t.doc.getSelection().focusNode; - var table = $(node).closest('table'); - - if(table.length > 0) { - $(table).find('tr').each(function() { - $(this).find('td:last').after(''); - }); - } - - return true; - } - }; - - var destroy = { - title: t.lang['tableDestroy'], - text: t.lang['tableDestroy'], - ico: 'table-delete', - - fn: function () { - t.saveRange(); - - var node = t.doc.getSelection().focusNode, - table = $(node).closest('table'); - - table.remove(); - - return true; - } - }; - - var deleteRow = { - title: t.lang['tableDeleteRow'], - text: t.lang['tableDeleteRow'], - ico: 'row-delete', - - fn: function () { - t.saveRange(); - - var node = t.doc.getSelection().focusNode, - row = $(node).closest('tr'); - - row.remove(); - - return true; - } - }; - - var deleteColumn = { - title: t.lang['tableDeleteColumn'], - text: t.lang['tableDeleteColumn'], - ico: 'col-delete', - - fn: function () { - t.saveRange(); - - var node = t.doc.getSelection().focusNode, - table = $(node).closest('table'), - td = $(node).closest('td'), - cellIndex = td.index(); - - $(table).find('tr').each(function() { - $(this).find('td:eq('+cellIndex+')').remove(); - }); - - return true; - } - }; - - t.addBtnDef('table', buildButtonDef); - t.addBtnDef('tableAddRow', addRow); - t.addBtnDef('tableAddColumn', addColumn); - t.addBtnDef('tableDeleteRow', deleteRow); - t.addBtnDef('tableDeleteColumn', deleteColumn); - t.addBtnDef('tableDestroy', destroy); - } - } - } - }); -})(jQuery); diff --git a/e_lib/trumbowyg/plugins/table/trumbowyg.table.min.js b/e_lib/trumbowyg/plugins/table/trumbowyg.table.min.js deleted file mode 100644 index cf721dd9..00000000 --- a/e_lib/trumbowyg/plugins/table/trumbowyg.table.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){"use strict";var t={rows:8,columns:8,styler:"table"};e.extend(!0,e.trumbowyg,{langs:{en:{table:"Insert table",tableAddRow:"Add row",tableAddColumn:"Add column",tableDeleteRow:"Delete row",tableDeleteColumn:"Delete column",tableDestroy:"Delete table",error:"Error"},de:{table:"Tabelle einfügen",tableAddRow:"Zeile hinzufügen",tableAddColumn:"Spalte hinzufügen",tableDeleteRow:"Zeile löschen",tableDeleteColumn:"Spalte löschen",tableDestroy:"Tabelle löschen",error:"Error"},sk:{table:"Vytvoriť tabuľky",tableAddRow:"Pridať riadok",tableAddColumn:"Pridať stĺpec",error:"Chyba"},fr:{table:"Insérer un tableau",tableAddRow:"Ajouter des lignes",tableAddColumn:"Ajouter des colonnes",error:"Erreur"},cs:{table:"Vytvořit příkaz Table",tableAddRow:"Přidat řádek",tableAddColumn:"Přidat sloupec",error:"Chyba"},ru:{table:"Вставить таблицу",tableAddRow:"Добавить строки",tableAddColumn:"Добавить столбцы",error:"Ошибка"},ja:{table:"表の挿入",tableAddRow:"行の追加",tableAddColumn:"列の追加",error:"エラー"},tr:{table:"Tablo ekle",tableAddRow:"Satır ekle",tableAddColumn:"Kolon ekle",error:"Hata"}},plugins:{table:{init:function(l){l.o.plugins.table=e.extend(!0,{},t,l.o.plugins.table||{});var a={fn:function(){l.saveRange();var t="table",a=l.o.prefix+"dropdown",d={"class":a+"-"+t+" "+a+" "+l.o.prefix+"fixed-top"};d["data-"+a]=t;var r=e("
",d);if(0===l.$box.find("."+a+"-"+t).length?l.$box.append(r.hide()):r=l.$box.find("."+a+"-"+t),r.html(""),l.$box.find("."+l.o.prefix+"table-button").hasClass(l.o.prefix+"active-button"))r.append(l.buildSubBtn("tableAddRow")),r.append(l.buildSubBtn("tableAddColumn")),r.append(l.buildSubBtn("tableDeleteRow")),r.append(l.buildSubBtn("tableDeleteColumn")),r.append(l.buildSubBtn("tableDestroy"));else{for(var b=e("
"),i=0;i").appendTo(b),u=0;u").appendTo(s);b.find("td").on("mouseover",n),b.find("td").on("mousedown",o),r.append(b),r.append(e("
1x1
"))}l.dropdown(t)}},n=function(t){var l=e(t.target),a=l.parents("table"),n=this.cellIndex,o=this.parentNode.rowIndex;a.find("td").removeClass("active");for(var d=0;d<=o;d+=1)for(var r=0;r<=n;r+=1)a.find("tr:nth-of-type("+(d+1)+")").find("td:nth-of-type("+(r+1)+")").addClass("active");a.next("center").html(n+1+"x"+(o+1))},o=function(t){l.saveRange();var a=e("
");l.o.plugins.table.styler&&a.attr("class",l.o.plugins.table.styler);for(var n=(e(t.target),this.cellIndex),o=this.parentNode.rowIndex,d=0;d<=o;d+=1)for(var r=e("").appendTo(a),b=0;b<=n;b+=1)e("").appendTo(r);l.range.deleteContents(),l.range.insertNode(a[0]),l.$c.trigger("tbwchange")},d={title:l.lang.tableAddRow,text:l.lang.tableAddRow,ico:"row-below",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,a=e(t).closest("table");if(a.length>0){for(var n=e(""),o=0;o").appendTo(n);n.appendTo(a)}return!0}},r={title:l.lang.tableAddColumn,text:l.lang.tableAddColumn,ico:"col-right",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,a=e(t).closest("table");return a.length>0&&e(a).find("tr").each(function(){e(this).find("td:last").after("")}),!0}},b={title:l.lang.tableDestroy,text:l.lang.tableDestroy,ico:"table-delete",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,a=e(t).closest("table");return a.remove(),!0}},i={title:l.lang.tableDeleteRow,text:l.lang.tableDeleteRow,ico:"row-delete",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,a=e(t).closest("tr");return a.remove(),!0}},s={title:l.lang.tableDeleteColumn,text:l.lang.tableDeleteColumn,ico:"col-delete",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,a=e(t).closest("table"),n=e(t).closest("td"),o=n.index();return e(a).find("tr").each(function(){e(this).find("td:eq("+o+")").remove()}),!0}};l.addBtnDef("table",a),l.addBtnDef("tableAddRow",d),l.addBtnDef("tableAddColumn",r),l.addBtnDef("tableDeleteRow",i),l.addBtnDef("tableDeleteColumn",s),l.addBtnDef("tableDestroy",b)}}}})}(jQuery); \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/table/ui/sass/trumbowyg.table.scss b/e_lib/trumbowyg/plugins/table/ui/sass/trumbowyg.table.scss deleted file mode 100644 index 7f0dfbb0..00000000 --- a/e_lib/trumbowyg/plugins/table/ui/sass/trumbowyg.table.scss +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - * Default stylesheet for Trumbowyg editor plugin - * ------------------------ - * @link http://alex-d.github.io/Trumbowyg - * @license MIT - * @author Alexandre Demode (Alex-D) - * Twitter : @AlexandreDemode - * Website : alex-d.fr - */ - -.trumbowyg-editor table { - width: 100%; - - td { - border: 1px dotted #e7eaec; - padding: 8px; - } -} - -.trumbowyg-dropdown-table { - table { - margin: 10px; - display: inline-block; - } - - table td { - display: inline-block; - height: 20px; - width: 20px; - margin: 1px; - background-color: #fff; - box-shadow: 0 0 0 1px #cecece inset; - - &.active { - background-color: #00b393; - box-shadow: none; - cursor: pointer; - } - } -} diff --git a/e_lib/trumbowyg/plugins/table/ui/trumbowyg.table.css b/e_lib/trumbowyg/plugins/table/ui/trumbowyg.table.css deleted file mode 100644 index cc4a64df..00000000 --- a/e_lib/trumbowyg/plugins/table/ui/trumbowyg.table.css +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - * Trumbowyg plugin stylesheet - * ------------------------ - * @link http://alex-d.github.io/Trumbowyg - * @license MIT - * @author Alexandre Demode (Alex-D) - * Twitter : @AlexandreDemode - * Website : alex-d.fr - */ - -.trumbowyg-editor table { - width: 100%; } - .trumbowyg-editor table td { - border: 1px dotted #e7eaec; - padding: 8px; } - -.trumbowyg-dropdown-table table { - margin: 10px; - display: inline-block; } - -.trumbowyg-dropdown-table table td { - display: inline-block; - height: 20px; - width: 20px; - margin: 1px; - background-color: #fff; - box-shadow: 0 0 0 1px #cecece inset; } - .trumbowyg-dropdown-table table td.active { - background-color: #00b393; - box-shadow: none; - cursor: pointer; } diff --git a/e_lib/trumbowyg/plugins/table/ui/trumbowyg.table.min.css b/e_lib/trumbowyg/plugins/table/ui/trumbowyg.table.min.css deleted file mode 100644 index 15e2f3ea..00000000 --- a/e_lib/trumbowyg/plugins/table/ui/trumbowyg.table.min.css +++ /dev/null @@ -1,2 +0,0 @@ -/** Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ -.trumbowyg-editor table{width:100%}.trumbowyg-editor table td{border:1px dotted #e7eaec;padding:8px}.trumbowyg-dropdown-table table{margin:10px;display:inline-block}.trumbowyg-dropdown-table table td{display:inline-block;height:20px;width:20px;margin:1px;background-color:#fff;box-shadow:0 0 0 1px #cecece inset}.trumbowyg-dropdown-table table td.active{background-color:#00b393;box-shadow:none;cursor:pointer} \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/template/trumbowyg.template.js b/e_lib/trumbowyg/plugins/template/trumbowyg.template.js deleted file mode 100644 index 8d96058b..00000000 --- a/e_lib/trumbowyg/plugins/template/trumbowyg.template.js +++ /dev/null @@ -1,64 +0,0 @@ -(function ($) { - 'use strict'; - - // Adds the language variables - $.extend(true, $.trumbowyg, { - langs: { - en: { - template: 'Template' - }, - fr: { - template: 'Patron' - }, - nl: { - template: 'Sjabloon' - }, - ru: { - template: 'Шаблон' - }, - ja: { - template: 'テンプレート' - }, - tr: { - template: 'Şablon' - } - } - }); - - // Adds the extra button definition - $.extend(true, $.trumbowyg, { - plugins: { - template: { - shouldInit: function (trumbowyg) { - return trumbowyg.o.plugins.hasOwnProperty('templates'); - }, - init: function (trumbowyg) { - trumbowyg.addBtnDef('template', { - dropdown: templateSelector(trumbowyg), - hasIcon: false, - text: trumbowyg.lang.template - }); - } - } - } - }); - - // Creates the template-selector dropdown. - function templateSelector(trumbowyg) { - var available = trumbowyg.o.plugins.templates; - var templates = []; - - $.each(available, function (index, template) { - trumbowyg.addBtnDef('template_' + index, { - fn: function () { - trumbowyg.html(template.html); - }, - hasIcon: false, - title: template.name - }); - templates.push('template_' + index); - }); - - return templates; - } -})(jQuery); diff --git a/e_lib/trumbowyg/plugins/template/trumbowyg.template.min.js b/e_lib/trumbowyg/plugins/template/trumbowyg.template.min.js deleted file mode 100644 index 3ecc68a2..00000000 --- a/e_lib/trumbowyg/plugins/template/trumbowyg.template.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t){"use strict";function e(e){var n=e.o.plugins.templates,a=[];return t.each(n,function(t,n){e.addBtnDef("template_"+t,{fn:function(){e.html(n.html)},hasIcon:!1,title:n.name}),a.push("template_"+t)}),a}t.extend(!0,t.trumbowyg,{langs:{en:{template:"Template"},fr:{template:"Patron"},nl:{template:"Sjabloon"},ru:{template:"Шаблон"},ja:{template:"テンプレート"},tr:{template:"Şablon"}}}),t.extend(!0,t.trumbowyg,{plugins:{template:{shouldInit:function(t){return t.o.plugins.hasOwnProperty("templates")},init:function(t){t.addBtnDef("template",{dropdown:e(t),hasIcon:!1,text:t.lang.template})}}}})}(jQuery); \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/upload/trumbowyg.upload.js b/e_lib/trumbowyg/plugins/upload/trumbowyg.upload.js deleted file mode 100644 index 580d2104..00000000 --- a/e_lib/trumbowyg/plugins/upload/trumbowyg.upload.js +++ /dev/null @@ -1,261 +0,0 @@ -/* =========================================================== - * trumbowyg.upload.js v1.2 - * Upload plugin for Trumbowyg - * http://alex-d.github.com/Trumbowyg - * =========================================================== - * Author : Alexandre Demode (Alex-D) - * Twitter : @AlexandreDemode - * Website : alex-d.fr - * Mod by : Aleksandr-ru - * Twitter : @Aleksandr_ru - * Website : aleksandr.ru - */ - -(function ($) { - 'use strict'; - - var defaultOptions = { - serverPath: '', - fileFieldName: 'fileToUpload', - data: [], // Additional data for ajax [{name: 'key', value: 'value'}] - headers: {}, // Additional headers - xhrFields: {}, // Additional fields - urlPropertyName: 'file', // How to get url from the json response (for instance 'url' for {url: ....}) - statusPropertyName: 'success', // How to get status from the json response - success: undefined, // Success callback: function (data, trumbowyg, $modal, values) {} - error: undefined, // Error callback: function () {} - imageWidthModalEdit: false // Add ability to edit image width - }; - - function getDeep(object, propertyParts) { - var mainProperty = propertyParts.shift(), - otherProperties = propertyParts; - - if (object !== null) { - if (otherProperties.length === 0) { - return object[mainProperty]; - } - - if (typeof object === 'object') { - return getDeep(object[mainProperty], otherProperties); - } - } - return object; - } - - addXhrProgressEvent(); - - $.extend(true, $.trumbowyg, { - langs: { - // jshint camelcase:false - en: { - upload: 'Upload', - file: 'File', - uploadError: 'Error' - }, - sk: { - upload: 'Nahrať', - file: 'Súbor', - uploadError: 'Chyba' - }, - fr: { - upload: 'Envoi', - file: 'Fichier', - uploadError: 'Erreur' - }, - cs: { - upload: 'Nahrát obrázek', - file: 'Soubor', - uploadError: 'Chyba' - }, - zh_cn: { - upload: '上传', - file: '文件', - uploadError: '错误' - }, - zh_tw: { - upload: '上傳', - file: '文件', - uploadError: '錯誤' - }, - ru: { - upload: 'Загрузка', - file: 'Файл', - uploadError: 'Ошибка' - }, - ja: { - upload: 'アップロード', - file: 'ファイル', - uploadError: 'エラー' - }, - pt_br: { - upload: 'Enviar do local', - file: 'Arquivo', - uploadError: 'Erro' - }, - tr: { - upload: 'Yükle', - file: 'Dosya', - uploadError: 'Hata' - } - }, - // jshint camelcase:true - - plugins: { - upload: { - init: function (trumbowyg) { - trumbowyg.o.plugins.upload = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.upload || {}); - var btnDef = { - fn: function () { - trumbowyg.saveRange(); - - var file, - prefix = trumbowyg.o.prefix; - - var fields = { - file: { - type: 'file', - required: true, - attributes: { - accept: 'image/*' - } - }, - alt: { - label: 'description', - value: trumbowyg.getRangeText() - } - }; - - if (trumbowyg.o.plugins.upload.imageWidthModalEdit) { - fields.width = { - value: '' - }; - } - - var $modal = trumbowyg.openModalInsert( - // Title - trumbowyg.lang.upload, - - // Fields - fields, - - // Callback - function (values) { - var data = new FormData(); - data.append(trumbowyg.o.plugins.upload.fileFieldName, file); - - trumbowyg.o.plugins.upload.data.map(function (cur) { - data.append(cur.name, cur.value); - }); - - $.map(values, function (curr, key) { - if (key !== 'file') { - data.append(key, curr); - } - }); - - if ($('.' + prefix + 'progress', $modal).length === 0) { - $('.' + prefix + 'modal-title', $modal) - .after( - $('
', { - 'class': prefix + 'progress' - }).append( - $('
', { - 'class': prefix + 'progress-bar' - }) - ) - ); - } - - $.ajax({ - url: trumbowyg.o.plugins.upload.serverPath, - headers: trumbowyg.o.plugins.upload.headers, - xhrFields: trumbowyg.o.plugins.upload.xhrFields, - type: 'POST', - data: data, - cache: false, - dataType: 'json', - processData: false, - contentType: false, - - progressUpload: function (e) { - $('.' + prefix + 'progress-bar').css('width', Math.round(e.loaded * 100 / e.total) + '%'); - }, - - success: function (data) { - if (trumbowyg.o.plugins.upload.success) { - trumbowyg.o.plugins.upload.success(data, trumbowyg, $modal, values); - } else { - if (!!getDeep(data, trumbowyg.o.plugins.upload.statusPropertyName.split('.'))) { - var url = getDeep(data, trumbowyg.o.plugins.upload.urlPropertyName.split('.')); - trumbowyg.execCmd('insertImage', url); - var $img = $('img[src="' + url + '"]:not([alt])', trumbowyg.$box); - $img.attr('alt', values.alt); - if (trumbowyg.o.imageWidthModalEdit && parseInt(values.width) > 0) { - $img.attr({ - width: values.width - }); - } - setTimeout(function () { - trumbowyg.closeModal(); - }, 250); - trumbowyg.$c.trigger('tbwuploadsuccess', [trumbowyg, data, url]); - } else { - trumbowyg.addErrorOnModalField( - $('input[type=file]', $modal), - trumbowyg.lang[data.message] - ); - trumbowyg.$c.trigger('tbwuploaderror', [trumbowyg, data]); - } - } - }, - - error: trumbowyg.o.plugins.upload.error || function () { - trumbowyg.addErrorOnModalField( - $('input[type=file]', $modal), - trumbowyg.lang.uploadError - ); - trumbowyg.$c.trigger('tbwuploaderror', [trumbowyg]); - } - }); - } - ); - - $('input[type=file]').on('change', function (e) { - try { - // If multiple files allowed, we just get the first. - file = e.target.files[0]; - } catch (err) { - // In IE8, multiple files not allowed - file = e.target.value; - } - }); - } - }; - - trumbowyg.addBtnDef('upload', btnDef); - } - } - } - }); - - function addXhrProgressEvent() { - if (!$.trumbowyg.addedXhrProgressEvent) { // Avoid adding progress event multiple times - var originalXhr = $.ajaxSettings.xhr; - $.ajaxSetup({ - xhr: function () { - var req = originalXhr(), - that = this; - if (req && typeof req.upload === 'object' && that.progressUpload !== undefined) { - req.upload.addEventListener('progress', function (e) { - that.progressUpload(e); - }, false); - } - - return req; - } - }); - $.trumbowyg.addedXhrProgressEvent = true; - } - } -})(jQuery); diff --git a/e_lib/trumbowyg/plugins/upload/trumbowyg.upload.min.js b/e_lib/trumbowyg/plugins/upload/trumbowyg.upload.min.js deleted file mode 100644 index 06150480..00000000 --- a/e_lib/trumbowyg/plugins/upload/trumbowyg.upload.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(r){"use strict";function e(r,a){var o=a.shift(),l=a;if(null!==r){if(0===l.length)return r[o];if("object"==typeof r)return e(r[o],l)}return r}function a(){if(!r.trumbowyg.addedXhrProgressEvent){var e=r.ajaxSettings.xhr;r.ajaxSetup({xhr:function(){var r=e(),a=this;return r&&"object"==typeof r.upload&&void 0!==a.progressUpload&&r.upload.addEventListener("progress",function(r){a.progressUpload(r)},!1),r}}),r.trumbowyg.addedXhrProgressEvent=!0}}var o={serverPath:"",fileFieldName:"fileToUpload",data:[],headers:{},xhrFields:{},urlPropertyName:"file",statusPropertyName:"success",success:void 0,error:void 0,imageWidthModalEdit:!1};a(),r.extend(!0,r.trumbowyg,{langs:{en:{upload:"Upload",file:"File",uploadError:"Error"},sk:{upload:"Nahrať",file:"Súbor",uploadError:"Chyba"},fr:{upload:"Envoi",file:"Fichier",uploadError:"Erreur"},cs:{upload:"Nahrát obrázek",file:"Soubor",uploadError:"Chyba"},zh_cn:{upload:"上传",file:"文件",uploadError:"错误"},zh_tw:{upload:"上傳",file:"文件",uploadError:"錯誤"},ru:{upload:"Загрузка",file:"Файл",uploadError:"Ошибка"},ja:{upload:"アップロード",file:"ファイル",uploadError:"エラー"},pt_br:{upload:"Enviar do local",file:"Arquivo",uploadError:"Erro"},tr:{upload:"Yükle",file:"Dosya",uploadError:"Hata"}},plugins:{upload:{init:function(a){a.o.plugins.upload=r.extend(!0,{},o,a.o.plugins.upload||{});var l={fn:function(){a.saveRange();var o,l=a.o.prefix,t={file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:a.getRangeText()}};a.o.plugins.upload.imageWidthModalEdit&&(t.width={value:""});var i=a.openModalInsert(a.lang.upload,t,function(t){var d=new FormData;d.append(a.o.plugins.upload.fileFieldName,o),a.o.plugins.upload.data.map(function(r){d.append(r.name,r.value)}),r.map(t,function(r,e){"file"!==e&&d.append(e,r)}),0===r("."+l+"progress",i).length&&r("."+l+"modal-title",i).after(r("
",{"class":l+"progress"}).append(r("
",{"class":l+"progress-bar"}))),r.ajax({url:a.o.plugins.upload.serverPath,headers:a.o.plugins.upload.headers,xhrFields:a.o.plugins.upload.xhrFields,type:"POST",data:d,cache:!1,dataType:"json",processData:!1,contentType:!1,progressUpload:function(e){r("."+l+"progress-bar").css("width",Math.round(100*e.loaded/e.total)+"%")},success:function(o){if(a.o.plugins.upload.success)a.o.plugins.upload.success(o,a,i,t);else if(e(o,a.o.plugins.upload.statusPropertyName.split("."))){var l=e(o,a.o.plugins.upload.urlPropertyName.split("."));a.execCmd("insertImage",l);var d=r('img[src="'+l+'"]:not([alt])',a.$box);d.attr("alt",t.alt),a.o.imageWidthModalEdit&&parseInt(t.width)>0&&d.attr({width:t.width}),setTimeout(function(){a.closeModal()},250),a.$c.trigger("tbwuploadsuccess",[a,o,l])}else a.addErrorOnModalField(r("input[type=file]",i),a.lang[o.message]),a.$c.trigger("tbwuploaderror",[a,o])},error:a.o.plugins.upload.error||function(){a.addErrorOnModalField(r("input[type=file]",i),a.lang.uploadError),a.$c.trigger("tbwuploaderror",[a])}})});r("input[type=file]").on("change",function(r){try{o=r.target.files[0]}catch(e){o=r.target.value}})}};a.addBtnDef("upload",l)}}}})}(jQuery); \ No newline at end of file diff --git a/e_lib/trumbowyg/trumbowyg.fontsize.css b/e_lib/trumbowyg/trumbowyg.fontsize.css deleted file mode 100644 index e2eefb02..00000000 --- a/e_lib/trumbowyg/trumbowyg.fontsize.css +++ /dev/null @@ -1,27 +0,0 @@ -.trumbowyg-fontsize_24px-dropdown-button{ - min-height:25px; -} - -.trumbowyg-fontsize_28px-dropdown-button{ - min-height:29px; -} - -.trumbowyg-fontsize_32px-dropdown-button{ - min-height:33px; -} - -.trumbowyg-fontsize_40px-dropdown-button{ - min-height:41px; -} - -.trumbowyg-fontsize_46px-dropdown-button{ - min-height:47px; -} - -.trumbowyg-fontsize_52px-dropdown-button{ - min-height:53px; -} - -.trumbowyg-fontsize_60px-dropdown-button{ - min-height:61px; -} \ No newline at end of file diff --git a/e_lib/trumbowyg/trumbowyg.fontsize.js b/e_lib/trumbowyg/trumbowyg.fontsize.js deleted file mode 100644 index 7e2fcbe4..00000000 --- a/e_lib/trumbowyg/trumbowyg.fontsize.js +++ /dev/null @@ -1,118 +0,0 @@ -(function ($) { - 'use strict'; - - $.extend(true, $.trumbowyg, { - langs: { - // jshint camelcase:false - en: { - fontsize: 'Font size', - fontsizes: { - 'custom': 'Custom' - } - }, - ko: { - fontsize: '글자 크기', - fontsizes: { - 'custom': '사용자 정의' - } - }, - } - }); - // jshint camelcase:true - - // Add dropdown with font sizes - $.extend(true, $.trumbowyg, { - plugins: { - fontsize: { - init: function (trumbowyg) { - trumbowyg.addBtnDef('fontsize', { - dropdown: buildDropdown(trumbowyg) - }); - } - } - } - }); - - function buildDropdown(trumbowyg) { - var dropdown = []; - var sizes = [ - '8px', - '9px', - '10px', - '11px', - '12px', - '14px', - '16px', - '18px', - '20px', - '24px', - '28px', - '32px', - '40px', - '46px', - '52px', - '60px' - ]; - - $.each(sizes, function (index, size) { - trumbowyg.addBtnDef('fontsize_' + size, { - text: '' + size + '', - hasIcon: false, - fn: function () { - trumbowyg.saveRange(); - var text = trumbowyg.range.startContainer.parentElement; - var selectedText = trumbowyg.getRangeText(); - if ($(text).html() === selectedText) { - $(text).css('font-size', size); - } else { - trumbowyg.range.deleteContents(); - var html = '' + selectedText + ''; - var node = $(html)[0]; - trumbowyg.range.insertNode(node); - } - trumbowyg.saveRange(); - trumbowyg.syncCode(); - trumbowyg.$c.trigger('tbwchange'); - return true; - } - }); - dropdown.push('fontsize_' + size); - }); - - var freeSizeButtonName = 'fontsize_custom', - freeSizeBtnDef = { - fn: function () { - trumbowyg.openModalInsert('Custom Font Size', - { - size: { - label: 'Font Size', - value: '48px' - } - }, - function (values) { - var text = trumbowyg.range.startContainer.parentElement; - var selectedText = trumbowyg.getRangeText(); - if ($(text).html() === selectedText) { - $(text).css('font-size', values.size); - } else { - trumbowyg.range.deleteContents(); - var html = '' + selectedText + ''; - var node = $(html)[0]; - trumbowyg.range.insertNode(node); - } - trumbowyg.saveRange(); - trumbowyg.syncCode(); - trumbowyg.$c.trigger('tbwchange'); - return true; - } - ); - }, - text: '' + trumbowyg.lang.fontsizes.custom + '', - hasIcon: false - }; - trumbowyg.addBtnDef(freeSizeButtonName, freeSizeBtnDef); - dropdown.push(freeSizeButtonName); - - return dropdown; - } -})(jQuery); diff --git a/e_lib/trumbowyg/trumbowyg.js b/e_lib/trumbowyg/trumbowyg.js deleted file mode 100644 index 17d301ec..00000000 --- a/e_lib/trumbowyg/trumbowyg.js +++ /dev/null @@ -1,1823 +0,0 @@ -/** - * Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - * Trumbowyg core file - * ------------------------ - * @link http://alex-d.github.io/Trumbowyg - * @license MIT - * @author Alexandre Demode (Alex-D) - * Twitter : @AlexandreDemode - * Website : alex-d.fr - */ - -jQuery.trumbowyg = { - langs: { - en: { - viewHTML: 'View HTML', - - undo: 'Undo', - redo: 'Redo', - - formatting: 'Formatting', - p: 'Paragraph', - blockquote: 'Quote', - code: 'Code', - header: 'Header', - - bold: 'Bold', - italic: 'Italic', - strikethrough: 'Stroke', - underline: 'Underline', - - strong: 'Strong', - em: 'Emphasis', - del: 'Deleted', - - superscript: 'Superscript', - subscript: 'Subscript', - - unorderedList: 'Unordered list', - orderedList: 'Ordered list', - - insertImage: 'Insert Image', - link: 'Link', - createLink: 'Insert link', - unlink: 'Remove link', - - justifyLeft: 'Align Left', - justifyCenter: 'Align Center', - justifyRight: 'Align Right', - justifyFull: 'Align Justify', - - horizontalRule: 'Insert horizontal rule', - removeformat: 'Remove format', - - fullscreen: 'Fullscreen', - - close: 'Close', - - submit: 'Confirm', - reset: 'Cancel', - - required: 'Required', - description: 'Description', - title: 'Title', - text: 'Text', - target: 'Target', - width: 'Width' - } - }, - - // Plugins - plugins: {}, - - // SVG Path globally - svgPath: null, - - hideButtonTexts: null -}; - -// Makes default options read-only -Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { - value: { - lang: 'en', - - fixedBtnPane: false, - fixedFullWidth: false, - autogrow: false, - autogrowOnEnter: false, - imageWidthModalEdit: false, - - prefix: 'trumbowyg-', - - semantic: true, - resetCss: false, - removeformatPasted: false, - tagsToRemove: [], - btns: [ - ['viewHTML'], - ['undo', 'redo'], // Only supported in Blink browsers - ['formatting'], - ['strong', 'em', 'del'], - ['superscript', 'subscript'], - ['link'], - ['insertImage'], - ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'], - ['unorderedList', 'orderedList'], - ['horizontalRule'], - ['removeformat'], - ['fullscreen'] - ], - // For custom button definitions - btnsDef: {}, - - inlineElementsSelector: 'a,abbr,acronym,b,caption,cite,code,col,dfn,dir,dt,dd,em,font,hr,i,kbd,li,q,span,strikeout,strong,sub,sup,u', - - pasteHandlers: [], - - // imgDblClickHandler: default is defined in constructor - - plugins: {}, - urlProtocol: false, - minimalLinks: false - }, - writable: false, - enumerable: true, - configurable: false -}); - - -(function (navigator, window, document, $) { - 'use strict'; - - var CONFIRM_EVENT = 'tbwconfirm', - CANCEL_EVENT = 'tbwcancel'; - - $.fn.trumbowyg = function (options, params) { - var trumbowygDataName = 'trumbowyg'; - if (options === Object(options) || !options) { - return this.each(function () { - if (!$(this).data(trumbowygDataName)) { - $(this).data(trumbowygDataName, new Trumbowyg(this, options)); - } - }); - } - if (this.length === 1) { - try { - var t = $(this).data(trumbowygDataName); - switch (options) { - // Exec command - case 'execCmd': - return t.execCmd(params.cmd, params.param, params.forceCss); - - // Modal box - case 'openModal': - return t.openModal(params.title, params.content); - case 'closeModal': - return t.closeModal(); - case 'openModalInsert': - return t.openModalInsert(params.title, params.fields, params.callback); - - // Range - case 'saveRange': - return t.saveRange(); - case 'getRange': - return t.range; - case 'getRangeText': - return t.getRangeText(); - case 'restoreRange': - return t.restoreRange(); - - // Enable/disable - case 'enable': - return t.setDisabled(false); - case 'disable': - return t.setDisabled(true); - - // Toggle - case 'toggle': - return t.toggle(); - - // Destroy - case 'destroy': - return t.destroy(); - - // Empty - case 'empty': - return t.empty(); - - // HTML - case 'html': - return t.html(params); - } - } catch (c) { - } - } - - return false; - }; - - // @param: editorElem is the DOM element - var Trumbowyg = function (editorElem, options) { - var t = this, - trumbowygIconsId = 'trumbowyg-icons', - $trumbowyg = $.trumbowyg; - - // Get the document of the element. It use to makes the plugin - // compatible on iframes. - t.doc = editorElem.ownerDocument || document; - - // jQuery object of the editor - t.$ta = $(editorElem); // $ta : Textarea - t.$c = $(editorElem); // $c : creator - - options = options || {}; - - // Localization management - if (options.lang != null || $trumbowyg.langs[options.lang] != null) { - t.lang = $.extend(true, {}, $trumbowyg.langs.en, $trumbowyg.langs[options.lang]); - } else { - t.lang = $trumbowyg.langs.en; - } - - t.hideButtonTexts = $trumbowyg.hideButtonTexts != null ? $trumbowyg.hideButtonTexts : options.hideButtonTexts; - - // SVG path - var svgPathOption = $trumbowyg.svgPath != null ? $trumbowyg.svgPath : options.svgPath; - t.hasSvg = svgPathOption !== false; - t.svgPath = !!t.doc.querySelector('base') ? window.location.href.split('#')[0] : ''; - if ($('#' + trumbowygIconsId, t.doc).length === 0 && svgPathOption !== false) { - if (svgPathOption == null) { - // Hack to get svgPathOption based on trumbowyg.js path - var scriptElements = document.getElementsByTagName('script'); - for (var i = 0; i < scriptElements.length; i += 1) { - var source = scriptElements[i].src; - var matches = source.match('trumbowyg(\.min)?\.js'); - if (matches != null) { - svgPathOption = source.substring(0, source.indexOf(matches[0])) + 'ui/icons.svg'; - } - } - if (svgPathOption == null) { - console.warn('You must define svgPath: https://goo.gl/CfTY9U'); // jshint ignore:line - } - } - - var div = t.doc.createElement('div'); - div.id = trumbowygIconsId; - t.doc.body.insertBefore(div, t.doc.body.childNodes[0]); - $.ajax({ - async: true, - type: 'GET', - contentType: 'application/x-www-form-urlencoded; charset=UTF-8', - dataType: 'xml', - crossDomain: true, - url: svgPathOption, - data: null, - beforeSend: null, - complete: null, - success: function (data) { - div.innerHTML = new XMLSerializer().serializeToString(data.documentElement); - } - }); - } - - - /** - * When the button is associated to a empty object - * fn and title attributs are defined from the button key value - * - * For example - * foo: {} - * is equivalent to : - * foo: { - * fn: 'foo', - * title: this.lang.foo - * } - */ - var h = t.lang.header, // Header translation - isBlinkFunction = function () { - return (window.chrome || (window.Intl && Intl.v8BreakIterator)) && 'CSS' in window; - }; - t.btnsDef = { - viewHTML: { - fn: 'toggle' - }, - - undo: { - isSupported: isBlinkFunction, - key: 'Z' - }, - redo: { - isSupported: isBlinkFunction, - key: 'Y' - }, - - p: { - fn: 'formatBlock' - }, - blockquote: { - fn: 'formatBlock' - }, - h1: { - fn: 'formatBlock', - title: h + ' 1' - }, - h2: { - fn: 'formatBlock', - title: h + ' 2' - }, - h3: { - fn: 'formatBlock', - title: h + ' 3' - }, - h4: { - fn: 'formatBlock', - title: h + ' 4' - }, - subscript: { - tag: 'sub' - }, - superscript: { - tag: 'sup' - }, - - bold: { - key: 'B', - tag: 'b' - }, - italic: { - key: 'I', - tag: 'i' - }, - underline: { - tag: 'u' - }, - strikethrough: { - tag: 'strike' - }, - - strong: { - fn: 'bold', - key: 'B' - }, - em: { - fn: 'italic', - key: 'I' - }, - del: { - fn: 'strikethrough' - }, - - createLink: { - key: 'K', - tag: 'a' - }, - unlink: {}, - - insertImage: {}, - - justifyLeft: { - tag: 'left', - forceCss: true - }, - justifyCenter: { - tag: 'center', - forceCss: true - }, - justifyRight: { - tag: 'right', - forceCss: true - }, - justifyFull: { - tag: 'justify', - forceCss: true - }, - - unorderedList: { - fn: 'insertUnorderedList', - tag: 'ul' - }, - orderedList: { - fn: 'insertOrderedList', - tag: 'ol' - }, - - horizontalRule: { - fn: 'insertHorizontalRule' - }, - - removeformat: {}, - - fullscreen: { - class: 'trumbowyg-not-disable' - }, - close: { - fn: 'destroy', - class: 'trumbowyg-not-disable' - }, - - // Dropdowns - formatting: { - dropdown: ['p', 'blockquote', 'h1', 'h2', 'h3', 'h4'], - ico: 'p' - }, - link: { - dropdown: ['createLink', 'unlink'] - } - }; - - // Defaults Options - t.o = $.extend(true, {}, $trumbowyg.defaultOptions, options); - if (!t.o.hasOwnProperty('imgDblClickHandler')) { - t.o.imgDblClickHandler = t.getDefaultImgDblClickHandler(); - } - - t.urlPrefix = t.setupUrlPrefix(); - - t.disabled = t.o.disabled || (editorElem.nodeName === 'TEXTAREA' && editorElem.disabled); - - if (options.btns) { - t.o.btns = options.btns; - } else if (!t.o.semantic) { - t.o.btns[3] = ['bold', 'italic', 'underline', 'strikethrough']; - } - - $.each(t.o.btnsDef, function (btnName, btnDef) { - t.addBtnDef(btnName, btnDef); - }); - - // put this here in the event it would be merged in with options - t.eventNamespace = 'trumbowyg-event'; - - // Keyboard shortcuts are load in this array - t.keys = []; - - // Tag to button dynamically hydrated - t.tagToButton = {}; - t.tagHandlers = []; - - // Admit multiple paste handlers - t.pasteHandlers = [].concat(t.o.pasteHandlers); - - // Check if browser is IE - t.isIE = (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') !== -1); - - t.init(); - }; - - Trumbowyg.prototype = { - DEFAULT_SEMANTIC_MAP: { - 'b': 'strong', - 'i': 'em', - 's': 'del', - 'strike': 'del', - 'div': 'p' - }, - - init: function () { - var t = this; - t.height = t.$ta.height(); - - t.initPlugins(); - - try { - // Disable image resize, try-catch for old IE - t.doc.execCommand('enableObjectResizing', false, false); - t.doc.execCommand('defaultParagraphSeparator', false, 'p'); - } catch (e) { - } - - t.buildEditor(); - t.buildBtnPane(); - - t.fixedBtnPaneEvents(); - - t.buildOverlay(); - - setTimeout(function () { - if (t.disabled) { - t.setDisabled(true); - } - t.$c.trigger('tbwinit'); - }); - }, - - addBtnDef: function (btnName, btnDef) { - this.btnsDef[btnName] = btnDef; - }, - - setupUrlPrefix: function () { - var protocol = this.o.urlProtocol; - if (!protocol) { - return; - } - - if (typeof(protocol) !== 'string') { - return 'https://'; - } - return /:\/\/$/.test(protocol) ? protocol : protocol + '://'; - }, - - buildEditor: function () { - var t = this, - prefix = t.o.prefix, - html = ''; - - t.$box = $('
', { - class: prefix + 'box ' + prefix + 'editor-visible ' + prefix + t.o.lang + ' trumbowyg' - }); - - // $ta = Textarea - // $ed = Editor - t.isTextarea = t.$ta.is('textarea'); - if (t.isTextarea) { - html = t.$ta.val(); - t.$ed = $('
'); - t.$box - .insertAfter(t.$ta) - .append(t.$ed, t.$ta); - } else { - t.$ed = t.$ta; - html = t.$ed.html(); - - t.$ta = $('