mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-03 13:25:05 +01:00
1 line
9.1 KiB
JavaScript
1 line
9.1 KiB
JavaScript
!function(){"use strict";var e,t,n,r,o,i,a,u,l,c,s,d,f,m=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=function(e){return function(){return e}},h=function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var a=new Array(arguments.length-1),n=1;n<arguments.length;n++)a[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=a.concat(n);return i.apply(null,o)}},y=p(!1),g=p(!0),k=y,v=g,b=function(){return w},w=(r={fold:function(e,t){return e()},is:k,isSome:k,isNone:v,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:b,ap:b,each:function(){},bind:b,flatten:b,exists:k,forall:v,filter:b,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:p("none()")},Object.freeze&&Object.freeze(r),r),x=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:v,isNone:k,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return x(e(n))},ap:function(e){return e.fold(b,function(e){return x(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:w},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(k,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},A={some:x,none:b,from:function(e){return null===e||e===undefined?w:x(e)}},O=(o="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===o}),S=(i=Array.prototype.indexOf)===undefined?function(e,t){return T(e,t)}:function(e,t){return i.call(e,t)},C=function(e,t){return-1<S(e,t)},P=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},T=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},_=(Array.prototype.slice,O(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.I18n")),F="undefined"!=typeof window?window:Function("return this;")(),M=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:F,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},H=function(e,t){var n=M(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n},I=function(){return H("URL")},E=function(e){return I().createObjectURL(e)},j=navigator,N=j.userAgent,L=function(e){return"matchMedia"in window&&matchMedia(e).matches};/Android/.test(N),u=(u=!(a=/WebKit/.test(N))&&/MSIE/gi.test(N)&&/Explorer/gi.test(j.appName))&&/MSIE (\w+)\./.exec(N)[1],l=-1!==N.indexOf("Trident/")&&(-1!==N.indexOf("rv:")||-1!==j.appName.indexOf("Netscape"))&&11,c=-1!==N.indexOf("Edge/")&&!u&&!l&&12,u=u||l||c,!a&&!l&&/Gecko/.test(N),s=-1!==N.indexOf("Mac"),d=/(iPad|iPhone)/.test(N),f="FormData"in window&&"FileReader"in window&&"URL"in window&&!!E,L("only screen and (max-device-width: 480px)"),L("only screen and (min-width: 800px)"),N.indexOf("Windows Phone"),c&&(a=!1);var D=s,U=(!d||f||parseInt(N.match(/AppleWebKit\/(\d*)/)[1],10),window.getSelection&&window,u&&!c&&document.documentMode,D?"\u2318":"Ctrl"),B=D?"Ctrl + Alt":"Shift + Alt",R={shortcuts:[{shortcut:U+" + B",action:"Bold"},{shortcut:U+" + I",action:"Italic"},{shortcut:U+" + U",action:"Underline"},{shortcut:U+" + A",action:"Select all"},{shortcut:U+" + Y or "+U+" + Shift + Z",action:"Redo"},{shortcut:U+" + Z",action:"Undo"},{shortcut:B+" + 1",action:"Header 1"},{shortcut:B+" + 2",action:"Header 2"},{shortcut:B+" + 3",action:"Header 3"},{shortcut:B+" + 4",action:"Header 4"},{shortcut:B+" + 5",action:"Header 5"},{shortcut:B+" + 6",action:"Header 6"},{shortcut:B+" + 7",action:"Paragraph"},{shortcut:B+" + 8",action:"Div"},{shortcut:B+" + 9",action:"Address"},{shortcut:"Alt + F9",action:"Focus to menubar"},{shortcut:"Alt + F10",action:"Focus to toolbar"},{shortcut:"Alt + F11",action:"Focus to element path"},{shortcut:"Ctrl + F9",action:"Focus to contextual toolbar"},{shortcut:U+" + K",action:"Insert link (if link plugin activated)"},{shortcut:U+" + S",action:"Save (if save plugin activated)"},{shortcut:U+" + F",action:"Find (if searchreplace plugin activated)"}]},z=function(){var e=P(R.shortcuts,function(e){return'<tr data-mce-tabstop="1" tabindex="-1" aria-label="Action: '+(t=e).action+", Shortcut: "+t.shortcut.replace(/Ctrl/g,"Control")+'"><td>'+_.translate(e.action)+"</td><td>"+e.shortcut+"</td></tr>";var t}).join("");return{title:"Handy Shortcuts",items:[{type:"htmlpanel",html:'<div><table class="mce-table-striped"><thead><th>'+_.translate("Action")+"</th><th>"+_.translate("Shortcut")+"</th></thead>"+e+"</table></div>"}]}},V=Object.keys,q=function(e,o){return e.replace(/\$\{([^{}]*)\}/g,function(e,t){var n,r=o[t];return"string"==(n=typeof r)||"number"===n?r.toString():e})},W=[{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"compat3x",name:"3.x Compatibility"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"}],K=function(e){var t,n,r,o,i,a,u,l,c,s=h(q,'<a href="${url}" target="_blank" rel="noopener">${name}</a>'),d=function(t,n){return function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return A.some(o)}return A.none()}(W,function(e){return e.key===n}).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?s(e()):n},function(e){return s({name:e.name,url:"https://www.tiny.cloud/docs/plugins/"+e.key})})};return{title:"Plugins",items:[{type:"htmlpanel",html:[(t=e,null==t?"":'<div style="overflow-y: auto; overflow-x: hidden; max-height: 230px; height: 230px;" data-mce-tabstop="1" tabindex="-1">'+(n=t,i=V((r=n).plugins),a=r.settings.forced_plugins===undefined?i:function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n}(i,(o=h(C,r.settings.forced_plugins),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!o.apply(null,arguments)})),u=P(a,function(e){return"<li>"+d(n,e)+"</li>"}),l=u.length,c=u.join(""),"<p><b>"+_.translate(["Plugins installed ({0}):",l])+"</b></p><ul>"+c+"</ul>")+"</div>"),'<div style="padding: 10px; background: #e3e7f4; height: 100%;" data-mce-tabstop="1" tabindex="-1"><p><b>'+_.translate("Premium plugins:")+'</b></p><ul><li>PowerPaste</li><li>Spell Checker Pro</li><li>Accessibility Checker</li><li>Advanced Code Editor</li><li>Enhanced Media Embed</li><li>Link Checker</li></ul><br /><p style="float: right;"><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+_.translate("Learn more...")+"</a></p></div>"].join("")}]}},X=tinymce.util.Tools.resolve("tinymce.EditorManager"),$=function(){var e,t,n='<a href="https://www.tinymce.com/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+(e=X.majorVersion,t=X.minorVersion,0===e.indexOf("@")?"X.X.X":e+"."+t)+"</a>";return{title:"Version",items:[{type:"htmlpanel",html:_.translate(["You are using {0}",n])}]}},Y=function(e,t){return function(){e.windowManager.open({title:"Help",size:"medium",body:{type:"tabpanel",tabs:[z(),K(e),$()]},buttons:[{type:"cancel",name:"cancel",text:"Close",primary:!0}],initialData:{}})}},Z=function(e,t){e.addCommand("mceHelp",Y(e,t))},G=function(e,t){e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:Y(e,t)}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",onAction:Y(e,t)})};m.add("help",function(e,t){G(e,t),Z(e,t),e.shortcuts.add("Alt+0","Open help dialog","mceHelp")}),function J(){}}(); |