mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-25 21:53:17 -05:00
Show error messages when creating smart playlists. Closes #180
This commit is contained in:
parent
8ba331adae
commit
a205cda835
@ -158,4 +158,10 @@ td {
|
|||||||
|
|
||||||
#playlist_buttons {
|
#playlist_buttons {
|
||||||
float: right;
|
float: right;
|
||||||
|
}
|
||||||
|
#pl_warning {
|
||||||
|
background-color: yellow;
|
||||||
|
padding: 1em;
|
||||||
|
border: 1px solid #8CACBB;
|
||||||
|
width: 40em;
|
||||||
}
|
}
|
@ -11,7 +11,9 @@
|
|||||||
@ispage config.html:<script type="text/javascript" src="lib-js/prototype.js"></script>:@
|
@ispage config.html:<script type="text/javascript" src="lib-js/prototype.js"></script>:@
|
||||||
@ispage config.html:<script type="text/javascript" src="lib-js/script.aculo.us/scriptaculous.js"></script>:@
|
@ispage config.html:<script type="text/javascript" src="lib-js/script.aculo.us/scriptaculous.js"></script>:@
|
||||||
@ispage config.html:<script type="text/javascript" src="util.js"></script>:@
|
@ispage config.html:<script type="text/javascript" src="util.js"></script>:@
|
||||||
@ispage config.html:<script type="text/javascript" src="config.js"></script>:@
|
@ispage config.html:<script type="text/javascript" src="config.js"></script>:@
|
||||||
|
@ispage smart.html:<script type="text/javascript" src="lib-js/prototype.js"></script>:@
|
||||||
|
@ispage smart.html:<script type="text/javascript" src="lib-js/script.aculo.us/effects.js"></script>:@
|
||||||
@ispage smart.html:<script type="text/javascript" src="smart.js"></script>:@
|
@ispage smart.html:<script type="text/javascript" src="smart.js"></script>:@
|
||||||
@ispage playlist.html:<script type="text/javascript" src="lib-js/prototype.js"></script>:@
|
@ispage playlist.html:<script type="text/javascript" src="lib-js/prototype.js"></script>:@
|
||||||
@ispage playlist.html:<script type="text/javascript" src="lib-js/script.aculo.us/builder.js"></script>:@
|
@ispage playlist.html:<script type="text/javascript" src="lib-js/script.aculo.us/builder.js"></script>:@
|
||||||
|
@ -4,25 +4,27 @@
|
|||||||
<table cellspacing="0" >
|
<table cellspacing="0" >
|
||||||
<thead><tr><th>ID</th><th>Playlist Name</th><th>Type</th><th>Action</th></tr></thead>
|
<thead><tr><th>ID</th><th>Playlist Name</th><th>Type</th><th>Action</th></tr></thead>
|
||||||
<tbody id="playlists">
|
<tbody id="playlists">
|
||||||
|
<tr><td></td></tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<a href="javascript:pl_new();">Add new playlist</a>
|
<a href="javascript:pl_new();">Add new playlist</a>
|
||||||
|
|
||||||
<div id="pl_data">
|
<div id="pl_data">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="pl_editor" style="display: none;">
|
<div id="pl_editor" style="display: none;">
|
||||||
<div class="naviheader">
|
<div class="naviheader">
|
||||||
New playlist
|
New playlist
|
||||||
</div>
|
</div>
|
||||||
<div class="navibox">
|
<div class="navibox">
|
||||||
<form name="pl_form" action="">
|
<form id="pl_form" action="">
|
||||||
<div>
|
<div>
|
||||||
<input type="hidden" name="playlist_id"/>
|
<input type="hidden" name="playlist_id" id="playlist_id" />
|
||||||
<label for="playlist_name">Name</label>
|
<label for="playlist_name">Name</label>
|
||||||
<input id="playlist_name" class="playlistfield" type="text" name="playlist_name" />
|
<input id="playlist_name" class="playlistfield" type="text" name="playlist_name" />
|
||||||
<br />
|
<br />
|
||||||
<label for="playlist_spec">Playlist criteria</label>
|
<label for="playlist_spec">Playlist criteria</label>
|
||||||
<textarea id="playlist_spec" class="playlistfield" rows="5" name="playlist_spec"></textarea>
|
<textarea id="playlist_spec" class="playlistfield" rows="5" cols="50" name="playlist_spec"></textarea>
|
||||||
<br />
|
<br />
|
||||||
<div id="playlist_buttons">
|
<div id="playlist_buttons">
|
||||||
<input type="button" onclick="javascript:pl_update();" name="submit_button" value="Submit"/>
|
<input type="button" onclick="javascript:pl_update();" name="submit_button" value="Submit"/>
|
||||||
@ -33,13 +35,10 @@ New playlist
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div id="pl_warning" class="message" style="display:none">
|
<br />
|
||||||
|
<div id="pl_warning" class="message" style="display:none;">
|
||||||
Error messages go here...
|
Error messages go here...
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@include ftr.html@
|
@include ftr.html@
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
var req;
|
var req;
|
||||||
var playlist_info={};
|
var playlist_info={};
|
||||||
|
var g_messageTimeout;
|
||||||
|
|
||||||
function pl_editor_state(state) {
|
function pl_editor_state(state) {
|
||||||
var pleditor = document.getElementById("pl_editor");
|
var pleditor = document.getElementById("pl_editor");
|
||||||
@ -17,6 +17,9 @@ function pl_editor_state(state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function pl_errormsg(msg) {
|
function pl_errormsg(msg) {
|
||||||
|
if (g_messageTimeout) {
|
||||||
|
window.clearTimeout(g_messageTimeout);
|
||||||
|
}
|
||||||
var msgdiv = document.getElementById("pl_warning");
|
var msgdiv = document.getElementById("pl_warning");
|
||||||
|
|
||||||
if(!msgdiv)
|
if(!msgdiv)
|
||||||
@ -27,7 +30,12 @@ function pl_errormsg(msg) {
|
|||||||
if(msg == "") {
|
if(msg == "") {
|
||||||
msgdiv.style.display="none";
|
msgdiv.style.display="none";
|
||||||
} else {
|
} else {
|
||||||
msgdiv.style.display="block";
|
Effect.Appear(msgdiv,{duration: 0.2});
|
||||||
|
if (('Success' == msg) || 'Cancelled' == msg) {
|
||||||
|
g_messageTimeout = window.setTimeout(function(){
|
||||||
|
Effect.Fade(msgdiv,{duration: 0.2});
|
||||||
|
},3000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,17 +71,19 @@ function pl_displayresults(xmldoc,query) {
|
|||||||
|
|
||||||
pl_errormsg(status_string);
|
pl_errormsg(status_string);
|
||||||
} else {
|
} else {
|
||||||
|
pl_editor_state(false);
|
||||||
pl_errormsg("Success");
|
pl_errormsg("Success");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function pl_update() {
|
function pl_update() {
|
||||||
/* this is either update or create, depending... */
|
/* this is either update or create, depending... */
|
||||||
|
pl_errormsg('');
|
||||||
var id, name, spec;
|
var id, name, spec;
|
||||||
|
|
||||||
id = document.forms['pl_form']['playlist_id'].value;
|
id = document.getElementById('playlist_id').value;
|
||||||
name = encodeURIComponent(document.forms['pl_form']['playlist_name'].value);
|
name = encodeURIComponent(document.getElementById('playlist_name').value);
|
||||||
spec = encodeURIComponent(document.forms['pl_form']['playlist_spec'].value);
|
spec = encodeURIComponent(document.getElementById('playlist_spec').value);
|
||||||
|
|
||||||
if(id == '0') {
|
if(id == '0') {
|
||||||
/* new playlist... post it! */
|
/* new playlist... post it! */
|
||||||
@ -87,7 +97,7 @@ function pl_update() {
|
|||||||
pl_displayresults(req.responseXML);
|
pl_displayresults(req.responseXML);
|
||||||
|
|
||||||
init();
|
init();
|
||||||
pl_editor_state(false);
|
// pl_editor_state(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function pl_cancel() {
|
function pl_cancel() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user