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/cvetdv.ru/bitrix/modules/burlakastudio.realcommenter/lib/ |
Upload File : |
<?php namespace Burlakastudio\Realcommenter; use Bitrix\Main\Context; use CJSCore; class BehindAjaxWrapper { public static function deployScene($maxDeployAttempts = 20) { $request = Context::getCurrent()->getRequest(); if (!$request->isAjaxRequest()) { return; } CJSCore::RegisterExt('realcommenter_after_ajax_wrapper', [ 'js' => '/bitrix/js/burlakastudio.realcommenter/behindAjaxWrapper.js', ]); CJSCore::Init('realcommenter_after_ajax_wrapper'); ?> <script type="javascript"> function realcommenterAjaxDeployAssets () { let awaitAttempt = 0; let maxAwaitAttempts = <?= $maxDeployAttempts?>; function ajaxAftermathAwait () { if (!window['behindAjaxWrapperReInit']) { if (++awaitAttempt < maxAwaitAttempts) { console.log('await'); setTimeout(ajaxAftermathAwait, 50); } return; } setTimeout(behindAjaxWrapperReInit, 500); } ajaxAftermathAwait(); <?php $server = Context::getCurrent()->getServer(); global $MESS; include $server->getDocumentRoot() . '/bitrix/modules/burlakastudio.realcommenter/lang/' . LANGUAGE_ID . '/js/talk_tree_js_options.php'; foreach($MESS as $langKey => $langText) { ?> BX.message['<?= $langKey?>'] = '<?= $langText?>'; <?php } ?> } BX.ready(realcommenterAjaxDeployAssets); </script> <?php } }