Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Feb 2, 6:48 PM

in-portal

Index: trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js
===================================================================
--- trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js (revision 1728)
+++ trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js (revision 1729)
@@ -1,236 +1,236 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: fck_2.js
* This is the second part of the "FCK" object creation. This is the main
* object that represents an editor instance.
*
* Version: 2.0 RC3
* Modified: 2005-03-02 10:44:27
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
// This collection is used by the browser specific implementations to tell
// wich named commands must be handled separately.
FCK.RedirectNamedCommands = new Object() ;
FCK.ExecuteNamedCommand = function( commandName, commandParameter )
{
if ( FCK.RedirectNamedCommands[ commandName ] != null ) {
FCK.ExecuteRedirectedNamedCommand( commandName, commandParameter ) ;
}
else
{
FCK.Focus() ;
//alert(commandName);
if (commandName == "Undo")
{
if (confirm("This will delete everything on this page. Are you sure?"))
FCK.EditorDocument.execCommand( commandName, false, commandParameter ) ;
} else
FCK.EditorDocument.execCommand( commandName, false, commandParameter ) ;
FCK.Events.FireEvent( 'OnSelectionChange' ) ;
}
}
FCK.GetNamedCommandState = function( commandName )
{
try
{
if (commandName == 'InsertHorizontalRule')
return FCK_TRISTATE_OFF;
if ( !FCK.EditorDocument.queryCommandEnabled( commandName ) )
return FCK_TRISTATE_DISABLED ;
else {
switch ( commandName )
{
/*
case 'CreateLink' :
case 'Unlink' :
oDocument = FCK.Selection.MoveToAncestorNode( 'A' ) ;
if ( oDocument )
{
//FCK.Selection.MoveToNode( oDocument ) ;
if (oDocument.getAttribute('label',2) == 'Doc')
return FCK_TRISTATE_DISABLED;
else
return FCK.EditorDocument.queryCommandState( commandName ) ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ;
} else
return FCK.EditorDocument.queryCommandState( commandName ) ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ;
break;
*/
default:
return FCK.EditorDocument.queryCommandState( commandName ) ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ;
}
}
}
catch ( e )
{
return FCK_TRISTATE_OFF ;
}
}
FCK.GetNamedCommandValue = function( commandName )
{
var sValue = '' ;
var eState = FCK.GetNamedCommandState( commandName ) ;
if ( eState == FCK_TRISTATE_DISABLED )
return null ;
try
{
sValue = this.EditorDocument.queryCommandValue( commandName ) ;
}
catch(e) {}
return sValue ? sValue : '' ;
}
FCK.CleanAndPaste = function( html )
{
// Remove all SPAN tags
html = html.replace(/<\/?SPAN[^>]*>/gi, "" );
// Remove Class attributes
html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
// Remove Style attributes
html = html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ;
// Remove Lang attributes
html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
// Remove XML elements and declarations
html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
// Remove Tags with XML namespace declarations: <o:p></o:p>
html = html.replace(/<\/?\w+:[^>]*>/gi, "") ;
// Replace the &nbsp;
html = html.replace(/&nbsp;/, " " );
// Transform <P> to <DIV>
var re = new RegExp("(<P)([^>]*>.*?)(<\/P>)","gi") ; // Different because of a IE 5.0 error
html = html.replace( re, "<div$2</div>" ) ;
FCK.InsertHtml( html ) ;
}
/*
FCK.Preview = function()
{
if (typeof(FCKConfig.template_name) != 'undefined' && FCKConfig.template_name != '')
{
var oWindow = window.open(FCKConfig.project_path+'index.php?t='+FCKConfig.template_name, 'prewiev', 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes') ;
if ( FCKBrowserInfo.IsIE ) {
oWindow.attachEvent( "onload", FCK.SetPreview ) ;
}
else
oWindow.addEventListener( 'load', this.SetPreview, true ) ;
} else {
var oWindow = window.open( '', null, 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes' ) ;
var sHTML = '<html><head><link href="' + FCKConfig.EditorAreaCSS + '" rel="stylesheet" type="text/css" /></head><body>' + FCK.GetHTML() + '</body></html>' ;
oWindow.document.write( sHTML );
oWindow.document.close();
}
}
FCK.SetPreview = function()
{
oWindow.document.getElementById('block_'+FCKConfig.block_id).innerHTML = FCK.GetHTML();
}
function show_props(obj, objName) {
var result = "";
for (var i in obj) {
result = objName + "." + i + " = " + obj[i] + " \n";
alert(result);
}
//return result;
}
*/
FCK.Preview = function()
{
if (typeof(FCKConfig.template_name) != 'undefined' && FCKConfig.template_name != '')
{
oWindow = window.open(FCKConfig.project_path+'index.php?t='+FCKConfig.template_name, 'prewiev', 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes') ;
if ( FCKBrowserInfo.IsIE ) {
oWindow.attachEvent( "onload", FCK.SetPreview ) ;
}
else
oWindow.addEventListener( 'load', FCK.SetPreview, true ) ;
return ;
}
else {
- var oWindow_2 = window.open( '', null, 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes' ) ;
+ var oWindow = window.open( '', null, 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes' ) ;
var sHTML = '<html><head><link href="' + FCKConfig.EditorAreaCSS + '" rel="stylesheet" type="text/css" /></head><body>' + FCK.GetHTML() + '</body></html>' ;
oWindow_2.document.write( sHTML );
oWindow_2.document.close();
}
}
FCK.SetPreview = function()
{
oWindow.document.getElementById('block_'+FCKConfig.block_id).innerHTML = FCK.GetHTML();
}
FCK.SwitchEditMode = function()
{
// Check if the actual mode is WYSIWYG.
var bWYSIWYG = ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) ;
// Display/Hide the TRs.
document.getElementById('eWysiwyg').style.display = bWYSIWYG ? 'none' : '' ;
document.getElementById('eSource').style.display = bWYSIWYG ? '' : 'none' ;
// Update the HTML in the view output to show.
if ( bWYSIWYG )
document.getElementById('eSourceField').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ;
else
FCK.SetHTML( FCK.GetHTML(), true ) ;
// Updates the actual mode status.
FCK.EditMode = bWYSIWYG ? FCK_EDITMODE_SOURCE : FCK_EDITMODE_WYSIWYG ;
// Update the toolbar.
FCKToolbarSet.RefreshModeState() ;
// Set the Focus.
FCK.Focus() ;
}
FCK.CreateElement = function( tag )
{
var e = FCK.EditorDocument.createElement( tag ) ;
return FCK.InsertElementAndGetIt( e ) ;
}
FCK.InsertElementAndGetIt = function( e )
{
e.setAttribute( '__FCKTempLabel', 1 ) ;
this.InsertElement( e ) ;
var aEls = FCK.EditorDocument.getElementsByTagName( e.tagName ) ;
for ( var i = 0 ; i < aEls.length ; i++ )
{
if ( aEls[i].getAttribute( '__FCKTempLabel' ) )
{
aEls[i].removeAttribute( '__FCKTempLabel' ) ;
return aEls[i] ;
}
}
}
Property changes on: trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property

Event Timeline