The Free Software Media System - Server Backend & API
Add concept of Supporter-only plug-ins (premium with price = 0)
Eric Reed830f6e2201cf
diff --git a/MediaBrowser.WebDashboard/Html/addPlugin.html b/MediaBrowser.WebDashboard/Html/addPlugin.htmlindex 820319091e..2244d5c147 100644--- a/MediaBrowser.WebDashboard/Html/addPlugin.html+++ b/MediaBrowser.WebDashboard/Html/addPlugin.html@@ -39,20 +39,23 @@</p><p id="regInfo"></p>- <p id="regPrice">- </p>- <input type="hidden" name="cmd" value="_xclick">- <input type="hidden" id="payPalEmail" name="business" value="[email protected]">- <input type="hidden" name="currency_code" value="USD">- <input type="hidden" id="featureName" name="item_name" value="MBSupporter">- <input type="hidden" id="amount" name="amount" value="10">- <input type="hidden" id="featureId" name="item_number" value="MBSupporter">- <input type="hidden" name="notify_url" value="http://mb3admin.com/admin/service/services/ppipn.php">- <input type="hidden" name="return" id ="paypalReturnUrl" value="#">- <a data-role="button" id="ppButton" onclick="_xclick.submit();"><img src="css/images/registerpp.png"/></a>- <p id="noEmail" style="display: none"><strong>This developer has not provided a PayPal email. Please see their- website for registration information.</strong>- </p>+ <div class="premiumHasPrice" style="display: none">+ <p id="regPrice">+ </p>+ <input type="hidden" name="cmd" value="_xclick">+ <input type="hidden" id="payPalEmail" name="business" value="[email protected]">+ <input type="hidden" name="currency_code" value="USD">+ <input type="hidden" id="featureName" name="item_name" value="MBSupporter">+ <input type="hidden" id="amount" name="amount" value="10">+ <input type="hidden" id="featureId" name="item_number" value="MBSupporter">+ <input type="hidden" name="notify_url" value="http://mb3admin.com/admin/service/services/ppipn.php">+ <input type="hidden" name="return" id ="paypalReturnUrl" value="#">+ <a data-role="button" id="ppButton" onclick="_xclick.submit();"><img src="css/images/registerpp.png"/></a>+ <p id="noEmail" style="display: none"><strong>This developer has not provided a PayPal email. Please see their+ website for registration information.</strong>+ </p>++ </div></div>diff --git a/MediaBrowser.WebDashboard/Html/css/images/supporterflag.png b/MediaBrowser.WebDashboard/Html/css/images/supporterflag.pngnew file mode 100644index 0000000000..880d434d56Binary files /dev/null and b/MediaBrowser.WebDashboard/Html/css/images/supporterflag.png differdiff --git a/MediaBrowser.WebDashboard/Html/scripts/AddPluginPage.js b/MediaBrowser.WebDashboard/Html/scripts/AddPluginPage.jsindex e8cf82e869..8b45747bbf 100644--- a/MediaBrowser.WebDashboard/Html/scripts/AddPluginPage.js+++ b/MediaBrowser.WebDashboard/Html/scripts/AddPluginPage.js@@ -50,7 +50,7 @@regStatus += "You are currently registered for this feature";} else {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 {if (pkg.expDate <= new Date().getTime()) {regStatus += "The trial period for this feature has expired on this machine";@@ -65,23 +65,29 @@if (pluginSecurityInfo.IsMBSupporter) {$('#regInfo', page).html(pkg.regInfo || "");- // Fill in PayPal info- $('#featureId', page).val(pkg.featureId);- $('#featureName', page).val(pkg.name);- $('#amount', page).val(pkg.price);- $('#regPrice', page).html("<h2>Price: $" + pkg.price.toFixed(2) + " (USD)</h2>");- var url = "http://mb3admin.com/admin/service/user/getPayPalEmail?id=" + pkg.owner;- $.getJSON(url).done(function (dev) {- if (dev.payPalEmail) {- $('#payPalEmail', page).val(dev.payPalEmail);-- } else {- $('#ppButton', page).hide();- $('#noEmail', page).show();- }- });+ if (pkg.price > 0) {+ // Fill in PayPal info+ $('premiumHasPrice', page).show();+ $('#featureId', page).val(pkg.featureId);+ $('#featureName', page).val(pkg.name);+ $('#amount', page).val(pkg.price);+ $('#regPrice', page).html("<h2>Price: $" + pkg.price.toFixed(2) + " (USD)</h2>");+ var url = "http://mb3admin.com/admin/service/user/getPayPalEmail?id=" + pkg.owner;+ $.getJSON(url).done(function(dev) {+ if (dev.payPalEmail) {+ $('#payPalEmail', page).val(dev.payPalEmail);++ } else {+ $('#ppButton', page).hide();+ $('#noEmail', page).show();+ }+ });+ } else {+ // 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 register this feature.</h3>");+ $('#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();}diff --git a/MediaBrowser.WebDashboard/Html/scripts/PluginCatalogPage.js b/MediaBrowser.WebDashboard/Html/scripts/PluginCatalogPage.jsindex 5b6dc982e4..cde6be9d4e 100644--- a/MediaBrowser.WebDashboard/Html/scripts/PluginCatalogPage.js+++ b/MediaBrowser.WebDashboard/Html/scripts/PluginCatalogPage.js@@ -47,7 +47,11 @@}if (plugin.isPremium) {- html += "<div class='premiumBanner'><img src='css/images/premiumflag.png' /></div>";+ if (plugin.price > 0) {+ 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();diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csprojindex e57d7ad2fd..188c187226 100644--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj@@ -385,6 +385,7 @@<EmbeddedResource Include="Html\scripts\ItemDetailPage.js" /></ItemGroup><ItemGroup>+ <EmbeddedResource Include="Html\css\images\supporterflag.png" /><EmbeddedResource Include="Html\scripts\ItemListPage.js" /><EmbeddedResource Include="Html\itemList.html" /><EmbeddedResource Include="Html\scripts\WizardFinishPage.js" />