[ Index ] |
|
Code source de e107 0.7.8 |
1 // Import theme specific language pack 2 // $Source: /cvsroot/e107/e107_0.7/e107_handlers/tiny_mce/plugins/ibrowser/editor_plugin.js,v $ 3 // $Revision: 1.4 $ 4 // $Date: 2006/10/27 22:36:57 $ 5 // $Author: e107coders $ 6 7 tinyMCE.importPluginLanguagePack('ibrowser', 'en,es,da,de,fr,nl,pl,sv,ru'); 8 9 // Returns the HTML contents of the ibrowser control. 10 11 var TinyMCE_ibrowserPlugin = { 12 getInfo : function() { 13 return { 14 longname : 'ibrowser', 15 author : 'Your name', 16 authorurl : '', 17 infourl : '', 18 version : "1.1" 19 }; 20 }, 21 22 getControlHTML : function(cn) { 23 switch (cn) { 24 case "ibrowser": 25 return tinyMCE.getButtonHTML(cn, 'lang_ibrowser_desc', '{$pluginurl}/images/ibrowser.gif', 'mceBrowseImage', true); 26 } 27 28 return ""; 29 }, 30 31 32 execCommand : function(editor_id, element, command, user_interface, value) { 33 // Handle commands 34 switch (command) { 35 case "mceBrowseImage": 36 var template = new Array(); 37 38 template['file'] = '../../plugins/ibrowser/ibrowser.php'; // Relative to theme location 39 template['width'] = 480; 40 template['height'] = 670; 41 42 var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = ""; 43 var margin_left = ""; 44 var margin_right = ""; 45 var margin_top = ""; 46 var margin_bottom = ""; 47 48 if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") 49 tinyMCE.imgElement = tinyMCE.selectedElement; 50 51 if (tinyMCE.imgElement) { 52 src = tinyMCE.imgElement.getAttribute('src') ? tinyMCE.imgElement.getAttribute('src') : ""; 53 alt = tinyMCE.imgElement.getAttribute('alt') ? tinyMCE.imgElement.getAttribute('alt') : ""; 54 } 55 /* 56 57 border = tinyMCE.imgElement.style.border ? tinyMCE.imgElement.style.border : ""; 58 hspace = tinyMCE.imgElement.getAttribute('hspace') ? tinyMCE.imgElement.getAttribute('hspace') : ""; 59 vspace = tinyMCE.imgElement.getAttribute('vspace') ? tinyMCE.imgElement.getAttribute('vspace') : ""; 60 width = tinyMCE.imgElement.style.width ? tinyMCE.imgElement.style.width.replace('px','') : ""; 61 height = tinyMCE.imgElement.style.height ? tinyMCE.imgElement.style.height.replace('px','') : ""; 62 align = tinyMCE.imgElement.getAttribute('align') ? tinyMCE.imgElement.getAttribute('align') : ""; 63 64 margin_left = tinyMCE.imgElement.style.marginLeft ? tinyMCE.imgElement.style.marginLeft.replace('px','') : ""; 65 margin_right = tinyMCE.imgElement.style.marginRight ? tinyMCE.imgElement.style.marginRight.replace('px','') : ""; 66 margin_top = tinyMCE.imgElement.style.marginTop ? tinyMCE.imgElement.style.marginTop.replace('px','') : ""; 67 margin_bottom = tinyMCE.imgElement.style.marginBottom ? tinyMCE.imgElement.style.marginBottom.replace('px','') : ""; 68 69 // Fix for drag-drop/copy paste bug in Mozilla 70 mceRealSrc = tinyMCE.imgElement.getAttribute('mce_real_src') ? tinyMCE.imgElement.getAttribute('mce_real_src') : ""; 71 if (mceRealSrc != "") 72 src = mceRealSrc; 73 74 // src = eval(tinyMCE.settings['urlconvertor_callback'] + "(src, tinyMCE.imgElement, true);"); 75 } 76 */ 77 tinyMCE.openWindow(template, {editor_id : editor_id, src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align}); 78 return true; 79 } 80 81 // Pass to next handler in chain 82 return false; 83 } 84 85 }; 86 87 88 tinyMCE.addPlugin("ibrowser", TinyMCE_ibrowserPlugin); 89 90 91 92
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |