Browse Source

Changed the way API keys are set

pull/197/head
Zach Wise 12 years ago
parent
commit
066484c47b
  1. 8
      compiled/js/timeline-min.js
  2. 107
      compiled/js/timeline.js
  3. 2
      source/js/Core
  4. 7
      source/js/VMM.Timeline.TimeNav.js
  5. 5
      source/js/VMM.Timeline.js

8
compiled/js/timeline-min.js vendored

File diff suppressed because one or more lines are too long

107
compiled/js/timeline.js

@ -2362,7 +2362,28 @@ if(typeof VMM != 'undefined' && typeof VMM.Language == 'undefined') {
================================================== */
if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
VMM.ExternalAPI = {
VMM.ExternalAPI = ({
keys: {
google: "",
flickr: "",
twitter: ""
},
keys_master: {
vp: "Pellentesque nibh felis, eleifend id, commodo in, interdum vitae, leo",
flickr: "RAIvxHY4hE/Elm5cieh4X5ptMyDpj7MYIxziGxi0WGCcy1s+yr7rKQ==",
google: "jwNGnYw4hE9lmAez4ll0QD+jo6SKBJFknkopLS4FrSAuGfIwyj57AusuR0s8dAo=",
twitter: ""
},
init: function() {
return this;
},
setKeys: function(d) {
VMM.ExternalAPI.keys = d;
},
pushQues: function() {
@ -2659,6 +2680,14 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
googlemaps: {
maptype: "toner",
setMapType: function(d) {
if (d != "") {
VMM.ExternalAPI.googlemaps.maptype = d;
}
},
get: function(m) {
var timer,
api_key,
@ -2668,10 +2697,10 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
map_vars = VMM.Util.getUrlVars(m.id);
if (VMM.master_config.Timeline.api_keys.google != "") {
api_key = VMM.master_config.Timeline.api_keys.google;
if (VMM.ExternalAPI.keys.google != "") {
api_key = VMM.ExternalAPI.keys.google;
} else {
api_key = Aes.Ctr.decrypt(VMM.master_config.api_keys_master.google, VMM.master_config.vp, 256);
api_key = Aes.Ctr.decrypt(VMM.ExternalAPI.keys_master.google, VMM.ExternalAPI.keys_master.vp, 256);
}
map_url = "http://maps.googleapis.com/maps/api/js?key=" + api_key + "&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady";
@ -2693,9 +2722,19 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
},
create: function(m) {
var map_attribution = "";
var layer;
var map;
var map_attribution = "",
layer,
map,
map_options,
unique_map_id = m.id.toString() + "_gmap",
map_attribution_html = "",
location = new google.maps.LatLng(41.875696,-87.624207),
latlong,
zoom = 11,
has_location = false,
has_zoom = false,
map_bounds;
function mapProvider(name) {
if (name in VMM.ExternalAPI.googlemaps.map_providers) {
@ -2743,23 +2782,16 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
/* Make the Map
================================================== */
if (type.of(VMM.master_config.Timeline.maptype) == "string") {
if (VMM.ExternalAPI.googlemaps.defaultType(VMM.master_config.Timeline.maptype)) {
layer = google.maps.MapTypeId[VMM.master_config.Timeline.maptype.toUpperCase()];
if (VMM.ExternalAPI.googlemaps.maptype != "") {
if (VMM.ExternalAPI.googlemaps.defaultType(VMM.ExternalAPI.googlemaps.maptype)) {
layer = google.maps.MapTypeId[VMM.ExternalAPI.googlemaps.maptype.toUpperCase()];
} else {
layer = VMM.master_config.Timeline.maptype;
layer = VMM.ExternalAPI.googlemaps.maptype;
}
} else {
layer = "toner";
}
var location = new google.maps.LatLng(41.875696,-87.624207);
var latlong;
var zoom = 11;
var has_location = false;
var has_zoom = false;
var map_bounds;
if (type.of(VMM.Util.getUrlVars(m.url)["ll"]) == "string") {
has_location = true;
@ -2776,7 +2808,7 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
zoom = parseFloat(VMM.Util.getUrlVars(m.url)["z"]);
}
var map_options = {
map_options = {
zoom: zoom,
disableDefaultUI: true,
mapTypeControl: false,
@ -2792,18 +2824,17 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
}
}
var unique_map_id = m.id.toString() + "_gmap";
VMM.attachElement("#" + m.id, "<div class='google-map' id='" + unique_map_id + "' style='width=100%;height=100%;'></div>");
var map = new google.maps.Map(document.getElementById(unique_map_id), map_options);
map = new google.maps.Map(document.getElementById(unique_map_id), map_options);
if (VMM.ExternalAPI.googlemaps.defaultType(VMM.master_config.Timeline.maptype)) {
if (VMM.ExternalAPI.googlemaps.defaultType(VMM.ExternalAPI.googlemaps.maptype)) {
} else {
map.mapTypes.set(layer, new google.maps.VeriteMapType(layer));
// ATTRIBUTION
var map_attribution_html = "<div class='map-attribution'><div class='attribution-text'>" + map_attribution + "</div></div>";
map_attribution_html = "<div class='map-attribution'><div class='attribution-text'>" + map_attribution + "</div></div>";
VMM.appendElement("#"+unique_map_id, map_attribution_html);
}
@ -2811,10 +2842,12 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
// KML
function loadKML() {
var kml_url = m.url + "&output=kml";
var kml_url, kml_layer, infowindow, text;
kml_url = m.url + "&output=kml";
kml_url = kml_url.replace("&output=embed", "");
var kml_layer = new google.maps.KmlLayer(kml_url, {preserveViewport:true});
var infowindow = new google.maps.InfoWindow();
kml_layer = new google.maps.KmlLayer(kml_url, {preserveViewport:true});
infowindow = new google.maps.InfoWindow();
kml_layer.setMap(map);
google.maps.event.addListenerOnce(kml_layer, "defaultviewport_changed", function() {
@ -2828,7 +2861,7 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
});
google.maps.event.addListener(kml_layer, 'click', function(kmlEvent) {
var text = kmlEvent.featureData.description;
text = kmlEvent.featureData.description;
showInfoWindow(text);
function showInfoWindow(c) {
@ -3109,7 +3142,7 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
var api_key,
callback_timeout= setTimeout(callback, VMM.master_config.timers.api, flick);
if (VMM.master_config.Timeline.api_keys.flickr != "") {
if (typeof VMM.master_config.Timeline != 'undefined' && VMM.master_config.Timeline.api_keys.flickr != "") {
api_key = VMM.master_config.Timeline.api_keys.flickr;
} else {
api_key = Aes.Ctr.decrypt(VMM.master_config.api_keys_master.flickr, VMM.master_config.vp, 256)
@ -3499,7 +3532,7 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
}
}
}).init();
}
@ -4780,8 +4813,8 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
navigation.nextDate = VMM.appendAndGetElement(navigation.nextBtnContainer, "<div>", "date", "");
navigation.prevDate = VMM.appendAndGetElement(navigation.prevBtnContainer, "<div>", "date", "");
}
navigation.nextTitle = VMM.appendAndGetElement(navigation.nextBtnContainer, "<div>", "title", "Title Goes Here");
navigation.prevTitle = VMM.appendAndGetElement(navigation.prevBtnContainer, "<div>", "title", "Title Goes Here");
navigation.nextTitle = VMM.appendAndGetElement(navigation.nextBtnContainer, "<div>", "title", "");
navigation.prevTitle = VMM.appendAndGetElement(navigation.prevBtnContainer, "<div>", "title", "");
VMM.bindEvent(".nav-next", onNextClick);
VMM.bindEvent(".nav-previous", onPrevClick);
@ -6234,9 +6267,14 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
config.source = _data;
}
// LANGUAGE
VMM.Date.setLanguage(config.language);
VMM.master_config.language = config.language;
// EXTERNAL API
VMM.ExternalAPI.setKeys(config.api_keys);
VMM.ExternalAPI.googlemaps.setMapType(config.maptype);
// EVENTS
VMM.bindEvent(global, onDataReady, config.events.data_ready);
VMM.bindEvent(global, showMessege, config.events.messege);
@ -7987,7 +8025,6 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
trace("TITLE SLUG NOT FOUND " + data[i].slug)
}
if (has_title) {
VMM.appendElement(_marker_content, "<h3>" + _marker_title + "</h3>");
}
@ -8033,7 +8070,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
// CREATE TAGS
tags = VMM.Util.deDupeArray(tags);
if (tags.length > 2) {
if (tags.length > 3) {
config.nav.rows.current = config.nav.rows.half;
} else {
config.nav.rows.current = config.nav.rows.full;
@ -8042,7 +8079,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
if (k < config.nav.rows.current.length) {
var tag_element = VMM.appendAndGetElement($timebackground, "<div>", "timenav-tag");
VMM.Lib.addClass(tag_element, "timenav-tag-row-" + (k+1));
if (tags.length > 2) {
if (tags.length > 3) {
VMM.Lib.addClass(tag_element, "timenav-tag-size-half");
} else {
VMM.Lib.addClass(tag_element, "timenav-tag-size-full");
@ -8053,7 +8090,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
}
// RESIZE FLAGS IF NEEDED
if (tags.length > 2) {
if (tags.length > 3) {
for(l = 0; l < markers.length; l++) {
VMM.Lib.addClass(markers[l].flag, "flag-small");
markers[l].full = false;

2
source/js/Core

@ -1 +1 @@
Subproject commit 7c4dcd4760fbd197602de2c8edf23d898970b534
Subproject commit 27cea679940eed77af69de6d5700956a161fa107

7
source/js/VMM.Timeline.TimeNav.js

@ -1475,7 +1475,6 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
trace("TITLE SLUG NOT FOUND " + data[i].slug)
}
if (has_title) {
VMM.appendElement(_marker_content, "<h3>" + _marker_title + "</h3>");
}
@ -1521,7 +1520,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
// CREATE TAGS
tags = VMM.Util.deDupeArray(tags);
if (tags.length > 2) {
if (tags.length > 3) {
config.nav.rows.current = config.nav.rows.half;
} else {
config.nav.rows.current = config.nav.rows.full;
@ -1530,7 +1529,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
if (k < config.nav.rows.current.length) {
var tag_element = VMM.appendAndGetElement($timebackground, "<div>", "timenav-tag");
VMM.Lib.addClass(tag_element, "timenav-tag-row-" + (k+1));
if (tags.length > 2) {
if (tags.length > 3) {
VMM.Lib.addClass(tag_element, "timenav-tag-size-half");
} else {
VMM.Lib.addClass(tag_element, "timenav-tag-size-full");
@ -1541,7 +1540,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
}
// RESIZE FLAGS IF NEEDED
if (tags.length > 2) {
if (tags.length > 3) {
for(l = 0; l < markers.length; l++) {
VMM.Lib.addClass(markers[l].flag, "flag-small");
markers[l].full = false;

5
source/js/VMM.Timeline.js

@ -334,9 +334,14 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
config.source = _data;
}
// LANGUAGE
VMM.Date.setLanguage(config.language);
VMM.master_config.language = config.language;
// EXTERNAL API
VMM.ExternalAPI.setKeys(config.api_keys);
VMM.ExternalAPI.googlemaps.setMapType(config.maptype);
// EVENTS
VMM.bindEvent(global, onDataReady, config.events.data_ready);
VMM.bindEvent(global, showMessege, config.events.messege);

Loading…
Cancel
Save