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