From 57c2b7a7a0d6655dacf8935f8efd826450c42963 Mon Sep 17 00:00:00 2001 From: IshaGupta18 Date: Mon, 3 Jun 2019 22:07:08 +0530 Subject: [PATCH] Importing from Published Google Sheet --- examples/upload_file.html | 5 +++- src/parsing.js | 53 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/examples/upload_file.html b/examples/upload_file.html index dd2b425..94b4ba2 100644 --- a/examples/upload_file.html +++ b/examples/upload_file.html @@ -47,7 +47,10 @@
OR
- +
OR
+
+ +
diff --git a/src/parsing.js b/src/parsing.js index 4a1d112..d838691 100644 --- a/src/parsing.js +++ b/src/parsing.js @@ -421,6 +421,54 @@ function handleFileSelectstring(val){ $('.carousel').carousel(1); determineHeaders(mat); } +} +function handleFileSelectGoogleSheet(val){ + + document.getElementById("upload").onclick = function(e){ + var sheet_link=val; + $.getJSON(sheet_link, function(data) { + //first row "title" column + var hashSheet=data.feed.entry; + var headers_sheet=[]; + for (var key in hashSheet){ + var h=hashSheet[key]; + for (var headKey in h){ + if (headKey.slice(0,4)=="gsx$"){ + headers_sheet.push(headKey); + } + } + break; + } + console.log(headers_sheet,"headers_sheet"); + var matrixComplete=[]; + for (var i=0;i