--- /dev/null
+/*\r
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
+ * Copyright (C) 2003-2008 Frederico Caldeira Knabben\r
+ *\r
+ * == BEGIN LICENSE ==\r
+ *\r
+ * Licensed under the terms of any of the following licenses at your\r
+ * choice:\r
+ *\r
+ * - GNU General Public License Version 2 or later (the "GPL")\r
+ * http://www.gnu.org/licenses/gpl.html\r
+ *\r
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
+ * http://www.gnu.org/licenses/lgpl.html\r
+ *\r
+ * - Mozilla Public License Version 1.1 or later (the "MPL")\r
+ * http://www.mozilla.org/MPL/MPL-1.1.html\r
+ *\r
+ * == END LICENSE ==\r
+ *\r
+ * This is a sample plugin definition file.\r
+ */\r
+\r
+// Here we define our custom Style combo, with custom widths.\r
+var oMyBigStyleCombo = new FCKToolbarStyleCombo() ;\r
+oMyBigStyleCombo.FieldWidth = 250 ;\r
+oMyBigStyleCombo.PanelWidth = 300 ;\r
+FCKToolbarItems.RegisterItem( 'My_BigStyle', oMyBigStyleCombo ) ;\r
+\r
+\r
+// ##### Defining a custom context menu entry.\r
+\r
+// ## 1. Define the command to be executed when selecting the context menu item.\r
+var oMyCMCommand = new Object() ;\r
+oMyCMCommand.Name = 'OpenImage' ;\r
+\r
+// This is the standard function used to execute the command (called when clicking in the context menu item).\r
+oMyCMCommand.Execute = function()\r
+{\r
+ // This command is called only when an image element is selected (IMG).\r
+ // Get image URL (src).\r
+ var sUrl = FCKSelection.GetSelectedElement().src ;\r
+\r
+ // Open the URL in a new window.\r
+ window.top.open( sUrl ) ;\r
+}\r
+\r
+// This is the standard function used to retrieve the command state (it could be disabled for some reason).\r
+oMyCMCommand.GetState = function()\r
+{\r
+ // Let's make it always enabled.\r
+ return FCK_TRISTATE_OFF ;\r
+}\r
+\r
+// ## 2. Register our custom command.\r
+FCKCommands.RegisterCommand( 'OpenImage', oMyCMCommand ) ;\r
+\r
+// ## 3. Define the context menu "listener".\r
+var oMyContextMenuListener = new Object() ;\r
+\r
+// This is the standard function called right before sowing the context menu.\r
+oMyContextMenuListener.AddItems = function( contextMenu, tag, tagName )\r
+{\r
+ // Let's show our custom option only for images.\r
+ if ( tagName == 'IMG' )\r
+ {\r
+ contextMenu.AddSeparator() ;\r
+ contextMenu.AddItem( 'OpenImage', 'Open image in a new window (Custom)' ) ;\r
+ }\r
+}\r
+\r
+// ## 4. Register our context menu listener.\r
+FCK.ContextMenu.RegisterListener( oMyContextMenuListener ) ;\r