Subversion Repositories Applications.papyrus

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1074 → Rev 1075

/trunk/api/fckeditor/editor/plugins/placeholder/lang/en.js
New file
0,0 → 1,23
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: en.js
* Placholder English language file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
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' ;
/trunk/api/fckeditor/editor/plugins/placeholder/lang/fr.js
New file
0,0 → 1,23
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fr.js
* Placholder Italian language file.
*
* File Authors:
* Hubert Garrido (liane@users.sourceforge.net)
*/
FCKLang.PlaceholderBtn = 'Insérer/Modifier Substitut' ;
FCKLang.PlaceholderDlgTitle = 'Propriétés de Substitut' ;
FCKLang.PlaceholderDlgName = 'Nom de Substitut' ;
FCKLang.PlaceholderErrNoName = 'Veuillez saisir le nom de Substitut' ;
FCKLang.PlaceholderErrNameInUse = 'Ce nom est déjà utilisé' ;
/trunk/api/fckeditor/editor/plugins/placeholder/lang/de.js
New file
0,0 → 1,23
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: de.js
* Placholder German language file.
*
* File Authors:
* José Fontanil
*/
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' ;
/trunk/api/fckeditor/editor/plugins/placeholder/lang/pl.js
New file
0,0 → 1,23
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: pl.js
* Placholder Polish language file.
*
* File Authors:
* Marcin Pietrzak (fck@iworks.pl)
*/
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' ;
/trunk/api/fckeditor/editor/plugins/placeholder/lang/it.js
New file
0,0 → 1,23
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: it.js
* Placholder Italian language file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
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' ;
/trunk/api/fckeditor/editor/plugins/placeholder/placeholder.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/fckeditor/editor/plugins/placeholder/placeholder.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/fckeditor/editor/plugins/placeholder/fck_placeholder.html
New file
0,0 → 1,96
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_placeholder.html
* Placeholder Plugin.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<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>
/trunk/api/fckeditor/editor/plugins/placeholder/fckplugin.js
New file
0,0 → 1,175
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckplugin.js
* Plugin to insert "Placeholders" in the editor.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// 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.CreateElement( '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 ;
}
}
 
if ( FCKBrowserInfo.IsIE )
{
FCKPlaceholders.Redraw = function()
{
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()
{
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 ;
}