Ignore:
Timestamp:
12/29/09 08:16:25 (2 years ago)
Author:
PaulHarvey
Message:

Item2447: Merge fix for problems with heading, normal etc. formats from release branch. Still broken in IE6, will create a new task for that.

Location:
trunk/TinyMCEPlugin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/TinyMCEPlugin

  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons

  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/attach_error_autoinc.htm

  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/editor_plugin.js

    r5710 r5869  
    33return;ed.windowManager.open({location:false,menubar:false,toolbar:false,status:false,url:url+'/colours.htm',width:240,height:140,movable:true,popup_css:false,inline:true},{plugin_url:url});});ed.addButton('colour',{title:'foswikibuttons.colour_desc',cmd:'foswikibuttonsColour',image:url+'/img/colour.gif'});ed.addCommand('foswikibuttonsAttach',function(){var htmpath='/attach.htm',htmheight=250;if(null!==FoswikiTiny.foswikiVars.TOPIC.match(/(X{10}|AUTOINC[0-9]+)/)){htmpath='/attach_error_autoinc.htm',htmheight=125;} 
    44ed.windowManager.open({location:false,menubar:false,toolbar:false,status:false,url:url+htmpath,width:350,height:htmheight,movable:true,inline:true},{plugin_url:url});});ed.addButton('attach',{title:'foswikibuttons.attach_desc',cmd:'foswikibuttonsAttach',image:url+'/img/attach.gif'});ed.addCommand('foswikibuttonsHide',function(){if(FoswikiTiny.saveEnabled){if(ed.getParam('fullscreen_is_enabled')){ed.onGetContent.add(function(){tinymce.DOM.win.setTimeout(function(){var e=tinyMCE.activeEditor;tinyMCE.execCommand("mceToggleEditor",true,e.id);FoswikiTiny.switchToRaw(e);},10);});ed.execCommand('mceFullScreen');} 
    5 else{tinyMCE.execCommand("mceToggleEditor",true,ed.id);FoswikiTiny.switchToRaw(ed);}}});ed.addButton('hide',{title:'foswikibuttons.hide_desc',cmd:'foswikibuttonsHide',image:url+'/img/hide.gif'});ed.addCommand('foswikibuttonsFormat',function(ui,fn){var format=null;for(var i=0;i<ed.fw_formats.length;i++){if(ed.fw_formats[i].name==fn){format=ed.fw_formats[i];break;}} 
    6 if(format.el!=null){var fmt=format.el;if(fmt.length) 
    7 fmt='<'+fmt+'>';ed.execCommand('FormatBlock',false,fmt);if(format.el==''){var elm=ed.selection.getNode();ed.execCommand('removeformat',false,elm);}} 
    8 if(format.style!=null){ed.execCommand('mceSetCSSClass',false,format.style);} 
     5else{tinyMCE.execCommand("mceToggleEditor",true,ed.id);FoswikiTiny.switchToRaw(ed);}}});ed.addButton('hide',{title:'foswikibuttons.hide_desc',cmd:'foswikibuttonsHide',image:url+'/img/hide.gif'});ed.addCommand('foswikibuttonsFormat',function(ui,fn){var format=null;for(var i=0;i<ed.fw_formats.length;i++){if(ed.fw_formats[i].name===fn){format=ed.fw_formats[i];break;}} 
     6if(format.el!==null){var fmt=format.el;ed.execCommand('FormatBlock',false,fmt);} 
     7if(format.style!==null){ed.execCommand('mceSetCSSClass',false,format.style);} 
    98ed.nodeChanged();});ed.onNodeChange.add(this._nodeChange,this);},getInfo:function(){return{longname:'Foswiki Buttons Plugin',author:'Crawford Currie',authorurl:'http://c-dot.co.uk',infourl:'http://c-dot.co.uk',version:2};},createControl:function(n,cm){if(n=='foswikiformat'){var ed=tinyMCE.activeEditor;var m=cm.createListBox(ed.id+'_'+n,{title:'Format',onselect:function(format){ed.execCommand('foswikibuttonsFormat',false,format);}});var formats=ed.getParam("foswikibuttons_formats");for(var i=0;i<formats.length;i++){m.add(formats[i].name,formats[i].name);} 
    109m.selectByIndex(0);ed.fw_lb=m;return m;} 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/editor_plugin_src.js

    r5710 r5869  
    133133                var format = null; 
    134134                for (var i = 0; i < ed.fw_formats.length; i++) { 
    135                     if (ed.fw_formats[i].name == fn) { 
     135                    if (ed.fw_formats[i].name === fn) { 
    136136                        format = ed.fw_formats[i]; 
    137137                        break; 
    138138                    } 
    139139                } 
    140                 if (format.el != null) { 
    141                     var fmt = format.el; 
    142                     if (fmt.length) 
    143                         fmt = '<' + fmt + '>'; 
    144                     // SMELL: MIDAS command 
    145                     ed.execCommand('FormatBlock', false, fmt); 
    146                     if (format.el == '') { 
     140                if (format.el !== null) { 
     141                    ed.execCommand('FormatBlock', false, format.el); 
     142                    /* Item2447: We apply a <div> instead of null element 
     143                    if (format.el === '') { 
    147144                        var elm = ed.selection.getNode(); 
    148145                        // SMELL: MIDAS command 
    149146                        ed.execCommand('removeformat', false, elm); 
    150                     } 
    151                 } 
    152                 if (format.style != null) { 
     147                    }*/ 
     148                } 
     149                if (format.style !== null) { 
    153150                    // element is additionally styled 
    154151                    ed.execCommand('mceSetCSSClass', false, 
Note: See TracChangeset for help on using the changeset viewer.