1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update script loading

This commit is contained in:
Luke Pulverenti 2015-05-19 15:15:40 -04:00
parent 463ad6cfb1
commit bbdbdf346e
92 changed files with 1062 additions and 518 deletions

View file

@ -62,7 +62,7 @@
html += '<div class="cardPadder"></div>';
var href = "#";
var href = server.href || "#";
html += '<a class="cardContent lnkServer" data-serverid="' + server.Id + '" href="' + href + '">';
var imgUrl = server.Id == 'connect' ? 'css/images/logo536.png' : '';
@ -84,20 +84,22 @@
// cardScalable
html += "</div>";
html += '<div class="cardFooter">';
html += '<div class="cardFooter outerCardFooter">';
if (server.showOptions !== false) {
html += '<div class="cardText" style="text-align:right; float:right;">';
html += '<button class="btnServerMenu" type="button" data-inline="true" data-iconpos="notext" data-icon="ellipsis-v" style="margin: 2px 0 0;"></button>';
html += '<button class="listviewMenuButton imageButton btnCardOptions btnServerMenu" type="button" data-role="none" style="margin: 4px 0 0;"><i class="fa fa-ellipsis-v"></i></button>';
html += "</div>";
}
html += '<div class="cardText" style="margin-right: 30px; padding: 11px 0 10px;">';
html += '<div class="cardText">';
html += server.Name;
html += "</div>";
html += '<div class="cardText">';
html += '&nbsp;';
html += "</div>";
// cardFooter
html += "</div>";
@ -128,21 +130,15 @@
var id = this.getAttribute('data-serverid');
if (id == 'new') {
Dashboard.navigate('connectlogin.html?mode=manualserver');
return;
if (id != 'new' && id != 'connect') {
var server = servers.filter(function (s) {
return s.Id == id;
})[0];
connectToServer(page, server);
}
if (id == 'connect') {
Dashboard.navigate('connectlogin.html?mode=connect');
return;
}
var server = servers.filter(function (s) {
return s.Id == id;
})[0];
connectToServer(page, server);
});
$('.btnServerMenu', elem).on('click', function () {
@ -312,17 +308,20 @@
// cardScalable
html += "</div>";
html += '<div class="cardFooter">';
html += '<div class="cardFooter outerCardFooter">';
html += '<div class="cardText" style="text-align:right; float:right;">';
html += '<button class="btnInviteMenu" type="button" data-inline="true" data-iconpos="notext" data-icon="ellipsis-v" style="margin: 2px 0 0;"></button>';
html += '<button class="listviewMenuButton imageButton btnCardOptions btnInviteMenu" type="button" data-role="none" style="margin: 4px 0 0;"><i class="fa fa-ellipsis-v"></i></button>';
html += "</div>";
html += '<div class="cardText" style="margin-right: 30px; padding: 11px 0 10px;">';
html += '<div class="cardText">';
html += invite.Name;
html += "</div>";
html += '<div class="cardText">';
html += '&nbsp;';
html += "</div>";
// cardFooter
html += "</div>";
@ -383,15 +382,8 @@
servers.push({
Name: Globalize.translate('ButtonNewServer'),
Id: 'new',
showOptions: false
});
}
if (!ConnectionManager.isLoggedIntoConnect()) {
servers.push({
Name: Globalize.translate('ButtonSignInWithConnect'),
Id: 'connect',
showOptions: false
showOptions: false,
href: 'connectlogin.html?mode=manualserver'
});
}
@ -401,10 +393,16 @@
});
loadInvitations(page);
if (ConnectionManager.isLoggedIntoConnect()) {
$('.connectLogin', page).hide();
} else {
$('.connectLogin', page).show();
}
}
function updatePageStyle(page) {
if (ConnectionManager.isLoggedIntoConnect()) {
$(page).addClass('libraryPage').addClass('noSecondaryNavPage').removeClass('standalonePage');
} else {
@ -412,12 +410,12 @@
}
}
$(document).on('pagebeforecreate pageinit pagebeforeshow', "#selectServerPage", function () {
$(document).on('pageinitdepends pagebeforeshowready', "#selectServerPage", function () {
var page = this;
updatePageStyle(page);
}).on('pagebeforeshow', "#selectServerPage", function () {
}).on('pageshowready', "#selectServerPage", function () {
var page = this;
@ -425,21 +423,4 @@
});
window.SelectServerPage = {
onServerAddressEntrySubmit: function () {
Dashboard.showLoadingMsg();
var form = this;
var page = $(form).parents('.page');
// Disable default form submission
return false;
}
};
})();