|









|
Diodia ToolbarAssembler 1.2 Command Reference
Buttons in a toolbar created with Diodia
ToolbarAssembler activates commands.
The most basic command one can think of is a command opening a web page. The
Navigate command does exactly this.
Attributes are used to pass information to commands.
For example, to open Diodia Software's home page you pass the address
"http://www.diodia.com/" to the Navigate command through the
url attribute.
Placeholders are used to extract the content of text
boxes in a toolbar. To pass a query string entered in a text box to the
Navigate command you use a placeholder like ##TextBox##. For example,
passing the parameter "http://www.yahoo.com/search?p=##TextBox##" to the
Navigate command opens a web page displaying the Yahoo search results
for the phrase currently entered in the text box with the id "TextBox".
Parameters and placeholders make the Navigate command
very powerful. In fact, an entire toolbar can be constructed using only the
Navigate command.
Even more powerful are the JavaScript and the
VBScript commands. These commands execute JavaScript and VBScript
code on the page currently opened in the Internet Explorer.
The script commands have access to the Internet Explorer's DOM
(Document Object Model), and can therefore analyze and make changes on the
current web page. This can be used to automatically fill out forms, find and
highlight words and add a wide range of other features to the Internet
Explorer.
Placeholders can also be used inside scripts, so it is
possible to extract the content of a text box from within a script.
The RssFeedList and RssFeedGoToArticle commands are
used to display RSS content in a toolbar. If you are building a toolbar for a
web site that supports RSS feeds then these two commands makes it very easy to
display up-to-date information from the web site in the toolbar.
The Dialog command is used to create dialogs from HTML
pages. It is mostly used to create About dialogs.
The FindNext, FindPrevious and
Highlight commands are used to find and highlight text strings on the
current web page.
The Execute command is used to launch other
Windows applications from a toolbar.
Commands:
|
Navigate |
|
The
Navigate
command is used to open web
pages. The url attribute contains
the address of
the web page to open.
The target attribute contains the name
of the frame to open the web page in. To just open a new page in the web
browser, don't specify a target. To open a web page in a new window, set
the target to "_blank".
Example:
<?xml version="1.0"
encoding="utf-8"?>
<toolband name="My
Toolbar" company="My Company">
:
<menu caption="News">
:
<button caption="CNN"
command="Navigate"
url="www.cnn.com"/>
<button caption="USA Today"
command="Navigate"
url="www.usatoday.com"/>
<separator/>
<button caption="BBC"
command="Navigate"
target="_blank"
url="www.bbc.co.uk"/>
:
</menu>
:
</toolband> |
|
|
|
JavaScript |
|
The
JavaScript
command is used to execute JavaScript on the current web page.
The script attribute contains the script code, or the name of a file containing the JavaScript code. The
file must be located in the same folder as the toolbar definition file
(ToolbarDefinition.xml).
The file containing the JavaScript code
must have the extension ".js".
JavaScript code in a file must define
either a function called diodia_run_in_all_frames() or a function
called diodia_run_once(). The function is called when the command
is executed, either once for each frame on the current web page or once
in the last frame on the page, depending on which function is defined.
Example
(ToolbarDefinition.xml):
<?xml version="1.0"
encoding="utf-8"?>
<toolband name="My
Toolbar" company="My Company">
:
<button command="JavaScript"
script="autofill.js"
caption="Insert
Name"/>
:
</toolband> |
Example
(autofill.js):
function
diodia_run_in_all_frames()
{
NameBox=document.getElementById('firstname');
NameBox.value='Nick';
} |
|
|
|
VBScript |
|
The
VBScript
command is used to execute
VBScript on the current web page.
The script attribute contains the script code, or the name of a file containing the VBScript code. The
file must be located in the same folder as the toolbar definition file
(ToolbarDefinition.xml).
The file containing the VBScript code
must have the extension ".vbs".
VBScript code in a file must define
either a sub-routine called diodia_run_in_all_frames() or a
sub-routine called diodia_run_once(). The sub-routine is called
when the command is executed, either once for each frame on the current
web page or once in the last frame on the page, depending on which
sub-routine is defined.
Example
(ToolbarDefinition.xml):
<?xml version="1.0"
encoding="utf-8"?>
<toolband name="My
Toolbar" company="My Company">
:
<button command="VBScript"
parameter="highlight.vb"
caption="Highlight"/>
:
</toolband> |
Example
(highlight.vb):
Sub diodia_run_in_all_frames()
set range = document.body.createTextRange()
Do match = range.findText("##TextBox##", 0, 0)
If match <> False Then
range.pasteHTML("<span
style='background-color:yellow'>" & range.text & "</span>")
End If
range.moveEnd "word", 1000
Loop Until Not match
End Sub |
|
|
RssRssFeedList
New in version 1.1 |
|
The
RssFeedList
command displays one or more RSS
feeds in a drop-down list.
The parameter contains the addresses and the titles of the RSS feeds,
alternating and separated by ##, i.e.
|
parameter="address_1##title_1##address_2##title_2##...##address_N##title_N" |
The id attribute is used to assign a unique
identifier to the RSS feed list. The id is required to connect the RSS feed list
to a "go-to-article" button using the RssFeedGoToArticle command.
Example:
<?xml version="1.0"
encoding="utf-8"?>
<toolband name="My
Toolbar" company="My Company">
:
<combo-box command="RssFeedList"
parameter="http://rss.cnn.com/rss/cnn_topstories.rss##CNN"
id="MyFeedList"
fixed-list="yes"
width="200"
auto-size="yes"
/>
:
</toolband> |
|
|
RssFeedGoTo
Article
New in version 1.1 |
|
The
RssFeedGoToArticle
command opens an article currently
shown by an RSS
feed list command.
The parameter contains the unique identifier of the RSS feed list to which the command
is connected.
The id attribute is used to assign a unique
identifier to the "go-to-article" button.
Example:
<?xml version="1.0"
encoding="utf-8"?>
<toolband name="My
Toolbar" company="My Company">
:
<button command="RssFeedGoToArticle"
id="MyFeedGoTo"
parameter="MyFeedList"
caption="Read..." />
:
<</toolband> |
|
|
Dialog
New in version 1.1 |
|
The
Dialog
command opens a HTML page in a
dialog window.
The parameter contains the dimensions of the dialog window and the name of the HTML
page to display,
separated by ##.
Example
(ToolbarDefinition.xml):
<?xml version="1.0"
encoding="utf-8"?>
<toolband name="My
Toolbar" company="My Company">
:
<button command="Dialog"
parameter="360##150##Dialog.htm"
caption="Dialog using HTML" />
:
</toolband> |
|
|
FindNext
New in version 1.2 |
|
The
FindNext
command finds the next
occurrence of a text string on the current web page.
The pattern attribute contains the text string to search for, or
alternatively, the id of an edit or combo-box control to retrieve the
text string from. The id must be enclosed in ##.
Example
(ToolbarDefinition.xml):
<?xml version="1.0"
encoding="utf-8"?>
<toolband name="My
Toolbar" company="My Company">
:
<button command="FindNext"
pattern="##Search##"
caption="Find Next"
tooltip="Find Next"
image="findnext.bmp"/>
:
</toolband> |
|
|
FindPrevious
New in version 1.2 |
|
The
FindPrevious command finds the
previous
occurrence of a text string on the current web page.
The pattern attribute contains the text string to search for, or
alternatively, the id of an edit or combo-box control to retrieve the
text string from. The id must be enclosed in ##.
Example
(ToolbarDefinition.xml):
<?xml version="1.0"
encoding="utf-8"?>
<toolband name="My
Toolbar" company="My Company">
:
<button command="FindPrevious"
pattern="##Search##"
caption="Find
Previous"
tooltip="Find
Previous"
image="findprevious.bmp"/>
:
</toolband> |
|
|
Highlight
New in version 1.2 |
|
The
Highlight
command highlights all
occurrence of a text string on the current web page.
The pattern attribute contains the text string to highlight, or
alternatively, the id of an edit or combo-box control to retrieve the
text string from. The id must be enclosed in ##.
The color attribute
contains the color to highlight with.
Example
(ToolbarDefinition.xml):
<?xml version="1.0"
encoding="utf-8"?>
<toolband name="My
Toolbar" company="My Company">
:
<button command="Highlight"
pattern="##Search##"
caption="Highlight"
tooltip="Highlight"
image="highlight.bmp"
color="yellow"
toggle-button="yes"/>
:
</toolband> |
|
|
Execute
New in version 1.2 |
|
The
Execute
command launches an
application.
The parameter attribute contains the file name of the application to
launch.
Example
(ToolbarDefinition.xml):
<?xml version="1.0"
encoding="utf-8"?>
<toolband name="My
Toolbar" company="My Company">
:
<button command="Execute"
parameter="Calc.exe"
caption="Calculator"
tooltip="Calculator"
image="calc.bmp"/>
:
</toolband> |
|
|
|
|