1
/* vim: set expandtab tabstop=4 shiftwidth=4: */
2
// +----------------------------------------------------------------------+
4
// +----------------------------------------------------------------------+
5
// | Copyright (c) 2000-2004 WS Interactive |
6
// | Copyright (c) 2000-2004 Antoine Pouch |
7
// +----------------------------------------------------------------------+
8
// | This source file is subject to version 2.0 of the GPL license, |
9
// | or (at your discretion) to version 3.0 of the PHP license. |
10
// | The first is bundled with this package in the file LICENSE-GPL, and |
11
// | is available at through the world-wide-web at |
12
// | http://www.gnu.org/copyleft/gpl.html. |
13
// | The later is bundled with this package in the file LICENSE-PHP, and |
14
// | is available at through the world-wide-web at |
15
// | http://www.php.net/license/3_0.txt. |
16
// +----------------------------------------------------------------------+
17
// | Author: S�bastien Pauchet <sebastien.pauchet@ws-interactive.fr> |
18
// +----------------------------------------------------------------------+
20
// $Id: fckplugin.js,v 1.1.1.1 2008/11/26 17:12:14 sebastien Exp $
23
* Javascript Polymod plugin for FCKeditor
24
* Allow usage of all Polymod wysiwyg plugins
28
* @author S�bastien Pauchet <sebastien.pauchet@ws-interactive.fr>
31
// Register the related commands.
32
FCKCommands.RegisterCommand( 'polymod' , new FCKDialogCommand( FCKLang['DlgPolymodTitle'] , FCKLang['DlgPolymodTitle'] , FCKConfig.PluginsPath + 'polymod/polymod.php' , 750, 550 ) ) ;
34
// Create the "automneLinks" toolbar button.
35
var oPolymod = new FCKToolbarButton( 'polymod', FCKLang['DlgPolymodTitle'] ) ;
36
oPolymod.IconPath = FCKConfig.PluginsPath + 'polymod/polymod.gif' ;
38
FCKToolbarItems.RegisterItem( 'polymod', oPolymod ) ; // 'polymod' is the name used in the Toolbar config.
41
// ##### Define "Edit input" context menu entry.
43
// ## 1. Define the command to be executed when selecting the context menu item.
44
var oEditPolyCommand = new Object() ;
45
oEditPolyCommand.Name = 'polyEdit' ;
47
// This is the standard function used to execute the command (called when clicking in the context menu item).
48
oEditPolyCommand.Execute = function() {
49
FCKDialog.OpenDialog( 'FCKDialog_poly_edit', FCKLang['DlgPolymodTitle'], FCKConfig.PluginsPath + 'polymod/polymod.php' , 750, 550 ) ;
52
// This is the standard function used to retrieve the command state (it could be disabled for some reason).
53
oEditPolyCommand.GetState = function() {
54
// Let's make it always enabled.
55
return FCK_TRISTATE_OFF ;
58
// ## 2. Register our custom command.
59
FCKCommands.RegisterCommand( 'polyEdit', oEditPolyCommand ) ;
61
// ## 3. Define the context menu "listener".
62
var oEditPolyContextMenuListener = new Object() ;
64
// This is the standard function called right before sowing the context menu.
65
oEditPolyContextMenuListener.AddItems = function( contextMenu, tag, tagName ) {
66
// Let's show our custom option only for form fields.
67
if ( tagName == 'SPAN' || FCKSelection.HasAncestorNode( 'SPAN' )) {
68
// Go up to the span to test its properties
69
var oSpan = FCKSelection.MoveToAncestorNode( 'SPAN' ) ;
70
if (oSpan.className == 'polymod') {
71
contextMenu.AddSeparator() ;
72
contextMenu.AddItem( 'polyEdit', FCKLang['DlgPolymodEditTitle'], FCKConfig.PluginsPath + 'polymod/polymod.gif' ) ;
77
// ## 4. Register our context menu listener.
78
FCK.ContextMenu.RegisterListener( oEditPolyContextMenuListener ) ;
80
// Open the Placeholder dialog on double click.
81
oEditPolyCommand.OnDoubleClick = function( span ) {
82
// Let's show our custom option only for form fields.
83
if ( span.tagName == 'SPAN' || FCKSelection.HasAncestorNode( 'SPAN' )) {
84
// Go up to the span to test its properties
85
var oSpan = FCKSelection.MoveToAncestorNode( 'SPAN' ) ;
86
if (oSpan.className == 'polymod') {
87
FCKCommands.GetCommand( 'polyEdit' ).Execute() ;
91
FCK.RegisterDoubleClickHandler( oEditPolyCommand.OnDoubleClick, 'SPAN' ) ;
b'\\ No newline at end of file'