1// jQuery Autocomplete plugin 1.2.2 by Jörn Zaefferer 2;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150,noRecord:""},options);options.highlight=options.highlight||function(value){return value};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options)})},result:function(handler){return this.bind("result",handler)},search:function(handler){return this.trigger("search",[handler])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(options){return this.trigger("setOptions",[options])},unautocomplete:function(){return this.trigger("unautocomplete")}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var globalFailure=null;if(options.failure!=null&&typeof options.failure=="function"){globalFailure=options.failure}var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;navigator.userAgent.indexOf("Opera")!=-1&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false}});$input.bind((navigator.userAgent.indexOf("Opera")!=-1&&!'KeyboardEvent'in window?"keypress":"keydown")+".autocomplete",function(event){hasFocus=1;lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:if(select.visible()){event.preventDefault();select.prev()}else{onChange(0,true)}break;case KEY.DOWN:if(select.visible()){event.preventDefault();select.next()}else{onChange(0,true)}break;case KEY.PAGEUP:if(select.visible()){event.preventDefault();select.pageUp()}else{onChange(0,true)}break;case KEY.PAGEDOWN:if(select.visible()){event.preventDefault();select.pageDown()}else{onChange(0,true)}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break}}).focus(function(){hasFocus++}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults()}}).click(function(){if(options.clickFire){if(!select.visible()){onChange(0,true)}}else{if(hasFocus++>1&&!select.visible()){onChange(0,true)}}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break}}}if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value])}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback)})}).bind("flushCache",function(){cache.flush()}).bind("setOptions",function(){$.extend(true,options,arguments[1]);if("data"in arguments[1])cache.populate()}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete")}
2);function selectCurrent(){var selected=select.selected();if(!selected)return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){var seperator=options.multipleSeparator.length;var cursorAt=$(input).selection().start;var wordAt,progress=0;$.each(words,function(i,word){progress+=word.length;if(cursorAt<=progress){wordAt=i;return false}progress+=seperator});words[wordAt]=v;v=words.join(options.multipleSeparator)}v+=options.multipleSeparator}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return}var currentValue=$input.val();if(!skipPrevCheck&¤tValue==previousValue)return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow)}else{stopLoading();select.hide()}};function trimWords(value){if(!value)return[""];if(!options.multiple)return[$.trim(value)];return $.map(value.split(options.multipleSeparator),function(word){return $.trim(value).length?$.trim(word):null})}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);if(words.length==1)return words[0];var cursorAt=$(input).selection().start;if(cursorAt==value.length){words=trimWords(value)}else{words=trimWords(value.replace(value.substring(cursorAt),""))}return words[words.length-1]}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$(input).selection(previousValue.length,previousValue.length+sValue.length)}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200)};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""))}else{$input.val("");$input.trigger("result",null)}}})}};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show()}else{hideResultsNow()}};function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data){if(data.length){success(term,data)}else{var parsed=options.parse&&options.parse(options.noRecord)||parse(options.noRecord);success(term,parsed)}}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed)}})}else{select.emptyList();if(globalFailure!=null){globalFailure()}else{failure(term)}}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]}}}return parsed};function stopLoading(){$input.removeClass(options.loadingClass)}};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:100,max:1000,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0]},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:" ",inputFocus:true,clickFire:false,highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:180,scrollJumpPosition:true};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(options.matchContains=="word"){i=s.toLowerCase().search("\\b"+sub.toLowerCase())}if(i==-1)return false;return i==0||options.matchContains};function add(q,value){if(length>options.cacheLength){flush()}if(!data[q]){length++}data[q]=value}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(typeof(value)==='undefined'||value===false)continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row)}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value)})}setTimeout(populate,25);function flush(){data={};length=0}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x)}})}}return csub}else if(data[q]){return data[q]}else if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x}});return csub}}}return null}}};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;
2function init(){if(!needsInit)return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body).hover(function(event){if($(this).is(":visible")){input.focus()}config.mouseDownOnSelect=false});list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE)}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();if(options.inputFocus)input.focus();return false}).mousedown(function(){config.mouseDownOnSelect=true}).mouseup(function(){config.mouseDownOnSelect=false});if(options.width>0)element.css("width",options.width);needsInit=false}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight())}else if(offset<list.scrollTop()){list.scrollTop(offset)}}};function movePosition(step){if(options.scrollJumpPosition||(!options.scrollJumpPosition&&!((step<0&&active==0)||(step>0&&active==listItems.size()-1)))){active+=step;if(active<0){active=listItems.size()-1}else if(active>=listItems.size()){active=0}}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available}function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i])}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0}if($.fn.bgiframe)list.bgiframe()}return{display:function(d,q){init();data=d;term=q;fillList()},next:function(){moveSelect(1)},prev:function(){moveSelect(-1)},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active)}else{moveSelect(-8)}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active)}else{moveSelect(8)}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1},visible:function(){return element&&element.is(":visible")},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0])},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if(navigator.userAgent.indexOf("MSIE")!=-1&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")))}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data")},emptyList:function(){list&&list.empty()},unbind:function(){element&&element.remove()}}};$.fn.selection=function(start,end){if(start!==undefined){return this.each(function(){if(this.createTextRange){var selRange=this.createTextRange();if(end===undefined||start==end){selRange.move("character",start);selRange.select()}else{selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select()}}else if(this.setSelectionRange){this.setSelectionRange(start,end)}else if(this.selectionStart){this.selectionStart=start;this.selectionEnd=end}})}var field=this[0];if(field.createTextRange){var range=document.selection.createRange(),orig=field.value,teststring="<->",textLength=range.text.length;range.text=teststring;var caretAt=field.value.indexOf(teststring);field.value=orig;this.selection(caretAt,caretAt+textLength);return{start:caretAt,end:caretAt+textLength}}else if(field.selectionStart!==undefined){return{start:field.selectionStart,end:field.selectionEnd}}}})(jQuery); 3 4// cookie 5(function(d){"function"===typeof define&&define.amd?define(["jquery"],d):d(jQuery)})(function(d){function n(a){return a}function p(a){return decodeURIComponent(a.replace(k," "))}function l(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e.json?JSON.parse(a):a}catch(c){}}var k=/\+/g,e=d.cookie=function(a,c,b){if(void 0!==c){b=d.extend({},e.defaults,b);if("number"===typeof b.expires){var g=b.expires,f=b.expires=new Date;f.setDate(f.getDate()+g)}c=e.json? 6JSON.stringify(c):String(c);return document.cookie=[e.raw?a:encodeURIComponent(a),"=",e.raw?c:encodeURIComponent(c),b.expires?"; expires="+b.expires.toUTCString():"",b.path?"; path="+b.path:"",b.domain?"; domain="+b.domain:"",b.secure?"; secure":""].join("")}c=e.raw?n:p;b=document.cookie.split("; ");for(var g=a?void 0:{},f=0,k=b.length;f<k;f++){var h=b[f].split("="),m=c(h.shift()),h=c(h.join("="));if(a&&a===m){g=l(h);break}a||(g[m]=l(h))}return g};e.defaults={};d.removeCookie=function(a,c){return void 0!== 7d.cookie(a)?(d.cookie(a,"",d.extend({},c,{expires:-1})),!0):!1}}); 8 9function isMobile() { 10 return window.matchMedia("only screen and (max-width: 768px)").matches; 11} 12 13$(window).on('load', function() { 14 const navList = $('.site-navigation ul'); 15 const toggleButton = $('.menu-toggle'); 16 17 function checkMenuOverflow() { 18 const navWidth = navList.width(); 19 20 21 const itemsWidth = navList.children().toArray().reduce((total, item) => { 22 const itemWidth = $(item).outerWidth(true); 23 24 return total + itemWidth; 25 }, 0); 26 27 if (itemsWidth > navWidth) { 28 toggleButton.css('display', 'inline'); 29 } else { 30 toggleButton.css('display', 'none'); 31 } 32 } 33 34 checkMenuOverflow(); 35 36 $(window).on('resize', checkMenuOverflow); 37}); 38 39/*region #Propeller_interstitial vignette */ 40let targetLink = '', vignetteShown = false;
41$(window).on("load", () => { 42 if (!$('#Propeller_interstitial').length) { 43 return; 44 } 45 46 if (!shouldShowVignette()) return; 47 48 Math.random() < 0.5 ? setupScrollVignette() : setupClickVignette(); 49 50 $(document).on('click', '#Propeller_interstitial .close-btn, #Propeller_interstitial', (e) => { 51 if (e.target.id === 'Propeller_interstitial' || e.target.classList.contains('close-btn')) closeVignette(); 52 }); 53}); 54 55const setupScrollVignette = () => { 56 const triggerPoint = ($(document).height() - window.innerHeight) * (Math.random() * 0.5 + 0.3); 57 $(window).on('scroll', () => { 58 if (!vignetteShown && $(window).scrollTop() >= triggerPoint) showVignette(); 59 }); 60}; 61 62const setupClickVignette = () => { 63 $(document).on('click', 'a, img', (e) => { 64 e.preventDefault(); 65 66 const link = $(e.target).is("a") ? $(e.target) : $(e.target).closest("a"); 67 68 const href = link.attr('href'); 69 const target = link.attr('target') ?? "_self"; 70 71 if (href && href !== '#' && !href.startsWith('#')) { 72 e.preventDefault(); 73 74 targetLink = target === '_blank' ? window.open(href, '_blank') : href; 75 76 showVignette(); 77 } 78 }); 79}; 80 81const disableScroll = () => { 82 const scrollTop = $(window).scrollTop(); 83 $('body').css({ 84 'position': 'fixed', 85 'top': `-${scrollTop}px`, 86 'width': '100%' 87 }).attr('data-scroll-top', scrollTop); 88}; 89 90const enableScroll = () => { 91 const scrollTop = $('body').attr('data-scroll-top'); 92 $('body').css({ 93 'position': '', 94 'top': '', 95 'width': '' 96 }); 97 $(window).scrollTop(scrollTop); 98}; 99 100const showVignette = () => { 101 vignetteShown = true; 102 disableScroll(); 103 $('#Propeller_interstitial').fadeIn(); 104}; 105 106const closeVignette = () => { 107 $('#Propeller_interstitial').fadeOut(() => { 108 enableScroll(); // Görgetés visszaengedése 109 localStorage.setItem('vignetteLastShown', Date.now().toString()); 110 if (targetLink) window.location.href = targetLink; 111 }); 112}; 113const shouldShowVignette = () => { 114 const lastShown = localStorage.getItem('vignetteLastShown'); 115 return !lastShown || (Date.now() - parseInt(lastShown, 10)) >= 12 * 60 * 60 * 1000; 116}; 117/*endregion*/ 118 119 120//Ez azért van, hogy mobilon minden link az aktuális ablakban nyÃljon meg. 121if(isMobile()){ 122 window.addEventListener('load', function() { 123 $("a").removeAttr("target"); 124 }); 125 126 jQuery(document).ready(function() { 127 $("a").removeAttr("target"); 128 }); 129 130 //Ez azért van, hogy a késÅbb betöltÅdÅ linkekrÅl is lekerüljön a target 131 //A 10 és 2000 ezek teljesen manuálisan választott számok, lehet Åket variálni, ha kellene 132 let count = 0; 133 const max = 10; 134 const interval = 2000; 135 const removeTargetFromLinkInterval = setInterval(function() { 136 $("a").removeAttr("target"); 137 138 count++; 139 if (count >= max) { 140 clearInterval(removeTargetFromLinkInterval); 141 } 142 }, interval); 143} 144 145var window_height = $(window).outerHeight(true); 146function scrolling() { 147 if(!isMobile()) { 148 if($(window).scrollTop() > window_height) { 149 $('#scroll-top').fadeIn().css('display', 'inline-block'); 150 } 151 else { 152 $('#scroll-top').fadeOut(); 153 } 154 155 if($(window).scrollTop() > 250) { 156 $('a#next-post').fadeIn().css('display', 'inline-block'); 157 } 158 else { 159 $('a#next-post').fadeOut(); 160 } 161 162 } 163} 164 165$(window).scroll(function(e) { 166 scrolling(); 167}); 168 169$(function() { 170 scrolling(); 171 172 // hash url helyre rántása, mivel a bannerek töltÅdése elcseszi 173 scrollTopHash(); 174 175 if (typeof adblock_notification !== 'undefined') { 176 OVERLAY.notification(adblock_notification); 177 } 178 179}); 180 181OVERLAY = { 182 debug: true, 183 184 init: function() { 185 if($.cookie('overlay_notification')) { 186 OVERLAY.notification($.cookie('overlay_notification')); 187 $.removeCookie('overlay_notification'); 188 } 189 190 if($.cookie('overlay_dialog')) { 191 OVERLAY.dialog($.cookie('overlay_dialog')); 192 $.removeCookie('overlay_dialog'); 193 } 194 }, 195 notification: function(message) { 196 OVERLAY.remove(); 197 198 $('body').prepend('<div id="overlay-box" class="notification"><div class="content">'+message+'</div></div>'); 199 $('#overlay-box > .content').click(OVERLAY.remove); 200 201 }, 202 dialog: function(message, options) { 203 options = options || {}; 204 if(!options.primaryLabel) options.primaryLabel = 'Rendben'; 205 if(!options.width) options.width = 450; 206 OVERLAY.remove(); 207 208 $('body').prepend('<div id="overlay-box" class="dialog" role="dialog"><div class="content">'+message+'</div><div class="buttons"></div></div>'); 209 $('body').prepend('<div id="overlay-mask"></div>'); 210 211 // gombok 212 $('#overlay-box .buttons').append('<button class="primary">'+options.primaryLabel+'</button>'); 213 if(options.secondaryLabel) $('#overlay-box .buttons').append('<button class="secondary">'+options.secondaryLabel+'</button>'); 214 $('#overlay-box .buttons button').click(OVERLAY.remove); 215 216 // callback -ek 217 if(options.primary) $('#overlay-box .buttons .primary').click(options.primary); 218 if(options.secondary) $('#overlay-box .buttons .secondary').click(options.secondary); 219 220 var height = $('#overlay-box').height(); 221 $('#overlay-box').css({'width': options.width, 'top': '25%', 'left': '50%', 'margin-left': -options.width/2, 'margin-top': -height/4}); 222 }, 223 remove: function() { 224 $('html').css({ 'overflow': 'auto', 'overflow-y': 'scroll'}); 225 $('#overlay-box').remove(); 226 $('#overlay-mask').remove(); 227 } 228} 229 230$.fn.defaultValue = function(def, options) { 231options = options || {}; 232options['class'] = options['class'] || 'defaultValue'; 233$(this).each(function() { 234 if ($(this).val() == '' || $(this).val() == def) { 235 $(this).addClass(options['class']); 236 $(this).val(def) 237 } 238 239 $(this).focus(function() { 240 if ($(this).val() == def) { 241 $(this).val(''); 242 $(this).removeClass(options['class']); 243 } 244 }); 245 $(this).blur(function() { 246 if ($(this).val() == '') { 247 $(this).addClass(options['class']); 248 $(this).val(def); 249 } 250 }); 251 252 var inp = $(this); 253 $(this).parents('form').submit(function() { 254 if (inp.val() == def) { 255 inp.val(''); 256 } 257 }); 258}); 259} 260 261// aktivitás olvasottnak jelölése (callback) 262function setAcitvityViewed(id, thref) { 263 $.ajax({ 264 type: 'POST', 265 url: '/requests/content/act_viewed', 266 data: {'id': id}, 267 dataType: 'text', 268 success: function(data) { 269 if(window.location.href.split('#')[0] == thref.split('#')[0]) { 270 window.location.reload(); 271 } 272 else { 273 window.location = thref; 274 } 275 } 276 }); 277} 278 279 280 281 282// hÃr törlése 283function deleteContent(content_id) { 284 285 OVERLAY.dialog('Biztos, hogy törölni szeretné ezt beküldött a hÃrt a PropellerrÅl? Nem vonható vissza és a hozzászólások is elvesznek!', { 286 primaryLabel: 'Igen, törlöm', 287 primary: function() { 288 $.ajax({ 289 type: 'GET', 290 url: '/requests/content/delete_content', 291 data: {'content_id': content_id}, 292 dataType: 'text', 293 success: function (data) { 294 // $('#feed-item-'+content_id).remove(); 295 $('#c'+content_id).fadeOut(400).hide(); 296 OVERLAY.notification('A hÃr törlése megtörtént.'); 297 } 298 }); 299 }, 300 secondaryLabel: 'Mégsem', 301 secondary: function() { 302 return false;
303 } 304 }); 305 306} 307 308// privát üzenet törlése 309function deleteMessage(message_id) { 310 311 OVERLAY.dialog('Biztos, hogy törölni szeretné ezt a privát üzenetet? Nem vonható vissza!', { 312 primaryLabel: 'Igen, törlöm', 313 primary: function() { 314 $.ajax({ 315 type: 'GET', 316 url: '/requests/users/delete_message', 317 data: {'message_id': message_id}, 318 dataType: 'text', 319 success: function (data) { 320 $('#m'+message_id).fadeOut(400).hide(); 321 } 322 }); 323 }, 324 secondaryLabel: 'Mégsem', 325 secondary: function() { 326 return false; 327 } 328 }); 329 330} 331 332 function toggle(what) { // ez mi? 333 $('#'+what).toggle(); 334 return; 335 } 336 337// beállÃtásoknál a politikai nézet változtatása 338function togglePolOther(e) { 339 $('#politics-wrapper').css('display', ((e == 'other') ? 'block' : 'none')); 340} 341 342 343 344 345 346 347 348function comments_resize(parse) { 349 //$('.fb-comments').attr('data-width', $('.fb-comments-wrapper').width()); 350 // if(parse) FB.XFBML.parse($('.fb-comments-wrapper')[0]); 351} 352 353$(window).bind('resize', function(e) { 354 window.resizeEvt; 355 $(window).resize(function() { 356 clearTimeout(window.resizeEvt); 357 window.resizeEvt = setTimeout(function() { 358 comments_resize(true); 359 }, 150); 360 }); 361}); 362 363$(function() { 364 OVERLAY.init(); 365 366 //OVERLAY.notification('habalababalala'); 367 //OVERLAY.dialog('habalababalala?', { secondaryLabel: 'nem'}); 368 369 370 $('#scroll-top').click(function(e) { 371 e.preventDefault(); 372 $('html, body').animate({scrollTop: 0}, 800); 373 }); 374 375 $('.site-navigation .menu-toggle a').click(function(e) { 376 e.preventDefault(); 377 if($('.site-navigation ul').hasClass('toggled')) { 378 $('.site-navigation ul').removeClass('toggled'); 379 } 380 else { 381 $('.site-navigation ul').addClass('toggled'); 382 } 383 }); 384 385 $('#show-comments').click(function(e) { 386 e.preventDefault(); 387 if($('.all-comments').hasClass('toggled')) { 388 $('.all-comments').removeClass('toggled'); 389 } 390 else { 391 $('.all-comments').addClass('toggled'); 392 } 393 }); 394 395 396/// GA GA GA GA GA GA GA GA GA GA GA GA GA GA GA GA GA GA GA GA GA GA GA GA GA GA /// 397 398 // kimenÅ linkek mérése 399 $('a.outgoing').click(function() { 400 ga('send', 'event', 'outgoing', 'click', $(this).attr('href')); 401 $(this).attr('target', '_blank'); 402 }); 403 404 // kapcsolódók a cikkoldalon 405 $('.related a').click(function() { 406 ga('send', 'event', 'related', 'click', $(this).html(), {'nonInteraction': 1}); 407 }); 408 409 $('.topstories.bottom a').click(function() { 410 ga('send', 'event', 'topstories-bottom', 'click', $(this).attr('title'), {'nonInteraction': 1}); 411 }); 412 413 $('.topstories.header a').click(function() { 414 ga('send', 'event', 'topstories-header', 'click', $(this).attr('title'), {'nonInteraction': 1}); 415 }); 416 417 $('.topstories.aside a').click(function() { 418 ga('send', 'event', 'topstories-sidebar', 'click', $(this).attr('title'), {'nonInteraction': 1}); 419 }); 420 421 $('.topstories.content a').click(function() { 422 ga('send', 'event', 'topstories-content', 'click', $(this).attr('title'), {'nonInteraction': 1}); 423 }); 424 425 426 $('aside.sidebar .popular-box a').click(function() { 427 var str = $(this).html().replace(/(<([^>]+)>)/ig,""); 428 ga('send', 'event', 'popular-sidebar', 'click', str, {'nonInteraction': 1}); 429 }); 430 431 $('aside.sidebar .commented-box a').click(function() { 432 var str = $(this).html().replace(/(<([^>]+)>)/ig,""); 433 ga('send', 'event', 'commented-sidebar', 'click', str, {'nonInteraction': 1}); 434 }); 435 436 $('#next-post').click(function() { 437 var str = $(this).html().replace(/(<([^>]+)>)/ig,""); 438 ga('send', 'event', 'next-post', 'click', 'sajat', 1, {'nonInteraction': 1}); 439 }); 440 441 442 443 $('.ga-event a').click(function() { 444 var data = $(this).closest('.ga-event'); 445 446 ga('send', 'event', 'gae-' + $(data).data('category'), $(data).data('action'), $(data).data('label'), {'nonInteraction': 1}); 447 }); 448 449 // tulajdonnevek kiemelése a hÃrcÃmekben 450 $('.list-box a:not(.thumb)').each(function() { 451 $(this).html($(this).html().replace(new RegExp('([A-ZŰÃÃÃÃÅÃÃÃ0-9][-a-zA-Z0-9öüóÅúéáäűÃŰÃÃÃÃÅÃÃÃ!?\']+)', "g"), '<b>$1</b>')); 452 }); 453 454 455 function numberFrm(x) { 456 return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); 457 } 458 459 // share számok 460 var get_fb_container = []; 461 $('.get-fb-count').each(function(key, value) { 462 var url = $(this).data('url').replace('.dev', '.hu');; 463 get_fb_container.push(url); 464 465/* $.ajax({ 466 url: 'https://graph.facebook.com/?id=' + url + '&callback=?', 467 dataType: "json", 468 success: function(result) { 469 if(result.share) { 470 var str = '<i class="material-icons material-hot">whatshot</i>'+numberFrm(parseInt(result.share.share_count)); 471 472 var elm = $(".get-fb-count[data-url='" +url+ "']"); 473 474 $(elm).children('span').html(str+' megosztás'); 475 //console.log(url + ' > ' + count); 476 } 477 } 478 });*/ 479 }); 480 481 482 if (get_fb_container.length) { 483 $.ajax({ 484 url: 'https://graph.facebook.com/?ids=' + get_fb_container.join(',') + '&callback=?', 485 dataType: "json", 486 success: function(data) { 487 if(typeof data !== "undefined" && data) { 488 $.each(data, function (key, value) { 489 var url = value.id ? value.id : ""; 490 var count = (value.share && value.share.share_count) ? value.share.share_count : ""; 491 492 var str = '<i class="material-icons material-hot">whatshot</i>' + numberFrm(parseInt(count)); 493 var elm = $(".get-fb-count[data-url='" + url + "']"); 494 495 $(elm).children('span').html(str + ' megosztás'); 496 //console.log(key + ' > ' + count); 497 }); 498 } 499 } 500 }); 501 } 502 503 504 $('.get-fb-count, .fb-buttons .facebook').click(function(e) { 505 e.preventDefault(); 506 var left = (screen.width/2)-(600/2); 507 var top = (screen.height/3)-(350/2); 508 window.open($(this).attr('href'), 'Megosztás', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=600, height=350, top='+top+', left
508='+left); 509 ga('send', 'event', 'share_button', 'click', window.location.href, {'nonInteraction': 1}); 510 }); 511 512 513 514 // a cÃmlapi "most beszédtéma" doboz és a fejléc aktivitások értesÃtÅ-buborékjának frissÃtése 515 var checking_interval = logged_in ? 90000 : 180000; // 90 és 180 másodperc 516 var previous_comment_num = 0; 517 518 if(typeof commented_since !== 'undefined' || logged_in) { 519 setTimeout(checkCommentsAndActivities, checking_interval); 520 } 521 522 function checkCommentsAndActivities() { 523 $.ajax({ 524 type: 'POST', 525 url: '/requests/content/check', 526 data: 'commented_since='+((typeof commented_since !== 'undefined') ? commented_since : ''), 527 dataType: 'json', 528 success: function(data) { 529 if(!data) return; 530 531 // friss kommentek 532 if(typeof data.comments !== 'undefined') { 533 newCommentedItems = ''; 534 535 var newc = 0; 536 $.each(data.comments, function(key, value){ 537 if(value.datetime > commented_since) newc++; 538 }); 539 540 commented_since = data.comments[0].datetime; 541 542 if(newc > 0) { // vannak új kommentek 543 //var alert_str = (previous_comment_num+newc)+' új hozzászólás'; 544 545 //$('#commented-message-wrapper').html(alert_str).unbind('click').click(function() { 546 //$('#commented-message-wrapper').fadeOut(); 547 548 $('#commented-box > li').each(function(key, value) { 549 currId = $(this).attr('id'); 550 newId = 'c_'+data.comments[key].id; 551 552 tit = data.comments[key].title; 553 tit = tit.replace(new RegExp('([A-ZŰÃÃÃÃÅÃÃÃ0-9][-a-zA-Z0-9öüóÅúéáäűÃŰÃÃÃÃÅÃÃÃ!?\']+)', "g"), '<b>$1</b>'); 554 555 $(this).attr('id', newId).html('<a href="'+data.comments[key].link+'#v'+data.comments[key].id+'">'+tit+'</a>'); 556 557 if(currId != newId) { 558 //$(this).fadeOut().fadeIn(); 559 } 560 }); 561 previous_comment_num = 0; 562 //}); 563 564 // eddig 0 új volt 565 //if(previous_comment_num == 0) $('#commented-message-wrapper').fadeIn(); 566 567 previous_comment_num = previous_comment_num+newc; 568 } 569 570 } 571 572 // aktivitások 573 if(typeof data.activities !== 'undefined') { 574 var a = data.activities; 575 var html = ''; 576 if(a.num == 0) { // már nincsenek olvasatlanok 577 $('#activity').hide(); 578 var w_title = $(document).attr('title').replace(/^\s*\([^\)]*\)\s*/, ''); 579 $(document).attr('title', w_title); 580 } 581 582 // nincsenek aktivitások, vége 583 if(typeof(a.items) == 'undefined') return false; 584 585 $.each(a.items, function(key, value){ 586 html += '<li data-id="'+value.id+'">'+value.message+'</li>'; 587 }); 588 //html += '<li class="all"><a>Ãsszesen '+a.num+' új értesÃtés</a></li>'; 589 $('#activity-list').html(html); 590 591 //$('#activity .all a').attr('href', $('#activity > a').attr('href')); 592 // aktivitások kattintásra olvasottak legyeneke 593 $('#activity-list li a').unbind('click').click(function(e) { 594 e.preventDefault(); 595 setAcitvityViewed($(this).parents('li').data('id'), this.href); 596 }); 597 598 if($('#activity').html() != '<i class="material-icons">public</i><span>'+a.num+'</span>') { 599 $('#activity').hide(); 600 } 601 $('#activity').html('<i class="material-icons">public</i><span>'+a.num+'</span>').show(); 602 603 // cÃmsorba a számláló 604 var w_title = $(document).attr('title').replace(/^\s*\([^\)]*\)\s*/, ''); 605 var w_counter = $(document).attr('title').replace(/[^0-9]+/g, ''); 606 607 $(document).attr('title', '('+a.num+') '+w_title); 608 609 } 610 611 }, 612 error: function () { 613 } 614 }); 615 616 setTimeout(checkCommentsAndActivities, checking_interval); 617 } 618 619 // hozzászólás küldés 620 $('#comment-form').submit(function() { 621 if(!logged_in) { 622 OVERLAY.notification('Hozzászólás Ãrásához regisztráció szükséges. <a href="/regisztracio">Regisztráljon</a> vagy használja a <a href="/belepes" rel="nofollow">belépést</a>!'); 623 return false; 624 } 625 626 if($('#comment').val() == '') return false; 627 628 $('#submit').attr('disabled', 'disabled'); 629 OVERLAY.notification('Pillanat...'); 630 }); 631 632 // ha fókusz kerül a komment mezÅre 633 if(!logged_in) { 634 $('#comment-form #comment').focus(function() { 635 OVERLAY.notification('Hozzászólás Ãrásához regisztráció szükséges. <a href="/regisztracio">
635Regisztráljon</a> vagy használja a <a href="/belepes" rel="nofollow">belépést</a>!'); 636 }); 637 } 638 639 // komment aktivitás: lájk 640 $('.ca-like').click(function() { 641 if(!logged_in) { 642 OVERLAY.notification('A hozzászólások kedveléséhez regisztráció szükséges. <a href="/regisztracio">Regisztráljon</a> vagy használja a <a href="/belepes" rel="nofollow">belépést</a>!'); 643 return false; 644 } 645 646 var parent = $(this).parent().parent().parent(); 647 var comment_id = $(parent).data('commentid'); 648 var content_id = $(parent).data('contentid'); 649 var user_id = $(parent).data('userid'); 650 651 $.ajax({ 652 type: 'GET', 653 url: '/requests/content/like_comment', 654 data: {'content_id': content_id, 'comment_id': comment_id, 'user_id': user_id}, 655 dataType: 'text', 656 success: function(data) { 657 if(data == 'OK') { 658 var wrap = $('.c-'+comment_id+' .ca-like span'); 659 if($(wrap).length) { 660 var n = ($(wrap).html() == '') ? 1 : parseInt($(wrap).html()) + 1; 661 $(wrap).html(n); 662 } 663 $(wrap).hide().fadeIn(); 664 } 665 } 666 }); 667 return false; 668 }); 669 670 // komment aktivitás: jelentés 671 $('.ca-report').click(function() { 672 if(!logged_in) { 673 OVERLAY.notification('A hozzászólások jelentéséhez regisztráció szükséges. <a href="/regisztracio">Regisztráljon</a> vagy használja a <a href="/belepes" rel="nofollow">belépést</a>!'); 674 return false; 675 } 676 677 var parent = $(this).parent().parent().parent(); 678 var comment_id = $(parent).data('commentid'); 679 var content_id = $(parent).data('contentid'); 680 681 OVERLAY.dialog('Biztos, hogy jelenteni szeretné ezt a hozzászólást a moderátornak?', { 682 primaryLabel: 'Igen, jelentem', 683 primary: function() { 684 $.ajax({ 685 type: 'GET', 686 url: '/requests/content/report_comment', 687 data: {'content_id': content_id, 'comment_id': comment_id }, 688 dataType: 'text', 689 success: function (data) { 690 OVERLAY.notification('Köszönjük az értesÃtést, a moderátor hamarosan megvizsgálja a hozzászólást!'); 691 } 692 }); 693 }, 694 secondaryLabel: 'Mégsem', 695 secondary: function() { 696 return false; 697 } 698 }); 699 return false; 700 }); 701 702 // komment aktivitás: válasz 703 $('.ca-reply').click(function() { 704 var comment_id = $(this).parent().parent().parent().data('commentid'); 705 $('#comment').focus().attr('scrollTop', 0).val($('#comment').val()+'@'+$('.c-'+comment_id+' .username').html()+': '); 706 return false; 707 }); 708 709 // fejléc aktivitások buborékja 710 $('#activity').mouseenter(function() { 711 $('#activity-list').slideDown(100); 712 }); 713 $('#activity-list').mouseleave(function() { 714 $('#activity-list').slideUp(200); 715 }); 716 $('#activity').click(function(e) { // meghagyjuk ezt is touch miatt 717 e.preventDefault(); 718 $('#activity-list').slideToggle(150); 719 }); 720 721 722 // aktivitások kattintásra olvasottak legyenek 723 $('#activity-list a').click(function(e) { 724 e.preventDefault(); 725 setAcitvityViewed($(this).parents('li').data('id'), this.href); 726 }); 727 728 729 730 731 732 // téma hozzáadásnál: link ellenÅrzése 733 $('#add-link').blur(function() { 734 var l = $('#add-link'); 735 if(l.val() == '' || l.val() == 'http://') return; 736 737 OVERLAY.notification('Pillanat...'); 738 739 $.ajax({ 740 type: 'GET', 741 url: '/requests/content/get_title', 742 data: {'title': l.val()}, 743 dataType: 'json', 744 success: function(data) { 745 OVERLAY.remove(); 746 747 if(data == '404') { // nincs semmi 748 $('#add-link').focus(); 749 OVERLAY.notification('Nem sikerült feldolgozni a linket.'); 750 return false; 751 } 752 753 754 if(data.duplicatedlink) { //van már ilyen tartalom 755 $('#add-title').after('<p class="error">Ezt a hÃrt már beküldte valaki, <a href="'+data.duplicatedlink+'" target="_blank">itt találja</a>.</p>'); 756 } 757 if(data.link) { 758 $('#add-link').val(data.link); 759 $('#add-title').focus(); 760 } 761 762 $('#add-title').val(data.title); 763 if(data.title) { 764 $('#add-description').focus(); 765 } 766 767 $('#add-description').val(data.description); 768 var descl = data.description; 769 if(descl.length < 210) { 770 OVERLAY.notification('Túl rövid bevezetÅ, legalább 200 karaktert Ãrjon, vagy másoljon be néhány bekezdést!'); 771 } 772 773 if(data.description) { 774 $('#category_id').focus(); 775 } 776 777 $('#add-tags').val(data.tags); 778 if(data.tags) { 779 $('#add-tags').removeClass('defaultValue'); 780 } 781 } 782 }); 783 }); 784 785 // téma hozzáadásnál: cÃmkék 786 $('#add-tags').autocomplete('/requests/content/tags_autocomplete', { 787 width: 410, 788 minChars: 2, 789 selectFirst: true, 790 scroll: false, 791 highlight: false, 792 multiple: true, 793 multipleSeparator: ", " 794 }); 795 796 797 798 799 800 801 802 803 804 // üzenet küldés számláló 805 var keyHandler = function() { 806 var len = 1000 - $('#message').val().length; 807 var td = len < 10 ? 'blink' : 'none'; 808 $('#message-counter').html(len).css('text-decoration', td).show(); 809 } 810 $('#message').keyup(keyHandler).keyup(); 811 812 var delayedKeyHandler = function() { 813 setTimeout(function() { $('#message').trigger('keyup') }, 1); 814 } 815 $('#message').bind('paste', delayedKeyHandler).bind('cut', delayedKeyHandler); 816 817 // komment küldés számláló 818 var keyHandler = function() { 819 var len = 2000 - $('#comment').val().length; 820 var td = len < 10 ? 'blink' : 'none'; 821 $('#comment-counter').html(len).css('text-decoration', td).show(); 822 } 823 $('#comment').keyup(keyHandler).keyup(); 824 825 var delayedKeyHandler = function() { 826 setTimeout(function() { $('#message').trigger('keyup') }, 1); 827 } 828 $('#message').bind('paste', delayedKeyHandler).bind('cut', delayedKeyHandler); 829 830 831 832 833 // üzeneteknél a cÃmzett 834 $('#message-recipient').autocomplete('/requests/users/recipient_autocomplete', { 835 width: 410, 836 minChars: 2, 837 selectFirst: true, 838 scroll: false, 839 highlight: false, 840 multiple: false 841 }); 842 843 // beállÃtások lapon a település választó 844 $("#city-change").autocomplete("/requests/content/get_cities", { 845 width: 300, 846 minChars: 2, 847 selectFirst: true, 848 scroll: false, 849 highlight: false 850 }); 851 852 $('#city-change').result(function(event, data, formatted) { 853 if(!data) return; 854 $('#city_id').val(data[1]); 855 }); 856 857 858 $('#search-q').defaultValue('KeresendÅ hÃr...'); 859 $('#mm-name').defaultValue('Vezetéknév Keresztnév'); 860 $('#mm-mail').defaultValue('E-mail cÃm'); 861 $('#message-recipient').defaultValue('CÃmzett neve (kezdje el gépelni...)'); 862 $('#message').defaultValue('Ãzenet szövege...'); 863 $('#message-reply').defaultValue('Válasz szövege...'); 864 $('#add-link').defaultValue('http://'); 865 $('#add-tags').defaultValue('Kezdjen el gépelni egy szót...'); 866 867}); 868 869window.fbAsyncInit = function() { 870 871 FB.init({ 872 appId: "247823682023773", 873 status: true, 874 xfbml: true 875 }); 876 877 FB.Event.subscribe('edge.create', function(response) { // like 878 if(response == "http://www.facebook.com/propellerhu") { 879 //_gaq.push(['_trackEvent', 'facebook_like', document.title, $('link[rel=canonical]').attr('href'), 1, true]); 880 ga('send', 'event', 'facebook_like', 'click', document.title, {'nonInteraction': 1}); 881 $.cookie('facebook_liked', 1, { expires: 180, path: '/' }); 882 } 883 }); 884 885 FB.Event.subscribe('edge.remove', function(href) { // dislike 886 if(href == "http://www.facebook.com/propellerhu") { 887 $.removeCookie('facebook_liked'); 888 } 889 }); 890 891 /*comments_resize(false); 892 FB.Event.subscribe('xfbml.render', function(response) { 893 if($('#fb-comments-count').length) { 894 if($('#fb-comments-count').hasClass('fb_comments_count_zero')) { 895 $('.fb-comments > span').height(110).css('overflow', 'auto'); 896 $('.fb-comments > span > iframe').height(110).css('overflow', 'auto'); 897 scrollTopHash(); 898 } 899 } 900 scrollTopHash(); 901 });*/ 902 903}; 904 905function scrollTopHash() { 906 // tartalmi oldalon hashhez ugrás 907 if(window.location.hash) { // van hash 908 var anchor = window.location.hash.substring(1); 909 var pref = window.location.hash.substring(1,2); 910 if($('#'+anchor).length) { 911 if(pref == 'c') { 912 $(window).scrollTop(($('#'+anchor).offset().top)-4); 913 } 914 } 915 } 916} 917 918 919/* 920(function(d, s, id){ 921 var js, fjs = d.getElementsByTagName(s)[0]; 922 if (d.getElementById(id)) {return;} 923 js = d.createElement(s); js.id = id; 924 js.src = "//connect.facebook.net/hu_HU/all.js"; 925 fjs.parentNode.insertBefore(js, fjs); 926}(document, "script", "facebook-jssdk")); 927*/ 928 929 930 931$(function() { 932 if (isMobile()) { 933 $('#fb-ad').html('<fb:ad placementid="247823682023773_642553142550823" format="320x50" testmode="false"></fb:ad>'); 934 } 935}); 936 937window.fbAsyncInit = function() { 938 FB.Event.subscribe( 939 'ad.loaded', 940 function(placementId) { 941 console.log('Audience Network ad loaded'); 942 } 943 ); 944 FB.Event.subscribe( 945 'ad.error', 946 function(errorCode, errorMessage, placementId) { 947 console.log('Audience Network error (' + errorCode + ') ' + errorMessage); 948 } 949 ); 950}; 951 952(function(d, s, id) { 953var js, fjs = d.getElementsByTagName(s)[0]; 954if (d.getElementById(id)) return; 955js = d.createElement(s); js.id = id; 956js.src = "//connect.facebook.net/en_US/sdk/xfbml.ad.js#xfbml=1&version=v2.5&appId=247823682023773"; 957fjs.parentNode.insertBefore(js, fjs); 958}(document, 'script', 'facebook-jssdk')); 959 960 961 962 963 964/* ========================================================================== 965 COOKIE ALERT 966 ========================================================================== */ 967 968/* Vertical tabs for cookie modal 969 SRC: W3schools */ 970function openCity(evt, cityName) { 971 var i, tabcontent, tablinks; 972 tabcontent = document.getElementsByClassName("tabcontent"); 973 for (i = 0; i < tabcontent.length; i++) { 974 tabcontent[i].style.display = "none"; 975 } 976 tablinks = document.getElementsByClassName("tablinks"); 977 for (i = 0; i < tablinks.length; i++) { 978 tablinks[i].className = tablinks[i].className.replace(" active", ""); 979 } 980 document.getElementById(cityName).style.display = "block"; 981 evt.currentTarget.className += " active"; 982} 983 984// Get the element with id="defaultOpen" and click on it 985document.getElementById("defaultOpen").click(); 986/* End of vertical tabs */ 987 988jQuery(document).ready(function($) { 989 $(document).on("click", ".change-settings-button", function(event) { 990 //event.preventDefault(); 991 }); 992 993 $(".sp-back, .sp-close").on("click", function(event) { 994 event.preventDefault(); 995 $(".smart-popin").css({"opacity":"0","visibility":"hidden"}); 996 }); 997 998 var cookieAcceptedByUser = $.cookie("propeller-gdpr"); 999 var specpage = false;
1000 if($('body').hasClass('postid-53616')){ 1001 specpage = true; 1002 } 1003 1004 console.log('cookie: ' + cookieAcceptedByUser + ' specpage: ' + specpage); 1005 1006 if(!specpage){ 1007 if( !cookieAcceptedByUser){ 1008 $('#cookie_block').prop('hidden', false); 1009 } 1010 } 1011 1012 $(document).on('click', '#accept_cookie_btn', function(event) { 1013 event.preventDefault(); 1014 var val = encodeURI("{1,1}"); 1015 $.cookie("propeller-gdpr", val, { expires : 14, path: '/' }); 1016 $('#cookie_block').prop('hidden', true); 1017 }); 1018 1019 $(document).on('click', '#kisu-cookie', function(event) { 1020 var state = $('#kisu-cookie').is(':checked'); 1021 if (state) { 1022 $("#gdpr-cookie-form > #kisu").attr("value","1"); 1023 } else { 1024 $("#gdpr-cookie-form > #kisu").attr("value","0"); 1025 } 1026 }); 1027 $(document).on('click', '#func-cookie', function(event) { 1028 var state = $('#func-cookie').is(':checked'); 1029 if (state) { 1030 $("#gdpr-cookie-form > #func").attr("value","1"); 1031 } else { 1032 $("#gdpr-cookie-form > #func").attr("value","0"); 1033 } 1034 }); 1035 $(document).on("click", "#gdpr-save, #save_cookie_btn", function(event) { 1036 //event.preventDefault(); 1037 var val1 = $("#gdpr-cookie-form > #func").attr("value"); 1038 var val2 = $("#gdpr-cookie-form > #kisu").attr("value"); 1039 var val = encodeURI("{"+val1+","+val2+"}"); 1040 if (val1 == 0) { 1041 $.removeCookie("__gads"); 1042 $.removeCookie("__gfp_64b"); 1043 $.removeCookie("_fbp"); 1044 $.removeCookie("_ga"); 1045 $.removeCookie("_gat"); 1046 $.removeCookie("_gat_regi"); 1047 $.removeCookie("_gid"); 1048 } 1049 $.cookie("propeller-gdpr", val, { expires : 14, path: '/' }); 1050 $(".smart-popin").css({"opacity":"0","visibility":"hidden"}); 1051 location.reload(); 1052 }); 1053 1054});//ready end 1055 1056
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.