You are not logged in.
I want to intercept the click of the 'Clear Inline Font Specifications' button so that I can avoid the confirm boxes shown by Xinha.prototype._clearFonts() method.
From what I can tell, overriding Xinha.prototype._clearFonts() would do me no good because I never new up a Xinha (it's done internally by Xinha).
Therefore I'm thinking I need to intercept the click of the 'Clear Inline Font Specifications' button somehow and basically do what _clearFonts() does, MINUS the
confirm dialogs.
Any thoughts on how to do this?
Thank you.
Offline
Overriding the Xinha.prototype._clearFonts should work fine.
Xinha.prototype._clearFonts = function() { ... }
Of course, you must do this AFTER you load Xinha's file or it will be redefined to the default.
James Sleeman
Offline
Ok. I see what you are saying here, but I wouldn't call that overriding the function.
I think of that as basically wiping it out with my own, which I agree will work.
I chose a different way, basically registered a button and a handler for it:
xinhaConfig.hideSomeButtons(' clearfonts ');
var xinhaEditors = [ this.containerRichTextId ];
...
// register the toolbar buttons provided by this plugin
this.myEditor.config.registerButton(
{
id : "mw_clearfonts",
tooltip : Xinha._lc("Clear Fonts", "Clear Fonts"),
image : this.myEditor.imgURL("images/ed_clearfonts.gif"),
textMode : true,
action : function(editor) {
self._removeFonts();
}
});
Offline