diff --git a/assets/css/admin-main.css b/assets/css/admin-main.css index 04ec8266d..7742d7260 100644 --- a/assets/css/admin-main.css +++ b/assets/css/admin-main.css @@ -10471,8 +10471,11 @@ body.stop-scrolling { width: 100%; top: 0; left: 0; + z-index: 10; + pointer-events: none; } .plupload-thumbs .atbdp-thumb-actions .thumbremovelink { + pointer-events: auto; position: absolute; top: 10px; right: 10px; @@ -10541,6 +10544,84 @@ body.stop-scrolling { z-index: 1; } +.plupload-thumbs .thumb .atbdp-file-wrapper { + -webkit-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + height: 100%; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + padding: 20px; + background: var(--directorist-color-bg-gray, #f8f9fa); + border-radius: 12px; + cursor: move; + position: relative; + -webkit-transition: background-color 0.3s ease; + transition: background-color 0.3s ease; + z-index: 1; + pointer-events: auto; +} +.plupload-thumbs .thumb .atbdp-file-wrapper:hover { + background: var(--directorist-color-border-gray, #e9ecef); +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-icon { + width: 64px; + height: 64px; + margin-bottom: 12px; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-icon::after { + width: 64px; + height: 64px; + background-color: var(--directorist-color-primary, #2563eb); + opacity: 0.15; + border-radius: 8px; +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-name { + font-size: 12px; + font-weight: 500; + color: var(--directorist-color-body, #374151); + text-align: center; + word-break: break-word; + line-height: 1.4; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + margin-top: 4px; +} + .plupload-thumbs .thumb .thumbi { position: absolute; right: -10px; diff --git a/assets/css/admin-main.rtl.css b/assets/css/admin-main.rtl.css index 67ce97258..16734f389 100644 --- a/assets/css/admin-main.rtl.css +++ b/assets/css/admin-main.rtl.css @@ -10471,8 +10471,11 @@ body.stop-scrolling { width: 100%; top: 0; right: 0; + z-index: 10; + pointer-events: none; } .plupload-thumbs .atbdp-thumb-actions .thumbremovelink { + pointer-events: auto; position: absolute; top: 10px; left: 10px; @@ -10541,6 +10544,84 @@ body.stop-scrolling { z-index: 1; } +.plupload-thumbs .thumb .atbdp-file-wrapper { + -webkit-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + height: 100%; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + padding: 20px; + background: var(--directorist-color-bg-gray, #f8f9fa); + border-radius: 12px; + cursor: move; + position: relative; + -webkit-transition: background-color 0.3s ease; + transition: background-color 0.3s ease; + z-index: 1; + pointer-events: auto; +} +.plupload-thumbs .thumb .atbdp-file-wrapper:hover { + background: var(--directorist-color-border-gray, #e9ecef); +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-icon { + width: 64px; + height: 64px; + margin-bottom: 12px; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-icon::after { + width: 64px; + height: 64px; + background-color: var(--directorist-color-primary, #2563eb); + opacity: 0.15; + border-radius: 8px; +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-name { + font-size: 12px; + font-weight: 500; + color: var(--directorist-color-body, #374151); + text-align: center; + word-break: break-word; + line-height: 1.4; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + margin-top: 4px; +} + .plupload-thumbs .thumb .thumbi { position: absolute; left: -10px; diff --git a/assets/css/all-listings.css b/assets/css/all-listings.css index 7c2e36a6c..afd5a19f6 100644 --- a/assets/css/all-listings.css +++ b/assets/css/all-listings.css @@ -5320,8 +5320,11 @@ body.stop-scrolling { width: 100%; top: 0; left: 0; + z-index: 10; + pointer-events: none; } .plupload-thumbs .atbdp-thumb-actions .thumbremovelink { + pointer-events: auto; position: absolute; top: 10px; right: 10px; @@ -5390,6 +5393,84 @@ body.stop-scrolling { z-index: 1; } +.plupload-thumbs .thumb .atbdp-file-wrapper { + -webkit-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + height: 100%; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + padding: 20px; + background: var(--directorist-color-bg-gray, #f8f9fa); + border-radius: 12px; + cursor: move; + position: relative; + -webkit-transition: background-color 0.3s ease; + transition: background-color 0.3s ease; + z-index: 1; + pointer-events: auto; +} +.plupload-thumbs .thumb .atbdp-file-wrapper:hover { + background: var(--directorist-color-border-gray, #e9ecef); +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-icon { + width: 64px; + height: 64px; + margin-bottom: 12px; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-icon::after { + width: 64px; + height: 64px; + background-color: var(--directorist-color-primary, #2563eb); + opacity: 0.15; + border-radius: 8px; +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-name { + font-size: 12px; + font-weight: 500; + color: var(--directorist-color-body, #374151); + text-align: center; + word-break: break-word; + line-height: 1.4; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + margin-top: 4px; +} + .plupload-thumbs .thumb .thumbi { position: absolute; right: -10px; diff --git a/assets/css/all-listings.rtl.css b/assets/css/all-listings.rtl.css index c06beb02e..4d3b77b9c 100644 --- a/assets/css/all-listings.rtl.css +++ b/assets/css/all-listings.rtl.css @@ -5320,8 +5320,11 @@ body.stop-scrolling { width: 100%; top: 0; right: 0; + z-index: 10; + pointer-events: none; } .plupload-thumbs .atbdp-thumb-actions .thumbremovelink { + pointer-events: auto; position: absolute; top: 10px; left: 10px; @@ -5390,6 +5393,84 @@ body.stop-scrolling { z-index: 1; } +.plupload-thumbs .thumb .atbdp-file-wrapper { + -webkit-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + height: 100%; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + padding: 20px; + background: var(--directorist-color-bg-gray, #f8f9fa); + border-radius: 12px; + cursor: move; + position: relative; + -webkit-transition: background-color 0.3s ease; + transition: background-color 0.3s ease; + z-index: 1; + pointer-events: auto; +} +.plupload-thumbs .thumb .atbdp-file-wrapper:hover { + background: var(--directorist-color-border-gray, #e9ecef); +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-icon { + width: 64px; + height: 64px; + margin-bottom: 12px; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-icon::after { + width: 64px; + height: 64px; + background-color: var(--directorist-color-primary, #2563eb); + opacity: 0.15; + border-radius: 8px; +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-name { + font-size: 12px; + font-weight: 500; + color: var(--directorist-color-body, #374151); + text-align: center; + word-break: break-word; + line-height: 1.4; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + margin-top: 4px; +} + .plupload-thumbs .thumb .thumbi { position: absolute; left: -10px; diff --git a/assets/css/public-main.css b/assets/css/public-main.css index 4efede260..b3ed57eb0 100644 --- a/assets/css/public-main.css +++ b/assets/css/public-main.css @@ -5320,8 +5320,11 @@ body.stop-scrolling { width: 100%; top: 0; left: 0; + z-index: 10; + pointer-events: none; } .plupload-thumbs .atbdp-thumb-actions .thumbremovelink { + pointer-events: auto; position: absolute; top: 10px; right: 10px; @@ -5390,6 +5393,84 @@ body.stop-scrolling { z-index: 1; } +.plupload-thumbs .thumb .atbdp-file-wrapper { + -webkit-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + height: 100%; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + padding: 20px; + background: var(--directorist-color-bg-gray, #f8f9fa); + border-radius: 12px; + cursor: move; + position: relative; + -webkit-transition: background-color 0.3s ease; + transition: background-color 0.3s ease; + z-index: 1; + pointer-events: auto; +} +.plupload-thumbs .thumb .atbdp-file-wrapper:hover { + background: var(--directorist-color-border-gray, #e9ecef); +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-icon { + width: 64px; + height: 64px; + margin-bottom: 12px; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-icon::after { + width: 64px; + height: 64px; + background-color: var(--directorist-color-primary, #2563eb); + opacity: 0.15; + border-radius: 8px; +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-name { + font-size: 12px; + font-weight: 500; + color: var(--directorist-color-body, #374151); + text-align: center; + word-break: break-word; + line-height: 1.4; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + margin-top: 4px; +} + .plupload-thumbs .thumb .thumbi { position: absolute; right: -10px; diff --git a/assets/css/public-main.rtl.css b/assets/css/public-main.rtl.css index c06beb02e..4d3b77b9c 100644 --- a/assets/css/public-main.rtl.css +++ b/assets/css/public-main.rtl.css @@ -5320,8 +5320,11 @@ body.stop-scrolling { width: 100%; top: 0; right: 0; + z-index: 10; + pointer-events: none; } .plupload-thumbs .atbdp-thumb-actions .thumbremovelink { + pointer-events: auto; position: absolute; top: 10px; left: 10px; @@ -5390,6 +5393,84 @@ body.stop-scrolling { z-index: 1; } +.plupload-thumbs .thumb .atbdp-file-wrapper { + -webkit-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + height: 100%; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + padding: 20px; + background: var(--directorist-color-bg-gray, #f8f9fa); + border-radius: 12px; + cursor: move; + position: relative; + -webkit-transition: background-color 0.3s ease; + transition: background-color 0.3s ease; + z-index: 1; + pointer-events: auto; +} +.plupload-thumbs .thumb .atbdp-file-wrapper:hover { + background: var(--directorist-color-border-gray, #e9ecef); +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-icon { + width: 64px; + height: 64px; + margin-bottom: 12px; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-icon::after { + width: 64px; + height: 64px; + background-color: var(--directorist-color-primary, #2563eb); + opacity: 0.15; + border-radius: 8px; +} +.plupload-thumbs .thumb .atbdp-file-wrapper .atbdp-file-name { + font-size: 12px; + font-weight: 500; + color: var(--directorist-color-body, #374151); + text-align: center; + word-break: break-word; + line-height: 1.4; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + margin-top: 4px; +} + .plupload-thumbs .thumb .thumbi { position: absolute; left: -10px; diff --git a/assets/js/account.js b/assets/js/account.js index 272bc89b7..6ee162daa 100644 --- a/assets/js/account.js +++ b/assets/js/account.js @@ -315,12 +315,6 @@ jQuery(function ($) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/add-listing-google-map.js b/assets/js/add-listing-google-map.js index 470ca6464..702df3318 100644 --- a/assets/js/add-listing-google-map.js +++ b/assets/js/add-listing-google-map.js @@ -73,12 +73,6 @@ function convertToSelect2(selector) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/add-listing-openstreet-map.js b/assets/js/add-listing-openstreet-map.js index 9981c91df..ba4bd857f 100644 --- a/assets/js/add-listing-openstreet-map.js +++ b/assets/js/add-listing-openstreet-map.js @@ -101,12 +101,6 @@ function convertToSelect2(selector) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/add-listing.js b/assets/js/add-listing.js index 6f30726d9..9c6ae21ab 100644 --- a/assets/js/add-listing.js +++ b/assets/js/add-listing.js @@ -1094,12 +1094,6 @@ function _unsupportedIterableToArray(r, a) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/admin-builder-archive.js b/assets/js/admin-builder-archive.js index 8442fae1e..1c91c0555 100644 --- a/assets/js/admin-builder-archive.js +++ b/assets/js/admin-builder-archive.js @@ -2257,12 +2257,6 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"axios","version":"0.21.4","de /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/admin-import-export.js b/assets/js/admin-import-export.js index e64f0242c..57c485b28 100644 --- a/assets/js/admin-import-export.js +++ b/assets/js/admin-import-export.js @@ -109,12 +109,6 @@ function _typeof(o) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/admin-main.js b/assets/js/admin-main.js index b296ffd44..efe241400 100644 --- a/assets/js/admin-main.js +++ b/assets/js/admin-main.js @@ -3168,12 +3168,6 @@ function _unsupportedIterableToArray(r, a) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/all-authors.js b/assets/js/all-authors.js index affa1b5b9..3f7b2e96e 100644 --- a/assets/js/all-authors.js +++ b/assets/js/all-authors.js @@ -110,12 +110,6 @@ /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/all-listings.js b/assets/js/all-listings.js index 1a6e6e2df..c245ace26 100644 --- a/assets/js/all-listings.js +++ b/assets/js/all-listings.js @@ -3379,12 +3379,6 @@ function _unsupportedIterableToArray(r, a) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/all-location-category.js b/assets/js/all-location-category.js index 4de59761e..298f3ce7e 100644 --- a/assets/js/all-location-category.js +++ b/assets/js/all-location-category.js @@ -112,12 +112,6 @@ window.addEventListener('load', function () { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/author-profile.js b/assets/js/author-profile.js index 5eb17891b..004c21feb 100644 --- a/assets/js/author-profile.js +++ b/assets/js/author-profile.js @@ -335,12 +335,6 @@ window.addEventListener('load', function () { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/directorist-dashboard.js b/assets/js/directorist-dashboard.js index 1ded7c4e9..b6e944090 100644 --- a/assets/js/directorist-dashboard.js +++ b/assets/js/directorist-dashboard.js @@ -1147,12 +1147,6 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length) /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/directorist-plupload.js b/assets/js/directorist-plupload.js index b5a72e8c1..23a49a8d7 100644 --- a/assets/js/directorist-plupload.js +++ b/assets/js/directorist-plupload.js @@ -73,12 +73,6 @@ function convertToSelect2(selector) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed @@ -407,25 +401,71 @@ function plu_show_thumbs(imgId) { image_caption_html = '' + image_caption + ''; } } else { - var file_type_class = 'la-file'; + // Map file extensions to Directorist icon classes + var icon_class = 'las la-file'; if (file_ext == 'pdf') { - file_type_class = 'la-file-pdf-o'; - } else if (file_ext == 'zip' || file_ext == 'tar') { - file_type_class = 'la-file-zip-o'; - } else if (file_ext == 'doc' || file_ext == 'odt') { - file_type_class = 'la-file-word-0'; + icon_class = 'fas fa-file-pdf'; + } else if (file_ext == 'zip' || file_ext == 'tar' || file_ext == 'rar' || file_ext == '7z') { + icon_class = 'fas fa-file-archive'; + } else if (file_ext == 'doc' || file_ext == 'docx' || file_ext == 'odt') { + icon_class = 'fas fa-file-word'; } else if (file_ext == 'txt' || file_ext == 'text') { - file_type_class = 'la-file-text-0'; - } else if (file_ext == 'csv' || file_ext == 'ods' || file_ext == 'ots') { - file_type_class = 'la-file-excel-0'; - } else if (file_ext == 'avi' || file_ext == 'mp4' || file_ext == 'mov') { - file_type_class = 'la-file-video-0'; + icon_class = 'far fa-file-alt'; + } else if (file_ext == 'csv' || file_ext == 'ods' || file_ext == 'ots' || file_ext == 'xls' || file_ext == 'xlsx') { + icon_class = 'fas fa-file-excel'; + } else if (file_ext == 'avi' || file_ext == 'mp4' || file_ext == 'mov' || file_ext == 'wmv' || file_ext == 'flv' || file_ext == 'mkv') { + icon_class = 'fas fa-file-video'; + } else if (file_ext == 'mp3' || file_ext == 'wav' || file_ext == 'ogg' || file_ext == 'm4a' || file_ext == 'flac') { + icon_class = 'fas fa-file-audio'; + } else if (file_ext == 'ppt' || file_ext == 'pptx') { + icon_class = 'fas fa-file-powerpoint'; + } else if (file_ext == 'xps') { + icon_class = 'fas fa-file-alt'; + } + + // Get icon URL using Directorist icon system + var iconURL = ''; + var iconPath = ''; + if (typeof directorist !== 'undefined' && directorist.assets_url) { + // Map icon class to file path + if (icon_class.indexOf('fa-file-pdf') !== -1) { + iconPath = 'font-awesome/svgs/solid/file-pdf.svg'; + } else if (icon_class.indexOf('fa-file-archive') !== -1) { + iconPath = 'font-awesome/svgs/solid/file-archive.svg'; + } else if (icon_class.indexOf('fa-file-word') !== -1) { + iconPath = 'font-awesome/svgs/solid/file-word.svg'; + } else if (icon_class.indexOf('fa-file-alt') !== -1) { + iconPath = 'font-awesome/svgs/regular/file-alt.svg'; + } else if (icon_class.indexOf('fa-file-excel') !== -1) { + iconPath = 'font-awesome/svgs/solid/file-excel.svg'; + } else if (icon_class.indexOf('fa-file-video') !== -1) { + iconPath = 'font-awesome/svgs/solid/file-video.svg'; + } else if (icon_class.indexOf('fa-file-audio') !== -1) { + iconPath = 'font-awesome/svgs/solid/file-audio.svg'; + } else if (icon_class.indexOf('fa-file-powerpoint') !== -1) { + iconPath = 'font-awesome/svgs/solid/file-powerpoint.svg'; + } else { + iconPath = 'font-awesome/svgs/regular/file.svg'; + } + iconURL = directorist.assets_url + 'icons/' + iconPath; + } + + // Generate Directorist icon HTML for file + var fileIconHTML = ''; + if (iconURL && typeof directorist !== 'undefined' && directorist.icon_markup) { + fileIconHTML = directorist.icon_markup.replace('##URL##', iconURL).replace('##CLASS##', 'atbdp-file-icon'); + } else if (iconURL) { + // Fallback to simple icon if directorist.icon_markup is not available + fileIconHTML = ''; + } else { + // Final fallback - use a generic file icon + fileIconHTML = ''; } file_display_class = 'file-thumb'; - file_display = ''; + file_display = '
' + fileIconHTML + '' + atbdp_esc_entities(file_name) + '' + '
'; } - var iconURL = directorist.assets_url + 'icons/font-awesome/svgs/solid/trash-alt.svg'; - var iconHTML = directorist.icon_markup.replace('##URL##', iconURL).replace('##CLASS##', ''); + var removeIconURL = directorist.assets_url + 'icons/font-awesome/svgs/solid/trash-alt.svg'; + var iconHTML = directorist.icon_markup.replace('##URL##', removeIconURL).replace('##CLASS##', ''); var thumb = $('
' + image_title_html + file_display + image_caption_html + '
' + '' + iconHTML + '' + '
' + '
'); thumbsC.append(thumb); thumb.find('.thumbremovelink').click(function () { diff --git a/assets/js/global-main.js b/assets/js/global-main.js index c8336f204..365f46a67 100644 --- a/assets/js/global-main.js +++ b/assets/js/global-main.js @@ -924,12 +924,6 @@ function _unsupportedIterableToArray(r, a) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/global-markerclusterer.js b/assets/js/global-markerclusterer.js index b44bb386f..54de8bc56 100644 --- a/assets/js/global-markerclusterer.js +++ b/assets/js/global-markerclusterer.js @@ -37,12 +37,6 @@ function _typeof(o) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/google-map.js b/assets/js/google-map.js index cba290543..bf4c262e7 100644 --- a/assets/js/google-map.js +++ b/assets/js/google-map.js @@ -783,12 +783,6 @@ function convertToSelect2(selector) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/openstreet-map.js b/assets/js/openstreet-map.js index 4877f652b..5347152cd 100644 --- a/assets/js/openstreet-map.js +++ b/assets/js/openstreet-map.js @@ -497,12 +497,6 @@ function convertToSelect2(selector) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/public-main.js b/assets/js/public-main.js index e09016353..94836ad64 100644 --- a/assets/js/public-main.js +++ b/assets/js/public-main.js @@ -961,12 +961,6 @@ function _unsupportedIterableToArray(r, a) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/range-slider.js b/assets/js/range-slider.js index 3f818adfe..8bf4ea905 100644 --- a/assets/js/range-slider.js +++ b/assets/js/range-slider.js @@ -37,12 +37,6 @@ function _typeof(o) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/search-form.js b/assets/js/search-form.js index e094c4c57..338e5f389 100644 --- a/assets/js/search-form.js +++ b/assets/js/search-form.js @@ -1228,12 +1228,6 @@ function _unsupportedIterableToArray(r, a) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed @@ -1510,6 +1504,13 @@ document.addEventListener('DOMContentLoaded', function () { $('body').removeClass('directorist-preload'); $('.button.wp-color-result').attr('style', ' '); + // Escape text for safe HTML insertion (XSS prevention) + function escapeHtml(text) { + var div = document.createElement('div'); + div.textContent = text == null ? '' : String(text); + return div.innerHTML; + } + /* ---------------- Search Form ------------------ */ @@ -2203,7 +2204,7 @@ document.addEventListener('DOMContentLoaded', function () { }); // Listing Type Change - $('body').on('click', '.search_listing_types', function (event) { + $('body').on('click', '.search_listing_types, .directorist-type-nav__link', function (event) { event.preventDefault(); var parent = $(this).closest('.directorist-search-contents'); var listing_type = $(this).attr('data-listing_type'); @@ -2424,10 +2425,7 @@ document.addEventListener('DOMContentLoaded', function () { getResultContainer: getWidgetResultContainer }]; input_fields.forEach(function (field) { - if (!$(field.input_elm).length) { - return; - } - $(field.input_elm).on('keyup', (0,_global_components_debounce__WEBPACK_IMPORTED_MODULE_4__["default"])(function (event) { + $('body').off('keyup.directoristOpenstreet', field.input_elm).on('keyup.directoristOpenstreet', field.input_elm, (0,_global_components_debounce__WEBPACK_IMPORTED_MODULE_4__["default"])(function (event) { event.preventDefault(); var blockedKeyCodes = [16, 17, 18, 19, 20, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 91, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 144, 145]; @@ -2448,7 +2446,7 @@ document.addEventListener('DOMContentLoaded', function () { display: 'block' }); $.ajax({ - url: 'https://nominatim.openstreetmap.org/?q=%27+'.concat(search, '+%27&format=json'), + url: 'https://nominatim.openstreetmap.org/?q=' + encodeURIComponent(search) + '&format=json&limit=5', type: 'GET', data: {}, success: function success(data) { @@ -2461,7 +2459,7 @@ document.addEventListener('DOMContentLoaded', function () { var iconHTML = directorist.icon_markup.replace('##URL##', iconURL).replace('##CLASS##', ''); var locationIconHTML = "" + iconHTML + ''; for (var i = 0, len = data.length > 5 ? 5 : data.length; i < len; i++) { - res += '
  • ' + locationIconHTML + "" + data[i].display_name, +'
  • '; + res += '
  • ' + locationIconHTML + "" + escapeHtml(String(data[i].display_name || '')) + '
  • '; } function displayLocation(position, event) { var lat = position.coords.latitude; @@ -2813,7 +2811,7 @@ document.addEventListener('DOMContentLoaded', function () { if (directorist.i18n_text.select_listing_map === 'google') { var url = directorist.ajax_url; } else { - url = "https://nominatim.openstreetmap.org/?postalcode=".concat(zipcode, "&format=json&addressdetails=1"); + url = "https://nominatim.openstreetmap.org/?postalcode=".concat(encodeURIComponent(zipcode), "&format=json&addressdetails=1"); $('.directorist-country').css({ display: 'block' }); @@ -2853,7 +2851,8 @@ document.addEventListener('DOMContentLoaded', function () { zipcode_search.find('.zip-cityLng').val(lon); } else { for (var i = 0; i < data.length; i++) { - res += "
  • ").concat(data[i].address.country, "
  • "); + var country = data[i] && data[i].address && data[i].address.country ? data[i].address.country : ''; + res += '
  • ' + escapeHtml(country) + '
  • '; } } $(country_suggest).html("")); diff --git a/assets/js/single-listing.js b/assets/js/single-listing.js index 0bf133fcd..549b2bdfa 100644 --- a/assets/js/single-listing.js +++ b/assets/js/single-listing.js @@ -1230,12 +1230,6 @@ function _typeof(o) { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/js/widgets.js b/assets/js/widgets.js index 9a861ee0b..5d6f040fb 100644 --- a/assets/js/widgets.js +++ b/assets/js/widgets.js @@ -112,12 +112,6 @@ window.addEventListener('load', function () { /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } -/******/ // Check if module exists (development only) -/******/ if (__webpack_modules__[moduleId] === undefined) { -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); -/******/ e.code = 'MODULE_NOT_FOUND'; -/******/ throw e; -/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed diff --git a/assets/src/js/global/directorist-plupload.js b/assets/src/js/global/directorist-plupload.js index 98215efe4..fd09afe64 100644 --- a/assets/src/js/global/directorist-plupload.js +++ b/assets/src/js/global/directorist-plupload.js @@ -438,9 +438,18 @@ function plu_show_thumbs(imgId) { var icon_class = 'las la-file'; if (file_ext == 'pdf') { icon_class = 'fas fa-file-pdf'; - } else if (file_ext == 'zip' || file_ext == 'tar' || file_ext == 'rar' || file_ext == '7z') { + } else if ( + file_ext == 'zip' || + file_ext == 'tar' || + file_ext == 'rar' || + file_ext == '7z' + ) { icon_class = 'fas fa-file-archive'; - } else if (file_ext == 'doc' || file_ext == 'docx' || file_ext == 'odt') { + } else if ( + file_ext == 'doc' || + file_ext == 'docx' || + file_ext == 'odt' + ) { icon_class = 'fas fa-file-word'; } else if (file_ext == 'txt' || file_ext == 'text') { icon_class = 'far fa-file-alt'; @@ -478,8 +487,11 @@ function plu_show_thumbs(imgId) { // Get icon URL using Directorist icon system var iconURL = ''; var iconPath = ''; - - if (typeof directorist !== 'undefined' && directorist.assets_url) { + + if ( + typeof directorist !== 'undefined' && + directorist.assets_url + ) { // Map icon class to file path if (icon_class.indexOf('fa-file-pdf') !== -1) { iconPath = 'font-awesome/svgs/solid/file-pdf.svg'; @@ -495,8 +507,11 @@ function plu_show_thumbs(imgId) { iconPath = 'font-awesome/svgs/solid/file-video.svg'; } else if (icon_class.indexOf('fa-file-audio') !== -1) { iconPath = 'font-awesome/svgs/solid/file-audio.svg'; - } else if (icon_class.indexOf('fa-file-powerpoint') !== -1) { - iconPath = 'font-awesome/svgs/solid/file-powerpoint.svg'; + } else if ( + icon_class.indexOf('fa-file-powerpoint') !== -1 + ) { + iconPath = + 'font-awesome/svgs/solid/file-powerpoint.svg'; } else { iconPath = 'font-awesome/svgs/regular/file.svg'; } @@ -505,16 +520,24 @@ function plu_show_thumbs(imgId) { // Generate Directorist icon HTML for file var fileIconHTML = ''; - if (iconURL && typeof directorist !== 'undefined' && directorist.icon_markup) { + if ( + iconURL && + typeof directorist !== 'undefined' && + directorist.icon_markup + ) { fileIconHTML = directorist.icon_markup .replace('##URL##', iconURL) .replace('##CLASS##', 'atbdp-file-icon'); } else if (iconURL) { // Fallback to simple icon if directorist.icon_markup is not available - fileIconHTML = ''; + fileIconHTML = + ''; } else { // Final fallback - use a generic file icon - fileIconHTML = ''; + fileIconHTML = + ''; } file_display_class = 'file-thumb'; diff --git a/assets/src/js/public/search-form.js b/assets/src/js/public/search-form.js index 4e7030e45..fcf20d826 100644 --- a/assets/src/js/public/search-form.js +++ b/assets/src/js/public/search-form.js @@ -224,6 +224,13 @@ document.addEventListener('DOMContentLoaded', () => { $('body').removeClass('directorist-preload'); $('.button.wp-color-result').attr('style', ' '); + // Escape text for safe HTML insertion (XSS prevention) + function escapeHtml(text) { + const div = document.createElement('div'); + div.textContent = text == null ? '' : String(text); + return div.innerHTML; + } + /* ---------------- Search Form ------------------ */ @@ -1325,124 +1332,134 @@ document.addEventListener('DOMContentLoaded', () => { ); // Listing Type Change - $('body').on('click', '.search_listing_types', function (event) { - event.preventDefault(); - let parent = $(this).closest('.directorist-search-contents'); - let listing_type = $(this).attr('data-listing_type'); - let type_current = parent.find( - '.directorist-listing-type-selection__link--current' - ); - - if (type_current.length) { - type_current.removeClass( - 'directorist-listing-type-selection__link--current' - ); - $(this).addClass( - 'directorist-listing-type-selection__link--current' + $('body').on( + 'click', + '.search_listing_types, .directorist-type-nav__link', + function (event) { + event.preventDefault(); + let parent = $(this).closest('.directorist-search-contents'); + let listing_type = $(this).attr('data-listing_type'); + let type_current = parent.find( + '.directorist-listing-type-selection__link--current' ); - } - parent.find('.listing_type').val(listing_type); - - let form_data = new FormData(); - form_data.append('action', 'atbdp_listing_types_form'); - form_data.append('nonce', directorist.directorist_nonce); - form_data.append('listing_type', listing_type); - - let atts = parent.attr('data-atts'); - let atts_decoded = btoa(atts); - - form_data.append('atts', atts_decoded); - - parent - .find('.directorist-search-form-box') - .addClass('atbdp-form-fade'); - - $.ajax({ - method: 'POST', - processData: false, - contentType: false, - url: directorist.ajax_url, - data: form_data, - success(response) { - if (response) { - // Add Temp Element - let new_inserted_elm = - '
    '; - parent.before(new_inserted_elm); - - // Remove Old Parent - parent.remove(); - - // Insert New Parent - $('.directorist_search_temp').after( - response['search_form'] - ); - let newParent = $('.directorist_search_temp').next(); + if (type_current.length) { + type_current.removeClass( + 'directorist-listing-type-selection__link--current' + ); + $(this).addClass( + 'directorist-listing-type-selection__link--current' + ); + } - // Toggle Active Class - newParent - .find( - '.directorist-listing-type-selection__link--current' - ) - .removeClass( - 'directorist-listing-type-selection__link--current' - ); - newParent - .find("[data-listing_type='" + listing_type + "']") - .addClass( - 'directorist-listing-type-selection__link--current' + parent.find('.listing_type').val(listing_type); + + let form_data = new FormData(); + form_data.append('action', 'atbdp_listing_types_form'); + form_data.append('nonce', directorist.directorist_nonce); + form_data.append('listing_type', listing_type); + + let atts = parent.attr('data-atts'); + let atts_decoded = btoa(atts); + + form_data.append('atts', atts_decoded); + + parent + .find('.directorist-search-form-box') + .addClass('atbdp-form-fade'); + + $.ajax({ + method: 'POST', + processData: false, + contentType: false, + url: directorist.ajax_url, + data: form_data, + success(response) { + if (response) { + // Add Temp Element + let new_inserted_elm = + '
    '; + parent.before(new_inserted_elm); + + // Remove Old Parent + parent.remove(); + + // Insert New Parent + $('.directorist_search_temp').after( + response['search_form'] ); + let newParent = $( + '.directorist_search_temp' + ).next(); + + // Toggle Active Class + newParent + .find( + '.directorist-listing-type-selection__link--current' + ) + .removeClass( + 'directorist-listing-type-selection__link--current' + ); + newParent + .find( + "[data-listing_type='" + listing_type + "']" + ) + .addClass( + 'directorist-listing-type-selection__link--current' + ); - // Remove Temp Element - $('.directorist_search_temp').remove(); - - let events = [ - new CustomEvent( - 'directorist-search-form-nav-tab-reloaded' - ), - new CustomEvent( - 'directorist-reload-select2-fields' - ), - new CustomEvent('directorist-reload-map-api-field'), - new CustomEvent('triggerSlice'), - ]; - - events.forEach((event) => { - document.body.dispatchEvent(event); - window.dispatchEvent(event); - }); + // Remove Temp Element + $('.directorist_search_temp').remove(); + + let events = [ + new CustomEvent( + 'directorist-search-form-nav-tab-reloaded' + ), + new CustomEvent( + 'directorist-reload-select2-fields' + ), + new CustomEvent( + 'directorist-reload-map-api-field' + ), + new CustomEvent('triggerSlice'), + ]; - handleRadiusVisibility(); - directorist_custom_range_slider(); + events.forEach((event) => { + document.body.dispatchEvent(event); + window.dispatchEvent(event); + }); - initSearchFields(); + handleRadiusVisibility(); + directorist_custom_range_slider(); - initSearchCategoryCustomFields($); - } + initSearchFields(); - let parentAfterAjax = $(this).closest( - '.directorist-search-contents' - ); + initSearchCategoryCustomFields($); + } + + let parentAfterAjax = $(this).closest( + '.directorist-search-contents' + ); - parentAfterAjax - .find('.directorist-search-form-box') - .removeClass('atbdp-form-fade'); - if ( parentAfterAjax .find('.directorist-search-form-box') - .find('.directorist-search-field-radius_search') - .length - ) { - handleRadiusVisibility(); - directorist_custom_range_slider(); - } - }, - error(error) { - // console.log(error); - }, - }); - }); + .removeClass('atbdp-form-fade'); + if ( + parentAfterAjax + .find('.directorist-search-form-box') + .find('.directorist-search-field-radius_search') + .length + ) { + handleRadiusVisibility(); + directorist_custom_range_slider(); + } + }, + error(error) { + // console.log(error); + }, + }); + } + ); initSearchCategoryCustomFields($); @@ -1674,200 +1691,220 @@ document.addEventListener('DOMContentLoaded', () => { ]; input_fields.forEach((field) => { - if (!$(field.input_elm).length) { - return; - } - - $(field.input_elm).on( - 'keyup', - debounce(function (event) { - event.preventDefault(); - - let blockedKeyCodes = [ - 16, 17, 18, 19, 20, 27, 33, 34, 35, 36, 37, 38, - 39, 40, 45, 91, 93, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 144, 145, - ]; + $('body') + .off('keyup.directoristOpenstreet', field.input_elm) + .on( + 'keyup.directoristOpenstreet', + field.input_elm, + debounce(function (event) { + event.preventDefault(); + + let blockedKeyCodes = [ + 16, 17, 18, 19, 20, 27, 33, 34, 35, 36, 37, + 38, 39, 40, 45, 91, 93, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 144, + 145, + ]; + + // Return early when blocked key is pressed. + if (blockedKeyCodes.includes(event.keyCode)) { + return; + } - // Return early when blocked key is pressed. - if (blockedKeyCodes.includes(event.keyCode)) { - return; - } + let locationAddressField = $(this).parent( + '.directorist-search-field' + ); + let result_container = field.getResultContainer( + this, + field + ); + let search = $(this).val(); + + if (search.length < 3) { + result_container.css({ + display: 'none', + }); + } else { + locationAddressField.addClass( + 'atbdp-form-fade' + ); + result_container.css({ + display: 'block', + }); + + $.ajax({ + url: + 'https://nominatim.openstreetmap.org/?q=' + + encodeURIComponent(search) + + '&format=json&limit=5', + type: 'GET', + data: {}, + success: function success(data) { + let res = ''; + + let currentIconURL = + directorist.assets_url + + 'icons/font-awesome/svgs/solid/paper-plane.svg'; + let currentIconHTML = + directorist.icon_markup + .replace( + '##URL##', + currentIconURL + ) + .replace('##CLASS##', ''); + let currentLocationIconHTML = + "" + + currentIconHTML + + ''; + let currentLocationAddressHTML = + ""; + + let iconURL = + directorist.assets_url + + 'icons/font-awesome/svgs/solid/map-marker-alt.svg'; + let iconHTML = + directorist.icon_markup + .replace('##URL##', iconURL) + .replace('##CLASS##', ''); + let locationIconHTML = + "" + + iconHTML + + ''; + + for ( + let i = 0, + len = + data.length > 5 + ? 5 + : data.length; + i < len; + i++ + ) { + res += + '
  • ' + + locationIconHTML + + "" + + escapeHtml( + String( + data[i] + .display_name || + '' + ) + ) + + '
  • '; + } + + function displayLocation( + position, + event + ) { + let lat = + position.coords.latitude; + let lng = + position.coords.longitude; + $.ajax({ + url: + 'https://nominatim.openstreetmap.org/reverse?format=json&lon=' + + lng + + '&lat=' + + lat, + type: 'GET', + data: {}, + success: function success( + data + ) { + $( + '.directorist-location-js, .atbdp-search-address' + ).val( + data.display_name + ); + $( + '.directorist-location-js, .atbdp-search-address' + ).attr( + 'data-value', + data.display_name + ); + $('#cityLat').val(lat); + $('#cityLng').val(lng); - let locationAddressField = $(this).parent( - '.directorist-search-field' - ); - let result_container = field.getResultContainer( - this, - field - ); - let search = $(this).val(); + const locationSearch = + $( + '.directorist-search-location' + ); + if ( + locationSearch.length + ) { + locationSearch.trigger( + 'change' + ); + } + }, + }); + } + + result_container.html( + '' + ); + if (res.length) { + result_container.show(); + } else { + result_container.hide(); + } + + locationAddressField.removeClass( + 'atbdp-form-fade' + ); - if (search.length < 3) { - result_container.css({ - display: 'none', - }); - } else { - locationAddressField.addClass( - 'atbdp-form-fade' - ); - result_container.css({ - display: 'block', - }); - - $.ajax({ - url: 'https://nominatim.openstreetmap.org/?q=%27+'.concat( - search, - '+%27&format=json' - ), - type: 'GET', - data: {}, - success: function success(data) { - let res = ''; - - let currentIconURL = - directorist.assets_url + - 'icons/font-awesome/svgs/solid/paper-plane.svg'; - let currentIconHTML = - directorist.icon_markup - .replace( - '##URL##', - currentIconURL + $('body') + .off( + 'click', + '.address_result .current-location' ) - .replace('##CLASS##', ''); - let currentLocationIconHTML = - "" + - currentIconHTML + - ''; - let currentLocationAddressHTML = - ""; - - let iconURL = - directorist.assets_url + - 'icons/font-awesome/svgs/solid/map-marker-alt.svg'; - let iconHTML = directorist.icon_markup - .replace('##URL##', iconURL) - .replace('##CLASS##', ''); - let locationIconHTML = - "" + - iconHTML + - ''; - - for ( - let i = 0, - len = - data.length > 5 - ? 5 - : data.length; - i < len; - i++ - ) { - ((res += - '
  • ' + - locationIconHTML + - "" + - data[i].display_name), - +'
  • '); - } - - function displayLocation( - position, - event - ) { - let lat = position.coords.latitude; - let lng = position.coords.longitude; - $.ajax({ - url: - 'https://nominatim.openstreetmap.org/reverse?format=json&lon=' + - lng + - '&lat=' + - lat, - type: 'GET', - data: {}, - success: function success( - data - ) { - $( - '.directorist-location-js, .atbdp-search-address' - ).val(data.display_name); - $( - '.directorist-location-js, .atbdp-search-address' - ).attr( - 'data-value', - data.display_name - ); - $('#cityLat').val(lat); - $('#cityLng').val(lng); - - const locationSearch = $( - '.directorist-search-location' - ); - if (locationSearch.length) { - locationSearch.trigger( - 'change' + .on( + 'click', + '.address_result .current-location', + function (e) { + e.preventDefault(); + + navigator.geolocation.getCurrentPosition( + function ( + position + ) { + return displayLocation( + position, + e + ); + } ); } - }, + ); + }, + error: function error(_error3) { + console.log({ + error: _error3, }); - } - - result_container.html( - '' - ); - if (res.length) { - result_container.show(); - } else { - result_container.hide(); - } - - locationAddressField.removeClass( - 'atbdp-form-fade' - ); - - $('body') - .off( - 'click', - '.address_result .current-location' - ) - .on( - 'click', - '.address_result .current-location', - function (e) { - e.preventDefault(); - - navigator.geolocation.getCurrentPosition( - function (position) { - return displayLocation( - position, - e - ); - } - ); - } + locationAddressField.removeClass( + 'atbdp-form-fade' ); - }, - error: function error(_error3) { - console.log({ - error: _error3, - }); - locationAddressField.removeClass( - 'atbdp-form-fade' - ); - }, - }); - } - }, 750) - ); + }, + }); + } + }, 750) + ); }); // hide address result when click outside the input field @@ -2315,7 +2352,9 @@ document.addEventListener('DOMContentLoaded', () => { if (directorist.i18n_text.select_listing_map === 'google') { var url = directorist.ajax_url; } else { - url = `https://nominatim.openstreetmap.org/?postalcode=${zipcode}&format=json&addressdetails=1`; + url = `https://nominatim.openstreetmap.org/?postalcode=${encodeURIComponent( + zipcode + )}&format=json&addressdetails=1`; $('.directorist-country').css({ display: 'block', @@ -2366,7 +2405,20 @@ document.addEventListener('DOMContentLoaded', () => { zipcode_search.find('.zip-cityLng').val(lon); } else { for (let i = 0; i < data.length; i++) { - res += `
  • ${data[i].address.country}
  • `; + let country = + data[i] && + data[i].address && + data[i].address.country + ? data[i].address.country + : ''; + res += + '
  • ' + + escapeHtml(country) + + '
  • '; } }