summaryrefslogtreecommitdiff
path: root/src/editor/simple/editor.js
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2011-07-07 13:30:56 +0000
committerhallgren <hallgren@chalmers.se>2011-07-07 13:30:56 +0000
commitc7fffd861b4fa74afc450be2970cd8cf63f64a88 (patch)
tree4a38edebc5b6027bd8f4737e833c117af7cb85c2 /src/editor/simple/editor.js
parentf224ead86b266c3c6c01a68c592ea589b0eba1bd (diff)
gfse: grammars in the cloud, work in progress
Cloud merging: when sharing grammars between two devices that previously each had separate grammar directoies on the server, clean up one of the directories and make it a symbolic link to the other.
Diffstat (limited to 'src/editor/simple/editor.js')
-rw-r--r--src/editor/simple/editor.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/editor/simple/editor.js b/src/editor/simple/editor.js
index ea56548a4..9954c5f7e 100644
--- a/src/editor/simple/editor.js
+++ b/src/editor/simple/editor.js
@@ -969,7 +969,12 @@ function download_from_cloud() {
var newdir="/tmp/"+location.hash.substr(1)
local.put("dir",newdir);
if(olddir && uploaded && newdir!=olddir) {
- upload_json(function(){download_json(newdir)})
+ function download() { download_json(newdir) }
+ function rmolddir(){
+ ajax_http_get("upload.cgi?rmdir="+olddir+"&newdir="+newdir,
+ download,download)
+ }
+ upload_json(rmolddir)
}
else download_json(newdir)
}