Skip to content

Commit

Permalink
elev get r21 fix index
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-armour committed Sep 20, 2016
1 parent 42d4070 commit 0e0fd67
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions google-maps-api3/b-clk-click/click-r2.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
'<p>api key: <input id=CLKinpAPI onclick=this.select(); title="Obtain API key from Google Maps" ></p>' +
'<p><button onclick=CLK.onEventAPIKeyUpdate(); >Set API key</button></p>' +

// '<p><button onclick=CLK.setCookie(); >set cookie</button></p>' +
// '<p><button onclick=alert(document.cookie); >get cookie</button></p>' +
// '<p><button onclick=CLK.resetOnce(); >reset cookie</button></p>' +


'</details>' +

b;
Expand All @@ -24,6 +29,22 @@

}

CLK.setCookie = function() {

document.cookie = "apiKey=23"; // + CLKinpAPI.value + ", ";

console.log( 'dc', document.cookie );

}


CLK.resetOnce = function() {

document.cookie = "apiKey=; expires=Thu, 01 Jan 1970 00:00:00 GMT";

}



CLK.getMenuDetailsMapClick = function() {

Expand Down Expand Up @@ -51,6 +72,14 @@
googleMap.script = document.body.appendChild( document.createElement('script') );
googleMap.script.onload = CLK.initGoogleMap;

if ( location.hash.includes( 'key=') ) {

CLKinpAPI.value = location.hash.slice( location.hash.indexOf( 'key=' ) + 4, 44 )

}



if ( CLKinpAPI.value !== '' ) {

googleMap.script.src = 'https://maps.googleapis.com/maps/api/js?libraries=places&key=' + CLKinpAPI.value;
Expand All @@ -61,6 +90,8 @@

}

console.log( 'CLKinpAPI.value', CLKinpAPI.value );

}


Expand Down
2 changes: 1 addition & 1 deletion google-maps-api3/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// https://github.com/jaanga/jaanga.github.io/tree/master/cookbook-html/templates/open-index-or-markdown

var defaultFile = 'elevations-get-r21.html';
location.hash = 'readme.md';
// location.hash = 'readme.md';

var contents;

Expand Down

0 comments on commit 0e0fd67

Please sign in to comment.