Announcement

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

#1 2005-06-30 08:58:52

rmmoore80
New member
From: Anderson, IN
Registered: 2005-06-30
Posts: 3

Button List Question

I can't find documentation for this...if I over looked it then I appologize.

I'm trying to modify one of the buttons.  I created my own C# + Javascript Image Upload utility and I want to change the image button to call my page instead of the regular one.  I got it working by editing the htmlarea.js file but I know that is not the recommended method.  I tried adding xinha_config.btnList = to my my_config.js file but that didn't do anything.  Is there documentation on how to do this or can someone explain a little about how this works to me?

Offline

#2 2005-06-30 14:52:42

mokhet
Xinha Authority
From: Paris, France
Registered: 2005-04-03
Posts: 105
Website

Re: Button List Question

You dont need to update the editor.config.btnList unless you want to update the whole button, which in the case here dont seems to be what you want to do. You want to update the destination link on the image button, to accomplish this, just add this line in your config file :

xinha_config.URIs["insert_image"] = 'url to your insert image html page';

or you can use the ImageManager plugin and update the 'backend' link defined in the config. I am not sure at all how it is working but looking at the code, i think it may be done this way

xinha_config.ImageManager.backend = 'url to your own back end';

People using this plugin may know better how to change the backend file.

Offline

#3 2005-06-30 14:58:30

rmmoore80
New member
From: Anderson, IN
Registered: 2005-06-30
Posts: 3

Re: Button List Question

well, I don't want it to call a page but instead a javascript function.  The javascript function generates a random ID # and then opens a new window and submits that ID.  This next page has a browse button.  You pick an image and click upload.  The upload uses the random id to generate a random unique file name and sends it to the server.  Then you click CLOSE and it sends the file name BACK to the editor which then inserts that file name into the editor.  So I don't want it to call a page, but a javascript...  is there command to change the function that is being called?

Offline

#4 2005-07-03 19:22:46

mokhet
Xinha Authority
From: Paris, France
Registered: 2005-04-03
Posts: 105
Website

Re: Button List Question

You can update the button like this

  var xinha_config = new HTMLArea.Config();
  xinha_config.btnList['insertimage'][3] = function(e) {
    alert('my own javascript');
    };

http://mokhet.com/xinha/examples/ownjs.html

or you may prefer to update the _insertImage function

HTMLArea.prototype._insertImage = function(image) {
  alert('my own insert image');
};

http://mokhet.com/xinha/examples/owninsertimage.html

Hope one of thoses 2 ways of doing your own javascript is what you looking for.

Offline

Board footer

Powered by FluxBB