Your IP : 18.119.28.173


Current Path : /var/www/u0635749/data/www/hobbyclick.ru/public/hobbyclick/bitrix/js/sale/
Upload File :
Current File : /var/www/u0635749/data/www/hobbyclick.ru/public/hobbyclick/bitrix/js/sale/vk_admin.min.js

(function(e){if(!BX.Sale)BX.Sale={};if(!BX.Sale.VkAdmin){BX.Sale.VkAdmin={}}BX.Sale.VkAdmin={ajaxUrl:"/bitrix/admin/sale_vk_ajax.php",startFeed:function(e,t,o){BX.Sale.VkAdmin.exportProcessProlog();if(o)BX.cleanNode(BX("vk_export_notify__progress"));BX.showWait();var a={action:"startFeed",type:e,exportId:t,firstRun:o,sessid:BX.bitrix_sessid()};BX.ajax({timeout:120,method:"POST",dataType:"json",url:BX.Sale.VkAdmin.ajaxUrl,data:a,onsuccess:function(e){if(e&&e.ERRORS_CRITICAL){BX.closeWait();BX.adjust(BX("vk_export_notify__error_critical"),{style:{display:"block"}});BX.adjust(BX("vk_export_notify__error_critical"),{html:e.ERRORS_CRITICAL});if(e.PROGRESS.length>0)BX.adjust(BX("vk_export_notify__progress"),{html:e.PROGRESS});BX.Sale.VkAdmin.exportProcessEpilog()}else{if(e&&e.CONTINUE){BX.closeWait();BX.Sale.VkAdmin.startFeed(e.TYPE,t,false)}else{BX.closeWait();BX.Sale.VkAdmin.exportProcessEpilog()}if(e.PROGRESS.length>0)BX.adjust(BX("vk_export_notify__progress"),{html:e.PROGRESS});if(typeof e.STATS_ALBUMS!="undefined"&&e.STATS_ALBUMS.length>0)BX.adjust(BX("vk_export_statistic__albums"),{html:e.STATS_ALBUMS});if(typeof e.STATS_PRODUCTS!="undefined"&&e.STATS_PRODUCTS.length>0)BX.adjust(BX("vk_export_statistic__products"),{html:e.STATS_PRODUCTS});if(typeof e.ERRORS_NORMAL!="undefined"&&e.ERRORS_NORMAL.length>0){BX.adjust(BX("vk_export_notify__error_normal"),{style:{display:"block"}});BX.adjust(BX("vk_export_notify__error_normal__msg"),{html:e.ERRORS_NORMAL})}}},onfailure:function(){BX.closeWait();BX.Sale.VkAdmin.exportProcessEpilog();BX.debug("Feed failure!");location.reload()}})},exportProcessProlog:function(){BX.adjust(BX("vk_export_button__startFeed_all"),{props:{disabled:true}});var e=document.getElementsByClassName("adm-btn-menu");for(var t=0;t<e.length;t++){BX.adjust(e[t],{style:{display:"none"}});BX.addClass(e[t],"adm-btn-disabled")}BX.adjust(BX("vk_export_button__save"),{props:{disabled:true}});BX.adjust(BX("vk_export_button__apply"),{props:{disabled:true}});BX.adjust(BX("vk_export_button__cancel"),{props:{disabled:true}})},exportProcessEpilog:function(){BX.adjust(BX("vk_export_button__startFeed_all"),{props:{disabled:false}});var e=document.getElementsByClassName("adm-btn-menu");for(var t=0;t<e.length;t++){BX.adjust(e[t],{style:{display:"inline-block"}});BX.removeClass(e[t],"adm-btn-disabled")}BX.adjust(BX("vk_export_button__save"),{props:{disabled:false}});BX.adjust(BX("vk_export_button__apply"),{props:{disabled:false}});BX.adjust(BX("vk_export_button__cancel"),{props:{disabled:false}})},stopProcess:function(e){BX.showWait();var t={action:"stopProcess",exportId:e,sessid:BX.bitrix_sessid()};BX.ajax({timeout:120,method:"POST",dataType:"json",url:BX.Sale.VkAdmin.ajaxUrl,data:t,onsuccess:function(e){BX.closeWait();if(e&&e.COMPLETED){}else{alert(e.ERROR)}BX.Sale.VkAdmin.exportProcessEpilog()},onfailure:function(){BX.debug("Feed SALE_VK_SETTINGS_RESET_ERROR")}})},clearErrorLog:function(e){BX.showWait();var t={action:"clearErrorLog",exportId:e,sessid:BX.bitrix_sessid()};BX.ajax({timeout:120,method:"POST",dataType:"json",url:BX.Sale.VkAdmin.ajaxUrl,data:t,onsuccess:function(e){BX.closeWait();if(e&&e.COMPLETED){BX.adjust(BX("vk_export_notify__error_normal"),{style:{display:"none"}});BX.adjust(BX("vk_export_notify__error_critical"),{style:{display:"none"}})}else{alert(e.MESSAGE)}},onfailure:function(){BX.closeWait();BX.debug("Feed SALE_VK_SETTINGS_RESET_ERROR")}})},loadExportMapOk:false,loadExportMap:function(e){if(!BX.Sale.VkAdmin.loadExportMapOk){var t={action:"loadExportMap",exportId:e,sessid:BX.bitrix_sessid()};BX.ajax({timeout:120,method:"POST",dataType:"json",url:BX.Sale.VkAdmin.ajaxUrl,async:true,data:t,onsuccess:function(e){if(e&&e.COMPLETED){BX.adjust(BX("vk_export_map_edit_table__content"),{html:e.MAP});BX.Sale.VkAdmin.loadExportMapOk=true}},onfailure:function(){BX.debug("LOAD EXPORT MAP ERROR")}})}},changeVkGroupLink:function(){BX("vk_export_groupselector__link").href="https://vk.com/club"+BX("vk_export_groupselector").value}}})(window);