From c7fffd861b4fa74afc450be2970cd8cf63f64a88 Mon Sep 17 00:00:00 2001 From: hallgren Date: Thu, 7 Jul 2011 13:30:56 +0000 Subject: 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. --- src/editor/simple/editor.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/editor/simple/editor.js') 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) } -- cgit v1.2.3