Commit 5ac7e927 authored by Simon's avatar Simon

autocomplete & feedbacks split

parent ea37ee7f
{
"presets": ["@babel/preset-env"]
// "presets": ["@babel/preset-env"],
"presets": [
[
"@babel/preset-env", {
"targets": {
"node": "current"
}
}
]
],
"plugins": ["@babel/plugin-syntax-dynamic-import"]
}
This diff is collapsed.
......@@ -9,25 +9,23 @@
"private": true,
"author": "Biuro",
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.4.4",
"@babel/preset-react": "^7.0.0",
"@babel/preset-env": "^7.4.5",
"@babel/register": "^7.4.4",
"@babel/runtime": "^7.4.4",
"autoprefixer": "^9.5.1",
"@babel/runtime": "^7.4.5",
"autoprefixer": "^9.6.0",
"babel-loader": "^8.0.6",
"browser-sync": "^2.26.5",
"browser-sync": "^2.26.7",
"connect-modrewrite": "^0.10.2",
"css-mqpacker": "^7.0.0",
"cssnano": "^4.1.10",
"del": "^4.1.1",
"eslint": "^5.16.0",
"eslint-config-standard": "^12.0.0",
"eslint-config-standard-preact": "^1.1.6",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-node": "^9.0.1",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-node": "^9.1.0",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-standard": "^4.0.0",
"glob": "^7.1.4",
......@@ -42,7 +40,7 @@
"gulp-rev": "^9.0.0",
"gulp-sourcemaps": "^2.6.5",
"http2": "^3.3.7",
"postcss": "^7.0.16",
"postcss": "^7.0.17",
"postcss-browser-reporter": "^0.6.0",
"postcss-critical-split": "^2.5.3",
"postcss-custom-media": "^7.0.8",
......@@ -52,19 +50,15 @@
"postcss-preset-env": "^6.6.0",
"postcss-reporter": "^6.0.1",
"precss": "^4.0.0",
"stylelint": "^10.0.1",
"stylelint": "^10.1.0",
"stylelint-config-standard": "^18.3.0",
"webpack": "^4.31.0",
"webpack": "^4.34.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-dev-middleware": "^3.6.2",
"webpack-hot-middleware": "^2.24.4",
"webpack-dev-middleware": "^3.7.0",
"webpack-hot-middleware": "^2.25.0",
"write-file-webpack-plugin": "^4.3.2"
},
"dependencies": {
"npm": "^6.9.0",
"preact": "^8.3.1",
"preact-async-route": "^2.2.1",
"preact-router": "^2.6.1"
},
"browserslist": "last 2 versions, ie 11"
"npm": "^6.9.0"
}
}
......@@ -7,8 +7,8 @@ export default {
name: 'biuro',
isProduction: ENV === 'production',
certs: {
key: 'certs/biuro.lt/private.key',
cert: 'certs/biuro.lt/certificate.crt'
key: 'certs/private.key',
cert: 'certs/fullchain.pem'
},
proxy: 'https://dev.biuro.lt'
};
import gulp from 'gulp';
import browser from 'browser-sync';
import webpack from 'webpack';
import http2 from 'http2';
// import http2 from 'http2';
import webpackDevMiddleware from 'webpack-dev-middleware';
......
......@@ -14,14 +14,20 @@ let config = {
entry: conf.isProduction ? {
main: [
// './source/js/main'
`./wp-content/themes/${conf.name}/js/main`,
`./wp-content/themes/${conf.name}/js/main`
]
// autocomplete: `./wp-content/themes/${conf.name}/js/components/autocomplete`,
} : {
main: [
`./wp-content/themes/${conf.name}/js/main`,
'webpack/hot/dev-server',
'webpack-hot-middleware/client'
]
// autocomplete: [
// `./wp-content/themes/${conf.name}/js/components/autocomplete`,
// 'webpack/hot/dev-server',
// 'webpack-hot-middleware/client'
// ]
},
// devServer: {
......@@ -40,17 +46,18 @@ let config = {
test: /\.js?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
loader: 'babel-loader'
// options: {
// presets: ['@babel/preset-env'],
// plugins: ['@babel/plugin-syntax-dynamic-import']
// }
}
}]
},
output: {
filename: `wp-content/themes/${conf.name}/js/[name]${conf.isProduction ? '-[hash:8]' : ''}.min.js`,
chunkFilename: `wp-content/themes/${conf.name}/js/components/${conf.isProduction ? '-[hash:8]' : ''}.min.js`,
chunkFilename: `wp-content/themes/${conf.name}/js/components/[name]${conf.isProduction ? '-[hash:8]' : ''}.min.js`,
path: path.resolve(__dirname, '../'),
publicPath: '/'
},
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -38,6 +38,10 @@ qa-: Signify that a QA or Test Engineering team is running an automated UI test
/* critical:end */
/** { border: 1px solid #000; }*/
input::-webkit-calendar-picker-indicator {
display: none;
}
.tmp-contacts {
img { display: none; }
ul { padding-left: 5px }
......
......@@ -91,7 +91,7 @@
<?php
endif;
?>
<script src="/wp-content/themes/biuro/js/main-3a215a69.min.js" async></script>
<script src="/wp-content/themes/biuro/js/main-68f7bbda.min.js" async></script>
<?php
// global $time_start;
......
......@@ -31,15 +31,15 @@
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-500.woff2" crossorigin="anonymous" >
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-regular.woff2" crossorigin="anonymous" >
<style><?php include 'css/core-38a448fde0.min.css'; ?></style>
<style><?php include 'css/core-bfe6eeea3f.min.css'; ?></style>
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-300.woff2" crossorigin="anonymous" >
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-700.woff2" crossorigin="anonymous" >
<link rel="preload" href="/wp-content/themes/biuro/css/main-780377ec27.min.css" as="style" onload="this.rel='stylesheet'">
<link rel="preload" href="/wp-content/themes/biuro/css/main-39ee6ce3d1.min.css" as="style" onload="this.rel='stylesheet'">
<noscript>
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main-780377ec27.min.css">
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main-39ee6ce3d1.min.css">
</noscript>
<?php wp_head(); ?>
......
......@@ -31,15 +31,15 @@
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-500.woff2" crossorigin="anonymous" >
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-regular.woff2" crossorigin="anonymous" >
<style><?php include 'css/core-38a448fde0.min.css'; ?></style>
<style><?php include 'css/core-bfe6eeea3f.min.css'; ?></style>
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-300.woff2" crossorigin="anonymous" >
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-700.woff2" crossorigin="anonymous" >
<link rel="preload" href="/wp-content/themes/biuro/css/main-780377ec27.min.css" as="style" onload="this.rel='stylesheet'">
<link rel="preload" href="/wp-content/themes/biuro/css/main-39ee6ce3d1.min.css" as="style" onload="this.rel='stylesheet'">
<noscript>
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main-780377ec27.min.css">
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main-39ee6ce3d1.min.css">
</noscript>
<?php wp_head(); ?>
......
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[,,function(t,e,i){"use strict";i.r(e);var n=i(4);const s=document.getElementById("search-city");if(s){const t=new n.a(s,{minChars:0,maxItems:1e3,sort:!1});s.addEventListener("focus",()=>{t.evaluate()})}const r=document.getElementById("search-query");if(r){const t=new n.a(r,{minChars:0,maxItems:1e3,sort:!1});r.addEventListener("focus",()=>{t.evaluate()})}const o=document.getElementById("search");o&&o.addEventListener("submit",t=>{s.value||r.value||(s.focus(),t.preventDefault())},!1)},,function(t,e,i){"use strict";(function(t){e.a=function(){var e=function(t,i){var n=this;e.count=(e.count||0)+1,this.count=e.count,this.isOpened=!1,this.input=s(t),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("aria-owns","awesomplete_list_"+this.count),this.input.setAttribute("role","combobox"),this.options=i=i||{},function(t,e,i){for(var n in e){var s=e[n],r=t.input.getAttribute("data-"+n.toLowerCase());"number"==typeof s?t[n]=parseInt(r):!1===s?t[n]=null!==r:s instanceof Function?t[n]=null:t[n]=r,t[n]||0===t[n]||(t[n]=n in i?i[n]:s)}}(this,{minChars:2,maxItems:10,autoFirst:!1,data:e.DATA,filter:e.FILTER_CONTAINS,sort:!1!==i.sort&&e.SORT_BYLENGTH,container:e.CONTAINER,item:e.ITEM,replace:e.REPLACE,tabSelect:!1},i),this.index=-1,this.container=this.container(t),this.ul=s.create("ul",{hidden:"hidden",role:"listbox",id:"awesomplete_list_"+this.count,inside:this.container}),this.status=s.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-atomic":!0,inside:this.container,textContent:0!=this.minChars?"Type "+this.minChars+" or more characters for results.":"Begin typing for results."}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(t){var e=t.keyCode;n.opened&&(13===e&&n.selected?(t.preventDefault(),n.select()):9===e&&n.selected&&n.tabSelect?n.select():27===e?n.close({reason:"esc"}):38!==e&&40!==e||(t.preventDefault(),n[38===e?"previous":"next"]()))}},form:{submit:this.close.bind(this,{reason:"submit"})},ul:{mousedown:function(t){t.preventDefault()},click:function(t){var e=t.target;if(e!==this){for(;e&&!/li/i.test(e.nodeName);)e=e.parentNode;e&&0===t.button&&(t.preventDefault(),n.select(e,t.target))}}}},s.bind(this.input,this._events.input),s.bind(this.input.form,this._events.form),s.bind(this.ul,this._events.ul),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||i.list||[],e.all.push(this)};function i(t){var e=Array.isArray(t)?{label:t[0],value:t[1]}:"object"==typeof t&&"label"in t&&"value"in t?t:{label:t,value:t};this.label=e.label||e.value,this.value=e.value}e.prototype={set list(t){if(Array.isArray(t))this._list=t;else if("string"==typeof t&&t.indexOf(",")>-1)this._list=t.split(/\s*,\s*/);else if((t=s(t))&&t.children){var e=[];n.apply(t.children).forEach(function(t){if(!t.disabled){var i=t.textContent.trim(),n=t.value||i,s=t.label||i;""!==n&&e.push({label:s,value:n})}}),this._list=e}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return this.isOpened},close:function(t){this.opened&&(this.input.setAttribute("aria-expanded","false"),this.ul.setAttribute("hidden",""),this.isOpened=!1,this.index=-1,this.status.setAttribute("hidden",""),s.fire(this.input,"awesomplete-close",t||{}))},open:function(){this.input.setAttribute("aria-expanded","true"),this.ul.removeAttribute("hidden"),this.isOpened=!0,this.status.removeAttribute("hidden"),this.autoFirst&&-1===this.index&&this.goto(0),s.fire(this.input,"awesomplete-open")},destroy:function(){if(s.unbind(this.input,this._events.input),s.unbind(this.input.form,this._events.form),!this.options.container){var t=this.container.parentNode;t.insertBefore(this.input,this.container),t.removeChild(this.container)}this.input.removeAttribute("autocomplete"),this.input.removeAttribute("aria-autocomplete");var i=e.all.indexOf(this);-1!==i&&e.all.splice(i,1)},next:function(){var t=this.ul.children.length;this.goto(this.index<t-1?this.index+1:t?0:-1)},previous:function(){var t=this.ul.children.length,e=this.index-1;this.goto(this.selected&&-1!==e?e:t-1)},goto:function(t){var e=this.ul.children;this.selected&&e[this.index].setAttribute("aria-selected","false"),this.index=t,t>-1&&e.length>0&&(e[t].setAttribute("aria-selected","true"),this.status.textContent=e[t].textContent+", list item "+(t+1)+" of "+e.length,this.input.setAttribute("aria-activedescendant",this.ul.id+"_item_"+this.index),this.ul.scrollTop=e[t].offsetTop-this.ul.clientHeight+e[t].clientHeight,s.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(t,e){if(t?this.index=s.siblingIndex(t):t=this.ul.children[this.index],t){var i=this.suggestions[this.index];s.fire(this.input,"awesomplete-select",{text:i,origin:e||t})&&(this.replace(i),this.close({reason:"select"}),s.fire(this.input,"awesomplete-selectcomplete",{text:i}))}},evaluate:function(){var t=this,e=this.input.value;e.length>=this.minChars&&this._list&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(n){return new i(t.data(n,e))}).filter(function(i){return t.filter(i,e)}),!1!==this.sort&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.maxItems),this.suggestions.forEach(function(i,n){t.ul.appendChild(t.item(i,e,n))}),0===this.ul.children.length?(this.status.textContent="No results found",this.close({reason:"nomatches"})):(this.open(),this.status.textContent=this.ul.children.length+" results found")):(this.close({reason:"nomatches"}),this.status.textContent="No results found")}},e.all=[],e.FILTER_CONTAINS=function(t,e){return RegExp(s.regExpEscape(e.trim()),"i").test(t)},e.FILTER_STARTSWITH=function(t,e){return RegExp("^"+s.regExpEscape(e.trim()),"i").test(t)},e.SORT_BYLENGTH=function(t,e){return t.length!==e.length?t.length-e.length:t<e?-1:1},e.CONTAINER=function(t){return s.create("div",{className:"awesomplete",around:t})},e.ITEM=function(t,e,i){var n=""===e.trim()?t:t.replace(RegExp(s.regExpEscape(e.trim()),"gi"),"<mark>$&</mark>");return s.create("li",{innerHTML:n,role:"option","aria-selected":"false",id:"awesomplete_list_"+this.count+"_item_"+i})},e.REPLACE=function(t){this.input.value=t.value},e.DATA=function(t){return t},Object.defineProperty(i.prototype=Object.create(String.prototype),"length",{get:function(){return this.label.length}}),i.prototype.toString=i.prototype.valueOf=function(){return""+this.label};var n=Array.prototype.slice;function s(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function r(t,e){return n.call((e||document).querySelectorAll(t))}function o(){r("input.awesomplete").forEach(function(t){new e(t)})}return s.create=function(t,e){var i=document.createElement(t);for(var n in e){var r=e[n];if("inside"===n)s(r).appendChild(i);else if("around"===n){var o=s(r);o.parentNode.insertBefore(i,o),i.appendChild(o),null!=o.getAttribute("autofocus")&&o.focus()}else n in i?i[n]=r:i.setAttribute(n,r)}return i},s.bind=function(t,e){if(t)for(var i in e){var n=e[i];i.split(/\s+/).forEach(function(e){t.addEventListener(e,n)})}},s.unbind=function(t,e){if(t)for(var i in e){var n=e[i];i.split(/\s+/).forEach(function(e){t.removeEventListener(e,n)})}},s.fire=function(t,e,i){var n=document.createEvent("HTMLEvents");for(var s in n.initEvent(e,!0,!0),i)n[s]=i[s];return t.dispatchEvent(n)},s.regExpEscape=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},s.siblingIndex=function(t){for(var e=0;t=t.previousElementSibling;e++);return e},"undefined"!=typeof self&&(self.Awesomplete=e),"undefined"!=typeof Document&&("loading"!==document.readyState?o():document.addEventListener("DOMContentLoaded",o)),e.$=s,e.$$=r,t.exports&&(t.exports=e),e}()}).call(this,i(5)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}}]]);
\ No newline at end of file
import Awesomplete from '../vendor/awesomplete';
const city = document.getElementById('search-city');
if (city) {
const cityBox = new Awesomplete(city, {
minChars: 0,
maxItems: 1000,
sort: false
});
city.addEventListener('focus', () => {
cityBox.evaluate();
});
}
const query = document.getElementById('search-query');
if (query) {
const queryBox = new Awesomplete(query, {
minChars: 0,
maxItems: 1000,
sort: false
});
query.addEventListener('focus', () => {
queryBox.evaluate();
});
}
const search = document.getElementById('search');
if (search) {
search.addEventListener('submit', (e) => {
if (!city.value && !query.value) {
city.focus();
e.preventDefault();
}
}, false);
}
This source diff could not be displayed because it is too large. You can view the blob instead.
import Swiper from '../vendor/swiper';
const swiper = new Swiper('.c-feedbacks--inner', {
speed: 900,
autoplay: {
delay: 6000,
disableOnInteraction: false
},
grabCursor: true,
loop: true,
pagination: {
el: '.swiper-pagination',
clickable: true
}
});
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){function o(o){for(var t,c,r=o[0],i=o[1],s=0,l=[];s<r.length;s++)c=r[s],n[c]&&l.push(n[c][0]),n[c]=0;for(t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t]);for(a&&a(o);l.length;)l.shift()()}var t={},n={2:0};function c(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.e=function(e){var o=[],t=n[e];if(0!==t)if(t)o.push(t[2]);else{var r=new Promise(function(o,c){t=n[e]=[o,c]});o.push(t[2]=r);var i,s=document.createElement("script");s.charset="utf-8",s.timeout=120,c.nc&&s.setAttribute("nonce",c.nc),s.src=function(e){return c.p+"wp-content/themes/biuro/js/components/"+({0:"autocomplete",1:"feedbacks"}[e]||e)+"-68f7bbda.min.js"}(e);var a=new Error;i=function(o){s.onerror=s.onload=null,clearTimeout(l);var t=n[e];if(0!==t){if(t){var c=o&&("load"===o.type?"missing":o.type),r=o&&o.target&&o.target.src;a.message="Loading chunk "+e+" failed.\n("+c+": "+r+")",a.name="ChunkLoadError",a.type=c,a.request=r,t[1](a)}n[e]=void 0}};var l=setTimeout(function(){i({type:"timeout",target:s})},12e4);s.onerror=s.onload=i,document.head.appendChild(s)}return Promise.all(o)},c.m=e,c.c=t,c.d=function(e,o,t){c.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:t})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,o){if(1&o&&(e=c(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(c.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var n in e)c.d(t,n,function(o){return e[o]}.bind(null,n));return t},c.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(o,"a",o),o},c.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},c.p="/",c.oe=function(e){throw console.error(e),e};var r=window.webpackJsonp=window.webpackJsonp||[],i=r.push.bind(r);r.push=o,r=r.slice();for(var s=0;s<r.length;s++)o(r[s]);var a=i;c(c.s=0)}([function(e,o,t){e.exports=t(1)},function(e,o,t){(e=>{const o=document.getElementById("cookie-warning"),t=document.getElementById("cookie-agree"),n=document.getElementById("cookie-close"),c=!!r()&&localStorage.getItem("biuro-agree");function r(){try{return localStorage.setItem("a","a"),localStorage.removeItem("a"),!0}catch(e){return!1}}o&&t&&n&&!c&&(o.style.display="block",t.addEventListener("click",()=>{r()&&localStorage.setItem("biuro-agree","true"),o.style.display="none"}),n.addEventListener("click",()=>{o.style.display="none"}))})(window),(e=>{const o=document.getElementById("js-map--divisions");o&&fetch("/wp-json/api/v1/divisions?langID="+o.dataset.id).then(e=>e.json()).then(e=>{!function e(o,t){if(!window.google)return void setTimeout(()=>{e(o,t)},250);const c=new window.google.maps.Map(o,{mapTypeIds:[window.google.maps.MapTypeId.ROADMAP,window.google.maps.MapTypeId.HYBRID,"biuro"]});c.mapTypes.set("biuro",new window.google.maps.StyledMapType(n,{name:"Biuro"}));c.setMapTypeId("biuro");window.google.maps.event.addListenerOnce(c,"bounds_changed",function(){this.getZoom()>15&&this.setZoom(14)});let i=[];Object.keys(t).forEach(e=>{const o=t[e];"city"===e.substr(0,4)&&(i=i.concat(o))});document.querySelectorAll(".js-division").forEach(e=>{e.addEventListener("click",()=>{const o=e&&e.dataset.id?e.dataset.id:"";t[o]?r(c,t[o].filter(e=>e.lat&&e.lng),!0):r(c,i.filter(e=>e.lat&&e.lng))})});r(c,i.filter(e=>e.lat&&e.lng))}(o,e)})})(window),(e=>{const o=document.querySelector(".c-nav--lang");o&&o.addEventListener("click",e=>{e.currentTarget.classList.toggle("c-nav--lang--is-open")})})(window),(e=>{const o=document.getElementById("js-map--regions");o&&function e(o){if(!window.google)return void setTimeout(()=>{e(o)},250);const t=new window.google.maps.Map(o,{mapTypeIds:[window.google.maps.MapTypeId.ROADMAP,window.google.maps.MapTypeId.HYBRID,"biuro"]});t.mapTypes.set("biuro",new window.google.maps.StyledMapType(n,{name:"Biuro"}));t.setMapTypeId("biuro");window.google.maps.event.addListenerOnce(t,"bounds_changed",function(){this.getZoom()>15&&this.setZoom(14)});r(t,[{title:"Vilnius",lat:54.687157,lng:25.279652},{title:"Rīga",lat:56.946285,lng:24.105078},{title:"Tallinn",lat:59.436962,lng:24.753574}])}(o)})(window),window,document.querySelectorAll(".js-toggle--nav").forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),document.body.classList.toggle("is-nav--open")})}),document.querySelectorAll(".js-toggle--aside").forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),document.body.classList.toggle("is-aside--open")})});const n=[{featureType:"all",elementType:"all",stylers:[{saturation:-92},{lightness:-8},{hue:"#0000ff"}]},{featureType:"water",elementType:"all",stylers:[{saturation:-95},{lightness:-25},{hue:"#0000ff"}]}];var c;function r(e,o,t){for(var n=new window.google.maps.LatLngBounds,r=0;r<o.length;r++){const s=o[r],a=new window.google.maps.LatLng(s.lat,s.lng);var i=new window.google.maps.Marker({position:a,map:e,icon:"/wp-content/themes/biuro/i/ico--map-pin.svg",title:s.title||""});c&&c.close(),n.extend(a),s.content&&(i.content=s.content,window.google.maps.event.addListener(i,"click",function(){(c=new window.google.maps.InfoWindow({content:this.content})).open(e,this)})),t&&(window.innerWidth<960&&window.scrollTo(0,0),new google.maps.event.trigger(i,"click"))}e.fitBounds(n)}document.querySelectorAll(".js-toggle--services").forEach(e=>{e.addEventListener("click",()=>{e.parentNode.classList.toggle("c-services--is-open")})}),document.querySelectorAll(".js-toggle--sections").forEach(e=>{e.addEventListener("click",()=>{const o=e.parentNode;o.classList.contains("c-sections--is-open")?o.classList.toggle("c-sections--is-open"):(document.querySelectorAll(".c-sections--is-open").forEach(e=>{e.classList.remove("c-sections--is-open")}),o.classList.toggle("c-sections--is-open"))})}),document.querySelectorAll(".js-expand-jobs-section").forEach(e=>{e.addEventListener("click",o=>{o.preventDefault(),e.parentNode.classList.remove("c-jobs-section--is-closed"),e.remove()})});const i=()=>{const e=document.querySelector('[name="s"][value="1"]');if(e)return void e.click();const o=document.querySelector('[name="name"]');o&&o.focus()};function s(e){navigator.clipboard?navigator.clipboard.writeText(e).then(function(){},function(e){console.error("Async: Could not copy text: ",e)}):function(e){var o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.focus(),o.select();try{var t=document.execCommand("copy")?"successful":"unsuccessful";console.log("Fallback: Copying text command was "+t)}catch(e){console.error("Fallback: Oops, unable to copy",e)}document.body.removeChild(o)}(e)}document.querySelector(".js-inititate-position-form")&&document.querySelector(".js-inititate-position-form").addEventListener("click",i),document.querySelector(".js-focus-form")&&document.querySelector(".js-focus-form").addEventListener("click",()=>{const e=document.querySelector(".c-form input:first-of-type");e&&e.focus()}),document.querySelector(".js-modal--close")&&document.querySelector(".js-modal--close").addEventListener("click",()=>{const e=document.querySelector(".c-modal");e&&e.remove();const o=document.querySelector(".c-form [autofocus]");o&&o.focus()}),document.querySelector(".js-copy-to-clipboard")&&document.querySelector(".js-copy-to-clipboard").addEventListener("click",e=>{e.preventDefault(),s(window.location)}),(e=>{const o=document.querySelector(".c-form [autofocus]");if(o&&o.focus(),location.hash){const e=document.querySelector(".c-form--input-wrap--error input")||document.querySelector(".c-form--checkbox--error");if(e)return void e.focus();const o=document.querySelector('.c-form [name="name"]');o&&o.focus()}})(window),window,document.querySelectorAll(".gtm-share-click").forEach(e=>{e.addEventListener("click",o=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"shareClick",shareLabel:e.dataset.label||""})})}),async function(){await t.e(0).then(t.bind(null,2))}(),async function(){await t.e(1).then(t.bind(null,3))}()}]);
\ No newline at end of file
import Awesomplete from './vendor/awesomplete';
import Swiper from './vendor/swiper';
// https://github.com/webpack/webpack/issues/8656#issuecomment-456001556
// import Awesomplete from './vendor/awesomplete';
// import Swiper from './vendor/swiper';
// const swiper = new Swiper('.c-feedbacks--inner', {
// speed: 900,
// autoplay: {
// delay: 6000,
// disableOnInteraction: false
// },
// grabCursor: true,
// loop: true,
// pagination: {
// el: '.swiper-pagination',
// clickable: true
// }
// });
(global => {
const container = document.getElementById('cookie-warning');
......@@ -245,60 +261,51 @@ function initDivisionsMap (node, data) {
setMarkers(map, divisions.filter((d) => { return d.lat && d.lng; }));
}
(global => {
const city = document.getElementById('search-city');
// (global => {
// const city = document.getElementById('search-city');
if (!city) {
return;
}
// if (!city) {
// return;
// }
const cityBox = new Awesomplete(city, {
minChars: 0,
maxItems: 1000,
sort: false
});
// const cityBox = new Awesomplete(city, {
// minChars: 0,
// maxItems: 1000,
// sort: false
// });
city.addEventListener('focus', () => {
cityBox.evaluate();
});
// city.addEventListener('focus', () => {
// cityBox.evaluate();
// });
const search = document.getElementById('search');
const query = document.getElementById('search-query');
// const search = document.getElementById('search');
// const query = document.getElementById('search-query');
const queryBox = new Awesomplete(query, {
minChars: 0,
maxItems: 1000,
sort: false
});
// const queryBox = new Awesomplete(query, {
// minChars: 0,
// maxItems: 1000,
// sort: false
// });
query.addEventListener('focus', () => {
queryBox.evaluate();
});
// query.addEventListener('focus', () => {
// queryBox.evaluate();
// });
if (search) {
search.addEventListener('submit', (e) => {
if (!city.value && !query.value) {
city.focus();
e.preventDefault();
}
}, false);
}
// if (search) {
// search.addEventListener('submit', (e) => {
// if (!city.value && !query.value) {
// city.focus();
// e.preventDefault();
// }
// }, false);
// }
})(window);
// })(window);
const swiper = new Swiper('.c-feedbacks--inner', {
speed: 900,
autoplay: {
delay: 6000,
disableOnInteraction: false
},
grabCursor: true,
loop: true,
pagination: {
el: '.swiper-pagination',
clickable: true
}
});
// import(/* webpackChunkName: "autocomplete" */ './components/autocomplete').then( ( data ) => {
// // import( './components/autocomplete.js'
// console.log( data );
// } );
document.querySelectorAll('.js-toggle--services').forEach((node) => {
node.addEventListener('click', () => {
......@@ -445,3 +452,14 @@ if (document.querySelector('.js-copy-to-clipboard')) {
});
});
})(window);
async function autocomplete() {
await import(/* webpackChunkName: "autocomplete" */ './components/autocomplete');
};
autocomplete();
async function feedbacks() {
await import(/* webpackChunkName: "feedbacks" */ './components/feedbacks');
};
feedbacks();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment