| [ Index ] |
PHP Cross Reference of Drupal 6 (yi-drupal) |
[Summary view] [Print] [Text view]
1 /* 2 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 3 * Copyright (C) 2003-2007 Frederico Caldeira Knabben 4 * 5 * == BEGIN LICENSE == 6 * 7 * Licensed under the terms of any of the following licenses at your 8 * choice: 9 * 10 * - GNU General Public License Version 2 or later (the "GPL") 11 * http://www.gnu.org/licenses/gpl.html 12 * 13 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 14 * http://www.gnu.org/licenses/lgpl.html 15 * 16 * - Mozilla Public License Version 1.1 or later (the "MPL") 17 * http://www.mozilla.org/MPL/MPL-1.1.html 18 * 19 * == END LICENSE == 20 * 21 * Plugin to insert "Placeholders" in the editor. 22 */ 23 24 // The object used for all Placeholder operations. 25 26 27 // Register the Drupal tag commands. 28 FCKCommands.RegisterCommand( 'LinkToNode', new FCKDialogCommand( 'LinkToNode', FCKLang.DlgLinkToNode, FCKConfig.PluginsPath + 'linktonode/fck_linktonode.html', 400, 330 ) ) ; 29 30 // Create the Drupal tag buttons. 31 var oLinkNodeItem = new FCKToolbarButton( 'LinkToNode', 'LinkToNode', null, null, true, true ) ; 32 oLinkNodeItem.IconPath = FCKConfig.PluginsPath + 'linktonode/images/linktonode.gif'; 33 FCKToolbarItems.RegisterItem( 'LinkToNode', oLinkNodeItem ) ; 34 35 FCK.ContextMenu.RegisterListener({ 36 AddItems : function( menu, tag, tagName ) 37 { 38 var bInsideLink = ( tagName == 'A' || FCKSelection.HasAncestorNode( 'A' ) ) ; 39 40 if ( bInsideLink || FCK.GetNamedCommandState( 'Unlink' ) != FCK_TRISTATE_DISABLED ) 41 { 42 // Go up to the anchor to test its properties 43 var oLink = FCKSelection.MoveToAncestorNode( 'A' ) ; 44 var bIsAnchor = ( oLink && oLink.name.length > 0 && oLink.href.length == 0 ) ; 45 // If it isn't a link then don't add the Link context menu 46 if ( bIsAnchor ) 47 return ; 48 49 // Get the actual Link href. 50 var sHRef = oLink.getAttribute( '_fcksavedurl' ) ; 51 if ( sHRef == null ) 52 sHRef = oLink.getAttribute( 'href' , 2 ) || '' ; 53 54 if (sHRef.indexOf(FCKConfig.DrupalPath)==0 || sHRef.indexOf("internal:")==0) 55 { 56 menu.RemoveAllItems() ; 57 58 menu.AddItem( 'Cut' , FCKLang.Cut , 7, FCKCommands.GetCommand( 'Cut' ).GetState() == FCK_TRISTATE_DISABLED ) ; 59 menu.AddItem( 'Copy' , FCKLang.Copy , 8, FCKCommands.GetCommand( 'Copy' ).GetState() == FCK_TRISTATE_DISABLED ) ; 60 menu.AddItem( 'Paste' , FCKLang.Paste , 9, FCKCommands.GetCommand( 'Paste' ).GetState() == FCK_TRISTATE_DISABLED ) ; 61 menu.AddSeparator() ; 62 if ( bInsideLink ) 63 menu.AddItem( 'LinkToNode', FCKLang.EditLink , FCKConfig.PluginsPath + 'linktonode/images/linktonode.gif' ) ; 64 menu.AddItem( 'Unlink' , FCKLang.RemoveLink , FCKConfig.PluginsPath + 'linktonode/images/linktonode.gif' ) ; 65 } 66 } 67 } 68 });
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Jul 9 18:01:44 2012 | Cross-referenced by PHPXref 0.7 |