Browse Source

Added `loc` parsing to Google Maps closes #220 and scoped loading message divs

pull/227/head
Zach Wise 13 years ago
parent
commit
54f6ed27f4
  1. 2
      compiled/js/storyjs-embed-cdn.js
  2. 2
      compiled/js/storyjs-embed-generator.js
  3. 2
      compiled/js/storyjs-embed.js
  4. 9303
      compiled/js/timeline-min.js
  5. 39
      compiled/js/timeline.js
  6. 2
      source/js/Core
  7. 2
      source/js/VMM.Timeline.License.js
  8. 2
      source/js/VMM.Timeline.js

2
compiled/js/storyjs-embed-cdn.js

File diff suppressed because one or more lines are too long

2
compiled/js/storyjs-embed-generator.js

@ -2,4 +2,4 @@
VéritéCo Embed Generator 2.1
Designed and built by Zach Wise digitalartwork.net
Date: June 21, 2012
*/function getScriptPath(e){var t=document.getElementsByTagName("script"),n="";for(var r=0;r<t.length;r++)t[r].src.match(e)&&(n=t[r].src);return n.split("?")[0].split("/").slice(0,-1).join("/")+"/"}function getUrlVars(e){var t=[],n,r,i=e.toString();i.match("&#038;")?i=i.replace("&#038;","&"):i.match("&#38;")?i=i.replace("&#38;","&"):i.match("&amp;")&&(i=i.replace("&amp;","&"));i.match("#")&&(i=i.split("#")[0]);r=i.slice(i.indexOf("?")+1).split("&");for(var s=0;s<r.length;s++){n=r[s].split("=");t.push(n[0]);t[n[0]]=n[1]}return t}function getLinkAndIframe(){var e={},t=document.getElementById("embed-source-url"),n=document.getElementById("embed-width"),r=document.getElementById("embed-height"),i=document.getElementById("embed-maptype"),s=document.getElementById("embed-language"),o=document.getElementById("embed_code"),u=document.getElementById("embed-font"),a=document.getElementById("embed-wordpressplugin"),f=document.getElementById("embed-startatend"),l=document.getElementById("embed-hashbookmark"),c=document.getElementById("embed-startzoomadjust"),h=document.getElementById("embed-startatslide"),p=document.getElementById("embed-debug"),d=document.getElementById("embed-googlemapkey"),v=!1,m=!1,g=!1,y,b,w,E,S;t.value.match("docs.google.com")?S=getUrlVars(t.value).key:t.value==""?S="0Agl_Dv6iEbDadHdKcHlHcTB5bzhvbF9iTWwyMmJHdkE":S=t.value;f.checked&&(v=!0);l.checked&&(m=!0);p.checked&&(g=!0);E="[timeline ";n.value>0&&(E+="width='"+n.value+"' ");r.value>0&&(E+="height='"+n.value+"' ");E+="font='"+u.value+"' ";E+="maptype='"+i.value+"' ";E+="lang='"+s.value+"' ";E+="src='"+t.value+"' ";v&&(E+="start_at_end='"+v+"' ");m&&(E+="hash_bookmark='"+m+"' ");g&&(E+="debug='"+g+"' ");d.value!=""&&(E+="gmap_key='"+d.value+"' ");parseInt(h.value,10)>0&&(E+="start_at_slide='"+parseInt(h.value,10)+"' ");parseInt(c.value,10)>0&&(E+="start_zoom_adjust='"+parseInt(c.value,10)+"' ");E+="]";e.wordpress=E;w=generator_embed_path+"?source="+S;w+="&font="+u.value;w+="&maptype="+i.value;w+="&lang="+s.value;v&&(w+="&start_at_end="+v);m&&(w+="&hash_bookmark="+m);g&&(w+="&debug="+g);parseInt(h.value,10)>0&&(w+="&start_at_slide="+parseInt(h.value,10));parseInt(c.value,10)>0&&(w+="&start_zoom_adjust="+parseInt(c.value,10));d.value!=""&&(w+="&gmap_key="+d.value);n.value>0&&(w+="&width="+n.value);r.value>0&&(w+="&height="+r.value);y="<iframe src='"+w+"'";n.value>0&&(y+=" width='"+n.value+"'");r.value>0&&(y+=" height='"+r.value+"'");y+=" frameborder='0'></iframe>";e.iframe=y;e.link=w;a.checked?e.copybox=E:e.copybox=y;return e}function updateEmbedCode(e,t){var n=document.getElementById("embed_code"),r=getLinkAndIframe();n.value=r.copybox;$("#preview-embed-link").attr("href",r.link);$("#preview-embed-iframe").html(r.iframe)}if(typeof generator_embed_path=="undefined"||typeof generator_embed_path=="undefined"){var generator_embed_path=getScriptPath("storyjs-embed-generator.js").split("js/")[0];generator_embed_path.match("http")?generator_embed_path=generator_embed_path:generator_embed_path=="/"?generator_embed_path="index.html":generator_embed_path+="index.html"};
*/function getScriptPath(e){var t=document.getElementsByTagName("script"),n="";for(var r=0;r<t.length;r++)t[r].src.match(e)&&(n=t[r].src);return n.split("?")[0].split("/").slice(0,-1).join("/")+"/"}function getUrlVars(e){var t=[],n,r,i=e.toString();i.match("&#038;")?i=i.replace("&#038;","&"):i.match("&#38;")?i=i.replace("&#38;","&"):i.match("&amp;")&&(i=i.replace("&amp;","&"));i.match("#")&&(i=i.split("#")[0]);r=i.slice(i.indexOf("?")+1).split("&");for(var s=0;s<r.length;s++){n=r[s].split("=");t.push(n[0]);t[n[0]]=n[1]}return t}function getLinkAndIframe(){var e={},t=document.getElementById("embed-source-url"),n=document.getElementById("embed-width"),r=document.getElementById("embed-height"),i=document.getElementById("embed-maptype"),s=document.getElementById("embed-language"),o=document.getElementById("embed_code"),u=document.getElementById("embed-font"),a=document.getElementById("embed-wordpressplugin"),f=document.getElementById("embed-startatend"),l=document.getElementById("embed-hashbookmark"),c=document.getElementById("embed-startzoomadjust"),h=document.getElementById("embed-startatslide"),p=document.getElementById("embed-debug"),d=document.getElementById("embed-googlemapkey"),v=!1,m=!1,g=!1,y,b,w,E,S;t.value.match("docs.google.com")?S=getUrlVars(t.value).key:t.value==""?S="0Agl_Dv6iEbDadHdKcHlHcTB5bzhvbF9iTWwyMmJHdkE":S=t.value;f.checked&&(v=!0);l.checked&&(m=!0);p.checked&&(g=!0);E="[timeline ";n.value>0&&(E+="width='"+n.value+"' ");r.value>0&&(E+="height='"+n.value+"' ");E+="font='"+u.value+"' ";E+="maptype='"+i.value+"' ";E+="lang='"+s.value+"' ";E+="src='"+t.value+"' ";v&&(E+="start_at_end='"+v+"' ");m&&(E+="hash_bookmark='"+m+"' ");g&&(E+="debug='"+g+"' ");d.value!=""&&(E+="gmap_key='"+d.value+"' ");parseInt(h.value,10)>0&&(E+="start_at_slide='"+parseInt(h.value,10)+"' ");parseInt(c.value,10)>0&&(E+="start_zoom_adjust='"+parseInt(c.value,10)+"' ");E+="]";e.wordpress=E;w=generator_embed_path+"?source="+S;w+="&font="+u.value;w+="&maptype="+i.value;w+="&lang="+s.value;v&&(w+="&start_at_end="+v);m&&(w+="&hash_bookmark="+m);g&&(w+="&debug="+g);parseInt(h.value,10)>0&&(w+="&start_at_slide="+parseInt(h.value,10));parseInt(c.value,10)>0&&(w+="&start_zoom_adjust="+parseInt(c.value,10));d.value!=""&&(w+="&gmap_key="+d.value);n.value>0&&(w+="&width="+n.value);r.value>0&&(w+="&height="+r.value);y="<iframe src='"+w+"'";n.value>0&&(y+=" width='"+n.value+"'");r.value>0&&(y+=" height='"+r.value+"'");y+=" frameborder='0'></iframe>";e.iframe=y;e.link=w;a.checked?e.copybox=E:e.copybox=y;return e}function updateEmbedCode(e,t){var n=document.getElementById("embed_code"),r=getLinkAndIframe();n.value=r.copybox;jQuery("#preview-embed-link").attr("href",r.link);jQuery("#preview-embed-iframe").html(r.iframe);jQuery("#preview-embed").css("display","block")}if(typeof generator_embed_path=="undefined"||typeof generator_embed_path=="undefined"){var generator_embed_path=getScriptPath("storyjs-embed-generator.js").split("js/")[0];generator_embed_path.match("http")?generator_embed_path=generator_embed_path:generator_embed_path=="/"?generator_embed_path="index.html":generator_embed_path+="index.html"};

