diff options
| author | hallgren <hallgren@chalmers.se> | 2011-07-07 13:30:56 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2011-07-07 13:30:56 +0000 |
| commit | c7fffd861b4fa74afc450be2970cd8cf63f64a88 (patch) | |
| tree | 4a38edebc5b6027bd8f4737e833c117af7cb85c2 /src/editor/simple/editor.js | |
| parent | f224ead86b266c3c6c01a68c592ea589b0eba1bd (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.js | 7 |
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) } |
