mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 20:44:53 -04:00
Hopefully fixed href bugs for all browsers now.
This commit is contained in:
parent
8fea7bfb74
commit
68497e749b
2 changed files with 14 additions and 2 deletions
|
@ -2,7 +2,19 @@
|
||||||
modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, types, ajax) {
|
modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, types, ajax) {
|
||||||
|
|
||||||
var domain = document.domain,
|
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
|
// 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'),
|
time = format.parseDate($tds.eq(2).text(), 'DD-MMM-YYYY HH:mm'),
|
||||||
size = format.parseSize($tds.eq(3).text());
|
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);
|
return label === 'Parent Directory' ? null : Entry.get(absHref, time, size);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue