wc-pg-blocks
2 months ago
admin.js
3 weeks ago
admin.min.js
3 weeks ago
dashboard.js
1 day ago
dashboard.min.js
1 day ago
gutenberg-jalali-calendar.build.js
3 weeks ago
index.php
3 weeks ago
jalalidatepicker.min.js
3 weeks ago
keen-slider.min.js
2 months ago
script.js
1 day ago
script.min.js
1 day ago
script.js
32 lines
| 1 | /* |
| 2 | * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). |
| 3 | * This devtool is neither made for production nor for readable output files. |
| 4 | * It uses "eval()" calls to create a separate source file in the browser devtools. |
| 5 | * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) |
| 6 | * or disable the default devtool with "devtool: false". |
| 7 | * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). |
| 8 | */ |
| 9 | /******/ (() => { // webpackBootstrap |
| 10 | /******/ var __webpack_modules__ = ({ |
| 11 | |
| 12 | /***/ "./assets/js-admin-src/script.js" |
| 13 | /*!***************************************!*\ |
| 14 | !*** ./assets/js-admin-src/script.js ***! |
| 15 | \***************************************/ |
| 16 | () { |
| 17 | |
| 18 | eval("{jQuery(document).ready(function ($) {\r\n let wpColorPickerPalettes = ['#333', '#5de0f0', '#608bf7', '#7fff3f', '#00b700', '#fff200', '#ffae63', '#e64f6f', '#ef32e3', '#d1c1ff', '#873eff'],\r\n wpColorPickerOptions = {\r\n defaultColor: false, change: function (event, ui) {\r\n wppdActiveSettingsForm();\r\n }, clear: function () {\r\n wppdActiveSettingsForm();\r\n }, hide: true, palettes: wpColorPickerPalettes\r\n },\r\n settingsSubmitActive = false,\r\n wpMediaFrames = {};\r\n\r\n const wppdBody = $('body'),\r\n wppdContentWrap = $('#wppd-content-wrap'),\r\n wppdSettingsHeader = $('#wppd-settings-header'),\r\n wppdSettingsSidebar = $('#wppd-sidebar'),\r\n wppdSettingsDisplaySidebar = $('#wppd-display-sidebar'),\r\n wppdSettingsHideSidebar = $('#wppd-hide-sidebar'),\r\n wppdSettingsSectionLinks = $('.wppd-section-links ul'),\r\n settingsForm = document.getElementById('wppd-settings-form'),\r\n settingsFooter = document.getElementById('wppd-settings-footer'),\r\n settingsResetButton = document.getElementById(\"wppd-settings-reset-button\");\r\n\r\n let wppdContentWrapPrevScrollPos = wppdContentWrap.scrollTop(),\r\n wppdContentWrapCurrentScrollPos = wppdContentWrapPrevScrollPos,\r\n wppdPageRefreshedAfter = parseInt(WpParsiDate.pageRefreshedAfter);\r\n\r\n /**\r\n * Page refresh\r\n * */\r\n if (wppdPageRefreshedAfter > 0) {\r\n setTimeout(function () {\r\n if (WpParsiDate.pageRefreshUrl !== null)\r\n window.location.href = WpParsiDate.pageRefreshUrl;\r\n else\r\n window.location.reload(true);\r\n }, wppdPageRefreshedAfter);\r\n }\r\n\r\n /**\r\n * Hide header on scroll down and sticky on scroll to top\r\n * */\r\n wppdContentWrap.scroll(function () {\r\n wppdContentWrapCurrentScrollPos = $(this).scrollTop();\r\n if (wppdContentWrapPrevScrollPos < wppdContentWrapCurrentScrollPos && wppdContentWrapCurrentScrollPos > wppdSettingsHeader.outerHeight())\r\n wppdSettingsHeader.addClass('hide-header');\r\n else\r\n wppdSettingsHeader.removeClass('hide-header');\r\n\r\n wppdContentWrapPrevScrollPos = wppdContentWrapCurrentScrollPos;\r\n });\r\n\r\n /**\r\n * Sidebar menu\r\n * */\r\n wppdSettingsDisplaySidebar.on('click', function (e) {\r\n e.preventDefault();\r\n wppdSettingsSidebar.addClass('wppd-mobile-sidebar');\r\n wppdBody.addClass('wppd-mobile-sidebar-active');\r\n });\r\n wppdSettingsHideSidebar.on('click', function (e) {\r\n e.preventDefault();\r\n wppdSettingsSidebar.removeClass('wppd-mobile-sidebar');\r\n wppdBody.removeClass('wppd-mobile-sidebar-active');\r\n });\r\n\r\n /**\r\n * Auto scroll to active section link\r\n * */\r\n if (wppdSettingsSectionLinks.length) {\r\n let wppdSectionActiveLink = wppdSettingsSectionLinks.find('.wppd-section-link-current'),\r\n wppdSectionOutsideActiveLink = wppdSettingsSectionLinks.outerWidth() - 100 < wppdSectionActiveLink.position().left,\r\n wppdSectionScrollActiveLink = wppdSectionActiveLink.position().left - wppdSectionActiveLink.outerWidth(true) - (wppdSettingsSectionLinks.outerWidth() / 3);\r\n\r\n if (isRtl) {\r\n wppdSectionOutsideActiveLink = wppdSectionActiveLink.position().left - 100 < 0;\r\n }\r\n\r\n if (wppdSectionOutsideActiveLink) {\r\n wppdSettingsSectionLinks.animate({\r\n scrollLeft: wppdSectionScrollActiveLink\r\n }, 500);\r\n }\r\n }\r\n\r\n function wppdActiveSettingsForm() {\r\n if (settingsSubmitActive) return;\r\n settingsSubmitActive = true;\r\n\r\n if (settingsFooter) settingsFooter.classList.remove('wppd-submit-inactive');\r\n\r\n window.addEventListener(\"beforeunload\", wppdSettingsFormChangeAlert);\r\n }\r\n\r\n const wppdSettingsFormChangeAlert = (event) => {\r\n event.preventDefault();\r\n event.returnValue = true;\r\n }\r\n\r\n if (settingsForm) {\r\n if (settingsFooter) settingsFooter.classList.add('wppd-submit-inactive');\r\n\r\n settingsForm.addEventListener('change', function () {\r\n wppdActiveSettingsForm();\r\n });\r\n\r\n settingsForm.addEventListener('submit', function () {\r\n window.removeEventListener(\"beforeunload\", wppdSettingsFormChangeAlert);\r\n });\r\n\r\n if (settingsResetButton) {\r\n settingsResetButton.addEventListener(\"click\", () => {\r\n settingsSubmitActive = false;\r\n\r\n if (settingsFooter) settingsFooter.classList.add('wppd-submit-inactive');\r\n\r\n window.removeEventListener(\"beforeunload\", wppdSettingsFormChangeAlert);\r\n });\r\n }\r\n }\r\n\r\n function wpColorPickerInit() {\r\n let wpColorPicker = $('.wppd-wp-color-picker,.wppd-color-palette').not('.wppd-gradient-select-color').find('input[type=\"text\"]');\r\n\r\n if (wpColorPicker.length) {\r\n wpColorPicker.wpColorPicker(wpColorPickerOptions);\r\n\r\n setTimeout(function () {\r\n $('.wppd-color-palette[data-removable=\"1\"]').each(function () {\r\n let wppdPickerContainer = $(this).find('.wp-picker-container');\r\n\r\n if (wppdPickerContainer.length > 0) {\r\n wppdPickerContainer.append('<button type=\"button\" class=\"wppd-remove-color\"><i class=\"wppd-icon-cross\"></i></button>');\r\n }\r\n });\r\n }, 500);\r\n }\r\n }\r\n\r\n wpColorPickerInit();\r\n\r\n /** Media methods */\r\n function wppdMediaInit() {\r\n $('.wppd-media-image').off('click', '**').on('click', function () {\r\n let $this = $(this),\r\n mediaSelectID = $this.attr('data-id'),\r\n mediaWrap = $this.closest('.wppd-media-wrap'),\r\n mediaInput = mediaWrap.find('input'),\r\n mediaImageIDs = mediaInput.val().split(',');\r\n\r\n const index = mediaImageIDs.indexOf(mediaSelectID);\r\n if (index > -1) {\r\n mediaImageIDs.splice(index, 1);\r\n }\r\n\r\n if (mediaImageIDs.length === 0) {\r\n mediaWrap.removeClass('wppd-media-selected');\r\n }\r\n\r\n mediaInput.val(mediaImageIDs.join(','));\r\n $this.remove();\r\n wppdActiveSettingsForm();\r\n });\r\n }\r\n\r\n $('.wppd-media-select').on('click', function () {\r\n let $this = $(this),\r\n mediaWrap = $this.closest('.wppd-media-wrap'),\r\n mediaWrapperID = mediaWrap.attr('id'),\r\n mediaTitle = mediaWrap.data('title'),\r\n mediaButton = mediaWrap.data('button'),\r\n mediaType = mediaWrap.data('type'),\r\n acceptExtensions = mediaWrap.data('accept-extensions'),\r\n multiSelection = parseInt(mediaWrap.data('multi-selection')) === 1,\r\n mediaMaxNumber = parseInt(mediaWrap.data('max-number')),\r\n mediaMultiple = mediaMaxNumber > 1,\r\n mediaImageContainer = mediaWrap.find('.wppd-media-images'),\r\n mediaInput = mediaWrap.find('input'),\r\n mediaSelected = 1;\r\n\r\n /*if (wpMediaFrames.hasOwnProperty(mediaWrapperID)) {\r\n wpMediaFrames[mediaWrapperID].open();\r\n return;\r\n }*/\r\n\r\n // Create a new media frame\r\n wpMediaFrames[mediaWrapperID] = wp.media({\r\n title: mediaTitle,\r\n button: {\r\n text: mediaButton\r\n },\r\n library: {\r\n type: mediaType\r\n },\r\n multiple: mediaMultiple\r\n });\r\n\r\n wpMediaFrames[mediaWrapperID].once('uploader:ready', function () {\r\n var uploader = wpMediaFrames[mediaWrapperID].uploader.uploader.uploader; // Upload manager\r\n\r\n //Updating allowed extensions\r\n uploader.setOption('filters',\r\n {\r\n mime_types: [\r\n {extensions: acceptExtensions}\r\n ]\r\n }\r\n );\r\n\r\n //Trick to reinit field\r\n uploader.setOption('multi_selection', multiSelection);\r\n });\r\n\r\n wpMediaFrames[mediaWrapperID].on('open', function () {\r\n let selection = wpMediaFrames[mediaWrapperID].state().get('selection'),\r\n mediaIDs = mediaInput.val().split(',');\r\n\r\n if (mediaIDs.length > 0) {\r\n mediaIDs.forEach(function (id) {\r\n let attachment = wp.media.attachment(id);\r\n attachment.fetch();\r\n selection.add(attachment ? [attachment] : []);\r\n });\r\n }\r\n });\r\n\r\n // When an image is selected in the media frame...\r\n wpMediaFrames[mediaWrapperID].on('select', function () {\r\n mediaImageContainer.html('');\r\n\r\n // Get media attachment details from the frame state\r\n let attachments = wpMediaFrames[mediaWrapperID].state().get('selection'),\r\n attachmentIDs = attachments.map(function (attachment) {\r\n if (mediaSelected <= mediaMaxNumber) {\r\n attachment = attachment.toJSON();\r\n let attachmentUrl = attachment.url;\r\n if (attachment.type !== 'image') {\r\n if (attachment.hasOwnProperty('image') && attachment.image.hasOwnProperty('src') && attachment.image.src) {\r\n attachmentUrl = attachment.image.src;\r\n } else {\r\n attachmentUrl = attachment.icon;\r\n }\r\n }\r\n let imageTitle = attachment.id + ': ' + (attachment.caption.length > 0 ? attachment.caption : attachment.title) + ' (' + attachment.type + ')';\r\n mediaImageContainer.append('<div class=\"wppd-media-image\" data-id=\"' + attachment.id + '\"><img src=\"' + attachmentUrl + '\" title=\"' + imageTitle + '\"/><span class=\"wppd-media-image-title\">' + imageTitle + '</span></div>');\r\n }\r\n mediaSelected++;\r\n return attachment.id;\r\n });\r\n\r\n attachmentIDs = attachmentIDs.slice(0, mediaMaxNumber);\r\n\r\n mediaWrap.addClass('wppd-media-selected');\r\n\r\n // Send the attachment id to our hidden input\r\n mediaInput.val(attachmentIDs.join(','));\r\n\r\n wppdMediaInit();\r\n wppdActiveSettingsForm();\r\n });\r\n\r\n // Finally, open the modal on click\r\n wpMediaFrames[mediaWrapperID].open();\r\n });\r\n\r\n $('.wppd-media-remove-all').on('click', function () {\r\n let $this = $(this),\r\n mediaWrap = $this.closest('.wppd-media-wrap'),\r\n mediaInput = mediaWrap.find('input');\r\n\r\n mediaWrap.removeClass('wppd-media-selected');\r\n mediaInput.val('');\r\n wppdActiveSettingsForm();\r\n });\r\n\r\n wppdMediaInit();\r\n\r\n /**\r\n * Copy text\r\n * */\r\n function wppdCopyTextInit() {\r\n let wppdCopyText = $('.wppd-copy-text');\r\n if (navigator.clipboard) {\r\n wppdCopyText.each(function () {\r\n if ($(this).attr('title') === undefined)\r\n $(this).attr('title', WpParsiDate.copyText);\r\n })\r\n wppdCopyText.off('click', '**').on('click', function () {\r\n let wppdCopyTextElm = $(this),\r\n wppdTextForCopy = wppdCopyTextElm.attr('data-text') !== undefined ? wppdCopyTextElm.attr('data-text') : wppdCopyTextElm.text();\r\n navigator.clipboard.writeText(wppdTextForCopy);\r\n wppdCopyTextElm.addClass('wppd-text-copied');\r\n\r\n setTimeout(function () {\r\n wppdCopyTextElm.removeClass('wppd-text-copied');\r\n }, 500);\r\n });\r\n } else {\r\n wppdCopyText.removeClass('wppd-copy-text');\r\n }\r\n }\r\n\r\n wppdCopyTextInit();\r\n});\r\n\n\n//# sourceURL=webpack://wp-parsidate/./assets/js-admin-src/script.js?\n}"); |
| 19 | |
| 20 | /***/ } |
| 21 | |
| 22 | /******/ }); |
| 23 | /************************************************************************/ |
| 24 | /******/ |
| 25 | /******/ // startup |
| 26 | /******/ // Load entry module and return exports |
| 27 | /******/ // This entry module can't be inlined because the eval devtool is used. |
| 28 | /******/ var __webpack_exports__ = {}; |
| 29 | /******/ __webpack_modules__["./assets/js-admin-src/script.js"](); |
| 30 | /******/ |
| 31 | /******/ })() |
| 32 | ; |