| Server IP : 38.190.208.107 / Your IP : 216.73.217.46 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.2/wp-content/themes/blocksy/static/js/customizer/sync/single/ |
Upload File : |
import { getPrefixFor, watchOptionsWithPrefix, getOptionFor } from '../helpers'
import { makeVariablesWithCondition } from '../helpers/variables-with-conditions'
import { handleBackgroundOptionFor } from '../variables/background'
import { maybePromoteScalarValueIntoResponsive } from 'customizer-sync-helpers/dist/promote-into-responsive'
const getSelectorSuffixFor = (prefix) => {
let selectorSuffix = '[class*="ct-container"] > article[class*="post"]'
if (prefix === 'courses_single') {
selectorSuffix = '.tutor-col-xl-8'
}
return selectorSuffix
}
watchOptionsWithPrefix({
getPrefix: () => getPrefixFor(),
getOptionsForPrefix: ({ prefix }) => [`${prefix}_content_area_spacing`],
render: ({ prefix, id }) => {
if (id !== `${prefix}_content_area_spacing`) {
return
}
if (
(document.body.dataset.prefixCustom || '').indexOf(
'vertical-spacing'
) > -1
) {
return
}
let el = document.querySelector('.site-main > [class*="ct-container"]')
if (!el) {
return
}
let spacingComponents = []
let contentAreaSpacing = getOptionFor('content_area_spacing', prefix)
if (contentAreaSpacing === 'both' || contentAreaSpacing === 'top') {
spacingComponents.push('top')
}
if (contentAreaSpacing === 'both' || contentAreaSpacing === 'bottom') {
spacingComponents.push('bottom')
}
el.removeAttribute('data-vertical-spacing')
if (spacingComponents.length > 0) {
el.dataset.verticalSpacing = spacingComponents.join(':')
}
},
})
export const getSingleContentVariablesFor = () => {
const prefix = getPrefixFor()
if (
(document.body.dataset.prefixCustom || '').indexOf('content-style') > -1
) {
return {}
}
return {
...handleBackgroundOptionFor({
id: `${prefix}_background`,
selector: `[data-prefix="${prefix}"]`,
responsive: true,
}),
...makeVariablesWithCondition(
`${prefix}_content_style`,
{
[`${prefix}_content_style`]: [
{
selector: `[data-prefix="${prefix}"] ${getSelectorSuffixFor(
prefix
)}`,
variable: 'has-boxed',
responsive: true,
skipOutputCheck: true,
extractValue: (value) => ({
desktop:
maybePromoteScalarValueIntoResponsive(value)
.desktop === 'boxed'
? 'var(--true)'
: 'var(--false)',
tablet:
maybePromoteScalarValueIntoResponsive(value)
.tablet === 'boxed'
? 'var(--true)'
: 'var(--false)',
mobile:
maybePromoteScalarValueIntoResponsive(value)
.mobile === 'boxed'
? 'var(--true)'
: 'var(--false)',
}),
unit: '',
},
{
selector: `[data-prefix="${prefix}"] ${getSelectorSuffixFor(
prefix
)}`,
variable: 'has-wide',
responsive: true,
skipOutputCheck: true,
extractValue: (value) => ({
desktop:
maybePromoteScalarValueIntoResponsive(value)
.desktop === 'wide'
? 'var(--true)'
: 'var(--false)',
tablet:
maybePromoteScalarValueIntoResponsive(value)
.tablet === 'wide'
? 'var(--true)'
: 'var(--false)',
mobile:
maybePromoteScalarValueIntoResponsive(value)
.mobile === 'wide'
? 'var(--true)'
: 'var(--false)',
}),
unit: '',
},
],
...handleBackgroundOptionFor({
id: `${prefix}_content_background`,
selector: `[data-prefix="${prefix}"] ${getSelectorSuffixFor(
prefix
)}`,
responsive: true,
conditional_var: '--has-background',
}),
[`${prefix}_boxed_content_spacing`]: {
selector: `[data-prefix="${prefix}"] ${getSelectorSuffixFor(
prefix
)}`,
type: 'spacing',
variable: 'theme-boxed-content-spacing',
responsive: true,
unit: '',
},
[`${prefix}_content_boxed_radius`]: {
selector: `[data-prefix="${prefix}"] ${getSelectorSuffixFor(
prefix
)}`,
type: 'spacing',
variable: 'theme-boxed-content-border-radius',
responsive: true,
},
[`${prefix}_content_boxed_shadow`]: {
selector: `[data-prefix="${prefix}"] ${getSelectorSuffixFor(
prefix
)}`,
type: 'box-shadow',
variable: 'theme-boxed-content-box-shadow',
responsive: true,
},
[`${prefix}_content_boxed_border`]: {
selector: `[data-prefix="${prefix}"] ${getSelectorSuffixFor(
prefix
)}`,
variable: 'theme-boxed-content-border',
type: 'border',
responsive: true,
skip_none: true,
},
},
() => true
),
}
}