JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.6.1
[ckeditor.git] / _source / plugins / horizontalrule / plugin.js
1 /*\r
2 Copyright (c) 2003-2013, 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                         var hr = editor.document.createElement( 'hr' );\r
18                         editor.insertElement( hr );\r
19                 }\r
20         };\r
21 \r
22         var pluginName = 'horizontalrule';\r
23 \r
24         // Register a plugin named "horizontalrule".\r
25         CKEDITOR.plugins.add( pluginName,\r
26         {\r
27                 init : function( editor )\r
28                 {\r
29                         editor.addCommand( pluginName, horizontalruleCmd );\r
30                         editor.ui.addButton( 'HorizontalRule',\r
31                                 {\r
32                                         label : editor.lang.horizontalrule,\r
33                                         command : pluginName\r
34                                 });\r
35                 }\r
36         });\r
37 })();\r