PageSourceSearch

https://www.vuokraturva.fi/sites/default/files/js/js_9HrvDK02zjpcL…EVJSApk5fNrQCEpBrczL7nEz6xd92-N4Y2r0AJ6ETLk

js vuokraturva.fi collected 2026-09-26 02:40:33 UTC 20,433 bytes, 58 lines download raw bytes

1/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
2((Drupal,drupalSettings,$)=>{$(document).ready(function(){var client=new AddSearchClient('19ceebd039b6c7726eceb60b726fa675');let pageLang=jQuery('html').attr('lang');client.setLanguage(pageLang);var page_map={'fi':'/haku','sv':'/sv/sok','en':'/en/search'};var conf={searchResultsPageUrl:page_map[pageLang],updateBrowserHistory:false};const SEARCHFIELD_TEMPLATE=`
3      <div class="addsearch-searchfield-container">
4        <form class="addsearch-searchfield" autocomplete="off" action="?" role="search">
5          <div class="search-field-wrapper">
6            <input type="search" placeholder="{{placeholder}}" aria-label="${Drupal.t('Search')}" class="{{#not icon false}}icon{{/not}}" />
7          </div>
8          {{#if button}}
9            <button type="button" aria-label="Search button">{{button}}</button>
10          {{/if}}
11        </form>
12      </div>
13    `;const SEARCHRESULTS_TEMPLATE=`
14      <div class="addsearch-searchresults">
15        {{#if resultcount}}
16          {{> numberOfResultsTemplate }}
17        {{/if}}
18
19        {{#each hits}}
20          <div class="hit{{#equals type "PROMOTED"}} promoted{{/equals}}">
21            <div class="text-wrapper">
22              <h3>
23                <a href="{{url}}" data-analytics-click="{{id}}">{{#if title}} {{title}} {{else}} {{removeTrailingQueriesFromUrl url}} {{/if}}</a>
24              </h3>
25              {{#if (eq custom_fields.category "portaali")}}
26                <div class="category">
27                  ${Drupal.t('Rental apartment')}
28                </div>
29              {{/if}}
30              {{#gt categories.length 1}}
31                <div class="category">
32                  {{selectCategory ..}}
33                </div>
34              {{/gt}}
35              <div class="highlight">
36                {{{highlight}}}{{#not type "PROMOTED"}}&#8230;{{/not}}
37              </div>
38            </div>
39            <div class="image-wrapper">{{> searchResultImageTemplate}}</div>
40          </div>
41        {{/each}}
42      </div>
43    `;const template_image=`
44      {{#if custom_fields.apartment-image}}
45      <span class="main-image {{document_type}}" style="background-image: url(data:image/jpeg;base64,{{images.main_b64}})">
46        <img src="{{custom_fields.apartment-image}}" alt="{{title}}" />
47      </span>
48      {{else}}
49      <span class="main-image {{document_type}} {{#unless images.main}}noimage1{{/unless}}"{{#if images.main}} style="background-image: url(data:image/jpeg;base64,{{images.main_b64}})"{{/if}}>
50        {{#if images.main}}<img src="{{images.main}}" alt="{{title}}" />
51        {{else if style.image_url}}<img src="{{style.image_url}}" alt="{{title}}" />{{/if}}
52      </span>{{/if}}
53    `;function addsearchInit(){var searchui=new AddSearchUI(client,conf);searchui.registerHandlebarsHelper('eq',(a,b)=>a==b);searchui.searchField({containerId:'addsearch-search',placeholder:Drupal.t('Search'),template:SEARCHFIELD_TEMPLATE,searchAsYouType:true,icon:false,autofocus:false});searchui.searchResults({containerId:'addsearch-results',template:SEARCHRESULTS_TEMPLATE,template_image});searchui.start();}function addsearchFooterInit(){var searchui=new AddSearchUI(client,conf);searchui.registerHandlebarsHelper('eq',(a,b)=>a==b);searchui.searchField({containerId:'addsearch-footer-search',placeholder:Drupal.t('Search'),template:SEARCHFIELD_TEMPLATE,searchAsYouType:true,icon:false,autofocus:false});searchui.start();}addsearchInit();addsearchFooterInit();});})(Drupal,drupalSettings,jQuery);;
54var checkReadyState=setInterval(()=>{if(document.readyState==="complete"){clearInterval(checkReadyState);(($,Drupal)=>{const buttons=document.querySelector('.sticky-buttons');const form=document.querySelector('.webform-submission-form');let scrolled=false;let visible=false;if(buttons!=null){checkVisibilityOnScroll('.webform-submission-form');window.addEventListener('scroll',function(){if(window.scrollY<150&&visible){visible=false;buttons.classList.remove('visible');buttons.classList.add('hidden');}if(window.scrollY>150&&!visible){visible=true;buttons.classList.add('visible');buttons.classList.remove('hidden');}});}function checkVisibilityOnScroll(targetClass){const elements=document.querySelectorAll(targetClass);let visibleElements=[0];let changed=false;function updateVisibility(){let isMobile=window.innerWidth<961?true:false;for(const [i,el] of elements.entries()){const rect=el.getBoundingClientRect();bottom=isMobile?rect.bottom+150:rect.bottom;if(rect.top<=window.innerHeight&&bottom>=window.innerHeight)visibleElements[i]=1;else visibleElements[i]=0;}const redu=visibleElements.reduce((accumulator,currentValue)=>accumulator+currentValue,0);if(redu>0){buttons.classList.add('fadeout');buttons.classList.remove('fadein');}else{buttons.classList.remove('fadeout');buttons.classList.add('fadein');}}window.addEventListener('scroll',updateVisibility);updateVisibility();}})(jQuery,Drupal);}},100);;
55(($,Drupal)=>{var $addsearch=$('#addsearch');
55var $addsearchToggle=$(".toggle-addsearch");function openAddsearch(){$addsearch.addClass('focused');$addsearchToggle.attr('aria-expanded','true');$addsearchToggle.attr('aria-label',Drupal.t('Close search'));$('#addsearch-search input').focus();}function closeAddsearch(){$addsearch.removeClass('focused');$addsearchToggle.attr('aria-expanded','false');$addsearchToggle.attr('aria-label',Drupal.t('Open search'));}$addsearchToggle.on('click',function(e){$addsearchToggle.attr('aria-expanded')=='false'?openAddsearch():closeAddsearch();});$('.toggle-language-menu').on('focus',function(){closeAddsearch();});$(document).on('keyup',function(e){if(e.key=="Escape")if($addsearch.hasClass('focused')){closeAddsearch();$addsearchToggle.focus();}});})(jQuery,Drupal);;
56(function(root,factory){'use strict';if(typeof define==='function'&&define.amd)define([],factory);else if(typeof exports==='object')module.exports=factory();else root.Headroom=factory();}(this,function(){'use strict';var features={bind:!!(function(){}.bind),classList:'classList' in document.documentElement,rAF:!!(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)};window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;function Debouncer(callback){this.callback=callback;this.ticking=false;}Debouncer.prototype={constructor:Debouncer,update:function(){this.callback&&this.callback();this.ticking=false;},requestTick:function(){if(!this.ticking){requestAnimationFrame(this.rafCallback||(this.rafCallback=this.update.bind(this)));this.ticking=true;}},handleEvent:function(){this.requestTick();}};function isDOMElement(obj){return obj&&typeof window!=='undefined'&&(obj===window||obj.nodeType);}function extend(object){if(arguments.length<=0)throw new Error('Missing arguments in extend function');var result=object||{},key,i;for(i=1;i<arguments.length;i++){var replacement=arguments[i]||{};for(key in replacement)if(typeof result[key]==='object'&&!isDOMElement(result[key]))result[key]=extend(result[key],replacement[key]);else result[key]=result[key]||replacement[key];}return result;}function normalizeTolerance(t){return t===Object(t)?t:{down:t,up:t};}function Headroom(elem,options){options=extend(options,Headroom.options);this.lastKnownScrollY=0;this.elem=elem;this.tolerance=normalizeTolerance(options.tolerance);this.classes=options.classes;this.offset=options.offset;this.scroller=options.scroller;this.initialised=false;this.onPin=options.onPin;this.onUnpin=options.onUnpin;this.onTop=options.onTop;this.onNotTop=options.onNotTop;this.onBottom=options.onBottom;this.onNotBottom=options.onNotBottom;}Headroom.prototype={constructor:Headroom,init:function(){if(!Headroom.cutsTheMustard)return;this.debouncer=new Debouncer(this.update.bind(this));this.elem.classList.add(this.classes.initial);setTimeout(this.attachEvent.bind(this),100);return this;},destroy:function(){var classes=this.classes;this.initialised=false;for(var key in classes)if(classes.hasOwnProperty(key))this.elem.classList.remove(classes[key]);this.scroller.removeEventListener('scroll',this.debouncer,false);},attachEvent:function(){if(!this.initialised){this.lastKnownScrollY=this.getScrollY();this.initialised=true;this.scroller.addEventListener('scroll',this.debouncer,false);this.debouncer.handleEvent();}},unpin:function(){var classList=this.elem.classList,classes=this.classes;if(classList.contains(classes.pinned)||!classList.contains(classes.unpinned)){classList.add(classes.unpinned);classList.remove(classes.pinned);this.onUnpin&&this.onUnpin.call(this);}},pin:function(){var classList=this.elem.classList,classes=this.classes;if(classList.contains(classes.unpinned)){classList.remove(classes.unpinned);classList.add(classes.pinned);this.onPin&&this.onPin.call(this);}},top:function(){var classList=this.elem.classList,classes=this.classes;if(!classList.contains(classes.top)){classList.add(classes.top);classList.remove(classes.notTop);this.onTop&&this.onTop.call(this);}},notTop:function(){var classList=this.elem.classList,classes=this.classes;
56if(!classList.contains(classes.notTop)){classList.add(classes.notTop);classList.remove(classes.top);this.onNotTop&&this.onNotTop.call(this);}},bottom:function(){var classList=this.elem.classList,classes=this.classes;if(!classList.contains(classes.bottom)){classList.add(classes.bottom);classList.remove(classes.notBottom);this.onBottom&&this.onBottom.call(this);}},notBottom:function(){var classList=this.elem.classList,classes=this.classes;if(!classList.contains(classes.notBottom)){classList.add(classes.notBottom);classList.remove(classes.bottom);this.onNotBottom&&this.onNotBottom.call(this);}},getScrollY:function(){return (this.scroller.pageYOffset!==undefined)?this.scroller.pageYOffset:(this.scroller.scrollTop!==undefined)?this.scroller.scrollTop:(document.documentElement||document.body.parentNode||document.body).scrollTop;},getViewportHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;},getElementPhysicalHeight:function(elm){return Math.max(elm.offsetHeight,elm.clientHeight);},getScrollerPhysicalHeight:function(){return (this.scroller===window||this.scroller===document.body)?this.getViewportHeight():this.getElementPhysicalHeight(this.scroller);},getDocumentHeight:function(){var body=document.body,documentElement=document.documentElement;return Math.max(body.scrollHeight,documentElement.scrollHeight,body.offsetHeight,documentElement.offsetHeight,body.clientHeight,documentElement.clientHeight);},getElementHeight:function(elm){return Math.max(elm.scrollHeight,elm.offsetHeight,elm.clientHeight);},getScrollerHeight:function(){return (this.scroller===window||this.scroller===document.body)?this.getDocumentHeight():this.getElementHeight(this.scroller);},isOutOfBounds:function(currentScrollY){var pastTop=currentScrollY<0,pastBottom=currentScrollY+this.getScrollerPhysicalHeight()>this.getScrollerHeight();return pastTop||pastBottom;},toleranceExceeded:function(currentScrollY,direction){return Math.abs(currentScrollY-this.lastKnownScrollY)>=this.tolerance[direction];},shouldUnpin:function(currentScrollY,toleranceExceeded){var scrollingDown=currentScrollY>this.lastKnownScrollY,pastOffset=currentScrollY>=this.offset;return scrollingDown&&pastOffset&&toleranceExceeded;},shouldPin:function(currentScrollY,toleranceExceeded){var scrollingUp=currentScrollY<this.lastKnownScrollY,pastOffset=currentScrollY<=this.offset;return (scrollingUp&&toleranceExceeded)||pastOffset;},update:function(){var currentScrollY=this.getScrollY(),scrollDirection=currentScrollY>this.lastKnownScrollY?'down':'up',toleranceExceeded=this.toleranceExceeded(currentScrollY,scrollDirection);if(this.isOutOfBounds(currentScrollY))return;if(currentScrollY<=this.offset)this.top();else this.notTop();if(currentScrollY+this.getViewportHeight()>=this.getScrollerHeight())this.bottom();else this.notBottom();if(this.shouldUnpin(currentScrollY,toleranceExceeded))this.unpin();else{if(this.shouldPin(currentScrollY,toleranceExceeded))this.pin();}this.lastKnownScrollY=currentScrollY;}};Headroom.options={tolerance:{up:0,down:0},offset:0,scroller:window,classes:{pinned:'headroom--pinned',unpinned:'headroom--unpinned',top:'headroom--top',notTop:'headroom--not-top',bottom:'headroom--bottom',notBottom:'headroom--not-bottom',initial:'headroom'}};Headroom.cutsTheMustard=typeof features!=='undefined'&&features.rAF&&features.bind&&features.classList;return Headroom;}));;
57(function($){if(!$)return;$.fn.headroom=function(option){return this.each(function(){var $this=$(this),data=$this.data('headroom'),options=typeof option==='object'&&option;options=$.extend(true,{},Headroom.options,options);if(!data){data=new Headroom(this,options);data.init();$this.data('headroom',data);}if(typeof option==='string'){data[option]();if(option==='destroy')$this.removeData('headroom');}});};$('[data-headroom]').each(function(){var $this=$(this);$this.headroom($this.data());});}(window.Zepto||window.jQuery));;
58(function($,Drupal,drupalSettings){const iconPath="/themes/custom/vtbase/components/icons/";const logoPath="/"+drupalSettings.path.themeUrl+"/";const primaryNavigationTransitionWidth=1199;const secondaryNavigationTransitionWidth=1235;var headroomOptions={"offset":40,onNotTop:function(){setTimeout(function(){$(".main-page .header-wrapper.headroom--not-top").addClass("on-not-top");$(".main-page .header-wrapper.headroom--not-top").removeClass("on-top");},1000);},onTop:function(){$(".main-page .header-wrapper.headroom--top header.header-primary a.site-logo > img").attr("src",logoPath+"logo_white.svg");$(".main-page .header-wrapper.headroom--top").addClass("on-top");$(".main-page .header-wrapper.headroom--top").removeClass("on-not-top");}};Drupal.behaviors.navigation={attach:function(context){}}
58;Drupal.behaviors.heroOffset={attach:function(context){if(context!==document)return;$(".image-wrapper",context).each(function(){var offset=$(this).data("image-offset");if(offset===undefined)return;$("img",this).css("bottom",offset);});}};Drupal.behaviors.adminBar={attach:function(context){var toolbarTabOuterHeight=$("#toolbar-bar",context).find(".toolbar-tab",context).outerHeight()||0;var toolbarTrayHorizontalOuterHeight=$(".is-active.toolbar-tray-horizontal",context).outerHeight()||0;var primaryNavigationOuterHeight=$(".header-primary",context).outerHeight()||0;var secondaryNavigationOuterHeight=$(".header-secondary",context).outerHeight()||0;$(".header-wrapper",context).css({"margin-top":toolbarTabOuterHeight+toolbarTrayHorizontalOuterHeight});$(".hero:not(.hero--subpage)",context).css({"padding-top":primaryNavigationOuterHeight+secondaryNavigationOuterHeight});$(".header-wrapper div.block-language",context).css({"margin-top":0});$(".header-wrapper header.header-primary nav.menu--main",context).css({"margin-top":0});$(".header-wrapper div.block-search-page-link",context).css({"margin-top":0});$(".header-wrapper.on-mobile div.block-language",context).css({"margin-top":toolbarTabOuterHeight+toolbarTrayHorizontalOuterHeight});$(".header-wrapper.on-mobile header.header-primary nav.menu--main",context).css({"margin-top":toolbarTabOuterHeight+toolbarTrayHorizontalOuterHeight});$(".header-wrapper.on-mobile div.block-search-page-link",context).css({"margin-top":toolbarTabOuterHeight+toolbarTrayHorizontalOuterHeight});}};Drupal.behaviors.toolbarTrayMenuReposition={attach:function(){if(once('toolbarTrayMenuReposition','html').length)$(window).on("drupalViewportOffsetChange",function(){Drupal.behaviors.adminBar.attach();});}};Drupal.menuPrimaryMobile={show:function(context){$(".region-header-primary",context).addClass("menu--shown");$("div.menu-toggle-primary",context).load(iconPath+"cross.svg");},hide:function(context){$(".region-header-primary",context).removeClass("menu--shown");$("div.menu-toggle-primary",context).load(iconPath+"burger.svg");},click:function(context){$(once('menu-click-primary',"div.menu-toggle-primary",context)).click(function(){$(".header-wrapper").removeClass("no-transitions");if($(".region-header-primary",context).hasClass("menu--shown"))Drupal.menuPrimaryMobile.hide(context);else Drupal.menuPrimaryMobile.show(context);});},init:function(context){Drupal.menuPrimaryMobile.hide(context);}};Drupal.menuSecondaryMobile={show:function(context){$(".region-header-secondary",context).addClass("menu--shown");$(".menu-toggle-secondary",context).load(iconPath+"down.svg");},hide:function(context){$(".region-header-secondary",context).removeClass("menu--shown");$(".menu-toggle-secondary",context).load(iconPath+"up.svg");},click:function(context){$("div.menu-toggle-secondary",context).click(function(){$(".header-wrapper").removeClass("no-transitions");if($(".region-header-secondary",context).hasClass("menu--shown"))Drupal.menuSecondaryMobile.hide(context);else Drupal.menuSecondaryMobile.show(context);setTimeout(function(){$(".header-wrapper").addClass("no-transitions");},400);});},init:function(context){Drupal.menuSecondaryMobile.hide(context);}};Drupal.behaviors.menusMobile={attach:function(context){Drupal.behaviors.menusMobile.refresh(context);Drupal.menuPrimaryMobile.init(context);Drupal.menuSecondaryMobile.init(context);Drupal.menuPrimaryMobile.click(context);Drupal.menuSecondaryMobile.click(context);Drupal.behaviors.adminBar.attach();$(window).resize(function(){Drupal.behaviors.menusMobile.refresh(context);Drupal.behaviors.adminBar.attach();});},refresh:function(context){if($(window).width()<primaryNavigationTransitionWidth){$(".header-wrapper",context).addClass("on-mobile");$("header.header-primary",context).addClass("on-mobile");$("section.hero:not(.hero--subpage)",context).addClass("on-mobile");}else{$(".header-wrapper",context).removeClass("on-mobile");$("header.header-primary",context).removeClass("on-mobile");$("section.hero:not(.hero--subpage)",context).removeClass("on-mobile");}if($(window).width()<secondaryNavigationTransitionWidth){$("header.header-secondary",context).addClass("on-mobile");$("section.hero:not(.hero--subpage)",context).addClass("on-mobile");}else{$(".header-wrapper",context).removeClass("on-mobile");$("header.header-secondary",context).removeClass("on-mobile");$("section.hero:not(.hero--subpage)",context).removeClass("on-mobile");}}};Drupal.behaviors.footerOffices={attach:function(context){if($("#views-exposed-form-offices-offices-compact",context).length){var $form=$("#views-exposed-form-offices-offices-compact",context);var $select=$("select[name='field_address_locality']",$form);var $submit=$("input[type='submit']",$form);$select.change(function(){$submit.click();});if(context===document)if(once('footer-offices','html').length)$(document).ready(function(){$submit.click();});}}};Drupal.behaviors.print={attach:function(context){var $printBtns=$("input[name='print']",context);$printBtns.click(function(e){e.preventDefault();$(".print-me").removeClass("print-me");var $wrapper=$(this).parents(".paragraph");$wrapper.addClass("print-me");window.print();});}};Drupal.behaviors.infokit={attach:function(context){$(document).ready(function(){var $context=$("#block-views-block-infokit-all",context);if($context.length){var $triggers=$(".menu-item",$context);var filter=window.location.hash.slice(1);if(filter.length)Drupal.behaviors.infokit.filterElements(filter,$context);$triggers.click(function(e){e.preventDefault();var filterClicked=$(this).attr("class").split(" ").filter((i)=>i!=="menu-item").filter((i)=>i!=="active").shift();Drupal.behaviors.infokit.filterElements(filterClicked,$context);});}});},filterElements:function(filter,$context){var $triggers=$(".menu-item",$context);var $elements=$(".views-row",$context);var className="."+filter;$triggers.removeClass("active");if($triggers.filter(className).length){$triggers.filter(className).addClass("active");if(filter==="all"||filter.length===0)$elements.show();else{$elements.filter(className).show();$elements.not(className).hide();}}}};Drupal.behaviors.backButton={attach:function(context){var $context=$(".back-button",context);var pathname=window.location.pathname;if($context.length)if(pathname.length>0&&pathname.indexOf("node/")===-1){var result=pathname.split("/");result.pop();var backpath=result.join("/");$(".back-button a",context).attr("href",backpath);}else $(".back-button a",context).click(function(e){e.preventDefault();window.history.back();});}};}(jQuery,Drupal,drupalSettings));;

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.