mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-27 07:09:56 +09:00
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
This commit is contained in:
parent
408ca98a4e
commit
db0deabda0
4 changed files with 28 additions and 90 deletions
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ g=true;if(a.match(/^\$(BEFORE|ON|AFTER)_MSG_APP_READY$/))for(var h=0;h<f;h++){if
|
|||
b,d){this.oDebugger.log_CallHandlerStart(a,b,d);var f=a[b].apply(a,d);this.oDebugger.log_CallHandlerEnd(a,b,d);return f},_execHandlerWithoutDebugger:function(a,b,d){return a[b].apply(a,d)},_doAddToCommandMap:function(a,b){typeof b[a]=="function"&&(this.oCommandMap[a][this.oCommandMap[a].length]=b)},_waitForPluginReady:function(){for(var a=true,b=0;b<this.aPlugins.length;b++)if(this.aPlugins[b].status==xe.PLUGIN_STATUS.NOT_READY){a=false;break}a?this._changeAppStatus(xe.APP_STATUS.READY):setTimeout(c.fnBind(this._waitForPluginReady,
|
||||
this),100)}});xe.APP_STATUS={NOT_READY:0,WAITING_FOR_PLUGINS_READY:1,READY:2};xe.PLUGIN_STATUS={NOT_READY:0,READY:1};xe.W3CDOMRange=c.Class({$init:function(a){this._document=a||document;this.collapsed=true;this.endContainer=this.commonAncestorContainer=this._document.body;this.endOffset=0;this.startContainer=this._document.body;this.startOffset=0},cloneContents:function(){var a=this._document.createDocumentFragment(),b=this._document.createDocumentFragment(),d=this._getNodesInRange();if(d.length<
|
||||
1)return a;d=this._constructClonedTree(d,b);if(b=b.firstChild)for(var b=b.firstChild,f;b;)f=b.nextSibling,a.appendChild(b),b=f;d=this._splitTextEndNodes({oStartContainer:d.oStartContainer,iStartOffset:this.startOffset,oEndContainer:d.oEndContainer,iEndOffset:this.endOffset});d.oStartContainer&&d.oStartContainer.previousSibling&&xe.DOMFix.parentNode(d.oStartContainer).removeChild(d.oStartContainer.previousSibling);d.oEndContainer&&d.oEndContainer.nextSibling&&xe.DOMFix.parentNode(d.oEndContainer).removeChild(d.oEndContainer.nextSibling);
|
||||
return a},_constructClonedTree:function(a,b){var d=null,f=null,c=this.startContainer,g=this.endContainer;_recurConstructClonedTree=function(a,b,j,k){if(b<0)return b;var j=b-1,o=a[b].cloneNode(false);a[b]==c&&(d=o);for(a[b]==g&&(f=o);j>=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<d.length&&c;e++){d[e].match(/([^\[]+)\[(\d+)/i);for(var g=RegExp.$1,h=RegExp.$2,c=xe.DOMFix.childNodes(c),l=[],j=c.length,k=0,o=0;o<j;o++)c[o].tagName==g&&(l[k++]=c[o]);c=l.length<h?null:l[h]}return c},_evaluateXPathBookmark:function(a){var 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<d.length&&c;e++){d[e].match(/([^\[]+)\[(\d+)/i);for(var g=RegExp.$1,h=RegExp.$2,c=xe.DOMFix.childNodes(c),l=[],j=c.length,p=0,n=0;n<j;n++)c[n].tagName==g&&(l[p++]=c[n]);c=l.length<h?null:l[h]}return c},_evaluateXPathBookmark:function(a){var b=
|
||||
a.nTextNodeIdx,d=a.nOffset,a=this._evaluateXPath(a.sXPath,this._document);if(b>-1&&a){for(var c=xe.DOMFix.childNodes(a),e=null;(e=c[b])&&e.nodeType==3&&e.nodeValue.length<d;)d-=e.nodeValue.length,b++;a=xe.DOMFix.childNodes(a)[b]}if(!a)a=this._document.body,d=0;return{elContainer:a,nOffset:d}},getXPathBookmark:function(){var a=-1,b={elContainer:this.startContainer,nOffset:this.startOffset},d=this.startContainer;d.nodeType==3&&(b=this._getFixedStartTextNode(),a=this._getPosIdx(b.elContainer),d=xe.DOMFix.parentNode(d));
|
||||
var a={sXPath:this._getXPath(d),nTextNodeIdx:a,nOffset:b.nOffset},b=-1,d={elContainer:this.endContainer,nOffset:this.endOffset},c=this.endContainer;c.nodeType==3&&(d=this._getFixedEndTextNode(),b=this._getPosIdx(d.elContainer),c=xe.DOMFix.parentNode(c));b={sXPath:this._getXPath(c),nTextNodeIdx:b,nOffset:d.nOffset};return[a,b]},moveToXPathBookmark:function(a){if(a){var b=this._evaluateXPathBookmark(a[0]),a=this._evaluateXPathBookmark(a[1]);if(b.elContainer&&a.elContainer)this.startContainer=b.elContainer,
|
||||
this.startOffset=b.nOffset,this.endContainer=a.elContainer,this.endOffset=a.nOffset}},_getFixedTextContainer:function(a,b){for(;a&&a.nodeType==3&&a.previousSibling&&a.previousSibling.nodeType==3;)b+=a.previousSibling.nodeValue.length,a=a.previousSibling;return{elContainer:a,nOffset:b}},_getFixedStartTextNode:function(){return this._getFixedTextContainer(this.startContainer,this.startOffset)},_getFixedEndTextNode:function(){return this._getFixedTextContainer(this.endContainer,this.endOffset)},placeStringBookmark:function(){var a=
|
||||
|
|
@ -41,8 +41,8 @@ collapseToEnd:function(){this.collapse(false)},createAndInsertNode:function(){tm
|
|||
this._document.createElement(a);this.surroundContents(a);return a},isRangeinRange:function(a){var b=this.compareBoundaryPoints(this.START_TO_START,a),d=this.compareBoundaryPoints(this.START_TO_END,a),c=this.compareBoundaryPoints(this.END_TO_START,a),a=this.compareBoundaryPoints(this.END_TO_END,a);return b<=0&&a>=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<m;q++)if((h=f[q])&&!(h.nodeType!=
|
||||
3||h.nodeValue=="")){o=xe.DOMFix.parentNode(h);if(o.tagName=="SPAN"&&(l=this._getVeryFirstRealChild(o),j=l==h?1:n.indexOf(l),j!=-1&&(l=this._getVeryLastRealChild(o),k=l==h?1:n.indexOf(l)),j!=-1&&k!=-1)){e[g++]=o;continue}l=this._document.createElement("SPAN");o.insertBefore(l,h);l.appendChild(h);e[g++]=l;a&&l.setAttribute(a,"true")}this.setStartBefore(b);this.setEndAfter(d);return e},_getVeryFirstChild:function(a){return a.firstChild?this._getVeryFirstChild(a.firstChild):a},_getVeryLastChild:function(a){return a.lastChild?
|
||||
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,p,n,k=f.length,m=c(f).filter(function(){return!!this.childNodes.length}),o=0;o<k;o++)if((h=f[o])&&!(h.nodeType!=
|
||||
3||h.nodeValue=="")){n=xe.DOMFix.parentNode(h);if(n.tagName=="SPAN"&&(l=this._getVeryFirstRealChild(n),j=l==h?1:m.indexOf(l),j!=-1&&(l=this._getVeryLastRealChild(n),p=l==h?1:m.indexOf(l)),j!=-1&&p!=-1)){e[g++]=n;continue}l=this._document.createElement("SPAN");n.insertBefore(l,h);l.appendChild(h);e[g++]=l;a&&l.setAttribute(a,"true")}this.setStartBefore(b);this.setEndAfter(d);return e},_getVeryFirstChild:function(a){return a.firstChild?this._getVeryFirstChild(a.firstChild):a},_getVeryLastChild:function(a){return a.lastChild?
|
||||
this._getVeryLastChild(a.lastChild):a},_getFirstRealChild:function(a){for(a=a.firstChild;a&&a.nodeType==3&&a.nodeValue=="";)a=a.nextSibling;return a},_getLastRealChild:function(a){for(a=a.lastChild;a&&a.nodeType==3&&a.nodeValue=="";)a=a.previousSibling;return a},_getVeryFirstRealChild:function(a){var b=this._getFirstRealChild(a);return b?this._getVeryFirstRealChild(b):a},_getVeryLastRealChild:function(a){var b=this._getLastRealChild(a);return b?this._getVeryLastChild(b):a},_getLineStartInfo:function(a){function b(a){a&&
|
||||
!c&&(l.test(a.tagName)?(g=a,c=e,h=true):(e=a,d(a.previousSibling),c||b(xe.DOMFix.parentNode(a))))}function d(a){if(a&&!c)if(l.test(a.tagName))g=a,c=e,h=false;else{if(a.firstChild&&a.tagName!="TABLE")for(var b=a.lastChild;b&&!c;)d(b),b=b.previousSibling;else e=a;c||d(a.previousSibling)}}var c=null,e=a,g=a,h=true,l=this.rxLineBreaker;b(a);return{oNode:c,oLineBreaker:g,bParentBreak:h}},_getLineEndInfo:function(a){function b(a){a&&!c&&(l.test(a.tagName)?(g=a,c=e,h=true):(e=a,d(a.nextSibling),c||b(xe.DOMFix.parentNode(a))))}
|
||||
function d(a){if(a&&!c)if(l.test(a.tagName))g=a,c=e,h=false;else{if(a.firstChild&&a.tagName!="TABLE")for(var b=a.firstChild;b&&!c;)d(b),b=b.nextSibling;else e=a;c||d(a.nextSibling)}}var c=null,e=a,g=a,h=true,l=this.rxLineBreaker;b(a);return{oNode:c,oLineBreaker:g,bParentBreak:h}},getLineInfo:function(){var a=this.getStartNode(),b=this.getEndNode();a||(a=this.getNodeAroundRange(true,true));b||(b=this.getNodeAroundRange(true,true));var a=this._getLineStartInfo(a),d=a.oNode,b=this._getLineEndInfo(b),
|
||||
|
|
@ -122,15 +122,15 @@ this.oApp.getSelection();this.oSelection.collapsed&&this.oSelection.selectNode(t
|
|||
_isChildOf:function(a,b){for(;a&&a.tagName!="BODY";){if(a==b)return true;a=xe.DOMFix.parentNode(a)}return false},_getLineWrapper:function(a){var b=this.oApp.getEmptySelection();b.selectNode(a);var a=b.getLineInfo(),d=a.oStart,c=a.oEnd,e,b=null,a=d.oNode;e=d.oLineBreaker;d=c.oNode;c=c.oLineBreaker;this.oSelection.setEndNodes(a,d);e==c&&(e.tagName=="P"||e.tagName=="DIV"?b=e:this.oSelection.setEndNodes(e.firstChild,e.lastChild));return b}});xe.XE_LineHeightWithSelectUI=c.Class({name:"XE_LineHeightWithSelectUI",
|
||||
_assignHTMLObjects:function(a){this.elLineHeightSelect=c("SELECT.xpress_xeditor_ui_lineHeight_select",a).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elLineHeightSelect,"change","SET_LINEHEIGHT_FROM_SELECT_UI");this.elLineHeightSelect.selectedIndex=0},$ON_MSG_STYLE_CHANGED:function(a,b){if(a=="lineHeight"&&(this.elLineHeightSelect.value=b,this.elLineHeightSelect.selectedIndex<0))this.elLineHeightSelect.selectedIndex=0},$ON_SET_LINEHEIGHT_FROM_SELECT_UI:function(){var a=
|
||||
this.elLineHeightSelect.value;if(a)this.elLineHeightSelect.selectedIndex=0,this.oApp.exec("SET_LINEHEIGHT",[a]),this.oApp.exec("CHECK_STYLE_CHANGE",[])}}).extend(xe.XE_LineHeight);xe.XE_ColorPalette=c.Class({name:"XE_ColorPalette",rxRGBColorPattern:/rgb\((\d+), ?(\d+), ?(\d+)\)/i,$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){this.elColorPaletteLayer=c("UL.xpress_xeditor_color_palette",a).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elColorPaletteLayer,
|
||||
"click","EVENT_MOUSEUP_COLOR_PALETTE")},$ON_SHOW_COLOR_PALETTE:function(a,b){this.sCallbackCmd=a;this.oLayerContainer=b;this.oLayerContainer.insertBefore(this.elColorPaletteLayer,null);this.elColorPaletteLayer.style.display="block"},$ON_HIDE_COLOR_PALETTE:function(){this.elColorPaletteLayer.style.display="none"},$ON_COLOR_PALETTE_APPLY_COLOR:function(a){if(this.rxRGBColorPattern.test(a))var b=function(a){a=parseInt(a).toString(16);a.length<2&&(a="0"+a);return a.toUpperCase()},a=b(RegExp.$1),c=b(RegExp.$2),
|
||||
b=b(RegExp.$3),a="#"+a+c+b;this.oApp.exec(this.sCallbackCmd,[a])},$ON_EVENT_MOUSEUP_COLOR_PALETTE:function(a){a=a.target;a.style.backgroundColor&&this.oApp.exec("COLOR_PALETTE_APPLY_COLOR",[a.style.backgroundColor])}});xe.XE_FontColor=c.Class({name:"XE_FontColor",rxColorPattern:/^#?[0-9a-fA-F]{6}$|^rgb\(\d+, ?\d+, ?\d+\)$/i,$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){this.elDropdownLayer=c("DIV.xpress_xeditor_fontcolor_layer",a).get(0)},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",
|
||||
"click","EVENT_MOUSEUP_COLOR_PALETTE")},$ON_SHOW_COLOR_PALETTE:function(a,b){this.sCallbackCmd=a;this.oLayerContainer=b;this.oLayerContainer.insertBefore(this.elColorPaletteLayer,null);this.elColorPaletteLayer.style.display="block"},$ON_HIDE_COLOR_PALETTE:function(){this.elColorPaletteLayer.style.display="none"},$ON_COLOR_PALETTE_APPLY_COLOR:function(a){if(this.rxRGBColorPattern.test(a))var b=function(a){a=parseInt(a).toString(16);a.length<2&&(a="0"+a);return a.toUpperCase()},a=b(RegExp.$1),d=b(RegExp.$2),
|
||||
b=b(RegExp.$3),a="#"+a+d+b;this.oApp.exec(this.sCallbackCmd,[a])},$ON_EVENT_MOUSEUP_COLOR_PALETTE:function(a){a=a.target;a.style.backgroundColor&&this.oApp.exec("COLOR_PALETTE_APPLY_COLOR",[a.style.backgroundColor])}});xe.XE_FontColor=c.Class({name:"XE_FontColor",rxColorPattern:/^#?[0-9a-fA-F]{6}$|^rgb\(\d+, ?\d+, ?\d+\)$/i,$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){this.elDropdownLayer=c("DIV.xpress_xeditor_fontcolor_layer",a).get(0)},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",
|
||||
["fontColor","click","TOGGLE_FONTCOLOR_LAYER"])},$ON_TOGGLE_FONTCOLOR_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer,null,"SHOW_COLOR_PALETTE",["APPLY_FONTCOLOR",this.elDropdownLayer]])},$ON_APPLY_FONTCOLOR:function(a){this.rxColorPattern.test(a)?(this.oApp.exec("SET_WYSIWYG_STYLE",[{color:a}]),this.oApp.exec("HIDE_ACTIVE_LAYER")):alert(this.oApp.$MSG("XE_FontColor.invalidColorCode"))}});xe.XE_BGColor=c.Class({name:"XE_BGColor",rxColorPattern:/^#?[0-9a-fA-F]{6}$|^rgb\(\d+, ?\d+, ?\d+\)$/i,
|
||||
$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){this.elDropdownLayer=c("DIV.xpress_xeditor_bgcolor_layer",a).get(0)},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["bgColor","click","TOGGLE_BGCOLOR_LAYER"]);this.oApp.registerBrowserEvent(this.elDropdownLayer,"click","EVENT_APPLY_BGCOLOR",[])},$ON_TOGGLE_BGCOLOR_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer,null,"SHOW_COLOR_PALETTE",["APPLY_BGCOLOR",this.elDropdownLayer]])},
|
||||
$ON_EVENT_APPLY_BGCOLOR:function(a){a=a.target;if(a.tagName=="SPAN")a=a.parentNode;a.tagName=="BUTTON"&&this.oApp.exec("APPLY_BGCOLOR",[a.style.backgroundColor,a.style.color])},$ON_APPLY_BGCOLOR:function(a,b){if(this.rxColorPattern.test(a)){var c={backgroundColor:a};if(b)c.color=b;this.oApp.exec("SET_WYSIWYG_STYLE",[c]);this.oApp.exec("HIDE_ACTIVE_LAYER")}else alert(this.oApp.$MSG("XE_BGColor.invalidColorCode"))}});xe.XE_Quote=c.Class({name:"XE_Quote",$init:function(a){this._assignHTMLObjects(a)},
|
||||
$ON_EVENT_APPLY_BGCOLOR:function(a){a=a.target;if(a.tagName=="SPAN")a=a.parentNode;a.tagName=="BUTTON"&&this.oApp.exec("APPLY_BGCOLOR",[a.style.backgroundColor,a.style.color])},$ON_APPLY_BGCOLOR:function(a,b){if(this.rxColorPattern.test(a)){var d={backgroundColor:a};if(b)d.color=b;this.oApp.exec("SET_WYSIWYG_STYLE",[d]);this.oApp.exec("HIDE_ACTIVE_LAYER")}else alert(this.oApp.$MSG("XE_BGColor.invalidColorCode"))}});xe.XE_Quote=c.Class({name:"XE_Quote",$init:function(a){this._assignHTMLObjects(a)},
|
||||
_assignHTMLObjects:function(a){this.elDropdownLayer=c("DIV.xpress_xeditor_blockquote_layer",a).get(0)},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["quote","click","TOGGLE_BLOCKQUOTE_LAYER"]);this.oApp.registerBrowserEvent(this.elDropdownLayer,"click","EVENT_APPLY_SEDITOR_BLOCKQUOTE",[])},$ON_TOGGLE_BLOCKQUOTE_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer])},$ON_EVENT_APPLY_SEDITOR_BLOCKQUOTE:function(a){a=a.target;if(a.tagName=="BUTTON")a=
|
||||
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 c=this.oApp.getSelection(),f=c.getLineInfo(),e=f.oStart,f=f.oEnd,g=/BODY|TD|LI/i,e=e.bParentBreak&&!g.test(e.oLineBreaker.tagName)?
|
||||
e.oNode.parentNode:e.oNode,f=f.bParentBreak&&!g.test(f.oLineBreaker.tagName)?f.oNode.parentNode:f.oNode;c.setStartBefore(e);c.setEndAfter(f);if(g=this._expandToTableStart(c,f))f=g,c.setEndAfter(g);if(g=this._expandToTableStart(c,e))e=g,c.setStartBefore(g);g=e;for(e=c.commonAncestorContainer;g&&g!=e&&g.parentNode!=e;)g=g.parentNode;oFormattingNode=c._document.createElement(a);if(b)oFormattingNode.className=b;g==e?e.insertBefore(oFormattingNode,e.firstChild):e.insertBefore(oFormattingNode,g);c.setStartAfter(oFormattingNode);
|
||||
c.setEndAfter(f);c.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=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("<br/>"),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("<br/>"),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<e;d++)b+=f;b+="</tr>\n";f=this.oRowInput.value;a+="<tbody>";for(d=0;d<f;d+
|
|||
"click","EVENT_TOGGLE_EDITING_MODE",[])},$ON_EVENT_TOGGLE_EDITING_MODE:function(){this.oApp.getEditingMode()=="WYSIWYG"?this.oApp.exec("CHANGE_EDITING_MODE",["HTMLSrc"]):this.oApp.exec("CHANGE_EDITING_MODE",["WYSIWYG"])},$ON_CHANGE_EDITING_MODE:function(a){a=="HTMLSrc"?(this.welModeToggleButton.addClass("active").parent("span").addClass("active"),this.oApp.exec("DISABLE_ALL_UI",[])):(this.welModeToggleButton.removeClass("active").parent("span").removeClass("active"),this.oApp.exec("ENABLE_ALL_UI",
|
||||
[]))}});xe.XpressCore.oMessageMap={"XE_EditingAreaManager.onExit":"%uB0B4%uC6A9%uC774%20%uBCC0%uACBD%uB418%uC5C8%uC2B5%uB2C8%uB2E4.","XE_FontColor.invalidColorCode":"%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff","XE_BGColor.invalidColorCode":"%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff",
|
||||
"XE_Hyperlink.invalidURL":"%uC785%uB825%uD558%uC2E0%20URL%uC774%20%uC62C%uBC14%uB974%uC9C0%20%uC54A%uC2B5%uB2C8%uB2E4."};regex_handler=/<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/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("</"+a.tag+">");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("</"+a.tag+">");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("<br />"),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("<br />"),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("<br />");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.left<e)e=a.left;if(a.top<f)f=a.top;if(a.bottom>g)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('<iframe id="editor_iframe_'+c+'" allowTransparency="true" frameborder="0" src="'+g+'" scrolling="yes" style="width:100%;height:'+n+'px">'),h=jQuery('<textarea rows="10" cols="20" class="input_syntax '+a+'" style="display:none"></textarea>'),a=b.get(0).form;a.setAttribute("editor_sequence",c);b.css("display","none");var l="";jQuery("input[name=content]",a).size()>
|
||||
function editorStart_xe(c,k,m,o,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('<iframe id="editor_iframe_'+c+'" allowTransparency="true" frameborder="0" src="'+g+'" scrolling="yes" style="width:100%;height:'+o+'px">'),h=jQuery('<textarea rows="10" cols="20" class="input_syntax '+a+'" style="display:none"></textarea>'),a=b.get(0).form;a.setAttribute("editor_sequence",c);b.css("display","none");var l="";jQuery("input[name=content]",a).size()>
|
||||
0&&(l=jQuery("input[name=content]",a).val().replace(/src=\"files\/attach/g,'src="'+request_uri+"files/attach"),jQuery("#xpress-editor-"+c).val(l));b.hide().css("width","99%").before(g).after(h);var j=new xe.XpressCore,p=g.get(0),b=b.get(0),g=h.get(0),h=jQuery(".xpress-editor",a).get(0);j.getFrame=function(){return p};j.getContent=function(){editorGetContentTextarea_xe(c)};l=a[m].value;xFF&&!l&&(l="<br />");l=editorReplacePath(l);a[m].value=l;jQuery("#xpress-editor-"+c).val(l);editorRelKeys[c]=[];
|
||||
editorRelKeys[c].primary=a[k];editorRelKeys[c].content=a[m];editorRelKeys[c].func=editorGetContentTextarea_xe;editorRelKeys[c].editor=j;editorRelKeys[c].pasteHTML=function(a){j.exec("PASTE_HTML",[a])};xe.Editors[c]=j;j.registerPlugin(new xe.CorePlugin(null));j.registerPlugin(new xe.XE_PreservTemplate(jQuery("#xpress-editor-"+c).val()));j.registerPlugin(new xe.StringConverterManager);j.registerPlugin(new xe.XE_EditingAreaManager("WYSIWYG",b,{nHeight:parseInt(n),nMinHeight:205},null,h));j.registerPlugin(new xe.XE_EditingArea_HTMLSrc(g));
|
||||
j.registerPlugin(new xe.XE_EditingAreaVerticalResizer(h));j.registerPlugin(new xe.Utils);j.registerPlugin(new xe.DialogLayerManager);j.registerPlugin(new xe.ActiveLayerManager);j.registerPlugin(new xe.Hotkey);j.registerPlugin(new xe.XE_WYSIWYGStyler);j.registerPlugin(new xe.XE_WYSIWYGStyleGetter);j.registerPlugin(new xe.MessageManager(xe.XpressCore.oMessageMap));j.registerPlugin(new xe.XE_Toolbar(h));j.registerPlugin(new xe.XE_XHTMLFormatter);j.registerPlugin(new xe.XE_GET_WYSYWYG_MODE(c));j.registerPlugin(new xe.XE_GET_WYSYWYG_CONTENT);
|
||||
jQuery("ul.extra1").length&&(j.registerPlugin(new xe.XE_ColorPalette(h)),j.registerPlugin(new xe.XE_FontColor(h)),j.registerPlugin(new xe.XE_BGColor(h)),j.registerPlugin(new xe.XE_Quote(h)),j.registerPlugin(new xe.XE_FontNameWithSelectUI(h)),j.registerPlugin(new xe.XE_FontSizeWithSelectUI(h)),j.registerPlugin(new xe.XE_LineHeightWithSelectUI(h)),j.registerPlugin(new xe.XE_UndoRedo),j.registerPlugin(new xe.XE_Table(h)),j.registerPlugin(new xe.XE_Hyperlink(h)),j.registerPlugin(new xe.XE_FormatWithSelectUI(h)),
|
||||
j.registerPlugin(new xe.XE_SCharacter(h)));jQuery("ul.extra2").length&&j.registerPlugin(new xe.XE_Extension(h,c));jQuery("ul.extra3").length&&j.registerPlugin(new xe.XE_EditingModeToggler(h));!jQuery.browser.msie&&!jQuery.browser.opera&&j.registerPlugin(new xe.XE_WYSIWYGEnterKey(p));(s=a._saved_doc_title)&&j.registerPlugin(new xe.XE_AutoSave(b,h));e();return j}
|
||||
function editorGetContentTextarea_xe(c){c=xe.Editors[c]||null;if(!c)return"";c=c.getIR();if(!jQuery.trim(c.replace(/( |<\/?(p|br|span|div)([^>]+)?>)/ig,"")))return"";c=c.replace(/<br ?\/?>$/i,"");if(c.length<1024){var k="#text,A,BR,IMG,EM,STRONG,SPAN,BIG,CITE,CODE,DD,DFN,HR,INS,KBD,LINK,Q,SAMP,SMALL,SUB,SUP,TT".split(","),m=true,n=jQuery("<div>"+c+"</div>").eq(0).contents();jQuery.each(n,function(){this.nodeType!=3&&jQuery.inArray(this.nodeName,k)==-1&&(m=false)});m&&(c="<p>"+c+"</p>")}c=c.replace(/src\s?=\s?(["']?)(?:\.\.\/)+(files\/attach\/)/ig,
|
||||
editorRelKeys[c].primary=a[k];editorRelKeys[c].content=a[m];editorRelKeys[c].func=editorGetContentTextarea_xe;editorRelKeys[c].editor=j;editorRelKeys[c].pasteHTML=function(a){j.exec("PASTE_HTML",[a])};xe.Editors[c]=j;j.registerPlugin(new xe.CorePlugin(null));j.registerPlugin(new xe.XE_PreservTemplate(jQuery("#xpress-editor-"+c).val()));j.registerPlugin(new xe.StringConverterManager);j.registerPlugin(new xe.XE_EditingAreaManager("WYSIWYG",b,{nHeight:parseInt(o),nMinHeight:205},null,h));j.registerPlugin(new xe.XE_EditingArea_HTMLSrc(g));
|
||||
j.registerPlugin(new xe.XE_EditingAreaVerticalResizer(h));j.registerPlugin(new xe.Utils);j.registerPlugin(new xe.DialogLayerManager);j.registerPlugin(new xe.ActiveLayerManager);j.registerPlugin(new xe.Hotkey);j.registerPlugin(new xe.XE_WYSIWYGStyler);j.registerPlugin(new xe.XE_WYSIWYGStyleGetter);j.registerPlugin(new xe.MessageManager(xe.XpressCore.oMessageMap));j.registerPlugin(new xe.XE_Toolbar(h));j.registerPlugin(new xe.XE_XHTMLFormatter);j.registerPlugin(new xe.XE_GET_WYSYWYG_MODE(c));jQuery("ul.extra1").length&&
|
||||
(j.registerPlugin(new xe.XE_ColorPalette(h)),j.registerPlugin(new xe.XE_FontColor(h)),j.registerPlugin(new xe.XE_BGColor(h)),j.registerPlugin(new xe.XE_Quote(h)),j.registerPlugin(new xe.XE_FontNameWithSelectUI(h)),j.registerPlugin(new xe.XE_FontSizeWithSelectUI(h)),j.registerPlugin(new xe.XE_LineHeightWithSelectUI(h)),j.registerPlugin(new xe.XE_UndoRedo),j.registerPlugin(new xe.XE_Table(h)),j.registerPlugin(new xe.XE_Hyperlink(h)),j.registerPlugin(new xe.XE_FormatWithSelectUI(h)),j.registerPlugin(new xe.XE_SCharacter(h)));
|
||||
jQuery("ul.extra2").length&&j.registerPlugin(new xe.XE_Extension(h,c));jQuery("ul.extra3").length&&j.registerPlugin(new xe.XE_EditingModeToggler(h));!jQuery.browser.msie&&!jQuery.browser.opera&&j.registerPlugin(new xe.XE_WYSIWYGEnterKey(p));(s=a._saved_doc_title)&&j.registerPlugin(new xe.XE_AutoSave(b,h));e();return j}
|
||||
function editorGetContentTextarea_xe(c){c=xe.Editors[c]||null;if(!c)return"";c=c.getIR();if(!jQuery.trim(c.replace(/( |<\/?(p|br|span|div)([^>]+)?>)/ig,"")))return"";c=c.replace(/<br ?\/?>$/i,"");if(c.length<1024){var k="#text,A,BR,IMG,EM,STRONG,SPAN,BIG,CITE,CODE,DD,DFN,HR,INS,KBD,LINK,Q,SAMP,SMALL,SUB,SUP,TT".split(","),m=true,o=jQuery("<div>"+c+"</div>").eq(0).contents();jQuery.each(o,function(){this.nodeType!=3&&jQuery.inArray(this.nodeName,k)==-1&&(m=false)});m&&(c="<p>"+c+"</p>")}c=c.replace(/src\s?=\s?(["']?)(?:\.\.\/)+(files\/attach\/)/ig,
|
||||
function(a,b,c){return"src="+(b||"")+c});c=c.replace(/\<(\/)?([A-Z]+)([^>]*)\>/ig,function(a,b,c,f){f=f?f.replace(/ ([A-Z]+?)\=/ig,function(a,b){b=b.toLowerCase();return" "+b+"="}):"";c=c.toLowerCase();b||(b="");return"<"+b+c+f+">"});return c=c.replace("<br>","<br />")}function editorGetIframe(c){return jQuery("iframe#editor_iframe_"+c).get(0)}function editorReplaceHTML(c,k){var k=editorReplacePath(k),m=parseInt(c.id.replace(/^.*_/,""),10);editorRelKeys[m].pasteHTML(k)}
|
||||
function editorReplacePath(c){return c=c.replace(/\<([^\>\<]*)(src=|href=|url\()("|\')*([^"\'\)]+)("|\'|\))*(\s|>)*/ig,function(c,m,n,a,b,d,f){n=="url("?(a="",d=")"):(typeof a=="undefined"&&(a='"'),typeof d=="undefined"&&(d='"'),typeof f=="undefined"&&(f=""));b=jQuery.trim(b).replace(/^\.\//,"");return/^(http\:|https\:|ftp\:|telnet\:|mms\:|mailto\:|\/|\.\.|\#)/i.test(b)?c:"<"+m+n+a+request_uri+b+d+f})}
|
||||
function editorReplacePath(c){return c=c.replace(/\<([^\>\<]*)(src=|href=|url\()("|\')*([^"\'\)]+)("|\'|\))*(\s|>)*/ig,function(c,m,o,a,b,d,f){o=="url("?(a="",d=")"):(typeof a=="undefined"&&(a='"'),typeof d=="undefined"&&(d='"'),typeof f=="undefined"&&(f=""));b=jQuery.trim(b).replace(/^\.\//,"");return/^(http\:|https\:|ftp\:|telnet\:|mms\:|mailto\:|\/|\.\.|\#)/i.test(b)?c:"<"+m+o+a+request_uri+b+d+f})}
|
||||
function editorGetAutoSavedDoc(c){var k=[];k.mid=current_mid;k.editor_sequence=c.getAttribute("editor_sequence");setTimeout(function(){exec_xml("editor","procEditorLoadSavedDocument",k,function(c){editorRelKeys[k.editor_sequence].primary.value=c.document_srl;typeof uploadSettingObj[k.editor_sequence]=="object"&&editorUploadInit(uploadSettingObj[k.editor_sequence],true)},"error,message,editor_sequence,title,content,document_srl".split(","))},0)}
|
||||
xe.XE_GET_WYSYWYG_MODE=jQuery.Class({name:"XE_GET_WYSYWYG_MODE",$init:function(c){this.editor_sequence=c},$ON_CHANGE_EDITING_MODE:function(c){editorMode[this.editor_sequence]=c=="HTMLSrc"?"html":"wysiwyg"}});
|
||||
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(c){return c=editorReplacePath(c)},replaceHTTP2XE:function(c){contENT=c.replace(/(src=|href=|url\()("|\')*([^"\'\)]+)("|\'|\))*(\s|>|\))*/ig,function(c,m,n,a,b,d){var c=RegExp("^"+request_uri.replace("/","\\/"),"ig"),f;m=="url("?(n="",b=")"):(n=n||'"',b=b||'"');
|
||||
f=c.test(f=jQuery.trim(a))?f.replace(c,""):a;return m+n+f+b+(d||"")});return c}});xe.XE_PreservTemplate=jQuery.Class({name:"XE_PreservTemplate",isRun:false,$BEFORE_SET_IR:function(c){if(!this.isRun&&!c)return this.isRun=true,false}});
|
||||
xe.XE_GET_WYSYWYG_MODE=jQuery.Class({name:"XE_GET_WYSYWYG_MODE",$init:function(c){this.editor_sequence=c},$ON_CHANGE_EDITING_MODE:function(c){editorMode[this.editor_sequence]=c=="HTMLSrc"?"html":"wysiwyg"}});xe.XE_PreservTemplate=jQuery.Class({name:"XE_PreservTemplate",isRun:false,$BEFORE_SET_IR:function(c){if(!this.isRun&&!c)return this.isRun=true,false}});
|
||||
xe.XE_Preview=jQuery.Class({name:"XE_Preview",elPreviewButton:null,$init:function(c){this._assignHTMLObjects(c)},_assignHTMLObjects:function(c){this.elPreviewButton=jQuery("BUTTON.xpress_xeditor_preview_button",c)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elPreviewButton.get(0),"click","EVENT_PREVIEW",[])},$ON_EVENT_PREVIEW:function(){}});
|
||||
function editorStartTextarea(c,k,m){var n=xGetElementById("editor_"+c),a=xGetElementById("htm_"+c).value;n.form.setAttribute("editor_sequence",c);n.style.width="99%";editorRelKeys[c]=[];editorRelKeys[c].primary=n.form[m];editorRelKeys[c].content=n.form[k];editorRelKeys[c].func=editorGetContentTextarea;c=n.form[k].value;a&&(c=c.replace(/<br([^>]*)>/ig,"\n"),a!="br"&&(c=c.replace(/</g,"<"),c=c.replace(/>/g,">"),c=c.replace(/"/g,'"'),c=c.replace(/&/g,"&")));n.value=c}
|
||||
function editorStartTextarea(c,k,m){var o=xGetElementById("editor_"+c),a=xGetElementById("htm_"+c).value;o.form.setAttribute("editor_sequence",c);o.style.width="99%";editorRelKeys[c]=[];editorRelKeys[c].primary=o.form[m];editorRelKeys[c].content=o.form[k];editorRelKeys[c].func=editorGetContentTextarea;c=o.form[k].value;a&&(c=c.replace(/<br([^>]*)>/ig,"\n"),a!="br"&&(c=c.replace(/</g,"<"),c=c.replace(/>/g,">"),c=c.replace(/"/g,'"'),c=c.replace(/&/g,"&")));o.value=c}
|
||||
function editorGetContentTextarea(c){var k=xGetElementById("editor_"+c),c=xGetElementById("htm_"+c).value,k=k.value.trim();c&&(c!="br"&&(k=k.replace(/&/g,"&"),k=k.replace(/</g,"<"),k=k.replace(/>/g,">"),k=k.replace(/\"/g,""")),k=k.replace(/(\r\n|\n)/g,"<br />"));return k};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue