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
102a72f9
Commit
102a72f9
authored
Nov 11, 2015
by
ThorbenQuast
Browse files
[editor] reenable automatic setting of commandline and clean from logs,
both from rev. 2420
parent
17774c3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
vispa/extensions/codeeditor/static/js/commandline.js
View file @
102a72f9
...
...
@@ -31,23 +31,17 @@ define(["jquery", "emitter"], function($, Emitter) {
this
.
commandCookie
=
null
;
this
.
view
.
on
(
"
stateChange
"
,
function
(
key
)
{
if
(
!
self
.
commandline
)
return
;
switch
(
key
)
{
case
"
command
"
:
if
(
!
self
.
commandline
)
return
;
var
command
=
this
.
getState
(
"
command
"
);
if
(
self
.
commandline
.
val
()
!=
command
)
{
self
.
commandline
.
val
(
command
);
}
break
;
case
"
path
"
:
self
.
getCookie
(
function
()
{
//get the last command and afterwards set the default & render the history
self
.
setLastCommandFromCookie
();
self
.
setDefault
();
if
(
self
.
commandline
)
self
.
renderHistory
();
});
this
.
initEntries
();
break
;
}
});
...
...
@@ -56,7 +50,6 @@ define(["jquery", "emitter"], function($, Emitter) {
setup
:
function
(
node
)
{
// command line setup
var
rightTopNode
=
node
.
find
(
"
.codeeditor-right-top
"
);
var
self
=
this
;
this
.
commandline
=
rightTopNode
.
find
(
"
#command-line
"
).
tooltip
({
trigger
:
"
focus
"
...
...
@@ -64,24 +57,37 @@ define(["jquery", "emitter"], function($, Emitter) {
this
.
histNode
=
rightTopNode
.
find
(
"
#history
"
);
this
.
menuNode
=
rightTopNode
.
find
(
"
#menu
"
);
this
.
renderHistory
();
//main setup
this
.
initEntries
();
this
.
setMenuEntries
();
//sets up the buttons in the submit menu
},
initEntries
:
function
()
{
var
self
=
this
;
this
.
getCookie
(
function
()
{
//get the last command and afterwards set the default & render the history
self
.
setLastCommandFromCookie
();
self
.
setDefault
();
self
.
renderHistory
();
});
},
setMenuEntries
:
function
()
{
var
node
;
var
self
=
this
;
var
self
=
this
;
if
(
vispa
.
extensions
.
extensions
.
jobmanagement
)
{
//the menu entries should only be added
node
=
$
(
"
<li/>
"
).
append
(
$
(
"
<a />
"
).
append
(
$
(
"
<i/>
"
).
addClass
(
"
glyphicon glyphicon-time
"
))
.
click
(
function
()
{
self
.
view
.
editor
.
actions
.
save
(
function
()
{
var
cmd
=
self
.
getVal
();
cmd
=
cmd
.
replace
(
/
\%
file/g
,
self
.
view
.
editor
.
path
);
self
.
view
.
spawnInstance
(
"
jobmanagement
"
,
"
submissionCenter
"
,{
commands
:
cmd
});
});
self
.
view
.
editor
.
actions
.
save
(
function
()
{
var
cmd
=
self
.
getVal
();
cmd
=
cmd
.
replace
(
/
\%
file/g
,
self
.
view
.
editor
.
path
);
self
.
view
.
spawnInstance
(
"
jobmanagement
"
,
"
submissionCenter
"
,
{
commands
:
cmd
});
});
}).
append
(
"
Submit
"
));
this
.
menuNode
.
append
(
node
);
...
...
@@ -141,8 +147,10 @@ define(["jquery", "emitter"], function($, Emitter) {
fileExtension
=
fileExtension
[
1
];
for
(
var
i
in
this
.
commandlineTemplates
)
{
if
(
~
this
.
commandlineTemplates
[
i
].
indexOf
(
fileExtension
))
{
if
(
this
.
commands
.
length
===
0
)
if
(
this
.
commands
.
length
===
0
)
{
this
.
view
.
setState
(
"
command
"
,
i
);
this
.
view
.
emit
(
"
stateChange
"
,
"
command
"
);
}
this
.
pushDefault
(
i
);
return
true
;
}
...
...
vispa/extensions/codeeditor/static/js/editor.js
View file @
102a72f9
...
...
@@ -302,7 +302,6 @@ define(["jquery", "emitter", "./action", "require", "ace/ace", "ace/ext-language
setAutoCompletion
:
function
()
{
if
(
!
this
.
ace
)
return
;
console
.
log
(
"
enable auto
"
);
var
enable
=
this
.
view
.
getPreference
(
"
autoCompletion
"
);
this
.
ace
.
setOptions
({
enableBasicAutocompletion
:
enable
,
...
...
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