Open Bug 256524 Opened 21 years ago Updated 17 years ago

alert()/confirm()/prompt() should allow a help or "More Info..." link or button

Categories

(SeaMonkey :: UI Design, enhancement)

All
Linux
enhancement
Not set
normal

Tracking

(Not tracked)

People

(Reporter: netdragon, Unassigned)

Details

Sometimes you want to make the alert()/confirm()/prompt() message short, but also want to provide more information for the user when its necessary for them to see more information. I think a good tradeoff would be to allow a help or More Info.. button or link that would either bring up the Mozilla Firefox Help or Mozilla Help to a page titled "Alert and Confirmation Messages", and scrolls to the right section. This could be provided as an additional parameter to the alert(), confirm(), and prompt() functions that are not available to non-chrome javascript, or it can be provided as additional functions that are not available to non-chrome javascript. An example of when this would be useful is bug 112848 - "Does your grandmother know what POSTDATA is?"
Product: Core → Mozilla Application Suite
This is a request for a feature that would not be in conformance with the W3C Document Object Module. Comments for extensions to the existing APIs should be directed towards relevant authorities that are in charge of standardizing APIs. Let's try not to introduce more browser-specific incompatibilities.
Actually alert/confirm/prompt are DOM 0, and are therefore not part of any formalized specification. Mutating them in vendor-specific ways is probably OK as long as the mutation doesn't interfere with the expected behavior. In this instance I'd recommend adding a second parameter to these functions, which would be an object that has various keys: alert( "This document has been changed since the last time you saved it. Do you want to save your changes?", { moreInfo: "http://mycoolwebsite.com/kb/DocumentChanges" } ); Making the extra parameter a hash would allow other features to be implemented on top of it (for example, changing the buttons) while still retaining backward compatibility. So, the proposed syntax is: alert( message [, alertObject] ); where alertObject is an object with (at least) the member 'moreInfo'. Other members (e.g., buttonLabels, alertText, etc) could be added later.
(In reply to comment #2) Adding an extra button that opens a new window shouldn't be a problem. Making alert() take an extra parameter is a problem, however, because any code that uses it won't be compatible with any other browser.
Filter "spam" on "guifeatures-nobody-20080610".
Assignee: guifeatures → nobody
QA Contact: guifeatures
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.