2
compiled/js/storyjs-embed.js

File diff suppressed because one or more lines are too long

9303
compiled/js/timeline-min.js vendored

File diff suppressed because one or more lines are too long

39
compiled/js/timeline.js

@ -1,6 +1,6 @@
/*!
TimelineJS
Version 2.10
Version 2.11
Designed and built by Zach Wise at VéritéCo
This Source Code Form is subject to the terms of the Mozilla Public
@ -3076,6 +3076,12 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
address = VMM.Util.getUrlVars(m.url)["q"],
marker;
if (address.match("loc:")) {
var address_latlon = address.split(":")[1].split("+");
location = new google.maps.LatLng(parseFloat(address_latlon[0]),parseFloat(address_latlon[1]));
has_location = true;
}
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
@ -3105,6 +3111,14 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
} else {
trace("Geocode for " + address + " was not successful for the following reason: " + status);
trace("TRYING PLACES SEARCH");
if (has_location) {
map.panTo(location);
}
if (has_zoom) {
map.setZoom(zoom);
}
loadPlaces();
}
});
@ -3165,16 +3179,25 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
} else {
trace("Place search for " + address + " was not successful for the following reason: " + status);
trace("Place search for " + search_request.query + " was not successful for the following reason: " + status);
// IF There's a problem loading the map, load a simple iFrame version instead
trace("YOU MAY NEED A GOOGLE MAPS API KEY IN ORDER TO USE THIS FEATURE OF TIMELINEJS");
trace("FIND OUT HOW TO GET YOUR KEY HERE: https://developers.google.com/places/documentation/#Authentication");
trace("USING SIMPLE IFRAME MAP EMBED");
if (m.url.match("https")) {
m.url = m.url.replace("https", "http");
if (has_location) {
map.panTo(location);
if (has_zoom) {
map.setZoom(zoom);
}
} else {
trace("USING SIMPLE IFRAME MAP EMBED");
if (m.url[0].match("https")) {
m.url = m.url[0].replace("https", "http");
}
VMM.ExternalAPI.googlemaps.createiFrameMap(m);
}
VMM.ExternalAPI.googlemaps.createiFrameMap(m);
}
}
@ -4014,7 +4037,7 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaElement == 'undefined') {
},
loadingmessage: function(m) {
return "<div class='loading'><div class='loading-container'><div class='loading-icon'></div>" + "<div class='message'><p>" + m + "</p></div></div></div>";
return "<div class='vco-loading'><div class='vco-loading-container'><div class='vco-loading-icon'></div>" + "<div class='vco-message'><p>" + m + "</p></div></div></div>";
},
thumbnail: function(data, w, h, uid) {
@ -6432,7 +6455,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
$navigation,
slider,
timenav,
version = "2.10",
version = "2.x",
timeline_id = "#timelinejs",
events = {},
data = {},

2
source/js/Core

@ -1 +1 @@
Subproject commit 946e5b4a427300160a1693f07409dc725d195f8f
Subproject commit 6dd315bf69a1f3b6cf38d1b68e1369bcc689a81d

2
source/js/VMM.Timeline.License.js

@ -1,6 +1,6 @@
/*!
TimelineJS
Version 2.10
Version 2.11
Designed and built by Zach Wise at VéritéCo
This Source Code Form is subject to the terms of the Mozilla Public

2
source/js/VMM.Timeline.js

@ -42,7 +42,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
$navigation,
slider,
timenav,
version = "2.10",
version = "2.x",
timeline_id = "#timelinejs",
events = {},
data = {},

Loading…
Cancel
Save