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 : |
function behindAjaxWrapperReInit () { behindAjaxWrapperHandlers.awaitFunctions = [ { handler: 'realcommenter_get_selector', attempts: 0 }, ]; behindAjaxWrapperHandlers.postInitFunctions = [ { handler: 'realcommenter_init_tools', attempts: 0 }, { handler: 'realcommenter_gallery_scan_and_init', attempts: 0 }, { handler: 'realcommenter_admintools_scan_and_init', attempts: 0 }, { handler: 'realcommenter_forms_scan_and_init', attempts: 0 }, { handler: 'safScanAndInit', attempts: 0 }, ]; // !!! Every call full reinit // ...because of ajax behindAjaxWrapperHandlers.maxAttempts = 20; behindAjaxWrapperHandlers.timeStep = 50; behindAjaxWrapperAwaiters(); } function behindAjaxWrapperHandlers () { let nextTickBundle = []; behindAjaxWrapperHandlers.postInitFunctions.forEach(function (funcOptions) { if (typeof window[funcOptions.handler] !== 'undefined') { if (window[funcOptions.handler] instanceof Function) { window[funcOptions.handler](); } } else { if (++funcOptions.attempts < behindAjaxWrapperHandlers.maxAttempts) { nextTickBundle.push(funcOptions); } else { console.log('dropped attempts for %o', funcOptions); } } }); if (nextTickBundle.length) { behindAjaxWrapperHandlers.postInitFunctions = nextTickBundle; setTimeout(behindAjaxWrapperHandlers, behindAjaxWrapperHandlers.timeStep); } } function behindAjaxWrapperAwaiters () { let nextTickBundle = []; behindAjaxWrapperHandlers.awaitFunctions.forEach(function (funcOptions) { if ( typeof window[funcOptions.handler] === 'undefined' || !(window[funcOptions.handler] instanceof Function) ) { if (++funcOptions.attempts < behindAjaxWrapperHandlers.maxAttempts) { nextTickBundle.push(funcOptions); } else { console.log('dropped await for %o', funcOptions); } } }); if (nextTickBundle.length) { behindAjaxWrapperHandlers.awaitFunctions = nextTickBundle; setTimeout(behindAjaxWrapperAwaiters, behindAjaxWrapperHandlers.timeStep); } else { behindAjaxWrapperHandlers(); } }