..:: Sort blog posts by topic: web :: photography :: success ::..
Thursday, January 17, 2008
Blogger.com FTP User's Rejoice! You're Label 'Cloud' is now available...
Finally... At last... It has arrived! Although it is not a true cloud.. maybe that will soon come also.
phydeaux3 of phydeaux3.blogspot.com has created a tasty bit of javascript to enhance my lonely sidebar - and yours too :-)
his code (please ignore the *'s):
<*div id="labelList"><*/div> <*script type="text/javascript">
//<*![CDATA[
function listLabels(root){
var baseURL = '/search/label/';
var baseHeading = "Labels";
var isFTP = false;
var llDiv = document.getElementById('labelList');
var entry = root.entry;
var h2 = document.createElement('h2');
h2.className = 'sidebar-title';
var h2t = document.createTextNode(baseHeading);
h2.appendChild(h2t);
llDiv.appendChild(h2);
var ul = document.createElement('ul');
ul.id = 'label-list';
var category = entry.category;
labelSort = new Array();
for(p in category){
labelSort[labelSort.length] = [category[p].term];
}
labelSort.sort();
for (var r=0; r < labelSort.length; r++){
var li = document.createElement('li');
var a = document.createElement('a');
if(isFTP){
a.href = baseURL
+ encodeURIComponent(labelSort[r])+'.html';
}
else {
a.href = baseURL + encodeURIComponent(labelSort[r]);
}
a.innerHTML = labelSort[r] + ' ';
li.appendChild(a);
ul.appendChild(li);
abnk = document.createTextNode(' ');
ul.appendChild(abnk);
}
llDiv.appendChild(ul);
}
//]]>
<*/script>
<*script type="text/javascript" src="http://www.blogger.com/feeds/
USERID/blogs/BLOGID?alt=json-in-script&callback=listLabels" >
<*/script>Here I will thank phydeaux3 for all his wisdom to figure out how to do this for all the rest of us.
Labels: blogger, javascript, web, Web Development















0 Comments:
Post a Comment
Links to this post:
Create a Link