From accc083702833b1fdd3aa30fbda1d082c0f3a62b Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 30 Aug 2018 01:25:45 +0900 Subject: [PATCH] =?UTF-8?q?gui=20=EC=97=90=EB=94=94=ED=84=B0=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e_lib/trumbowyg/langs/ko.min.js | 10 + .../trumbowyg.allowtagsfrompaste.js | 143 ++ .../trumbowyg.allowtagsfrompaste.min.js | 1 + .../plugins/base64/trumbowyg.base64.js | 129 ++ .../plugins/base64/trumbowyg.base64.min.js | 1 + .../cleanpaste/trumbowyg.cleanpaste.js | 112 + .../cleanpaste/trumbowyg.cleanpaste.min.js | 1 + .../plugins/colors/trumbowyg.colors.js | 185 ++ .../plugins/colors/trumbowyg.colors.min.js | 1 + .../colors/ui/sass/trumbowyg.colors.scss | 49 + .../plugins/colors/ui/trumbowyg.colors.css | 43 + .../colors/ui/trumbowyg.colors.min.css | 2 + .../plugins/emoji/trumbowyg.emoji.js | 968 +++++++++ .../plugins/emoji/trumbowyg.emoji.min.js | 1 + .../emoji/ui/sass/trumbowyg.emoji.scss | 56 + .../plugins/emoji/ui/trumbowyg.emoji.css | 47 + .../plugins/emoji/ui/trumbowyg.emoji.min.css | 2 + .../fontfamily/trumbowyg.fontfamily.js | 73 + .../fontfamily/trumbowyg.fontfamily.min.js | 1 + .../plugins/fontsize/trumbowyg.fontsize.js | 117 ++ .../fontsize/trumbowyg.fontsize.min.js | 1 + .../plugins/highlight/trumbowyg.highlight.js | 82 + .../highlight/trumbowyg.highlight.min.js | 1 + .../ui/sass/trumbowyg.highlight.scss | 25 + .../highlight/ui/trumbowyg.highlight.css | 20 + .../highlight/ui/trumbowyg.highlight.min.css | 2 + .../plugins/history/trumbowyg.history.js | 190 ++ .../plugins/history/trumbowyg.history.min.js | 1 + .../insertaudio/trumbowyg.insertaudio.js | 89 + .../insertaudio/trumbowyg.insertaudio.min.js | 1 + .../lineheight/trumbowyg.lineheight.js | 104 + .../lineheight/trumbowyg.lineheight.min.js | 1 + .../plugins/mathml/trumbowyg.mathml.js | 88 + .../plugins/mathml/trumbowyg.mathml.min.js | 1 + .../mathml/ui/sass/trumbowyg.mathml.scss | 36 + .../plugins/mathml/ui/trumbowyg.mathml.css | 29 + .../mathml/ui/trumbowyg.mathml.min.css | 2 + .../plugins/mention/trumbowyg.mention.js | 105 + .../plugins/mention/trumbowyg.mention.min.js | 1 + .../mention/ui/sass/trumbowyg.mention.scss | 39 + .../plugins/mention/ui/trumbowyg.mention.css | 32 + .../mention/ui/trumbowyg.mention.min.css | 2 + .../plugins/noembed/trumbowyg.noembed.js | 104 + .../plugins/noembed/trumbowyg.noembed.min.js | 1 + .../pasteembed/trumbowyg.pasteembed.js | 96 + .../pasteembed/trumbowyg.pasteembed.min.js | 1 + .../pasteimage/trumbowyg.pasteimage.js | 41 + .../pasteimage/trumbowyg.pasteimage.min.js | 1 + .../preformatted/trumbowyg.preformatted.js | 130 ++ .../trumbowyg.preformatted.min.js | 1 + .../plugins/resizimg/trumbowyg.resizimg.js | 69 + .../resizimg/trumbowyg.resizimg.min.js | 1 + .../trumbowyg/plugins/ruby/trumbowyg.ruby.js | 72 + .../plugins/ruby/trumbowyg.ruby.min.js | 1 + .../plugins/table/trumbowyg.table.js | 283 +++ .../plugins/table/trumbowyg.table.min.js | 1 + .../table/ui/sass/trumbowyg.table.scss | 41 + .../plugins/table/ui/trumbowyg.table.css | 32 + .../plugins/table/ui/trumbowyg.table.min.css | 2 + .../plugins/template/trumbowyg.template.js | 64 + .../template/trumbowyg.template.min.js | 1 + .../plugins/upload/trumbowyg.upload.js | 261 +++ .../plugins/upload/trumbowyg.upload.min.js | 1 + e_lib/trumbowyg/trumbowyg.js | 1823 +++++++++++++++++ e_lib/trumbowyg/trumbowyg.min.js | 2 + e_lib/trumbowyg/ui/icons.svg | 1 + e_lib/trumbowyg/ui/sass/trumbowyg.scss | 809 ++++++++ e_lib/trumbowyg/ui/trumbowyg.css | 587 ++++++ e_lib/trumbowyg/ui/trumbowyg.min.css | 2 + hwe/b_dipcenter.php | 42 +- hwe/c_dipcenter.php | 4 +- hwe/css/common.css | 18 +- hwe/css/dipcenter.css | 4 + hwe/js/dipcenter.js | 62 + 74 files changed, 7344 insertions(+), 8 deletions(-) create mode 100644 e_lib/trumbowyg/langs/ko.min.js create mode 100644 e_lib/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js create mode 100644 e_lib/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js create mode 100644 e_lib/trumbowyg/plugins/base64/trumbowyg.base64.js create mode 100644 e_lib/trumbowyg/plugins/base64/trumbowyg.base64.min.js create mode 100644 e_lib/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js create mode 100644 e_lib/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js create mode 100644 e_lib/trumbowyg/plugins/colors/trumbowyg.colors.js create mode 100644 e_lib/trumbowyg/plugins/colors/trumbowyg.colors.min.js create mode 100644 e_lib/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss create mode 100644 e_lib/trumbowyg/plugins/colors/ui/trumbowyg.colors.css create mode 100644 e_lib/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css create mode 100644 e_lib/trumbowyg/plugins/emoji/trumbowyg.emoji.js create mode 100644 e_lib/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js create mode 100644 e_lib/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss create mode 100644 e_lib/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css create mode 100644 e_lib/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css create mode 100644 e_lib/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.js create mode 100644 e_lib/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.min.js create mode 100644 e_lib/trumbowyg/plugins/fontsize/trumbowyg.fontsize.js create mode 100644 e_lib/trumbowyg/plugins/fontsize/trumbowyg.fontsize.min.js create mode 100644 e_lib/trumbowyg/plugins/highlight/trumbowyg.highlight.js create mode 100644 e_lib/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js create mode 100644 e_lib/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss create mode 100644 e_lib/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css create mode 100644 e_lib/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css create mode 100644 e_lib/trumbowyg/plugins/history/trumbowyg.history.js create mode 100644 e_lib/trumbowyg/plugins/history/trumbowyg.history.min.js create mode 100644 e_lib/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js create mode 100644 e_lib/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js create mode 100644 e_lib/trumbowyg/plugins/lineheight/trumbowyg.lineheight.js create mode 100644 e_lib/trumbowyg/plugins/lineheight/trumbowyg.lineheight.min.js create mode 100644 e_lib/trumbowyg/plugins/mathml/trumbowyg.mathml.js create mode 100644 e_lib/trumbowyg/plugins/mathml/trumbowyg.mathml.min.js create mode 100644 e_lib/trumbowyg/plugins/mathml/ui/sass/trumbowyg.mathml.scss create mode 100644 e_lib/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.css create mode 100644 e_lib/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.min.css create mode 100644 e_lib/trumbowyg/plugins/mention/trumbowyg.mention.js create mode 100644 e_lib/trumbowyg/plugins/mention/trumbowyg.mention.min.js create mode 100644 e_lib/trumbowyg/plugins/mention/ui/sass/trumbowyg.mention.scss create mode 100644 e_lib/trumbowyg/plugins/mention/ui/trumbowyg.mention.css create mode 100644 e_lib/trumbowyg/plugins/mention/ui/trumbowyg.mention.min.css create mode 100644 e_lib/trumbowyg/plugins/noembed/trumbowyg.noembed.js create mode 100644 e_lib/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js create mode 100644 e_lib/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.js create mode 100644 e_lib/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.min.js create mode 100644 e_lib/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js create mode 100644 e_lib/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js create mode 100644 e_lib/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js create mode 100644 e_lib/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js create mode 100644 e_lib/trumbowyg/plugins/resizimg/trumbowyg.resizimg.js create mode 100644 e_lib/trumbowyg/plugins/resizimg/trumbowyg.resizimg.min.js create mode 100644 e_lib/trumbowyg/plugins/ruby/trumbowyg.ruby.js create mode 100644 e_lib/trumbowyg/plugins/ruby/trumbowyg.ruby.min.js create mode 100644 e_lib/trumbowyg/plugins/table/trumbowyg.table.js create mode 100644 e_lib/trumbowyg/plugins/table/trumbowyg.table.min.js create mode 100644 e_lib/trumbowyg/plugins/table/ui/sass/trumbowyg.table.scss create mode 100644 e_lib/trumbowyg/plugins/table/ui/trumbowyg.table.css create mode 100644 e_lib/trumbowyg/plugins/table/ui/trumbowyg.table.min.css create mode 100644 e_lib/trumbowyg/plugins/template/trumbowyg.template.js create mode 100644 e_lib/trumbowyg/plugins/template/trumbowyg.template.min.js create mode 100644 e_lib/trumbowyg/plugins/upload/trumbowyg.upload.js create mode 100644 e_lib/trumbowyg/plugins/upload/trumbowyg.upload.min.js create mode 100644 e_lib/trumbowyg/trumbowyg.js create mode 100644 e_lib/trumbowyg/trumbowyg.min.js create mode 100644 e_lib/trumbowyg/ui/icons.svg create mode 100644 e_lib/trumbowyg/ui/sass/trumbowyg.scss create mode 100644 e_lib/trumbowyg/ui/trumbowyg.css create mode 100644 e_lib/trumbowyg/ui/trumbowyg.min.css create mode 100644 hwe/css/dipcenter.css create mode 100644 hwe/js/dipcenter.js diff --git a/e_lib/trumbowyg/langs/ko.min.js b/e_lib/trumbowyg/langs/ko.min.js new file mode 100644 index 00000000..76e9c248 --- /dev/null +++ b/e_lib/trumbowyg/langs/ko.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * ko.js + * Korean translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : JoongSeob Vito Kim (dorajistyle) + * Blog : http://dorajistyle.pe.kr + * Github : https://github.com/dorajistyle + */ +jQuery.trumbowyg.langs.ko={viewHTML:"HTML로 보기",formatting:"양식",p:"문단",blockquote:"인용부호",code:"코드",header:"머릿말",bold:"진하게",italic:"기울임",strikethrough:"취소선",underline:"밑줄",strong:"굵게",em:"강조",del:"취소",unorderedList:"순차 목록",orderedList:"비순차 목록",insertImage:"이미지 넣기",insertVideo:"비디오 넣기",link:"링크",createLink:"링크 넣기",unlink:"링크 없애기",justifyLeft:"왼쪽 정렬",justifyCenter:"가운데 정렬",justifyRight:"오른쪽 정렬",justifyFull:"혼합 정렬",horizontalRule:"가로줄 넣기",fullscreen:"전체 화면",close:"닫기",submit:"전송",reset:"초기화",required:"꼭 입력해야 합니다.",description:"설명",title:"제목",text:"본문 내용"}; \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js b/e_lib/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js new file mode 100644 index 00000000..8876e1ae --- /dev/null +++ b/e_lib/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js @@ -0,0 +1,143 @@ +/* =========================================================== + * trumbowyg.allowTagsFromPaste.js v1.0.2 + * It cleans tags from pasted text, whilst allowing several specified tags + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Fathi Anshory (0x00000F5C) + * Twitter : @fscchannl + * Notes: + * - removeformatPasted must be set to FALSE since it was applied prior to pasteHandlers, or else it will be useless + * - It is most advisable to use along with the cleanpaste plugin, or else you'd end up with dirty markup + */ + +(function ($) { + 'use strict'; + + var defaultOptions = { + allowTagsFromPaste: [ + 'a', + 'abbr', + 'address', + 'b', + 'bdi', + 'bdo', + 'blockquote', + 'br', + 'cite', + 'code', + 'del', + 'dfn', + 'details', + 'em', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'hr', + 'i', + 'ins', + 'kbd', + 'mark', + 'meter', + 'pre', + 'progress', + 'q', + 'rp', + 'rt', + 'ruby', + 's', + 'samp', + 'small', + 'span', + 'strong', + 'sub', + 'summary', + 'sup', + 'time', + 'u', + 'var', + 'wbr', + 'img', + 'map', + 'area', + 'canvas', + 'figcaption', + 'figure', + 'picture', + 'audio', + 'source', + 'track', + 'video', + 'ul', + 'ol', + 'li', + 'dl', + 'dt', + 'dd', + 'table', + 'caption', + 'th', + 'tr', + 'td', + 'thead', + 'tbody', + 'tfoot', + 'col', + 'colgroup', + 'style', + 'div', + 'p', + 'form', + 'input', + 'textarea', + 'button', + 'select', + 'optgroup', + 'option', + 'label', + 'fieldset', + 'legend', + 'datalist', + 'keygen', + 'output', + 'iframe', + 'link', + 'nav', + 'header', + 'hgroup', + 'footer', + 'main', + 'section', + 'article', + 'aside', + 'dialog', + 'script', + 'noscript', + 'embed', + 'object', + 'param' + ] + }; + + $.extend(true, $.trumbowyg, { + plugins: { + allowTagsFromPaste: { + init: function (trumbowyg) { + trumbowyg.o.removeformatPasted = false; + trumbowyg.o.plugins.allowTagsFromPaste = trumbowyg.o.allowTagsFromPaste ? $(defaultOptions.allowTagsFromPaste).not(trumbowyg.o.allowTagsFromPaste).get() : []; + trumbowyg.pasteHandlers.push(function () { + setTimeout(function () { + var processNodes = trumbowyg.$ed.html(); + $.each(trumbowyg.o.plugins.allowTagsFromPaste, function (iterator, tagName) { + processNodes = processNodes.replace(new RegExp('<\\/?' + tagName + '(\\s[^>]*)?>', 'gi'), ''); + }); + trumbowyg.$ed.html(processNodes); + }, 0); + }); + } + } + } + }); +})(jQuery); diff --git a/e_lib/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js b/e_lib/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js new file mode 100644 index 00000000..3ed0ba34 --- /dev/null +++ b/e_lib/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js @@ -0,0 +1 @@ +!function(e){"use strict";var t={allowTagsFromPaste:["a","abbr","address","b","bdi","bdo","blockquote","br","cite","code","del","dfn","details","em","h1","h2","h3","h4","h5","h6","hr","i","ins","kbd","mark","meter","pre","progress","q","rp","rt","ruby","s","samp","small","span","strong","sub","summary","sup","time","u","var","wbr","img","map","area","canvas","figcaption","figure","picture","audio","source","track","video","ul","ol","li","dl","dt","dd","table","caption","th","tr","td","thead","tbody","tfoot","col","colgroup","style","div","p","form","input","textarea","button","select","optgroup","option","label","fieldset","legend","datalist","keygen","output","iframe","link","nav","header","hgroup","footer","main","section","article","aside","dialog","script","noscript","embed","object","param"]};e.extend(!0,e.trumbowyg,{plugins:{allowTagsFromPaste:{init:function(a){a.o.removeformatPasted=!1,a.o.plugins.allowTagsFromPaste=a.o.allowTagsFromPaste?e(t.allowTagsFromPaste).not(a.o.allowTagsFromPaste).get():[],a.pasteHandlers.push(function(){setTimeout(function(){var t=a.$ed.html();e.each(a.o.plugins.allowTagsFromPaste,function(e,a){t=t.replace(new RegExp("<\\/?"+a+"(\\s[^>]*)?>","gi"),"")}),a.$ed.html(t)},0)})}}}})}(jQuery); \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/base64/trumbowyg.base64.js b/e_lib/trumbowyg/plugins/base64/trumbowyg.base64.js new file mode 100644 index 00000000..b939791c --- /dev/null +++ b/e_lib/trumbowyg/plugins/base64/trumbowyg.base64.js @@ -0,0 +1,129 @@ +/* =========================================================== + * trumbowyg.base64.js v1.0 + * Base64 plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Cyril Biencourt (lizardK) + */ + +(function ($) { + 'use strict'; + + var isSupported = function () { + return typeof FileReader !== 'undefined'; + }; + + var isValidImage = function (type) { + return /^data:image\/[a-z]?/i.test(type); + }; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + base64: 'Image as base64', + file: 'File', + errFileReaderNotSupported: 'FileReader is not supported by your browser.', + errInvalidImage: 'Invalid image file.' + }, + fr: { + base64: 'Image en base64', + file: 'Fichier' + }, + cs: { + base64: 'Vložit obrázek', + file: 'Soubor' + }, + zh_cn: { + base64: '图片(Base64编码)', + file: '文件' + }, + nl: { + base64: 'Afbeelding inline', + file: 'Bestand', + errFileReaderNotSupported: 'Uw browser ondersteunt deze functionaliteit niet.', + errInvalidImage: 'De gekozen afbeelding is ongeldig.' + }, + ru: { + base64: 'Изображение как код в base64', + file: 'Файл', + errFileReaderNotSupported: 'FileReader не поддерживается вашим браузером.', + errInvalidImage: 'Недопустимый файл изображения.' + }, + ja: { + base64: '画像 (Base64形式)', + file: 'ファイル', + errFileReaderNotSupported: 'あなたのブラウザーはFileReaderをサポートしていません', + errInvalidImage: '画像形式が正しくありません' + }, + tr: { + base64: 'Base64 olarak resim', + file: 'Dosya', + errFileReaderNotSupported: 'FileReader tarayıcınız tarafından desteklenmiyor.', + errInvalidImage: 'Geçersiz resim dosyası.' + } + }, + // jshint camelcase:true + + plugins: { + base64: { + shouldInit: isSupported, + init: function (trumbowyg) { + var btnDef = { + isSupported: isSupported, + fn: function () { + trumbowyg.saveRange(); + + var file; + var $modal = trumbowyg.openModalInsert( + // Title + trumbowyg.lang.base64, + + // Fields + { + file: { + type: 'file', + required: true, + attributes: { + accept: 'image/*' + } + }, + alt: { + label: 'description', + value: trumbowyg.getRangeText() + } + }, + + // Callback + function (values) { + var fReader = new FileReader(); + + fReader.onloadend = function (e) { + if (isValidImage(e.target.result)) { + trumbowyg.execCmd('insertImage', fReader.result); + $(['img[src="', fReader.result, '"]:not([alt])'].join(''), trumbowyg.$box).attr('alt', values.alt); + trumbowyg.closeModal(); + } else { + trumbowyg.addErrorOnModalField( + $('input[type=file]', $modal), + trumbowyg.lang.errInvalidImage + ); + } + }; + + fReader.readAsDataURL(file); + } + ); + + $('input[type=file]').on('change', function (e) { + file = e.target.files[0]; + }); + } + }; + + trumbowyg.addBtnDef('base64', btnDef); + } + } + } + }); +})(jQuery); diff --git a/e_lib/trumbowyg/plugins/base64/trumbowyg.base64.min.js b/e_lib/trumbowyg/plugins/base64/trumbowyg.base64.min.js new file mode 100644 index 00000000..c892d6dd --- /dev/null +++ b/e_lib/trumbowyg/plugins/base64/trumbowyg.base64.min.js @@ -0,0 +1 @@ +!function(e){"use strict";var a=function(){return"undefined"!=typeof FileReader},r=function(e){return/^data:image\/[a-z]?/i.test(e)};e.extend(!0,e.trumbowyg,{langs:{en:{base64:"Image as base64",file:"File",errFileReaderNotSupported:"FileReader is not supported by your browser.",errInvalidImage:"Invalid image file."},fr:{base64:"Image en base64",file:"Fichier"},cs:{base64:"Vložit obrázek",file:"Soubor"},zh_cn:{base64:"图片(Base64编码)",file:"文件"},nl:{base64:"Afbeelding inline",file:"Bestand",errFileReaderNotSupported:"Uw browser ondersteunt deze functionaliteit niet.",errInvalidImage:"De gekozen afbeelding is ongeldig."},ru:{base64:"Изображение как код в base64",file:"Файл",errFileReaderNotSupported:"FileReader не поддерживается вашим браузером.",errInvalidImage:"Недопустимый файл изображения."},ja:{base64:"画像 (Base64形式)",file:"ファイル",errFileReaderNotSupported:"あなたのブラウザーはFileReaderをサポートしていません",errInvalidImage:"画像形式が正しくありません"},tr:{base64:"Base64 olarak resim",file:"Dosya",errFileReaderNotSupported:"FileReader tarayıcınız tarafından desteklenmiyor.",errInvalidImage:"Geçersiz resim dosyası."}},plugins:{base64:{shouldInit:a,init:function(i){var t={isSupported:a,fn:function(){i.saveRange();var a,t=i.openModalInsert(i.lang.base64,{file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:i.getRangeText()}},function(n){var l=new FileReader;l.onloadend=function(a){r(a.target.result)?(i.execCmd("insertImage",l.result),e(['img[src="',l.result,'"]:not([alt])'].join(""),i.$box).attr("alt",n.alt),i.closeModal()):i.addErrorOnModalField(e("input[type=file]",t),i.lang.errInvalidImage)},l.readAsDataURL(a)});e("input[type=file]").on("change",function(e){a=e.target.files[0]})}};i.addBtnDef("base64",t)}}}})}(jQuery); \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js b/e_lib/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js new file mode 100644 index 00000000..34cf05bd --- /dev/null +++ b/e_lib/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js @@ -0,0 +1,112 @@ +/* =========================================================== + * trumbowyg.cleanpaste.js v1.0 + * Font Clean paste plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Authors : Eric Radin + * Todd Graham (slackwalker) + * + * This plugin will perform a "cleaning" on any paste, in particular + * it will clean pasted content of microsoft word document tags and classes. + */ + +(function ($) { + 'use strict'; + + function checkValidTags(snippet) { + var theString = snippet; + + // Replace uppercase element names with lowercase + theString = theString.replace(/<[^> ]*/g, function (match) { + return match.toLowerCase(); + }); + + // Replace uppercase attribute names with lowercase + theString = theString.replace(/<[^>]*>/g, function (match) { + match = match.replace(/ [^=]+=/g, function (match2) { + return match2.toLowerCase(); + }); + return match; + }); + + // Put quotes around unquoted attributes + theString = theString.replace(/<[^>]*>/g, function (match) { + match = match.replace(/( [^=]+=)([^"][^ >]*)/g, '$1\"$2\"'); + return match; + }); + + return theString; + } + + function cleanIt(html) { + // first make sure all tags and attributes are made valid + html = checkValidTags(html); + + // Replace opening bold tags with strong + html = html.replace(/)/g, ')/g, ')/g, ')/g, '\s*/g, ''); + + // strip out   -cgCraft + html = html.replace(/ /gi, ' '); + // strip out extra spaces -cgCraft + html = html.replace(/ <\//gi, ']*>/g, function (match) { + match = match.replace(/ ([^=]+)="[^"]*"/g, function (match2, attributeName) { + if (['alt', 'href', 'src', 'title'].indexOf(attributeName) !== -1) { + return match2; + } + return ''; + }); + return match; + }); + + // Final cleanout for MS Word crud + html = html.replace(/<\?xml[^>]*>/g, ''); + html = html.replace(/<[^ >]+:[^>]*>/g, ''); + html = html.replace(/<\/[^ >]+:[^>]*>/g, ''); + + // remove unwanted tags + html = html.replace(/<(div|span|style|meta|link).*?>/gi, ''); + + return html; + } + + // clean editor + // this will clean the inserted contents + // it does a compare, before and after paste to determine the + // pasted contents + $.extend(true, $.trumbowyg, { + plugins: { + cleanPaste: { + init: function (trumbowyg) { + trumbowyg.pasteHandlers.push(function () { + try { + trumbowyg.$ed.html(cleanIt(trumbowyg.$ed.html())); + } catch (c) { + } + }); + } + } + } + }); +})(jQuery); + + diff --git a/e_lib/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js b/e_lib/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js new file mode 100644 index 00000000..5ebc39b2 --- /dev/null +++ b/e_lib/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js @@ -0,0 +1 @@ +!function(e){"use strict";function r(e){var r=e;return r=r.replace(/<[^> ]*/g,function(e){return e.toLowerCase()}),r=r.replace(/<[^>]*>/g,function(e){return e=e.replace(/ [^=]+=/g,function(e){return e.toLowerCase()})}),r=r.replace(/<[^>]*>/g,function(e){return e=e.replace(/( [^=]+=)([^"][^ >]*)/g,'$1"$2"')})}function n(e){for(e=r(e),e=e.replace(/)/g,")/g,")/g,")/g,"\s*/g,""),e=e.replace(/ /gi," "),e=e.replace(/ <\//gi,"]*>/g,function(e){return e=e.replace(/ ([^=]+)="[^"]*"/g,function(e,r){return["alt","href","src","title"].indexOf(r)!==-1?e:""})}),e=e.replace(/<\?xml[^>]*>/g,""),e=e.replace(/<[^ >]+:[^>]*>/g,""),e=e.replace(/<\/[^ >]+:[^>]*>/g,""),e=e.replace(/<(div|span|style|meta|link).*?>/gi,"")}e.extend(!0,e.trumbowyg,{plugins:{cleanPaste:{init:function(e){e.pasteHandlers.push(function(){try{e.$ed.html(n(e.$ed.html()))}catch(r){}})}}}})}(jQuery); \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/colors/trumbowyg.colors.js b/e_lib/trumbowyg/plugins/colors/trumbowyg.colors.js new file mode 100644 index 00000000..6236279a --- /dev/null +++ b/e_lib/trumbowyg/plugins/colors/trumbowyg.colors.js @@ -0,0 +1,185 @@ +/* =========================================================== + * trumbowyg.colors.js v1.2 + * Colors picker plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +(function ($) { + 'use strict'; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + cs: { + foreColor: 'Barva textu', + backColor: 'Barva pozadí' + }, + en: { + foreColor: 'Text color', + backColor: 'Background color' + }, + fr: { + foreColor: 'Couleur du texte', + backColor: 'Couleur de fond' + }, + nl: { + foreColor: 'Tekstkleur', + backColor: 'Achtergrondkleur' + }, + sk: { + foreColor: 'Farba textu', + backColor: 'Farba pozadia' + }, + zh_cn: { + foreColor: '文字颜色', + backColor: '背景颜色' + }, + ru: { + foreColor: 'Цвет текста', + backColor: 'Цвет выделения текста' + }, + ja: { + foreColor: '文字色', + backColor: '背景色' + }, + tr: { + foreColor: 'Yazı rengi', + backColor: 'Arkaplan rengi' + } + } + }); + + // jshint camelcase:true + + + function hex(x) { + return ('0' + parseInt(x).toString(16)).slice(-2); + } + + function colorToHex(rgb) { + if (rgb.search('rgb') === -1) { + return rgb.replace('#', ''); + } else if (rgb === 'rgba(0, 0, 0, 0)') { + return 'transparent'; + } else { + rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/); + return hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); + } + } + + function colorTagHandler(element, trumbowyg) { + var tags = []; + + if (!element.style) { + return tags; + } + + // background color + if (element.style.backgroundColor !== '') { + var backColor = colorToHex(element.style.backgroundColor); + if (trumbowyg.o.plugins.colors.colorList.indexOf(backColor) >= 0) { + tags.push('backColor' + backColor); + } else { + tags.push('backColorFree'); + } + } + + // text color + var foreColor; + if (element.style.color !== '') { + foreColor = colorToHex(element.style.color); + } else if (element.hasAttribute('color')) { + foreColor = colorToHex(element.getAttribute('color')); + } + if (foreColor) { + if (trumbowyg.o.plugins.colors.colorList.indexOf(foreColor) >= 0) { + tags.push('foreColor' + foreColor); + } else { + tags.push('foreColorFree'); + } + } + + return tags; + } + + var defaultOptions = { + colorList: ['ffffff', '000000', 'eeece1', '1f497d', '4f81bd', 'c0504d', '9bbb59', '8064a2', '4bacc6', 'f79646', 'ffff00', 'f2f2f2', '7f7f7f', 'ddd9c3', 'c6d9f0', 'dbe5f1', 'f2dcdb', 'ebf1dd', 'e5e0ec', 'dbeef3', 'fdeada', 'fff2ca', 'd8d8d8', '595959', 'c4bd97', '8db3e2', 'b8cce4', 'e5b9b7', 'd7e3bc', 'ccc1d9', 'b7dde8', 'fbd5b5', 'ffe694', 'bfbfbf', '3f3f3f', '938953', '548dd4', '95b3d7', 'd99694', 'c3d69b', 'b2a2c7', 'b7dde8', 'fac08f', 'f2c314', 'a5a5a5', '262626', '494429', '17365d', '366092', '953734', '76923c', '5f497a', '92cddc', 'e36c09', 'c09100', '7f7f7f', '0c0c0c', '1d1b10', '0f243e', '244061', '632423', '4f6128', '3f3151', '31859b', '974806', '7f6000'] + }; + + // Add all colors in two dropdowns + $.extend(true, $.trumbowyg, { + plugins: { + color: { + init: function (trumbowyg) { + trumbowyg.o.plugins.colors = trumbowyg.o.plugins.colors || defaultOptions; + var foreColorBtnDef = { + dropdown: buildDropdown('foreColor', trumbowyg) + }, + backColorBtnDef = { + dropdown: buildDropdown('backColor', trumbowyg) + }; + + trumbowyg.addBtnDef('foreColor', foreColorBtnDef); + trumbowyg.addBtnDef('backColor', backColorBtnDef); + }, + tagHandler: colorTagHandler + } + } + }); + + function buildDropdown(fn, trumbowyg) { + var dropdown = []; + + $.each(trumbowyg.o.plugins.colors.colorList, function (i, color) { + var btn = fn + color, + btnDef = { + fn: fn, + forceCss: true, + param: '#' + color, + style: 'background-color: #' + color + ';' + }; + trumbowyg.addBtnDef(btn, btnDef); + dropdown.push(btn); + }); + + var removeColorButtonName = fn + 'Remove', + removeColorBtnDef = { + fn: 'removeFormat', + param: fn, + style: 'background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAG0lEQVQIW2NkQAAfEJMRmwBYhoGBYQtMBYoAADziAp0jtJTgAAAAAElFTkSuQmCC);' + }; + trumbowyg.addBtnDef(removeColorButtonName, removeColorBtnDef); + dropdown.push(removeColorButtonName); + + // add free color btn + var freeColorButtonName = fn + 'Free', + freeColorBtnDef = { + fn: function () { + trumbowyg.openModalInsert(trumbowyg.lang[fn], + { + color: { + label: fn, + value: '#FFFFFF' + } + }, + // callback + function (values) { + trumbowyg.execCmd(fn, values.color); + return true; + } + ); + }, + text: '#', + // style adjust for displaying the text + style: 'text-indent: 0;line-height: 20px;padding: 0 5px;' + }; + trumbowyg.addBtnDef(freeColorButtonName, freeColorBtnDef); + dropdown.push(freeColorButtonName); + + return dropdown; + } +})(jQuery); diff --git a/e_lib/trumbowyg/plugins/colors/trumbowyg.colors.min.js b/e_lib/trumbowyg/plugins/colors/trumbowyg.colors.min.js new file mode 100644 index 00000000..5bf1534c --- /dev/null +++ b/e_lib/trumbowyg/plugins/colors/trumbowyg.colors.min.js @@ -0,0 +1 @@ +!function(o){"use strict";function r(o){return("0"+parseInt(o).toString(16)).slice(-2)}function e(o){return o.search("rgb")===-1?o.replace("#",""):"rgba(0, 0, 0, 0)"===o?"transparent":(o=o.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/),r(o[1])+r(o[2])+r(o[3]))}function a(o,r){var a=[];if(!o.style)return a;if(""!==o.style.backgroundColor){var f=e(o.style.backgroundColor);r.o.plugins.colors.colorList.indexOf(f)>=0?a.push("backColor"+f):a.push("backColorFree")}var c;return""!==o.style.color?c=e(o.style.color):o.hasAttribute("color")&&(c=e(o.getAttribute("color"))),c&&(r.o.plugins.colors.colorList.indexOf(c)>=0?a.push("foreColor"+c):a.push("foreColorFree")),a}function f(r,e){var a=[];o.each(e.o.plugins.colors.colorList,function(o,f){var c=r+f,l={fn:r,forceCss:!0,param:"#"+f,style:"background-color: #"+f+";"};e.addBtnDef(c,l),a.push(c)});var f=r+"Remove",c={fn:"removeFormat",param:r,style:"background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAG0lEQVQIW2NkQAAfEJMRmwBYhoGBYQtMBYoAADziAp0jtJTgAAAAAElFTkSuQmCC);"};e.addBtnDef(f,c),a.push(f);var l=r+"Free",d={fn:function(){e.openModalInsert(e.lang[r],{color:{label:r,value:"#FFFFFF"}},function(o){return e.execCmd(r,o.color),!0})},text:"#",style:"text-indent: 0;line-height: 20px;padding: 0 5px;"};return e.addBtnDef(l,d),a.push(l),a}o.extend(!0,o.trumbowyg,{langs:{cs:{foreColor:"Barva textu",backColor:"Barva pozadí"},en:{foreColor:"Text color",backColor:"Background color"},fr:{foreColor:"Couleur du texte",backColor:"Couleur de fond"},nl:{foreColor:"Tekstkleur",backColor:"Achtergrondkleur"},sk:{foreColor:"Farba textu",backColor:"Farba pozadia"},zh_cn:{foreColor:"文字颜色",backColor:"背景颜色"},ru:{foreColor:"Цвет текста",backColor:"Цвет выделения текста"},ja:{foreColor:"文字色",backColor:"背景色"},tr:{foreColor:"Yazı rengi",backColor:"Arkaplan rengi"}}});var c={colorList:["ffffff","000000","eeece1","1f497d","4f81bd","c0504d","9bbb59","8064a2","4bacc6","f79646","ffff00","f2f2f2","7f7f7f","ddd9c3","c6d9f0","dbe5f1","f2dcdb","ebf1dd","e5e0ec","dbeef3","fdeada","fff2ca","d8d8d8","595959","c4bd97","8db3e2","b8cce4","e5b9b7","d7e3bc","ccc1d9","b7dde8","fbd5b5","ffe694","bfbfbf","3f3f3f","938953","548dd4","95b3d7","d99694","c3d69b","b2a2c7","b7dde8","fac08f","f2c314","a5a5a5","262626","494429","17365d","366092","953734","76923c","5f497a","92cddc","e36c09","c09100","7f7f7f","0c0c0c","1d1b10","0f243e","244061","632423","4f6128","3f3151","31859b","974806","7f6000"]};o.extend(!0,o.trumbowyg,{plugins:{color:{init:function(o){o.o.plugins.colors=o.o.plugins.colors||c;var r={dropdown:f("foreColor",o)},e={dropdown:f("backColor",o)};o.addBtnDef("foreColor",r),o.addBtnDef("backColor",e)},tagHandler:a}}})}(jQuery); \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss b/e_lib/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss new file mode 100644 index 00000000..f9363a5c --- /dev/null +++ b/e_lib/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss @@ -0,0 +1,49 @@ +/** + * 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-dropdown-foreColor, +.trumbowyg-dropdown-backColor { + width: 276px; + padding: 7px 5px; + + svg { + display: none !important; + } + + button { + display: block; + position: relative; + float: left; + text-indent: -9999px; + height: 20px; + width: 20px; + border: 1px solid #333; + padding: 0; + margin: 2px; + + &:hover, + &:focus { + &::after { + content: " "; + display: block; + position: absolute; + top: -5px; + left: -5px; + height: 27px; + width: 27px; + background: inherit; + border: 1px solid #FFF; + box-shadow: #000 0 0 2px; + z-index: 10; + } + } + } +} \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/colors/ui/trumbowyg.colors.css b/e_lib/trumbowyg/plugins/colors/ui/trumbowyg.colors.css new file mode 100644 index 00000000..91f80fca --- /dev/null +++ b/e_lib/trumbowyg/plugins/colors/ui/trumbowyg.colors.css @@ -0,0 +1,43 @@ +/** + * 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-dropdown-foreColor, +.trumbowyg-dropdown-backColor { + width: 276px; + padding: 7px 5px; } + .trumbowyg-dropdown-foreColor svg, + .trumbowyg-dropdown-backColor svg { + display: none !important; } + .trumbowyg-dropdown-foreColor button, + .trumbowyg-dropdown-backColor button { + display: block; + position: relative; + float: left; + text-indent: -9999px; + height: 20px; + width: 20px; + border: 1px solid #333; + padding: 0; + margin: 2px; } + .trumbowyg-dropdown-foreColor button:hover::after, .trumbowyg-dropdown-foreColor button:focus::after, + .trumbowyg-dropdown-backColor button:hover::after, + .trumbowyg-dropdown-backColor button:focus::after { + content: " "; + display: block; + position: absolute; + top: -5px; + left: -5px; + height: 27px; + width: 27px; + background: inherit; + border: 1px solid #FFF; + box-shadow: #000 0 0 2px; + z-index: 10; } diff --git a/e_lib/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css b/e_lib/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css new file mode 100644 index 00000000..9e59e2b3 --- /dev/null +++ b/e_lib/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css @@ -0,0 +1,2 @@ +/** Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +.trumbowyg-dropdown-backColor,.trumbowyg-dropdown-foreColor{width:276px;padding:7px 5px}.trumbowyg-dropdown-backColor svg,.trumbowyg-dropdown-foreColor svg{display:none!important}.trumbowyg-dropdown-backColor button,.trumbowyg-dropdown-foreColor button{display:block;position:relative;float:left;text-indent:-9999px;height:20px;width:20px;border:1px solid #333;padding:0;margin:2px}.trumbowyg-dropdown-backColor button:focus::after,.trumbowyg-dropdown-backColor button:hover::after,.trumbowyg-dropdown-foreColor button:focus::after,.trumbowyg-dropdown-foreColor button:hover::after{content:" ";display:block;position:absolute;top:-5px;left:-5px;height:27px;width:27px;background:inherit;border:1px solid #FFF;box-shadow:#000 0 0 2px;z-index:10} \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/emoji/trumbowyg.emoji.js b/e_lib/trumbowyg/plugins/emoji/trumbowyg.emoji.js new file mode 100644 index 00000000..1c4089a7 --- /dev/null +++ b/e_lib/trumbowyg/plugins/emoji/trumbowyg.emoji.js @@ -0,0 +1,968 @@ +/* =========================================================== + * trumbowyg.emoji.js v0.1 + * Emoji picker plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Nicolas Pion + * Twitter : @nicolas_pion + */ + +(function ($) { + 'use strict'; + + var defaultOptions = { + emojiList: [ + ':bowtie:', + ':smile:', + ':laughing:', + ':blush:', + ':smiley:', + ':relaxed:', + ':smirk:', + ':heart_eyes:', + ':kissing_heart:', + ':kissing_closed_eyes:', + ':flushed:', + ':relieved:', + ':satisfied:', + ':grin:', + ':wink:', + ':stuck_out_tongue_winking_eye:', + ':stuck_out_tongue_closed_eyes:', + ':grinning:', + ':kissing:', + ':kissing_smiling_eyes:', + ':stuck_out_tongue:', + ':sleeping:', + ':worried:', + ':frowning:', + ':anguished:', + ':open_mouth:', + ':grimacing:', + ':confused:', + ':hushed:', + ':expressionless:', + ':unamused:', + ':sweat_smile:', + ':sweat:', + ':disappointed_relieved:', + ':weary:', + ':pensive:', + ':disappointed:', + ':confounded:', + ':fearful:', + ':cold_sweat:', + ':persevere:', + ':cry:', + ':sob:', + ':joy:', + ':astonished:', + ':scream:', + ':neckbeard:', + ':tired_face:', + ':angry:', + ':rage:', + ':triumph:', + ':sleepy:', + ':yum:', + ':mask:', + ':sunglasses:', + ':dizzy_face:', + ':imp:', + ':smiling_imp:', + ':neutral_face:', + ':no_mouth:', + ':innocent:', + ':alien:', + ':yellow_heart:', + ':blue_heart:', + ':purple_heart:', + ':heart:', + ':green_heart:', + ':broken_heart:', + ':heartbeat:', + ':heartpulse:', + ':two_hearts:', + ':revolving_hearts:', + ':cupid:', + ':sparkling_heart:', + ':sparkles:', + ':star:', + ':star2:', + ':dizzy:', + ':boom:', + ':collision:', + ':anger:', + ':exclamation:', + ':question:', + ':grey_exclamation:', + ':grey_question:', + ':zzz:', + ':dash:', + ':sweat_drops:', + ':notes:', + ':musical_note:', + ':fire:', + ':hankey:', + ':poop:', + ':shit:', + ':+1:', + ':thumbsup:', + ':-1:', + ':thumbsdown:', + ':ok_hand:', + ':punch:', + ':facepunch:', + ':fist:', + ':v:', + ':wave:', + ':hand:', + ':raised_hand:', + ':open_hands:', + ':point_up:', + ':point_down:', + ':point_left:', + ':point_right:', + ':raised_hands:', + ':pray:', + ':point_up_2:', + ':clap:', + ':muscle:', + ':metal:', + ':fu:', + ':runner:', + ':running:', + ':couple:', + ':family:', + ':two_men_holding_hands:', + ':two_women_holding_hands:', + ':dancer:', + ':dancers:', + ':ok_woman:', + ':no_good:', + ':information_desk_person:', + ':raising_hand:', + ':bride_with_veil:', + ':person_with_pouting_face:', + ':person_frowning:', + ':bow:', + ':couplekiss:', + ':couple_with_heart:', + ':massage:', + ':haircut:', + ':nail_care:', + ':boy:', + ':girl:', + ':woman:', + ':man:', + ':baby:', + ':older_woman:', + ':older_man:', + ':person_with_blond_hair:', + ':man_with_gua_pi_mao:', + ':man_with_turban:', + ':construction_worker:', + ':cop:', + ':angel:', + ':princess:', + ':smiley_cat:', + ':smile_cat:', + ':heart_eyes_cat:', + ':kissing_cat:', + ':smirk_cat:', + ':scream_cat:', + ':crying_cat_face:', + ':joy_cat:', + ':pouting_cat:', + ':japanese_ogre:', + ':japanese_goblin:', + ':see_no_evil:', + ':hear_no_evil:', + ':speak_no_evil:', + ':guardsman:', + ':skull:', + ':feet:', + ':lips:', + ':kiss:', + ':droplet:', + ':ear:', + ':eyes:', + ':nose:', + ':tongue:', + ':love_letter:', + ':bust_in_silhouette:', + ':busts_in_silhouette:', + ':speech_balloon:', + ':thought_balloon:', + ':feelsgood:', + ':finnadie:', + ':goberserk:', + ':godmode:', + ':hurtrealbad:', + ':rage1:', + ':rage2:', + ':rage3:', + ':rage4:', + ':suspect:', + ':trollface:', + ':sunny:', + ':umbrella:', + ':cloud:', + ':snowflake:', + ':snowman:', + ':zap:', + ':cyclone:', + ':foggy:', + ':ocean:', + ':cat:', + ':dog:', + ':mouse:', + ':hamster:', + ':rabbit:', + ':wolf:', + ':frog:', + ':tiger:', + ':koala:', + ':bear:', + ':pig:', + ':pig_nose:', + ':cow:', + ':boar:', + ':monkey_face:', + ':monkey:', + ':horse:', + ':racehorse:', + ':camel:', + ':sheep:', + ':elephant:', + ':panda_face:', + ':snake:', + ':bird:', + ':baby_chick:', + ':hatched_chick:', + ':hatching_chick:', + ':chicken:', + ':penguin:', + ':turtle:', + ':bug:', + ':honeybee:', + ':ant:', + ':beetle:', + ':snail:', + ':octopus:', + ':tropical_fish:', + ':fish:', + ':whale:', + ':whale2:', + ':dolphin:', + ':cow2:', + ':ram:', + ':rat:', + ':water_buffalo:', + ':tiger2:', + ':rabbit2:', + ':dragon:', + ':goat:', + ':rooster:', + ':dog2:', + ':pig2:', + ':mouse2:', + ':ox:', + ':dragon_face:', + ':blowfish:', + ':crocodile:', + ':dromedary_camel:', + ':leopard:', + ':cat2:', + ':poodle:', + ':paw_prints:', + ':bouquet:', + ':cherry_blossom:', + ':tulip:', + ':four_leaf_clover:', + ':rose:', + ':sunflower:', + ':hibiscus:', + ':maple_leaf:', + ':leaves:', + ':fallen_leaf:', + ':herb:', + ':mushroom:', + ':cactus:', + ':palm_tree:', + ':evergreen_tree:', + ':deciduous_tree:', + ':chestnut:', + ':seedling:', + ':blossom:', + ':ear_of_rice:', + ':shell:', + ':globe_with_meridians:', + ':sun_with_face:', + ':full_moon_with_face:', + ':new_moon_with_face:', + ':new_moon:', + ':waxing_crescent_moon:', + ':first_quarter_moon:', + ':waxing_gibbous_moon:', + ':full_moon:', + ':waning_gibbous_moon:', + ':last_quarter_moon:', + ':waning_crescent_moon:', + ':last_quarter_moon_with_face:', + ':first_quarter_moon_with_face:', + ':crescent_moon:', + ':earth_africa:', + ':earth_americas:', + ':earth_asia:', + ':volcano:', + ':milky_way:', + ':partly_sunny:', + ':octocat:', + ':squirrel:', + ':bamboo:', + ':gift_heart:', + ':dolls:', + ':school_satchel:', + ':mortar_board:', + ':flags:', + ':fireworks:', + ':sparkler:', + ':wind_chime:', + ':rice_scene:', + ':jack_o_lantern:', + ':ghost:', + ':santa:', + ':christmas_tree:', + ':gift:', + ':bell:', + ':no_bell:', + ':tanabata_tree:', + ':tada:', + ':confetti_ball:', + ':balloon:', + ':crystal_ball:', + ':cd:', + ':dvd:', + ':floppy_disk:', + ':camera:', + ':video_camera:', + ':movie_camera:', + ':computer:', + ':tv:', + ':iphone:', + ':phone:', + ':telephone:', + ':telephone_receiver:', + ':pager:', + ':fax:', + ':minidisc:', + ':vhs:', + ':sound:', + ':speaker:', + ':mute:', + ':loudspeaker:', + ':mega:', + ':hourglass:', + ':hourglass_flowing_sand:', + ':alarm_clock:', + ':watch:', + ':radio:', + ':satellite:', + ':loop:', + ':mag:', + ':mag_right:', + ':unlock:', + ':lock:', + ':lock_with_ink_pen:', + ':closed_lock_with_key:', + ':key:', + ':bulb:', + ':flashlight:', + ':high_brightness:', + ':low_brightness:', + ':electric_plug:', + ':battery:', + ':calling:', + ':email:', + ':mailbox:', + ':postbox:', + ':bath:', + ':bathtub:', + ':shower:', + ':toilet:', + ':wrench:', + ':nut_and_bolt:', + ':hammer:', + ':seat:', + ':moneybag:', + ':yen:', + ':dollar:', + ':pound:', + ':euro:', + ':credit_card:', + ':money_with_wings:', + ':e-mail:', + ':inbox_tray:', + ':outbox_tray:', + ':envelope:', + ':incoming_envelope:', + ':postal_horn:', + ':mailbox_closed:', + ':mailbox_with_mail:', + ':mailbox_with_no_mail:', + ':package:', + ':door:', + ':smoking:', + ':bomb:', + ':gun:', + ':hocho:', + ':pill:', + ':syringe:', + ':page_facing_up:', + ':page_with_curl:', + ':bookmark_tabs:', + ':bar_chart:', + ':chart_with_upwards_trend:', + ':chart_with_downwards_trend:', + ':scroll:', + ':clipboard:', + ':calendar:', + ':date:', + ':card_index:', + ':file_folder:', + ':open_file_folder:', + ':scissors:', + ':pushpin:', + ':paperclip:', + ':black_nib:', + ':pencil2:', + ':straight_ruler:', + ':triangular_ruler:', + ':closed_book:', + ':green_book:', + ':blue_book:', + ':orange_book:', + ':notebook:', + ':notebook_with_decorative_cover:', + ':ledger:', + ':books:', + ':bookmark:', + ':name_badge:', + ':microscope:', + ':telescope:', + ':newspaper:', + ':football:', + ':basketball:', + ':soccer:', + ':baseball:', + ':tennis:', + ':8ball:', + ':rugby_football:', + ':bowling:', + ':golf:', + ':mountain_bicyclist:', + ':bicyclist:', + ':horse_racing:', + ':snowboarder:', + ':swimmer:', + ':surfer:', + ':ski:', + ':spades:', + ':hearts:', + ':clubs:', + ':diamonds:', + ':gem:', + ':ring:', + ':trophy:', + ':musical_score:', + ':musical_keyboard:', + ':violin:', + ':space_invader:', + ':video_game:', + ':black_joker:', + ':flower_playing_cards:', + ':game_die:', + ':dart:', + ':mahjong:', + ':clapper:', + ':memo:', + ':pencil:', + ':book:', + ':art:', + ':microphone:', + ':headphones:', + ':trumpet:', + ':saxophone:', + ':guitar:', + ':shoe:', + ':sandal:', + ':high_heel:', + ':lipstick:', + ':boot:', + ':shirt:', + ':tshirt:', + ':necktie:', + ':womans_clothes:', + ':dress:', + ':running_shirt_with_sash:', + ':jeans:', + ':kimono:', + ':bikini:', + ':ribbon:', + ':tophat:', + ':crown:', + ':womans_hat:', + ':mans_shoe:', + ':closed_umbrella:', + ':briefcase:', + ':handbag:', + ':pouch:', + ':purse:', + ':eyeglasses:', + ':fishing_pole_and_fish:', + ':coffee:', + ':tea:', + ':sake:', + ':baby_bottle:', + ':beer:', + ':beers:', + ':cocktail:', + ':tropical_drink:', + ':wine_glass:', + ':fork_and_knife:', + ':pizza:', + ':hamburger:', + ':fries:', + ':poultry_leg:', + ':meat_on_bone:', + ':spaghetti:', + ':curry:', + ':fried_shrimp:', + ':bento:', + ':sushi:', + ':fish_cake:', + ':rice_ball:', + ':rice_cracker:', + ':rice:', + ':ramen:', + ':stew:', + ':oden:', + ':dango:', + ':egg:', + ':bread:', + ':doughnut:', + ':custard:', + ':icecream:', + ':ice_cream:', + ':shaved_ice:', + ':birthday:', + ':cake:', + ':cookie:', + ':chocolate_bar:', + ':candy:', + ':lollipop:', + ':honey_pot:', + ':apple:', + ':green_apple:', + ':tangerine:', + ':lemon:', + ':cherries:', + ':grapes:', + ':watermelon:', + ':strawberry:', + ':peach:', + ':melon:', + ':banana:', + ':pear:', + ':pineapple:', + ':sweet_potato:', + ':eggplant:', + ':tomato:', + ':corn:', + ':house:', + ':house_with_garden:', + ':school:', + ':office:', + ':post_office:', + ':hospital:', + ':bank:', + ':convenience_store:', + ':love_hotel:', + ':hotel:', + ':wedding:', + ':church:', + ':department_store:', + ':european_post_office:', + ':city_sunrise:', + ':city_sunset:', + ':japanese_castle:', + ':european_castle:', + ':tent:', + ':factory:', + ':tokyo_tower:', + ':japan:', + ':mount_fuji:', + ':sunrise_over_mountains:', + ':sunrise:', + ':stars:', + ':statue_of_liberty:', + ':bridge_at_night:', + ':carousel_horse:', + ':rainbow:', + ':ferris_wheel:', + ':fountain:', + ':roller_coaster:', + ':ship:', + ':speedboat:', + ':boat:', + ':sailboat:', + ':rowboat:', + ':anchor:', + ':rocket:', + ':airplane:', + ':helicopter:', + ':steam_locomotive:', + ':tram:', + ':mountain_railway:', + ':bike:', + ':aerial_tramway:', + ':suspension_railway:', + ':mountain_cableway:', + ':tractor:', + ':blue_car:', + ':oncoming_automobile:', + ':car:', + ':red_car:', + ':taxi:', + ':oncoming_taxi:', + ':articulated_lorry:', + ':bus:', + ':oncoming_bus:', + ':rotating_light:', + ':police_car:', + ':oncoming_police_car:', + ':fire_engine:', + ':ambulance:', + ':minibus:', + ':truck:', + ':train:', + ':station:', + ':train2:', + ':bullettrain_front:', + ':bullettrain_side:', + ':light_rail:', + ':monorail:', + ':railway_car:', + ':trolleybus:', + ':ticket:', + ':fuelpump:', + ':vertical_traffic_light:', + ':traffic_light:', + ':warning:', + ':construction:', + ':beginner:', + ':atm:', + ':slot_machine:', + ':busstop:', + ':barber:', + ':hotsprings:', + ':checkered_flag:', + ':crossed_flags:', + ':izakaya_lantern:', + ':moyai:', + ':circus_tent:', + ':performing_arts:', + ':round_pushpin:', + ':triangular_flag_on_post:', + ':jp:', + ':kr:', + ':cn:', + ':us:', + ':fr:', + ':es:', + ':it:', + ':ru:', + ':gb:', + ':uk:', + ':de:', + ':one:', + ':two:', + ':three:', + ':four:', + ':five:', + ':six:', + ':seven:', + ':eight:', + ':nine:', + ':keycap_ten:', + ':1234:', + ':zero:', + ':hash:', + ':symbols:', + ':arrow_backward:', + ':arrow_down:', + ':arrow_forward:', + ':arrow_left:', + ':capital_abcd:', + ':abcd:', + ':abc:', + ':arrow_lower_left:', + ':arrow_lower_right:', + ':arrow_right:', + ':arrow_up:', + ':arrow_upper_left:', + ':arrow_upper_right:', + ':arrow_double_down:', + ':arrow_double_up:', + ':arrow_down_small:', + ':arrow_heading_down:', + ':arrow_heading_up:', + ':leftwards_arrow_with_hook:', + ':arrow_right_hook:', + ':left_right_arrow:', + ':arrow_up_down:', + ':arrow_up_small:', + ':arrows_clockwise:', + ':arrows_counterclockwise:', + ':rewind:', + ':fast_forward:', + ':information_source:', + ':ok:', + ':twisted_rightwards_arrows:', + ':repeat:', + ':repeat_one:', + ':new:', + ':top:', + ':up:', + ':cool:', + ':free:', + ':ng:', + ':cinema:', + ':koko:', + ':signal_strength:', + ':u5272:', + ':u5408:', + ':u55b6:', + ':u6307:', + ':u6708:', + ':u6709:', + ':u6e80:', + ':u7121:', + ':u7533:', + ':u7a7a:', + ':u7981:', + ':sa:', + ':restroom:', + ':mens:', + ':womens:', + ':baby_symbol:', + ':no_smoking:', + ':parking:', + ':wheelchair:', + ':metro:', + ':baggage_claim:', + ':accept:', + ':wc:', + ':potable_water:', + ':put_litter_in_its_place:', + ':secret:', + ':congratulations:', + ':m:', + ':passport_control:', + ':left_luggage:', + ':customs:', + ':ideograph_advantage:', + ':cl:', + ':sos:', + ':id:', + ':no_entry_sign:', + ':underage:', + ':no_mobile_phones:', + ':do_not_litter:', + ':non-potable_water:', + ':no_bicycles:', + ':no_pedestrians:', + ':children_crossing:', + ':no_entry:', + ':eight_spoked_asterisk:', + ':sparkle:', + ':eight_pointed_black_star:', + ':heart_decoration:', + ':vs:', + ':vibration_mode:', + ':mobile_phone_off:', + ':chart:', + ':currency_exchange:', + ':aries:', + ':taurus:', + ':gemini:', + ':cancer:', + ':leo:', + ':virgo:', + ':libra:', + ':scorpius:', + ':sagittarius:', + ':capricorn:', + ':aquarius:', + ':pisces:', + ':ophiuchus:', + ':six_pointed_star:', + ':negative_squared_cross_mark:', + ':a:', + ':b:', + ':ab:', + ':o2:', + ':diamond_shape_with_a_dot_inside:', + ':recycle:', + ':end:', + ':back:', + ':on:', + ':soon:', + ':clock1:', + ':clock130:', + ':clock10:', + ':clock1030:', + ':clock11:', + ':clock1130:', + ':clock12:', + ':clock1230:', + ':clock2:', + ':clock230:', + ':clock3:', + ':clock330:', + ':clock4:', + ':clock430:', + ':clock5:', + ':clock530:', + ':clock6:', + ':clock630:', + ':clock7:', + ':clock730:', + ':clock8:', + ':clock830:', + ':clock9:', + ':clock930:', + ':heavy_dollar_sign:', + ':copyright:', + ':registered:', + ':tm:', + ':x:', + ':heavy_exclamation_mark:', + ':bangbang:', + ':interrobang:', + ':o:', + ':heavy_multiplication_x:', + ':heavy_plus_sign:', + ':heavy_minus_sign:', + ':heavy_division_sign:', + ':white_flower:', + ':100:', + ':heavy_check_mark:', + ':ballot_box_with_check:', + ':radio_button:', + ':link:', + ':curly_loop:', + ':wavy_dash:', + ':part_alternation_mark:', + ':trident:', + ':black_small_square:', + ':white_small_square:', + ':black_medium_small_square:', + ':white_medium_small_square:', + ':black_medium_square:', + ':white_medium_square:', + ':white_large_square:', + ':white_check_mark:', + ':black_square_button:', + ':white_square_button:', + ':black_circle:', + ':white_circle:', + ':red_circle:', + ':large_blue_circle:', + ':large_blue_diamond:', + ':large_orange_diamond:', + ':small_blue_diamond:', + ':small_orange_diamond:', + ':small_red_triangle:', + ':small_red_triangle_down:', + ':shipit:' + ] + }; + + // Add all emoji in a dropdown + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + emoji: 'Add an emoji' + }, + fr: { + emoji: 'Ajouter un emoji' + }, + zh_cn: { + emoji: '添加表情' + }, + ru: { + emoji: 'Вставить emoji' + }, + ja: { + emoji: '絵文字の挿入' + }, + tr: { + emoji: 'Emoji ekle' + } + }, + // jshint camelcase:true + plugins: { + emoji: { + init: function (trumbowyg) { + trumbowyg.o.plugins.emoji = trumbowyg.o.plugins.emoji || defaultOptions; + var emojiBtnDef = { + dropdown: buildDropdown(trumbowyg) + }; + trumbowyg.addBtnDef('emoji', emojiBtnDef); + } + } + } + }); + + function buildDropdown(trumbowyg) { + var dropdown = []; + + $.each(trumbowyg.o.plugins.emoji.emojiList, function (i, emoji) { + if ($.isArray(emoji)) { // Custom emoji behaviour + var emojiCode = emoji[0], + emojiUrl = emoji[1], + emojiHtml = '' + emojiCode + '', + customEmojiBtnName = 'emoji-' + emojiCode.replace(/:/g, ''), + customEmojiBtnDef = { + hasIcon: false, + text: emojiHtml, + fn: function () { + trumbowyg.execCmd('insertImage', emojiUrl, false, true); + return true; + } + }; + + trumbowyg.addBtnDef(customEmojiBtnName, customEmojiBtnDef); + dropdown.push(customEmojiBtnName); + } else { // Default behaviour + var btn = emoji.replace(/:/g, ''), + defaultEmojiBtnName = 'emoji-' + btn, + defaultEmojiBtnDef = { + text: emoji, + fn: function () { + trumbowyg.execCmd('insertText', emoji); + return true; + } + }; + + trumbowyg.addBtnDef(defaultEmojiBtnName, defaultEmojiBtnDef); + dropdown.push(defaultEmojiBtnName); + } + }); + + return dropdown; + } +})(jQuery); diff --git a/e_lib/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js b/e_lib/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js new file mode 100644 index 00000000..c463f693 --- /dev/null +++ b/e_lib/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js @@ -0,0 +1 @@ +!function(e){"use strict";function a(a){var o=[];return e.each(a.o.plugins.emoji.emojiList,function(r,i){if(e.isArray(i)){var n=i[0],t=i[1],_=''+n+'',s="emoji-"+n.replace(/:/g,""),l={hasIcon:!1,text:_,fn:function(){return a.execCmd("insertImage",t,!1,!0),!0}};a.addBtnDef(s,l),o.push(s)}else{var c=i.replace(/:/g,""),u="emoji-"+c,h={text:i,fn:function(){return a.execCmd("insertText",i),!0}};a.addBtnDef(u,h),o.push(u)}}),o}var o={emojiList:[":bowtie:",":smile:",":laughing:",":blush:",":smiley:",":relaxed:",":smirk:",":heart_eyes:",":kissing_heart:",":kissing_closed_eyes:",":flushed:",":relieved:",":satisfied:",":grin:",":wink:",":stuck_out_tongue_winking_eye:",":stuck_out_tongue_closed_eyes:",":grinning:",":kissing:",":kissing_smiling_eyes:",":stuck_out_tongue:",":sleeping:",":worried:",":frowning:",":anguished:",":open_mouth:",":grimacing:",":confused:",":hushed:",":expressionless:",":unamused:",":sweat_smile:",":sweat:",":disappointed_relieved:",":weary:",":pensive:",":disappointed:",":confounded:",":fearful:",":cold_sweat:",":persevere:",":cry:",":sob:",":joy:",":astonished:",":scream:",":neckbeard:",":tired_face:",":angry:",":rage:",":triumph:",":sleepy:",":yum:",":mask:",":sunglasses:",":dizzy_face:",":imp:",":smiling_imp:",":neutral_face:",":no_mouth:",":innocent:",":alien:",":yellow_heart:",":blue_heart:",":purple_heart:",":heart:",":green_heart:",":broken_heart:",":heartbeat:",":heartpulse:",":two_hearts:",":revolving_hearts:",":cupid:",":sparkling_heart:",":sparkles:",":star:",":star2:",":dizzy:",":boom:",":collision:",":anger:",":exclamation:",":question:",":grey_exclamation:",":grey_question:",":zzz:",":dash:",":sweat_drops:",":notes:",":musical_note:",":fire:",":hankey:",":poop:",":shit:",":+1:",":thumbsup:",":-1:",":thumbsdown:",":ok_hand:",":punch:",":facepunch:",":fist:",":v:",":wave:",":hand:",":raised_hand:",":open_hands:",":point_up:",":point_down:",":point_left:",":point_right:",":raised_hands:",":pray:",":point_up_2:",":clap:",":muscle:",":metal:",":fu:",":runner:",":running:",":couple:",":family:",":two_men_holding_hands:",":two_women_holding_hands:",":dancer:",":dancers:",":ok_woman:",":no_good:",":information_desk_person:",":raising_hand:",":bride_with_veil:",":person_with_pouting_face:",":person_frowning:",":bow:",":couplekiss:",":couple_with_heart:",":massage:",":haircut:",":nail_care:",":boy:",":girl:",":woman:",":man:",":baby:",":older_woman:",":older_man:",":person_with_blond_hair:",":man_with_gua_pi_mao:",":man_with_turban:",":construction_worker:",":cop:",":angel:",":princess:",":smiley_cat:",":smile_cat:",":heart_eyes_cat:",":kissing_cat:",":smirk_cat:",":scream_cat:",":crying_cat_face:",":joy_cat:",":pouting_cat:",":japanese_ogre:",":japanese_goblin:",":see_no_evil:",":hear_no_evil:",":speak_no_evil:",":guardsman:",":skull:",":feet:",":lips:",":kiss:",":droplet:",":ear:",":eyes:",":nose:",":tongue:",":love_letter:",":bust_in_silhouette:",":busts_in_silhouette:",":speech_balloon:",":thought_balloon:",":feelsgood:",":finnadie:",":goberserk:",":godmode:",":hurtrealbad:",":rage1:",":rage2:",":rage3:",":rage4:",":suspect:",":trollface:",":sunny:",":umbrella:",":cloud:",":snowflake:",":snowman:",":zap:",":cyclone:",":foggy:",":ocean:",":cat:",":dog:",":mouse:",":hamster:",":rabbit:",":wolf:",":frog:",":tiger:",":koala:",":bear:",":pig:",":pig_nose:",":cow:",":boar:",":monkey_face:",":monkey:",":horse:",":racehorse:",":camel:",":sheep:",":elephant:",":panda_face:",":snake:",":bird:",":baby_chick:",":hatched_chick:",":hatching_chick:",":chicken:",":penguin:",":turtle:",":bug:",":honeybee:",":ant:",":beetle:",":snail:",":octopus:",":tropical_fish:",":fish:",":whale:",":whale2:",":dolphin:",":cow2:",":ram:",":rat:",":water_buffalo:",":tiger2:",":rabbit2:",":dragon:",":goat:",":rooster:",":dog2:",":pig2:",":mouse2:",":ox:",":dragon_face:",":blowfish:",":crocodile:",":dromedary_camel:",":leopard:",":cat2:",":poodle:",":paw_prints:",":bouquet:",":cherry_blossom:",":tulip:",":four_leaf_clover:",":rose:",":sunflower:",":hibiscus:",":maple_leaf:",":leaves:",":fallen_leaf:",":herb:",":mushroom:",":cactus:",":palm_tree:",":evergreen_tree:",":deciduous_tree:",":chestnut:",":seedling:",":blossom:",":ear_of_rice:",":shell:",":globe_with_meridians:",":sun_with_face:",":full_moon_with_face:",":new_moon_with_face:",":new_moon:",":waxing_crescent_moon:",":first_quarter_moon:",":waxing_gibbous_moon:",":full_moon:",":waning_gibbous_moon:",":last_quarter_moon:",":waning_crescent_moon:",":last_quarter_moon_with_face:",":first_quarter_moon_with_face:",":crescent_moon:",":earth_africa:",":earth_americas:",":earth_asia:",":volcano:",":milky_way:",":partly_sunny:",":octocat:",":squirrel:",":bamboo:",":gift_heart:",":dolls:",":school_satchel:",":mortar_board:",":flags:",":fireworks:",":sparkler:",":wind_chime:",":rice_scene:",":jack_o_lantern:",":ghost:",":santa:",":christmas_tree:",":gift:",":bell:",":no_bell:",":tanabata_tree:",":tada:",":confetti_ball:",":balloon:",":crystal_ball:",":cd:",":dvd:",":floppy_disk:",":camera:",":video_camera:",":movie_camera:",":computer:",":tv:",":iphone:",":phone:",":telephone:",":telephone_receiver:",":pager:",":fax:",":minidisc:",":vhs:",":sound:",":speaker:",":mute:",":loudspeaker:",":mega:",":hourglass:",":hourglass_flowing_sand:",":alarm_clock:",":watch:",":radio:",":satellite:",":loop:",":mag:",":mag_right:",":unlock:",":lock:",":lock_with_ink_pen:",":closed_lock_with_key:",":key:",":bulb:",":flashlight:",":high_brightness:",":low_brightness:",":electric_plug:",":battery:",":calling:",":email:",":mailbox:",":postbox:",":bath:",":bathtub:",":shower:",":toilet:",":wrench:",":nut_and_bolt:",":hammer:",":seat:",":moneybag:",":yen:",":dollar:",":pound:",":euro:",":credit_card:",":money_with_wings:",":e-mail:",":inbox_tray:",":outbox_tray:",":envelope:",":incoming_envelope:",":postal_horn:",":mailbox_closed:",":mailbox_with_mail:",":mailbox_with_no_mail:",":package:",":door:",":smoking:",":bomb:",":gun:",":hocho:",":pill:",":syringe:",":page_facing_up:",":page_with_curl:",":bookmark_tabs:",":bar_chart:",":chart_with_upwards_trend:",":chart_with_downwards_trend:",":scroll:",":clipboard:",":calendar:",":date:",":card_index:",":file_folder:",":open_file_folder:",":scissors:",":pushpin:",":paperclip:",":black_nib:",":pencil2:",":straight_ruler:",":triangular_ruler:",":closed_book:",":green_book:",":blue_book:",":orange_book:",":notebook:",":notebook_with_decorative_cover:",":ledger:",":books:",":bookmark:",":name_badge:",":microscope:",":telescope:",":newspaper:",":football:",":basketball:",":soccer:",":baseball:",":tennis:",":8ball:",":rugby_football:",":bowling:",":golf:",":mountain_bicyclist:",":bicyclist:",":horse_racing:",":snowboarder:",":swimmer:",":surfer:",":ski:",":spades:",":hearts:",":clubs:",":diamonds:",":gem:",":ring:",":trophy:",":musical_score:",":musical_keyboard:",":violin:",":space_invader:",":video_game:",":black_joker:",":flower_playing_cards:",":game_die:",":dart:",":mahjong:",":clapper:",":memo:",":pencil:",":book:",":art:",":microphone:",":headphones:",":trumpet:",":saxophone:",":guitar:",":shoe:",":sandal:",":high_heel:",":lipstick:",":boot:",":shirt:",":tshirt:",":necktie:",":womans_clothes:",":dress:",":running_shirt_with_sash:",":jeans:",":kimono:",":bikini:",":ribbon:",":tophat:",":crown:",":womans_hat:",":mans_shoe:",":closed_umbrella:",":briefcase:",":handbag:",":pouch:",":purse:",":eyeglasses:",":fishing_pole_and_fish:",":coffee:",":tea:",":sake:",":baby_bottle:",":beer:",":beers:",":cocktail:",":tropical_drink:",":wine_glass:",":fork_and_knife:",":pizza:",":hamburger:",":fries:",":poultry_leg:",":meat_on_bone:",":spaghetti:",":curry:",":fried_shrimp:",":bento:",":sushi:",":fish_cake:",":rice_ball:",":rice_cracker:",":rice:",":ramen:",":stew:",":oden:",":dango:",":egg:",":bread:",":doughnut:",":custard:",":icecream:",":ice_cream:",":shaved_ice:",":birthday:",":cake:",":cookie:",":chocolate_bar:",":candy:",":lollipop:",":honey_pot:",":apple:",":green_apple:",":tangerine:",":lemon:",":cherries:",":grapes:",":watermelon:",":strawberry:",":peach:",":melon:",":banana:",":pear:",":pineapple:",":sweet_potato:",":eggplant:",":tomato:",":corn:",":house:",":house_with_garden:",":school:",":office:",":post_office:",":hospital:",":bank:",":convenience_store:",":love_hotel:",":hotel:",":wedding:",":church:",":department_store:",":european_post_office:",":city_sunrise:",":city_sunset:",":japanese_castle:",":european_castle:",":tent:",":factory:",":tokyo_tower:",":japan:",":mount_fuji:",":sunrise_over_mountains:",":sunrise:",":stars:",":statue_of_liberty:",":bridge_at_night:",":carousel_horse:",":rainbow:",":ferris_wheel:",":fountain:",":roller_coaster:",":ship:",":speedboat:",":boat:",":sailboat:",":rowboat:",":anchor:",":rocket:",":airplane:",":helicopter:",":steam_locomotive:",":tram:",":mountain_railway:",":bike:",":aerial_tramway:",":suspension_railway:",":mountain_cableway:",":tractor:",":blue_car:",":oncoming_automobile:",":car:",":red_car:",":taxi:",":oncoming_taxi:",":articulated_lorry:",":bus:",":oncoming_bus:",":rotating_light:",":police_car:",":oncoming_police_car:",":fire_engine:",":ambulance:",":minibus:",":truck:",":train:",":station:",":train2:",":bullettrain_front:",":bullettrain_side:",":light_rail:",":monorail:",":railway_car:",":trolleybus:",":ticket:",":fuelpump:",":vertical_traffic_light:",":traffic_light:",":warning:",":construction:",":beginner:",":atm:",":slot_machine:",":busstop:",":barber:",":hotsprings:",":checkered_flag:",":crossed_flags:",":izakaya_lantern:",":moyai:",":circus_tent:",":performing_arts:",":round_pushpin:",":triangular_flag_on_post:",":jp:",":kr:",":cn:",":us:",":fr:",":es:",":it:",":ru:",":gb:",":uk:",":de:",":one:",":two:",":three:",":four:",":five:",":six:",":seven:",":eight:",":nine:",":keycap_ten:",":1234:",":zero:",":hash:",":symbols:",":arrow_backward:",":arrow_down:",":arrow_forward:",":arrow_left:",":capital_abcd:",":abcd:",":abc:",":arrow_lower_left:",":arrow_lower_right:",":arrow_right:",":arrow_up:",":arrow_upper_left:",":arrow_upper_right:",":arrow_double_down:",":arrow_double_up:",":arrow_down_small:",":arrow_heading_down:",":arrow_heading_up:",":leftwards_arrow_with_hook:",":arrow_right_hook:",":left_right_arrow:",":arrow_up_down:",":arrow_up_small:",":arrows_clockwise:",":arrows_counterclockwise:",":rewind:",":fast_forward:",":information_source:",":ok:",":twisted_rightwards_arrows:",":repeat:",":repeat_one:",":new:",":top:",":up:",":cool:",":free:",":ng:",":cinema:",":koko:",":signal_strength:",":u5272:",":u5408:",":u55b6:",":u6307:",":u6708:",":u6709:",":u6e80:",":u7121:",":u7533:",":u7a7a:",":u7981:",":sa:",":restroom:",":mens:",":womens:",":baby_symbol:",":no_smoking:",":parking:",":wheelchair:",":metro:",":baggage_claim:",":accept:",":wc:",":potable_water:",":put_litter_in_its_place:",":secret:",":congratulations:",":m:",":passport_control:",":left_luggage:",":customs:",":ideograph_advantage:",":cl:",":sos:",":id:",":no_entry_sign:",":underage:",":no_mobile_phones:",":do_not_litter:",":non-potable_water:",":no_bicycles:",":no_pedestrians:",":children_crossing:",":no_entry:",":eight_spoked_asterisk:",":sparkle:",":eight_pointed_black_star:",":heart_decoration:",":vs:",":vibration_mode:",":mobile_phone_off:",":chart:",":currency_exchange:",":aries:",":taurus:",":gemini:",":cancer:",":leo:",":virgo:",":libra:",":scorpius:",":sagittarius:",":capricorn:",":aquarius:",":pisces:",":ophiuchus:",":six_pointed_star:",":negative_squared_cross_mark:",":a:",":b:",":ab:",":o2:",":diamond_shape_with_a_dot_inside:",":recycle:",":end:",":back:",":on:",":soon:",":clock1:",":clock130:",":clock10:",":clock1030:",":clock11:",":clock1130:",":clock12:",":clock1230:",":clock2:",":clock230:",":clock3:",":clock330:",":clock4:",":clock430:",":clock5:",":clock530:",":clock6:",":clock630:",":clock7:",":clock730:",":clock8:",":clock830:",":clock9:",":clock930:",":heavy_dollar_sign:",":copyright:",":registered:",":tm:",":x:",":heavy_exclamation_mark:",":bangbang:",":interrobang:",":o:",":heavy_multiplication_x:",":heavy_plus_sign:",":heavy_minus_sign:",":heavy_division_sign:",":white_flower:",":100:",":heavy_check_mark:",":ballot_box_with_check:",":radio_button:",":link:",":curly_loop:",":wavy_dash:",":part_alternation_mark:",":trident:",":black_small_square:",":white_small_square:",":black_medium_small_square:",":white_medium_small_square:",":black_medium_square:",":white_medium_square:",":white_large_square:",":white_check_mark:",":black_square_button:",":white_square_button:",":black_circle:",":white_circle:",":red_circle:",":large_blue_circle:",":large_blue_diamond:",":large_orange_diamond:",":small_blue_diamond:",":small_orange_diamond:",":small_red_triangle:",":small_red_triangle_down:",":shipit:"]};e.extend(!0,e.trumbowyg,{langs:{en:{emoji:"Add an emoji"},fr:{emoji:"Ajouter un emoji"},zh_cn:{emoji:"添加表情"},ru:{emoji:"Вставить emoji"},ja:{emoji:"絵文字の挿入"},tr:{emoji:"Emoji ekle"}},plugins:{emoji:{init:function(e){e.o.plugins.emoji=e.o.plugins.emoji||o;var r={dropdown:a(e)};e.addBtnDef("emoji",r)}}}})}(jQuery); \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss b/e_lib/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss new file mode 100644 index 00000000..8c6006a5 --- /dev/null +++ b/e_lib/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss @@ -0,0 +1,56 @@ +/** + * 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-dropdown-emoji { + width: 265px; + padding: 7px 0 7px 5px; + height: 200px; + overflow-y: scroll; + overflow-x: hidden; +} + +.trumbowyg-dropdown-emoji svg { + display: none !important; +} + +.trumbowyg-dropdown-emoji button { + display: block; + position: relative; + float: left; + height: 26px; + width: 26px; + padding: 0; + margin: 2px; + line-height: 24px; + text-align: center; + + &:hover, + &:focus { + &::after { + display: block; + position: absolute; + top: -5px; + left: -5px; + height: 27px; + width: 27px; + background: inherit; + box-shadow: #000 0 0 2px; + z-index: 10; + background-color: transparent; + } + } +} + +.trumbowyg .emoji { + width: 22px; + height: 22px; + display: inline-block; +} diff --git a/e_lib/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css b/e_lib/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css new file mode 100644 index 00000000..39571269 --- /dev/null +++ b/e_lib/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css @@ -0,0 +1,47 @@ +/** + * 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-dropdown-emoji { + width: 265px; + padding: 7px 0 7px 5px; + height: 200px; + overflow-y: scroll; + overflow-x: hidden; } + +.trumbowyg-dropdown-emoji svg { + display: none !important; } + +.trumbowyg-dropdown-emoji button { + display: block; + position: relative; + float: left; + height: 26px; + width: 26px; + padding: 0; + margin: 2px; + line-height: 24px; + text-align: center; } + .trumbowyg-dropdown-emoji button:hover::after, .trumbowyg-dropdown-emoji button:focus::after { + display: block; + position: absolute; + top: -5px; + left: -5px; + height: 27px; + width: 27px; + background: inherit; + box-shadow: #000 0 0 2px; + z-index: 10; + background-color: transparent; } + +.trumbowyg .emoji { + width: 22px; + height: 22px; + display: inline-block; } diff --git a/e_lib/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css b/e_lib/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css new file mode 100644 index 00000000..e1dcb1aa --- /dev/null +++ b/e_lib/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css @@ -0,0 +1,2 @@ +/** Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +.trumbowyg-dropdown-emoji{width:265px;padding:7px 0 7px 5px;height:200px;overflow-y:scroll;overflow-x:hidden}.trumbowyg-dropdown-emoji svg{display:none!important}.trumbowyg-dropdown-emoji button{display:block;position:relative;float:left;height:26px;width:26px;padding:0;margin:2px;line-height:24px;text-align:center}.trumbowyg-dropdown-emoji button:focus::after,.trumbowyg-dropdown-emoji button:hover::after{display:block;position:absolute;top:-5px;left:-5px;height:27px;width:27px;background:inherit;box-shadow:#000 0 0 2px;z-index:10;background-color:transparent}.trumbowyg .emoji{width:22px;height:22px;display:inline-block} \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.js b/e_lib/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.js new file mode 100644 index 00000000..c09ccf29 --- /dev/null +++ b/e_lib/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.js @@ -0,0 +1,73 @@ +(function ($) { + 'use strict'; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + fontFamily: 'Font' + }, + fr: { + fontFamily: 'Police' + }, + nl: { + fontFamily: 'Lettertype' + }, + tr: { + fontFamily: 'Yazı Tipi' + } + } + }); + // jshint camelcase:true + + var defaultOptions = { + fontList: [ + {name: 'Arial', family: 'Arial, Helvetica, sans-serif'}, + {name: 'Arial Black', family: '\'Arial Black\', Gadget, sans-serif'}, + {name: 'Comic Sans', family: '\'Comic Sans MS\', Textile, cursive, sans-serif'}, + {name: 'Courier New', family: '\'Courier New\', Courier, monospace'}, + {name: 'Georgia', family: 'Georgia, serif'}, + {name: 'Impact', family: 'Impact, Charcoal, sans-serif'}, + {name: 'Lucida Console', family: '\'Lucida Console\', Monaco, monospace'}, + {name: 'Lucida Sans', family: '\'Lucida Sans Uncide\', \'Lucida Grande\', sans-serif'}, + {name: 'Palatino', family: '\'Palatino Linotype\', \'Book Antiqua\', Palatino, serif'}, + {name: 'Tahoma', family: 'Tahoma, Geneva, sans-serif'}, + {name: 'Times New Roman', family: '\'Times New Roman\', Times, serif'}, + {name: 'Trebuchet', family: '\'Trebuchet MS\', Helvetica, sans-serif'}, + {name: 'Verdana', family: 'Verdana, Geneva, sans-serif'} + ] + }; + + // Add dropdown with web safe fonts + $.extend(true, $.trumbowyg, { + plugins: { + fontfamily: { + init: function (trumbowyg) { + trumbowyg.o.plugins.fontfamily = trumbowyg.o.plugins.fontfamily || defaultOptions; + trumbowyg.addBtnDef('fontfamily', { + dropdown: buildDropdown(trumbowyg), + hasIcon: false, + text: trumbowyg.lang.fontFamily + }); + } + } + } + }); + + function buildDropdown(trumbowyg) { + var dropdown = []; + + $.each(trumbowyg.o.plugins.fontfamily.fontList, function (index, font) { + trumbowyg.addBtnDef('fontfamily_' + index, { + title: '' + font.name + '', + hasIcon: false, + fn: function () { + trumbowyg.execCmd('fontName', font.family, true); + } + }); + dropdown.push('fontfamily_' + index); + }); + + return dropdown; + } +})(jQuery); diff --git a/e_lib/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.min.js b/e_lib/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.min.js new file mode 100644 index 00000000..23c0cf6e --- /dev/null +++ b/e_lib/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.min.js @@ -0,0 +1 @@ +!function(a){"use strict";function n(n){var i=[];return a.each(n.o.plugins.fontfamily.fontList,function(a,e){n.addBtnDef("fontfamily_"+a,{title:''+e.name+"",hasIcon:!1,fn:function(){n.execCmd("fontName",e.family,!0)}}),i.push("fontfamily_"+a)}),i}a.extend(!0,a.trumbowyg,{langs:{en:{fontFamily:"Font"},fr:{fontFamily:"Police"},nl:{fontFamily:"Lettertype"},tr:{fontFamily:"Yazı Tipi"}}});var i={fontList:[{name:"Arial",family:"Arial, Helvetica, sans-serif"},{name:"Arial Black",family:"'Arial Black', Gadget, sans-serif"},{name:"Comic Sans",family:"'Comic Sans MS', Textile, cursive, sans-serif"},{name:"Courier New",family:"'Courier New', Courier, monospace"},{name:"Georgia",family:"Georgia, serif"},{name:"Impact",family:"Impact, Charcoal, sans-serif"},{name:"Lucida Console",family:"'Lucida Console', Monaco, monospace"},{name:"Lucida Sans",family:"'Lucida Sans Uncide', 'Lucida Grande', sans-serif"},{name:"Palatino",family:"'Palatino Linotype', 'Book Antiqua', Palatino, serif"},{name:"Tahoma",family:"Tahoma, Geneva, sans-serif"},{name:"Times New Roman",family:"'Times New Roman', Times, serif"},{name:"Trebuchet",family:"'Trebuchet MS', Helvetica, sans-serif"},{name:"Verdana",family:"Verdana, Geneva, sans-serif"}]};a.extend(!0,a.trumbowyg,{plugins:{fontfamily:{init:function(a){a.o.plugins.fontfamily=a.o.plugins.fontfamily||i,a.addBtnDef("fontfamily",{dropdown:n(a),hasIcon:!1,text:a.lang.fontFamily})}}}})}(jQuery); \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/fontsize/trumbowyg.fontsize.js b/e_lib/trumbowyg/plugins/fontsize/trumbowyg.fontsize.js new file mode 100644 index 00000000..ae5ea3b8 --- /dev/null +++ b/e_lib/trumbowyg/plugins/fontsize/trumbowyg.fontsize.js @@ -0,0 +1,117 @@ +(function ($) { + 'use strict'; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + fontsize: 'Font size', + fontsizes: { + 'x-small': 'Extra small', + 'small': 'Small', + 'medium': 'Regular', + 'large': 'Large', + 'x-large': 'Extra large', + 'custom': 'Custom' + } + }, + fr: { + fontsize: 'Taille de la police', + fontsizes: { + 'x-small': 'Très petit', + 'small': 'Petit', + 'medium': 'Normal', + 'large': 'Grand', + 'x-large': 'Très grand', + 'custom': 'Douane' + } + }, + nl: { + fontsize: 'Lettergrootte', + fontsizes: { + 'x-small': 'Extra klein', + 'small': 'Klein', + 'medium': 'Normaal', + 'large': 'Groot', + 'x-large': 'Extra groot', + 'custom': 'Tilpasset' + } + }, + tr: { + fontsize: 'Yazı Boyutu', + fontsizes: { + 'x-small': 'Çok Küçük', + 'small': 'Küçük', + 'medium': 'Normal', + 'large': 'Büyük', + 'x-large': 'Çok Büyük', + 'custom': 'Görenek' + } + } + } + }); + // 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 = ['x-small', 'small', 'medium', 'large', 'x-large']; + + $.each(sizes, function (index, size) { + trumbowyg.addBtnDef('fontsize_' + size, { + text: '' + trumbowyg.lang.fontsizes[size] + '', + hasIcon: false, + fn: function () { + trumbowyg.execCmd('fontSize', index + 1, 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(); + 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/plugins/fontsize/trumbowyg.fontsize.min.js b/e_lib/trumbowyg/plugins/fontsize/trumbowyg.fontsize.min.js new file mode 100644 index 00000000..475a8051 --- /dev/null +++ b/e_lib/trumbowyg/plugins/fontsize/trumbowyg.fontsize.min.js @@ -0,0 +1 @@ +!function(e){"use strict";function t(t){var n=[],s=["x-small","small","medium","large","x-large"];e.each(s,function(e,s){t.addBtnDef("fontsize_"+s,{text:''+t.lang.fontsizes[s]+"",hasIcon:!1,fn:function(){t.execCmd("fontSize",e+1,!0)}}),n.push("fontsize_"+s)});var a="fontsize_custom",o={fn:function(){t.openModalInsert("Custom Font Size",{size:{label:"Font Size",value:"48px"}},function(n){var s=t.range.startContainer.parentElement,a=t.getRangeText();if(e(s).html()===a)e(s).css("font-size",n.size);else{t.range.deleteContents();var o=''+a+"",l=e(o)[0];t.range.insertNode(l)}return t.saveRange(),!0})},text:''+t.lang.fontsizes.custom+"",hasIcon:!1};return t.addBtnDef(a,o),n.push(a),n}e.extend(!0,e.trumbowyg,{langs:{en:{fontsize:"Font size",fontsizes:{"x-small":"Extra small",small:"Small",medium:"Regular",large:"Large","x-large":"Extra large",custom:"Custom"}},fr:{fontsize:"Taille de la police",fontsizes:{"x-small":"Très petit",small:"Petit",medium:"Normal",large:"Grand","x-large":"Très grand",custom:"Douane"}},nl:{fontsize:"Lettergrootte",fontsizes:{"x-small":"Extra klein",small:"Klein",medium:"Normaal",large:"Groot","x-large":"Extra groot",custom:"Tilpasset"}},tr:{fontsize:"Yazı Boyutu",fontsizes:{"x-small":"Çok Küçük",small:"Küçük",medium:"Normal",large:"Büyük","x-large":"Çok Büyük",custom:"Görenek"}}}}),e.extend(!0,e.trumbowyg,{plugins:{fontsize:{init:function(e){e.addBtnDef("fontsize",{dropdown:t(e)})}}}})}(jQuery); \ No newline at end of file diff --git a/e_lib/trumbowyg/plugins/highlight/trumbowyg.highlight.js b/e_lib/trumbowyg/plugins/highlight/trumbowyg.highlight.js new file mode 100644 index 00000000..54c077fb --- /dev/null +++ b/e_lib/trumbowyg/plugins/highlight/trumbowyg.highlight.js @@ -0,0 +1,82 @@ +/* globals Prism */ +(function ($, Prism) { + 'use strict'; + + // My plugin default options + var defaultOptions = {}; + + function highlightIt(text, language) { + return [ + '
',
+            '' + Prism.highlight(text, Prism.languages[language]) + '',
+            '
', + ].join(''); + } + + // If my plugin is a button + function buildButtonDef(trumbowyg) { + return { + fn: function () { + var $modal = trumbowyg.openModal('Code', [ + '
', + ' ', + '
', + '
', + ' ', + '
', + ].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 new file mode 100644 index 00000000..feca0eef --- /dev/null +++ b/e_lib/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js @@ -0,0 +1 @@ +!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 new file mode 100644 index 00000000..05dfb4a6 --- /dev/null +++ b/e_lib/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss @@ -0,0 +1,25 @@ +/** + * 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 new file mode 100644 index 00000000..6cb61516 --- /dev/null +++ b/e_lib/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css @@ -0,0 +1,20 @@ +/** + * 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 new file mode 100644 index 00000000..89fcd3df --- /dev/null +++ b/e_lib/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css @@ -0,0 +1,2 @@ +/** 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 new file mode 100644 index 00000000..46f356f3 --- /dev/null +++ b/e_lib/trumbowyg/plugins/history/trumbowyg.history.js @@ -0,0 +1,190 @@ +/*/* =========================================================== + * 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 new file mode 100644 index 00000000..7d37a1d3 --- /dev/null +++ b/e_lib/trumbowyg/plugins/history/trumbowyg.history.min.js @@ -0,0 +1 @@ +!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 new file mode 100644 index 00000000..74bc31cd --- /dev/null +++ b/e_lib/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js @@ -0,0 +1,89 @@ +/*/* =========================================================== + * 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 = '