diff --git a/_config.yml b/_config.yml index 0138e1e..cf5877c 100644 --- a/_config.yml +++ b/_config.yml @@ -6,6 +6,7 @@ election_year: "2016" registration_end_date: "13th August 2014" api_key: "AIzaSyAwvkIls5mQybyp2R3g4FGiVetNdeVjUeE" +table_id: "1NMs_iAwYIZqdEBDVVuxA7nN4BQlvQwNAgevtPkYx" # ------------------------------------------------------------------------------ diff --git a/_layouts/default.html b/_layouts/default.html index 6319e56..5e98cff 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -31,9 +31,9 @@

GotToVote Logo diff --git a/js/main.js b/js/main.js index f520df8..4144f1d 100755 --- a/js/main.js +++ b/js/main.js @@ -25,6 +25,7 @@ var centre_name = new Array(); //Fusion Table Variables + var json_result; var get_url = "https://www.googleapis.com/fusiontables/v1/query?sql="; @@ -32,6 +33,8 @@ var sql_1 = encodeURIComponent("SELECT * FROM "); var sql_2 = encodeURIComponent(" WHERE Region_Code = "+county_code); var api_key = "&key={{ site.api_key }}"; +var table_id = "{{ site.table_id }}"; + county_sel.onchange = function () { if (county_sel.value==0) { @@ -53,7 +56,7 @@ county_sel.onchange = function () { county_code = county_sel.value; sql_2 = encodeURIComponent(" WHERE Region_Code = "+county_code); - run_get_centres("1NMs_iAwYIZqdEBDVVuxA7nN4BQlvQwNAgevtPkYx"); + run_get_centres(table_id); } } @@ -314,16 +317,15 @@ function run_get_centres(table_id) { } - - - // On Window load window.onload = function() { } + // Other Functions + function toTitleCase(str) { return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});