mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
lazy load scripts
This commit is contained in:
parent
1f0760df09
commit
89e0515a15
31 changed files with 366 additions and 328 deletions
|
@ -131,84 +131,7 @@
|
|||
|
||||
$('#developer', page).html(pkg.owner);
|
||||
|
||||
if (pkg.isPremium) {
|
||||
$('.premiumPackage', page).show();
|
||||
|
||||
// Fill in registration info
|
||||
var regStatus = "";
|
||||
if (pkg.isRegistered) {
|
||||
|
||||
regStatus += "<p style='color:green;'>";
|
||||
|
||||
regStatus += Globalize.translate('MessageFeatureIncludedWithSupporter');
|
||||
|
||||
} else {
|
||||
|
||||
var expDateTime = new Date(pkg.expDate).getTime();
|
||||
var nowTime = new Date().getTime();
|
||||
|
||||
if (expDateTime <= nowTime) {
|
||||
regStatus += "<p style='color:red;'>";
|
||||
regStatus += Globalize.translate('MessageTrialExpired');
|
||||
}
|
||||
else if (expDateTime > new Date(1970, 1, 1).getTime()) {
|
||||
|
||||
regStatus += "<p style='color:blue;'>";
|
||||
regStatus += Globalize.translate('MessageTrialWillExpireIn').replace('{0}', Math.round(expDateTime - nowTime) / (86400000));
|
||||
}
|
||||
}
|
||||
|
||||
regStatus += "</p>";
|
||||
$('#regStatus', page).html(regStatus);
|
||||
|
||||
if (pluginSecurityInfo.IsMBSupporter) {
|
||||
$('#regInfo', page).html(pkg.regInfo || "");
|
||||
|
||||
$('.premiumDescription', page).hide();
|
||||
$('.supporterDescription', page).hide();
|
||||
|
||||
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("<h3>" + Globalize.translate('ValuePriceUSD').replace('{0}', "$" + pkg.price.toFixed(2)) + "</h3>");
|
||||
|
||||
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();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Supporter-only feature
|
||||
$('.premiumHasPrice', page).hide();
|
||||
}
|
||||
} else {
|
||||
|
||||
if (pkg.price) {
|
||||
$('.premiumDescription', page).show();
|
||||
$('.supporterDescription', page).hide();
|
||||
$('#regInfo', page).html("");
|
||||
|
||||
} else {
|
||||
$('.premiumDescription', page).hide();
|
||||
$('.supporterDescription', page).show();
|
||||
$('#regInfo', page).html("");
|
||||
}
|
||||
|
||||
$('#ppButton', page).hide();
|
||||
}
|
||||
|
||||
} else {
|
||||
$('.premiumPackage', page).hide();
|
||||
}
|
||||
RegistrationServices.renderPluginInfo(page, pkg, pluginSecurityInfo);
|
||||
|
||||
//Ratings and Reviews
|
||||
var ratingHtml = RatingHelpers.getStoreRatingHtml(pkg.avgRating, pkg.id, pkg.name);
|
||||
|
@ -246,7 +169,7 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#addPluginPage", function () {
|
||||
$(document).on('pageshown', "#addPluginPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue