src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/DOMUtils.min.js
changeset 81 472bd9195a15
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/DOMUtils.min.js	Tue Sep 08 17:27:31 2015 +0200
@@ -0,0 +1,1 @@
+define("tinymce/dom/DOMUtils",["tinymce/dom/Sizzle","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/EventUtils","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/Env","tinymce/util/Tools","tinymce/dom/StyleSheetLoader"],function(c,g,j,f,h,r,d,b,a,m){var e=a.each,i=a.is,k=a.grep,o=a.trim;var n=b.ie;var l=/^([a-z0-9],?)+$/i;var s=/^[ \t\r\n]*$/;function p(u,w){var v={},t=w.keep_values,x;x={set:function(y,A,z){if(w.url_converter){A=w.url_converter.call(w.url_converter_scope||u,A,z,y[0])}y.attr("data-mce-"+z,A).attr(z,A)},get:function(y,z){return y.attr("data-mce-"+z)||y.attr(z)}};v={style:{set:function(y,z){if(z!==null&&typeof z==="object"){y.css(z);return}if(t){y.attr("data-mce-style",z)}y.attr("style",z)},get:function(y){var z=y.attr("data-mce-style")||y.attr("style");z=u.serializeStyle(u.parseStyle(z),y[0].nodeName);return z}}};if(t){v.href=v.src=x}return v}function q(w,u){var t=this,v;t.doc=w;t.win=window;t.files={};t.counter=0;t.stdMode=!n||w.documentMode>=8;t.boxModel=!n||w.compatMode=="CSS1Compat"||t.stdMode;t.styleSheetLoader=new m(w);t.boundEvents=[];t.settings=u=u||{};t.schema=u.schema;t.styles=new j({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema);t.fixDoc(w);t.events=u.ownEvents?new f(u.proxy):f.Event;t.attrHooks=p(t,u);v=u.schema?u.schema.getBlockElements():{};t.$=g.overrideDefaults(function(){return{context:w,element:t.getRoot()}});t.isBlock=function(y){if(!y){return false}var x=y.nodeType;if(x){return !!(x===1&&v[y.nodeName])}return !!v[y]}}q.prototype={$$:function(t){if(typeof t=="string"){t=this.get(t)}return this.$(t)},root:null,fixDoc:function(v){var u=this.settings,t;if(n&&u.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(w){v.createElement(w)});for(t in u.schema.getCustomElements()){v.createElement(t)}}},clone:function(v,t){var u=this,x,w;if(!n||v.nodeType!==1||t){return v.cloneNode(t)}w=u.doc;if(!t){x=w.createElement(v.nodeName);e(u.getAttribs(v),function(y){u.setAttrib(x,y.nodeName,u.getAttrib(v,y.nodeName))});return x}return x.firstChild},getRoot:function(){var t=this;return t.settings.root_element||t.doc.body},getViewPort:function(u){var t,v;u=!u?this.win:u;t=u.document;v=this.boxModel?t.documentElement:t.body;return{x:u.pageXOffset||v.scrollLeft,y:u.pageYOffset||v.scrollTop,w:u.innerWidth||v.clientWidth,h:u.innerHeight||v.clientHeight}},getRect:function(w){var t=this,v,u;w=t.get(w);v=t.getPos(w);u=t.getSize(w);return{x:v.x,y:v.y,w:u.w,h:u.h}},getSize:function(x){var u=this,t,v;x=u.get(x);t=u.getStyle(x,"width");v=u.getStyle(x,"height");if(t.indexOf("px")===-1){t=0}if(v.indexOf("px")===-1){v=0}return{w:parseInt(t,10)||x.offsetWidth||x.clientWidth,h:parseInt(v,10)||x.offsetHeight||x.clientHeight}},getParent:function(v,t,u){return this.getParents(v,t,u,false)},getParents:function(y,u,v,z){var x=this,w,t=[];y=x.get(y);z=z===undefined;v=v||(x.getRoot().nodeName!="BODY"?x.getRoot().parentNode:null);if(i(u,"string")){w=u;if(u==="*"){u=function(A){return A.nodeType==1}}else{u=function(A){return x.is(A,w)}}}while(y){if(y==v||!y.nodeType||y.nodeType===9){break}if(!u||u(y)){if(z){t.push(y)}else{return y}}y=y.parentNode}return z?t:null},get:function(u){var t;if(u&&this.doc&&typeof u=="string"){t=u;u=this.doc.getElementById(u);if(u&&u.id!==t){return this.doc.getElementsByName(t)[1]}}return u},getNext:function(u,t){return this._findSib(u,t,"nextSibling")},getPrev:function(u,t){return this._findSib(u,t,"previousSibling")},select:function(t,v){var u=this;return c(t,u.get(v)||u.settings.root_element||u.doc,[])},is:function(w,t){var u;if(w.length===undefined){if(t==="*"){return w.nodeType==1}if(l.test(t)){t=t.toLowerCase().split(/,/);w=w.nodeName.toLowerCase();for(u=t.length-1;u>=0;u--){if(t[u]==w){return true}}return false}}if(w.nodeType&&w.nodeType!=1){return false}var v=w.nodeType?[w]:w;return c(t,v[0].ownerDocument||v[0],null,v).length>0},add:function(y,v,u,x,w){var t=this;return this.run(y,function(A){var z;z=i(v,"string")?t.doc.createElement(v):v;t.setAttribs(z,u);if(x){if(x.nodeType){z.appendChild(x)}else{t.setHTML(z,x)}}return !w?A.appendChild(z):z})},create:function(u,t,v){return this.add(this.doc.createElement(u),u,t,v,1)},createHTML:function(u,t,w){var x="",v;x+="<"+u;for(v in t){if(t.hasOwnProperty(v)&&t[v]!==null&&typeof t[v]!="undefined"){x+=" "+v+'="'+this.encode(t[v])+'"'}}if(typeof w!="undefined"){return x+">"+w+"</"+u+">"}return x+" />"},createFragment:function(u){var x,v,w=this.doc,t;t=w.createElement("div");x=w.createDocumentFragment();if(u){t.innerHTML=u}while((v=t.firstChild)){x.appendChild(v)}return x},remove:function(t,u){t=this.$$(t);if(u){t.each(function(){var v;while((v=this.firstChild)){if(v.nodeType==3&&v.data.length===0){this.removeChild(v)}else{this.parentNode.insertBefore(v,this)}}}).remove()}else{t.remove()}return t.length>1?t.toArray():t[0]},setStyle:function(v,t,u){v=this.$$(v).css(t,u);if(this.settings.update_styles){v.attr("data-mce-style",null)}},getStyle:function(v,t,u){v=this.$$(v);if(u){return v.css(t)}t=t.replace(/-(\D)/g,function(x,w){return w.toUpperCase()});if(t=="float"){t=n?"styleFloat":"cssFloat"}return v[0]&&v[0].style?v[0].style[t]:undefined},setStyles:function(u,t){u=this.$$(u).css(t);if(this.settings.update_styles){u.attr("data-mce-style",null)}},removeAllAttribs:function(t){return this.run(t,function(w){var v,u=w.attributes;for(v=u.length-1;v>=0;v--){w.removeAttributeNode(u.item(v))}})},setAttrib:function(z,v,y){var u=this,t,x,w=u.settings;if(y===""){y=null}z=u.$$(z);t=z.attr(v);if(!z.length){return}x=u.attrHooks[v];if(x&&x.set){x.set(z,y,v)}else{z.attr(v,y)}if(t!=y&&w.onSetAttrib){w.onSetAttrib({attrElm:z,attrName:v,attrValue:y})}},setAttribs:function(v,u){var t=this;t.$$(v).each(function(w,x){e(u,function(z,y){t.setAttrib(x,y,z)})})},getAttrib:function(y,u,x){var t=this,w,v;y=t.$$(y);if(y.length){w=t.attrHooks[u];if(w&&w.get){v=w.get(y,u)}else{v=y.attr(u)}}if(typeof v=="undefined"){v=x||""}return v},getPos:function(v,w){var D=this,B=0,A=0,t,C=D.doc,u=C.body,z;v=D.get(v);w=w||u;if(v){if(w===u&&v.getBoundingClientRect&&g(u).css("position")==="static"){z=v.getBoundingClientRect();w=D.boxModel?C.documentElement:u;B=z.left+(C.documentElement.scrollLeft||u.scrollLeft)-w.clientLeft;A=z.top+(C.documentElement.scrollTop||u.scrollTop)-w.clientTop;return{x:B,y:A}}t=v;while(t&&t!=w&&t.nodeType){B+=t.offsetLeft||0;A+=t.offsetTop||0;t=t.offsetParent}t=v.parentNode;while(t&&t!=w&&t.nodeType){B-=t.scrollLeft||0;A-=t.scrollTop||0;t=t.parentNode}}return{x:B,y:A}},parseStyle:function(t){return this.styles.parse(t)},serializeStyle:function(u,t){return this.styles.serialize(u,t)},addStyle:function(w){var u=this,x=u.doc,v,y;if(u!==q.DOM&&x===document){var t=q.DOM.addedStyles;t=t||[];if(t[w]){return}t[w]=true;q.DOM.addedStyles=t}y=x.getElementById("mceDefaultStyles");if(!y){y=x.createElement("style");y.id="mceDefaultStyles";y.type="text/css";v=x.getElementsByTagName("head")[0];if(v.firstChild){v.insertBefore(y,v.firstChild)}else{v.appendChild(y)}}if(y.styleSheet){y.styleSheet.cssText+=w}else{y.appendChild(x.createTextNode(w))}},loadCSS:function(u){var t=this,w=t.doc,v;if(t!==q.DOM&&w===document){q.DOM.loadCSS(u);return}if(!u){u=""}v=w.getElementsByTagName("head")[0];e(u.split(","),function(x){var y;x=a._addCacheSuffix(x);if(t.files[x]){return}t.files[x]=true;y=t.create("link",{rel:"stylesheet",href:x});if(n&&w.documentMode&&w.recalc){y.onload=function(){if(w.recalc){w.recalc()}y.onload=null}}v.appendChild(y)})},addClass:function(u,t){this.$$(u).addClass(t)},removeClass:function(u,t){this.toggleClass(u,t,false)},hasClass:function(u,t){return this.$$(u).hasClass(t)},toggleClass:function(v,t,u){this.$$(v).toggleClass(t,u).each(function(){if(this.className===""){g(this).attr("class",null)}})},show:function(t){this.$$(t).show()},hide:function(t){this.$$(t).hide()},isHidden:function(t){return this.$$(t).css("display")=="none"},uniqueId:function(t){return(!t?"mce_":t)+(this.counter++)},setHTML:function(u,t){u=this.$$(u);if(n){u.each(function(w,x){if(x.canHaveHTML===false){return}while(x.firstChild){x.removeChild(x.firstChild)}try{x.innerHTML="<br>"+t;x.removeChild(x.firstChild)}catch(v){g("<div>").html("<br>"+t).contents().slice(1).appendTo(x)}return t})}else{u.html(t)}},getOuterHTML:function(t){t=this.get(t);return t.nodeType==1&&"outerHTML" in t?t.outerHTML:g("<div>").append(g(t).clone()).html()},setOuterHTML:function(v,u){var t=this;t.$$(v).each(function(){try{if("outerHTML" in this){this.outerHTML=u;return}}catch(w){}t.remove(g(this).html(u),true)})},decode:d.decode,encode:d.encodeAllRaw,insertAfter:function(u,t){t=this.get(t);return this.run(u,function(w){var v,x;v=t.parentNode;x=t.nextSibling;if(x){v.insertBefore(w,x)}else{v.appendChild(w)}return w})},replace:function(v,u,w){var t=this;return t.run(u,function(x){if(i(x,"array")){v=v.cloneNode(true)}if(w){e(k(x.childNodes),function(y){v.appendChild(y)})}return x.parentNode.replaceChild(v,x)})},rename:function(w,u){var t=this,v;if(w.nodeName!=u.toUpperCase()){v=t.create(u);e(t.getAttribs(w),function(x){t.setAttrib(v,x.nodeName,t.getAttrib(w,x.nodeName))});t.replace(v,w,1)}return v||w},findCommonAncestor:function(v,t){var w=v,u;while(w){u=t;while(u&&w!=u){u=u.parentNode}if(w==u){break}w=w.parentNode}if(!w&&v.ownerDocument){return v.ownerDocument.documentElement}return w},toHex:function(t){return this.styles.toHex(a.trim(t))},run:function(x,w,v){var u=this,t;if(typeof x==="string"){x=u.get(x)}if(!x){return false}v=v||this;if(!x.nodeType&&(x.length||x.length===0)){t=[];e(x,function(z,y){if(z){if(typeof z=="string"){z=u.get(z)}t.push(w.call(v,z,y))}});return t}return w.call(v,x)},getAttribs:function(v){var t;v=this.get(v);if(!v){return[]}if(n){t=[];if(v.nodeName=="OBJECT"){return v.attributes}if(v.nodeName==="OPTION"&&this.getAttrib(v,"selected")){t.push({specified:1,nodeName:"selected"})}var u=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;v.cloneNode(false).outerHTML.replace(u,"").replace(/[\w:\-]+/gi,function(w){t.push({specified:1,nodeName:w})});return t}return v.attributes},isEmpty:function(w,u){var B=this,y,x,A,t,v,z=0;w=w.firstChild;if(w){t=new h(w,w.parentNode);u=u||(B.schema?B.schema.getNonEmptyElements():null);do{A=w.nodeType;if(A===1){if(w.getAttribute("data-mce-bogus")){continue}v=w.nodeName.toLowerCase();if(u&&u[v]){if(v==="br"){z++;continue}return false}x=B.getAttribs(w);y=x.length;while(y--){v=x[y].nodeName;if(v==="name"||v==="data-mce-bookmark"){return false}}}if(A==8){return false}if((A===3&&!s.test(w.nodeValue))){return false}}while((w=t.next()))}return z<=1},createRng:function(){var t=this.doc;return t.createRange?t.createRange():new r(this)},nodeIndex:function(w,x){var t=0,v,u;if(w){for(v=w.nodeType,w=w.previousSibling;w;w=w.previousSibling){u=w.nodeType;if(x&&u==3){if(u==v||!w.nodeValue.length){continue}}t++;v=u}}return t},split:function(x,y,u){var B=this,t=B.createRng(),z,w,A;function v(G){var E,D=G.childNodes,F=G.nodeType;function H(K){var J=K.previousSibling&&K.previousSibling.nodeName=="SPAN";var I=K.nextSibling&&K.nextSibling.nodeName=="SPAN";return J&&I}if(F==1&&G.getAttribute("data-mce-type")=="bookmark"){return}for(E=D.length-1;E>=0;E--){v(D[E])}if(F!=9){if(F==3&&G.nodeValue.length>0){var C=o(G.nodeValue).length;if(!B.isBlock(G.parentNode)||C>0||C===0&&H(G)){return}}else{if(F==1){D=G.childNodes;if(D.length==1&&D[0]&&D[0].nodeType==1&&D[0].getAttribute("data-mce-type")=="bookmark"){G.parentNode.insertBefore(D[0],G)}if(D.length||/^(br|hr|input|img)$/i.test(G.nodeName)){return}}}B.remove(G)}return G}if(x&&y){t.setStart(x.parentNode,B.nodeIndex(x));t.setEnd(y.parentNode,B.nodeIndex(y));z=t.extractContents();t=B.createRng();t.setStart(y.parentNode,B.nodeIndex(y)+1);t.setEnd(x.parentNode,B.nodeIndex(x)+1);w=t.extractContents();A=x.parentNode;A.insertBefore(v(z),x);if(u){A.replaceChild(u,y)}else{A.insertBefore(y,x)}A.insertBefore(v(w),x);B.remove(x);return u||y}},bind:function(y,u,x,w){var t=this;if(a.isArray(y)){var v=y.length;while(v--){y[v]=t.bind(y[v],u,x,w)}return y}if(t.settings.collect&&(y===t.doc||y===t.win)){t.boundEvents.push([y,u,x,w])}return t.events.bind(y,u,x,w||t)},unbind:function(y,u,x){var t=this,v;if(a.isArray(y)){v=y.length;while(v--){y[v]=t.unbind(y[v],u,x)}return y}if(t.boundEvents&&(y===t.doc||y===t.win)){v=t.boundEvents.length;while(v--){var w=t.boundEvents[v];if(y==w[0]&&(!u||u==w[1])&&(!x||x==w[2])){this.events.unbind(w[0],w[1],w[2])}}}return this.events.unbind(y,u,x)},fire:function(v,u,t){return this.events.fire(v,u,t)},getContentEditable:function(u){var t;if(!u||u.nodeType!=1){return null}t=u.getAttribute("data-mce-contenteditable");if(t&&t!=="inherit"){return t}return u.contentEditable!=="inherit"?u.contentEditable:null},getContentEditableParent:function(u){var t=this.getRoot(),v=null;for(;u&&u!==t;u=u.parentNode){v=this.getContentEditable(u);if(v!==null){break}}return v},destroy:function(){var t=this;if(t.boundEvents){var u=t.boundEvents.length;while(u--){var v=t.boundEvents[u];this.events.unbind(v[0],v[1],v[2])}t.boundEvents=null}if(c.setDocument){c.setDocument()}t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(u,t){while(u){if(t===u){return true}u=u.parentNode}return false},dumpRng:function(t){return("startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset)},_findSib:function(x,t,v){var u=this,w=t;if(x){if(typeof w=="string"){w=function(y){return u.is(y,t)}}for(x=x[v];x;x=x[v]){if(w(x)){return x}}}return null}};q.DOM=new q(document);return q});
\ No newline at end of file