Browse Source

Adding Font Options

pull/23/merge
Zach Wise 13 years ago
parent
commit
342264f83a
  1. 2
      font/Font.Arvo.PTSans.css
  2. 2
      font/Font.Merriweather.NewsCycle.css
  3. 2
      font/Font.PoiretOne.Molengo.css
  4. 54
      source/js/timeline-embed.js
  5. 26
      source/less/Font.Arvo.PTSans.less
  6. 18
      source/less/Font.Default.less
  7. 26
      source/less/Font.Merriweather.NewsCycle.less
  8. 26
      source/less/Font.PoiretOne.Molengo.less
  9. 46
      source/less/VMM.Timeline.TimeNav.less
  10. 28
      timeline-dark.css
  11. 2
      timeline-embed.js
  12. 1491
      timeline.css

2
font/Font.Arvo.PTSans.css

@ -0,0 +1,2 @@
#timeline{font-family:'Arvo',serif;}#timeline .twitter,#timeline .messege,#timeline .credit,#timeline .caption,#timeline h1.date,#timeline h2.date,#timeline h3.date,#timeline h4.date,#timeline h5.date,#timeline h6.date,#timeline .era h3,#timeline .flag-content h3,#timeline .flag-content h4,#timeline .time-interval div,#timeline .time-interval-major div,#timeline .zoom-in,#timeline .zoom-out,#timeline .back-home{font-family:'PT Sans',sans-serif;}
#timeline p,#timeline blockquote,#timeline .twitter blockquote p{font-family:'Arvo',serif;}

2
font/Font.Merriweather.NewsCycle.css

@ -0,0 +1,2 @@
#timeline{font-family:'Merriweather',serif;}#timeline .twitter,#timeline .messege,#timeline .credit,#timeline .caption,#timeline h1.date,#timeline h2.date,#timeline h3.date,#timeline h4.date,#timeline h5.date,#timeline h6.date,#timeline .era h3,#timeline .flag-content h3,#timeline .flag-content h4,#timeline .time-interval div,#timeline .time-interval-major div,#timeline .zoom-in,#timeline .zoom-out,#timeline .back-home{font-family:'News Cycle',sans-serif;}
#timeline p,#timeline blockquote,#timeline .twitter blockquote p{font-family:'Merriweather',serif;}

2
font/Font.PoiretOne.Molengo.css

@ -0,0 +1,2 @@
#timeline{font-family:'Poiret One',serif;}#timeline .twitter,#timeline .messege,#timeline .credit,#timeline .caption,#timeline h1.date,#timeline h2.date,#timeline h3.date,#timeline h4.date,#timeline h5.date,#timeline h6.date,#timeline .era h3,#timeline .flag-content h3,#timeline .flag-content h4,#timeline .time-interval div,#timeline .time-interval-major div,#timeline .zoom-in,#timeline .zoom-out,#timeline .back-home{font-family:'Molengo',sans-serif;}
#timeline p,#timeline blockquote,#timeline .twitter blockquote p{font-family:'Poiret One',serif;}

54
source/js/timeline-embed.js

