1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-12-27 03:10:26 +00:00

Removed onclick markup

This commit is contained in:
jcorporation 2018-06-29 00:44:52 +01:00
parent e6fef5a174
commit a239edcff2
2 changed files with 93 additions and 60 deletions

View File

@ -26,24 +26,24 @@
</form>
<div class="dropdown-divider"></div>
<a id="nav-addstream" class="dropdown-item text-light bg-dark" href="#" data-toggle="modal" data-target="#addstream">Add Stream</a>
<a id="nav-updatedb" class="dropdown-item text-light bg-dark" href="#" onclick="updateDB(event);">Update Database</a>
<a id="nav-localplayer" class="dropdown-item text-light bg-dark" href="#" data-toggle="dropdown" onclick="window.open('/player.html#'+settings.mpdstream,'LocalPlayer');">Local Player</a>
<a id="nav-updatedb" class="dropdown-item text-light bg-dark" href="#">Update Database</a>
<a id="nav-localplayer" class="dropdown-item text-light bg-dark" href="#" data-toggle="dropdown">Local Player</a>
<a id="nav-settings" class="dropdown-item text-light bg-dark" href="#" data-toggle="modal" data-target="#settings">Settings</a>
<a id="nav-about" class="dropdown-item text-light bg-dark" href="#" data-toggle="modal" data-target="#about">About</a>
</div>
</div>
<div class="btn-toolbar col-auto pl-0 pr-0" role="toolbar">
<div class="btn-group mr-2" role="group">
<button id="btnPrev" type="button" class="btn btn-secondary pl-2 pr-2 material-icons" onclick="clickPrev();;">
<div class="btn-group mr-2" role="group" id="playControlBtns">
<button id="btnPrev" type="button" class="btn btn-secondary pl-2 pr-2 material-icons">
skip_previous
</button>
<button id="btnStop" type="button" class="btn btn-secondary pl-2 pr-2 material-icons" onclick="clickStop();">
<button id="btnStop" type="button" class="btn btn-secondary pl-2 pr-2 material-icons">
stop
</button>
<button id="btnPlay" type="button" class="btn btn-secondary pl-2 pr-2 material-icons" onclick="clickPlay();">
<button id="btnPlay" type="button" class="btn btn-secondary pl-2 pr-2 material-icons">
pause
</button>
<button id="btnNext" type="button" class="btn btn-secondary pl-2 pr-2 material-icons" onclick="clickNext();">
<button id="btnNext" type="button" class="btn btn-secondary pl-2 pr-2 material-icons">
skip_next
</button>
</div>
@ -55,11 +55,11 @@
<h2 class="dropdown-header text-light">Volume: <span id="volumePrct"></span></h2>
<form class="px-4 py-0 pb-3" id="volumeControl">
<div class="btn-group" role="group">
<input type="button" class="btn btn-secondary" value="&minus;" onclick="chVolume(-5)"/>
<input id="chVolumeMinus" type="button" class="btn btn-secondary" value="&minus;"/>
<div class="btn btn-secondary">
<input type="range" min="0" max="100" step="1" class="form-control-range" id="volumeBar">
</div>
<input type="button" class="btn btn-secondary" value="+" onclick="chVolume(5)"/>
<input id="chVolumePlus" type="button" class="btn btn-secondary" value="+"/>
</div>
</form>
<div class="dropdown-divider"></div>
@ -91,7 +91,6 @@
</div>
</div>
<div class="card hide" id="cardQueue">
<div class="card-header">
<a href="#" data-toggle="collapse" data-target="#queue-buttons" class="text-dark">Queue</a>

View File

