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