Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
3pia
VISPA
VISPA web
Commits
aa037f38
Commit
aa037f38
authored
Oct 15, 2014
by
ThorbenQuast
Browse files
code editor: fix scrolling bug
parent
ba2834a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
vispa/extensions/codeeditor/static/js/output.js
View file @
aa037f38
...
...
@@ -19,7 +19,7 @@ var CodeEditorOutput = Emitter.extend({
'
pdflatex %file
'
:
[
'
tex
'
],
'
gcc %file -o %file.out && ./%file.out
'
:
[
'
c
'
],
'
g++ %file -o %file.out && ./%file.out
'
:
[
'
cc
'
,
'
cp
'
,
'
cxx
'
,
'
cpp
'
,
'
CPP
'
,
'
c++
'
,
'
C
'
]
[
'
cc
'
,
'
cp
'
,
'
cxx
'
,
'
cpp
'
,
'
CPP
'
,
'
c++
'
,
'
C
'
]
};
},
...
...
@@ -75,23 +75,27 @@ var CodeEditorOutput = Emitter.extend({
self
.
updateExeButtons
();
});
// register events
this
.
view
.
onSocket
(
'
start
'
,
function
(
data
)
{
self
.
wasAtBottom
=
self
.
isAtBottom
();
self
.
append
(
"
executing
\"
"
+
data
.
command
+
"
\"\n
"
+
"
--------------------
\n
"
+
"
OUTPUT:
\n\n
"
);
if
(
wasAtBottom
)
self
.
goToBottom
();
}).
onSocket
(
'
data
'
,
function
(
data
)
{
self
.
append
(
data
);
if
(
self
.
wasAtBottom
)
self
.
goToBottom
();
}).
onSocket
(
'
done
'
,
function
(
data
)
{
self
.
append
(
"
\n
--------------------
\n
"
+
(
data
.
aborted
?
"
process was aborted!
\n
"
:
""
)
+
"
runtime:
"
+
self
.
formatRuntime
(
data
.
runtime
)
+
"
\n
"
+
"
====================
\n\n\n
"
);
if
(
self
.
wasAtBottom
)
self
.
goToBottom
();
self
.
running
=
false
;
self
.
updateExeButtons
();
self
.
goToBottom
();
});
return
this
;
...
...
@@ -104,7 +108,7 @@ var CodeEditorOutput = Emitter.extend({
if
(
fileExtension
)
{
fileExtension
=
fileExtension
[
1
];
for
(
var
i
in
this
.
commandlineTemplates
)
{
if
(
~
this
.
commandlineTemplates
[
i
].
indexOf
(
fileExtension
)
)
{
if
(
~
this
.
commandlineTemplates
[
i
].
indexOf
(
fileExtension
))
{
this
.
commandline
.
val
(
i
);
return
true
;
}
...
...
@@ -219,10 +223,12 @@ var CodeEditorOutput = Emitter.extend({
append
:
function
(
text
)
{
this
.
initialClear
();
var
wasAtBottom
=
this
.
isAtBottom
();
this
.
setText
(
this
.
getText
()
+
String
(
text
));
/*
var wasAtBottom = this.isAtBottom();
if (wasAtBottom)
this.goToBottom();
*/
return
this
;
},
...
...
Write
Preview
Supports
Markdown
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