mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-06 13:26:38 +02:00
Updates location checking.
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
|
||||
modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, types, ajax) {
|
||||
|
||||
var domain = document.domain,
|
||||
var doc = document,
|
||||
domain = doc.domain,
|
||||
location = (function () {
|
||||
|
||||
var testpathname = '/a b',
|
||||
a = document.createElement('a'),
|
||||
a = doc.createElement('a'),
|
||||
isDecoded, location;
|
||||
|
||||
a.href = testpathname;
|
||||
@@ -18,6 +19,10 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, ty
|
||||
location = encodeURIComponent(location).replace(/%2F/ig, '/').replace(/'/g, '%27');
|
||||
}
|
||||
|
||||
if (!location) {
|
||||
location = doc.location.href.replace(/.*:\/\/[^\/]*/, '').replace(/[^\/]*$/, '');
|
||||
}
|
||||
|
||||
return location;
|
||||
}()),
|
||||
|
||||
|
Reference in New Issue
Block a user