From 1eef49ac936947e34af470e339e00056fce50b87 Mon Sep 17 00:00:00 2001 From: hallgren Date: Thu, 4 Oct 2012 15:21:30 +0000 Subject: gfse: various code improvements and prelimiary support for public grammars --- src/www/gfse/cloud2.js | 83 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 10 deletions(-) (limited to 'src/www/gfse/cloud2.js') diff --git a/src/www/gfse/cloud2.js b/src/www/gfse/cloud2.js index 02af9d91a..b04be451a 100644 --- a/src/www/gfse/cloud2.js +++ b/src/www/gfse/cloud2.js @@ -74,7 +74,15 @@ function upload_grammars(gs,cont) { with_dir(upload2) } -// Upload the grammar to store it in the cloud +function assign_unique_name(g,unique_id) { + if(!g.unique_name) { + g.unique_name=unique_id+"-"+g.index; + save_grammar(g) + } + return g +} + +// Upload all grammars to the cloud function upload_json(cont) { function upload2(dir,unique_id) { function upload3(resptext,status) { @@ -105,10 +113,7 @@ function upload_json(cont) { for(var i=0;i