[sword-devel] SWORDWEB Footnote / Cross-ref support

DM Smith dmsmith555 at yahoo.com
Sun Jan 29 07:04:32 MST 2006

Looks good. Some thoughts.

In the NASB module each of the notes and cross references has an "n" 
attribute which can be used for a marker. I don't know if the sword api 
exposes them. If it does, you might want to use it.

In the "It's just my preference" category, I think that since you are 
not listing the notes at the foot of the page, they are not foot notes. 
The first thing that I did after clicking on "Show footnotes" was to 
scroll to the foot of the page to see the notes. Perhaps just call them 

In the KJV, notes often have references. How would that be handled?

If the reference is to something on the same page, should it do 
something different?

I run my monitor at a high resolution and it is hard for me to click on 
the little 'n's or 'x's. I noticed in the html that the spacing is 
outside the span. Perhaps putting it into the span would help. I think 
that using different marks might also help, such as †. You might 
not need to superscript it or make it smaller.

It appears that the showing or hiding of footnotes or cross references 
goes back out to the server. It is pretty fast but it causes a redraw 
and a jumping around of the page. I don't know what is done during that 
refresh, but I think that the page could be gotten with all the notes 
and references and the page built with them, but making them visible 
based on the state of the settings.

To do this, the "Study Tools" options would need to change to call 
javascript to toggle the setting and then invoke the appropriate 
behavior. The spacing around spans would need to be moved inside.

The appropriate behaviour may be to call passageStudy.jsp as it does now 
or to change the display state of the span with something like the 
following pseudo code:

 * Set the display state of sought tags.
 * @param root         the element whose descendants are examined
 * @param tagname      the tag of the elements being sought
 * @param classvalue   the class of elements being sought
 *                     An empty classvalue means that all elements match.
 * @param displayState "none" to hide, "inline" or "block" to show
function setState(root, tagName, classValue, displayState)
  // Get all the descendants of root having the desired tagName
  var elements = root.getElementsByTagName(tagName);
  for (var i=0; i < elements.length; i++)
    var item = elements[i];
    // for those elements that match on classValue
    if (!classValue || item.className == classValue)
      // set the state as desired.
      item.style.display = displayState;

I have used something like this to manage a tree made from a nested 
list. If you find this interesting and want more details please ask.

In His Service,

Troy A. Griffitts wrote:
> A first attempt at footnote / crossref support is available for 
> testing at:
> http://crosswire.org/study/passagestudy.jsp
> Notice 2 new tools on the right: Show [Footnotes | Cross-references]
> Your feedback is appreciated.
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

More information about the sword-devel mailing list