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

search flyout placeholder

This commit is contained in:
Luke Pulverenti 2013-04-26 16:53:54 -04:00
parent b9cc031d9b
commit ba13b0837d
5 changed files with 183 additions and 87 deletions

View file

@ -113,7 +113,7 @@
} }
.detailPageName + .detailPageName { .detailPageName + .detailPageName {
margin: 0 0 .3em; margin: 0;
} }
.detailPageParentLink { .detailPageParentLink {

View file

@ -0,0 +1,89 @@
.headerSearch {
display: none;
margin-right: 3em;
}
.txtSearch {
vertical-align: middle;
font: 16px arial,sans-serif;
height: 28px;
margin: 0 .15em 0 0;
width: 150px;
}
.searchHints {
width: 148px;
color: #000;
font-family: Arial;
}
.btnSearch {
vertical-align: middle;
background-color: #4d90fe;
background-image: -webkit-gradient(linear,left top,left bottom,from(#4d90fe),to(#4787ed));
background-image: -webkit-linear-gradient(top,#4d90fe,#4787ed);
background-image: -moz-linear-gradient(top,#4d90fe,#4787ed);
background-image: -ms-linear-gradient(top,#4d90fe,#4787ed);
background-image: -o-linear-gradient(top,#4d90fe,#4787ed);
background-image: linear-gradient(top,#4d90fe,#4787ed);
border: 1px solid #3079ed;
color: #fff!important;
margin: 0 0;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
font-weight: bold;
height: 28px;
min-width: 54px;
padding: 0 8px;
text-align: center;
text-decoration: none !important;
-moz-user-select: none;
-webkit-user-select: none;
text-align: center;
}
.btnSearch img {
height: 28px;
margin: 0 auto;
border: 0;
}
.searchHints {
background-color: #fff;
border: 1px solid #ccc;
position: absolute;
z-index: 999;
}
.searchHintsContent {
padding: 10px;
}
@media all and (min-width: 650px) {
.headerSearch {
display: inline-block;
}
}
@media all and (min-width: 750px) {
.txtSearch {
width: 200px;
}
.searchHints {
width: 198px;
}
}
@media all and (min-width: 850px) {
.txtSearch {
width: 250px;
}
.searchHints {
width: 248px;
}
}

View file

@ -26,6 +26,10 @@
src: local("Open Sans"), local("OpenSans"), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/K88pR3goAWT7BTt32Z01mz8E0i7KZn-EPnyo3HZu7kw.woff) format('woff'); src: local("Open Sans"), local("OpenSans"), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/K88pR3goAWT7BTt32Z01mz8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
} }
* {
text-shadow: none!important;
}
body { body {
overflow-y: scroll!important; overflow-y: scroll!important;
} }
@ -125,53 +129,6 @@ pre, textarea.pre {
right: 10px; right: 10px;
} }
.headerSearch {
display: none;
margin-right: 3em;
}
.txtSearch {
width: 150px;
vertical-align: middle;
font: 16px arial,sans-serif;
height: 23px;
line-height: 23px;
margin: 0 .15em 0 0;
}
.btnSearch {
vertical-align: middle;
background-color: #4d90fe;
background-image: -webkit-gradient(linear,left top,left bottom,from(#4d90fe),to(#4787ed));
background-image: -webkit-linear-gradient(top,#4d90fe,#4787ed);
background-image: -moz-linear-gradient(top,#4d90fe,#4787ed);
background-image: -ms-linear-gradient(top,#4d90fe,#4787ed);
background-image: -o-linear-gradient(top,#4d90fe,#4787ed);
background-image: linear-gradient(top,#4d90fe,#4787ed);
border: 1px solid #3079ed;
color: #fff!important;
margin: 0 0;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
font-weight: bold;
height: 29px;
line-height: 29px;
min-width: 54px;
padding: 0 8px;
text-align: center;
text-decoration: none !important;
-moz-user-select: none;
-webkit-user-select: none;
text-align: center;
}
.btnSearch img {
height: 29px;
margin: 0 auto;
border: 0;
}
.header .imageLink { .header .imageLink {
display: inline-block; display: inline-block;
} }
@ -312,10 +269,6 @@ form, .readOnlyContent {
@media all and (min-width: 650px) { @media all and (min-width: 650px) {
.headerSearch {
display: inline-block;
}
.imgLogoIcon { .imgLogoIcon {
height: 50px; height: 50px;
} }
@ -366,10 +319,6 @@ form, .readOnlyContent {
@media all and (min-width: 750px) { @media all and (min-width: 750px) {
.txtSearch {
width: 200px;
}
.imgLogoText { .imgLogoText {
height: 50px; height: 50px;
display: inline; display: inline;
@ -384,13 +333,6 @@ form, .readOnlyContent {
} }
} }
@media all and (min-width: 850px) {
.txtSearch {
width: 250px;
}
}
@media all and (min-width: 1200px) { @media all and (min-width: 1200px) {

View file

@ -0,0 +1,87 @@
(function ($, document, window) {
function createSearchHintsElement() {
$(document.body).append('<div id="searchHints" class="searchHints"><div class="searchHintsContent">Coming soon<div><div>').off("mousedown.hidesearchhints").on("mousedown.hidesearchhints", function (e) {
var elem = $(e.target);
if (!elem.is('#searchHints,#txtSearch,#btnSearch') && !elem.parents('#searchHints,#txtSearch,#btnSearch').length) {
$('#searchHints').remove();
$(document.body).off("mousedown.hidesearchhints");
}
});
var txtElem = $('#txtSearch');
var pos = txtElem.offset();
var hints = $('#searchHints')[0];
hints.style.top = txtElem[0].offsetHeight + pos.top + 1 + "px";
hints.style.left = pos.left + "px";
}
function renderSearchHints(searchTerm) {
var hints = $('#searchHints');
if (!hints.length) {
hints = createSearchHintsElement();
}
}
function search() {
var self = this;
self.getSearchHtml = function () {
var html = '<div class="headerSearch"><form id="searchForm" name="searchForm">';
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></div>';
return html;
};
self.onSearchRendered = function (parentElem) {
$('#searchForm', parentElem).on("submit", function () {
Dashboard.alert('Coming soon.');
return false;
});
$('#txtSearch', parentElem).on("keypress", function () {
renderSearchHints(this.value);
}).on("focus", function () {
var value = this.value;
if (value) {
renderSearchHints(value);
}
});
};
}
window.Search = new search();
})(jQuery, document, window);

View file

@ -696,7 +696,7 @@ var Dashboard = {
if (user && !page.hasClass('wizardPage')) { if (user && !page.hasClass('wizardPage')) {
headerHtml += Dashboard.getSearchHtml(); headerHtml += Search.getSearchHtml();
headerHtml += '<a class="imageLink btnCurrentUser" href="#" onclick="Dashboard.showUserFlyout();"><span class="currentUsername">' + user.Name + '</span>'; headerHtml += '<a class="imageLink btnCurrentUser" href="#" onclick="Dashboard.showUserFlyout();"><span class="currentUsername">' + user.Name + '</span>';
@ -724,7 +724,7 @@ var Dashboard = {
header.append(headerHtml); header.append(headerHtml);
$('#searchForm', header).on("submit", Dashboard.onSearchSubmit); Search.onSearchRendered(header);
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) { Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
if (pluginSecurityInfo.IsMBSupporter) { if (pluginSecurityInfo.IsMBSupporter) {
@ -733,28 +733,6 @@ var Dashboard = {
}); });
}, },
onSearchSubmit: function() {
Dashboard.alert('Coming soon.');
return false;
},
getSearchHtml: function() {
var html = '<div class="headerSearch"><form id="searchForm" name="searchForm">';
html += '<input class="txtSearch" type="text" />';
html += '<button class="btnSearch" type="submit">';
html += '<img src="css/images/searchbutton.png" />';
html += '</button>';
html += '</form></div>';
return html;
},
ensureToolsMenu: function (page) { ensureToolsMenu: function (page) {
if (!page.hasClass('type-interior')) { if (!page.hasClass('type-interior')) {