Your IP : 216.73.216.229


Current Path : /home/jeromecohp/www/plugins/system/yooessentials/modules/core/app/
Upload File :
Current File : /home/jeromecohp/www/plugins/system/yooessentials/modules/core/app/extend.js

/* Essentials YOOtheme Pro (Freemium) 2.0.19 build 1026.0920; ZOOlanders https://www.zoolanders.com; Copyright (C) Joolanders, SL; http://www.gnu.org/licenses/gpl.html GNU/GPL */

import Vue from 'vue';
import UIkit from 'uikit';
import yootheme from 'yootheme';
import essentials from './api';
import * as fields from './fields';

Object.assign(yootheme.fields.components, fields);

Vue.events.on('initBuilder', (e) => {
    essentials.Builder = e.origin;
});

// trigger event on each yooessentials
// request in order to collect context
yootheme.hooks.after('app.init', () => {
    yootheme.http.addons.unshift({
        beforeRequest(wretch) {
            const [url] = wretch._url.split('?');
            const method = wretch._options.method;

            if (!url.startsWith('yooessentials') || method !== 'POST') {
                return wretch;
            }

            const params = JSON.parse(wretch._options.body);

            Vue.events.trigger('yooessentials-prerequest', params);

            wretch._options.body = JSON.stringify(params);

            return wretch;
        },
    });
});

