Commit 07f998e8 authored by Simonas's avatar Simonas

Merge branch 'code-split' into dev

parents 802c35e2 3201c677
{
"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: '/'
},
......
......@@ -32,10 +32,11 @@ if ( ! defined( 'WPINC' ) ) die;
$emailValue = $_SESSION['employees--email-value'];
$emailStatus = $_SESSION['employees--email-status'];
$emailMessage = __($_SESSION['employees--email-message'], 'biuro-contacts');
/*
$agreeValue = $_SESSION['employees--agree-value'];
$agreeStatus = $_SESSION['employees--agree-status'];
$agreeMessage = __($_SESSION['employees--agree-message'], 'biuro-contacts');
*/
?>
<div class="c-form--row">
<label class="c-form--label" for="form-name"><?php _e('Name, surname', 'biuro-contacts'); ?></label>
......@@ -91,6 +92,8 @@ if ( ! defined( 'WPINC' ) ) die;
</div>
</div><!-- .c-form--row -->
<?php
/*
<div class="c-form--row">
<div class="c-form--checkbox-wrap">
<input id="form-agree" type="checkbox" class="c-form--checkbox <?php if ($agreeStatus) { echo "c-form--checkbox--$agreeStatus"; } ?>" name="agree" value="1" <?php if ($agreeValue): ?> checked="checked"<?php endif; ?> <?php if ($nameStatus != 'error' && $phoneStatus != 'error' && $agreeStatus == 'error'): ?> autofocus="autofocus" <?php endif; ?> >
......@@ -102,3 +105,12 @@ if ( ! defined( 'WPINC' ) ) die;
</div>
<?php endif; ?>
</div><!-- .c-form--row -->
*/
?>
<div class="c-form--row">
<div class="c-form--label-infobox">
<?php _e('We process your personal data to offer you jobs. More information at <a href="https://biuro.eu/privacy-en.html" target="_blank" rel="noopener">Personal Data Protection Policy.</a>', 'biuro-contacts'); ?>
<input type="hidden" name="agree" value="1">
</div>
</div><!-- .c-form--row -->
......@@ -21,8 +21,23 @@ if ( ! defined( 'WPINC' ) ) die;
?>
<div class="c-form--row">
<label class="c-form--label" for="form-city"><?php _e('City', 'biuro-contacts'); ?></label>
<div class="c-form--input-wrap">
<input type="text" class="c-form--input" id="form-city" name="city" value="" autofocus="autofocus">
<div class="c-form--input-wrap c-form--autocomplete">
<datalist id="form-cities">
<?php
$cities = get_terms( array(
'taxonomy' => 'city',
'hide_empty' => false,
) );
foreach ( $cities as $city ):
?>
<option value="<?php echo preg_replace('/\D/', '', $city->slug); ?>"><?php echo $city->name; ?></option>
<?php
endforeach;
?>
</datalist>
<input list="form-cities" type="text" class="c-form--input" id="form-city" name="city" value="">
<input type="hidden" id="form-city-id" name="city_id" value="">
</div>
</div><!-- .c-form--row -->
......
......@@ -81,6 +81,8 @@ if ( ! defined( 'WPINC' ) ) die;
</div>
</div><!-- .c-form--row -->
<?php
/*
<div class="c-form--row">
<div class="c-form--checkbox-wrap">
<input id="form-agree" type="checkbox" class="c-form--checkbox <?php if ($agreeStatus) { echo "c-form--checkbox--$agreeStatus"; } ?>" name="agree" value="1" <?php if ($agreeValue): ?> checked="checked"<?php endif; ?> <?php if ($nameStatus != 'error' && $phoneStatus != 'error' && $agreeStatus == 'error'): ?> autofocus="autofocus" <?php endif; ?> >
......@@ -92,3 +94,12 @@ if ( ! defined( 'WPINC' ) ) die;
</div>
<?php endif; ?>
</div><!-- .c-form--row -->
*/
?>
<div class="c-form--row">
<div class="c-form--label-infobox">
<?php _e('We process your personal data for service cooperation. More information at <a href="https://biuro.eu/privacy-en.html" target="_blank" rel="noopener">Personal Data Protection Policy.</a>', 'biuro-contacts'); ?>
<input type="hidden" name="agree" value="1">
</div>
</div><!-- .c-form--row -->
......@@ -35,10 +35,15 @@ if ( ! defined( 'WPINC' ) ) die;
$emailStatus = $_SESSION['position--email-status'];
$emailMessage = __($_SESSION['position--email-message'], 'biuro-contacts');
$cvValue = $_SESSION['position--cv-value'];
$cvStatus = $_SESSION['position--cv-status'];
$cvMessage = __($_SESSION['position--cv-message'], 'biuro-contacts');
/*
$agreeValue = $_SESSION['position--agree-value'];
$agreeStatus = $_SESSION['position--agree-status'];
$agreeMessage = __($_SESSION['position--agree-message'], 'biuro-contacts');
*/
$cvValue = $_SESSION['position--cv-value'];
$cityValue = $_SESSION['position--city-value'];
$cityIDValue = $_SESSION['position--city_id-value'];
......@@ -51,8 +56,8 @@ if ( ! defined( 'WPINC' ) ) die;
$nameValue = $employeeData['name'];
$phoneValue = $employeeData['phone'];
$emailValue = $employeeData['email'];
$city = $employeeData['city'];
# city reiks uzdet turbut?
$cityValue = $employeeData['city'];
$cityIDValue = $employeeData['city_id'];
}
?>
......@@ -96,11 +101,31 @@ if ( ! defined( 'WPINC' ) ) die;
<div class="c-form--row">
<label class="c-form--label" for="form-city"><?php _e('City', 'biuro-contacts'); ?></label>
<div class="c-form--input-wrap">
<input type="text" class="c-form--input" id="form-city" name="city" value="<?php echo $cityValue; ?>">
<div class="c-form--input-wrap c-form--autocomplete">
<datalist id="form-cities">
<?php
$cities = get_terms( array(
'taxonomy' => 'city',
'hide_empty' => false,
) );
foreach ( $cities as $city ):
?>
<option value="<?php echo preg_replace('/\D/', '', $city->slug); ?>"><?php echo $city->name; ?></option>
<?php
endforeach;
?>
</datalist>
<input list="form-cities" type="text" class="c-form--input" id="form-city" name="city" value="<?php echo $cityValue; ?>">
<input type="hidden" id="form-city-id" name="city_id" value="<?php echo $cityIDValue; ?>">
</div>
</div><!-- .c-form--row -->
<div class="c-form--row">
</div><!-- .c-form--row -->
<div id="agree"></div>
<div class="c-form--row">
......@@ -115,8 +140,15 @@ if ( ! defined( 'WPINC' ) ) die;
<div class="c-form--input-wrap">
<input type="file" class="c-form--input" id="form-cv" name="cv" value="" accept="application/pdf, application/doc, application/docx, application/rtf, application/txt, application/odf, application/msword, image/jpg, image/jpeg, image/png">
</div>
<?php if ($cvMessage): ?>
<div class="c-form--validation c-form--validation-<?php echo $cvStatus; ?>">
<?php echo $cvMessage; ?>
</div>
<?php endif; ?>
</div><!-- .c-form--row -->
<?php
/*
<div class="c-form--row">
<div class="c-form--checkbox-wrap">
<input id="form-agree" type="checkbox" class="c-form--checkbox <?php if ($agreeStatus) { echo "c-form--checkbox--$agreeStatus"; } ?>" name="agree" value="1" <?php if ($agreeValue): ?> checked="checked"<?php endif; ?> <?php if ($nameStatus != 'error' && $phoneStatus != 'error' && $agreeStatus == 'error'): ?> autofocus="autofocus" <?php endif; ?> >
......@@ -128,6 +160,15 @@ if ( ! defined( 'WPINC' ) ) die;
</div>
<?php endif; ?>
</div><!-- .c-form--row -->
*/
?>
<div class="c-form--row">
<div class="c-form--label-infobox">
<?php _e('We process your personal data to offer you jobs. More information at <a href="https://biuro.eu/privacy-en.html" target="_blank" rel="noopener">Personal Data Protection Policy.</a>', 'biuro-contacts'); ?>
<input type="hidden" name="agree" value="1">
</div>
</div><!-- .c-form--row -->
<div class="c-form--row">
<div class="c-form--submit-wrap">
......
......@@ -14,7 +14,7 @@
}
.awesomplete {
display: inline-block;
/*display: inline-block;*/
position: relative;
}
......
......@@ -54,6 +54,7 @@
&:after { content: ''; position: absolute; top: -2px; left: -28px; width: 20px; height: 20px; border-radius: 3px; color: var(--color--green); font-size: 22px; cursor: pointer; }
}
.c-form--label-infobox { color: #868F98; font-size: 12px; line-height: 17px; }
/* critical:end */
......@@ -89,3 +90,8 @@
.c-form--validation-success { color: #17DAB9; border-color: #17DAB9; margin-bottom: 10px; }
/*.c-form--validation-warning { color: orange; margin-bottom: 10px; }*/
.c-form--autocomplete {
ul { overflow-x: hidden; max-height: 250px; overflow-y: auto; border: 1px solid #d4d4d4; border-radius: 0 0 3px 3px; }
li { padding: 5px 10px; cursor: pointer; }
}
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-f697313b.min.js" async></script>
<?php
// global $time_start;
......
......@@ -889,3 +889,25 @@ function getDivisions($ID) {
return $wpdb->get_results($sql, ARRAY_A);
}
function getCities() {
global $wpdb;
$langs = pll_the_languages(array('raw'=>1));
$langID = $langs[pll_current_language('slug')]['id'];
$prefix = $wpdb->prefix;
$cities = get_terms( array(
'taxonomy' => 'city',
'hide_empty' => false,
) );
delog($wpdb->last_query);
delog('$terms');
debug($terms);
return [];
}
......@@ -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-b4dd038b5e.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-5e3bf9f768.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-5e3bf9f768.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-b4dd038b5e.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-5e3bf9f768.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-5e3bf9f768.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("form-city"),u=document.getElementById("form-city-id");if(o){const t=new n.a(o,{minChars:0,maxItems:1e3,sort:!1,replace:function(t){this.input.value=t.label,u&&(u.value=t.value)}});o.addEventListener("focus",()=>{t.evaluate()})}},,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 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();
});
}
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 t(t){for(var o,c,r=t[0],i=t[1],s=0,l=[];s<r.length;s++)c=r[s],n[c]&&l.push(n[c][0]),n[c]=0;for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o]);for(a&&a(t);l.length;)l.shift()()}var o={},n={2:0};function c(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.e=function(e){var t=[],o=n[e];if(0!==o)if(o)t.push(o[2]);else{var r=new Promise(function(t,c){o=n[e]=[t,c]});t.push(o[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)+"-f697313b.min.js"}(e);var a=new Error;i=function(t){s.onerror=s.onload=null,clearTimeout(l);var o=n[e];if(0!==o){if(o){var c=t&&("load"===t.type?"missing":t.type),r=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+c+": "+r+")",a.name="ChunkLoadError",a.type=c,a.request=r,o[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(t)},c.m=e,c.c=o,c.d=function(e,t,o){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},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,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(c.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)c.d(o,n,function(t){return e[t]}.bind(null,n));return o},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/",c.oe=function(e){throw console.error(e),e};var r=window.webpackJsonp=window.webpackJsonp||[],i=r.push.bind(r);r.push=t,r=r.slice();for(var s=0;s<r.length;s++)t(r[s]);var a=i;c(c.s=0)}([function(e,t,o){e.exports=o(1)},function(e,t,o){(e=>{const t=document.getElementById("cookie-warning"),o=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}}t&&o&&n&&!c&&(t.style.display="block",o.addEventListener("click",()=>{r()&&localStorage.setItem("biuro-agree","true"),t.style.display="none"}),n.addEventListener("click",()=>{t.style.display="none"}))})(window),(e=>{const t=document.getElementById("js-map--divisions");t&&fetch("/wp-json/api/v1/divisions?langID="+t.dataset.id).then(e=>e.json()).then(e=>{!function e(t,o){if(!window.google)return void setTimeout(()=>{e(t,o)},250);const c=new window.google.maps.Map(t,{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(o).forEach(e=>{const t=o[e];"city"===e.substr(0,4)&&(i=i.concat(t))});document.querySelectorAll(".js-division").forEach(e=>{e.addEventListener("click",()=>{const t=e&&e.dataset.id?e.dataset.id:"";o[t]?r(c,o[t].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))}(t,e)})})(window),(e=>{const t=document.querySelector(".c-nav--lang");t&&t.addEventListener("click",e=>{e.currentTarget.classList.toggle("c-nav--lang--is-open")})})(window),(e=>{const t=document.getElementById("js-map--regions");t&&function e(t){if(!window.google)return void setTimeout(()=>{e(t)},250);const o=new window.google.maps.Map(t,{mapTypeIds:[window.google.maps.MapTypeId.ROADMAP,window.google.maps.MapTypeId.HYBRID,"biuro"]});o.mapTypes.set("biuro",new window.google.maps.StyledMapType(n,{name:"Biuro"}));o.setMapTypeId("biuro");window.google.maps.event.addListenerOnce(o,"bounds_changed",function(){this.getZoom()>15&&this.setZoom(14)});r(o,[{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}])}(t)})(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,t,o){for(var n=new window.google.maps.LatLngBounds,r=0;r<t.length;r++){const s=t[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)})),o&&(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 t=e.parentNode;t.classList.contains("c-sections--is-open")?t.classList.toggle("c-sections--is-open"):(document.querySelectorAll(".c-sections--is-open").forEach(e=>{e.classList.remove("c-sections--is-open")}),t.classList.toggle("c-sections--is-open"))})}),document.querySelectorAll(".js-expand-jobs-section").forEach(e=>{e.addEventListener("click",t=>{t.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 t=document.querySelector('[name="name"]');t&&t.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 t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.focus(),t.select();try{var o=document.execCommand("copy")?"successful":"unsuccessful";console.log("Fallback: Copying text command was "+o)}catch(e){console.error("Fallback: Oops, unable to copy",e)}document.body.removeChild(t)}(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 t=document.querySelector(".c-form [autofocus]");t&&t.focus()}),document.querySelector(".js-copy-to-clipboard")&&document.querySelector(".js-copy-to-clipboard").addEventListener("click",e=>{e.preventDefault(),s(window.location)}),(e=>{const t=document.querySelector(".c-form [autofocus]");if(t&&t.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 t=document.querySelector('.c-form [name="name"]');t&&t.focus()}})(window),window,document.querySelectorAll(".gtm-share-click").forEach(e=>{e.addEventListener("click",t=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"shareClick",shareLabel:e.dataset.label||""})})});const a=document.getElementById("search");a&&a.addEventListener("submit",e=>{city.value||query.value||(city.focus(),e.preventDefault())},!1),(document.getElementById("search-city")||document.getElementById("search-query")||document.getElementById("form-city"))&&async function(){await o.e(0).then(o.bind(null,2))}(),document.querySelectorAll(".c-feedbacks--inner").length&&async function(){await o.e(1).then(o.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,32 @@ if (document.querySelector('.js-copy-to-clipboard')) {
});
});
})(window);
const search = document.getElementById('search');
if (search) {
search.addEventListener('submit', (e) => {
if (!city.value && !query.value) {
city.focus();
e.preventDefault();
}
}, false);
}
async function autocomplete() {
await import(/* webpackChunkName: "autocomplete" */ './components/autocomplete');
};
if (document.getElementById('search-city') || document.getElementById('search-query') || document.getElementById('form-city')) {
autocomplete();
}
async function feedbacks() {
await import(/* webpackChunkName: "feedbacks" */ './components/feedbacks');
};
if (document.querySelectorAll('.c-feedbacks--inner').length) {
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