2 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
\r
5 * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
\r
8 /* Import plugin specific language pack */
\r
9 tinyMCE.importPluginLanguagePack('advhr');
\r
11 var TinyMCE_AdvancedHRPlugin = {
\r
12 getInfo : function() {
\r
14 longname : 'Advanced HR',
\r
15 author : 'Moxiecode Systems AB',
\r
16 authorurl : 'http://tinymce.moxiecode.com',
\r
17 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
\r
18 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
\r
22 getControlHTML : function(cn) {
\r
25 return tinyMCE.getButtonHTML(cn, 'lang_insert_advhr_desc', '{$pluginurl}/images/advhr.gif', 'mceAdvancedHr');
\r
32 * Executes the mceAdvanceHr command.
\r
34 execCommand : function(editor_id, element, command, user_interface, value) {
\r
37 case "mceAdvancedHr":
\r
38 var template = new Array();
\r
40 template['file'] = '../../plugins/advhr/rule.htm'; // Relative to theme
\r
41 template['width'] = 250;
\r
42 template['height'] = 160;
\r
44 template['width'] += tinyMCE.getLang('lang_advhr_delta_width', 0);
\r
45 template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0);
\r
47 var size = "", width = "", noshade = "";
\r
48 if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr") {
\r
49 tinyMCE.hrElement = tinyMCE.selectedElement;
\r
51 if (tinyMCE.hrElement) {
\r
52 size = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : "";
\r
53 width = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : "";
\r
54 noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : "";
\r
57 tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'});
\r
59 if (tinyMCE.isMSIE) {
\r
60 tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'<hr />');
\r
62 tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'});
\r
69 // Pass to next handler in chain
\r
73 handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
\r
78 if (node.nodeName == "HR") {
\r
79 tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonSelected');
\r
82 } while ((node = node.parentNode));
\r
84 tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonNormal');
\r
90 tinyMCE.addPlugin("advhr", TinyMCE_AdvancedHRPlugin);
\r