// set custom admin icons
UIkit.icon.add({
    'ye--check-circle':
        '<svg viewBox="0 0 16 21" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" clip-rule="evenodd"><circle cx="9.5" cy="9.5" r="9" fill="none" stroke="#444" stroke-width="1.32" transform="matrix(.80783 0 0 .80783 .326 2.887)"/><path d="m4.365 10.841 2.237 2.797 5.033-6.152" fill="none" stroke="#444" stroke-width="1.0682057"/></svg>',
    'ye--circle-dashed':
        '<svg viewBox="0 0 16 21" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" clip-rule="evenodd"><circle cx="9.5" cy="9.5" r="9" fill="none" stroke="#444" stroke-width="1.32" stroke-dasharray="2.64,1.32,0,0" transform="matrix(.80783 0 0 .80783 .326 2.887)"/></svg>',
    'ye--toggle-on':
        '<svg viewBox="0 0 16 21" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" clip-rule="evenodd"><path fill="#444" d="M7.933 2.559h2.566v1H7.933zM11.933 2.559h2.566v1h-2.566zM1.501 2.559h2.435v1H1.5z"/><path fill="#444" d="M5.501 2.559h2.435v1H5.5zM1.5 19.05v-2.435h1v2.434zM1.5 15.634V13.2h1v2.434zM1.5 12.218V9.653h1v2.565zM1.5 8.672V6.106h1v2.566zM1.5 5.125V2.559h1v2.566z"/><g><path fill="#444" d="M13.499 19.05v-2.435h1v2.434zM13.499 15.634V13.2h1v2.434zM13.499 12.218V9.653h1v2.565zM13.499 8.672V6.106h1v2.566zM13.499 5.125V2.559h1v2.566z"/></g><g><path fill="#444" d="M7.93 18.05h2.567v1H7.93zM11.93 18.05h2.567v1H11.93zM1.5 18.05h2.433v1H1.5z"/><path fill="#444" d="M5.5 18.05h2.433v1H5.5z"/></g><g><path d="M8 1.559v1" fill="none" stroke="#444"/></g><g><path d="M8 19.025v1" fill="none" stroke="#444"/></g><g><path fill="#444" d="M7.502 2.559h6.995v16.49H7.502z"/></g></svg>',
    'ye--toggle-off':
        '<svg viewBox="0 0 16 21" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" clip-rule="evenodd"><path fill="#444" d="M7.933 2.559h2.566v1H7.933zM11.933 2.559h2.566v1h-2.566zM1.501 2.559h2.435v1H1.5z"/><path fill="#444" d="M5.501 2.559h2.435v1H5.5zM1.5 19.05v-2.435h1v2.434zM1.5 15.634V13.2h1v2.434zM1.5 12.218V9.653h1v2.565zM1.5 8.672V6.106h1v2.566zM1.5 5.125V2.559h1v2.566z"/><g><path fill="#444" d="M13.499 19.05v-2.435h1v2.434zM13.499 15.634V13.2h1v2.434zM13.499 12.218V9.653h1v2.565zM13.499 8.672V6.106h1v2.566zM13.499 5.125V2.559h1v2.566z"/></g><g><path fill="#444" d="M7.93 18.05h2.567v1H7.93zM11.93 18.05h2.567v1H11.93zM1.5 18.05h2.433v1H1.5z"/><path fill="#444" d="M5.5 18.05h2.433v1H5.5z"/></g><g><path d="M8 1.559v1" fill="none" stroke="#444"/></g><g><path d="M8 19.025v1" fill="none" stroke="#444"/></g><g><path fill="#444" d="M1.501 2.559h6v1h-6zM1.999 18.05h6v1H2z"/><path fill="#444" d="M1.5 2.597h1v16.452h-1zM7.502 2.335h1v16.452h-1z"/></g></svg>',
    'ye--report':
        '<svg viewBox="0 0 16 21" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" clip-rule="evenodd"><path d="M3.5 2.5v16h12v-16" fill="none" stroke="#444" stroke-width="1.03" transform="matrix(1 0 0 .93688 -1.502 1.217)"/><path fill="#444" d="M11.933 2.559h2.566v1h-2.566zM1.501 2.559h2.435v1H1.5z"/><path d="M4.436 3.059v-1.5h7v1.5M4.436 3.059v1.5h7v-1.5" fill="none" stroke="#444"/></svg>',
    'ye--report-check':
        '<svg viewBox="0 0 16 21" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" clip-rule="evenodd"><path d="M3.5 2.5v16h12v-16" fill="none" stroke="#444" stroke-width="1.03" transform="matrix(1 0 0 .93688 -1.502 1.217)"/><path fill="#444" d="M11.933 2.559h2.566v1h-2.566zM1.501 2.559h2.435v1H1.5z"/><path d="M4.436 3.059v-1.5h7v1.5M4.436 3.059v1.5h7v-1.5" fill="none" stroke="#444"/><g><path d="m10.638 9.393-3.303 5.121-1.977-1.997" fill="none" stroke="#444" stroke-width=".9846536000000001"/></g></svg>',
    'ye--report-ban':
        '<svg viewBox="0 0 16 21" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" clip-rule="evenodd"><path d="M3.5 2.5v16h12v-16" fill="none" stroke="#444" stroke-width="1.03" transform="matrix(1 0 0 .93688 -1.502 1.217)"/><path fill="#444" d="M11.933 2.559h2.566v1h-2.566zM1.501 2.559h2.435v1H1.5z"/><path d="M4.436 3.059v-1.5h7v1.5M4.436 3.059v1.5h7v-1.5" fill="none" stroke="#444"/><g><circle cx="10" cy="10" r="9" fill="none" stroke="#444" stroke-width="3.17" transform="matrix(.29444 0 0 .29444 5.056 9.079)"/><path d="m6.233 10.11 3.534 3.827" fill="none" stroke="#444" stroke-width=".9333748"/></g></svg>',
    'ye--report-x':
        '<svg viewBox="0 0 16 21" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" clip-rule="evenodd"><path d="M3.5 2.5v16h12v-16" fill="none" stroke="#444" stroke-width="1.03" transform="matrix(1 0 0 .93688 -1.502 1.217)"/><path fill="#444" d="M11.933 2.559h2.566v1h-2.566zM1.501 2.559h2.435v1H1.5z"/><path d="M4.436 3.059v-1.5h7v1.5M4.436 3.059v1.5h7v-1.5" fill="none" stroke="#444"/><g><path d="m5.358 9.393 5.28 5.28M10.638 9.393l-5.28 5.28" fill="none" stroke="#444" stroke-width=".9306563999999999"/></g></svg>',
});