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
Hide 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() {
}
})
.
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
.
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
_this
.
cb
(
_this
.
options
.
fieldName
,
val
,
{},
true
);
_this
.
input
.
closest
(
'
.dropdown
'
)
...
...
@@ -43,7 +43,7 @@ GitLabDropdownInput = (function() {
GitLabDropdownInput
.
prototype
.
onInput
=
function
(
cb
)
{
this
.
cb
=
cb
;
}
}
;
return
GitLabDropdownInput
;
})();
...
...
@@ -306,9 +306,9 @@ GitLabDropdown = (function() {
});
}
}
if
(
this
.
noFilterInput
.
length
)
{
if
(
this
.
noFilterInput
.
length
)
{
this
.
plainInput
=
new
GitLabDropdownInput
(
this
.
noFilterInput
,
this
.
options
);
this
.
plainInput
.
onInput
(
this
.
addInput
.
bind
(
this
))
this
.
plainInput
.
onInput
(
this
.
addInput
.
bind
(
this
))
;
}
// Init filterable
if
(
this
.
options
.
filterable
)
{
...
...
@@ -798,10 +798,10 @@ GitLabDropdown = (function() {
GitLabDropdown
.
prototype
.
addInput
=
function
(
fieldName
,
value
,
selectedObject
,
single
)
{
var
$input
;
// Create hidden input for form
if
(
single
)
{
$
(
'
input[name="
'
+
fieldName
+
'
"]
'
).
remove
();
if
(
single
)
{
$
(
'
input[name="
'
+
fieldName
+
'
"]
'
).
remove
();
}
$input
=
$
(
'
<input>
'
).
attr
(
'
type
'
,
'
hidden
'
).
attr
(
'
name
'
,
fieldName
).
val
(
value
);
if
(
this
.
options
.
inputId
!=
null
)
{
$input
.
attr
(
'
id
'
,
this
.
options
.
inputId
);
...
...
app/assets/javascripts/project.js
View file @
4028f632
...
...
@@ -123,10 +123,9 @@ import Cookies from 'js-cookie';
var
shouldVisit
=
typeof
$visit
===
'
undefined
'
?
true
:
$visit
;
var
action
=
$form
.
attr
(
'
action
'
);
var
divider
=
action
.
indexOf
(
'
?
'
)
===
-
1
?
'
?
'
:
'
&
'
;
if
(
shouldVisit
)
{
gl
.
utils
.
visitUrl
(
action
+
''
+
divider
+
''
+
$form
.
serialize
());
if
(
shouldVisit
)
{
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';
import
RepoEditor
from
'
./repo_editor.vue
'
;
import
monacoLoader
from
'
./monaco_loader
'
;
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
);
...
...
@@ -40,7 +40,7 @@ function addEventsForNonVueEls() {
window
.
onbeforeunload
=
function
(
e
)
{
const
hasChanged
=
Store
.
openedFiles
.
some
(
file
=>
file
.
changed
);
if
(
!
hasChanged
)
return
;
if
(
!
hasChanged
)
return
;
e
=
e
||
window
.
event
;
if
(
e
)
{
e
.
returnValue
=
'
Are you sure you want to lose unsaved changes?
'
;
...
...
@@ -53,7 +53,6 @@ function addEventsForNonVueEls() {
function
initRepo
()
{
const
repo
=
document
.
getElementById
(
'
repo
'
);
Store
.
service
=
Service
;
Store
.
service
.
url
=
repo
.
dataset
.
url
;
Store
.
service
.
refsUrl
=
repo
.
dataset
.
refsUrl
;
...
...
@@ -107,8 +106,8 @@ function initRepo() {
dialogSubmitted
(
status
)
{
this
.
dialog
.
open
=
false
;
this
.
dialog
.
status
=
status
;
}
}
}
,
}
,
});
const
editButton
=
document
.
getElementById
(
'
editable-mode
'
);
...
...
app/assets/javascripts/repo/repo_binary_viewer.vue
View file @
4028f632
...
...
@@ -7,15 +7,14 @@ const RepoBinaryViewer = {
computed
:
{
pngBlobWithDataURI
()
{
if
(
this
.
binaryTypes
.
png
)
{
return
`data:image/png;base64,
${
this
.
blobRaw
}
`
;
if
(
this
.
binaryTypes
.
png
)
{
return
`data:image/png;base64,
${
this
.
blobRaw
}
`
;
}
return
''
;
},
svgBlobWithDataURI
()
{
if
(
this
.
binaryTypes
.
svg
)
{
if
(
this
.
binaryTypes
.
svg
)
{
return
`data:image/svg+xml;utf8,
${
this
.
blobRaw
}
`
;
}
return
''
;
...
...
@@ -32,11 +31,11 @@ const RepoBinaryViewer = {
},
getBinaryType
()
{
if
(
this
.
binaryTypes
.
hasOwnProperty
(
this
.
activeFile
.
extension
))
{
if
(
this
.
binaryTypes
.
hasOwnProperty
(
this
.
activeFile
.
extension
))
{
return
this
.
activeFile
.
extension
;
}
return
'
unknown
'
;
}
}
,
},
watch
:
{
...
...
app/assets/javascripts/repo/repo_commit_section.vue
View file @
4028f632
...
...
@@ -2,24 +2,22 @@
/* global Flash */
import
Store
from
'
./repo_store
'
;
import
Api
from
'
../api
'
;
import
RepoMixin
from
'
./repo_mixin
'
import
Helper
from
'
./repo_helper
'
import
RepoMixin
from
'
./repo_mixin
'
;
import
Helper
from
'
./repo_helper
'
;
const
RepoCommitSection
=
{
data
:
()
=>
Store
,
mixins
:
[
RepoMixin
],
computed
:
{
branchPaths
()
{
let
branch
=
Helper
.
getBranch
();
return
this
.
changedFiles
.
map
((
f
)
=>
{
return
Helper
.
getFilePathFromFullPath
(
f
.
url
,
branch
);
});
const
branch
=
Helper
.
getBranch
();
return
this
.
changedFiles
.
map
(
f
=>
Helper
.
getFilePathFromFullPath
(
f
.
url
,
branch
));
},
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 {
},
methods
:
{
editClicked
()
{
if
(
this
.
changedFiles
.
length
)
{
if
(
this
.
changedFiles
.
length
)
{
this
.
dialog
.
open
=
true
;
return
;
}
...
...
app/assets/javascripts/repo/repo_editor.vue
View file @
4028f632
...
...
@@ -71,11 +71,11 @@ const RepoEditor = {
readOnly
,
});
if
(
this
.
editMode
)
{
if
(
this
.
editMode
)
{
$
(
'
.project-refs-form
'
).
addClass
(
'
disabled
'
);
$
(
'
.fa-long-arrow-right
'
).
show
();
$
(
'
.project-refs-target-form
'
).
show
();
}
else
{
}
else
{
$
(
'
.project-refs-form
'
).
removeClass
(
'
disabled
'
);
$
(
'
.fa-long-arrow-right
'
).
hide
();
$
(
'
.project-refs-target-form
'
).
hide
();
...
...
@@ -88,10 +88,10 @@ const RepoEditor = {
dialog
:
{
handler
(
obj
)
{
if
(
obj
.
status
)
{
if
(
obj
.
status
)
{
obj
.
status
=
false
;
this
.
openedFiles
.
map
((
f
)
=>
{
if
(
f
.
active
)
{
if
(
f
.
active
)
{
this
.
blobRaw
=
f
.
plain
;
}
f
.
changed
=
false
;
...
...
app/assets/javascripts/repo/repo_helper.js
View file @
4028f632
...
...
@@ -58,7 +58,7 @@ const RepoHelper = {
file
.
opened
=
true
;
file
.
icon
=
'
fa-folder-open
'
;
RepoHelper
.
toURL
(
file
.
url
,
file
.
name
)
RepoHelper
.
toURL
(
file
.
url
,
file
.
name
)
;
return
file
;
},
...
...
@@ -281,7 +281,7 @@ const RepoHelper = {
history
.
pushState
({
key
:
RepoHelper
.
key
},
''
,
url
);
if
(
title
)
{
if
(
title
)
{
document
.
title
=
`
${
title
}
· GitLab`
;
}
},
...
...
app/assets/javascripts/repo/repo_store.js
View file @
4028f632
...
...
@@ -27,7 +27,7 @@ const RepoStore = {
minTabSize
:
30
,
tabsOverflow
:
41
,
submitCommitsLoading
:
false
,
binaryLoaded
:
false
,
binaryLoaded
:
false
,
dialog
:
{
open
:
false
,
title
:
''
,
...
...
@@ -60,7 +60,7 @@ const RepoStore = {
resetBinaryTypes
()
{
let
s
=
''
;
for
(
s
in
RepoStore
.
binaryTypes
)
{
for
(
s
in
RepoStore
.
binaryTypes
)
{
RepoStore
.
binaryTypes
[
s
]
=
false
;
}
},
...
...
app/assets/javascripts/repo/repo_tabs.vue
View file @
4028f632
...
...
@@ -20,7 +20,7 @@ const RepoTabs = {
xclicked
(
file
)
{
Store
.
removeFromOpenedFiles
(
file
);
}
}
,
},
watch
:
{
...
...
app/assets/javascripts/vue_shared/components/popup_dialog.vue
View file @
4028f632
...
...
@@ -23,10 +23,10 @@ const PopupDialog = {
computed
:
{
typeOfClass
()
{
const
className
=
`btn-
${
this
.
kind
}
`
;
le
t
returnObj
=
{};
cons
t
returnObj
=
{};
returnObj
[
className
]
=
true
;
return
returnObj
;
}
}
,
},
methods
:
{
...
...
@@ -40,8 +40,8 @@ const PopupDialog = {
noClick
()
{
this
.
$emit
(
'
submit
'
,
false
);
}
}
}
,
}
,
};
export
default
PopupDialog
;
...
...
@@ -64,4 +64,4 @@ export default PopupDialog;
</div>
</div>
</div>
</
template
>
\ No newline at end of file
</
template
>
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