From 0e0fd6787437a0cd2bbf94881066ab7b6bc72ee0 Mon Sep 17 00:00:00 2001 From: Theo Armour Date: Mon, 19 Sep 2016 19:13:57 -0700 Subject: [PATCH] elev get r21 fix index --- google-maps-api3/b-clk-click/click-r2.js | 31 ++++++++++++++++++++++++ google-maps-api3/index.html | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/google-maps-api3/b-clk-click/click-r2.js b/google-maps-api3/b-clk-click/click-r2.js index 3cd096c..c2fc8bc 100644 --- a/google-maps-api3/b-clk-click/click-r2.js +++ b/google-maps-api3/b-clk-click/click-r2.js @@ -16,6 +16,11 @@ '

api key:

' + '

' + +// '

' + +// '

' + +// '

' + + + '' + b; @@ -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() { @@ -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; @@ -61,6 +90,8 @@ } +console.log( 'CLKinpAPI.value', CLKinpAPI.value ); + } diff --git a/google-maps-api3/index.html b/google-maps-api3/index.html index b5124e6..a76e1ba 100644 --- a/google-maps-api3/index.html +++ b/google-maps-api3/index.html @@ -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;