mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-23 19:39:10 -04:00
Au cas ou
This commit is contained in:
162
public/js/plugins/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js
vendored
Normal file
162
public/js/plugins/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js
vendored
Normal file
@@ -0,0 +1,162 @@
|
||||
/* ===========================================================
|
||||
* 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 = {
|
||||
// When empty, all tags are allowed making this plugin useless
|
||||
// If you want to remove all tags, use removeformatPasted core option instead
|
||||
allowedTags: [],
|
||||
// List of tags which can be allowed
|
||||
removableTags: [
|
||||
'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) {
|
||||
// Force disable remove format pasted
|
||||
trumbowyg.o.removeformatPasted = false;
|
||||
|
||||
if (!trumbowyg.o.plugins.allowTagsFromPaste) {
|
||||
return;
|
||||
}
|
||||
|
||||
var allowedTags = trumbowyg.o.plugins.allowTagsFromPaste.allowedTags || defaultOptions.allowedTags;
|
||||
var removableTags = trumbowyg.o.plugins.allowTagsFromPaste.removableTags || defaultOptions.removableTags;
|
||||
|
||||
if (allowedTags.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get list of tags to remove
|
||||
var tagsToRemove = $(removableTags).not(allowedTags).get();
|
||||
|
||||
trumbowyg.pasteHandlers.push(function () {
|
||||
setTimeout(function () {
|
||||
var processNodes = trumbowyg.$ed.html();
|
||||
$.each(tagsToRemove, function (iterator, tagName) {
|
||||
processNodes = processNodes.replace(new RegExp('<\\/?' + tagName + '(\\s[^>]*)?>', 'gi'), '');
|
||||
});
|
||||
trumbowyg.$ed.html(processNodes);
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
1
public/js/plugins/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){"use strict";var a={allowedTags:[],removableTags:["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(t){if(t.o.removeformatPasted=!1,t.o.plugins.allowTagsFromPaste){var o=t.o.plugins.allowTagsFromPaste.allowedTags||a.allowedTags,r=t.o.plugins.allowTagsFromPaste.removableTags||a.removableTags;if(0!==o.length){var s=e(r).not(o).get();t.pasteHandlers.push(function(){setTimeout(function(){var a=t.$ed.html();e.each(s,function(e,t){a=a.replace(new RegExp("<\\/?"+t+"(\\s[^>]*)?>","gi"),"")}),t.$ed.html(a)},0)})}}}}}})}(jQuery);
|
||||
153
public/js/plugins/trumbowyg/plugins/base64/trumbowyg.base64.js
vendored
Normal file
153
public/js/plugins/trumbowyg/plugins/base64/trumbowyg.base64.js
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
/* ===========================================================
|
||||
* 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.'
|
||||
},
|
||||
da: {
|
||||
base64: 'Billede som base64',
|
||||
file: 'Fil',
|
||||
errFileReaderNotSupported: 'FileReader er ikke understøttet af din browser.',
|
||||
errInvalidImage: 'Ugyldig billedfil.'
|
||||
},
|
||||
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ı.'
|
||||
},
|
||||
zh_tw: {
|
||||
base64: '圖片(base64編碼)',
|
||||
file: '檔案',
|
||||
errFileReaderNotSupported: '你的瀏覽器不支援FileReader',
|
||||
errInvalidImage: '不正確的檔案格式'
|
||||
},
|
||||
pt_br: {
|
||||
base64: 'Imagem em base64',
|
||||
file: 'Arquivo',
|
||||
errFileReaderNotSupported: 'FileReader não é suportado pelo seu navegador.',
|
||||
errInvalidImage: 'Arquivo de imagem inválido.'
|
||||
},
|
||||
ko: {
|
||||
base64: '그림 넣기(base64)',
|
||||
file: '파일',
|
||||
errFileReaderNotSupported: 'FileReader가 현재 브라우저를 지원하지 않습니다.',
|
||||
errInvalidImage: '유효하지 않은 파일'
|
||||
},
|
||||
},
|
||||
// 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, false, true);
|
||||
$(['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);
|
||||
1
public/js/plugins/trumbowyg/plugins/base64/trumbowyg.base64.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/base64/trumbowyg.base64.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){"use strict";var a=function(){return"undefined"!=typeof FileReader},r=function(e){return/^data:image\/[a-z]?/i.test(e)};e.extend(!0,e.trumbowyg,{langs:{en:{base64:"Image as base64",file:"File",errFileReaderNotSupported:"FileReader is not supported by your browser.",errInvalidImage:"Invalid image file."},da:{base64:"Billede som base64",file:"Fil",errFileReaderNotSupported:"FileReader er ikke understøttet af din browser.",errInvalidImage:"Ugyldig billedfil."},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ı."},zh_tw:{base64:"圖片(base64編碼)",file:"檔案",errFileReaderNotSupported:"你的瀏覽器不支援FileReader",errInvalidImage:"不正確的檔案格式"},pt_br:{base64:"Imagem em base64",file:"Arquivo",errFileReaderNotSupported:"FileReader não é suportado pelo seu navegador.",errInvalidImage:"Arquivo de imagem inválido."},ko:{base64:"그림 넣기(base64)",file:"파일",errFileReaderNotSupported:"FileReader가 현재 브라우저를 지원하지 않습니다.",errInvalidImage:"유효하지 않은 파일"}},plugins:{base64:{shouldInit:a,init:function(i){var t={isSupported:a,fn:function(){i.saveRange();var a,t=i.openModalInsert(i.lang.base64,{file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:i.getRangeText()}},function(l){var n=new FileReader;n.onloadend=function(a){r(a.target.result)?(i.execCmd("insertImage",n.result,!1,!0),e(['img[src="',n.result,'"]:not([alt])'].join(""),i.$box).attr("alt",l.alt),i.closeModal()):i.addErrorOnModalField(e("input[type=file]",t),i.lang.errInvalidImage)},n.readAsDataURL(a)});e("input[type=file]").on("change",function(e){a=e.target.files[0]})}};i.addBtnDef("base64",t)}}}})}(jQuery);
|
||||
111
public/js/plugins/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js
vendored
Normal file
111
public/js/plugins/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
/* ===========================================================
|
||||
* 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 -cgCraft
|
||||
html = html.replace(/ /gi, ' ');
|
||||
// strip out extra spaces -cgCraft
|
||||
html = html.replace(/ <\//gi, '</');
|
||||
|
||||
// Remove multiple spaces
|
||||
html.replace(/\s+/g, ' ');
|
||||
|
||||
// strip -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 clean out 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 () {
|
||||
setTimeout(function () {
|
||||
try {
|
||||
trumbowyg.$ed.html(cleanIt(trumbowyg.$ed.html()));
|
||||
} catch (c) {
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
1
public/js/plugins/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js
vendored
Normal file
@@ -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){return 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(/ /gi," "),e=e.replace(/ <\//gi,"</"),e.replace(/\s+/g," "),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(){setTimeout(function(){try{e.$ed.html(n(e.$ed.html()))}catch(r){}},0)})}}}})}(jQuery);
|
||||
250
public/js/plugins/trumbowyg/plugins/colors/trumbowyg.colors.js
vendored
Normal file
250
public/js/plugins/trumbowyg/plugins/colors/trumbowyg.colors.js
vendored
Normal file
@@ -0,0 +1,250 @@
|
||||
/* ===========================================================
|
||||
* 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',
|
||||
foreColorRemove: 'Remove text color',
|
||||
backColorRemove: 'Remove background color'
|
||||
},
|
||||
da: {
|
||||
foreColor: 'Tekstfarve',
|
||||
backColor: 'Baggrundsfarve'
|
||||
},
|
||||
fr: {
|
||||
foreColor: 'Couleur du texte',
|
||||
backColor: 'Couleur de fond',
|
||||
foreColorRemove: 'Supprimer la couleur du texte',
|
||||
backColorRemove: 'Supprimer la couleur de fond'
|
||||
},
|
||||
de: {
|
||||
foreColor: 'Textfarbe',
|
||||
backColor: 'Hintergrundfarbe'
|
||||
},
|
||||
nl: {
|
||||
foreColor: 'Tekstkleur',
|
||||
backColor: 'Achtergrondkleur'
|
||||
},
|
||||
sk: {
|
||||
foreColor: 'Farba textu',
|
||||
backColor: 'Farba pozadia'
|
||||
},
|
||||
zh_cn: {
|
||||
foreColor: '文字颜色',
|
||||
backColor: '背景颜色'
|
||||
},
|
||||
zh_tw: {
|
||||
foreColor: '文字顏色',
|
||||
backColor: '背景顏色'
|
||||
},
|
||||
ru: {
|
||||
foreColor: 'Цвет текста',
|
||||
backColor: 'Цвет выделения текста'
|
||||
},
|
||||
ja: {
|
||||
foreColor: '文字色',
|
||||
backColor: '背景色'
|
||||
},
|
||||
tr: {
|
||||
foreColor: 'Yazı rengi',
|
||||
backColor: 'Arkaplan rengi'
|
||||
},
|
||||
pt_br: {
|
||||
foreColor: 'Cor de fonte',
|
||||
backColor: 'Cor de fundo'
|
||||
},
|
||||
ko: {
|
||||
foreColor: '글자색',
|
||||
backColor: '배경색',
|
||||
foreColorRemove: '글자색 지우기',
|
||||
backColorRemove: '배경색 지우기'
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
// 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'
|
||||
],
|
||||
foreColorList: null, // fallbacks on colorList
|
||||
backColorList: null, // fallbacks on colorList
|
||||
allowCustomForeColor: true,
|
||||
allowCustomBackColor: true,
|
||||
displayAsList: false,
|
||||
};
|
||||
|
||||
// Add all colors in two dropdowns
|
||||
$.extend(true, $.trumbowyg, {
|
||||
plugins: {
|
||||
color: {
|
||||
init: function (trumbowyg) {
|
||||
trumbowyg.o.plugins.colors = trumbowyg.o.plugins.colors || defaultOptions;
|
||||
var dropdownClass = trumbowyg.o.plugins.colors.displayAsList ? trumbowyg.o.prefix + 'dropdown--color-list' : '';
|
||||
|
||||
var foreColorBtnDef = {
|
||||
dropdown: buildDropdown('foreColor', trumbowyg),
|
||||
dropdownClass: dropdownClass,
|
||||
},
|
||||
backColorBtnDef = {
|
||||
dropdown: buildDropdown('backColor', trumbowyg),
|
||||
dropdownClass: dropdownClass,
|
||||
};
|
||||
|
||||
trumbowyg.addBtnDef('foreColor', foreColorBtnDef);
|
||||
trumbowyg.addBtnDef('backColor', backColorBtnDef);
|
||||
},
|
||||
tagHandler: colorTagHandler
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function buildDropdown(fn, trumbowyg) {
|
||||
var dropdown = [],
|
||||
trumbowygColorOptions = trumbowyg.o.plugins.colors,
|
||||
colorList = trumbowygColorOptions[fn + 'List'] || trumbowygColorOptions.colorList;
|
||||
|
||||
$.each(colorList, function (i, color) {
|
||||
var btn = fn + color,
|
||||
btnDef = {
|
||||
fn: fn,
|
||||
forceCss: true,
|
||||
hasIcon: false,
|
||||
text: trumbowyg.lang['#' + color] || ('#' + color),
|
||||
param: '#' + color,
|
||||
style: 'background-color: #' + color + ';'
|
||||
};
|
||||
|
||||
if (trumbowygColorOptions.displayAsList && fn === 'foreColor') {
|
||||
btnDef.style = 'color: #' + color + ' !important;';
|
||||
}
|
||||
|
||||
trumbowyg.addBtnDef(btn, btnDef);
|
||||
dropdown.push(btn);
|
||||
});
|
||||
|
||||
// Remove color
|
||||
var removeColorButtonName = fn + 'Remove',
|
||||
removeColorBtnDef = {
|
||||
fn: 'removeFormat',
|
||||
hasIcon: false,
|
||||
param: fn,
|
||||
style: 'background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAG0lEQVQIW2NkQAAfEJMRmwBYhoGBYQtMBYoAADziAp0jtJTgAAAAAElFTkSuQmCC);'
|
||||
};
|
||||
|
||||
if (trumbowygColorOptions.displayAsList) {
|
||||
removeColorBtnDef.style = '';
|
||||
}
|
||||
|
||||
trumbowyg.addBtnDef(removeColorButtonName, removeColorBtnDef);
|
||||
dropdown.push(removeColorButtonName);
|
||||
|
||||
// Custom color
|
||||
if (trumbowygColorOptions['allowCustom' + fn.charAt(0).toUpperCase() + fn.substr(1)]) {
|
||||
// add free color btn
|
||||
var freeColorButtonName = fn + 'Free',
|
||||
freeColorBtnDef = {
|
||||
fn: function () {
|
||||
trumbowyg.openModalInsert(trumbowyg.lang[fn],
|
||||
{
|
||||
color: {
|
||||
label: fn,
|
||||
forceCss: true,
|
||||
type: 'color',
|
||||
value: '#FFFFFF'
|
||||
}
|
||||
},
|
||||
// callback
|
||||
function (values) {
|
||||
trumbowyg.execCmd(fn, values.color);
|
||||
return true;
|
||||
}
|
||||
);
|
||||
},
|
||||
hasIcon: false,
|
||||
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);
|
||||
1
public/js/plugins/trumbowyg/plugins/colors/trumbowyg.colors.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/colors/trumbowyg.colors.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(o){"use strict";function r(o){return("0"+parseInt(o).toString(16)).slice(-2)}function e(o){return o.search("rgb")===-1?o.replace("#",""):"rgba(0, 0, 0, 0)"===o?"transparent":(o=o.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/),r(o[1])+r(o[2])+r(o[3]))}function l(o,r){var l=[];if(!o.style)return l;if(""!==o.style.backgroundColor){var a=e(o.style.backgroundColor);r.o.plugins.colors.colorList.indexOf(a)>=0?l.push("backColor"+a):l.push("backColorFree")}var c;return""!==o.style.color?c=e(o.style.color):o.hasAttribute("color")&&(c=e(o.getAttribute("color"))),c&&(r.o.plugins.colors.colorList.indexOf(c)>=0?l.push("foreColor"+c):l.push("foreColorFree")),l}function a(r,e){var l=[],a=e.o.plugins.colors,c=a[r+"List"]||a.colorList;o.each(c,function(o,c){var f=r+c,t={fn:r,forceCss:!0,hasIcon:!1,text:e.lang["#"+c]||"#"+c,param:"#"+c,style:"background-color: #"+c+";"};a.displayAsList&&"foreColor"===r&&(t.style="color: #"+c+" !important;"),e.addBtnDef(f,t),l.push(f)});var f=r+"Remove",t={fn:"removeFormat",hasIcon:!1,param:r,style:"background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAG0lEQVQIW2NkQAAfEJMRmwBYhoGBYQtMBYoAADziAp0jtJTgAAAAAElFTkSuQmCC);"};if(a.displayAsList&&(t.style=""),e.addBtnDef(f,t),l.push(f),a["allowCustom"+r.charAt(0).toUpperCase()+r.substr(1)]){var d=r+"Free",n={fn:function(){e.openModalInsert(e.lang[r],{color:{label:r,forceCss:!0,type:"color",value:"#FFFFFF"}},function(o){return e.execCmd(r,o.color),!0})},hasIcon:!1,text:"#",style:"text-indent: 0; line-height: 20px; padding: 0 5px;"};e.addBtnDef(d,n),l.push(d)}return l}o.extend(!0,o.trumbowyg,{langs:{cs:{foreColor:"Barva textu",backColor:"Barva pozadí"},en:{foreColor:"Text color",backColor:"Background color",foreColorRemove:"Remove text color",backColorRemove:"Remove background color"},da:{foreColor:"Tekstfarve",backColor:"Baggrundsfarve"},fr:{foreColor:"Couleur du texte",backColor:"Couleur de fond",foreColorRemove:"Supprimer la couleur du texte",backColorRemove:"Supprimer la couleur de fond"},de:{foreColor:"Textfarbe",backColor:"Hintergrundfarbe"},nl:{foreColor:"Tekstkleur",backColor:"Achtergrondkleur"},sk:{foreColor:"Farba textu",backColor:"Farba pozadia"},zh_cn:{foreColor:"文字颜色",backColor:"背景颜色"},zh_tw:{foreColor:"文字顏色",backColor:"背景顏色"},ru:{foreColor:"Цвет текста",backColor:"Цвет выделения текста"},ja:{foreColor:"文字色",backColor:"背景色"},tr:{foreColor:"Yazı rengi",backColor:"Arkaplan rengi"},pt_br:{foreColor:"Cor de fonte",backColor:"Cor de fundo"},ko:{foreColor:"글자색",backColor:"배경색",foreColorRemove:"글자색 지우기",backColorRemove:"배경색 지우기"}}});var c={colorList:["ffffff","000000","eeece1","1f497d","4f81bd","c0504d","9bbb59","8064a2","4bacc6","f79646","ffff00","f2f2f2","7f7f7f","ddd9c3","c6d9f0","dbe5f1","f2dcdb","ebf1dd","e5e0ec","dbeef3","fdeada","fff2ca","d8d8d8","595959","c4bd97","8db3e2","b8cce4","e5b9b7","d7e3bc","ccc1d9","b7dde8","fbd5b5","ffe694","bfbfbf","3f3f3f","938953","548dd4","95b3d7","d99694","c3d69b","b2a2c7","b7dde8","fac08f","f2c314","a5a5a5","262626","494429","17365d","366092","953734","76923c","5f497a","92cddc","e36c09","c09100","7f7f7f","0c0c0c","1d1b10","0f243e","244061","632423","4f6128","3f3151","31859b","974806","7f6000"],foreColorList:null,backColorList:null,allowCustomForeColor:!0,allowCustomBackColor:!0,displayAsList:!1};o.extend(!0,o.trumbowyg,{plugins:{color:{init:function(o){o.o.plugins.colors=o.o.plugins.colors||c;var r=o.o.plugins.colors.displayAsList?o.o.prefix+"dropdown--color-list":"",e={dropdown:a("foreColor",o),dropdownClass:r},l={dropdown:a("backColor",o),dropdownClass:r};o.addBtnDef("foreColor",e),o.addBtnDef("backColor",l)},tagHandler:l}}})}(jQuery);
|
||||
68
public/js/plugins/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss
vendored
Normal file
68
public/js/plugins/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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:not(.trumbowyg-dropdown--color-list),
|
||||
.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) {
|
||||
max-width: 276px;
|
||||
padding: 7px 5px;
|
||||
overflow: initial;
|
||||
|
||||
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;
|
||||
width: 27px;
|
||||
height: 27px;
|
||||
background: inherit;
|
||||
border: 1px solid #fff;
|
||||
box-shadow: #000 0 0 2px;
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list {
|
||||
button:not(.trumbowyg-backColorRemove-dropdown-button) {
|
||||
position: relative;
|
||||
color: #fff !important;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
&::after {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 13px;
|
||||
left: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 5px solid transparent;
|
||||
border-left-color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
55
public/js/plugins/trumbowyg/plugins/colors/ui/trumbowyg.colors.css
vendored
Normal file
55
public/js/plugins/trumbowyg/plugins/colors/ui/trumbowyg.colors.css
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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:not(.trumbowyg-dropdown--color-list),
|
||||
.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) {
|
||||
max-width: 276px;
|
||||
padding: 7px 5px;
|
||||
overflow: initial; }
|
||||
.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button,
|
||||
.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) 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:not(.trumbowyg-dropdown--color-list) button:hover::after, .trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button:focus::after,
|
||||
.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button:hover::after,
|
||||
.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button:focus::after {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: -5px;
|
||||
left: -5px;
|
||||
width: 27px;
|
||||
height: 27px;
|
||||
background: inherit;
|
||||
border: 1px solid #fff;
|
||||
box-shadow: #000 0 0 2px;
|
||||
z-index: 10; }
|
||||
|
||||
.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button) {
|
||||
position: relative;
|
||||
color: #fff !important; }
|
||||
.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button):hover::after, .trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button):focus::after {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 13px;
|
||||
left: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 5px solid transparent;
|
||||
border-left-color: #fff; }
|
||||
2
public/js/plugins/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css
vendored
Normal file
2
public/js/plugins/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/** Trumbowyg v2.21.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
|
||||
.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list),.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list){max-width:276px;padding:7px 5px;overflow:initial}.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button,.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) 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:not(.trumbowyg-dropdown--color-list) button:focus::after,.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button:hover::after,.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button:focus::after,.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button:hover::after{content:" ";display:block;position:absolute;top:-5px;left:-5px;width:27px;height:27px;background:inherit;border:1px solid #fff;box-shadow:#000 0 0 2px;z-index:10}.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button){position:relative;color:#fff!important}.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button):focus::after,.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button):hover::after{content:" ";display:block;position:absolute;top:13px;left:0;width:0;height:0;border:5px solid transparent;border-left-color:#fff}
|
||||
1353
public/js/plugins/trumbowyg/plugins/emoji/trumbowyg.emoji.js
vendored
Normal file
1353
public/js/plugins/trumbowyg/plugins/emoji/trumbowyg.emoji.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
public/js/plugins/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
53
public/js/plugins/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss
vendored
Normal file
53
public/js/plugins/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
44
public/js/plugins/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css
vendored
Normal file
44
public/js/plugins/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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; }
|
||||
|
||||
.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; }
|
||||
2
public/js/plugins/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css
vendored
Normal file
2
public/js/plugins/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/** Trumbowyg v2.21.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}.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}
|
||||
95
public/js/plugins/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.js
vendored
Normal file
95
public/js/plugins/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.js
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
$.extend(true, $.trumbowyg, {
|
||||
langs: {
|
||||
// jshint camelcase:false
|
||||
en: {
|
||||
fontFamily: 'Font'
|
||||
},
|
||||
es: {
|
||||
fontFamily: 'Fuente'
|
||||
},
|
||||
da: {
|
||||
fontFamily: 'Skrifttype'
|
||||
},
|
||||
fr: {
|
||||
fontFamily: 'Police'
|
||||
},
|
||||
de: {
|
||||
fontFamily: 'Schriftart'
|
||||
},
|
||||
nl: {
|
||||
fontFamily: 'Lettertype'
|
||||
},
|
||||
tr: {
|
||||
fontFamily: 'Yazı Tipi'
|
||||
},
|
||||
zh_tw: {
|
||||
fontFamily: '字體',
|
||||
},
|
||||
pt_br: {
|
||||
fontFamily: 'Fonte',
|
||||
},
|
||||
ko: {
|
||||
fontFamily: '글꼴'
|
||||
},
|
||||
}
|
||||
});
|
||||
// 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 = $.extend({},
|
||||
defaultOptions,
|
||||
trumbowyg.o.plugins.fontfamily || {}
|
||||
);
|
||||
|
||||
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);
|
||||
1
public/js/plugins/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.min.js
vendored
Normal file
@@ -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"},es:{fontFamily:"Fuente"},da:{fontFamily:"Skrifttype"},fr:{fontFamily:"Police"},de:{fontFamily:"Schriftart"},nl:{fontFamily:"Lettertype"},tr:{fontFamily:"Yazı Tipi"},zh_tw:{fontFamily:"字體"},pt_br:{fontFamily:"Fonte"},ko:{fontFamily:"글꼴"}}});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(e){e.o.plugins.fontfamily=a.extend({},i,e.o.plugins.fontfamily||{}),e.addBtnDef("fontfamily",{dropdown:n(e),hasIcon:!1,text:e.lang.fontFamily})}}}})}(jQuery);
|
||||
257
public/js/plugins/trumbowyg/plugins/fontsize/trumbowyg.fontsize.js
vendored
Normal file
257
public/js/plugins/trumbowyg/plugins/fontsize/trumbowyg.fontsize.js
vendored
Normal file
@@ -0,0 +1,257 @@
|
||||
(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'
|
||||
},
|
||||
fontCustomSize: {
|
||||
title: 'Custom Font Size',
|
||||
label: 'Font Size',
|
||||
value: '48px'
|
||||
}
|
||||
},
|
||||
es: {
|
||||
fontsize: 'Tamaño de Fuente',
|
||||
fontsizes: {
|
||||
'x-small': 'Extra pequeña',
|
||||
'small': 'Pegueña',
|
||||
'medium': 'Regular',
|
||||
'large': 'Grande',
|
||||
'x-large': 'Extra Grande',
|
||||
'custom': 'Customizada'
|
||||
},
|
||||
fontCustomSize: {
|
||||
title: 'Tamaño de Fuente Customizada',
|
||||
label: 'Tamaño de Fuente',
|
||||
value: '48px'
|
||||
}
|
||||
},
|
||||
da: {
|
||||
fontsize: 'Skriftstørrelse',
|
||||
fontsizes: {
|
||||
'x-small': 'Ekstra lille',
|
||||
'small': 'Lille',
|
||||
'medium': 'Normal',
|
||||
'large': 'Stor',
|
||||
'x-large': 'Ekstra stor',
|
||||
'custom': 'Brugerdefineret'
|
||||
}
|
||||
},
|
||||
fr: {
|
||||
fontsize: 'Taille de la police',
|
||||
fontsizes: {
|
||||
'x-small': 'Très petit',
|
||||
'small': 'Petit',
|
||||
'medium': 'Normal',
|
||||
'large': 'Grand',
|
||||
'x-large': 'Très grand',
|
||||
'custom': 'Taille personnalisée'
|
||||
},
|
||||
fontCustomSize: {
|
||||
title: 'Taille de police personnalisée',
|
||||
label: 'Taille de la police',
|
||||
value: '48px'
|
||||
}
|
||||
},
|
||||
de: {
|
||||
fontsize: 'Schriftgröße',
|
||||
fontsizes: {
|
||||
'x-small': 'Sehr klein',
|
||||
'small': 'Klein',
|
||||
'medium': 'Normal',
|
||||
'large': 'Groß',
|
||||
'x-large': 'Sehr groß',
|
||||
'custom': 'Benutzerdefiniert'
|
||||
},
|
||||
fontCustomSize: {
|
||||
title: 'Benutzerdefinierte Schriftgröße',
|
||||
label: 'Schriftgröße',
|
||||
value: '48px'
|
||||
}
|
||||
},
|
||||
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'
|
||||
}
|
||||
},
|
||||
zh_tw: {
|
||||
fontsize: '字體大小',
|
||||
fontsizes: {
|
||||
'x-small': '最小',
|
||||
'small': '小',
|
||||
'medium': '中',
|
||||
'large': '大',
|
||||
'x-large': '最大',
|
||||
'custom': '自訂大小',
|
||||
},
|
||||
fontCustomSize: {
|
||||
title: '自訂義字體大小',
|
||||
label: '字體大小',
|
||||
value: '48px'
|
||||
}
|
||||
},
|
||||
pt_br: {
|
||||
fontsize: 'Tamanho da fonte',
|
||||
fontsizes: {
|
||||
'x-small': 'Extra pequeno',
|
||||
'small': 'Pequeno',
|
||||
'regular': 'Médio',
|
||||
'large': 'Grande',
|
||||
'x-large': 'Extra grande',
|
||||
'custom': 'Personalizado'
|
||||
},
|
||||
fontCustomSize: {
|
||||
title: 'Tamanho de Fonte Personalizado',
|
||||
label: 'Tamanho de Fonte',
|
||||
value: '48px'
|
||||
}
|
||||
},
|
||||
it: {
|
||||
fontsize: 'Dimensioni del testo',
|
||||
fontsizes: {
|
||||
'x-small': 'Molto piccolo',
|
||||
'small': 'piccolo',
|
||||
'regular': 'normale',
|
||||
'large': 'grande',
|
||||
'x-large': 'Molto grande',
|
||||
'custom': 'Personalizzato'
|
||||
},
|
||||
fontCustomSize: {
|
||||
title: 'Dimensioni del testo personalizzato',
|
||||
label: 'Dimensioni del testo',
|
||||
value: '48px'
|
||||
}
|
||||
},
|
||||
ko: {
|
||||
fontsize: '글꼴 크기',
|
||||
fontsizes: {
|
||||
'x-small': '아주 작게',
|
||||
'small': '작게',
|
||||
'medium': '보통',
|
||||
'large': '크게',
|
||||
'x-large': '아주 크게',
|
||||
'custom': '사용자 지정'
|
||||
},
|
||||
fontCustomSize: {
|
||||
title: '사용자 지정 글꼴 크기',
|
||||
label: '글꼴 크기',
|
||||
value: '48px'
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
// jshint camelcase:true
|
||||
|
||||
var defaultOptions = {
|
||||
sizeList: [
|
||||
'x-small',
|
||||
'small',
|
||||
'medium',
|
||||
'large',
|
||||
'x-large'
|
||||
],
|
||||
allowCustomSize: true
|
||||
};
|
||||
|
||||
// Add dropdown with font sizes
|
||||
$.extend(true, $.trumbowyg, {
|
||||
plugins: {
|
||||
fontsize: {
|
||||
init: function (trumbowyg) {
|
||||
trumbowyg.o.plugins.fontsize = $.extend({},
|
||||
defaultOptions,
|
||||
trumbowyg.o.plugins.fontsize || {}
|
||||
);
|
||||
|
||||
trumbowyg.addBtnDef('fontsize', {
|
||||
dropdown: buildDropdown(trumbowyg)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function setFontSize(trumbowyg, size) {
|
||||
trumbowyg.$ed.focus();
|
||||
trumbowyg.saveRange();
|
||||
var text = trumbowyg.range.startContainer.parentElement;
|
||||
var selectedText = trumbowyg.getRangeText();
|
||||
if ($(text).html() === selectedText) {
|
||||
$(text).css('font-size', size);
|
||||
} else {
|
||||
trumbowyg.range.deleteContents();
|
||||
var html = '<span style="font-size: ' + size + ';">' + selectedText + '</span>';
|
||||
var node = $(html)[0];
|
||||
trumbowyg.range.insertNode(node);
|
||||
}
|
||||
trumbowyg.restoreRange();
|
||||
}
|
||||
|
||||
function buildDropdown(trumbowyg) {
|
||||
var dropdown = [];
|
||||
|
||||
$.each(trumbowyg.o.plugins.fontsize.sizeList, function (index, size) {
|
||||
trumbowyg.addBtnDef('fontsize_' + size, {
|
||||
text: '<span style="font-size: ' + size + ';">' + (trumbowyg.lang.fontsizes[size] || size) + '</span>',
|
||||
hasIcon: false,
|
||||
fn: function () {
|
||||
setFontSize(trumbowyg, size);
|
||||
}
|
||||
});
|
||||
dropdown.push('fontsize_' + size);
|
||||
});
|
||||
|
||||
if (trumbowyg.o.plugins.fontsize.allowCustomSize) {
|
||||
var customSizeButtonName = 'fontsize_custom';
|
||||
var customSizeBtnDef = {
|
||||
fn: function () {
|
||||
trumbowyg.openModalInsert(trumbowyg.lang.fontCustomSize.title,
|
||||
{
|
||||
size: {
|
||||
label: trumbowyg.lang.fontCustomSize.label,
|
||||
value: trumbowyg.lang.fontCustomSize.value
|
||||
}
|
||||
},
|
||||
function (form) {
|
||||
setFontSize(trumbowyg, form.size);
|
||||
return true;
|
||||
}
|
||||
);
|
||||
},
|
||||
text: '<span style="font-size: medium;">' + trumbowyg.lang.fontsizes.custom + '</span>',
|
||||
hasIcon: false
|
||||
};
|
||||
trumbowyg.addBtnDef(customSizeButtonName, customSizeBtnDef);
|
||||
dropdown.push(customSizeButtonName);
|
||||
}
|
||||
|
||||
return dropdown;
|
||||
}
|
||||
})(jQuery);
|
||||
1
public/js/plugins/trumbowyg/plugins/fontsize/trumbowyg.fontsize.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/fontsize/trumbowyg.fontsize.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){"use strict";function t(t,l){t.$ed.focus(),t.saveRange();var a=t.range.startContainer.parentElement,o=t.getRangeText();if(e(a).html()===o)e(a).css("font-size",l);else{t.range.deleteContents();var s='<span style="font-size: '+l+';">'+o+"</span>",n=e(s)[0];t.range.insertNode(n)}t.restoreRange()}function l(l){var a=[];if(e.each(l.o.plugins.fontsize.sizeList,function(e,o){l.addBtnDef("fontsize_"+o,{text:'<span style="font-size: '+o+';">'+(l.lang.fontsizes[o]||o)+"</span>",hasIcon:!1,fn:function(){t(l,o)}}),a.push("fontsize_"+o)}),l.o.plugins.fontsize.allowCustomSize){var o="fontsize_custom",s={fn:function(){l.openModalInsert(l.lang.fontCustomSize.title,{size:{label:l.lang.fontCustomSize.label,value:l.lang.fontCustomSize.value}},function(e){return t(l,e.size),!0})},text:'<span style="font-size: medium;">'+l.lang.fontsizes.custom+"</span>",hasIcon:!1};l.addBtnDef(o,s),a.push(o)}return a}e.extend(!0,e.trumbowyg,{langs:{en:{fontsize:"Font size",fontsizes:{"x-small":"Extra small",small:"Small",medium:"Regular",large:"Large","x-large":"Extra large",custom:"Custom"},fontCustomSize:{title:"Custom Font Size",label:"Font Size",value:"48px"}},es:{fontsize:"Tamaño de Fuente",fontsizes:{"x-small":"Extra pequeña",small:"Pegueña",medium:"Regular",large:"Grande","x-large":"Extra Grande",custom:"Customizada"},fontCustomSize:{title:"Tamaño de Fuente Customizada",label:"Tamaño de Fuente",value:"48px"}},da:{fontsize:"Skriftstørrelse",fontsizes:{"x-small":"Ekstra lille",small:"Lille",medium:"Normal",large:"Stor","x-large":"Ekstra stor",custom:"Brugerdefineret"}},fr:{fontsize:"Taille de la police",fontsizes:{"x-small":"Très petit",small:"Petit",medium:"Normal",large:"Grand","x-large":"Très grand",custom:"Taille personnalisée"},fontCustomSize:{title:"Taille de police personnalisée",label:"Taille de la police",value:"48px"}},de:{fontsize:"Schriftgröße",fontsizes:{"x-small":"Sehr klein",small:"Klein",medium:"Normal",large:"Groß","x-large":"Sehr groß",custom:"Benutzerdefiniert"},fontCustomSize:{title:"Benutzerdefinierte Schriftgröße",label:"Schriftgröße",value:"48px"}},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"}},zh_tw:{fontsize:"字體大小",fontsizes:{"x-small":"最小",small:"小",medium:"中",large:"大","x-large":"最大",custom:"自訂大小"},fontCustomSize:{title:"自訂義字體大小",label:"字體大小",value:"48px"}},pt_br:{fontsize:"Tamanho da fonte",fontsizes:{"x-small":"Extra pequeno",small:"Pequeno",regular:"Médio",large:"Grande","x-large":"Extra grande",custom:"Personalizado"},fontCustomSize:{title:"Tamanho de Fonte Personalizado",label:"Tamanho de Fonte",value:"48px"}},it:{fontsize:"Dimensioni del testo",fontsizes:{"x-small":"Molto piccolo",small:"piccolo",regular:"normale",large:"grande","x-large":"Molto grande",custom:"Personalizzato"},fontCustomSize:{title:"Dimensioni del testo personalizzato",label:"Dimensioni del testo",value:"48px"}},ko:{fontsize:"글꼴 크기",fontsizes:{"x-small":"아주 작게",small:"작게",medium:"보통",large:"크게","x-large":"아주 크게",custom:"사용자 지정"},fontCustomSize:{title:"사용자 지정 글꼴 크기",label:"글꼴 크기",value:"48px"}}}});var a={sizeList:["x-small","small","medium","large","x-large"],allowCustomSize:!0};e.extend(!0,e.trumbowyg,{plugins:{fontsize:{init:function(t){t.o.plugins.fontsize=e.extend({},a,t.o.plugins.fontsize||{}),t.addBtnDef("fontsize",{dropdown:l(t)})}}}})}(jQuery);
|
||||
182
public/js/plugins/trumbowyg/plugins/giphy/trumbowyg.giphy.js
vendored
Normal file
182
public/js/plugins/trumbowyg/plugins/giphy/trumbowyg.giphy.js
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
$.extend(true, $.trumbowyg, {
|
||||
langs: {
|
||||
// jshint camelcase:false
|
||||
en: {
|
||||
giphy: 'Insert GIF',
|
||||
},
|
||||
fr: {
|
||||
giphy: 'Insérer un GIF',
|
||||
},
|
||||
// jshint camelcase:true
|
||||
}
|
||||
});
|
||||
|
||||
var giphyLogo = '<svg viewBox="0 0 231 53" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M48.32 22.386c0-1.388-.252-1.892-1.767-1.85-3.448.126-6.855.042-10.303.042H25.443c-.927 0-1.346.211-1.305 1.22.085 2.86.085 5.72.043 8.58 0 .883.252 1.169 1.169 1.135 2.018-.084 3.995-.042 6.014 0 1.64 0 4.164-.546 4.752.252.841 1.169.421 3.364.337 5.089-.043.547-.547 1.304-1.094 1.598-2.692 1.556-5.678 2.018-8.747 1.892-5.342-.21-9.336-2.439-11.481-7.527-1.388-3.364-1.725-6.855-1.01-10.43 1.01-4.963 3.407-8.747 8.58-10.051 5.215-1.305 10.136-.547 14.467 2.817 1.219.967 1.798.715 2.691-.294 1.514-1.724 3.154-3.322 4.753-4.963 1.892-1.933 1.892-1.892-.169-3.7C38.429.813 31.238-.617 23.5.224 12.818 1.393 5.248 6.658 1.59 17.045-.177 22.008-.428 27.097.623 32.227c1.682 7.914 5.551 14.12 13.289 17.368 6.898 2.901 14.046 3.448 21.321 1.598 4.331-1.093 8.411-2.608 11.354-6.223 1.136-1.388 1.725-2.902 1.682-4.71l.043-17.873.008-.001zm125.153 3.784l.042-23.046c0-1.136-.168-1.598-1.472-1.556a238.02 238.02 0 0 1-11.017 0c-1.136-.042-1.439.337-1.439 1.439v15.645c0 1.345-.421 1.556-1.641 1.556a422.563 422.563 0 0 0-14.593 0c-1.262.042-1.472-.421-1.439-1.556l.043-15.813c0-.926-.169-1.304-1.17-1.262h-11.513c-.927 0-1.304.169-1.304 1.22v46.764c0 .967.252 1.262 1.219 1.262h11.512c1.169.042 1.262-.462 1.262-1.388l-.042-15.644c0-1.053.251-1.346 1.304-1.346h15.14c1.22 0 1.388.421 1.388 1.472l-.042 15.477c0 1.093.21 1.472 1.388 1.439 3.615-.085 7.233-.085 10.807 0 1.304.042 1.598-.337 1.598-1.598l-.042-23.047.011-.018zM106.565 1.654c-8.369-.211-16.728-.126-25.065-.211-1.346 0-1.767.337-1.767 1.724l.043 23.004v23.215c0 1.009.168 1.439 1.304 1.387a271.22 271.22 0 0 1 11.691 0c1.094 0 1.346-.336 1.346-1.345l-.042-10.64c0-1.052.294-1.345 1.345-1.345 3.322.042 6.645.085 9.967-.085 4.407-.21 8.621-1.219 12.111-4.12 5.551-4.584 7.613-12.701 5.131-20.061-2.313-6.561-8.747-11.354-16.064-11.522v-.001zm-3.028 24.013c-2.818.042-5.594-.043-8.411.042-1.169.042-1.439-.378-1.345-1.439.084-1.556 0-3.069 0-4.626v-5.131c-.043-.841.251-1.094 1.052-1.052 2.986.042 5.929-.085 8.915.042 3.616.126 5.887 2.692 5.846 6.266-.126 3.658-2.313 5.846-6.055 5.887l-.002.011zM229.699 1.569c-4.458 0-8.915-.042-13.415.043-.629 0-1.472.503-1.85 1.052a505.695 505.695 0 0 0-8.957 14.214c-.884 1.472-1.22 1.169-1.977-.084l-8.496-14.089c-.503-.841-1.052-1.136-2.018-1.136l-13.078.043c-.462 0-.967.125-1.439.21.21.378.378.799.629 1.169l17.412 27.167c.462.715.715 1.682.757 2.524v16.653c0 1.052.168 1.514 1.388 1.472 3.784-.084 7.57-.084 11.354 0 1.136.043 1.304-.377 1.304-1.387l-.042-8.58c0-2.734-.084-5.51.042-8.243.043-.926.337-1.933.841-2.649l18.167-27.041c.252-.337.337-.758.547-1.17a3.636 3.636 0 0 0-1.169-.168zM70.104 2.661c0-1.009-.294-1.219-1.262-1.219H57.69c-1.262-.043-1.472.377-1.472 1.513l.042 23.004v23.34c0 1.053.126 1.514 1.346 1.473 3.7-.085 7.444-.043 11.152 0 .966 0 1.387-.085 1.387-1.262l-.042-46.857.001.008z" fill="currentColor" fill-rule="nonzero"/></svg>';
|
||||
|
||||
var CANCEL_EVENT = 'tbwcancel';
|
||||
|
||||
// Throttle helper
|
||||
function trumbowygThrottle(callback, delay) {
|
||||
var last;
|
||||
var timer;
|
||||
|
||||
return function () {
|
||||
var context = this;
|
||||
var now = +new Date();
|
||||
var args = arguments;
|
||||
|
||||
if (last && now < last + delay) {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(function () {
|
||||
last = now;
|
||||
callback.apply(context, args);
|
||||
}, delay);
|
||||
} else {
|
||||
last = now;
|
||||
callback.apply(context, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Fills modal with response gifs
|
||||
function renderGifs(response, $giphyModal, trumbowyg, mustEmpty) {
|
||||
var width = ($giphyModal.width() - 20) / 3;
|
||||
|
||||
var html = response.data
|
||||
.filter(function (gifData) {
|
||||
return gifData.images.downsized.url !== '';
|
||||
})
|
||||
.map(function (gifData) {
|
||||
var image = gifData.images.downsized,
|
||||
imageRatio = image.height / image.width;
|
||||
|
||||
return '<div class="img-container"><img src=' + image.url + ' width="' + width + '" height="' + imageRatio * width + '" loading="lazy" onload="this.classList.add(\'tbw-loaded\')"/></div>';
|
||||
})
|
||||
.join('')
|
||||
;
|
||||
|
||||
if (mustEmpty === true) {
|
||||
if (html.length === 0) {
|
||||
if ($('.' + trumbowyg.o.prefix + 'giphy-no-result', $giphyModal).length > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
html = '<img class="' + trumbowyg.o.prefix + 'giphy-no-result" src="' + trumbowyg.o.plugins.giphy.noResultGifUrl + '"/>';
|
||||
}
|
||||
|
||||
$giphyModal.empty();
|
||||
}
|
||||
$giphyModal.append(html);
|
||||
$('img', $giphyModal).on('click', function () {
|
||||
trumbowyg.restoreRange();
|
||||
trumbowyg.execCmd('insertImage', $(this).attr('src'), false, true);
|
||||
$('img', $giphyModal).off();
|
||||
trumbowyg.closeModal();
|
||||
});
|
||||
}
|
||||
|
||||
var defaultOptions = {
|
||||
rating: 'g',
|
||||
apiKey: null,
|
||||
throttleDelay: 300,
|
||||
noResultGifUrl: 'https://media.giphy.com/media/2Faz9FbRzmwxY0pZS/giphy.gif'
|
||||
};
|
||||
|
||||
// Add dropdown with font sizes
|
||||
$.extend(true, $.trumbowyg, {
|
||||
plugins: {
|
||||
giphy: {
|
||||
init: function (trumbowyg) {
|
||||
trumbowyg.o.plugins.giphy = $.extend({},
|
||||
defaultOptions,
|
||||
trumbowyg.o.plugins.giphy || {}
|
||||
);
|
||||
|
||||
trumbowyg.addBtnDef('giphy', {
|
||||
fn: function() {
|
||||
if (trumbowyg.o.plugins.giphy.apiKey === null) {
|
||||
throw new Error('You must set a Giphy API Key');
|
||||
}
|
||||
|
||||
var BASE_URL = 'https://api.giphy.com/v1/gifs/search?api_key=' + trumbowyg.o.plugins.giphy.apiKey + '&rating=' + trumbowyg.o.plugins.giphy.rating,
|
||||
DEFAULT_URL = BASE_URL.replace('/search', '/trending');
|
||||
var previousAjaxCall = {abort: function () {}};
|
||||
var prefix = trumbowyg.o.prefix;
|
||||
|
||||
// Create and open the modal
|
||||
var searchInput = '<input name="" class="' + prefix + 'giphy-search" placeholder="Search a GIF" autofocus="autofocus">',
|
||||
closeButton = '<button class="' + prefix + 'giphy-close" title="' + trumbowyg.lang.close + '"><svg><use xlink:href="' + trumbowyg.svgPath + '#' + prefix + 'close"/></svg></button>',
|
||||
poweredByGiphy = '<div class="' + prefix + 'powered-by-giphy"><span>Powered by</span>' + giphyLogo + '</div>',
|
||||
giphyModalHtml = searchInput + closeButton + poweredByGiphy + '<div class="' + prefix + 'giphy-modal-scroll"><div class="' + prefix + 'giphy-modal"></div></div>';
|
||||
|
||||
trumbowyg
|
||||
.openModal(null, giphyModalHtml, false)
|
||||
.one(CANCEL_EVENT, function () {
|
||||
try {
|
||||
previousAjaxCall.abort();
|
||||
} catch (e) {}
|
||||
|
||||
trumbowyg.closeModal();
|
||||
});
|
||||
|
||||
var $giphyInput = $('.' + prefix + 'giphy-search'),
|
||||
$giphyClose = $('.' + prefix + 'giphy-close'),
|
||||
$giphyModal = $('.' + prefix + 'giphy-modal');
|
||||
|
||||
var ajaxError = function () {
|
||||
if (!navigator.onLine && !$('.' + prefix + 'giphy-offline', $giphyModal).length) {
|
||||
$giphyModal.empty();
|
||||
$giphyModal.append('<p class="' + prefix + 'giphy-offline">You are offline</p>');
|
||||
}
|
||||
};
|
||||
|
||||
// Load trending gifs as default
|
||||
$.ajax({
|
||||
url: DEFAULT_URL,
|
||||
dataType: 'json',
|
||||
|
||||
success: function(response) {
|
||||
renderGifs(response, $giphyModal, trumbowyg, true);
|
||||
},
|
||||
error: ajaxError
|
||||
});
|
||||
|
||||
var searchGifsOnInput = function () {
|
||||
var query = $giphyInput.val();
|
||||
|
||||
if (query.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
previousAjaxCall.abort();
|
||||
} catch (e) {}
|
||||
|
||||
previousAjaxCall = $.ajax({
|
||||
url: BASE_URL + '&q=' + encodeURIComponent(query),
|
||||
dataType: 'json',
|
||||
|
||||
success: function(response) {
|
||||
renderGifs(response, $giphyModal, trumbowyg, true);
|
||||
},
|
||||
error: ajaxError
|
||||
});
|
||||
};
|
||||
var throttledInputRequest = trumbowygThrottle(searchGifsOnInput, trumbowyg.o.plugins.giphy.throttleDelay);
|
||||
|
||||
$giphyInput.on('input', throttledInputRequest);
|
||||
$giphyInput.focus();
|
||||
|
||||
$giphyClose.one('click', function() {
|
||||
$giphyModal.trigger(CANCEL_EVENT);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
1
public/js/plugins/trumbowyg/plugins/giphy/trumbowyg.giphy.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/giphy/trumbowyg.giphy.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
111
public/js/plugins/trumbowyg/plugins/giphy/ui/sass/trumbowyg.giphy.scss
vendored
Normal file
111
public/js/plugins/trumbowyg/plugins/giphy/ui/sass/trumbowyg.giphy.scss
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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-giphy-button svg {
|
||||
transform: scale(1.22);
|
||||
}
|
||||
|
||||
.trumbowyg-giphy-search {
|
||||
display: block;
|
||||
width: 80%;
|
||||
margin: 5%;
|
||||
padding-left: 10px;
|
||||
padding-right: 150px;
|
||||
}
|
||||
|
||||
.trumbowyg-giphy-close {
|
||||
position: absolute;
|
||||
top: calc(5% + 8px);
|
||||
right: calc(5% - 2px);
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: none;
|
||||
border: 1px solid transparent;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
outline: none;
|
||||
background: #ecf0f1;
|
||||
}
|
||||
&:focus {
|
||||
border-color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
}
|
||||
|
||||
.trumbowyg-powered-by-giphy {
|
||||
position: absolute;
|
||||
top: calc(5% + 12px);
|
||||
right: calc(15% + 10px);
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
|
||||
span {
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
font-size: 10px;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
svg {
|
||||
width: 66px;
|
||||
height: 15px;
|
||||
vertical-align: bottom;
|
||||
margin-left: 6px;
|
||||
opacity: 0.45;
|
||||
}
|
||||
}
|
||||
|
||||
.trumbowyg-giphy-modal-scroll {
|
||||
overflow: auto;
|
||||
overflow-x: hidden;
|
||||
height: 240px;
|
||||
}
|
||||
|
||||
.trumbowyg-giphy-modal {
|
||||
padding: 0 5%;
|
||||
columns: 3;
|
||||
column-gap: 10px;
|
||||
|
||||
.trumbowyg-giphy-no-result {
|
||||
width: 250%;
|
||||
margin: 13% 0 0 29%;
|
||||
}
|
||||
|
||||
.trumbowyg-giphy-offline {
|
||||
font-size: 18px;
|
||||
width: 305%;
|
||||
height: 600px;
|
||||
margin-top: 95px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.trumbowyg-giphy-modal .img-container {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
background-color: #ecf0f1;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
transition: opacity 150ms;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
border: #2ecc71 solid 3px;
|
||||
}
|
||||
}
|
||||
|
||||
img.tbw-loaded {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
90
public/js/plugins/trumbowyg/plugins/giphy/ui/trumbowyg.giphy.css
vendored
Normal file
90
public/js/plugins/trumbowyg/plugins/giphy/ui/trumbowyg.giphy.css
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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-giphy-button svg {
|
||||
transform: scale(1.22); }
|
||||
|
||||
.trumbowyg-giphy-search {
|
||||
display: block;
|
||||
width: 80%;
|
||||
margin: 5%;
|
||||
padding-left: 10px;
|
||||
padding-right: 150px; }
|
||||
|
||||
.trumbowyg-giphy-close {
|
||||
position: absolute;
|
||||
top: calc(5% + 8px);
|
||||
right: calc(5% - 2px);
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: none;
|
||||
border: 1px solid transparent; }
|
||||
.trumbowyg-giphy-close:hover, .trumbowyg-giphy-close:focus {
|
||||
outline: none;
|
||||
background: #ecf0f1; }
|
||||
.trumbowyg-giphy-close:focus {
|
||||
border-color: rgba(0, 0, 0, 0.3); }
|
||||
|
||||
.trumbowyg-powered-by-giphy {
|
||||
position: absolute;
|
||||
top: calc(5% + 12px);
|
||||
right: calc(15% + 10px);
|
||||
pointer-events: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none; }
|
||||
.trumbowyg-powered-by-giphy span {
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
font-size: 10px;
|
||||
opacity: 0.6; }
|
||||
.trumbowyg-powered-by-giphy svg {
|
||||
width: 66px;
|
||||
height: 15px;
|
||||
vertical-align: bottom;
|
||||
margin-left: 6px;
|
||||
opacity: 0.45; }
|
||||
|
||||
.trumbowyg-giphy-modal-scroll {
|
||||
overflow: auto;
|
||||
overflow-x: hidden;
|
||||
height: 240px; }
|
||||
|
||||
.trumbowyg-giphy-modal {
|
||||
padding: 0 5%;
|
||||
-moz-columns: 3;
|
||||
columns: 3;
|
||||
-moz-column-gap: 10px;
|
||||
column-gap: 10px; }
|
||||
.trumbowyg-giphy-modal .trumbowyg-giphy-no-result {
|
||||
width: 250%;
|
||||
margin: 13% 0 0 29%; }
|
||||
.trumbowyg-giphy-modal .trumbowyg-giphy-offline {
|
||||
font-size: 18px;
|
||||
width: 305%;
|
||||
height: 600px;
|
||||
margin-top: 95px;
|
||||
text-align: center; }
|
||||
|
||||
.trumbowyg-giphy-modal .img-container {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
background-color: #ecf0f1; }
|
||||
.trumbowyg-giphy-modal .img-container img {
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
transition: opacity 150ms; }
|
||||
.trumbowyg-giphy-modal .img-container img:hover, .trumbowyg-giphy-modal .img-container img:focus {
|
||||
border: #2ecc71 solid 3px; }
|
||||
.trumbowyg-giphy-modal .img-container img.tbw-loaded {
|
||||
opacity: 1; }
|
||||
2
public/js/plugins/trumbowyg/plugins/giphy/ui/trumbowyg.giphy.min.css
vendored
Normal file
2
public/js/plugins/trumbowyg/plugins/giphy/ui/trumbowyg.giphy.min.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/** Trumbowyg v2.21.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
|
||||
.trumbowyg-giphy-button svg{transform:scale(1.22)}.trumbowyg-giphy-search{display:block;width:80%;margin:5%;padding-left:10px;padding-right:150px}.trumbowyg-giphy-close{position:absolute;top:calc(5% + 8px);right:calc(5% - 2px);width:30px;height:30px;background:0 0;border:1px solid transparent}.trumbowyg-giphy-close:focus,.trumbowyg-giphy-close:hover{outline:0;background:#ecf0f1}.trumbowyg-giphy-close:focus{border-color:rgba(0,0,0,.3)}.trumbowyg-powered-by-giphy{position:absolute;top:calc(5% + 12px);right:calc(15% + 10px);pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.trumbowyg-powered-by-giphy span{text-transform:uppercase;font-weight:700;font-size:10px;opacity:.6}.trumbowyg-powered-by-giphy svg{width:66px;height:15px;vertical-align:bottom;margin-left:6px;opacity:.45}.trumbowyg-giphy-modal-scroll{overflow:auto;overflow-x:hidden;height:240px}.trumbowyg-giphy-modal{padding:0 5%;-moz-columns:3;columns:3;-moz-column-gap:10px;column-gap:10px}.trumbowyg-giphy-modal .trumbowyg-giphy-no-result{width:250%;margin:13% 0 0 29%}.trumbowyg-giphy-modal .trumbowyg-giphy-offline{font-size:18px;width:305%;height:600px;margin-top:95px;text-align:center}.trumbowyg-giphy-modal .img-container{width:100%;margin-bottom:10px;background-color:#ecf0f1}.trumbowyg-giphy-modal .img-container img{width:100%;cursor:pointer;opacity:0;transition:opacity 150ms}.trumbowyg-giphy-modal .img-container img:focus,.trumbowyg-giphy-modal .img-container img:hover{border:3px solid #2ecc71}.trumbowyg-giphy-modal .img-container img.tbw-loaded{opacity:1}
|
||||
90
public/js/plugins/trumbowyg/plugins/highlight/trumbowyg.highlight.js
vendored
Normal file
90
public/js/plugins/trumbowyg/plugins/highlight/trumbowyg.highlight.js
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
/* 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.hasOwnProperty(lang)) {
|
||||
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: {
|
||||
// jshint camelcase:false
|
||||
en: {
|
||||
highlight: 'Code syntax highlight'
|
||||
},
|
||||
pt_br: {
|
||||
highlight: 'Realçar sintaxe de código'
|
||||
},
|
||||
ko: {
|
||||
highlight: '코드 문법 하이라이트'
|
||||
},
|
||||
// jshint camelcase:true
|
||||
},
|
||||
// Add our plugin to Trumbowyg registered 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);
|
||||
1
public/js/plugins/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(i,n){"use strict";function e(i,e){return['<pre class="language-'+e+'">','<code class="language-'+e+'">'+n.highlight(i,n.languages[e])+"</code>","</pre>"].join("")}function o(i){return{fn:function(){var o=i.openModal("Code",['<div class="'+i.o.prefix+'highlight-form-group">',' <select class="'+i.o.prefix+'highlight-form-control language">',function(){var i="";for(var e in n.languages)n.languages.hasOwnProperty(e)&&(i+='<option value="'+e+'">'+e+"</option>");return i}()," </select>","</div>",'<div class="'+i.o.prefix+'highlight-form-group">',' <textarea class="'+i.o.prefix+'highlight-form-control code"></textarea>',"</div>"].join("\n")),t=o.find(".language"),g=o.find(".code");o.on("tbwconfirm",function(){i.restoreRange(),i.execCmd("insertHTML",e(g.val(),t.val())),i.execCmd("insertHTML","<p><br></p>"),i.closeModal()}),o.on("tbwcancel",function(){i.closeModal()})}}}var t={};i.extend(!0,i.trumbowyg,{langs:{en:{highlight:"Code syntax highlight"},pt_br:{highlight:"Realçar sintaxe de código"},ko:{highlight:"코드 문법 하이라이트"}},plugins:{highlight:{init:function(n){n.o.plugins.highlight=i.extend(!0,{},t,n.o.plugins.highlight||{}),n.addBtnDef("highlight",o(n))}}}})}(jQuery,Prism);
|
||||
25
public/js/plugins/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss
vendored
Normal file
25
public/js/plugins/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
20
public/js/plugins/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css
vendored
Normal file
20
public/js/plugins/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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; }
|
||||
2
public/js/plugins/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css
vendored
Normal file
2
public/js/plugins/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/** Trumbowyg v2.21.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}
|
||||
216
public/js/plugins/trumbowyg/plugins/history/trumbowyg.history.js
vendored
Normal file
216
public/js/plugins/trumbowyg/plugins/history/trumbowyg.history.js
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
/*/* ===========================================================
|
||||
* 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: {
|
||||
// jshint camelcase:false
|
||||
de: {
|
||||
history: {
|
||||
redo: 'Wiederholen',
|
||||
undo: 'Rückgängig'
|
||||
}
|
||||
},
|
||||
en: {
|
||||
history: {
|
||||
redo: 'Redo',
|
||||
undo: 'Undo'
|
||||
}
|
||||
},
|
||||
da: {
|
||||
history: {
|
||||
redo: 'Annuller fortryd',
|
||||
undo: 'Fortryd'
|
||||
}
|
||||
},
|
||||
fr: {
|
||||
history: {
|
||||
redo: 'Annuler',
|
||||
undo: 'Rétablir'
|
||||
}
|
||||
},
|
||||
zh_tw: {
|
||||
history: {
|
||||
redo: '重做',
|
||||
undo: '復原'
|
||||
}
|
||||
},
|
||||
pt_br: {
|
||||
history: {
|
||||
redo: 'Refazer',
|
||||
undo: 'Desfazer'
|
||||
}
|
||||
},
|
||||
ko: {
|
||||
history: {
|
||||
redo: '다시 실행',
|
||||
undo: '되돌리기'
|
||||
}
|
||||
},
|
||||
// jshint camelcase:true
|
||||
},
|
||||
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 modified 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);
|
||||
1
public/js/plugins/trumbowyg/plugins/history/trumbowyg.history.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/history/trumbowyg.history.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(o){"use strict";o.extend(!0,o.trumbowyg,{langs:{de:{history:{redo:"Wiederholen",undo:"Rückgängig"}},en:{history:{redo:"Redo",undo:"Undo"}},da:{history:{redo:"Annuller fortryd",undo:"Fortryd"}},fr:{history:{redo:"Annuler",undo:"Rétablir"}},zh_tw:{history:{redo:"重做",undo:"復原"}},pt_br:{history:{redo:"Refazer",undo:"Desfazer"}},ko:{history:{redo:"다시 실행",undo:"되돌리기"}}},plugins:{history:{init:function(i){i.o.plugins.history=o.extend(!0,{_stack:[],_index:-1,_focusEl:void 0},i.o.plugins.history||{});var t={title:i.lang.history.redo,ico:"redo",key:"Y",fn:function(){if(i.o.plugins.history._index<i.o.plugins.history._stack.length-1){i.o.plugins.history._index+=1;var o=i.o.plugins.history._index,t=i.o.plugins.history._stack[o];i.execCmd("html",t),i.o.plugins.history._stack[o]=i.$ed.html(),l(),s()}}},n={title:i.lang.history.undo,ico:"undo",key:"Z",fn:function(){if(i.o.plugins.history._index>0){i.o.plugins.history._index-=1;var o=i.o.plugins.history._index,t=i.o.plugins.history._stack[o];i.execCmd("html",t),i.o.plugins.history._stack[o]=i.$ed.html(),l(),s()}}},e=function(){var t,n,e=i.o.plugins.history._index,r=i.o.plugins.history._stack,l=r.slice(-1)[0]||"<p></p>",u=r[e],h=i.$ed.html(),c=i.doc.getSelection().focusNode,g="",a=i.o.plugins.history._focusEl;t=o("<div>"+l+"</div>").find("*").map(function(){return this.localName}),n=o("<div>"+h+"</div>").find("*").map(function(){return this.localName}),c&&(i.o.plugins.history._focusEl=c,g=c.outerHTML||c.textContent),h!==u&&(g.slice(-1).match(/\s/)||!d(t,n)||i.o.plugins.history._index<=0||c!==a?(i.o.plugins.history._index+=1,i.o.plugins.history._stack=r.slice(0,i.o.plugins.history._index),i.o.plugins.history._stack.push(h)):i.o.plugins.history._stack[e]=h,s())},s=function(){var o=i.o.plugins.history._index,t=i.o.plugins.history._stack.length,n=o>0,e=0!==t&&o!==t-1;r("historyUndo",n),r("historyRedo",e)},r=function(o,t){var n=i.$box.find(".trumbowyg-"+o+"-button");t?n.removeClass("trumbowyg-disable"):n.hasClass("trumbowyg-disable")||n.addClass("trumbowyg-disable")},d=function(o,i){if(o===i)return!0;if(null==o||null==i)return!1;if(o.length!==i.length)return!1;for(var t=0;t<o.length;t+=1)if(o[t]!==i[t])return!1;return!0},l=function(){var o=i.doc.getSelection().focusNode,t=i.doc.createRange();o.childNodes.length>0&&(t.setStartAfter(o.childNodes[o.childNodes.length-1]),t.setEndAfter(o.childNodes[o.childNodes.length-1]),i.doc.getSelection().removeAllRanges(),i.doc.getSelection().addRange(t))};i.$c.on("tbwinit tbwchange",e),i.addBtnDef("historyRedo",t),i.addBtnDef("historyUndo",n)}}}})}(jQuery);
|
||||
100
public/js/plugins/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js
vendored
Normal file
100
public/js/plugins/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
/*/* ===========================================================
|
||||
* 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: {
|
||||
// jshint camelcase:false
|
||||
en: {
|
||||
insertAudio: 'Insert Audio'
|
||||
},
|
||||
da: {
|
||||
insertAudio: 'Indsæt lyd'
|
||||
},
|
||||
fr: {
|
||||
insertAudio: 'Insérer un son'
|
||||
},
|
||||
ru: {
|
||||
insertAudio: 'Вставить аудио'
|
||||
},
|
||||
ja: {
|
||||
insertAudio: '音声の挿入'
|
||||
},
|
||||
tr: {
|
||||
insertAudio: 'Ses Ekle'
|
||||
},
|
||||
pt_br: {
|
||||
insertAudio: 'Inserir áudio'
|
||||
},
|
||||
ko: {
|
||||
insertAudio: '소리 넣기'
|
||||
},
|
||||
// jshint camelcase:true
|
||||
},
|
||||
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);
|
||||
1
public/js/plugins/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js
vendored
Normal file
@@ -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"},da:{insertAudio:"Indsæt lyd"},fr:{insertAudio:"Insérer un son"},ru:{insertAudio:"Вставить аудио"},ja:{insertAudio:"音声の挿入"},tr:{insertAudio:"Ses Ekle"},pt_br:{insertAudio:"Inserir áudio"},ko:{insertAudio:"소리 넣기"}},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 i=e(t)[0];return n.range.deleteContents(),n.range.insertNode(i),!0};n.openModalInsert(n.lang.insertAudio,r,t)}};n.addBtnDef("insertAudio",t)}}}})}(jQuery);
|
||||
162
public/js/plugins/trumbowyg/plugins/lineheight/trumbowyg.lineheight.js
vendored
Normal file
162
public/js/plugins/trumbowyg/plugins/lineheight/trumbowyg.lineheight.js
vendored
Normal file
@@ -0,0 +1,162 @@
|
||||
(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'
|
||||
}
|
||||
},
|
||||
da: {
|
||||
lineheight: 'Linjehøjde',
|
||||
lineheights: {
|
||||
'0.9': 'Lille',
|
||||
'normal': 'Normal',
|
||||
'1.5': 'Stor',
|
||||
'2.0': 'Ekstra stor'
|
||||
}
|
||||
},
|
||||
fr: {
|
||||
lineheight: 'Hauteur de ligne',
|
||||
lineheights: {
|
||||
'0.9': 'Petite',
|
||||
'normal': 'Normale',
|
||||
'1.5': 'Grande',
|
||||
'2.0': 'Très grande'
|
||||
}
|
||||
},
|
||||
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'
|
||||
}
|
||||
},
|
||||
zh_tw: {
|
||||
lineheight: '文字間距',
|
||||
lineheights: {
|
||||
'0.9': '小',
|
||||
'normal': '正常',
|
||||
'1.5': '大',
|
||||
'2.0': '特大'
|
||||
}
|
||||
},
|
||||
pt_br: {
|
||||
lineheight: 'Altura de linha',
|
||||
lineheights: {
|
||||
'0.9': 'Pequena',
|
||||
'normal': 'Regular',
|
||||
'1.5': 'Grande',
|
||||
'2.0': 'Extra grande'
|
||||
}
|
||||
},
|
||||
it: {
|
||||
lineheight: 'Altezza linea',
|
||||
lineheights: {
|
||||
'0.9': 'Bassa',
|
||||
'normal': 'Normale',
|
||||
'1.5': 'Alta',
|
||||
'2.0': 'Molto alta'
|
||||
}
|
||||
},
|
||||
ko: {
|
||||
lineheight: '줄 간격',
|
||||
lineheights: {
|
||||
'0.9': '좁게',
|
||||
'normal': '보통',
|
||||
'1.5': '넓게',
|
||||
'2.0': '아주 넓게'
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
// jshint camelcase:true
|
||||
|
||||
var defaultOptions = {
|
||||
sizeList: [
|
||||
'0.9',
|
||||
'normal',
|
||||
'1.5',
|
||||
'2.0'
|
||||
]
|
||||
};
|
||||
|
||||
// Add dropdown with font sizes
|
||||
$.extend(true, $.trumbowyg, {
|
||||
plugins: {
|
||||
lineheight: {
|
||||
init: function (trumbowyg) {
|
||||
trumbowyg.o.plugins.lineheight = $.extend({},
|
||||
defaultOptions,
|
||||
trumbowyg.o.plugins.lineheight || {}
|
||||
);
|
||||
|
||||
trumbowyg.addBtnDef('lineheight', {
|
||||
dropdown: buildDropdown(trumbowyg)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Build the dropdown
|
||||
function buildDropdown(trumbowyg) {
|
||||
var dropdown = [];
|
||||
|
||||
$.each(trumbowyg.o.plugins.lineheight.sizeList, function(index, size) {
|
||||
trumbowyg.addBtnDef('lineheight_' + size, {
|
||||
text: trumbowyg.lang.lineheights[size] || size,
|
||||
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);
|
||||
1
public/js/plugins/trumbowyg/plugins/lineheight/trumbowyg.lineheight.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/lineheight/trumbowyg.lineheight.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){"use strict";function n(n){var i=[];return e.each(n.o.plugins.lineheight.sizeList,function(l,a){n.addBtnDef("lineheight_"+a,{text:n.lang.lineheights[a]||a,hasIcon:!1,fn:function(){n.saveRange();var i=n.getRangeText();if(""!==i.replace(/\s/g,""))try{var l=t();e(l).css("lineHeight",a)}catch(h){}}}),i.push("lineheight_"+a)}),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"}},da:{lineheight:"Linjehøjde",lineheights:{.9:"Lille",normal:"Normal",1.5:"Stor","2.0":"Ekstra stor"}},fr:{lineheight:"Hauteur de ligne",lineheights:{.9:"Petite",normal:"Normale",1.5:"Grande","2.0":"Très grande"}},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"}},zh_tw:{lineheight:"文字間距",lineheights:{.9:"小",normal:"正常",1.5:"大","2.0":"特大"}},pt_br:{lineheight:"Altura de linha",lineheights:{.9:"Pequena",normal:"Regular",1.5:"Grande","2.0":"Extra grande"}},it:{lineheight:"Altezza linea",lineheights:{.9:"Bassa",normal:"Normale",1.5:"Alta","2.0":"Molto alta"}},ko:{lineheight:"줄 간격",lineheights:{.9:"좁게",normal:"보통",1.5:"넓게","2.0":"아주 넓게"}}}});var i={sizeList:["0.9","normal","1.5","2.0"]};e.extend(!0,e.trumbowyg,{plugins:{lineheight:{init:function(t){t.o.plugins.lineheight=e.extend({},i,t.o.plugins.lineheight||{}),t.addBtnDef("lineheight",{dropdown:n(t)})}}}})}(jQuery);
|
||||
117
public/js/plugins/trumbowyg/plugins/mathml/trumbowyg.mathml.js
vendored
Normal file
117
public/js/plugins/trumbowyg/plugins/mathml/trumbowyg.mathml.js
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
/* ===========================================================
|
||||
* trumbowyg.mathMl.js v1.0
|
||||
* MathML plugin for Trumbowyg
|
||||
* http://alex-d.github.com/Trumbowyg
|
||||
* ===========================================================
|
||||
* Author : loclamor
|
||||
*/
|
||||
|
||||
/* globals MathJax */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.extend(true, $.trumbowyg, {
|
||||
langs: {
|
||||
// jshint camelcase:false
|
||||
en: {
|
||||
mathml: 'Insert Formulas',
|
||||
formulas: 'Formulas',
|
||||
inline: 'Inline'
|
||||
},
|
||||
da: {
|
||||
mathml: 'Indsæt formler',
|
||||
formulas: 'Formler',
|
||||
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'
|
||||
},
|
||||
zh_tw: {
|
||||
mathml: '插入方程式',
|
||||
formulas: '方程式',
|
||||
inline: '內嵌'
|
||||
},
|
||||
pt_br: {
|
||||
mathml: 'Inserir fórmulas',
|
||||
formulas: 'Fórmulas',
|
||||
inline: 'Em linha'
|
||||
},
|
||||
ko: {
|
||||
mathml: '수식 넣기',
|
||||
formulas: '수식',
|
||||
inline: '글 안에 넣기'
|
||||
},
|
||||
},
|
||||
// jshint camelcase:true
|
||||
|
||||
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 delimiter = v.inline ? '$' : '$$';
|
||||
if (trumbowyg.currentMathNode) {
|
||||
$(trumbowyg.currentMathNode)
|
||||
.html(delimiter + ' ' + v.formulas + ' ' + delimiter)
|
||||
.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') + '" >' + delimiter + ' ' + v.formulas + ' ' + delimiter + '</span>';
|
||||
var node = $(html)[0];
|
||||
node.onclick = function() {
|
||||
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);
|
||||
1
public/js/plugins/trumbowyg/plugins/mathml/trumbowyg.mathml.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/mathml/trumbowyg.mathml.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{mathml:"Insert Formulas",formulas:"Formulas",inline:"Inline"},da:{mathml:"Indsæt formler",formulas:"Formler",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"},zh_tw:{mathml:"插入方程式",formulas:"方程式",inline:"內嵌"},pt_br:{mathml:"Inserir fórmulas",formulas:"Fórmulas",inline:"Em linha"},ko:{mathml:"수식 넣기",formulas:"수식",inline:"글 안에 넣기"}},plugins:{mathml:{init:function(n){var l={fn:function(){n.saveRange();var l={formulas:{label:n.lang.formulas,required:!0,value:""},inline:{label:n.lang.inline,attributes:{checked:!0},type:"checkbox",required:!1}},a=function(t){var r=t.inline?"$":"$$";if(n.currentMathNode)e(n.currentMathNode).html(r+" "+t.formulas+" "+r).attr("formulas",t.formulas).attr("inline",t.inline?"true":"false");else{var i='<span class="mathMlContainer" contenteditable="false" formulas="'+t.formulas+'" inline="'+(t.inline?"true":"false")+'" >'+r+" "+t.formulas+" "+r+"</span>",u=e(i)[0];u.onclick=function(){n.currentMathNode=this,l.formulas.value=e(this).attr("formulas"),"true"===e(this).attr("inline")?l.inline.attributes.checked=!0:delete l.inline.attributes.checked,n.openModalInsert(n.lang.mathml,l,a)},n.range.deleteContents(),n.range.insertNode(u)}return n.currentMathNode=!1,MathJax.Hub.Queue(["Typeset",MathJax.Hub]),!0};l.formulas.value=n.getRangeText(),l.inline.attributes.checked=!0,n.openModalInsert(n.lang.mathml,l,a)}};n.addBtnDef("mathml",l)}}}})}(jQuery);
|
||||
36
public/js/plugins/trumbowyg/plugins/mathml/ui/sass/trumbowyg.mathml.scss
vendored
Normal file
36
public/js/plugins/trumbowyg/plugins/mathml/ui/sass/trumbowyg.mathml.scss
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: rgba(255, 255, 255, 0.83);
|
||||
box-shadow: 0 0 5px 5px rgba(255, 255, 255, 0.83);
|
||||
cursor: pointer;
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
29
public/js/plugins/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.css
vendored
Normal file
29
public/js/plugins/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.css
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: rgba(255, 255, 255, 0.83);
|
||||
box-shadow: 0 0 5px 5px rgba(255, 255, 255, 0.83);
|
||||
cursor: pointer;
|
||||
pointer-events: auto; }
|
||||
2
public/js/plugins/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.min.css
vendored
Normal file
2
public/js/plugins/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.min.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/** Trumbowyg v2.21.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';position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(255,255,255,.83);box-shadow:0 0 5px 5px rgba(255,255,255,.83);cursor:pointer;pointer-events:auto}
|
||||
116
public/js/plugins/trumbowyg/plugins/mention/trumbowyg.mention.js
vendored
Normal file
116
public/js/plugins/trumbowyg/plugins/mention/trumbowyg.mention.js
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
/* ===========================================================
|
||||
* 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: {
|
||||
// jshint camelcase:false
|
||||
en: {
|
||||
mention: 'Mention'
|
||||
},
|
||||
da: {
|
||||
mention: 'Nævn'
|
||||
},
|
||||
fr: {
|
||||
mention: 'Mentionner'
|
||||
},
|
||||
ru: {
|
||||
mention: 'Упомянуть'
|
||||
},
|
||||
tr: {
|
||||
mention: 'Bahset'
|
||||
},
|
||||
zh_tw: {
|
||||
mention: '標記'
|
||||
},
|
||||
pt_br: {
|
||||
mention: 'Menção'
|
||||
},
|
||||
ko: {
|
||||
mention: '언급'
|
||||
},
|
||||
// jshint camelcase:true
|
||||
},
|
||||
|
||||
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 = [];
|
||||
|
||||
$.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);
|
||||
1
public/js/plugins/trumbowyg/plugins/mention/trumbowyg.mention.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/mention/trumbowyg.mention.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(n){"use strict";function t(t,o){var e=[];return 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"},da:{mention:"Nævn"},fr:{mention:"Mentionner"},ru:{mention:"Упомянуть"},tr:{mention:"Bahset"},zh_tw:{mention:"標記"},pt_br:{mention:"Menção"},ko:{mention:"언급"}},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);
|
||||
29
public/js/plugins/trumbowyg/plugins/mention/ui/sass/trumbowyg.mention.scss
vendored
Normal file
29
public/js/plugins/trumbowyg/plugins/mention/ui/sass/trumbowyg.mention.scss
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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 {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
public/js/plugins/trumbowyg/plugins/mention/ui/trumbowyg.mention.css
vendored
Normal file
24
public/js/plugins/trumbowyg/plugins/mention/ui/trumbowyg.mention.css
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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 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; }
|
||||
2
public/js/plugins/trumbowyg/plugins/mention/ui/trumbowyg.mention.min.css
vendored
Normal file
2
public/js/plugins/trumbowyg/plugins/mention/ui/trumbowyg.mention.min.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/** Trumbowyg v2.21.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
|
||||
.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}
|
||||
121
public/js/plugins/trumbowyg/plugins/noembed/trumbowyg.noembed.js
vendored
Normal file
121
public/js/plugins/trumbowyg/plugins/noembed/trumbowyg.noembed.js
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
/* ===========================================================
|
||||
* 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: {
|
||||
// jshint camelcase:false
|
||||
en: {
|
||||
noembed: 'Noembed',
|
||||
noembedError: 'Error'
|
||||
},
|
||||
da: {
|
||||
noembedError: 'Fejl'
|
||||
},
|
||||
sk: {
|
||||
noembedError: 'Chyba'
|
||||
},
|
||||
fr: {
|
||||
noembedError: 'Erreur'
|
||||
},
|
||||
cs: {
|
||||
noembedError: 'Chyba'
|
||||
},
|
||||
ru: {
|
||||
noembedError: 'Ошибка'
|
||||
},
|
||||
ja: {
|
||||
noembedError: 'エラー'
|
||||
},
|
||||
tr: {
|
||||
noembedError: 'Hata'
|
||||
},
|
||||
zh_tw: {
|
||||
noembed: '插入影片',
|
||||
noembedError: '錯誤'
|
||||
},
|
||||
pt_br: {
|
||||
noembed: 'Incorporar',
|
||||
noembedError: 'Erro'
|
||||
},
|
||||
ko: {
|
||||
noembed: 'oEmbed 넣기',
|
||||
noembedError: '에러'
|
||||
},
|
||||
// jshint camelcase:true
|
||||
},
|
||||
|
||||
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);
|
||||
1
public/js/plugins/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js
vendored
Normal file
@@ -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"},da:{noembedError:"Fejl"},sk:{noembedError:"Chyba"},fr:{noembedError:"Erreur"},cs:{noembedError:"Chyba"},ru:{noembedError:"Ошибка"},ja:{noembedError:"エラー"},tr:{noembedError:"Hata"},zh_tw:{noembed:"插入影片",noembedError:"錯誤"},pt_br:{noembed:"Incorporar",noembedError:"Erro"},ko:{noembed:"oEmbed 넣기",noembedError:"에러"}},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);
|
||||
96
public/js/plugins/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.js
vendored
Normal file
96
public/js/plugins/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.js
vendored
Normal file
@@ -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);
|
||||
1
public/js/plugins/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.min.js
vendored
Normal file
@@ -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);
|
||||
49
public/js/plugins/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js
vendored
Normal file
49
public/js/plugins/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
/* ===========================================================
|
||||
* 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,
|
||||
mustPreventDefault = false,
|
||||
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, false, true);
|
||||
};
|
||||
/* jshint +W083 */
|
||||
reader.readAsDataURL(items[i].getAsFile());
|
||||
|
||||
mustPreventDefault = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (mustPreventDefault) {
|
||||
pasteEvent.stopPropagation();
|
||||
pasteEvent.preventDefault();
|
||||
}
|
||||
} catch (c) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
1
public/js/plugins/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js
vendored
Normal file
@@ -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=!1,r=n.length-1;r>=0;r-=1)n[r].type.match(/^image\//)&&(a=new FileReader,a.onloadend=function(t){e.execCmd("insertImage",t.target.result,!1,!0)},a.readAsDataURL(n[r].getAsFile()),i=!0);i&&(t.stopPropagation(),t.preventDefault())}catch(o){}})}}}})}(jQuery);
|
||||
142
public/js/plugins/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js
vendored
Normal file
142
public/js/plugins/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
/* ===========================================================
|
||||
* 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>'
|
||||
},
|
||||
da: {
|
||||
preformatted: 'Præformateret <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>'
|
||||
},
|
||||
zh_tw: {
|
||||
preformatted: '代碼範例 <pre>'
|
||||
},
|
||||
pt_br: {
|
||||
preformatted: 'Exemple de código <pre>'
|
||||
},
|
||||
ko: {
|
||||
preformatted: '코드 예제 <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);
|
||||
1
public/js/plugins/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js
vendored
Normal file
@@ -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 r(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}function n(){var t=null;if(document.selection)t=document.selection.createRange().parentElement();else{var r=window.getSelection();r.rangeCount>0&&(t=r.getRangeAt(0).startContainer.parentNode)}var n=e(t).contents().closest("pre").length,o=e(t).contents().closest("code").length;n&&o?e(t).contents().unwrap("code").unwrap("pre"):n?e(t).contents().unwrap("pre"):o&&e(t).contents().unwrap("code")}e.extend(!0,e.trumbowyg,{langs:{en:{preformatted:"Code sample <pre>"},da:{preformatted:"Præformateret <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>"},zh_tw:{preformatted:"代碼範例 <pre>"},pt_br:{preformatted:"Exemple de código <pre>"},ko:{preformatted:"코드 예제 <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 n();e.execCmd("insertHTML","<pre><code>"+r(o)+"</code></pre>")}catch(p){}},tag:"pre"};e.addBtnDef("preformatted",o)}}}})}(jQuery);
|
||||
20
public/js/plugins/trumbowyg/plugins/resizimg/resizable-resolveconflict.js
vendored
Normal file
20
public/js/plugins/trumbowyg/plugins/resizimg/resizable-resolveconflict.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
(function (factory, define, require, module) {
|
||||
'use strict';
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
// CommonJS
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
// Global jQuery
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
'use strict';
|
||||
|
||||
// rename to avoid conflict with jquery-resizable
|
||||
$.fn.uiresizable = $.fn.resizable;
|
||||
delete $.fn.resizable;
|
||||
}));
|
||||
1
public/js/plugins/trumbowyg/plugins/resizimg/resizable-resolveconflict.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/resizimg/resizable-resolveconflict.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,t,o,r){"use strict";"function"==typeof t&&t.amd?t(["jquery"],e):"object"==typeof r&&"object"==typeof r.exports?r.exports=e(o("jquery")):e(jQuery)}(function(e){"use strict";e.fn.uiresizable=e.fn.resizable,delete e.fn.resizable});
|
||||
303
public/js/plugins/trumbowyg/plugins/resizimg/trumbowyg.resizimg.js
vendored
Normal file
303
public/js/plugins/trumbowyg/plugins/resizimg/trumbowyg.resizimg.js
vendored
Normal file
@@ -0,0 +1,303 @@
|
||||
;(function ($) {
|
||||
'use strict';
|
||||
|
||||
var defaultOptions = {
|
||||
minSize: 32,
|
||||
step: 4
|
||||
};
|
||||
|
||||
function preventDefault(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
var ResizeWithCanvas = function () {
|
||||
// variable to create canvas and save img in resize mode
|
||||
this.resizeCanvas = document.createElement('canvas');
|
||||
// to allow canvas to get focus
|
||||
this.resizeCanvas.setAttribute('tabindex', '0');
|
||||
this.resizeCanvas.id = 'trumbowyg-resizimg-' + (+new Date());
|
||||
this.ctx = null;
|
||||
this.resizeImg = null;
|
||||
|
||||
this.pressEscape = function (obj) {
|
||||
obj.reset();
|
||||
};
|
||||
this.pressBackspaceOrDelete = function (obj) {
|
||||
$(obj.resizeCanvas).replaceWith('');
|
||||
obj.resizeImg = null;
|
||||
};
|
||||
|
||||
// PRIVATE FUNCTION
|
||||
var focusedNow = false;
|
||||
var isCursorSeResize = false;
|
||||
|
||||
// calculate offset to change mouse over square in the canvas
|
||||
var offsetX, offsetY;
|
||||
var reOffset = function (canvas) {
|
||||
var BB = canvas.getBoundingClientRect();
|
||||
offsetX = BB.left;
|
||||
offsetY = BB.top;
|
||||
};
|
||||
|
||||
var drawRect = function (shapeData, ctx) {
|
||||
// Inner
|
||||
ctx.beginPath();
|
||||
ctx.fillStyle = 'rgb(255, 255, 255)';
|
||||
ctx.rect(shapeData.points.x, shapeData.points.y, shapeData.points.width, shapeData.points.height);
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
};
|
||||
|
||||
var updateCanvas = function (canvas, ctx, img, canvasWidth, canvasHeight) {
|
||||
ctx.translate(0.5, 0.5);
|
||||
ctx.lineWidth = 1;
|
||||
|
||||
// image
|
||||
ctx.drawImage(img, 5, 5, canvasWidth - 10, canvasHeight - 10);
|
||||
|
||||
// border
|
||||
ctx.beginPath();
|
||||
ctx.rect(5, 5, canvasWidth - 10, canvasHeight - 10);
|
||||
ctx.stroke();
|
||||
|
||||
// square in the angle
|
||||
ctx.beginPath();
|
||||
ctx.fillStyle = 'rgb(255, 255, 255)';
|
||||
ctx.rect(canvasWidth - 10, canvasHeight - 10, 9, 9);
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
// get the offset to change the mouse cursor
|
||||
reOffset(canvas);
|
||||
|
||||
return ctx;
|
||||
};
|
||||
|
||||
// PUBLIC FUNCTION
|
||||
// necessary to correctly print cursor over square. Called once for instance. Useless with trumbowyg.
|
||||
this.init = function () {
|
||||
var _this = this;
|
||||
$(window).on('scroll resize', function () {
|
||||
_this.reCalcOffset();
|
||||
});
|
||||
};
|
||||
|
||||
this.reCalcOffset = function () {
|
||||
reOffset(this.resizeCanvas);
|
||||
};
|
||||
|
||||
this.canvasId = function () {
|
||||
return this.resizeCanvas.id;
|
||||
};
|
||||
|
||||
this.isActive = function () {
|
||||
return this.resizeImg !== null;
|
||||
};
|
||||
|
||||
this.isFocusedNow = function () {
|
||||
return focusedNow;
|
||||
};
|
||||
|
||||
this.blurNow = function () {
|
||||
focusedNow = false;
|
||||
};
|
||||
|
||||
// restore image in the HTML of the editor
|
||||
this.reset = function () {
|
||||
if (this.resizeImg === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.resizeImg.width = this.resizeCanvas.clientWidth - 10;
|
||||
this.resizeImg.height = this.resizeCanvas.clientHeight - 10;
|
||||
// clear style of image to avoid issue on resize because this attribute have priority over width and height attribute
|
||||
this.resizeImg.removeAttribute('style');
|
||||
|
||||
$(this.resizeCanvas).replaceWith($(this.resizeImg));
|
||||
|
||||
// reset canvas style
|
||||
this.resizeCanvas.removeAttribute('style');
|
||||
this.resizeImg = null;
|
||||
};
|
||||
|
||||
// setup canvas with points and border to allow the resizing operation
|
||||
this.setup = function (img, resizableOptions) {
|
||||
this.resizeImg = img;
|
||||
|
||||
if (!this.resizeCanvas.getContext) {
|
||||
return false;
|
||||
}
|
||||
|
||||
focusedNow = true;
|
||||
|
||||
// draw canvas
|
||||
this.resizeCanvas.width = $(this.resizeImg).width() + 10;
|
||||
this.resizeCanvas.height = $(this.resizeImg).height() + 10;
|
||||
this.resizeCanvas.style.margin = '-5px';
|
||||
this.ctx = this.resizeCanvas.getContext('2d');
|
||||
|
||||
// replace image with canvas
|
||||
$(this.resizeImg).replaceWith($(this.resizeCanvas));
|
||||
|
||||
updateCanvas(this.resizeCanvas, this.ctx, this.resizeImg, this.resizeCanvas.width, this.resizeCanvas.height);
|
||||
|
||||
// enable resize
|
||||
$(this.resizeCanvas).resizable(resizableOptions)
|
||||
.on('mousedown', preventDefault);
|
||||
|
||||
var _this = this;
|
||||
$(this.resizeCanvas)
|
||||
.on('mousemove', function (e) {
|
||||
var mouseX = Math.round(e.clientX - offsetX);
|
||||
var mouseY = Math.round(e.clientY - offsetY);
|
||||
|
||||
var wasCursorSeResize = isCursorSeResize;
|
||||
|
||||
_this.ctx.rect(_this.resizeCanvas.width - 10, _this.resizeCanvas.height - 10, 9, 9);
|
||||
isCursorSeResize = _this.ctx.isPointInPath(mouseX, mouseY);
|
||||
if (wasCursorSeResize !== isCursorSeResize) {
|
||||
this.style.cursor = isCursorSeResize ? 'se-resize' : 'default';
|
||||
}
|
||||
})
|
||||
.on('keydown', function (e) {
|
||||
if (!_this.isActive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
var x = e.keyCode;
|
||||
if (x === 27) { // ESC
|
||||
_this.pressEscape(_this);
|
||||
} else if (x === 8 || x === 46) { // BACKSPACE or DELETE
|
||||
_this.pressBackspaceOrDelete(_this);
|
||||
}
|
||||
})
|
||||
.on('focus', preventDefault);
|
||||
|
||||
this.resizeCanvas.focus();
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
// update the canvas after the resizing
|
||||
this.refresh = function () {
|
||||
if (!this.resizeCanvas.getContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.resizeCanvas.width = this.resizeCanvas.clientWidth;
|
||||
this.resizeCanvas.height = this.resizeCanvas.clientHeight;
|
||||
updateCanvas(this.resizeCanvas, this.ctx, this.resizeImg, this.resizeCanvas.width, this.resizeCanvas.height);
|
||||
};
|
||||
};
|
||||
|
||||
// object to interact with canvas
|
||||
var resizeWithCanvas = new ResizeWithCanvas();
|
||||
|
||||
function destroyResizable(trumbowyg) {
|
||||
// clean html code
|
||||
trumbowyg.$ed.find('canvas.resizable')
|
||||
.resizable('destroy')
|
||||
.off('mousedown', preventDefault)
|
||||
.removeClass('resizable');
|
||||
|
||||
resizeWithCanvas.reset();
|
||||
|
||||
trumbowyg.syncCode();
|
||||
}
|
||||
|
||||
$.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 () {
|
||||
// resize update canvas information
|
||||
resizeWithCanvas.refresh();
|
||||
trumbowyg.syncCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
function initResizable() {
|
||||
trumbowyg.$ed.find('img')
|
||||
.off('click')
|
||||
.on('click', function (e) {
|
||||
// if I'm already do a resize, reset it
|
||||
if (resizeWithCanvas.isActive()) {
|
||||
resizeWithCanvas.reset();
|
||||
}
|
||||
// initialize resize of image
|
||||
resizeWithCanvas.setup(this, trumbowyg.o.plugins.resizimg.resizable);
|
||||
|
||||
preventDefault(e);
|
||||
});
|
||||
}
|
||||
|
||||
trumbowyg.$c.on('tbwinit', function () {
|
||||
initResizable();
|
||||
|
||||
// disable resize when click on other items
|
||||
trumbowyg.$ed.on('click', function (e) {
|
||||
// check if I've clicked out of canvas or image to reset it
|
||||
if ($(e.target).is('img') || e.target.id === resizeWithCanvas.canvasId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
preventDefault(e);
|
||||
resizeWithCanvas.reset();
|
||||
|
||||
// save changes
|
||||
trumbowyg.$c.trigger('tbwchange');
|
||||
});
|
||||
|
||||
trumbowyg.$ed.on('scroll', function () {
|
||||
resizeWithCanvas.reCalcOffset();
|
||||
});
|
||||
});
|
||||
|
||||
trumbowyg.$c.on('tbwfocus tbwchange', initResizable);
|
||||
trumbowyg.$c.on('tbwresize', function () {
|
||||
resizeWithCanvas.reCalcOffset();
|
||||
});
|
||||
|
||||
// Destroy
|
||||
trumbowyg.$c.on('tbwblur', function () {
|
||||
// if I have already focused the canvas avoid destroy
|
||||
if (resizeWithCanvas.isFocusedNow()) {
|
||||
resizeWithCanvas.blurNow();
|
||||
} else {
|
||||
destroyResizable(trumbowyg);
|
||||
}
|
||||
});
|
||||
},
|
||||
destroy: function (trumbowyg) {
|
||||
destroyResizable(trumbowyg);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
1
public/js/plugins/trumbowyg/plugins/resizimg/trumbowyg.resizimg.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/resizimg/trumbowyg.resizimg.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){"use strict";function i(e){e.stopPropagation(),e.preventDefault()}function t(e){e.$ed.find("canvas.resizable").resizable("destroy").off("mousedown",i).removeClass("resizable"),r.reset(),e.syncCode()}var s={minSize:32,step:4},n=function(){this.resizeCanvas=document.createElement("canvas"),this.resizeCanvas.setAttribute("tabindex","0"),this.resizeCanvas.id="trumbowyg-resizimg-"+ +new Date,this.ctx=null,this.resizeImg=null,this.pressEscape=function(e){e.reset()},this.pressBackspaceOrDelete=function(i){e(i.resizeCanvas).replaceWith(""),i.resizeImg=null};var t,s,n=!1,r=!1,a=function(e){var i=e.getBoundingClientRect();t=i.left,s=i.top},h=function(e,i,t,s,n){return i.translate(.5,.5),i.lineWidth=1,i.drawImage(t,5,5,s-10,n-10),i.beginPath(),i.rect(5,5,s-10,n-10),i.stroke(),i.beginPath(),i.fillStyle="rgb(255, 255, 255)",i.rect(s-10,n-10,9,9),i.fill(),i.stroke(),a(e),i};this.init=function(){var i=this;e(window).on("scroll resize",function(){i.reCalcOffset()})},this.reCalcOffset=function(){a(this.resizeCanvas)},this.canvasId=function(){return this.resizeCanvas.id},this.isActive=function(){return null!==this.resizeImg},this.isFocusedNow=function(){return n},this.blurNow=function(){n=!1},this.reset=function(){null!==this.resizeImg&&(this.resizeImg.width=this.resizeCanvas.clientWidth-10,this.resizeImg.height=this.resizeCanvas.clientHeight-10,this.resizeImg.removeAttribute("style"),e(this.resizeCanvas).replaceWith(e(this.resizeImg)),this.resizeCanvas.removeAttribute("style"),this.resizeImg=null)},this.setup=function(a,o){if(this.resizeImg=a,!this.resizeCanvas.getContext)return!1;n=!0,this.resizeCanvas.width=e(this.resizeImg).width()+10,this.resizeCanvas.height=e(this.resizeImg).height()+10,this.resizeCanvas.style.margin="-5px",this.ctx=this.resizeCanvas.getContext("2d"),e(this.resizeImg).replaceWith(e(this.resizeCanvas)),h(this.resizeCanvas,this.ctx,this.resizeImg,this.resizeCanvas.width,this.resizeCanvas.height),e(this.resizeCanvas).resizable(o).on("mousedown",i);var c=this;return e(this.resizeCanvas).on("mousemove",function(e){var i=Math.round(e.clientX-t),n=Math.round(e.clientY-s),a=r;c.ctx.rect(c.resizeCanvas.width-10,c.resizeCanvas.height-10,9,9),r=c.ctx.isPointInPath(i,n),a!==r&&(this.style.cursor=r?"se-resize":"default")}).on("keydown",function(e){if(c.isActive()){var i=e.keyCode;27===i?c.pressEscape(c):8!==i&&46!==i||c.pressBackspaceOrDelete(c)}}).on("focus",i),this.resizeCanvas.focus(),!0},this.refresh=function(){this.resizeCanvas.getContext&&(this.resizeCanvas.width=this.resizeCanvas.clientWidth,this.resizeCanvas.height=this.resizeCanvas.clientHeight,h(this.resizeCanvas,this.ctx,this.resizeImg,this.resizeCanvas.width,this.resizeCanvas.height))}},r=new n;e.extend(!0,e.trumbowyg,{plugins:{resizimg:{init:function(n){function a(){n.$ed.find("img").off("click").on("click",function(e){r.isActive()&&r.reset(),r.setup(this,n.o.plugins.resizimg.resizable),i(e)})}n.o.plugins.resizimg=e.extend(!0,{},s,n.o.plugins.resizimg||{},{resizable:{resizeWidth:!1,onDragStart:function(e,i){var t=n.o.plugins.resizimg,s=e.pageX-i.offset().left,r=e.pageY-i.offset().top;if(s<i.width()-t.minSize||r<i.height()-t.minSize)return!1},onDrag:function(e,i,t,s){var r=n.o.plugins.resizimg;return s<r.minSize&&(s=r.minSize),s-=s%r.step,i.height(s),!1},onDragEnd:function(){r.refresh(),n.syncCode()}}}),n.$c.on("tbwinit",function(){a(),n.$ed.on("click",function(t){e(t.target).is("img")||t.target.id===r.canvasId()||(i(t),r.reset(),n.$c.trigger("tbwchange"))}),n.$ed.on("scroll",function(){r.reCalcOffset()})}),n.$c.on("tbwfocus tbwchange",a),n.$c.on("tbwresize",function(){r.reCalcOffset()}),n.$c.on("tbwblur",function(){r.isFocusedNow()?r.blurNow():t(n)})},destroy:function(e){t(e)}}}})}(jQuery);
|
||||
94
public/js/plugins/trumbowyg/plugins/ruby/trumbowyg.ruby.js
vendored
Normal file
94
public/js/plugins/trumbowyg/plugins/ruby/trumbowyg.ruby.js
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
/* ===========================================================
|
||||
* 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: {
|
||||
// jshint camelcase:false
|
||||
en: {
|
||||
ruby: 'Add ruby text',
|
||||
rubyModal: 'Ruby modal',
|
||||
rubyText: 'Ruby text'
|
||||
},
|
||||
da: {
|
||||
ruby: 'Tilføj ruby tekst',
|
||||
rubyModal: 'Ruby modal',
|
||||
rubyText: 'Ruby tekst'
|
||||
},
|
||||
fr: {
|
||||
ruby: 'Ajouter du texte ruby',
|
||||
rubyModal: 'Modale ruby',
|
||||
rubyText: 'Texte ruby'
|
||||
},
|
||||
id: {
|
||||
ruby: 'Sisipkan teks ruby',
|
||||
rubyModal: 'Modal teks ruby',
|
||||
rubyText: 'Teks ruby'
|
||||
},
|
||||
ko: {
|
||||
ruby: '루비 문자 넣기',
|
||||
rubyModal: '대상 문자',
|
||||
rubyText: '루비 문자'
|
||||
},
|
||||
pt_br: {
|
||||
ruby: 'Adicionar texto ruby',
|
||||
rubyModal: 'Modal ruby',
|
||||
rubyText: 'Texto ruby'
|
||||
},
|
||||
tr: {
|
||||
ruby: 'Ruby metni ekle',
|
||||
rubyModal: 'Ruby modal',
|
||||
rubyText: 'Ruby metni'
|
||||
},
|
||||
zh_tw: {
|
||||
ruby: '加入 ruby 文字',
|
||||
rubyModal: 'Ruby 彈跳視窗',
|
||||
rubyText: 'Ruby 文字'
|
||||
},
|
||||
// jshint camelcase:true
|
||||
},
|
||||
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
public/js/plugins/trumbowyg/plugins/ruby/trumbowyg.ruby.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/ruby/trumbowyg.ruby.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(r){"use strict";r.extend(!0,r.trumbowyg,{langs:{en:{ruby:"Add ruby text",rubyModal:"Ruby modal",rubyText:"Ruby text"},da:{ruby:"Tilføj ruby tekst",rubyModal:"Ruby modal",rubyText:"Ruby tekst"},fr:{ruby:"Ajouter du texte ruby",rubyModal:"Modale ruby",rubyText:"Texte ruby"},id:{ruby:"Sisipkan teks ruby",rubyModal:"Modal teks ruby",rubyText:"Teks ruby"},ko:{ruby:"루비 문자 넣기",rubyModal:"대상 문자",rubyText:"루비 문자"},pt_br:{ruby:"Adicionar texto ruby",rubyModal:"Modal ruby",rubyText:"Texto ruby"},tr:{ruby:"Ruby metni ekle",rubyModal:"Ruby modal",rubyText:"Ruby metni"},zh_tw:{ruby:"加入 ruby 文字",rubyModal:"Ruby 彈跳視窗",rubyText:"Ruby 文字"}},plugins:{ruby:{init:function(u){var e={fn:function(){u.saveRange(),u.openModalInsert(u.lang.ruby,{rubyText:{label:u.lang.rubyText,required:!1},modal:{label:u.lang.rubyModal,value:u.getRangeText(),required:!0}},function(e){var b=r('<ruby title="'+e.rubyText+'">'+e.modal+"<rp> (</rp><rt>"+e.rubyText+"</rt><rp>)</rp></ruby>")[0];return u.range.deleteContents(),u.range.insertNode(b),u.syncCode(),u.$c.trigger("tbwchange"),!0})}};u.addBtnDef("ruby",e)}}}})}(jQuery);
|
||||
79
public/js/plugins/trumbowyg/plugins/specialchars/trumbowyg.specialchars.js
vendored
Normal file
79
public/js/plugins/trumbowyg/plugins/specialchars/trumbowyg.specialchars.js
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/* ===========================================================
|
||||
* trumbowyg.specialchars.js v0.99
|
||||
* Unicode characters picker plugin for Trumbowyg
|
||||
* http://alex-d.github.com/Trumbowyg
|
||||
* ===========================================================
|
||||
* Author : Renaud Hoyoux (geektortoise)
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
var defaultOptions = {
|
||||
symbolList: [
|
||||
// currencies
|
||||
'0024', '20AC', '00A3', '00A2', '00A5', '00A4', '2030', null,
|
||||
// legal signs
|
||||
'00A9', '00AE', '2122', null,
|
||||
// textual sign
|
||||
'00A7', '00B6', '00C6', '00E6', '0152', '0153', null,
|
||||
'2022', '25CF', '2023', '25B6', '2B29', '25C6', null,
|
||||
//maths
|
||||
'00B1', '00D7', '00F7', '21D2', '21D4', '220F', '2211', '2243', '2264', '2265'
|
||||
]
|
||||
};
|
||||
|
||||
$.extend(true, $.trumbowyg, {
|
||||
langs: {
|
||||
en: {
|
||||
specialChars: 'Special characters'
|
||||
},
|
||||
fr: {
|
||||
specialChars: 'Caractères spéciaux'
|
||||
},
|
||||
ko: {
|
||||
specialChars: '특수문자'
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
specialchars: {
|
||||
init: function (trumbowyg) {
|
||||
trumbowyg.o.plugins.specialchars = trumbowyg.o.plugins.specialchars || defaultOptions;
|
||||
var specialCharsBtnDef = {
|
||||
dropdown: buildDropdown(trumbowyg)
|
||||
};
|
||||
|
||||
trumbowyg.addBtnDef('specialChars', specialCharsBtnDef);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function buildDropdown(trumbowyg) {
|
||||
var dropdown = [];
|
||||
$.each(trumbowyg.o.plugins.specialchars.symbolList, function (i, symbol) {
|
||||
if (symbol === null) {
|
||||
symbol = ' ';
|
||||
} else {
|
||||
symbol = '&#x' + symbol;
|
||||
}
|
||||
|
||||
var btn = symbol.replace(/:/g, ''),
|
||||
defaultSymbolBtnName = 'symbol-' + btn,
|
||||
defaultSymbolBtnDef = {
|
||||
text: symbol,
|
||||
hasIcon: false,
|
||||
fn: function () {
|
||||
var encodedSymbol = String.fromCodePoint(parseInt(symbol.replace('&#', '0')));
|
||||
trumbowyg.execCmd('insertText', encodedSymbol);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
trumbowyg.addBtnDef(defaultSymbolBtnName, defaultSymbolBtnDef);
|
||||
dropdown.push(defaultSymbolBtnName);
|
||||
});
|
||||
|
||||
return dropdown;
|
||||
}
|
||||
})(jQuery);
|
||||
1
public/js/plugins/trumbowyg/plugins/specialchars/trumbowyg.specialchars.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/specialchars/trumbowyg.specialchars.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(s){"use strict";function a(a){var n=[];return s.each(a.o.plugins.specialchars.symbolList,function(s,e){e=null===e?" ":"&#x"+e;var r=e.replace(/:/g,""),l="symbol-"+r,c={text:e,hasIcon:!1,fn:function(){var s=String.fromCodePoint(parseInt(e.replace("&#","0")));return a.execCmd("insertText",s),!0}};a.addBtnDef(l,c),n.push(l)}),n}var n={symbolList:["0024","20AC","00A3","00A2","00A5","00A4","2030",null,"00A9","00AE","2122",null,"00A7","00B6","00C6","00E6","0152","0153",null,"2022","25CF","2023","25B6","2B29","25C6",null,"00B1","00D7","00F7","21D2","21D4","220F","2211","2243","2264","2265"]};s.extend(!0,s.trumbowyg,{langs:{en:{specialChars:"Special characters"},fr:{specialChars:"Caractères spéciaux"},ko:{specialChars:"특수문자"}},plugins:{specialchars:{init:function(s){s.o.plugins.specialchars=s.o.plugins.specialchars||n;var e={dropdown:a(s)};s.addBtnDef("specialChars",e)}}}})}(jQuery);
|
||||
56
public/js/plugins/trumbowyg/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss
vendored
Normal file
56
public/js/plugins/trumbowyg/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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-symbol-\ -dropdown-button {
|
||||
display: none !important;
|
||||
}
|
||||
.trumbowyg-symbol-\ -dropdown-button + button {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.trumbowyg-dropdown-specialChars {
|
||||
width: 248px;
|
||||
padding: 5px 3px 3px;
|
||||
}
|
||||
|
||||
.trumbowyg-dropdown-specialChars 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 .specialChars {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
display: inline-block;
|
||||
}
|
||||
47
public/js/plugins/trumbowyg/plugins/specialchars/ui/trumbowyg.specialchars.css
vendored
Normal file
47
public/js/plugins/trumbowyg/plugins/specialchars/ui/trumbowyg.specialchars.css
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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-symbol-\ -dropdown-button {
|
||||
display: none !important; }
|
||||
|
||||
.trumbowyg-symbol-\ -dropdown-button + button {
|
||||
clear: both; }
|
||||
|
||||
.trumbowyg-dropdown-specialChars {
|
||||
width: 248px;
|
||||
padding: 5px 3px 3px; }
|
||||
|
||||
.trumbowyg-dropdown-specialChars button {
|
||||
display: block;
|
||||
position: relative;
|
||||
float: left;
|
||||
height: 26px;
|
||||
width: 26px;
|
||||
padding: 0;
|
||||
margin: 2px;
|
||||
line-height: 24px;
|
||||
text-align: center; }
|
||||
.trumbowyg-dropdown-specialChars button:hover::after, .trumbowyg-dropdown-specialChars 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 .specialChars {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
display: inline-block; }
|
||||
2
public/js/plugins/trumbowyg/plugins/specialchars/ui/trumbowyg.specialchars.min.css
vendored
Normal file
2
public/js/plugins/trumbowyg/plugins/specialchars/ui/trumbowyg.specialchars.min.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/** Trumbowyg v2.21.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
|
||||
.trumbowyg-symbol-\ -dropdown-button{display:none!important}.trumbowyg-symbol-\ -dropdown-button+button{clear:both}.trumbowyg-dropdown-specialChars{width:248px;padding:5px 3px 3px}.trumbowyg-dropdown-specialChars button{display:block;position:relative;float:left;height:26px;width:26px;padding:0;margin:2px;line-height:24px;text-align:center}.trumbowyg-dropdown-specialChars button:focus::after,.trumbowyg-dropdown-specialChars 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 .specialChars{width:22px;height:22px;display:inline-block}
|
||||
419
public/js/plugins/trumbowyg/plugins/table/trumbowyg.table.js
vendored
Normal file
419
public/js/plugins/trumbowyg/plugins/table/trumbowyg.table.js
vendored
Normal file
@@ -0,0 +1,419 @@
|
||||
/* ===========================================================
|
||||
* 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: {
|
||||
// jshint camelcase:false
|
||||
en: {
|
||||
table: 'Insert table',
|
||||
tableAddRow: 'Add row',
|
||||
tableAddRowAbove: 'Add row above',
|
||||
tableAddColumnLeft: 'Add column to the left',
|
||||
tableAddColumn: 'Add column to the right',
|
||||
tableDeleteRow: 'Delete row',
|
||||
tableDeleteColumn: 'Delete column',
|
||||
tableDestroy: 'Delete table',
|
||||
error: 'Error'
|
||||
},
|
||||
da: {
|
||||
table: 'Indsæt tabel',
|
||||
tableAddRow: 'Tilføj række',
|
||||
tableAddRowAbove: 'Tilføj række',
|
||||
tableAddColumnLeft: 'Tilføj kolonne',
|
||||
tableAddColumn: 'Tilføj kolonne',
|
||||
tableDeleteRow: 'Slet række',
|
||||
tableDeleteColumn: 'Slet kolonne',
|
||||
tableDestroy: 'Slet tabel',
|
||||
error: 'Fejl'
|
||||
},
|
||||
de: {
|
||||
table: 'Tabelle einfügen',
|
||||
tableAddRow: 'Zeile hinzufügen',
|
||||
tableAddRowAbove: 'Zeile hinzufügen',
|
||||
tableAddColumnLeft: 'Spalte 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',
|
||||
tableAddRowAbove: 'Pridať riadok',
|
||||
tableAddColumnLeft: 'Pridať stĺpec',
|
||||
tableAddColumn: 'Pridať stĺpec',
|
||||
error: 'Chyba'
|
||||
},
|
||||
fr: {
|
||||
table: 'Insérer un tableau',
|
||||
tableAddRow: 'Ajouter des lignes',
|
||||
tableAddRowAbove: 'Ajouter des lignes',
|
||||
tableAddColumnLeft: 'Ajouter des colonnes',
|
||||
tableAddColumn: 'Ajouter des colonnes',
|
||||
tableDeleteRow: 'Effacer la ligne',
|
||||
tableDeleteColumn: 'Effacer la colonne',
|
||||
tableDestroy: 'Effacer le tableau',
|
||||
error: 'Erreur'
|
||||
},
|
||||
cs: {
|
||||
table: 'Vytvořit příkaz Table',
|
||||
tableAddRow: 'Přidat řádek',
|
||||
tableAddRowAbove: 'Přidat řádek',
|
||||
tableAddColumnLeft: 'Přidat sloupec',
|
||||
tableAddColumn: 'Přidat sloupec',
|
||||
error: 'Chyba'
|
||||
},
|
||||
ru: {
|
||||
table: 'Вставить таблицу',
|
||||
tableAddRow: 'Добавить строку',
|
||||
tableAddRowAbove: 'Добавить строку',
|
||||
tableAddColumnLeft: 'Добавить столбец',
|
||||
tableAddColumn: 'Добавить столбец',
|
||||
tableDeleteRow: 'Удалить строку',
|
||||
tableDeleteColumn: 'Удалить столбец',
|
||||
tableDestroy: 'Удалить таблицу',
|
||||
error: 'Ошибка'
|
||||
},
|
||||
ja: {
|
||||
table: '表の挿入',
|
||||
tableAddRow: '行の追加',
|
||||
tableAddRowAbove: '行の追加',
|
||||
tableAddColumnLeft: '列の追加',
|
||||
tableAddColumn: '列の追加',
|
||||
error: 'エラー'
|
||||
},
|
||||
tr: {
|
||||
table: 'Tablo ekle',
|
||||
tableAddRow: 'Satır ekle',
|
||||
tableAddRowAbove: 'Satır ekle',
|
||||
tableAddColumnLeft: 'Kolon ekle',
|
||||
tableAddColumn: 'Kolon ekle',
|
||||
error: 'Hata'
|
||||
},
|
||||
zh_tw: {
|
||||
table: '插入表格',
|
||||
tableAddRow: '加入行',
|
||||
tableAddRowAbove: '加入行',
|
||||
tableAddColumnLeft: '加入列',
|
||||
tableAddColumn: '加入列',
|
||||
tableDeleteRow: '刪除行',
|
||||
tableDeleteColumn: '刪除列',
|
||||
tableDestroy: '刪除表格',
|
||||
error: '錯誤'
|
||||
},
|
||||
id: {
|
||||
table: 'Sisipkan tabel',
|
||||
tableAddRow: 'Sisipkan baris',
|
||||
tableAddRowAbove: 'Sisipkan baris',
|
||||
tableAddColumnLeft: 'Sisipkan kolom',
|
||||
tableAddColumn: 'Sisipkan kolom',
|
||||
tableDeleteRow: 'Hapus baris',
|
||||
tableDeleteColumn: 'Hapus kolom',
|
||||
tableDestroy: 'Hapus tabel',
|
||||
error: 'Galat'
|
||||
},
|
||||
pt_br: {
|
||||
table: 'Inserir tabela',
|
||||
tableAddRow: 'Adicionar linha',
|
||||
tableAddRowAbove: 'Adicionar linha',
|
||||
tableAddColumnLeft: 'Adicionar coluna',
|
||||
tableAddColumn: 'Adicionar coluna',
|
||||
tableDeleteRow: 'Deletar linha',
|
||||
tableDeleteColumn: 'Deletar coluna',
|
||||
tableDestroy: 'Deletar tabela',
|
||||
error: 'Erro'
|
||||
},
|
||||
ko: {
|
||||
table: '표 넣기',
|
||||
tableAddRow: '줄 추가',
|
||||
tableAddRowAbove: '줄 추가',
|
||||
tableAddColumnLeft: '칸 추가',
|
||||
tableAddColumn: '칸 추가',
|
||||
tableDeleteRow: '줄 삭제',
|
||||
tableDeleteColumn: '칸 삭제',
|
||||
tableDestroy: '표 지우기',
|
||||
error: '에러'
|
||||
},
|
||||
// jshint camelcase:true
|
||||
},
|
||||
|
||||
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('tableAddRowAbove'));
|
||||
$dropdown.append(t.buildSubBtn('tableAddRow'));
|
||||
$dropdown.append(t.buildSubBtn('tableAddColumnLeft'));
|
||||
$dropdown.append(t.buildSubBtn('tableAddColumn'));
|
||||
$dropdown.append(t.buildSubBtn('tableDeleteRow'));
|
||||
$dropdown.append(t.buildSubBtn('tableDeleteColumn'));
|
||||
$dropdown.append(t.buildSubBtn('tableDestroy'));
|
||||
} else {
|
||||
var tableSelect = $('<table/>');
|
||||
$('<tbody/>').appendTo(tableSelect);
|
||||
for (var i = 0; i < t.o.plugins.table.rows; i += 1) {
|
||||
var row = $('<tr/>').appendTo(tableSelect);
|
||||
for (var j = 0; j < t.o.plugins.table.columns; j += 1) {
|
||||
$('<td/>').appendTo(row);
|
||||
}
|
||||
}
|
||||
tableSelect.find('td').on('mouseover', tableAnimate);
|
||||
tableSelect.find('td').on('mousedown', tableBuild);
|
||||
|
||||
$dropdown.append(tableSelect);
|
||||
$dropdown.append($('<div class="trumbowyg-table-size">1x1</div>'));
|
||||
}
|
||||
|
||||
t.dropdown(btnName);
|
||||
}
|
||||
};
|
||||
|
||||
var tableAnimate = function(columnEvent) {
|
||||
var column = $(columnEvent.target),
|
||||
table = column.closest('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('.trumbowyg-table-size').html((colIndex+1) + 'x' + (rowIndex+1));
|
||||
};
|
||||
|
||||
var tableBuild = function() {
|
||||
t.saveRange();
|
||||
|
||||
var tabler = $('<table/>');
|
||||
$('<tbody/>').appendTo(tabler);
|
||||
if (t.o.plugins.table.styler) {
|
||||
tabler.attr('class', t.o.plugins.table.styler);
|
||||
}
|
||||
|
||||
var 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/>').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 focusedRow = $(node).closest('tr');
|
||||
var table = $(node).closest('table');
|
||||
|
||||
if(table.length > 0) {
|
||||
var row = $('<tr/>');
|
||||
// add columns according to current columns count
|
||||
for (var i = 0; i < table.find('tr')[0].childElementCount; i += 1) {
|
||||
$('<td/>').appendTo(row);
|
||||
}
|
||||
// add row to table
|
||||
focusedRow.after(row);
|
||||
}
|
||||
|
||||
t.syncCode();
|
||||
}
|
||||
};
|
||||
|
||||
var addRowAbove = {
|
||||
title: t.lang.tableAddRowAbove,
|
||||
text: t.lang.tableAddRowAbove,
|
||||
ico: 'row-above',
|
||||
|
||||
fn: function () {
|
||||
t.saveRange();
|
||||
|
||||
var node = t.doc.getSelection().focusNode;
|
||||
var focusedRow = $(node).closest('tr');
|
||||
var table = $(node).closest('table');
|
||||
|
||||
if(table.length > 0) {
|
||||
var row = $('<tr/>');
|
||||
// add columns according to current columns count
|
||||
for (var i = 0; i < table.find('tr')[0].childElementCount; i += 1) {
|
||||
$('<td/>').appendTo(row);
|
||||
}
|
||||
// add row to table
|
||||
focusedRow.before(row);
|
||||
}
|
||||
|
||||
t.syncCode();
|
||||
}
|
||||
};
|
||||
|
||||
var addColumn = {
|
||||
title: t.lang.tableAddColumn,
|
||||
text: t.lang.tableAddColumn,
|
||||
ico: 'col-right',
|
||||
|
||||
fn: function () {
|
||||
t.saveRange();
|
||||
|
||||
var node = t.doc.getSelection().focusNode;
|
||||
var focusedCol = $(node).closest('td');
|
||||
var table = $(node).closest('table');
|
||||
var focusedColIdx = focusedCol.index();
|
||||
|
||||
if(table.length > 0) {
|
||||
$(table).find('tr').each(function() {
|
||||
$($(this).children()[focusedColIdx]).after('<td></td>');
|
||||
});
|
||||
}
|
||||
|
||||
t.syncCode();
|
||||
}
|
||||
};
|
||||
|
||||
var addColumnLeft = {
|
||||
title: t.lang.tableAddColumnLeft,
|
||||
text: t.lang.tableAddColumnLeft,
|
||||
ico: 'col-left',
|
||||
|
||||
fn: function () {
|
||||
t.saveRange();
|
||||
|
||||
var node = t.doc.getSelection().focusNode;
|
||||
var focusedCol = $(node).closest('td');
|
||||
var table = $(node).closest('table');
|
||||
var focusedColIdx = focusedCol.index();
|
||||
|
||||
if(table.length > 0) {
|
||||
$(table).find('tr').each(function() {
|
||||
$($(this).children()[focusedColIdx]).before('<td></td>');
|
||||
});
|
||||
}
|
||||
|
||||
t.syncCode();
|
||||
}
|
||||
};
|
||||
|
||||
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();
|
||||
|
||||
t.syncCode();
|
||||
}
|
||||
};
|
||||
|
||||
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();
|
||||
|
||||
t.syncCode();
|
||||
}
|
||||
};
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
t.syncCode();
|
||||
}
|
||||
};
|
||||
|
||||
t.addBtnDef('table', buildButtonDef);
|
||||
t.addBtnDef('tableAddRowAbove', addRowAbove);
|
||||
t.addBtnDef('tableAddRow', addRow);
|
||||
t.addBtnDef('tableAddColumnLeft', addColumnLeft);
|
||||
t.addBtnDef('tableAddColumn', addColumn);
|
||||
t.addBtnDef('tableDeleteRow', deleteRow);
|
||||
t.addBtnDef('tableDeleteColumn', deleteColumn);
|
||||
t.addBtnDef('tableDestroy', destroy);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
1
public/js/plugins/trumbowyg/plugins/table/trumbowyg.table.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/table/trumbowyg.table.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
46
public/js/plugins/trumbowyg/plugins/table/ui/sass/trumbowyg.table.scss
vendored
Normal file
46
public/js/plugins/trumbowyg/plugins/table/ui/sass/trumbowyg.table.scss
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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;
|
||||
padding: 0;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 0 1px #cecece inset;
|
||||
|
||||
&.active {
|
||||
background-color: #00b393;
|
||||
box-shadow: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.trumbowyg-table-size {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
36
public/js/plugins/trumbowyg/plugins/table/ui/trumbowyg.table.css
vendored
Normal file
36
public/js/plugins/trumbowyg/plugins/table/ui/trumbowyg.table.css
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.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;
|
||||
padding: 0;
|
||||
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; }
|
||||
|
||||
.trumbowyg-dropdown-table .trumbowyg-table-size {
|
||||
text-align: center; }
|
||||
2
public/js/plugins/trumbowyg/plugins/table/ui/trumbowyg.table.min.css
vendored
Normal file
2
public/js/plugins/trumbowyg/plugins/table/ui/trumbowyg.table.min.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/** Trumbowyg v2.21.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;padding:0;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}.trumbowyg-dropdown-table .trumbowyg-table-size{text-align:center}
|
||||
81
public/js/plugins/trumbowyg/plugins/template/trumbowyg.template.js
vendored
Normal file
81
public/js/plugins/trumbowyg/plugins/template/trumbowyg.template.js
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
// Adds the language variables
|
||||
$.extend(true, $.trumbowyg, {
|
||||
langs: {
|
||||
// jshint camelcase:false
|
||||
en: {
|
||||
template: 'Template'
|
||||
},
|
||||
da: {
|
||||
template: 'Skabelon'
|
||||
},
|
||||
de: {
|
||||
template: 'Vorlage'
|
||||
},
|
||||
fr: {
|
||||
template: 'Patron'
|
||||
},
|
||||
ja: {
|
||||
template: 'テンプレート'
|
||||
},
|
||||
ko: {
|
||||
template: '서식'
|
||||
},
|
||||
nl: {
|
||||
template: 'Sjabloon'
|
||||
},
|
||||
pt_br: {
|
||||
template: 'Modelo'
|
||||
},
|
||||
ru: {
|
||||
template: 'Шаблон'
|
||||
},
|
||||
tr: {
|
||||
template: 'Şablon'
|
||||
},
|
||||
zh_tw: {
|
||||
template: '模板',
|
||||
},
|
||||
// jshint camelcase:true
|
||||
}
|
||||
});
|
||||
|
||||
// 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);
|
||||
1
public/js/plugins/trumbowyg/plugins/template/trumbowyg.template.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/template/trumbowyg.template.min.js
vendored
Normal file
@@ -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"},da:{template:"Skabelon"},de:{template:"Vorlage"},fr:{template:"Patron"},ja:{template:"テンプレート"},ko:{template:"서식"},nl:{template:"Sjabloon"},pt_br:{template:"Modelo"},ru:{template:"Шаблон"},tr:{template:"Şablon"},zh_tw:{template:"模板"}}}),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);
|
||||
277
public/js/plugins/trumbowyg/plugins/upload/trumbowyg.upload.js
vendored
Normal file
277
public/js/plugins/trumbowyg/plugins/upload/trumbowyg.upload.js
vendored
Normal file
@@ -0,0 +1,277 @@
|
||||
/* ===========================================================
|
||||
* 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'
|
||||
},
|
||||
da: {
|
||||
upload: 'Upload',
|
||||
file: 'Fil',
|
||||
uploadError: 'Fejl'
|
||||
},
|
||||
de: {
|
||||
upload: 'Hochladen',
|
||||
file: 'Datei',
|
||||
uploadError: 'Fehler'
|
||||
},
|
||||
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'
|
||||
},
|
||||
ko: {
|
||||
upload: '그림 올리기',
|
||||
file: '파일',
|
||||
uploadError: '에러'
|
||||
},
|
||||
},
|
||||
// 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, false, true);
|
||||
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 that = this,
|
||||
req = originalXhr();
|
||||
|
||||
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);
|
||||
1
public/js/plugins/trumbowyg/plugins/upload/trumbowyg.upload.min.js
vendored
Normal file
1
public/js/plugins/trumbowyg/plugins/upload/trumbowyg.upload.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(r){"use strict";function e(r,a){var o=a.shift(),l=a;if(null!==r){if(0===l.length)return r[o];if("object"==typeof r)return e(r[o],l)}return r}function a(){if(!r.trumbowyg.addedXhrProgressEvent){var e=r.ajaxSettings.xhr;r.ajaxSetup({xhr:function(){var r=this,a=e();return a&&"object"==typeof a.upload&&void 0!==r.progressUpload&&a.upload.addEventListener("progress",function(e){r.progressUpload(e)},!1),a}}),r.trumbowyg.addedXhrProgressEvent=!0}}var o={serverPath:"",fileFieldName:"fileToUpload",data:[],headers:{},xhrFields:{},urlPropertyName:"file",statusPropertyName:"success",success:void 0,error:void 0,imageWidthModalEdit:!1};a(),r.extend(!0,r.trumbowyg,{langs:{en:{upload:"Upload",file:"File",uploadError:"Error"},da:{upload:"Upload",file:"Fil",uploadError:"Fejl"},de:{upload:"Hochladen",file:"Datei",uploadError:"Fehler"},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"},ko:{upload:"그림 올리기",file:"파일",uploadError:"에러"}},plugins:{upload:{init:function(a){a.o.plugins.upload=r.extend(!0,{},o,a.o.plugins.upload||{});var l={fn:function(){a.saveRange();var o,l=a.o.prefix,t={file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:a.getRangeText()}};a.o.plugins.upload.imageWidthModalEdit&&(t.width={value:""});var d=a.openModalInsert(a.lang.upload,t,function(t){var i=new FormData;i.append(a.o.plugins.upload.fileFieldName,o),a.o.plugins.upload.data.map(function(r){i.append(r.name,r.value)}),r.map(t,function(r,e){"file"!==e&&i.append(e,r)}),0===r("."+l+"progress",d).length&&r("."+l+"modal-title",d).after(r("<div/>",{"class":l+"progress"}).append(r("<div/>",{"class":l+"progress-bar"}))),r.ajax({url:a.o.plugins.upload.serverPath,headers:a.o.plugins.upload.headers,xhrFields:a.o.plugins.upload.xhrFields,type:"POST",data:i,cache:!1,dataType:"json",processData:!1,contentType:!1,progressUpload:function(e){r("."+l+"progress-bar").css("width",Math.round(100*e.loaded/e.total)+"%")},success:function(o){if(a.o.plugins.upload.success)a.o.plugins.upload.success(o,a,d,t);else if(e(o,a.o.plugins.upload.statusPropertyName.split("."))){var l=e(o,a.o.plugins.upload.urlPropertyName.split("."));a.execCmd("insertImage",l,!1,!0);var i=r('img[src="'+l+'"]:not([alt])',a.$box);i.attr("alt",t.alt),a.o.imageWidthModalEdit&&parseInt(t.width)>0&&i.attr({width:t.width}),setTimeout(function(){a.closeModal()},250),a.$c.trigger("tbwuploadsuccess",[a,o,l])}else a.addErrorOnModalField(r("input[type=file]",d),a.lang[o.message]),a.$c.trigger("tbwuploaderror",[a,o])},error:a.o.plugins.upload.error||function(){a.addErrorOnModalField(r("input[type=file]",d),a.lang.uploadError),a.$c.trigger("tbwuploaderror",[a])}})});r("input[type=file]").on("change",function(r){try{o=r.target.files[0]}catch(e){o=r.target.value}})}};a.addBtnDef("upload",l)}}}})}(jQuery);
|
||||
Reference in New Issue
Block a user