/* * * * */ function Popup(url) { var w=screen.width/2-250; var h=screen.height/3-200; popupWindow=window.open(url, "popUpWindow", "height=400, width=500, left="+w+", top="+h+", resizable=no, scrollbars=no, toolbar=no, menubar=no, location=no, directories=no, status=yes") } if (top != self) { top.location.href = self.location.href; } var int = setInterval(function() { if (document.getElementById("menu-item-2663") != null) { document.getElementById("menu-item-2663").getElementsByTagName("a")[0].innerHTML = ""; clearInterval(int); } }, 100); var hovered = false; var reload = true; $(document).ready(function() { $(".post-format-icon.video").html(""); $(".post-format-icon.gallery").html(""); $(".post-format-icon.audio").html(""); $(".post-format-icon.image").html(""); $(".social-icons li a").attr("target","_blank"); // $("head").append(""); rotacija na logoto pri hover var time; $(".navigation li .mega-menu").css({"visibility" : "visible", "display" : "none"}); $(".navigation li").hover(function() { clearTimeout(time); var mega = $(this); time = setTimeout(function() { if ($(".navigation.sticky").length > 0) { mega.find(".mega-menu").css("z-index", "auto"); } else { mega.find(".mega-menu").css("z-index", "1000"); } mega.find(".mega-menu").slideDown('slow'); }, 500); }, function() { clearTimeout(time); var mega = $(this); mega.find(".mega-menu").css({"display" : "auto", "opacity" : "1"}); if ($(".navigation.sticky").length > 0) { mega.find(".mega-menu").css("z-index", "auto"); } else { mega.find(".mega-menu").css("z-index", "1000"); } mega.find(".mega-menu").slideUp('slow'); }); var loc = $(location).attr('href'); if (loc.indexOf("/author/") != -1) { $(".author-info").remove(); } if (loc == "https://zabava.mk/") { $(".gallery-title.prominent:eq(0)").css("background", "#C10551"); // boja kaj tonight $(".gallery-title.prominent:eq(1)").css("background", "#FF0000"); // boja kaj ne propustajte $("..section-head.prominent:eq(3)").css("background", "#d54f9c"); // zolta astro $("..section-head.prominent:eq(3)").css("color", "#fff"); // zolta astro $(".main .sidebar .widgettitle:eq(0)").css("background", "#1e90ff"); // VIC NA DENOT $("head").append(""); // otfrlanje na next i prev kaj tonight i prvite tri statii $(".gallery-title.prominent").each(function() { if ($(this).text() == "Ноќен живот") { $(this).html("Ноќен живот"); } if ($(this).text() == "Не пропуштајте") { $(this).html("Не пропуштајте"); } }); $(".section-head.prominent").each(function() { if ($(this).text() == "ЧЕК ДИС АУТ") { $(this).html("ЧЕК ДИС АУТ"); } if ($(this).text() == "АСТРО") { $(this).html("ЧЕК ДИС АУТ"); } }); $(".flexslider.carousel .cat-title.cat-6").hide(); $("h3.section-head.prominent:eq(2)").css("background", "DarkMagenta"); //boja za travel na pocetna } if (loc == "https://zabava.mk/dzetset/") { $(".section-head.prominent:eq(0)").css("background", "#C10551"); // boja kaj mk scena $(".section-head.prominent:eq(1)").css("background", "#C10551"); // boja kaj tonight $(".gallery-title.prominent").css("background", "#C10551"); // boja kaj ne propustajte $(".read-more a").css("border-radius", "10px"); $(".section-head.prominent").each(function() { if ($(this).text() == "МК Сцена") { $(this).html("МК Сцена"); } else if ($(this).text() == "Ноќен живот") { $(this).html("Ноќен живот"); } }); $(".gallery-title.prominent").html("Не пропуштајте"); $("head").append(""); } if (loc == "https://zabava.mk/magazin/") { $(".section-head.prominent:eq(0)").css("background", "DarkMagenta"); // boja kaj travel $(".navigation").css("background", "DarkMagenta !improtant"); $(".section-head.prominent:eq(1)").css("background", "DarkMagenta"); // boja kaj kulinarstvo $(".section-head.prominent:eq(2)").css("background", "DarkMagenta"); // boja kaj horoskop $(".gallery-title.prominent").css("background", "DarkMagenta"); // boja kaj ne propustajte $(".section-head.prominent").each(function() { if ($(this).text() == "Кулинарство") { $(this).html("Кулинарство"); } else if ($(this).text() == "Хороскоп") { $(this).html("Хороскоп"); } else if ($(this).text() == "Травел") { $(this).html("Травел"); } }); $(".gallery-title.prominent").html("Не пропуштајте"); $("head").append(""); } if (loc == "https://zabava.mk/sexfiles/") { $(".section-head.prominent:eq(0)").css("background", "#FF1493"); // boja kaj gentleman's choice $(".section-head.prominent:eq(1)").css("background", "#FF1493"); // boja kaj lady's choice $(".gallery-title.prominent").css("background", "#FF1493"); // boja kaj ne propustajte $(".section-head.prominent").each(function() { if ($(this).text() == "Gentleman’s Choice") { $(this).html("Gentleman’s Choice"); } else if ($(this).text() == "Lady’s Choice") { $(this).html("Lady’s Choice"); } }); $(".gallery-title.prominent").html("Не пропуштајте"); $("head").append(""); } if (loc == "http://zabava.mk/chek-dis-aut/") { $(".section-head.prominent").css("background", "Green"); // boja kaj misterii $(".gallery-title.prominent").css("background", "Green"); // boja kaj ne propustajte $(".read-more a").css("border-radius", "10px"); $(".section-head.prominent").each(function() { if ($(this).text() == "Мистерии") { $(this).html("Мистерии"); } }); $(".gallery-title.prominent").html("Не пропуштајте"); $("head").append(""); } if (loc == "https://zabava.mk/relaksacija/") { $(".section-head.prominent").css("background", "Olive"); // boja kaj (de)motivatori $(".gallery-title.prominent").css("background", "Olive"); // boja kaj ne propustajte $(".section-head.prominent").each(function() { if ($(this).text() == "(Де) Мотиватори") { $(this).html("(Де) Мотиватори"); } }); $(".gallery-title.prominent").html("Не пропуштајте"); $("head").append(""); } if (loc == "https://zabava.mk/hajtek/") { $(".section-head.prominent").css("background", "DodgerBlue"); // boja kaj internet, gadzeti i game report $(".gallery-title.prominent").css("background", "DodgerBlue"); // boja kaj ne propustajte $(".read-more a").css("border-radius", "10px"); $(".section-head.prominent").each(function() { if ($(this).text() == "Интернет") { $(this).html("Интернет"); } else if ($(this).text() == "Гаџети") { $(this).html("Гаџети"); } else if ($(this).text() == "Gamereport") { $(this).html("Gamereport"); } }); $(".gallery-title.prominent").html("Не пропуштајте"); $("head").append(""); } if (loc == "https://zabava.mk/topspeed/") { $(".section-head.prominent").css("background", "DarkCyan"); // boja kaj soveti $(".gallery-title.prominent").css("background", "DarkCyan"); // boja kaj ne propustajte $(".section-head.prominent").each(function() { if ($(this).text() == "Совети") { $(this).html("Совети"); } }); $(".gallery-title.prominent").html("Не пропуштајте"); $("head").append(""); } $(".bio .posts a").each(function() { var text = $(this).text().split(" "); $(this).html("" + text[0] + " Статии"); $(this).attr("title", "Прегледајте ги написите од авторот"); }); $(".post-share .share-links a").each(function() { reload = false; var link = $(this).attr("href"); if (link.indexOf("mailto") == -1 && link.indexOf("facebook") == -1) { $(this).attr("onclick", "Popup('" + link + "');"); // $(this).removeAttr("href"); $(this).attr("href", "#"); $(this).css("border-radius", "5px"); } else if (link.indexOf("mailto") != -1) { // $(this).removeAttr("href"); $(this).attr("href", "#"); $(this).css("border-radius", "5px"); $(this).attr("onclick", "FB.ui({method: 'send', link: '" + loc + "'});"); } else if (link.indexOf("facebook") != -1) { // $(this).removeAttr("href"); $(this).attr("href", "#"); $(this).css("border-radius", "5px"); link = "https://www.facebook.com/sharer.php?app_id=941001055926664&sdk=joey&u=" + loc + "&display=popup&ref=plugin"; $(this).attr("onclick", "Popup('" + link + "');"); } }); $(".post-share .share-links a").click(function() { return false; }); $(".highlights.column.one-third").each(function() { var link = $(this).find("a").attr("href") + "#comments"; var html = $(this).find(".comments").html(); $(this).find(".comments").html("" + html + ""); }); if (loc.indexOf("/dzetset/") != -1 || loc.indexOf("/selebriti/") != -1 || loc.indexOf("/film/") != -1 || loc.indexOf("/muzika/") != -1 || loc.indexOf("/daily-starlet/") != -1 || loc.indexOf("/mk-scena/") != -1 || loc.indexOf("/tonight/") != -1 || loc.indexOf("/intervju/") != -1) { $('.navigation').addClass('dzetset'); } if (loc.indexOf("/magazin/") != -1 || loc.indexOf("/lajfstajl/") != -1 || loc.indexOf("/zdravje/") != -1 || loc.indexOf("/moda-i-ubavina/") != -1 || loc.indexOf("/wake-up/") != -1 || loc.indexOf("/horoskop/") != -1 || loc.indexOf("/travel/") != -1 || loc.indexOf("/kulinarstvo/") != -1) { $('.navigation').addClass('magazin'); } if (loc.indexOf("/zanimlivosti/") != -1 || loc.indexOf("/chek-dis-aut/") != -1 || loc.indexOf("/misterii/") != -1 || loc.indexOf("/umetnost/") != -1 || loc.indexOf("/lud-svet/") != -1 || loc.indexOf("/chitalna/") != -1 || loc.indexOf("/vicoteka/") != -1 || loc.indexOf("/retro/") != -1) { $('.navigation').addClass('chek-dis-aut'); } if (loc.indexOf("/relaksacija/") != -1 || loc.indexOf("/fakti-i-citati/") != -1 || loc.indexOf("/testovi-i-kvizovi/") != -1 || loc.indexOf("/mk-tvitovi/") != -1 || loc.indexOf("/stripovi/") != -1 || loc.indexOf("/gifoteka/") != -1 || loc.indexOf("/de-motivatori/") != -1) { $('.navigation').addClass('relaksacija'); } if (loc.indexOf("/hajtek/") != -1 || loc.indexOf("/nauka/") != -1 || loc.indexOf("/softver/") != -1 || loc.indexOf("/internet/") != -1 || loc.indexOf("/hardver/") != -1 || loc.indexOf("/mobilni/") != -1 || loc.indexOf("/gadzeti/") != -1 || loc.indexOf("/game-report/") != -1) { $('.navigation').addClass('hajtek'); } if (loc.indexOf("/topspeed/") != -1 || loc.indexOf("/noviteti/") != -1 || loc.indexOf("/fun-news/") != -1 || loc.indexOf("/koncepti/") != -1 || loc.indexOf("/soveti/") != -1 || loc.indexOf("/sajmovi/") != -1) { $('.navigation').addClass('topspeed'); } if (loc.indexOf("/sexfiles/") != -1 || loc.indexOf("/gentlemans-choice/") != -1 || loc.indexOf("/ladys-choice/") != -1 || loc.indexOf("/ljubovni-vrski/") != -1 || loc.indexOf("/afrodizijak/") != -1 || loc.indexOf("/kamasutra/") != -1 || loc.indexOf("/mashki-svet/") != -1 || loc.indexOf("zabava.mk/kategorija/zhenski-svet") != -1) { $('.navigation').addClass('sexfiles'); } var timeout; $('.news-focus .subcats a').click(function() { reload = false; clearTimeout(timeout); var active = $(this).parents('.subcats').find('a.active'), parent = $(this).parents('.news-focus'); // show the news and hide the other block parent.find('.news-' + active.data('id')).hide(); parent.find('.news-loader').show(); var id = $(this).data('id'); timeout = setTimeout(function() { parent.find('.news-loader').hide(); parent.find('.news-' + id).fadeIn('slow'); }, 800); active.removeClass('active'); $(this).addClass('active'); return false; }); var tajmaut; $('.nav-block').click(function() { clearTimeout(tajmaut); var block = $(this).parents('.block-one-article-container').find('.block-one-article-ul'); var active = block.find('li.block-one-article-li-active'); var loader = $(this).parents('.block-one-article-container').find(".block-one-article-loader"); if ($(this).data("id") == "prev-block") { active.hide(); loader.show(); var prev = active.prev(); if (!prev.length) { prev = block.find('li:last').prev(); } tajmaut = setTimeout(function() { loader.hide(); active.removeClass('block-one-article-li-active'); prev.addClass('block-one-article-li-active').fadeIn('slow'); }, 800); return false; } else { active.hide(); loader.show(); var next = active.next(); if (next.hasClass('block-one-article-loader')) { next = block.find('li:first'); } tajmaut = setTimeout(function() { loader.hide(); active.removeClass('block-one-article-li-active'); next.addClass('block-one-article-li-active').fadeIn('slow'); }, 800); return false; } }); createTicker(); $(".read-more a").text("Прочитај повеќе"); $(".read-more a").attr("title", "Прочитај повеќе"); $("#social-icons p").hover(function() { $(this).find("a").css({ borderTopLeftRadius: 15, borderTopRightRadius: 15, borderBottomLeftRadius: 15, borderBottomRightRadius: 15, WebkitBorderTopLeftRadius: 15, WebkitBorderTopRightRadius: 15, WebkitBorderBottomLeftRadius: 15, WebkitBorderBottomRightRadius: 15, MozBorderRadius: 15, textDecoration: 'underline' }); }, function() { $(this).find("a").css({ borderTopLeftRadius: 5, borderTopRightRadius: 5, borderBottomLeftRadius: 5, borderBottomRightRadius: 5, WebkitBorderTopLeftRadius: 5, WebkitBorderTopRightRadius: 5, WebkitBorderBottomLeftRadius: 5, WebkitBorderBottomRightRadius: 5, MozBorderRadius: 5, textDecoration: 'none' }); }); $(window).scroll(function() { if ($(this).scrollTop() > 100) { $('#go-top').css({bottom: "60px"}); } else { $('#go-top').css({bottom: "-100px"}); } }); $('#go-top a').click(function(e) { e.preventDefault(); $('html, body').animate({ scrollTop: 0 }, 800); return false; }); /*$("a[href='#foto-blok']").click(function(e) { e.preventDefault(); if ($("#foto-blok").length == 0) return; $("html, body").animate({ scrollTop: $("#foto-blok").offset().top - 150 }, 800); }); $("a[href='#video-blok']").click(function(e) { e.preventDefault(); if ($("#video-blok").length == 0) return; $("html, body").animate({ scrollTop: $("#video-blok").offset().top - 150 }, 800); });*/ $(".search-button").attr("disabled", "disabled"); $(".search-text").on("keyup, change", function() { var text = $(this).val(); if (text != "") { $(".search-button").removeAttr("disabled"); } else { $(".search-button").attr("disabled", "disabled"); } }); var flag = false; var first = true; $(".breadcrumbs a").each(function() { if (!first) { var url = $(this).attr('href').split('/'); if (loc.indexOf('/' + url[2] + '/') != -1) { $(this).css('color', 'black'); flag = true; } } first = false; }); if (flag == false) { $(".breadcrumbs a:eq(0)").css("color", "black"); } $("a").each(function() { if ($(this).attr("href") != undefined && $(this).attr("href") != "") { if ($(this).attr("href").indexOf("/category/") != -1) { var href = $(this).attr("href").replace("/category", ""); $(this).attr("href", href); } } }); $(".trending-ticker ul").hover(function() { hovered = true; }, function() { hovered = false; }); $("#komentari").click(function(e) { e.preventDefault(); $('html, body').animate({ scrollTop: $("#comments").offset().top - 200 }, 800); }); if (loc.indexOf("#comments") != -1) { $('html, body').animate({ scrollTop: $("#comments").offset().top - 200 }, 800); } }); function init() { FB.Event.subscribe('comment.create', comment_created); FB.Event.subscribe('comment.remove', comment_removed); } var comment_created = function() { editNumComments('created'); } var comment_removed = function() { editNumComments('removed'); } function editNumComments(status) { var post_id = document.getElementById('post_id').value; var url = document.location.pathname; $.ajax({ type: 'POST', url: 'http://zabava.mk/content-files/themes/zabava/js/numComments.php', data: { post_id: post_id, url: url, status: status }, success: function(response) { var obj = jQuery.parseJSON(response); $("#komentari").html(obj.comment_count); } }); } (function getNumComments() { var intval = setInterval(function() { if (document.getElementById('post_id') != null) { clearInterval(intval); var post_id = document.getElementById('post_id').value; $.ajax({ type: 'POST', url: 'http://zabava.mk/content-files/themes/zabava/js/numComments.php', data: { post_id: post_id }, success: function(response) { var obj = jQuery.parseJSON(response); $("#komentari").html(obj.comment_count); $("#post_views").html(obj.views_count + " пати"); } }); } }, 100); })(); function createTicker() { var tickerLIs = $(".trending-ticker ul").children(); tickerItems = new Array(); tickerLIs.each(function(el) { tickerItems.push($(this).html()); }); i = 0; rotateTicker(); } function rotateTicker() { if (hovered) { setTimeout("rotateTicker()", 5000); } else { if (i == tickerItems.length) { i = 0; } tickerText = tickerItems[i]; c = 0; typetext(); // setTimeout("rotateTicker()", 5000); i++; } } var isInTag = false; function typetext() { if ($('.trending-ticker ul').length > 0) { var thisChar = tickerText.substr(c, 1); if (thisChar == '<') { isInTag = true; } if (thisChar == '>') { isInTag = false; } $('.trending-ticker ul').html('
  • ' + tickerText.substr(0, c++) + '
  • '); if (c < tickerText.length + 1) { if (isInTag) { typetext(); } else { setTimeout("typetext()", 28); } } else { // c = 1; // tickerText = ""; setTimeout("rotateTicker()", 5000); } } } var weather_hovered = false; var interval = setInterval(function() { if ($("#weather ul").length) { if (!$("#weather ul").find("li.active_weather_li").length) { $("#weather ul").find("li:first").addClass("active_weather_li").fadeIn(1000); } setTimeout(function() { rotate(); }, 5000); $("#weather").hover(function() { weather_hovered = true; }, function() { weather_hovered = false; }); clearInterval(interval); } }, 100); function rotate() { var active = $("#weather ul").find("li.active_weather_li"); active.removeClass("active_weather_li"); $.fn.nextEle = function() { var next = active.next(); if (!next.length) { next = $("#weather ul").find("li:first"); } next.addClass("active_weather_li"); return next; }; active.fadeOut(1000).nextEle().fadeIn(1000); var interval = setInterval(function() { if (!weather_hovered) { clearInterval(interval); rotate(); } }, 5000); return false; }