1
0
mirror of https://github.com/SuperBFG7/ympd synced 2025-05-02 07:24:06 +00:00

Removed bootstrap-notify

This commit is contained in:
jcorporation 2018-07-01 23:49:47 +01:00
parent ab871dfc30
commit 680f9d3425
5 changed files with 40 additions and 24 deletions

View File

@ -12,7 +12,6 @@ This fork provides a reworked ui based on Bootstrap 4 and a modernized backend.
UI Components UI Components
------------- -------------
- Bootstrap 4: https://getbootstrap.com/ - Bootstrap 4: https://getbootstrap.com/
- Bootstrap Notify: http://bootstrap-notify.remabledesigns.com/
- Material Design Icons: https://material.io/tools/icons/?style=baseline - Material Design Icons: https://material.io/tools/icons/?style=baseline
- jQuery: https://jquery.com/ - jQuery: https://jquery.com/

View File

@ -159,10 +159,6 @@ main {
width:160px; width:160px;
} }
[data-notify="title"] {
font-size:120%;
}
.header-logo { .header-logo {
font-size:2rem; font-size:2rem;
float:left; float:left;
@ -194,4 +190,20 @@ button.active {
border-color: #28a745 !important; border-color: #28a745 !important;
} }
div#alertBox {
position:fixed;
top: 50px;
right:10px;
width:80%;
max-width:400px;
z-index:1000;
opacity:0;
visibility:visible;
transition:opacity 0.5s ease-in;
}
div.alertBoxActive {
opacity:1 !important;
visibility:visible !important;
transition:opacity 0.5s ease-in;
}

View File

@ -462,6 +462,11 @@
</div> </div>
</nav> </nav>
</footer> </footer>
<!-- Notifications -->
<div id="alertBox" class="alert alert-success"></div>
<!-- Modal --> <!-- Modal -->
<div class="modal" id="modalConnectionError" role="dialog"> <div class="modal" id="modalConnectionError" role="dialog">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
@ -669,7 +674,6 @@
</div><!-- /.modal --> </div><!-- /.modal -->
<script src="js/jquery-3.3.1.min.js"></script> <script src="js/jquery-3.3.1.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script> <script src="js/bootstrap.bundle.min.js"></script>
<script src="js/bootstrap-notify.min.js"></script>
<script src="js/mpd.js"></script> <script src="js/mpd.js"></script>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

View File

