Tabel Konten Blogger dengan Pilihan Sortir + Komentar
by astin query
HTML
<div id="toc-container">Memuat...</div>
CSS
body {
margin:0;
padding:10px;
background-color: #DDD;
}
#tocTable {
border:2px solid white;
font:normal normal 11px/normal Verdana,Tahoma,Arial,Sans-Serif;
color:#333;
border-collapse:collapse;
text-align:left;
margin:0 auto 5px;
}
#tocTable th,
#tocTable td {
border:1px solid white;
background-color:#fafafa;
padding:10px 15px;
}
#tocTable th {
background-color:#5d5d5d;
font-weight:bold;
color:white;
text-shadow:0 1px 0 rgba(0,0,0,.3);
}
#th-1 {
width:55%;
background-color:#5A930D;
}
#th-2,#th-3,#th-4 {width:15%}
#tocTable td.toc-header-col-1,
#tocTable td.toc-header-col-2 {
padding:0 !important;
background-color:#2372A7;
}
#tocTable td.toc-header-col-3,#tocTable td.toc-header-col-4 {background-color:#D7DEF0}
#tocTable a {
display:block;
text-decoration:none;
color:white;
padding:10px 15px;
background:none;
}
#tocTable td.toc-header-col-1:hover,
#tocTable td.toc-header-col-2:hover {
background-color:#174B6F;
-webkit-box-shadow:inset 0 0 3px rgba(0,0,0,.4);
-moz-box-shadow:inset 0 0 3px rgba(0,0,0,.4);
box-shadow:inset 0 0 3px rgba(0,0,0,.4);
}
#tocSort {
display:block;
width:220px;
font:normal bold 12px/normal Verdana,Tahoma,Arial,Sans-Serif;
color:#333;
cursor:pointer;
border:none;
outline:none;
background-color:#eee;
margin:0 0 2px 0;
padding:5px;
}
JavaScript
var theTotalPosts = 9999, // Tentukan jumlah maksimal posting
theOptions = "Sortir...", // Label opsi 1
theSortPosts = "Sortir berdasarkan Abjad", // Label opsi 2
theSortLabels = "Sortir berdasarkan Label", // Label opsi 3
theTitles = "Judul Artikel", // Header tabel 1
theLabels = "Label Artikel", // Header tabel 2
theDates = "Bulan Terbit", // Header tabel 3
theComment = "Jumlah Komentar", // Header tabel 4
theBlankLabels = "Tak Berlabel", // Label kosong
theSiteUrl = "http://astinquery.blogspot.com", // URL blog kamu
theConfig = "toc-container",
theCmtext = "Komentar";
// Original: http://www.threelas.com
// Modified by Astin (http://astinquery.blogspot.com)
function toc_sort_table(a) {
var post = [],
label = [],
timepub = [],
skeleton = "",
g = document.getElementById(theConfig),
b = a.feed.openSearch$totalResults.$t;
if (b < theTotalPosts) theTotalPosts = b - 1;
for (var c = 0; c <= theTotalPosts; c++) {
post[c] = a.feed.entry[c].title.$t;
label[c] = a.feed.entry[c].category[0].term;
timepub[c] = a.feed.entry[c].published.$t.substring(0, 10);
}
var d = [];
var cmnum = [];
for (var c = 0; c <= theTotalPosts; c++) {
for (var e = 0; e <= a.feed.entry[c].link.length - 1; e++) {
if (a.feed.entry[c].link[e].rel == "alternate") {
d[c] = a.feed.entry[c].link[e].href;
break;
}
}
for (var l = 0; l <= a.feed.entry[c].link.length - 1; l++) {
if (a.feed.entry[c].link[l].rel == "replies" && a.feed.entry[c].link[l].type == "text/html") {
cmnum[c] = a.feed.entry[c].link[l].title.split(" ")[0];
break;
}
}
}
skeleton = '<select id="tocSort" onchange="displayMessage(this.options[this.selectedIndex].value);"><option value="0">' + theOptions + '</option><option value="0">' + theSortPosts +...