Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tagcloud/tagcloud.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// tagcloud
(function(){
// Add tagcloud counter
var tagCloudNb = 1;
[].forEach.call( document.querySelectorAll('[tagcloud]'), function(cloud) {
// Find all tagcloud items with a weight defined and add them to this array
var weights = [].slice.call(cloud.querySelectorAll('[tagcloud-weight]'))
Expand Down Expand Up @@ -43,7 +45,7 @@
.map(function(item) {
return ( item.indexOf('span') === -1 ) ? '<span>' + item.trim() + '</span> ' : item.trim();
})
.join("");
.join(" ");

}

Expand Down Expand Up @@ -97,7 +99,7 @@
}

// Replace the inner html of the slide with the formatted tags
cloud.innerHTML = formatTags(cloud.innerHTML);
cloud.innerHTML = "<tagcloud>" + formatTags(cloud.innerHTML) + "</tagcloud>";

// Append the slideNotes to the slide again
for(index = 0; index < slideNotes.length; ++index) {
Expand All @@ -120,5 +122,8 @@
elem.style.color = tagColor(elem, isBlackWhite);
}
});
// Add id to style
cloud.setAttribute("id", "tagCloud-" + tagcloudnb);
tagcloudnb ++;
});
})();