Ignore:
Timestamp:
12/29/09 09:21:49 (2 years ago)
Author:
PaulHarvey
Message:

Item2447: Merge fix for formats listbox not always reflecting current cursor selection.

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

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/editor_plugin.js

    r5869 r5873  
    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');} 
    55else{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;ed.execCommand('FormatBlock',false,fmt);} 
     6if(format.el!==null){ed.execCommand('FormatBlock',false,format.el);} 
    77if(format.style!==null){ed.execCommand('mceSetCSSClass',false,format.style);} 
    88ed.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);} 
     
    1515cm.setActive('colour',true);else 
    1616cm.setActive('colour',false);if(ed.fw_lb){var puck=-1;var nn=n.nodeName.toLowerCase();do{for(var i=0;i<ed.fw_formats.length;i++){if((!ed.fw_formats[i].el||ed.fw_formats[i].el==nn)&&(!ed.fw_formats[i].style||ed.dom.hasClass(ed.fw_formats[i].style))){puck=i;if(puck>0) 
    17 break;}}}while(puck<0&&(n=n.parentNode)!=null);if(puck>=0){ed.fw_lb.selectByIndex(puck);}} 
     17break;}}}while(puck<0&&(n=n.parentNode)!=null);if(puck>=0){ed.fw_lb.selectByIndex(puck);}else{ed.fw_lb.selectByIndex(0);}} 
    1818return true;}});tinymce.PluginManager.add('foswikibuttons',tinymce.plugins.FoswikiButtons);})(); 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/editor_plugin_src.js

    r5869 r5873  
    233233                if (puck >= 0) { 
    234234                    ed.fw_lb.selectByIndex(puck); 
     235                } else { 
     236                    // A region has been selected that doesn't match any known 
     237                    // foswiki formats, so select the first format in our list  
     238                    // ('Normal'). 
     239                    ed.fw_lb.selectByIndex(0); 
    235240                } 
    236241            } 
Note: See TracChangeset for help on using the changeset viewer.