initial commit
This commit is contained in:
commit
252dac3143
1516 changed files with 694271 additions and 0 deletions
100
FCKeditor/editor/plugins/placeholder/fck_placeholder.html
Normal file
100
FCKeditor/editor/plugins/placeholder/fck_placeholder.html
Normal file
|
@ -0,0 +1,100 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<!--
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Placeholder Plugin.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Placeholder Properties</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta content="noindex, nofollow" name="robots">
|
||||
<script language="javascript">
|
||||
|
||||
var oEditor = window.parent.InnerDialogLoaded() ;
|
||||
var FCKLang = oEditor.FCKLang ;
|
||||
var FCKPlaceholders = oEditor.FCKPlaceholders ;
|
||||
|
||||
window.onload = function ()
|
||||
{
|
||||
// First of all, translate the dialog box texts
|
||||
oEditor.FCKLanguageManager.TranslatePage( document ) ;
|
||||
|
||||
LoadSelected() ;
|
||||
|
||||
// Show the "Ok" button.
|
||||
window.parent.SetOkButton( true ) ;
|
||||
}
|
||||
|
||||
var eSelected = oEditor.FCKSelection.GetSelectedElement() ;
|
||||
|
||||
function LoadSelected()
|
||||
{
|
||||
if ( !eSelected )
|
||||
return ;
|
||||
|
||||
if ( eSelected.tagName == 'SPAN' && eSelected._fckplaceholder )
|
||||
document.getElementById('txtName').value = eSelected._fckplaceholder ;
|
||||
else
|
||||
eSelected == null ;
|
||||
}
|
||||
|
||||
function Ok()
|
||||
{
|
||||
var sValue = document.getElementById('txtName').value ;
|
||||
|
||||
if ( eSelected && eSelected._fckplaceholder == sValue )
|
||||
return true ;
|
||||
|
||||
if ( sValue.length == 0 )
|
||||
{
|
||||
alert( FCKLang.PlaceholderErrNoName ) ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
if ( FCKPlaceholders.Exist( sValue ) )
|
||||
{
|
||||
alert( FCKLang.PlaceholderErrNameInUse ) ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
FCKPlaceholders.Add( sValue ) ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body scroll="no" style="OVERFLOW: hidden">
|
||||
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<table cellSpacing="0" cellPadding="0" align="center" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<span fckLang="PlaceholderDlgName">Placeholder Name</span><br>
|
||||
<input id="txtName" type="text">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
187
FCKeditor/editor/plugins/placeholder/fckplugin.js
Normal file
187
FCKeditor/editor/plugins/placeholder/fckplugin.js
Normal file
|
@ -0,0 +1,187 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Plugin to insert "Placeholders" in the editor.
|
||||
*/
|
||||
|
||||
// Register the related command.
|
||||
FCKCommands.RegisterCommand( 'Placeholder', new FCKDialogCommand( 'Placeholder', FCKLang.PlaceholderDlgTitle, FCKPlugins.Items['placeholder'].Path + 'fck_placeholder.html', 340, 170 ) ) ;
|
||||
|
||||
// Create the "Plaholder" toolbar button.
|
||||
var oPlaceholderItem = new FCKToolbarButton( 'Placeholder', FCKLang.PlaceholderBtn ) ;
|
||||
oPlaceholderItem.IconPath = FCKPlugins.Items['placeholder'].Path + 'placeholder.gif' ;
|
||||
|
||||
FCKToolbarItems.RegisterItem( 'Placeholder', oPlaceholderItem ) ;
|
||||
|
||||
|
||||
// The object used for all Placeholder operations.
|
||||
var FCKPlaceholders = new Object() ;
|
||||
|
||||
// Add a new placeholder at the actual selection.
|
||||
FCKPlaceholders.Add = function( name )
|
||||
{
|
||||
var oSpan = FCK.InsertElement( 'span' ) ;
|
||||
this.SetupSpan( oSpan, name ) ;
|
||||
}
|
||||
|
||||
FCKPlaceholders.SetupSpan = function( span, name )
|
||||
{
|
||||
span.innerHTML = '[[ ' + name + ' ]]' ;
|
||||
|
||||
span.style.backgroundColor = '#ffff00' ;
|
||||
span.style.color = '#000000' ;
|
||||
|
||||
if ( FCKBrowserInfo.IsGecko )
|
||||
span.style.cursor = 'default' ;
|
||||
|
||||
span._fckplaceholder = name ;
|
||||
span.contentEditable = false ;
|
||||
|
||||
// To avoid it to be resized.
|
||||
span.onresizestart = function()
|
||||
{
|
||||
FCK.EditorWindow.event.returnValue = false ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
// On Gecko we must do this trick so the user select all the SPAN when clicking on it.
|
||||
FCKPlaceholders._SetupClickListener = function()
|
||||
{
|
||||
FCKPlaceholders._ClickListener = function( e )
|
||||
{
|
||||
if ( e.target.tagName == 'SPAN' && e.target._fckplaceholder )
|
||||
FCKSelection.SelectNode( e.target ) ;
|
||||
}
|
||||
|
||||
FCK.EditorDocument.addEventListener( 'click', FCKPlaceholders._ClickListener, true ) ;
|
||||
}
|
||||
|
||||
// Open the Placeholder dialog on double click.
|
||||
FCKPlaceholders.OnDoubleClick = function( span )
|
||||
{
|
||||
if ( span.tagName == 'SPAN' && span._fckplaceholder )
|
||||
FCKCommands.GetCommand( 'Placeholder' ).Execute() ;
|
||||
}
|
||||
|
||||
FCK.RegisterDoubleClickHandler( FCKPlaceholders.OnDoubleClick, 'SPAN' ) ;
|
||||
|
||||
// Check if a Placholder name is already in use.
|
||||
FCKPlaceholders.Exist = function( name )
|
||||
{
|
||||
var aSpans = FCK.EditorDocument.getElementsByTagName( 'SPAN' ) ;
|
||||
|
||||
for ( var i = 0 ; i < aSpans.length ; i++ )
|
||||
{
|
||||
if ( aSpans[i]._fckplaceholder == name )
|
||||
return true ;
|
||||
}
|
||||
|
||||
return false ;
|
||||
}
|
||||
|
||||
if ( FCKBrowserInfo.IsIE )
|
||||
{
|
||||
FCKPlaceholders.Redraw = function()
|
||||
{
|
||||
if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
|
||||
return ;
|
||||
|
||||
var aPlaholders = FCK.EditorDocument.body.innerText.match( /\[\[[^\[\]]+\]\]/g ) ;
|
||||
if ( !aPlaholders )
|
||||
return ;
|
||||
|
||||
var oRange = FCK.EditorDocument.body.createTextRange() ;
|
||||
|
||||
for ( var i = 0 ; i < aPlaholders.length ; i++ )
|
||||
{
|
||||
if ( oRange.findText( aPlaholders[i] ) )
|
||||
{
|
||||
var sName = aPlaholders[i].match( /\[\[\s*([^\]]*?)\s*\]\]/ )[1] ;
|
||||
oRange.pasteHTML( '<span style="color: #000000; background-color: #ffff00" contenteditable="false" _fckplaceholder="' + sName + '">' + aPlaholders[i] + '</span>' ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FCKPlaceholders.Redraw = function()
|
||||
{
|
||||
if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
|
||||
return ;
|
||||
|
||||
var oInteractor = FCK.EditorDocument.createTreeWalker( FCK.EditorDocument.body, NodeFilter.SHOW_TEXT, FCKPlaceholders._AcceptNode, true ) ;
|
||||
|
||||
var aNodes = new Array() ;
|
||||
|
||||
while ( ( oNode = oInteractor.nextNode() ) )
|
||||
{
|
||||
aNodes[ aNodes.length ] = oNode ;
|
||||
}
|
||||
|
||||
for ( var n = 0 ; n < aNodes.length ; n++ )
|
||||
{
|
||||
var aPieces = aNodes[n].nodeValue.split( /(\[\[[^\[\]]+\]\])/g ) ;
|
||||
|
||||
for ( var i = 0 ; i < aPieces.length ; i++ )
|
||||
{
|
||||
if ( aPieces[i].length > 0 )
|
||||
{
|
||||
if ( aPieces[i].indexOf( '[[' ) == 0 )
|
||||
{
|
||||
var sName = aPieces[i].match( /\[\[\s*([^\]]*?)\s*\]\]/ )[1] ;
|
||||
|
||||
var oSpan = FCK.EditorDocument.createElement( 'span' ) ;
|
||||
FCKPlaceholders.SetupSpan( oSpan, sName ) ;
|
||||
|
||||
aNodes[n].parentNode.insertBefore( oSpan, aNodes[n] ) ;
|
||||
}
|
||||
else
|
||||
aNodes[n].parentNode.insertBefore( FCK.EditorDocument.createTextNode( aPieces[i] ) , aNodes[n] ) ;
|
||||
}
|
||||
}
|
||||
|
||||
aNodes[n].parentNode.removeChild( aNodes[n] ) ;
|
||||
}
|
||||
|
||||
FCKPlaceholders._SetupClickListener() ;
|
||||
}
|
||||
|
||||
FCKPlaceholders._AcceptNode = function( node )
|
||||
{
|
||||
if ( /\[\[[^\[\]]+\]\]/.test( node.nodeValue ) )
|
||||
return NodeFilter.FILTER_ACCEPT ;
|
||||
else
|
||||
return NodeFilter.FILTER_SKIP ;
|
||||
}
|
||||
}
|
||||
|
||||
FCK.Events.AttachEvent( 'OnAfterSetHTML', FCKPlaceholders.Redraw ) ;
|
||||
|
||||
// We must process the SPAN tags to replace then with the real resulting value of the placeholder.
|
||||
FCKXHtml.TagProcessors['span'] = function( node, htmlNode )
|
||||
{
|
||||
if ( htmlNode._fckplaceholder )
|
||||
node = FCKXHtml.XML.createTextNode( '[[' + htmlNode._fckplaceholder + ']]' ) ;
|
||||
else
|
||||
FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
|
||||
|
||||
return node ;
|
||||
}
|
27
FCKeditor/editor/plugins/placeholder/lang/de.js
Normal file
27
FCKeditor/editor/plugins/placeholder/lang/de.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Placholder German language file.
|
||||
*/
|
||||
FCKLang.PlaceholderBtn = 'Einfügen/editieren Platzhalter' ;
|
||||
FCKLang.PlaceholderDlgTitle = 'Platzhalter Eigenschaften' ;
|
||||
FCKLang.PlaceholderDlgName = 'Platzhalter Name' ;
|
||||
FCKLang.PlaceholderErrNoName = 'Bitte den Namen des Platzhalters schreiben' ;
|
||||
FCKLang.PlaceholderErrNameInUse = 'Der angegebene Namen ist schon in Gebrauch' ;
|
27
FCKeditor/editor/plugins/placeholder/lang/en.js
Normal file
27
FCKeditor/editor/plugins/placeholder/lang/en.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Placholder English language file.
|
||||
*/
|
||||
FCKLang.PlaceholderBtn = 'Insert/Edit Placeholder' ;
|
||||
FCKLang.PlaceholderDlgTitle = 'Placeholder Properties' ;
|
||||
FCKLang.PlaceholderDlgName = 'Placeholder Name' ;
|
||||
FCKLang.PlaceholderErrNoName = 'Please type the placeholder name' ;
|
||||
FCKLang.PlaceholderErrNameInUse = 'The specified name is already in use' ;
|
27
FCKeditor/editor/plugins/placeholder/lang/fr.js
Normal file
27
FCKeditor/editor/plugins/placeholder/lang/fr.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Placeholder French language file.
|
||||
*/
|
||||
FCKLang.PlaceholderBtn = "Insérer/Modifier l'Espace réservé" ;
|
||||
FCKLang.PlaceholderDlgTitle = "Propriétés de l'Espace réservé" ;
|
||||
FCKLang.PlaceholderDlgName = "Nom de l'Espace réservé" ;
|
||||
FCKLang.PlaceholderErrNoName = "Veuillez saisir le nom de l'Espace réservé" ;
|
||||
FCKLang.PlaceholderErrNameInUse = "Ce nom est déjà utilisé" ;
|
27
FCKeditor/editor/plugins/placeholder/lang/it.js
Normal file
27
FCKeditor/editor/plugins/placeholder/lang/it.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Placholder Italian language file.
|
||||
*/
|
||||
FCKLang.PlaceholderBtn = 'Aggiungi/Modifica Placeholder' ;
|
||||
FCKLang.PlaceholderDlgTitle = 'Proprietà del Placeholder' ;
|
||||
FCKLang.PlaceholderDlgName = 'Nome del Placeholder' ;
|
||||
FCKLang.PlaceholderErrNoName = 'Digitare il nome del placeholder' ;
|
||||
FCKLang.PlaceholderErrNameInUse = 'Il nome inserito è già in uso' ;
|
27
FCKeditor/editor/plugins/placeholder/lang/pl.js
Normal file
27
FCKeditor/editor/plugins/placeholder/lang/pl.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Placholder Polish language file.
|
||||
*/
|
||||
FCKLang.PlaceholderBtn = 'Wstaw/Edytuj nagłówek' ;
|
||||
FCKLang.PlaceholderDlgTitle = 'Właśności nagłówka' ;
|
||||
FCKLang.PlaceholderDlgName = 'Nazwa nagłówka' ;
|
||||
FCKLang.PlaceholderErrNoName = 'Proszę wprowadzić nazwę nagłówka' ;
|
||||
FCKLang.PlaceholderErrNameInUse = 'Podana nazwa jest już w użyciu' ;
|
BIN
FCKeditor/editor/plugins/placeholder/placeholder.gif
Normal file
BIN
FCKeditor/editor/plugins/placeholder/placeholder.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 96 B |
Loading…
Add table
Add a link
Reference in a new issue