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
c5a35c64
Commit
c5a35c64
authored
Oct 12, 2014
by
Benjamin Fischer
Browse files
Fixing saving in codeeditor & fix selfcleanup of watches. fix #1921
parent
defc4892
Changes
2
Hide whitespace changes
Inline
Side-by-side
vispa/extensions/codeeditor/static/js/editor.js
View file @
c5a35c64
...
...
@@ -9,6 +9,7 @@ var CodeEditor = Emitter.extend({
this
.
mtime
=
null
;
this
.
lastContent
=
""
;
this
.
modified_processing
=
false
;
this
.
saving_processing
=
false
;
this
.
ace
=
null
;
this
.
originalAceCommands
=
null
;
...
...
@@ -61,7 +62,7 @@ var CodeEditor = Emitter.extend({
}
self
.
modified_processing
=
false
;
});
}
else
if
(
data
.
mtime
!=
self
.
mtime
)
{
}
else
if
(
data
.
mtime
!=
self
.
mtime
&&
!
self
.
saving_processing
)
{
self
.
modified_processing
=
true
;
self
.
view
.
confirm
(
"
The file
"
+
self
.
path
+
"
has changed on disk.
"
+
...
...
@@ -272,6 +273,7 @@ var CodeEditor = Emitter.extend({
}
this
.
view
.
setLoading
(
true
);
this
.
saving_processing
=
true
;
this
.
view
.
POST
(
vispa
.
url
.
dynamic
(
"
/ajax/fs/save_file
"
),
{
path
:
this
.
path
,
...
...
@@ -287,6 +289,7 @@ var CodeEditor = Emitter.extend({
callback
();
}).
always
(
function
()
{
self
.
view
.
setLoading
(
false
);
self
.
saving_processing
=
false
;
});
return
this
;
...
...
vispa/remote/filesystem.py
View file @
c5a35c64
...
...
@@ -511,12 +511,13 @@ class FileSystem(object):
if
event
.
action_name
==
'access'
:
return
if
os
.
path
.
exists
(
event
.
watch
.
path
):
mtime
=
os
.
path
.
getmtime
(
event
.
watch
.
path
)
else
:
mtime
=
-
1
with
self
.
_monitor_lock
:
# inform all listener
if
os
.
path
.
exists
(
event
.
watch
.
path
):
mtime
=
os
.
path
.
getmtime
(
event
.
watch
.
path
)
else
:
mtime
=
-
1
for
combined_id
in
event
.
watch
.
listener
:
vispa
.
remote
.
send_topic
(
"extension.%s.socket.watch"
%
combined_id
[
1
],
...
...
@@ -529,7 +530,7 @@ class FileSystem(object):
})
# cleanup yourself
if
mtime
==
-
1
:
if
event
.
action_name
in
[
'delete self'
,
'move self'
]
:
for
combined_id
in
event
.
watch
.
listener
:
del
self
.
_monitor_listener
[
combined_id
]
event
.
watch
.
listener
=
[]
...
...
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