mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-03-22 13:30:05 +01:00
Updates location checking.
This commit is contained in:
parent
f65f5021ae
commit
30d48fb1ef
@ -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;
|
||||
}()),
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user