W3C home > Mailing lists > Public > public-html-commits@w3.org > January 2010

html5/md Overview.html,1.19,1.20

From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 18 Jan 2010 06:46:29 +0000
To: public-html-commits@w3.org
Message-Id: <E1NWlNd-000547-SR@lionel-hutz.w3.org>
Update of /sources/public/html5/md
In directory hutz:/tmp/cvs-serv19457

Modified Files:
	Overview.html 
Log Message:
Fix some coding errors in a scripted iCalendar example. (whatwg r4605)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/md/Overview.html,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- Overview.html	18 Jan 2010 06:36:29 -0000	1.19
+++ Overview.html	18 Jan 2010 06:46:27 -0000	1.20
@@ -3793,7 +3793,9 @@
    this:</p>
 
    <pre>function getCalendar(node) {
-  while (node &amp;&amp; (!node.nodeScope || !node.itemType == 'http://microformats.org/profile/hcalendar#vevent'))
+  // This function assumes the content is valid.
+  // It is not a compliant implementation of the algorithm for <a href="#extracting-vevent-data">extracting vEvent data</a>.
+  while (node &amp;&amp; (!node.itemScope || !node.itemType == 'http://microformats.org/profile/hcalendar#vevent'))
     node = node.parentNode;
   if (!node) {
     alert('No event data found.');
@@ -3811,19 +3813,19 @@
     var parameters = '';
     if (prop.localName == 'time') {
       value = value.replace(/[:-]/g, '');
-      if (prop.date &amp;&amp; prop.time)
+      if (value.match(/T/))
         parameters = ';VALUE=DATE';
       else
         parameters = ';VALUE=DATE-TIME';
     } else {
       value = value.replace(/\\/g, '\\n');
       value = value.replace(/;/g, '\\;');
-      value = value.replace(/,/g, \\,');
+      value = value.replace(/,/g, '\\,');
       value = value.replace(/\n/g, '\\n');
     }
     for (var nameIndex = 0; nameIndex &lt; prop.itemProp.length; nameIndex += 1) {
       var name = prop.itemProp[nameIndex];
-      if (!name.match(':') &amp;&amp; !name.match('.'))
+      if (!name.match(/:/) &amp;&amp; !name.match(/\./))
         calendar += name.toUpperCase() + parameters + ':' + value + '\r\n';
     }
   }
Received on Monday, 18 January 2010 06:46:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 18 January 2010 06:46:37 GMT