mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
make scripts more modular
This commit is contained in:
parent
284e61038d
commit
ce35317652
11 changed files with 109 additions and 86 deletions
|
@ -4,7 +4,7 @@
|
|||
<title>${TitleAdvanced}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="advancedConfigurationPage" data-role="page" class="page type-interior advancedConfigurationPage">
|
||||
<div id="advancedConfigurationPage" data-role="page" class="page type-interior advancedConfigurationPage" data-require="scripts/advancedconfigurationpage">
|
||||
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
|
@ -14,7 +14,7 @@
|
|||
<a href="dashboardhosting.html" data-role="button">${TabHosting}</a>
|
||||
<a href="serversecurity.html" data-role="button">${TabSecurity}</a>
|
||||
</div>
|
||||
<form id="advancedConfigurationForm">
|
||||
<form class="advancedConfigurationForm">
|
||||
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li id="fldRunAtStartup" style="display: none;">
|
||||
|
@ -97,10 +97,6 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#advancedConfigurationForm').on('submit', AdvancedConfigurationPage.onSubmit);
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1405,6 +1405,14 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
|
|||
background-position: center center;
|
||||
}
|
||||
|
||||
.listViewMoreButton {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 10%;
|
||||
padding: 15px 20px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.ui-li-has-icon > .ui-btn {
|
||||
padding-left: 5.25em !important;
|
||||
padding-top: 5px !important;
|
||||
|
|
|
@ -93,9 +93,9 @@
|
|||
vertical-align: top;
|
||||
color: #eee;
|
||||
display: inline-block;
|
||||
width: 80%;
|
||||
width: 70%;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@media all and (max-width: 1200px) {
|
||||
|
@ -113,7 +113,7 @@
|
|||
font-size: 18px;
|
||||
text-transform: uppercase;
|
||||
color: #ddd !important;
|
||||
font-weight: 500 !important;
|
||||
font-weight: 400 !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -145,12 +145,13 @@
|
|||
border: 0;
|
||||
color: #ddd;
|
||||
border-radius: 3px;
|
||||
padding: 4px 7px 3px 50px;
|
||||
padding: 4px 0 3px 0;
|
||||
text-indent: 50px;
|
||||
font-size: 16px;
|
||||
font-family: Roboto;
|
||||
outline: none;
|
||||
vertical-align: middle;
|
||||
width: 85%;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.searchInputIcon {
|
||||
|
@ -175,7 +176,7 @@
|
|||
}
|
||||
|
||||
.viewMenuSearchForm {
|
||||
max-width: initial;
|
||||
max-width: none;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
|
|
|
@ -305,6 +305,7 @@ h1 .imageLink {
|
|||
padding: 0;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.imageButton:hover {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<title>${TitleAdvanced}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="dashboardHostingPage" data-role="page" class="page type-interior advancedConfigurationPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Hosting%20Settings">
|
||||
<div id="dashboardHostingPage" data-role="page" class="page type-interior advancedConfigurationPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Hosting%20Settings" data-require="scripts/dashboardhosting">
|
||||
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
|
@ -78,10 +78,6 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('.dashboardHostingForm').off('submit', DashboardHostingPage.onSubmit).on('submit', DashboardHostingPage.onSubmit);
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -35,7 +35,31 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#advancedConfigurationPage", function () {
|
||||
function onSubmit() {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.EnableDebugLevelLogging = $('#chkDebugLog', form).checked();
|
||||
|
||||
config.RunAtStartup = $('#chkRunAtStartup', form).checked();
|
||||
config.SystemUpdateLevel = $('#selectAutomaticUpdateLevel', form).val();
|
||||
config.EnableAutomaticRestart = $('#chkEnableAutomaticRestart', form).checked();
|
||||
|
||||
config.EnableDashboardResourceMinification = $('#chkEnableMinification', form).checked();
|
||||
config.EnableDashboardResponseCaching = $('#chkEnableDashboardResponseCache', form).checked();
|
||||
config.DashboardSourcePath = $('#txtDashboardSourcePath', form).val();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).on('pageshown', "#advancedConfigurationPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
@ -51,7 +75,7 @@
|
|||
|
||||
});
|
||||
|
||||
}).on('pageinit', "#advancedConfigurationPage", function () {
|
||||
}).on('pageinitdepends', "#advancedConfigurationPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
@ -81,37 +105,7 @@
|
|||
});
|
||||
});
|
||||
|
||||
$('.advancedConfigurationForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
});
|
||||
|
||||
function advancedConfigurationPage() {
|
||||
|
||||
var self = this;
|
||||
|
||||
self.onSubmit = function () {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.EnableDebugLevelLogging = $('#chkDebugLog', form).checked();
|
||||
|
||||
config.RunAtStartup = $('#chkRunAtStartup', form).checked();
|
||||
config.SystemUpdateLevel = $('#selectAutomaticUpdateLevel', form).val();
|
||||
config.EnableAutomaticRestart = $('#chkEnableAutomaticRestart', form).checked();
|
||||
|
||||
config.EnableDashboardResourceMinification = $('#chkEnableMinification', form).checked();
|
||||
config.EnableDashboardResponseCaching = $('#chkEnableDashboardResponseCache', form).checked();
|
||||
config.DashboardSourcePath = $('#txtDashboardSourcePath', form).val();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
window.AdvancedConfigurationPage = new advancedConfigurationPage();
|
||||
|
||||
})(jQuery, document, window);
|
||||
|
|
|
@ -17,7 +17,30 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#dashboardHostingPage", function () {
|
||||
function onSubmit() {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.HttpServerPortNumber = $('#txtPortNumber', form).val();
|
||||
config.PublicPort = $('#txtPublicPort', form).val();
|
||||
config.PublicHttpsPort = $('#txtPublicHttpsPort', form).val();
|
||||
config.EnableHttps = $('#chkEnableHttps', form).checked();
|
||||
config.HttpsPortNumber = $('#txtHttpsPort', form).val();
|
||||
config.EnableUPnP = $('#chkEnableUpnp', form).checked();
|
||||
config.WanDdns = $('#txtDdns', form).val();
|
||||
config.CertificatePath = $('#txtCertificatePath', form).val();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).on('pageshown', "#dashboardHostingPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
@ -29,7 +52,7 @@
|
|||
|
||||
});
|
||||
|
||||
}).on('pageinit', "#dashboardHostingPage", function () {
|
||||
}).on('pageinitdepends', "#dashboardHostingPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
@ -53,33 +76,8 @@
|
|||
header: Globalize.translate('HeaderSelectCertificatePath')
|
||||
});
|
||||
});
|
||||
|
||||
$('.dashboardHostingForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
});
|
||||
|
||||
window.DashboardHostingPage = {
|
||||
|
||||
onSubmit: function () {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.HttpServerPortNumber = $('#txtPortNumber', form).val();
|
||||
config.PublicPort = $('#txtPublicPort', form).val();
|
||||
config.PublicHttpsPort = $('#txtPublicHttpsPort', form).val();
|
||||
config.EnableHttps = $('#chkEnableHttps', form).checked();
|
||||
config.HttpsPortNumber = $('#txtHttpsPort', form).val();
|
||||
config.EnableUPnP = $('#chkEnableUpnp', form).checked();
|
||||
config.WanDdns = $('#txtDdns', form).val();
|
||||
config.CertificatePath = $('#txtCertificatePath', form).val();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})(jQuery, document, window);
|
||||
|
|
|
@ -714,7 +714,7 @@
|
|||
|
||||
|
||||
var href = LibraryBrowser.getHref(item, options.context);
|
||||
html += '<li class="' + cssClass + '"' + dataAttributes + ' data-itemid="' + item.Id + '" data-playlistitemid="' + (item.PlaylistItemId || '') + '" data-href="' + href + '">';
|
||||
html += '<li class="' + cssClass + '"' + dataAttributes + ' data-itemid="' + item.Id + '" data-playlistitemid="' + (item.PlaylistItemId || '') + '" data-href="' + href + '" data-icon="false">';
|
||||
|
||||
var defaultAction = options.defaultAction;
|
||||
if (defaultAction == 'play' || defaultAction == 'playallfromhere') {
|
||||
|
@ -848,9 +848,9 @@
|
|||
}
|
||||
html += '</a>';
|
||||
|
||||
// Render out the jqm classes so that we don't have to call trigger create
|
||||
html += '<a href="#" data-icon="ellipsis-v" class="listviewMenuButton ui-btn ui-icon-ellipsis-v ui-btn-icon-notext ui-btn-inline">';
|
||||
html += '</a>';
|
||||
html += '<button type="button" data-role="none" class="listviewMenuButton imageButton listViewMoreButton" data-icon="none">';
|
||||
html += '<i class="fa fa-ellipsis-v"></i>';
|
||||
html += '</button>';
|
||||
|
||||
html += '</li>';
|
||||
|
||||
|
@ -1558,8 +1558,6 @@
|
|||
|
||||
if (options.cardLayout) {
|
||||
html += '<div class="cardText" style="text-align:right; float:right;">';
|
||||
// Render out the jqm classes so that we don't have to call trigger create
|
||||
//html += '<button class="listviewMenuButton ui-btn ui-icon-ellipsis-v ui-btn-icon-notext ui-btn-inline ui-shadow ui-corner-all" type="button" data-inline="true" data-iconpos="notext" data-icon="ellipsis-v" style="margin: 4px 0 0;"></button>';
|
||||
html += '<button class="listviewMenuButton imageButton btnCardOptions" type="button" data-role="none" style="margin: 4px 0 0;"><i class="fa fa-ellipsis-v"></i></button>';
|
||||
html += "</div>";
|
||||
}
|
||||
|
|
|
@ -89,7 +89,8 @@
|
|||
showTitle: true,
|
||||
coverImage: true,
|
||||
centerImage: true,
|
||||
textLines: getAdditionalTextLines
|
||||
textLines: getAdditionalTextLines,
|
||||
cardLayout: true
|
||||
});
|
||||
$('.itemsContainer', elem).html(html).lazyChildren();
|
||||
}
|
||||
|
|
|
@ -1824,6 +1824,36 @@ $(document).on('pagecreate', ".page", function () {
|
|||
$(document.body).addClass('removeScrollbars');
|
||||
}
|
||||
|
||||
}).on('pageinit', ".page", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
var require = this.getAttribute('data-require');
|
||||
|
||||
if (require) {
|
||||
requirejs([require], function() {
|
||||
|
||||
$(page).trigger('pageinitdepends');
|
||||
});
|
||||
} else {
|
||||
$(page).trigger('pageinitdepends');
|
||||
}
|
||||
|
||||
}).on('pageshow', ".page", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
var require = this.getAttribute('data-require');
|
||||
|
||||
if (require) {
|
||||
requirejs([require], function () {
|
||||
|
||||
$(page).trigger('pageshown');
|
||||
});
|
||||
} else {
|
||||
$(page).trigger('pageshown');
|
||||
}
|
||||
|
||||
}).on('pagebeforeshow', ".page", function () {
|
||||
|
||||
var page = $(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue