Better modals

This commit is contained in:
Paul Sori 2018-11-18 01:15:35 -05:00
parent 7ac06a7055
commit 7783cf67a8
5 changed files with 55 additions and 11 deletions

View File

@ -88,7 +88,7 @@ exports.setup = function (mstream, program) {
// Scan library
mstream.get('/db/recursive-scan', (req, res) => {
runScan(program);
const scan = runScan(program);
res.status((scan.error === true) ? 555 : 200).json({ status: scan.message });
});
}

View File

@ -14,6 +14,32 @@ body {
clear: both;
}
#save_playlist_form{
padding-left: 15px;
padding-right: 15px;
padding-top: 25px;
}
input[type="submit"], input[type="button"] {
background-color: rgb(147, 151, 205);
border-radius: 2px;
border-style: solid;
border-width: 1px;
border-color: rgb(147, 151, 205);
box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px;
box-sizing: border-box;
color: rgb(255, 255, 255);
cursor: pointer;
width: 150px;
height: 40px;
font-weight: 800;
font-size: 15px;
font-family: 'Jura', sans-serif;
}
input[type="submit"]:focus {outline:0;}
input[type="button"]:focus {outline:0;}
.fullHeight {
height: 100%;
overflow: scroll; }

View File

@ -23,11 +23,13 @@ $(document).ready(function () {
// Modals
$("#sharePlaylist").iziModal({
title: 'Share Playlist',
setBottom: 100
headerColor: '#5a5a6a',
padding: 15
});
$('#savePlaylist').iziModal({
title: 'Save Playlist',
setBottom: 100
headerColor: '#5a5a6a',
width: 475
});
$(document).on('click', '.trigger-share', function (event) {
event.preventDefault();
@ -42,6 +44,7 @@ $(document).ready(function () {
$('#savePlaylist').iziModal('open');
});
$('#savePlaylist').iziModal('setTop', '15%');
$('#sharePlaylist').iziModal('setTop', '15%');
const myDropzone = new Dropzone(document.body, {
previewsContainer: false,
@ -304,6 +307,9 @@ $(document).ready(function () {
/////////////////////////////////////// File Explorer
function loadFileExplorer() {
$('ul.left-nav-menu li').removeClass('selected');
$('.get_file_explorer').addClass('selected');
resetPanel('File Explorer', 'scrollBoxHeight1');
programState = [{
state: 'fileExplorer'
@ -627,6 +633,8 @@ $(document).ready(function () {
});
function getAllPlaylists() {
$('ul.left-nav-menu li').removeClass('selected');
$('.get_all_playlists').addClass('selected');
resetPanel('Playlists', 'scrollBoxHeight1');
programState = [{
state: 'allPlaylists'
@ -767,6 +775,8 @@ $(document).ready(function () {
///////////////////////////// Database Management
// The Manage DB panel
$('.db-panel').on('click', function () {
$('ul.left-nav-menu li').removeClass('selected');
$('.db-panel').addClass('selected');
resetPanel('Database', 'scrollBoxHeight2');
$('#directory_bar').hide();
@ -794,7 +804,7 @@ $(document).ready(function () {
return;
}
// If you got this far the db is made and working
$('#filelist').append('<p>Your DB has ' + response.totalFileCount + ' files</p><input type="button" class="button secondary rounded small" value="Build Database" id="build_database">');
$('#filelist').append('<p>Your DB has ' + response.totalFileCount + ' files</p><input type="button" value="Build Database" id="build_database">');
});
});
@ -841,6 +851,8 @@ $(document).ready(function () {
});
function getAllAlbums() {
$('ul.left-nav-menu li').removeClass('selected');
$('.get_all_albums').addClass('selected');
resetPanel('Albums', 'scrollBoxHeight1');
programState = [{
@ -919,6 +931,8 @@ $(document).ready(function () {
});
function getAllArtists() {
$('ul.left-nav-menu li').removeClass('selected');
$('.get_all_artists').addClass('selected');
resetPanel('Artists', 'scrollBoxHeight1');
programState = [{
state: 'allArtists'
@ -984,6 +998,8 @@ $(document).ready(function () {
getRatedSongs();
});
function getRatedSongs() {
$('ul.left-nav-menu li').removeClass('selected');
$('.get_rated_songs').addClass('selected');
resetPanel('Starred', 'scrollBoxHeight1');
programState = [{
state: 'allRated'
@ -1026,6 +1042,8 @@ $(document).ready(function () {
//////////////////////// Jukebox Mode
function setupJukeboxPanel() {
$('ul.left-nav-menu li').removeClass('selected');
$('.jukebox_mode').addClass('selected');
// Hide the directory bar
resetPanel('Jukebox Mode', 'scrollBoxHeight2');
currentBrowsingList = [];
@ -1039,7 +1057,7 @@ $(document).ready(function () {
<p class="jukebox-panel">\
<br><br>\
<h3>Jukebox Mode allows you to control this page remotely<h3> <br><br>\
<div class="jukebox_connect button"> CONNECT IT!</div>\
<input value="Connect" type="button" class="jukebox_connect">\
</p>\
<img src="/public/img/loading.gif" class="hide jukebox-loading">';
}
@ -1049,7 +1067,7 @@ $(document).ready(function () {
}
// The jukebox panel
$('#jukebox_mode').on('click', function () {
$('.jukebox_mode').on('click', function () {
setupJukeboxPanel();
});

View File

@ -875,7 +875,7 @@ $(document).ready(function () {
}
// The jukebox panel
$('#jukebox_mode').on('click', function () {
$('.jukebox_mode').on('click', function () {
setupJukeboxPanel();
});

View File

@ -93,7 +93,7 @@
<label>Password</label>
<input required type="password" class="form-control" id="login-password">
</div>
<button id="login-submit" type="submit" class="btn btn-warning btn-lg" :disabled="pending === true ? true : false">Login</button>
<input value="Login" id="login-submit" type="submit" :disabled="pending === true ? true : false">
</form>
</div>
<div class="large-3 medium-3 small-1 columns">
@ -106,7 +106,7 @@
<div id="savePlaylist" class="hide">
<form id="save_playlist_form">
<input id="playlist_name" type="text" required placeholder="Enter your playlist name" pattern="[a-zA-Z0-9 _-]+">
<input id="save_playlist" type="submit" class="button small" value="Save Playlist">
<input id="save_playlist" type="submit" class="" value="Save Playlist">
</form>
</div>
@ -120,7 +120,7 @@
<span class="share-time-post postfix radius">Days</span>
</div>
</div>
<input id="share_it" type="submit" class="button small" value="Share It!">
<input id="share_it" type="submit" value="Share It!">
</form>
<textarea class="share-textarea" rows="8" cols="60" placeholder="Your URL will be put here" readonly="readonly"></textarea>
</div>
@ -189,7 +189,7 @@
<svg viewBox="0 0 1024 768" height="24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M384 960C171.969 960 0 902.625 0 832V704c0-11.125 5.562-21.688 13.562-32C56.375 727.125 205.25 768 384 768s327.625-40.875 370.438-96c8 10.312 13.562 20.875 13.562 32v128c0 70.625-172 128-384 128zm0-256C171.969 704 0 646.625 0 576V448c0-6.781 2.562-13.375 6-19.906C7.938 424 10.5 419.969 13.562 416 56.375 471.094 205.25 512 384 512s327.625-40.906 370.438-96c3.062 3.969 5.625 8 7.562 12.094 3.438 6.531 6 13.125 6 19.906v128c0 70.625-172 128-384 128zm0-256C171.969 448 0 390.656 0 320v-64-64C0 121.344 171.969 64 384 64c212 0 384 57.344 384 128v128c0 70.656-172 128-384 128zm0-320c-141.375 0-256 28.594-256 64s114.625 64 256 64 256-28.594 256-64-114.625-64-256-64z"/></svg>
Database
</li>
<li class="">
<li class="jukebox_mode">
Jukebox
</li>
</ul>