gui 에디터 추가

This commit is contained in:
2018-08-30 01:25:45 +09:00
parent 9e677f3871
commit accc083702
74 changed files with 7344 additions and 8 deletions
@@ -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);
@@ -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);
@@ -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);
File diff suppressed because one or more lines are too long
@@ -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(/<b(\s+|>)/g, '<strong$1');
// Replace closing bold tags with closing strong
html = html.replace(/<\/b(\s+|>)/g, '</strong$1');
// Replace italic tags with em
html = html.replace(/<i(\s+|>)/g, '<em$1');
// Replace closing italic tags with closing em
html = html.replace(/<\/i(\s+|>)/g, '</em$1');
// strip out comments -cgCraft
html = html.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g, '');
// strip out &nbsp; -cgCraft
html = html.replace(/&nbsp;/gi, ' ');
// strip out extra spaces -cgCraft
html = html.replace(/ <\//gi, '</');
while (html.indexOf(' ') !== -1) {
html = html.split(' ').join(' ');
}
// strip &nbsp; -cgCraft
html = html.replace(/^\s*|\s*$/g, '');
// Strip out unaccepted attributes
html = html.replace(/<[^>]*>/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);
@@ -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(/<b(\s+|>)/g,"<strong$1"),e=e.replace(/<\/b(\s+|>)/g,"</strong$1"),e=e.replace(/<i(\s+|>)/g,"<em$1"),e=e.replace(/<\/i(\s+|>)/g,"</em$1"),e=e.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g,""),e=e.replace(/&nbsp;/gi," "),e=e.replace(/ <\//gi,"</");e.indexOf(" ")!==-1;)e=e.split(" ").join(" ");return e=e.replace(/^\s*|\s*$/g,""),e=e.replace(/<[^>]*>/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);
@@ -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);
File diff suppressed because one or more lines are too long
@@ -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;
}
}
}
}
@@ -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; }
@@ -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}
@@ -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 = '<img src="' + emojiUrl + '" alt="' + 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);
File diff suppressed because one or more lines are too long
@@ -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;
}
@@ -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; }
@@ -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}
@@ -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: '<span style="font-family: ' + font.family + ';">' + font.name + '</span>',
hasIcon: false,
fn: function () {
trumbowyg.execCmd('fontName', font.family, true);
}
});
dropdown.push('fontfamily_' + index);
});
return dropdown;
}
})(jQuery);
@@ -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:'<span style="font-family: '+e.family+';">'+e.name+"</span>",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);
@@ -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: '<span style="font-size: ' + size + ';">' + trumbowyg.lang.fontsizes[size] + '</span>',
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 = '<span style="font-size: ' + values.size + ';">' + selectedText + '</span>';
var node = $(html)[0];
trumbowyg.range.insertNode(node);
}
trumbowyg.saveRange();
return true;
}
);
},
text: '<span style="font-size: medium;">' + trumbowyg.lang.fontsizes.custom + '</span>',
hasIcon: false
};
trumbowyg.addBtnDef(freeSizeButtonName, freeSizeBtnDef);
dropdown.push(freeSizeButtonName);
return dropdown;
}
})(jQuery);
File diff suppressed because one or more lines are too long
@@ -0,0 +1,82 @@
/* globals Prism */
(function ($, Prism) {
'use strict';
// My plugin default options
var defaultOptions = {};
function highlightIt(text, language) {
return [
'<pre class="language-' + language + '">',
'<code class="language-' + language + '">' + Prism.highlight(text, Prism.languages[language]) + '</code>',
'</pre>',
].join('');
}
// If my plugin is a button
function buildButtonDef(trumbowyg) {
return {
fn: function () {
var $modal = trumbowyg.openModal('Code', [
'<div class="' + trumbowyg.o.prefix + 'highlight-form-group">',
' <select class="' + trumbowyg.o.prefix + 'highlight-form-control language">',
(function () {
var options = '';
for (var lang in Prism.languages) {
if (Prism.languages[lang].comment) {
options += '<option value="' + lang + '">' + lang + '</option>';
}
}
return options;
})(),
' </select>',
'</div>',
'<div class="' + trumbowyg.o.prefix + 'highlight-form-group">',
' <textarea class="' + trumbowyg.o.prefix + 'highlight-form-control code"></textarea>',
'</div>',
].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', '<p><br></p>');
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);
@@ -0,0 +1 @@
!function(n,i){"use strict";function e(n,e){return['<pre class="language-'+e+'">','<code class="language-'+e+'">'+i.highlight(n,i.languages[e])+"</code>","</pre>"].join("")}function o(n){return{fn:function(){var o=n.openModal("Code",['<div class="'+n.o.prefix+'highlight-form-group">',' <select class="'+n.o.prefix+'highlight-form-control language">',function(){var n="";for(var e in i.languages)i.languages[e].comment&&(n+='<option value="'+e+'">'+e+"</option>");return n}()," </select>","</div>",'<div class="'+n.o.prefix+'highlight-form-group">',' <textarea class="'+n.o.prefix+'highlight-form-control code"></textarea>',"</div>"].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","<p><br></p>"),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);
@@ -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;
}
}
}
@@ -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; }
@@ -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}
@@ -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] || '<p></p>',
prevState = stack[index],
newState = t.$ed.html(),
focusEl = t.doc.getSelection().focusNode,
focusElText = '',
latestStateTagsList,
newStateTagsList,
prevFocusEl = t.o.plugins.history._focusEl;
latestStateTagsList = $('<div>' + latestState + '</div>').find('*').map(function () {
return this.localName;
});
newStateTagsList = $('<div>' + newState + '</div>').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);
File diff suppressed because one or more lines are too long
@@ -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 = '<audio controls';
if (v.src) {
html += ' src=\'' + v.src + '\'';
}
if (v.autoplay) {
html += ' autoplay';
}
if (v.muted) {
html += ' muted';
}
if (v.preload) {
html += ' preload=\'' + v + '\'';
}
html += '></audio>';
var node = $(html)[0];
trumbowyg.range.deleteContents();
trumbowyg.range.insertNode(node);
return true;
};
trumbowyg.openModalInsert(trumbowyg.lang.insertAudio, insertAudioOptions, insertAudioCallback);
}
};
trumbowyg.addBtnDef('insertAudio', btnDef);
}
}
}
});
})(jQuery);
@@ -0,0 +1 @@
!function(e){"use strict";var r={src:{label:"URL",required:!0},autoplay:{label:"AutoPlay",required:!1,type:"checkbox"},muted:{label:"Muted",required:!1,type:"checkbox"},preload:{label:"preload options",required:!1}};e.extend(!0,e.trumbowyg,{langs:{en:{insertAudio:"Insert Audio"},fr:{insertAudio:"Insérer un son"},ru:{insertAudio:"Вставить аудио"},ja:{insertAudio:"音声の挿入"},tr:{insertAudio:"Ses Ekle"}},plugins:{insertAudio:{init:function(n){var t={fn:function(){var t=function(r){var t="<audio controls";r.src&&(t+=" src='"+r.src+"'"),r.autoplay&&(t+=" autoplay"),r.muted&&(t+=" muted"),r.preload&&(t+=" preload='"+r+"'"),t+="></audio>";var o=e(t)[0];return n.range.deleteContents(),n.range.insertNode(o),!0};n.openModalInsert(n.lang.insertAudio,r,t)}};n.addBtnDef("insertAudio",t)}}}})}(jQuery);
@@ -0,0 +1,104 @@
(function ($) {
'use strict';
$.extend(true, $.trumbowyg, {
langs: {
// jshint camelcase:false
en: {
lineheight: 'Line height',
lineheights: {
'0.9': 'Small',
'normal': 'Regular',
'1.5': 'Large',
'2.0': 'Extra large'
}
},
fr: {
lineheight: 'Hauteur de ligne',
lineheights: {
'0.9': 'Petit',
'normal': 'Regular',
'1.5': 'Grand',
'2.0': 'Très grand'
}
},
nl: {
lineheight: 'Regelhoogte',
lineheights: {
'0.9': 'Klein',
'normal': 'Normaal',
'1.5': 'Groot',
'2.0': 'Extra groot'
}
},
tr: {
lineheight: 'Satır yüksekliği',
lineheights: {
'0.9': 'Küçük',
'normal': 'Normal',
'1.5': 'Büyük',
'2.0': 'Çok Büyük'
}
}
}
});
// jshint camelcase:true
// Add dropdown with font sizes
$.extend(true, $.trumbowyg, {
plugins: {
lineheight: {
init: function (trumbowyg) {
trumbowyg.addBtnDef('lineheight', {
dropdown: buildDropdown(trumbowyg)
});
}
}
}
});
// Build the dropdown
function buildDropdown(trumbowyg) {
var dropdown = [];
var sizes = ['0.9', 'normal', '1.5', '2.0'];
$.each(sizes, function(index, size) {
trumbowyg.addBtnDef('lineheight_' + size, {
text: '<span style="line-height: ' + size + ';">' + trumbowyg.lang.lineheights[size] + '</span>',
hasIcon: false,
fn: function(){
trumbowyg.saveRange();
var text = trumbowyg.getRangeText();
if (text.replace(/\s/g, '') !== '') {
try {
var parent = getSelectionParentElement();
$(parent).css('lineHeight', size);
} catch (e) {
}
}
}
});
dropdown.push('lineheight_' + size);
});
return dropdown;
}
// Get the selection's parent
function getSelectionParentElement() {
var parentEl = null,
selection;
if (window.getSelection) {
selection = window.getSelection();
if (selection.rangeCount) {
parentEl = selection.getRangeAt(0).commonAncestorContainer;
if (parentEl.nodeType !== 1) {
parentEl = parentEl.parentNode;
}
}
} else if ((selection = document.selection) && selection.type !== 'Control') {
parentEl = selection.createRange().parentElement();
}
return parentEl;
}
})(jQuery);
@@ -0,0 +1 @@
!function(e){"use strict";function n(n){var i=[],l=["0.9","normal","1.5","2.0"];return e.each(l,function(l,r){n.addBtnDef("lineheight_"+r,{text:'<span style="line-height: '+r+';">'+n.lang.lineheights[r]+"</span>",hasIcon:!1,fn:function(){n.saveRange();var i=n.getRangeText();if(""!==i.replace(/\s/g,""))try{var l=t();e(l).css("lineHeight",r)}catch(a){}}}),i.push("lineheight_"+r)}),i}function t(){var e,n=null;return window.getSelection?(e=window.getSelection(),e.rangeCount&&(n=e.getRangeAt(0).commonAncestorContainer,1!==n.nodeType&&(n=n.parentNode))):(e=document.selection)&&"Control"!==e.type&&(n=e.createRange().parentElement()),n}e.extend(!0,e.trumbowyg,{langs:{en:{lineheight:"Line height",lineheights:{.9:"Small",normal:"Regular",1.5:"Large","2.0":"Extra large"}},fr:{lineheight:"Hauteur de ligne",lineheights:{.9:"Petit",normal:"Regular",1.5:"Grand","2.0":"Très grand"}},nl:{lineheight:"Regelhoogte",lineheights:{.9:"Klein",normal:"Normaal",1.5:"Groot","2.0":"Extra groot"}},tr:{lineheight:"Satır yüksekliği",lineheights:{.9:"Küçük",normal:"Normal",1.5:"Büyük","2.0":"Çok Büyük"}}}}),e.extend(!0,e.trumbowyg,{plugins:{lineheight:{init:function(e){e.addBtnDef("lineheight",{dropdown:n(e)})}}}})}(jQuery);
@@ -0,0 +1,88 @@
/* ===========================================================
* trumbowyg.mathMl.js v1.0
* MathML plugin for Trumbowyg
* https://github.com/loclamor/Trumbowyg/tree/mathml-plugin/plugins/mathml
* ===========================================================
* Author : loclamor
*/
/* globals MathJax */
(function($) {
'use strict';
$.extend(true, $.trumbowyg, {
langs: {
en: {
mathml: 'Insert Formulas',
formulas: 'Formulas',
inline: 'Inline'
},
fr: {
mathml: 'Inserer une formule',
formulas: 'Formule',
inline: 'En ligne'
},
tr: {
mathml: 'Formül Ekle',
formulas: 'Formüller',
inline: 'Satır içi'
}
},
plugins: {
mathml: {
init: function(trumbowyg) {
var btnDef = {
fn: function() {
trumbowyg.saveRange();
var mathMLoptions = {
formulas: {
label: trumbowyg.lang.formulas,
required: true,
value: ''
},
inline: {
label: trumbowyg.lang.inline,
attributes: {
checked: true
},
type: 'checkbox',
required: false,
}
};
var mathmlCallback = function(v) {
var delimitor = v.inline ? '$' : '$$';
if (trumbowyg.currentMathNode) {
$(trumbowyg.currentMathNode).html(delimitor + ' ' + v.formulas + ' ' + delimitor).attr('formulas', v.formulas).attr('inline', (v.inline ? 'true' : 'false'));
} else {
var html = '<span class="mathMlContainer" contenteditable="false" formulas="' + v.formulas + '" inline="' + (v.inline ? 'true' : 'false') + '" >' + delimitor + ' ' + v.formulas + ' ' + delimitor + '</span>';
var node = $(html)[0];
node.onclick = function(e) {
trumbowyg.currentMathNode = this;
mathMLoptions.formulas.value = $(this).attr('formulas');
if ($(this).attr('inline') === "true") {
mathMLoptions.inline.attributes.checked = true;
} else {
delete mathMLoptions.inline.attributes.checked;
}
trumbowyg.openModalInsert(trumbowyg.lang.mathml, mathMLoptions, mathmlCallback);
};
trumbowyg.range.deleteContents();
trumbowyg.range.insertNode(node);
}
trumbowyg.currentMathNode = false;
MathJax.Hub.Queue(['Typeset', MathJax.Hub]);
return true;
};
mathMLoptions.formulas.value = trumbowyg.getRangeText();
mathMLoptions.inline.attributes.checked = true;
trumbowyg.openModalInsert(trumbowyg.lang.mathml, mathMLoptions, mathmlCallback);
}
};
trumbowyg.addBtnDef('mathml', btnDef);
}
}
}
});
})(jQuery);
@@ -0,0 +1 @@
!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{mathml:"Insert Formulas",formulas:"Formulas",inline:"Inline"},fr:{mathml:"Inserer une formule",formulas:"Formule",inline:"En ligne"},tr:{mathml:"Formül Ekle",formulas:"Formüller",inline:"Satır içi"}},plugins:{mathml:{init:function(n){var t={fn:function(){n.saveRange();var t={formulas:{label:n.lang.formulas,required:!0,value:""},inline:{label:n.lang.inline,attributes:{checked:!0},type:"checkbox",required:!1}},a=function(l){var r=l.inline?"$":"$$";if(n.currentMathNode)e(n.currentMathNode).html(r+" "+l.formulas+" "+r).attr("formulas",l.formulas).attr("inline",l.inline?"true":"false");else{var i='<span class="mathMlContainer" contenteditable="false" formulas="'+l.formulas+'" inline="'+(l.inline?"true":"false")+'" >'+r+" "+l.formulas+" "+r+"</span>",u=e(i)[0];u.onclick=function(l){n.currentMathNode=this,t.formulas.value=e(this).attr("formulas"),"true"===e(this).attr("inline")?t.inline.attributes.checked=!0:delete t.inline.attributes.checked,n.openModalInsert(n.lang.mathml,t,a)},n.range.deleteContents(),n.range.insertNode(u)}return n.currentMathNode=!1,MathJax.Hub.Queue(["Typeset",MathJax.Hub]),!0};t.formulas.value=n.getRangeText(),t.inline.attributes.checked=!0,n.openModalInsert(n.lang.mathml,t,a)}};n.addBtnDef("mathml",t)}}}})}(jQuery);
@@ -0,0 +1,36 @@
/**
* 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
*/
.mathMlContainer {
position: relative;
&[inline="false"] {
display: block;
width: 100%;
}
&:hover {
pointer-events: none;
&:after {
content: '\270E';
pointer-events: auto;
position: absolute;
left: 0px;
top: 0px;
background-color: #ffffffd4;
cursor: pointer;
bottom: 0px;
right: 0px;
box-shadow: 0 0 5px 5px #ffffffd4;
}
}
}
@@ -0,0 +1,29 @@
/**
* 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
*/
.mathMlContainer {
position: relative; }
.mathMlContainer[inline="false"] {
display: block;
width: 100%; }
.mathMlContainer:hover {
pointer-events: none; }
.mathMlContainer:hover:after {
content: '\270E';
pointer-events: auto;
position: absolute;
left: 0px;
top: 0px;
background-color: #ffffffd4;
cursor: pointer;
bottom: 0px;
right: 0px;
box-shadow: 0 0 5px 5px #ffffffd4; }
@@ -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 */
.mathMlContainer{position:relative}.mathMlContainer[inline=false]{display:block;width:100%}.mathMlContainer:hover{pointer-events:none}.mathMlContainer:hover:after{content:'\270E';pointer-events:auto;position:absolute;left:0;top:0;background-color:#fffd4;cursor:pointer;bottom:0;right:0;box-shadow:0 0 5px 5px #fffd4}
@@ -0,0 +1,105 @@
/* ===========================================================
* trumbowyg.mention.js v0.1
* Mention plugin for Trumbowyg
* http://alex-d.github.com/Trumbowyg
* ===========================================================
* Author : Viper
* Github: https://github.com/Globulopolis
* Website: http://киноархив.com
*/
(function ($) {
'use strict';
var defaultOptions = {
source: '',
formatDropdownItem: formatDropdownItem,
formatResult: formatResult
};
$.extend(true, $.trumbowyg, {
langs: {
en: {
mention: 'Mention'
},
fr: {
mention: 'Mentioner'
},
ru: {
mention: 'Упомянуть'
},
tr: {
mention: 'Bahset'
}
},
plugins: {
mention: {
init: function (trumbowyg) {
trumbowyg.o.plugins.mention = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.mention || {});
var btnDef = {
dropdown: buildDropdown(trumbowyg.o.plugins.mention.source, trumbowyg)
};
trumbowyg.addBtnDef('mention', btnDef);
}
}
}
});
/**
* Build dropdown list
*
* @param {Array} items Items
* @param {object} trumbowyg Editor
*
* @return {Array}
*/
function buildDropdown(items, trumbowyg) {
var dropdown = [];
// Check if source is an array
if (items.constructor === Array) {
$.each(items, function (i, item) {
var btn = 'mention-' + i,
btnDef = {
hasIcon: false,
text: trumbowyg.o.plugins.mention.formatDropdownItem(item),
fn: function () {
trumbowyg.execCmd('insertHTML', trumbowyg.o.plugins.mention.formatResult(item));
return true;
}
};
trumbowyg.addBtnDef(btn, btnDef);
dropdown.push(btn);
});
}
return dropdown;
}
/**
* Format item in dropdown.
*
* @param {object} item Item object.
*
* @return {string}
*/
function formatDropdownItem(item) {
return item.login;
}
/**
* Format result pasted in editor.
*
* @param {object} item Item object.
*
* @return {string}
*/
function formatResult(item) {
return '@' + item.login + ' ';
}
})(jQuery);
@@ -0,0 +1 @@
!function(n){"use strict";function t(t,o){var e=[];return t.constructor===Array&&n.each(t,function(n,t){var i="mention-"+n,r={hasIcon:!1,text:o.o.plugins.mention.formatDropdownItem(t),fn:function(){return o.execCmd("insertHTML",o.o.plugins.mention.formatResult(t)),!0}};o.addBtnDef(i,r),e.push(i)}),e}function o(n){return n.login}function e(n){return"@"+n.login+" "}var i={source:"",formatDropdownItem:o,formatResult:e};n.extend(!0,n.trumbowyg,{langs:{en:{mention:"Mention"},fr:{mention:"Mentioner"},ru:{mention:"Упомянуть"},tr:{mention:"Bahset"}},plugins:{mention:{init:function(o){o.o.plugins.mention=n.extend(!0,{},i,o.o.plugins.mention||{});var e={dropdown:t(o.o.plugins.mention.source,o)};o.addBtnDef("mention",e)}}}})}(jQuery);
@@ -0,0 +1,39 @@
/**
* 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-mention {
height: calc(75%);
width: 300px;
max-width: 300px;
overflow-y: scroll;
overflow-x: hidden;
svg {
display: none !important;
}
button {
position: relative;
white-space: nowrap;
&:after {
content: "";
position: absolute;
top: 0;
right: 0;
width: 15%;
height: 100%;
background-size: 100%;
background-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, #ffffff 80%, #ffffff 100%);
pointer-events: none;
}
}
}
@@ -0,0 +1,32 @@
/**
* 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-mention {
height: calc(75%);
width: 300px;
max-width: 300px;
overflow-y: scroll;
overflow-x: hidden; }
.trumbowyg-dropdown-mention svg {
display: none !important; }
.trumbowyg-dropdown-mention button {
position: relative;
white-space: nowrap; }
.trumbowyg-dropdown-mention button:after {
content: "";
position: absolute;
top: 0;
right: 0;
width: 15%;
height: 100%;
background-size: 100%;
background-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, #ffffff 80%, #ffffff 100%);
pointer-events: none; }
@@ -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-mention{height:calc(75%);width:300px;max-width:300px;overflow-y:scroll;overflow-x:hidden}.trumbowyg-dropdown-mention svg{display:none!important}.trumbowyg-dropdown-mention button{position:relative;white-space:nowrap}.trumbowyg-dropdown-mention button:after{content:"";position:absolute;top:0;right:0;width:15%;height:100%;background-size:100%;background-image:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 80%,#fff 100%);pointer-events:none}
@@ -0,0 +1,104 @@
/* ===========================================================
* trumbowyg.noembed.js v1.0
* noEmbed plugin for Trumbowyg
* http://alex-d.github.com/Trumbowyg
* ===========================================================
* Author : Jake Johns (jakejohns)
*/
(function ($) {
'use strict';
var defaultOptions = {
proxy: 'https://noembed.com/embed?nowrap=on',
urlFiled: 'url',
data: [],
success: undefined,
error: undefined
};
$.extend(true, $.trumbowyg, {
langs: {
en: {
noembed: 'Noembed',
noembedError: 'Error'
},
sk: {
noembedError: 'Chyba'
},
fr: {
noembedError: 'Erreur'
},
cs: {
noembedError: 'Chyba'
},
ru: {
noembedError: 'Ошибка'
},
ja: {
noembedError: 'エラー'
},
tr: {
noembedError: 'Hata'
}
},
plugins: {
noembed: {
init: function (trumbowyg) {
trumbowyg.o.plugins.noembed = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.noembed || {});
var btnDef = {
fn: function () {
var $modal = trumbowyg.openModalInsert(
// Title
trumbowyg.lang.noembed,
// Fields
{
url: {
label: 'URL',
required: true
}
},
// Callback
function (data) {
$.ajax({
url: trumbowyg.o.plugins.noembed.proxy,
type: 'GET',
data: data,
cache: false,
dataType: 'json',
success: trumbowyg.o.plugins.noembed.success || function (data) {
if (data.html) {
trumbowyg.execCmd('insertHTML', data.html);
setTimeout(function () {
trumbowyg.closeModal();
}, 250);
} else {
trumbowyg.addErrorOnModalField(
$('input[type=text]', $modal),
data.error
);
}
},
error: trumbowyg.o.plugins.noembed.error || function () {
trumbowyg.addErrorOnModalField(
$('input[type=text]', $modal),
trumbowyg.lang.noembedError
);
}
});
}
);
}
};
trumbowyg.addBtnDef('noembed', btnDef);
}
}
}
});
})(jQuery);
@@ -0,0 +1 @@
!function(e){"use strict";var r={proxy:"https://noembed.com/embed?nowrap=on",urlFiled:"url",data:[],success:void 0,error:void 0};e.extend(!0,e.trumbowyg,{langs:{en:{noembed:"Noembed",noembedError:"Error"},sk:{noembedError:"Chyba"},fr:{noembedError:"Erreur"},cs:{noembedError:"Chyba"},ru:{noembedError:"Ошибка"},ja:{noembedError:"エラー"},tr:{noembedError:"Hata"}},plugins:{noembed:{init:function(o){o.o.plugins.noembed=e.extend(!0,{},r,o.o.plugins.noembed||{});var n={fn:function(){var r=o.openModalInsert(o.lang.noembed,{url:{label:"URL",required:!0}},function(n){e.ajax({url:o.o.plugins.noembed.proxy,type:"GET",data:n,cache:!1,dataType:"json",success:o.o.plugins.noembed.success||function(n){n.html?(o.execCmd("insertHTML",n.html),setTimeout(function(){o.closeModal()},250)):o.addErrorOnModalField(e("input[type=text]",r),n.error)},error:o.o.plugins.noembed.error||function(){o.addErrorOnModalField(e("input[type=text]",r),o.lang.noembedError)}})})}};o.addBtnDef("noembed",n)}}}})}(jQuery);
@@ -0,0 +1,96 @@
/* ===========================================================
* trumbowyg.pasteembed.js v1.0
* Url paste to iframe with noembed. Plugin for Trumbowyg
* http://alex-d.github.com/Trumbowyg
* ===========================================================
* Author : Max Seelig
* Facebook : https://facebook.com/maxse
* Website : https://www.maxmade.nl/
*/
(function($) {
'use strict';
var defaultOptions = {
enabled: true,
endpoints: [
'https://noembed.com/embed?nowrap=on',
'https://api.maxmade.nl/url2iframe/embed'
]
};
$.extend(true, $.trumbowyg, {
plugins: {
pasteEmbed: {
init: function(trumbowyg) {
trumbowyg.o.plugins.pasteEmbed = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.pasteEmbed || {});
if (!trumbowyg.o.plugins.pasteEmbed.enabled) {
return;
}
trumbowyg.pasteHandlers.push(function(pasteEvent) {
try {
var clipboardData = (pasteEvent.originalEvent || pasteEvent).clipboardData,
pastedData = clipboardData.getData('Text'),
endpoints = trumbowyg.o.plugins.pasteEmbed.endpoints,
request = null;
if (pastedData.startsWith('http')) {
pasteEvent.stopPropagation();
pasteEvent.preventDefault();
var query = {
url: pastedData.trim()
};
var content = '';
var index = 0;
if (request && request.transport) {
request.transport.abort();
}
request = $.ajax({
crossOrigin: true,
url: endpoints[index],
type: 'GET',
data: query,
cache: false,
dataType: 'jsonp',
success: function(res) {
if (res.html) {
index = 0;
content = res.html;
} else {
index += 1;
}
},
error: function() {
index += 1;
},
complete: function() {
if (content.length === 0 && index < endpoints.length - 1) {
this.url = endpoints[index];
this.data = query;
$.ajax(this);
}
if (index === endpoints.length - 1) {
content = $('<a>', {
href: pastedData,
text: pastedData
}).prop('outerHTML');
}
if (content.length > 0) {
index = 0;
trumbowyg.execCmd('insertHTML', content);
}
}
});
}
} catch (c) {}
});
}
}
}
});
})(jQuery);
@@ -0,0 +1 @@
!function(t){"use strict";var e={enabled:!0,endpoints:["https://noembed.com/embed?nowrap=on","https://api.maxmade.nl/url2iframe/embed"]};t.extend(!0,t.trumbowyg,{plugins:{pasteEmbed:{init:function(n){n.o.plugins.pasteEmbed=t.extend(!0,{},e,n.o.plugins.pasteEmbed||{}),n.o.plugins.pasteEmbed.enabled&&n.pasteHandlers.push(function(e){try{var a=(e.originalEvent||e).clipboardData,r=a.getData("Text"),s=n.o.plugins.pasteEmbed.endpoints,i=null;if(r.startsWith("http")){e.stopPropagation(),e.preventDefault();var o={url:r.trim()},p="",l=0;i&&i.transport&&i.transport.abort(),i=t.ajax({crossOrigin:!0,url:s[l],type:"GET",data:o,cache:!1,dataType:"jsonp",success:function(t){t.html?(l=0,p=t.html):l+=1},error:function(){l+=1},complete:function(){0===p.length&&l<s.length-1&&(this.url=s[l],this.data=o,t.ajax(this)),l===s.length-1&&(p=t("<a>",{href:r,text:r}).prop("outerHTML")),p.length>0&&(l=0,n.execCmd("insertHTML",p))}})}}catch(u){}})}}}})}(jQuery);
@@ -0,0 +1,41 @@
/* ===========================================================
* trumbowyg.pasteimage.js v1.0
* Basic base64 paste 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, {
plugins: {
pasteImage: {
init: function (trumbowyg) {
trumbowyg.pasteHandlers.push(function (pasteEvent) {
try {
var items = (pasteEvent.originalEvent || pasteEvent).clipboardData.items,
reader;
for (var i = items.length - 1; i >= 0; i -= 1) {
if (items[i].type.match(/^image\//)) {
reader = new FileReader();
/* jshint -W083 */
reader.onloadend = function (event) {
trumbowyg.execCmd('insertImage', event.target.result, undefined, true);
};
/* jshint +W083 */
reader.readAsDataURL(items[i].getAsFile());
}
}
} catch (c) {
}
});
}
}
}
});
})(jQuery);
@@ -0,0 +1 @@
!function(e){"use strict";e.extend(!0,e.trumbowyg,{plugins:{pasteImage:{init:function(e){e.pasteHandlers.push(function(t){try{for(var a,n=(t.originalEvent||t).clipboardData.items,i=n.length-1;i>=0;i-=1)n[i].type.match(/^image\//)&&(a=new FileReader,a.onloadend=function(t){e.execCmd("insertImage",t.target.result,void 0,!0)},a.readAsDataURL(n[i].getAsFile()))}catch(r){}})}}}})}(jQuery);
@@ -0,0 +1,130 @@
/* ===========================================================
* trumbowyg.preformatted.js v1.0
* Preformatted plugin for Trumbowyg
* http://alex-d.github.com/Trumbowyg
* ===========================================================
* Author : Casella Edoardo (Civile)
*/
(function ($) {
'use strict';
$.extend(true, $.trumbowyg, {
langs: {
// jshint camelcase:false
en: {
preformatted: 'Code sample <pre>'
},
fr: {
preformatted: 'Exemple de code <pre>'
},
it: {
preformatted: 'Codice <pre>'
},
zh_cn: {
preformatted: '代码示例 <pre>'
},
ru: {
preformatted: 'Пример кода <pre>'
},
ja: {
preformatted: 'コードサンプル <pre>'
},
tr: {
preformatted: 'Kod örneği <pre>'
}
},
// jshint camelcase:true
plugins: {
preformatted: {
init: function (trumbowyg) {
var btnDef = {
fn: function () {
trumbowyg.saveRange();
var text = trumbowyg.getRangeText();
if (text.replace(/\s/g, '') !== '') {
try {
var curtag = getSelectionParentElement().tagName.toLowerCase();
if (curtag === 'code' || curtag === 'pre') {
return unwrapCode();
}
else {
trumbowyg.execCmd('insertHTML', '<pre><code>' + strip(text) + '</code></pre>');
}
} catch (e) {
}
}
},
tag: 'pre'
};
trumbowyg.addBtnDef('preformatted', btnDef);
}
}
}
});
/*
* GetSelectionParentElement
*/
function getSelectionParentElement() {
var parentEl = null,
selection;
if (window.getSelection) {
selection = window.getSelection();
if (selection.rangeCount) {
parentEl = selection.getRangeAt(0).commonAncestorContainer;
if (parentEl.nodeType !== 1) {
parentEl = parentEl.parentNode;
}
}
} else if ((selection = document.selection) && selection.type !== 'Control') {
parentEl = selection.createRange().parentElement();
}
return parentEl;
}
/*
* Strip
* returns a text without HTML tags
*/
function strip(html) {
var tmp = document.createElement('DIV');
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || '';
}
/*
* UnwrapCode
* ADD/FIX: to improve, works but can be better
* "paranoic" solution
*/
function unwrapCode() {
var container = null;
if (document.selection) { //for IE
container = document.selection.createRange().parentElement();
} else {
var select = window.getSelection();
if (select.rangeCount > 0) {
container = select.getRangeAt(0).startContainer.parentNode;
}
}
//'paranoic' unwrap
var ispre = $(container).contents().closest('pre').length;
var iscode = $(container).contents().closest('code').length;
if (ispre && iscode) {
$(container).contents().unwrap('code').unwrap('pre');
} else if (ispre) {
$(container).contents().unwrap('pre');
} else if (iscode) {
$(container).contents().unwrap('code');
}
}
})(jQuery);
@@ -0,0 +1 @@
!function(e){"use strict";function t(){var e,t=null;return window.getSelection?(e=window.getSelection(),e.rangeCount&&(t=e.getRangeAt(0).commonAncestorContainer,1!==t.nodeType&&(t=t.parentNode))):(e=document.selection)&&"Control"!==e.type&&(t=e.createRange().parentElement()),t}function n(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}function r(){var t=null;if(document.selection)t=document.selection.createRange().parentElement();else{var n=window.getSelection();n.rangeCount>0&&(t=n.getRangeAt(0).startContainer.parentNode)}var r=e(t).contents().closest("pre").length,o=e(t).contents().closest("code").length;r&&o?e(t).contents().unwrap("code").unwrap("pre"):r?e(t).contents().unwrap("pre"):o&&e(t).contents().unwrap("code")}e.extend(!0,e.trumbowyg,{langs:{en:{preformatted:"Code sample <pre>"},fr:{preformatted:"Exemple de code <pre>"},it:{preformatted:"Codice <pre>"},zh_cn:{preformatted:"代码示例 <pre>"},ru:{preformatted:"Пример кода <pre>"},ja:{preformatted:"コードサンプル <pre>"},tr:{preformatted:"Kod örneği <pre>"}},plugins:{preformatted:{init:function(e){var o={fn:function(){e.saveRange();var o=e.getRangeText();if(""!==o.replace(/\s/g,""))try{var a=t().tagName.toLowerCase();if("code"===a||"pre"===a)return r();e.execCmd("insertHTML","<pre><code>"+n(o)+"</code></pre>")}catch(c){}},tag:"pre"};e.addBtnDef("preformatted",o)}}}})}(jQuery);
@@ -0,0 +1,69 @@
(function ($) {
'use strict';
var defaultOptions = {
minSize: 32,
step: 4
};
var preventDefault = function (ev) {
return ev.preventDefault();
};
$.extend(true, $.trumbowyg, {
plugins: {
resizimg: {
init: function (trumbowyg) {
trumbowyg.o.plugins.resizimg = $.extend(true, {},
defaultOptions,
trumbowyg.o.plugins.resizimg || {},
{
resizable: {
resizeWidth: false,
onDragStart: function (ev, $el) {
var opt = trumbowyg.o.plugins.resizimg;
var x = ev.pageX - $el.offset().left;
var y = ev.pageY - $el.offset().top;
if (x < $el.width() - opt.minSize || y < $el.height() - opt.minSize) {
return false;
}
},
onDrag: function (ev, $el, newWidth, newHeight) {
var opt = trumbowyg.o.plugins.resizimg;
if (newHeight < opt.minSize) {
newHeight = opt.minSize;
}
newHeight -= newHeight % opt.step;
$el.height(newHeight);
return false;
},
onDragEnd: function () {
trumbowyg.$c.trigger('tbwchange');
}
}
}
);
function initResizable() {
trumbowyg.$ed.find('img:not(.resizable)')
.resizable(trumbowyg.o.plugins.resizimg.resizable)
.on('mousedown', preventDefault);
}
function destroyResizable() {
trumbowyg.$ed.find('img.resizable')
.resizable('destroy')
.off('mousedown', preventDefault);
trumbowyg.syncTextarea();
}
trumbowyg.$c.on('tbwinit', initResizable);
trumbowyg.$c.on('tbwfocus', initResizable);
trumbowyg.$c.on('tbwchange', initResizable);
trumbowyg.$c.on('tbwblur', destroyResizable);
trumbowyg.$c.on('tbwclose', destroyResizable);
}
}
}
});
})(jQuery);
@@ -0,0 +1 @@
!function(i){"use strict";var e={minSize:32,step:4},n=function(i){return i.preventDefault()};i.extend(!0,i.trumbowyg,{plugins:{resizimg:{init:function(t){function o(){t.$ed.find("img:not(.resizable)").resizable(t.o.plugins.resizimg.resizable).on("mousedown",n)}function r(){t.$ed.find("img.resizable").resizable("destroy").off("mousedown",n),t.syncTextarea()}t.o.plugins.resizimg=i.extend(!0,{},e,t.o.plugins.resizimg||{},{resizable:{resizeWidth:!1,onDragStart:function(i,e){var n=t.o.plugins.resizimg,o=i.pageX-e.offset().left,r=i.pageY-e.offset().top;if(o<e.width()-n.minSize||r<e.height()-n.minSize)return!1},onDrag:function(i,e,n,o){var r=t.o.plugins.resizimg;return o<r.minSize&&(o=r.minSize),o-=o%r.step,e.height(o),!1},onDragEnd:function(){t.$c.trigger("tbwchange")}}}),t.$c.on("tbwinit",o),t.$c.on("tbwfocus",o),t.$c.on("tbwchange",o),t.$c.on("tbwblur",r),t.$c.on("tbwclose",r)}}}})}(jQuery);
@@ -0,0 +1,72 @@
/* ===========================================================
* trumbowyg.ruby.js v1.0
* Ruby text plugin for Trumbowyg
* http://alex-d.github.com/Trumbowyg
* ===========================================================
* Author : Fathi Anshory (0x00000F5C)
* Twitter : @fscchannl
* Comment : Since I use trumbowyg in my project and required it to insert ruby text, so I thought I can contribute a little. :D
*/
(function ($) {
'use strict';
$.extend(true, $.trumbowyg, {
langs: {
en: {
ruby: 'Add ruby text',
rubyModal: 'Ruby modal',
rubyText: 'Ruby text'
},
fr: {
ruby: 'Ajouter du texte ruby',
rubyModal: 'Modale ruby',
rubyText: 'Texte ruby'
},
id: {
ruby: 'Sisipkan teks ruby',
rubyModal: 'Modal teks ruby',
rubyText: 'Teks ruby'
},
tr: {
ruby: 'Ruby metni ekle',
rubyModal: 'Ruby modal',
rubyText: 'Ruby metni'
}
},
plugins: {
ruby: {
init: function (trumbowyg) {
var btnDef = {
fn: function () {
trumbowyg.saveRange();
trumbowyg.openModalInsert(
trumbowyg.lang.ruby,
{
rubyText: {
label: trumbowyg.lang.rubyText,
required: false,
},
modal: {
label: trumbowyg.lang.rubyModal,
value: trumbowyg.getRangeText(),
required: true
}
},
function (v) {
var node = $('<ruby title="' + v.rubyText + '">' + v.modal + '<rp> (</rp><rt>' + v.rubyText + '</rt><rp>)</rp></ruby>')[0];
trumbowyg.range.deleteContents();
trumbowyg.range.insertNode(node);
trumbowyg.syncCode();
trumbowyg.$c.trigger('tbwchange');
return true;
}
);
}
};
trumbowyg.addBtnDef('ruby', btnDef);
}
}
}
});
})(jQuery);
+1
View File
@@ -0,0 +1 @@
!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{ruby:"Add ruby text",rubyModal:"Ruby modal",rubyText:"Ruby text"},fr:{ruby:"Ajouter du texte ruby",rubyModal:"Modale ruby",rubyText:"Texte ruby"},id:{ruby:"Sisipkan teks ruby",rubyModal:"Modal teks ruby",rubyText:"Teks ruby"},tr:{ruby:"Ruby metni ekle",rubyModal:"Ruby modal",rubyText:"Ruby metni"}},plugins:{ruby:{init:function(r){var u={fn:function(){r.saveRange(),r.openModalInsert(r.lang.ruby,{rubyText:{label:r.lang.rubyText,required:!1},modal:{label:r.lang.rubyModal,value:r.getRangeText(),required:!0}},function(u){var t=e('<ruby title="'+u.rubyText+'">'+u.modal+"<rp> (</rp><rt>"+u.rubyText+"</rt><rp>)</rp></ruby>")[0];return r.range.deleteContents(),r.range.insertNode(t),r.syncCode(),r.$c.trigger("tbwchange"),!0})}};r.addBtnDef("ruby",u)}}}})}(jQuery);
@@ -0,0 +1,283 @@
/* ===========================================================
* trumbowyg.table.custom.js v2.0
* Table plugin for Trumbowyg
* http://alex-d.github.com/Trumbowyg
* ===========================================================
* Author : Sven Dunemann [dunemann@forelabs.eu]
*/
(function ($) {
'use strict';
var defaultOptions = {
rows: 8,
columns: 8,
styler: 'table'
};
$.extend(true, $.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 (t) {
t.o.plugins.table = $.extend(true, {}, defaultOptions, t.o.plugins.table || {});
var buildButtonDef = {
fn: function () {
t.saveRange();
var btnName = 'table';
var dropdownPrefix = t.o.prefix + 'dropdown',
dropdownOptions = { // the dropdown
class: dropdownPrefix + '-' + btnName + ' ' + dropdownPrefix + ' ' + t.o.prefix + 'fixed-top'
};
dropdownOptions['data-' + dropdownPrefix] = btnName;
var $dropdown = $('<div/>', dropdownOptions);
if (t.$box.find("." + dropdownPrefix + "-" + btnName).length === 0) {
t.$box.append($dropdown.hide());
} else {
$dropdown = t.$box.find("." + dropdownPrefix + "-" + btnName);
}
// clear dropdown
$dropdown.html('');
// when active table show AddRow / AddColumn
if (t.$box.find("." + t.o.prefix + "table-button").hasClass(t.o.prefix + 'active-button')) {
$dropdown.append(t.buildSubBtn('tableAddRow'));
$dropdown.append(t.buildSubBtn('tableAddColumn'));
$dropdown.append(t.buildSubBtn('tableDeleteRow'));
$dropdown.append(t.buildSubBtn('tableDeleteColumn'));
$dropdown.append(t.buildSubBtn('tableDestroy'));
} else {
var tableSelect = $('<table></table>');
for (var i = 0; i < t.o.plugins.table.rows; i += 1) {
var row = $('<tr></tr>').appendTo(tableSelect);
for (var j = 0; j < t.o.plugins.table.columns; j += 1) {
$('<td></td>').appendTo(row);
}
}
tableSelect.find('td').on('mouseover', tableAnimate);
tableSelect.find('td').on('mousedown', tableBuild);
$dropdown.append(tableSelect);
$dropdown.append($('<center>1x1</center>'));
}
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 = $('<table></table>');
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 = $('<tr></tr>').appendTo(tabler);
for (var j = 0; j <= colIndex; j += 1) {
$('<td></td>').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 = $('<tr></tr>');
// add columns according to current columns count
for (var i = 0; i < table.find('tr')[0].childElementCount; i += 1) {
$('<td></td>').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('<td></td>');
});
}
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);
File diff suppressed because one or more lines are too long
@@ -0,0 +1,41 @@
/**
* 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;
}
}
}
@@ -0,0 +1,32 @@
/**
* 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; }
@@ -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-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}
@@ -0,0 +1,64 @@
(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);
@@ -0,0 +1 @@
!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);
@@ -0,0 +1,261 @@
/* ===========================================================
* 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(
$('<div/>', {
'class': prefix + 'progress'
}).append(
$('<div/>', {
'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);
File diff suppressed because one or more lines are too long