290 lines
10 KiB
JavaScript
290 lines
10 KiB
JavaScript
/******/ (() => { // webpackBootstrap
|
||
/******/ var __webpack_modules__ = ({
|
||
|
||
/***/ "./resources/css/app.css":
|
||
/*!*******************************!*\
|
||
!*** ./resources/css/app.css ***!
|
||
\*******************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
// extracted by mini-css-extract-plugin
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./resources/css/editor-style.css":
|
||
/*!****************************************!*\
|
||
!*** ./resources/css/editor-style.css ***!
|
||
\****************************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
// extracted by mini-css-extract-plugin
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./resources/js/app.js":
|
||
/*!*****************************!*\
|
||
!*** ./resources/js/app.js ***!
|
||
\*****************************/
|
||
/***/ (() => {
|
||
|
||
/*
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
const header = document.getElementById('site-header');
|
||
const main = document.getElementById('main-content');
|
||
|
||
function updateMainPadding() {
|
||
const headerHeight = header.offsetHeight;
|
||
main.style.paddingTop = headerHeight + 'px';
|
||
|
||
// Показываем контент с плавной анимацией
|
||
main.classList.remove('opacity-0');
|
||
}
|
||
|
||
updateMainPadding();
|
||
window.addEventListener('resize', updateMainPadding);
|
||
});*/
|
||
|
||
// Используем делегирование событий для динамически загружаемых форм
|
||
document.addEventListener('DOMContentLoaded', function () {
|
||
// Делегирование для focus события
|
||
document.addEventListener('focus', function (e) {
|
||
if (e.target.matches('#fluentform_4 .ff-el-form-control')) {
|
||
var group = e.target.closest('.ff-el-group');
|
||
if (group) group.classList.add('focused');
|
||
}
|
||
}, true); // используем capture phase
|
||
|
||
// Делегирование для blur события
|
||
document.addEventListener('blur', function (e) {
|
||
if (e.target.matches('#fluentform_4 .ff-el-form-control')) {
|
||
var group = e.target.closest('.ff-el-group');
|
||
if (group) group.classList.remove('focused');
|
||
}
|
||
}, true);
|
||
|
||
// Делегирование для input события
|
||
document.addEventListener('input', function (e) {
|
||
// Обычные поля формы
|
||
if (e.target.matches('#fluentform_4 .ff-el-form-control')) {
|
||
var group = e.target.closest('.ff-el-group');
|
||
if (group) {
|
||
if (e.target.value.trim() !== '') {
|
||
group.classList.add('has-value');
|
||
} else {
|
||
group.classList.remove('has-value');
|
||
}
|
||
}
|
||
}
|
||
|
||
// Форматирование телефона
|
||
if (e.target.matches('#fluentform_4 .ff-el-phone')) {
|
||
formatPhoneNumber(e);
|
||
}
|
||
});
|
||
|
||
// Делегирование для keydown события (для телефона)
|
||
document.addEventListener('keydown', function (e) {
|
||
if (e.target.matches('#fluentform_4 .ff-el-phone')) {
|
||
handlePhoneKeydown(e);
|
||
}
|
||
});
|
||
|
||
// Функция форматирования телефона
|
||
function formatPhoneNumber(e) {
|
||
var value = e.target.value.replace(/\D/g, '');
|
||
|
||
// Заменяем 8 на 7
|
||
if (value.startsWith('8')) {
|
||
value = '7' + value.slice(1);
|
||
}
|
||
|
||
// Добавляем 7 если нет
|
||
if (!value.startsWith('7') && value.length > 0) {
|
||
value = '7' + value;
|
||
}
|
||
var formattedValue = '';
|
||
if (value.length > 0) {
|
||
formattedValue = '+7';
|
||
if (value.length > 1) {
|
||
formattedValue += ' (' + value.slice(1, 4);
|
||
if (value.length > 4) {
|
||
formattedValue += ') ' + value.slice(4, 7);
|
||
if (value.length > 7) {
|
||
formattedValue += '-' + value.slice(7, 9);
|
||
if (value.length > 9) {
|
||
formattedValue += '-' + value.slice(9, 11);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
e.target.value = formattedValue;
|
||
}
|
||
|
||
// Функция обработки клавиш для телефона
|
||
function handlePhoneKeydown(e) {
|
||
if (e.key === 'Backspace' || e.key === 'Delete') {
|
||
var cursorPos = e.target.selectionStart;
|
||
var value = e.target.value;
|
||
if (cursorPos > 0 && [' ', '(', ')', '-'].includes(value[cursorPos - 1])) {
|
||
setTimeout(function () {
|
||
e.target.setSelectionRange(cursorPos - 1, cursorPos - 1);
|
||
}, 0);
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
/***/ })
|
||
|
||
/******/ });
|
||
/************************************************************************/
|
||
/******/ // The module cache
|
||
/******/ var __webpack_module_cache__ = {};
|
||
/******/
|
||
/******/ // The require function
|
||
/******/ function __webpack_require__(moduleId) {
|
||
/******/ // Check if module is in cache
|
||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||
/******/ if (cachedModule !== undefined) {
|
||
/******/ return cachedModule.exports;
|
||
/******/ }
|
||
/******/ // Create a new module (and put it into the cache)
|
||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||
/******/ // no module.id needed
|
||
/******/ // no module.loaded needed
|
||
/******/ exports: {}
|
||
/******/ };
|
||
/******/
|
||
/******/ // Execute the module function
|
||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||
/******/
|
||
/******/ // Return the exports of the module
|
||
/******/ return module.exports;
|
||
/******/ }
|
||
/******/
|
||
/******/ // expose the modules object (__webpack_modules__)
|
||
/******/ __webpack_require__.m = __webpack_modules__;
|
||
/******/
|
||
/************************************************************************/
|
||
/******/ /* webpack/runtime/chunk loaded */
|
||
/******/ (() => {
|
||
/******/ var deferred = [];
|
||
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||
/******/ if(chunkIds) {
|
||
/******/ priority = priority || 0;
|
||
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||
/******/ deferred[i] = [chunkIds, fn, priority];
|
||
/******/ return;
|
||
/******/ }
|
||
/******/ var notFulfilled = Infinity;
|
||
/******/ for (var i = 0; i < deferred.length; i++) {
|
||
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||
/******/ var fulfilled = true;
|
||
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||
/******/ chunkIds.splice(j--, 1);
|
||
/******/ } else {
|
||
/******/ fulfilled = false;
|
||
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||
/******/ }
|
||
/******/ }
|
||
/******/ if(fulfilled) {
|
||
/******/ deferred.splice(i--, 1)
|
||
/******/ var r = fn();
|
||
/******/ if (r !== undefined) result = r;
|
||
/******/ }
|
||
/******/ }
|
||
/******/ return result;
|
||
/******/ };
|
||
/******/ })();
|
||
/******/
|
||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||
/******/ (() => {
|
||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||
/******/ })();
|
||
/******/
|
||
/******/ /* webpack/runtime/make namespace object */
|
||
/******/ (() => {
|
||
/******/ // define __esModule on exports
|
||
/******/ __webpack_require__.r = (exports) => {
|
||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||
/******/ }
|
||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||
/******/ };
|
||
/******/ })();
|
||
/******/
|
||
/******/ /* webpack/runtime/jsonp chunk loading */
|
||
/******/ (() => {
|
||
/******/ // no baseURI
|
||
/******/
|
||
/******/ // object to store loaded and loading chunks
|
||
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||
/******/ var installedChunks = {
|
||
/******/ "/js/app": 0,
|
||
/******/ "css/editor-style": 0,
|
||
/******/ "css/app": 0
|
||
/******/ };
|
||
/******/
|
||
/******/ // no chunk on demand loading
|
||
/******/
|
||
/******/ // no prefetching
|
||
/******/
|
||
/******/ // no preloaded
|
||
/******/
|
||
/******/ // no HMR
|
||
/******/
|
||
/******/ // no HMR manifest
|
||
/******/
|
||
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||
/******/
|
||
/******/ // install a JSONP callback for chunk loading
|
||
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||
/******/ var [chunkIds, moreModules, runtime] = data;
|
||
/******/ // add "moreModules" to the modules object,
|
||
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||
/******/ var moduleId, chunkId, i = 0;
|
||
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||
/******/ for(moduleId in moreModules) {
|
||
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||
/******/ }
|
||
/******/ }
|
||
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||
/******/ }
|
||
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||
/******/ for(;i < chunkIds.length; i++) {
|
||
/******/ chunkId = chunkIds[i];
|
||
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||
/******/ installedChunks[chunkId][0]();
|
||
/******/ }
|
||
/******/ installedChunks[chunkId] = 0;
|
||
/******/ }
|
||
/******/ return __webpack_require__.O(result);
|
||
/******/ }
|
||
/******/
|
||
/******/ var chunkLoadingGlobal = self["webpackChunktailpress"] = self["webpackChunktailpress"] || [];
|
||
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||
/******/ })();
|
||
/******/
|
||
/************************************************************************/
|
||
/******/
|
||
/******/ // startup
|
||
/******/ // Load entry module and return exports
|
||
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||
/******/ __webpack_require__.O(undefined, ["css/editor-style","css/app"], () => (__webpack_require__("./resources/js/app.js")))
|
||
/******/ __webpack_require__.O(undefined, ["css/editor-style","css/app"], () => (__webpack_require__("./resources/css/app.css")))
|
||
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["css/editor-style","css/app"], () => (__webpack_require__("./resources/css/editor-style.css")))
|
||
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||
/******/
|
||
/******/ })()
|
||
; |