Commit 2b1f12fd authored by Simon's avatar Simon

CV input file UI update

parent 71888aae
......@@ -49,9 +49,14 @@ if ( ! defined( 'WPINC' ) ) die;
</div><!-- .c-form--row -->
<div class="c-form--row">
<label class="c-form--label" for="form-cv"><?php _e('CV', 'biuro-contacts'); ?></label>
<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 class="c-form--input-file-wrap">
<input type="file" class="js-form--input-file c-form--input-file" 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">
<button class="c-form--input-file-btn">
<svg width="16px" height="21px" class="c-ico--attachment">
<use xlink:href="#ico--attachment"></use>
</svg>
<span class="js-form--input-file-text c-form--input-file-text"><?php _e('CV', 'biuro-contacts'); ?></span>
</button>
</div>
</div><!-- .c-form--row -->
......
......@@ -33,15 +33,6 @@ if ( ! defined( 'WPINC' ) ) die;
</div>
</div><!-- .c-form--row -->
<?php /*
<div class="c-form--row">
<label class="c-form--label" for="form-cv"><?php _e('CV', 'biuro-contacts'); ?></label>
<div class="c-form--input-wrap">
<input type="file" class="c-form--input" id="form-cv" name="cv" value="">
</div>
</div><!-- .c-form--row -->
*/ ?>
<div class="c-form--row">
<div class="c-form--submit-wrap">
<button type="submit" class="o-btn c-btn--main c-btn--fill" name="s" value="2"><?php _e('Submit', 'biuro-contacts'); ?></button>
......
......@@ -121,11 +121,6 @@ if ( ! defined( 'WPINC' ) ) die;
</div>
</div><!-- .c-form--row -->
<div class="c-form--row">
</div><!-- .c-form--row -->
<div id="agree"></div>
<div class="c-form--row">
......@@ -136,9 +131,14 @@ if ( ! defined( 'WPINC' ) ) die;
</div><!-- .c-form--row -->
<div class="c-form--row">
<label class="c-form--label" for="form-cv"><?php _e('CV', 'biuro-contacts'); ?></label>
<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 class="c-form--input-file-wrap">
<input type="file" class="js-form--input-file c-form--input-file" 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">
<button class="c-form--input-file-btn">
<svg width="16px" height="21px" class="c-ico--attachment">
<use xlink:href="#ico--attachment"></use>
</svg>
<span class="js-form--input-file-text c-form--input-file-text"><?php _e('CV', 'biuro-contacts'); ?></span>
</button>
</div>
<?php if ($cvMessage): ?>
<div class="c-form--validation c-form--validation-<?php echo $cvStatus; ?>">
......@@ -147,22 +147,6 @@ if ( ! defined( 'WPINC' ) ) die;
<?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; ?> >
<label class="c-form--label-checkbox" for="form-agree"><?php _e('I agree, that my personal data will be used for offering me a job. For more detailed information view our <a href="https://biuro.eu/privacy-en.html" target="_blank" rel="noopener">Personal Data Protection Policy.</a>', 'biuro-contacts'); ?></label>
</div>
<?php if ($agreeMessage): ?>
<div class="c-form--validation c-form--validation-<?php echo $agreeStatus; ?>">
<?php echo $agreeMessage; ?>
</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'); ?>
......
......@@ -36,14 +36,27 @@
.c-form--label { display: block; color: #2A3644; font-size: 15px; line-height: 18px; margin-bottom: 4px; font-weight: 500; }
.c-form--input-wrap { }
.c-form--input-file-wrap { position: relative; overflow: hidden; }
.c-form--input { width: 100%; padding: 10px; border: 0; background: none; border: 1px solid #d4d4d4; border-radius: 3px; font-size: 15px; font-family: inherit;
.c-form--input { width: 100%; padding: 10px; background: none; border: 1px solid #d4d4d4; border-radius: 3px; font-size: 15px; font-family: inherit;
&:focus { border-color: #d4d4d4 !important; }
}
.c-form--textarea { width: 100%; padding: 10px; border: 0; background: none; border: 1px solid #d4d4d4; border-radius: 3px; font-size: 15px; font-family: inherit;
.c-form--textarea { width: 100%; padding: 10px; background: none; border: 1px solid #d4d4d4; border-radius: 3px; font-size: 15px; font-family: inherit;
&:focus { border-color: #d4d4d4 !important; }
}
.c-form--input-file { position: absolute; left: 0; top: 0; width: 100%; height: 100%; cursor: pointer; z-index: 10; opacity: 0;
&:hover {
+ button { background: var(--color--green); color: #fff; }
}
}
.c-form--input-file-btn { width: 100%; padding: 10px 10px 6px; background-color: #F0F0F0; border: 1px solid #F0F0F0; border-radius: 3px; font-size: 15px; font-family: inherit; text-align: center; }
.c-form--input-file-text { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-form--submit-wrap { padding: 10px 0; }
.c-form--checkbox-wrap { display: flex; position: relative; }
......
......@@ -21,6 +21,8 @@
.c-ico--offer { float: left; margin: 1px 23px 0 0; }
.c-ico--easy { float: left; margin: 0 21px 0 0; }
.c-ico--attachment { margin: -2px 4px -1px 0; opacity: 0.5; }
/* critical:end */
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.
......@@ -426,6 +426,18 @@ function initDivisionsMap (node, data) {
setMarkers(map, divisions.filter((d) => { return d.lat && d.lng; }));
}
document.querySelectorAll('.js-form--input-file').forEach((node) => {
node.addEventListener('change', () => {
const parent = node.parentNode;
const name = node.value.split(/\\|\//).pop();
const text = parent.querySelector('.js-form--input-file-text');
if (text && name) {
text.innerHTML = name;
}
});
});
document.querySelectorAll('.js-toggle--services').forEach((node) => {
node.addEventListener('click', () => {
node.parentNode.classList.toggle('c-services--is-open');
......
......@@ -63,7 +63,7 @@
/******/
/******/ var hotApplyOnUpdate = true;
/******/ // eslint-disable-next-line no-unused-vars
/******/ var hotCurrentHash = "0ffa4b37063c3345d341";
/******/ var hotCurrentHash = "8a34b69ce8e37814c58c";
/******/ var hotRequestTimeout = 10000;
/******/ var hotCurrentModuleData = {};
/******/ var hotCurrentChildModule;
......@@ -995,7 +995,7 @@ eval("var logLevel = \"info\";\n\nfunction dummy() {}\n\nfunction shouldLog(leve
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vendor/awesomplete */ \"./wp-content/themes/biuro/js/vendor/awesomplete.js\");\n/* harmony import */ var _vendor_swiper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vendor/swiper */ \"./wp-content/themes/biuro/js/vendor/swiper.js\");\n/* harmony import */ var _vendor_swiper__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_vendor_swiper__WEBPACK_IMPORTED_MODULE_1__);\n// https://github.com/webpack/webpack/issues/8656#issuecomment-456001556\n// import \"core-js/es\";\n// import(/* webpackChunkName: \"autocomplete\" */ './components/autocomplete');\n// import(/* webpackChunkName: \"feedbacks\" */ './components/feedbacks');\n\n\nvar swiper = new _vendor_swiper__WEBPACK_IMPORTED_MODULE_1___default.a('.c-feedbacks--inner', {\n speed: 900,\n autoplay: {\n delay: 6000,\n disableOnInteraction: false\n },\n grabCursor: true,\n loop: true,\n pagination: {\n el: '.swiper-pagination',\n clickable: true\n }\n});\n\nvar autocomplete = function autocomplete(str) {\n var node = document.getElementById(str);\n var arrow = document.querySelector('.js-toggle--' + str);\n var clear = document.querySelector('.js-clear--' + str);\n var isOpen = false;\n\n var toggle = function toggle(status) {\n var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n setTimeout(function () {\n isOpen = status;\n }, delay);\n\n if (arrow) {\n arrow.classList.toggle('is-open', status);\n }\n };\n\n if (!node) {\n return;\n }\n\n var box = new _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node, {\n minChars: 0,\n maxItems: 1000,\n sort: false\n });\n node.addEventListener('input', function () {\n if (clear) {\n clear.classList.toggle('u-hidden', !node.value);\n }\n\n if (arrow) {\n arrow.classList.toggle('u-hidden', !!node.value);\n }\n });\n node.addEventListener('focus', function () {\n if (box.ul.childNodes.length === 0 || box.ul.hasAttribute('hidden')) {\n toggle(true);\n box.evaluate();\n } else {\n toggle(false);\n box.close();\n }\n });\n node.addEventListener('awesomplete-selectcomplete', function () {\n node.blur();\n\n if (clear) {\n clear.classList.remove('u-hidden');\n }\n\n if (arrow) {\n arrow.classList.add('u-hidden');\n }\n });\n node.addEventListener('awesomplete-close', function () {\n toggle(false, 150);\n });\n\n if (arrow) {\n arrow.addEventListener('click', function () {\n if (!isOpen) {\n node.focus();\n } else {\n box.close();\n }\n });\n }\n\n if (clear) {\n clear.addEventListener('click', function () {\n node.value = '';\n node.focus();\n\n if (clear) {\n clear.classList.add('u-hidden');\n }\n\n if (arrow) {\n arrow.classList.remove('u-hidden');\n }\n });\n }\n};\n\nautocomplete('search-city');\nautocomplete('search-query');\nvar search = document.getElementById('search');\nvar city = document.getElementById('search-city');\nvar query = document.getElementById('search-query');\n\nif (search) {\n search.addEventListener('submit', function (e) {\n if (city && !city.value && query && !query.value) {\n city.focus();\n e.preventDefault();\n }\n }, false);\n}\n\nvar node = document.getElementById('form-city');\nvar cityID = document.getElementById('form-city-id');\n\nif (node) {\n var nodeBox = new _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node, {\n minChars: 0,\n maxItems: 1000,\n sort: false,\n replace: function replace(suggestion) {\n this.input.value = suggestion.label;\n\n if (cityID) {\n cityID.value = suggestion.value;\n }\n }\n });\n node.addEventListener('focus', function () {\n nodeBox.evaluate();\n });\n}\n\nif (window.NodeList && !NodeList.prototype.forEach) {\n NodeList.prototype.forEach = Array.prototype.forEach;\n}\n\n(function (arr) {\n arr.forEach(function (item) {\n if (item.hasOwnProperty('remove')) {\n return;\n }\n\n Object.defineProperty(item, 'remove', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: function remove() {\n if (this.parentNode === null) {\n return;\n }\n\n this.parentNode.removeChild(this);\n }\n });\n });\n})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);\n\n(function (global) {\n var container = document.getElementById('cookie-warning');\n var btnAgree = document.getElementById('cookie-agree');\n var btnClose = document.getElementById('cookie-close');\n var agreed = useLS() ? localStorage.getItem('biuro-agree') : false;\n\n function useLS() {\n var mod = 'a';\n\n try {\n localStorage.setItem(mod, mod);\n localStorage.removeItem(mod);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n if (!container || !btnAgree || !btnClose || agreed) {\n return;\n }\n\n container.style.display = 'block';\n btnAgree.addEventListener('click', function () {\n if (useLS()) {\n localStorage.setItem('biuro-agree', 'true');\n }\n\n container.style.display = 'none';\n });\n btnClose.addEventListener('click', function () {\n container.style.display = 'none';\n });\n})(window);\n\nif (true) {\n module.hot.accept();\n}\n\n(function (global) {\n var node = document.getElementById('js-map--divisions');\n\n if (!node) {\n return;\n }\n\n fetch('/wp-json/api/v1/divisions?langID=' + node.dataset.id).then(function (t) {\n return t.json();\n }).then(function (data) {\n initDivisionsMap(node, data);\n });\n})(window);\n\n(function (global) {\n var node = document.querySelector('.c-nav--lang');\n\n if (!node) {\n return;\n }\n\n node.addEventListener('click', function (e) {\n e.currentTarget.classList.toggle('c-nav--lang--is-open');\n });\n})(window);\n\n(function (global) {\n var node = document.getElementById('js-map--regions');\n\n if (!node) {\n return;\n }\n\n initRegionsMap(node);\n})(window);\n\n(function (global) {\n document.querySelectorAll('.js-toggle--nav').forEach(function (node) {\n node.addEventListener('click', function (e) {\n e.preventDefault();\n document.body.classList.toggle('is-nav--open');\n });\n });\n document.querySelectorAll('.js-toggle--aside').forEach(function (node) {\n node.addEventListener('click', function (e) {\n e.preventDefault();\n document.body.classList.toggle('is-aside--open');\n });\n });\n})(window);\n\nvar mapStyles = [{\n featureType: 'all',\n elementType: 'all',\n stylers: [{\n saturation: -92\n }, {\n lightness: -8\n }, {\n hue: '#004ed4'\n }]\n}, {\n featureType: 'water',\n elementType: 'all',\n stylers: [{\n saturation: -95\n }, {\n lightness: -25\n }, {\n hue: '#004ed4'\n }]\n}];\nvar info;\n\nfunction setMarkers(map, positions, focus) {\n var bounds = new window.google.maps.LatLngBounds();\n\n for (var i = 0; i < positions.length; i++) {\n var position = positions[i];\n var pos = new window.google.maps.LatLng(position.lat, position.lng);\n var marker = new window.google.maps.Marker({\n position: pos,\n map: map,\n icon: '/wp-content/themes/biuro/i/ico--map-pin.svg',\n title: position.title || ''\n });\n\n if (info) {\n info.close();\n }\n\n bounds.extend(pos);\n\n if (position.content) {\n marker['content'] = position.content;\n window.google.maps.event.addListener(marker, 'click', function () {\n info = new window.google.maps.InfoWindow({\n content: this.content\n });\n info.open(map, this);\n });\n }\n\n if (focus) {\n if (window.innerWidth < 960) {\n window.scrollTo(0, 0);\n }\n\n new google.maps.event.trigger(marker, 'click');\n }\n }\n\n map.fitBounds(bounds);\n\n if (window.innerWidth > 1020) {\n map.panBy(250, 0);\n } else if (window.innerWidth > 959) {\n map.panBy(180, 0);\n }\n}\n\nfunction initRegionsMap(node) {\n if (!window.google) {\n setTimeout(function () {\n initRegionsMap(node);\n }, 250);\n return;\n }\n\n var options = {\n mapTypeIds: [window.google.maps.MapTypeId.ROADMAP, window.google.maps.MapTypeId.HYBRID, 'biuro']\n };\n var map = new window.google.maps.Map(node, options);\n var biuroMap = new window.google.maps.StyledMapType(mapStyles, {\n name: 'Biuro'\n });\n map.mapTypes.set('biuro', biuroMap);\n map.setMapTypeId('biuro');\n window.google.maps.event.addListenerOnce(map, 'bounds_changed', function () {\n if (this.getZoom() > 15) {\n this.setZoom(14);\n }\n });\n var regions = [{\n title: 'Vilnius',\n lat: 54.687157,\n lng: 25.279652\n }, {\n title: 'Rīga',\n lat: 56.946285,\n lng: 24.105078\n }, {\n title: 'Tallinn',\n lat: 59.436962,\n lng: 24.753574\n }];\n setMarkers(map, regions);\n}\n\nfunction initDivisionsMap(node, data) {\n if (!window.google) {\n setTimeout(function () {\n initDivisionsMap(node, data);\n }, 250);\n return;\n }\n\n var options = {\n mapTypeIds: [window.google.maps.MapTypeId.ROADMAP, window.google.maps.MapTypeId.HYBRID, 'biuro']\n };\n var map = new window.google.maps.Map(node, options);\n var biuroMap = new window.google.maps.StyledMapType(mapStyles, {\n name: 'Biuro'\n });\n map.mapTypes.set('biuro', biuroMap);\n map.setMapTypeId('biuro');\n window.google.maps.event.addListenerOnce(map, 'bounds_changed', function () {\n if (this.getZoom() > 15) {\n this.setZoom(14);\n }\n });\n var divisions = [];\n Object.keys(data).forEach(function (key) {\n var division = data[key];\n\n if (key.substr(0, 4) === 'city') {\n divisions = divisions.concat(division);\n }\n });\n document.querySelectorAll('.js-division').forEach(function (node) {\n node.addEventListener('click', function () {\n var ID = node && node.dataset.id ? node.dataset.id : '';\n\n if (data[ID]) {\n setMarkers(map, data[ID].filter(function (d) {\n return d.lat && d.lng;\n }), true);\n } else {\n setMarkers(map, divisions.filter(function (d) {\n return d.lat && d.lng;\n }));\n }\n });\n });\n setMarkers(map, divisions.filter(function (d) {\n return d.lat && d.lng;\n }));\n}\n\ndocument.querySelectorAll('.js-toggle--services').forEach(function (node) {\n node.addEventListener('click', function () {\n node.parentNode.classList.toggle('c-services--is-open');\n });\n});\ndocument.querySelectorAll('.js-toggle--sections').forEach(function (node) {\n node.addEventListener('click', function () {\n var parent = node.parentNode;\n\n if (parent.classList.contains('c-sections--is-open')) {\n parent.classList.toggle('c-sections--is-open');\n } else {\n document.querySelectorAll('.c-sections--is-open').forEach(function (node) {\n node.classList.remove('c-sections--is-open');\n });\n parent.classList.toggle('c-sections--is-open');\n }\n });\n});\ndocument.querySelectorAll('.js-expand-jobs-section').forEach(function (node) {\n node.addEventListener('click', function (e) {\n e.preventDefault();\n node.parentNode.classList.remove('c-jobs-section--is-closed');\n node.remove();\n });\n});\n\nvar initiatePositionForm = function initiatePositionForm() {\n var button = document.querySelector('[name=\"s\"][value=\"1\"]');\n\n if (button) {\n button.click();\n return;\n }\n\n var input = document.querySelector('[name=\"name\"]');\n\n if (input) {\n input.focus();\n }\n};\n\nif (document.querySelector('.js-inititate-position-form')) {\n document.querySelector('.js-inititate-position-form').addEventListener('click', initiatePositionForm);\n}\n\nif (document.querySelector('.js-focus-form')) {\n document.querySelector('.js-focus-form').addEventListener('click', function () {\n var input = document.querySelector('.c-form input:first-of-type');\n\n if (input) {\n input.focus();\n }\n });\n}\n\nif (document.querySelector('.js-modal--close')) {\n document.querySelector('.js-modal--close').addEventListener('click', function () {\n var modal = document.querySelector('.c-modal');\n\n if (modal) {\n modal.remove();\n }\n\n var node = document.querySelector('.c-form [autofocus]');\n\n if (node) {\n node.focus();\n }\n });\n}\n\nfunction fallbackCopyTextToClipboard(text) {\n var textArea = document.createElement('textarea');\n textArea.value = text;\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n\n try {\n var successful = document.execCommand('copy');\n var msg = successful ? 'successful' : 'unsuccessful';\n console.log('Fallback: Copying text command was ' + msg);\n } catch (err) {\n console.error('Fallback: Oops, unable to copy', err);\n }\n\n document.body.removeChild(textArea);\n}\n\nfunction copyTextToClipboard(text) {\n if (!navigator.clipboard) {\n fallbackCopyTextToClipboard(text);\n return;\n }\n\n navigator.clipboard.writeText(text).then(function () {}, function (err) {\n console.error('Async: Could not copy text: ', err);\n });\n}\n\nif (document.querySelector('.js-copy-to-clipboard')) {\n document.querySelector('.js-copy-to-clipboard').addEventListener('click', function (e) {\n e.preventDefault();\n copyTextToClipboard(window.location);\n });\n}\n\n(function (global) {\n var node = document.querySelector('.c-form [autofocus]');\n\n if (node) {\n node.focus();\n }\n\n if (location.hash) {\n var error = document.querySelector('.c-form--input-wrap--error input') || document.querySelector('.c-form--checkbox--error');\n\n if (error) {\n error.focus();\n return;\n }\n\n var input = document.querySelector('.c-form [name=\"name\"]');\n\n if (input) {\n input.focus();\n }\n }\n})(window);\n\n(function (global) {\n document.querySelectorAll('.gtm-share-click').forEach(function (node) {\n node.addEventListener('click', function (e) {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n 'event': 'shareClick',\n 'shareLabel': node.dataset.label || ''\n });\n });\n });\n})(window); // async function autocomplete() {\n// // await import(/* webpackChunkName: \"autocomplete\" */ './components/autocomplete');\n// const aaaa = require('./components/autocomplete').default;\n// }\n// if (document.getElementById('search-city') || document.getElementById('search-query') || document.getElementById('form-city')) {\n// autocomplete();\n// }\n// async function feedbacks() {\n// await import(/* webpackChunkName: \"feedbacks\" */ './components/feedbacks');\n// };\n// if (document.querySelectorAll('.c-feedbacks--inner').length) {\n// feedbacks();\n// }\n\n\nvar submitContactsFrom = function submitContactsFrom(form) {\n if (form.querySelector('[type=\"submit\"]')) {\n form.querySelector('[type=\"submit\"]').classList.add('c-btn--disabled');\n }\n};\n\ndocument.querySelectorAll('[name=\"form-position\"], [name=\"form-employees\"], [name=\"form-employers\"]').forEach(function (form) {\n form.addEventListener('submit', function () {\n submitContactsFrom(form);\n });\n});\n\n//# sourceURL=webpack:///./wp-content/themes/biuro/js/main.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vendor/awesomplete */ \"./wp-content/themes/biuro/js/vendor/awesomplete.js\");\n/* harmony import */ var _vendor_swiper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vendor/swiper */ \"./wp-content/themes/biuro/js/vendor/swiper.js\");\n/* harmony import */ var _vendor_swiper__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_vendor_swiper__WEBPACK_IMPORTED_MODULE_1__);\n// https://github.com/webpack/webpack/issues/8656#issuecomment-456001556\n// import \"core-js/es\";\n// import(/* webpackChunkName: \"autocomplete\" */ './components/autocomplete');\n// import(/* webpackChunkName: \"feedbacks\" */ './components/feedbacks');\n\n\nvar swiper = new _vendor_swiper__WEBPACK_IMPORTED_MODULE_1___default.a('.c-feedbacks--inner', {\n speed: 900,\n autoplay: {\n delay: 6000,\n disableOnInteraction: false\n },\n grabCursor: true,\n loop: true,\n pagination: {\n el: '.swiper-pagination',\n clickable: true\n }\n});\n\nvar autocomplete = function autocomplete(str) {\n var node = document.getElementById(str);\n var arrow = document.querySelector('.js-toggle--' + str);\n var clear = document.querySelector('.js-clear--' + str);\n var isOpen = false;\n\n var toggle = function toggle(status) {\n var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n setTimeout(function () {\n isOpen = status;\n }, delay);\n\n if (arrow) {\n arrow.classList.toggle('is-open', status);\n }\n };\n\n if (!node) {\n return;\n }\n\n var box = new _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node, {\n minChars: 0,\n maxItems: 1000,\n sort: false\n });\n node.addEventListener('input', function () {\n if (clear) {\n clear.classList.toggle('u-hidden', !node.value);\n }\n\n if (arrow) {\n arrow.classList.toggle('u-hidden', !!node.value);\n }\n });\n node.addEventListener('focus', function () {\n if (box.ul.childNodes.length === 0 || box.ul.hasAttribute('hidden')) {\n toggle(true);\n box.evaluate();\n } else {\n toggle(false);\n box.close();\n }\n });\n node.addEventListener('awesomplete-selectcomplete', function () {\n node.blur();\n\n if (clear) {\n clear.classList.remove('u-hidden');\n }\n\n if (arrow) {\n arrow.classList.add('u-hidden');\n }\n });\n node.addEventListener('awesomplete-close', function () {\n toggle(false, 150);\n });\n\n if (arrow) {\n arrow.addEventListener('click', function () {\n if (!isOpen) {\n node.focus();\n } else {\n box.close();\n }\n });\n }\n\n if (clear) {\n clear.addEventListener('click', function () {\n node.value = '';\n node.focus();\n\n if (clear) {\n clear.classList.add('u-hidden');\n }\n\n if (arrow) {\n arrow.classList.remove('u-hidden');\n }\n });\n }\n};\n\nautocomplete('search-city');\nautocomplete('search-query');\nvar search = document.getElementById('search');\nvar city = document.getElementById('search-city');\nvar query = document.getElementById('search-query');\n\nif (search) {\n search.addEventListener('submit', function (e) {\n if (city && !city.value && query && !query.value) {\n city.focus();\n e.preventDefault();\n }\n }, false);\n}\n\nvar node = document.getElementById('form-city');\nvar cityID = document.getElementById('form-city-id');\n\nif (node) {\n var nodeBox = new _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node, {\n minChars: 0,\n maxItems: 1000,\n sort: false,\n replace: function replace(suggestion) {\n this.input.value = suggestion.label;\n\n if (cityID) {\n cityID.value = suggestion.value;\n }\n }\n });\n node.addEventListener('focus', function () {\n nodeBox.evaluate();\n });\n}\n\nif (window.NodeList && !NodeList.prototype.forEach) {\n NodeList.prototype.forEach = Array.prototype.forEach;\n}\n\n(function (arr) {\n arr.forEach(function (item) {\n if (item.hasOwnProperty('remove')) {\n return;\n }\n\n Object.defineProperty(item, 'remove', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: function remove() {\n if (this.parentNode === null) {\n return;\n }\n\n this.parentNode.removeChild(this);\n }\n });\n });\n})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);\n\n(function (global) {\n var container = document.getElementById('cookie-warning');\n var btnAgree = document.getElementById('cookie-agree');\n var btnClose = document.getElementById('cookie-close');\n var agreed = useLS() ? localStorage.getItem('biuro-agree') : false;\n\n function useLS() {\n var mod = 'a';\n\n try {\n localStorage.setItem(mod, mod);\n localStorage.removeItem(mod);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n if (!container || !btnAgree || !btnClose || agreed) {\n return;\n }\n\n container.style.display = 'block';\n btnAgree.addEventListener('click', function () {\n if (useLS()) {\n localStorage.setItem('biuro-agree', 'true');\n }\n\n container.style.display = 'none';\n });\n btnClose.addEventListener('click', function () {\n container.style.display = 'none';\n });\n})(window);\n\nif (true) {\n module.hot.accept();\n}\n\n(function (global) {\n var node = document.getElementById('js-map--divisions');\n\n if (!node) {\n return;\n }\n\n fetch('/wp-json/api/v1/divisions?langID=' + node.dataset.id).then(function (t) {\n return t.json();\n }).then(function (data) {\n initDivisionsMap(node, data);\n });\n})(window);\n\n(function (global) {\n var node = document.querySelector('.c-nav--lang');\n\n if (!node) {\n return;\n }\n\n node.addEventListener('click', function (e) {\n e.currentTarget.classList.toggle('c-nav--lang--is-open');\n });\n})(window);\n\n(function (global) {\n var node = document.getElementById('js-map--regions');\n\n if (!node) {\n return;\n }\n\n initRegionsMap(node);\n})(window);\n\n(function (global) {\n document.querySelectorAll('.js-toggle--nav').forEach(function (node) {\n node.addEventListener('click', function (e) {\n e.preventDefault();\n document.body.classList.toggle('is-nav--open');\n });\n });\n document.querySelectorAll('.js-toggle--aside').forEach(function (node) {\n node.addEventListener('click', function (e) {\n e.preventDefault();\n document.body.classList.toggle('is-aside--open');\n });\n });\n})(window);\n\nvar mapStyles = [{\n featureType: 'all',\n elementType: 'all',\n stylers: [{\n saturation: -92\n }, {\n lightness: -8\n }, {\n hue: '#004ed4'\n }]\n}, {\n featureType: 'water',\n elementType: 'all',\n stylers: [{\n saturation: -95\n }, {\n lightness: -25\n }, {\n hue: '#004ed4'\n }]\n}];\nvar info;\n\nfunction setMarkers(map, positions, focus) {\n var bounds = new window.google.maps.LatLngBounds();\n\n for (var i = 0; i < positions.length; i++) {\n var position = positions[i];\n var pos = new window.google.maps.LatLng(position.lat, position.lng);\n var marker = new window.google.maps.Marker({\n position: pos,\n map: map,\n icon: '/wp-content/themes/biuro/i/ico--map-pin.svg',\n title: position.title || ''\n });\n\n if (info) {\n info.close();\n }\n\n bounds.extend(pos);\n\n if (position.content) {\n marker['content'] = position.content;\n window.google.maps.event.addListener(marker, 'click', function () {\n info = new window.google.maps.InfoWindow({\n content: this.content\n });\n info.open(map, this);\n });\n }\n\n if (focus) {\n if (window.innerWidth < 960) {\n window.scrollTo(0, 0);\n }\n\n new google.maps.event.trigger(marker, 'click');\n }\n }\n\n map.fitBounds(bounds);\n\n if (window.innerWidth > 1020) {\n map.panBy(250, 0);\n } else if (window.innerWidth > 959) {\n map.panBy(180, 0);\n }\n}\n\nfunction initRegionsMap(node) {\n if (!window.google) {\n setTimeout(function () {\n initRegionsMap(node);\n }, 250);\n return;\n }\n\n var options = {\n mapTypeIds: [window.google.maps.MapTypeId.ROADMAP, window.google.maps.MapTypeId.HYBRID, 'biuro']\n };\n var map = new window.google.maps.Map(node, options);\n var biuroMap = new window.google.maps.StyledMapType(mapStyles, {\n name: 'Biuro'\n });\n map.mapTypes.set('biuro', biuroMap);\n map.setMapTypeId('biuro');\n window.google.maps.event.addListenerOnce(map, 'bounds_changed', function () {\n if (this.getZoom() > 15) {\n this.setZoom(14);\n }\n });\n var regions = [{\n title: 'Vilnius',\n lat: 54.687157,\n lng: 25.279652\n }, {\n title: 'Rīga',\n lat: 56.946285,\n lng: 24.105078\n }, {\n title: 'Tallinn',\n lat: 59.436962,\n lng: 24.753574\n }];\n setMarkers(map, regions);\n}\n\nfunction initDivisionsMap(node, data) {\n if (!window.google) {\n setTimeout(function () {\n initDivisionsMap(node, data);\n }, 250);\n return;\n }\n\n var options = {\n mapTypeIds: [window.google.maps.MapTypeId.ROADMAP, window.google.maps.MapTypeId.HYBRID, 'biuro']\n };\n var map = new window.google.maps.Map(node, options);\n var biuroMap = new window.google.maps.StyledMapType(mapStyles, {\n name: 'Biuro'\n });\n map.mapTypes.set('biuro', biuroMap);\n map.setMapTypeId('biuro');\n window.google.maps.event.addListenerOnce(map, 'bounds_changed', function () {\n if (this.getZoom() > 15) {\n this.setZoom(14);\n }\n });\n var divisions = [];\n Object.keys(data).forEach(function (key) {\n var division = data[key];\n\n if (key.substr(0, 4) === 'city') {\n divisions = divisions.concat(division);\n }\n });\n document.querySelectorAll('.js-division').forEach(function (node) {\n node.addEventListener('click', function () {\n var ID = node && node.dataset.id ? node.dataset.id : '';\n\n if (data[ID]) {\n setMarkers(map, data[ID].filter(function (d) {\n return d.lat && d.lng;\n }), true);\n } else {\n setMarkers(map, divisions.filter(function (d) {\n return d.lat && d.lng;\n }));\n }\n });\n });\n setMarkers(map, divisions.filter(function (d) {\n return d.lat && d.lng;\n }));\n}\n\ndocument.querySelectorAll('.js-form--input-file').forEach(function (node) {\n node.addEventListener('change', function () {\n var parent = node.parentNode;\n var name = node.value.split(/\\\\|\\//).pop();\n var text = parent.querySelector('.js-form--input-file-text');\n\n if (text && name) {\n text.innerHTML = name;\n }\n });\n});\ndocument.querySelectorAll('.js-toggle--services').forEach(function (node) {\n node.addEventListener('click', function () {\n node.parentNode.classList.toggle('c-services--is-open');\n });\n});\ndocument.querySelectorAll('.js-toggle--sections').forEach(function (node) {\n node.addEventListener('click', function () {\n var parent = node.parentNode;\n\n if (parent.classList.contains('c-sections--is-open')) {\n parent.classList.toggle('c-sections--is-open');\n } else {\n document.querySelectorAll('.c-sections--is-open').forEach(function (node) {\n node.classList.remove('c-sections--is-open');\n });\n parent.classList.toggle('c-sections--is-open');\n }\n });\n});\ndocument.querySelectorAll('.js-expand-jobs-section').forEach(function (node) {\n node.addEventListener('click', function (e) {\n e.preventDefault();\n node.parentNode.classList.remove('c-jobs-section--is-closed');\n node.remove();\n });\n});\n\nvar initiatePositionForm = function initiatePositionForm() {\n var button = document.querySelector('[name=\"s\"][value=\"1\"]');\n\n if (button) {\n button.click();\n return;\n }\n\n var input = document.querySelector('[name=\"name\"]');\n\n if (input) {\n input.focus();\n }\n};\n\nif (document.querySelector('.js-inititate-position-form')) {\n document.querySelector('.js-inititate-position-form').addEventListener('click', initiatePositionForm);\n}\n\nif (document.querySelector('.js-focus-form')) {\n document.querySelector('.js-focus-form').addEventListener('click', function () {\n var input = document.querySelector('.c-form input:first-of-type');\n\n if (input) {\n input.focus();\n }\n });\n}\n\nif (document.querySelector('.js-modal--close')) {\n document.querySelector('.js-modal--close').addEventListener('click', function () {\n var modal = document.querySelector('.c-modal');\n\n if (modal) {\n modal.remove();\n }\n\n var node = document.querySelector('.c-form [autofocus]');\n\n if (node) {\n node.focus();\n }\n });\n}\n\nfunction fallbackCopyTextToClipboard(text) {\n var textArea = document.createElement('textarea');\n textArea.value = text;\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n\n try {\n var successful = document.execCommand('copy');\n var msg = successful ? 'successful' : 'unsuccessful';\n console.log('Fallback: Copying text command was ' + msg);\n } catch (err) {\n console.error('Fallback: Oops, unable to copy', err);\n }\n\n document.body.removeChild(textArea);\n}\n\nfunction copyTextToClipboard(text) {\n if (!navigator.clipboard) {\n fallbackCopyTextToClipboard(text);\n return;\n }\n\n navigator.clipboard.writeText(text).then(function () {}, function (err) {\n console.error('Async: Could not copy text: ', err);\n });\n}\n\nif (document.querySelector('.js-copy-to-clipboard')) {\n document.querySelector('.js-copy-to-clipboard').addEventListener('click', function (e) {\n e.preventDefault();\n copyTextToClipboard(window.location);\n });\n}\n\n(function (global) {\n var node = document.querySelector('.c-form [autofocus]');\n\n if (node) {\n node.focus();\n }\n\n if (location.hash) {\n var error = document.querySelector('.c-form--input-wrap--error input') || document.querySelector('.c-form--checkbox--error');\n\n if (error) {\n error.focus();\n return;\n }\n\n var input = document.querySelector('.c-form [name=\"name\"]');\n\n if (input) {\n input.focus();\n }\n }\n})(window);\n\n(function (global) {\n document.querySelectorAll('.gtm-share-click').forEach(function (node) {\n node.addEventListener('click', function (e) {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n 'event': 'shareClick',\n 'shareLabel': node.dataset.label || ''\n });\n });\n });\n})(window); // async function autocomplete() {\n// // await import(/* webpackChunkName: \"autocomplete\" */ './components/autocomplete');\n// const aaaa = require('./components/autocomplete').default;\n// }\n// if (document.getElementById('search-city') || document.getElementById('search-query') || document.getElementById('form-city')) {\n// autocomplete();\n// }\n// async function feedbacks() {\n// await import(/* webpackChunkName: \"feedbacks\" */ './components/feedbacks');\n// };\n// if (document.querySelectorAll('.c-feedbacks--inner').length) {\n// feedbacks();\n// }\n\n\nvar submitContactsFrom = function submitContactsFrom(form) {\n if (form.querySelector('[type=\"submit\"]')) {\n form.querySelector('[type=\"submit\"]').classList.add('c-btn--disabled');\n }\n};\n\ndocument.querySelectorAll('[name=\"form-position\"], [name=\"form-employees\"], [name=\"form-employers\"]').forEach(function (form) {\n form.addEventListener('submit', function () {\n submitContactsFrom(form);\n });\n});\n\n//# sourceURL=webpack:///./wp-content/themes/biuro/js/main.js?");
/***/ }),
......
......@@ -67,4 +67,7 @@
<symbol id="ico--close" viewBox="0 0 13 13">
<path fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square" d="M6.5,6.5L0.843,0.843L6.5,6.5 l-5.657,5.657L6.5,6.5z M6.5,6.5l5.657,5.657L6.5,6.5l5.657-5.657L6.5,6.5z"/>
</symbol>
<symbol id="ico--attachment" viewBox="0 0 16 21">
<path class="u-fill--inherit" d="M1.873,18.799c-1.883-2.266-1.884-5.934,0-8.201L9.18,1.808c1.45-1.744,3.808-1.744,5.258,0 c1.453,1.748,1.453,4.578,0,6.326l-6.152,7.402c-1.02,1.227-2.679,1.227-3.699,0c-1.022-1.23-1.023-3.221,0-4.451l5.21-6.269 c0.152-0.183,0.399-0.183,0.551,0l0.551,0.663c0.152,0.183,0.152,0.48,0,0.663l-5.21,6.269c-0.413,0.497-0.413,1.302,0,1.799 c0.412,0.496,1.083,0.496,1.495,0l6.152-7.402c0.844-1.015,0.844-2.659,0-3.674c-0.842-1.013-2.212-1.013-3.054,0l-7.306,8.791 c-1.274,1.533-1.275,4.015,0,5.549c1.276,1.535,3.341,1.535,4.616-0.001c1.755-2.114,4.605-5.544,6.361-7.656 c0.152-0.183,0.399-0.183,0.551,0l0.551,0.663c0.152,0.183,0.152,0.48,0,0.663c-1.756,2.113-4.605,5.543-6.36,7.656 C6.809,21.067,3.758,21.067,1.873,18.799z"/>
</symbol>
</svg>
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