You are not logged in.
Pages: 1
Can Somebody post some clear, step-by-step instructions on how to create and add a custom button to the Xinha toolbar.
I checked the documentation and the forums and I see nothing regarding this...
Offline
Here, this is what I do. I found this on this forum.
I added an upload-popup. ("Bestanden uploaden" means to upload files.) Just before the line "HTMLArea.startEditors(xinha_editors);" I put :
xinha_config.URIs["upload"] = '/xinha/plugins/Linker/upload.php';
cfg.btnList["upload"] =
[ "bestanden uploaden", "/xinha/images/save.gif", true, function(e) { xinha_editors.myTextArea._popupDialog(xinha_config.URIs["upload"], null, null); } ];
cfg.toolbar.push(["upload"]);
Offline
I don't have that line: "HTMLArea.startEditors(xinha_editors);" anywhere..... I checked both my config file and the htmlarea.js file.... are you using an older version?
Offline
There´s a function for this in Xinha
/** Helper function: register a new button with the configuration. It can be
* called with all 5 arguments, or with only one (first one). When called with
* only one argument it must be an object with the following properties: id,
* tooltip, image, textMode, action. Examples:
*
* 1. config.registerButton("my-hilite", "Hilite text", "my-hilite.gif", false, function(editor) {...});
* 2. config.registerButton({
* id : "my-hilite", // the ID of your button
* tooltip : "Hilite text", // the tooltip
* image : "my-hilite.gif", // image to be displayed in the toolbar
* textMode : false, // disabled in text mode
* action : function(editor) { // called when the button is clicked
* editor.surroundHTML('<span class="hilite">', '</span>');
* },
* context : "p" // will be disabled if outside a <p> element
* });
*/
I used it like this for making a "save"-button:
xinha_config.registerButton("save_submit", "Speichern", [_editor_url+"images/ed_buttons_main.gif",9,1], false, function() {document.getElementById("editor_form").onsubmit();document.getElementById("editor_form").submit()});
xinha_config.toolbar =
[
["save_submit", ....
Offline
Ray, Thank you for your response so far. What I am trying to do is this:
I am creating a upload module for users to upload word and pdf files into a folder. The file is named and added to the folder on upload and the name and path to the file is added into the database. The custom button will be a "pdf" or "word" icon. When the user hilights some text in the editor and then clicks this new button a pop up (similar to the "insert web link") pop up is displayed that has a dropdown box of all of the uploaded files. When a file is selected, the highlighted text then links to the file allowing for download.
I hope I was clear in explaining.
Jonas
Offline
Actually it should be just a matter of duplicating the "add web link" button and renaming it to say "pdf" or "word" and then in place of the url text box is instead a dropdown box that lists the uploaded files..., selecting one of the files will make the text a link to that file...
Offline
The "Insert Web Link" button calls the function HTMLArea.prototype._createLink where the the popup is hardcoded. So to use another popup you either have to duplicate this function or hack it.
Why don´t you use the exquisit Linker plugin? you can configure that to show the contents of a give directory.
Offline
actually the linker plugin looks perfect. I'm having problem installing it though... Can you give me clear instructions how to install it?
Offline
Pages: 1