Vlad Kurkin (b_vladi) wrote in changelog,
Vlad Kurkin
b_vladi
changelog

[livejournal] r19383: LJSUP-9159: Update and improve RTE by CK...

Committer: vkurkin
LJSUP-9159: Update and improve RTE by CKEditor 3.6.1
U   trunk/htdocs/js/rte.js
U   trunk/htdocs/stc/fck/editor/dialog/common/fck_dialog_common.js
U   trunk/htdocs/stc/fck/editor/dialog/fck_link/fck_link.js
U   trunk/htdocs/stc/fck/editor/js/fckeditorcode_gecko.js
Modified: trunk/htdocs/js/rte.js
===================================================================
--- trunk/htdocs/js/rte.js	2011-06-28 06:31:35 UTC (rev 19382)
+++ trunk/htdocs/js/rte.js	2011-06-28 07:25:38 UTC (rev 19383)
@@ -143,22 +143,15 @@
 			$('switched_rte_on').value = '1';
 
 			if(!CKEditor && CKEDITOR && CKEDITOR.env.isCompatible){
+				CKEDITOR.basePath = statPrefix + '/ck/';
 				var editor = CKEDITOR.replace(textArea, {
 					skin: 'v2',
-					baseHref: statPrefix + '/ck/',
+					baseHref: CKEDITOR.basePath,
 					height: 350
 				});
 
 				editor.on('instanceReady', function(){
 					CKEditor = editor;
-
-					/*$('updateForm').onsubmit = function(){
-						if(switchedRteOn){
-							var html = closeEmptyTags(CKEditor.element.getValue());
-							CKEditor.setData(html);
-						}
-					};*/
-					
 					CKEditor.on('dataReady', LJToHtml);
 				});
 			} else {

Modified: trunk/htdocs/stc/fck/editor/dialog/common/fck_dialog_common.js
===================================================================
--- trunk/htdocs/stc/fck/editor/dialog/common/fck_dialog_common.js	2011-06-28 06:31:35 UTC (rev 19382)
+++ trunk/htdocs/stc/fck/editor/dialog/common/fck_dialog_common.js	2011-06-28 07:25:38 UTC (rev 19383)
@@ -1,6 +1,6 @@
 /*
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -23,328 +23,303 @@
  */
 
 // Automatically detect the correct document.domain (#123).
-(function()
-{
-	var d = document.domain ;
+(function(){
+	var d = document.domain;
 
-	while ( true )
-	{
+	while(true){
 		// Test if we can access a parent property.
-		try
-		{
-			var test = window.parent.document.domain ;
-			break ;
+		try{
+			var test = window.parent.document.domain;
+			break;
+		} catch(e){
 		}
-		catch( e ) {}
 
 		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
-		d = d.replace( /.*?(?:\.|$)/, '' ) ;
+		d = d.replace(/.*?(?:\.|$)/, '');
 
-		if ( d.length == 0 )
-			break ;		// It was not able to detect the domain.
+		if(d.length == 0){
+			break;
+		}		// It was not able to detect the domain.
 
-		try
-		{
-			document.domain = d ;
+		try{
+			document.domain = d;
+		} catch (e){
+			break;
 		}
-		catch (e)
-		{
-			break ;
-		}
 	}
-})() ;
+})();
 
 // Attention: FCKConfig must be available in the page.
-function GetCommonDialogCss( prefix )
-{
+function GetCommonDialogCss(prefix){
 	// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt).
-	return FCKConfig.BasePath + 'dialog/common/' + '|.ImagePreviewArea{border:#000 1px solid;overflow:auto;width:100%;height:170px;background-color:#fff}.FlashPreviewArea{border:#000 1px solid;padding:5px;overflow:auto;width:100%;height:170px;background-color:#fff}.BtnReset{float:left;background-position:center center;background-image:url(images/reset.gif);width:16px;height:16px;background-repeat:no-repeat;border:1px none;font-size:1px}.BtnLocked,.BtnUnlocked{float:left;background-position:center center;background-image:url(images/locked.gif);width:16px;height:16px;background-repeat:no-repeat;border:none 1px;font-size:1px}.BtnUnlocked{background-image:url(images/unlocked.gif)}.BtnOver{border:outset 1px;cursor:pointer;cursor:hand}' ;
+	return FCKConfig
+		.BasePath + 'dialog/common/' + '|.ImagePreviewArea{border:#000 1px solid;overflow:auto;width:100%;height:170px;background-color:#fff}.FlashPreviewArea{border:#000 1px solid;padding:5px;overflow:auto;width:100%;height:170px;background-color:#fff}.BtnReset{float:left;background-position:center center;background-image:url(images/reset.gif);width:16px;height:16px;background-repeat:no-repeat;border:1px none;font-size:1px}.BtnLocked,.BtnUnlocked{float:left;background-position:center center;background-image:url(images/locked.gif);width:16px;height:16px;background-repeat:no-repeat;border:none 1px;font-size:1px}.BtnUnlocked{background-image:url(images/unlocked.gif)}.BtnOver{border:outset 1px;cursor:pointer;cursor:hand}';
 }
 
 // Gets a element by its Id. Used for shorter coding.
-function GetE( elementId )
-{
-	return document.getElementById( elementId )  ;
+function GetE(elementId){
+	return document.getElementById(elementId);
 }
 
-function ShowE( element, isVisible )
-{
-	if ( typeof( element ) == 'string' )
-		element = GetE( element ) ;
-	element.style.display = isVisible ? '' : 'none' ;
+function ShowE(element, isVisible){
+	if(typeof( element ) == 'string'){
+		element = GetE(element);
+	}
+	element.style.display = isVisible ? '' : 'none';
 }
 
-function SetAttribute( element, attName, attValue )
-{
-	if ( attValue == null || attValue.length == 0 )
-		element.removeAttribute( attName, 0 ) ;			// 0 : Case Insensitive
-	else
-		element.setAttribute( attName, attValue, 0 ) ;	// 0 : Case Insensitive
+function SetAttribute(element, attName, attValue){
+	if(attValue == null || attValue.length == 0){
+		element.removeAttribute(attName, 0);
+	}			// 0 : Case Insensitive
+	else {
+		element.setAttribute(attName, attValue, 0);
+	}	// 0 : Case Insensitive
 }
 
-function GetAttribute( element, attName, valueIfNull )
-{
-	var oAtt = element.attributes[attName] ;
+function GetAttribute(element, attName, valueIfNull){
+	var oAtt = element.attributes[attName];
 
-	if ( oAtt == null || !oAtt.specified )
-		return valueIfNull ? valueIfNull : '' ;
+	if(oAtt == null || !oAtt.specified){
+		return valueIfNull ? valueIfNull : '';
+	}
 
-	var oValue = element.getAttribute( attName, 2 ) ;
+	var oValue = element.getAttribute(attName, 2);
 
-	if ( oValue == null )
-		oValue = oAtt.nodeValue ;
+	if(oValue == null){
+		oValue = oAtt.nodeValue;
+	}
 
-	return ( oValue == null ? valueIfNull : oValue ) ;
+	return ( oValue == null ? valueIfNull : oValue );
 }
 
-function SelectField( elementId )
-{
-    //added try catch because the tab can be hidden at this moment
-    try {
-        var element = GetE( elementId ) ;
-        element.focus() ;
-    } catch( e ) {};
+function SelectField(elementId){
+	var element = GetE(elementId);
+	element.focus();
 
 	// element.select may not be available for some fields (like <select>).
-	if ( element.select )
-		element.select() ;
+	if(element.select){
+		element.select();
+	}
 }
 
 // Functions used by text fields to accept numbers only.
-var IsDigit = ( function()
-	{
-		var KeyIdentifierMap =
-		{
-			End			: 35,
-			Home		: 36,
-			Left		: 37,
-			Right		: 39,
-			'U+00007F'	: 46		// Delete
-		} ;
+var IsDigit = ( function(){
+	var KeyIdentifierMap = {
+		End			: 35,
+		Home		: 36,
+		Left		: 37,
+		Right		: 39,
+		'U+00007F'	: 46		// Delete
+	};
 
-		return function ( e )
-			{
-				if ( !e )
-					e = event ;
+	return function (e){
+		if(!e){
+			e = event;
+		}
 
-				var iCode = ( e.keyCode || e.charCode ) ;
+		var iCode = ( e.keyCode || e.charCode );
 
-				if ( !iCode && e.keyIdentifier && ( e.keyIdentifier in KeyIdentifierMap ) )
-						iCode = KeyIdentifierMap[ e.keyIdentifier ] ;
+		if(!iCode && e.keyIdentifier && ( e.keyIdentifier in KeyIdentifierMap )){
+			iCode = KeyIdentifierMap[ e.keyIdentifier ];
+		}
 
-				return (
-						( iCode >= 48 && iCode <= 57 )		// Numbers
-						|| (iCode >= 35 && iCode <= 40)		// Arrows, Home, End
-						|| iCode == 8						// Backspace
-						|| iCode == 46						// Delete
-						|| iCode == 9						// Tab
-				) ;
-			}
-	} )() ;
+		return (
+			( iCode >= 48 && iCode <= 57 )		// Numbers || (iCode >= 35 && iCode <= 40)		// Arrows, Home, End || iCode == 8						// Backspace || iCode == 46						// Delete || iCode == 9						// Tab
+			);
+	}
+} )();
 
-String.prototype.Trim = function()
-{
-	return this.replace( /(^\s*)|(\s*$)/g, '' ) ;
-}
+String.prototype.Trim = function(){
+	return this.replace(/(^\s*)|(\s*$)/g, '');
+};
 
-String.prototype.StartsWith = function( value )
-{
-	return ( this.substr( 0, value.length ) == value ) ;
-}
+String.prototype.StartsWith = function(value){
+	return ( this.substr(0, value.length) == value );
+};
 
-String.prototype.Remove = function( start, length )
-{
-	var s = '' ;
+String.prototype.Remove = function(start, length){
+	var s = '';
 
-	if ( start > 0 )
-		s = this.substring( 0, start ) ;
+	if(start > 0){
+		s = this.substring(0, start);
+	}
 
-	if ( start + length < this.length )
-		s += this.substring( start + length , this.length ) ;
+	if(start + length < this.length){
+		s += this.substring(start + length, this.length);
+	}
 
-	return s ;
-}
+	return s;
+};
 
-String.prototype.ReplaceAll = function( searchArray, replaceArray )
-{
-	var replaced = this ;
+String.prototype.ReplaceAll = function(searchArray, replaceArray){
+	var replaced = this;
 
-	for ( var i = 0 ; i < searchArray.length ; i++ )
-	{
-		replaced = replaced.replace( searchArray[i], replaceArray[i] ) ;
+	for(var i = 0; i < searchArray.length; i++){
+		replaced = replaced.replace(searchArray[i], replaceArray[i]);
 	}
 
-	return replaced ;
-}
+	return replaced;
+};
 
-function OpenFileBrowser( url, width, height )
-{
+function OpenFileBrowser(url, width, height){
 	// oEditor must be defined.
 
-	var iLeft = ( oEditor.FCKConfig.ScreenWidth  - width ) / 2 ;
-	var iTop  = ( oEditor.FCKConfig.ScreenHeight - height ) / 2 ;
+	var iLeft = ( oEditor.FCKConfig.ScreenWidth - width ) / 2;
+	var iTop = ( oEditor.FCKConfig.ScreenHeight - height ) / 2;
 
-	var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes,scrollbars=yes" ;
-	sOptions += ",width=" + width ;
-	sOptions += ",height=" + height ;
-	sOptions += ",left=" + iLeft ;
-	sOptions += ",top=" + iTop ;
+	var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes,scrollbars=yes";
+	sOptions += ",width=" + width;
+	sOptions += ",height=" + height;
+	sOptions += ",left=" + iLeft;
+	sOptions += ",top=" + iTop;
 
-	window.open( url, 'FCKBrowseWindow', sOptions ) ;
+	window.open(url, 'FCKBrowseWindow', sOptions);
 }
 
 /**
  Utility function to create/update an element with a name attribute in IE, so it behaves properly when moved around
  It also allows to change the name or other special attributes in an existing node
-	oEditor : instance of FCKeditor where the element will be created
-	oOriginal : current element being edited or null if it has to be created
-	nodeName : string with the name of the element to create
-	oAttributes : Hash object with the attributes that must be set at creation time in IE
-								Those attributes will be set also after the element has been
-								created for any other browser to avoid redudant code
-*/
-function CreateNamedElement( oEditor, oOriginal, nodeName, oAttributes )
-{
-	var oNewNode ;
+ oEditor : instance of FCKeditor where the element will be created
+ oOriginal : current element being edited or null if it has to be created
+ nodeName : string with the name of the element to create
+ oAttributes : Hash object with the attributes that must be set at creation time in IE
+ Those attributes will be set also after the element has been
+ created for any other browser to avoid redudant code
+ */
+function CreateNamedElement(oEditor, oOriginal, nodeName, oAttributes){
+	var oNewNode;
 
 	// IE doesn't allow easily to change properties of an existing object,
 	// so remove the old and force the creation of a new one.
-	var oldNode = null ;
-	if ( oOriginal && oEditor.FCKBrowserInfo.IsIE )
-	{
+	var oldNode = null;
+	if(oOriginal && oEditor.FCKBrowserInfo.IsIE){
 		// Force the creation only if some of the special attributes have changed:
 		var bChanged = false;
-		for( var attName in oAttributes )
-			bChanged |= ( oOriginal.getAttribute( attName, 2) != oAttributes[attName] ) ;
+		for(var attName in oAttributes){
+			bChanged |= ( oOriginal.getAttribute(attName, 2) != oAttributes[attName] );
+		}
 
-		if ( bChanged )
-		{
-			oldNode = oOriginal ;
-			oOriginal = null ;
+		if(bChanged){
+			oldNode = oOriginal;
+			oOriginal = null;
 		}
 	}
 
 	// If the node existed (and it's not IE), then we just have to update its attributes
-	if ( oOriginal )
-	{
-		oNewNode = oOriginal ;
-	}
-	else
-	{
+	if(oOriginal){
+		oNewNode = oOriginal;
+	} else {
 		// #676, IE doesn't play nice with the name or type attribute
-		if ( oEditor.FCKBrowserInfo.IsIE )
-		{
-			var sbHTML = [] ;
-			sbHTML.push( '<' + nodeName ) ;
-			for( var prop in oAttributes )
-			{
-				sbHTML.push( ' ' + prop + '="' + oAttributes[prop] + '"' ) ;
+		if(oEditor.FCKBrowserInfo.IsIE){
+			var sbHTML = [];
+			sbHTML.push('<' + nodeName);
+			for(var prop in oAttributes){
+				sbHTML.push(' ' + prop + '="' + oAttributes[prop] + '"');
 			}
-			sbHTML.push( '>' ) ;
-			if ( !oEditor.FCKListsLib.EmptyElements[nodeName.toLowerCase()] )
-				sbHTML.push( '</' + nodeName + '>' ) ;
+			sbHTML.push('>');
+			if(!oEditor.FCKListsLib.EmptyElements[nodeName.toLowerCase()]){
+				sbHTML.push('</' + nodeName + '>');
+			}
 
-			oNewNode = oEditor.FCK.EditorDocument.createElement( sbHTML.join('') ) ;
+			oNewNode = oEditor.FCK.EditorDocument.createElement(sbHTML.join(''));
 			// Check if we are just changing the properties of an existing node: copy its properties
-			if ( oldNode )
-			{
-				CopyAttributes( oldNode, oNewNode, oAttributes ) ;
-				oEditor.FCKDomTools.MoveChildren( oldNode, oNewNode ) ;
-				oldNode.parentNode.removeChild( oldNode ) ;
-				oldNode = null ;
+			if(oldNode){
+				CopyAttributes(oldNode, oNewNode, oAttributes);
+				oEditor.FCKDomTools.MoveChildren(oldNode, oNewNode);
+				oldNode.parentNode.removeChild(oldNode);
+				oldNode = null;
 
-				if ( oEditor.FCK.Selection.SelectionData )
-				{
+				if(oEditor.FCK.Selection.SelectionData){
 					// Trick to refresh the selection object and avoid error in
 					// fckdialog.html Selection.EnsureSelection
-					var oSel = oEditor.FCK.EditorDocument.selection ;
-					oEditor.FCK.Selection.SelectionData = oSel.createRange() ; // Now oSel.type will be 'None' reflecting the real situation
+					var oSel = oEditor.FCK.EditorDocument.selection;
+					oEditor.FCK.Selection.SelectionData = oSel.createRange(); // Now oSel.type will be 'None' reflecting the real situation
 				}
 			}
-			oNewNode = oEditor.FCK.InsertElement( oNewNode ) ;
+			oNewNode = oEditor.FCK.InsertElement(oNewNode);
 
 			// FCK.Selection.SelectionData is broken by now since we've
 			// deleted the previously selected element. So we need to reassign it.
-			if ( oEditor.FCK.Selection.SelectionData )
-			{
-				var range = oEditor.FCK.EditorDocument.body.createControlRange() ;
-				range.add( oNewNode ) ;
-				oEditor.FCK.Selection.SelectionData = range ;
+			if(oEditor.FCK.Selection.SelectionData){
+				var range = oEditor.FCK.EditorDocument.body.createControlRange();
+				range.add(oNewNode);
+				oEditor.FCK.Selection.SelectionData = range;
 			}
+		} else {
+			oNewNode = oEditor.FCK.InsertElement(nodeName);
 		}
-		else
-		{
-			oNewNode = oEditor.FCK.InsertElement( nodeName ) ;
-		}
 	}
 
 	// Set the basic attributes
-	for( var attName in oAttributes )
-		oNewNode.setAttribute( attName, oAttributes[attName], 0 ) ;	// 0 : Case Insensitive
+	for(var attName in oAttributes){
+		oNewNode.setAttribute(attName, oAttributes[attName], 0);
+	}	// 0 : Case Insensitive
 
-	return oNewNode ;
+	return oNewNode;
 }
 
 // Copy all the attributes from one node to the other, kinda like a clone
 // But oSkipAttributes is an object with the attributes that must NOT be copied
-function CopyAttributes( oSource, oDest, oSkipAttributes )
-{
-	var aAttributes = oSource.attributes ;
+function CopyAttributes(oSource, oDest, oSkipAttributes){
+	var aAttributes = oSource.attributes;
 
-	for ( var n = 0 ; n < aAttributes.length ; n++ )
-	{
-		var oAttribute = aAttributes[n] ;
+	for(var n = 0; n < aAttributes.length; n++){
+		var oAttribute = aAttributes[n];
 
-		if ( oAttribute.specified )
-		{
-			var sAttName = oAttribute.nodeName ;
+		if(oAttribute.specified){
+			var sAttName = oAttribute.nodeName;
 			// We can set the type only once, so do it with the proper value, not copying it.
-			if ( sAttName in oSkipAttributes )
-				continue ;
+			if(sAttName in oSkipAttributes){
+				continue;
+			}
 
-			var sAttValue = oSource.getAttribute( sAttName, 2 ) ;
-			if ( sAttValue == null )
-				sAttValue = oAttribute.nodeValue ;
+			var sAttValue = oSource.getAttribute(sAttName, 2);
+			if(sAttValue == null){
+				sAttValue = oAttribute.nodeValue;
+			}
 
-			oDest.setAttribute( sAttName, sAttValue, 0 ) ;	// 0 : Case Insensitive
+			oDest.setAttribute(sAttName, sAttValue, 0);	// 0 : Case Insensitive
 		}
 	}
 	// The style:
-	if ( oSource.style.cssText !== '' )
-		oDest.style.cssText = oSource.style.cssText ;
+	if(oSource.style.cssText !== ''){
+		oDest.style.cssText = oSource.style.cssText;
+	}
 }
 
 /**
-* Replaces a tag with another one, keeping its contents:
-* for example TD --> TH, and TH --> TD.
-* input: the original node, and the new tag name
-* http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-renameNode
-*/
-function RenameNode( oNode , newTag )
-{
+ * Replaces a tag with another one, keeping its contents:
+ * for example TD --> TH, and TH --> TD.
+ * input: the original node, and the new tag name
+ * http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-renameNode
+ */
+function RenameNode(oNode, newTag){
 	// TODO: if the browser natively supports document.renameNode call it.
 	// does any browser currently support it in order to test?
 
 	// Only rename element nodes.
-	if ( oNode.nodeType != 1 )
-		return null ;
+	if(oNode.nodeType != 1){
+		return null;
+	}
 
 	// If it's already correct exit here.
-	if ( oNode.nodeName == newTag )
-		return oNode ;
+	if(oNode.nodeName == newTag){
+		return oNode;
+	}
 
-	var oDoc = oNode.ownerDocument ;
+	var oDoc = oNode.ownerDocument;
 	// Create the new node
-	var newNode = oDoc.createElement( newTag ) ;
+	var newNode = oDoc.createElement(newTag);
 
 	// Copy all attributes
-	CopyAttributes( oNode, newNode, {} ) ;
+	CopyAttributes(oNode, newNode, {});
 
 	// Move children to the new node
-	FCKDomTools.MoveChildren( oNode, newNode ) ;
+	FCKDomTools.MoveChildren(oNode, newNode);
 
 	// Finally replace the node and return the new one
-	oNode.parentNode.replaceChild( newNode, oNode ) ;
+	oNode.parentNode.replaceChild(newNode, oNode);
 
-	return newNode ;
+	return newNode;
 }

Modified: trunk/htdocs/stc/fck/editor/dialog/fck_link/fck_link.js
===================================================================
--- trunk/htdocs/stc/fck/editor/dialog/fck_link/fck_link.js	2011-06-28 06:31:35 UTC (rev 19382)
+++ trunk/htdocs/stc/fck/editor/dialog/fck_link/fck_link.js	2011-06-28 07:25:38 UTC (rev 19383)
@@ -79,255 +79,235 @@
 
 // This method simply returns the two inputs in numerical order. You can even
 // provide strings, as the method would parseInt() the values.
-oParser.SortNumerical = function(a, b)
-{
-	return parseInt( a, 10 ) - parseInt( b, 10 ) ;
-}
+oParser.SortNumerical = function(a, b){
+	return parseInt(a, 10) - parseInt(b, 10);
+};
 
-oParser.ParseEMailParams = function(sParams)
-{
+oParser.ParseEMailParams = function(sParams){
 	// Initialize the oEMailParams object.
-	var oEMailParams = new Object() ;
-	oEMailParams.Subject = '' ;
-	oEMailParams.Body = '' ;
+	var oEMailParams = new Object();
+	oEMailParams.Subject = '';
+	oEMailParams.Body = '';
 
-	var aMatch = sParams.match( /(^|^\?|&)subject=([^&]+)/i ) ;
-	if ( aMatch ) oEMailParams.Subject = decodeURIComponent( aMatch[2] ) ;
+	var aMatch = sParams.match(/(^|^\?|&)subject=([^&]+)/i);
+	if(aMatch) oEMailParams.Subject = decodeURIComponent(aMatch[2]);
 
-	aMatch = sParams.match( /(^|^\?|&)body=([^&]+)/i ) ;
-	if ( aMatch ) oEMailParams.Body = decodeURIComponent( aMatch[2] ) ;
+	aMatch = sParams.match(/(^|^\?|&)body=([^&]+)/i);
+	if(aMatch) oEMailParams.Body = decodeURIComponent(aMatch[2]);
 
-	return oEMailParams ;
-}
+	return oEMailParams;
+};
 
 // This method returns either an object containing the email info, or FALSE
 // if the parameter is not an email link.
-oParser.ParseEMailUri = function( sUrl )
-{
+oParser.ParseEMailUri = function(sUrl){
 	// Initializes the EMailInfo object.
-	var oEMailInfo = new Object() ;
-	oEMailInfo.Address = '' ;
-	oEMailInfo.Subject = '' ;
-	oEMailInfo.Body = '' ;
+	var oEMailInfo = new Object();
+	oEMailInfo.Address = '';
+	oEMailInfo.Subject = '';
+	oEMailInfo.Body = '';
 
-	var aLinkInfo = sUrl.match( /^(\w+):(.*)$/ ) ;
-	if ( aLinkInfo && aLinkInfo[1] == 'mailto' )
-	{
+	var aLinkInfo = sUrl.match(/^(\w+):(.*)$/);
+	if(aLinkInfo && aLinkInfo[1] == 'mailto'){
 		// This seems to be an unprotected email link.
-		var aParts = aLinkInfo[2].match( /^([^\?]+)\??(.+)?/ ) ;
-		if ( aParts )
-		{
+		var aParts = aLinkInfo[2].match(/^([^\?]+)\??(.+)?/);
+		if(aParts){
 			// Set the e-mail address.
-			oEMailInfo.Address = aParts[1] ;
+			oEMailInfo.Address = aParts[1];
 
 			// Look for the optional e-mail parameters.
-			if ( aParts[2] )
-			{
-				var oEMailParams = oParser.ParseEMailParams( aParts[2] ) ;
-				oEMailInfo.Subject = oEMailParams.Subject ;
-				oEMailInfo.Body = oEMailParams.Body ;
+			if(aParts[2]){
+				var oEMailParams = oParser.ParseEMailParams(aParts[2]);
+				oEMailInfo.Subject = oEMailParams.Subject;
+				oEMailInfo.Body = oEMailParams.Body;
 			}
 		}
-		return oEMailInfo ;
-	}
-	else if ( aLinkInfo && aLinkInfo[1] == 'javascript' )
-	{
+		return oEMailInfo;
+	} else if(aLinkInfo && aLinkInfo[1] == 'javascript'){
 		// This may be a protected email.
 
 		// Try to match the url against the EMailProtectionFunction.
-		var func = FCKConfig.EMailProtectionFunction ;
-		if ( func != null )
-		{
-			try
-			{
+		var func = FCKConfig.EMailProtectionFunction;
+		if(func != null){
+			try{
 				// Escape special chars.
-				func = func.replace( /([\/^$*+.?()\[\]])/g, '\\$1' ) ;
+				func = func.replace(/([\/^$*+.?()\[\]])/g, '\\$1');
 
 				// Define the possible keys.
-				var keys = new Array('NAME', 'DOMAIN', 'SUBJECT', 'BODY') ;
+				var keys = new Array('NAME', 'DOMAIN', 'SUBJECT', 'BODY');
 
 				// Get the order of the keys (hold them in the array <pos>) and
 				// the function replaced by regular expression patterns.
-				var sFunc = func ;
-				var pos = new Array() ;
-				for ( var i = 0 ; i < keys.length ; i ++ )
-				{
-					var rexp = new RegExp( keys[i] ) ;
-					var p = func.search( rexp ) ;
-					if ( p >= 0 )
-					{
-						sFunc = sFunc.replace( rexp, '\'([^\']*)\'' ) ;
-						pos[pos.length] = p + ':' + keys[i] ;
+				var sFunc = func;
+				var pos = new Array();
+				for(var i = 0; i < keys.length; i ++){
+					var rexp = new RegExp(keys[i]);
+					var p = func.search(rexp);
+					if(p >= 0){
+						sFunc = sFunc.replace(rexp, '\'([^\']*)\'');
+						pos[pos.length] = p + ':' + keys[i];
 					}
 				}
 
 				// Sort the available keys.
-				pos.sort( oParser.SortNumerical ) ;
+				pos.sort(oParser.SortNumerical);
 
 				// Replace the excaped single quotes in the url, such they do
 				// not affect the regexp afterwards.
-				aLinkInfo[2] = aLinkInfo[2].replace( /\\'/g, '###SINGLE_QUOTE###' ) ;
+				aLinkInfo[2] = aLinkInfo[2].replace(/\\'/g, '###SINGLE_QUOTE###');
 
 				// Create the regexp and execute it.
-				var rFunc = new RegExp( '^' + sFunc + '$' ) ;
-				var aMatch = rFunc.exec( aLinkInfo[2] ) ;
-				if ( aMatch )
-				{
+				var rFunc = new RegExp('^' + sFunc + '$');
+				var aMatch = rFunc.exec(aLinkInfo[2]);
+				if(aMatch){
 					var aInfo = new Array();
-					for ( var i = 1 ; i < aMatch.length ; i ++ )
-					{
-						var k = pos[i-1].match(/^\d+:(.+)$/) ;
-						aInfo[k[1]] = aMatch[i].replace(/###SINGLE_QUOTE###/g, '\'') ;
+					for(var i = 1; i < aMatch.length; i ++){
+						var k = pos[i - 1].match(/^\d+:(.+)$/);
+						aInfo[k[1]] = aMatch[i].replace(/###SINGLE_QUOTE###/g, '\'');
 					}
 
 					// Fill the EMailInfo object that will be returned
-					oEMailInfo.Address = aInfo['NAME'] + '@' + aInfo['DOMAIN'] ;
-					oEMailInfo.Subject = decodeURIComponent( aInfo['SUBJECT'] ) ;
-					oEMailInfo.Body = decodeURIComponent( aInfo['BODY'] ) ;
+					oEMailInfo.Address = aInfo['NAME'] + '@' + aInfo['DOMAIN'];
+					oEMailInfo.Subject = decodeURIComponent(aInfo['SUBJECT']);
+					oEMailInfo.Body = decodeURIComponent(aInfo['BODY']);
 
-					return oEMailInfo ;
+					return oEMailInfo;
 				}
+			} catch (e){
 			}
-			catch (e)
-			{
-			}
 		}
 
 		// Try to match the email against the encode protection.
-		var aMatch = aLinkInfo[2].match( /^(?:void\()?location\.href='mailto:'\+(String\.fromCharCode\([\d,]+\))\+'(.*)'\)?$/ ) ;
-		if ( aMatch )
-		{
+		var aMatch = aLinkInfo[2].match(/^(?:void\()?location\.href='mailto:'\+(String\.fromCharCode\([\d,]+\))\+'(.*)'\)?$/);
+		if(aMatch){
 			// The link is encoded
-			oEMailInfo.Address = eval( aMatch[1] ) ;
-			if ( aMatch[2] )
-			{
-				var oEMailParams = oParser.ParseEMailParams( aMatch[2] ) ;
-				oEMailInfo.Subject = oEMailParams.Subject ;
-				oEMailInfo.Body = oEMailParams.Body ;
+			oEMailInfo.Address = eval(aMatch[1]);
+			if(aMatch[2]){
+				var oEMailParams = oParser.ParseEMailParams(aMatch[2]);
+				oEMailInfo.Subject = oEMailParams.Subject;
+				oEMailInfo.Body = oEMailParams.Body;
 			}
-			return oEMailInfo ;
+			return oEMailInfo;
 		}
 	}
 	return false;
-}
+};
 
-oParser.CreateEMailUri = function( address, subject, body )
-{
+oParser.CreateEMailUri = function(address, subject, body){
 	// Switch for the EMailProtection setting.
-	switch ( FCKConfig.EMailProtection )
-	{
+	switch(FCKConfig.EMailProtection){
 		case 'function' :
-			var func = FCKConfig.EMailProtectionFunction ;
-			if ( func == null )
-			{
-				if ( FCKConfig.Debug )
-				{
-					alert('EMailProtection alert!\nNo function defined. Please set "FCKConfig.EMailProtectionFunction"') ;
+			var func = FCKConfig.EMailProtectionFunction;
+			if(func == null){
+				if(FCKConfig.Debug){
+					alert('EMailProtection alert!\nNo function defined. Please set "FCKConfig.EMailProtectionFunction"');
 				}
 				return '';
 			}
 
 			// Split the email address into name and domain parts.
-			var aAddressParts = address.split( '@', 2 ) ;
-			if ( aAddressParts[1] == undefined )
-			{
-				aAddressParts[1] = '' ;
+			var aAddressParts = address.split('@', 2);
+			if(aAddressParts[1] == undefined){
+				aAddressParts[1] = '';
 			}
 
 			// Replace the keys by their values (embedded in single quotes).
-			func = func.replace(/NAME/g, "'" + aAddressParts[0].replace(/'/g, '\\\'') + "'") ;
-			func = func.replace(/DOMAIN/g, "'" + aAddressParts[1].replace(/'/g, '\\\'') + "'") ;
-			func = func.replace(/SUBJECT/g, "'" + encodeURIComponent( subject ).replace(/'/g, '\\\'') + "'") ;
-			func = func.replace(/BODY/g, "'" + encodeURIComponent( body ).replace(/'/g, '\\\'') + "'") ;
+			func = func.replace(/NAME/g, "'" + aAddressParts[0].replace(/'/g, '\\\'') + "'");
+			func = func.replace(/DOMAIN/g, "'" + aAddressParts[1].replace(/'/g, '\\\'') + "'");
+			func = func.replace(/SUBJECT/g, "'" + encodeURIComponent(subject).replace(/'/g, '\\\'') + "'");
+			func = func.replace(/BODY/g, "'" + encodeURIComponent(body).replace(/'/g, '\\\'') + "'");
 
-			return 'javascript:' + func ;
+			return 'javascript:' + func;
 
 		case 'encode' :
-			var aParams = [] ;
-			var aAddressCode = [] ;
+			var aParams = [];
+			var aAddressCode = [];
 
-			if ( subject.length > 0 )
-				aParams.push( 'subject='+ encodeURIComponent( subject ) ) ;
-			if ( body.length > 0 )
-				aParams.push( 'body=' + encodeURIComponent( body ) ) ;
-			for ( var i = 0 ; i < address.length ; i++ )
-				aAddressCode.push( address.charCodeAt( i ) ) ;
+			if(subject.length > 0)
+				aParams.push('subject=' + encodeURIComponent(subject));
+			if(body.length > 0)
+				aParams.push('body=' + encodeURIComponent(body));
+			for(var i = 0; i < address.length; i++)
+				aAddressCode.push(address.charCodeAt(i));
 
-			return 'javascript:void(location.href=\'mailto:\'+String.fromCharCode(' + aAddressCode.join( ',' ) + ')+\'?' + aParams.join( '&' ) + '\')' ;
+			return 'javascript:void(location.href=\'mailto:\'+String.fromCharCode(' + aAddressCode.join(',') + ')+\'?' + aParams.join('&') + '\')';
 	}
 
 	// EMailProtection 'none'
 
-	var sBaseUri = 'mailto:' + address ;
+	var sBaseUri = 'mailto:' + address;
 
-	var sParams = '' ;
+	var sParams = '';
 
-	if ( subject.length > 0 )
-		sParams = '?subject=' + encodeURIComponent( subject ) ;
+	if(subject.length > 0)
+		sParams = '?subject=' + encodeURIComponent(subject);
 
-	if ( body.length > 0 )
-	{
-		sParams += ( sParams.length == 0 ? '?' : '&' ) ;
-		sParams += 'body=' + encodeURIComponent( body ) ;
+	if(body.length > 0){
+		sParams += ( sParams.length == 0 ? '?' : '&' );
+		sParams += 'body=' + encodeURIComponent(body);
 	}
 
-	return sBaseUri + sParams ;
-}
+	return sBaseUri + sParams;
+};
+var oLink;
+function onLoad(){
 
-//#### Initialization Code
+	//#### Initialization Code
 
-// oLink: The actual selected link in the editor.
-var oLink = dialog.Selection.GetSelection().MoveToAncestorNode( 'A' ) ;
-if ( oLink )
-	FCK.Selection.SelectNode( oLink ) ;
-
-window.onload = function()
-{
+	// oLink: The actual selected link in the editor.
+	oLink = dialog.Selection.GetSelection().MoveToAncestorNode('A');
+	if(oLink)
+		FCK.Selection.SelectNode(oLink);
+	
 	// Translate the dialog box texts.
-	oEditor.FCKLanguageManager.TranslatePage(document) ;
+	oEditor.FCKLanguageManager.TranslatePage(document);
 
 	// Fill the Anchor Names and Ids combos.
-	LoadAnchorNamesAndIds() ;
+	LoadAnchorNamesAndIds();
 
 	// Load the selected link information (if any).
-	LoadSelection() ;
+	LoadSelection();
 
 	// Update the dialog box.
-	SetLinkType( GetE('cmbLinkType').value ) ;
+	SetLinkType(GetE('cmbLinkType').value);
 
 	// Show/Hide the "Browse Server" button.
-	GetE('divBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none' ;
+	GetE('divBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none';
 
 	// Show the initial dialog content.
-	GetE('divInfo').style.display = '' ;
+	GetE('divInfo').style.display = '';
 
 	// Set the actual uploader URL.
-	if ( FCKConfig.LinkUpload )
-		GetE('frmUpload').action = FCKConfig.LinkUploadURL ;
+	if(FCKConfig.LinkUpload)
+		GetE('frmUpload').action = FCKConfig.LinkUploadURL;
 
 	// Set the default target (from configuration).
-	SetDefaultTarget() ;
+	SetDefaultTarget();
 
 	// Activate the "OK" button.
-	dialog.SetOkButton( true ) ;
+	dialog.SetOkButton(true);
 
 	// Select the first field.
-	switch( GetE('cmbLinkType').value )
-	{
+	switch(GetE('cmbLinkType').value){
 		case 'url' :
-			SelectField( 'txtUrl' ) ;
-			break ;
+			SelectField('txtUrl');
+			break;
 		case 'email' :
-			SelectField( 'txtEMailAddress' ) ;
-			break ;
+			SelectField('txtEMailAddress');
+			break;
 		case 'anchor' :
-			if ( GetE('divSelAnchor').style.display != 'none' )
-				SelectField( 'cmbAnchorName' ) ;
-			else
-				SelectField( 'cmbLinkType' ) ;
+			if(GetE('divSelAnchor').style.display != 'none')
+				SelectField('cmbAnchorName'); else
+				SelectField('cmbLinkType');
 	}
 }
 
+if(window.addEventListener){
+	window.addEventListener('load', onLoad, false);
+} else {
+	window.attachEvent('onload', onLoad);
+}
+
 var bHasAnchors ;
 
 function LoadAnchorNamesAndIds()

Modified: trunk/htdocs/stc/fck/editor/js/fckeditorcode_gecko.js
===================================================================
--- trunk/htdocs/stc/fck/editor/js/fckeditorcode_gecko.js	2011-06-28 06:31:35 UTC (rev 19382)
+++ trunk/htdocs/stc/fck/editor/js/fckeditorcode_gecko.js	2011-06-28 07:25:38 UTC (rev 19383)
@@ -22,88 +22,11309 @@
  * can be found at "editor/_source".
  */
 
-var FCK_STATUS_NOTLOADED=window.parent.FCK_STATUS_NOTLOADED=0;var FCK_STATUS_ACTIVE=window.parent.FCK_STATUS_ACTIVE=1;var FCK_STATUS_COMPLETE=window.parent.FCK_STATUS_COMPLETE=2;var FCK_TRISTATE_OFF=window.parent.FCK_TRISTATE_OFF=0;var FCK_TRISTATE_ON=window.parent.FCK_TRISTATE_ON=1;var FCK_TRISTATE_DISABLED=window.parent.FCK_TRISTATE_DISABLED=-1;var FCK_UNKNOWN=window.parent.FCK_UNKNOWN=-9;var FCK_TOOLBARITEM_ONLYICON=window.parent.FCK_TOOLBARITEM_ONLYICON=0;var FCK_TOOLBARITEM_ONLYTEXT=window.parent.FCK_TOOLBARITEM_ONLYTEXT=1;var FCK_TOOLBARITEM_ICONTEXT=window.parent.FCK_TOOLBARITEM_ICONTEXT=2;var FCK_EDITMODE_WYSIWYG=window.parent.FCK_EDITMODE_WYSIWYG=0;var FCK_EDITMODE_SOURCE=window.parent.FCK_EDITMODE_SOURCE=1;var FCK_IMAGES_PATH='images/';var FCK_SPACER_PATH='images/spacer.gif';var CTRL=1000;var SHIFT=2000;var ALT=4000;var FCK_STYLE_BLOCK=0;var FCK_STYLE_INLINE=1;var FCK_STYLE_OBJECT=2;
-String.prototype.Contains=function(A){return (this.indexOf(A)>-1);};String.prototype.Equals=function(){var A=arguments;if (A.length==1&&A[0].pop) A=A[0];for (var i=0;i<A.length;i++){if (this==A[i]) return true;};return false;};String.prototype.IEquals=function(){var A=this.toUpperCase();var B=arguments;if (B.length==1&&B[0].pop) B=B[0];for (var i=0;i<B.length;i++){if (A==B[i].toUpperCase()) return true;};return false;};String.prototype.ReplaceAll=function(A,B){var C=this;for (var i=0;i<A.length;i++){C=C.replace(A[i],B[i]);};return C;};String.prototype.StartsWith=function(A){return (this.substr(0,A.length)==A);};String.prototype.EndsWith=function(A,B){var C=this.length;var D=A.length;if (D>C) return false;if (B){var E=new RegExp(A+'$','i');return E.test(this);}else return (D==0||this.substr(C-D,D)==A);};String.prototype.Remove=function(A,B){var s='';if (A>0) s=this.substring(0,A);if (A+B<this.length) s+=this.substring(A+B,this.length);return s;};String.prototype.Trim=function(){return this.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g,'');};String.prototype.LTrim=function(){return this.replace(/^[ \t\n\r]*/g,'');};String.prototype.RTrim=function(){return this.replace(/[ \t\n\r]*$/g,'');};String.prototype.ReplaceNewLineChars=function(A){return this.replace(/\n/g,A);};String.prototype.Replace=function(A,B,C){if (typeof B=='function'){return this.replace(A,function(){return B.apply(C||this,arguments);});}else return this.replace(A,B);};Array.prototype.IndexOf=function(A){for (var i=0;i<this.length;i++){if (this[i]==A) return i;};return-1;};
-var s=navigator.userAgent.toLowerCase();var FCKBrowserInfo={IsIE:/*@cc_on!@*/false,IsIE7:/*@cc_on!@*/false&&(parseInt(s.match(/msie (\d+)/)[1],10)>=7),IsIE6:/*@cc_on!@*/false&&(parseInt(s.match(/msie (\d+)/)[1],10)>=6),IsSafari:s.Contains(' applewebkit/'),IsOpera:!!window.opera,IsAIR:s.Contains(' adobeair/'),IsMac:s.Contains('macintosh')};(function(A){A.IsGecko=(navigator.product=='Gecko')&&!A.IsSafari&&!A.IsOpera;A.IsGeckoLike=(A.IsGecko||A.IsSafari||A.IsOpera);if (A.IsGecko){var B=s.match(/rv:(\d+\.\d+)/);var C=B&&parseFloat(B[1]);if (C){A.IsGecko10=(C<1.8);A.IsGecko19=(C>1.8);}}})(FCKBrowserInfo);
-var FCKURLParams={};(function(){var A=document.location.search.substr(1).split('&');for (var i=0;i<A.length;i++){var B=A[i].split('=');var C=decodeURIComponent(B[0]);var D=decodeURIComponent(B[1]);FCKURLParams[C]=D;}})();
-var FCKEvents=function(A){this.Owner=A;this._RegisteredEvents={};};FCKEvents.prototype.AttachEvent=function(A,B){var C;if (!(C=this._RegisteredEvents[A])) this._RegisteredEvents[A]=[B];else{if (C.IndexOf(B)==-1) C.push(B);}};FCKEvents.prototype.FireEvent=function(A,B){var C=true;var D=this._RegisteredEvents[A];if (D){for (var i=0;i<D.length;i++){try{C=(D[i](this.Owner,B)&&C);}catch(e){if (e.number!=-2146823277) throw e;}}};return C;};
-var FCKDataProcessor=function(){};FCKDataProcessor.prototype={ConvertToHtml:function(A){if (FCKConfig.FullPage){FCK.DocTypeDeclaration=A.match(FCKRegexLib.DocTypeTag);if (!FCKRegexLib.HasBodyTag.test(A)) A='<body>'+A+'</body>';if (!FCKRegexLib.HtmlOpener.test(A)) A='<html dir="'+FCKConfig.ContentLangDirection+'">'+A+'</html>';if (!FCKRegexLib.HeadOpener.test(A)) A=A.replace(FCKRegexLib.HtmlOpener,'$&<head><title></title></head>');return A;}else{var B=FCKConfig.DocType+'<html dir="'+FCKConfig.ContentLangDirection+'"';if (FCKBrowserInfo.IsIE&&FCKConfig.DocType.length>0&&!FCKRegexLib.Html4DocType.test(FCKConfig.DocType)) B+=' style="overflow-y: scroll"';B+='><head><title></title></head><body'+FCKConfig.GetBodyAttributes()+'>'+A+'</body></html>';return B;}},ConvertToDataFormat:function(A,B,C,D){var E=FCKXHtml.GetXHTML(A,!B,D);if (C&&FCKRegexLib.EmptyOutParagraph.test(E)) return '';return E;},FixHtml:function(A){return A;}};
-var FCK={Name:FCKURLParams['InstanceName'],Status:0,EditMode:0,Toolbar:null,HasFocus:false,DataProcessor:new FCKDataProcessor(),GetInstanceObject:(function(){var w=window;return function(name){return w[name];}})(),AttachToOnSelectionChange:function(A){this.Events.AttachEvent('OnSelectionChange',A);},GetLinkedFieldValue:function(){return this.LinkedField.value;},GetParentForm:function(){return this.LinkedField.form;},StartupValue:'',IsDirty:function(){if (this.EditMode==1) return (this.StartupValue!=this.EditingArea.Textarea.value);else{if (!this.EditorDocument) return false;return (this.StartupValue!=this.EditorDocument.body.innerHTML);}},ResetIsDirty:function(){if (this.EditMode==1) this.StartupValue=this.EditingArea.Textarea.value;else if (this.EditorDocument.body) this.StartupValue=this.EditorDocument.body.innerHTML;},StartEditor:function(){this.TempBaseTag=FCKConfig.BaseHref.length>0?'<base href="'+FCKConfig.BaseHref+'" _fcktemp="true"></base>':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};A.SetKeystrokes([CTRL+8,true]);this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=FCKConfig.FirefoxSpellChecker;this.SetData(this.GetLinkedFieldValue(),true);FCKTools.AddEventListener(document,"keydown",this._TabKeyHandler);this.AttachToOnSelectionChange(_FCK_PaddingNodeListener);if (FCKBrowserInfo.IsGecko) this.AttachToOnSelectionChange(this._ExecCheckEmptyBlock);},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:var G=D.nodeName.toLowerCase();if (!FCKListsLib.BlockElements[G]&&G!='li'&&!D.getAttribute('_fckfakelement')&&D.getAttribute('_moz_dirty')==null) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;break;case 8:if (E) F=true;break;};if (F){var H=D.parentNode;if (!E) E=H.insertBefore(B.createElement(A),D);E.appendChild(H.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetData:function(A){FCK.Events.FireEvent("OnBeforeGetData");if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B=FCK.EditorDocument;if (!B) return null;var C=FCKConfig.FullPage;var D=FCK.DataProcessor.ConvertToDataFormat(C?B.documentElement:B.body,!C,FCKConfig.IgnoreEmptyParagraphValue,A);D=FCK.ProtectEventsRestore(D);if (FCKBrowserInfo.IsIE) D=D.replace(FCKRegexLib.ToReplace,'$1');if (C){if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) D=FCK.DocTypeDeclaration+'\n'+D;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) D=FCK.XmlDeclaration+'\n'+D;};D=FCKConfig.ProtectedSource.Revert(D);setTimeout(function() { FCK.Events.FireEvent("OnAfterGetData");},0);return D;},UpdateLinkedField:function(){var A=FCK.GetXHTML(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) A=FCKTools.HTMLEncode(A);FCK.LinkedField.value=A;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName.toUpperCase()];if (B){for (var i=0;i<B.length;i++) B[i](A);};B=FCK.RegisteredDoubleClickHandlers['*'];if (B){for (var i=0;i<B.length;i++) B[i](A);}},RegisterDoubleClickHandler:function(A,B){var C=B||'*';C=C.toUpperCase();var D;if (!(D=FCK.RegisteredDoubleClickHandlers[C])) FCK.RegisteredDoubleClickHandlers[C]=[A];else{if (D.IndexOf(A)==-1) D.push(A);}},OnAfterSetHTML:function(){FCKDocumentProcessor.Process(FCK.EditorDocument);FCKUndo.SaveUndoStep();FCK.Events.FireEvent('OnSelectionChange');FCK.Events.FireEvent('OnAfterSetHTML');},ProtectUrls:function(A){A=A.replace(FCKRegexLib.ProtectUrlsA,'$& _fcksavedurl=$1');A=A.replace(FCKRegexLib.ProtectUrlsImg,'$& _fcksavedurl=$1');A=A.replace(FCKRegexLib.ProtectUrlsArea,'$& _fcksavedurl=$1');return A;},ProtectEvents:function(A){return A.replace(FCKRegexLib.TagsWithEvent,_FCK_ProtectEvents_ReplaceTags);},ProtectEventsRestore:function(A){return A.replace(FCKRegexLib.ProtectedEvents,_FCK_ProtectEvents_RestoreEvents);},ProtectTags:function(A){var B=FCKConfig.ProtectedTags;if (FCKBrowserInfo.IsIE) B+=B.length>0?'|ABBR|XML|EMBED|OBJECT':'ABBR|XML|EMBED|OBJECT';var C;if (B.length>0){C=new RegExp('<('+B+')(?!\w|:)','gi');A=A.replace(C,'<FCK:$1');C=new RegExp('<\/('+B+')>','gi');A=A.replace(C,'<\/FCK:$1>');};B='META';if (FCKBrowserInfo.IsIE) B+='|HR';C=new RegExp('<(('+B+')(?=\\s|>|/)[\\s\\S]*?)/?>','gi');A=A.replace(C,'<FCK:$1 />');return A;},SetData:function(A,B){this.EditingArea.Mode=FCK.EditMode;if (FCKBrowserInfo.IsIE&&FCK.EditorDocument){FCK.EditorDocument.detachEvent("onselectionchange",Doc_OnSelectionChange);};FCKTempBin.Reset();FCK.Selection.Release();if (FCK.EditMode==0){this._ForceResetIsDirty=(B===true);A=FCKConfig.ProtectedSource.Protect(A);A=FCK.DataProcessor.ConvertToHtml(A);A=A.replace(FCKRegexLib.InvalidSelfCloseTags,'$1></$2>');A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) A=A.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);var C='';if (!FCKConfig.FullPage) C+=_FCK_GetEditorAreaStyleTags();if (FCKBrowserInfo.IsIE) C+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) C+=FCKTools.GetStyleHtml(FCK_ShowTableBordersCSS,true);C+=FCKTools.GetStyleHtml(FCK_InternalCSS,true);A=A.replace(FCKRegexLib.HeadCloser,C+'$&');this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(A);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;FCKDomTools.PaddingNode=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;if (B) this.ResetIsDirty();FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (window.onresize) window.onresize();},RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C,D){if (!D) FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};if (!D) FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (FCKBrowserInfo.IsSafari&&FCK.EditorWindow&&A.IEquals('Paste')) return 0;if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else{return FCK.EditorDocument.queryCommandState(A)?1:0;}}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},Paste:function(A){if (FCK.Status!=2||!FCK.Events.FireEvent('OnPaste')) return false;return A||FCK._ExecPaste();},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) A=FCK.TempBaseTag+FCK.GetXHTML();else A=FCK.GetXHTML();}else{A=FCKConfig.DocType+'<html dir="'+FCKConfig.ContentLangDirection+'"><head>'+FCK.TempBaseTag+'<title>'+FCKLang.Preview+'</title>'+_FCK_GetEditorAreaStyleTags()+'</head><body'+FCKConfig.GetBodyAttributes()+'>'+FCK.GetXHTML()+'</body></html>';};var B=FCKConfig.ScreenWidth*0.8;var C=FCKConfig.ScreenHeight*0.7;var D=(FCKConfig.ScreenWidth-B)/2;var E='';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A;E='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.opener._FCKHtmlToLoad );document.close() ;window.opener._FCKHtmlToLoad = null ;})() )';};var F=window.open(E,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D);if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){F.document.write(A);F.document.close();}},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C=FCK.IsDirty();var D;if (B){FCKCommands.GetCommand('ShowBlocks').SaveState();if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();D=FCK.GetXHTML(FCKConfig.FormatSource);if (FCKBrowserInfo.IsIE) FCKTempBin.ToHtml();if (D==null) return false;}else D=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetData(D,!C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},InsertElement:function(A){if (typeof A=='string') A=this.EditorDocument.createElement(A);var B=A.nodeName.toLowerCase();FCKSelection.Restore();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();C.DeleteContents();if (FCKListsLib.BlockElements[B]!=null){if (C.StartBlock){if (C.CheckStartOfBlock()) C.MoveToPosition(C.StartBlock,3);else if (C.CheckEndOfBlock()) C.MoveToPosition(C.StartBlock,4);else C.SplitBlock();};C.InsertNode(A);var D=FCKDomTools.GetNextSourceElement(A,false,null,['hr','br','param','img','area','input'],true);if (!D&&FCKConfig.EnterMode!='br'){D=this.EditorDocument.body.appendChild(this.EditorDocument.createElement(FCKConfig.EnterMode));if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);};if (FCKListsLib.EmptyElements[B]==null) C.MoveToElementEditStart(A);else if (D) C.MoveToElementEditStart(D);else C.MoveToPosition(A,4);if (FCKBrowserInfo.IsGeckoLike){if (D) FCKDomTools.ScrollIntoView(D,false);FCKDomTools.ScrollIntoView(A,false);}}else{C.InsertNode(A);C.SetStart(A,4);C.SetEnd(A,4);};C.Select();C.Release();this.Focus();return A;},_InsertBlockElement:function(A){},_IsFunctionKey:function(A){if (A>=16&&A<=20) return true;if (A==27||(A>=33&&A<=40)) return true;if (A==45) return true;return false;},_KeyDownListener:function(A){if (!A) A=FCK.EditorWindow.event;if (FCK.EditorWindow){if (!FCK._IsFunctionKey(A.keyCode)&&!(A.ctrlKey||A.metaKey)&&!(A.keyCode==46)) FCK._KeyDownUndo();};return true;},_KeyDownUndo:function(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;FCKUndo.Changed=1;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}},_TabKeyHandler:function(A){if (!A) A=window.event;var B=A.keyCode;if (B==9&&FCK.EditMode!=0){if (FCKBrowserInfo.IsIE){var C=document.selection.createRange();if (C.parentElement()!=FCK.EditingArea.Textarea) return true;C.text='\t';C.select();}else{var a=[];var D=FCK.EditingArea.Textarea;var E=D.selectionStart;var F=D.selectionEnd;a.push(D.value.substr(0,E));a.push('\t');a.push(D.value.substr(F));D.value=a.join('');D.setSelectionRange(E+1,E+1);};if (A.preventDefault) return A.preventDefault();return A.returnValue=false;};return true;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML=FCK.GetData;FCK.SetHTML=FCK.SetData;FCK.InsertElementAndGetIt=FCK.CreateElement=FCK.InsertElement;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+encodeURIComponent(A)+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return decodeURIComponent(B);};function _FCK_MouseEventsListener(A){if (!A) A=window.event;if (A.type=='mousedown') FCK.MouseDownFlag=true;else if (A.type=='mouseup') FCK.MouseDownFlag=false;else if (A.type=='mousemove') FCK.Events.FireEvent('OnMouseMove',A);};function _FCK_PaddingNodeListener(){if (FCKConfig.EnterMode.IEquals('br')) return;FCKDomTools.EnforcePaddingNode(FCK.EditorDocument,FCKConfig.EnterMode);if (!FCKBrowserInfo.IsIE&&FCKDomTools.PaddingNode){var A=FCKSelection.GetSelection();if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.collapsed&&B.startContainer==FCK.EditorDocument.body&&B.startOffset==0){B.selectNodeContents(FCKDomTools.PaddingNode);B.collapse(true);A.removeAllRanges();A.addRange(B);}}}else if (FCKDomTools.PaddingNode){var C=FCKSelection.GetParentElement();var D=FCKDomTools.PaddingNode;if (C&&C.nodeName.IEquals('body')){if (FCK.EditorDocument.body.childNodes.length==1&&FCK.EditorDocument.body.firstChild==D){if (FCKSelection._GetSelectionDocument(FCK.EditorDocument.selection)!=FCK.EditorDocument) return;var B=FCK.EditorDocument.body.createTextRange();var F=false;if (!D.childNodes.firstChild){D.appendChild(FCKTools.GetElementDocument(D).createTextNode('\ufeff'));F=true;};B.moveToElementText(D);B.select();if (F) B.pasteHTML('');}}}};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;if (FCKBrowserInfo.IsIE) FCKTempBin.ToElements();FCK.InitializeBehaviors();FCK.MouseDownFlag=false;FCKTools.AddEventListener(FCK.EditorDocument,'mousemove',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mouseup',_FCK_MouseEventsListener);if (FCKBrowserInfo.IsSafari){FCKTools.AddEventListener(FCK.EditorDocument,'paste',function(evt){var A=new FCKDomRange(FCK.EditorWindow);var B=FCK.EditorDocument.createTextNode('\ufeff');var C=FCK.EditorDocument.createElement('a');C.id='fck_paste_padding';C.innerHTML='&#65279;';A.MoveToSelection();A.DeleteContents();A.InsertNode(B);A.Collapse();A.InsertNode(C);A.MoveToPosition(C,3);A.Select();setTimeout(function(){B.parentNode.removeChild(B);C=FCK.EditorDocument.getElementById('fck_paste_padding');C.parentNode.removeChild(C);},0);});};if (FCKBrowserInfo.IsSafari){var D=function(evt){if (!(evt.ctrlKey||evt.metaKey)) return;if (FCK.EditMode!=0) return;switch (evt.keyCode){case 89:FCKUndo.Redo();break;case 90:FCKUndo.Undo();break;}};FCKTools.AddEventListener(FCK.EditorDocument,'keyup',D);};FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode,FCKConfig.TabSpaces);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);if (FCK._ForceResetIsDirty) FCK.ResetIsDirty();if (FCKBrowserInfo.IsIE&&FCK.HasFocus) FCK.EditorDocument.body.setActive();FCK.OnAfterSetHTML();FCKCommands.GetCommand('ShowBlocks').RestoreState();if (FCK.Status!=0) return;FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){return FCKTools.GetStyleHtml(FCKConfig.EditorAreaCSS)+FCKTools.GetStyleHtml(FCKConfig.EditorAreaStyles);};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){switch (B){case 'Paste':return!FCK.Paste();case 'Cut':FCKUndo.SaveUndoStep();return false;}}else{if (B.Equals('Paste','Undo','Redo','SelectAll','Cut')) return false;};var C=FCK.Commands.GetCommand(B);if (C.GetState()==-1) return false;return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i<this.Elements.length) this.Elements[i++]=null;this.Elements.length=0;},ToHtml:function(){for (var i=0;i<this.Elements.length;i++){this.Elements[i]='<div>&nbsp;'+this.Elements[i].outerHTML+'</div>';this.Elements[i].isHtml=true;}},ToElements:function(){var A=FCK.EditorDocument.createElement('div');for (var i=0;i<this.Elements.length;i++){if (this.Elements[i].isHtml){A.innerHTML=this.Elements[i];this.Elements[i]=A.firstChild.removeChild(A.firstChild.lastChild);}}}};var FCKFocusManager=FCK.FocusManager={IsLocked:false,AddWindow:function(A,B){var C;if (FCKBrowserInfo.IsIE) C=A.nodeType==1?A:A.frameElement?A.frameElement:A.document;else if (FCKBrowserInfo.IsSafari) C=A;else C=A.document;FCKTools.AddEventListener(C,'blur',FCKFocusManager_Win_OnBlur);FCKTools.AddEventListener(C,'focus',B?FCKFocusManager_Win_OnFocus_Area:FCKFocusManager_Win_OnFocus);},RemoveWindow:function(A){if (FCKBrowserInfo.IsIE) oTarget=A.nodeType==1?A:A.frameElement?A.frameElement:A.document;else oTarget=A.document;FCKTools.RemoveEventListener(oTarget,'blur',FCKFocusManager_Win_OnBlur);FCKTools.RemoveEventListener(oTarget,'focus',FCKFocusManager_Win_OnFocus_Area);FCKTools.RemoveEventListener(oTarget,'focus',FCKFocusManager_Win_OnFocus);},Lock:function(){this.IsLocked=true;},Unlock:function(){if (this._HasPendingBlur) FCKFocusManager._Timer=window.setTimeout(FCKFocusManager_FireOnBlur,100);this.IsLocked=false;},_ResetTimer:function(){this._HasPendingBlur=false;if (this._Timer){window.clearTimeout(this._Timer);delete this._Timer;}}};function FCKFocusManager_Win_OnBlur(){if (typeof(FCK)!='undefined'&&FCK.HasFocus){FCKFocusManager._ResetTimer();FCKFocusManager._Timer=window.setTimeout(FCKFocusManager_FireOnBlur,100);}};function FCKFocusManager_FireOnBlur(){if (FCKFocusManager.IsLocked) FCKFocusManager._HasPendingBlur=true;else{FCK.HasFocus=false;FCK.Events.FireEvent("OnBlur");}};function FCKFocusManager_Win_OnFocus_Area(){if (FCKFocusManager._IsFocusing) return;FCKFocusManager._IsFocusing=true;FCK.Focus();FCKFocusManager_Win_OnFocus();FCKTools.RunFunction(function(){delete FCKFocusManager._IsFocusing;});};function FCKFocusManager_Win_OnFocus(){FCKFocusManager._ResetTimer();if (!FCK.HasFocus&&!FCKFocusManager.IsLocked){FCK.HasFocus=true;FCK.Events.FireEvent("OnFocus");}};(function(){var A=window.frameElement;var B=A.width;var C=A.height;if (/^\d+$/.test(B)) B+='px';if (/^\d+$/.test(C)) C+='px';var D=A.style;D.border=D.padding=D.margin=0;D.backgroundColor='transparent';D.backgroundImage='none';D.width=B;D.height=C;})();
-FCK.Description="FCKeditor for Gecko Browsers";FCK.InitializeBehaviors=function(){if (window.onresize) window.onresize();FCKFocusManager.AddWindow(this.EditorWindow);this.ExecOnSelectionChange=function(){FCK.Events.FireEvent("OnSelectionChange");};this._ExecDrop=function(evt){if (FCK.MouseDownFlag){FCK.MouseDownFlag=false;return;};if (FCKConfig.ForcePasteAsPlainText){if (evt.dataTransfer){var A=evt.dataTransfer.getData('Text');A=FCKTools.HTMLEncode(A);A=FCKTools.ProcessLineBreaks(window,FCKConfig,A);FCK.InsertHtml(A);}else if (FCKConfig.ShowDropDialog) FCK.PasteAsPlainText();evt.preventDefault();evt.stopPropagation();}};this._ExecCheckCaret=function(evt){if (FCK.EditMode!=0) return;if (evt.type=='keypress'){var B=evt.keyCode;if (B<33||B>40) return;};var C=function(H){if (H.nodeType!=1) return false;var D=H.tagName.toLowerCase();return (FCKListsLib.BlockElements[D]||FCKListsLib.EmptyElements[D]);};var E=function(){var F=FCKSelection.GetSelection();var G=F.getRangeAt(0);if (!G||!G.collapsed) return;var H=G.endContainer;if (H.nodeType!=3) return;if (H.nodeValue.length!=G.endOffset) return;var I=H.parentNode.tagName.toLowerCase();if (!(I=='a'||(!FCKBrowserInfo.IsOpera&&String(H.parentNode.contentEditable)=='false')||(!(FCKListsLib.BlockElements[I]||FCKListsLib.NonEmptyBlockElements[I])&&B==35))) return;var J=FCKTools.GetNextTextNode(H,H.parentNode,C);if (J) return;G=FCK.EditorDocument.createRange();J=FCKTools.GetNextTextNode(H,H.parentNode.parentNode,C);if (J){if (FCKBrowserInfo.IsOpera&&B==37) return;G.setStart(J,0);G.setEnd(J,0);}else{while (H.parentNode&&H.parentNode!=FCK.EditorDocument.body&&H.parentNode!=FCK.EditorDocument.documentElement&&H==H.parentNode.lastChild&&(!FCKListsLib.BlockElements[H.parentNode.tagName.toLowerCase()]&&!FCKListsLib.NonEmptyBlockElements[H.parentNode.tagName.toLowerCase()])) H=H.parentNode;if (FCKListsLib.BlockElements[I]||FCKListsLib.EmptyElements[I]||H==FCK.EditorDocument.body){G.setStart(H,H.childNodes.length);G.setEnd(H,H.childNodes.length);}else{var K=H.nextSibling;while (K){if (K.nodeType!=1){K=K.nextSibling;continue;};var L=K.tagName.toLowerCase();if (FCKListsLib.BlockElements[L]||FCKListsLib.EmptyElements[L]||FCKListsLib.NonEmptyBlockElements[L]) break;K=K.nextSibling;};var M=FCK.EditorDocument.createTextNode('');if (K) H.parentNode.insertBefore(M,K);else H.parentNode.appendChild(M);G.setStart(M,0);G.setEnd(M,0);}};F.removeAllRanges();F.addRange(G);FCK.Events.FireEvent("OnSelectionChange");};setTimeout(E,1);};this.ExecOnSelectionChangeTimer=function(){if (FCK.LastOnChangeTimer) window.clearTimeout(FCK.LastOnChangeTimer);FCK.LastOnChangeTimer=window.setTimeout(FCK.ExecOnSelectionChange,100);};this.EditorDocument.addEventListener('mouseup',this.ExecOnSelectionChange,false);this.EditorDocument.addEventListener('keyup',this.ExecOnSelectionChangeTimer,false);this._DblClickListener=function(e){FCK.OnDoubleClick(e.target);e.stopPropagation();};this.EditorDocument.addEventListener('dblclick',this._DblClickListener,true);this.EditorDocument.addEventListener('keydown',this._KeyDownListener,false);if (FCKBrowserInfo.IsGecko){this.EditorWindow.addEventListener('dragdrop',this._ExecDrop,true);}else if (FCKBrowserInfo.IsSafari){this.EditorDocument.addEventListener('dragover',function (evt){ if (!FCK.MouseDownFlag&&FCK.Config.ForcePasteAsPlainText) evt.returnValue=false;},true);this.EditorDocument.addEventListener('drop',this._ExecDrop,true);this.EditorDocument.addEventListener('mousedown',function(ev){var N=ev.srcElement;if (N.nodeName.IEquals('IMG','HR','INPUT','TEXTAREA','SELECT')){FCKSelection.SelectNode(N);}},true);this.EditorDocument.addEventListener('mouseup',function(ev){if (ev.srcElement.nodeName.IEquals('INPUT','TEXTAREA','SELECT')) ev.preventDefault()},true);this.EditorDocument.addEventListener('click',function(ev){if (ev.srcElement.nodeName.IEquals('INPUT','TEXTAREA','SELECT')) ev.preventDefault()},true);};if (FCKBrowserInfo.IsGecko||FCKBrowserInfo.IsOpera){this.EditorDocument.addEventListener('keypress',this._ExecCheckCaret,false);this.EditorDocument.addEventListener('click',this._ExecCheckCaret,false);};FCK.ContextMenu._InnerContextMenu.SetMouseClickWindow(FCK.EditorWindow);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument);};FCK.MakeEditable=function(){this.EditingArea.MakeEditable();};function Document_OnContextMenu(e){if (!e.target._FCKShowContextMenu) e.preventDefault();};document.oncontextmenu=Document_OnContextMenu;FCK._BaseGetNamedCommandState=FCK.GetNamedCommandState;FCK.GetNamedCommandState=function(A){switch (A){case 'Unlink':return FCKSelection.HasAncestorNode('A')?0:-1;default:return FCK._BaseGetNamedCommandState(A);}};FCK.RedirectNamedCommands={Print:true,Paste:true};FCK.ExecuteRedirectedNamedCommand=function(A,B){switch (A){case 'Print':FCK.EditorWindow.print();break;case 'Paste':try{if (FCKBrowserInfo.IsSafari) throw '';if (FCK.Paste()) FCK.ExecuteNamedCommand('Paste',null,true);}catch (e)	{if (FCKConfig.ForcePasteAsPlainText) FCK.PasteAsPlainText();else FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security');};break;default:FCK.ExecuteNamedCommand(A,B);}};FCK._ExecPaste=function(){FCKUndo.SaveUndoStep();if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};return true;};FCK.InsertHtml=function(A){var B=FCK.EditorDocument,range;A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGecko){A=A.replace(/&nbsp;$/,'$&<span _fcktemp="1"/>');var C=new FCKDocumentFragment(this.EditorDocument);C.AppendHtml(A);var D=C.RootNode.lastChild;range=new FCKDomRange(this.EditorWindow);range.MoveToSelection();var E=C.RootNode.firstChild;while (E&&E.nodeType!=1) E=E.nextSibling;if (E&&FCKListsLib.BlockElements[E.nodeName.toLowerCase()]) range.SplitBlock();range.DeleteContents();range.InsertNode(C.RootNode);range.MoveToPosition(D,4);}else B.execCommand('inserthtml',false,A);this.Focus();if (!range){range=new FCKDomRange(this.EditorWindow);range.MoveToSelection();};var F=range.CreateBookmark();FCKDocumentProcessor.Process(B);try{range.MoveToBookmark(F);range.Sel...
 (truncated)
Tags: b_vladi, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments