From db0deabda01f112b4dd9e1e38a1b6d13df9e8e4e Mon Sep 17 00:00:00 2001 From: taggon Date: Wed, 26 Oct 2011 09:04:40 +0000 Subject: [PATCH] issue 707: Remove codes that changes URL in hyperlinks git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9758 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../skins/xpresseditor/js/Xpress_Editor.js | 2 +- .../skins/xpresseditor/js/xe_interface.js | 30 ----------- .../skins/xpresseditor/js/xpresseditor.js | 32 +---------- .../skins/xpresseditor/js/xpresseditor.min.js | 54 +++++++++---------- 4 files changed, 28 insertions(+), 90 deletions(-) diff --git a/modules/editor/skins/xpresseditor/js/Xpress_Editor.js b/modules/editor/skins/xpresseditor/js/Xpress_Editor.js index eaa76dd01..76bb67716 100644 --- a/modules/editor/skins/xpresseditor/js/Xpress_Editor.js +++ b/modules/editor/skins/xpresseditor/js/Xpress_Editor.js @@ -5244,7 +5244,7 @@ xe.XE_Extension = $.Class({ } }; - $('img,div[editor_component]', doc).each(function(){ + $(doc).find('img,div[editor_component]').each(function(){ var obj = $(this); if(this.nodeName == 'IMG' && !obj.attr('editor_component')) { obj.attr('editor_component','image_link'); diff --git a/modules/editor/skins/xpresseditor/js/xe_interface.js b/modules/editor/skins/xpresseditor/js/xe_interface.js index 1fc609259..4f2ea3299 100644 --- a/modules/editor/skins/xpresseditor/js/xe_interface.js +++ b/modules/editor/skins/xpresseditor/js/xe_interface.js @@ -77,7 +77,6 @@ function editorStart_xe(editor_sequence, primary_key, content_key, editor_height oEditor.registerPlugin(new xe.XE_XHTMLFormatter); oEditor.registerPlugin(new xe.XE_GET_WYSYWYG_MODE(editor_sequence)); - oEditor.registerPlugin(new xe.XE_GET_WYSYWYG_CONTENT()); if(jQuery("ul.extra1").length) { oEditor.registerPlugin(new xe.XE_ColorPalette(elAppContainer)); @@ -243,35 +242,6 @@ xe.XE_GET_WYSYWYG_MODE = jQuery.Class({ } }); -// 이미지등의 상대경로를 절대경로로 바꾸는 플러그인 -xe.XE_GET_WYSYWYG_CONTENT = jQuery.Class({ - name : "XE_GET_WYSYWYG_CONTENT", - - $ON_MSG_APP_READY : function() { - this.oApp.addConverter("IR_TO_WYSIWYG", this.replaceXE2HTTP); - this.oApp.addConverter("WYSIWYG_TO_IR", this.replaceHTTP2XE); - }, - - replaceXE2HTTP : function(content) { - // src, href, url의 XE 상대경로를 http로 시작하는 full path로 변경 - content = editorReplacePath(content); - - return content; - }, - - replaceHTTP2XE : function(content) { - // src, href, url에서 http로 시작하는 full path를 XE 상대경로로 변경 - contENT = content.replace(/(src=|href=|url\()("|\')*([^"\'\)]+)("|\'|\))*(\s|>|\))*/ig, function(m0,m1,m2,m3,m4,m5) { - var uriReg = new RegExp('^'+request_uri.replace('\/','\\/'),'ig'), val; - if(m1=="url(") { m2=''; m4=')'; } else { m2 = m2 || '"'; m4 = m4 || '"'; } - val = uriReg.test(val=jQuery.trim(m3))?val.replace(uriReg,''):m3; - - return m1+m2+val+m4+(m5||''); - }); - return content; - } -}); - // 서식 기본 내용을 보존 xe.XE_PreservTemplate = jQuery.Class({ name : "XE_PreservTemplate", diff --git a/modules/editor/skins/xpresseditor/js/xpresseditor.js b/modules/editor/skins/xpresseditor/js/xpresseditor.js index 4cba52530..50e5b36e7 100644 --- a/modules/editor/skins/xpresseditor/js/xpresseditor.js +++ b/modules/editor/skins/xpresseditor/js/xpresseditor.js @@ -5244,7 +5244,7 @@ xe.XE_Extension = $.Class({ } }; - $('img,div[editor_component]', doc).each(function(){ + $(doc).find('img,div[editor_component]').each(function(){ var obj = $(this); if(this.nodeName == 'IMG' && !obj.attr('editor_component')) { obj.attr('editor_component','image_link'); @@ -5841,7 +5841,6 @@ function editorStart_xe(editor_sequence, primary_key, content_key, editor_height oEditor.registerPlugin(new xe.XE_XHTMLFormatter); oEditor.registerPlugin(new xe.XE_GET_WYSYWYG_MODE(editor_sequence)); - oEditor.registerPlugin(new xe.XE_GET_WYSYWYG_CONTENT()); if(jQuery("ul.extra1").length) { oEditor.registerPlugin(new xe.XE_ColorPalette(elAppContainer)); @@ -6007,35 +6006,6 @@ xe.XE_GET_WYSYWYG_MODE = jQuery.Class({ } }); -// 이미지등의 상대경로를 절대경로로 바꾸는 플러그인 -xe.XE_GET_WYSYWYG_CONTENT = jQuery.Class({ - name : "XE_GET_WYSYWYG_CONTENT", - - $ON_MSG_APP_READY : function() { - this.oApp.addConverter("IR_TO_WYSIWYG", this.replaceXE2HTTP); - this.oApp.addConverter("WYSIWYG_TO_IR", this.replaceHTTP2XE); - }, - - replaceXE2HTTP : function(content) { - // src, href, url의 XE 상대경로를 http로 시작하는 full path로 변경 - content = editorReplacePath(content); - - return content; - }, - - replaceHTTP2XE : function(content) { - // src, href, url에서 http로 시작하는 full path를 XE 상대경로로 변경 - contENT = content.replace(/(src=|href=|url\()("|\')*([^"\'\)]+)("|\'|\))*(\s|>|\))*/ig, function(m0,m1,m2,m3,m4,m5) { - var uriReg = new RegExp('^'+request_uri.replace('\/','\\/'),'ig'), val; - if(m1=="url(") { m2=''; m4=')'; } else { m2 = m2 || '"'; m4 = m4 || '"'; } - val = uriReg.test(val=jQuery.trim(m3))?val.replace(uriReg,''):m3; - - return m1+m2+val+m4+(m5||''); - }); - return content; - } -}); - // 서식 기본 내용을 보존 xe.XE_PreservTemplate = jQuery.Class({ name : "XE_PreservTemplate", diff --git a/modules/editor/skins/xpresseditor/js/xpresseditor.min.js b/modules/editor/skins/xpresseditor/js/xpresseditor.min.js index 5cfb32bd4..a226c9643 100644 --- a/modules/editor/skins/xpresseditor/js/xpresseditor.min.js +++ b/modules/editor/skins/xpresseditor/js/xpresseditor.min.js @@ -9,7 +9,7 @@ g=true;if(a.match(/^\$(BEFORE|ON|AFTER)_MSG_APP_READY$/))for(var h=0;h=0&&xe.DOMFix.parentNode(a[j])==a[b];)j=this._recurConstructClonedTree(a,j,a[b],o,d,f);k.insertBefore(o,k.firstChild);return j};a[a.length]=xe.DOMFix.parentNode(a[a.length-1]);_recurConstructClonedTree(a,a.length-1,a[a.length-1],b);return{oStartContainer:d,oEndContainer:f}}, +return a},_constructClonedTree:function(a,b){var d=null,f=null,c=this.startContainer,g=this.endContainer;_recurConstructClonedTree=function(a,b,j,p){if(b<0)return b;var j=b-1,n=a[b].cloneNode(false);a[b]==c&&(d=n);for(a[b]==g&&(f=n);j>=0&&xe.DOMFix.parentNode(a[j])==a[b];)j=this._recurConstructClonedTree(a,j,a[b],n,d,f);p.insertBefore(n,p.firstChild);return j};a[a.length]=xe.DOMFix.parentNode(a[a.length-1]);_recurConstructClonedTree(a,a.length-1,a[a.length-1],b);return{oStartContainer:d,oEndContainer:f}}, cloneRange:function(){return this._copyRange(new xe.W3CDOMRange(this._document))},_copyRange:function(a){a.collapsed=this.collapsed;a.commonAncestorContainer=this.commonAncestorContainer;a.endContainer=this.endContainer;a.endOffset=this.endOffset;a.startContainer=this.startContainer;a.startOffset=this.startOffset;a._document=this._document;return a},collapse:function(a){a?(this.endContainer=this.startContainer,this.endOffset=this.startOffset):(this.startContainer=this.endContainer,this.startOffset= this.endOffset);this._updateRangeInfo()},compareBoundaryPoints:function(a,b){switch(a){case xe.W3CDOMRange.START_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,b.startContainer,b.startOffset);case xe.W3CDOMRange.START_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,b.startContainer,b.startOffset);case xe.W3CDOMRange.END_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,b.endContainer,b.endOffset);case xe.W3CDOMRange.END_TO_START:return this._compareEndPoint(this.startContainer, this.startOffset,b.endContainer,b.endOffset)}},_findBody:function(a){if(!a)return null;for(;a;){if(a.tagName=="BODY")return a;a=xe.DOMFix.parentNode(a)}return null},_compareEndPoint:function(a,b,d,f){if(!a||this._findBody(a)!=this._document.body)a=this._document.body,b=0;if(!d||this._findBody(d)!=this._document.body)d=this._document.body,f=0;var c=this._getCommonAncestorContainer(a,d);if(a!=c){for(;(oTmpNode=xe.DOMFix.parentNode(a))!=c;)a=oTmpNode;b=this._getPosIdx(a)+0.5}if(d!=c){for(;(oTmpNode= @@ -31,7 +31,7 @@ this.rxLineBreaker=RegExp("^("+this.sBlockElement+"|"+this.sBlockContainer+")$") b){this.setEndAfter(b);this.setStartBefore(a)},splitTextAtBothEnds:function(){this._splitTextEndNodesOfTheRange()},getStartNode:function(){return this.collapsed?this.startContainer.nodeType==3?this.startOffset==0?null:this.startContainer.nodeValue.length<=this.startOffset?null:this.startContainer:null:this.startContainer.nodeType==3?this.startOffset>=this.startContainer.nodeValue.length?this._getNextNode(this.startContainer):this.startContainer:this.startOffset>=xe.DOMFix.childNodes(this.startContainer).length? this._getNextNode(this.startContainer):xe.DOMFix.childNodes(this.startContainer)[this.startOffset]},getEndNode:function(){return this.collapsed?this.getStartNode():this.endContainer.nodeType==3?this.endOffset==0?this._getPrevNode(this.endContainer):this.endContainer:this.endOffset==0?this._getPrevNode(this.endContainer):xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]},getNodeAroundRange:function(a,b){if(this.collapsed&&this.startContainer&&this.startContainer.nodeType==3)return this.startContainer; if(!this.collapsed||this.startContainer&&this.startContainer.nodeType==3)return this.getStartNode();var d,c,e;c=this.startOffset>=xe.DOMFix.childNodes(this.startContainer).length?this._getNextNode(this.startContainer):xe.DOMFix.childNodes(this.startContainer)[this.startOffset];d=this.endOffset==0?this._getPrevNode(this.endContainer):xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1];a?(e=d,!e&&!b&&(e=c)):(e=c,!e&&!b&&(e=d));return e},_getXPath:function(a){for(var b="";a&&a.nodeType==1;)b="/"+ -a.tagName+"["+this._getPosIdx4XPath(a)+"]"+b,a=xe.DOMFix.parentNode(a);return b},_getPosIdx4XPath:function(a){for(var b=0,d=a.previousSibling;d;d=d.previousSibling)d.tagName==a.tagName&&b++;return b},_evaluateXPath:function(a,b){for(var a=a.substring(1,a.length-1),d=a.split(/\//),c=b.body,e=2;e-1&&a){for(var c=xe.DOMFix.childNodes(a),e=null;(e=c[b])&&e.nodeType==3&&e.nodeValue.length=0?true:bIncludePartlyIncluded?d==1?false:c==-1?false:true:false},isNodeInRange:function(a,b,d){var c=new xe.XpressRange(this._window);d&&a.firstChild?(c.setStartBefore(a.firstChild),c.setEndAfter(a.lastChild)): c.selectNode(a);return isRangeInRange(c,b)},pasteHTML:function(a){if(a=="")this.deleteContents();else{var b=this._document.createElement("DIV");b.innerHTML=a;for(var a=b.firstChild,d=b.lastChild,c=this.cloneRange(),e=c.placeStringBookmark();b.lastChild;)this.insertNode(b.lastChild);this.setEndNodes(a,d);c.moveToBookmark(e);c.deleteContents();c.removeStringBookmark(e)}},toString:function(){this.toString=xe.W3CDOMRange.prototype.toString;return this.toString()},toHTMLString:function(){var a=this._document.createElement("DIV"); a.appendChild(this.cloneContents());return a.innerHTML},findAncestorByTagName:function(a){for(var b=this.commonAncestorContainer;b&&b.tagName!=a;)b=xe.DOMFix.parentNode(b);return b},selectNodeContents:function(a){if(a){var b=a.firstChild?a.firstChild:a,a=a.lastChild?a.lastChild:a;b.nodeType==3?this.setStart(b,0):this.setStartBefore(b);a.nodeType==3?this.setEnd(a,a.nodeValue.length):this.setEndAfter(a)}},styleRange:function(a,b,d){d=this._getStyleParentNodes(d);if(!(d.length<1)){for(var f,e,g=0;g< -d.length;g++){for(var h in a)f=h,e=a[f],typeof e=="string"&&(d[g].style[f]=e);if(b)for(h in b)f=h,e=b[f],typeof e=="string"&&(f=="class"?c(d[g]).addClass(e):d[g].setAttribute(f,e))}this.setStartBefore(d[0]);this.setEndAfter(d[d.length-1])}},_getStyleParentNodes:function(a){this._splitTextEndNodesOfTheRange();for(var b=this.getStartNode(),d=this.getEndNode(),f=this._getNodesInRange(),e=[],g=0,h,l,j,k,o,m=f.length,n=c(f).filter(function(){return!!this.childNodes.length}),q=0;q=0;g--)if(e[g].nodeType==3||e[g].tagName=="BR"){for(var h=c._document.createElement("P"),f=e[g].nextSibling;g>=0&&e[g]&&(e[g].nodeType==3||e[g].tagName=="BR");)h.insertBefore(e[g--],h.firstChild);oFormattingNode.insertBefore(h,f);g++}if(oFormattingNode&&oFormattingNode.parentNode)h=c._document.createElement("P"),h.innerHTML=unescape("
"),oFormattingNode.parentNode.insertBefore(h,oFormattingNode.nextSibling); +a.parentNode.className,a!="q8"?this._wrapBlock("BLOCKQUOTE",a):this._unwrapBlock("BLOCKQUOTE"),this.oApp.exec("HIDE_ACTIVE_LAYER",[])},_unwrapBlock:function(a){for(var b=this.oApp.getSelection().commonAncestorContainer;b&&b.tagName!=a;)b=b.parentNode;if(b){for(;b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);b.parentNode.removeChild(b)}},_wrapBlock:function(a,b){var d=this.oApp.getSelection(),c=d.getLineInfo(),e=c.oStart,c=c.oEnd,g=/BODY|TD|LI/i,e=e.bParentBreak&&!g.test(e.oLineBreaker.tagName)? +e.oNode.parentNode:e.oNode,c=c.bParentBreak&&!g.test(c.oLineBreaker.tagName)?c.oNode.parentNode:c.oNode;d.setStartBefore(e);d.setEndAfter(c);if(g=this._expandToTableStart(d,c))c=g,d.setEndAfter(g);if(g=this._expandToTableStart(d,e))e=g,d.setStartBefore(g);g=e;for(e=d.commonAncestorContainer;g&&g!=e&&g.parentNode!=e;)g=g.parentNode;oFormattingNode=d._document.createElement(a);if(b)oFormattingNode.className=b;g==e?e.insertBefore(oFormattingNode,e.firstChild):e.insertBefore(oFormattingNode,g);d.setStartAfter(oFormattingNode); +d.setEndAfter(c);d.surroundContents(oFormattingNode);e=oFormattingNode.childNodes;for(g=e.length-1;g>=0;g--)if(e[g].nodeType==3||e[g].tagName=="BR"){for(var h=d._document.createElement("P"),c=e[g].nextSibling;g>=0&&e[g]&&(e[g].nodeType==3||e[g].tagName=="BR");)h.insertBefore(e[g--],h.firstChild);oFormattingNode.insertBefore(h,c);g++}if(oFormattingNode&&oFormattingNode.parentNode)h=d._document.createElement("P"),h.innerHTML=unescape("
"),oFormattingNode.parentNode.insertBefore(h,oFormattingNode.nextSibling); this.oApp.exec("RECORD_UNDO_ACTION",["Block Quote"]);return oFormattingNode},_expandToTableStart:function(a,b){for(var c=a.commonAncestorContainer,f=null,e=false;b&&!e;){b==c&&(e=true);if(/TBODY|TFOOT|THEAD|TR/i.test(b.tagName)){f=this._getTableRoot(b);break}b=b.parentNode}return f},_getTableRoot:function(a){for(;a&&a.tagName!="TABLE";)a=a.parentNode;return a}});xe.XE_SCharacter=c.Class({name:"XE_SCharacter",$init:function(a){this.bIE=c.browser.msie;this._assignHTMLObjects(a);this.charSet=[];this.charSet[0]= unescape("FF5B FF5D 3014 3015 3008 3009 300A 300B 300C 300D 300E 300F 3010 3011 2018 2019 201C 201D 3001 3002 %B7 2025 2026 %A7 203B 2606 2605 25CB 25CF 25CE 25C7 25C6 25A1 25A0 25B3 25B2 25BD 25BC 25C1 25C0 25B7 25B6 2664 2660 2661 2665 2667 2663 2299 25C8 25A3 25D0 25D1 2592 25A4 25A5 25A8 25A7 25A6 25A9 %B1 %D7 %F7 2260 2264 2265 221E 2234 %B0 2032 2033 2220 22A5 2312 2202 2261 2252 226A 226B 221A 223D 221D 2235 222B 222C 2208 220B 2286 2287 2282 2283 222A 2229 2227 2228 FFE2 21D2 21D4 2200 2203 %B4 FF5E 02C7 02D8 02DD 02DA 02D9 %B8 02DB %A1 %BF 02D0 222E 2211 220F 266D 2669 266A 266C 327F 2192 2190 2191 2193 2194 2195 2197 2199 2196 2198 321C 2116 33C7 2122 33C2 33D8 2121 2668 260F 260E 261C 261E %B6 2020 2021 %AE %AA %BA 2642 2640").replace(/(\S{4})/g, function(a){return"%u"+a}).split(" ");this.charSet[1]=unescape("%BD 2153 2154 %BC %BE 215B 215C 215D 215E %B9 %B2 %B3 2074 207F 2081 2082 2083 2084 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 FFE6 %24 FFE5 FFE1 20AC 2103 212B 2109 FFE0 %A4 2030 3395 3396 3397 2113 3398 33C4 33A3 33A4 33A5 33A6 3399 339A 339B 339C 339D 339E 339F 33A0 33A1 33A2 33CA 338D 338E 338F 33CF 3388 3389 33C8 33A7 33A8 33B0 33B1 33B2 33B3 33B4 33B5 33B6 33B7 33B8 33B9 3380 3381 3382 3383 3384 33BA 33BB 33BC 33BD 33BE 33BF 3390 3391 3392 3393 3394 2126 33C0 33C1 338A 338B 338C 33D6 33C5 33AD 33AE 33AF 33DB 33A9 33AA 33AB 33AC 33DD 33D0 33D3 33C3 33C9 33DC 33C6").replace(/(\S{4})/g, @@ -172,11 +172,11 @@ d=0;d\n";f=this.oRowInput.value;a+="";for(d=0;d]+)(.*?)>/ig;regex_font_color=/color\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i;regex_font_face=/face\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i;regex_font_size=/size\s*=(?:\s*"(\d+)"|\s*'(\d+)'|(\d+))/i;regex_style=/style\s*=\s*(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i;regex_font_weight=/font-weight\s*:\s*([a-z]+);?/i;regex_font_style= -/font-style\s*:\s*italic;?/i;regex_font_decoration=/text-decoration\s*:\s*([a-z -]+);?/i;regex_jquery=/jQuery\d+\s*=(\s*"\d+"|\d+)/ig;regex_quote_attr=/([\w-]+\s*=(?:\s*"[^"]+"|\s*'[^']+'))|([\w-]+)=([^\s]+)/g;"a,abbr,acronym,address,area,blockquote,br,caption,center,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,embed,h1,h2,h3,h4,h5,h6,hr,img,ins,kbd,li,map,object,ol,p,param,pre,q,samp,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,tt,u,ul,var,iframe,object,param,style".split(",");var n="area,br,col,embed,hr,img,input,param".split(","); +/font-style\s*:\s*italic;?/i;regex_font_decoration=/text-decoration\s*:\s*([a-z -]+);?/i;regex_jquery=/jQuery\d+\s*=(\s*"\d+"|\d+)/ig;regex_quote_attr=/([\w-]+\s*=(?:\s*"[^"]+"|\s*'[^']+'))|([\w-]+)=([^\s]+)/g;"a,abbr,acronym,address,area,blockquote,br,caption,center,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,embed,h1,h2,h3,h4,h5,h6,hr,img,ins,kbd,li,map,object,ol,p,param,pre,q,samp,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,tt,u,ul,var,iframe,object,param,style".split(",");var o="area,br,col,embed,hr,img,input,param".split(","); xe.XE_XHTMLFormatter=c.Class({name:"XE_XHTMLFormatter",$ON_MSG_APP_READY:function(){this.oApp.addConverter("WYSIWYG_TO_IR",this.TO_IR);this.oApp.addConverter("HTMLSrc_TO_IR",this.TO_IR);this.oApp.addConverter("IR_TO_HTMLSrc",this.IR_TO);this.oApp.addConverter("IR_TO_WYSIWYG",this.IR_TO)},TO_IR:function(a){var b=[];c.browser.msie&&(a=a.replace(regex_jquery,""),a=a.replace(/<(\w+) ([^>]+)>/g,function(a,b,c){return"<"+b+" "+c.replace(regex_quote_attr,function(a,b,c,d){return b?b:/^"/.test(d)||/"$/.test(d)? -c+"="+d:c+'="'+(d||c)+'"'})+">"}));regex=/<(\/)?([:\w\/-]+)(.*?)>/ig;return a=a.replace(regex,function(a,f,e,g){f=f||"";e=e.toLowerCase();g=c.trim(g||"");if(f){g=[];a="";if(!b.length)return"";do a=b.pop(),a.tag==e&&a.state!="deleted"&&g.push("");while(b.length&&a.tag!=e);return g.join("")}else if(c.inArray(e,n)>=0){a=g.length;e=="br"&&(g="");if(!g||g.substring(a-1,a)!="/")g+="/";return"<"+e+" "+c.trim(g)+">"}else b[b.length]={tag:e,state:""};return"<"+f+e+(g?" "+g:"")+">"})},IR_TO:function(a){return a}}); +c+"="+d:c+'="'+(d||c)+'"'})+">"}));regex=/<(\/)?([:\w\/-]+)(.*?)>/ig;return a=a.replace(regex,function(a,f,e,g){f=f||"";e=e.toLowerCase();g=c.trim(g||"");if(f){g=[];a="";if(!b.length)return"";do a=b.pop(),a.tag==e&&a.state!="deleted"&&g.push("");while(b.length&&a.tag!=e);return g.join("")}else if(c.inArray(e,o)>=0){a=g.length;e=="br"&&(g="");if(!g||g.substring(a-1,a)!="/")g+="/";return"<"+e+" "+c.trim(g)+">"}else b[b.length]={tag:e,state:""};return"<"+f+e+(g?" "+g:"")+">"})},IR_TO:function(a){return a}}); xe.XE_Extension=c.Class({name:"XE_Extension",seq:"",last_doc:"",$init:function(a,b){this.seq=b;this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){this.elDropdownLayer=c("DIV.xpress_xeditor_extension_layer",a).get(0)},_removeAttrs:function(a){return a},_addEvent:function(){if(this.oApp.getEditingMode()=="WYSIWYG"){var a=this.oApp.getWYSIWYGDocument(),b=this.seq,d=function(){var a=c(this),d=a.attr("editor_component");d&&c.isFunction(openComponent)&&(editorPrevNode=a.get(0),openComponent(d,b))}; -c("img,div[editor_component]",a).each(function(){var b=c(this);this.nodeName=="IMG"&&!b.attr("editor_component")&&b.attr("editor_component","image_link");if(this.last_doc!=a)b.dblclick(d),this.last_doc=a})}},$ON_MSG_APP_READY:function(){var a=this.oApp;a.exec("REGISTER_UI_EVENT",["extension","click","TOGGLE_EXTENSION_LAYER"]);var b=function(){a.exec("HIDE_ACTIVE_LAYER",[])};c("a",this.elDropdownLayer).each(function(){var a=c(this);a.attr("component_onclick_event_added")||(a.click(b),a.attr("component_onclick_event_added", +c(a).find("img,div[editor_component]").each(function(){var b=c(this);this.nodeName=="IMG"&&!b.attr("editor_component")&&b.attr("editor_component","image_link");if(this.last_doc!=a)b.dblclick(d),this.last_doc=a})}},$ON_MSG_APP_READY:function(){var a=this.oApp;a.exec("REGISTER_UI_EVENT",["extension","click","TOGGLE_EXTENSION_LAYER"]);var b=function(){a.exec("HIDE_ACTIVE_LAYER",[])};c("a",this.elDropdownLayer).each(function(){var a=c(this);a.attr("component_onclick_event_added")||(a.click(b),a.attr("component_onclick_event_added", "Y"))})},$ON_TOGGLE_EXTENSION_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer])},$ON_CHANGE_EDITING_MODE:function(){var a=this;setTimeout(function(){a._addEvent()},100)},$ON_PASTE_HTML:function(){var a=this;setTimeout(function(){a._addEvent()},100)},$ON_LOAD_IR_FIELD:function(){var a=this;setTimeout(function(){a._addEvent()},100)},$ON_SET_IR:function(){var a=this;setTimeout(function(){a._addEvent()},100)}});xe.XE_AutoSave=c.Class({name:"XE_AutoSave",form:null,textarea:null, $init:function(a,b){this.form=a.form;this.textarea=a;this._assignHTMLObjects(b)},_assignHTMLObjects:function(){this.welMessageBox=c("autosave_message")},$ON_MSG_APP_READY:function(){var a=c(this.form._saved_doc_title),b=c(this.form._saved_doc_content),a=c.trim(a.val()),b=c.trim(b.val());if(a||b)confirm(this.form._saved_doc_message.value)?(c(this.form.title).val(a),this.oApp.setIR(b),typeof editorGetAutoSavedDoc=="function"&&editorGetAutoSavedDoc(this.form)):editorRemoveSavedDoc();editorEnableAutoSave(this.form, c(this.form).attr("editor_sequence"));this.oApp.exec("REGISTER_HOTKEY",["ctrl+shift+s","AUTO_SAVE"])},$ON_AUTO_SAVE:function(){_editorAutoSave()}});xe.XE_FormatWithSelectUI=c.Class({name:"XE_FormatWithSelectUI",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){this.elFormatSelect=c("SELECT.xpress_xeditor_ui_format_select",a).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFormatSelect,"change","SET_FORMAT_FROM_SELECT_UI");this.elFormatSelect.selectedIndex= @@ -184,9 +184,9 @@ c(this.form).attr("editor_sequence"));this.oApp.exec("REGISTER_HOTKEY",["ctrl+sh (a="<"+a+">"),this.oApp.exec("EXECCOMMAND",["FormatBlock",false,a]),this.oApp.exec("CHECK_STYLE_CHANGE",[]))}});xe.XE_Table=c.Class({_startSel:null,_endSel:null,$ON_MSG_APP_READY:function(){this._doc=c(this.oApp.getWYSIWYGDocument());this.$FnMouseDown=c.fnBind(this._mousedown,this);this.$FnMouseUp=c.fnBind(this._mouseup,this);this.$FnMouseMove=c.fnBind(this._mousemove,this);this._doc.mousedown(this.$FnMouseDown);this._endSel=this._startSel=null;this.oApp.exec("REGISTER_UI_EVENT",["merge_cells","click", "MERGE_CELLS"]);this.oApp.exec("REGISTER_UI_EVENT",["split_col","click","CELL_SPLIT_BY_COL"]);this.oApp.exec("REGISTER_UI_EVENT",["split_row","click","CELL_SPLIT_BY_ROW"]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+alt+m","MERGE_CELLS"]);this.$super.$ON_MSG_APP_READY()},$ON_MERGE_CELLS:function(){var a="",b=c(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),d=this;if(b.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Merge"]);b.each(function(){a+=c(this).html()}).eq(0).html(a);var f= 0;b.eq(0).nextAll("td,th").andSelf().filter(".xe_selected_cell").each(function(){f+=d._getSpan(this,"col")});this._getRect(b.eq(0));var e=b.eq(0).parent("tr"),g=b.eq(b.length-1).parent("tr"),h=b.parents("table").eq(0).find("tr"),e=h.index(g.get(0))-h.index(e.get(0))+this._getSpan(b.eq(b.length-1),"row");b.eq(0).attr("colSpan",f).attr("rowSpan",e);b.slice(1).remove()}},$ON_CELL_SPLIT_BY_ROW:function(){var a=c(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),b=a.parents("table").eq(0), -d=this;if(a.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Row"]);var f=this._getRect(a.eq(0)).top,e=this._getRect(a.eq(a.length-1)).bottom;(a=b.find("td,th").filter(function(){var a=d._getRect(c(this));return!(a.bottom<=f||a.top>=e)})).filter(".xe_selected_cell").each(function(){var b=c(this),e=b.parent("tr"),f=d._getSpan(b,"row"),j=d._getRect(b),k=[],o=b.clone().html("
"),m=1,n=1;f>1?(m=Math.ceil(f/2),n=f-m,k.push(function(){b.attr("rowSpan",m)}),o.attr("rowSpan",n)):(a.filter(function(){if(b.get(0)== -this)return false;var a=c(this),a=d._getRect(a);return a.bottom<=j.top||a.top>=j.bottom?false:true}).each(function(){var a=c(this),b=d._getSpan(a,"row")+1;k.push(function(){a.attr("rowSpan",b)})}),c.browser.msie?e.after(e.clone().empty().get(0).outerHTML):e.after(e.clone().empty()));f=e.nextAll("tr");f.length?(e=f.eq(m-1).children("td,th").filter(function(){return d._getRect(c(this)).left>j.left}),c.browser.msie?e.length?e.eq(0).before(o.get(0).outerHTML):f.eq(m-1).append(o.get(0).outerHTML):e.length? -e.slice(0,1).before(o):f.slice(m-1,1).append(o)):e.after(e.clone().empty().append(o));c.each(k,function(){this()})})}},$ON_CELL_SPLIT_BY_COL:function(){var a=c(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),b=a.parents("table").slice(0,1),d=this;(new Date).getTime();if(a.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Column"]);var f=a.eq(0).parent("tr"),e=this._getRect(f.find(".xe_selected_cell:first")).left,g=this._getRect(f.find(".xe_selected_cell:last")).right; +d=this;if(a.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Row"]);var f=this._getRect(a.eq(0)).top,e=this._getRect(a.eq(a.length-1)).bottom;(a=b.find("td,th").filter(function(){var a=d._getRect(c(this));return!(a.bottom<=f||a.top>=e)})).filter(".xe_selected_cell").each(function(){var b=c(this),e=b.parent("tr"),f=d._getSpan(b,"row"),j=d._getRect(b),k=[],n=b.clone().html("
"),m=1,o=1;f>1?(m=Math.ceil(f/2),o=f-m,k.push(function(){b.attr("rowSpan",m)}),n.attr("rowSpan",o)):(a.filter(function(){if(b.get(0)== +this)return false;var a=c(this),a=d._getRect(a);return a.bottom<=j.top||a.top>=j.bottom?false:true}).each(function(){var a=c(this),b=d._getSpan(a,"row")+1;k.push(function(){a.attr("rowSpan",b)})}),c.browser.msie?e.after(e.clone().empty().get(0).outerHTML):e.after(e.clone().empty()));f=e.nextAll("tr");f.length?(e=f.eq(m-1).children("td,th").filter(function(){return d._getRect(c(this)).left>j.left}),c.browser.msie?e.length?e.eq(0).before(n.get(0).outerHTML):f.eq(m-1).append(n.get(0).outerHTML):e.length? +e.slice(0,1).before(n):f.slice(m-1,1).append(n)):e.after(e.clone().empty().append(n));c.each(k,function(){this()})})}},$ON_CELL_SPLIT_BY_COL:function(){var a=c(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),b=a.parents("table").slice(0,1),d=this;(new Date).getTime();if(a.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Column"]);var f=a.eq(0).parent("tr"),e=this._getRect(f.find(".xe_selected_cell:first")).left,g=this._getRect(f.find(".xe_selected_cell:last")).right; (a=b.find("td,th").filter(function(){var a=d._getRect(c(this));return!(a.right<=e||a.left>=g)})).filter(".xe_selected_cell").each(function(){var b=c(this),e=d._getSpan(b,"col"),f=b.clone().html("
");if(e>1){var g=Math.ceil(e/2);e-=g;b.attr("colSpan",g);f.attr("colSpan",e)}else{var k=d._getRect(b);a.filter(function(){if(b.get(0)==this)return false;var a=c(this),a=d._getRect(a);return a.right<=k.left||a.left>=k.right?false:true}).each(function(){var a=c(this);a.attr("colSpan",d._getSpan(a,"col")+ 1)});f.attr("colSpan",1)}c.browser.msie?b.after(f.get(0).outerHTML):b.after(f)})}},$ON_CHECK_STYLE_CHANGE:function(){var a=this.oApp,b=this._startSel&&this._startSel.is(".xe_selected_cell")?"ENABLE_UI":"DISABLE_UI";c.each(["merge_cells","split_col","split_row"],function(){a.exec(b,[this])})},_mousedown:function(a){var b=c(a.target).parents().andSelf().filter("td,th,table"),d=this.oApp,f=this;c("td.xe_selected_cell",this.oApp.getWYSIWYGDocument()).removeClass("xe_selected_cell");this._endSel=this._startSel= null;b.length&&this._isLeftClicked(a.button)&&setTimeout(function(){b=d.getSelection().cloneRange();b.collapseToStart();b=c(b.startContainer).parents().andSelf().filter("td,th").eq(0);if(!b.length)return f._removeAllListener()||true;f._getRect(f._startSel=b);f._doc.bind("mousemove",f.$FnMouseMove);f._doc.bind("mouseup",f.$FnMouseUp)},0)},_mouseup:function(){this._removeAllListener();this._startSel=this._endSel=null},_mousemove:function(a){var b=c(a.target).parents().andSelf().filter("td,th").eq(0), @@ -194,20 +194,18 @@ d=this;if(b.length&&this._isLeftClicked(a.button)&&(this._endSel||b.get(0)!=this d._getRect(c(this));if(a.right>h)h=a.right;if(a.leftg)g=a.bottom}),a=a.filter(":not(.xe_selected_cell)"),b=a.filter(function(){var a=d._getRect(c(this));return a.right<=e||a.left>=h||a.bottom<=f||a.top>=g?false:true}).addClass("xe_selected_cell");while(b.length);c.browser.mozilla||setTimeout(function(){var a=d.oApp.getSelection();d._startSel&&(d._startSel.get(0).firstChild||d._startSel.text(" "),a.selectNode(d._startSel.get(0).firstChild),a.collapseToStart(), a.select())},0);return false}},_removeAllListener:function(){this._doc.unbind("mousemove",this.$FnMouseMove);this._doc.unbind("mouseup",this.$FnMouseUp)},_isLeftClicked:function(a){return c.browser.msie?!!(a&1):a==0},_getRect:function(a){var b=a.get(0);a.rect={};a.rect.top=b.offsetTop;a.rect.left=b.offsetLeft;a.rect.bottom=a.rect.top+b.offsetHeight;a.rect.right=a.rect.left+b.offsetWidth;return a.rect},_getSpan:function(a,b){var d=parseInt(c(a).attr(b+"span"));return isNaN(d)?1:d}}).extend(xe.XE_Table)})(jQuery); window.xe||(xe={});xe.Editors=[]; -function editorStart_xe(c,k,m,n,a,b,d,f){function e(){try{var a=p.contentWindow.document;if(a.location=="about:blank")throw"blank";j.registerPlugin(new xe.XE_EditingArea_WYSIWYG(p));j.registerPlugin(new xe.XpressRangeManager(p));j.registerPlugin(new xe.XE_ExecCommand(p));if(d&&!a.body.style.fontFamily)a.body.style.fontFamily=d;if(f&&!a.body.style.fontSize)a.body.style.fontSize=f;j.run()}catch(b){setTimeout(e,0)}}typeof a=="undefined"&&(a="white");typeof b=="undefined"&&(b="xeStyle");typeof d=="undefined"&& -(d="");typeof f=="undefined"&&(f="");var g=request_uri+"modules/editor/styles/"+b+"/editor.html",b=jQuery("#xpress-editor-"+c),g=jQuery('