/*! * jQuery Smart Banner * Copyright (c) 2012 Arnold Daniels * Based on 'jQuery Smart Web App Banner' by Kurt Zenisek @ kzeni.com */!function($){var SmartBanner=function(options){this.origHtmlMargin=parseFloat($('html').css('margin-top')) this.options=$.extend({},$.smartbanner.defaults,options) var standalone=navigator.standalone,UA=navigator.userAgent if(this.options.force){this.type=this.options.force}else if(UA.match(/Windows Phone 8/i)!=null&&UA.match(/Touch/i)!==null){this.type='windows'}else if(UA.match(/iPhone|iPod/i)!=null||(UA.match(/iPad/)&&this.options.iOSUniversalApp)){if(UA.match(/Safari/i)!=null&&(UA.match(/CriOS/i)!=null||window.Number(UA.substr(UA.indexOf('OS ')+3,3).replace('_','.'))<6))this.type='ios'}else if(UA.match(/\bSilk\/(.*\bMobile Safari\b)?/)||UA.match(/\bKF\w/)||UA.match('Kindle Fire')){this.type='kindle'}else if(UA.match(/Android/i)!=null){this.type='android'}else{var isAndroidMobile=UA.indexOf('Android')>-1&&UA.indexOf('Mozilla/5.0')>-1&&UA.indexOf('AppleWebKit')>-1;var regExAppleWebKit=new RegExp(/AppleWebKit\/([\d.]+)/);var resultAppleWebKitRegEx=regExAppleWebKit.exec(UA);var appleWebKitVersion=(resultAppleWebKitRegEx===null?null:parseFloat(regExAppleWebKit.exec(UA)[1]));var regExChrome=new RegExp(/Chrome\/([\d.]+)/);var resultChromeRegEx=regExChrome.exec(UA);var chromeVersion=(resultChromeRegEx===null?null:parseFloat(regExChrome.exec(UA)[1]));if(isAndroidMobile&&(appleWebKitVersion!==null&&appleWebKitVersion<537)||(chromeVersion!==null&&chromeVersion<37)){this.type='android'}} if(!this.type||standalone||this.getCookie('sb-installed')||this.getCookie('sb-closed')){return} this.scale=this.options.scale=='auto'?$(window).width()/ window.screen.width:this.options.scale if(this.scale<1)this.scale=1 var meta=$(this.type=='android'?'meta[name="google-play-app"]':this.type=='ios'?'meta[name="apple-itunes-app"]':this.type=='kindle'?'meta[name="kindle-fire-app"]':'meta[name="msApplication-ID"]');if(meta.length==0)return if(this.type=='windows'){this.appId=$('meta[name="msApplication-PackageFamilyName"]').attr('content');}else{var parsedMetaContent=/app-id=([^\s,]+)/.exec(meta.attr('content'));if(parsedMetaContent){this.appId=parsedMetaContent[1];}else{return;}} this.title=this.options.title?this.options.title:meta.data('title')||$('title').text().replace(/\s*[|\-ยท].*$/,'') this.author=this.options.author?this.options.author:meta.data('author')||($('meta[name="author"]').length?$('meta[name="author"]').attr('content'):window.location.hostname) this.iconUrl=meta.data('icon-url');this.price=meta.data('price');if(typeof this.options.onInstall==='function'){this.options.onInstall=this.options.onInstall;}else{this.options.onInstall=function(){};} if(typeof this.options.onClose==='function'){this.options.onClose=this.options.onClose;}else{this.options.onClose=function(){};} this.create();this.show();this.listen();} SmartBanner.prototype={constructor:SmartBanner,create:function(){var iconURL,link=(this.options.url?this.options.url:(this.type=='windows'?'ms-windows-store:navigate?appid=':(this.type=='android'?'market://details?id=':(this.type=='kindle'?'amzn://apps/android?asin=':'https://itunes.apple.com/'+this.options.appStoreLanguage+'/app/id')))+this.appId),price=this.price||this.options.price,inStore=price?price+' - '+(this.type=='android'?this.options.inGooglePlay:this.type=='kindle'?this.options.inAmazonAppStore:this.type=='ios'?this.options.inAppStore:this.options.inWindowsStore):'',gloss=this.options.iconGloss===null?(this.type=='ios'):this.options.iconGloss if(this.type=='android'&&this.options.GooglePlayParams){link=link+'&referrer='+this.options.GooglePlayParams;} var banner='
×
'+this.title+''+this.author+''+inStore+'
'+this.options.button+'
';(this.options.layer)?$(this.options.appendToSelector).append(banner):$(this.options.appendToSelector).prepend(banner);if(this.options.icon){iconURL=this.options.icon}else if(this.iconUrl){iconURL=this.iconUrl;}else if($('link[rel="apple-touch-icon-precomposed"]').length>0){iconURL=$('link[rel="apple-touch-icon-precomposed"]').attr('href') if(this.options.iconGloss===null)gloss=false}else if($('link[rel="apple-touch-icon"]').length>0){iconURL=$('link[rel="apple-touch-icon"]').attr('href')}else if($('meta[name="msApplication-TileImage"]').length>0){iconURL=$('meta[name="msApplication-TileImage"]').attr('content')}else if($('meta[name="msapplication-TileImage"]').length>0){iconURL=$('meta[name="msapplication-TileImage"]').attr('content')} if(iconURL){$('#smartbanner .sb-icon').css('background-image','url('+iconURL+')') if(gloss)$('#smartbanner .sb-icon').addClass('gloss')}else{$('#smartbanner').addClass('no-icon')} this.bannerHeight=$('#smartbanner').outerHeight()+2 if(this.scale>1){$('#smartbanner').css('top',parseFloat($('#smartbanner').css('top'))*this.scale).css('height',parseFloat($('#smartbanner').css('height'))*this.scale).hide() $('#smartbanner .sb-container').css('-webkit-transform','scale('+this.scale+')').css('-msie-transform','scale('+this.scale+')').css('-moz-transform','scale('+this.scale+')').css('width',$(window).width()/ this.scale)} $('#smartbanner').css('position',(this.options.layer)?'absolute':'static')},listen:function(){$('#smartbanner .sb-close').bind('click',$.proxy(this.close,this));$('#smartbanner .sb-button').bind('click',$.proxy(this.install,this));},show:function(callback){var banner=$('#smartbanner');banner.stop();if(this.options.layer){banner.animate({top:0,display:'block'},this.options.speedIn).addClass('shown').show();$(this.pushSelector).animate({paddingTop:this.origHtmlMargin+(this.bannerHeight*this.scale)},this.options.speedIn,'swing',callback);}else{if($.support.transition){banner.animate({top:0},this.options.speedIn).addClass('shown');var transitionCallback=function(){$('html').removeClass('sb-animation');if(callback){callback();}};$(this.pushSelector).addClass('sb-animation').one($.support.transition.end,transitionCallback).emulateTransitionEnd(this.options.speedIn).css('margin-top',this.origHtmlMargin+(this.bannerHeight*this.scale));}else{banner.slideDown(this.options.speedIn).addClass('shown');}}},hide:function(callback){var banner=$('#smartbanner');banner.stop();banner.css({display:'none'}).removeClass('shown');},close:function(e){e.preventDefault() this.hide() this.setCookie('sb-closed','true',this.options.daysHidden);this.options.onClose(e);},install:function(e){if(this.options.hideOnInstall){this.hide()} this.setCookie('sb-installed','true',this.options.daysReminder) this.options.onInstall(e);},setCookie:function(name,value,exdays){var exdate=new Date() exdate.setDate(exdate.getDate()+exdays) value=encodeURI(value)+((exdays==null)?'':'; expires='+exdate.toUTCString()) document.cookie=name+'='+value+'; path=/;'},getCookie:function(name){var i,x,y,ARRcookies=document.cookie.split(";") for(i=0;i#smartbanner { position: absolute; left: 0; top: -100px; padding: 0; border-bottom: 1px solid #e8e8e8; width: 100%; height: 95px; font-family: \\\'Helvetica Neue\\\', sans-serif; background: #F2F2F2; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); z-index: 9998; -webkit-font-smoothing: antialiased; overflow: hidden; -webkit-text-size-adjust: none; } #smartbanner, html.sb-animation { -webkit-transition: all .3s ease; } #smartbanner .sb-container { margin: 0 auto; } #smartbanner .sb-close { position: absolute; left: 6px; top: 38px; display: block; width: 20px; height: 20px; font-family: \\\'ArialRoundedMTBold\\\', Arial; font-size: 24px; line-height: 20px; text-align: center; color: #fff; text-decoration: none; text-shadow: none; -webkit-font-smoothing: subpixel-antialiased; } #smartbanner .sb-close:active { font-size: 15px; color: #8B8B8B; } #smartbanner .sb-icon { position: absolute; left: 30px; top: 18px; display: block; width: 60px; height: 60px; background-size: cover; } #smartbanner.no-icon .sb-icon { display: none; } #smartbanner .sb-info { position: absolute; left: 100px; top: 20px; width: 44%; font-size: 11px; line-height: 1.2em; font-weight: bold; color: #6a6a6a; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); } #smartbanner .no-icon .sb-info { left: 34px; } #smartbanner .sb-info strong { display: block; font-size: 13px; color: #4d4d4d; line-height: 18px; } #smartbanner.android .sb-info strong{ font-family:Helvetica, Arial, san-serif; } #smartbanner.ios .sb-info strong{ font-family:Roboto, Arial, san-serif; } #smartbanner .sb-info > span { display: block; } #smartbanner .sb-info em { font-style: normal; text-transform: uppercase; } #smartbanner .sb-button { position: absolute; right: 15px; top: 24px; padding: 0 10px; min-width: 10%; height: auto; font-size: 14px; line-height: 24px; text-align: center; color: #6a6a6a; text-decoration: none; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); border-radius: 3px; } #smartbanner .sb-button:active, #smartbanner .sb-button:hover { background: -webkit-linear-gradient(top, #dcdcdc 0%, #efefef 100%); } #smartbanner .sb-icon.gloss:after { content: \\\'\\\'; position: absolute; left: 0; top: -1px; border-top: 1px solid rgba(255, 255, 255, 0.8); width: 100%; height: 50%; border-radius: 10px 10px 12px 12px; } #smartbanner.android, #smartbanner.ios { background: #F2F2F2; box-shadow: none; } #smartbanner.android .sb-close, #smartbanner.ios .sb-close { border: 0; width: 20px; height: 20px; line-height: 20px; color: #8B8B8B; } #smartbanner.android .sb-close:active, #smartbanner.ios .sb-close:active { color: #eee; } #smartbanner.android .sb-info, #smartbanner.ios .sb-info { color: #ACACAC; } #smartbanner.android .sb-info strong{ color: #000; font-size: 17px; } #smartbanner.android .sb-info strong, #smartbanner.ios .sb-info strong{ font-size:16px; color: #000; } #smartbanner.android .sb-button { min-width: 12%; background: #c1d739; border-radius: 5px; color: #fff; cursor: pointer; font-size: 16px; font-weight: bold; padding: 10px 15px; min-height: 28px; line-height: 28px; -webkit-border-radius: 5px; -moz-border-radius: 5px; } #smartbanner.android .sb-button span { text-align: center; display: block; text-transform: none; text-shadow: none; box-shadow: none; } #smartbanner.ios .sb-button { min-width: 12%; color: #006FFF; cursor: pointer; font-size: 16px; padding: 10px 15px; min-height: 28px; line-height: 28px; text-transform: none; } #smartbanner.ios .sb-button span { text-align: center; display: block; text-transform: none; text-shadow: none; box-shadow: none; } #smartbanner.android .sb-button:active, #smartbanner.android .sb-button:hover, #smartbanner.ios .sb-button:active, #smartbanner.ios .sb-button:hover { background: none; } #smartbanner.android .sb-button:active span, #smartbanner.android .sb-button:hover span, #smartbanner.ios .sb-button:active span, #smartbanner.ios .sb-button:hover span{ background: #2AC7E1; } #smartbanner.windows .sb-icon { border-radius: 0px; } #smartbanner .star-on { background: transparent url("https://s3.amazonaws.com/tap-medias/images/icon-etoile-on.png") no-repeat scroll 0 0; float:left; height: 13px; margin: 0; width: 13px; background-size:cover; } #smartbanner .star-off { background: transparent url("https://s3.amazonaws.com/tap-medias/images/icon-etoile-off.png") no-repeat scroll 0 0; float: left; height: 13px; margin: 0; width: 13px; background-size:cover; } #smartbanner .clear{ clear:both; }';} $(function(){setTimeout(function(){if($('body').hasClass('piguet-interstitiel')){$('.piguet-close').bind('click',function(){displayAppBar();});}else{displayAppBar();}},2000);});function displayAppBar(){$('head').append('');$('head').append("");$('head').append('');$('body').prepend(autoGeneratedStyle());var app_options={title:'Scommesse Sportive',author:'Risultati, Pronostici,',price:'Consigli',appStoreLanguage:'it',inGooglePlay:'Scaricare',inAppStore:'Scaricare',button:'Vedi',daysHidden:15,daysReminder:90};if(navigator.userAgent.match(/iPhone|iPod/i)!=null||(navigator.userAgent.match(/iPad/)&&this.options.iOSUniversalApp)){app_options.url='https://itunes.apple.com/fr/app/scommesse-sportive-risultati/id531765360';app_options.force='ios';}else if(navigator.userAgent.match(/Android/i)!=null){app_options.url='';} $.smartbanner(app_options);}}(window.jQuery);