Commit 4a89b7f8 authored by Simonas's avatar Simonas

release 1.12.4

parent dd32507d
{
"presets": ["@babel/preset-env"],
"presets": [
[
"@babel/preset-env", {
"targets": {
"node": "current"
}
}
]
],
// "presets": [
// [
// "@babel/preset-env", {
......
......@@ -20,9 +20,9 @@
## Production
- build CSS & JS assets - `C:\web\dev.biuro\ npm run build`
- build new image `docker build -t biuro/web:1.12.3 .` (update version number)
- build new image `docker build -t biuro/web:1.12.4 .` (update version number)
- login to biuro docker account `docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs`
- push image to docker repository - `docker push biuro/web:1.12.3`
- push image to docker repository - `docker push biuro/web:1.12.4`
## Production
- update biuro/web image version in .env file (staging or www)
......
{
"name": "biuro",
"version": "1.12.3",
"version": "1.12.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "biuro",
"version": "1.12.3",
"version": "1.12.4",
"description": "Biuro WP theme",
"scripts": {
"dev": "gulp --require @babel/register --gulpfile tasks",
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -154,7 +154,7 @@
<?php
endif;
?>
<script src="/wp-content/themes/biuro/js/main.min.js" async></script>
<script src="/wp-content/themes/biuro/js/main-2c7bb9ae.min.js" async></script>
<script src="/wp-content/themes/biuro/js/vendor/modernizr-custom.js" async></script>
......
......@@ -27,7 +27,7 @@
<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.min.css'; ?></style>
<style><?php include 'css/core-0cdb3b2c07.min.css'; ?></style>
<script>
document.documentElement.classList.replace('no-js', 'js');
......@@ -36,13 +36,13 @@
<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.min.css" as="style" onload="this.rel='stylesheet'">
<link rel="preload" href="/wp-content/themes/biuro/css/main-d24fbfd883.min.css" as="style" onload="this.rel='stylesheet'">
<link rel="preconnect" href="https://www.gstatic.com">
<link rel="preconnect" href="https://fonts.gstatic.com">
<noscript>
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main.min.css">
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main-d24fbfd883.min.css">
</noscript>
<?php wp_head(); ?>
......
......@@ -27,7 +27,7 @@
<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.min.css'; ?></style>
<style><?php include 'css/core-0cdb3b2c07.min.css'; ?></style>
<script>
document.documentElement.classList.replace('no-js', 'js');
......@@ -36,13 +36,13 @@
<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.min.css" as="style" onload="this.rel='stylesheet'">
<link rel="preload" href="/wp-content/themes/biuro/css/main-d24fbfd883.min.css" as="style" onload="this.rel='stylesheet'">
<link rel="preconnect" href="https://www.gstatic.com">
<link rel="preconnect" href="https://fonts.gstatic.com">
<noscript>
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main.min.css">
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main-d24fbfd883.min.css">
</noscript>
<?php wp_head(); ?>
......
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);
}
const node = document.getElementById('form-city');
const cityID = document.getElementById('form-city-id');
if (node) {
const nodeBox = new Awesomplete(node, {
minChars: 0,
maxItems: 1000,
sort: false,
replace: function (suggestion) {
this.input.value = suggestion.label;
if (cityID) {
cityID.value = suggestion.value;
}
}
});
node.addEventListener('focus', () => {
nodeBox.evaluate();
});
}
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{3:function(e,t,n){const s=document.getElementById("search"),a=document.getElementById("search-city"),l=document.getElementById("search-query"),u=document.getElementById("form-city"),o=document.getElementById("form-city-id"),i=document.getElementById("recommend-form-city"),c=document.getElementById("recommend-form-city-id");(s||a||l||u&&o||i&&c)&&async function(e,t,s,a,l,u,o){const{default:i}=await n.e(1).then(n.bind(null,5)),c=e=>{var t={"ą":"a","č":"c","ę":"e","ė":"e","į":"i","š":"s","ų":"u","ū":"u","ž":"z","ā":"a","ē":"e","ģ":"g","ī":"i","ķ":"k","ļ":"l","ņ":"n","õ":"o","ä":"a","ö":"o","ü":"u"};return e=(e=(e=e.trim()).toLowerCase()).replace(/[ąčęėįšųūžāēģīķļņõäöü]/g,e=>t[e])},d=e=>{const t=document.getElementById(e),n=document.querySelector(".js-toggle--"+e),s=document.querySelector(".js-clear--"+e);let a=!1;const l=(e,t,n,s)=>{const a=" "===t.id?"query":"city";fetch("/wp-json/api/v1/options?langID="+e+"&str="+n+"&type="+a).then(e=>e.json()).then(e=>{if(!e||!e.length)return;const n=e.map(e=>({label:e.name+" ("+e.total+")",value:e.name}));t.box.list=n,s?(t.box.evaluate(),t.box.close()):(t.focus(),t.box.evaluate())})},u=e=>{const t="search-city"===e.id?document.getElementById("search-query"):document.getElementById("search-city");!t||t.value&&e.value||(!t.value&&e.value?l(e.dataset.id,t,e.value,!0):e.value||(l(e.dataset.id,e,t.value),t.value||l(e.dataset.id,t,t.value,!0)))},o=(e,t=0)=>{setTimeout(()=>{a=e},t),n&&n.classList.toggle("is-open",e)};if(!t)return;const d=new i(t,{minChars:0,maxItems:1e3,sort:!1,filter:function(e,t){return-1!==c(e).indexOf(c(t))}});t.addEventListener("input",()=>{s&&s.classList.toggle("u-hidden",!t.value),n&&n.classList.toggle("u-hidden",!!t.value)}),t.addEventListener("focus",()=>{0===d.ul.childNodes.length||d.ul.hasAttribute("hidden")?(o(!0),d.evaluate()):(o(!1),d.close())}),t.addEventListener("blur",()=>{const e=Array.isArray(d.suggestions)&&1===d.suggestions.length?d.suggestions[0]:null;e&&c(t.value)===c(e.value)&&(t.value=e.value)}),t.addEventListener("awesomplete-selectcomplete",()=>{t.blur(),u(t),s&&s.classList.remove("u-hidden"),n&&n.classList.add("u-hidden")}),t.addEventListener("awesomplete-close",()=>{o(!1,150)}),n&&n.addEventListener("click",()=>{a?d.close():t.focus()}),s&&s.addEventListener("click",()=>{t.value="",u(t),s&&s.classList.add("u-hidden"),n&&n.classList.remove("u-hidden")}),t.box=d};t&&d("search-city"),s&&d("search-query"),e&&e.addEventListener("submit",e=>{t&&!t.value&&s&&!s.value&&(t.focus(),e.preventDefault())},!1);const r=(e,t)=>{if(!e||!t)return;const n=new i(e,{minChars:0,maxItems:1e3,sort:!1,filter:function(e,t){return-1!==c(e).indexOf(c(t))},replace:function(e){this.input.value=e.label,t&&(t.value=e.value)}});e.addEventListener("focus",()=>{n.evaluate()}),e.addEventListener("blur",()=>{const s=Array.isArray(n.suggestions)&&1===n.suggestions.length?n.suggestions[0]:null;s&&c(e.value)===c(s.label)&&(e.value=s.label,t&&(t.value=s.value))})};r(a,l),r(u,o)}(s,a,l,u,o,i,c)}}]);
\ No newline at end of file
const search = document.getElementById('search');
const city = document.getElementById('search-city');
const query = document.getElementById('search-query');
const formCity = document.getElementById('form-city');
const formCityID = document.getElementById('form-city-id');
const recommendCity = document.getElementById('recommend-form-city');
const recommendCityID = document.getElementById('recommend-form-city-id');
async function inititateAutocomplete (search, city, query, formCity, formCityID, recommendCity, recommendCityID) {
const { default: Awesomplete } = await import(/* webpackChunkName: "autocomplete/vendor/awesomplete" */ './vendor/awesomplete');
const lisp = (str) => {
var symbols = { 'ą': 'a', 'č': 'c', 'ę': 'e', 'ė': 'e', 'į': 'i', 'š': 's', 'ų': 'u', 'ū': 'u', 'ž': 'z', 'ā': 'a', 'ē': 'e', 'ģ': 'g', 'ī': 'i', 'ķ': 'k', 'ļ': 'l', 'ņ': 'n', 'õ': 'o', 'ä': 'a', 'ö': 'o', 'ü': 'u'};
str = str.trim();
str = str.toLowerCase();
str = str.replace(/[ąčęėįšųūžāēģīķļņõäöü]/g, (s) => {
return symbols[s];
});
return str;
};
const autocomplete = (str) => {
const node = document.getElementById(str);
const arrow = document.querySelector('.js-toggle--' + str);
const clear = document.querySelector('.js-clear--' + str);
let isOpen = false;
const update = (langID, target, str, hidden) => {
const type = (target.id === ' ') ? 'query' : 'city';
fetch('/wp-json/api/v1/options?langID=' + langID + '&str=' + str + '&type=' + type)
.then((t) => t.json())
.then((data) => {
if (!data || !data.length) {
return;
}
const list = data.map((option) => {
return { label: option.name + ' (' + option.total + ')', value: option.name };
});
target.box.list = list;
if (hidden) {
target.box.evaluate();
target.box.close();
} else {
target.focus();
target.box.evaluate();
}
});
};
const updateOptions = (node) => {
const target = (node.id === 'search-city') ? document.getElementById('search-query') : document.getElementById('search-city');
if (!target || (target.value && node.value)) {
return;
}
if (!target.value && node.value) {
update(node.dataset.id, target, node.value, true);
} else if (!node.value) {
update(node.dataset.id, node, target.value);
if (!target.value) {
update(node.dataset.id, target, target.value, true);
}
}
};
const toggle = (status, delay = 0) => {
setTimeout(() => {
isOpen = status;
}, delay);
if (arrow) {
arrow.classList.toggle('is-open', status);
}
};
if (!node) {
return;
}
const box = new Awesomplete(node, {
minChars: 0,
maxItems: 1000,
sort: false,
filter: function (text, input) {
return lisp(text).indexOf(lisp(input)) !== -1;
}
});
node.addEventListener('input', () => {
if (clear) {
clear.classList.toggle('u-hidden', !node.value);
}
if (arrow) {
arrow.classList.toggle('u-hidden', !!node.value);
}
});
node.addEventListener('focus', () => {
if (box.ul.childNodes.length === 0 || box.ul.hasAttribute('hidden')) {
toggle(true);
box.evaluate();
} else {
toggle(false);
box.close();
}
});
node.addEventListener('blur', () => {
const suggestion = (Array.isArray(box.suggestions) && box.suggestions.length === 1) ? box.suggestions[0] : null;
if (!suggestion) {
return;
}
if (lisp(node.value) === lisp(suggestion.value)) {
node.value = suggestion.value;
}
});
node.addEventListener('awesomplete-selectcomplete', () => {
node.blur();
updateOptions(node);
if (clear) {
clear.classList.remove('u-hidden');
}
if (arrow) {
arrow.classList.add('u-hidden');
}
});
node.addEventListener('awesomplete-close', () => {
toggle(false, 150);
});
if (arrow) {
arrow.addEventListener('click', () => {
if (!isOpen) {
node.focus();
} else {
box.close();
}
});
}
if (clear) {
clear.addEventListener('click', () => {
node.value = '';
updateOptions(node);
if (clear) {
clear.classList.add('u-hidden');
}
if (arrow) {
arrow.classList.remove('u-hidden');
}
});
}
node.box = box;
};
if (city) {
autocomplete('search-city');
}
if (query) {
autocomplete('search-query');
}
if (search) {
search.addEventListener('submit', (e) => {
if (city && !city.value && query && !query.value) {
city.focus();
e.preventDefault();
}
}, false);
}
const setCityAwesomplete = (node, cityID) => {
if (!node || !cityID) {
return;
}
const nodeBox = new Awesomplete(node, {
minChars: 0,
maxItems: 1000,
sort: false,
filter: function (text, input) {
return lisp(text).indexOf(lisp(input)) !== -1;
},
replace: function (suggestion) {
this.input.value = suggestion.label;
if (cityID) {
cityID.value = suggestion.value;
}
}
});
node.addEventListener('focus', () => {
nodeBox.evaluate();
});
node.addEventListener('blur', () => {
const suggestion = (Array.isArray(nodeBox.suggestions) && nodeBox.suggestions.length === 1) ? nodeBox.suggestions[0] : null;
if (!suggestion) {
return;
}
if (lisp(node.value) === lisp(suggestion.label)) {
node.value = suggestion.label;
if (cityID) {
cityID.value = suggestion.value;
}
}
});
};
setCityAwesomplete(formCity, formCityID);
setCityAwesomplete(recommendCity, recommendCityID);
}
if (search || city || query || (formCity && formCityID) || (recommendCity && recommendCityID)) {
inititateAutocomplete(search, city, query, formCity, formCityID, recommendCity, recommendCityID);
}
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{5:function(t,e,i){"use strict";i.r(e),function(t){e.default=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());t[n]="number"==typeof s?parseInt(r):!1===s?null!==r:s instanceof Function?null: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(6)(t))},6: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
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{2:function(e,n,o){document.querySelector(".c-feedbacks--inner")&&async function(e){const{default:n}=await o.e(3).then(o.t.bind(null,4,7));new n(e,{effect:"coverflow",grabCursor:!1,centeredSlides:!0,slidesPerView:"auto",slideToClickedSlide:!0,coverflowEffect:{rotate:0,stretch:0,depth:300,modifier:1,slideShadows:!1},speed:900,autoplay:{delay:6e3,disableOnInteraction:!1},loop:!0})}(".c-feedbacks--inner")}}]);
\ No newline at end of file
const selector = '.c-feedbacks--inner';
async function inititateFeedbacks (selector) {
const { default: Swiper } = await import(/* webpackChunkName: "feedback/vendor/swiper" */ './vendor/swiper');
return new Swiper(selector, {
effect: 'coverflow',
grabCursor: false,
centeredSlides: true,
slidesPerView: 'auto',
slideToClickedSlide: true,
coverflowEffect: {
rotate: 0,
stretch: 0,
depth: 300,
modifier: 1,
slideShadows: false
},
speed: 900,
autoplay: {
delay: 6000,
disableOnInteraction: false
},
loop: true
});
}
if (document.querySelector(selector)) {
inititateFeedbacks(selector);
}
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 diff is collapsed.
......@@ -2,285 +2,8 @@
// import "core-js/es";
// import(/* webpackChunkName: "autocomplete" */ './components/autocomplete');
// import(/* webpackChunkName: "feedbacks" */ './components/feedbacks');
import Awesomplete from './vendor/awesomplete';
import Swiper from './vendor/swiper';
const swiper = new Swiper('.c-feedbacks--inner', {
effect: 'coverflow',
grabCursor: false,
centeredSlides: true,
slidesPerView: 'auto',
slideToClickedSlide: true,
coverflowEffect: {
rotate: 0,
stretch: 0,
depth: 300,
modifier: 1,
slideShadows: false
},
speed: 900,
autoplay: {
delay: 6000,
disableOnInteraction: false
},
// grabCursor: true,
loop: true,
// pagination: {
// el: '.swiper-pagination',
// clickable: true
// }
});
const lisp = (str) => {
var symbols = {
'ą': 'a',
'č': 'c',
'ę': 'e',
'ė': 'e',
'į': 'i',
'š': 's',
'ų': 'u',
'ū': 'u',
'ž': 'z',
'ā': 'a',
'ē': 'e',
'ģ': 'g',
'ī': 'i',
'ķ': 'k',
'ļ': 'l',
'ņ': 'n',
'õ': 'o',
'ä': 'a',
'ö': 'o',
'ü': 'u'
};
str = str.trim();
str = str.toLowerCase();
str = str.replace(/[ąčęėįšųūžāēģīķļņõäöü]/g, (s) => {
return symbols[s];
});
return str;
};
const autocomplete = (str) => {
const node = document.getElementById(str);
const arrow = document.querySelector('.js-toggle--' + str);
const clear = document.querySelector('.js-clear--' + str);
let isOpen = false;
const update = (langID, target, str, hidden) => {
const type = (target.id === 'search-city') ? 'query' : 'city';
fetch('/wp-json/api/v1/options?langID=' + langID + '&str=' + str + '&type=' + type)
.then((t) => t.json())
.then((data) => {
if (!data || !data.length) {
return;
}
const list = data.map((option) => {
return { label: option.name + ' (' + option.total + ')', value: option.name };
});
target.box.list = list;
if (hidden) {
target.box.evaluate();
target.box.close();
} else {
target.focus();
target.box.evaluate();
}
});
};
const updateOptions = (node) => {
const target = (node.id === 'search-city') ? document.getElementById('search-query') : document.getElementById('search-city');
if (!target || (target.value && node.value)) {
return;
}
if (!target.value && node.value) {
update(node.dataset.id, target, node.value, true);
} else if (!node.value) {
update(node.dataset.id, node, target.value);
if (!target.value) {
update(node.dataset.id, target, target.value, true);
}
}
};
const toggle = (status, delay = 0) => {
setTimeout(() => {
isOpen = status;
}, delay);
if (arrow) {
arrow.classList.toggle('is-open', status);
}
};
if (!node) {
return;
}
const box = new Awesomplete(node, {
minChars: 0,
maxItems: 1000,
sort: false,
filter: function (text, input) {
return lisp(text).indexOf(lisp(input)) !== -1;
}
});
node.addEventListener('input', () => {
if (clear) {
clear.classList.toggle('u-hidden', !node.value);
}
if (arrow) {
arrow.classList.toggle('u-hidden', !!node.value);
}
});
node.addEventListener('focus', () => {
if (box.ul.childNodes.length === 0 || box.ul.hasAttribute('hidden')) {
toggle(true);
box.evaluate();
} else {
toggle(false);
box.close();
}
});
node.addEventListener('blur', () => {
const suggestion = (Array.isArray(box.suggestions) && box.suggestions.length === 1) ? box.suggestions[0] : null;
if (!suggestion) {
return;
}
if (lisp(node.value) === lisp(suggestion.value)) {
node.value = suggestion.value;
}
});
node.addEventListener('awesomplete-selectcomplete', () => {
node.blur();
updateOptions(node);
if (clear) {
clear.classList.remove('u-hidden');
}
if (arrow) {
arrow.classList.add('u-hidden');
}
});
node.addEventListener('awesomplete-close', () => {
toggle(false, 150);
});
if (arrow) {
arrow.addEventListener('click', () => {
if (!isOpen) {
node.focus();
} else {
box.close();
}
});
}
if (clear) {
clear.addEventListener('click', () => {
node.value = '';
updateOptions(node);
if (clear) {
clear.classList.add('u-hidden');
}
if (arrow) {
arrow.classList.remove('u-hidden');
}
});
}
node.box = box;
};
autocomplete('search-city');
autocomplete('search-query');
const search = document.getElementById('search');
const city = document.getElementById('search-city');
const query = document.getElementById('search-query');
if (search) {
search.addEventListener('submit', (e) => {
if (city && !city.value && query && !query.value) {
city.focus();
e.preventDefault();
}
}, false);
}
const setCityAwesomplete = (node, cityID) => {
if (!node || !cityID) {
return;
}
const nodeBox = new Awesomplete(node, {
minChars: 0,
maxItems: 1000,
sort: false,
filter: function (text, input) {
return lisp(text).indexOf(lisp(input)) !== -1;
},
replace: function (suggestion) {
this.input.value = suggestion.label;
if (cityID) {
cityID.value = suggestion.value;
}
}
});
node.addEventListener('focus', () => {
nodeBox.evaluate();
});
node.addEventListener('blur', () => {
const suggestion = (Array.isArray(nodeBox.suggestions) && nodeBox.suggestions.length === 1) ? nodeBox.suggestions[0] : null;
if (!suggestion) {
return;
}
if (lisp(node.value) === lisp(suggestion.label)) {
node.value = suggestion.label;
if (cityID) {
cityID.value = suggestion.value;
}
}
});
};
setCityAwesomplete(document.getElementById('form-city'), document.getElementById('form-city-id'));
setCityAwesomplete(document.getElementById('recommend-form-city'), document.getElementById('recommend-form-city-id'));
import(/* webpackChunkName: "feedback/feedback" */ './components/feedback/feedback');
import(/* webpackChunkName: "autocomplete/autocomplete" */ './components/autocomplete/autocomplete');
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = Array.prototype.forEach;
......
This diff is collapsed.
......@@ -3,6 +3,6 @@ Theme Name: Biuro
Author: Biuro
Author URI: https://www.biuro.lt/
Description: Biuro multiregion theme
Version: 1.12.3
Version: 1.12.4
Text Domain: biuro
*/
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