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,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk');
\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 var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceAdvancedHr\');return false;';
\r
18 return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" 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
25 * Executes the mceAdvanceHr command.
\r
27 function TinyMCE_advhr_execCommand(editor_id, element, command, user_interface, value) {
\r
30 case "mceAdvancedHr":
\r
31 var template = new Array();
\r
33 template['file'] = '../../plugins/advhr/rule.htm'; // Relative to theme
\r
34 template['width'] = 270;
\r
35 template['height'] = 180;
\r
37 template['width'] += tinyMCE.getLang('lang_advhr_delta_width', 0);
\r
38 template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0);
\r
40 var size = "", width = "", noshade = "";
\r
41 if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr"){
\r
42 tinyMCE.hrElement = tinyMCE.selectedElement;
\r
43 if (tinyMCE.hrElement) {
\r
44 size = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : "";
\r
45 width = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : "";
\r
46 noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : "";
\r
48 tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'});
\r
50 if (tinyMCE.isMSIE) {
\r
51 tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'<hr />');
\r
53 tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'});
\r
59 // Pass to next handler in chain
\r
63 function TinyMCE_advhr_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
\r
64 tinyMCE.switchClassSticky(editor_id + '_advhr', 'mceButtonNormal');
\r
70 if (node.nodeName.toLowerCase() == "hr")
\r
71 tinyMCE.switchClassSticky(editor_id + '_advhr', 'mceButtonSelected');
\r
72 } while ((node = node.parentNode));
\r