@ -363,62 +363,96 @@ $(document).ready(function(){
sendAPI({"cmd": "MPD_API_ADD_TRACK", "data": { "uri": app.current.search}});
},false);
$('#cardBrowseNavFilesystem').on('click', function (e) {
app.goto('Browse','Filesystem');
e.preventDefault();
});
document.getElementById('nav-updatedb').addEventListener('click', function(event) {
updateDB(event);
},false);
$('#cardBrowseNavDatabase').on('click', function (e) {
document.getElementById('nav-localplayer').addEventListener('click', function(event) {
window.open('/player.html#' + settings.mpdstream, 'LocalPlayer');
},false);
document.getElementById('playControlBtns').addEventListener('click', function(event) {
if (event.target.nodeName == 'BUTTON') {
switch (event.target.getAttribute('id')) {
case 'btnPrev':
clickPrev();
break;
case 'btnStop':
clickStop();
break;
case 'btnPlay':
clickPlay();
break;
case 'btnNext':
clickNext();
break;
}
}
}, false);
document.getElementById('chVolumeMinus').addEventListener('click', function(event) {
chVolume(-5)
},false);
document.getElementById('chVolumePlus').addEventListener('click', function(event) {
chVolume(5)
},false);
document.getElementById('panel-heading-browse').addEventListener('click', function(event) {
if (event.target.nodeName == 'A') {
event.preventDefault();
switch (event.target.getAttribute('id')) {
case 'cardBrowseNavDatabase':
app.goto('Browse','Database');
e.preventDefault();
});
$('#btnBrowseDatabaseArtist').on('click', function (e) {
app.goto('Browse','Database','Artist');
e.preventDefault();
});
$('#cardBrowseNavPlaylists').on('click', function (e) {
break;
case 'cardBrowseNavPlaylists':
app.goto('Browse','Playlists');
e.preventDefault();
});
$('#cardBrowseNavFilesystem').on('click', function (e) {
break;
case 'cardBrowseNavFilesystem':
app.goto('Browse','Filesystem');
e.preventDefault();
});
break;
}
}
}, false);
$('#navPlayback').on('click', function (e) {
document.getElementById('btnBrowseDatabaseArtist').addEventListener('click', function (event) {
app.goto('Browse','Database','Artist');
event.preventDefault();
}, false);
document.getElementById('navbar-bottom').addEventListener('click', function(event) {
if (event.target.nodeName == 'A') {
event.preventDefault();
switch (event.target.parentNode.getAttribute('id')) {
case 'navPlayback':
app.goto('Playback');
e.preventDefault();
});
$('#navQueue').on('click', function (e) {
break;
case 'navQueue':
app.goto('Queue');
e.preventDefault();
});
$('#navBrowse').on('click', function (e) {
break;
case 'navBrowse':
app.goto('Browse');
e.preventDefault();
});
$('#navSearch').on('click', function (e) {
break;
case 'navSearch':
app.goto('Search');
e.preventDefault();
});
break;
}
}
}, false);
$('#searchtags2 > button').on('click',function (e) {
app.goto(app.current.app, app.current.tab, app.current.view, '0/' + this.innerText + '/' + app.current.search);
});
document.getElementById('searchtags2').addEventListener('click', function(event) {
if (event.target.nodeName == 'BUTTON')
app.goto(app.current.app, app.current.tab, app.current.view, '0/' + event.target.innerText + '/' + app.current.search);
}, false);
$('#searchqueuestr').keyup(function (event) {
document.getElementById('searchqueuestr').addEventListener('keyup', function(event) {
app.goto(app.current.app, app.current.tab, app.current.view, '0/' + app.current.filter + '/' + this.value);
});
}, false);
$('#searchqueuetag > button').on('click',function (e) {
app.goto(app.current.app, app.current.tab, app.current.view, app.current.page + '/' + this.innerText + '/' + app.current.search);
});
document.getElementById('searchqueuetag').addEventListener('click', function (event) {
if (event.target.nodeName == 'BUTTON')
app.goto(app.current.app, app.current.tab, app.current.view, app.current.page + '/' + event.target.innerText + '/' + app.current.search);
}, false);
document.getElementById('inputSearch').addEventListener('keypress', function (event) {
if ( event.which == 13 )
@ -439,7 +473,7 @@ $(document).ready(function(){
}, false);
document.getElementById('searchstr2').addEventListener('keyup', function (event) {
app.goto('Search', undefined, undefined, app.current.page + '0/' + app.current.filter + '/' + this.value);
app.goto('Search', undefined, undefined, '0/' + app.current.filter + '/' + this.value);
}, false);
window.addEventListener('hashchange', app.route, false);