wplayer

Check-in [175042e320]
Login

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

Overview
Comment:Escape things before they go back out (they were already un-escaped on the way int). Fix some resulting display treatment.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:175042e320b09d449e86166e22d751f31131187b80a92e4f029e7cd3b3f40909
User & Date: ajv-899-334-8894@vsta.org 2016-01-31 03:16:44
Context
2016-02-01
04:12
Make printable version for "now playing" text pane. check-in: eefabcc658 user: ajv-899-334-8894@vsta.org tags: master, trunk
2016-01-31
03:16
Escape things before they go back out (they were already un-escaped on the way int). Fix some resulting display treatment. check-in: 175042e320 user: ajv-899-334-8894@vsta.org tags: master, trunk
01:08
Move some stuff to static HTML out of JS check-in: e0f7a0e0cf user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to get.py.

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
	for path,dirs,files in os.walk(path):
	    break
	else:
	    # If the walk got nothing, provide empty lists
	    files = dirs = ()

	# Normalize to UTF-8
	files = [f.decode('utf-8', 'replace') for f in files]
	dirs = [d.decode('utf-8', 'replace') for d in dirs]

	# In order
	files.sort()
	dirs.sort()

	# Put into place
	res["files"] = files







|
|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
	for path,dirs,files in os.walk(path):
	    break
	else:
	    # If the walk got nothing, provide empty lists
	    files = dirs = ()

	# Normalize to UTF-8
	files = [urllib.quote(f.decode('utf-8', 'replace')) for f in files]
	dirs = [urllib.quote(d.decode('utf-8', 'replace')) for d in dirs]

	# In order
	files.sort()
	dirs.sort()

	# Put into place
	res["files"] = files

Changes to js/player.js.

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
    // Directories (if any)
    if (pcontents.dirs.length > 0) {
	res += '<b>Directories</b>:<br>';
	for (var didx = 0; didx < pcontents.dirs.length; didx++) {
	    d = pcontents.dirs[didx];
	    res += '<button onclick="return go_dir(' + didx.toString() + ');">'
	    res += ' <img src="/imgs/player_play.png" alt="enter" />\n'
	    res += '</button>' + d + '<br>\n'
	}
    }

    // Files (if any)
    if (pcontents.files.length > 0) {
	res += '<b>Files</b>:<br>';
	for (var 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>' + f + '<br>\n'
	}
    }

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

// Update playlist queue pane
function paintQueue() {
    var res = '';
    for (var fidx = 0; fidx < playlist.length; fidx++) {
	res += playlist[fidx] + '\n';
    }
    pqueue.textContent = res;
}

// For current path, get contents from web server
function curdir() {
    // Flag this op is pending







|










|











|







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
    // Directories (if any)
    if (pcontents.dirs.length > 0) {
	res += '<b>Directories</b>:<br>';
	for (var didx = 0; didx < pcontents.dirs.length; didx++) {
	    d = pcontents.dirs[didx];
	    res += '<button onclick="return go_dir(' + didx.toString() + ');">'
	    res += ' <img src="/imgs/player_play.png" alt="enter" />\n'
	    res += '</button>' + unescape(d) + '<br>\n'
	}
    }

    // Files (if any)
    if (pcontents.files.length > 0) {
	res += '<b>Files</b>:<br>';
	for (var 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;
}

// Update playlist queue pane
function paintQueue() {
    var res = '';
    for (var fidx = 0; fidx < playlist.length; fidx++) {
	res += unescape(playlist[fidx]) + '\n';
    }
    pqueue.textContent = res;
}

// For current path, get contents from web server
function curdir() {
    // Flag this op is pending