Commit d863660c authored by Marcel Rieger's avatar Marcel Rieger
Browse files

Update http methods in ajax calls of extensions.

parent 88a47986
......@@ -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 checkPermissions(self, path):
def checkpermissions(self, path):
self.release_session()
fs = self.get('fs')
self.release_database()
......
......@@ -96,7 +96,7 @@ define(["jquery", "emitter"], function($, Emitter) {
self.view.setLoading(false);
};
//new: check for auto save tmp file
this.view.POST("/ajax/fs/get_file", {
this.view.GET("/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.POST("/ajax/fs/get_file", {
self.view.GET("/ajax/fs/getfile", {
path: path,
utf8: true,
watch_id: "code"
......@@ -123,7 +123,7 @@ define(["jquery", "emitter"], function($, Emitter) {
});
});
} else {
self.view.POST("/ajax/fs/get_file", {
self.view.GET("/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.POST("/ajax/fs/exists", {
self.view.GET("/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.GET("/ajax/fs/remove", {
this.view.POST("/ajax/fs/remove", {
"path": JSON.stringify(this.giveAutoSavePath())
//syntax of path required for the fs remove function
});
......
......@@ -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,
......
......@@ -203,7 +203,7 @@ define([
// cleanup
var cleanUp = function() {
self.GET(vispa.url.dynamic("/ajax/fs/unwatch"), {});
self.POST(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)
......
......@@ -163,7 +163,7 @@ define(["jquery", "jclass"], function($, JClass) {
if (newName == name) {
return true;
}
var dfd = self.FileBase.instance.GET("/ajax/fs/rename", {
var dfd = self.FileBase.instance.POST("/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.GET("/ajax/fs/move", {
"source": JSON.stringify(source),
self.FileBase.instance.POST("/ajax/fs/move", {
"source" : JSON.stringify(source),
"destination": JSON.stringify(destination)
});
},
......@@ -299,7 +299,7 @@ define(["jquery", "jclass"], function($, JClass) {
return;
}
self.FileBase.instance.GET("/ajax/fs/compress", {
self.FileBase.instance.POST("/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.GET("/ajax/fs/createfile", {
self.FileBase.instance.POST("/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.GET("/ajax/fs/createfolder", {
self.FileBase.instance.POST("/ajax/fs/createfolder", {
"path": self.FileBase.instance.getState("path"),
"name": newName
});
......
......@@ -97,7 +97,7 @@ define(["jquery", "jclass"], function($, JClass) {
setContent: function() {
var self = this;
// get names from workspaceini
this.instance.POST("/ajax/fs/get_workspaceini", {
this.instance.GET("/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(":"),
......
......@@ -82,7 +82,7 @@ define(["vispa/views/center", "vispa/views/dialog", "./menuentries", "./browser/
onClose: function() {
this.removeSocketListener("watch");
this.GET("/ajax/fs/unwatch", {
this.POST("/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.GET("/ajax/fs/unwatch", {
this.POST("/ajax/fs/unwatch", {
watch_id: "0"
});
return this;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment