mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
moved search into slide out panel
This commit is contained in:
parent
728e0003b2
commit
e7a3a38b03
34 changed files with 493 additions and 621 deletions
|
@ -2392,9 +2392,7 @@
|
|||
|
||||
html += '<div class="viewMenuSecondary">';
|
||||
|
||||
html += Search.getSearchHtml();
|
||||
|
||||
html += '<a class="viewMenuLink" class="btnCurrentUser" href="#" onclick="Dashboard.showUserFlyout(this);">';
|
||||
html += '<a class="viewMenuLink btnCurrentUser" href="#" onclick="Dashboard.showUserFlyout(this);">';
|
||||
|
||||
if (user.PrimaryImageTag) {
|
||||
|
||||
|
@ -2411,8 +2409,10 @@
|
|||
|
||||
html += '</a>';
|
||||
|
||||
html += '<button onclick="Search.showSearchPanel($.mobile.activePage);" type="button" data-icon="search" data-inline="true" data-iconpos="notext">Search</button>';
|
||||
|
||||
if (user.Configuration.IsAdministrator) {
|
||||
html += '<a class="viewMenuLink" href="dashboard.html" title="Dashboard"><img src="css/images/toolswhite.png" alt="Dashboard" /></a>';
|
||||
html += '<a href="dashboard.html" data-role="button" data-icon="gear" data-inline="true" data-iconpos="notext">Dashboard</a>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
@ -2421,7 +2421,7 @@
|
|||
|
||||
$(page).prepend(html);
|
||||
|
||||
Search.onSearchRendered($('.viewMenuBar', page));
|
||||
Search.onSearchRendered($('.viewMenuBar', page).trigger('create'));
|
||||
}
|
||||
|
||||
function insertViews(page, user, counts, liveTvServices) {
|
||||
|
@ -2433,36 +2433,27 @@
|
|||
|
||||
var view = page.getAttribute('data-view') || getParameterByName('context');
|
||||
|
||||
var viewCount = 0;
|
||||
|
||||
if (counts.MovieCount || counts.TrailerCount) {
|
||||
|
||||
html += '<a class="viewMenuLink viewMenuTextLink' + (view == 'movies' ? selectedCssClass : '') + '" href="moviesrecommended.html">' + (view == 'movies' ? selectedHtml : '') + '<span class="viewName">Movies</span></a>';
|
||||
viewCount++;
|
||||
}
|
||||
|
||||
if (counts.EpisodeCount || counts.SeriesCount) {
|
||||
html += '<a class="viewMenuLink viewMenuTextLink' + (view == 'tv' ? selectedCssClass : '') + '" href="tvrecommended.html">' + (view == 'tv' ? selectedHtml : '') + '<span class="viewName">TV</span></a>';
|
||||
viewCount++;
|
||||
}
|
||||
|
||||
if (liveTvServices.length) {
|
||||
html += '<a class="viewMenuLink viewMenuTextLink' + (view == 'livetv' ? selectedCssClass : '') + '" href="livetvchannels.html">' + (view == 'livetv' ? selectedHtml : '') + '<span class="viewName">Live TV</span></a>';
|
||||
viewCount++;
|
||||
}
|
||||
|
||||
if (counts.SongCount || counts.MusicVideoCount) {
|
||||
html += '<a class="viewMenuLink viewMenuTextLink' + (view == 'music' ? selectedCssClass : '') + '" href="musicrecommended.html">' + (view == 'music' ? selectedHtml : '') + '<span class="viewName">Music</span></a>';
|
||||
viewCount++;
|
||||
}
|
||||
|
||||
if (counts.GameCount) {
|
||||
html += '<a class="viewMenuLink viewMenuTextLink' + (view == 'games' ? selectedCssClass : '') + '" href="gamesrecommended.html">' + (view == 'games' ? selectedHtml : '') + '<span class="viewName">Games</span></a>';
|
||||
viewCount++;
|
||||
}
|
||||
|
||||
$(page).addClass('pageViewCount' + viewCount);
|
||||
|
||||
$('.homeMenuLink', page).after(html);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
var context = this;
|
||||
|
||||
var html = '<div data-role="popup" class="notificationsFlyout" style="min-width:250px;margin-top:30px;margin-right:20px;background: #f8f8f8;">';
|
||||
var html = '<div data-role="popup" class="notificationsFlyout" style="min-width:250px;margin-top:30px;margin-right:20px;" data-theme="a">';
|
||||
|
||||
html += '<a href="#" data-rel="back" data-role="button" data-theme="b" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>';
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
|||
|
||||
html += '</p>';
|
||||
|
||||
html += '<p style="display:none;" class="btnMarkReadContainer"><button class="btnMarkRead" type="button" data-icon="check" data-mini="true">Mark these read</button></p>';
|
||||
html += '<p style="display:none;" class="btnMarkReadContainer"><button class="btnMarkRead" type="button" data-icon="check" data-mini="true" data-theme="b">Mark these read</button></p>';
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
var PluginsPage = {
|
||||
|
||||
onPageShow: function () {
|
||||
PluginsPage.reloadList();
|
||||
PluginsPage.reloadList(this);
|
||||
},
|
||||
|
||||
reloadList: function () {
|
||||
reloadList: function (page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
@ -14,14 +14,12 @@
|
|||
|
||||
$.when(promise1, promise2).done(function(response1, response2) {
|
||||
|
||||
PluginsPage.populateList(response1[0], response2[0]);
|
||||
PluginsPage.populateList(page, response1[0], response2[0]);
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
populateList: function (plugins, pluginConfigurationPages) {
|
||||
|
||||
var page = $($.mobile.activePage);
|
||||
populateList: function (page, plugins, pluginConfigurationPages) {
|
||||
|
||||
plugins = plugins.sort(function (plugin1, plugin2) {
|
||||
|
||||
|
@ -71,6 +69,7 @@
|
|||
|
||||
deletePlugin: function (link) {
|
||||
|
||||
var page = $(link).parents('.page');
|
||||
var name = link.getAttribute('data-pluginname');
|
||||
var uniqueid = link.getAttribute('data-id');
|
||||
|
||||
|
@ -83,7 +82,7 @@
|
|||
|
||||
ApiClient.uninstallPlugin(uniqueid).done(function () {
|
||||
|
||||
PluginsPage.reloadList();
|
||||
PluginsPage.reloadList(page);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -11,43 +11,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
function createSearchHintsElement(page) {
|
||||
|
||||
$(document.body).off("mousedown.hidesearchhints").on("mousedown.hidesearchhints", function (e) {
|
||||
|
||||
var elem = $(e.target);
|
||||
|
||||
if (!elem.is('#searchHints,#txtSearch,#btnSearch') && !elem.parents('#searchHints,#txtSearch,#btnSearch').length) {
|
||||
hideFlyout(page);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return $('#searchHints', page).show();
|
||||
}
|
||||
|
||||
function hideFlyout(page) {
|
||||
$('#searchHints', page).hide();
|
||||
|
||||
$(document.body).off("mousedown.hidesearchhints");
|
||||
}
|
||||
|
||||
function showFlyout(page) {
|
||||
|
||||
var hints = $('#searchHints:visible');
|
||||
|
||||
if (!hints.length) {
|
||||
|
||||
createSearchHintsElement(page);
|
||||
}
|
||||
}
|
||||
|
||||
function updateFlyout(page, searchTerm) {
|
||||
function updateSearchHints(page, searchTerm) {
|
||||
|
||||
if (!searchTerm) {
|
||||
|
||||
$('#searchHints', page).empty();
|
||||
clearSearchHintTimeout();
|
||||
hideFlyout(page);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -69,11 +38,7 @@
|
|||
if (currentTimeout != searchHintTimeout) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!result.TotalRecordCount) {
|
||||
hideFlyout(page);
|
||||
return;
|
||||
}
|
||||
|
||||
renderSearchHintResult(page, result.SearchHints);
|
||||
});
|
||||
}
|
||||
|
@ -106,7 +71,7 @@
|
|||
var html = '';
|
||||
|
||||
var context;
|
||||
|
||||
|
||||
if (hint.Type == "Episode" || hint.Type == "Season" || hint.Type == "Series") {
|
||||
context = "tv";
|
||||
}
|
||||
|
@ -238,39 +203,72 @@
|
|||
|
||||
$('#searchHints', page).html(html);
|
||||
}
|
||||
|
||||
function getSearchPanel(page) {
|
||||
|
||||
var panel = $('#searchPanel', page);
|
||||
|
||||
if (!panel.length) {
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<div data-role="panel" id="searchPanel" class="searchPanel" data-position="right" data-display="overlay" data-position-fixed="true" data-theme="b">';
|
||||
|
||||
html += '<h3>';
|
||||
html += 'Search';
|
||||
html += '</h3>';
|
||||
|
||||
html += '<input id="txtSearch" class="txtSearch" type="search" data-theme="a" />';
|
||||
|
||||
html += '<div id="searchHints" class="searchHints"></div>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
$(page).append(html);
|
||||
|
||||
panel = $('#searchPanel', page).panel({}).trigger('create');
|
||||
|
||||
$('#txtSearch', panel).on("keyup", function (e) {
|
||||
|
||||
// Down
|
||||
if (e.keyCode == 40) {
|
||||
|
||||
var first = $('.searchHint', panel)[0];
|
||||
|
||||
if (first) {
|
||||
first.focus();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}).on("keyup", function (e) {
|
||||
|
||||
if (e.keyCode != 40) {
|
||||
var value = this.value;
|
||||
|
||||
updateSearchHints(panel, value);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
function search() {
|
||||
|
||||
var self = this;
|
||||
|
||||
self.getSearchHtml = function () {
|
||||
self.showSearchPanel = function (page) {
|
||||
|
||||
var html = '<div class="headerSearch"><form id="searchForm" name="searchForm">';
|
||||
var panel = getSearchPanel(page);
|
||||
|
||||
html += '<input id="txtSearch" class="txtSearch" type="search" required="required" />';
|
||||
|
||||
html += '<button id="btnSearch" class="btnSearch" type="submit">';
|
||||
html += '<img src="css/images/searchbutton.png" />';
|
||||
html += '</button>';
|
||||
|
||||
html += '</form>';
|
||||
|
||||
html += '<div id="searchHints" class="searchHints" style="display:none;"><div class="searchHintsContent"><div class="circle"></div><div class="circle1"></div></div></div>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
return html;
|
||||
$(panel).panel('toggle');
|
||||
};
|
||||
|
||||
self.onSearchRendered = function (parentElem) {
|
||||
|
||||
$('#searchForm', parentElem).on("submit", function () {
|
||||
|
||||
Dashboard.alert('Coming soon.');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#searchHints', parentElem).on("keydown", '.searchHint', function (e) {
|
||||
|
||||
// Down
|
||||
|
@ -298,39 +296,6 @@
|
|||
}
|
||||
});
|
||||
|
||||
$('#txtSearch', parentElem).on("keyup", function (e) {
|
||||
|
||||
// Down
|
||||
if (e.keyCode == 40) {
|
||||
|
||||
var first = $('.searchHint', parentElem)[0];
|
||||
|
||||
if (first) {
|
||||
first.focus();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}).on("keyup", function (e) {
|
||||
|
||||
if (e.keyCode != 40) {
|
||||
var value = this.value;
|
||||
|
||||
showFlyout(parentElem);
|
||||
updateFlyout(parentElem, value);
|
||||
}
|
||||
|
||||
}).on("focus", function () {
|
||||
|
||||
var value = this.value;
|
||||
|
||||
if (value) {
|
||||
showFlyout(parentElem, value);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -338,8 +303,6 @@
|
|||
|
||||
$(document).on('pagehide', ".libraryPage", function () {
|
||||
|
||||
hideFlyout(this);
|
||||
|
||||
$('#txtSearch', this).val('');
|
||||
});
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@ var Dashboard = {
|
|||
|
||||
showServerRestartWarning: function (systemInfo) {
|
||||
|
||||
var html = '<span style="margin-right: 1em;">Please restart Media Browser Server to finish updating.</span>';
|
||||
var html = '<span style="margin-right: 1em;">Please restart to finish updating.</span>';
|
||||
|
||||
if (systemInfo.CanSelfRestart) {
|
||||
html += '<button type="button" data-icon="refresh" onclick="$(this).buttonEnabled(false);Dashboard.restartServer();" data-theme="b" data-inline="true" data-mini="true">Restart Server</button>';
|
||||
|
@ -717,7 +717,6 @@ var Dashboard = {
|
|||
|
||||
var page = $.mobile.activePage;
|
||||
|
||||
|
||||
$("#dashboardPanel", page).panel("open");
|
||||
},
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
|
||||
deleteUser: function (link) {
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
var name = link.getAttribute('data-username');
|
||||
|
||||
var msg = "Are you sure you wish to delete " + name + "?";
|
||||
|
@ -74,7 +75,7 @@
|
|||
|
||||
ApiClient.deleteUser(id).done(function () {
|
||||
|
||||
Dashboard.validateCurrentUser($.mobile.activePage);
|
||||
Dashboard.validateCurrentUser(page);
|
||||
UserProfilesPage.loadPageData();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
self.onSubmit = function () {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
var form = this;
|
||||
|
||||
ApiClient.getUsers().done(function (users) {
|
||||
|
||||
|
@ -23,13 +23,13 @@
|
|||
|
||||
user = users[0];
|
||||
|
||||
user.Name = $('#txtUsername', page).val();
|
||||
user.Name = $('#txtUsername', form).val();
|
||||
|
||||
ApiClient.updateUser(user).done(onSaveComplete);
|
||||
|
||||
} else {
|
||||
|
||||
user = { Name: $('#txtUsername', page).val() };
|
||||
user = { Name: $('#txtUsername', form).val() };
|
||||
|
||||
ApiClient.createUser(user).done(onSaveComplete);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue