if (!window.shop_dp) { window.shop_dp = { plugin_url: '/wa-apps/shop/plugins/dp/', dialog_url: '/dp-plugin/dialog/', service_url: '/dp-plugin/service/', point_url: '/dp-plugin/city-save/', city_search_url: '/dp-plugin/city-search/', city_save_url: '/dp-plugin/city-save/', location: { country_code: 'rus', country_name: 'Российская Федерация', region_code: '77', region_name: 'Москва', city: 'Москва' }, maps: 'yandex', loader: { assets: {}, loadCSS: function(url) { $('') .appendTo('head') .attr({ type: 'text/css', rel: 'stylesheet', href: url }); }, load: function(asset, callback) { var self = this; var resolve = function() { if (typeof callback === 'function' && asset in self.assets) { callback.call(window.shop_dp.loader.assets[asset]); } }; if (window['shop_dp_is_loading_asset_' + asset]) { $(document).on('shop_dp_asset_loaded_' + asset, resolve); return false; } if (!(asset in this.assets) && !window['shop_dp_is_loading_asset_' + asset]) { window['shop_dp_is_loading_asset_' + asset] = true; $.ajax({ dataType: 'script', cache: false, url: window.shop_dp.plugin_url + 'js/' + (asset === 'core' ? 'core' : 'frontend.' + asset) + '.js', complete: function() { window['shop_dp_is_loading_asset_' + asset] = false; $(document).trigger('shop_dp_asset_loaded_' + asset); resolve(); } }); } else { resolve(); } } } }; (function($) { window.shop_dp.loader.load('core'); })(jQuery); }