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

update voice script

This commit is contained in:
Luke Pulverenti 2015-06-02 13:46:44 -04:00
parent 99f5167804
commit 9bdb4a323f
10 changed files with 125 additions and 29 deletions

View file

@ -920,7 +920,7 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
padding-top: 3px; padding-top: 3px;
border-radius: 50%; border-radius: 50%;
color: #fff; color: #fff;
background: rgba(51, 136, 204, .8); background: rgba(82, 181, 75, .8);
line-height: 16px; line-height: 16px;
} }
@ -928,6 +928,59 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
background: rgba(255, 106, 0, .8); background: rgba(255, 106, 0, .8);
} }
.pieIndicator {
height: 24px;
position: absolute;
top: 32px;
right: 29px;
text-align: center;
vertical-align: middle;
}
.pieBackground {
background-color: rgb(82, 181, 75);
position: absolute;
width: 24px;
height: 24px;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
-o-border-radius: 50px;
border-radius: 50px;
z-index: 1;
}
.pieIndicator .fa {
color: #fff;
z-index: 4;
position: absolute;
margin: 5px 0 0 6px;
}
.pie {
position: absolute;
width: 24px;
height: 24px;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
-o-border-radius: 50px;
border-radius: 50px;
clip: rect(0px, 12px, 24px, 0px);
background-color: rgba(31, 31, 31, .8);
z-index: 2;
}
.hold {
position: absolute;
width: 24px;
height: 24px;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
-o-border-radius: 50px;
border-radius: 50px;
clip: rect(0px, 24px, 24px, 12px);
z-index: 3;
}
.playedIndicator { .playedIndicator {
display: block; display: block;
position: absolute; position: absolute;
@ -1387,6 +1440,12 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
.listItem a:first-child { .listItem a:first-child {
margin-right: 0 !important; margin-right: 0 !important;
background-color: transparent !important; background-color: transparent !important;
padding-top: 0;
padding-bottom: 0;
}
.listItem.ui-li-has-thumb .ui-btn {
padding-left: 5.9em !important;
} }
.ui-page-theme-a .listItem a:first-child { .ui-page-theme-a .listItem a:first-child {
@ -1410,6 +1469,10 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
background-color: rgba(51,51,51,.6) !important; background-color: rgba(51,51,51,.6) !important;
} }
.listviewSubLink:hover {
color: #2ad;
}
@media all and (max-width: 600px) { @media all and (max-width: 600px) {
.itemsListview .ui-li-aside { .itemsListview .ui-li-aside {

View file

@ -154,15 +154,6 @@ h1 a:hover {
bottom: 0; bottom: 0;
right: 0; right: 0;
overflow: hidden; overflow: hidden;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
}
.ui-panel-inner::-webkit-scrollbar {
width: 0 !important;
display: none;
} }
.ui-slider-track.ui-mini .ui-slider-handle { .ui-slider-track.ui-mini .ui-slider-handle {
@ -189,15 +180,15 @@ h1 a:hover {
} }
.hiddenScrollY { .hiddenScrollY, .ui-panel-inner {
overflow-y: scroll; overflow-y: auto;
-ms-overflow-style: none; -ms-overflow-style: none;
overflow: -moz-scrollbars-none; overflow: -moz-scrollbars-none;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
overflow-x: hidden; overflow-x: hidden;
} }
.hiddenScrollY::-webkit-scrollbar { .touch .hiddenScrollY::-webkit-scrollbar, .touch .ui-panel-inner::-webkit-scrollbar {
width: 0 !important; width: 0 !important;
display: none; display: none;
} }

View file

@ -452,7 +452,6 @@
html = LibraryBrowser.getListViewHtml({ html = LibraryBrowser.getListViewHtml({
items: result.Items, items: result.Items,
smallIcon: true,
playFromHere: true, playFromHere: true,
defaultAction: 'playallfromhere' defaultAction: 'playallfromhere'
}); });
@ -504,8 +503,7 @@
else { else {
html = LibraryBrowser.getListViewHtml({ html = LibraryBrowser.getListViewHtml({
items: result.Items, items: result.Items
smallIcon: true
}); });
} }

View file

@ -811,11 +811,27 @@
} }
textlines.push(displayName); textlines.push(displayName);
var verticalTextLines = 2;
var enableSubLinks = !AppInfo.isTouchPreferred;
if (item.Type == 'Audio') { if (item.Type == 'Audio') {
textlines.push(item.ArtistItems.map(function (a) { textlines.push(item.ArtistItems.map(function (a) {
if (enableSubLinks) {
return '<span class="listviewSubLink" data-href="itembynamedetails.html?id=' + a.Id + '&context=music">' + a.Name + '</span>';
} else {
return a.Name; return a.Name;
}
}).join(', ') || '&nbsp;'); }).join(', ') || '&nbsp;');
if (item.Album && item.AlbumId && !options.smallIcon) {
verticalTextLines++;
if (enableSubLinks) {
textlines.push('<span class="listviewSubLink" data-href="itemdetails.html?id=' + item.AlbumId + '&context=music">' + item.Album + '</span>');
} else {
textlines.push(item.Album);
}
}
} }
if (item.Type == 'Game') { if (item.Type == 'Game') {
@ -836,14 +852,20 @@
html += textlines[0]; html += textlines[0];
html += '</h3>'; html += '</h3>';
if (textlines.length > 1) { if (textlines.length > 1 && verticalTextLines > 1) {
html += '<p>'; html += '<p>';
html += textlines[1]; html += textlines[1];
html += '</p>'; html += '</p>';
} }
if (textlines.length > 2 && verticalTextLines > 2) {
html += '<p>';
html += textlines[2];
html += '</p>';
}
html += '<div class="ui-li-aside">'; html += '<div class="ui-li-aside">';
html += textlines[2] || LibraryBrowser.getRatingHtml(item, false); html += textlines[verticalTextLines] || LibraryBrowser.getRatingHtml(item, false);
html += '</div>'; html += '</div>';
if (item.Type == 'Series' || item.Type == 'Season' || item.Type == 'BoxSet' || item.MediaType == 'Video') { if (item.Type == 'Series' || item.Type == 'Season' || item.Type == 'BoxSet' || item.MediaType == 'Video') {
@ -1852,6 +1874,16 @@
getSyncIndicator: function (item) { getSyncIndicator: function (item) {
if (item.SyncPercent) {
if (item.SyncPercent >= 100) {
return '<div class="syncIndicator"><i class="fa fa-refresh"></i></div>';
}
var degree = (item.SyncPercent / 100) * 360;
return '<div class="pieIndicator"><i class="fa fa-refresh"></i><div class="pieBackground"></div><div class="hold"><div class="pie" style="-webkit-transform: rotate(' + degree + 'deg);-moz-transform: rotate(' + degree + 'deg);-o-transform: rotate(' + degree + 'deg);transform: rotate(' + degree + 'deg);"></div></div></div>';
}
if (item.SyncStatus) { if (item.SyncStatus) {
if (item.SyncStatus == 'Queued' || item.SyncStatus == 'Converting' || item.SyncStatus == 'ReadyToTransfer' || item.SyncStatus == 'Transferring') { if (item.SyncStatus == 'Queued' || item.SyncStatus == 'Converting' || item.SyncStatus == 'ReadyToTransfer' || item.SyncStatus == 'Transferring') {

View file

@ -1049,6 +1049,13 @@
PlaylistManager.showPanel(selection); PlaylistManager.showPanel(selection);
} }
function onListviewSubLinkClick(e) {
var elem = e.target;
Dashboard.navigate(elem.getAttribute('data-href'));
return false;
}
function onItemWithActionClick(e) { function onItemWithActionClick(e) {
var elem = this; var elem = this;
@ -1129,7 +1136,7 @@
toggleSelections(page); toggleSelections(page);
}).on('click', '.itemWithAction', onItemWithActionClick); }).on('click', '.itemWithAction', onItemWithActionClick).on('click', '.listviewSubLink', onListviewSubLinkClick);
$('.itemsContainer', page).createCardMenus(); $('.itemsContainer', page).createCardMenus();

View file

@ -56,7 +56,7 @@
$('.btnCast', header).show(); $('.btnCast', header).show();
$('.headerSearchButton', header).show(); $('.headerSearchButton', header).show();
requirejs(['scripts/voice'], function () { requirejs(['voice/voice'], function () {
if (VoiceInputManager.isSupported()) { if (VoiceInputManager.isSupported()) {
$('.headerVoiceButton', header).show(); $('.headerVoiceButton', header).show();

View file

@ -98,7 +98,6 @@
showIndex: false, showIndex: false,
title: item.Name, title: item.Name,
showRemoveFromPlaylist: true, showRemoveFromPlaylist: true,
smallIcon: true,
playFromHere: true, playFromHere: true,
defaultAction: 'playallfromhere' defaultAction: 'playallfromhere'
}); });

View file

@ -63,7 +63,6 @@
html += LibraryBrowser.getListViewHtml({ html += LibraryBrowser.getListViewHtml({
items: result.Items, items: result.Items,
smallIcon: true,
showIndex: true, showIndex: true,
defaultAction: 'play' defaultAction: 'play'
}); });

View file

@ -1,5 +1,5 @@
.voiceInputHelp { .voiceInputHelp {
background-image: url(images/splash.jpg); background-image: url(../css/images/splash.jpg);
top: 50px; top: 50px;
left: 0; left: 0;
right: 0; right: 0;

View file

@ -148,7 +148,7 @@
var words = text.toLowerCase().split(' '); var words = text.toLowerCase().split(' ');
if (words.indexOf('show') != -1 || words.indexOf('pull') != -1 || words.indexOf('display') != -1) { if (words.indexOf('show') != -1 || words.indexOf('pull') != -1 || words.indexOf('display') != -1 || words.indexOf('go') != -1) {
if (words.indexOf('guide') != -1) { if (words.indexOf('guide') != -1) {
result.action = 'show'; result.action = 'show';
@ -164,6 +164,7 @@
result.removeWords.push('pull up'); result.removeWords.push('pull up');
result.removeWords.push('pull'); result.removeWords.push('pull');
result.removeWords.push('display'); result.removeWords.push('display');
result.removeWords.push('go to');
return result; return result;
} }
@ -450,7 +451,7 @@
destroyCurrentRecognition(); destroyCurrentRecognition();
require([ require([
'css!/web/css/voice' 'css!voice/voice'
], function () { ], function () {
startListeningInternal(); startListeningInternal();
@ -486,6 +487,12 @@
window.VoiceInputManager = { window.VoiceInputManager = {
isSupported: function () { isSupported: function () {
// Crashing. Don't want to fight it right now
if (AppInfo.isNativeApp && $.browser.safari) {
return false;
}
return window.SpeechRecognition || window.webkitSpeechRecognition; return window.SpeechRecognition || window.webkitSpeechRecognition;
}, },