Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
3pia
VISPA
VISPA web
Commits
d863660c
Commit
d863660c
authored
May 15, 2015
by
Marcel Rieger
Browse files
Update http methods in ajax calls of extensions.
parent
88a47986
Changes
7
Hide whitespace changes
Inline
Side-by-side
vispa/controller/filesystem.py
View file @
d863660c
...
...
@@ -304,7 +304,7 @@ class FSAjaxController(AbstractController):
@
cherrypy
.
expose
@
cherrypy
.
tools
.
ajax
(
encoded
=
True
)
@
cherrypy
.
tools
.
method
(
accept
=
"POST"
)
def
save
_
file
(
self
,
path
,
content
,
watch_id
=
None
,
utf8
=
False
):
def
savefile
(
self
,
path
,
content
,
watch_id
=
None
,
utf8
=
False
):
self
.
release_session
()
fs
=
self
.
get
(
'fs'
)
self
.
release_database
()
...
...
@@ -316,7 +316,7 @@ class FSAjaxController(AbstractController):
@
cherrypy
.
expose
@
cherrypy
.
tools
.
ajax
(
encoded
=
True
)
@
cherrypy
.
tools
.
method
(
accept
=
"GET"
)
def
get
_
file
(
self
,
path
,
watch_id
=
None
,
utf8
=
False
):
def
getfile
(
self
,
path
,
watch_id
=
None
,
utf8
=
False
):
self
.
release_session
()
fs
=
self
.
get
(
'fs'
)
self
.
release_database
()
...
...
@@ -357,7 +357,7 @@ class FSAjaxController(AbstractController):
@
cherrypy
.
expose
@
cherrypy
.
tools
.
ajax
(
encoded
=
True
)
@
cherrypy
.
tools
.
method
(
accept
=
"GET"
)
def
get
_
workspaceini
(
self
,
request
,
fail_on_missing
=
False
):
def
getworkspaceini
(
self
,
request
,
fail_on_missing
=
False
):
self
.
release_session
()
fs
=
self
.
get
(
'fs'
)
self
.
release_database
()
...
...
@@ -366,7 +366,7 @@ class FSAjaxController(AbstractController):
@
cherrypy
.
expose
@
cherrypy
.
tools
.
method
(
accept
=
"POST"
)
def
set
_
workspaceini
(
self
,
request
):
def
setworkspaceini
(
self
,
request
):
self
.
release_session
()
fs
=
self
.
get
(
'fs'
)
self
.
release_database
()
...
...
@@ -389,7 +389,7 @@ class FSAjaxController(AbstractController):
@
cherrypy
.
expose
@
cherrypy
.
tools
.
method
(
accept
=
"GET"
)
def
check
P
ermissions
(
self
,
path
):
def
check
p
ermissions
(
self
,
path
):
self
.
release_session
()
fs
=
self
.
get
(
'fs'
)
self
.
release_database
()
...
...
vispa/extensions/codeeditor/static/js/action.js
View file @
d863660c
...
...
@@ -96,7 +96,7 @@ define(["jquery", "emitter"], function($, Emitter) {
self
.
view
.
setLoading
(
false
);
};
//new: check for auto save tmp file
this
.
view
.
POS
T
(
"
/ajax/fs/get
_
file
"
,
{
this
.
view
.
GE
T
(
"
/ajax/fs/getfile
"
,
{
path
:
self
.
giveAutoSavePath
(),
utf8
:
true
},
function
(
err
,
res
)
{
...
...
@@ -110,7 +110,7 @@ define(["jquery", "emitter"], function($, Emitter) {
if
(
b
)
setContent
(
res
,
true
);
else
self
.
view
.
POS
T
(
"
/ajax/fs/get
_
file
"
,
{
self
.
view
.
GE
T
(
"
/ajax/fs/getfile
"
,
{
path
:
path
,
utf8
:
true
,
watch_id
:
"
code
"
...
...
@@ -123,7 +123,7 @@ define(["jquery", "emitter"], function($, Emitter) {
});
});
}
else
{
self
.
view
.
POS
T
(
"
/ajax/fs/get
_
file
"
,
{
self
.
view
.
GE
T
(
"
/ajax/fs/getfile
"
,
{
path
:
path
,
utf8
:
true
,
watch_id
:
"
code
"
...
...
@@ -153,7 +153,7 @@ define(["jquery", "emitter"], function($, Emitter) {
this
.
autosaveTimeOut
=
setTimeout
(
function
()
{
if
(
self
.
editor
.
path
&&
self
.
view
.
getState
(
"
writable
"
)
&&
self
.
view
.
isModified
())
{
self
.
savingProcessing
=
true
;
self
.
view
.
POST
(
"
/ajax/fs/save
_
file
"
,
{
self
.
view
.
POST
(
"
/ajax/fs/savefile
"
,
{
path
:
self
.
giveAutoSavePath
(),
content
:
self
.
editor
.
getContent
(),
utf8
:
true
...
...
@@ -218,7 +218,7 @@ define(["jquery", "emitter"], function($, Emitter) {
var
args
=
{
"
path
"
:
path
,
callback
:
function
(
path
)
{
self
.
view
.
POS
T
(
"
/ajax/fs/exists
"
,
{
self
.
view
.
GE
T
(
"
/ajax/fs/exists
"
,
{
path
:
path
},
function
(
err
,
selectedType
)
{
//check if saving is possible
...
...
@@ -294,7 +294,7 @@ define(["jquery", "emitter"], function($, Emitter) {
this
.
view
.
setLoading
(
true
);
this
.
savingProcessing
=
true
;
this
.
view
.
POST
(
"
/ajax/fs/save
_
file
"
,
{
this
.
view
.
POST
(
"
/ajax/fs/savefile
"
,
{
path
:
path
!==
undefined
?
path
:
this
.
editor
.
path
,
content
:
this
.
editor
.
getContent
(),
utf8
:
true
,
...
...
@@ -337,7 +337,7 @@ define(["jquery", "emitter"], function($, Emitter) {
},
removeAutoSaveFile
:
function
()
{
this
.
view
.
GE
T
(
"
/ajax/fs/remove
"
,
{
this
.
view
.
POS
T
(
"
/ajax/fs/remove
"
,
{
"
path
"
:
JSON
.
stringify
(
this
.
giveAutoSavePath
())
//syntax of path required for the fs remove function
});
...
...
vispa/extensions/codeeditor/static/js/output.js
View file @
d863660c
...
...
@@ -286,7 +286,7 @@ define(["jquery", "emitter"], function($, Emitter) {
self
.
view
.
alert
(
"
File extension '
"
+
fileExtension
+
"
'' is not supported!
"
);
else
{
self
.
view
.
setLoading
(
true
);
self
.
view
.
POST
(
"
/ajax/fs/save
_
file
"
,
{
self
.
view
.
POST
(
"
/ajax/fs/savefile
"
,
{
path
:
path
,
content
:
self
.
getText
(),
utf8
:
true
,
...
...
vispa/extensions/codeeditor/static/js/view.js
View file @
d863660c
...
...
@@ -203,7 +203,7 @@ define([
// cleanup
var
cleanUp
=
function
()
{
self
.
GE
T
(
vispa
.
url
.
dynamic
(
"
/ajax/fs/unwatch
"
),
{});
self
.
POS
T
(
vispa
.
url
.
dynamic
(
"
/ajax/fs/unwatch
"
),
{});
self
.
editor
.
actions
.
removeAutoSaveFile
();
self
.
POST
(
"
close
"
);
//to be replaced if #2164 is solved (place this call in the appropriate lines in ui.js)
...
...
vispa/extensions/file/static/js/base/actions.js
View file @
d863660c
...
...
@@ -163,7 +163,7 @@ define(["jquery", "jclass"], function($, JClass) {
if
(
newName
==
name
)
{
return
true
;
}
var
dfd
=
self
.
FileBase
.
instance
.
GE
T
(
"
/ajax/fs/rename
"
,
{
var
dfd
=
self
.
FileBase
.
instance
.
POS
T
(
"
/ajax/fs/rename
"
,
{
"
path
"
:
path
,
"
name
"
:
name
,
"
new_name
"
:
newName
...
...
@@ -232,8 +232,8 @@ define(["jquery", "jclass"], function($, JClass) {
move
:
function
(
source
,
destination
)
{
var
self
=
this
;
self
.
FileBase
.
instance
.
GE
T
(
"
/ajax/fs/move
"
,
{
"
source
"
:
JSON
.
stringify
(
source
),
self
.
FileBase
.
instance
.
POS
T
(
"
/ajax/fs/move
"
,
{
"
source
"
:
JSON
.
stringify
(
source
),
"
destination
"
:
JSON
.
stringify
(
destination
)
});
},
...
...
@@ -299,7 +299,7 @@ define(["jquery", "jclass"], function($, JClass) {
return
;
}
self
.
FileBase
.
instance
.
GE
T
(
"
/ajax/fs/compress
"
,
{
self
.
FileBase
.
instance
.
POS
T
(
"
/ajax/fs/compress
"
,
{
path
:
self
.
FileBase
.
instance
.
getState
(
"
path
"
),
paths
:
JSON
.
stringify
(
self
.
entries
),
name
:
newName
...
...
@@ -394,7 +394,7 @@ define(["jquery", "jclass"], function($, JClass) {
return
;
}
newName
=
name
;
self
.
FileBase
.
instance
.
GE
T
(
"
/ajax/fs/createfile
"
,
{
self
.
FileBase
.
instance
.
POS
T
(
"
/ajax/fs/createfile
"
,
{
"
path
"
:
self
.
FileBase
.
instance
.
getState
(
"
path
"
),
"
name
"
:
newName
});
...
...
@@ -409,7 +409,7 @@ define(["jquery", "jclass"], function($, JClass) {
return
;
}
newName
=
name
;
self
.
FileBase
.
instance
.
GE
T
(
"
/ajax/fs/createfolder
"
,
{
self
.
FileBase
.
instance
.
POS
T
(
"
/ajax/fs/createfolder
"
,
{
"
path
"
:
self
.
FileBase
.
instance
.
getState
(
"
path
"
),
"
name
"
:
newName
});
...
...
vispa/extensions/file/static/js/base/bookmark.js
View file @
d863660c
...
...
@@ -97,7 +97,7 @@ define(["jquery", "jclass"], function($, JClass) {
setContent
:
function
()
{
var
self
=
this
;
// get names from workspaceini
this
.
instance
.
POS
T
(
"
/ajax/fs/get
_
workspaceini
"
,
{
this
.
instance
.
GE
T
(
"
/ajax/fs/getworkspaceini
"
,
{
request
:
JSON
.
stringify
({
Bookmarks
:
[
"
names
"
,
"
paths
"
,
"
symbols
"
]
})
...
...
@@ -226,7 +226,7 @@ define(["jquery", "jclass"], function($, JClass) {
},
saveBookmarks
:
function
()
{
return
this
.
instance
.
POST
(
"
/ajax/fs/set
_
workspaceini
"
,
{
return
this
.
instance
.
POST
(
"
/ajax/fs/setworkspaceini
"
,
{
request
:
JSON
.
stringify
({
Bookmarks
:
{
names
:
this
.
names
.
join
(
"
:
"
),
...
...
vispa/extensions/file/static/js/views.js
View file @
d863660c
...
...
@@ -82,7 +82,7 @@ define(["vispa/views/center", "vispa/views/dialog", "./menuentries", "./browser/
onClose
:
function
()
{
this
.
removeSocketListener
(
"
watch
"
);
this
.
GE
T
(
"
/ajax/fs/unwatch
"
,
{
this
.
POS
T
(
"
/ajax/fs/unwatch
"
,
{
watch_id
:
"
0
"
});
return
this
;
...
...
@@ -212,7 +212,7 @@ define(["vispa/views/center", "vispa/views/dialog", "./menuentries", "./browser/
},
onClose
:
function
()
{
this
.
removeSocketListener
(
"
watch
"
);
this
.
GE
T
(
"
/ajax/fs/unwatch
"
,
{
this
.
POS
T
(
"
/ajax/fs/unwatch
"
,
{
watch_id
:
"
0
"
});
return
this
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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