var entry = e.feed.entry[i];
var posttitle = entry.title.$t;
var posturl;
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
posturl = entry.link[k].href;
break;
}
}
postdate = entry.published.$t;
var month = [1,2,3,4,5,6,7,8,9,10,11,12];
var month2 = ["01","02","03","04","05","06","07","08","09","10","11","12"];
var day = postdate.split("-")[2].substring(0,2);
var m = postdate.split("-")[1];
var y = postdate.split("-")[0];
for(var u2=0;u2<month.length;u2++){
if(parseInt(m)==month[u2]) {
m = month2[u2] ; break;
}
}
var daystr = day+ '/' + m + '/' + y;
var trtd = trtd + '<li><span class="news-ticker-post-timestamp">'+daystr+'</span><a class="ticker-title" href="'+posturl+'"><h3>'+posttitle+'</h3></a></li>';
}
newsTickerUl.html(trtd);
}
});
}
// ]]>
</script>
<script type='text/javascript'>
var htmlElement = document.querySelector("html");
var leftOrRight = htmlElement.getAttribute("dir");
if(leftOrRight === "ltr") {
jQuery(function(){
jQuery('#news-ticker').webTicker({
speed: 100,
});
});
}
if(leftOrRight === "rtl") {
jQuery(function(){
jQuery('#news-ticker').webTicker({
speed: 100,
direction: "right"
});
});
}
</script>
<script>
//<![CDATA[
$(function () {
var searchBox = $("#search-input");
var searchBtn = $("#search-box");
searchBtn.on("click", function () {
searchBox.slideToggle("fast");
});
});
// ]]>
</script> <!-- Search box script -->
<script>
//<![CDATA[
var s = document.querySelectorAll(".sidebartabs-wrapper .section .widget");
var a = document.querySelector(".sidebartabs-wrapper");
if (s.length < 2) {
a.remove();
}
else
{
var sidebarTabsWidgetsTitle = $("#sidebar-tabs .widget").children("h2");
var sidebarTabItem1 = $("#sidebartab-item1");
var sidebarTabItem2 = $("#sidebartab-item2");
sidebarTabsWidgetsTitle.each( function (f) {
var _self = $(this);
if(f===0){
sidebarTabItem1.html(_self.text());
} else {
sidebarTabItem2.html(_self.text());
}
});
}
// ]]>
</script>
<script>
//<![CDATA[
$(function () {
var mainNavBtn = $("#mobile-main-nav-btn");
var mainNav = $("#main-nav");
mainNavBtn.on("click", function () {
mainNav.slideToggle("fast");
});
});
// ]]>
</script> <!-- Main navigation script -->
<script>
//<![CDATA[
var theLabel = $("#main-nav li a");
theLabel.each( function (f) {
var _self = $(this);
var labelName = _self.text()
var mega = _self.attr("href");
if(mega === "mega") {
var megaListItem = _self.parent();
_self.addClass("mega-icon");
_self.attr("href", "/search/label/"+ labelName +"?&max-results=10");
var listIcon = labelName.match(/<.*>/g);
labelName.replace(/<.*>/g, '');
$.ajax({
url: "/feeds/posts/default/-/" + labelName + "?alt=json-in-script&max-results=4",
type: "get",
dataType: "jsonp",
success: function (e) {
var img = new Array();
var trtd = '';
for (var i = 0; i < 4; i++) {
var entry = e.feed.entry[i];
var posttitle = entry.title.$t;
var posturl;
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
posturl = entry.link[k].href;
break;
}
}
if ("content" in entry) {
var postcontent = entry.content.$t;
}
s = postcontent; a = s.indexOf("<img"); b = s.indexOf("src=\"",a); c = s.indexOf("\"",b+5); d = s.substr(b+5,c-b-5);
if((a!=-1)&&(b!=-1)&&(c!=-1)&&(d!="")) img[i] = d;
var tmb = img[i].replace('s1600/','s500-c/');
var trtd = trtd + '<li class="mega-post clearfix"><a href="'+ posturl +'" class="mega_post-image" style="background: url('+ tmb +') no-repeat center;background-size: cover"></a><a href="'+ posturl +'"><h3 class="mega_post-title">'+ posttitle +'</h3></a></li>';
}
megaListItem.append('<div class="mega-menu-wrapper"><ul class="mega-menu clearfix">' + trtd + '</ul></div>');
}
});
}
});
//]]>
</script> <!-- Mega menu script -->
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<script>
//<![CDATA[
/* Slider Widget
--------------------------------------*/
var numOfSliderPosts = 5;
var slider = $('#slider .widget-content');
var sliderContent = slider.text().trim();
var sliderTitle = $('#slider .title').text();
slider.removeClass('widget-content').addClass(''+ sliderTitle +' clearfix');
if(sliderTitle === "slider1" || sliderTitle === "slider2") {
if((sliderContent !== "random") && (sliderContent.charAt(0) !== "[")) {
$.ajax({
url: "/feeds/posts/default/-/" + sliderContent + "?alt=json-in-script&max-results="+ numOfSliderPosts +"",
type: "get",
dataType: "jsonp",
success: function (e) {
var img = new Array();
for (var i = 0; i < 5; i++) {
var entry = e.feed.entry[i];
var posttitle = entry.title.$t;
var posturl;
var category = '<a class="post-category" href="/search/label/'+entry.category[0].term+'?max-results=7">'+entry.category[0].term+'</a>';
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
posturl = entry.
Back to home |
File page
Subscribe |
Register |
Login
| N