Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
a9a87c60
Commit
a9a87c60
authored
5 years ago
by
Guilherme Gazzo
Committed by
Diego Sampaio
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] IE11 baseURI (#15319)
parent
6ea44a36
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/ui/client/components/icon.js
+3
-1
3 additions, 1 deletion
app/ui/client/components/icon.js
app/utils/client/lib/RestApiClient.js
+4
-2
4 additions, 2 deletions
app/utils/client/lib/RestApiClient.js
app/utils/client/lib/baseuri.js
+14
-0
14 additions, 0 deletions
app/utils/client/lib/baseuri.js
with
21 additions
and
3 deletions
app/ui/client/components/icon.js
+
3
−
1
View file @
a9a87c60
import
{
FlowRouter
}
from
'
meteor/kadira:flow-router
'
;
import
{
Template
}
from
'
meteor/templating
'
;
import
{
baseURI
}
from
'
../../../utils/client/lib/baseuri
'
;
import
'
./icon.html
'
;
const
baseUrlFix
=
()
=>
`
${
document
.
baseURI
}${
FlowRouter
.
current
().
path
.
substring
(
1
)
}
`
;
const
baseUrlFix
=
()
=>
`
${
baseURI
}${
FlowRouter
.
current
().
path
.
substring
(
1
)
}
`
;
const
isMozillaFirefoxBelowVersion
=
(
upperVersion
)
=>
{
const
[,
version
]
=
navigator
.
userAgent
.
match
(
/Firefox
\/(\d
+
)\.\d
/
)
||
[];
...
...
This diff is collapsed.
Click to expand it.
app/utils/client/lib/RestApiClient.js
+
4
−
2
View file @
a9a87c60
import
{
Meteor
}
from
'
meteor/meteor
'
;
import
{
Accounts
}
from
'
meteor/accounts-base
'
;
import
{
baseURI
}
from
'
./baseuri
'
;
export
const
APIClient
=
{
delete
(
endpoint
,
params
)
{
return
APIClient
.
_jqueryCall
(
'
DELETE
'
,
endpoint
,
params
);
...
...
@@ -47,7 +49,7 @@ export const APIClient = {
return
new
Promise
(
function
_rlRestApiGet
(
resolve
,
reject
)
{
jQuery
.
ajax
({
method
,
url
:
`
${
document
.
baseURI
}
api/
${
endpoint
}${
query
}
`
,
url
:
`
${
baseURI
}
api/
${
endpoint
}${
query
}
`
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
,
'
X-User-Id
'
:
Meteor
.
_localStorage
.
getItem
(
Accounts
.
USER_ID_KEY
),
...
...
@@ -75,7 +77,7 @@ export const APIClient = {
return
new
Promise
(
function
_jqueryFormDataPromise
(
resolve
,
reject
)
{
jQuery
.
ajax
({
url
:
`
${
document
.
baseURI
}
api/
${
endpoint
}${
query
}
`
,
url
:
`
${
baseURI
}
api/
${
endpoint
}${
query
}
`
,
headers
:
{
'
X-User-Id
'
:
Meteor
.
_localStorage
.
getItem
(
Accounts
.
USER_ID_KEY
),
'
X-Auth-Token
'
:
Meteor
.
_localStorage
.
getItem
(
Accounts
.
LOGIN_TOKEN_KEY
),
...
...
This diff is collapsed.
Click to expand it.
app/utils/client/lib/baseuri.js
0 → 100644
+
14
−
0
View file @
a9a87c60
export
const
baseURI
=
(()
=>
{
if
(
document
.
baseURI
)
{
return
document
.
baseURI
;
}
// Should be exactly one tag:
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
const
base
=
document
.
getElementsByTagName
(
'
base
'
);
// Return location from BASE tag.
if
(
base
.
length
>
0
)
{
return
base
[
0
].
href
;
}
// Else use implementation of documentURI:
// http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-baseURI
return
document
.
URL
;
})();
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment