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
b867b33e
Commit
b867b33e
authored
Apr 12, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved CSS into SCSS file
added ellipsis to path but not name
parent
a3566506
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
39 deletions
+40
-39
app/assets/javascripts/ide/components/file_finder/index.vue
app/assets/javascripts/ide/components/file_finder/index.vue
+7
-26
app/assets/javascripts/ide/components/file_finder/item.vue
app/assets/javascripts/ide/components/file_finder/item.vue
+11
-12
app/assets/javascripts/ide/lib/editor.js
app/assets/javascripts/ide/lib/editor.js
+2
-1
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+20
-0
No files found.
app/assets/javascripts/ide/components/file_finder/index.vue
View file @
b867b33e
...
...
@@ -5,7 +5,7 @@ import VirtualList from 'vue-virtual-scroll-list';
import
Item
from
'
./item.vue
'
;
import
router
from
'
../../ide_router
'
;
const
MAX_RESULTS
=
2
0
;
const
MAX_RESULTS
=
4
0
;
export
default
{
components
:
{
...
...
@@ -48,16 +48,14 @@ export default {
this
.
$nextTick
(()
=>
{
if
(
!
this
.
fileFindVisible
)
{
this
.
searchText
=
''
;
this
.
focusedIndex
=
0
;
}
else
{
this
.
focusedIndex
=
0
;
this
.
$refs
.
searchInput
.
focus
();
}
});
},
searchText
()
{
if
(
this
.
searchText
.
trim
()
!==
''
)
{
this
.
focusedIndex
=
0
;
}
},
},
methods
:
{
...
...
@@ -103,7 +101,7 @@ export default {
<
template
>
<div
class=
"ide-file-finder-overlay"
@
click
.self=
"toggleFileFinder(false)"
@
mousedown
.self=
"toggleFileFinder(false)"
>
<div
class=
"dropdown-menu diff-file-changes ide-file-finder show"
...
...
@@ -112,7 +110,7 @@ export default {
<input
type=
"search"
class=
"dropdown-input-field"
placeholder=
"Search files
"
:placeholder=
"__('Search files')
"
autocomplete=
"off"
v-model=
"searchText"
ref=
"searchInput"
...
...
@@ -150,10 +148,10 @@ export default {
>
<a
href=
""
>
<
template
v-if=
"loading"
>
Loading...
{{
__
(
'
Loading...
'
)
}}
</
template
>
<
template
v-else
>
No files found.
{{
__
(
'
No files found.
'
)
}}
</
template
>
</a>
</li>
...
...
@@ -162,20 +160,3 @@ export default {
</div>
</div>
</template>
<
style
>
.ide-file-finder-overlay
{
position
:
absolute
;
top
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
z-index
:
100
;
}
.ide-file-finder
{
top
:
10px
;
left
:
50%
;
transform
:
translateX
(
-50%
);
}
</
style
>
app/assets/javascripts/ide/components/file_finder/item.vue
View file @
b867b33e
...
...
@@ -2,6 +2,8 @@
import
fuzzaldrinPlus
from
'
fuzzaldrin-plus
'
;
import
FileIcon
from
'
../../../vue_shared/components/file_icon.vue
'
;
const
MAX_PATH_LENGTH
=
60
;
export
default
{
components
:
{
FileIcon
,
...
...
@@ -24,10 +26,14 @@ export default {
clickRow
()
{
this
.
$emit
(
'
click
'
,
this
.
file
);
},
highlightText
(
text
)
{
const
occurrences
=
fuzzaldrinPlus
.
match
(
text
,
this
.
searchText
);
highlightText
(
text
,
addEllipsis
)
{
const
maxText
=
text
.
length
<
MAX_PATH_LENGTH
||
!
addEllipsis
?
text
:
`...
${
text
.
substr
(
text
.
length
-
MAX_PATH_LENGTH
)}
`
;
const
occurrences
=
fuzzaldrinPlus
.
match
(
maxText
,
this
.
searchText
);
return
t
ext
return
maxT
ext
.
split
(
''
)
.
map
(
(
char
,
i
)
=>
...
...
@@ -56,21 +62,14 @@ export default {
<span
class=
"diff-changed-file-content append-right-8"
>
<strong
class=
"diff-changed-file-name"
v-html=
"highlightText(file.name)"
v-html=
"highlightText(file.name
, false
)"
>
</strong>
<span
class=
"diff-changed-file-path prepend-top-5"
v-html=
"highlightText(file.path)"
v-html=
"highlightText(file.path
, true
)"
>
</span>
</span>
</a>
</
template
>
<
style
>
.highlighted
{
color
:
#1b69b6
;
font-weight
:
600
;
}
</
style
>
app/assets/javascripts/ide/lib/editor.js
View file @
b867b33e
...
...
@@ -200,13 +200,14 @@ export default class Editor {
const
getKeyCode
=
key
=>
{
const
monacoKeyMod
=
key
.
indexOf
(
'
KEY_
'
)
===
0
;
return
monacoKeyMod
?
monaco
.
KeyCode
[
key
]
:
monaco
.
KeyMod
[
key
];
return
monacoKeyMod
?
this
.
monaco
.
KeyCode
[
key
]
:
this
.
monaco
.
KeyMod
[
key
];
};
keymap
.
forEach
(
command
=>
{
const
keybindings
=
command
.
bindings
.
map
(
binding
=>
{
const
keys
=
binding
.
split
(
'
+
'
);
// eslint-disable-next-line no-bitwise
return
keys
.
length
>
1
?
getKeyCode
(
keys
[
0
])
|
getKeyCode
(
keys
[
1
])
:
getKeyCode
(
keys
[
0
]);
});
...
...
app/assets/stylesheets/pages/repo.scss
View file @
b867b33e
...
...
@@ -840,3 +840,23 @@
align-items
:
center
;
font-weight
:
$gl-font-weight-bold
;
}
.ide-file-finder-overlay
{
position
:
absolute
;
top
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
z-index
:
100
;
}
.ide-file-finder
{
top
:
10px
;
left
:
50%
;
transform
:
translateX
(
-50%
);
.highlighted
{
color
:
$blue-500
;
font-weight
:
$gl-font-weight-bold
;
}
}
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