easyappointments/assets/ext/trumbowyg/plugins/fontsize/trumbowyg.fontsize.min.js

1 line
1.5 KiB
JavaScript
Raw Normal View History

!function(e){"use strict";function t(t){var n=[],s=["x-small","small","medium","large","x-large"];e.each(s,function(e,s){t.addBtnDef("fontsize_"+s,{text:'<span style="font-size: '+s+';">'+t.lang.fontsizes[s]+"</span>",hasIcon:!1,fn:function(){t.execCmd("fontSize",e+1,!0)}}),n.push("fontsize_"+s)});var a="fontsize_custom",o={fn:function(){t.openModalInsert("Custom Font Size",{size:{label:"Font Size",value:"48px"}},function(n){var s=t.range.startContainer.parentElement,a=t.getRangeText();if(e(s).html()===a)e(s).css("font-size",n.size);else{t.range.deleteContents();var o='<span style="font-size: '+n.size+';">'+a+"</span>",l=e(o)[0];t.range.insertNode(l)}return t.saveRange(),!0})},text:'<span style="font-size: medium;">'+t.lang.fontsizes.custom+"</span>",hasIcon:!1};return t.addBtnDef(a,o),n.push(a),n}e.extend(!0,e.trumbowyg,{langs:{en:{fontsize:"Font size",fontsizes:{"x-small":"Extra small",small:"Small",medium:"Regular",large:"Large","x-large":"Extra large",custom:"Custom"}},fr:{fontsize:"Taille de la police",fontsizes:{"x-small":"Très petit",small:"Petit",medium:"Normal",large:"Grand","x-large":"Très grand",custom:"Douane"}},nl:{fontsize:"Lettergrootte",fontsizes:{"x-small":"Extra klein",small:"Klein",medium:"Normaal",large:"Groot","x-large":"Extra groot",custom:"Tilpasset"}},tr:{fontsize:"Yazı Boyutu",fontsizes:{"x-small":"Çok Küçük",small:"Küçük",medium:"Normal",large:"Büyük","x-large":"Çok Büyük",custom:"Görenek"}}}}),e.extend(!0,e.trumbowyg,{plugins:{fontsize:{init:function(e){e.addBtnDef("fontsize",{dropdown:t(e)})}}}})}(jQuery);