mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-03-20 04:20:00 +01:00
Hopefully fixed href bugs for all browsers now.
This commit is contained in:
parent
8fea7bfb74
commit
68497e749b
@ -2,7 +2,19 @@
|
||||
modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, types, ajax) {
|
||||
|
||||
var domain = document.domain,
|
||||
location = document.location.href.replace(/^.*:\/\/[^\/]*/, '').replace(/[^\/]*$/, ''),
|
||||
location = (function () {
|
||||
|
||||
var location = document.location.pathname.replace(/[^\/]*$/, ''),
|
||||
testpathname = '/a b',
|
||||
a = document.createElement('a');
|
||||
|
||||
a.href = testpathname;
|
||||
if (a.pathname === testpathname) {
|
||||
location = encodeURIComponent(location).replace(/%2F/ig, '/').replace(/'/g, '%27');
|
||||
}
|
||||
|
||||
return location;
|
||||
}()),
|
||||
|
||||
|
||||
// utils
|
||||
|
@ -9,7 +9,7 @@ modulejs.define('parser/apache-autoindex', ['_', '$', 'core/settings', 'core/for
|
||||
time = format.parseDate($tds.eq(2).text(), 'DD-MMM-YYYY HH:mm'),
|
||||
size = format.parseSize($tds.eq(3).text());
|
||||
|
||||
absHref = absHref + $a.attr('href');
|
||||
absHref = absHref + $a.attr('href').replace(/'/g, '%27').replace(/\+/g, '%2B').replace(/\=/g, '%3D');
|
||||
|
||||
return label === 'Parent Directory' ? null : Entry.get(absHref, time, size);
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user