Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Issue #109 Multiple App Banner #129

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jQuery Smart Banner
brings this feature to older iOS versions, Android devices and for Windows Store apps.

# _Low maintanace_

_jQuery Smart Banner is currently not being actively maintained. Issues will not be solved, but pull requests **might** be merged. If you like to collaborate or take over this project, please contact me at arnold@jasny.net._

## Usage ##
Expand All @@ -16,7 +16,7 @@ _jQuery Smart Banner is currently not being actively maintained. Issues will not
<meta name="apple-itunes-app" content="app-id=544007664">
<meta name="google-play-app" content="app-id=com.google.android.youtube">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="jquery.smartbanner.css" type="text/css" media="screen">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
</head>
Expand Down Expand Up @@ -55,6 +55,7 @@ _jQuery Smart Banner is currently not being actively maintained. Issues will not
layer: false, // Display as overlay layer or slide down the page
iOSUniversalApp: true, // If the iOS App is a universal app for both iPad and iPhone, display Smart Banner to iPad users, too.
appendToSelector: 'body', //Append the banner to a specific selector
cookiePrefix: 'sb', // The prefix used in the cookies used (default is sb)
onInstall: function() {
// alert('Click install');
},
Expand Down
9 changes: 5 additions & 4 deletions jquery.smartbanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}

// Don't show banner if device isn't iOS or Android, website is loaded in app or user dismissed banner
if (!this.type || standalone || this.getCookie('sb-closed') || this.getCookie('sb-installed')) {
if (!this.type || standalone || this.getCookie(this.options.cookiePrefix + '-closed') || this.getCookie(this.options.cookiePrefix + '-installed')) {
return;
}

Expand Down Expand Up @@ -199,15 +199,15 @@
, close: function (e) {
e.preventDefault();
this.hide();
this.setCookie('sb-closed','true',this.options.daysHidden);
this.setCookie(this.options.cookiePrefix + '-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.setCookie(this.options.cookiePrefix + '-installed','true',this.options.daysReminder);
this.options.onInstall(e);
}

Expand Down Expand Up @@ -280,7 +280,8 @@
layer: false, // Display as overlay layer or slide down the page
iOSUniversalApp: true, // If the iOS App is a universal app for both iPad and iPhone, display Smart Banner to iPad users, too.
appendToSelector: 'body', //Append the banner to a specific selector
pushSelector: 'html' // What element is going to push the site content down; this is where the banner append animation will start.
pushSelector: 'html', // What element is going to push the site content down; this is where the banner append animation will start.
cookiePrefix: 'sb' // The prefix used in the cookies used (default is sb)
};

$.smartbanner.Constructor = SmartBanner;
Expand Down