Skip to content

Commit

Permalink
Using config items.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lemayian committed May 27, 2015
1 parent 8cefa07 commit e77cd0d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ election_year: "2016"
registration_end_date: "13th August 2014"

api_key: "AIzaSyAwvkIls5mQybyp2R3g4FGiVetNdeVjUeE"
table_id: "1NMs_iAwYIZqdEBDVVuxA7nN4BQlvQwNAgevtPkYx"


# ------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
<div class="container-narrow">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li class="{{page.home}}"><a href="index.html">Home</a></li>
<li class="{{page.about}}"><a href="about.html">About</a></li>
<li><a href="http://GotToVote.cc" target="_blank" style="border: 2px solid; padding: 8px 13px;">GtV.cc</a></li>
<li class="{{ page.home }}"><a href="{{ site.baseurl }}">Home</a></li>
<li class="{{ page.about }}"><a href="{{ site.baseurl }}/about">About</a></li>
<li><a href="http://gottovote.cc/" target="_blank" style="border: 2px solid; padding: 8px 13px;">GtV.cc</a></li>
</ul>
<h1 class="pull-left" style="margin-top:5px;">
<a href="index.html"><img src="img/logo_2.png" alt="GotToVote Logo"></a>
Expand Down
10 changes: 6 additions & 4 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ var centre_name = new Array();


//Fusion Table Variables

var json_result;

var get_url = "https://www.googleapis.com/fusiontables/v1/query?sql=";
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) {
Expand All @@ -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);
}
}

Expand Down Expand Up @@ -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();});
Expand Down

0 comments on commit e77cd0d

Please sign in to comment.