403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/burlakastudio.realcommenter/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/burlakastudio.realcommenter/talk_editor.js
'use strict';

/**
 * Модуль "Полноценные Комментарии D7" под Битрикс
 * Официальный сайт модуля: www.realcommenter.com
 * Официальный сайт разработчика: burlaka.studio
 * Автор и разработчик: Алексей Бурлака (AlexeyGfi) -> alexeygfi@gmail.com
 */

function realcommenterHtmlEditorOnInit(obj, silentMode) {

    /**
     * textarea должен иметь особый аттрибут, соответствующий пользовательскому полю таблицы
     */

    if (!obj || !obj.pTextarea) {
        return;
    }

    obj.pTextarea.setAttribute('data-input', 'UF_COMMENT');
    obj.pTextarea.setAttribute('data-require', '1');
    obj.pTextarea.setAttribute('data-editor-type', 'html');

    if (!silentMode) {
        /**
         * Пробрасываем курсор внутрь, чтобы было видно, где редактор
         */

        setTimeout(function () {
            this.pEditorDocument.children[0].focus();
        }.bind(obj), 50);
    }

}

BX.addCustomEvent('LHE_ConstructorInited', realcommenterHtmlEditorOnInit);

function realcommenterHtmlEditorTpl(editorPrefix) {

    let div = document.createElement('div');
    div.id = 'bxlhe_frame_' + editorPrefix;
    div.className = 'bxlhe-frame';
    div.innerHTML = '<table class="bxlhe-frame-table" cellspacing="0" style="height:100px; width: 100%;"><tr class="bxlhe-editor-toolbar-row"><td class="bxlhe-editor-buttons"><div class="lhe-stat-toolbar-cont brfb_tools lhe-stat-toolbar-cont-preload"></div></td></tr><tr><td class="bxlhe-editor-cell" style=""></td></tr></table><div class="bxlhe_resizer_area"><img id="bxlhe_resize_' + editorPrefix + '" src="/bitrix/images/1.gif"/></div>';

    return div;

}

function realcommenterHtmlEditorPlaceAndInit(node, editorPrefix, content, silentMode) {

    if (!node || !editorPrefix) {
        return;
    }

    if (!content) {
        content = '';
    }

    let lheHeight = 200;

    let divObj = realcommenterHtmlEditorTpl(editorPrefix);
    node.appendChild(divObj);

    function _lheScriptloaded() {
        if (!window.JCLightHTMLEditor) {
            return setTimeout(_lheScriptloaded, 10);
        }

        if (
            typeof JCLightHTMLEditor.items[editorPrefix] === 'undefined' ||
            !document.body.contains(JCLightHTMLEditor.items[editorPrefix].pFrame)
        ) {

            let editorSettings = {
                'id': editorPrefix,
                'content': content,
                'bBBCode': false,
                'bUseFileDialogs': false,
                'bUseMedialib': false,
                'arSmiles': '',
                'arFonts': false,
                'arFontSizes': false,
                'inputName': editorPrefix,
                'inputId': editorPrefix,
                'videoSettings': false,
                'bSaveOnBlur': true,
                'bResizable': true,
                'autoResizeSaveSize': true,
                'bManualResize': false,
                'bAutoResize': true,
                'bReplaceTabToNbsp': true,
                'bSetDefaultCodeView': false,
                'bBBParseImageSize': false,
                'smileCountInToolbar': '0',
                'bQuoteFromSelection': true,
                'bConvertContentFromBBCodes': false,
                'oneGif': '/bitrix/images/1.gif',
                'imagePath': '/bitrix/images/fileman/light_htmledit/',
                'width': '100%',
                'height': lheHeight + 'px',
                'controlButtonsHeight': 30,
                'toolbarConfig': ['Bold', 'Italic', 'Quote', 'RemoveFormat' /*'=|=', 'Code', 'Source', *//*'Underline', 'Strike', 'RemoveFormat', *//*'CreateLink', 'DeleteLink', *//*'Image', *//*'BackColor', 'ForeColor', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyFull', 'InsertOrderedList', 'InsertUnorderedList', 'Outdent', 'Indent', 'StyleList', 'HeaderList', 'FontList', 'FontSizeList'*/
                ],
                'documentCSS': 'body{ background-color: white; padding: 10px !important; border: 1px solid #bdbdbd !important; font-size: 1em; font-family: Arial;  border-radius: 0 5px 5px; min-width: 220px; line-height: 1.4em !important; -webkit-transition: border-color 0.3s ease-in 0s;  -moz-transition: border-color 0.3s ease-in 0s;  -o-transition: border-color 0.3s ease-in 0s;  transition: border-color 0.3s ease-in 0s; } body:focus { border-color: #003D5C !important; outline: none !important; box-shadow: -1px 1px 8px -1px rgba(0, 61, 92, 0.49) inset; } blockquote {margin: 15px 5px 5px 0;color: #717171;font-style: oblique;border-left: 2px solid;padding-left: 10px;font-size: .9em; background-color: #f1f1f1; padding: 10px 20px;}'
            };

            if (BX.message('realcommenter_brand_manager') || BX.message('realcommenter_any_moder')) {
                editorSettings.toolbarConfig.push('CreateLink');
                editorSettings.toolbarConfig.push('DeleteLink');
            }

            if (BX.message('realcommenter_any_moder')) {
                editorSettings.toolbarConfig.push('=|=');
                editorSettings.toolbarConfig.push('Source');
            }

            top[editorPrefix] = window[editorPrefix] = new window.JCLightHTMLEditor(editorSettings);

            BX.onCustomEvent(
                window,
                'LHE_ConstructorInited',
                [window[editorPrefix], silentMode]);
        }
    }

    if (!window.JCLightHTMLEditor) {

        LHE_MESS = window.LHE_MESS = '';

        BX.loadCSS(realcommenter_get_jscss_url('light_editor.css'));

        let loadList = [
            realcommenter_get_jscss_url('le_dialogs.js'),
            realcommenter_get_jscss_url('le_core.js'),
            realcommenter_get_jscss_url('talk_editor_toolbar_buttons.js'),
            realcommenter_get_jscss_url('talk_editor_controls.js')
        ];

        if (BX.message('realcommenter_any_moder') || BX.message('realcommenter_brand_manager')) {
            BX.loadCSS(realcommenter_get_jscss_url('popup.css'));
            loadList.unshift(realcommenter_get_jscss_url('le_controls.js'));
        }

        BX.loadScript(loadList, _lheScriptloaded);

    } else {
        _lheScriptloaded();
    }
}


Youez - 2016 - github.com/yon3zu
LinuXploit