Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bce89082
Commit
bce89082
authored
Jun 15, 2018
by
gfyoung
Committed by
Phil Hughes
Jun 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable no-restricted-globals in JS files
parent
72770e60
Changes
42
Show whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
55 additions
and
53 deletions
+55
-53
.eslintrc.yml
.eslintrc.yml
+0
-2
app/assets/javascripts/blob/viewer/index.js
app/assets/javascripts/blob/viewer/index.js
+1
-1
app/assets/javascripts/boards/components/board_delete.js
app/assets/javascripts/boards/components/board_delete.js
+1
-1
app/assets/javascripts/boards/stores/boards_store.js
app/assets/javascripts/boards/stores/boards_store.js
+1
-1
app/assets/javascripts/commits.js
app/assets/javascripts/commits.js
+1
-1
app/assets/javascripts/deploy_keys/components/app.vue
app/assets/javascripts/deploy_keys/components/app.vue
+1
-1
app/assets/javascripts/environments/components/environment_stop.vue
.../javascripts/environments/components/environment_stop.vue
+1
-1
app/assets/javascripts/ide/lib/diff/diff_worker.js
app/assets/javascripts/ide/lib/diff/diff_worker.js
+2
-0
app/assets/javascripts/ide/stores/workers/files_decorator_worker.js
.../javascripts/ide/stores/workers/files_decorator_worker.js
+2
-0
app/assets/javascripts/issue_show/components/app.vue
app/assets/javascripts/issue_show/components/app.vue
+1
-1
app/assets/javascripts/issue_show/components/edit_actions.vue
...assets/javascripts/issue_show/components/edit_actions.vue
+1
-1
app/assets/javascripts/issue_show/components/locked_warning.vue
...sets/javascripts/issue_show/components/locked_warning.vue
+1
-1
app/assets/javascripts/lazy_loader.js
app/assets/javascripts/lazy_loader.js
+2
-2
app/assets/javascripts/lib/utils/bootstrap_linked_tabs.js
app/assets/javascripts/lib/utils/bootstrap_linked_tabs.js
+1
-1
app/assets/javascripts/lib/utils/number_utils.js
app/assets/javascripts/lib/utils/number_utils.js
+1
-1
app/assets/javascripts/line_highlighter.js
app/assets/javascripts/line_highlighter.js
+2
-2
app/assets/javascripts/milestone.js
app/assets/javascripts/milestone.js
+2
-2
app/assets/javascripts/monitoring/components/graph/flag.vue
app/assets/javascripts/monitoring/components/graph/flag.vue
+1
-1
app/assets/javascripts/monitoring/utils/multiple_time_series.js
...sets/javascripts/monitoring/utils/multiple_time_series.js
+1
-1
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+2
-2
app/assets/javascripts/notes/components/noteable_discussion.vue
...sets/javascripts/notes/components/noteable_discussion.vue
+1
-1
app/assets/javascripts/notes/components/noteable_note.vue
app/assets/javascripts/notes/components/noteable_note.vue
+2
-2
app/assets/javascripts/pages/users/user_tabs.js
app/assets/javascripts/pages/users/user_tabs.js
+1
-1
app/assets/javascripts/project_find_file.js
app/assets/javascripts/project_find_file.js
+1
-1
app/assets/javascripts/project_import.js
app/assets/javascripts/project_import.js
+1
-1
app/assets/javascripts/search_autocomplete.js
app/assets/javascripts/search_autocomplete.js
+1
-1
app/assets/javascripts/settings_panels.js
app/assets/javascripts/settings_panels.js
+2
-2
app/assets/javascripts/shortcuts_find_file.js
app/assets/javascripts/shortcuts_find_file.js
+2
-2
app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue
...ar/components/confidential/confidential_issue_sidebar.vue
+1
-1
app/assets/javascripts/sidebar/components/lock/lock_issue_sidebar.vue
...avascripts/sidebar/components/lock/lock_issue_sidebar.vue
+1
-1
app/assets/javascripts/sidebar/sidebar_mediator.js
app/assets/javascripts/sidebar/sidebar_mediator.js
+1
-1
app/assets/javascripts/snippet/snippet_embed.js
app/assets/javascripts/snippet/snippet_embed.js
+1
-1
spec/javascripts/blob/viewer/index_spec.js
spec/javascripts/blob/viewer/index_spec.js
+2
-2
spec/javascripts/bootstrap_linked_tabs_spec.js
spec/javascripts/bootstrap_linked_tabs_spec.js
+1
-1
spec/javascripts/commits_spec.js
spec/javascripts/commits_spec.js
+1
-1
spec/javascripts/environments/environments_app_spec.js
spec/javascripts/environments/environments_app_spec.js
+1
-1
spec/javascripts/environments/folder/environments_folder_view_spec.js
...ipts/environments/folder/environments_folder_view_spec.js
+1
-1
spec/javascripts/ide/stores/actions/file_spec.js
spec/javascripts/ide/stores/actions/file_spec.js
+2
-2
spec/javascripts/issue_show/components/app_spec.js
spec/javascripts/issue_show/components/app_spec.js
+2
-2
spec/javascripts/lib/utils/common_utils_spec.js
spec/javascripts/lib/utils/common_utils_spec.js
+2
-2
spec/javascripts/pipelines/pipelines_spec.js
spec/javascripts/pipelines/pipelines_spec.js
+1
-1
spec/javascripts/settings_panels_spec.js
spec/javascripts/settings_panels_spec.js
+2
-2
No files found.
.eslintrc.yml
View file @
bce89082
...
@@ -71,7 +71,5 @@ rules:
...
@@ -71,7 +71,5 @@ rules:
body
:
1
body
:
1
## Destructuring: https://eslint.org/docs/rules/prefer-destructuring
## Destructuring: https://eslint.org/docs/rules/prefer-destructuring
prefer-destructuring
:
off
prefer-destructuring
:
off
## no-restricted-globals: https://eslint.org/docs/rules/no-restricted-globals
no-restricted-globals
:
off
## no-multi-assign: https://eslint.org/docs/rules/no-multi-assign
## no-multi-assign: https://eslint.org/docs/rules/no-multi-assign
no-multi-assign
:
off
no-multi-assign
:
off
app/assets/javascripts/blob/viewer/index.js
View file @
bce89082
...
@@ -70,7 +70,7 @@ export default class BlobViewer {
...
@@ -70,7 +70,7 @@ export default class BlobViewer {
const
initialViewer
=
this
.
$fileHolder
[
0
].
querySelector
(
'
.blob-viewer:not(.hidden)
'
);
const
initialViewer
=
this
.
$fileHolder
[
0
].
querySelector
(
'
.blob-viewer:not(.hidden)
'
);
let
initialViewerName
=
initialViewer
.
getAttribute
(
'
data-type
'
);
let
initialViewerName
=
initialViewer
.
getAttribute
(
'
data-type
'
);
if
(
this
.
switcher
&&
location
.
hash
.
indexOf
(
'
#L
'
)
===
0
)
{
if
(
this
.
switcher
&&
window
.
location
.
hash
.
indexOf
(
'
#L
'
)
===
0
)
{
initialViewerName
=
'
simple
'
;
initialViewerName
=
'
simple
'
;
}
}
...
...
app/assets/javascripts/boards/components/board_delete.js
View file @
bce89082
...
@@ -17,7 +17,7 @@ gl.issueBoards.BoardDelete = Vue.extend({
...
@@ -17,7 +17,7 @@ gl.issueBoards.BoardDelete = Vue.extend({
deleteBoard
()
{
deleteBoard
()
{
$
(
this
.
$el
).
tooltip
(
'
hide
'
);
$
(
this
.
$el
).
tooltip
(
'
hide
'
);
if
(
confirm
(
'
Are you sure you want to delete this list?
'
))
{
if
(
window
.
confirm
(
'
Are you sure you want to delete this list?
'
))
{
this
.
list
.
destroy
();
this
.
list
.
destroy
();
}
}
}
}
...
...
app/assets/javascripts/boards/stores/boards_store.js
View file @
bce89082
...
@@ -145,6 +145,6 @@ gl.issueBoards.BoardsStore = {
...
@@ -145,6 +145,6 @@ gl.issueBoards.BoardsStore = {
return
filteredList
[
0
];
return
filteredList
[
0
];
},
},
updateFiltersUrl
()
{
updateFiltersUrl
()
{
history
.
pushState
(
null
,
null
,
`?
${
this
.
filter
.
path
}
`
);
window
.
history
.
pushState
(
null
,
null
,
`?
${
this
.
filter
.
path
}
`
);
}
}
};
};
app/assets/javascripts/commits.js
View file @
bce89082
...
@@ -45,7 +45,7 @@ export default class CommitsList {
...
@@ -45,7 +45,7 @@ export default class CommitsList {
this
.
content
.
fadeTo
(
'
fast
'
,
1.0
);
this
.
content
.
fadeTo
(
'
fast
'
,
1.0
);
// Change url so if user reload a page - search results are saved
// Change url so if user reload a page - search results are saved
history
.
replaceState
({
window
.
history
.
replaceState
({
page
:
commitsUrl
,
page
:
commitsUrl
,
},
document
.
title
,
commitsUrl
);
},
document
.
title
,
commitsUrl
);
})
})
...
...
app/assets/javascripts/deploy_keys/components/app.vue
View file @
bce89082
...
@@ -98,7 +98,7 @@ export default {
...
@@ -98,7 +98,7 @@ export default {
},
},
disableKey
(
deployKey
,
callback
)
{
disableKey
(
deployKey
,
callback
)
{
// eslint-disable-next-line no-alert
// eslint-disable-next-line no-alert
if
(
confirm
(
s__
(
'
DeployKeys|You are going to remove this deploy key. Are you sure?
'
)))
{
if
(
window
.
confirm
(
s__
(
'
DeployKeys|You are going to remove this deploy key. Are you sure?
'
)))
{
this
.
service
this
.
service
.
disableKey
(
deployKey
.
id
)
.
disableKey
(
deployKey
.
id
)
.
then
(
this
.
fetchKeys
)
.
then
(
this
.
fetchKeys
)
...
...
app/assets/javascripts/environments/components/environment_stop.vue
View file @
bce89082
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
methods
:
{
methods
:
{
onClick
()
{
onClick
()
{
// eslint-disable-next-line no-alert
// eslint-disable-next-line no-alert
if
(
confirm
(
'
Are you sure you want to stop this environment?
'
))
{
if
(
window
.
confirm
(
'
Are you sure you want to stop this environment?
'
))
{
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
$
(
this
.
$el
).
tooltip
(
'
dispose
'
);
$
(
this
.
$el
).
tooltip
(
'
dispose
'
);
...
...
app/assets/javascripts/ide/lib/diff/diff_worker.js
View file @
bce89082
import
{
computeDiff
}
from
'
./diff
'
;
import
{
computeDiff
}
from
'
./diff
'
;
// eslint-disable-next-line no-restricted-globals
self
.
addEventListener
(
'
message
'
,
(
e
)
=>
{
self
.
addEventListener
(
'
message
'
,
(
e
)
=>
{
const
data
=
e
.
data
;
const
data
=
e
.
data
;
// eslint-disable-next-line no-restricted-globals
self
.
postMessage
({
self
.
postMessage
({
path
:
data
.
path
,
path
:
data
.
path
,
changes
:
computeDiff
(
data
.
originalContent
,
data
.
newContent
),
changes
:
computeDiff
(
data
.
originalContent
,
data
.
newContent
),
...
...
app/assets/javascripts/ide/stores/workers/files_decorator_worker.js
View file @
bce89082
import
{
viewerInformationForPath
}
from
'
~/vue_shared/components/content_viewer/lib/viewer_utils
'
;
import
{
viewerInformationForPath
}
from
'
~/vue_shared/components/content_viewer/lib/viewer_utils
'
;
import
{
decorateData
,
sortTree
}
from
'
../utils
'
;
import
{
decorateData
,
sortTree
}
from
'
../utils
'
;
// eslint-disable-next-line no-restricted-globals
self
.
addEventListener
(
'
message
'
,
e
=>
{
self
.
addEventListener
(
'
message
'
,
e
=>
{
const
{
data
,
projectId
,
branchId
,
tempFile
=
false
,
content
=
''
,
base64
=
false
}
=
e
.
data
;
const
{
data
,
projectId
,
branchId
,
tempFile
=
false
,
content
=
''
,
base64
=
false
}
=
e
.
data
;
...
@@ -89,6 +90,7 @@ self.addEventListener('message', e => {
...
@@ -89,6 +90,7 @@ self.addEventListener('message', e => {
return
acc
;
return
acc
;
},
{});
},
{});
// eslint-disable-next-line no-restricted-globals
self
.
postMessage
({
self
.
postMessage
({
entries
,
entries
,
treeList
:
sortTree
(
treeList
),
treeList
:
sortTree
(
treeList
),
...
...
app/assets/javascripts/issue_show/components/app.vue
View file @
bce89082
...
@@ -226,7 +226,7 @@
...
@@ -226,7 +226,7 @@
.
then
(
res
=>
res
.
data
)
.
then
(
res
=>
res
.
data
)
.
then
(
data
=>
this
.
checkForSpam
(
data
))
.
then
(
data
=>
this
.
checkForSpam
(
data
))
.
then
((
data
)
=>
{
.
then
((
data
)
=>
{
if
(
location
.
pathname
!==
data
.
web_url
)
{
if
(
window
.
location
.
pathname
!==
data
.
web_url
)
{
visitUrl
(
data
.
web_url
);
visitUrl
(
data
.
web_url
);
}
}
...
...
app/assets/javascripts/issue_show/components/edit_actions.vue
View file @
bce89082
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
},
},
deleteIssuable
()
{
deleteIssuable
()
{
// eslint-disable-next-line no-alert
// eslint-disable-next-line no-alert
if
(
confirm
(
'
Issue will be removed! Are you sure?
'
))
{
if
(
window
.
confirm
(
'
Issue will be removed! Are you sure?
'
))
{
this
.
deleteLoading
=
true
;
this
.
deleteLoading
=
true
;
eventHub
.
$emit
(
'
delete.issuable
'
);
eventHub
.
$emit
(
'
delete.issuable
'
);
...
...
app/assets/javascripts/issue_show/components/locked_warning.vue
View file @
bce89082
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
export
default
{
export
default
{
computed
:
{
computed
:
{
currentPath
()
{
currentPath
()
{
return
location
.
pathname
;
return
window
.
location
.
pathname
;
},
},
},
},
};
};
...
...
app/assets/javascripts/lazy_loader.js
View file @
bce89082
...
@@ -44,8 +44,8 @@ export default class LazyLoader {
...
@@ -44,8 +44,8 @@ export default class LazyLoader {
requestAnimationFrame
(()
=>
this
.
checkElementsInView
());
requestAnimationFrame
(()
=>
this
.
checkElementsInView
());
}
}
checkElementsInView
()
{
checkElementsInView
()
{
const
scrollTop
=
pageYOffset
;
const
scrollTop
=
window
.
pageYOffset
;
const
visHeight
=
scrollTop
+
innerHeight
+
SCROLL_THRESHOLD
;
const
visHeight
=
scrollTop
+
window
.
innerHeight
+
SCROLL_THRESHOLD
;
// Loading Images which are in the current viewport or close to them
// Loading Images which are in the current viewport or close to them
this
.
lazyImages
=
this
.
lazyImages
.
filter
((
selectedImage
)
=>
{
this
.
lazyImages
=
this
.
lazyImages
.
filter
((
selectedImage
)
=>
{
...
...
app/assets/javascripts/lib/utils/bootstrap_linked_tabs.js
View file @
bce89082
...
@@ -93,7 +93,7 @@ export default class LinkedTabs {
...
@@ -93,7 +93,7 @@ export default class LinkedTabs {
const
newState
=
`
${
copySource
}${
this
.
currentLocation
.
search
}${
this
.
currentLocation
.
hash
}
`
;
const
newState
=
`
${
copySource
}${
this
.
currentLocation
.
search
}${
this
.
currentLocation
.
hash
}
`
;
history
.
replaceState
({
window
.
history
.
replaceState
({
url
:
newState
,
url
:
newState
,
},
document
.
title
,
newState
);
},
document
.
title
,
newState
);
return
newState
;
return
newState
;
...
...
app/assets/javascripts/lib/utils/number_utils.js
View file @
bce89082
...
@@ -12,7 +12,7 @@ export function formatRelevantDigits(number) {
...
@@ -12,7 +12,7 @@ export function formatRelevantDigits(number) {
let
digitsLeft
=
''
;
let
digitsLeft
=
''
;
let
relevantDigits
=
0
;
let
relevantDigits
=
0
;
let
formattedNumber
=
''
;
let
formattedNumber
=
''
;
if
(
!
isNaN
(
Number
(
number
)))
{
if
(
!
Number
.
isNaN
(
Number
(
number
)))
{
digitsLeft
=
number
.
toString
().
split
(
'
.
'
)[
0
];
digitsLeft
=
number
.
toString
().
split
(
'
.
'
)[
0
];
switch
(
digitsLeft
.
length
)
{
switch
(
digitsLeft
.
length
)
{
case
1
:
case
1
:
...
...
app/assets/javascripts/line_highlighter.js
View file @
bce89082
...
@@ -35,7 +35,7 @@ const LineHighlighter = function(options = {}) {
...
@@ -35,7 +35,7 @@ const LineHighlighter = function(options = {}) {
options
.
highlightLineClass
=
options
.
highlightLineClass
||
'
hll
'
;
options
.
highlightLineClass
=
options
.
highlightLineClass
||
'
hll
'
;
options
.
fileHolderSelector
=
options
.
fileHolderSelector
||
'
.file-holder
'
;
options
.
fileHolderSelector
=
options
.
fileHolderSelector
||
'
.file-holder
'
;
options
.
scrollFileHolder
=
options
.
scrollFileHolder
||
false
;
options
.
scrollFileHolder
=
options
.
scrollFileHolder
||
false
;
options
.
hash
=
options
.
hash
||
location
.
hash
;
options
.
hash
=
options
.
hash
||
window
.
location
.
hash
;
this
.
options
=
options
;
this
.
options
=
options
;
this
.
_hash
=
options
.
hash
;
this
.
_hash
=
options
.
hash
;
...
@@ -170,7 +170,7 @@ LineHighlighter.prototype.setHash = function(firstLineNumber, lastLineNumber) {
...
@@ -170,7 +170,7 @@ LineHighlighter.prototype.setHash = function(firstLineNumber, lastLineNumber) {
//
//
// This method is stubbed in tests.
// This method is stubbed in tests.
LineHighlighter
.
prototype
.
__setLocationHash__
=
function
(
value
)
{
LineHighlighter
.
prototype
.
__setLocationHash__
=
function
(
value
)
{
return
history
.
pushState
({
return
window
.
history
.
pushState
({
url
:
value
url
:
value
// We're using pushState instead of assigning location.hash directly to
// We're using pushState instead of assigning location.hash directly to
// prevent the page from scrolling on the hashchange event
// prevent the page from scrolling on the hashchange event
...
...
app/assets/javascripts/milestone.js
View file @
bce89082
...
@@ -18,13 +18,13 @@ export default class Milestone {
...
@@ -18,13 +18,13 @@ export default class Milestone {
return
$
(
'
a[data-toggle="tab"]
'
).
on
(
'
show.bs.tab
'
,
(
e
)
=>
{
return
$
(
'
a[data-toggle="tab"]
'
).
on
(
'
show.bs.tab
'
,
(
e
)
=>
{
const
$target
=
$
(
e
.
target
);
const
$target
=
$
(
e
.
target
);
location
.
hash
=
$target
.
attr
(
'
href
'
);
window
.
location
.
hash
=
$target
.
attr
(
'
href
'
);
this
.
loadTab
(
$target
);
this
.
loadTab
(
$target
);
});
});
}
}
// eslint-disable-next-line class-methods-use-this
// eslint-disable-next-line class-methods-use-this
loadInitialTab
()
{
loadInitialTab
()
{
const
$target
=
$
(
`.js-milestone-tabs a[href="
${
location
.
hash
}
"]`
);
const
$target
=
$
(
`.js-milestone-tabs a[href="
${
window
.
location
.
hash
}
"]`
);
if
(
$target
.
length
)
{
if
(
$target
.
length
)
{
$target
.
tab
(
'
show
'
);
$target
.
tab
(
'
show
'
);
...
...
app/assets/javascripts/monitoring/components/graph/flag.vue
View file @
bce89082
...
@@ -97,7 +97,7 @@ export default {
...
@@ -97,7 +97,7 @@ export default {
?
this
.
deploymentFlagData
.
seriesIndex
?
this
.
deploymentFlagData
.
seriesIndex
:
indexFromCoordinates
;
:
indexFromCoordinates
;
const
value
=
series
.
values
[
index
]
&&
series
.
values
[
index
].
value
;
const
value
=
series
.
values
[
index
]
&&
series
.
values
[
index
].
value
;
if
(
isNaN
(
value
))
{
if
(
Number
.
isNaN
(
value
))
{
return
'
-
'
;
return
'
-
'
;
}
}
return
`
${
formatRelevantDigits
(
value
)}${
this
.
unitOfDisplay
}
`
;
return
`
${
formatRelevantDigits
(
value
)}${
this
.
unitOfDisplay
}
`
;
...
...
app/assets/javascripts/monitoring/utils/multiple_time_series.js
View file @
bce89082
...
@@ -73,7 +73,7 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, xDom
...
@@ -73,7 +73,7 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, xDom
timeSeriesScaleX
.
ticks
(
d3
.
timeMinute
,
60
);
timeSeriesScaleX
.
ticks
(
d3
.
timeMinute
,
60
);
timeSeriesScaleY
.
domain
(
yDom
);
timeSeriesScaleY
.
domain
(
yDom
);
const
defined
=
d
=>
!
isNaN
(
d
.
value
)
&&
d
.
value
!=
null
;
const
defined
=
d
=>
!
Number
.
isNaN
(
d
.
value
)
&&
d
.
value
!=
null
;
const
lineFunction
=
d3
const
lineFunction
=
d3
.
line
()
.
line
()
...
...
app/assets/javascripts/notes.js
View file @
bce89082
...
@@ -315,7 +315,7 @@ export default class Notes {
...
@@ -315,7 +315,7 @@ export default class Notes {
if
(
discussionNoteForm
.
length
)
{
if
(
discussionNoteForm
.
length
)
{
if
(
$textarea
.
val
()
!==
''
)
{
if
(
$textarea
.
val
()
!==
''
)
{
if
(
if
(
!
confirm
(
'
Are you sure you want to cancel creating this comment?
'
)
!
window
.
confirm
(
'
Are you sure you want to cancel creating this comment?
'
)
)
{
)
{
return
;
return
;
}
}
...
@@ -329,7 +329,7 @@ export default class Notes {
...
@@ -329,7 +329,7 @@ export default class Notes {
newText
=
$textarea
.
val
();
newText
=
$textarea
.
val
();
if
(
originalText
!==
newText
)
{
if
(
originalText
!==
newText
)
{
if
(
if
(
!
confirm
(
'
Are you sure you want to cancel editing this comment?
'
)
!
window
.
confirm
(
'
Are you sure you want to cancel editing this comment?
'
)
)
{
)
{
return
;
return
;
}
}
...
...
app/assets/javascripts/notes/components/noteable_discussion.vue
View file @
bce89082
...
@@ -152,7 +152,7 @@ export default {
...
@@ -152,7 +152,7 @@ export default {
const
msg
=
'
Are you sure you want to cancel creating this comment?
'
;
const
msg
=
'
Are you sure you want to cancel creating this comment?
'
;
// eslint-disable-next-line no-alert
// eslint-disable-next-line no-alert
if
(
!
confirm
(
msg
))
{
if
(
!
window
.
confirm
(
msg
))
{
return
;
return
;
}
}
}
}
...
...
app/assets/javascripts/notes/components/noteable_note.vue
View file @
bce89082
...
@@ -77,7 +77,7 @@ export default {
...
@@ -77,7 +77,7 @@ export default {
},
},
deleteHandler
()
{
deleteHandler
()
{
// eslint-disable-next-line no-alert
// eslint-disable-next-line no-alert
if
(
confirm
(
'
Are you sure you want to delete this comment?
'
))
{
if
(
window
.
confirm
(
'
Are you sure you want to delete this comment?
'
))
{
this
.
isDeleting
=
true
;
this
.
isDeleting
=
true
;
this
.
deleteNote
(
this
.
note
)
this
.
deleteNote
(
this
.
note
)
...
@@ -129,7 +129,7 @@ export default {
...
@@ -129,7 +129,7 @@ export default {
formCancelHandler
(
shouldConfirm
,
isDirty
)
{
formCancelHandler
(
shouldConfirm
,
isDirty
)
{
if
(
shouldConfirm
&&
isDirty
)
{
if
(
shouldConfirm
&&
isDirty
)
{
// eslint-disable-next-line no-alert
// eslint-disable-next-line no-alert
if
(
!
confirm
(
'
Are you sure you want to cancel editing this comment?
'
))
if
(
!
window
.
confirm
(
'
Are you sure you want to cancel editing this comment?
'
))
return
;
return
;
}
}
this
.
$refs
.
noteBody
.
resetAutoSave
();
this
.
$refs
.
noteBody
.
resetAutoSave
();
...
...
app/assets/javascripts/pages/users/user_tabs.js
View file @
bce89082
...
@@ -187,7 +187,7 @@ export default class UserTabs {
...
@@ -187,7 +187,7 @@ export default class UserTabs {
let
newState
=
source
;
let
newState
=
source
;
newState
=
newState
.
replace
(
/
\/
+$/
,
''
);
newState
=
newState
.
replace
(
/
\/
+$/
,
''
);
newState
+=
this
.
windowLocation
.
search
+
this
.
windowLocation
.
hash
;
newState
+=
this
.
windowLocation
.
search
+
this
.
windowLocation
.
hash
;
history
.
replaceState
(
window
.
history
.
replaceState
(
{
{
url
:
newState
,
url
:
newState
,
},
},
...
...
app/assets/javascripts/project_find_file.js
View file @
bce89082
...
@@ -150,7 +150,7 @@ export default class ProjectFindFile {
...
@@ -150,7 +150,7 @@ export default class ProjectFindFile {
}
}
goToTree
()
{
goToTree
()
{
return
location
.
href
=
this
.
options
.
treeUrl
;
return
window
.
location
.
href
=
this
.
options
.
treeUrl
;
}
}
goToBlob
()
{
goToBlob
()
{
...
...
app/assets/javascripts/project_import.js
View file @
bce89082
...
@@ -2,7 +2,7 @@ import { visitUrl } from './lib/utils/url_utility';
...
@@ -2,7 +2,7 @@ import { visitUrl } from './lib/utils/url_utility';
export
default
function
projectImport
()
{
export
default
function
projectImport
()
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
visitUrl
(
location
.
href
);
visitUrl
(
window
.
location
.
href
);
},
5000
);
},
5000
);
}
}
app/assets/javascripts/search_autocomplete.js
View file @
bce89082
...
@@ -438,7 +438,7 @@ export default class SearchAutocomplete {
...
@@ -438,7 +438,7 @@ export default class SearchAutocomplete {
}
}
onClick
(
item
,
$el
,
e
)
{
onClick
(
item
,
$el
,
e
)
{
if
(
location
.
pathname
.
indexOf
(
item
.
url
)
!==
-
1
)
{
if
(
window
.
location
.
pathname
.
indexOf
(
item
.
url
)
!==
-
1
)
{
if
(
!
e
.
metaKey
)
e
.
preventDefault
();
if
(
!
e
.
metaKey
)
e
.
preventDefault
();
if
(
!
this
.
badgePresent
)
{
if
(
!
this
.
badgePresent
)
{
if
(
item
.
category
===
'
Projects
'
)
{
if
(
item
.
category
===
'
Projects
'
)
{
...
...
app/assets/javascripts/settings_panels.js
View file @
bce89082
...
@@ -42,8 +42,8 @@ export default function initSettingsPanels() {
...
@@ -42,8 +42,8 @@ export default function initSettingsPanels() {
}
}
});
});
if
(
location
.
hash
)
{
if
(
window
.
location
.
hash
)
{
const
$target
=
$
(
location
.
hash
);
const
$target
=
$
(
window
.
location
.
hash
);
if
(
$target
.
length
&&
$target
.
hasClass
(
'
settings
'
))
{
if
(
$target
.
length
&&
$target
.
hasClass
(
'
settings
'
))
{
expandSection
(
$target
);
expandSection
(
$target
);
}
}
...
...
app/assets/javascripts/shortcuts_find_file.js
View file @
bce89082
...
@@ -13,8 +13,8 @@ export default class ShortcutsFindFile extends ShortcutsNavigation {
...
@@ -13,8 +13,8 @@ export default class ShortcutsFindFile extends ShortcutsNavigation {
element
===
this
.
projectFindFile
.
inputElement
[
0
]
&&
element
===
this
.
projectFindFile
.
inputElement
[
0
]
&&
(
combo
===
'
up
'
||
combo
===
'
down
'
||
combo
===
'
esc
'
||
combo
===
'
enter
'
)
(
combo
===
'
up
'
||
combo
===
'
down
'
||
combo
===
'
esc
'
||
combo
===
'
enter
'
)
)
{
)
{
// when press up/down key in textbox, cusor prevent to move to home/end
// when press up/down key in textbox, cu
r
sor prevent to move to home/end
e
vent
.
preventDefault
();
e
.
preventDefault
();
return
false
;
return
false
;
}
}
...
...
app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue
View file @
bce89082
...
@@ -54,7 +54,7 @@ export default {
...
@@ -54,7 +54,7 @@ export default {
updateConfidentialAttribute
(
confidential
)
{
updateConfidentialAttribute
(
confidential
)
{
this
.
service
this
.
service
.
update
(
'
issue
'
,
{
confidential
})
.
update
(
'
issue
'
,
{
confidential
})
.
then
(()
=>
location
.
reload
())
.
then
(()
=>
window
.
location
.
reload
())
.
catch
(()
=>
{
.
catch
(()
=>
{
Flash
(
Flash
(
__
(
__
(
...
...
app/assets/javascripts/sidebar/components/lock/lock_issue_sidebar.vue
View file @
bce89082
...
@@ -76,7 +76,7 @@ export default {
...
@@ -76,7 +76,7 @@ export default {
.
update
(
this
.
issuableType
,
{
.
update
(
this
.
issuableType
,
{
discussion_locked
:
locked
,
discussion_locked
:
locked
,
})
})
.
then
(()
=>
location
.
reload
())
.
then
(()
=>
window
.
location
.
reload
())
.
catch
(()
=>
.
catch
(()
=>
Flash
(
Flash
(
this
.
__
(
this
.
__
(
...
...
app/assets/javascripts/sidebar/sidebar_mediator.js
View file @
bce89082
...
@@ -80,7 +80,7 @@ export default class SidebarMediator {
...
@@ -80,7 +80,7 @@ export default class SidebarMediator {
return
this
.
service
.
moveIssue
(
this
.
store
.
moveToProjectId
)
return
this
.
service
.
moveIssue
(
this
.
store
.
moveToProjectId
)
.
then
(
response
=>
response
.
json
())
.
then
(
response
=>
response
.
json
())
.
then
((
data
)
=>
{
.
then
((
data
)
=>
{
if
(
location
.
pathname
!==
data
.
web_url
)
{
if
(
window
.
location
.
pathname
!==
data
.
web_url
)
{
visitUrl
(
data
.
web_url
);
visitUrl
(
data
.
web_url
);
}
}
});
});
...
...
app/assets/javascripts/snippet/snippet_embed.js
View file @
bce89082
export
default
()
=>
{
export
default
()
=>
{
const
{
protocol
,
host
,
pathname
}
=
location
;
const
{
protocol
,
host
,
pathname
}
=
window
.
location
;
const
shareBtn
=
document
.
querySelector
(
'
.js-share-btn
'
);
const
shareBtn
=
document
.
querySelector
(
'
.js-share-btn
'
);
const
embedBtn
=
document
.
querySelector
(
'
.js-embed-btn
'
);
const
embedBtn
=
document
.
querySelector
(
'
.js-embed-btn
'
);
const
snippetUrlArea
=
document
.
querySelector
(
'
.js-snippet-url-area
'
);
const
snippetUrlArea
=
document
.
querySelector
(
'
.js-snippet-url-area
'
);
...
...
spec/javascripts/blob/viewer/index_spec.js
View file @
bce89082
...
@@ -32,7 +32,7 @@ describe('Blob viewer', () => {
...
@@ -32,7 +32,7 @@ describe('Blob viewer', () => {
afterEach
(()
=>
{
afterEach
(()
=>
{
mock
.
restore
();
mock
.
restore
();
location
.
hash
=
''
;
window
.
location
.
hash
=
''
;
});
});
it
(
'
loads source file after switching views
'
,
(
done
)
=>
{
it
(
'
loads source file after switching views
'
,
(
done
)
=>
{
...
@@ -49,7 +49,7 @@ describe('Blob viewer', () => {
...
@@ -49,7 +49,7 @@ describe('Blob viewer', () => {
});
});
it
(
'
loads source file when line number is in hash
'
,
(
done
)
=>
{
it
(
'
loads source file when line number is in hash
'
,
(
done
)
=>
{
location
.
hash
=
'
#L1
'
;
window
.
location
.
hash
=
'
#L1
'
;
new
BlobViewer
();
new
BlobViewer
();
...
...
spec/javascripts/bootstrap_linked_tabs_spec.js
View file @
bce89082
...
@@ -36,7 +36,7 @@ import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs';
...
@@ -36,7 +36,7 @@ import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs';
describe
(
'
on click
'
,
()
=>
{
describe
(
'
on click
'
,
()
=>
{
it
(
'
should change the url according to the clicked tab
'
,
()
=>
{
it
(
'
should change the url according to the clicked tab
'
,
()
=>
{
const
historySpy
=
spyOn
(
history
,
'
replaceState
'
).
and
.
callFake
(()
=>
{});
const
historySpy
=
spyOn
(
window
.
history
,
'
replaceState
'
).
and
.
callFake
(()
=>
{});
const
linkedTabs
=
new
LinkedTabs
({
const
linkedTabs
=
new
LinkedTabs
({
action
:
'
show
'
,
action
:
'
show
'
,
...
...
spec/javascripts/commits_spec.js
View file @
bce89082
...
@@ -56,7 +56,7 @@ describe('Commits List', () => {
...
@@ -56,7 +56,7 @@ describe('Commits List', () => {
beforeEach
(()
=>
{
beforeEach
(()
=>
{
commitsList
.
searchField
.
val
(
''
);
commitsList
.
searchField
.
val
(
''
);
spyOn
(
history
,
'
replaceState
'
).
and
.
stub
();
spyOn
(
window
.
history
,
'
replaceState
'
).
and
.
stub
();
mock
=
new
MockAdapter
(
axios
);
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
'
/h5bp/html5-boilerplate/commits/master
'
).
reply
(
200
,
{
mock
.
onGet
(
'
/h5bp/html5-boilerplate/commits/master
'
).
reply
(
200
,
{
...
...
spec/javascripts/environments/environments_app_spec.js
View file @
bce89082
...
@@ -220,7 +220,7 @@ describe('Environment', () => {
...
@@ -220,7 +220,7 @@ describe('Environment', () => {
);
);
component
=
mountComponent
(
EnvironmentsComponent
,
mockData
);
component
=
mountComponent
(
EnvironmentsComponent
,
mockData
);
spyOn
(
history
,
'
pushState
'
).
and
.
stub
();
spyOn
(
window
.
history
,
'
pushState
'
).
and
.
stub
();
});
});
describe
(
'
updateContent
'
,
()
=>
{
describe
(
'
updateContent
'
,
()
=>
{
...
...
spec/javascripts/environments/folder/environments_folder_view_spec.js
View file @
bce89082
...
@@ -177,7 +177,7 @@ describe('Environments Folder View', () => {
...
@@ -177,7 +177,7 @@ describe('Environments Folder View', () => {
});
});
component
=
mountComponent
(
Component
,
mockData
);
component
=
mountComponent
(
Component
,
mockData
);
spyOn
(
history
,
'
pushState
'
).
and
.
stub
();
spyOn
(
window
.
history
,
'
pushState
'
).
and
.
stub
();
});
});
describe
(
'
updateContent
'
,
()
=>
{
describe
(
'
updateContent
'
,
()
=>
{
...
...
spec/javascripts/ide/stores/actions/file_spec.js
View file @
bce89082
...
@@ -166,12 +166,12 @@ describe('IDE store file actions', () => {
...
@@ -166,12 +166,12 @@ describe('IDE store file actions', () => {
});
});
it
(
'
resets location.hash for line highlighting
'
,
done
=>
{
it
(
'
resets location.hash for line highlighting
'
,
done
=>
{
location
.
hash
=
'
test
'
;
window
.
location
.
hash
=
'
test
'
;
store
store
.
dispatch
(
'
setFileActive
'
,
localFile
.
path
)
.
dispatch
(
'
setFileActive
'
,
localFile
.
path
)
.
then
(()
=>
{
.
then
(()
=>
{
expect
(
location
.
hash
).
not
.
toBe
(
'
test
'
);
expect
(
window
.
location
.
hash
).
not
.
toBe
(
'
test
'
);
done
();
done
();
})
})
...
...
spec/javascripts/issue_show/components/app_spec.js
View file @
bce89082
...
@@ -145,7 +145,7 @@ describe('Issuable output', () => {
...
@@ -145,7 +145,7 @@ describe('Issuable output', () => {
resolve
({
resolve
({
data
:
{
data
:
{
confidential
:
false
,
confidential
:
false
,
web_url
:
location
.
pathname
,
web_url
:
window
.
location
.
pathname
,
},
},
});
});
}));
}));
...
@@ -177,7 +177,7 @@ describe('Issuable output', () => {
...
@@ -177,7 +177,7 @@ describe('Issuable output', () => {
spyOn
(
vm
.
service
,
'
updateIssuable
'
).
and
.
callFake
(()
=>
new
Promise
((
resolve
)
=>
{
spyOn
(
vm
.
service
,
'
updateIssuable
'
).
and
.
callFake
(()
=>
new
Promise
((
resolve
)
=>
{
resolve
({
resolve
({
data
:
{
data
:
{
web_url
:
location
.
pathname
,
web_url
:
window
.
location
.
pathname
,
confidential
:
vm
.
isConfidential
,
confidential
:
vm
.
isConfidential
,
},
},
});
});
...
...
spec/javascripts/lib/utils/common_utils_spec.js
View file @
bce89082
...
@@ -40,13 +40,13 @@ describe('common_utils', () => {
...
@@ -40,13 +40,13 @@ describe('common_utils', () => {
});
});
it
(
'
should decode params
'
,
()
=>
{
it
(
'
should decode params
'
,
()
=>
{
history
.
pushState
(
''
,
''
,
'
?label_name%5B%5D=test
'
);
window
.
history
.
pushState
(
''
,
''
,
'
?label_name%5B%5D=test
'
);
expect
(
expect
(
commonUtils
.
getUrlParamsArray
()[
0
],
commonUtils
.
getUrlParamsArray
()[
0
],
).
toBe
(
'
label_name[]=test
'
);
).
toBe
(
'
label_name[]=test
'
);
history
.
pushState
(
''
,
''
,
'
?
'
);
window
.
history
.
pushState
(
''
,
''
,
'
?
'
);
});
});
});
});
...
...
spec/javascripts/pipelines/pipelines_spec.js
View file @
bce89082
...
@@ -427,7 +427,7 @@ describe('Pipelines', () => {
...
@@ -427,7 +427,7 @@ describe('Pipelines', () => {
describe
(
'
methods
'
,
()
=>
{
describe
(
'
methods
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
spyOn
(
history
,
'
pushState
'
).
and
.
stub
();
spyOn
(
window
.
history
,
'
pushState
'
).
and
.
stub
();
});
});
describe
(
'
updateContent
'
,
()
=>
{
describe
(
'
updateContent
'
,
()
=>
{
...
...
spec/javascripts/settings_panels_spec.js
View file @
bce89082
...
@@ -9,11 +9,11 @@ describe('Settings Panels', () => {
...
@@ -9,11 +9,11 @@ describe('Settings Panels', () => {
describe
(
'
initSettingsPane
'
,
()
=>
{
describe
(
'
initSettingsPane
'
,
()
=>
{
afterEach
(()
=>
{
afterEach
(()
=>
{
location
.
hash
=
''
;
window
.
location
.
hash
=
''
;
});
});
it
(
'
should expand linked hash fragment panel
'
,
()
=>
{
it
(
'
should expand linked hash fragment panel
'
,
()
=>
{
location
.
hash
=
'
#autodevops-settings
'
;
window
.
location
.
hash
=
'
#autodevops-settings
'
;
const
pipelineSettingsPanel
=
document
.
querySelector
(
'
#autodevops-settings
'
);
const
pipelineSettingsPanel
=
document
.
querySelector
(
'
#autodevops-settings
'
);
// Our test environment automatically expands everything so we need to clear that out first
// Our test environment automatically expands everything so we need to clear that out first
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment