mirror of
				https://github.com/BookStackApp/BookStack.git
				synced 2025-10-31 03:50:27 +03:00 
			
		
		
		
	- Created new translation file for editor view. - Added simple logic to format for tinymce. - Aligned some of the custom labels we were using.
		
			
				
	
	
		
			29 lines
		
	
	
		
			695 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			695 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /**
 | |
|  * @param {Editor} editor
 | |
|  * @param {String} url
 | |
|  */
 | |
| function register(editor, url) {
 | |
|     editor.addCommand('InsertHorizontalRule', function () {
 | |
|         let hrElem = document.createElement('hr');
 | |
|         let cNode = editor.selection.getNode();
 | |
|         let parentNode = cNode.parentNode;
 | |
|         parentNode.insertBefore(hrElem, cNode);
 | |
|     });
 | |
| 
 | |
|     editor.ui.registry.addButton('hr', {
 | |
|         icon: 'horizontal-rule',
 | |
|         tooltip: 'Insert horizontal line',
 | |
|         onAction() {
 | |
|             editor.execCommand('InsertHorizontalRule');
 | |
|         }
 | |
|     });
 | |
| }
 | |
| 
 | |
| 
 | |
| /**
 | |
|  * @param {WysiwygConfigOptions} options
 | |
|  * @return {register}
 | |
|  */
 | |
| export function getPlugin(options) {
 | |
|     return register;
 | |
| } |