Your IP : 18.116.20.205


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/ebay_admin.min.js

(function(e){if(!BX.Sale)BX.Sale={};if(!BX.Sale.EbayAdmin)BX.Sale.EbayAdmin={};BX.Sale.EbayAdmin={ajaxUrl:"/bitrix/admin/sale_ebay_ajax.php",startFeed:function(e,t,a){BX.showWait();var i={action:"startFeed",type:e,siteId:t,sessid:BX.bitrix_sessid()};if(a)i.startPos=a;BX.ajax({timeout:120,method:"POST",dataType:"json",url:BX.Sale.EbayAdmin.ajaxUrl,data:i,onsuccess:function(t){BX.closeWait();if(t&&t.COMPLETED){alert(BX.message("SALE_EBAY_EXCHANGE_OK"))}else if(t&&t.ERROR){alert(BX.message("SALE_EBAY_EXCHANGE_ERROR")+".\n"+t.ERROR)}else if(t){var a=t.END_ROW||0;BX.Sale.EbayAdmin.startFeed(e,a)}else{alert(BX.message("SALE_EBAY_EXCHANGE_ERROR"))}},onfailure:function(){BX.debug("Feed failure!")}})},addIblockSelect:function(){var e=BX("SALE_EBAY_IBLOCK_CHOOSE").lastElementChild.cloneNode(true);BX("SALE_EBAY_IBLOCK_CHOOSE").appendChild(e);if(e.firstElementChild.options["0"])e.firstElementChild.value="0";e.firstElementChild.name=e.firstElementChild.id=BX.Sale.EbayAdmin.iblockSelectNameIncrement(e.firstElementChild.name);e.firstElementChild.setAttribute("onchange",BX.Sale.EbayAdmin.iblockSelectNameIncrement(e.firstElementChild.getAttribute("onchange")));if(e.firstElementChild.options["0"])e.firstElementChild.value="0";e.lastElementChild.name=e.lastElementChild.id=BX.Sale.EbayAdmin.iblockSelectNameIncrement(e.lastElementChild.name)},iblockSelectNameIncrement:function(e){if(!e||!e.replace)return;return e.replace(/(.*)\[(\d+)\](.*)/,"$1[$21]$3")},refreshCategoriesData:function(e){BX.showWait();var t={action:"refreshCategoriesData",siteId:e,sessid:BX.bitrix_sessid()};BX.ajax({timeout:300,method:"POST",dataType:"json",url:BX.Sale.EbayAdmin.ajaxUrl,data:t,onsuccess:function(e){BX.closeWait();if(e&&e.COUNT){alert("Refreshed "+e.COUNT+" categories.")}else if(e&&e.ERROR){alert(e.ERROR)}else{BX.debug("BX.Sale.EbayAdmin.refreshCategoriesData error!")}},onfailure:function(){BX.debug("BX.Sale.EbayAdmin.refreshCategoriesData failure!")}})},refreshCategoriesPropsData:function(e){BX.showWait();var t={action:"refreshCategoriesPropsData",siteId:e,sessid:BX.bitrix_sessid()};BX.ajax({timeout:120,method:"POST",dataType:"json",url:BX.Sale.EbayAdmin.ajaxUrl,data:t,onsuccess:function(e){BX.closeWait();if(e&&e.COUNT){alert("Refreshed properties for "+e.COUNT+" categories.")}else if(e&&e.ERROR){alert(e.ERROR)}else{BX.debug("BX.Sale.EbayAdmin.refreshCategoriesPropsData error!")}},onfailure:function(){BX.debug("BX.Sale.EbayAdmin.refreshCategoriesPropsData failure!")}})},setOpenerFieldsFromHash:function(t){var a=true,i="{";if(e.location.hash){var r=e.location.hash.substring(1).split("&");for(var n in r){if(!r.hasOwnProperty(n))continue;var s=r[n].split("=");if(!s)continue;var o=BX.Sale.EbayAdmin.setOpenerFieldFromHash(s[0],s[1]);a=a&&o;if(i!="{")i+=", ";i+='"'+s[0]+'":"'+s[1]+'"'}}if(i!="{")i+=", ";i+='"messageType":"'+t+'"}';if(parent.window.opener)parent.window.opener.postMessage(i,e.location.origin);e.addEventListener("message",function(t){if(t.data=="MESSAGE_RECEIVED")e.close()},false);return a},setOpenerFieldFromHash:function(e,t){var a="SALE_EBAY_SETTINGS_"+e,i=null,r=false;if(parent.window.opener!==null){try{i=parent.window.opener.document.getElementById(a);r=true}catch(n){}}if(!i)i=BX(a);if(i){t=decodeURIComponent(t);if(i.type=="text")i.value=t;else if(i.type=="textarea")i.value=t}return r},showAlertOpener:function(t){if(parent.window.opener!==null){try{parent.window.opener.alert(t);return true}catch(a){}}e.alert(t);return false},addSftpTokenEventListener:function(t,a){e.addEventListener("message",function(a){if(a.origin==e.location.origin||a.origin=="http://www.1c-bitrix.ru.smn"||a.origin=="https://www.1c-bitrix.ru"){var i=BX("SALE_EBAY_SETTINGS_SFTP_TOKEN"),r=BX("SALE_EBAY_SETTINGS_SFTP_TOKEN_EXP"),n=JSON.parse(a.data);if(!n.messageType||n.messageType!="SFTP_TOKEN")return;if(r&&n.SFTP_TOKEN_EXP)r.value=decodeURIComponent(n.SFTP_TOKEN_EXP);if(i&&n.SFTP_TOKEN)i.value=decodeURIComponent(n.SFTP_TOKEN);if((n.SFTP_ACCOUNT_STATE=="ACTIVE"||n.SFTP_ACCOUNT_STATE=="SUBSCRIBED")&&n.SFTP_TOKEN!=""){alert(t.messageOk);if(t.submit&&r&&r.form)r.form.submit()}else{alert(t.messageError)}a.source.postMessage("MESSAGE_RECEIVED",a.origin)}},false)},addApiTokenListener:function(t){e.addEventListener("message",function(a){if(a.origin==e.location.origin||a.origin=="http://www.1c-bitrix.ru.smn"||a.origin=="http://www.1c-bitrix.ru"){var i=BX("SALE_EBAY_SETTINGS_API_TOKEN"),r=BX("SALE_EBAY_SETTINGS_API_TOKEN_EXP"),n=JSON.parse(a.data);if(!n.messageType||n.messageType!="API_TOKEN")return;if(r&&n.API_TOKEN_EXP)r.value=decodeURIComponent(n.API_TOKEN_EXP);if(i&&n.API_TOKEN){i.value=decodeURIComponent(n.API_TOKEN);a.source.postMessage("MESSAGE_RECEIVED",a.origin);alert(t.messageOk)}else{alert(t.messageError)}}},false)}}})(window);
//# sourceMappingURL=ebay_admin.map.js