Re: Contacts API updates

The issue I see with this approach is that it has nothing to do with the standard we are defining in terms of the API itself and is only informative to show how scripts can create a vCard and set the href. Am I missing something? 

Suresh

----- Original Message -----
From: Anssi Kostiainen [mailto:anssi.kostiainen@nokia.com]
Sent: Wednesday, January 12, 2011 09:03 AM
To: ext Rich Tibbett <rich.tibbett@gmail.com>
Cc: public-device-apis@w3.org <public-device-apis@w3.org>
Subject: Re: Contacts API updates

Hi,

On 6.1.2011, at 18.35, ext Rich Tibbett wrote:

> On Thu, Jan 6, 2011 at 4:30 PM, Rich Tibbett <rich.tibbett@gmail.com> wrote:
> I've updated the Contacts draft in line with recent discussions.
> 
> As usual, the CVS log is available at [1] and changes from the previous version can be viewed via the diff log at [2].
> 
> Please let me know if there are any outstanding changes to be made and thanks for all your input to date.

Looks great! It would be cool if we could also use data URIs for adding/updating contacts (or calendar entries/...) as an alternative to the File Writer-based mechanism described here:

  http://dev.w3.org/2009/dap/contacts/#adding-a-new-contact

Actually, the following works in Chrome already:

<a id="vcard">Save Contact</a>

<script>
var vcard = 'BEGIN:VCARD\n' +
            'VERSION:3.0\n' +
            'N:Doe;John;;;\n' +
            'FN:John Doe\n' +
            'TEL;type=CELL:123456\n' +
            'END:VCARD';

document.getElementById('vcard').href = 'data:text/x-vcard;charset=utf-8,' + encodeURIComponent(vcard);
</script>

It seems Chrome acts solely based on provided MIME-type (text/x-vcard), and does not require Content-Disposition header in order to trigger the Open/Save As dialog.

I found a thread on this exact case but it seems it did not go anywhere:

  http://lists.w3.org/Archives/Public/uri/2010Feb/0058.html

-Anssi



---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

Received on Wednesday, 12 January 2011 15:40:30 UTC