- From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 18 Jan 2010 06:46:29 +0000
- To: public-html-commits@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 && (!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 && (!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 && 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 < prop.itemProp.length; nameIndex += 1) {
var name = prop.itemProp[nameIndex];
- if (!name.match(':') && !name.match('.'))
+ if (!name.match(/:/) && !name.match(/\./))
calendar += name.toUpperCase() + parameters + ':' + value + '\r\n';
}
}
Received on Monday, 18 January 2010 06:46:31 UTC