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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
9960c761
Commit
9960c761
authored
Feb 25, 2017
by
Takuya Noguchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep consistent in handling indexOf results
parent
7d15f36b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
9 deletions
+13
-9
app/assets/javascripts/build.js
app/assets/javascripts/build.js
+1
-1
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+3
-3
app/assets/javascripts/issuable.js.es6
app/assets/javascripts/issuable.js.es6
+1
-1
app/assets/javascripts/merge_request_widget.js.es6
app/assets/javascripts/merge_request_widget.js.es6
+2
-2
app/assets/javascripts/new_branch_form.js
app/assets/javascripts/new_branch_form.js
+1
-1
app/assets/javascripts/project.js
app/assets/javascripts/project.js
+1
-1
changelogs/unreleased/28723-consistent-handling-indexof.yml
changelogs/unreleased/28723-consistent-handling-indexof.yml
+4
-0
No files found.
app/assets/javascripts/build.js
View file @
9960c761
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
if
(
window
.
location
.
hash
===
DOWN_BUILD_TRACE
)
{
if
(
window
.
location
.
hash
===
DOWN_BUILD_TRACE
)
{
$
(
"
html,body
"
).
scrollTop
(
this
.
$buildTrace
.
height
());
$
(
"
html,body
"
).
scrollTop
(
this
.
$buildTrace
.
height
());
}
}
if
(
removeRefreshStatuses
.
indexOf
(
buildData
.
status
)
>=
0
)
{
if
(
removeRefreshStatuses
.
indexOf
(
buildData
.
status
)
!==
-
1
)
{
this
.
$buildRefreshAnimation
.
remove
();
this
.
$buildRefreshAnimation
.
remove
();
return
this
.
initScrollMonitor
();
return
this
.
initScrollMonitor
();
}
}
...
...
app/assets/javascripts/gl_dropdown.js
View file @
9960c761
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
}
}
GitLabDropdownFilter
.
prototype
.
shouldBlur
=
function
(
keyCode
)
{
GitLabDropdownFilter
.
prototype
.
shouldBlur
=
function
(
keyCode
)
{
return
BLUR_KEYCODES
.
indexOf
(
keyCode
)
>=
0
;
return
BLUR_KEYCODES
.
indexOf
(
keyCode
)
!==
-
1
;
};
};
GitLabDropdownFilter
.
prototype
.
filter
=
function
(
search_text
)
{
GitLabDropdownFilter
.
prototype
.
filter
=
function
(
search_text
)
{
...
@@ -605,7 +605,7 @@
...
@@ -605,7 +605,7 @@
var
occurrences
;
var
occurrences
;
occurrences
=
fuzzaldrinPlus
.
match
(
text
,
term
);
occurrences
=
fuzzaldrinPlus
.
match
(
text
,
term
);
return
text
.
split
(
''
).
map
(
function
(
character
,
i
)
{
return
text
.
split
(
''
).
map
(
function
(
character
,
i
)
{
if
(
indexOf
.
call
(
occurrences
,
i
)
>=
0
)
{
if
(
indexOf
.
call
(
occurrences
,
i
)
!==
-
1
)
{
return
"
<b>
"
+
character
+
"
</b>
"
;
return
"
<b>
"
+
character
+
"
</b>
"
;
}
else
{
}
else
{
return
character
;
return
character
;
...
@@ -748,7 +748,7 @@
...
@@ -748,7 +748,7 @@
return
function
(
e
)
{
return
function
(
e
)
{
var
$listItems
,
PREV_INDEX
,
currentKeyCode
;
var
$listItems
,
PREV_INDEX
,
currentKeyCode
;
currentKeyCode
=
e
.
which
;
currentKeyCode
=
e
.
which
;
if
(
ARROW_KEY_CODES
.
indexOf
(
currentKeyCode
)
>=
0
)
{
if
(
ARROW_KEY_CODES
.
indexOf
(
currentKeyCode
)
!==
-
1
)
{
e
.
preventDefault
();
e
.
preventDefault
();
e
.
stopImmediatePropagation
();
e
.
stopImmediatePropagation
();
PREV_INDEX
=
currentIndex
;
PREV_INDEX
=
currentIndex
;
...
...
app/assets/javascripts/issuable.js.es6
View file @
9960c761
...
@@ -116,7 +116,7 @@
...
@@ -116,7 +116,7 @@
formData = $.param(formData);
formData = $.param(formData);
formAction = form.attr('action');
formAction = form.attr('action');
issuesUrl = formAction;
issuesUrl = formAction;
issuesUrl += "" + (formAction.indexOf('?')
< 0
? '?' : '&');
issuesUrl += "" + (formAction.indexOf('?')
=== -1
? '?' : '&');
issuesUrl += formData;
issuesUrl += formData;
return gl.utils.visitUrl(issuesUrl);
return gl.utils.visitUrl(issuesUrl);
};
};
...
...
app/assets/javascripts/merge_request_widget.js.es6
View file @
9960c761
...
@@ -83,7 +83,7 @@ require('./smart_interval');
...
@@ -83,7 +83,7 @@ require('./smart_interval');
return function() {
return function() {
var page;
var page;
page = $('body').data('page').split(':').last();
page = $('body').data('page').split(':').last();
if (allowedPages.indexOf(page)
< 0
) {
if (allowedPages.indexOf(page)
=== -1
) {
return _this.clearEventListeners();
return _this.clearEventListeners();
}
}
};
};
...
@@ -233,7 +233,7 @@ require('./smart_interval');
...
@@ -233,7 +233,7 @@ require('./smart_interval');
}
}
$('.ci_widget').hide();
$('.ci_widget').hide();
allowed_states = ["failed", "canceled", "running", "pending", "success", "success_with_warnings", "skipped", "not_found"];
allowed_states = ["failed", "canceled", "running", "pending", "success", "success_with_warnings", "skipped", "not_found"];
if (indexOf.call(allowed_states, state)
>= 0
) {
if (indexOf.call(allowed_states, state)
!== -1
) {
$('.ci_widget.ci-' + state).show();
$('.ci_widget.ci-' + state).show();
switch (state) {
switch (state) {
case "failed":
case "failed":
...
...
app/assets/javascripts/new_branch_form.js
View file @
9960c761
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
var
errorMessage
,
errors
,
formatter
,
unique
,
validator
;
var
errorMessage
,
errors
,
formatter
,
unique
,
validator
;
this
.
branchNameError
.
empty
();
this
.
branchNameError
.
empty
();
unique
=
function
(
values
,
value
)
{
unique
=
function
(
values
,
value
)
{
if
(
indexOf
.
call
(
values
,
value
)
<
0
)
{
if
(
indexOf
.
call
(
values
,
value
)
===
-
1
)
{
values
.
push
(
value
);
values
.
push
(
value
);
}
}
return
values
;
return
values
;
...
...
app/assets/javascripts/project.js
View file @
9960c761
...
@@ -116,7 +116,7 @@
...
@@ -116,7 +116,7 @@
if
(
$
(
'
input[name="ref"]
'
).
length
)
{
if
(
$
(
'
input[name="ref"]
'
).
length
)
{
var
$form
=
$dropdown
.
closest
(
'
form
'
);
var
$form
=
$dropdown
.
closest
(
'
form
'
);
var
action
=
$form
.
attr
(
'
action
'
);
var
action
=
$form
.
attr
(
'
action
'
);
var
divider
=
action
.
indexOf
(
'
?
'
)
<
0
?
'
?
'
:
'
&
'
;
var
divider
=
action
.
indexOf
(
'
?
'
)
===
-
1
?
'
?
'
:
'
&
'
;
gl
.
utils
.
visitUrl
(
action
+
''
+
divider
+
''
+
$form
.
serialize
());
gl
.
utils
.
visitUrl
(
action
+
''
+
divider
+
''
+
$form
.
serialize
());
}
}
}
}
...
...
changelogs/unreleased/28723-consistent-handling-indexof.yml
0 → 100644
View file @
9960c761
---
title
:
Keep consistent in handling indexOf results
merge_request
:
9531
author
:
Takuya Noguchi
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