<?xml version="1.0" encoding="UTF-8"?><d:tdl xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://www.backbase.com/2006/btl" xmlns:d="http://www.backbase.com/2006/tdl"><d:namespace name="http://www.backbase.com/2006/btl"><d:uses behavior="btlBehavior" src="../btl.xml"/><d:uses element="dimensionElement" src="../visualElement/visualElement.xml"/><d:uses element="formField" src="../formField/formField.xml"/><d:uses element="focusableElement" src="../focus/focus.xml"/><d:element name="stateHolder" abstract="true"><d:property name="state"><d:setter type="text/javascript"/></d:property><d:method name="changeState"><d:argument name="stateName" type="string"/><d:body type="text/javascript"><![CDATA[this._._state&&bb.removeBehavior(this,btl.namespaceURI,this._._state);stateName&&bb.addBehavior(this,btl.namespaceURI,stateName);this._._state=stateName;]]></d:body></d:method></d:element><d:behavior name="richTextEditorReady" extends="b:btlBehavior"><d:property name="value"><d:getter type="text/javascript"><![CDATA[return btl.richTextEditor.serializeElementContent(this.getProperty('contentDocument').body);]]></d:getter><d:setter type="text/javascript"><![CDATA[if(bb.browser.ie){this.renderDocument(value);}else{this.getProperty('contentDocument').body.innerHTML=value;}]]></d:setter></d:property><d:property name="contentWindow" onget="return this.getProperty('contentFrame').contentWindow;"/><d:property name="contentDocument" onget="return this.getProperty('contentWindow').document;"/><d:method name="renderDocument"><d:argument name="content" type="string"/><d:body type="text/javascript"><![CDATA[var oDocument=this.getProperty('contentDocument');oDocument.open('text/html','replace');oDocument.write(this.getProperty('documentTemplate').compile({content:content}));oDocument.close();bb.controller.detachDocument(this,oDocument);bb.controller.attachDocument(this,oDocument);]]></d:body></d:method><d:handler event="keydown" type="text/javascript"><![CDATA[if(bb.browser.gecko){if(event.ctrlKey){if(event.keyIdentifier=='U+0042'){btl.richTextEditor.execCommand(this,'bold');}else{if(event.keyIdentifier=='U+0049'){btl.richTextEditor.execCommand(this,'italic');}else{if(event.keyIdentifier=='U+0055'){btl.richTextEditor.execCommand(this,'underline');}else{return false;}}}event.preventDefault();event.stopPropagation();}}]]></d:handler><d:handler event="focus" type="text/javascript"><![CDATA[var oSelectedRange=this._._selectedRange;if(oSelectedRange){oSelectedRange.select();}bb.browser.ie&&this.startCommandStateListening();]]></d:handler><d:handler event="blur" type="text/javascript"><![CDATA[if(bb.browser.ie){this._._selectedRange=this.getProperty('contentDocument').selection.createRange();}bb.browser.ie&&this.pauseCommandStateListening();]]></d:handler></d:behavior><d:element name="richTextEditor" extends="b:dimensionElement b:formField b:stateHolder b:focusableElement"><d:resource type="text/javascript"><![CDATA[btl.richTextEditor=(function(){var oHTMLSerializer={escapeChars:{'"':'&quot;','<':'&lt;','>':'&gt;','&':'&amp;'},textNodeEscapeChars:['&','<','>'],attrNodeEscapeChars:['&','<','>','"'],escapeHtml:function(sString,aChars){aChars||(aChars=this.textNodeEscapeChars);var oEscapeChars=this.escapeChars,sChar='',sEscapeSeq='';for(var iChar=0;iChar<aChars.length;++iChar){sChar=aChars[iChar];sEscapeSeq=oEscapeChars[sChar];if(sEscapeSeq){sString=sString.replace(sChar,sEscapeSeq);}}return sString;},singleTags:['area','base','basefont','br','col','frame','hr','img','input','isindex','link','meta','param'],serializers:{1:function(oElement){var sLocalName=(oElement.localName||oElement.tagName).toLowerCase(),aOpeningTagContent=[sLocalName],sAttribute='',aAttributes=oElement.attributes;function fAttributeSerializer(oAttribute){var sName=oAttribute.name,sValue=oElement.getAttribute(sName,2)||oAttribute.value;return oAttribute.specified?(sName+'="'+oHTMLSerializer.escapeHtml(sValue,oHTMLSerializer.attrNodeEscapeChars)+'"'):'';}for(var iAttribute=0;iAttribute<aAttributes.length;++iAttribute){sAttribute=fAttributeSerializer(aAttributes[iAttribute]);sAttribute&&aOpeningTagContent.push(sAttribute);}var sElementContent=oHTMLSerializer.serializeElementContent(oElement),aSingleTags=oHTMLSerializer.singleTags,bSingle=bb.array.indexOf(aSingleTags,sLocalName)!=-1;return '<'+aOpeningTagContent.join(' ')+'>'+(bSingle&&!sElementContent?'':(sElementContent+'</'+sLocalName+'>'));},3:function(oText){return oHTMLSerializer.escapeHtml(oText.nodeValue);},8:function(oComment){return '<!--'+oComment.nodeValue+'-->';},empty:function(){return '';}},serializeNode:function(oNode){return (this.serializers[oNode.nodeType]||this.serializers['empty'])(oNode);},serializeElementContent:function(oElement){var aChildren=oElement.childNodes,aSerializedElements=[];for(var iChild=0;iChild<aChildren.length;++iChild){aSerializedElements.push(this.serializeNode(aChildren[iChild]));}return aSerializedElements.join('');}};var fTemplate=function(sTemplate){var oVarRegExp=/\{\$([\w\d]+)\}/,aVar=null,sVarName='',sVarDirective='',iPosition=0;var aSubstrings=this._substrings=[];var oVarPositions=this._variablePositions={};while(aVar=sTemplate.match(oVarRegExp)){sVarDirective=aVar[0];sVarName=aVar[1];iPosition=sTemplate.indexOf(sVarDirective);aSubstrings.push(sTemplate.slice(0,iPosition));aSubstrings.push('');oVarPositions[sVarName]=aSubstrings.length-1;sTemplate=sTemplate.slice(iPosition+sVarDirective.length);}if(sTemplate.length){aSubstrings.push(sTemplate);}};fTemplate.prototype.compile=function(oValues){var sVarValue='',iVarPosition=0,oVarPositions=this._variablePositions;aSubstrings=this._substrings;for(var sVarName in oValues){sVarValue=oValues[sVarName];iVarPosition=oVarPositions[sVarName];if(typeof iVarPosition=='number'){aSubstrings[iVarPosition]=sVarValue;}}return aSubstrings.join('');};var oEditorUtility={Template:fTemplate,serializeElementContent:function(oElement){return oHTMLSerializer.serializeElementContent(oElement);},registerCommandButton:function(oController,oButton){if(!oController._.registeredButtons){oController._.registeredButtons=[];}oController._.registeredButtons.push(oButton);var sCommand=oButton.getAttribute('richTextCommand');bb.html.disableUserSelect(oButton.viewNode);oButton.setAttribute('icon','btl-richTextEditor-'+sCommand);oButton.viewGate.innerHTML='&nbsp;';},execCommand:function(oController,sCommand,sOption){try{var oContentWindow=bb.getProperty(oController,'contentWindow');var oContentDocument=bb.getProperty(oController,'contentDocument');oContentWindow.focus();oContentDocument.execCommand(sCommand,false,sOption);}catch(oException){setTimeout(function(){btl.richTextEditor.execCommand(oController,sCommand,sOption);},100);}}};return oEditorUtility;})();]]></d:resource><d:resource type="text/css"><![CDATA[.btl-richTextEditor-contentFrame-container{border-left:1px solid #ACB0BC;border-top:1px solid #D9D9D9;border-right:1px solid #8C909C;border-bottom:1px solid #8C909C;}.btl-richTextEditor-contentFrame{width:100%;margin:0px;padding:0px;display:block;}.btl-richTextEditor-toolBar-container{visibility:hidden;}.btl-richTextEditor-ready .btl-richTextEditor-toolBar-container{visibility:visible;}.btl-richTextEditor-border{border-style:solid;border-width:1px;border-color:ThreeDShadow ThreeDHighLight ThreeDHighLight ThreeDShadow;}.btl-richTextEditor-img{width:25px;height:24px;}.btl-richTextEditor-bold{background-image:url(media/bold.png) !important;}.btl-richTextEditor-italic{background-image:url(media/italic.png) !important;}.btl-richTextEditor-underline{background-image:url(media/underline.png) !important;}.btl-richTextEditor-justifyleft{background-image:url(media/justifyleft.png) !important;}.btl-richTextEditor-justifycenter{background-image:url(media/justifycenter.png) !important;}.btl-richTextEditor-justifyright{background-image:url(media/justifyright.png) !important;}.btl-richTextEditor-justifyfull{background-image:url(media/justifyfull.png) !important;}.btl-richTextEditor-insertorderedlist{background-image:url(media/insertorderedlist.png) !important;}.btl-richTextEditor-insertunorderedlist{background-image:url(media/insertunorderedlist.png) !important;}.btl-richTextEditor-outdent{background-image:url(media/outdent.png) !important;}.btl-richTextEditor-indent{background-image:url(media/indent.png) !important;}]]></d:resource><d:resource name="defaultDocument" type="text/plain"><![CDATA[
				<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
				<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
					<head>
						<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
						<style type="text/css">
							body {
								background: #FFF;
								margin: 1em;
								padding: 0;
								font-family: Verdana;
							}
						</style>
					</head>
					<body>{$content}</body>
				</html>
			]]></d:resource><d:resource name="defaultToolBar" type="application/xml"><b:toolBar><b:toolBarSwitch richTextCommand="bold"/><b:toolBarSwitch richTextCommand="italic"/><b:toolBarSwitch richTextCommand="underline"/><b:toolBarSeparator/><b:toolBarSwitch richTextCommand="justifyleft"/><b:toolBarSwitch richTextCommand="justifycenter"/><b:toolBarSwitch richTextCommand="justifyright"/><b:toolBarSwitch richTextCommand="justifyfull"/><b:toolBarSeparator/><b:toolBarButton richTextCommand="insertorderedlist"/><b:toolBarButton richTextCommand="insertunorderedlist"/><b:toolBarButton richTextCommand="outdent"/><b:toolBarButton richTextCommand="indent"/></b:toolBar></d:resource><d:template type="application/xhtml+xml"><div class="btl-richTextEditor btl-richTextEditor-border btl-chameleon-highlightBorder"><div class="btl-richTextEditor-toolBar-container"><d:content/></div><input type="hidden"/><div class="btl-richTextEditor-contentFrame-container"><iframe class="btl-richTextEditor-contentFrame" src="about:blank" frameborder="0"/></div></div></d:template><d:attribute name="name" onmap="this.viewNode.getElementsByTagName('input')[0].name = value"/><d:attribute name="height" default="200px"/><d:property name="height"><d:setter type="text/javascript"><![CDATA[this.viewNode.style.height=value;this._._height=value;btl.updateHasDimensionsClass(this);bb.ui.reflow(this);]]></d:setter></d:property><d:property name="contentFrame"><d:setter type="text/javascript"/><d:getter type="text/javascript"><![CDATA[return this._._contentFrame||(this._._contentFrame=this.viewNode.getElementsByTagName('iframe')[0]);]]></d:getter></d:property><d:property name="focusElement"><d:setter type="text/javascript"/><d:getter type="text/javascript"><![CDATA[return this.getProperty('contentFrame');]]></d:getter></d:property><d:property name="contentWindow" onget="return null;"/><d:property name="contentDocument" onget="return null;"/><d:property name="value"><d:getter type="text/javascript"><![CDATA[return this._._postponedValue;]]></d:getter><d:setter type="text/javascript"><![CDATA[this._._postponedValue=value;]]></d:setter></d:property><d:property name="documentTemplate"><d:setter type="text/javascript"/><d:getter type="text/javascript"><![CDATA[return this._._documentTemplate||(this._._documentTemplate=new btl.richTextEditor.Template(bb.getResource(this,'defaultDocument')));]]></d:getter></d:property><d:method name="renderDocument"><d:argument name="content" type="string"/><d:body type="text/javascript"><![CDATA[throw new Error('Editor is not ready to be able to render the inner document!');]]></d:body></d:method><d:method name="startCommandStateListening"><d:body type="text/javascript"><![CDATA[var oEditor=this;this._._commandStateListenerInterval=setInterval(function(){var oDocument=oEditor.getProperty('contentDocument'),oButton=null,iCommand=0,aCommands=oEditor._.registeredButtons,bDisabled=false;if(aCommands){while(oButton=aCommands[iCommand++]){try{var sCommand=oButton.modelNode.getAttribute('richTextCommand');oButton.setAttribute('disabled',String(!oDocument.queryCommandEnabled(sCommand)));var sState=String(oDocument.queryCommandState(sCommand));if(oButton.modelNode.getAttribute('active')!=sState){oButton.setAttribute('active',sState);}}catch(oException){}}}},200);]]></d:body></d:method><d:method name="pauseCommandStateListening"><d:body type="text/javascript"><![CDATA[if(this._._commandStateListenerInterval){clearInterval(this._._commandStateListenerInterval);this._._commandStateListenerInterval=null;}]]></d:body></d:method><d:constructor type="text/javascript"><![CDATA[bb.ui.reflow.add(this);var oEditor=this;(function init(){try{oEditor.getProperty('contentFrame').contentWindow.document;}catch(oException){return setTimeout(function(){oEditor._&&init();},100);}oEditor.changeState('richTextEditorReady');var oDocument=oEditor.getProperty('contentDocument');oDocument.designMode='on';oEditor.renderDocument(oEditor._._postponedValue||'');(!bb.browser.ie||oEditor._.focused)&&oEditor.startCommandStateListening();bb.html.addClass(oEditor.viewNode,'btl-richTextEditor-ready');bb.ui.reflow(oEditor,true,true);})();]]></d:constructor><d:handler event="focus" type="text/javascript"><![CDATA[this._._focused=true;]]></d:handler><d:handler event="blur" type="text/javascript"><![CDATA[this._._focused=false;]]></d:handler><d:handler event="reflow" type="text/javascript"><![CDATA[var oContentFrame=this.getProperty('contentFrame');btl.html.stretch(oContentFrame.parentNode);btl.html.stretch(oContentFrame);]]></d:handler><d:handler event="click" type="text/javascript"><![CDATA[var oButton=event.target;var sCommand=oButton.modelNode.getAttribute('richTextCommand');if(sCommand){var sOption=oButton.getAttribute('selected')=='true';btl.richTextEditor.execCommand(this,sCommand,sOption);}]]></d:handler><d:handler event="DOMNodeInsertedIntoDocument" type="text/javascript"><![CDATA[var oEditor=this;var oCData=bb.xml.getFirstByNodeType(this.modelNode,4);if(oCData){var sData=oCData.nodeValue;bb.destruct(bb.getControllerFromModel(oCData));}var oToolbar=this.getElementsByTagNameNS(btl.namespaceURI,'toolBar')[0];if(!oToolbar){oToolbar=bb.getResource(this,'defaultToolBar').documentElement.cloneNode(true);this.appendChild(bb.construct(oToolbar));}(function(oElement){if(oElement.hasAttribute('richTextCommand')){btl.richTextEditor.registerCommandButton(oEditor,oElement);}var aChildren=oElement.getProperty('childNodes');for(var iChild=0;iChild<aChildren.length;iChild++){arguments.callee(aChildren[iChild]);}})(this);var oInput=this.viewNode.getElementsByTagName('input')[0];if(oInput.form){bb.html.addEventListener(oInput.form,'submit',function(){oInput.value=oEditor.getProperty('value');},false);}this.setProperty('value',sData||'');]]></d:handler></d:element></d:namespace></d:tdl>