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/skyweb24.popuppro/admin/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/skyweb24.popuppro/admin/preview.js
BX.ready(function () {
 
    BX.namespace("PopupproAdminPreview");

    BX.PopupproAdminPreview = function(){
        this.init();
    };

    BX.PopupproAdminPreview.prototype = {
        init: function () {

            this.CPreviewForm = document.querySelector("#sw24_popup_settings .bx-block-editor-preview-container");
            this.CPreviewSuccess = document.querySelector("#sw24_popup_window_success .bx-block-editor-preview-container");
            this.CStatistic = BX("sw24_popup_statistics");

            this._events();
        },

        update: function(vars = {}, func = {}){
            if (Object.keys(vars).length > 0) {
                for (let key in vars) {
                    frames['preview_iframe'][key] = vars[key];
                }
            }

            if (Object.keys(func).length > 0) {
                for (let f in func) {
                    let _o = false;

                    for(let o of f.split("."))
                    {
                        if(!_o) {
                            _o = frames['preview_iframe'][o];
                        }
                        else{
                            _o = _o[o];
                        }
                    }

                    if(_o) _o.apply(this, func[f]);
                }
            }

            // dev ...
        },

        _request: function(fields){
            return $.ajax({
                url: location.href,
                data: fields,
                method: "POST"
            });
        },

        _events: function () {
            let _self = this;

            BX.bindDelegate(this.CPreviewForm, "click", {className: "action-show"}, function () {
                let nameAnimation = document.querySelectorAll("[name='SHOW_ANIMATION']")[0].value;
                frames['preview_iframe'].document.body.style.removeProperty("opacity");
                frames['preview_iframe'].document.body.setAttribute("class", "popup-window sw24PopupPro animated " + nameAnimation);
            });

            BX.bindDelegate(this.CPreviewForm, "click", {className: "action-hide"}, function () {
                let nameAnimation = document.querySelectorAll("[name='HIDE_ANIMATION']")[0].value;
                frames['preview_iframe'].document.body.style.setProperty("opacity", 0, "important");
                frames['preview_iframe'].document.body.classList.add(nameAnimation);
            });

            BX.bindDelegate(this.CStatistic, "click", {className: "statistic_reset"}, BX.proxy(function (e) {
                if (window.confirm(BX.message("SKYWEB24_POPUPPRO_STATISTIC_RESET_CONFIRM"))) {
                    _self._request({
                        ajax: "y",
                        command: "statistic_reset",
                        popupId: e.target.dataset.popupId
                    }).done(function (data) {
                        if (data) {
                            location.reload();
                        }
                    });
                }
            }, this));




            BX.addCustomEvent('onPreviewUpdate', function (params) {

                // TODO перенести обновление превью в этот класс
                managerPopupPro.updatePreview(false);
                managerPopupPro.renderIframeContent();

                // _self.update();
            });

        }
    }
});


Youez - 2016 - github.com/yon3zu
LinuXploit