Wednesday, February 13, 2008

New Additions and Functionality

Resizing Gripper

With the help of The University of Pennsylvania Libraries Toolbar I was able to correct and add a resizing gripper to the toolbar. The gripper behavior is a bit non-intuitive as to how it works but I was able to correct the behavior by locking down each component by setting their flex values. The gripper resizes the box to the immediate left of it and nothing else. If the values were not set then resizing the toolbar would be destructive and when you pulled the bar to the left and let go of the element it would leave everything scrunched together (like my previous post).

So each XUL element needs to have locked size settings and a setting for flex:
flex = "0" (or 1) (0 means that it is not flexible, 1 means you can resize it).

Tabbing Controls

One of my faculty asked me to standardize the searching method that is built into the toolbar to load each new search into a pop-up menu. I have added the option to pick whether or not the user wants to load searches in new windows or to load them in the current window they are working in. The following XUL script will add in a tabbing section to a menu. The function that follows controls whether or not tabbing is used.

<menupopup id="EToolbar Settings">
<menuitem label="Tabbing On" oncommand="engrTabSet(true)" tooltiptext="Turn Tabbing On" />
<menuitem label="Tabbing Off" oncommand="engrTabSet(false)" tooliptext="Turn Tabbing Off" />

Javascript Functions:

//engrTabSet(Boolean) - Sets whether tabbing is on or off.

function engrTabSet(engrtabval)

//engrTab(String) takes the string that is given to it and either loads it into a new tab (if tabbing is on) or loads it into the same window otherwise.

function engrTab(engrlink)
var newTab=getBrowser().addTab(engrlink);

I have gone through the code that I used for the toolbar and cleaned up syntax and formatting. I also standardized several of the functions so there would be no conflicts with other applications.

No comments: