From a434c34b77c9af68ee776b31eb72126e87780d47 Mon Sep 17 00:00:00 2001 From: Gordon Sun Date: Tue, 8 Mar 2016 00:02:30 -0800 Subject: [PATCH 1/2] Use a different meta tag to avoid double banner. --- index.js | 2 +- smart-app-banner.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 6cd2d28..8f914ff 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,7 @@ var userLang = userLangAttribute.slice(-2) || 'us'; // platform dependent functionality var mixins = { ios: { - appMeta: 'apple-itunes-app', + appMeta: 'apple-itunes-app-custom', // Mobile Safari uses apple-itunes-app to show banner. Use a different meta to avoid double banner iconRels: ['apple-touch-icon-precomposed', 'apple-touch-icon'], getStoreLink: function() { return 'https://itunes.apple.com/' + this.options.appStoreLanguage + '/app/id' + this.appId; diff --git a/smart-app-banner.js b/smart-app-banner.js index 91c8f4b..1802831 100644 --- a/smart-app-banner.js +++ b/smart-app-banner.js @@ -1,6 +1,6 @@ (function(q){"object"===typeof exports&&"undefined"!==typeof module?module.exports=q():"function"===typeof define&&define.amd?define([],q):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).SmartBanner=q()})(function(){return function c(f,h,d){function b(e,g){if(!h[e]){if(!f[e]){var l="function"==typeof require&&require;if(!g&&l)return l(e,!0);if(a)return a(e,!0);l=Error("Cannot find module '"+e+"'");throw l.code="MODULE_NOT_FOUND",l;}l=h[e]= -{exports:{}};f[e][0].call(l.exports,function(a){var d=f[e][1][a];return b(d?d:a)},l,l.exports,c,f,h,d)}return h[e].exports}for(var a="function"==typeof require&&require,g=0;gparseInt(a.os.version)?this.type="ios":"Android"===a.os.name&& (this.type="android");!this.type||navigator.standalone||e.get("smartbanner-closed")||e.get("smartbanner-installed")||(d(this,m[this.type]),this.parseAppId()&&(this.create(),this.show()))};c.prototype={constructor:c,create:function(){for(var d=this.getStoreLink(),e=this.options.price[this.type]+" - "+this.options.store[this.type],r,g=0;g
'+this.options.title+"
"+this.options.author+"
"+e+'
'+this.options.button+"";a.body?a.body.appendChild(c):a&& From 27a47e9801e01574d5e1f46d167e9999b75416fa Mon Sep 17 00:00:00 2001 From: Gordon Sun Date: Tue, 8 Mar 2016 00:15:17 -0800 Subject: [PATCH 2/2] Better comments. And update README.md --- README.md | 4 +++- index.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 629e03a..e3d479e 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,9 @@ Based on 'jQuery Smart Banner' by Arnold Daniels https://gith MyPage - + + diff --git a/index.js b/index.js index 8f914ff..1b742bf 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,9 @@ var userLang = userLangAttribute.slice(-2) || 'us'; // platform dependent functionality var mixins = { ios: { - appMeta: 'apple-itunes-app-custom', // Mobile Safari uses apple-itunes-app to show banner. Use a different meta to avoid double banner + // Mobile Safari will automatically show a built in banner when detect meta tag apple-itunes-app. + // Use a different tag to avoid show two banners. + appMeta: 'apple-itunes-app-custom', iconRels: ['apple-touch-icon-precomposed', 'apple-touch-icon'], getStoreLink: function() { return 'https://itunes.apple.com/' + this.options.appStoreLanguage + '/app/id' + this.appId;