New assets/plugins

This commit is contained in:
2022-08-14 03:40:48 -04:00
parent b2155d64ed
commit f2240cd6e7
184 changed files with 34304 additions and 11 deletions
@@ -0,0 +1,149 @@
/* ===========================================================
* 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'
},
by: {
mathml: 'Уставіць формулу',
formulas: 'Формула',
inline: 'Inline-элемент'
},
da: {
mathml: 'Indsæt formler',
formulas: 'Formler',
inline: 'Inline'
},
et: {
mathml: 'Sisesta valem',
formulas: 'Valemid',
inline: 'Teksti sees'
},
fr: {
mathml: 'Inserer une formule',
formulas: 'Formule',
inline: 'En ligne'
},
hu: {
mathml: 'Formulák beszúrás',
formulas: 'Formulák',
inline: 'Inline'
},
ko: {
mathml: '수식 넣기',
formulas: '수식',
inline: '글 안에 넣기'
},
pt_br: {
mathml: 'Inserir fórmulas',
formulas: 'Fórmulas',
inline: 'Em linha'
},
ru: {
mathml: 'Вставить формулу',
formulas: 'Формула',
inline: 'Строчный элемент'
},
tr: {
mathml: 'Formül Ekle',
formulas: 'Formüller',
inline: 'Satır içi'
},
zh_tw: {
mathml: '插入方程式',
formulas: '方程式',
inline: '內嵌'
},
},
// jshint camelcase:true
plugins: {
mathml: {
init: function (trumbowyg) {
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 contenteditable="false" formulas="' + v.formulas + '" inline="' + (v.inline ? 'true' : 'false') + '" >' + delimiter + ' ' + v.formulas + ' ' + delimiter + '</span>';
var node = $(html)[0];
node.onclick = openModal;
trumbowyg.range.deleteContents();
trumbowyg.range.insertNode(node);
}
trumbowyg.currentMathNode = false;
MathJax.Hub.Queue(['Typeset', MathJax.Hub]);
return true;
};
var openModal = 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);
};
var btnDef = {
fn: function () {
trumbowyg.saveRange();
mathMlOptions.formulas.value = trumbowyg.getRangeText();
mathMlOptions.inline.attributes.checked = true;
trumbowyg.openModalInsert(trumbowyg.lang.mathml, mathMlOptions, mathmlCallback);
}
};
trumbowyg.$ta.on('tbwinit', function () {
var nodes = trumbowyg.$ed.find('[formulas]');
nodes.each(function (i, elem) {
elem.onclick = openModal;
});
});
trumbowyg.addBtnDef('mathml', btnDef);
}
}
}
});
})(jQuery);
@@ -0,0 +1,8 @@
/* ===========================================================
* trumbowyg.mathMl.js v1.0
* MathML plugin for Trumbowyg
* http://alex-d.github.com/Trumbowyg
* ===========================================================
* Author : loclamor
*/
!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{mathml:"Insert Formulas",formulas:"Formulas",inline:"Inline"},by:{mathml:"Уставіць формулу",formulas:"Формула",inline:"Inline-элемент"},da:{mathml:"Indsæt formler",formulas:"Formler",inline:"Inline"},et:{mathml:"Sisesta valem",formulas:"Valemid",inline:"Teksti sees"},fr:{mathml:"Inserer une formule",formulas:"Formule",inline:"En ligne"},hu:{mathml:"Formulák beszúrás",formulas:"Formulák",inline:"Inline"},ko:{mathml:"수식 넣기",formulas:"수식",inline:"글 안에 넣기"},pt_br:{mathml:"Inserir fórmulas",formulas:"Fórmulas",inline:"Em linha"},ru:{mathml:"Вставить формулу",formulas:"Формула",inline:"Строчный элемент"},tr:{mathml:"Formül Ekle",formulas:"Formüller",inline:"Satır içi"},zh_tw:{mathml:"插入方程式",formulas:"方程式",inline:"內嵌"}},plugins:{mathml:{init:function(n){var l={formulas:{label:n.lang.formulas,required:!0,value:""},inline:{label:n.lang.inline,attributes:{checked:!0},type:"checkbox",required:!1}},a=function(l){var a=l.inline?"$":"$$";if(n.currentMathNode)e(n.currentMathNode).html(a+" "+l.formulas+" "+a).attr("formulas",l.formulas).attr("inline",l.inline?"true":"false");else{var r='<span contenteditable="false" formulas="'+l.formulas+'" inline="'+(l.inline?"true":"false")+'" >'+a+" "+l.formulas+" "+a+"</span>",i=e(r)[0];i.onclick=t,n.range.deleteContents(),n.range.insertNode(i)}return n.currentMathNode=!1,MathJax.Hub.Queue(["Typeset",MathJax.Hub]),!0},t=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)},r={fn:function(){n.saveRange(),l.formulas.value=n.getRangeText(),l.inline.attributes.checked=!0,n.openModalInsert(n.lang.mathml,l,a)}};n.$ta.on("tbwinit",(function(){n.$ed.find("[formulas]").each((function(e,n){n.onclick=t}))})),n.addBtnDef("mathml",r)}}}})}(jQuery);
@@ -0,0 +1,41 @@
/**
* Trumbowyg v2.25.2 - 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
*/
[formulas] {
position: relative;
display: inline-block;
pointer-events: none;
&[inline="false"] {
display: block;
width: 100%;
}
&::after {
content: '\270E';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 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;
}
&:hover {
&::after {
opacity: 1;
}
}
}
@@ -0,0 +1,33 @@
/**
* Trumbowyg v2.25.2 - 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
*/
[formulas] {
position: relative;
display: inline-block;
pointer-events: none; }
[formulas][inline="false"] {
display: block;
width: 100%; }
[formulas]::after {
content: '\270E';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0;
background-color: rgba(255, 255, 255, 0.83);
-webkit-box-shadow: 0 0 5px 5px rgba(255, 255, 255, 0.83);
box-shadow: 0 0 5px 5px rgba(255, 255, 255, 0.83);
cursor: pointer;
pointer-events: auto; }
[formulas]:hover::after {
opacity: 1; }
@@ -0,0 +1,2 @@
/** Trumbowyg v2.25.2 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
[formulas]{position:relative;display:inline-block;pointer-events:none}[formulas][inline=false]{display:block;width:100%}[formulas]::after{content:'\270E';position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;background-color:rgba(255,255,255,.83);-webkit-box-shadow:0 0 5px 5px rgba(255,255,255,.83);box-shadow:0 0 5px 5px rgba(255,255,255,.83);cursor:pointer;pointer-events:auto}[formulas]:hover::after{opacity:1}