]> BookStack Code Mirror - bookstack/blobdiff - public/libs/tinymce/plugins/contextmenu/plugin.min.js
Rolled tri-layout to page edit and book-create
[bookstack] / public / libs / tinymce / plugins / contextmenu / plugin.min.js
index 5a46aa31e97d6c2bfbe67e473307c21886085a48..a2e2c7547f1f330b81f6483578932f35bf89ee2f 100644 (file)
@@ -1 +1 @@
-!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("6",tinymce.util.Tools.resolve),g("1",["6"],function(a){return a("tinymce.dom.DOMUtils")}),g("2",["6"],function(a){return a("tinymce.Env")}),g("3",["6"],function(a){return a("tinymce.PluginManager")}),g("4",["6"],function(a){return a("tinymce.ui.Menu")}),g("5",["6"],function(a){return a("tinymce.util.Tools")}),g("0",["1","2","3","4","5"],function(a,b,c,d,e){var f=a.DOM;return c.add("contextmenu",function(a){var c,g,h=a.settings.contextmenu_never_use_native,i=function(a){return a.ctrlKey&&!h},j=function(){return b.mac&&b.webkit},k=function(){return g===!0};return a.on("mousedown",function(b){j()&&2===b.button&&!i(b)&&a.selection.isCollapsed()&&a.once("contextmenu",function(b){a.selection.placeCaretAt(b.clientX,b.clientY)})}),a.on("contextmenu",function(b){var h;if(!i(b)){if(b.preventDefault(),h=a.settings.contextmenu||"link openlink image inserttable | cell row column deletetable",c)c.show();else{var j=[];e.each(h.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",j.push(c))});for(var k=0;k<j.length;k++)"|"==j[k].text&&(0!==k&&k!=j.length-1||j.splice(k,1));c=new d({items:j,context:"contextmenu",classes:"contextmenu"}).renderTo(),c.on("hide",function(a){a.control===this&&(g=!1)}),a.on("remove",function(){c.remove(),c=null})}var l={x:b.pageX,y:b.pageY};a.inline||(l=f.getPos(a.getContentAreaContainer()),l.x+=b.clientX,l.y+=b.clientY),c.moveTo(l.x,l.y),g=!0}}),{isContextMenuVisible:k}}),function(){}}),d("0")()}();
\ No newline at end of file
+!function(){"use strict";var o=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return o(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t){return{isContextMenuVisible:function(){return t.get()}}},r=function(t){return t.settings.contextmenu_never_use_native},u=function(t){return t.getParam("contextmenu","link openlink image inserttable | cell row column deletetable")},l=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=function(t){return l.DOM.select(t.settings.ui_container)[0]},a=function(t,n){return{x:t,y:n}},f=function(t,n,e){return a(t.x+n,t.y+e)},m=function(t,n){if(t&&"static"!==l.DOM.getStyle(t,"position",!0)){var e=l.DOM.getPos(t),o=e.x-t.scrollLeft,i=e.y-t.scrollTop;return f(n,-o,-i)}return f(n,0,0)},c=function(t,n){if(t.inline)return m(s(t),a((u=n).pageX,u.pageY));var e,o,i,r,u,c=(e=t.getContentAreaContainer(),o=a((r=n).clientX,r.clientY),i=l.DOM.getPos(e),f(o,i.x,i.y));return m(s(t),c)},g=tinymce.util.Tools.resolve("tinymce.ui.Factory"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),y=function(t,n,e,o){null===o.get()?o.set(function(e,n){var t,o,i=[];o=u(e),v.each(o.split(/[ ,]/),function(t){var n=e.menuItems[t];"|"===t&&(n={text:t}),n&&(n.shortcut="",i.push(n))});for(var r=0;r<i.length;r++)"|"===i[r].text&&(0!==r&&r!==i.length-1||i.splice(r,1));return(t=g.create("menu",{items:i,context:"contextmenu",classes:"contextmenu"})).uiContainer=s(e),t.renderTo(s(e)),t.on("hide",function(t){t.control===this&&n.set(!1)}),e.on("remove",function(){t.remove(),t=null}),t}(t,e)):o.get().show(),o.get().moveTo(n.x,n.y),e.set(!0)},x=function(e,o,i){e.on("contextmenu",function(t){var n;n=e,(!t.ctrlKey||r(n))&&(t.preventDefault(),y(e,c(e,t),o,i))})};t.add("contextmenu",function(t){var n=o(null),e=o(!1);return x(t,e,n),i(e)})}();
\ No newline at end of file