You are not logged in.
Pages: 1
Hi,
I am trying to move some icons of plugins speciually for my cms onto the second or third
toolbar. In htmlarea3 this could be done by:
editor.config.toolbar[3].push("separator", "sas-image", "sas-link" , "anchor-link");
but the icons end up on the first toolbar at the end.
Do I have to use a different method?
Thanks and kind regards Fred Stuurman
Offline
Hi,
I am trying to move some icons of plugins speciually for my cms onto the second or third
toolbar. In htmlarea3 this could be done by:editor.config.toolbar[3].push("separator", "sas-image", "sas-link" , "anchor-link");
but the icons end up on the first toolbar at the end.
Do I have to use a different method?
Thanks and kind regards Fred Stuurman
It's tricky at the moment, basically for sme unknown reason, back before I had even released the htmlarea-fork, let alone Xinha, I changes the toolbar to require explicit "linebreak" items to break lines in the toolbar. I don't know why I did it, and I regret doing it because it really isn't a good idea, but I don't want to change it back just yet as the whole toolbar thing needs a rework anyway to make it easier for plugins to put stuff in sensible places.
For now, best if you define your own toolbar in the configuration object, see htmlarea.js.
James Sleeman
Offline
Basically the structure of the toolbar has changed since htmlArea it now looks like this:
this.toolbar =
[
["popupeditor","separator"],
["formatblock","fontname","fontsize","bold","italic","underline","strikethrough","separator"],
["forecolor","hilitecolor","textindicator","separator"],
["subscript","superscript"],
["linebreak","justifyleft","justifycenter","justifyright","justifyfull","separator"],
["insertorderedlist","insertunorderedlist","outdent","indent","separator"],
["inserthorizontalrule","createlink","insertimage","inserttable","separator"],
["undo","redo"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste"]),["separator"],
["killword","removeformat","toggleborders","lefttoright", "righttoleft", "separator","htmlmode","about"]
];
You may notice that there are more square brackets now.
Effectively when you write
editor.config.toolbar[3].push("separator", "sas-image", "sas-link" , "anchor-link");
You are asking to insert the separator and your three buttons after the fourth set of square brackets (zero based numbering) This means it is after the subscript superscript buttons and before the line break in the next set - this means it is at the end of the first line!
If you change the number 3 in your push statement you can move your button around *almost* where ever you like. I say almost, because you many want to put a button in between say the subscript and superscript buttons, and to do that you will need to alter your push statement slightly to the following:
editor.config.toolbar[3] = ["subscript", "sas-image", "superscript"];
akaEdge
Offline
I see the DefinitionList plugin
& see
cfg.toolbar.push(toolbar);
But I want to insert this buttons near ul & ol lists
How can I do it ?
Last edited by zerok (2010-11-17 13:25:29)
Offline
Hmm .. I don't see any obvious good way. I think the toolbar system might need an overhaul to make this easier. (But correct me if I'm wrong and it's easier than it looks.)
If you're willing to hack your copy of the code, you can do this:
1) comment out the "cfg.toolbar.push(toolbar);" line in DefinitionList, so that the plugin doesn't insert the buttons itself
2) in your config, explicitly add the buttons "dl", "dd" and "dt" where you want them using the xinha_config.toolbar parameter. For example (basing this off examples/XinhaConfig.js),
xinha_config.toolbar =
[
["popupeditor"],
["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"],
["separator","forecolor","hilitecolor","textindicator"],
["separator","subscript","superscript"],
["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
["linebreak","insertorderedlist","insertunorderedlist", "dl", "dt", "dd"],
];
Offline
can't find where comment pushing buttons in DefinitionList plugin.
I tried some :
cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "DefinitionList"), false,
function(editor, id) {
// dispatch button press event
self.buttonPress(editor, id);
});
toolbar.push(id);
&
cfg.toolbar.push(toolbar);
but I have two variant of buttons in toolbar
the first one - that I push in config - this buttons don't react on over focus of editor (they are equally off focus & on focus)
the second variant - is after button "about" in toolbar & it react on\off focus
Offline
You should comment out the line "cfg.toolbar.push(toolbar);" in DefinitionList.js, first of all.
Then, you need to add it to your own xinha config -- where you set up the Xinha editor for the page. What does your Xinha config Javascript look like?
Offline
I use some changed examples/XinhaConfig.js
remove stilist run plugin & comment
// xinha_config.stylistLoadStylesheet(_editor_url + "examples/files/stylist.css");
add
'DefinitionList',
&
'SuperClean',
that all
so all plugins
xinha_plugins = xinha_plugins ? xinha_plugins :
[
'DefinitionList',
'CharacterMap',
'ContextMenu',
'InsertNote',
'SmartReplace',
'ExtendedFileManager',
'Linker',
'SuperClean',
'TableOperations',
'UnFormat'
];
xinha_config.toolbar =
[
["popupeditor"],
["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"],
["separator","forecolor","hilitecolor","textindicator"],
["separator","subscript","superscript"],
["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
["separator","insertorderedlist","insertunorderedlist", "dl", "dd", "dt", "outdent","indent"],
["separator","inserthorizontalrule","createlink","insertimage","inserttable"],
["linebreak","separator","undo","redo","selectall","print"], (Xinha.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]),
["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"],
["separator","htmlmode","showhelp","about"]
];
Last edited by zerok (2010-11-17 15:03:14)
Offline
Hmm, that configuration should work. You should have only one copy of the dl/dd/dt buttons, as long as you removed the right line from DefinitionList.js
Maybe your browser is caching an old copy of DefinitionList.js? Can you clear the cache or try it in a different browser?
Offline
one moment, hm. I try
Offline
WOW it works! it is realy cache! Thanx
Offline
ejcovey: See the addToolbarElement method in Xinha.js, DefinitionList doesn't use it (it just pushes onto the toolbar), but could, and probably should insert it's buttons somewhere around the standard list buttons.
In it's simplest form it takes as three parameters
1: the button id (previously registered with registerButton)
2: the id of the button you want to insert this button relative to
3: one of, -1 for "insert before", 0 for "replace" and 1 for "insert after"
James Sleeman
Offline
gogo, DefinitionList is a plugin of ejcovey ?
Offline
zerok, no, DefinitionList isn't my plugin, i just happened to know it was there
gogo, thanks for the tip, and the welcome! - i filed the toolbar reordering idea at http://trac.xinha.org/ticket/1561, and i'll try to commit the fix soon.
Offline
how can I can use trunk checkout ?
Offline
I find http://svn.xinha.org/trunk/ and make checkout
I have some difference - I havent DoubleClick plugin there. (I compare xinha096 & checkout version)
Offline
zerok, see http://trac.xinha.org/wiki/Documentatio … tedPlugins
* DoubleClick will still work (you don't need to make any changes)
* but its functionality is now in core instead of a plugin
Offline
Pages: 1