wplayer

Check-in [d25d5e6c6b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Visual confirmation when you choose a file
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:d25d5e6c6baff75a072a307b89d6a63b76147778263a9f34beafb7bf096b3720
User & Date: ajv-899-334-8894@vsta.org 2018-03-13 02:11:48
Context
2018-04-27
03:50
Add back a style sheet. Add some actual handling for album art which shows up in the media directories. check-in: e09cccc9df user: vandyswa@gmail.com tags: master, trunk
2018-03-13
02:11
Visual confirmation when you choose a file check-in: d25d5e6c6b user: ajv-899-334-8894@vsta.org tags: master, trunk
01:50
Don't use global keystroke shortcuts when it's input. check-in: b93e987eac user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to js/player.js.

120
121
122
123
124
125
126

127
128
129
130
131
132
133
134
...
231
232
233
234
235
236
237






238
239
240
241
242
243
244

    // Files (if any)
    if (pcontents.files.length > 0) {
	res += '<b>Files</b>:<br>';
        var fidx;
	for (fidx = 0; fidx < pcontents.files.length; fidx++) {
	    f = pcontents.files[fidx];

	    res += '<button onclick="return go_file(' + fidx.toString() + ');">'
	    res += ' <img src="/imgs/player_play.png" alt="play" />\n'
	    res += '</button>' + unescape(f) + '<br>\n'
	}
    }

    // Replace the HTML
    browser.innerHTML = res;
................................................................................

// Add file to playlist (or play if playlist empty)
function go_file(fidx) {
    // Working on a previous click
    if (pcontents == null) {
	return false;
    }







    // Assemble full filename
    let fname = "/media" + path + "/" + pcontents.files[fidx]
    if (opts.noflac) {
        if (fname.endsWith(".flac")) {
            fname += "?asogg";
        }







>
|







 







>
>
>
>
>
>







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
...
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251

    // Files (if any)
    if (pcontents.files.length > 0) {
	res += '<b>Files</b>:<br>';
        var fidx;
	for (fidx = 0; fidx < pcontents.files.length; fidx++) {
	    f = pcontents.files[fidx];
	    res += '<button id="file' + fidx.toString() + '"';
	    res += ' onclick="return go_file(' + fidx.toString() + ');">'
	    res += ' <img src="/imgs/player_play.png" alt="play" />\n'
	    res += '</button>' + unescape(f) + '<br>\n'
	}
    }

    // Replace the HTML
    browser.innerHTML = res;
................................................................................

// Add file to playlist (or play if playlist empty)
function go_file(fidx) {
    // Working on a previous click
    if (pcontents == null) {
	return false;
    }

    // Light up button to confirm
    let fbtn = document.getElementById("file" + fidx.toString());
    if (fbtn) {
	fbtn.style.background = "PaleGreen";
    }

    // Assemble full filename
    let fname = "/media" + path + "/" + pcontents.files[fidx]
    if (opts.noflac) {
        if (fname.endsWith(".flac")) {
            fname += "?asogg";
        }