1 /* Import plugin specific language pack */
2 tinyMCE.importPluginLanguagePack('advhr', 'en,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,da,he,no,hu');
4 function TinyMCE_advhr_getInfo() {
6 longname : 'Advanced HR',
7 author : 'Moxiecode Systems',
8 authorurl : 'http://tinymce.moxiecode.com',
9 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advhr.html',
10 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
14 function TinyMCE_advhr_getControlHTML(control_name) {
15 switch (control_name) {
17 return '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceAdvancedHr\');" target="_self" onmousedown="return false;"><img id="{$editor_id}_advhr" src="{$pluginurl}/images/advhr.gif" title="{$lang_insert_advhr_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';
24 * Executes the mceAdvanceHr command.
26 function TinyMCE_advhr_execCommand(editor_id, element, command, user_interface, value) {
30 var template = new Array();
32 template['file'] = '../../plugins/advhr/rule.htm'; // Relative to theme
33 template['width'] = 270;
34 template['height'] = 180;
36 template['width'] += tinyMCE.getLang('lang_advhr_delta_width', 0);
37 template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0);
39 var size = "", width = "", noshade = "";
40 if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr"){
41 tinyMCE.hrElement = tinyMCE.selectedElement;
42 if (tinyMCE.hrElement) {
43 size = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : "";
44 width = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : "";
45 noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : "";
47 tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'});
50 tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'<hr />');
52 tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'});
58 // Pass to next handler in chain
62 function TinyMCE_advhr_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
63 tinyMCE.switchClassSticky(editor_id + '_advhr', 'mceButtonNormal');
69 if (node.nodeName.toLowerCase() == "hr")
70 tinyMCE.switchClassSticky(editor_id + '_advhr', 'mceButtonSelected');
71 } while ((node = node.parentNode));