Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <script type='text/javascript'>
  2. var showPostDate = true,
  3.     showComments = false,
  4.     idMode = true,
  5.     sortByLabel = false,
  6.     labelSorter = "JQuery",
  7.     loadingText = "Loading...",
  8.     totalPostLabel = "Total Videos:",
  9.     jumpPageLabel = "Showing Videos",
  10.     commentsLabel = "Komentar",
  11.     rmoreText = "View &#9658;",
  12.     prevText = "Previus Page",
  13.     nextText = "Next Page",
  14.     siteUrl = "http://www.banglatune.co.uk",
  15.     postsperpage = 6,
  16.     numchars = 0,
  17.     imgBlank = "http://2.bp.blogspot.com/-11FkySHGB5Y/TpZ6SSbsF2I/AAAAAAAAA94/zK10UaL7jgo/s1600/images.jpeg";
  18. </script>
  19. <script type='text/javascript'>
  20. //<![CDATA[
  21. // -----------------------------------------------------------------------------------------
  22. // Table of Content for Blogger with Pagination
  23. // Original: http://vagabundia.blogspot.com/2011/04/resumen-de-entradas-con-paginacion.html
  24. // Modified by Taufik Nurrohman
  25. // On 3 March 2012
  26. // Visit: http://www.dte.web.id/2012/03/daftar-isi-blogger-dengan-navigasi.html?showComment=1369317982121#c4428416619672321239
  27. // -----------------------------------------------------------------------------------------
  28.  
  29. var minpage = 6; // Minimum number to display the page
  30. var maxpage = 10; // The maximum number of pages to display
  31. var firstpage = 0; // Detect the first time it is executed
  32. var pagernum = 0; // Contain the page number where we
  33. var postsnum = 0; // Start the first page
  34. var actualpage = 1; // Starting value of the current page (it will change if you click the pagination).
  35.  
  36. // This is the container template that will be used to insert post template, pagination and the posts count
  37. document.write('<div id="toc-outer"><div id="results"></div><div id="itempager" style="position:relative;"><div id="pagination"></div><div id="totalposts"></div><a title="Taufik Nurrohman" style="display:block!important;visibility:visible!important;opacity:1!important;position:absolute;bottom:10px;right:14px;font:normal bold 8px Arial,Sans-Serif!important;color:#666;text-shadow:0 1px 0 rgba(255,255,255,.1);text-decoration:none;" href="http://hompimpaalaihumgambreng.blogspot.com/2012/03/daftar-isi-blogger-dengan-navigasi.html" target="_blank">&#9658;TN</a></div></div>');
  38.  
  39. var _results = document.getElementById('results');
  40. var _pagination = document.getElementById('pagination');
  41. var _totalposts = document.getElementById('totalposts');
  42.  
  43. // Build the table of contents framework
  44.  
  45. function showPagePosts(json) {
  46.  
  47.    var entry, posttitle, posturl, postimg, s, a, b, c, d, postsumm, replies, monthnames, timepub, output = "";
  48.  
  49.    if (pagernum === 0) {
  50.        postsnum = parseInt(json.feed.openSearch$totalResults.$t);
  51.        pagernum = parseInt(postsnum / postsperpage) + 1;
  52.    }
  53.  
  54.    for (var i = 0; i < postsperpage; i++) {
  55.  
  56.        if ("entry" in json.feed) {
  57.  
  58.            if (i == json.feed.entry.length) break;
  59.  
  60.            entry = json.feed.entry[i];
  61.            posttitle = entry.title.$t; // Get the post title
  62.  
  63.            // Get rel="alternate" for truly post url
  64.            for (var k = 0, elen = entry.link.length; k < elen; k++) {
  65.                if (entry.link[k].rel == 'alternate') {
  66.                    posturl = entry.link[k].href; // This is your real post URL!
  67.                    break;
  68.                }
  69.            }
  70.  
  71.            // Get the comments count
  72.            for (var l = 0, clen = entry.link.length; l < clen; l++) {
  73.                if (entry.link[l].rel == "replies" && entry.link[l].type == "text/html") {
  74.                    var commentsnum = entry.link[l].title.split(" ")[0]; // This is your comments count
  75.                    break;
  76.                }
  77.            }
  78.  
  79.            // If the Blogger-feed is set to FULL, then the content is in the content-field
  80.            postsumm = ("content" in entry) ? entry.content.$t.replace(/<br ?\/?>/ig, " ").replace(/<(.*?)>/g, "") : ""; // Get the post content
  81.  
  82.            // Reduce post summaries to "numchars" characters.
  83.            // "numchars" is a variable. You determine the value
  84.            if (postsumm.length > numchars) {
  85.                postsumm = (numchars > 0 && numchars !== false) ? postsumm.substring(0, numchars) + '...' : "";
  86.            }
  87.  
  88.            // Get the post date (e.g: 2012-02-07T12:56:00.000+07:00)
  89.            var _postdate = entry.published.$t,
  90.                _cdyear = _postdate.substring(0, 4), // Take 4 characters from the "postdate" beginning, it means the year (2012)
  91.                _cdmonth = _postdate.substring(5, 7), // Take 2 character 5 step from "postdate" beginning, it mean the month (02)
  92.                _cdday = _postdate.substring(8, 10); // Take 2 character 8 step from "postdate" beginning. it means the day (07)
  93.  
  94.            // Month array template
  95.            monthnames = (idMode) ? ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agt", "Sep", "Okt", "Nov", "Des"] : ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
  96.  
  97.            // The final product of the post date = (07 Feb 2012) (cdday monthnames cdyear)
  98.            timepub = (showPostDate) ? _cdday + ' ' + monthnames[parseInt(_cdmonth, 10) - 1] + ' ' + _cdyear + ' - ' : '';
  99.  
  100.            // The final product of the comments count & comments label (10 Komentar) (commentsnum commentsLabel)
  101.            replies = (showComments) ? commentsnum + ' ' + commentsLabel : '';
  102.  
  103.            // Get the post thumbnails
  104.            s = entry.content.$t;
  105.            a = s.indexOf("<img");
  106.            b = s.indexOf("src=\"", a);
  107.            c = s.indexOf("\"", b + 5);
  108.            d = s.substr(b + 5, c - b - 5);
  109.  
  110.            postimg = ((a != -1) && (b != -1) && (c != -1) && (d != "")) ? d : imgBlank;
  111.  
  112.            // Build the post template
  113.            output += '<div class="itemposts">';
  114.            output += '<div class="iteminside"><div class="imagecrop"><a href="' + posturl + '" target="_parent"><span class="play-button3"></span><img src="' + postimg + '" width="175" height="95"/></a></div>';
  115.            output += '<h6><a href="' + posturl + '" target="_parent">' + posttitle + '</a></h6>';
  116.            output += '<span class="summary">' + postsumm + '</span></div>';
  117.            output += '<div style="clear:both;"></div><div class="itemfoot">' + timepub + replies + '<a class="itemrmore" href="' + posturl + '" target="_blank">' + rmoreText + '</a></div>';
  118.            output += '</div>';
  119.  
  120.        }
  121.  
  122.    }
  123.  
  124.    // Put the whole template above into <div id="results"></div>
  125.    _results.innerHTML = output;
  126.    _create_pagination();
  127.  
  128. }
  129.  
  130. // Build the pagination
  131. function _create_pagination() {
  132.  
  133.    output = "";
  134.    var starter = 0;
  135.  
  136.    output += ((actualpage > 1) ? '<a title="' + prevText + '" class="prevjson" href="javascript:_init_script(' + parseInt(actualpage - 1) + ')">' + prevText + '</a>' : '<span class="prevjson hidden">' + prevText + '</span>') + '<em style="font:inherit;color:inherit;" class="pagernumber">';
  137.  
  138.    if (pagernum < (maxpage + 1)) {
  139.        for (starter = 1; starter <= pagernum; starter++) {
  140.            output += (starter == actualpage) ? '<span class="actual">' + starter + '</span>' : '<a href="javascript:_init_script(' + starter + ')">' + starter + '</a>';
  141.        }
  142.    } else if (pagernum > (maxpage - 1)) {
  143.        if (actualpage < minpage) {
  144.            for (starter = 1; starter < (maxpage - 2); starter++) {
  145.                output += (starter == actualpage) ? '<span class="actual">' + starter + '</span>' : '<a href="javascript:_init_script(' + starter + ')">' + starter + '</a>';
  146.            }
  147.            output += ' ... ';
  148.            output += '<a href="javascript:_init_script(' + parseInt(pagernum - 1) + ')">' + parseInt(pagernum - 1) + '</a>';
  149.            output += '<a href="javascript:_init_script(' + pagernum + ')">' + pagernum + '</a>';
  150.        } else if (pagernum - (minpage - 1) > actualpage && actualpage > (minpage - 1)) {
  151.            output += '<a href="javascript:_init_script(1)">1</a>';
  152.            output += '<a href="javascript:_init_script(2)">2</a>';
  153.            output += ' ... ';
  154.            for (starter = actualpage - 2; starter <= actualpage + 2; starter++) {
  155.                output += (starter == actualpage) ? '<span class="actual">' + starter + '</span>' : '<a href="javascript:_init_script(' + starter + ')">' + starter + '</a>';
  156.            }
  157.            output += ' ... ';
  158.            output += '<a href="javascript:_init_script(' + parseInt(pagernum - 1) + ')">' + parseInt(pagernum - 1) + '</a>';
  159.            output += '<a href="javascript:_init_script(' + pagernum + ')">' + pagernum + '</a>';
  160.        } else {
  161.            output += '<a href="javascript:_init_script(1)">1</a>';
  162.            output += '<a href="javascript:_init_script(2)">2</a>';
  163.            output += ' ... ';
  164.            for (starter = pagernum - (minpage + 1); starter <= pagernum; starter++) {
  165.                output += (starter == actualpage) ? '<span class="actual">' + starter + '</span>' : '<a href="javascript:_init_script(' + starter + ')">' + starter + '</a>';
  166.            }
  167.        }
  168.    }
  169.  
  170.    output += '</em>' + ((actualpage < starter - 1) ? '<a title="' + nextText + '" class="nextjson" href="javascript:_init_script(' + parseInt(actualpage + 1) + ')">' + nextText + '</a>' : '<span class="nextjson hidden">' + nextText + '</span>');
  171.  
  172.    _pagination.innerHTML = output;
  173.    var parameter = (actualpage * postsperpage) - (postsperpage - 1),
  174.        _final = actualpage * postsperpage;
  175.    _totalposts.innerHTML = totalPostLabel + ' ' + postsnum + ' - ' + jumpPageLabel + ' ' + parameter + ((actualpage < starter - 1) ? ' - ' + _final : "");
  176. }
  177.  
  178. // Functions to remove and append the callback script that has been manipulated in the `start-index` parameter
  179. function _init_script(n) {
  180.  
  181.    var parameter = (n * postsperpage) - (postsperpage - 1);
  182.    var url = (sortByLabel) ? siteUrl + '/feeds/posts/default/-/' + labelSorter + '?start-index=' + parameter : siteUrl + '/feeds/posts/default/?start-index=' + parameter; // Optional: Sort posts by a specific label
  183.  
  184.    if (firstpage == 1) {
  185.        var old = document.getElementById("TEMPORAL");
  186.        old.parentNode.removeChild(old);
  187.    }
  188.    _results.innerHTML = '<div id="loadingscript">' + loadingText + '</div>';
  189.    _pagination.innerHTML = '';
  190.    _totalposts.innerHTML = '';
  191.  
  192.    var script = document.createElement('script');
  193.    script.type = 'text/javascript';
  194.    script.src = url + '&max-results=' + postsperpage + '&orderby=published&alt=json-in-script&callback=showPagePosts';
  195.    script.id = 'TEMPORAL';
  196.    document.getElementsByTagName('head')[0].appendChild(script);
  197.    firstpage = 1;
  198.    actualpage = n;
  199. }
  200.  
  201. // Execute the _init_script() function with parameter as `1` immediately
  202. // So it will show the first page.
  203. _init_script(1);
  204. //]]>
  205. </script>