Fixes char # in filenames links

vnext
Paul Schneider 4 years ago
parent ad84b875e5
commit c5de5a83bb
1 changed files with 6 additions and 6 deletions

@ -50,8 +50,8 @@ if (typeof XMLHttpRequest === 'undefined') {
var dnames = _this.root.split('/');
$.each(dnames, function () {
var part = this;
if (npath == null) npath = part;
else npath = npath + '/' + part;
if (npath == null) npath = encodeURIComponent(part);
else npath = npath + '/' + encodeURIComponent(part);
$('<button/>')
.append(part)
.click(function () {
@ -90,7 +90,7 @@ if (typeof XMLHttpRequest === 'undefined') {
{
$.each(data.SubDirectories, function () {
var item = this;
var spath = _this.root ? _this.root + '/' + item.Name : item.Name;
var spath = _this.root ? _this.root + '/' + encodeURIComponent(item.Name) : encodeURIComponent(item.Name);
$('<button/>')
.append(item.Name)
.click(function () {
@ -110,8 +110,8 @@ if (typeof XMLHttpRequest === 'undefined') {
_this.SetItemSelected(item.Name, this.checked);
})
.appendTo($td);
var furl = (_this.root) ? '/files/' + owner + '/' + _this.root + '/' + item.Name
: '/files/' + owner + '/' + item.Name;
var furl = (_this.root) ? '/files/' + owner + '/' + _this.root + '/' + encodeURIComponent(item.Name)
: '/files/' + owner + '/' + encodeURIComponent(item.Name);
$('<td class="filename"></td>')
.append($('<a></a>').attr('href',furl)
.append(item.Name)).appendTo($tr);
@ -294,4 +294,4 @@ if (typeof XMLHttpRequest === 'undefined') {
this.openDir($view.data('path'));
}
});
})(window.jQuery);
})(window.jQuery);

Loading…