var OShotTourVars = {"getDataUrl":"https:\/\/export.otpusk.com\/api\/tours\/hot\/","getBlocksUrl":"https:\/\/export.otpusk.com\/api\/tours\/hotBlock\/","getToursUrl":"https:\/\/export.otpusk.com\/api\/tours\/hotTour\/","blockId":17146,"timestamp":1565202285}; // document.write('
'); // console.log(OShotTourVars); /*! * accounting.js v0.4.1, copyright 2014 Open Exchange Rates, MIT license, http://openexchangerates.github.io/accounting.js */ (function(p,z){function q(a){return!!(""===a||a&&a.charCodeAt&&a.substr)}function m(a){return u?u(a):"[object Array]"===v.call(a)}function r(a){return"[object Object]"===v.call(a)}function s(a,b){var d,a=a||{},b=b||{};for(d in b)b.hasOwnProperty(d)&&null==a[d]&&(a[d]=b[d]);return a}function j(a,b,d){var c=[],e,h;if(!a)return c;if(w&&a.map===w)return a.map(b,d);for(e=0,h=a.length;ea?"-":"",g=parseInt(y(Math.abs(a||0),h),10)+"",l=3a?g.neg:g.zero).replace("%s",f.symbol).replace("%v",t(Math.abs(a),n(f.precision),f.thousand,f.decimal))};c.formatColumn=function(a,b,d,i,e,h){if(!a)return[];var f=s(r(b)?b:{symbol:b,precision:d,thousand:i,decimal:e,format:h},c.settings.currency),g=x(f.format),l=g.pos.indexOf("%s")a?g.neg:g.zero).replace("%s",f.symbol).replace("%v",t(Math.abs(a),n(f.precision),f.thousand,f.decimal));if(a.length>k)k=a.length;return a});return j(a,function(a){return q(a)&&a.length135){ self.view.$.find(" .hot-otp-price-count").css({'text-align':'left'}); }else{ self.view.$.find(" .hot-otp-price-count").css({'text-align':'right'}); self.view.$.find(" .hot-price-block").width('80'); } } if(!self.view.$.hasClass('hot-block_string')){ //console.log(self.view.$); if (self.view.$.width()<=410){ self.view.$.addClass(column_block).removeClass(list_block).removeClass(table_block); } if(self.view.$.hasClass(column_block) && self.view.$.width()>473){ self.view.$.addClass(list_block).removeClass(column_block); self.view.$.find(tour_block).width('auto'); } if(self.view.$.width()<600){ if(self.view.$.hasClass(table_block)){ self.view.$.addClass(list_block).removeClass(table_block); } }else{ if(self.view.$.hasClass(list_block)){ self.view.$.addClass(table_block).removeClass(list_block); } } if(self.view.$.hasClass(column_block) || self.view.$.hasClass(table_block)){ var imgWidth = self.view.$.find(".hot-otp-img").width(), imgHeight = self.view.$.find(".hot-otp-img").height(); if (imgWidth<200) {imgWidth = 200;} } if(self.view.$.hasClass(list_block) || self.view.$.hasClass(block_string)){ self.view.$.find(tour_block).width('auto'); } self.view.$.find(tour_block).width(imgWidth); if(self.view.$.hasClass(table_block)){ self.view.$.find(' .hot-otp-form-wrap').each(function(){ var infoHeight = $jq(this).find('.hot-otp-info_place').height(), hotelHeight = $jq(this).find('.hot-otp-description').height(), TopCity = (imgHeight + 30 + infoHeight), TopCountry = (imgHeight + 55 + infoHeight); $jq(this).find(".hot-otp-departure-city").css('top',-TopCity); $jq(this).find(".hot-country").css('top',-TopCountry); $jq(this).find('.hot-otp-description').css('margin-top',infoHeight+5); $jq(this).find('.hot-otp-info_place').css('margin-top',-(hotelHeight+infoHeight+9)); $jq(this).find('.hot-price-block').css('margin-top',hotelHeight+10); }); } } } }; /** * Run widget */ var startFunction = function() { // load block data self.getHotBlocks(function(block){ self.data = block; var tours = []; var $block = $jq('#otpusk_onsite_hot' + params.blockId); $block.empty(); if (!block.error) { if (typeof noHotStyles !== 'undefined') { //do nothing } else { $block.append($jq('').append(block.css)); } if (typeof block.block.view_type === 'undefined') { block.block.view_type = 'string'; } if('click_action' in block.block && block.block.click_action === 'form') { if('undefined' === typeof window.otpHotOrder) { $jq('head').append($jq('').attr('rel', 'stylesheet').attr('type', 'text/css').attr('href', 'https://export.otpusk.com/jsapi/order.min.css')); $jq('head').append($jq('').attr('rel', 'stylesheet').attr('type', 'text/css').attr('href', 'https://export.otpusk.com/os/templates/css/font-awesome.css')); $block.append($jq(''); //jQuery('body').prepend(''); } case 'tiles': $jq('
') .addClass('hot-otp-form-wrap') .addClass('os-hot-tour-'+ tourId) .addClass('hot-tour-while-loading') .append( $jq('
') .addClass('hot-otp-img') .append( $jq('').append( $jq('') .attr('src', 'https://export.otpusk.com/ehot/templates/css/images/grey.png') ).click(function () { if($jq('.new_t-menu-back').length) { $jq('html, body').animate({ scrollTop: $jq('.new_t-menu-back').offset().top - 20 }, 1000); } }) ) ).append( $jq('') .addClass('hot-otp-tour-block no_tour') .click(function () { if($jq('.new_t-menu-back').length) { $jq('html, body').animate({ scrollTop: $jq('.new_t-menu-back').offset().top - 20 }, 1000); } }) .append( $jq('').append( $jq('') .addClass('hot-otp-description') .text(self._('Идет обновление')) ) ).append( $jq('
') .addClass('hot-otp-info_place') .append( $jq('
') .addClass('hot-otp-place') ) .append( $jq('
') .addClass('hot-otp-tour-info') ) ).append( $jq('
') .addClass('hot-price-block') .append( $jq('
') .addClass('hot-otp-price') .append( $jq('').click(function () { if($jq('.new_t-menu-back').length) { $jq('html, body').animate({ scrollTop: $jq('.new_t-menu-back').offset().top - 20 }, 1000); } }) ) ).append( $jq('
') .addClass('hot-otp-price-count') ) ) ).appendTo($block); break; } }; // Run application this.checkScripts(startFunction); /** * local && session storage #11195 */ this.storage = new function(){ /** * Is supported local storage * @returns {boolean} */ this.is_support = function(){ try { localStorage.setItem('test', 'test'); localStorage.removeItem('test'); return true; } catch(e) { return false; } }; /** * Get object from storage * @param key * @param type (dict || list) * @param ts * @param cached_days * @param cached_hours * @param cached_minutes * @returns {*} * * @example o.storage.get('key', '{}', 'session', 7) */ this.get = function(key, type, ts, cached_days, cached_hours, cached_minutes) { type = type || []; // list type default if(this.is_support() && key) { if(ts === 'session') { return JSON.parse(sessionStorage.getItem(key) || type); } else { // cached var now = new Date(); if(+localStorage.getItem(key +'-date') < now.getTime()) { var days = +cached_days? cached_days: (+cached_hours? 0: 2); // 2 day default var hours = +cached_hours? cached_hours: 0; var minutes = +cached_minutes? cached_minutes: 0; if(days) { // cached days this.set(key +'-date', now.getTime()+(+days*24*60*60*1000)); } else if(hours) { // cached hours this.set(key +'-date', now.getTime()+(+hours*60*60*1000)); } else { this.set(key +'-date', now.getTime()+(+minutes*60*1000)); } // remove cache localStorage.removeItem(key); } return JSON.parse(localStorage.getItem(key) || type); } } }; /** * Set object to storage * @param key * @param value * @param ts * * @example o.storage.set('key', 123) */ this.set = function(key, value, ts){ if(this.is_support() && key && value) { if(ts === 'session') { sessionStorage.setItem(key, JSON.stringify(value)); } else { localStorage.setItem(key, JSON.stringify(value)); } } }; }; }; new osHotTourWidgetClass(OShotTourVars, apiKey);