Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sfcode
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush
sfcode
Commits
e6e6d487
Commit
e6e6d487
authored
Dec 05, 2020
by
Ayush
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor update
parent
3b822e68
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
src/app/ide/ide.component.ts
src/app/ide/ide.component.ts
+11
-4
No files found.
src/app/ide/ide.component.ts
View file @
e6e6d487
...
@@ -31,7 +31,8 @@ export class IdeComponent implements OnInit {
...
@@ -31,7 +31,8 @@ export class IdeComponent implements OnInit {
@
ViewChild
(
IdeCompileComponent
)
runField
;
@
ViewChild
(
IdeCompileComponent
)
runField
;
@
ViewChild
(
SaveFileComponent
)
saveField
;
@
ViewChild
(
SaveFileComponent
)
saveField
;
constructor
(
public
router
:
Router
,
public
runCodeService
:
RunCodeService
,
private
fileService
:
FileService
)
{}
constructor
(
public
router
:
Router
,
public
runCodeService
:
RunCodeService
,
private
fileService
:
FileService
)
{
}
ngOnInit
():
void
{
ngOnInit
():
void
{
const
editorArea
=
document
.
getElementById
(
'
editor
'
);
const
editorArea
=
document
.
getElementById
(
'
editor
'
);
...
@@ -76,8 +77,10 @@ int main() {
...
@@ -76,8 +77,10 @@ int main() {
};
};
editor
.
on
(
'
update
'
,
()
=>
{
editor
.
on
(
'
update
'
,
()
=>
{
if
(
!
this
.
isUploading
)
{
this
.
isUpToDate
=
false
;
this
.
isUpToDate
=
false
;
document
.
getElementById
(
'
saveBtn
'
).
innerHTML
=
'
Save File
'
;
document
.
getElementById
(
'
saveBtn
'
).
innerHTML
=
'
Save File
'
;
}
code
[
activeLang
]
=
editor
.
getValue
();
code
[
activeLang
]
=
editor
.
getValue
();
this
.
file
.
text
=
editor
.
getValue
();
this
.
file
.
text
=
editor
.
getValue
();
});
});
...
@@ -90,7 +93,9 @@ int main() {
...
@@ -90,7 +93,9 @@ int main() {
updateFile
():
void
{
updateFile
():
void
{
const
btn
=
document
.
getElementById
(
'
saveBtn
'
)
as
HTMLButtonElement
;
const
btn
=
document
.
getElementById
(
'
saveBtn
'
)
as
HTMLButtonElement
;
if
(
btn
.
classList
.
contains
(
'
disabled
'
))
{
return
;
}
if
(
btn
.
classList
.
contains
(
'
disabled
'
))
{
return
;
}
this
.
isUploading
=
true
;
this
.
isUploading
=
true
;
btn
.
innerHTML
=
'
Saving...
'
;
btn
.
innerHTML
=
'
Saving...
'
;
this
.
fileService
.
upload
(
this
.
file
)
this
.
fileService
.
upload
(
this
.
file
)
...
@@ -100,6 +105,8 @@ int main() {
...
@@ -100,6 +105,8 @@ int main() {
this
.
isUpToDate
=
true
;
this
.
isUpToDate
=
true
;
},
error
=>
{
},
error
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
this
.
isUploading
=
false
;
btn
.
innerHTML
=
'
Save 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