VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /var/www/html/libs/absol-form/document/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/libs/absol-form/document/class_interface.js
var _ = absol._;
var $ = absol.$;
var BODY = document.body;
var AssemblerInstance = absol.form.AssemblerInstance;


var testBlocks = {};

function makeTestBlock(clazz) {
    if (clazz.prototype.type === 'COMPONENT') {
        return AssemblerInstance.buildComponent({ tag: clazz.prototype.tag });
    }
    else if (clazz.prototype.type === 'BLOCK') {
        return AssemblerInstance.buildBlock({ tag: clazz.prototype.tag });
    }
}

function getTestBlock(clazz) {
    testBlocks[clazz.prototype.tag] = testBlocks[clazz.prototype.tag] || makeTestBlock(clazz);
    return testBlocks[clazz.prototype.tag];
}

function analysisDescriptor(handler, clazz) {
    var descriptor = handler.getDescriptor || handler.descriptor;
    var res = { type: "*", description: {} };

    var block;
    if (typeof descriptor === "function") {
        block = testBlocks[clazz.prototype.tag] || makeTestBlock(clazz);
        descriptor = descriptor.call(block);
    }

    if (typeof descriptor === 'object') {
        res.type = descriptor.type || res.type;
    }
    return res;
}


function printBlockInfo(clazz, ctn) {
    var title = _({
        tag: 'h3',
        child: [
            clazz.prototype.menuIcon,
            { text: ' ' },
            { text: clazz.prototype.tag }
        ]
    }).addTo(ctn);
    _({
        tag: 'table',
        class: 'memberSummary',
        child: [
            {
                tag: 'caption',
                child: {
                    tag: 'span',
                    child: { text: 'attributes' }
                }
            },
            {
                tag: 'thead',
                child: [
                    {
                        tag: 'tr',
                        child: [
                            { tag: 'th', class: 'colFirst', child: { text: 'Name' } },
                            { tag: 'th', class: 'colTwo', child: { text: 'Type' } },
                            { tag: 'th', class: 'colTwo', child: { text: 'Default' } },
                            { tag: 'th', class: 'colLast', child: { text: 'Description' } }
                        ]
                    }
                ]
            },
            {
                tag: 'tbody',
                child: Object.keys(clazz.prototype.attributeHandlers).map(function (name, i) {
                    var tag = clazz.prototype.tag;
                    var type = getTestBlock(clazz).attributes.getPropertyDescriptor(name).type;
                    var description;
                    description = (CI_Doc[tag] && CI_Doc[tag].attributes && CI_Doc[tag].attributes[name]) || CI_Doc.attributes[name];
                    description = description || [];
                    var defaultValue = '';
                    if (!name.match(/^(id|name|groupName)$/))
                        defaultValue = JSON.stringify(getTestBlock(clazz).attributes[name]);

                    return {
                        tag: 'tr',
                        class: i % 2 === 0 ? 'altColor' : 'rowColor',
                        child: [
                            { tag: 'td', class: 'colFirst', child: { text: name } },
                            { tag: 'td', class: 'colTwo', child: { text: type } },
                            { tag: 'td', class: 'colTwo', child: { text: defaultValue } },
                            { tag: 'td', class: 'colLast', child: description }
                        ]
                    }
                })
            }

        ]
    }).addTo(ctn);
    if (clazz.prototype.styleHandlers)
        _({
            tag: 'table',
            class: 'memberSummary',
            child: [
                {
                    tag: 'caption',
                    child: {
                        tag: 'span',
                        child: { text: 'style' }
                    }
                },
                {
                    tag: 'thead',
                    child: [
                        {
                            tag: 'tr',
                            child: [
                                { tag: 'th', class: 'colFirst', child: { text: 'Name' } },
                                { tag: 'th', class: 'colTwo', child: { text: 'Type' } },
                                { tag: 'th', class: 'colTwo', child: { text: 'Default' } },
                                { tag: 'th', class: 'colLast', child: { text: 'Description' } }
                            ]
                        }
                    ]
                },
                {
                    tag: 'tbody',
                    child: Object.keys(clazz.prototype.styleHandlers).map(function (name, i) {
                        var type = getTestBlock(clazz).style.getPropertyDescriptor(name).type;
                        var defaultValue = '';
                        defaultValue = JSON.stringify(getTestBlock(clazz).attributes[name]);
                        return {
                            tag: 'tr',
                            class: i % 2 === 0 ? 'altColor' : 'rowColor',
                            child: [
                                { tag: 'td', class: 'colFirst', child: { text: name } },
                                { tag: 'td', class: 'colTwo', child: { text: type } },
                                {
                                    tag: 'td',
                                    class: 'colTwo',
                                    child: { text: defaultValue }
                                },

                                { tag: 'td', class: 'colLast', child: {} }
                            ]
                        }
                    })
                }

            ]
        }).addTo(ctn);
    if (clazz.prototype.pinHandlers) {
        _({
            tag: 'table',
            class: 'memberSummary',
            child: [
                {
                    tag: 'caption',
                    child: {
                        tag: 'span',
                        child: { text: 'pins' }
                    }
                },
                {
                    tag: 'thead',
                    child: [
                        {
                            tag: 'tr',
                            child: [
                                { tag: 'th', class: 'colFirst', child: { text: 'Name' } },
                                { tag: 'th', class: 'colTwo', child: { text: 'Type' } },
                                { tag: 'th', class: 'colSmall', child: { text: 'IN' } },
                                { tag: 'th', class: 'colSmall', child: { text: 'OUT' } },
                                { tag: 'th', class: 'colLast', child: { text: 'Description' } }
                            ]
                        }
                    ]
                },
                {
                    tag: 'tbody',
                    child: Object.keys(clazz.prototype.pinHandlers).map(function (name, i) {
                        var tag = clazz.prototype.tag;
                        var handler = clazz.prototype.pinHandlers[name];
                        var descriptor = analysisDescriptor(handler, clazz);
                        var description = (CI_Doc[tag] && CI_Doc[tag].pins && CI_Doc[tag].pins[name]) || CI_Doc.pins[name];
                        description = description || [];
                        return {
                            tag: 'tr',
                            class: i % 2 === 0 ? 'altColor' : 'rowColor',
                            child: [
                                { tag: 'td', class: 'colFirst', child: { text: name } },
                                { tag: 'td', class: 'colTwo', child: { text: descriptor.type } },
                                {
                                    tag: 'td', class: 'colSmall',
                                    child: handler.receives ? {
                                        tag: 'span',
                                        style: { color: 'rgb(30, 230, 30)' },
                                        class: ['mdi', 'mdi-check-outline']
                                    } : 'span'
                                },
                                {
                                    tag: 'td', class: 'colSmall',
                                    child: handler.get ? {
                                        tag: 'span',
                                        style: { color: 'rgb(30, 230, 30)' },
                                        class: ['mdi', 'mdi-check-outline']
                                    } : 'span'
                                },

                                { tag: 'td', class: 'colLast', child: description }
                            ]
                        }
                    })
                }

            ]
        }).addTo(ctn);
    }
}


function printComponentListInfo(ctn) {
    _('<h2 class="title">Blocks</h2>').addTo(ctn);
    var BlockClasses = AssemblerInstance.classes['BLOCK'];
    Object.keys(BlockClasses).forEach(function (tag) {
        printBlockInfo(BlockClasses[tag], ctn);
    });

    _('<h2 class="title">Components</h2>').addTo(ctn);
    var ComponentClasses = AssemblerInstance.classes['COMPONENT'];
    Object.keys(ComponentClasses).forEach(function (tag) {
        printBlockInfo(ComponentClasses[tag], ctn);
    });
}


function main() {
    _('<h1>Class Interface</h1>').addTo(BODY);
    printComponentListInfo(BODY);
}


main();

VaKeR 2022