@ -45,6 +45,8 @@
*/
(function() {
/* CONFIG Default
@ -53,6 +55,7 @@
width: 800,
height: 600,
source: 'taylor/data.json',
font: 'default',
css: 'http://veritetimeline.appspot.com/latest/timeline.css',
js: 'http://veritetimeline.appspot.com/latest/timeline-min.js'
}
@ -79,6 +82,10 @@
================================================== */
var jsReady = false;
var cssReady = false;
var fontCSSReady = false;
var fontJSReady = false;
var font_css_url = "http://veritetimeline.appspot.com/latest/font/"
var font_js_url = "http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js";
var isReady = false;
var preload_checks = 0;
var timeout;
@ -109,6 +116,41 @@
================================================== */
LazyLoad.css(embed_config.css, cssComplete);
/* Load Font
================================================== */
if (embed_config.font != "default") {
fontJSReady = true;
fontCSSReady = true;
} else {
/* Load Font CSS
================================================== */
if (embed_config.font.match("http://")) {
font_css_url = embed_config.font;
} else {
font_css_url = font_css_url + embed_config.font + ".css";
}
LazyLoad.css(font_css_url, fontCSSComplete);
/* Load Font JS
================================================== */
WebFontConfig = {
google: { families: [ 'News+Cycle:400,700:latin', 'Merriweather:400,700,900:latin' ] }
};
LazyLoad.js(font_js_url, onFontJSLoaded);
}
/* Check for jQuery
================================================== */
try {
@ -141,6 +183,16 @@
checkLoad();
}
function fontCSSComplete() {
fontCSSReady = true;
checkLoad();
}
function onFontJSLoaded() {
fontJSReady = true;
checkLoad();
}
/* Check to see if everything is loaded.
================================================== */
function checkLoad() {
@ -150,7 +202,7 @@
} else {
preload_checks++;
if (jsReady && cssReady) {
if (jsReady && cssReady && fontCSSReady && fontJSReady) {
if (!isReady) {
isReady = true;
timeline = new VMM.Timeline();

26
source/less/Font.Arvo.PTSans.less

@ -4,7 +4,27 @@
http://www.google.com/webfonts#UsePlace:use/Collection:News+Cycle:400,700|Merriweather:400,700,900
------------------------------------------------------------------------------------------- */
@import url(http://fonts.googleapis.com/css?family=Arvo:400,700,400italic|PT+Sans:400,700);
//@import url(http://fonts.googleapis.com/css?family=Arvo:400,700,400italic|PT+Sans:400,700);
@font-serif: 'Arvo', serif;
@font-sansserif: 'PT Sans', sans-serif;
@font-serif: 'Arvo', serif;
@font-sansserif: 'PT Sans', sans-serif;
#timeline {
font-family: @font-serif;
.twitter, .messege, .credit, .caption,
h1.date, h2.date, h3.date, h4.date, h5.date, h6.date,
.era h3, .flag-content h3, .flag-content h4,
.time-interval div, .time-interval-major div,
.zoom-in, .zoom-out, .back-home {
font-family: @font-sansserif;
}
p, blockquote, .twitter blockquote p {
font-family: @font-serif;
}
}

18
source/less/Font.Default.less

@ -3,19 +3,27 @@
Default
------------------------------------------------------------------------------------------- */
@font-sansserif: "Helvetica Neue", Helvetica, Arial, sans-serif;
@font-serif: "Georgia", Times New Roman, Times, serif;
//@font-serif: 'Merriweather', serif;
//@font-sansserif: 'News Cycle', sans-serif;
@font-sansserif: "Helvetica Neue", Helvetica, Arial, sans-serif;
@font-serif: "Georgia", Times New Roman, Times, serif;
#timeline {
font-family: @font-serif;
.twitter, .messege, .credit, .caption, h1.date, h2.date, h3.date, h4.date, h5.date, h6.date {
.twitter, .messege, .credit, .caption,
h1.date, h2.date, h3.date, h4.date, h5.date, h6.date,
.era h3, .flag-content h3, .flag-content h4,
.time-interval div, .time-interval-major div,
.zoom-in, .zoom-out, .back-home {
font-family: @font-sansserif;
}
p, blockquote, .twitter blockquote p {
font-family: @font-serif;
}
}

26
source/less/Font.Merriweather.NewsCycle.less

@ -4,7 +4,27 @@
http://www.google.com/webfonts#UsePlace:use/Collection:News+Cycle:400,700|Merriweather:400,700,900
------------------------------------------------------------------------------------------- */
@import url(http://fonts.googleapis.com/css?family=News+Cycle:400,700|Merriweather:400,700,900);
//@import url(http://fonts.googleapis.com/css?family=News+Cycle:400,700|Merriweather:400,700,900);
@font-serif: 'Merriweather', serif;
@font-sansserif: 'News Cycle', sans-serif;
@font-serif: 'Merriweather', serif;
@font-sansserif: 'News Cycle', sans-serif;
#timeline {
font-family: @font-serif;
.twitter, .messege, .credit, .caption,
h1.date, h2.date, h3.date, h4.date, h5.date, h6.date,
.era h3, .flag-content h3, .flag-content h4,
.time-interval div, .time-interval-major div,
.zoom-in, .zoom-out, .back-home {
font-family: @font-sansserif;
}
p, blockquote, .twitter blockquote p {
font-family: @font-serif;
}
}

26
source/less/Font.PoiretOne.Molengo.less

@ -4,7 +4,27 @@
http://www.google.com/webfonts#UsePlace:use/Collection:News+Cycle:400,700|Merriweather:400,700,900
------------------------------------------------------------------------------------------- */
@import url(http://fonts.googleapis.com/css?family=Poiret+One|Molengo);
//@import url(http://fonts.googleapis.com/css?family=Poiret+One|Molengo);
@font-serif: 'Poiret One', serif;
@font-sansserif: 'Molengo', sans-serif;
@font-serif: 'Poiret One', serif;
@font-sansserif: 'Molengo', sans-serif;
#timeline {
font-family: @font-serif;
.twitter, .messege, .credit, .caption,
h1.date, h2.date, h3.date, h4.date, h5.date, h6.date,
.era h3, .flag-content h3, .flag-content h4,
.time-interval div, .time-interval-major div,
.zoom-in, .zoom-out, .back-home {
font-family: @font-sansserif;
}
p, blockquote, .twitter blockquote p {
font-family: @font-serif;
}
}

46
source/less/VMM.Timeline.TimeNav.less

@ -31,8 +31,14 @@
//.box-shadow();
.box-shadow(1px 1px 0px rgba(0,0,0,.20));
.zoom-in, .zoom-out, .back-home {
#font > .navigation(normal,10px);
font-weight: normal;
font-size: 10px;
line-height: 20px;
//line-height:5px;
//position:absolute;
//display:inline-block;
@ -263,14 +269,18 @@
//border: 1px solid @color-line;
//.border-radius(5px);
//.box-shadow(0px 1px 0px @color-line);
.flag-content {
padding: 5px 7px 2px 5px;
overflow:hidden;
height:33px;
h3 {
#font > .navigation(bold,@base-font,@base-line);
//font-weight: bold;
font-weight: bold;
font-size: @base-font;
line-height: @base-line;
font-size: 11px;
line-height:11px;
//color:@color-nav-date;
@ -282,7 +292,12 @@
}
h4 {
display:none;
#font > .navigation(normal,@base-font,@base-line);
font-weight: normal;
font-size: @base-font;
line-height: @base-line;
font-size: 10px;
line-height:10px;
//color:@color-nav-title;
@ -364,7 +379,11 @@
z-index:-10;
h3 {
#font > .navigation(bold,10px,10px);
font-weight: bold;
font-size: 10px;
line-height: 10px;
color:@white;
position:absolute;
top:-1px;
@ -375,6 +394,7 @@
}
.time {
position:absolute;
left:0px;
@ -410,6 +430,7 @@
}
.time-interval {
white-space:nowrap;
position:absolute;
@ -427,7 +448,12 @@
left:0px;
display:block;
//width:150px;
#font > .navigation(normal,10px,@base-line);
font-weight: normal;
font-size: 10px;
line-height: @base-line;
text-transform: uppercase;
text-align:left;
text-indent: 0px;
@ -446,6 +472,7 @@
}
.time-interval-major {
white-space:nowrap;
position:absolute;
@ -463,7 +490,12 @@
left:0px;
display:block;
//width:150px;
#font > .navigation(bold,12px,@base-line);
font-weight: bold;
font-size: 12px;
line-height: @base-line;
text-transform: uppercase;
text-align:left;
text-indent: 0px;

28
timeline-dark.css

@ -182,7 +182,15 @@
#timeline h3.date,
#timeline h4.date,
#timeline h5.date,
#timeline h6.date {
#timeline h6.date,
#timeline .era h3,
#timeline .flag-content h3,
#timeline .flag-content h4,
#timeline .time-interval div,
#timeline .time-interval-major div,
#timeline .zoom-in,
#timeline .zoom-out,
#timeline .back-home {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
#timeline p,
@ -784,9 +792,8 @@
#timeline .navigation .toolbar .zoom-in,
#timeline .navigation .toolbar .zoom-out,
#timeline .navigation .toolbar .back-home {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 10px;
font-weight: normal;
font-size: 10px;
line-height: 20px;
top: 0px;
z-index: 202;
@ -999,9 +1006,8 @@
height: 33px;
}
#timeline .navigation .timenav .content .marker .flag .flag-content h3 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 15px;
font-weight: bold;
font-size: 15px;
line-height: 20px;
font-size: 11px;
line-height: 11px;
@ -1013,9 +1019,8 @@
}
#timeline .navigation .timenav .content .marker .flag .flag-content h4 {
display: none;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 15px;
font-weight: normal;
font-size: 15px;
line-height: 20px;
font-size: 10px;
line-height: 10px;
@ -1080,9 +1085,8 @@
z-index: -10;
}
#timeline .navigation .timenav .content .era h3 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 10px;
font-weight: bold;
font-size: 10px;
line-height: 10px;
color: #ffffff;
position: absolute;
@ -1133,9 +1137,8 @@
height: 3px;
left: 0px;
display: block;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 10px;
font-weight: normal;
font-size: 10px;
line-height: 20px;
text-transform: uppercase;
text-align: left;
@ -1166,9 +1169,8 @@
height: 15px;
left: 0px;
display: block;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px;
font-weight: bold;
font-size: 12px;
line-height: 20px;
text-transform: uppercase;
text-align: left;

2
timeline-embed.js

@ -33,4 +33,4 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@class LazyLoad
@static
@version 2.0.3 (git)
*/LazyLoad=function(a){function h(b,c){var d=a.createElement(b),e;for(e in c)c.hasOwnProperty(e)&&d.setAttribute(e,c[e]);return d}function i(a){var b=d[a],c,g;if(b){c=b.callback;g=b.urls;g.shift();e=0;if(!g.length){c&&c.call(b.context,b.obj);d[a]=null;f[a].length&&k(a)}}}function j(){var c=navigator.userAgent;b={async:a.createElement("script").async===!0};(b.webkit=/AppleWebKit\//.test(c))||(b.ie=/MSIE/.test(c))||(b.opera=/Opera/.test(c))||(b.gecko=/Gecko\//.test(c))||(b.unknown=!0)}function k(e,g,k,n,o){var p=function(){i(e)},q=e==="css",r=[],s,t,u,v,w,x;b||j();if(g){g=typeof g=="string"?[g]:g.concat();if(q||b.async||b.gecko||b.opera)f[e].push({urls:g,callback:k,obj:n,context:o});else for(s=0,t=g.length;s<t;++s)f[e].push({urls:[g[s]],callback:s===t-1?k:null,obj:n,context:o})}if(d[e]||!(v=d[e]=f[e].shift()))return;c||(c=a.head||a.getElementsByTagName("head")[0]);w=v.urls;for(s=0,t=w.length;s<t;++s){x=w[s];if(q)u=b.gecko?h("style"):h("link",{href:x,rel:"stylesheet"});else{u=h("script",{src:x});u.async=!1}u.className="lazyload";u.setAttribute("charset","utf-8");if(b.ie&&!q)u.onreadystatechange=function(){if(/loaded|complete/.test(u.readyState)){u.onreadystatechange=null;p()}};else if(q&&(b.gecko||b.webkit))if(b.webkit){v.urls[s]=u.href;m()}else{u.innerHTML='@import "'+x+'";';l(u)}else u.onload=u.onerror=p;r.push(u)}for(s=0,t=r.length;s<t;++s)c.appendChild(r[s])}function l(a){var b;try{b=!!a.sheet.cssRules}catch(c){e+=1;e<200?setTimeout(function(){l(a)},50):b&&i("css");return}i("css")}function m(){var a=d.css,b;if(a){b=g.length;while(--b>=0)if(g[b].href===a.urls[0]){i("css");break}e+=1;a&&(e<200?setTimeout(m,50):i("css"))}}var b,c,d={},e=0,f={css:[],js:[]},g=a.styleSheets;return{css:function(a,b,c,d){k("css",a,b,c,d)},js:function(a,b,c,d){k("js",a,b,c,d)}}}(this.document);(function(){function m(){LazyLoad.js(a.js,n)}function n(){c=!0;p()}function o(){d=!0;p()}function p(){if(f>40)return;f++;if(c&&d){if(!e){e=!0;h=new VMM.Timeline;h.init(a.source)}}else g=setTimeout("checkAgain();",250)}var a={width:800,height:600,source:"taylor/data.json",css:"http://veritetimeline.appspot.com/latest/timeline.css",js:"http://veritetimeline.appspot.com/latest/timeline-min.js"};if(typeof timeline_config=="object"){var b;for(b in timeline_config)Object.prototype.hasOwnProperty.call(timeline_config,b)&&(a[b]=timeline_config[b])}else if(typeof config=="object"){var b;for(b in config)Object.prototype.hasOwnProperty.call(config,b)&&(a[b]=config[b])}timeline_config=a;var c=!1,d=!1,e=!1,f=0,g,h,i=document.createElement("div"),j=document.getElementById("timeline-embed");j.appendChild(i);i.setAttribute("id","timeline");a.width.toString().match("%")||a.width.toString().match("px")?j.style.width=a.width:j.style.width=a.width+"px";a.height.toString().match("%")||a.height.toString().match("px")?j.style.height=a.height:j.style.height=a.height+"px";i.style.position="relative";LazyLoad.css(a.css,o);try{var k=jQuery;k=!0}catch(l){var k=!1}k?m():LazyLoad.js("http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js",m);this.checkAgain=function(){p()}})();
*/LazyLoad=function(a){function h(b,c){var d=a.createElement(b),e;for(e in c)c.hasOwnProperty(e)&&d.setAttribute(e,c[e]);return d}function i(a){var b=d[a],c,g;if(b){c=b.callback;g=b.urls;g.shift();e=0;if(!g.length){c&&c.call(b.context,b.obj);d[a]=null;f[a].length&&k(a)}}}function j(){var c=navigator.userAgent;b={async:a.createElement("script").async===!0};(b.webkit=/AppleWebKit\//.test(c))||(b.ie=/MSIE/.test(c))||(b.opera=/Opera/.test(c))||(b.gecko=/Gecko\//.test(c))||(b.unknown=!0)}function k(e,g,k,n,o){var p=function(){i(e)},q=e==="css",r=[],s,t,u,v,w,x;b||j();if(g){g=typeof g=="string"?[g]:g.concat();if(q||b.async||b.gecko||b.opera)f[e].push({urls:g,callback:k,obj:n,context:o});else for(s=0,t=g.length;s<t;++s)f[e].push({urls:[g[s]],callback:s===t-1?k:null,obj:n,context:o})}if(d[e]||!(v=d[e]=f[e].shift()))return;c||(c=a.head||a.getElementsByTagName("head")[0]);w=v.urls;for(s=0,t=w.length;s<t;++s){x=w[s];if(q)u=b.gecko?h("style"):h("link",{href:x,rel:"stylesheet"});else{u=h("script",{src:x});u.async=!1}u.className="lazyload";u.setAttribute("charset","utf-8");if(b.ie&&!q)u.onreadystatechange=function(){if(/loaded|complete/.test(u.readyState)){u.onreadystatechange=null;p()}};else if(q&&(b.gecko||b.webkit))if(b.webkit){v.urls[s]=u.href;m()}else{u.innerHTML='@import "'+x+'";';l(u)}else u.onload=u.onerror=p;r.push(u)}for(s=0,t=r.length;s<t;++s)c.appendChild(r[s])}function l(a){var b;try{b=!!a.sheet.cssRules}catch(c){e+=1;e<200?setTimeout(function(){l(a)},50):b&&i("css");return}i("css")}function m(){var a=d.css,b;if(a){b=g.length;while(--b>=0)if(g[b].href===a.urls[0]){i("css");break}e+=1;a&&(e<200?setTimeout(m,50):i("css"))}}var b,c,d={},e=0,f={css:[],js:[]},g=a.styleSheets;return{css:function(a,b,c,d){k("css",a,b,c,d)},js:function(a,b,c,d){k("js",a,b,c,d)}}}(this.document);(function(){function q(){LazyLoad.js(a.js,r)}function r(){c=!0;v()}function s(){d=!0;v()}function t(){e=!0;v()}function u(){f=!0;v()}function v(){if(j>40)return;j++;if(c&&d&&e&&f){if(!i){i=!0;l=new VMM.Timeline;l.init(a.source)}}else k=setTimeout("checkAgain();",250)}var a={width:800,height:600,source:"taylor/data.json",font:"default",css:"http://veritetimeline.appspot.com/latest/timeline.css",js:"http://veritetimeline.appspot.com/latest/timeline-min.js"};if(typeof timeline_config=="object"){var b;for(b in timeline_config)Object.prototype.hasOwnProperty.call(timeline_config,b)&&(a[b]=timeline_config[b])}else if(typeof config=="object"){var b;for(b in config)Object.prototype.hasOwnProperty.call(config,b)&&(a[b]=config[b])}timeline_config=a;var c=!1,d=!1,e=!1,f=!1,g="http://veritetimeline.appspot.com/latest/font/",h="http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js",i=!1,j=0,k,l,m=document.createElement("div"),n=document.getElementById("timeline-embed");n.appendChild(m);m.setAttribute("id","timeline");a.width.toString().match("%")||a.width.toString().match("px")?n.style.width=a.width:n.style.width=a.width+"px";a.height.toString().match("%")||a.height.toString().match("px")?n.style.height=a.height:n.style.height=a.height+"px";m.style.position="relative";LazyLoad.css(a.css,s);if(a.font!="default"){f=!0;e=!0}else{a.font.match("http://")?g=a.font:g=g+a.font+".css";LazyLoad.css(g,t);WebFontConfig={google:{families:["News+Cycle:400,700:latin","Merriweather:400,700,900:latin"]}};LazyLoad.js(h,u)}try{var o=jQuery;o=!0}catch(p){var o=!1}o?q():LazyLoad.js("http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js",q);this.checkAgain=function(){v()}})();

1491
timeline.css

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save