issue 1151 refixed.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10390 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
devjin 2012-03-08 06:31:49 +00:00
parent 6a6eb42203
commit 970d989575
3 changed files with 100 additions and 98 deletions

View file

@ -1370,16 +1370,17 @@ xe.XpressRange = $.Class({
oParentNode = xe.DOMFix.parentNode(oNode); oParentNode = xe.DOMFix.parentNode(oNode);
if(oParentNode.tagName == "SPAN"){ if(oParentNode.tagName == "SPAN"){
var parentText = $(oParentNode).html();
// check if the SPAN element is fully contained // check if the SPAN element is fully contained
// do quick checks before trying indexOf() because indexOf() function is very slow // do quick checks before trying indexOf() because indexOf() function is very slow
oTmpNode = this._getVeryFirstRealChild(oParentNode); oTmpNode = this._getVeryFirstRealChild(oParentNode);
if(oTmpNode == oNode) iSIdx = 1; if(oTmpNode == oNode) iSIdx = 1;
else iSIdx = (typeof(arAllBottmNodes) =="String") ? arAllBottmNodes.indexOf(oTmpNode) : arAllBottmNodes.html().indexOf(oTmpNode); else iSIdx = parentText.indexOf(oTmpNode);
if(iSIdx != -1){ if(iSIdx != -1){
oTmpNode = this._getVeryLastRealChild(oParentNode); oTmpNode = this._getVeryLastRealChild(oParentNode);
if(oTmpNode == oNode) iEIdx = 1; if(oTmpNode == oNode) iEIdx = 1;
else iEIdx = (typeof(arAllBottmNodes) =="String") ? arAllBottmNodes.indexOf(oTmpNode) : arAllBottmNodes.html().indexOf(oTmpNode); else iEIdx = parentText.indexOf(oTmpNode);
} }
if(iSIdx != -1 && iEIdx != -1){ if(iSIdx != -1 && iEIdx != -1){

View file

@ -1370,16 +1370,17 @@ xe.XpressRange = $.Class({
oParentNode = xe.DOMFix.parentNode(oNode); oParentNode = xe.DOMFix.parentNode(oNode);
if(oParentNode.tagName == "SPAN"){ if(oParentNode.tagName == "SPAN"){
var parentText = $(oParentNode).html();
// check if the SPAN element is fully contained // check if the SPAN element is fully contained
// do quick checks before trying indexOf() because indexOf() function is very slow // do quick checks before trying indexOf() because indexOf() function is very slow
oTmpNode = this._getVeryFirstRealChild(oParentNode); oTmpNode = this._getVeryFirstRealChild(oParentNode);
if(oTmpNode == oNode) iSIdx = 1; if(oTmpNode == oNode) iSIdx = 1;
else iSIdx = (typeof(arAllBottmNodes) =="String") ? arAllBottmNodes.indexOf(oTmpNode) : arAllBottmNodes.html().indexOf(oTmpNode); else iSIdx = parentText.indexOf(oTmpNode);
if(iSIdx != -1){ if(iSIdx != -1){
oTmpNode = this._getVeryLastRealChild(oParentNode); oTmpNode = this._getVeryLastRealChild(oParentNode);
if(oTmpNode == oNode) iEIdx = 1; if(oTmpNode == oNode) iEIdx = 1;
else iEIdx = (typeof(arAllBottmNodes) =="String") ? arAllBottmNodes.indexOf(oTmpNode) : arAllBottmNodes.html().indexOf(oTmpNode); else iEIdx = parentText.indexOf(oTmpNode);
} }
if(iSIdx != -1 && iEIdx != -1){ if(iSIdx != -1 && iEIdx != -1){

View file

@ -41,98 +41,98 @@ 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||c==-1?false:true:false},isNodeInRange:function(a,b,d){var c=new xe.XpressRange(this._window);if(d&&a.firstChild){c.setStartBefore(a.firstChild);c.setEndAfter(a.lastChild)}else c.selectNode(a); 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||c==-1?false:true:false},isNodeInRange:function(a,b,d){var c=new xe.XpressRange(this._window);if(d&&a.firstChild){c.setStartBefore(a.firstChild);c.setEndAfter(a.lastChild)}else 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(),f=c.placeStringBookmark();b.lastChild;)this.insertNode(b.lastChild);this.setEndNodes(a,d);c.moveToBookmark(f);c.deleteContents();c.removeStringBookmark(f)}},toString:function(){this.toString=xe.W3CDOMRange.prototype.toString;return this.toString()},toHTMLString:function(){var a=this._document.createElement("DIV"); 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(),f=c.placeStringBookmark();b.lastChild;)this.insertNode(b.lastChild);this.setEndNodes(a,d);c.moveToBookmark(f);c.deleteContents();c.removeStringBookmark(f)}},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 e,f,g=0;g< 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 e,f,g=0;g<
d.length;g++){for(var h in a){e=h;f=a[e];typeof f=="string"&&(d[g].style[e]=f)}if(b)for(h in b){e=h;f=b[e];typeof f=="string"&&(e=="class"?c(d[g]).addClass(f):d[g].setAttribute(e,f))}}this.setStartBefore(d[0]);this.setEndAfter(d[d.length-1])}},_getStyleParentNodes:function(a){this._splitTextEndNodesOfTheRange();for(var b=this.getStartNode(),d=this.getEndNode(),e=this._getNodesInRange(),f=[],g=0,h,k,j,n,m,q=e.length,l=c(e).filter(function(){return!!this.childNodes.length}),o=0;o<q;o++)if((h=e[o])&& d.length;g++){for(var h in a){e=h;f=a[e];typeof f=="string"&&(d[g].style[e]=f)}if(b)for(h in b){e=h;f=b[e];typeof f=="string"&&(e=="class"?c(d[g]).addClass(f):d[g].setAttribute(e,f))}}this.setStartBefore(d[0]);this.setEndAfter(d[d.length-1])}},_getStyleParentNodes:function(a){this._splitTextEndNodesOfTheRange();var b=this.getStartNode(),d=this.getEndNode(),e=this._getNodesInRange(),f=[],g=0,h,k,j,n,m,q=e.length;c(e).filter(function(){return!!this.childNodes.length});for(var l=0;l<q;l++)if((h=e[l])&&
!(h.nodeType!=3||h.nodeValue=="")){m=xe.DOMFix.parentNode(h);if(m.tagName=="SPAN"){k=this._getVeryFirstRealChild(m);j=k==h?1:typeof l=="String"?l.indexOf(k):l.html().indexOf(k);if(j!=-1){k=this._getVeryLastRealChild(m);n=k==h?1:typeof l=="String"?l.indexOf(k):l.html().indexOf(k)}if(j!=-1&&n!=-1){f[g++]=m;continue}}k=this._document.createElement("SPAN");m.insertBefore(k,h);k.appendChild(h);f[g++]=k;a&&k.setAttribute(a,"true")}this.setStartBefore(b);this.setEndAfter(d);return f},_getVeryFirstChild:function(a){return a.firstChild? !(h.nodeType!=3||h.nodeValue=="")){m=xe.DOMFix.parentNode(h);if(m.tagName=="SPAN"){var o=c(m).html();k=this._getVeryFirstRealChild(m);j=k==h?1:o.indexOf(k);if(j!=-1){k=this._getVeryLastRealChild(m);n=k==h?1:o.indexOf(k)}if(j!=-1&&n!=-1){f[g++]=m;continue}}k=this._document.createElement("SPAN");m.insertBefore(k,h);k.appendChild(h);f[g++]=k;a&&k.setAttribute(a,"true")}this.setStartBefore(b);this.setEndAfter(d);return f},_getVeryFirstChild:function(a){return a.firstChild?this._getVeryFirstChild(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= 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._getLastRealChild(a);return b?this._getVeryLastChild(b):a},_getLineStartInfo:function(a){function b(a){if(a&&!c)if(k.test(a.tagName)){g=a;c=f;h=true}else{f=a;d(a.previousSibling);c||b(xe.DOMFix.parentNode(a))}}function d(a){if(a&&!c)if(k.test(a.tagName)){g=a;c=f;h=false}else{if(a.firstChild&&a.tagName!="TABLE")for(var b=a.lastChild;b&&!c;){d(b);b=b.previousSibling}else f=a;c||d(a.previousSibling)}}var c=null,f=a,g=a,h=true,k=this.rxLineBreaker;b(a);return{oNode:c,oLineBreaker:g,bParentBreak:h}}, this._getVeryLastChild(b):a},_getLineStartInfo:function(a){function b(a){if(a&&!c)if(k.test(a.tagName)){g=a;c=f;h=true}else{f=a;d(a.previousSibling);c||b(xe.DOMFix.parentNode(a))}}function d(a){if(a&&!c)if(k.test(a.tagName)){g=a;c=f;h=false}else{if(a.firstChild&&a.tagName!="TABLE")for(var b=a.lastChild;b&&!c;){d(b);b=b.previousSibling}else f=a;c||d(a.previousSibling)}}var c=null,f=a,g=a,h=true,k=this.rxLineBreaker;b(a);return{oNode:c,oLineBreaker:g,bParentBreak:h}},_getLineEndInfo:function(a){function b(a){if(a&&
_getLineEndInfo:function(a){function b(a){if(a&&!c)if(k.test(a.tagName)){g=a;c=f;h=true}else{f=a;d(a.nextSibling);c||b(xe.DOMFix.parentNode(a))}}function d(a){if(a&&!c)if(k.test(a.tagName)){g=a;c=f;h=false}else{if(a.firstChild&&a.tagName!="TABLE")for(var b=a.firstChild;b&&!c;){d(b);b=b.nextSibling}else f=a;c||d(a.nextSibling)}}var c=null,f=a,g=a,h=true,k=this.rxLineBreaker;b(a);return{oNode:c,oLineBreaker:g,bParentBreak:h}},getLineInfo:function(){var a=this.getStartNode(),b=this.getEndNode();a||(a= !c)if(k.test(a.tagName)){g=a;c=f;h=true}else{f=a;d(a.nextSibling);c||b(xe.DOMFix.parentNode(a))}}function d(a){if(a&&!c)if(k.test(a.tagName)){g=a;c=f;h=false}else{if(a.firstChild&&a.tagName!="TABLE")for(var b=a.firstChild;b&&!c;){d(b);b=b.nextSibling}else f=a;c||d(a.nextSibling)}}var c=null,f=a,g=a,h=true,k=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,
this.getNodeAroundRange(true,true));b||(b=this.getNodeAroundRange(true,true));var a=this._getLineStartInfo(a),d=a.oNode,b=this._getLineEndInfo(b),c=b.oNode,d=this._compareEndPoint(xe.DOMFix.parentNode(d),this._getPosIdx(d),this.endContainer,this.endOffset),c=this._compareEndPoint(xe.DOMFix.parentNode(c),this._getPosIdx(c)+1,this.startContainer,this.startOffset);if(!(d<=0&&c>=0)){a=this.getNodeAroundRange(false,true);b=this.getNodeAroundRange(false,true);a=this._getLineStartInfo(a);b=this._getLineEndInfo(b)}return{oStart:a, true));var a=this._getLineStartInfo(a),d=a.oNode,b=this._getLineEndInfo(b),c=b.oNode,d=this._compareEndPoint(xe.DOMFix.parentNode(d),this._getPosIdx(d),this.endContainer,this.endOffset),c=this._compareEndPoint(xe.DOMFix.parentNode(c),this._getPosIdx(c)+1,this.startContainer,this.startOffset);if(!(d<=0&&c>=0)){a=this.getNodeAroundRange(false,true);b=this.getNodeAroundRange(false,true);a=this._getLineStartInfo(a);b=this._getLineEndInfo(b)}return{oStart:a,oEnd:b}}}).extend(xe.W3CDOMRange);xe.SimpleSelection=
oEnd:b}}}).extend(xe.W3CDOMRange);xe.SimpleSelection=function(a){this.init=function(a){this._window=a||window;this._document=this._window.document};this.init(a);c.browser.msie?xe.SimpleSelectionImpl_IE.apply(this):xe.SimpleSelectionImpl_FF.apply(this);this.selectRange=function(a){this.selectNone();this.addRange(a)};this.selectionLoaded=true;if(!this._oSelection)this.selectionLoaded=false};xe.SimpleSelectionImpl_FF=function(){this._oSelection=this._window.getSelection();this.getRangeAt=function(a){try{var b= function(a){this.init=function(a){this._window=a||window;this._document=this._window.document};this.init(a);c.browser.msie?xe.SimpleSelectionImpl_IE.apply(this):xe.SimpleSelectionImpl_FF.apply(this);this.selectRange=function(a){this.selectNone();this.addRange(a)};this.selectionLoaded=true;if(!this._oSelection)this.selectionLoaded=false};xe.SimpleSelectionImpl_FF=function(){this._oSelection=this._window.getSelection();this.getRangeAt=function(a){try{var b=this._oSelection.getRangeAt(a||0)}catch(d){return new xe.W3CDOMRange(this._document)}return this._FFRange2W3CRange(b)};
this._oSelection.getRangeAt(a||0)}catch(d){return new xe.W3CDOMRange(this._document)}return this._FFRange2W3CRange(b)};this.addRange=function(a){this._oSelection.addRange(this._W3CRange2FFRange(a))};this.selectNone=function(){this._oSelection.removeAllRanges()};this._FFRange2W3CRange=function(a){var b=new xe.W3CDOMRange(this._document);b.setStart(a.startContainer,a.startOffset);b.setEnd(a.endContainer,a.endOffset);return b};this._W3CRange2FFRange=function(a){var b=this._document.createRange();b.setStart(a.startContainer, this.addRange=function(a){this._oSelection.addRange(this._W3CRange2FFRange(a))};this.selectNone=function(){this._oSelection.removeAllRanges()};this._FFRange2W3CRange=function(a){var b=new xe.W3CDOMRange(this._document);b.setStart(a.startContainer,a.startOffset);b.setEnd(a.endContainer,a.endOffset);return b};this._W3CRange2FFRange=function(a){var b=this._document.createRange();b.setStart(a.startContainer,a.startOffset);b.setEnd(a.endContainer,a.endOffset);return b}};xe.SimpleSelectionImpl_IE=function(){this._oSelection=
a.startOffset);b.setEnd(a.endContainer,a.endOffset);return b}};xe.SimpleSelectionImpl_IE=function(){this._oSelection=this._document.selection;this.getRangeAt=function(a){a=a||0;if(this._oSelection.type=="Control"){var b=new xe.W3CDOMRange(this._document),d=this._oSelection.createRange().item(a);if(!d||d.ownerDocument!=this._document)return b;b.selectNode(d);return b}d=this._oSelection.createRangeCollection().item(a).parentElement();if(!d||d.ownerDocument!=this._document)return b=new xe.W3CDOMRange(this._document); this._document.selection;this.getRangeAt=function(a){a=a||0;if(this._oSelection.type=="Control"){var b=new xe.W3CDOMRange(this._document),d=this._oSelection.createRange().item(a);if(!d||d.ownerDocument!=this._document)return b;b.selectNode(d);return b}d=this._oSelection.createRangeCollection().item(a).parentElement();if(!d||d.ownerDocument!=this._document)return b=new xe.W3CDOMRange(this._document);return this._IERange2W3CRange(this._oSelection.createRangeCollection().item(a))};this.addRange=function(a){this._W3CRange2IERange(a).select()};
return this._IERange2W3CRange(this._oSelection.createRangeCollection().item(a))};this.addRange=function(a){this._W3CRange2IERange(a).select()};this.selectNone=function(){this._oSelection.empty()};this._W3CRange2IERange=function(a){var b=this._getIERangeAt(a.startContainer,a.startOffset),a=this._getIERangeAt(a.endContainer,a.endOffset);b.setEndPoint("EndToEnd",a);return b};this._getIERangeAt=function(a,b){var d=this._document.body.createTextRange(),c=this._getSelectableNodeAndOffsetForIE(a,b),f=c.iOffsetForIE; this.selectNone=function(){this._oSelection.empty()};this._W3CRange2IERange=function(a){var b=this._getIERangeAt(a.startContainer,a.startOffset),a=this._getIERangeAt(a.endContainer,a.endOffset);b.setEndPoint("EndToEnd",a);return b};this._getIERangeAt=function(a,b){var d=this._document.body.createTextRange(),c=this._getSelectableNodeAndOffsetForIE(a,b),f=c.iOffsetForIE;d.moveToElementText(c.oSelectableNodeForIE);d.collapse(c.bCollapseToStart);d.moveStart("character",f);return d};this._getSelectableNodeAndOffsetForIE=
d.moveToElementText(c.oSelectableNodeForIE);d.collapse(c.bCollapseToStart);d.moveStart("character",f);return d};this._getSelectableNodeAndOffsetForIE=function(a,b){var d=this._document.body.createTextRange(),c=null,f=null,g=0;if(a.nodeType==3){c=xe.DOMFix.parentNode(a);f=xe.DOMFix.childNodes(c);g=f.length}else{c=a;f=xe.DOMFix.childNodes(c);g=b}for(var h=null,k=0,j=true,n=0;n<g;n++){h=f[n];if(h.nodeType==3){if(h==a)break;k=k+h.nodeValue.length}else{d.moveToElementText(h);c=h;k=0;j=false}}a.nodeType== function(a,b){var d=this._document.body.createTextRange(),c=null,f=null,g=0;if(a.nodeType==3){c=xe.DOMFix.parentNode(a);f=xe.DOMFix.childNodes(c);g=f.length}else{c=a;f=xe.DOMFix.childNodes(c);g=b}for(var h=null,k=0,j=true,n=0;n<g;n++){h=f[n];if(h.nodeType==3){if(h==a)break;k=k+h.nodeValue.length}else{d.moveToElementText(h);c=h;k=0;j=false}}a.nodeType==3&&(k=k+b);return{oSelectableNodeForIE:c,iOffsetForIE:k,bCollapseToStart:j}};this._IERange2W3CRange=function(a){var b=new xe.W3CDOMRange(this._document),
3&&(k=k+b);return{oSelectableNodeForIE:c,iOffsetForIE:k,bCollapseToStart:j}};this._IERange2W3CRange=function(a){var b=new xe.W3CDOMRange(this._document),d=null,d=null,d=a.duplicate();d.collapse(true);d=this._getW3CContainerAndOffset(d,true);b.setStart(d.oContainer,d.iOffset);d=a.duplicate();d.collapse(true);if(d.isEqual(a))b.collapse(true);else{d=a.duplicate();d.collapse(false);d=this._getW3CContainerAndOffset(d);b.setEnd(d.oContainer,d.iOffset)}return b};this._getW3CContainerAndOffset=function(a, d=null,d=null,d=a.duplicate();d.collapse(true);d=this._getW3CContainerAndOffset(d,true);b.setStart(d.oContainer,d.iOffset);d=a.duplicate();d.collapse(true);if(d.isEqual(a))b.collapse(true);else{d=a.duplicate();d.collapse(false);d=this._getW3CContainerAndOffset(d);b.setEnd(d.oContainer,d.iOffset)}return b};this._getW3CContainerAndOffset=function(a,b){for(var d=a.parentElement(),c=-1,f=this._document.body.createTextRange(),g=xe.DOMFix.childNodes(d),c=null,h=0,h=0;h<g.length;h++)if(g[h].nodeType!=3){f.moveToElementText(g[h]);
b){for(var d=a.parentElement(),c=-1,f=this._document.body.createTextRange(),g=xe.DOMFix.childNodes(d),c=null,h=0,h=0;h<g.length;h++)if(g[h].nodeType!=3){f.moveToElementText(g[h]);if(f.compareEndPoints("StartToStart",a)>=0)break;c=g[h]}if(h!=0&&g[h-1].nodeType==3){g=this._document.body.createTextRange();f=null;if(c){g.moveToElementText(c);g.collapse(false);f=c.nextSibling}else{g.moveToElementText(d);g.collapse(true);f=d.firstChild}d=a.duplicate();d.setEndPoint("StartToStart",g);for(c=d.text.length;c> if(f.compareEndPoints("StartToStart",a)>=0)break;c=g[h]}if(h!=0&&g[h-1].nodeType==3){g=this._document.body.createTextRange();f=null;if(c){g.moveToElementText(c);g.collapse(false);f=c.nextSibling}else{g.moveToElementText(d);g.collapse(true);f=d.firstChild}d=a.duplicate();d.setEndPoint("StartToStart",g);for(c=d.text.length;c>f.nodeValue.length&&f.nextSibling;){c=c-f.nodeValue.length;f=f.nextSibling}if(b&&f.nextSibling&&f.nextSibling.nodeType==3&&c==f.nodeValue.length){c=c-f.nodeValue.length;f=f.nextSibling}d=
f.nodeValue.length&&f.nextSibling;){c=c-f.nodeValue.length;f=f.nextSibling}if(b&&f.nextSibling&&f.nextSibling.nodeType==3&&c==f.nodeValue.length){c=c-f.nodeValue.length;f=f.nextSibling}d=f}else{d=a.parentElement();c=h}return{oContainer:d,iOffset:c}}};xe.DOMFix=new (c.Class({$init:function(){if(c.browser.msie||c.browser.opera){this.childNodes=this._childNodes_Fix;this.parentNode=this._parentNode_Fix}else{this.childNodes=this._childNodes_Native;this.parentNode=this._parentNode_Native}},_parentNode_Native:function(a){return a.parentNode}, f}else{d=a.parentElement();c=h}return{oContainer:d,iOffset:c}}};xe.DOMFix=new (c.Class({$init:function(){if(c.browser.msie||c.browser.opera){this.childNodes=this._childNodes_Fix;this.parentNode=this._parentNode_Fix}else{this.childNodes=this._childNodes_Native;this.parentNode=this._parentNode_Native}},_parentNode_Native:function(a){return a.parentNode},_parentNode_Fix:function(a){if(!a)return a;for(;a.previousSibling;)a=a.previousSibling;return a.parentNode},_childNodes_Native:function(a){return a.childNodes},
_parentNode_Fix:function(a){if(!a)return a;for(;a.previousSibling;)a=a.previousSibling;return a.parentNode},_childNodes_Native:function(a){return a.childNodes},_childNodes_Fix:function(a){var b=null,d=0;if(a){b=[];for(a=a.firstChild;a;){b[d++]=a;a=a.nextSibling}}return b}}));xe.DraggableLayer=c.Class({$init:function(a,b){this.oOptions=c.extend({bModal:"false",oHandle:a,iMinX:-999999,iMinY:-999999,iMaxX:999999,iMaxY:999999},b);this.oHandle=this.oOptions.oHandle;a.style.display="block";a.style.position= _childNodes_Fix:function(a){var b=null,d=0;if(a){b=[];for(a=a.firstChild;a;){b[d++]=a;a=a.nextSibling}}return b}}));xe.DraggableLayer=c.Class({$init:function(a,b){this.oOptions=c.extend({bModal:"false",oHandle:a,iMinX:-999999,iMinY:-999999,iMaxX:999999,iMaxY:999999},b);this.oHandle=this.oOptions.oHandle;a.style.display="block";a.style.position="absolute";a.style.zIndex="9999";this.aBasePosition=this.getBaseOffset(a);a.style.top=this.toInt(c(a).offset().top)-this.aBasePosition.top+"px";a.style.left=
"absolute";a.style.zIndex="9999";this.aBasePosition=this.getBaseOffset(a);a.style.top=this.toInt(c(a).offset().top)-this.aBasePosition.top+"px";a.style.left=this.toInt(c(a).offset().left)-this.aBasePosition.left+"px";this.$FnMouseDown=c.fnBind(this._mousedown,this,a);this.$FnMouseMove=c.fnBind(this._mousemove,this,a);this.$FnMouseUp=c.fnBind(this._mouseup,this,a);c(this.oHandle).bind("mousedown",this.$FnMouseDown)},_mousedown:function(a,b){if(b.target.tagName!="INPUT"){this.MouseOffsetY=b.pageY-this.toInt(a.style.top)- this.toInt(c(a).offset().left)-this.aBasePosition.left+"px";this.$FnMouseDown=c.fnBind(this._mousedown,this,a);this.$FnMouseMove=c.fnBind(this._mousemove,this,a);this.$FnMouseUp=c.fnBind(this._mouseup,this,a);c(this.oHandle).bind("mousedown",this.$FnMouseDown)},_mousedown:function(a,b){if(b.target.tagName!="INPUT"){this.MouseOffsetY=b.pageY-this.toInt(a.style.top)-this.aBasePosition.top;this.MouseOffsetX=b.pageX-this.toInt(a.style.left)-this.aBasePosition.left;c(a).bind("mousemove",this.$FnMouseMove);
this.aBasePosition.top;this.MouseOffsetX=b.pageX-this.toInt(a.style.left)-this.aBasePosition.left;c(a).bind("mousemove",this.$FnMouseMove);c(a).bind("mouseup",this.$FnMouseUp)}},_mousemove:function(a,b){var d=b.pageY-this.MouseOffsetY-this.aBasePosition.top,c=b.pageX-this.MouseOffsetX-this.aBasePosition.left;if(d<this.oOptions.iMinY)d=this.oOptions.iMinY;if(d>this.oOptions.iMaxY)d=this.oOptions.iMaxY;if(c<this.oOptions.iMinX)c=this.oOptions.iMinX;if(c>this.oOptions.iMaxX)c=this.oOptions.iMaxX;a.style.top= c(a).bind("mouseup",this.$FnMouseUp)}},_mousemove:function(a,b){var d=b.pageY-this.MouseOffsetY-this.aBasePosition.top,c=b.pageX-this.MouseOffsetX-this.aBasePosition.left;if(d<this.oOptions.iMinY)d=this.oOptions.iMinY;if(d>this.oOptions.iMaxY)d=this.oOptions.iMaxY;if(c<this.oOptions.iMinX)c=this.oOptions.iMinX;if(c>this.oOptions.iMaxX)c=this.oOptions.iMaxX;a.style.top=d+"px";a.style.left=c+"px"},_mouseup:function(a){c(a).unbind("mousemove",this.$FnMouseMove);c(a).unbind("mouseup",this.$FnMouseUp)},
d+"px";a.style.left=c+"px"},_mouseup:function(a){c(a).unbind("mousemove",this.$FnMouseMove);c(a).unbind("mouseup",this.$FnMouseUp)},toInt:function(a){return parseInt(a)||0},findNonStatic:function(a){return!a?null:a.tagName=="BODY"||c(a).css("position").match(/absolute|relative/i)?a:this.findNonStatic(a.offsetParent)},getBaseOffset:function(a){a=this.findNonStatic(a.offsetParent);a=c(a).offset();return{top:a.top,left:a.left}}});xe.CorePlugin=c.Class({name:"CorePlugin",$init:function(a){this.funcOnReady= toInt:function(a){return parseInt(a)||0},findNonStatic:function(a){return!a?null:a.tagName=="BODY"||c(a).css("position").match(/absolute|relative/i)?a:this.findNonStatic(a.offsetParent)},getBaseOffset:function(a){a=this.findNonStatic(a.offsetParent);a=c(a).offset();return{top:a.top,left:a.left}}});xe.CorePlugin=c.Class({name:"CorePlugin",$init:function(a){this.funcOnReady=a},$AFTER_MSG_APP_READY:function(){this.oApp.exec("EXEC_ON_READY_FUNCTION",[])},$ON_ADD_APP_PROPERTY:function(a,b){this.oApp[a]=
a},$AFTER_MSG_APP_READY:function(){this.oApp.exec("EXEC_ON_READY_FUNCTION",[])},$ON_ADD_APP_PROPERTY:function(a,b){this.oApp[a]=b},$ON_REGISTER_BROWSER_EVENT:function(a,b,d,c,f){this.oApp.registerBrowserEvent(a,b,d,c,f)},$ON_DISABLE_COMMAND:function(a){this.oApp.disableCommand(a,true)},$ON_ENABLE_COMMAND:function(a){this.oApp.disableCommand(a,false)},$ON_EXEC_ON_READY_FUNCTION:function(){typeof this.funcOnReady=="function"&&this.funcOnReady()}});xe.Utils=c.Class({name:"Utils",$init:function(){if(c.browser.msie&& b},$ON_REGISTER_BROWSER_EVENT:function(a,b,d,c,f){this.oApp.registerBrowserEvent(a,b,d,c,f)},$ON_DISABLE_COMMAND:function(a){this.oApp.disableCommand(a,true)},$ON_ENABLE_COMMAND:function(a){this.oApp.disableCommand(a,false)},$ON_EXEC_ON_READY_FUNCTION:function(){typeof this.funcOnReady=="function"&&this.funcOnReady()}});xe.Utils=c.Class({name:"Utils",$init:function(){if(c.browser.msie&&c.browser.nVersion==6)try{document.execCommand("BackgroundImageCache",false,true)}catch(a){}},$ON_ATTACH_HOVER_EVENTS:function(a,
c.browser.nVersion==6)try{document.execCommand("BackgroundImageCache",false,true)}catch(a){}},$ON_ATTACH_HOVER_EVENTS:function(a,b){b=b||"hover";a&&c(a).hover(function(){c(this).addClass(b)},function(){c(this).removeClass(b)})}});xe.XpressRangeManager=c.Class({name:"XpressRangeManager",oWindow:null,$init:function(a){this.oWindow=a||window},$BEFORE_MSG_APP_READY:function(){if(this.oWindow&&this.oWindow.tagName=="IFRAME")this.oWindow=this.oWindow.contentWindow;this.oApp.exec("ADD_APP_PROPERTY",["getSelection", b){b=b||"hover";a&&c(a).hover(function(){c(this).addClass(b)},function(){c(this).removeClass(b)})}});xe.XpressRangeManager=c.Class({name:"XpressRangeManager",oWindow:null,$init:function(a){this.oWindow=a||window},$BEFORE_MSG_APP_READY:function(){if(this.oWindow&&this.oWindow.tagName=="IFRAME")this.oWindow=this.oWindow.contentWindow;this.oApp.exec("ADD_APP_PROPERTY",["getSelection",c.fnBind(this.getSelection,this)]);this.oApp.exec("ADD_APP_PROPERTY",["getEmptySelection",c.fnBind(this.getEmptySelection,
c.fnBind(this.getSelection,this)]);this.oApp.exec("ADD_APP_PROPERTY",["getEmptySelection",c.fnBind(this.getEmptySelection,this)])},$ON_SET_EDITING_WINDOW:function(a){this.oWindow=a},getEmptySelection:function(){return new xe.XpressRange(this.oWindow)},getSelection:function(){this.oApp.exec("RESTORE_IE_SELECTION",[]);var a=this.getEmptySelection();try{a.setFromSelection()}catch(b){}return a}});xe.Hotkey=c.Class({name:"Hotkey",storage:{},keyhash:{},$init:function(){this.storage={};this.keyhash={backspace:8, this)])},$ON_SET_EDITING_WINDOW:function(a){this.oWindow=a},getEmptySelection:function(){return new xe.XpressRange(this.oWindow)},getSelection:function(){this.oApp.exec("RESTORE_IE_SELECTION",[]);var a=this.getEmptySelection();try{a.setFromSelection()}catch(b){}return a}});xe.Hotkey=c.Class({name:"Hotkey",storage:{},keyhash:{},$init:function(){this.storage={};this.keyhash={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,meta:224,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,
tab:9,enter:13,shift:16,ctrl:17,alt:18,meta:224,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:46,comma:188,period:190,slash:191,hyphen:109,equal:61};if(c.browser.msie||c.browser.safari){this.keyhash.hyphen=189;this.keyhash.equal=187;this.keyhash.meta=91}},$ON_MSG_APP_READY:function(){c(this.oApp.getWYSIWYGDocument()||document).keydown(c.fnBind(this.keydown,this))},$ON_REGISTER_HOTKEY:function(a,b,d){d||(d=[]);b=c.fnBind(this.oApp.exec,this.oApp,b,d);a=this.normalize(a); right:39,down:40,del:46,comma:188,period:190,slash:191,hyphen:109,equal:61};if(c.browser.msie||c.browser.safari){this.keyhash.hyphen=189;this.keyhash.equal=187;this.keyhash.meta=91}},$ON_MSG_APP_READY:function(){c(this.oApp.getWYSIWYGDocument()||document).keydown(c.fnBind(this.keydown,this))},$ON_REGISTER_HOTKEY:function(a,b,d){d||(d=[]);b=c.fnBind(this.oApp.exec,this.oApp,b,d);a=this.normalize(a);if(!a)return false;this.add(a,b)},add:function(a,b){typeof this.storage[a]=="undefined"?this.storage[a]=
if(!a)return false;this.add(a,b)},add:function(a,b){typeof this.storage[a]=="undefined"?this.storage[a]=[b]:this.storage[a].push(b)},keydown:function(a){var b=[],d=this.keyhash;if(!(c.inArray(a.keyCode,[d.shift,d.ctrl,d.alt,d.meta])>=0)){a.shiftKey&&b.push("shift");a.altKey&&b.push("alt");a.ctrlKey&&b.push("ctrl");a.metaKey&&b.push("meta");if(b.length){b.length==1&&a.metaKey&&(b=["ctrl","meta"]);b.push(a.keyCode);b=b.join("+");if(this.storage[b]){c.each(this.storage[b],function(){this()});return false}}}}, [b]:this.storage[a].push(b)},keydown:function(a){var b=[],d=this.keyhash;if(!(c.inArray(a.keyCode,[d.shift,d.ctrl,d.alt,d.meta])>=0)){a.shiftKey&&b.push("shift");a.altKey&&b.push("alt");a.ctrlKey&&b.push("ctrl");a.metaKey&&b.push("meta");if(b.length){b.length==1&&a.metaKey&&(b=["ctrl","meta"]);b.push(a.keyCode);b=b.join("+");if(this.storage[b]){c.each(this.storage[b],function(){this()});return false}}}},normalize:function(a){var b,d,e,f,g,a=(a||"").toLowerCase().split("+");b=d=e=f=g=false;c.each(a,
normalize:function(a){var b,d,e,f,g,a=(a||"").toLowerCase().split("+");b=d=e=f=g=false;c.each(a,function(){var a=""+this;switch(a){case "shift":b=true;case "alt":e=true;case "ctrl":d=true;case "meta":f=true;default:g=a}});if(!g)return"";a=[];b&&a.push("shift");e&&a.push("alt");d&&a.push("ctrl");(f||d&&!b&&!e)&&a.push("meta");a.push(this.keyhash[g]||g.toUpperCase().charCodeAt(0));return a.join("+")}});xe.DialogLayerManager=c.Class({name:"DialogLayerManager",aMadeDraggable:null,aOpenedLayers:null,$init:function(){this.aMadeDraggable= function(){var a=""+this;switch(a){case "shift":b=true;case "alt":e=true;case "ctrl":d=true;case "meta":f=true;default:g=a}});if(!g)return"";a=[];b&&a.push("shift");e&&a.push("alt");d&&a.push("ctrl");(f||d&&!b&&!e)&&a.push("meta");a.push(this.keyhash[g]||g.toUpperCase().charCodeAt(0));return a.join("+")}});xe.DialogLayerManager=c.Class({name:"DialogLayerManager",aMadeDraggable:null,aOpenedLayers:null,$init:function(){this.aMadeDraggable=[];this.aOpenedLayers=[]},$ON_SHOW_DIALOG_LAYER:function(a,b){a=
[];this.aOpenedLayers=[]},$ON_SHOW_DIALOG_LAYER:function(a,b){a=c.$(a);b=c.$(b)||false;if(a&&c.inArray(a,this.aOpenedLayers)==-1){this.oApp.exec("POSITION_DIALOG_LAYER",[a]);this.aOpenedLayers[this.aOpenedLayers.length]=a;if(c.inArray(a,this.aMadeDraggable)==-1){new xe.DraggableLayer(a,{bModal:b,iMinY:0});this.aMadeDraggable[this.aMadeDraggable.length]=a}else a.style.display="block"}},$ON_HIDE_LAST_DIALOG_LAYER:function(){this.oApp.exec("HIDE_DIALOG_LAYER",[this.aOpenedLayers[this.aOpenedLayers.length- c.$(a);b=c.$(b)||false;if(a&&c.inArray(a,this.aOpenedLayers)==-1){this.oApp.exec("POSITION_DIALOG_LAYER",[a]);this.aOpenedLayers[this.aOpenedLayers.length]=a;if(c.inArray(a,this.aMadeDraggable)==-1){new xe.DraggableLayer(a,{bModal:b,iMinY:0});this.aMadeDraggable[this.aMadeDraggable.length]=a}else a.style.display="block"}},$ON_HIDE_LAST_DIALOG_LAYER:function(){this.oApp.exec("HIDE_DIALOG_LAYER",[this.aOpenedLayers[this.aOpenedLayers.length-1]])},$ON_HIDE_ALL_DIALOG_LAYER:function(){for(var a=this.aOpenedLayers.length-
1]])},$ON_HIDE_ALL_DIALOG_LAYER:function(){for(var a=this.aOpenedLayers.length-1;a>=0;a--)this.oApp.exec("HIDE_DIALOG_LAYER",[this.aOpenedLayers[a]])},$ON_HIDE_DIALOG_LAYER:function(a){if(a=c.$(a))a.style.display="none";this.aOpenedLayers=c.grep(this.aOpenedLayers,function(b){return b!=a})},$ON_SET_DIALOG_LAYER_POSITION:function(a,b,d){a.style.top=b;a.style.left=d}});xe.ActiveLayerManager=c.Class({name:"ActiveLayerManager",oCurrentLayer:null,$ON_TOGGLE_ACTIVE_LAYER:function(a,b,d,c,f){if(a==this.oCurrentLayer)this.oApp.exec("HIDE_ACTIVE_LAYER", 1;a>=0;a--)this.oApp.exec("HIDE_DIALOG_LAYER",[this.aOpenedLayers[a]])},$ON_HIDE_DIALOG_LAYER:function(a){if(a=c.$(a))a.style.display="none";this.aOpenedLayers=c.grep(this.aOpenedLayers,function(b){return b!=a})},$ON_SET_DIALOG_LAYER_POSITION:function(a,b,d){a.style.top=b;a.style.left=d}});xe.ActiveLayerManager=c.Class({name:"ActiveLayerManager",oCurrentLayer:null,$ON_TOGGLE_ACTIVE_LAYER:function(a,b,d,c,f){if(a==this.oCurrentLayer)this.oApp.exec("HIDE_ACTIVE_LAYER",[]);else{this.oApp.exec("SHOW_ACTIVE_LAYER",
[]);else{this.oApp.exec("SHOW_ACTIVE_LAYER",[a,c,f]);b&&this.oApp.exec(b,d)}},$ON_SHOW_ACTIVE_LAYER:function(a,b,d){a=c.$(a);this.sOnCloseCmd=b;this.aOnCloseParam=d;if(a!=this.oCurrentLayer){this.oApp.exec("HIDE_ACTIVE_LAYER",[]);a.style.display="block";this.oCurrentLayer=a}},$ON_HIDE_ACTIVE_LAYER:function(){var a=this.oCurrentLayer;if(a){a.style.display="none";this.oCurrentLayer=null;this.sOnCloseCmd&&this.oApp.exec(this.sOnCloseCmd,this.aOnCloseParam)}},$ON_HIDE_CURRENT_ACTIVE_LAYER:function(){this.oApp.exec("HIDE_ACTIVE_LAYER", [a,c,f]);b&&this.oApp.exec(b,d)}},$ON_SHOW_ACTIVE_LAYER:function(a,b,d){a=c.$(a);this.sOnCloseCmd=b;this.aOnCloseParam=d;if(a!=this.oCurrentLayer){this.oApp.exec("HIDE_ACTIVE_LAYER",[]);a.style.display="block";this.oCurrentLayer=a}},$ON_HIDE_ACTIVE_LAYER:function(){var a=this.oCurrentLayer;if(a){a.style.display="none";this.oCurrentLayer=null;this.sOnCloseCmd&&this.oApp.exec(this.sOnCloseCmd,this.aOnCloseParam)}},$ON_HIDE_CURRENT_ACTIVE_LAYER:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_EVENT_EDITING_AREA_KEYDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",
[])},$ON_EVENT_EDITING_AREA_KEYDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_EVENT_EDITING_AREA_MOUSEDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])}});xe.StringConverterManager=c.Class({name:"StringConverterManager",oConverters:null,$init:function(){this.oConverters={}},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["applyConverter",c.fnBind(this.applyConverter,this)]);this.oApp.exec("ADD_APP_PROPERTY",["addConverter",c.fnBind(this.addConverter,this)])}, [])},$ON_EVENT_EDITING_AREA_MOUSEDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])}});xe.StringConverterManager=c.Class({name:"StringConverterManager",oConverters:null,$init:function(){this.oConverters={}},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["applyConverter",c.fnBind(this.applyConverter,this)]);this.oApp.exec("ADD_APP_PROPERTY",["addConverter",c.fnBind(this.addConverter,this)])},applyConverter:function(a,b){var d=this.oConverters[a];if(!d)return b;for(var c=0;c<
applyConverter:function(a,b){var d=this.oConverters[a];if(!d)return b;for(var c=0;c<d.length;c++)b=d[c](b);return b},addConverter:function(a,b){this.oConverters[a]||(this.oConverters[a]=[]);this.oConverters[a][this.oConverters[a].length]=b}});xe.MessageManager=c.Class({name:"MessageManager",oMessageMap:null,$init:function(a){this.oMessageMap=a},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["$MSG",c.fnBind(this.getMessage,this)])},getMessage:function(a){return this.oMessageMap[a]? d.length;c++)b=d[c](b);return b},addConverter:function(a,b){this.oConverters[a]||(this.oConverters[a]=[]);this.oConverters[a][this.oConverters[a].length]=b}});xe.MessageManager=c.Class({name:"MessageManager",oMessageMap:null,$init:function(a){this.oMessageMap=a},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["$MSG",c.fnBind(this.getMessage,this)])},getMessage:function(a){return this.oMessageMap[a]?unescape(this.oMessageMap[a]):a}});xe.XE_Toolbar=c.Class({name:"XE_Toolbar",toolbarArea:null,
unescape(this.oMessageMap[a]):a}});xe.XE_Toolbar=c.Class({name:"XE_Toolbar",toolbarArea:null,toolbarButton:null,uiNameTag:"uiName",sUIClassPrefix:"xpress_xeditor_ui_",aUICmdMap:null,$init:function(a){this.htUIList={};this.aUICmdMap={};this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){a=c.$(a)||document;this.toolbarArea=c(".tool",a).get(0);this.welToolbarArea=c(this.toolbarArea);this.aAllButtons=c("BUTTON",this.toolbarArea).get();for(var a=this.toolbarArea.getElementsByTagName("LI"),b=a.length, toolbarButton:null,uiNameTag:"uiName",sUIClassPrefix:"xpress_xeditor_ui_",aUICmdMap:null,$init:function(a){this.htUIList={};this.aUICmdMap={};this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){a=c.$(a)||document;this.toolbarArea=c(".tool",a).get(0);this.welToolbarArea=c(this.toolbarArea);this.aAllButtons=c("BUTTON",this.toolbarArea).get();for(var a=this.toolbarArea.getElementsByTagName("LI"),b=a.length,d=RegExp(this.sUIClassPrefix+"([^ ]+)"),e=0;e<b;e++)if(d.test(a[e].className)){var f=RegExp.$1;
d=RegExp(this.sUIClassPrefix+"([^ ]+)"),e=0;e<b;e++)if(d.test(a[e].className)){var f=RegExp.$1;this.htUIList[f]==null&&(this.htUIList[f]=c(">*:first-child",a[e]).get(0))}},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.toolbarArea,"mouseover","EVENT_TOOLBAR_MOUSEOVER",[]);this.oApp.registerBrowserEvent(this.toolbarArea,"mouseout","EVENT_TOOLBAR_MOUSEOUT",[]);this.oApp.exec("ADD_APP_PROPERTY",["getToolbarButtonByUIName",c.fnBind(this.getToolbarButtonByUIName,this)])},$ON_EVENT_TOOLBAR_MOUSEOVER:function(a){a.target.tagName== this.htUIList[f]==null&&(this.htUIList[f]=c(">*:first-child",a[e]).get(0))}},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.toolbarArea,"mouseover","EVENT_TOOLBAR_MOUSEOVER",[]);this.oApp.registerBrowserEvent(this.toolbarArea,"mouseout","EVENT_TOOLBAR_MOUSEOUT",[]);this.oApp.exec("ADD_APP_PROPERTY",["getToolbarButtonByUIName",c.fnBind(this.getToolbarButtonByUIName,this)])},$ON_EVENT_TOOLBAR_MOUSEOVER:function(a){a.target.tagName=="BUTTON"&&c(a.target).addClass("hover").parent("span").addClass("hover")},
"BUTTON"&&c(a.target).addClass("hover").parent("span").addClass("hover")},$ON_EVENT_TOOLBAR_MOUSEOUT:function(a){a.target.tagName=="BUTTON"&&c(a.target).removeClass("hover").parent("span").removeClass("hover")},$ON_TOGGLE_TOOLBAR_ACTIVE_LAYER:function(a,b,d,c,f,g){this.oApp.exec("TOGGLE_ACTIVE_LAYER",[a,"MSG_TOOLBAR_LAYER_SHOWN",[a,b,d,c],f,g])},$ON_MSG_TOOLBAR_LAYER_SHOWN:function(a,b,d,c){this.oApp.exec("POSITION_TOOLBAR_LAYER",[a,b]);d&&this.oApp.exec(d,c)},$ON_SHOW_TOOLBAR_ACTIVE_LAYER:function(a, $ON_EVENT_TOOLBAR_MOUSEOUT:function(a){a.target.tagName=="BUTTON"&&c(a.target).removeClass("hover").parent("span").removeClass("hover")},$ON_TOGGLE_TOOLBAR_ACTIVE_LAYER:function(a,b,d,c,f,g){this.oApp.exec("TOGGLE_ACTIVE_LAYER",[a,"MSG_TOOLBAR_LAYER_SHOWN",[a,b,d,c],f,g])},$ON_MSG_TOOLBAR_LAYER_SHOWN:function(a,b,d,c){this.oApp.exec("POSITION_TOOLBAR_LAYER",[a,b]);d&&this.oApp.exec(d,c)},$ON_SHOW_TOOLBAR_ACTIVE_LAYER:function(a,b,d,c){this.oApp.exec("SHOW_ACTIVE_LAYER",[a,b,d]);this.oApp.exec("POSITION_TOOLBAR_LAYER",
b,d,c){this.oApp.exec("SHOW_ACTIVE_LAYER",[a,b,d]);this.oApp.exec("POSITION_TOOLBAR_LAYER",[a,c])},$ON_ENABLE_UI:function(a){var b=this.htUIList[a];if(b){c(b).removeClass("off");b.disabled=false;b="";if(this.aUICmdMap[a])for(var d=0;d<this.aUICmdMap[a].length;d++){b=this.aUICmdMap[a][d];this.oApp.exec("ENABLE_COMMAND",[b])}}},$ON_DISABLE_UI:function(a){var b=this.htUIList[a];if(b){c(b).addClass("off");c(b).removeClass("hover").parent("span").removeClass("hover");b.disabled=true;b="";if(this.aUICmdMap[a])for(var d= [a,c])},$ON_ENABLE_UI:function(a){var b=this.htUIList[a];if(b){c(b).removeClass("off");b.disabled=false;b="";if(this.aUICmdMap[a])for(var d=0;d<this.aUICmdMap[a].length;d++){b=this.aUICmdMap[a][d];this.oApp.exec("ENABLE_COMMAND",[b])}}},$ON_DISABLE_UI:function(a){var b=this.htUIList[a];if(b){c(b).addClass("off");c(b).removeClass("hover").parent("span").removeClass("hover");b.disabled=true;b="";if(this.aUICmdMap[a])for(var d=0;d<this.aUICmdMap[a].length;d++){b=this.aUICmdMap[a][d];this.oApp.exec("DISABLE_COMMAND",
0;d<this.aUICmdMap[a].length;d++){b=this.aUICmdMap[a][d];this.oApp.exec("DISABLE_COMMAND",[b])}}},$ON_SELECT_UI:function(a){(a=this.htUIList[a])&&c(a).addClass("active")},$ON_DESELECT_UI:function(a){(a=this.htUIList[a])&&c(a).removeClass("active")},$ON_ENABLE_ALL_UI:function(){for(var a in this.htUIList)a&&this.oApp.exec("ENABLE_UI",[a]);c(this.toolbarArea).removeClass("off")},$ON_DISABLE_ALL_UI:function(){for(var a in this.htUIList)a&&this.oApp.exec("DISABLE_UI",[a]);c(this.toolbarArea).addClass("off"); [b])}}},$ON_SELECT_UI:function(a){(a=this.htUIList[a])&&c(a).addClass("active")},$ON_DESELECT_UI:function(a){(a=this.htUIList[a])&&c(a).removeClass("active")},$ON_ENABLE_ALL_UI:function(){for(var a in this.htUIList)a&&this.oApp.exec("ENABLE_UI",[a]);c(this.toolbarArea).removeClass("off")},$ON_DISABLE_ALL_UI:function(){for(var a in this.htUIList)a&&this.oApp.exec("DISABLE_UI",[a]);c(this.toolbarArea).addClass("off");this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_MSG_STYLE_CHANGED:function(a,b){b==1?this.oApp.exec("SELECT_UI",
this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_MSG_STYLE_CHANGED:function(a,b){b==1?this.oApp.exec("SELECT_UI",[a]):this.oApp.exec("DESELECT_UI",[a])},$ON_REGISTER_UI_EVENT:function(a,b,d,c){this.aUICmdMap[a]||(this.aUICmdMap[a]=[]);this.aUICmdMap[a][this.aUICmdMap[a].length]=d;(a=this.htUIList[a])&&this.oApp.registerBrowserEvent(a,b,d,c)},$ON_POSITION_TOOLBAR_LAYER:function(a,b){a=c.$(a);b=c.$(b);if(a){b&&b.tagName&&b.tagName=="BUTTON"&&b.parentNode.appendChild(a);a.style.left="0";var d=c(a).offset().left, [a]):this.oApp.exec("DESELECT_UI",[a])},$ON_REGISTER_UI_EVENT:function(a,b,d,c){this.aUICmdMap[a]||(this.aUICmdMap[a]=[]);this.aUICmdMap[a][this.aUICmdMap[a].length]=d;(a=this.htUIList[a])&&this.oApp.registerBrowserEvent(a,b,d,c)},$ON_POSITION_TOOLBAR_LAYER:function(a,b){a=c.$(a);b=c.$(b);if(a){b&&b.tagName&&b.tagName=="BUTTON"&&b.parentNode.appendChild(a);a.style.left="0";var d=c(a).offset().left,d=d+a.offsetWidth,e=this.welToolbarArea.offset().left,e=e+this.toolbarArea.offsetWidth;if(d>e)a.style.left=
d=d+a.offsetWidth,e=this.welToolbarArea.offset().left,e=e+this.toolbarArea.offsetWidth;if(d>e)a.style.left=e-d-5+"px"}},getToolbarButtonByUIName:function(a){return this.htUIList[a]}});xe.XE_EditingAreaManager=c.Class({name:"XE_EditingAreaManager",oActivePlugin:null,oIRField:null,bIsDirty:!1,$init:function(a,b,d,e,f){this.sInitialMode=a;this.oIRField=c.$(b);this._assignHTMLObjects(f);this.fOnBeforeUnload=e;this.oEditingMode={};this.elEditingAreaContainer.style.height=parseInt(d.nHeight||this.elEditingAreaContainer.offsetHeight)+ e-d-5+"px"}},getToolbarButtonByUIName:function(a){return this.htUIList[a]}});xe.XE_EditingAreaManager=c.Class({name:"XE_EditingAreaManager",oActivePlugin:null,oIRField:null,bIsDirty:!1,$init:function(a,b,d,e,f){this.sInitialMode=a;this.oIRField=c.$(b);this._assignHTMLObjects(f);this.fOnBeforeUnload=e;this.oEditingMode={};this.elEditingAreaContainer.style.height=parseInt(d.nHeight||this.elEditingAreaContainer.offsetHeight)+"px";this.nMinHeight=d.nMinHeight||10;this.niMinWidth=d.nMinWidth||10},_assignHTMLObjects:function(a){a=
"px";this.nMinHeight=d.nMinHeight||10;this.niMinWidth=d.nMinWidth||10},_assignHTMLObjects:function(a){a=c.$(a)||document;this.elEditingAreaContainer=c("DIV.xpress_xeditor_editing_area_container",a).get(0);this.elEditingAreaSkipUI=c("A.skip",a).get(0)},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["elEditingAreaContainer",this.elEditingAreaContainer]);this.oApp.exec("ADD_APP_PROPERTY",["getIR",c.fnBind(this.getIR,this)]);this.oApp.exec("ADD_APP_PROPERTY",["setIR",this.setIR]); c.$(a)||document;this.elEditingAreaContainer=c("DIV.xpress_xeditor_editing_area_container",a).get(0);this.elEditingAreaSkipUI=c("A.skip",a).get(0)},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["elEditingAreaContainer",this.elEditingAreaContainer]);this.oApp.exec("ADD_APP_PROPERTY",["getIR",c.fnBind(this.getIR,this)]);this.oApp.exec("ADD_APP_PROPERTY",["setIR",this.setIR]);this.oApp.exec("ADD_APP_PROPERTY",["getEditingMode",c.fnBind(this.getEditingMode,this)])},$ON_MSG_APP_READY:function(){this.oApp.exec("CHANGE_EDITING_MODE",
this.oApp.exec("ADD_APP_PROPERTY",["getEditingMode",c.fnBind(this.getEditingMode,this)])},$ON_MSG_APP_READY:function(){this.oApp.exec("CHANGE_EDITING_MODE",[this.sInitialMode,true]);this.oApp.exec("LOAD_IR_FIELD",[false]);this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI,"focus","MSG_EDITING_AREA_SIZE_CHANGED",[],50);this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI,"blur","MSG_EDITING_AREA_SIZE_CHANGED",[],50)},$AFTER_MSG_APP_READY:function(){this.oApp.exec("UPDATE_IR_FIELD",[])},$ON_LOAD_IR_FIELD:function(a){this.oApp.setIR(this.oIRField.value, [this.sInitialMode,true]);this.oApp.exec("LOAD_IR_FIELD",[false]);this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI,"focus","MSG_EDITING_AREA_SIZE_CHANGED",[],50);this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI,"blur","MSG_EDITING_AREA_SIZE_CHANGED",[],50)},$AFTER_MSG_APP_READY:function(){this.oApp.exec("UPDATE_IR_FIELD",[])},$ON_LOAD_IR_FIELD:function(a){this.oApp.setIR(this.oIRField.value,a)},$ON_UPDATE_IR_FIELD:function(){this.oIRField.value=this.oApp.getIR()},$BEFORE_CHANGE_EDITING_MODE:function(a){this._oPrevActivePlugin=
a)},$ON_UPDATE_IR_FIELD:function(){this.oIRField.value=this.oApp.getIR()},$BEFORE_CHANGE_EDITING_MODE:function(a){this._oPrevActivePlugin=this.oActivePlugin;this.oActivePlugin=this.oEditingMode[a]},$AFTER_CHANGE_EDITING_MODE:function(a,b){if(this._oPrevActivePlugin){this.oApp.exec("SET_IR",[this._oPrevActivePlugin.getIR()]);this.oApp.exec("ENABLE_UI",[this._oPrevActivePlugin.sMode]);this._setEditingAreaDimension()}this.oApp.exec("DISABLE_UI",[this.oActivePlugin.sMode]);b||this.oApp.exec("FOCUS",[])}, this.oActivePlugin;this.oActivePlugin=this.oEditingMode[a]},$AFTER_CHANGE_EDITING_MODE:function(a,b){if(this._oPrevActivePlugin){this.oApp.exec("SET_IR",[this._oPrevActivePlugin.getIR()]);this.oApp.exec("ENABLE_UI",[this._oPrevActivePlugin.sMode]);this._setEditingAreaDimension()}this.oApp.exec("DISABLE_UI",[this.oActivePlugin.sMode]);b||this.oApp.exec("FOCUS",[])},$ON_SET_IS_DIRTY:function(a){this.bIsDirty=a},$ON_FOCUS:function(){this.oActivePlugin&&typeof this.oActivePlugin.setIR=="function"&&this.oActivePlugin.focus()},
$ON_SET_IS_DIRTY:function(a){this.bIsDirty=a},$ON_FOCUS:function(){this.oActivePlugin&&typeof this.oActivePlugin.setIR=="function"&&this.oActivePlugin.focus()},$BEFORE_SET_IR:function(a,b){b||this.oApp.exec("RECORD_UNDO_ACTION",["SET CONTENTS"])},$ON_SET_IR:function(a){this.oActivePlugin&&typeof this.oActivePlugin.setIR=="function"&&this.oActivePlugin.setIR(a)},$AFTER_SET_IR:function(a,b){b||this.oApp.exec("RECORD_UNDO_ACTION",["SET CONTENTS"])},$ON_REGISTER_EDITING_AREA:function(a){this.oEditingMode[a.sMode]= $BEFORE_SET_IR:function(a,b){b||this.oApp.exec("RECORD_UNDO_ACTION",["SET CONTENTS"])},$ON_SET_IR:function(a){this.oActivePlugin&&typeof this.oActivePlugin.setIR=="function"&&this.oActivePlugin.setIR(a)},$AFTER_SET_IR:function(a,b){b||this.oApp.exec("RECORD_UNDO_ACTION",["SET CONTENTS"])},$ON_REGISTER_EDITING_AREA:function(a){this.oEditingMode[a.sMode]=a;this.attachDocumentEvents(a.oEditingArea)},$ON_MSG_EDITING_AREA_RESIZE_STARTED:function(){this.oActivePlugin.elEditingArea.style.display="none";
a;this.attachDocumentEvents(a.oEditingArea)},$ON_MSG_EDITING_AREA_RESIZE_STARTED:function(){this.oActivePlugin.elEditingArea.style.display="none";this.iStartingHeight=parseInt(this.elEditingAreaContainer.style.height)},$ON_RESIZE_EDITING_AREA:function(a,b){var d=parseInt(a),c=parseInt(b);if(d<this.niMinWidth)d=this.niMinWidth;if(c<this.nMinHeight)c=this.nMinHeight;if(a)this.elEditingAreaContainer.style.width=d+"px";if(b)this.elEditingAreaContainer.style.height=c+"px"},$ON_RESIZE_EDITING_AREA_BY:function(a, this.iStartingHeight=parseInt(this.elEditingAreaContainer.style.height)},$ON_RESIZE_EDITING_AREA:function(a,b){var d=parseInt(a),c=parseInt(b);if(d<this.niMinWidth)d=this.niMinWidth;if(c<this.nMinHeight)c=this.nMinHeight;if(a)this.elEditingAreaContainer.style.width=d+"px";if(b)this.elEditingAreaContainer.style.height=c+"px"},$ON_RESIZE_EDITING_AREA_BY:function(a,b){var d=parseInt(a),c=parseInt(b);this.oApp.exec("RESIZE_EDITING_AREA",[this.elEditingAreaContainer.style.width?parseInt(this.elEditingAreaContainer.style.width)+
b){var d=parseInt(a),c=parseInt(b);this.oApp.exec("RESIZE_EDITING_AREA",[this.elEditingAreaContainer.style.width?parseInt(this.elEditingAreaContainer.style.width)+d:null,this.elEditingAreaContainer.style.height?this.iStartingHeight+c:null])},$ON_MSG_EDITING_AREA_RESIZE_ENDED:function(){this.oActivePlugin.elEditingArea.style.display="block";this._setEditingAreaDimension()},_setEditingAreaDimension:function(){this.oActivePlugin.elEditingArea.style.height=this.elEditingAreaContainer.style.height;this.oActivePlugin.elEditingArea.style.width= d:null,this.elEditingAreaContainer.style.height?this.iStartingHeight+c:null])},$ON_MSG_EDITING_AREA_RESIZE_ENDED:function(){this.oActivePlugin.elEditingArea.style.display="block";this._setEditingAreaDimension()},_setEditingAreaDimension:function(){this.oActivePlugin.elEditingArea.style.height=this.elEditingAreaContainer.style.height;this.oActivePlugin.elEditingArea.style.width=this.elEditingAreaContainer.style.width},attachDocumentEvents:function(a){this.oApp.registerBrowserEvent(a,"click","EVENT_EDITING_AREA_CLICK");
this.elEditingAreaContainer.style.width},attachDocumentEvents:function(a){this.oApp.registerBrowserEvent(a,"click","EVENT_EDITING_AREA_CLICK");this.oApp.registerBrowserEvent(a,"mousedown","EVENT_EDITING_AREA_MOUSEDOWN");this.oApp.registerBrowserEvent(a,"mousemove","EVENT_EDITING_AREA_MOUSEMOVE");this.oApp.registerBrowserEvent(a,"mouseup","EVENT_EDITING_AREA_MOUSEUP");this.oApp.registerBrowserEvent(a,"keydown","EVENT_EDITING_AREA_KEYDOWN");this.oApp.registerBrowserEvent(a,"keypress","EVENT_EDITING_AREA_KEYPRESS"); this.oApp.registerBrowserEvent(a,"mousedown","EVENT_EDITING_AREA_MOUSEDOWN");this.oApp.registerBrowserEvent(a,"mousemove","EVENT_EDITING_AREA_MOUSEMOVE");this.oApp.registerBrowserEvent(a,"mouseup","EVENT_EDITING_AREA_MOUSEUP");this.oApp.registerBrowserEvent(a,"keydown","EVENT_EDITING_AREA_KEYDOWN");this.oApp.registerBrowserEvent(a,"keypress","EVENT_EDITING_AREA_KEYPRESS");this.oApp.registerBrowserEvent(a,"keyup","EVENT_EDITING_AREA_KEYUP")},getIR:function(){return this.oActivePlugin.getIR()},setIR:function(a,
this.oApp.registerBrowserEvent(a,"keyup","EVENT_EDITING_AREA_KEYUP")},getIR:function(){return this.oActivePlugin.getIR()},setIR:function(a,b){this.oApp.exec("SET_IR",[a,b])},getEditingMode:function(){return this.oActivePlugin.sMode}});xe.XE_EditingArea_HTMLSrc=c.Class({name:"XE_EditingArea_HTMLSrc",sMode:"HTMLSrc",textarea:null,$init:function(a){this.elEditingArea=this.textarea=c.$(a)},$BEFORE_MSG_APP_READY:function(){this.oEditingArea=this.textarea;this.oApp.exec("REGISTER_EDITING_AREA",[this])}, b){this.oApp.exec("SET_IR",[a,b])},getEditingMode:function(){return this.oActivePlugin.sMode}});xe.XE_EditingArea_HTMLSrc=c.Class({name:"XE_EditingArea_HTMLSrc",sMode:"HTMLSrc",textarea:null,$init:function(a){this.elEditingArea=this.textarea=c.$(a)},$BEFORE_MSG_APP_READY:function(){this.oEditingArea=this.textarea;this.oApp.exec("REGISTER_EDITING_AREA",[this])},$ON_CHANGE_EDITING_MODE:function(a){this.textarea.style.display=a==this.sMode?"block":"none"},$ON_PASTE_HTML:function(a){if(this.oApp.getEditingMode()==
$ON_CHANGE_EDITING_MODE:function(a){this.textarea.style.display=a==this.sMode?"block":"none"},$ON_PASTE_HTML:function(a){if(this.oApp.getEditingMode()==this.sMode){(new l(this.textarea)).paste(a);this.textarea.focus()}},getIR:function(){var a=this.textarea.value;return this.oApp.applyConverter?this.oApp.applyConverter(this.sMode+"_TO_IR",a):a},setIR:function(a){this.textarea.value=this.oApp.applyConverter?this.oApp.applyConverter("IR_TO_"+this.sMode,a):a},focus:function(){this.textarea.focus()}}); this.sMode){(new l(this.textarea)).paste(a);this.textarea.focus()}},getIR:function(){var a=this.textarea.value;return this.oApp.applyConverter?this.oApp.applyConverter(this.sMode+"_TO_IR",a):a},setIR:function(a){this.textarea.value=this.oApp.applyConverter?this.oApp.applyConverter("IR_TO_"+this.sMode,a):a},focus:function(){this.textarea.focus()}});var l=function(a){this._o=a};l.prototype.getSelection=function(){var a=this._o,b=[-1,-1];if(isNaN(this._o.selectionStart)){a.focus();var d=document.body.createTextRange(),
var l=function(a){this._o=a};l.prototype.getSelection=function(){var a=this._o,b=[-1,-1];if(isNaN(this._o.selectionStart)){a.focus();var d=document.body.createTextRange(),c=null,c=document.selection.createRange().duplicate();d.moveToElementText(a);c.collapse(true);d.setEndPoint("EndToEnd",c);b[0]=d.text.length;c=document.selection.createRange().duplicate();d.moveToElementText(a);c.collapse(false);d.setEndPoint("EndToEnd",c);b[1]=d.text.length;a.blur()}else{b[0]=a.selectionStart;b[1]=a.selectionEnd}return b}; c=null,c=document.selection.createRange().duplicate();d.moveToElementText(a);c.collapse(true);d.setEndPoint("EndToEnd",c);b[0]=d.text.length;c=document.selection.createRange().duplicate();d.moveToElementText(a);c.collapse(false);d.setEndPoint("EndToEnd",c);b[1]=d.text.length;a.blur()}else{b[0]=a.selectionStart;b[1]=a.selectionEnd}return b};l.prototype.setSelection=function(a,b){var d=this._o;typeof b=="undefined"&&(b=a);if(d.setSelectionRange)d.setSelectionRange(a,b);else if(d.createTextRange){var c=
l.prototype.setSelection=function(a,b){var d=this._o;typeof b=="undefined"&&(b=a);if(d.setSelectionRange)d.setSelectionRange(a,b);else if(d.createTextRange){var c=d.createTextRange();c.collapse(true);c.moveStart("character",a);c.moveEnd("character",b-a);c.select();d.blur()}};l.prototype.copy=function(){var a=this.getSelection();return this._o.value.substring(a[0],a[1])};l.prototype.paste=function(a){var b=this._o,d=this.getSelection(),c=b.value,f=c.substr(0,d[0]),c=c.substr(d[1]);b.value=f+a+c;b= d.createTextRange();c.collapse(true);c.moveStart("character",a);c.moveEnd("character",b-a);c.select();d.blur()}};l.prototype.copy=function(){var a=this.getSelection();return this._o.value.substring(a[0],a[1])};l.prototype.paste=function(a){var b=this._o,d=this.getSelection(),c=b.value,f=c.substr(0,d[0]),c=c.substr(d[1]);b.value=f+a+c;b=0;if(typeof document.body.style.maxHeight=="undefined"){f=f.match(/\n/gi);b=f!=null?f.length:0}this.setSelection(d[0]+a.length-b)};l.prototype.cut=function(){var a=
0;if(typeof document.body.style.maxHeight=="undefined"){f=f.match(/\n/gi);b=f!=null?f.length:0}this.setSelection(d[0]+a.length-b)};l.prototype.cut=function(){var a=this.copy();this.paste("");return a};xe.XE_EditingArea_WYSIWYG=c.Class({name:"XE_EditingArea_WYSIWYG",status:xe.PLUGIN_STATUS.NOT_READY,sMode:"WYSIWYG",iframe:null,doc:null,iLastUndoRecorded:0,iMinUndoInterval:3E3,_nIFrameReadyCount:50,$init:function(a){this.iframe=c.$(a);this.initIframe();this.elEditingArea=a},$BEFORE_MSG_APP_READY:function(){this.oEditingArea= this.copy();this.paste("");return a};xe.XE_EditingArea_WYSIWYG=c.Class({name:"XE_EditingArea_WYSIWYG",status:xe.PLUGIN_STATUS.NOT_READY,sMode:"WYSIWYG",iframe:null,doc:null,iLastUndoRecorded:0,iMinUndoInterval:3E3,_nIFrameReadyCount:50,$init:function(a){this.iframe=c.$(a);this.initIframe();this.elEditingArea=a},$BEFORE_MSG_APP_READY:function(){this.oEditingArea=this.doc;this.oApp.exec("REGISTER_EDITING_AREA",[this]);this.oApp.exec("ADD_APP_PROPERTY",["getWYSIWYGWindow",c.fnBind(this.getWindow,this)]);
this.doc;this.oApp.exec("REGISTER_EDITING_AREA",[this]);this.oApp.exec("ADD_APP_PROPERTY",["getWYSIWYGWindow",c.fnBind(this.getWindow,this)]);this.oApp.exec("ADD_APP_PROPERTY",["getWYSIWYGDocument",c.fnBind(this.getDocument,this)])},$ON_MSG_APP_READY:function(){if(c.browser.msie){c(this.doc).unbind("keydown.ea").bind("keydown.ea",c.fnBind(function(a){if(this.doc.selection.type.toLowerCase()=="control"&&a.keyCode==8){this.oApp.exec("EXECCOMMAND",["delete",false,false]);a.preventDefault();a.stopPropagation()}}, this.oApp.exec("ADD_APP_PROPERTY",["getWYSIWYGDocument",c.fnBind(this.getDocument,this)])},$ON_MSG_APP_READY:function(){if(c.browser.msie){c(this.doc).unbind("keydown.ea").bind("keydown.ea",c.fnBind(function(a){if(this.doc.selection.type.toLowerCase()=="control"&&a.keyCode==8){this.oApp.exec("EXECCOMMAND",["delete",false,false]);a.preventDefault();a.stopPropagation()}},this));c(this.doc.body).unbind("mousedown.ea").bind("mousedown.ea",c.fnBind(function(){this._oIERange=null;this._bIERangeReset=true},
this));c(this.doc.body).unbind("mousedown.ea").bind("mousedown.ea",c.fnBind(function(){this._oIERange=null;this._bIERangeReset=true},this)).unbind("beforedeactivate.ea").bind("beforedeactivate.ea",c.fnBind(function(){if(!this._bIERangeReset){var a=this.getDocument().selection.createRange(0);this._oIERange=a.parentElement&&a.parentElement()&&a.parentElement().tagName=="INPUT"?this._oPrevIERange:a}},this)).unbind("mouseup.ea").bind("mouseup.ea",c.fnBind(function(){this._bIERangeReset=false},this))}}, this)).unbind("beforedeactivate.ea").bind("beforedeactivate.ea",c.fnBind(function(){if(!this._bIERangeReset){var a=this.getDocument().selection.createRange(0);this._oIERange=a.parentElement&&a.parentElement()&&a.parentElement().tagName=="INPUT"?this._oPrevIERange:a}},this)).unbind("mouseup.ea").bind("mouseup.ea",c.fnBind(function(){this._bIERangeReset=false},this))}},$ON_CHANGE_EDITING_MODE:function(a){if(a==this.sMode){this.iframe.style.display="block";this.oApp.exec("REFRESH_WYSIWYG",[]);this.oApp.exec("SET_EDITING_WINDOW",
$ON_CHANGE_EDITING_MODE:function(a){if(a==this.sMode){this.iframe.style.display="block";this.oApp.exec("REFRESH_WYSIWYG",[]);this.oApp.exec("SET_EDITING_WINDOW",[this.getWindow()])}else this.iframe.style.display="none"},$AFTER_CHANGE_EDITING_MODE:function(){this._oIERange=null},$ON_REFRESH_WYSIWYG:function(){if(c.browser.mozilla){this._disableWYSIWYG();this._enableWYSIWYG()}},$ON_ENABLE_WYSIWYG:function(){this._enableWYSIWYG()},$ON_DISABLE_WYSIWYG:function(){this._disableWYSIWYG()},$ON_EVENT_EDITING_AREA_KEYDOWN:function(a){if(a.ctrlKey){switch(a.keyCode){case 37:this.oApp.exec("EXECCOMMAND", [this.getWindow()])}else this.iframe.style.display="none"},$AFTER_CHANGE_EDITING_MODE:function(){this._oIERange=null},$ON_REFRESH_WYSIWYG:function(){if(c.browser.mozilla){this._disableWYSIWYG();this._enableWYSIWYG()}},$ON_ENABLE_WYSIWYG:function(){this._enableWYSIWYG()},$ON_DISABLE_WYSIWYG:function(){this._disableWYSIWYG()},$ON_EVENT_EDITING_AREA_KEYDOWN:function(a){if(a.ctrlKey){switch(a.keyCode){case 37:this.oApp.exec("EXECCOMMAND",["outdent",false,false]);break;case 39:this.oApp.exec("EXECCOMMAND",
["outdent",false,false]);break;case 39:this.oApp.exec("EXECCOMMAND",["indent",false,false]);break;case 49:case 50:case 51:case 52:case 53:case 54:this.oApp.exec("EXECCOMMAND",["FormatBlock",false,"<h"+(a.keyCode-48)+">"]);break;default:return}a.preventDefault();a.stopPropagation()}},$ON_EVENT_EDITING_AREA_KEYUP:function(a){a.keyCode==229||a.keyCode==13||a.altKey||a.ctrlKey||a.keyCode>=33&&a.keyCode<=40||a.keyCode==16||this._recordUndo(a)},$ON_PASTE_HTML:function(a,b){if(this.oApp.getEditingMode()== ["indent",false,false]);break;case 49:case 50:case 51:case 52:case 53:case 54:this.oApp.exec("EXECCOMMAND",["FormatBlock",false,"<h"+(a.keyCode-48)+">"]);break;default:return}a.preventDefault();a.stopPropagation()}},$ON_EVENT_EDITING_AREA_KEYUP:function(a){a.keyCode==229||a.keyCode==13||a.altKey||a.ctrlKey||a.keyCode>=33&&a.keyCode<=40||a.keyCode==16||this._recordUndo(a)},$ON_PASTE_HTML:function(a,b){if(this.oApp.getEditingMode()==this.sMode){var d=b||this.oApp.getSelection();d.pasteHTML(a);if(!c.browser.msie){var e=
this.sMode){var d=b||this.oApp.getSelection();d.pasteHTML(a);if(!c.browser.msie){var e=d.placeStringBookmark();this.oApp.getWYSIWYGDocument().body.innerHTML=this.oApp.getWYSIWYGDocument().body.innerHTML;d.moveToBookmark(e);d.collapseToEnd();d.select();d.removeStringBookmark(e)}this.oApp.exec("RECORD_UNDO_ACTION",["INSERT HTML"])}},$AFTER_MSG_EDITING_AREA_RESIZE_ENDED:function(){this.oApp.exec("REFRESH_WYSIWYG",[])},$ON_RESTORE_IE_SELECTION:function(){if(this._oIERange){this._oIERange.select();this._oPrevIERange= d.placeStringBookmark();this.oApp.getWYSIWYGDocument().body.innerHTML=this.oApp.getWYSIWYGDocument().body.innerHTML;d.moveToBookmark(e);d.collapseToEnd();d.select();d.removeStringBookmark(e)}this.oApp.exec("RECORD_UNDO_ACTION",["INSERT HTML"])}},$AFTER_MSG_EDITING_AREA_RESIZE_ENDED:function(){this.oApp.exec("REFRESH_WYSIWYG",[])},$ON_RESTORE_IE_SELECTION:function(){if(this._oIERange){this._oIERange.select();this._oPrevIERange=this._oIERange;this._oIERange=null}},initIframe:function(){try{this.doc=
this._oIERange;this._oIERange=null}},initIframe:function(){try{this.doc=this.iframe.contentWindow.document;if(this.doc==null||this.doc.location.href=="about:blank")throw Error("Access denied");this._enableWYSIWYG();this.status=xe.PLUGIN_STATUS.READY}catch(a){if(this._nIFrameReadyCount-- >0)setTimeout(c.fnBind(this.initIframe,this),100);else throw"iframe for WYSIWYG editing mode can't be initialized. Please check if the iframe document exists and is also accessable(cross-domain issues). ";}},getIR:function(){var a= this.iframe.contentWindow.document;if(this.doc==null||this.doc.location.href=="about:blank")throw Error("Access denied");this._enableWYSIWYG();this.status=xe.PLUGIN_STATUS.READY}catch(a){if(this._nIFrameReadyCount-- >0)setTimeout(c.fnBind(this.initIframe,this),100);else throw"iframe for WYSIWYG editing mode can't be initialized. Please check if the iframe document exists and is also accessable(cross-domain issues). ";}},getIR:function(){var a=this.doc.body.innerHTML;return this.oApp.applyConverter?
this.doc.body.innerHTML;return this.oApp.applyConverter?this.oApp.applyConverter(this.sMode+"_TO_IR",a):a},setIR:function(a){this.doc.body.innerHTML=this.oApp.applyConverter?this.oApp.applyConverter("IR_TO_"+this.sMode,a):a;if(c.browser.mozilla&&this.doc.body.innerHTML=="")this.doc.body.innerHTML="<br>"},getWindow:function(){return this.iframe.contentWindow},getDocument:function(){return this.iframe.contentWindow.document},focus:function(){},_recordUndo:function(a){if(!(new Date-this.iLastUndoRecorded< this.oApp.applyConverter(this.sMode+"_TO_IR",a):a},setIR:function(a){this.doc.body.innerHTML=this.oApp.applyConverter?this.oApp.applyConverter("IR_TO_"+this.sMode,a):a;if(c.browser.mozilla&&this.doc.body.innerHTML=="")this.doc.body.innerHTML="<br>"},getWindow:function(){return this.iframe.contentWindow},getDocument:function(){return this.iframe.contentWindow.document},focus:function(){},_recordUndo:function(a){if(!(new Date-this.iLastUndoRecorded<this.iMinUndoInterval)){this.oApp.exec("RECORD_UNDO_ACTION",
this.iMinUndoInterval)){this.oApp.exec("RECORD_UNDO_ACTION",["KEYPRESS"]);this.iLastUndoRecorded=new Date;this.prevKeyCode=a.keyCode}},_enableWYSIWYG:function(){if(c.browser.msie){this.doc.body.disabled=true;this.doc.body.contentEditable=true;this.doc.body.removeAttribute("disabled")}else this.doc.designMode="on"},_disableWYSIWYG:function(){c.browser.msie?this.doc.body.contentEditable=false:this.doc.designMode="off"}});xe.XE_EditingAreaVerticalResizer=c.Class({name:"XE_EditingAreaVerticalResizer", ["KEYPRESS"]);this.iLastUndoRecorded=new Date;this.prevKeyCode=a.keyCode}},_enableWYSIWYG:function(){if(c.browser.msie){this.doc.body.disabled=true;this.doc.body.contentEditable=true;this.doc.body.removeAttribute("disabled")}else this.doc.designMode="on"},_disableWYSIWYG:function(){c.browser.msie?this.doc.body.contentEditable=false:this.doc.designMode="off"}});xe.XE_EditingAreaVerticalResizer=c.Class({name:"XE_EditingAreaVerticalResizer",oResizeGrip:null,$init:function(a){this._assignHTMLObjects(a);
oResizeGrip:null,$init:function(a){this._assignHTMLObjects(a);this.$FnMouseDown=c.fnBind(this._mousedown,this);this.$FnMouseMove=c.fnBind(this._mousemove,this);this.$FnMouseUp=c.fnBind(this._mouseup,this);c(this.oResizeGrip).bind("mousedown",this.$FnMouseDown)},_assignHTMLObjects:function(a){a=c.$(a)||document;this.oResizeGrip=c(".xpress_xeditor_editingArea_verticalResizer",a).get(0)},_mousedown:function(a){this.iStartHeight=a.clientY;c(document).bind("mousemove",this.$FnMouseMove);c(document).bind("mouseup", this.$FnMouseDown=c.fnBind(this._mousedown,this);this.$FnMouseMove=c.fnBind(this._mousemove,this);this.$FnMouseUp=c.fnBind(this._mouseup,this);c(this.oResizeGrip).bind("mousedown",this.$FnMouseDown)},_assignHTMLObjects:function(a){a=c.$(a)||document;this.oResizeGrip=c(".xpress_xeditor_editingArea_verticalResizer",a).get(0)},_mousedown:function(a){this.iStartHeight=a.clientY;c(document).bind("mousemove",this.$FnMouseMove);c(document).bind("mouseup",this.$FnMouseUp);this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED",
this.$FnMouseUp);this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])},_mousemove:function(a){this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,a.clientY-this.iStartHeight])},_mouseup:function(){c(document).unbind("mousemove",this.$FnMouseMove);c(document).unbind("mouseup",this.$FnMouseUp);this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])}});xe.XE_ExecCommand=c.Class({name:"XE_ExecCommand",oEditingArea:null, [this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])},_mousemove:function(a){this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,a.clientY-this.iStartHeight])},_mouseup:function(){c(document).unbind("mousemove",this.$FnMouseMove);c(document).unbind("mouseup",this.$FnMouseUp);this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])}});xe.XE_ExecCommand=c.Class({name:"XE_ExecCommand",oEditingArea:null,$init:function(a){this.oEditingArea=a},$BEFORE_MSG_APP_READY:function(){if(this.oEditingArea&&
$init:function(a){this.oEditingArea=a},$BEFORE_MSG_APP_READY:function(){if(this.oEditingArea&&this.oEditingArea.tagName=="IFRAME")this.oEditingArea=this.oEditingArea.contentWindow.document},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_HOTKEY",["ctrl+b","EXECCOMMAND",["bold",false,false]]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+u","EXECCOMMAND",["underline",false,false]]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+i","EXECCOMMAND",["italic",false,false]]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+d", this.oEditingArea.tagName=="IFRAME")this.oEditingArea=this.oEditingArea.contentWindow.document},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_HOTKEY",["ctrl+b","EXECCOMMAND",["bold",false,false]]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+u","EXECCOMMAND",["underline",false,false]]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+i","EXECCOMMAND",["italic",false,false]]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+d","EXECCOMMAND",["strikethrough",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["bold",
"EXECCOMMAND",["strikethrough",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["bold","click","EXECCOMMAND",["bold",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["underline","click","EXECCOMMAND",["underline",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["italic","click","EXECCOMMAND",["italic",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["lineThrough","click","EXECCOMMAND",["strikethrough",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["superscript","click","EXECCOMMAND",["superscript", "click","EXECCOMMAND",["bold",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["underline","click","EXECCOMMAND",["underline",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["italic","click","EXECCOMMAND",["italic",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["lineThrough","click","EXECCOMMAND",["strikethrough",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["superscript","click","EXECCOMMAND",["superscript",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["subscript","click","EXECCOMMAND",
false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["subscript","click","EXECCOMMAND",["subscript",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["justifyleft","click","EXECCOMMAND",["justifyleft",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["justifycenter","click","EXECCOMMAND",["justifycenter",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["justifyright","click","EXECCOMMAND",["justifyright",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["justifyfull","click","EXECCOMMAND",["justifyfull", ["subscript",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["justifyleft","click","EXECCOMMAND",["justifyleft",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["justifycenter","click","EXECCOMMAND",["justifycenter",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["justifyright","click","EXECCOMMAND",["justifyright",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["justifyfull","click","EXECCOMMAND",["justifyfull",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["orderedlist","click","EXECCOMMAND",
false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["orderedlist","click","EXECCOMMAND",["insertorderedlist",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["unorderedlist","click","EXECCOMMAND",["insertunorderedlist",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["outdent","click","EXECCOMMAND",["outdent",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["indent","click","EXECCOMMAND",["indent",false,false]])},$BEFORE_EXECCOMMAND:function(a){this._bOnlyCursorChanged=false;this.oApp.exec("FOCUS", ["insertorderedlist",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["unorderedlist","click","EXECCOMMAND",["insertunorderedlist",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["outdent","click","EXECCOMMAND",["outdent",false,false]]);this.oApp.exec("REGISTER_UI_EVENT",["indent","click","EXECCOMMAND",["indent",false,false]])},$BEFORE_EXECCOMMAND:function(a){this._bOnlyCursorChanged=false;this.oApp.exec("FOCUS",[]);if(a.match(/^bold|underline|italic|strikethrough|superscript|subscript$/i)&&
[]);if(a.match(/^bold|underline|italic|strikethrough|superscript|subscript$/i)&&this.oApp.getSelection().collapsed)this._bOnlyCursorChanged=true;this._bOnlyCursorChanged||this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",[a])},$ON_EXECCOMMAND:function(a,b,d){this.oEditingArea.execCommand(a,b==""||b?b:false,d==""||d?d:false)},$AFTER_EXECCOMMAND:function(a){this._bOnlyCursorChanged||this.oApp.exec("RECORD_UNDO_AFTER_ACTION",[a]);this.oApp.exec("CHECK_STYLE_CHANGE",[])}});xe.XE_WYSIWYGEnterKey=c.Class({name:"XE_WYSIWYGEnterKey", this.oApp.getSelection().collapsed)this._bOnlyCursorChanged=true;this._bOnlyCursorChanged||this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",[a])},$ON_EXECCOMMAND:function(a,b,d){this.oEditingArea.execCommand(a,b==""||b?b:false,d==""||d?d:false)},$AFTER_EXECCOMMAND:function(a){this._bOnlyCursorChanged||this.oApp.exec("RECORD_UNDO_AFTER_ACTION",[a]);this.oApp.exec("CHECK_STYLE_CHANGE",[])}});xe.XE_WYSIWYGEnterKey=c.Class({name:"XE_WYSIWYGEnterKey",unsupportedBrowser:["ie","opera"],oEditingArea:null,$init:function(a){this.oEditingArea=
unsupportedBrowser:["ie","opera"],oEditingArea:null,$init:function(a){this.oEditingArea=a},$BEFORE_MSG_APP_READY:function(){if(this.oEditingArea&&this.oEditingArea.tagName=="IFRAME")this.oEditingArea=this.oEditingArea.contentWindow.document},$ON_EVENT_EDITING_AREA_KEYDOWN:function(a){if(!(this.oApp.getEditingMode()!="WYSIWYG"||a.shiftKey)&&a.keyCode==13){var b=this.oApp.getSelection(),d=b.placeStringBookmark(),c=b.getLineInfo(),f=c.oStart,c=c.oEnd;if(!f.bParentBreak||b.rxBlockContainer.test(f.oLineBreaker.tagName)){a.stopPropagation(); a},$BEFORE_MSG_APP_READY:function(){if(this.oEditingArea&&this.oEditingArea.tagName=="IFRAME")this.oEditingArea=this.oEditingArea.contentWindow.document},$ON_EVENT_EDITING_AREA_KEYDOWN:function(a){if(!(this.oApp.getEditingMode()!="WYSIWYG"||a.shiftKey)&&a.keyCode==13){var b=this.oApp.getSelection(),d=b.placeStringBookmark(),c=b.getLineInfo(),f=c.oStart,c=c.oEnd;if(!f.bParentBreak||b.rxBlockContainer.test(f.oLineBreaker.tagName)){a.stopPropagation();a.preventDefault();a=this.oEditingArea.createElement("P");
a.preventDefault();a=this.oEditingArea.createElement("P");b.moveToBookmark(d);b.setStartBefore(f.oNode);b.surroundContents(a);b.collapseToEnd();f=this.oEditingArea.createElement("P");b.setEndAfter(c.oNode);b.surroundContents(f);b.removeStringBookmark(d);if(a.innerHTML=="")a.innerHTML="<br>";if(f.innerHTML=="")f.innerHTML="<br>";f.nextSibling&&f.nextSibling.tagName=="BR"&&f.parentNode.removeChild(f.nextSibling);b.selectNodeContents(f);b.collapseToStart();b.select();this.oApp.exec("CHECK_STYLE_CHANGE", b.moveToBookmark(d);b.setStartBefore(f.oNode);b.surroundContents(a);b.collapseToEnd();f=this.oEditingArea.createElement("P");b.setEndAfter(c.oNode);b.surroundContents(f);b.removeStringBookmark(d);if(a.innerHTML=="")a.innerHTML="<br>";if(f.innerHTML=="")f.innerHTML="<br>";f.nextSibling&&f.nextSibling.tagName=="BR"&&f.parentNode.removeChild(f.nextSibling);b.selectNodeContents(f);b.collapseToStart();b.select();this.oApp.exec("CHECK_STYLE_CHANGE",[])}else b.removeStringBookmark(d)}}});xe.XE_WYSIWYGStyler=
[])}else b.removeStringBookmark(d)}}});xe.XE_WYSIWYGStyler=c.Class({name:"XE_WYSIWYGStyler",$PRECONDITION:function(){return this.oApp.getEditingMode()=="WYSIWYG"},$ON_SET_WYSIWYG_STYLE:function(a){var b=this.oApp.getSelection();if(b.collapsed){var d=this.oApp.getWYSIWYGDocument().createElement("SPAN");b.insertNode(d);d.innerHTML=unescape("%uFEFF");var e,f;for(f in a){e=a[f];typeof e=="string"&&(d.style[f]=e)}b.selectNodeContents(d);b.collapseToEnd();b._window.focus();b._window.document.body.focus(); c.Class({name:"XE_WYSIWYGStyler",$PRECONDITION:function(){return this.oApp.getEditingMode()=="WYSIWYG"},$ON_SET_WYSIWYG_STYLE:function(a){var b=this.oApp.getSelection();if(b.collapsed){var d=this.oApp.getWYSIWYGDocument().createElement("SPAN");b.insertNode(d);d.innerHTML=unescape("%uFEFF");var e,f;for(f in a){e=a[f];typeof e=="string"&&(d.style[f]=e)}b.selectNodeContents(d);b.collapseToEnd();b._window.focus();b._window.document.body.focus();b.select();if(c.browser.mozilla&&c.browser.nVersion==3)d.innerHTML=
b.select();if(c.browser.mozilla&&c.browser.nVersion==3)d.innerHTML=""}else{this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["FONT STYLE"]);b.styleRange(a);b._window.focus();b.select();this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["FONT STYLE"])}}});xe.XE_WYSIWYGStyleGetter=c.Class({name:"XE_WYSIWYGStyleGetter",hKeyUp:null,getStyleInterval:200,oStyleMap:{fontFamily:{type:"Value",css:"fontFamily"},fontSize:{type:"Value",css:"fontSize"},lineHeight:{type:"Value",css:"lineHeight",converter:function(a,b){return!a.match(/px$/)? ""}else{this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["FONT STYLE"]);b.styleRange(a);b._window.focus();b.select();this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["FONT STYLE"])}}});xe.XE_WYSIWYGStyleGetter=c.Class({name:"XE_WYSIWYGStyleGetter",hKeyUp:null,getStyleInterval:200,oStyleMap:{fontFamily:{type:"Value",css:"fontFamily"},fontSize:{type:"Value",css:"fontSize"},lineHeight:{type:"Value",css:"lineHeight",converter:function(a,b){return!a.match(/px$/)?a:Math.ceil(parseInt(a)/parseInt(b.fontSize)*10)/10}},
a:Math.ceil(parseInt(a)/parseInt(b.fontSize)*10)/10}},bold:{command:"bold"},underline:{command:"underline"},italic:{command:"italic"},lineThrough:{command:"strikethrough"},superscript:{command:"superscript"},subscript:{command:"subscript"},justifyleft:{command:"justifyleft"},justifycenter:{command:"justifycenter"},justifyright:{command:"justifyright"},justifyfull:{command:"justifyfull"},orderedlist:{command:"insertorderedlist"},unorderedlist:{command:"insertunorderedlist"}},$init:function(){this.oStyle= bold:{command:"bold"},underline:{command:"underline"},italic:{command:"italic"},lineThrough:{command:"strikethrough"},superscript:{command:"superscript"},subscript:{command:"subscript"},justifyleft:{command:"justifyleft"},justifycenter:{command:"justifycenter"},justifyright:{command:"justifyright"},justifyfull:{command:"justifyfull"},orderedlist:{command:"insertorderedlist"},unorderedlist:{command:"insertunorderedlist"}},$init:function(){this.oStyle=this._getBlankStyle()},$PRECONDITION:function(){return this.oApp.getEditingMode()!=
this._getBlankStyle()},$PRECONDITION:function(){return this.oApp.getEditingMode()!="WYSIWYG"?false:true},$ON_MSG_APP_READY:function(){this.oDocument=this.oApp.getWYSIWYGDocument();this.oApp.exec("ADD_APP_PROPERTY",["getCurrentStyle",c.fnBind(this.getCurrentStyle,this)])},$ON_EVENT_EDITING_AREA_MOUSEUP:function(){this.hKeyUp&&clearTimeout(this.hKeyUp);this.oApp.exec("CHECK_STYLE_CHANGE",[])},$ON_EVENT_EDITING_AREA_KEYUP:function(a){if(a.keyCode==8||a.keyCode>=33&&a.keyCode<=40||a.keyCode==45||a.keyCode== "WYSIWYG"?false:true},$ON_MSG_APP_READY:function(){this.oDocument=this.oApp.getWYSIWYGDocument();this.oApp.exec("ADD_APP_PROPERTY",["getCurrentStyle",c.fnBind(this.getCurrentStyle,this)])},$ON_EVENT_EDITING_AREA_MOUSEUP:function(){this.hKeyUp&&clearTimeout(this.hKeyUp);this.oApp.exec("CHECK_STYLE_CHANGE",[])},$ON_EVENT_EDITING_AREA_KEYUP:function(a){if(a.keyCode==8||a.keyCode>=33&&a.keyCode<=40||a.keyCode==45||a.keyCode==46){this.hKeyUp&&clearTimeout(this.hKeyUp);this.hKeyUp=setTimeout(c.fnBind(this.oApp.exec,
46){this.hKeyUp&&clearTimeout(this.hKeyUp);this.hKeyUp=setTimeout(c.fnBind(this.oApp.exec,this.oApp,"CHECK_STYLE_CHANGE",[]),this.getStyleInterval)}},$ON_CHECK_STYLE_CHANGE:function(){this._getStyle()},$ON_RESET_STYLE_STATUS:function(){var a=this._getBlankStyle(),b;for(b in a)this.oApp.exec("SET_STYLE_STATUS",[b,a[b]])},getCurrentStyle:function(){return this.oStyle},_check_style_change:function(){this.oApp.exec("CHECK_STYLE_CHANGE",[])},_getBlankStyle:function(){var a={},b;for(b in this.oStyleMap)a[b]= this.oApp,"CHECK_STYLE_CHANGE",[]),this.getStyleInterval)}},$ON_CHECK_STYLE_CHANGE:function(){this._getStyle()},$ON_RESET_STYLE_STATUS:function(){var a=this._getBlankStyle(),b;for(b in a)this.oApp.exec("SET_STYLE_STATUS",[b,a[b]])},getCurrentStyle:function(){return this.oStyle},_check_style_change:function(){this.oApp.exec("CHECK_STYLE_CHANGE",[])},_getBlankStyle:function(){var a={},b;for(b in this.oStyleMap)a[b]=this.oStyleMap[b].type=="Value"?"":0;return a},_getStyle:function(){var a=this.oApp.getSelection(),
this.oStyleMap[b].type=="Value"?"":0;return a},_getStyle:function(){var a=this.oApp.getSelection(),b=a.getNodes(false,function(a){return!a.childNodes||a.childNodes.length==0?true:false}),d,a=b.length==0?this._getStyleOf(a.commonAncestorContainer):this._getStyleOf(b[0]);for(d in a){this.oStyleMap[d].converter&&(a[d]=this.oStyleMap[d].converter(a[d],a));this.oStyle[d]!=a[d]&&this.oApp.exec("MSG_STYLE_CHANGED",[d,a[d]])}this.oStyle=a},_getStyleOf:function(a){var b=this._getBlankStyle();if(!a)return b; b=a.getNodes(false,function(a){return!a.childNodes||a.childNodes.length==0?true:false}),d,a=b.length==0?this._getStyleOf(a.commonAncestorContainer):this._getStyleOf(b[0]);for(d in a){this.oStyleMap[d].converter&&(a[d]=this.oStyleMap[d].converter(a[d],a));this.oStyle[d]!=a[d]&&this.oApp.exec("MSG_STYLE_CHANGED",[d,a[d]])}this.oStyle=a},_getStyleOf:function(a){var b=this._getBlankStyle();if(!a)return b;if(a.nodeType==3)a=a.parentNode;var a=c(a),d,e;for(e in this.oStyle){d=this.oStyleMap[e];if(d.type&&
if(a.nodeType==3)a=a.parentNode;var a=c(a),d,e;for(e in this.oStyle){d=this.oStyleMap[e];if(d.type&&d.type=="Value")if(d.css){d=a.css(d.css);e=="fontFamily"&&(d=d.split(/,/)[0]);b[e]=d}else{if(d.command)try{b[e]=this.oDocument.queryCommandState(d.command)}catch(f){}}else if(d.command)try{b[e]=this.oDocument.queryCommandState(d.command)?1:0}catch(g){}}return b}});xe.XE_FontSizeWithSelectUI=c.Class({name:"XE_FontSizeWithSelectUI",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){this.elFontSizeSelect= d.type=="Value")if(d.css){d=a.css(d.css);e=="fontFamily"&&(d=d.split(/,/)[0]);b[e]=d}else{if(d.command)try{b[e]=this.oDocument.queryCommandState(d.command)}catch(f){}}else if(d.command)try{b[e]=this.oDocument.queryCommandState(d.command)?1:0}catch(g){}}return b}});xe.XE_FontSizeWithSelectUI=c.Class({name:"XE_FontSizeWithSelectUI",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){this.elFontSizeSelect=c("SELECT.xpress_xeditor_ui_fontSize_select",a).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFontSizeSelect,
c("SELECT.xpress_xeditor_ui_fontSize_select",a).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFontSizeSelect,"change","SET_FONTSIZE_FROM_SELECT_UI");this.elFontSizeSelect.selectedIndex=0},$ON_MSG_STYLE_CHANGED:function(a,b){if(a=="fontSize"){this.elFontSizeSelect.value=b;if(this.elFontSizeSelect.selectedIndex<0)this.elFontSizeSelect.selectedIndex=0}},$ON_SET_FONTSIZE_FROM_SELECT_UI:function(){var a=this.elFontSizeSelect.value;if(a){this.oApp.exec("SET_WYSIWYG_STYLE",[{fontSize:a}]); "change","SET_FONTSIZE_FROM_SELECT_UI");this.elFontSizeSelect.selectedIndex=0},$ON_MSG_STYLE_CHANGED:function(a,b){if(a=="fontSize"){this.elFontSizeSelect.value=b;if(this.elFontSizeSelect.selectedIndex<0)this.elFontSizeSelect.selectedIndex=0}},$ON_SET_FONTSIZE_FROM_SELECT_UI:function(){var a=this.elFontSizeSelect.value;if(a){this.oApp.exec("SET_WYSIWYG_STYLE",[{fontSize:a}]);this.oApp.exec("CHECK_STYLE_CHANGE",[])}}});xe.XE_FontNameWithSelectUI=c.Class({name:"XE_FontNameWithSelectUI",$init:function(a){this._assignHTMLObjects(a)},
this.oApp.exec("CHECK_STYLE_CHANGE",[])}}});xe.XE_FontNameWithSelectUI=c.Class({name:"XE_FontNameWithSelectUI",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){this.elFontNameSelect=c("SELECT.xpress_xeditor_ui_fontName_select",a).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFontNameSelect,"change","SET_FONTNAME_FROM_SELECT_UI");this.elFontNameSelect.selectedIndex=0},$ON_MSG_STYLE_CHANGED:function(a,b){if(a=="fontFamily"){this.elFontNameSelect.value= _assignHTMLObjects:function(a){this.elFontNameSelect=c("SELECT.xpress_xeditor_ui_fontName_select",a).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFontNameSelect,"change","SET_FONTNAME_FROM_SELECT_UI");this.elFontNameSelect.selectedIndex=0},$ON_MSG_STYLE_CHANGED:function(a,b){if(a=="fontFamily"){this.elFontNameSelect.value=b.toLowerCase();if(this.elFontNameSelect.selectedIndex<0)this.elFontNameSelect.selectedIndex=0}},$ON_SET_FONTNAME_FROM_SELECT_UI:function(){var a=this.elFontNameSelect.value;
b.toLowerCase();if(this.elFontNameSelect.selectedIndex<0)this.elFontNameSelect.selectedIndex=0}},$ON_SET_FONTNAME_FROM_SELECT_UI:function(){var a=this.elFontNameSelect.value;if(a){this.oApp.exec("SET_WYSIWYG_STYLE",[{fontFamily:a}]);this.oApp.exec("CHECK_STYLE_CHANGE",[])}}});xe.XE_LineHeight=c.Class({name:"XE_LineHeight",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(){},$ON_SET_LINEHEIGHT:function(a){this.setLineHeight(a)},getLineHeight:function(){var a=this._getSelectedNodes(false), if(a){this.oApp.exec("SET_WYSIWYG_STYLE",[{fontFamily:a}]);this.oApp.exec("CHECK_STYLE_CHANGE",[])}}});xe.XE_LineHeight=c.Class({name:"XE_LineHeight",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(){},$ON_SET_LINEHEIGHT:function(a){this.setLineHeight(a)},getLineHeight:function(){var a=this._getSelectedNodes(false),b,d,e;if(a.length==0)return-1;var f=a.length;if(f==0)e=-1;else{d=this._getLineWrapper(a[0]);e=this._getWrapperLineheight(d)}var g=this.oSelection.getStartNode();
b,d,e;if(a.length==0)return-1;var f=a.length;if(f==0)e=-1;else{d=this._getLineWrapper(a[0]);e=this._getWrapperLineheight(d)}var g=this.oSelection.getStartNode();if(e>0)for(var h=1;h<f;h++)if(!this._isChildOf(a[h],b)&&a[h]){b=this._getLineWrapper(a[h]);if(b!=d){curHeight=this._getWrapperLineheight(b);if(curHeight!=e){e=-1;break}d=b}}b=this._getLineWrapper(a[f-1]);a=this.oSelection.getEndNode();selectText=c.fnBind(function(a,b){this.oSelection.setEndNodes(a,b);this.oSelection.select()},this,g,a);setTimeout(selectText, if(e>0)for(var h=1;h<f;h++)if(!this._isChildOf(a[h],b)&&a[h]){b=this._getLineWrapper(a[h]);if(b!=d){curHeight=this._getWrapperLineheight(b);if(curHeight!=e){e=-1;break}d=b}}b=this._getLineWrapper(a[f-1]);a=this.oSelection.getEndNode();selectText=c.fnBind(function(a,b){this.oSelection.setEndNodes(a,b);this.oSelection.select()},this,g,a);setTimeout(selectText,100);return e},setLineHeight:function(a){function b(a,b){if(!a)try{a=thisRef.oSelection.surroundContentsWithNewNode("P")}catch(d){a=thisRef.oSelection.surroundContentsWithNewNode("DIV")}a.style.lineHeight=
100);return e},setLineHeight:function(a){function b(a,b){if(!a)try{a=thisRef.oSelection.surroundContentsWithNewNode("P")}catch(d){a=thisRef.oSelection.surroundContentsWithNewNode("DIV")}a.style.lineHeight=b;return a}function d(a){for(;a&&a.tagName!="BODY";)a=xe.DOMFix.parentNode(a);return!a?false:true}thisRef=this;var e=this._getSelectedNodes(false);if(e.length!=0){var f,g,h=e.length;this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["LINEHEIGHT"]);g=this._getLineWrapper(e[0]);for(var k=g=b(g,a),j=1;j<h;j++){try{if(!d(xe.DOMFix.parentNode(e[j])))continue}catch(n){continue}if(!this._isChildOf(e[j], b;return a}function d(a){for(;a&&a.tagName!="BODY";)a=xe.DOMFix.parentNode(a);return!a?false:true}thisRef=this;var e=this._getSelectedNodes(false);if(e.length!=0){var f,g,h=e.length;this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["LINEHEIGHT"]);g=this._getLineWrapper(e[0]);for(var k=g=b(g,a),j=1;j<h;j++){try{if(!d(xe.DOMFix.parentNode(e[j])))continue}catch(n){continue}if(!this._isChildOf(e[j],f)){f=this._getLineWrapper(e[j]);if(f!=g)g=f=b(f,a)}}setTimeout(c.fnBind(function(a,b){this.oSelection.setEndNodes(a,
f)){f=this._getLineWrapper(e[j]);if(f!=g)g=f=b(f,a)}}setTimeout(c.fnBind(function(a,b){this.oSelection.setEndNodes(a,b);this.oSelection.select();this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["LINEHEIGHT"])},this,k,f||k),100)}},_getSelectedNodes:function(a){if(!a)this.oSelection=this.oApp.getSelection();this.oSelection.collapsed&&this.oSelection.selectNode(this.oSelection.commonAncestorContainer);a=this.oSelection.getTextNodes();if(a.length==0){var b=this.oSelection.getStartNode();b?a[0]=b:a=[]}return a}, b);this.oSelection.select();this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["LINEHEIGHT"])},this,k,f||k),100)}},_getSelectedNodes:function(a){if(!a)this.oSelection=this.oApp.getSelection();this.oSelection.collapsed&&this.oSelection.selectNode(this.oSelection.commonAncestorContainer);a=this.oSelection.getTextNodes();if(a.length==0){var b=this.oSelection.getStartNode();b?a[0]=b:a=[]}return a},_getWrapperLineheight:function(a){var b="";if(a&&a.style.lineHeight)b=a.style.lineHeight;else for(a=this.oSelection.commonAncesterContainer;a&&
_getWrapperLineheight:function(a){var b="";if(a&&a.style.lineHeight)b=a.style.lineHeight;else for(a=this.oSelection.commonAncesterContainer;a&&!this.oSelection.rxLineBreaker.test(a.tagName);){if(a&&a.style.lineHeight){b=a.style.lineHeight;break}a=xe.DOMFix.parentNode(a)}return b},_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, !this.oSelection.rxLineBreaker.test(a.tagName);){if(a&&a.style.lineHeight){b=a.style.lineHeight;break}a=xe.DOMFix.parentNode(a)}return b},_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,f,b=null,a=d.oNode;f=d.oLineBreaker;d=c.oNode;c=c.oLineBreaker;this.oSelection.setEndNodes(a,d);f==c&&(f.tagName=="P"||f.tagName==
c=a.oEnd,f,b=null,a=d.oNode;f=d.oLineBreaker;d=c.oNode;c=c.oLineBreaker;this.oSelection.setEndNodes(a,d);f==c&&(f.tagName=="P"||f.tagName=="DIV"?b=f:this.oSelection.setEndNodes(f.firstChild,f.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"); "DIV"?b=f:this.oSelection.setEndNodes(f.firstChild,f.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=
this.elLineHeightSelect.selectedIndex=0},$ON_MSG_STYLE_CHANGED:function(a,b){if(a=="lineHeight"){this.elLineHeightSelect.value=b;if(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, b;if(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=
$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= 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=
"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, 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=
$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){if(this.rxColorPattern.test(a)){this.oApp.exec("SET_WYSIWYG_STYLE", 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){if(this.rxColorPattern.test(a)){this.oApp.exec("SET_WYSIWYG_STYLE",[{color:a}]);this.oApp.exec("HIDE_ACTIVE_LAYER")}else alert(this.oApp.$MSG("XE_FontColor.invalidColorCode"))}});
[{color:a}]);this.oApp.exec("HIDE_ACTIVE_LAYER")}else 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, 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",
"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 d={backgroundColor:a};if(b)d.color=b;this.oApp.exec("SET_WYSIWYG_STYLE", [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 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"))}});
[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", 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])},
[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 d=this.oApp.getSelection(), $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 d=this.oApp.getSelection(),c=d.getLineInfo(),
c=d.getLineInfo(),f=c.oStart,c=c.oEnd,g=/BODY|TD|LI/i,f=f.bParentBreak&&!g.test(f.oLineBreaker.tagName)?f.oNode.parentNode:f.oNode,c=c.bParentBreak&&!g.test(c.oLineBreaker.tagName)?c.oNode.parentNode:c.oNode;d.setStartBefore(f);d.setEndAfter(c);if(g=this._expandToTableStart(d,c)){c=g;d.setEndAfter(g)}if(g=this._expandToTableStart(d,f)){f=g;d.setStartBefore(g)}g=f;for(f=d.commonAncestorContainer;g&&g!=f&&g.parentNode!=f;)g=g.parentNode;oFormattingNode=d._document.createElement(a);if(b)oFormattingNode.className= f=c.oStart,c=c.oEnd,g=/BODY|TD|LI/i,f=f.bParentBreak&&!g.test(f.oLineBreaker.tagName)?f.oNode.parentNode:f.oNode,c=c.bParentBreak&&!g.test(c.oLineBreaker.tagName)?c.oNode.parentNode:c.oNode;d.setStartBefore(f);d.setEndAfter(c);if(g=this._expandToTableStart(d,c)){c=g;d.setEndAfter(g)}if(g=this._expandToTableStart(d,f)){f=g;d.setStartBefore(g)}g=f;for(f=d.commonAncestorContainer;g&&g!=f&&g.parentNode!=f;)g=g.parentNode;oFormattingNode=d._document.createElement(a);if(b)oFormattingNode.className=b;g==
b;g==f?f.insertBefore(oFormattingNode,f.firstChild):f.insertBefore(oFormattingNode,g);d.setStartAfter(oFormattingNode);d.setEndAfter(c);d.surroundContents(oFormattingNode);f=oFormattingNode.childNodes;for(g=f.length-1;g>=0;g--)if(f[g].nodeType==3||f[g].tagName=="BR"){for(var h=d._document.createElement("P"),c=f[g].nextSibling;g>=0&&f[g]&&(f[g].nodeType==3||f[g].tagName=="BR");)h.insertBefore(f[g--],h.firstChild);oFormattingNode.insertBefore(h,c);g++}if(oFormattingNode&&oFormattingNode.parentNode){h= f?f.insertBefore(oFormattingNode,f.firstChild):f.insertBefore(oFormattingNode,g);d.setStartAfter(oFormattingNode);d.setEndAfter(c);d.surroundContents(oFormattingNode);f=oFormattingNode.childNodes;for(g=f.length-1;g>=0;g--)if(f[g].nodeType==3||f[g].tagName=="BR"){for(var h=d._document.createElement("P"),c=f[g].nextSibling;g>=0&&f[g]&&(f[g].nodeType==3||f[g].tagName=="BR");)h.insertBefore(f[g--],h.firstChild);oFormattingNode.insertBefore(h,c);g++}if(oFormattingNode&&oFormattingNode.parentNode){h=d._document.createElement("P");
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,e=null,f=false;b&&!f;){b==c&&(f=true);if(/TBODY|TFOOT|THEAD|TR/i.test(b.tagName)){e=this._getTableRoot(b);break}b=b.parentNode}return e},_getTableRoot:function(a){for(;a&&a.tagName!="TABLE";)a=a.parentNode;return a}});xe.XE_SCharacter= 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,e=null,f=false;b&&!f;){b==c&&(f=true);if(/TBODY|TFOOT|THEAD|TR/i.test(b.tagName)){e=this._getTableRoot(b);break}b=b.parentNode}return e},_getTableRoot:function(a){for(;a&&a.tagName!="TABLE";)a=a.parentNode;return a}});xe.XE_SCharacter=c.Class({name:"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, $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, 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,
function(a){return"%u"+a}).split(" ");this.charSet[2]=unescape("3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 326A 326B 326C 326D 326E 326F 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 327A 327B 24D0 24D1 24D2 24D3 24D4 24D5 24D6 24D7 24D8 24D9 24DA 24DB 24DC 24DD 24DE 24DF 24E0 24E1 24E2 24E3 24E4 24E5 24E6 24E7 24E8 24E9 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 246A 246B 246C 246D 246E 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 320A 320B 320C 320D 320E 320F 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 321A 321B 249C 249D 249E 249F 24A0 24A1 24A2 24A3 24A4 24A5 24A6 24A7 24A8 24A9 24AA 24AB 24AC 24AD 24AE 24AF 24B0 24B1 24B2 24B3 24B4 24B5 2474 2475 2476 2477 2478 2479 247A 247B 247C 247D 247E 247F 2480 2481 2482").replace(/(\S{4})/g, function(a){return"%u"+a}).split(" ");this.charSet[2]=unescape("3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 326A 326B 326C 326D 326E 326F 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 327A 327B 24D0 24D1 24D2 24D3 24D4 24D5 24D6 24D7 24D8 24D9 24DA 24DB 24DC 24DD 24DE 24DF 24E0 24E1 24E2 24E3 24E4 24E5 24E6 24E7 24E8 24E9 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 246A 246B 246C 246D 246E 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 320A 320B 320C 320D 320E 320F 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 321A 321B 249C 249D 249E 249F 24A0 24A1 24A2 24A3 24A4 24A5 24A6 24A7 24A8 24A9 24AA 24AB 24AC 24AD 24AE 24AF 24B0 24B1 24B2 24B3 24B4 24B5 2474 2475 2476 2477 2478 2479 247A 247B 247C 247D 247E 247F 2480 2481 2482").replace(/(\S{4})/g,
function(a){return"%u"+a}).split(" ");this.charSet[3]=unescape("3131 3132 3133 3134 3135 3136 3137 3138 3139 313A 313B 313C 313D 313E 313F 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 314A 314B 314C 314D 314E 314F 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 315A 315B 315C 315D 315E 315F 3160 3161 3162 3163 3165 3166 3167 3168 3169 316A 316B 316C 316D 316E 316F 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 317A 317B 317C 317D 317E 317F 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 318A 318B 318C 318D 318E").replace(/(\S{4})/g, function(a){return"%u"+a}).split(" ");this.charSet[3]=unescape("3131 3132 3133 3134 3135 3136 3137 3138 3139 313A 313B 313C 313D 313E 313F 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 314A 314B 314C 314D 314E 314F 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 315A 315B 315C 315D 315E 315F 3160 3161 3162 3163 3165 3166 3167 3168 3169 316A 316B 316C 316D 316E 316F 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 317A 317B 317C 317D 317E 317F 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 318A 318B 318C 318D 318E").replace(/(\S{4})/g,