1
0
forked from GitHub/gf-core

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.
This commit is contained in:
hallgren
2011-07-07 13:30:56 +00:00
parent f224ead86b
commit c7fffd861b
2 changed files with 32 additions and 1 deletions

View File

@@ -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)
}