src/myams/resources/js/ext/tinymce/dev/classes/dom/ControlSelection.min.js
changeset 5 c9c69b13d884
parent 0 f05d7aea098a
--- a/src/myams/resources/js/ext/tinymce/dev/classes/dom/ControlSelection.min.js	Wed Jul 15 15:04:38 2020 +0200
+++ b/src/myams/resources/js/ext/tinymce/dev/classes/dom/ControlSelection.min.js	Wed Jul 15 15:39:56 2020 +0200
@@ -1,1 +1,1 @@
-define("tinymce/dom/ControlSelection",["tinymce/util/VK","tinymce/util/Tools","tinymce/Env"],function(c,b,a){return function(q,e){var f=e.dom,L=b.each;var n,U,G,I,S,Q;var v,t,E,D,w,B,J,j;var d,g,o=e.getDoc(),R=document,m=a.ie&&a.ie<11;var A=Math.abs,P=Math.round,s=e.getBody(),x,h;I={n:[0.5,0,0,-1],e:[1,0.5,1,0],s:[0.5,1,0,1],w:[0,0.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var u=".mce-content-body";e.contentStyles.push(u+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}"+u+" .mce-resizehandle:hover {background: #000}"+u+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+u+" .mce-clonedresizable {position: absolute;"+(a.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+u+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");function M(W){var V=e.settings.object_resizing;if(V===false||a.iOS){return false}if(typeof V!="string"){V="table,img,div"}if(W.getAttribute("data-mce-resize")==="false"){return false}return e.dom.is(W,V)}function i(Y){var W,V,X;var aa,Z;W=Y.screenX-v;V=Y.screenY-t;d=W*S[2]+w;g=V*S[3]+B;d=d<5?5:d;g=g<5?5:g;if(n.nodeName=="IMG"&&e.settings.resize_img_proportional!==false){X=!c.modifierPressed(Y)}else{X=c.modifierPressed(Y)||(n.nodeName=="IMG"&&S[2]*S[3]!==0)}if(X){if(A(W)>A(V)){g=P(d*J);d=P(g/J)}else{d=P(g/J);g=P(d*J)}}f.setStyles(U,{width:d,height:g});aa=S.startPos.x+W;Z=S.startPos.y+V;aa=aa>0?aa:0;Z=Z>0?Z:0;f.setStyles(G,{left:aa,top:Z,display:"block"});G.innerHTML=d+" &times; "+g;if(S[2]<0&&U.clientWidth<=d){f.setStyle(U,"left",E+(w-d))}if(S[3]<0&&U.clientHeight<=g){f.setStyle(U,"top",D+(B-g))}W=s.scrollWidth-x;V=s.scrollHeight-h;if(W+V!==0){f.setStyles(G,{left:aa-W,top:Z-V})}if(!j){e.fire("ObjectResizeStart",{target:n,width:w,height:B});j=true}}function H(){j=false;function V(W,X){if(X){if(n.style[W]||!e.schema.isValid(n.nodeName.toLowerCase(),W)){f.setStyle(n,W,X)}else{f.setAttrib(n,W,X)}}}V("width",d);V("height",g);f.unbind(o,"mousemove",i);f.unbind(o,"mouseup",H);if(R!=o){f.unbind(R,"mousemove",i);f.unbind(R,"mouseup",H)}f.remove(U);f.remove(G);if(!m||n.nodeName=="TABLE"){C(n)}e.fire("ObjectResized",{target:n,width:d,height:g});f.setAttrib(n,"style",f.getAttrib(n,"style"));e.nodeChanged()}function C(ab,Z,X){var W,Y,V,ac,aa;T();W=f.getPos(ab,s);E=W.x;D=W.y;aa=ab.getBoundingClientRect();Y=aa.width||(aa.right-aa.left);V=aa.height||(aa.bottom-aa.top);if(n!=ab){N();n=ab;d=g=0}ac=e.fire("ObjectSelected",{target:ab});if(M(ab)&&!ac.isDefaultPrevented()){L(I,function(ag,ae){var af,ah;function ad(ai){v=ai.screenX;t=ai.screenY;w=n.clientWidth;B=n.clientHeight;J=B/w;S=ag;ag.startPos={x:Y*ag[0]+E,y:V*ag[1]+D};x=s.scrollWidth;h=s.scrollHeight;U=n.cloneNode(true);f.addClass(U,"mce-clonedresizable");f.setAttrib(U,"data-mce-bogus","all");U.contentEditable=false;U.unSelectabe=true;f.setStyles(U,{left:E,top:D,margin:0});U.removeAttribute("data-mce-selected");s.appendChild(U);f.bind(o,"mousemove",i);f.bind(o,"mouseup",H);if(R!=o){f.bind(R,"mousemove",i);f.bind(R,"mouseup",H)}G=f.add(s,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},w+" &times; "+B)}if(Z){if(ae==Z){ad(X)}return}af=f.get("mceResizeHandle"+ae);if(!af){ah=s;af=f.add(ah,"div",{id:"mceResizeHandle"+ae,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:true,style:"cursor:"+ae+"-resize; margin:0; padding:0"});if(a.ie){af.contentEditable=false}}else{f.show(af)}if(!ag.elm){f.bind(af,"mousedown",function(ai){ai.stopImmediatePropagation();ai.preventDefault();ad(ai)});ag.elm=af}f.setStyles(af,{left:(Y*ag[0]+E)-(af.offsetWidth/2),top:(V*ag[1]+D)-(af.offsetHeight/2)})})}else{y()}n.setAttribute("data-mce-selected","1")}function y(){var V,W;T();if(n){n.removeAttribute("data-mce-selected")}for(V in I){W=f.get("mceResizeHandle"+V);if(W){f.unbind(W);f.remove(W)}}}function z(Y){var X,V;function W(aa,Z){if(aa){do{if(aa===Z){return true}}while((aa=aa.parentNode))}}if(j){return}L(f.select("img[data-mce-selected],hr[data-mce-selected]"),function(Z){Z.removeAttribute("data-mce-selected")});V=Y.type=="mousedown"?Y.target:q.getNode();V=f.$(V).closest(m?"table":"table,img,hr")[0];if(W(V,s)){F();X=q.getStart(true);if(W(X,V)&&W(q.getEnd(true),V)){if(!m||(V!=X&&X.nodeName!=="IMG")){C(V);return}}}y()}function k(X,V,W){if(X&&X.attachEvent){X.attachEvent("on"+V,W)}}function r(X,V,W){if(X&&X.detachEvent){X.detachEvent("on"+V,W)}}function p(X){var Y=X.srcElement,ac,V,ad,ab,Z,aa,W;ac=Y.getBoundingClientRect();aa=Q.clientX-ac.left;W=Q.clientY-ac.top;for(V in I){ad=I[V];ab=Y.offsetWidth*ad[0];Z=Y.offsetHeight*ad[1];if(A(ab-aa)<8&&A(Z-W)<8){S=ad;break}}j=true;e.fire("ObjectResizeStart",{target:n,width:n.clientWidth,height:n.clientHeight});e.getDoc().selection.empty();C(Y,V,Q)}function O(W){var V=W.srcElement;if(V!=n){e.fire("ObjectSelected",{target:V});N();if(V.id.indexOf("mceResizeHandle")===0){W.returnValue=false;return}if(V.nodeName=="IMG"||V.nodeName=="TABLE"){y();n=V;k(V,"resizestart",p)}}}function N(){r(n,"resizestart",p)}function T(){for(var V in I){var W=I[V];if(W.elm){f.unbind(W.elm);delete W.elm}}}function F(){try{e.getDoc().execCommand("enableObjectResizing",false,false)}catch(V){}}function l(X){var W;if(!m){return}W=o.body.createControlRange();try{W.addElement(X);W.select();return true}catch(V){}}e.on("init",function(){if(m){e.on("ObjectResized",function(V){if(V.target.nodeName!="TABLE"){y();l(V.target)}});k(s,"controlselect",O);e.on("mousedown",function(V){Q=V})}else{F();if(a.ie>=11){e.on("mouseup",function(V){var W=V.target.nodeName;if(!j&&/^(TABLE|IMG|HR)$/.test(W)){e.selection.select(V.target,W=="TABLE");e.nodeChanged()}});e.dom.bind(s,"mscontrolselect",function(V){if(/^(TABLE|IMG|HR)$/.test(V.target.nodeName)){V.preventDefault();if(V.target.tagName=="IMG"){window.setTimeout(function(){e.selection.select(V.target)},0)}}})}}e.on("nodechange ResizeEditor",z);e.on("keydown keyup",function(V){if(n&&n.nodeName=="TABLE"){z(V)}});e.on("hide",y)});e.on("remove",T);function K(){n=U=null;if(m){N();r(s,"controlselect",O)}}return{isResizable:M,showResizeRect:C,hideResizeRect:y,updateResizeRect:z,controlSelect:l,destroy:K}}});
\ No newline at end of file
+define("tinymce/dom/ControlSelection",["tinymce/util/VK","tinymce/util/Tools","tinymce/Env"],(function(e,t,n){return function(i,o){var s,a,c,d,r,l,m,u,g,f,h,b,p,v,y,z,w,R,x=o.dom,E=t.each,S=o.getDoc(),A=document,N=n.ie&&n.ie<11,H=Math.abs,k=Math.round,B=o.getBody();d={n:[.5,0,0,-1],e:[1,.5,1,0],s:[.5,1,0,1],w:[0,.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var C=".mce-content-body";function M(e){var t=o.settings.object_resizing;return!1!==t&&!n.iOS&&("string"!=typeof t&&(t="table,img,div"),"false"!==e.getAttribute("data-mce-resize")&&o.dom.is(e,t))}function T(t){var n,i,d,l;n=t.screenX-m,i=t.screenY-u,y=n*r[2]+h,z=i*r[3]+b,y=y<5?5:y,z=z<5?5:z,("IMG"==s.nodeName&&!1!==o.settings.resize_img_proportional?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==s.nodeName&&r[2]*r[3]!=0)&&(H(n)>H(i)?(z=k(y*p),y=k(z/p)):(y=k(z/p),z=k(y*p))),x.setStyles(a,{width:y,height:z}),d=(d=r.startPos.x+n)>0?d:0,l=(l=r.startPos.y+i)>0?l:0,x.setStyles(c,{left:d,top:l,display:"block"}),c.innerHTML=y+" &times; "+z,r[2]<0&&a.clientWidth<=y&&x.setStyle(a,"left",g+(h-y)),r[3]<0&&a.clientHeight<=z&&x.setStyle(a,"top",f+(b-z)),(n=B.scrollWidth-w)+(i=B.scrollHeight-R)!==0&&x.setStyles(c,{left:d-n,top:l-i}),v||(o.fire("ObjectResizeStart",{target:s,width:h,height:b}),v=!0)}function L(){function e(e,t){t&&(s.style[e]||!o.schema.isValid(s.nodeName.toLowerCase(),e)?x.setStyle(s,e,t):x.setAttrib(s,e,t))}v=!1,e("width",y),e("height",z),x.unbind(S,"mousemove",T),x.unbind(S,"mouseup",L),A!=S&&(x.unbind(A,"mousemove",T),x.unbind(A,"mouseup",L)),x.remove(a),x.remove(c),N&&"TABLE"!=s.nodeName||O(s),o.fire("ObjectResized",{target:s,width:y,height:z}),x.setAttrib(s,"style",x.getAttrib(s,"style")),o.nodeChanged()}function O(e,t,i){var l,v,N,H,k;V(),l=x.getPos(e,B),g=l.x,f=l.y,k=e.getBoundingClientRect(),v=k.width||k.right-k.left,N=k.height||k.bottom-k.top,s!=e&&(F(),s=e,y=z=0),H=o.fire("ObjectSelected",{target:e}),M(e)&&!H.isDefaultPrevented()?E(d,(function(e,o){var d,l;function y(t){m=t.screenX,u=t.screenY,h=s.clientWidth,b=s.clientHeight,p=b/h,r=e,e.startPos={x:v*e[0]+g,y:N*e[1]+f},w=B.scrollWidth,R=B.scrollHeight,a=s.cloneNode(!0),x.addClass(a,"mce-clonedresizable"),x.setAttrib(a,"data-mce-bogus","all"),a.contentEditable=!1,a.unSelectabe=!0,x.setStyles(a,{left:g,top:f,margin:0}),a.removeAttribute("data-mce-selected"),B.appendChild(a),x.bind(S,"mousemove",T),x.bind(S,"mouseup",L),A!=S&&(x.bind(A,"mousemove",T),x.bind(A,"mouseup",L)),c=x.add(B,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},h+" &times; "+b)}t?o==t&&y(i):((d=x.get("mceResizeHandle"+o))?x.show(d):(l=B,d=x.add(l,"div",{id:"mceResizeHandle"+o,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+o+"-resize; margin:0; padding:0"}),n.ie&&(d.contentEditable=!1)),e.elm||(x.bind(d,"mousedown",(function(e){e.stopImmediatePropagation(),e.preventDefault(),y(e)})),e.elm=d),x.setStyles(d,{left:v*e[0]+g-d.offsetWidth/2,top:N*e[1]+f-d.offsetHeight/2}))})):j(),s.setAttribute("data-mce-selected","1")}function j(){var e,t;for(e in V(),s&&s.removeAttribute("data-mce-selected"),d)(t=x.get("mceResizeHandle"+e))&&(x.unbind(t),x.remove(t))}function I(e){var t,n;function o(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)}v||(E(x.select("img[data-mce-selected],hr[data-mce-selected]"),(function(e){e.removeAttribute("data-mce-selected")})),n="mousedown"==e.type?e.target:i.getNode(),o(n=x.$(n).closest(N?"table":"table,img,hr")[0],B)&&(X(),o(t=i.getStart(!0),n)&&o(i.getEnd(!0),n)&&(!N||n!=t&&"IMG"!==t.nodeName))?O(n):j())}function P(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function G(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function W(e){var t,n,i,a,c,m,u,g=e.srcElement;for(n in t=g.getBoundingClientRect(),m=l.clientX-t.left,u=l.clientY-t.top,d)if(i=d[n],a=g.offsetWidth*i[0],c=g.offsetHeight*i[1],H(a-m)<8&&H(c-u)<8){r=i;break}v=!0,o.fire("ObjectResizeStart",{target:s,width:s.clientWidth,height:s.clientHeight}),o.getDoc().selection.empty(),O(g,n,l)}function D(e){var t=e.srcElement;if(t!=s){if(o.fire("ObjectSelected",{target:t}),F(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);"IMG"!=t.nodeName&&"TABLE"!=t.nodeName||(j(),s=t,P(t,"resizestart",W))}}function F(){G(s,"resizestart",W)}function V(){for(var e in d){var t=d[e];t.elm&&(x.unbind(t.elm),delete t.elm)}}function X(){try{o.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function Y(e){var t;if(N){t=S.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(e){}}}return o.contentStyles.push(C+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}"+C+" .mce-resizehandle:hover {background: #000}"+C+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+C+" .mce-clonedresizable {position: absolute;"+(n.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+C+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),o.on("init",(function(){N?(o.on("ObjectResized",(function(e){"TABLE"!=e.target.nodeName&&(j(),Y(e.target))})),P(B,"controlselect",D),o.on("mousedown",(function(e){l=e}))):(X(),n.ie>=11&&(o.on("mouseup",(function(e){var t=e.target.nodeName;!v&&/^(TABLE|IMG|HR)$/.test(t)&&(o.selection.select(e.target,"TABLE"==t),o.nodeChanged())})),o.dom.bind(B,"mscontrolselect",(function(e){/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&window.setTimeout((function(){o.selection.select(e.target)}),0))})))),o.on("nodechange ResizeEditor",I),o.on("keydown keyup",(function(e){s&&"TABLE"==s.nodeName&&I(e)})),o.on("hide",j)})),o.on("remove",V),{isResizable:M,showResizeRect:O,hideResizeRect:j,updateResizeRect:I,controlSelect:Y,destroy:function(){s=a=null,N&&(F(),G(B,"controlselect",D))}}}}));