Interspire Product Knowledge Base

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Export to PDF

User Opinions (12 votes)

33% thumbs up 66% thumbs down

How would you rate this answer?



Thank you for rating this answer.

How do I add a button to the DevEdit toolbar?

The first thing you want to do is edit the config.js file in the de folder. If you are using DevEdit NX 1.9.2.4, you'll be looking for the common.js file. On line 67, you'll see this:

['Fontname','Fontsize','Formatblock','Styles','-','Fontcolor','Highlight','-','Table','-','Form','-','Flash','Image','Media','-','Inserttextbox','HR','Insertchars','Pageproperties','Clearcode','Custominsert','Toggleposition','Showborders']

These are the toolbar buttons. Let's add one called NewButton. Change line 67 to this:

['Fontname','Fontsize','Formatblock','Styles','-','Fontcolor','Highlight','-','Table','-','Form','-','Flash','Image','Media','-','Inserttextbox','HR','Insertchars','Pageproperties','Clearcode','Custominsert','Toggleposition','Showborders','-','NewButton']

Now open common.js and add this line at the bottom of all the case statements (around line 2027):

case 'NewButton': item    = new ToolbarButton( 'NewButton', 'New Button'     ) ; break;

You'll need to create a button called newbutton.gif and put it in the de/skins/default folder.

Next, we need to add the command. Add this line after line 2050:

c["NewButton"] = new NewButton();

Now add this code to the bottom of the common.js file:

// NewButton command
var NewButton = function(){
    this.Name = 'NewButton' ;
}

NewButton.prototype.execute = function(word)
{
    alert("Test");
}

ReplaceWord.prototype.getMode = function(){return OFF;}

The alert("Test"); part of the code is where you would put the JavaScript you want to execute. For information on the JavaScript API, see this link:

http://www.interspire.com/devedit/documentation.php

Related Articles

No related articles were found.

Attachments

No attachments were found.

Powered by Interspire Knowledge Manager - World's #1 Best Selling FAQ and Knowledge Base Software