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

strip unused css from initial download

This commit is contained in:
Luke Pulverenti 2015-11-27 13:24:44 -05:00
parent 6a9accf68f
commit 2d014a82b4
10 changed files with 82 additions and 108 deletions

View file

@ -39,6 +39,6 @@
"commit": "cec8e49744a1e18b14a711eea77e201bb70de544" "commit": "cec8e49744a1e18b14a711eea77e201bb70de544"
}, },
"_source": "git://github.com/desandro/doc-ready.git", "_source": "git://github.com/desandro/doc-ready.git",
"_target": "~1.0.4", "_target": "1.0.x",
"_originalSource": "doc-ready" "_originalSource": "doc-ready"
} }

View file

@ -1,71 +0,0 @@
#mediaElement {
display: inline-block;
position: relative;
}
.nowPlayingText {
display: inline-block;
font-weight: normal;
position: relative;
top: -7px;
margin: 0 0 0 3px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
vertical-align: middle;
text-align: left;
font-size: 15px;
max-width: 130px;
}
.mediaButton.infoButton {
width: 34px;
height: 34px;
}
.mediaButton.active {
color: #52B54B;
}
@media (min-width: 500px) {
.nowPlayingText {
max-width: 180px;
}
}
@media (min-width: 600px) {
.nowPlayingText {
max-width: 200px;
}
}
@media (min-width: 800px) {
.nowPlayingText {
margin-right: 30px;
}
}
.mediaButton img {
height: 24px;
}
.currentTime {
display: inline-block;
vertical-align: middle;
max-width: 110px;
margin-right: 2em;
font-weight: normal;
}
.mediaPlayerAudioContainer {
position: fixed;
top: 40%;
text-align: center;
left: 0;
right: 0;
}
.mediaPlayerAudioContainerInner {
padding: 1em;
background: #222;
}

View file

@ -1,4 +1,58 @@
/* Now playing bar */ .nowPlayingText {
display: inline-block;
font-weight: normal;
position: relative;
top: -7px;
margin: 0 0 0 3px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
vertical-align: middle;
text-align: left;
font-size: 15px;
max-width: 130px;
}
.mediaButton.infoButton {
width: 34px;
height: 34px;
}
.mediaButton.active {
color: #52B54B;
}
@media (min-width: 500px) {
.nowPlayingText {
max-width: 180px;
}
}
@media (min-width: 600px) {
.nowPlayingText {
max-width: 200px;
}
}
@media (min-width: 800px) {
.nowPlayingText {
margin-right: 30px;
}
}
.mediaButton img {
height: 24px;
}
.currentTime {
display: inline-block;
vertical-align: middle;
max-width: 110px;
margin-right: 2em;
font-weight: normal;
}
/* Now playing bar */
.nowPlayingBar { .nowPlayingBar {
border-top: 1px solid #444; border-top: 1px solid #444;
text-align: center; text-align: center;

View file

@ -664,19 +664,6 @@ div[data-role="controlgroup"] a.ui-btn-active {
transform: translateY(-205%); transform: translateY(-205%);
} }
.largePanel {
width: 270px !important;
}
/* Make panels larger */
.largePanelModalOpen.ui-panel-dismiss-position-right {
right: 270px !important;
}
.largePanelModalOpen.ui-panel-dismiss-position-left {
left: 270px !important;
}
.checkboxContainer { .checkboxContainer {
white-space: nowrap; white-space: nowrap;
} }
@ -696,22 +683,6 @@ div[data-role="controlgroup"] a.ui-btn-active {
padding: .7em .5em; padding: .7em .5em;
} }
@media all and (min-width: 340px) {
.largePanel {
width: 300px !important;
}
/* Make panels larger */
.largePanelModalOpen.ui-panel-dismiss-position-right {
right: 300px !important;
}
.largePanelModalOpen.ui-panel-dismiss-position-left {
left: 300px !important;
}
}
textarea { textarea {
width: 100%; width: 100%;
} }

View file

@ -223,7 +223,7 @@
$('.alphabetPicker', page).alphaValue(query.NameStartsWith); $('.alphabetPicker', page).alphaValue(query.NameStartsWith);
} }
pageIdOn.on('pageinit', "channelItemsPage", function () { pageIdOn('pageinit', "channelItemsPage", function () {
var page = this; var page = this;

View file

@ -160,9 +160,9 @@
var requiresControls = !MediaPlayer.canAutoPlayAudio(); var requiresControls = !MediaPlayer.canAutoPlayAudio();
if (requiresControls) { if (requiresControls) {
html += '<div class="mediaPlayerAudioContainer"><div class="mediaPlayerAudioContainerInner">';; html += '<div class="mediaPlayerAudioContainer" style="position: fixed;top: 40%;text-align: center;left: 0;right: 0;"><div class="mediaPlayerAudioContainerInner">';;
} else { } else {
html += '<div class="mediaPlayerAudioContainer" style="display:none;"><div class="mediaPlayerAudioContainerInner">';; html += '<div class="mediaPlayerAudioContainer" style="display:none;padding: 1em;background: #222;"><div class="mediaPlayerAudioContainerInner">';;
} }
html += '<audio class="mediaPlayerAudio" crossorigin="anonymous" controls>'; html += '<audio class="mediaPlayerAudio" crossorigin="anonymous" controls>';

View file

@ -674,6 +674,8 @@
function ensureVideoPlayerElements() { function ensureVideoPlayerElements() {
Dashboard.importCss('css/mediaplayer-video.css');
var html = '<div id="mediaPlayer" style="display: none;">'; var html = '<div id="mediaPlayer" style="display: none;">';
html += '<div class="videoBackdrop">'; html += '<div class="videoBackdrop">';
@ -745,7 +747,6 @@
var div = document.createElement('div'); var div = document.createElement('div');
div.innerHTML = html; div.innerHTML = html;
document.body.appendChild(div); document.body.appendChild(div);
$(div).trigger('create');
} }
Dashboard.ready(function () { Dashboard.ready(function () {

View file

@ -764,6 +764,7 @@
var page = this; var page = this;
Dashboard.importCss('css/nowplaying.css');
bindEvents(page); bindEvents(page);
$('.sendMessageForm').off('submit', NowPlayingPage.onMessageSubmit).on('submit', NowPlayingPage.onMessageSubmit); $('.sendMessageForm').off('submit', NowPlayingPage.onMessageSubmit).on('submit', NowPlayingPage.onMessageSubmit);

View file

@ -6,6 +6,7 @@
self.show = function () { self.show = function () {
Dashboard.importCss('css/search.css');
$('.headerSearchInput').val(''); $('.headerSearchInput').val('');
require(["jquery", "velocity"], function ($, Velocity) { require(["jquery", "velocity"], function ($, Velocity) {

View file

@ -1924,9 +1924,26 @@ var AppInfo = {};
tapDelay: 0 tapDelay: 0
}); });
function parentWithClass(elem, className) {
while (!elem.classList || !elem.classList.contains(className)) {
elem = elem.parentNode;
if (!elem) {
return null;
}
}
return elem;
}
// Have to work around this issue of fast click breaking the panel dismiss // Have to work around this issue of fast click breaking the panel dismiss
$(document.body).on('touchstart', '.ui-panel-dismiss', function () { document.body.addEventListener('touchstart', function (e) {
$(this).trigger('click');
var tgt = parentWithClass(e.target, 'ui-panel-dismiss');
if (tgt) {
$(tgt).click();
}
}); });
}); });