GRAYBYTE WORDPRESS FILE MANAGER6316

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/essential-blocks/src/helpers/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/essential-blocks/src/helpers//fetch.js
/**
 * Define AJAX Action names
 */
const updateGlobalStyleAction = 'global_styles_update';
const getGlobalStyleAction = 'global_styles_get';
const updateBlockDefaultsAction = 'block_defaults_update';
const getBlockDefaultsAction = 'block_defaults_get';
const nonce = EssentialBlocksLocalize.admin_nonce;

/**
 * Function for Update Global Settings
 * @param {*} value
 * @returns {object}
 */
export const updateGlobalStyle = (value, key = 'all') => {
    // console.log('updateGlobalStyle', value)
    let data = new FormData();
    data.append("action", updateGlobalStyleAction);
    data.append("admin_nonce", nonce);
    data.append("eb_global_style_key", key);
    data.append("eb_global_style_value", JSON.stringify(value));

    return fetch(EssentialBlocksLocalize.ajax_url, {
        method: 'POST',
        body: data,
    }) // wrapped
        .then(res => res.text())
        .then(data => {
            const response = JSON.parse(data);
            if (response.success) {
                return response.data
            }
            else {
                console.log("Update failed! ", response.data)
            }
        })
        .catch(err => console.log(err));
}

/**
 * Function for Get Global Settings
 * @returns
 */
export const getGlobalSettings = () => {
    let data = new FormData();
    data.append("action", getGlobalStyleAction);
    data.append("admin_nonce", nonce);

    return fetch(EssentialBlocksLocalize.ajax_url, {
        method: 'POST',
        body: data,
    }) // wrapped
        .then(res => res.text())
        .then(data => {
            const response = JSON.parse(data);
            if (response.success) {
                return response.data
            }
            else {
                return false;
            }
        })
        .catch(err => console.log(err));
}

/**
 * Function for Update block defaults
 * @param {*} value
 * @returns {Object}
 */
export const updateBlockDefaults = (value) => {
    let data = new FormData();
    data.append("action", updateBlockDefaultsAction);
    data.append("admin_nonce", nonce);
    data.append("eb_block_defaults_value", JSON.stringify(value));

    return fetch(EssentialBlocksLocalize.ajax_url, {
        method: 'POST',
        body: data,
    }) // wrapped
        .then(res => res.text())
        .then(data => {
            const response = JSON.parse(data);
            if (response.success) {
                return response.data
            }
            else {
                console.log("failed update", data)
            }
        })
        .catch(err => console.log(err));
}

/**
 * Function for Get Block Defaults
 * @returns
 */
export const getBlockDefaults = () => {
    let data = new FormData();
    data.append("action", getBlockDefaultsAction);
    data.append("admin_nonce", nonce);

    return fetch(EssentialBlocksLocalize.ajax_url, {
        method: 'POST',
        body: data,
    }) // wrapped
        .then(res => res.text())
        .then(data => {
            const response = JSON.parse(data);
            if (response.success) {
                return response.data
            }
            else {
                return false;
            }
        })
        .catch(err => console.log(err));
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:24
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:25
giriqfky / giriqfky
0644
LoadAssets.js
2.848 KB
August 27 2024 16:37:06
giriqfky / giriqfky
0644
fetch.js
3.166 KB
February 26 2025 16:22:10
giriqfky / giriqfky
0644
helpers.js
6.286 KB
September 03 2024 16:13:22
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF