JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.1
[ckeditor.git] / _source / plugins / horizontalrule / plugin.js
1 /*\r
2 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
3 For licensing, see LICENSE.html or http://ckeditor.com/license\r
4 */\r
5 \r
6 /**\r
7  * @file Horizontal Rule plugin.\r
8  */\r
9 \r
10 (function()\r
11 {\r
12         var horizontalruleCmd =\r
13         {\r
14                 canUndo : false,    // The undo snapshot will be handled by 'insertElement'.\r
15                 exec : function( editor )\r
16                 {\r
17                         editor.insertElement( editor.document.createElement( 'hr' ) );\r
18                 }\r
19         };\r
20 \r
21         var pluginName = 'horizontalrule';\r
22 \r
23         // Register a plugin named "horizontalrule".\r
24         CKEDITOR.plugins.add( pluginName,\r
25         {\r
26                 init : function( editor )\r
27                 {\r
28                         editor.addCommand( pluginName, horizontalruleCmd );\r
29                         editor.ui.addButton( 'HorizontalRule',\r
30                                 {\r
31                                         label : editor.lang.horizontalrule,\r
32                                         command : pluginName\r
33                                 });\r
34                 }\r
35         });\r
36 })();\r