Closed Bug 124882 Opened 24 years ago Closed 24 years ago

Update logic for contextual help

Categories

(SeaMonkey :: Help Documentation, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.0.1

People

(Reporter: oeschger, Assigned: oeschger)

References

()

Details

Notes from alecf about the way we ask for a help topic from the UI: [needs to be fixed because,] by determining the codepath based on the format of a string you're inventing a syntax, which unnecessarily complicates your code. Instead, you should let the syntax of javascript choose your codepath for you. Consider: function openHelpTopic(topic) { topWindow.displayTopic(topic); } function openHelpUrl(uri) { var URI = normalizeURI(uri); topWindow.displayTopic(URI.topic); } you'll notice that there are no branches in the above code, and neither function needs to unpack/parse the contents of the strings that are passed in. In your solution, the looks more or less like: function openHelp(uri) { var URI = normalizeuri(uri); // break out uri into topic and url, note that "uri" may actually be the topic topWidnow.displayTopic(URI.topic); } What I'm saying basically is that you want to make one function that takes two kinds of parameters, when in fact the caller should always KNOW what kind of parameter they are passing in... meaning the caller already knows which codepath should be followed - so there is no need to obscure this knowledge by encoding it in a string.
Accepting and moving out to just beyond the Big Release. I'd like to get context help working again right away and then make this change as soon as I can after that.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0.1
This ain't necessarily so. When I'm wearing my UA consultant's hat ( a big MS Access Accounting and Manufaturing package) I have code which references up to 80 different help files. Being able to specify only the topic will not work. I suppose that, in this case, each call to openHelp could be prefixed be a call to setHelpFileURI()- then you have to be careful to also restore it after each call. That makes three calls instead of one.
Blocks: 118834
This was taken care of with a previous check-in. Logic for context-sensitive help is as it should be. Marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
v
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.