Re: Extra option for custom information

On 07/30/2012 10:30 AM, ext Anne van Kesteren wrote:
> On Fri, Jul 27, 2012 at 10:35 AM, Adrian Yanes <adrian.yanes@nokia.com> wrote:
>> An extra options in the Notifications Options like:
>>
>> DOMString extra; (another meaningful name is more than welcome)
>>
>> could to this job, this option could be reserved for all of the
>> information that it is not common over all the notifications, but that
>> can be extremely useful at the agent's level in terms of behavior
>> definition.
>>
>> Therefore, the end-user will have the capability to add extra
>> information, like the indication of persistence, timestamps, etc;
>> without to overlap other options such as tag.
> Could you give a more elaborate example as to how you envision this to
> work? I don't get it.
>
>

Let's imagine we want to indicate this notification should be persistent
at the UI level.

The extra field can host any value that the developer wants; the
developer chooses that 'persistent' is the string-flag he will use to
indicate that this notification should now be removed from the queue or
that it requires further interaction (despite onclick, onshow, onerror,
onclose..):

new Notification("New mail from John Doe",
{ tag: 'message1' , extra: 'persistent' }); 


The idea is to provide an extra field content-free that allows other information that can be useful for particular usecases.

Of course same behavior can be achieved in other layers not involving the notification object itself. However, in other notification systems I worked on, I always missed the lack of an option that allows me to add any extra info that I could need in addition to the common fields

Regards,

Adrian.

Received on Monday, 30 July 2012 07:46:57 UTC