/
blog-anukramanika.js
1 lines (1 loc) · 6.87 KB
/
blog-anukramanika.js
1
function loadblogindex(a){function b(){if("entry"in a.feed){var b=a.feed.entry.length;totalEntires=totalEntires+b;totalPosts=a.feed.openSearch$totalResults.$t;if(totalPosts>totalEntires){var c=document.createElement("script");c.type="text/javascript";startindex=totalEntires+1;c.setAttribute("src","/feeds/posts/summary?start-index="+startindex+"&max-results=500&alt=json-in-script&callback=loadblogindex");blogindexdiv.appendChild(c)}for(var d=0;d<b;d++){var e=a.feed.entry[d];var f=e.title.$t;var g=e.published.$t.substring(0,10);var h;for(var i=0;i<e.link.length;i++){if(e.link[i].rel=="alternate"){h=e.link[i].href;break}}if("content"in e){var j=e.content.$t}else if("summary"in e){var j=e.summary.$t}else var j="";var k=/<\S[^>]*>/g;j=j.replace(k,"");if(j.length>numChars){j=j.substring(0,numChars);var l=j.lastIndexOf(" ");j=j.substring(0,l)+"..."}var m="";if("category"in e){for(var i=0;i<e.category.length;i++){m+="<a href=\"javascript:filterPosts('"+e.category[i].term+"');\" title=\"'"+e.category[i].term+"' लेबल वाली सभी पोस्ट देखने के लिए क्लिक करें\">"+e.category[i].term+"</a>, "}var n=m.lastIndexOf(",");if(n!=-1){m=m.substring(0,n)}}postTitle.push(f);postDate.push(g);postUrl.push(h);postSum.push(j);postLabels.push(m)}}if(totalEntires==totalPosts){blogindexLoaded=true;showblogindex()}}b();sortPosts(sortBy);blogindexLoaded=true}function filterPosts(a){postFilter=a;displayblogindex(postFilter)}function allPosts(){postFilter="";displayblogindex(postFilter)}function sortPosts(a){function b(a,b){var c=postTitle[a];postTitle[a]=postTitle[b];postTitle[b]=c;var c=postDate[a];postDate[a]=postDate[b];postDate[b]=c;var c=postUrl[a];postUrl[a]=postUrl[b];postUrl[b]=c;var c=postSum[a];postSum[a]=postSum[b];postSum[b]=c;var c=postLabels[a];postLabels[a]=postLabels[b];postLabels[b]=c}for(var c=0;c<postTitle.length-1;c++){for(var d=c+1;d<postTitle.length;d++){if(a=="titleasc"){if(postTitle[c]>postTitle[d]){b(c,d)}}if(a=="titledesc"){if(postTitle[c]<postTitle[d]){b(c,d)}}if(a=="dateoldest"){if(postDate[c]>postDate[d]){b(c,d)}}if(a=="datenewest"){if(postDate[c]<postDate[d]){b(c,d)}}}}}function displayblogindex(a){var b=0;var c="";var d="पोस्ट शीर्षक";var e="शीर्षक के अनुसार छाँटें";var f="प्रकाशित";var g="तिथि के अनुसार छाँटें";var h="लेबल";var i="";if(sortBy=="titleasc"){e+=" (घटते क्रम में)";g+=" (नयी पहले)"}if(sortBy=="titledesc"){e+=" (बढ़ते क्रम में)";g+=" (नयी पहले)"}if(sortBy=="dateoldest"){e+=" (बढ़ते क्रम में)";g+=" (नयी पहले)"}if(sortBy=="datenewest"){e+=" (बढ़ते क्रम में)";g+=" (पुरानी पहले)"}if(postFilter!=""){i="सभी पोस्ट दिखायें"}c+="<table>";c+="<tr>";c+='<td class="blogindex-header-col1">';c+='<a href="javascript:toggleTitleSort();" title="'+e+'">'+d+"</a>";c+="</td>";c+='<td class="blogindex-header-col2">';c+='<a href="javascript:toggleDateSort();" title="'+g+'">'+f+"</a>";c+="</td>";c+='<td class="blogindex-header-col3">';c+='<a href="javascript:allPosts();" title="'+i+'">'+h+"</a>";c+="</td>";c+="</tr>";for(var j=0;j<postTitle.length;j++){if(a==""){c+='<tr><td class="blogindex-entry-col1"><a href="'+postUrl[j]+'" title="'+postSum[j]+'">'+postTitle[j]+'</a></td><td class="blogindex-entry-col2">'+postDate[j]+'</td><td class="blogindex-entry-col3">'+postLabels[j]+"</td></tr>";b++}else{z=postLabels[j].lastIndexOf(a);if(z!=-1){c+='<tr><td class="blogindex-entry-col1"><a href="'+postUrl[j]+'" title="'+postSum[j]+'">'+postTitle[j]+'</a></td><td class="blogindex-entry-col2">'+postDate[j]+'</td><td class="blogindex-entry-col3">'+postLabels[j]+"</td></tr>";b++}}}c+="</table>";if(b==postTitle.length){var k='<span class="blogindex-note">सभी '+postTitle.length+" पोस्ट दिखा रहे हैं<br/></span>"}else{var k='<span class="blogindex-note">कुल पोस्ट '+postTitle.length+" में से '";k+=postFilter+"' लेबल वाली "+b+" पोस्ट दिखा रहे हैं<br/></span>"}blogindexdiv.innerHTML=k+c}function toggleTitleSort(){if(sortBy=="titleasc"){sortBy="titledesc"}else{sortBy="titleasc"}sortPosts(sortBy);displayblogindex(postFilter)}function toggleDateSort(){if(sortBy=="datenewest"){sortBy="dateoldest"}else{sortBy="datenewest"}sortPosts(sortBy);displayblogindex(postFilter)}function showblogindex(){if(blogindexLoaded){displayblogindex(postFilter);var a=document.getElementById("blogindexlink")}else{alert("प्रतीक्षा कीजिए... लेख अनुक्रमणिका बना रहे हैं...")}}function hideblogindex(){var a=document.getElementById("blogindex");a.innerHTML="";var b=document.getElementById("blogindexlink");b.innerHTML='<a href="#" onclick="scroll(0,0); showblogindex(); Effect.toggle('+"'blogindex-result','blind');"+'">» लेख अनुक्रमणिका दिखायें</a> <img src="data:image/gif;base64,R0lGODlhHAALAKIAAP/////MAP+ZAP8AAMwA/wD/AAAz/wAAACH/C05FVFNDQVBFMi4wAwEAAAAh/nZERU1PIFZFUlNJT04gOiBCdWlsdCB3aXRoIGFuIFVOUkVHSVNURVJFRCBjb3B5IG9mIEdJRiBNb3ZpZSBHZWFyIDIuNg0KZnJvbSBnYW1hbmkgcHJvZHVjdGlvbnMgKGh0dHA6Ly93d3cuZ2FtYW5pLmNvbSkuACH+HUdpZkJ1aWxkZXIgMC4yIGJ5IFl2ZXMgUGlndWV0ACH5BAUKAAAALAAAAAAcAAsABwNCCLrc/mqMJSerVLpxLK9gR3VYdIjfqX6hJJpsR1Zk7VpAnJ6Tro893gwmC+I+RJBLhtJEnDmOaqbMvSBKaKME6XoTACH5BAUKAAAALAAAAAAcAAsABwNCCLrc/kqIJSerVDpxLK9gR3VYdIjfqX6hJJpsR1Zk7VpAnJ6Tro893gwmC+I+RJBLhtJEnDmOaqbMvSBKaKME6XoTACH5BAUKAAAALAAAAAAcAAsABwNCCLrc/iqEJSerVLpwLK9gR3VYdIjfqX6hJJpsR1Zk7VpAnJ6Tro893gwmC+I+RJBLhtJEnDmOaqbMvSBKaKME6XoTACH5BAUKAAAALAAAAAAcAAsABwNCCLrc/qqUJSerVLpyLK9gR3VYdIjfqX6hJJpsR1Zk7VpAnJ6Tro893gwmC+I+RJBLhtJEnDmOaqbMvSBKaKME6XoTACH5BAUKAAAALAAAAAAcAAsABwNCCLrc/sqYJSerVDpzLK9gR3VYdIjfqX6hJJpsR1Zk7VpAnJ6Tro893gwmC+I+RJBLhtJEnDmOaqbMvSBKaKME6XoTACH5BAUKAAAALAAAAAAcAAsABwNCCLrc/oqQJSerVDpyLK9gR3VYdIjfqX6hJJpsR1Zk7VpAnJ6Tro893gwmC+I+RJBLhtJEnDmOaqbMvSBKaKME6XoTACH5BAUKAAAALAAAAAAcAAsABwNCCLrc/sqYJSerVDpzLK9gR3VYdIjfqX6hJJpsR1Zk7VpAnJ6Tro893gwmC+I+RJBLhtJEnDmOaqbMvSBKaKME6XoTACH5BAUKAAAALAAAAAAcAAsABwNCCLrc/qqUJSerVLpyLK9gR3VYdIjfqX6hJJpsR1Zk7VpAnJ6Tro893gwmC+I+RJBLhtJEnDmOaqbMvSBKaKME6XoTACH5BAUKAAAALAAAAAAcAAsABwNCCLrc/iqEJSerVLpwLK9gR3VYdIjfqX6hJJpsR1Zk7VpAnJ6Tro893gwmC+I+RJBLhtJEnDmOaqbMvSBKaKME6XoTACH5BAUKAAAALAAAAAAcAAsABwNCCLrc/kqIJSerVDpxLK9gR3VYdIjfqX6hJJpsR1Zk7VpAnJ6Tro893gwmC+I+RJBLhtJEnDmOaqbMvSBKaKME6XoTADs="/>'}var postTitle=new Array;var postUrl=new Array;var postDate=new Array;var postSum=new Array;var postLabels=new Array;var sortBy="datenewest";var blogindexLoaded=false;var numChars=250;var postFilter="";var blogindexdiv=document.getElementById("tp_blogindex");var totalEntires=0;var totalPosts=0;document.write('<a href="http://hi.techprevue.com">तकनीक द्रष्टा</'+'a>');