@ -28,6 +28,7 @@ var last_state;
var current_song = new Object(); var current_song = new Object();
var playstate = ''; var playstate = '';
var settings = {}; var settings = {};
var timeOut;
var app = {}; var app = {};
app.apps = { "Playback": { "state": "0/-/" }, app.apps = { "Playback": { "state": "0/-/" },
@ -65,6 +66,7 @@ domCache.btnNext = document.getElementById('btnNext');
domCache.progressBar = document.getElementById('progressBar'); domCache.progressBar = document.getElementById('progressBar');
domCache.volumeBar = document.getElementById('volumeBar'); domCache.volumeBar = document.getElementById('volumeBar');
domCache.outputs = document.getElementById('outputs'); domCache.outputs = document.getElementById('outputs');
domCache.alertBox = document.getElementById('alertBox');
app.prepare=function() { app.prepare=function() {
if (app.current.app != app.last.app || app.current.tab != app.last.tab || app.current.view != app.last.view) { if (app.current.app != app.last.app || app.current.tab != app.last.tab || app.current.view != app.last.view) {
@ -177,21 +179,21 @@ app.route=function() {
else else
document.getElementById('BrowseFilesystemAddAllSongs').setAttribute('disabled', 'disabled') document.getElementById('BrowseFilesystemAddAllSongs').setAttribute('disabled', 'disabled')
// Create breadcrumb // Create breadcrumb
var breadcrumbs=['<li class="breadcrumb-item"><a data-uri="">root</a></li>']; var breadcrumbs='<li class="breadcrumb-item"><a data-uri="">root</a></li>';
var pathArray = app.current.search.split('/'); var pathArray = app.current.search.split('/');
var pathArrayLen = pathArray.length; var pathArrayLen = pathArray.length;
var fullPath = ''; var fullPath = '';
for (var i = 0; i < pathArrayLen; i ++) { for (var i = 0; i < pathArrayLen; i ++) {
if (pathArrayLen -1 == i) { if (pathArrayLen -1 == i) {
breadcrumbs.push('<li class="breadcrumb-item active">' + pathArray[i] + '</li>'); breadcrumbs += '<li class="breadcrumb-item active">' + pathArray[i] + '</li>';
break; break;
} }
fullPath += pathArray[i]; fullPath += pathArray[i];
breadcrumbs.push('<li class="breadcrumb-item"><a data-uri="' + fullPath + '">' + pathArray[i] + '</a></li>'); breadcrumbs += '<li class="breadcrumb-item"><a data-uri="' + fullPath + '">' + pathArray[i] + '</a></li>';
fullPath += '/'; fullPath += '/';
} }
var elBrowseBreadcrumb=document.getElementById('BrowseBreadcrumb'); var elBrowseBreadcrumb=document.getElementById('BrowseBreadcrumb');
elBrowseBreadcrumb.innerHTML = breadcrumbs.join(''); elBrowseBreadcrumb.innerHTML = breadcrumbs;
var breadcrumbItems = elBrowseBreadcrumb.getElementsByTagName('a'); var breadcrumbItems = elBrowseBreadcrumb.getElementsByTagName('a');
var breadcrumbItemsLen = breadcrumbItems.length; var breadcrumbItemsLen = breadcrumbItems.length;
for (var i = 0; i < breadcrumbItemsLen; i ++) { for (var i = 0; i < breadcrumbItemsLen; i ++) {
@ -1027,15 +1029,15 @@ function parseListTitles(obj) {
img.setAttribute('data-name', encodeURI(obj.album)); img.setAttribute('data-name', encodeURI(obj.album));
img.setAttribute('data-type', 'album'); img.setAttribute('data-type', 'album');
var titleList = new Array(); var titleList = '';
var nrItems = obj.data.length; var nrItems = obj.data.length;
for (var i = 0; i < nrItems; i ++) { for (var i = 0; i < nrItems; i ++) {
titleList.push('<tr data-type="song" data-name="' + obj.data[i].title + '" data-uri="' + encodeURI(obj.data[i].uri) + '">' + titleList += '<tr data-type="song" data-name="' + obj.data[i].title + '" data-uri="' + encodeURI(obj.data[i].uri) + '">' +
'<td>' + obj.data[i].track + '</td><td>' + obj.data[i].title + '</td>' + '<td>' + obj.data[i].track + '</td><td>' + obj.data[i].title + '</td>' +
'<td><a href="#" tabindex="0" data-trigger="focus" class="material-icons">playlist_add</a></td>' + '<td><a href="#" tabindex="0" data-trigger="focus" class="material-icons">playlist_add</a></td>' +
'</tr>'); '</tr>';
} }
tbody.innerHTML=titleList.join(''); tbody.innerHTML = titleList;
img.addEventListener('click', function() { img.addEventListener('click', function() {
//appendQueue('song', decodeURI(this.getAttribute('data-uri')), this.getAttribute('data-name')); //appendQueue('song', decodeURI(this.getAttribute('data-uri')), this.getAttribute('data-name'));
@ -1296,12 +1298,13 @@ function showNotification(notificationTitle,notificationText,notificationHtml,no
}, 3000, notification); }, 3000, notification);
} }
if (settings.notificationPage == 1) { if (settings.notificationPage == 1) {
$.notify({ title: notificationTitle, message: notificationHtml},{ type: notificationType, offset: { y:60, x:20 }, domCache.alertBox.innerHTML = '<strong>' + notificationTitle + '</strong>' + notificationHtml;
template: '<div data-notify="container" class="alert alert-{0}" role="alert">' + domCache.alertBox.classList.add('alertBoxActive');
'<span data-notify="title">{1}</span> ' + if (timeOut)
'<span data-notify="message">{2}</span>' + clearTimeout(timeOut);
'</div>' timeOut = setTimeout(function(notificationTitle) {
}); domCache.alertBox.classList.remove('alertBoxActive');
}, 3000);
} }
} }