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
Boxiang Sun
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';
...
@@ -5,7 +5,7 @@ import VirtualList from 'vue-virtual-scroll-list';
import
Item
from
'
./item.vue
'
;
import
Item
from
'
./item.vue
'
;
import
router
from
'
../../ide_router
'
;
import
router
from
'
../../ide_router
'
;
const
MAX_RESULTS
=
2
0
;
const
MAX_RESULTS
=
4
0
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -48,16 +48,14 @@ export default {
...
@@ -48,16 +48,14 @@ export default {
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
if
(
!
this
.
fileFindVisible
)
{
if
(
!
this
.
fileFindVisible
)
{
this
.
searchText
=
''
;
this
.
searchText
=
''
;
this
.
focusedIndex
=
0
;
}
else
{
}
else
{
this
.
focusedIndex
=
0
;
this
.
$refs
.
searchInput
.
focus
();
this
.
$refs
.
searchInput
.
focus
();
}
}
});
});
},
},
searchText
()
{
searchText
()
{
if
(
this
.
searchText
.
trim
()
!==
''
)
{
this
.
focusedIndex
=
0
;
this
.
focusedIndex
=
0
;
}
},
},
},
},
methods
:
{
methods
:
{
...
@@ -103,7 +101,7 @@ export default {
...
@@ -103,7 +101,7 @@ export default {
<
template
>
<
template
>
<div
<div
class=
"ide-file-finder-overlay"
class=
"ide-file-finder-overlay"
@
click
.self=
"toggleFileFinder(false)"
@
mousedown
.self=
"toggleFileFinder(false)"
>
>
<div
<div
class=
"dropdown-menu diff-file-changes ide-file-finder show"
class=
"dropdown-menu diff-file-changes ide-file-finder show"
...
@@ -112,7 +110,7 @@ export default {
...
@@ -112,7 +110,7 @@ export default {
<input
<input
type=
"search"
type=
"search"
class=
"dropdown-input-field"
class=
"dropdown-input-field"
placeholder=
"Search files
"
:placeholder=
"__('Search files')
"
autocomplete=
"off"
autocomplete=
"off"
v-model=
"searchText"
v-model=
"searchText"
ref=
"searchInput"
ref=
"searchInput"
...
@@ -150,10 +148,10 @@ export default {
...
@@ -150,10 +148,10 @@ export default {
>
>
<a
href=
""
>
<a
href=
""
>
<
template
v-if=
"loading"
>
<
template
v-if=
"loading"
>
Loading...
{{
__
(
'
Loading...
'
)
}}
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
No files found.
{{
__
(
'
No files found.
'
)
}}
</
template
>
</
template
>
</a>
</a>
</li>
</li>
...
@@ -162,20 +160,3 @@ export default {
...
@@ -162,20 +160,3 @@ export default {
</div>
</div>
</div>
</div>
</template>
</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 @@
...
@@ -2,6 +2,8 @@
import
fuzzaldrinPlus
from
'
fuzzaldrin-plus
'
;
import
fuzzaldrinPlus
from
'
fuzzaldrin-plus
'
;
import
FileIcon
from
'
../../../vue_shared/components/file_icon.vue
'
;
import
FileIcon
from
'
../../../vue_shared/components/file_icon.vue
'
;
const
MAX_PATH_LENGTH
=
60
;
export
default
{
export
default
{
components
:
{
components
:
{
FileIcon
,
FileIcon
,
...
@@ -24,10 +26,14 @@ export default {
...
@@ -24,10 +26,14 @@ export default {
clickRow
()
{
clickRow
()
{
this
.
$emit
(
'
click
'
,
this
.
file
);
this
.
$emit
(
'
click
'
,
this
.
file
);
},
},
highlightText
(
text
)
{
highlightText
(
text
,
addEllipsis
)
{
const
occurrences
=
fuzzaldrinPlus
.
match
(
text
,
this
.
searchText
);
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
(
''
)
.
split
(
''
)
.
map
(
.
map
(
(
char
,
i
)
=>
(
char
,
i
)
=>
...
@@ -56,21 +62,14 @@ export default {
...
@@ -56,21 +62,14 @@ export default {
<span
class=
"diff-changed-file-content append-right-8"
>
<span
class=
"diff-changed-file-content append-right-8"
>
<strong
<strong
class=
"diff-changed-file-name"
class=
"diff-changed-file-name"
v-html=
"highlightText(file.name)"
v-html=
"highlightText(file.name
, false
)"
>
>
</strong>
</strong>
<span
<span
class=
"diff-changed-file-path prepend-top-5"
class=
"diff-changed-file-path prepend-top-5"
v-html=
"highlightText(file.path)"
v-html=
"highlightText(file.path
, true
)"
>
>
</span>
</span>
</span>
</span>
</a>
</a>
</
template
>
</
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 {
...
@@ -200,13 +200,14 @@ export default class Editor {
const
getKeyCode
=
key
=>
{
const
getKeyCode
=
key
=>
{
const
monacoKeyMod
=
key
.
indexOf
(
'
KEY_
'
)
===
0
;
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
=>
{
keymap
.
forEach
(
command
=>
{
const
keybindings
=
command
.
bindings
.
map
(
binding
=>
{
const
keybindings
=
command
.
bindings
.
map
(
binding
=>
{
const
keys
=
binding
.
split
(
'
+
'
);
const
keys
=
binding
.
split
(
'
+
'
);
// eslint-disable-next-line no-bitwise
return
keys
.
length
>
1
?
getKeyCode
(
keys
[
0
])
|
getKeyCode
(
keys
[
1
])
:
getKeyCode
(
keys
[
0
]);
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 @@
...
@@ -840,3 +840,23 @@
align-items
:
center
;
align-items
:
center
;
font-weight
:
$gl-font-weight-bold
;
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