Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2007-03-26 11:43:21

jedi58
Xinha Authority
From: Leicester, UK
Registered: 2007-01-14
Posts: 113
Website

Disabling buttons

Okay, I know this is a strange request, but I was wondering if it is possible to permanently disable buttons but not hide them (this is due to wanting to keep consistent interface between users that have some restrictions)


David G. Paul
[url]http://www.newearthonline.co.uk[/url]

Offline

#2 2007-03-26 13:14:22

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Disabling buttons

The button status is updated (and thus enabled) by updateToolbar() all the time

Dirty hack: define a context for the buttons that never occurs

xinha_config.btnList.about[4] = 'del';

This would be the clean way, a plugin the disables the respective buttons on each cycle

function DisableButtons(editor) {
    this.editor = editor;
}

DisableButtons._pluginInfo = {
  name          : "DisableButtons",
  version       : "1.0",
  developer     : "Xinha Core Developer Team",
  developer_url : "http://xinha.org",
  c_owner       : "Xinha community",
  sponsor       : "",
  sponsor_url   : "",
  license       : "Creative Commons Attribution-ShareAlike License"
}
Xinha.Config.prototype.btnsToDisable =
[
    'about','formatblock','fullscreen'
]

DisableButtons.prototype.onUpdateToolbar = function()
{
    for (var i =0; i<this.editor.config.btnsToDisable.length;i++)
    {
        this.editor._toolbarObjects[this.editor.config.btnsToDisable[i]].state("enabled", false);
    }
}

Offline

#3 2007-03-26 14:56:18

jedi58
Xinha Authority
From: Leicester, UK
Registered: 2007-01-14
Posts: 113
Website

Re: Disabling buttons

omg! that's brilliant, thanks!

Once again it's ray to the rescue!


David G. Paul
[url]http://www.newearthonline.co.uk[/url]

Offline

Board footer

Powered by FluxBB