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