Add concept of Supporter-only plug-ins (premium with price = 0)

This commit is contained in:
Eric Reed 2013-03-07 14:03:23 -05:00
parent de9d2a3afd
commit 96d6767689
4 changed files with 44 additions and 31 deletions

View File

@ -39,6 +39,7 @@
</p> </p>
<p id="regInfo"> <p id="regInfo">
</p> </p>
<div class="premiumHasPrice" style="display: none">
<p id="regPrice"> <p id="regPrice">
</p> </p>
<input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="cmd" value="_xclick">
@ -56,6 +57,8 @@
</div> </div>
</div>
<div data-role="collapsible" data-content-theme="c" data-collapsed="false" style="margin-top: 2em;" data-theme="a"> <div data-role="collapsible" data-content-theme="c" data-collapsed="false" style="margin-top: 2em;" data-theme="a">
<h3>Developer Info</h3> <h3>Developer Info</h3>
<p id="developer"></p> <p id="developer"></p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -50,7 +50,7 @@
regStatus += "You are currently registered for this feature"; regStatus += "You are currently registered for this feature";
} else { } else {
if (new Date(pkg.expDate).getTime() < new Date(1970, 1, 1).getTime()) { if (new Date(pkg.expDate).getTime() < new Date(1970, 1, 1).getTime()) {
regStatus += "You have never installed this feature"; regStatus += "This feature has no registration information";
} else { } else {
if (pkg.expDate <= new Date().getTime()) { if (pkg.expDate <= new Date().getTime()) {
regStatus += "The trial period for this feature has expired on this machine"; regStatus += "The trial period for this feature has expired on this machine";
@ -65,7 +65,9 @@
if (pluginSecurityInfo.IsMBSupporter) { if (pluginSecurityInfo.IsMBSupporter) {
$('#regInfo', page).html(pkg.regInfo || ""); $('#regInfo', page).html(pkg.regInfo || "");
if (pkg.price > 0) {
// Fill in PayPal info // Fill in PayPal info
$('premiumHasPrice', page).show();
$('#featureId', page).val(pkg.featureId); $('#featureId', page).val(pkg.featureId);
$('#featureName', page).val(pkg.name); $('#featureName', page).val(pkg.name);
$('#amount', page).val(pkg.price); $('#amount', page).val(pkg.price);
@ -81,7 +83,11 @@
} }
}); });
} else { } else {
$('#regInfo', page).html("<h3>You must be a <a href='supporter.html'>Media Browser Supporter</a> in order to register this feature.</h3>"); // Supporter-only feature
$('premiumHasPrice', page).hide();
}
} else {
$('#regInfo', page).html("<h3>You must be a <a href='supporter.html'>Media Browser Supporter</a> in order to gain access to this feature.</h3>");
$('#ppButton', page).hide(); $('#ppButton', page).hide();
} }

View File

@ -47,7 +47,11 @@
} }
if (plugin.isPremium) { if (plugin.isPremium) {
if (plugin.price > 0) {
html += "<div class='premiumBanner'><img src='css/images/premiumflag.png' /></div>"; html += "<div class='premiumBanner'><img src='css/images/premiumflag.png' /></div>";
} else {
html += "<div class='premiumBanner'><img src='css/images/supporterflag.png' /></div>";
}
} }
var color = plugin.tileColor || Dashboard.getRandomMetroColor(); var color = plugin.tileColor || Dashboard.getRandomMetroColor();