Thursday, March 31, 2005

CCMS Web Site

A number of updates have been made to the site. Mostly content, so not much to speak of here.

I did have to modify the show/hide script. There was a but where div and span tags would be hidden by the script if they were contained within a shContent section. I had to modify the conditional that checked the class type of the tags. It was only checking for one condition and if the conditional failed that test blindly applying the opposite. I changed it so that the conditional tested on both possible states.

Regarding that same conditional, I should change it so that the class value is search for (e.g. using indexOf) rather than doing an outright equality comparison. Something to keep in mind for future upates.

RSL:PD Online

Going up tonight.

Wednesday, March 30, 2005

Prototyping

Spent two more days working on the prototype for FM. Mostly cosmetic and fixes, but a few JS functionality fixes and additions as well.

One problem was that on documents that use the show/hide JS functionality a link from an external page to a page anchor would not work correctly. The reason was that the page was being loaded and the anchor location noted and jumped to prior to the implementation of the show/hide functionality. So the browser scrolls to the location of the anchor before the show/hide sections are hidden. Once the show/hide sections are hidden the document length changes and the anchor will change position. However, the browser itself has finished navigation and so the anchor will move beyond the top of the screen.

I overcame the problem by using the findYPos function from PPK's QuirksMode Web site to locate the anchor after the page has finished initializing and then using the window object's scroll function to put it into view.

One other modification deserves mention if for no other reason that the functionality could prove useful in the future. I needed a method of having a show/hide section be shown if a user visits the page via a URL that has an anchor pointing to the section. I had neglected to make the show/hide code more modular and so would have had to rewrite it in order to accommodate this fact. Rather than spend the time doing that I found a method of simulating a user click on the link associated with the section in question. Now when the page loads initially the script execute the following code, which simulated the link click:
if (sh_bw.ie) {
objTags[i].click();
}
if (sh_bw.dom && !sh_bw.ie) {
var e = document.createEvent('MouseEvents');
e.initMouseEvent('click',true,true,document.defaultView,1,0,0,0,0,false,false,false,false,0,null);
objTags[i].dispatchEvent(e);
}
objTags is a document.getElementsByTagName('a'). The first part of the code is the IE specific code to perform the click (Does it also support the standard code? I don't know.). The second part is the DOM method supported by Gecko which I found via Google Groups (thanks Mike W.).

Friday, March 25, 2005

Instructional Components Prototype

This project has occupied most of my time this week. I've done so much JavaScript work on it trying to get show/hide functionality working across all the various content modules all contained within the same document. I've made some progress in some areas, but problems still abound. We need to sit down at some point and discuss the exact functionality needed for this thing so we can actually plan a course of development rather than hack it together as something is brought up. Right now I'm trying to figure out how to enable back/forward navigation but it's not going very well.

I've also done a bit of SVG work for this, creating a floating navigational element (pan/zoom). It works well enough, but I pretty much just hacked together scripts from other sources. FM wants to create a library of objects we can use for navigation and other features, which is probably a good idea if we're going to continue using SVG. At some point I'll need to devote some time to developing something we can use that looks a little nicer. What I've done for the prototype is functional but a little skittish when it comes to mouse tracking and not smooth enough for production use.

Mass Mailing

To the web list. 2371 recipients. A fairly large number of bounces for bad e-mail, which is surprising on this list. Also a couple of the typical stupid spam filters. Some people shouldn't be responsible for e-mail systems. One system blacklisted us because our e-mail contained the word "cialis" but the only occurence of that phrase was in the word "specialists."

Friday, March 18, 2005

Component Prototype

I made some major modifications to the show/hide navigation script I wrote for inclusion in the prototype that FM is working on. Some of the modifications may make their way back into the script, but for now I'll be keeping them separate. Here's a breakdown of the changes:
  • Split up the initial setup portion of the script into two parts: one sets up the page for use with the navigation script (hide navigation sections, add click event for every link to aid in navigation); the second determines which section needs to be shown.
  • The new second part of the function determines whether or not an anchor is included in the URL. If none is present then the first section is made visible. If one is present and it matches one of the navigation sections then that section is made visible. If it matches an anchor other than one of the navigation sections it climbs the DOM tree to see if that anchor is contained in one of the navigation sections, which is then made visible.
  • The new click event for links was necessary to allow anchor navigation within a document. Since an anchor may be in a hidden section it was necessary to find a way to determine when such a link was clicked so that the correct section could be shown. The function loads the new URL and then reloads the page, causing the load event to fire which then displays the correct navigation section and jumps to the anchor point.
  • Split the function that shows/hides the navigation section into two different functions. The first determines (based on the click event) which navigational link was click and so which section needs to be shown. The second performs the actual work of showing the correct section. I split this up so that I could do the show/hide work outside of the original flow (the navigation click). This was necessary for the creation of the added functionality described in the previous bullets. It also allows someone to create a link to perform this function.
I still have a few problems to work out, bookmarking and back/forward navigation. Regarding bookmarking, since the script prevents the browser from loading the navigation links it is impossible to bookmark a section. One way around this is to not prevent the default action, but the jumping around that occurs is not desirable. Regarding history navigation, since JS is responsible for setting up the state of a document (e.g. which section is shown), and since there is no way to detect the action of clicking back/forward, the back/forward navigation of the browser becomes unusable.

Friday, March 11, 2005

IERI Utility

There's a problem when processing an enacted analysis sighting when the sighting has no observable indicators (whether defined in the criterion or marked as "Not Applicable" by the analyst). Indicators that aren't observable/applicable are marked as a -1 internally. Any value entered for these indicators leads them to be counted as having been rated (all indicators must be rated in some way before the criterion rating can be made). However, since these are not observable/applicable indicators they are not added to the indicator sum for calculation of the criterion rating. Thus, if all indicators in a sighting are not observable/applicable the indicator sum will be zero and an overflow occurs. I modified the rating portion of the script to check and see if the indicators rated is greater than zero, allowing for a valid criterion rating to be produced. If no indicators have an actual rating the utility maintains a "Not Rated" state.

Thursday, March 03, 2005

Web Site Updates

I've completed some help text for the AAAS search engine. The text is fairly comprehensive (I think) and is the first step on our three-stage plan to revitalize the web site. Initially I had planned on including images to help illustrate the explanations provided. In the end, though, I decided that it would probably not be necessary and that I did not want to spend the time working on it.

I'll be showing off the survey at tomorrow's Web Oversight meeting.

Francis has some suggestions that look pretty good. One of the suggestions includes adding an image to one section and so I may end up adding others as well.