W3C home > Mailing lists > Public > public-html-commits@w3.org > August 2008

html5/workers Overview.html,1.52,1.53

From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 27 Aug 2008 23:16:43 +0000
To: public-html-commits@w3.org
Message-Id: <E1KYUFn-0004Q0-LX@lionel-hutz.w3.org>

Update of /sources/public/html5/workers
In directory hutz:/tmp/cvs-serv16966

Modified Files:
	Overview.html 
Log Message:
Woops, error in the example. (credit: js) (whatwg r60)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/workers/Overview.html,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- Overview.html	27 Aug 2008 09:55:18 -0000	1.52
+++ Overview.html	27 Aug 2008 23:16:41 -0000	1.53
@@ -549,7 +549,7 @@
      // no longer need this listener
      worker.port.removeEventListener('message', configure, false);
    }
-   worker.addEventListener('message', configure, false);
+   worker.port.addEventListener('message', configure, false);
 
    // MAP
    function paintMap(event) {
@@ -569,7 +569,7 @@
        }
      }
    }
-   worker.addEventListener('message', paintMap, false);
+   worker.port.addEventListener('message', paintMap, false);
 
    // PUBLIC CHAT
    function updatePublicChat(event) {
@@ -585,7 +585,7 @@
      dd.textContent = message;
      dialog.appendChild(dd);
    }
-   worker.addEventListener('message', updatePublicChat, false);
+   worker.port.addEventListener('message', updatePublicChat, false);
 
    // PRIVATE CHAT
    function startPrivateChat(event) {
@@ -629,7 +629,7 @@
      form.appendChild(p);
      li.appendChild(form);
    }
-   worker.addEventListener('message', startPrivateChat, false);
+   worker.port.addEventListener('message', startPrivateChat, false);
   &lt;/script>
  &lt;/head>
  &lt;body>
@@ -637,16 +637,16 @@
   &lt;h2>Map&lt;/h2>
   &lt;p>&lt;canvas id="map" height=150 width=150>&lt;/canvas>&lt;/p>
   &lt;p>
-   &lt;button type=button onclick="worker.postMessage('mov left')">Left&lt;/button>
-   &lt;button type=button onclick="worker.postMessage('mov up')">Up&lt;/button>
-   &lt;button type=button onclick="worker.postMessage('mov down')">Down&lt;/button>
-   &lt;button type=button onclick="worker.postMessage('mov right')">Right&lt;/button>
-   &lt;button type=button onclick="worker.postMessage('set 0')">Set 0&lt;/button>
-   &lt;button type=button onclick="worker.postMessage('set 1')">Set 1&lt;/button>
+   &lt;button type=button onclick="worker.port.postMessage('mov left')">Left&lt;/button>
+   &lt;button type=button onclick="worker.port.postMessage('mov up')">Up&lt;/button>
+   &lt;button type=button onclick="worker.port.postMessage('mov down')">Down&lt;/button>
+   &lt;button type=button onclick="worker.port.postMessage('mov right')">Right&lt;/button>
+   &lt;button type=button onclick="worker.port.postMessage('set 0')">Set 0&lt;/button>
+   &lt;button type=button onclick="worker.port.postMessage('set 1')">Set 1&lt;/button>
   &lt;/p>
   &lt;h2>Public Chat&lt;/h2>
   &lt;dialog id="public">&lt;/dialog>
-  &lt;form onsubmit="worker.postMessage('txt ' + message.value); message.value = ''; return false;">
+  &lt;form onsubmit="worker.port.postMessage('txt ' + message.value); message.value = ''; return false;">
    &lt;p>
     &lt;input type="text" name="message" size="50">
     &lt;button>Post&lt;/button>
Received on Wednesday, 27 August 2008 23:17:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 9 October 2008 20:32:59 GMT