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
Jérome Perrin
gitlab-ce
Commits
33c8de60
Commit
33c8de60
authored
Jul 17, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further eslint fixes after conflict resolution
parent
9fe346af
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
71 additions
and
73 deletions
+71
-73
app/assets/javascripts/repo/repo_binary_viewer.js
app/assets/javascripts/repo/repo_binary_viewer.js
+1
-1
app/assets/javascripts/repo/repo_bundle.js
app/assets/javascripts/repo/repo_bundle.js
+10
-10
app/assets/javascripts/repo/repo_commit_section.js
app/assets/javascripts/repo/repo_commit_section.js
+6
-9
app/assets/javascripts/repo/repo_edit_button.js
app/assets/javascripts/repo/repo_edit_button.js
+7
-9
app/assets/javascripts/repo/repo_editor.js
app/assets/javascripts/repo/repo_editor.js
+14
-15
app/assets/javascripts/repo/repo_file_buttons.js
app/assets/javascripts/repo/repo_file_buttons.js
+6
-6
app/assets/javascripts/repo/repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+18
-14
app/assets/javascripts/repo/repo_sidebar.js
app/assets/javascripts/repo/repo_sidebar.js
+4
-4
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+1
-1
app/assets/javascripts/repo/repo_tab.js
app/assets/javascripts/repo/repo_tab.js
+4
-4
No files found.
app/assets/javascripts/repo/repo_binary_viewer.js
View file @
33c8de60
...
...
@@ -27,7 +27,7 @@ export default class RepoBinaryViewer {
watch
:
{
blobRaw
()
{
if
(
this
.
isMarkdown
())
{
if
(
this
.
isMarkdown
())
{
this
.
binaryTypes
.
markdown
=
true
;
this
.
activeFile
.
raw
=
false
;
// counts as binaryish so we use the binary viewer in this case.
...
...
app/assets/javascripts/repo/repo_bundle.js
View file @
33c8de60
import
Tabs
from
'
./repo_tabs
'
import
Sidebar
from
'
./repo_sidebar
'
import
Editor
from
'
./repo_editor
'
import
FileButtons
from
'
./repo_file_buttons
'
import
EditButton
from
'
./repo_edit_button
'
import
BinaryViewer
from
'
./repo_binary_viewer
'
import
CommitSection
from
'
./repo_commit_section
'
import
Service
from
'
./repo_service
'
import
Store
from
'
./repo_store
'
import
Helper
from
'
./repo_helper
'
import
Tabs
from
'
./repo_tabs
'
;
import
Sidebar
from
'
./repo_sidebar
'
;
import
Editor
from
'
./repo_editor
'
;
import
FileButtons
from
'
./repo_file_buttons
'
;
import
EditButton
from
'
./repo_edit_button
'
;
import
BinaryViewer
from
'
./repo_binary_viewer
'
;
import
CommitSection
from
'
./repo_commit_section
'
;
import
Service
from
'
./repo_service
'
;
import
Store
from
'
./repo_store
'
;
import
Helper
from
'
./repo_helper
'
;
export
default
class
RepoBundle
{
constructor
()
{
...
...
app/assets/javascripts/repo/repo_commit_section.js
View file @
33c8de60
import
Helper
from
'
./repo_helper
'
import
Vue
from
'
vue
'
import
Store
from
'
./repo_store
'
import
Vue
from
'
vue
'
;
import
Store
from
'
./repo_store
'
;
export
default
class
RepoCommitSection
{
constructor
()
{
...
...
@@ -16,13 +15,11 @@ export default class RepoCommitSection {
computed
:
{
changedFiles
()
{
const
changedFileList
=
this
.
openedFiles
.
filter
((
file
)
=>
{
return
file
.
changed
;
});
console
.
log
(
'
changedFileList
'
,
changedFileList
);
.
filter
(
file
=>
file
.
changed
);
console
.
log
(
'
changedFileList
'
,
changedFileList
);
return
changedFileList
;
},
}
}
,
});
}
}
\ No newline at end of file
}
app/assets/javascripts/repo/repo_edit_button.js
View file @
33c8de60
import
Service
from
'
./repo_service
'
import
Helper
from
'
./repo_helper
'
import
Vue
from
'
vue
'
import
Store
from
'
./repo_store
'
import
Vue
from
'
vue
'
;
import
Store
from
'
./repo_store
'
;
export
default
class
RepoEditButton
{
constructor
()
{
...
...
@@ -19,14 +17,14 @@ export default class RepoEditButton {
},
buttonIcon
()
{
return
this
.
editMode
?
[]
:
[
'
fa
'
,
'
fa-pencil
'
];
}
return
this
.
editMode
?
[]
:
[
'
fa
'
,
'
fa-pencil
'
];
}
,
},
methods
:
{
editClicked
()
{
this
.
editMode
=
!
this
.
editMode
;
}
}
}
,
}
,
});
}
}
\ No newline at end of file
}
app/assets/javascripts/repo/repo_editor.js
View file @
33c8de60
...
...
@@ -10,18 +10,11 @@ export default class RepoEditor {
}
addMonacoEvents
()
{
this
.
monacoEditor
.
onMouseUp
(
this
.
onMonacoEditorMouseUp
.
bind
(
this
)
);
this
.
monacoEditor
.
onMouseUp
(
RepoEditor
.
onMonacoEditorMouseUp
);
this
.
monacoEditor
.
onKeyUp
(
this
.
onMonacoEditorKeysPressed
.
bind
(
this
));
}
static
onMonacoEditorMouseUp
(
e
)
{
if
(
e
.
target
.
element
.
className
===
'
line-numbers
'
)
{
location
.
hash
=
`L
${
e
.
target
.
position
.
lineNumber
}
`
;
Store
.
activeLine
=
e
.
target
.
position
.
lineNumber
;
}
}
onMonacoEditorKeysPressed
(
e
)
{
onMonacoEditorKeysPressed
()
{
Helper
.
setActiveFileContents
(
this
.
monacoEditor
.
getValue
());
}
...
...
@@ -63,7 +56,7 @@ export default class RepoEditor {
methods
:
{
showHide
()
{
if
(
!
this
.
openedFiles
.
length
||
(
this
.
binary
&&
!
this
.
activeFile
.
raw
))
{
if
(
!
this
.
openedFiles
.
length
||
(
this
.
binary
&&
!
this
.
activeFile
.
raw
))
{
self
.
el
.
style
.
display
=
'
none
'
;
}
else
{
self
.
el
.
style
.
display
=
'
inline-block
'
;
...
...
@@ -80,17 +73,16 @@ export default class RepoEditor {
},
editMode
()
{
if
(
this
.
editMode
)
{
if
(
this
.
editMode
)
{
document
.
querySelector
(
'
.panel-right
'
).
classList
.
add
(
'
edit-mode
'
);
self
.
monacoEditor
.
updateOptions
({
readOnly
:
false
readOnly
:
false
,
});
}
else
{
document
.
querySelector
(
'
.panel-right
'
).
classList
.
remove
(
'
edit-mode
'
);
self
.
monacoEditor
.
updateOptions
({
readOnly
:
true
readOnly
:
true
,
});
}
},
...
...
@@ -114,7 +106,7 @@ export default class RepoEditor {
blobRaw
()
{
this
.
showHide
();
if
(
!
this
.
isTree
)
{
if
(
!
this
.
isTree
)
{
// kill the current model;
self
.
monacoEditor
.
setModel
(
null
);
// then create the new one
...
...
@@ -130,4 +122,11 @@ export default class RepoEditor {
},
});
}
static
onMonacoEditorMouseUp
(
e
)
{
if
(
e
.
target
.
element
.
className
===
'
line-numbers
'
)
{
location
.
hash
=
`L
${
e
.
target
.
position
.
lineNumber
}
`
;
Store
.
activeLine
=
e
.
target
.
position
.
lineNumber
;
}
}
}
app/assets/javascripts/repo/repo_file_buttons.js
View file @
33c8de60
import
Vue
from
'
vue
'
import
Store
from
'
./repo_store
'
import
Helper
from
'
./repo_helper
'
import
RepoMiniMixin
from
'
./repo_mini_mixin
'
import
Vue
from
'
vue
'
;
import
Store
from
'
./repo_store
'
;
import
Helper
from
'
./repo_helper
'
;
import
RepoMiniMixin
from
'
./repo_mini_mixin
'
;
export
default
class
RepoSidebar
{
constructor
(
url
)
{
...
...
@@ -33,7 +33,7 @@ export default class RepoSidebar {
computed
:
{
editableBorder
()
{
return
this
.
editMode
?
'
1px solid #1F78D1
'
:
'
1px solid #f0f0f0
'
;
return
this
.
editMode
?
'
1px solid #1F78D1
'
:
'
1px solid #f0f0f0
'
;
},
canPreview
()
{
...
...
@@ -56,7 +56,7 @@ export default class RepoSidebar {
methods
:
{
rawPreviewToggle
()
{
Helper
.
setCurrentFileRawOrPreview
();
}
}
,
},
});
}
...
...
app/assets/javascripts/repo/repo_helper.js
View file @
33c8de60
...
...
@@ -70,12 +70,14 @@ const RepoHelper = {
setActiveFile
(
file
)
{
// don't load the file that is already loaded
if
(
file
.
url
===
Store
.
activeFile
.
url
)
return
;
if
(
file
.
url
===
Store
.
activeFile
.
url
)
return
;
Store
.
openedFiles
=
Store
.
openedFiles
.
map
((
openedFile
,
i
)
=>
{
openedFile
.
active
=
file
.
url
===
openedFile
.
url
;
if
(
openedFile
.
active
)
{
Store
.
activeFile
=
openedFile
;
const
activeFile
=
openedFile
;
activeFile
.
active
=
file
.
url
===
activeFile
.
url
;
if
(
activeFile
.
active
)
{
Store
.
activeFile
=
activeFile
;
Store
.
activeFileIndex
=
i
;
}
return
activeFile
;
...
...
@@ -86,7 +88,7 @@ const RepoHelper = {
// can't get vue to listen to raw for some reason so this for now.
Store
.
activeFileLabel
=
'
Raw
'
;
if
(
file
.
binary
)
{
if
(
file
.
binary
)
{
Store
.
blobRaw
=
file
.
base64
;
}
else
{
Store
.
blobRaw
=
file
.
plain
;
...
...
@@ -103,12 +105,13 @@ const RepoHelper = {
},
addToOpenedFiles
(
file
)
{
const
openedFilesAlreadyExists
=
Store
.
openedFiles
.
some
((
openedFile
)
=>
{
return
openedFile
.
url
===
file
.
url
});
if
(
!
openedFilesAlreadyExists
)
{
file
.
changed
=
false
;
Store
.
openedFiles
.
push
(
file
);
const
openFile
=
file
;
const
openedFilesAlreadyExists
=
Store
.
openedFiles
.
some
(
openedFile
=>
openedFile
.
url
===
openFile
.
url
);
if
(
!
openedFilesAlreadyExists
)
{
openFile
.
changed
=
false
;
Store
.
openedFiles
.
push
(
openFile
);
}
},
...
...
@@ -143,7 +146,7 @@ const RepoHelper = {
},
setActiveFileContents
(
contents
)
{
if
(
!
Store
.
editMode
)
return
;
if
(
!
Store
.
editMode
)
return
;
Store
.
activeFile
.
newContent
=
contents
;
Store
.
activeFile
.
changed
=
Store
.
activeFile
.
plain
!==
Store
.
activeFile
.
newContent
;
Store
.
openedFiles
[
Store
.
activeFileIndex
].
changed
=
Store
.
activeFile
.
changed
;
...
...
@@ -180,7 +183,8 @@ const RepoHelper = {
},
// may be tree or file.
getContent
(
file
)
{
getContent
(
treeOrFile
)
{
let
file
=
treeOrFile
;
// don't load the same active file. That's silly.
// if(file && file.url === this.activeFile.url) return;
const
loadingData
=
this
.
setLoading
(
true
);
...
...
@@ -206,7 +210,7 @@ const RepoHelper = {
Store
.
blobRaw
=
data
.
plain
;
data
.
binary
=
false
;
}
if
(
!
file
.
url
)
{
if
(
!
file
.
url
)
{
file
.
url
=
location
.
pathname
;
}
data
.
url
=
file
.
url
;
...
...
app/assets/javascripts/repo/repo_sidebar.js
View file @
33c8de60
...
...
@@ -48,14 +48,14 @@ export default class RepoSidebar {
if
(
file
.
type
===
'
tree
'
&&
file
.
opened
)
{
Helper
.
removeChildFilesOfTree
(
file
);
return
;
}
else
{
url
=
file
.
url
;
Service
.
url
=
url
;
Helper
.
getContent
(
file
);
}
url
=
file
.
url
;
Service
.
url
=
url
;
Helper
.
getContent
(
file
);
url
=
file
.
url
;
Service
.
url
=
url
;
Helper
.
getContent
(
file
);
}
else
if
(
typeof
file
===
'
string
'
)
{
// go back
url
=
file
;
...
...
app/assets/javascripts/repo/repo_store.js
View file @
33c8de60
...
...
@@ -24,7 +24,7 @@ const RepoStore = {
url
:
''
,
raw
:
false
,
newContent
:
''
,
changed
:
false
changed
:
false
,
},
activeFileIndex
:
0
,
activeLine
:
0
,
...
...
app/assets/javascripts/repo/repo_tab.js
View file @
33c8de60
...
...
@@ -20,10 +20,10 @@ const RepoTab = {
changedClass
()
{
const
tabChangedObj
=
{
'
fa-times
'
:
!
this
.
tab
.
changed
,
'
fa-circle
'
:
this
.
tab
.
changed
'
fa-circle
'
:
this
.
tab
.
changed
,
};
return
tabChangedObj
}
return
tabChangedObj
;
}
,
},
methods
:
{
...
...
@@ -32,7 +32,7 @@ const RepoTab = {
},
xClicked
(
file
)
{
if
(
file
.
changed
)
return
;
if
(
file
.
changed
)
return
;
RepoHelper
.
removeFromOpenedFiles
(
file
);
},
},
...
...
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