Permalink
Browse files

updated microdata processor javascript

  • Loading branch information...
1 parent 9ef0233 commit 0994183d2b311bcd4aa8eccf662bed9994556f03 @CatChen committed Jul 2, 2012
@@ -6,7 +6,7 @@
</head>
<body>
<div itemscope itemtype="http://schema.org/SoftwareApplication" class="download">
- <img itemprop="image" src="https://ssl.gstatic.com/android/market/com.zeptolab.ctr.paid/hi-124-11" />
+ <img itemprop="image" src="https://ssl.gstatic.com/android/market/com.zeptolab.ctr.paid/hi-124-11" alt="" />
<a itemprop="url" href="">
<span itemprop="name">Cut the Rope</span>
(<span itemprop="softwareVersion">1.3</span>)
@@ -45,6 +45,7 @@
hashArray.push(key + '=' +hash[key]);
}
+ /* TODO: support itemid */
link.hash = '#' + hashArray.join('&');
}
};
@@ -65,6 +66,7 @@
if (getNearestScopeElement(propElement) === scopeElement) {
var itemProp = getItemProp(propElement);
if (itemProp.key) {
+ /* TODO: need to add multiple values support instead of simple overriding existed key */
directItemProps[itemProp.key] = itemProp.value;
}
}
@@ -76,6 +78,7 @@
/* see Microdata standard for how to extract value from element: http://www.w3.org/TR/microdata/#values */
var property = {};
property.node = propElement;
+ /* TODO: support multiple keys within one itemprop attribute */
property.key = propElement.getAttribute('itemprop');
if (propElement.hasAttribute('itemscope')) {
@@ -109,7 +112,7 @@
property.value = propElement.value;
break;
case 'TIME':
- property.value = propElement.getAttribute('datetime');
+ property.value = propElement.getAttribute('datetime') || propElement.textContent;
break;
default:
property.value = propElement.textContent;

0 comments on commit 0994183

Please sign in to comment.