fix examples using event handlers
authorAnne van Kesteren <annevk@opera.com>
Fri, 15 Jun 2012 10:37:28 +0200
changeset 13 e6822fd2e4f2
parent 12 c115a6e7895e
child 14 b7484c2b2d43
fix examples using event handlers
Overview.html
Overview.src.html
--- a/Overview.html	Tue Jun 12 15:15:21 2012 +0200
+++ b/Overview.html	Fri Jun 15 10:37:28 2012 +0200
@@ -47,7 +47,7 @@
 <!--end-logo-->
 
 <h1>Web Notifications</h1>
-<h2 class="no-num no-toc" id="editor's-draft-12-june-2012">Editor's Draft 12 June 2012</h2>
+<h2 class="no-num no-toc" id="editor's-draft-15-june-2012">Editor's Draft 15 June 2012</h2>
 
 <dl>
  <dt>This Version:
@@ -92,7 +92,7 @@
 found in the <a href="http://www.w3.org/TR/">W3C technical reports index</a>
 at http://www.w3.org/TR/.</em>
 
-<p>This is the 12 June 2012 Editor's Draft of Web Notifications.
+<p>This is the 15 June 2012 Editor's Draft of Web Notifications.
 Please send comments to
 <a href="mailto:public-web-notification@w3.org">public-web-notification@w3.org</a>
 (<a href="http://lists.w3.org/Archives/Public/public-web-notification/">archived</a>).
@@ -584,39 +584,29 @@
 
 <h3 id="using-events"><span class="secno">7.1 </span>Using events</h3>
 
-<p>
-	Notification objects dispatch events during their lifecycle, which authors can use
-	to generate desired behaviors.
-      </p>
-      <p>
-	The <code>show</code> event occurs when the notification is shown to the user --
-	this may be at some time after the notification is created in the case
-	of limited display space and a queue.
-      </p>
-
-      <p>
-	In the following example, this event is used to guarantee that regardless of when
-	the notification is shown, it is displayed for only 15 seconds.
-      </p>
+<p><code><a href="#notification">Notification</a></code> objects dispatch events during their lifecycle,
+which developers can use to generate desired behaviors.
 
-<pre class="example">new Notification("New Email Received",
-                 { iconUrl: "mail.png",
-                   onshow: function() { setTimeout(notification.close(), 15000); }
-                 });</pre>
-
-<p>The <code>close</code> events occurs when the notification is dismissed by the user.
-	Authors may use this event to perform actions when notifications are acknowledged.
+<p>The <code title="event-show">show</code> event dispatches when the
+<a href="#concept-notification" title="concept-notification">notification</a> is shown to the user
+— this may be at some time after the notification is created in the
+case of limited display space and a queue.
 
-<p>
-	In the following example, when a meeting reminder notification is acknowledged, the
-	application suppresses other forms of reminders.
-      </p>
+<p>In the following example, this event is used to guarantee that regardless
+of when the notification is shown, it is displayed for only 15 seconds.
 
-<pre class="example">new Notification("Meeting about to begin",
-                 { iconUrl: "calendar.gif",
-                   body: "Room 101",
-                   onclose: function() { cancelReminders(event); }
-                 });</pre>
+<pre class="example">var notification = new Notification("New Email Received", { iconUrl: "mail.png" })
+notification.onshow = function() { setTimeout(notification.close(), 15000) }</pre>
+
+<p>The <code title="event-close">close</code> events dispatches when the
+notification is dismissed by the user. Developers may use this event to
+perform actions when notifications are acknowledged.
+
+<p>In the following example, when a meeting reminder notification is
+acknowledged, the application suppresses other forms of reminders.
+
+<pre class="example">var notification = new Notification("Meeting about to begin", { iconUrl: "calendar.gif", body: "Room 101" })
+notification.onclose = function(event) { cancelReminders(event) }</pre>
 
 
 <h3 id="tags-example"><span class="secno">7.2 </span>Using the <code title="">tag</code> member for multiple instances</h3>
--- a/Overview.src.html	Tue Jun 12 15:15:21 2012 +0200
+++ b/Overview.src.html	Fri Jun 15 10:37:28 2012 +0200
@@ -562,39 +562,29 @@
 
 <h3>Using events</h3>
 
-<p>
-	Notification objects dispatch events during their lifecycle, which authors can use
-	to generate desired behaviors.
-      </p>
-      <p>
-	The <code>show</code> event occurs when the notification is shown to the user --
-	this may be at some time after the notification is created in the case
-	of limited display space and a queue.
-      </p>
-
-      <p>
-	In the following example, this event is used to guarantee that regardless of when
-	the notification is shown, it is displayed for only 15 seconds.
-      </p>
+<p><code>Notification</code> objects dispatch events during their lifecycle,
+which developers can use to generate desired behaviors.
 
-<pre class="example">new Notification("New Email Received",
-                 { iconUrl: "mail.png",
-                   onshow: function() { setTimeout(notification.close(), 15000); }
-                 });</pre>
-
-<p>The <code>close</code> events occurs when the notification is dismissed by the user.
-	Authors may use this event to perform actions when notifications are acknowledged.
+<p>The <code title=event-show>show</code> event dispatches when the
+<span title=concept-notification>notification</span> is shown to the user
+&mdash; this may be at some time after the notification is created in the
+case of limited display space and a queue.
 
-<p>
-	In the following example, when a meeting reminder notification is acknowledged, the
-	application suppresses other forms of reminders.
-      </p>
+<p>In the following example, this event is used to guarantee that regardless
+of when the notification is shown, it is displayed for only 15 seconds.
 
-<pre class="example">new Notification("Meeting about to begin",
-                 { iconUrl: "calendar.gif",
-                   body: "Room 101",
-                   onclose: function() { cancelReminders(event); }
-                 });</pre>
+<pre class="example">var notification = new Notification("New Email Received", { iconUrl: "mail.png" })
+notification.onshow = function() { setTimeout(notification.close(), 15000) }</pre>
+
+<p>The <code title=event-close>close</code> events dispatches when the
+notification is dismissed by the user. Developers may use this event to
+perform actions when notifications are acknowledged.
+
+<p>In the following example, when a meeting reminder notification is
+acknowledged, the application suppresses other forms of reminders.
+
+<pre class="example">var notification = new Notification("Meeting about to begin", { iconUrl: "calendar.gif", body: "Room 101" })
+notification.onclose = function(event) { cancelReminders(event) }</pre>
 
 
 <h3 id="tags-example">Using the <code title>tag</code> member for multiple instances</h3>