| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Summary view] [Print] [Text view]
1 /* 2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 */ 5 CKEDITOR.plugins.add( 'linktomenu', 6 { 7 init : function( editor ) 8 { 9 // Add the link and unlink buttons. 10 editor.addCommand( 'linktomenu', new CKEDITOR.dialogCommand( 'linktomenu' ) ); 11 editor.ui.addButton( 'LinkToMenu', 12 { 13 label : 'Link to menu', 14 icon : this.path + 'images/linktomenu.gif', 15 command : 'linktomenu' 16 } ); 17 CKEDITOR.dialog.add( 'linktomenu', this.path + 'dialogs/link.js' ); 18 19 // If the "menu" plugin is loaded, register the menu items. 20 if ( editor.addMenuItems ) 21 { 22 editor.addMenuItems( 23 { 24 linktomenu : 25 { 26 label : 'Link to menu', 27 command : 'linktomenu', 28 group : 'linktomenu', 29 order : 1 30 } 31 }); 32 } 33 34 // If the "contextmenu" plugin is loaded, register the listeners. 35 if ( editor.contextMenu ) 36 { 37 editor.contextMenu.addListener( function( element, selection ) 38 { 39 if ( !element ) 40 return null; 41 42 var isAnchor = ( element.is( 'img' ) && element.getAttribute( '_cke_real_element_type' ) == 'anchor' ); 43 44 if ( !isAnchor ) 45 { 46 if ( !( element = element.getAscendant( 'a', true ) ) ) 47 return null; 48 49 isAnchor = ( element.getAttribute( 'name' ) && !element.getAttribute( 'href' ) ); 50 } 51 52 return { linktomenu : CKEDITOR.TRISTATE_OFF }; 53 }); 54 } 55 } 56 } );
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |