Hopefully fixed href bugs for all browsers now.

This commit is contained in:
Lars Jung 2012-07-16 17:23:01 +02:00
parent 8fea7bfb74
commit 68497e749b
2 changed files with 14 additions and 2 deletions

View File

@ -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

View File

@ -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);
},