[ Index ] |
|
Code source de Seagull 0.6.1 |
1 /** 2 * $RCSfile: editor_plugin_src.js,v $ 3 * $Revision: 1.19 $ 4 * $Date: 2006/02/10 16:29:37 $ 5 * 6 * @author Moxiecode 7 * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. 8 */ 9 10 /* Import plugin specific language pack */ 11 tinyMCE.importPluginLanguagePack('advhr', 'en,tr,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'); 12 13 var TinyMCE_AdvancedHRPlugin = { 14 getInfo : function() { 15 return { 16 longname : 'Advanced HR', 17 author : 'Moxiecode Systems', 18 authorurl : 'http://tinymce.moxiecode.com', 19 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advhr.html', 20 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion 21 } 22 }, 23 24 getControlHTML : function(cn) { 25 switch (cn) { 26 case "advhr": 27 return tinyMCE.getButtonHTML(cn, 'lang_insert_advhr_desc', '{$pluginurl}/images/advhr.gif', 'mceAdvancedHr'); 28 } 29 30 return ""; 31 }, 32 33 /** 34 * Executes the mceAdvanceHr command. 35 */ 36 execCommand : function(editor_id, element, command, user_interface, value) { 37 // Handle commands 38 switch (command) { 39 case "mceAdvancedHr": 40 var template = new Array(); 41 42 template['file'] = '../../plugins/advhr/rule.htm'; // Relative to theme 43 template['width'] = 250; 44 template['height'] = 160; 45 46 template['width'] += tinyMCE.getLang('lang_advhr_delta_width', 0); 47 template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0); 48 49 var size = "", width = "", noshade = ""; 50 if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr") { 51 tinyMCE.hrElement = tinyMCE.selectedElement; 52 53 if (tinyMCE.hrElement) { 54 size = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : ""; 55 width = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : ""; 56 noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : ""; 57 } 58 59 tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'}); 60 } else { 61 if (tinyMCE.isMSIE) { 62 tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'<hr />'); 63 } else { 64 tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'}); 65 } 66 } 67 68 return true; 69 } 70 71 // Pass to next handler in chain 72 return false; 73 }, 74 75 handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { 76 if (node == null) 77 return; 78 79 do { 80 if (node.nodeName == "HR") { 81 tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonSelected'); 82 return true; 83 } 84 } while ((node = node.parentNode)); 85 86 tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonNormal'); 87 88 return true; 89 } 90 }; 91 92 tinyMCE.addPlugin("advhr", TinyMCE_AdvancedHRPlugin);
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Mar 30 01:27:52 2007 | par Balluche grâce à PHPXref 0.7 |