Open Bug 191518 Opened 22 years ago Updated 10 years ago

implement the "view complete vCard" button for vcards so they work in mail even when JS is disabled.

Categories

(SeaMonkey :: MailNews: Message Display, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: sspitzer, Unassigned)

References

Details

implement the "add to addressbook" button for vcards in mail messages (or in web
pages)

start here, but this might not be exactly how we'll do this in mozilla:

http://lxr.mozilla.org/mozilla/source/mailnews/mime/cthandlers/vcard/mimevcrd.cpp#1017

1017 /**** RICHIE: When we get the addbook:add protocol into the product, we
need to turn this stuff back on!
1018   rsrcString = VCardGetStringByID(VCARD_MSG_ADD_TO_ADDR_BOOK);
1019   htmlLine2 = PR_smprintf ("<FORM name=form1 METHOD=get
ACTION=\"addbook:add\"><INPUT TYPE=hidden name=vcard VALUE=\"%s\"><INPUT
type=submit value=\"%s\"></INPUT></FORM>",
1020                            vEscCard, rsrcString); 
1021   PR_FREEIF(rsrcString);
1022 
1023   if (!htmlLine1 && !htmlLine2)
1024 ******/
futuring.
Target Milestone: --- → Future
I'm going to morph this bug.

since bug #14373 is fixed, this works, but only if you allow javascript to be
run in mail messages.

if it is disabled, which it is by default, you won't see this button (or the
"view complete/view condensed" vcard buttons.

we need to find a way to do this when JS is disabled.
Blocks: 14373
Status: NEW → ASSIGNED
Summary: implement the "add to addressbook" button for vcards in mail messages (or in web pages) → implement the "add to addressbook" and "view complete vCard" buttons for vcards so they work in mail even when JS is disabled.
*** Bug 126895 has been marked as a duplicate of this bug. ***
scott, does BMS need this?  (I think they might)
No longer blocks: 14373
Depends on: 14373
Could it be implemented by using a context menu?
Blocks: 221542
Yeah we'll want to do this sooner rather than later. Not sure how  we can yet
though since JS is disabled. 
Assignee: sspitzer → scott
Status: ASSIGNED → NEW
Target Milestone: Future → mozilla1.6alpha
sorry, "add to addressbook" button will (and does) work if js is disabled.

it's just the view complete vCard button that doesn't work.

ian's idea about a context menu is a good one, but is it discoverable?

Summary: implement the "add to addressbook" and "view complete vCard" buttons for vcards so they work in mail even when JS is disabled. → implement the "view complete vCard" button for vcards so they work in mail even when JS is disabled.
an idea:

we add a new action for the addressbook url

for the "add to addressbook" button, we currently do: "addbook:add?action=add..."

see OutputButtons() in mimevcrd.cpp

to fix this bug, we'll add a "addbook:vcardview?action=complete" and
"addbook:vcardview?action=condensed"

we'll emit a HTML button (like we do for "add to addressbook") and when you
click on it, it runs that url.

in nsAddbookProtocolHandler(), send a notifcation (observer service) that the
state changed

then, we add an observer listener to mail3PaneWindowCommands.js and
messageWindow.js where we'll call MsgReload(), like we do currently when you
"View | Headers | ..." or "View | Message Body As | ..."

we might have hurdles to jump to make the toggle only change the window you
click, and not all the 3 pane / stand alone windows.  (maybe pass in something
about the current window in that addrbook url, and then in the listeners,
require it to match before calling msg reload.

or, instead of call msg reload, we could have our notification listener do what
showAdvanced() and showBasic() do:  poke style attributes on the divs we emit.

it should be possible to access the dom of the message we emit, so maybe that's
a better idea.

or, it was acceptable for this pref to be global pref that persisted (between
viewing messages, which it doesn't in 4.x, or currently), we could just use a
pref and pref listeners, instead of the observer service.

scott / david / neil, what do you think?
> or, instead of call msg reload, we could have our notification listener do what
> showAdvanced() and showBasic() do:  poke style attributes on the divs we emit.

or, as neil suggests, we could just call that js from a context menu or a menu
item, but it's not discoverable.
s/neil suggests/ian neal suggests
Product: Browser → Seamonkey
Address book-related, Mark, thoughts?

This is the only bug that blocks tracking bug 214399.
You could do something similar to what Firefox does for security error pages - although there it has the advantage of knowing what the URL of the page is.

If you want to get really sneaky you could write the vcard as a chrome iframe so that the script in the frame will always run.
Assignee: mscott → nobody
The "View Complete vCard" feature was mostly excised from the tree some time ago.  The only thing that remains to do is get rid of the remaining unused code fragments and strings.
QA Contact: laurel → message-display
Target Milestone: mozilla1.6alpha → ---
You need to log in before you can comment on or make changes to this bug.