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
2268c2e0
Commit
2268c2e0
authored
May 11, 2016
by
Fabian-Andree Heidemann
Browse files
[codeeditor] fix state and prepare shortcuts
parent
8c0f14db
Changes
5
Hide whitespace changes
Inline
Side-by-side
vispa/extensions/codeeditor/static/js/commandline.js
View file @
2268c2e0
...
...
@@ -30,7 +30,7 @@ define(["jquery", "emitter", "vispa/extension"], function($, Emitter, Extension)
this
.
cookieName
=
null
;
this
.
commandCookie
=
null
;
this
.
view
.
on
(
"
stateChang
e
"
,
function
(
key
)
{
this
.
view
.
on
(
"
changedStat
e
"
,
function
(
key
)
{
if
(
!
self
.
commandline
)
return
;
switch
(
key
)
{
...
...
vispa/extensions/codeeditor/static/js/editor.js
View file @
2268c2e0
...
...
@@ -36,7 +36,7 @@ define([
this
.
actions
=
new
CodeEditorActions
(
this
,
view
);
this
.
view
.
on
(
"
stateChang
e
"
,
function
(
key
)
{
this
.
view
.
on
(
"
changedStat
e
"
,
function
(
key
)
{
if
(
key
==
"
path
"
)
{
if
(
!
self
.
ace
)
return
;
var
path
=
self
.
view
.
state
.
get
(
"
path
"
);
...
...
@@ -91,7 +91,7 @@ define([
self
.
applyShortcuts
();
// trigger loading of state again since we can handle it now
self
.
view
.
emit
(
"
stateChang
e
"
,
"
path
"
);
self
.
view
.
emit
(
"
changedStat
e
"
,
"
path
"
);
self
.
ace
.
focus
();
self
.
ace
.
resize
();
self
.
view
.
setLoading
(
false
);
...
...
@@ -239,8 +239,8 @@ define([
}.
bind
(
this
));
// overwrite with custom commands
var
shortcuts
=
$
.
extend
(
true
,
{},
this
.
view
.
_
shortcuts
);
var
shortcutData
=
$
.
extend
(
true
,
{},
this
.
view
.
_extension
.
_defaultShortcuts
.
CodeEditor
);
var
shortcuts
=
$
.
extend
(
true
,
{},
this
.
view
.
shortcuts
.
children
()
);
var
shortcutData
=
$
.
extend
(
true
,
{},
Prefs
.
shortcuts
);
//entries with incorrect syntax due to key even indication
var
notAllowed
=
[];
...
...
vispa/extensions/codeeditor/static/js/preview.js
View file @
2268c2e0
...
...
@@ -27,7 +27,7 @@ define(["jquery", "emitter", "text!../html/preview.html"], function($, Emitter,
this
.
thumbnailSize
=
null
;
this
.
view
.
on
(
"
stateChang
e
"
,
function
(
key
)
{
this
.
view
.
on
(
"
changedStat
e
"
,
function
(
key
)
{
switch
(
key
)
{
case
"
path
"
:
var
path
=
self
.
view
.
state
.
get
(
"
path
"
);
...
...
@@ -105,7 +105,7 @@ define(["jquery", "emitter", "text!../html/preview.html"], function($, Emitter,
self
.
loaderInterval
=
setInterval
(
function
()
{
self
.
refresh
();
},
1000
);
self
.
view
.
emit
(
"
stateChang
e
"
,
"
previewPath
"
);
self
.
view
.
emit
(
"
changedStat
e
"
,
"
previewPath
"
);
return
this
;
},
...
...
vispa/extensions/codeeditor/static/js/ui.js
View file @
2268c2e0
...
...
@@ -83,7 +83,7 @@ define(["jquery", "emitter"], function($, Emitter) {
}
});
this
.
view
.
on
(
"
stateChang
e
"
,
function
(
key
)
{
this
.
view
.
on
(
"
changedStat
e
"
,
function
(
key
)
{
if
(
key
==
"
showOutput
"
)
{
self
.
setInputOutputRatio
();
}
...
...
vispa/extensions/codeeditor/static/js/view.js
View file @
2268c2e0
...
...
@@ -112,7 +112,7 @@ define([
this
.
commandLine
.
setup
(
node
);
this
.
applyPreferences
();
this
.
_applyShortcuts
();
//
this._applyShortcuts();
//initially set the icon
this
.
icon
=
"
fa-align-left
"
;
this
.
setLoading
(
false
);
...
...
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