includes/clientside/tinymce/plugins/advhr/editor_plugin_src.js
changeset 1344 dc96d6c5cd1e
parent 1343 2a31905a567d
child 1345 1de01205143b
equal deleted inserted replaced
1343:2a31905a567d 1344:dc96d6c5cd1e
     1 /**
       
     2  * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
       
     3  *
       
     4  * @author Moxiecode
       
     5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
       
     6  */
       
     7 
       
     8 (function() {
       
     9 	tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
       
    10 		init : function(ed, url) {
       
    11 			// Register commands
       
    12 			ed.addCommand('mceAdvancedHr', function() {
       
    13 				ed.windowManager.open({
       
    14 					file : url + '/rule.htm',
       
    15 					width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
       
    16 					height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
       
    17 					inline : 1
       
    18 				}, {
       
    19 					plugin_url : url
       
    20 				});
       
    21 			});
       
    22 
       
    23 			// Register buttons
       
    24 			ed.addButton('advhr', {
       
    25 				title : 'advhr.advhr_desc',
       
    26 				cmd : 'mceAdvancedHr'
       
    27 			});
       
    28 
       
    29 			ed.onNodeChange.add(function(ed, cm, n) {
       
    30 				cm.setActive('advhr', n.nodeName == 'HR');
       
    31 			});
       
    32 
       
    33 			ed.onClick.add(function(ed, e) {
       
    34 				e = e.target;
       
    35 
       
    36 				if (e.nodeName === 'HR')
       
    37 					ed.selection.select(e);
       
    38 			});
       
    39 		},
       
    40 
       
    41 		getInfo : function() {
       
    42 			return {
       
    43 				longname : 'Advanced HR',
       
    44 				author : 'Moxiecode Systems AB',
       
    45 				authorurl : 'http://tinymce.moxiecode.com',
       
    46 				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
       
    47 				version : tinymce.majorVersion + "." + tinymce.minorVersion
       
    48 			};
       
    49 		}
       
    50 	});
       
    51 
       
    52 	// Register plugin
       
    53 	tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
       
    54 })();