Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1050616
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jul 3, 5:19 AM
Size
7 KB
Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:19 AM (1 d, 17 h)
Engine
blob
Format
Raw Data
Handle
678836
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js
===================================================================
--- trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js (revision 2844)
+++ trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js (revision 2845)
@@ -1,231 +1,231 @@
/*
* 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() ;
var oWindow = new Object() ;
FCK.ExecuteNamedCommand = function( commandName, commandParameter )
{
if ( FCK.RedirectNamedCommands[ commandName ] != null ) {
FCK.ExecuteRedirectedNamedCommand( commandName, commandParameter ) ;
}
else
{
FCK.Focus() ;
//alert(commandName);
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 'Unlink' :
oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
if (oLink)
return FCK.EditorDocument.queryCommandState( commandName ) ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ;
else
return FCK_TRISTATE_DISABLED;
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
html = html.replace(/ /, " " );
// 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>" ) ;
+ //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.ProjectPath+'/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 {
if (typeof(FCKConfig.preview_width) != 'undefined' && typeof(FCKConfig.preview_height) != 'undefined' && FCKConfig.preview_width > 0 && FCKConfig.preview_height > 0)
var oWindowE = window.open( '', null, 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+FCKConfig.preview_width+',height='+FCKConfig.preview_height ) ;
else
var oWindowE = 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>' ;
oWindowE.document.write( sHTML );
oWindowE.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() ;
if (typeof(FCKConfig.newBgColor) != 'undefined')
FCK.EditorDocument.bgColor = FCKConfig.newBgColor;
// 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.12
\ No newline at end of property
+1.13
\ No newline at end of property
Event Timeline
Log In to Comment