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
4028f632
Commit
4028f632
authored
Aug 01, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ci skip] eslint-fix
parent
ecd5d340
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
40 additions
and
45 deletions
+40
-45
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+8
-8
app/assets/javascripts/project.js
app/assets/javascripts/project.js
+2
-3
app/assets/javascripts/repo/index.js
app/assets/javascripts/repo/index.js
+4
-5
app/assets/javascripts/repo/repo_binary_viewer.vue
app/assets/javascripts/repo/repo_binary_viewer.vue
+5
-6
app/assets/javascripts/repo/repo_commit_section.vue
app/assets/javascripts/repo/repo_commit_section.vue
+6
-8
app/assets/javascripts/repo/repo_edit_button.js
app/assets/javascripts/repo/repo_edit_button.js
+1
-1
app/assets/javascripts/repo/repo_editor.vue
app/assets/javascripts/repo/repo_editor.vue
+4
-4
app/assets/javascripts/repo/repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+2
-2
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+2
-2
app/assets/javascripts/repo/repo_tabs.vue
app/assets/javascripts/repo/repo_tabs.vue
+1
-1
app/assets/javascripts/vue_shared/components/popup_dialog.vue
...assets/javascripts/vue_shared/components/popup_dialog.vue
+5
-5
No files found.
app/assets/javascripts/gl_dropdown.js
View file @
4028f632
...
@@ -30,9 +30,9 @@ GitLabDropdownInput = (function() {
...
@@ -30,9 +30,9 @@ GitLabDropdownInput = (function() {
}
}
})
})
.
on
(
'
input
'
,
function
(
e
)
{
.
on
(
'
input
'
,
function
(
e
)
{
var
val
=
e
.
currentTarget
.
value
||
'
new-branch
'
var
val
=
e
.
currentTarget
.
value
||
'
new-branch
'
;
val
=
val
.
split
(
'
'
).
join
(
'
-
'
)
// replaces space with dash
val
=
val
.
split
(
'
'
).
join
(
'
-
'
)
// replaces space with dash
.
replace
(
/
[^
a-zA-Z0-9 -
]
/g
,
''
).
toLowerCase
()
//replace non alphanumeric
.
replace
(
/
[^
a-zA-Z0-9 -
]
/g
,
''
).
toLowerCase
()
//
replace non alphanumeric
.
replace
(
/
(
-
)\1
+/g
,
'
-
'
);
// replace repeated dashes
.
replace
(
/
(
-
)\1
+/g
,
'
-
'
);
// replace repeated dashes
_this
.
cb
(
_this
.
options
.
fieldName
,
val
,
{},
true
);
_this
.
cb
(
_this
.
options
.
fieldName
,
val
,
{},
true
);
_this
.
input
.
closest
(
'
.dropdown
'
)
_this
.
input
.
closest
(
'
.dropdown
'
)
...
@@ -43,7 +43,7 @@ GitLabDropdownInput = (function() {
...
@@ -43,7 +43,7 @@ GitLabDropdownInput = (function() {
GitLabDropdownInput
.
prototype
.
onInput
=
function
(
cb
)
{
GitLabDropdownInput
.
prototype
.
onInput
=
function
(
cb
)
{
this
.
cb
=
cb
;
this
.
cb
=
cb
;
}
}
;
return
GitLabDropdownInput
;
return
GitLabDropdownInput
;
})();
})();
...
@@ -306,9 +306,9 @@ GitLabDropdown = (function() {
...
@@ -306,9 +306,9 @@ GitLabDropdown = (function() {
});
});
}
}
}
}
if
(
this
.
noFilterInput
.
length
)
{
if
(
this
.
noFilterInput
.
length
)
{
this
.
plainInput
=
new
GitLabDropdownInput
(
this
.
noFilterInput
,
this
.
options
);
this
.
plainInput
=
new
GitLabDropdownInput
(
this
.
noFilterInput
,
this
.
options
);
this
.
plainInput
.
onInput
(
this
.
addInput
.
bind
(
this
))
this
.
plainInput
.
onInput
(
this
.
addInput
.
bind
(
this
))
;
}
}
// Init filterable
// Init filterable
if
(
this
.
options
.
filterable
)
{
if
(
this
.
options
.
filterable
)
{
...
@@ -798,7 +798,7 @@ GitLabDropdown = (function() {
...
@@ -798,7 +798,7 @@ GitLabDropdown = (function() {
GitLabDropdown
.
prototype
.
addInput
=
function
(
fieldName
,
value
,
selectedObject
,
single
)
{
GitLabDropdown
.
prototype
.
addInput
=
function
(
fieldName
,
value
,
selectedObject
,
single
)
{
var
$input
;
var
$input
;
// Create hidden input for form
// Create hidden input for form
if
(
single
)
{
if
(
single
)
{
$
(
'
input[name="
'
+
fieldName
+
'
"]
'
).
remove
();
$
(
'
input[name="
'
+
fieldName
+
'
"]
'
).
remove
();
}
}
...
...
app/assets/javascripts/project.js
View file @
4028f632
...
@@ -123,10 +123,9 @@ import Cookies from 'js-cookie';
...
@@ -123,10 +123,9 @@ import Cookies from 'js-cookie';
var
shouldVisit
=
typeof
$visit
===
'
undefined
'
?
true
:
$visit
;
var
shouldVisit
=
typeof
$visit
===
'
undefined
'
?
true
:
$visit
;
var
action
=
$form
.
attr
(
'
action
'
);
var
action
=
$form
.
attr
(
'
action
'
);
var
divider
=
action
.
indexOf
(
'
?
'
)
===
-
1
?
'
?
'
:
'
&
'
;
var
divider
=
action
.
indexOf
(
'
?
'
)
===
-
1
?
'
?
'
:
'
&
'
;
if
(
shouldVisit
)
{
if
(
shouldVisit
)
{
gl
.
utils
.
visitUrl
(
action
+
''
+
divider
+
''
+
$form
.
serialize
());
gl
.
utils
.
visitUrl
(
action
+
''
+
divider
+
''
+
$form
.
serialize
());
}
}
}
}
}
}
});
});
...
...
app/assets/javascripts/repo/index.js
View file @
4028f632
...
@@ -13,7 +13,7 @@ import RepoBinaryViewer from './repo_binary_viewer.vue';
...
@@ -13,7 +13,7 @@ import RepoBinaryViewer from './repo_binary_viewer.vue';
import
RepoEditor
from
'
./repo_editor.vue
'
;
import
RepoEditor
from
'
./repo_editor.vue
'
;
import
monacoLoader
from
'
./monaco_loader
'
;
import
monacoLoader
from
'
./monaco_loader
'
;
import
RepoMixin
from
'
./repo_mixin
'
;
import
RepoMixin
from
'
./repo_mixin
'
;
import
PopupDialog
from
'
../vue_shared/components/popup_dialog.vue
'
import
PopupDialog
from
'
../vue_shared/components/popup_dialog.vue
'
;
Vue
.
use
(
Translate
);
Vue
.
use
(
Translate
);
...
@@ -40,7 +40,7 @@ function addEventsForNonVueEls() {
...
@@ -40,7 +40,7 @@ function addEventsForNonVueEls() {
window
.
onbeforeunload
=
function
(
e
)
{
window
.
onbeforeunload
=
function
(
e
)
{
const
hasChanged
=
Store
.
openedFiles
const
hasChanged
=
Store
.
openedFiles
.
some
(
file
=>
file
.
changed
);
.
some
(
file
=>
file
.
changed
);
if
(
!
hasChanged
)
return
;
if
(
!
hasChanged
)
return
;
e
=
e
||
window
.
event
;
e
=
e
||
window
.
event
;
if
(
e
)
{
if
(
e
)
{
e
.
returnValue
=
'
Are you sure you want to lose unsaved changes?
'
;
e
.
returnValue
=
'
Are you sure you want to lose unsaved changes?
'
;
...
@@ -53,7 +53,6 @@ function addEventsForNonVueEls() {
...
@@ -53,7 +53,6 @@ function addEventsForNonVueEls() {
function
initRepo
()
{
function
initRepo
()
{
const
repo
=
document
.
getElementById
(
'
repo
'
);
const
repo
=
document
.
getElementById
(
'
repo
'
);
Store
.
service
=
Service
;
Store
.
service
=
Service
;
Store
.
service
.
url
=
repo
.
dataset
.
url
;
Store
.
service
.
url
=
repo
.
dataset
.
url
;
Store
.
service
.
refsUrl
=
repo
.
dataset
.
refsUrl
;
Store
.
service
.
refsUrl
=
repo
.
dataset
.
refsUrl
;
...
@@ -107,8 +106,8 @@ function initRepo() {
...
@@ -107,8 +106,8 @@ function initRepo() {
dialogSubmitted
(
status
)
{
dialogSubmitted
(
status
)
{
this
.
dialog
.
open
=
false
;
this
.
dialog
.
open
=
false
;
this
.
dialog
.
status
=
status
;
this
.
dialog
.
status
=
status
;
}
}
,
}
}
,
});
});
const
editButton
=
document
.
getElementById
(
'
editable-mode
'
);
const
editButton
=
document
.
getElementById
(
'
editable-mode
'
);
...
...
app/assets/javascripts/repo/repo_binary_viewer.vue
View file @
4028f632
...
@@ -7,15 +7,14 @@ const RepoBinaryViewer = {
...
@@ -7,15 +7,14 @@ const RepoBinaryViewer = {
computed
:
{
computed
:
{
pngBlobWithDataURI
()
{
pngBlobWithDataURI
()
{
if
(
this
.
binaryTypes
.
png
)
{
if
(
this
.
binaryTypes
.
png
)
{
return
`data:image/png;base64,
${
this
.
blobRaw
}
`
;
return
`data:image/png;base64,
${
this
.
blobRaw
}
`
;
}
}
return
''
;
return
''
;
},
},
svgBlobWithDataURI
()
{
svgBlobWithDataURI
()
{
if
(
this
.
binaryTypes
.
svg
)
{
if
(
this
.
binaryTypes
.
svg
)
{
return
`data:image/svg+xml;utf8,
${
this
.
blobRaw
}
`
;
return
`data:image/svg+xml;utf8,
${
this
.
blobRaw
}
`
;
}
}
return
''
;
return
''
;
...
@@ -32,11 +31,11 @@ const RepoBinaryViewer = {
...
@@ -32,11 +31,11 @@ const RepoBinaryViewer = {
},
},
getBinaryType
()
{
getBinaryType
()
{
if
(
this
.
binaryTypes
.
hasOwnProperty
(
this
.
activeFile
.
extension
))
{
if
(
this
.
binaryTypes
.
hasOwnProperty
(
this
.
activeFile
.
extension
))
{
return
this
.
activeFile
.
extension
;
return
this
.
activeFile
.
extension
;
}
}
return
'
unknown
'
;
return
'
unknown
'
;
}
}
,
},
},
watch
:
{
watch
:
{
...
...
app/assets/javascripts/repo/repo_commit_section.vue
View file @
4028f632
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
/* global Flash */
/* global Flash */
import
Store
from
'
./repo_store
'
;
import
Store
from
'
./repo_store
'
;
import
Api
from
'
../api
'
;
import
Api
from
'
../api
'
;
import
RepoMixin
from
'
./repo_mixin
'
import
RepoMixin
from
'
./repo_mixin
'
;
import
Helper
from
'
./repo_helper
'
import
Helper
from
'
./repo_helper
'
;
const
RepoCommitSection
=
{
const
RepoCommitSection
=
{
data
:
()
=>
Store
,
data
:
()
=>
Store
,
...
@@ -12,14 +12,12 @@ const RepoCommitSection = {
...
@@ -12,14 +12,12 @@ const RepoCommitSection = {
computed
:
{
computed
:
{
branchPaths
()
{
branchPaths
()
{
let
branch
=
Helper
.
getBranch
();
const
branch
=
Helper
.
getBranch
();
return
this
.
changedFiles
.
map
((
f
)
=>
{
return
this
.
changedFiles
.
map
(
f
=>
Helper
.
getFilePathFromFullPath
(
f
.
url
,
branch
));
return
Helper
.
getFilePathFromFullPath
(
f
.
url
,
branch
);
});
},
},
filePluralize
()
{
filePluralize
()
{
return
this
.
changedFiles
.
length
>
1
?
'
files
'
:
'
file
'
return
this
.
changedFiles
.
length
>
1
?
'
files
'
:
'
file
'
;
},
},
},
},
...
...
app/assets/javascripts/repo/repo_edit_button.js
View file @
4028f632
...
@@ -24,7 +24,7 @@ export default class RepoEditButton {
...
@@ -24,7 +24,7 @@ export default class RepoEditButton {
},
},
methods
:
{
methods
:
{
editClicked
()
{
editClicked
()
{
if
(
this
.
changedFiles
.
length
)
{
if
(
this
.
changedFiles
.
length
)
{
this
.
dialog
.
open
=
true
;
this
.
dialog
.
open
=
true
;
return
;
return
;
}
}
...
...
app/assets/javascripts/repo/repo_editor.vue
View file @
4028f632
...
@@ -71,11 +71,11 @@ const RepoEditor = {
...
@@ -71,11 +71,11 @@ const RepoEditor = {
readOnly
,
readOnly
,
});
});
if
(
this
.
editMode
)
{
if
(
this
.
editMode
)
{
$
(
'
.project-refs-form
'
).
addClass
(
'
disabled
'
);
$
(
'
.project-refs-form
'
).
addClass
(
'
disabled
'
);
$
(
'
.fa-long-arrow-right
'
).
show
();
$
(
'
.fa-long-arrow-right
'
).
show
();
$
(
'
.project-refs-target-form
'
).
show
();
$
(
'
.project-refs-target-form
'
).
show
();
}
else
{
}
else
{
$
(
'
.project-refs-form
'
).
removeClass
(
'
disabled
'
);
$
(
'
.project-refs-form
'
).
removeClass
(
'
disabled
'
);
$
(
'
.fa-long-arrow-right
'
).
hide
();
$
(
'
.fa-long-arrow-right
'
).
hide
();
$
(
'
.project-refs-target-form
'
).
hide
();
$
(
'
.project-refs-target-form
'
).
hide
();
...
@@ -88,10 +88,10 @@ const RepoEditor = {
...
@@ -88,10 +88,10 @@ const RepoEditor = {
dialog
:
{
dialog
:
{
handler
(
obj
)
{
handler
(
obj
)
{
if
(
obj
.
status
)
{
if
(
obj
.
status
)
{
obj
.
status
=
false
;
obj
.
status
=
false
;
this
.
openedFiles
.
map
((
f
)
=>
{
this
.
openedFiles
.
map
((
f
)
=>
{
if
(
f
.
active
)
{
if
(
f
.
active
)
{
this
.
blobRaw
=
f
.
plain
;
this
.
blobRaw
=
f
.
plain
;
}
}
f
.
changed
=
false
;
f
.
changed
=
false
;
...
...
app/assets/javascripts/repo/repo_helper.js
View file @
4028f632
...
@@ -58,7 +58,7 @@ const RepoHelper = {
...
@@ -58,7 +58,7 @@ const RepoHelper = {
file
.
opened
=
true
;
file
.
opened
=
true
;
file
.
icon
=
'
fa-folder-open
'
;
file
.
icon
=
'
fa-folder-open
'
;
RepoHelper
.
toURL
(
file
.
url
,
file
.
name
)
RepoHelper
.
toURL
(
file
.
url
,
file
.
name
)
;
return
file
;
return
file
;
},
},
...
@@ -281,7 +281,7 @@ const RepoHelper = {
...
@@ -281,7 +281,7 @@ const RepoHelper = {
history
.
pushState
({
key
:
RepoHelper
.
key
},
''
,
url
);
history
.
pushState
({
key
:
RepoHelper
.
key
},
''
,
url
);
if
(
title
)
{
if
(
title
)
{
document
.
title
=
`
${
title
}
· GitLab`
;
document
.
title
=
`
${
title
}
· GitLab`
;
}
}
},
},
...
...
app/assets/javascripts/repo/repo_store.js
View file @
4028f632
...
@@ -27,7 +27,7 @@ const RepoStore = {
...
@@ -27,7 +27,7 @@ const RepoStore = {
minTabSize
:
30
,
minTabSize
:
30
,
tabsOverflow
:
41
,
tabsOverflow
:
41
,
submitCommitsLoading
:
false
,
submitCommitsLoading
:
false
,
binaryLoaded
:
false
,
binaryLoaded
:
false
,
dialog
:
{
dialog
:
{
open
:
false
,
open
:
false
,
title
:
''
,
title
:
''
,
...
@@ -60,7 +60,7 @@ const RepoStore = {
...
@@ -60,7 +60,7 @@ const RepoStore = {
resetBinaryTypes
()
{
resetBinaryTypes
()
{
let
s
=
''
;
let
s
=
''
;
for
(
s
in
RepoStore
.
binaryTypes
)
{
for
(
s
in
RepoStore
.
binaryTypes
)
{
RepoStore
.
binaryTypes
[
s
]
=
false
;
RepoStore
.
binaryTypes
[
s
]
=
false
;
}
}
},
},
...
...
app/assets/javascripts/repo/repo_tabs.vue
View file @
4028f632
...
@@ -20,7 +20,7 @@ const RepoTabs = {
...
@@ -20,7 +20,7 @@ const RepoTabs = {
xclicked
(
file
)
{
xclicked
(
file
)
{
Store
.
removeFromOpenedFiles
(
file
);
Store
.
removeFromOpenedFiles
(
file
);
}
}
,
},
},
watch
:
{
watch
:
{
...
...
app/assets/javascripts/vue_shared/components/popup_dialog.vue
View file @
4028f632
...
@@ -23,10 +23,10 @@ const PopupDialog = {
...
@@ -23,10 +23,10 @@ const PopupDialog = {
computed
:
{
computed
:
{
typeOfClass
()
{
typeOfClass
()
{
const
className
=
`btn-
${
this
.
kind
}
`
;
const
className
=
`btn-
${
this
.
kind
}
`
;
le
t
returnObj
=
{};
cons
t
returnObj
=
{};
returnObj
[
className
]
=
true
;
returnObj
[
className
]
=
true
;
return
returnObj
;
return
returnObj
;
}
}
,
},
},
methods
:
{
methods
:
{
...
@@ -40,8 +40,8 @@ const PopupDialog = {
...
@@ -40,8 +40,8 @@ const PopupDialog = {
noClick
()
{
noClick
()
{
this
.
$emit
(
'
submit
'
,
false
);
this
.
$emit
(
'
submit
'
,
false
);
}
}
,
}
}
,
};
};
export
default
PopupDialog
;
export
default
PopupDialog
;
...
...
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