From f208307cbdd403d3fa92a1aae1dc9c094c7ec9d8 Mon Sep 17 00:00:00 2001
From: Eric Bidelman
Date: Wed, 11 Jul 2012 10:43:37 -0700
Subject: Bringing in upstream changes
---
README.html | 10 +-
README.md | 8 +-
app.yaml | 23 ++
images/google_developers_logo_tiny.png | Bin 0 -> 3749 bytes
js/order.js | 8 +
js/polyfills/bind.js | 3 -
js/polyfills/matchMedia.js | 30 ---
js/require-1.0.8.min.js | 33 +++
js/slide-controller.js | 2 +-
js/slide-deck.js | 116 +++++++--
js/slides.js | 20 +-
scripts/md/README.md | 5 +
scripts/md/base.html | 66 +++++
scripts/md/render.py | 53 ++++
scripts/md/slides.md | 64 +++++
serve.sh | 9 +-
slide_config.js | 36 +++
slide_config.json | 34 ---
template.html | 19 +-
theme/.base.css.swp | Bin 45056 -> 0 bytes
theme/.default.css.swp | Bin 45056 -> 0 bytes
theme/css/default.css | 449 +++++++++++++++++++++------------
theme/scss/_base.scss | 5 +-
theme/scss/default.scss | 150 ++++++++++-
24 files changed, 853 insertions(+), 290 deletions(-)
create mode 100644 app.yaml
create mode 100644 images/google_developers_logo_tiny.png
create mode 100644 js/order.js
delete mode 100644 js/polyfills/bind.js
delete mode 100644 js/polyfills/matchMedia.js
create mode 100644 js/require-1.0.8.min.js
create mode 100644 scripts/md/README.md
create mode 100644 scripts/md/base.html
create mode 100755 scripts/md/render.py
create mode 100644 scripts/md/slides.md
create mode 100644 slide_config.js
delete mode 100644 slide_config.json
delete mode 100644 theme/.base.css.swp
delete mode 100644 theme/.default.css.swp
diff --git a/README.html b/README.html
index 690a90d..20276de 100644
--- a/README.html
+++ b/README.html
@@ -49,13 +49,13 @@ pre {
HTML5 Slide Template
Configuring the slides
-Much of the deck is customized by changing the settings in slide_config.json
.
+
Much of the deck is customized by changing the settings in slide_config.js
.
Some of the customizations include the title, Analytics tracking ID, speaker
information (name, social urls, blog), web fonts to load, themes, and other
general behavior.
-Customizing the #io2012
hash
-The bottom of the slides include #io2012
by default. If you'd like to change
-this, please update the variable $social-tags: '#io2012';
in
+
Customizing the #io12
hash
+The bottom of the slides include #io12
by default. If you'd like to change
+this, please update the variable $social-tags: '#io12';
in
/theme/scss/default.scss
.
See the next section on "Editing CSS" before you go editing things.
Editing CSS
@@ -102,4 +102,4 @@ from a popup window.
To disable presenter mode, hit http://localhost:8000/template.html?presentme=false
Presenter mode is sticky, so refreshing the page will persist your settings.
-That's all she wrote!
\ No newline at end of file
+That's all she wrote!
diff --git a/README.md b/README.md
index 34777da..1ba5391 100644
--- a/README.md
+++ b/README.md
@@ -50,15 +50,15 @@ pre {
## Configuring the slides
-Much of the deck is customized by changing the settings in [`slide_config.json`](slide_config.json).
+Much of the deck is customized by changing the settings in [`slide_config.js`](slide_config.js).
Some of the customizations include the title, Analytics tracking ID, speaker
information (name, social urls, blog), web fonts to load, themes, and other
general behavior.
-### Customizing the `#io2012` hash
+### Customizing the `#io12` hash
-The bottom of the slides include `#io2012` by default. If you'd like to change
-this, please update the variable `$social-tags: '#io2012';` in
+The bottom of the slides include `#io12` by default. If you'd like to change
+this, please update the variable `$social-tags: '#io12';` in
[`/theme/scss/default.scss`](theme/scss/default.scss).
See the next section on "Editing CSS" before you go editing things.
diff --git a/app.yaml b/app.yaml
new file mode 100644
index 0000000..7692ab2
--- /dev/null
+++ b/app.yaml
@@ -0,0 +1,23 @@
+application: my-io-talk
+version: 1
+runtime: python27
+api_version: 1
+threadsafe: yes
+
+handlers:
+- url: /
+ static_files: template.html
+ upload: template\.html
+
+- url: /slide_config\.js
+ static_files: slide_config.js
+ upload: slide_config\.js
+
+- url: /js
+ static_dir: js
+
+- url: /theme
+ static_dir: theme
+
+- url: /images
+ static_dir: images
diff --git a/images/google_developers_logo_tiny.png b/images/google_developers_logo_tiny.png
new file mode 100644
index 0000000..6e607e4
Binary files /dev/null and b/images/google_developers_logo_tiny.png differ
diff --git a/js/order.js b/js/order.js
new file mode 100644
index 0000000..e78c183
--- /dev/null
+++ b/js/order.js
@@ -0,0 +1,8 @@
+/*
+ RequireJS order 1.0.5 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ Available via the MIT or new BSD license.
+ see: http://github.com/jrburke/requirejs for details
+*/
+(function(){function k(a){var b=a.currentTarget||a.srcElement,c;if(a.type==="load"||l.test(b.readyState)){a=b.getAttribute("data-requiremodule");j[a]=!0;for(a=0;c=g[a];a++)if(j[c.name])c.req([c.name],c.onLoad);else break;a>0&&g.splice(0,a);setTimeout(function(){b.parentNode.removeChild(b)},15)}}function m(a){var b,c;a.setAttribute("data-orderloaded","loaded");for(a=0;c=h[a];a++)if((b=i[c])&&b.getAttribute("data-orderloaded")==="loaded")delete i[c],require.addScriptToDom(b);else break;a>0&&h.splice(0,
+a)}var f=typeof document!=="undefined"&&typeof window!=="undefined"&&document.createElement("script"),n=f&&(f.async||window.opera&&Object.prototype.toString.call(window.opera)==="[object Opera]"||"MozAppearance"in document.documentElement.style),o=f&&f.readyState==="uninitialized",l=/^(complete|loaded)$/,g=[],j={},i={},h=[],f=null;define({version:"1.0.5",load:function(a,b,c,e){var d;b.nameToUrl?(d=b.nameToUrl(a,null),require.s.skipAsync[d]=!0,n||e.isBuild?b([a],c):o?(e=require.s.contexts._,!e.urlFetched[d]&&
+!e.loaded[a]&&(e.urlFetched[d]=!0,require.resourcesReady(!1),e.scriptCount+=1,d=require.attach(d,e,a,null,null,m),i[a]=d,h.push(a)),b([a],c)):b.specified(a)?b([a],c):(g.push({name:a,req:b,onLoad:c}),require.attach(d,null,a,k,"script/cache"))):b([a],c)}})})();
diff --git a/js/polyfills/bind.js b/js/polyfills/bind.js
deleted file mode 100644
index fe6bc0d..0000000
--- a/js/polyfills/bind.js
+++ /dev/null
@@ -1,3 +0,0 @@
-// Function.bind polyfill for Safari < 5.1.4 and iOS.
-// From https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind
-Function.prototype.bind||(Function.prototype.bind=function(c){if("function"!==typeof this)throw new TypeError("Function.prototype.bind - binding an object that is not callable");var d=Array.prototype.slice.call(arguments,1),e=this,a=function(){},b=function(){return e.apply(this instanceof a?this:c||window,d.concat(Array.prototype.slice.call(arguments)))};a.prototype=this.prototype;b.prototype=new a;return b});
diff --git a/js/polyfills/matchMedia.js b/js/polyfills/matchMedia.js
deleted file mode 100644
index 6d4d17c..0000000
--- a/js/polyfills/matchMedia.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
-
-window.matchMedia = window.matchMedia || (function(doc, undefined){
-
- var bool,
- docElem = doc.documentElement,
- refNode = docElem.firstElementChild || docElem.firstChild,
- // fakeBody required for
- fakeBody = doc.createElement('body'),
- div = doc.createElement('div');
-
- div.id = 'mq-test-1';
- div.style.cssText = "position:absolute;top:-100em";
- fakeBody.style.background = "none";
- fakeBody.appendChild(div);
-
- return function(q){
-
- div.innerHTML = '';
-
- docElem.insertBefore(fakeBody, refNode);
- bool = div.offsetWidth == 42;
- docElem.removeChild(fakeBody);
-
- return { matches: bool, media: q };
- };
-
-})(document);
-
-
diff --git a/js/require-1.0.8.min.js b/js/require-1.0.8.min.js
new file mode 100644
index 0000000..162cd9a
--- /dev/null
+++ b/js/require-1.0.8.min.js
@@ -0,0 +1,33 @@
+/*
+ RequireJS 1.0.8 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ Available via the MIT or new BSD license.
+ see: http://github.com/jrburke/requirejs for details
+*/
+var requirejs,require,define;
+(function(r){function K(a){return O.call(a)==="[object Function]"}function G(a){return O.call(a)==="[object Array]"}function $(a,c,l){for(var j in c)if(!(j in L)&&(!(j in a)||l))a[j]=c[j];return d}function P(a,c,d){a=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+a);if(d)a.originalError=d;return a}function aa(a,c,d){var j,k,t;for(j=0;t=c[j];j++){t=typeof t==="string"?{name:t}:t;k=t.location;if(d&&(!k||k.indexOf("/")!==0&&k.indexOf(":")===-1))k=d+"/"+(k||t.name);a[t.name]={name:t.name,location:k||
+t.name,main:(t.main||"main").replace(fa,"").replace(ba,"")}}}function V(a,c){a.holdReady?a.holdReady(c):c?a.readyWait+=1:a.ready(!0)}function ga(a){function c(b,f){var g,m;if(b&&b.charAt(0)===".")if(f){q.pkgs[f]?f=[f]:(f=f.split("/"),f=f.slice(0,f.length-1));g=b=f.concat(b.split("/"));var a;for(m=0;a=g[m];m++)if(a===".")g.splice(m,1),m-=1;else if(a==="..")if(m===1&&(g[2]===".."||g[0]===".."))break;else m>0&&(g.splice(m-1,2),m-=2);m=q.pkgs[g=b[0]];b=b.join("/");m&&b===g+"/"+m.main&&(b=g)}else b.indexOf("./")===
+0&&(b=b.substring(2));return b}function l(b,f){var g=b?b.indexOf("!"):-1,m=null,a=f?f.name:null,h=b,e,d;g!==-1&&(m=b.substring(0,g),b=b.substring(g+1,b.length));m&&(m=c(m,a));b&&(m?e=(g=n[m])&&g.normalize?g.normalize(b,function(b){return c(b,a)}):c(b,a):(e=c(b,a),d=G[e],d||(d=i.nameToUrl(b,null,f),G[e]=d)));return{prefix:m,name:e,parentMap:f,url:d,originalName:h,fullName:m?m+"!"+(e||""):e}}function j(){var b=!0,f=q.priorityWait,g,a;if(f){for(a=0;g=f[a];a++)if(!s[g]){b=!1;break}b&&delete q.priorityWait}return b}
+function k(b,f,g){return function(){var a=ha.call(arguments,0),c;if(g&&K(c=a[a.length-1]))c.__requireJsBuild=!0;a.push(f);return b.apply(null,a)}}function t(b,f,g){f=k(g||i.require,b,f);$(f,{nameToUrl:k(i.nameToUrl,b),toUrl:k(i.toUrl,b),defined:k(i.requireDefined,b),specified:k(i.requireSpecified,b),isBrowser:d.isBrowser});return f}function p(b){var f,g,a,c=b.callback,h=b.map,e=h.fullName,ca=b.deps;a=b.listeners;var j=q.requireExecCb||d.execCb;if(c&&K(c)){if(q.catchError.define)try{g=j(e,b.callback,
+ca,n[e])}catch(k){f=k}else g=j(e,b.callback,ca,n[e]);if(e)(c=b.cjsModule)&&c.exports!==r&&c.exports!==n[e]?g=n[e]=b.cjsModule.exports:g===r&&b.usingExports?g=n[e]:(n[e]=g,H[e]&&(T[e]=!0))}else e&&(g=n[e]=c,H[e]&&(T[e]=!0));if(x[b.id])delete x[b.id],b.isDone=!0,i.waitCount-=1,i.waitCount===0&&(J=[]);delete M[e];if(d.onResourceLoad&&!b.placeholder)d.onResourceLoad(i,h,b.depArray);if(f)return g=(e?l(e).url:"")||f.fileName||f.sourceURL,a=f.moduleTree,f=P("defineerror",'Error evaluating module "'+e+'" at location "'+
+g+'":\n'+f+"\nfileName:"+g+"\nlineNumber: "+(f.lineNumber||f.line),f),f.moduleName=e,f.moduleTree=a,d.onError(f);for(f=0;c=a[f];f++)c(g);return r}function u(b,f){return function(g){b.depDone[f]||(b.depDone[f]=!0,b.deps[f]=g,b.depCount-=1,b.depCount||p(b))}}function o(b,f){var g=f.map,a=g.fullName,c=g.name,h=N[b]||(N[b]=n[b]),e;if(!f.loading)f.loading=!0,e=function(b){f.callback=function(){return b};p(f);s[f.id]=!0;A()},e.fromText=function(b,f){var g=Q;s[b]=!1;i.scriptCount+=1;i.fake[b]=!0;g&&(Q=!1);
+d.exec(f);g&&(Q=!0);i.completeLoad(b)},a in n?e(n[a]):h.load(c,t(g.parentMap,!0,function(b,a){var c=[],e,m;for(e=0;m=b[e];e++)m=l(m,g.parentMap),b[e]=m.fullName,m.prefix||c.push(b[e]);f.moduleDeps=(f.moduleDeps||[]).concat(c);return i.require(b,a)}),e,q)}function y(b){x[b.id]||(x[b.id]=b,J.push(b),i.waitCount+=1)}function D(b){this.listeners.push(b)}function v(b,f){var g=b.fullName,a=b.prefix,c=a?N[a]||(N[a]=n[a]):null,h,e;g&&(h=M[g]);if(!h&&(e=!0,h={id:(a&&!c?O++ +"__p@:":"")+(g||"__r@"+O++),map:b,
+depCount:0,depDone:[],depCallbacks:[],deps:[],listeners:[],add:D},B[h.id]=!0,g&&(!a||N[a])))M[g]=h;a&&!c?(g=l(a),a in n&&!n[a]&&(delete n[a],delete R[g.url]),a=v(g,!0),a.add(function(){var f=l(b.originalName,b.parentMap),f=v(f,!0);h.placeholder=!0;f.add(function(b){h.callback=function(){return b};p(h)})})):e&&f&&(s[h.id]=!1,i.paused.push(h),y(h));return h}function C(b,f,a,c){var b=l(b,c),d=b.name,h=b.fullName,e=v(b),j=e.id,k=e.deps,o;if(h){if(h in n||s[j]===!0||h==="jquery"&&q.jQuery&&q.jQuery!==
+a().fn.jquery)return;B[j]=!0;s[j]=!0;h==="jquery"&&a&&W(a())}e.depArray=f;e.callback=a;for(a=0;a0)return r;if(q.priorityWait)if(j())A();else return r;for(h in s)if(!(h in L)&&(c=!0,!s[h]))if(b)a+=h+" ";else if(l=!0,h.indexOf("!")===-1){k=[];break}else(e=M[h]&&M[h].moduleDeps)&&k.push.apply(k,e);if(!c&&!i.waitCount)return r;if(b&&a)return b=P("timeout","Load timeout for modules: "+a),b.requireType="timeout",b.requireModules=a,b.contextName=i.contextName,d.onError(b);
+if(l&&k.length)for(a=0;h=x[k[a]];a++)if(h=F(h,{})){z(h,{});break}if(!b&&(l||i.scriptCount)){if((I||da)&&!X)X=setTimeout(function(){X=0;E()},50);return r}if(i.waitCount){for(a=0;h=J[a];a++)z(h,{});i.paused.length&&A();Y<5&&(Y+=1,E())}Y=0;d.checkReadyState();return r}var i,A,q={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},catchError:{}},S=[],B={require:!0,exports:!0,module:!0},G={},n={},s={},x={},J=[],R={},O=0,M={},N={},H={},T={},Z=0;W=function(b){if(!i.jQuery&&(b=b||(typeof jQuery!=="undefined"?jQuery:
+null))&&!(q.jQuery&&b.fn.jquery!==q.jQuery)&&("holdReady"in b||"readyWait"in b))if(i.jQuery=b,w(["jquery",[],function(){return jQuery}]),i.scriptCount)V(b,!0),i.jQueryIncremented=!0};A=function(){var b,a,c,l,k,h;i.takeGlobalQueue();Z+=1;if(i.scriptCount<=0)i.scriptCount=0;for(;S.length;)if(b=S.shift(),b[0]===null)return d.onError(P("mismatch","Mismatched anonymous define() module: "+b[b.length-1]));else w(b);if(!q.priorityWait||j())for(;i.paused.length;){k=i.paused;i.pausedCount+=k.length;i.paused=
+[];for(l=0;b=k[l];l++)a=b.map,c=a.url,h=a.fullName,a.prefix?o(a.prefix,b):!R[c]&&!s[h]&&((q.requireLoad||d.load)(i,h,c),c.indexOf("empty:")!==0&&(R[c]=!0));i.startTime=(new Date).getTime();i.pausedCount-=k.length}Z===1&&E();Z-=1;return r};i={contextName:a,config:q,defQueue:S,waiting:x,waitCount:0,specified:B,loaded:s,urlMap:G,urlFetched:R,scriptCount:0,defined:n,paused:[],pausedCount:0,plugins:N,needFullExec:H,fake:{},fullExec:T,managerCallbacks:M,makeModuleMap:l,normalize:c,configure:function(b){var a,
+c,d;b.baseUrl&&b.baseUrl.charAt(b.baseUrl.length-1)!=="/"&&(b.baseUrl+="/");a=q.paths;d=q.pkgs;$(q,b,!0);if(b.paths){for(c in b.paths)c in L||(a[c]=b.paths[c]);q.paths=a}if((a=b.packagePaths)||b.packages){if(a)for(c in a)c in L||aa(d,a[c],c);b.packages&&aa(d,b.packages);q.pkgs=d}if(b.priority)c=i.requireWait,i.requireWait=!1,A(),i.require(b.priority),A(),i.requireWait=c,q.priorityWait=b.priority;if(b.deps||b.callback)i.require(b.deps||[],b.callback)},requireDefined:function(b,a){return l(b,a).fullName in
+n},requireSpecified:function(b,a){return l(b,a).fullName in B},require:function(b,c,g){if(typeof b==="string"){if(K(c))return d.onError(P("requireargs","Invalid require call"));if(d.get)return d.get(i,b,c);c=l(b,c);b=c.fullName;return!(b in n)?d.onError(P("notloaded","Module name '"+c.fullName+"' has not been loaded yet for context: "+a)):n[b]}(b&&b.length||c)&&C(null,b,c,g);if(!i.requireWait)for(;!i.scriptCount&&i.paused.length;)A();return i.require},takeGlobalQueue:function(){U.length&&(ja.apply(i.defQueue,
+[i.defQueue.length-1,0].concat(U)),U=[])},completeLoad:function(b){var a;for(i.takeGlobalQueue();S.length;)if(a=S.shift(),a[0]===null){a[0]=b;break}else if(a[0]===b)break;else w(a),a=null;a?w(a):w([b,[],b==="jquery"&&typeof jQuery!=="undefined"?function(){return jQuery}:null]);d.isAsync&&(i.scriptCount-=1);A();d.isAsync||(i.scriptCount-=1)},toUrl:function(b,a){var c=b.lastIndexOf("."),d=null;c!==-1&&(d=b.substring(c,b.length),b=b.substring(0,c));return i.nameToUrl(b,d,a)},nameToUrl:function(b,a,g){var l,
+k,h,e,j=i.config,b=c(b,g&&g.fullName);if(d.jsExtRegExp.test(b))a=b+(a?a:"");else{l=j.paths;k=j.pkgs;g=b.split("/");for(e=g.length;e>0;e--)if(h=g.slice(0,e).join("/"),l[h]){g.splice(0,e,l[h]);break}else if(h=k[h]){b=b===h.name?h.location+"/"+h.main:h.location;g.splice(0,e,b);break}a=g.join("/")+(a||".js");a=(a.charAt(0)==="/"||a.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+a}return j.urlArgs?a+((a.indexOf("?")===-1?"?":"&")+j.urlArgs):a}};i.jQueryCheck=W;i.resume=A;return i}function ka(){var a,c,d;if(C&&C.readyState===
+"interactive")return C;a=document.getElementsByTagName("script");for(c=a.length-1;c>-1&&(d=a[c]);c--)if(d.readyState==="interactive")return C=d;return null}var la=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ma=/require\(\s*["']([^'"\s]+)["']\s*\)/g,fa=/^\.\//,ba=/\.js$/,O=Object.prototype.toString,u=Array.prototype,ha=u.slice,ja=u.splice,I=!!(typeof window!=="undefined"&&navigator&&document),da=!I&&typeof importScripts!=="undefined",na=I&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,
+ea=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",L={},D={},U=[],C=null,Y=0,Q=!1,ia={require:!0,module:!0,exports:!0},d,u={},J,y,v,E,o,w,F,B,z,W,X;if(typeof define==="undefined"){if(typeof requirejs!=="undefined")if(K(requirejs))return;else u=requirejs,requirejs=r;typeof require!=="undefined"&&!K(require)&&(u=require,require=r);d=requirejs=function(a,c,d){var j="_",k;!G(a)&&typeof a!=="string"&&(k=a,G(c)?(a=c,c=d):a=[]);if(k&&k.context)j=k.context;d=D[j]||(D[j]=ga(j));k&&d.configure(k);
+return d.require(a,c)};d.config=function(a){return d(a)};require||(require=d);d.toUrl=function(a){return D._.toUrl(a)};d.version="1.0.8";d.jsExtRegExp=/^\/|:|\?|\.js$/;y=d.s={contexts:D,skipAsync:{}};if(d.isAsync=d.isBrowser=I)if(v=y.head=document.getElementsByTagName("head")[0],E=document.getElementsByTagName("base")[0])v=y.head=E.parentNode;d.onError=function(a){throw a;};d.load=function(a,c,l){d.resourcesReady(!1);a.scriptCount+=1;d.attach(l,a,c);if(a.jQuery&&!a.jQueryIncremented)V(a.jQuery,!0),
+a.jQueryIncremented=!0};define=function(a,c,d){var j,k;typeof a!=="string"&&(d=c,c=a,a=null);G(c)||(d=c,c=[]);!c.length&&K(d)&&d.length&&(d.toString().replace(la,"").replace(ma,function(a,d){c.push(d)}),c=(d.length===1?["require"]:["require","exports","module"]).concat(c));if(Q&&(j=J||ka()))a||(a=j.getAttribute("data-requiremodule")),k=D[j.getAttribute("data-requirecontext")];(k?k.defQueue:U).push([a,c,d]);return r};define.amd={multiversion:!0,plugins:!0,jQuery:!0};d.exec=function(a){return eval(a)};
+d.execCb=function(a,c,d,j){return c.apply(j,d)};d.addScriptToDom=function(a){J=a;E?v.insertBefore(a,E):v.appendChild(a);J=null};d.onScriptLoad=function(a){var c=a.currentTarget||a.srcElement,l;if(a.type==="load"||c&&na.test(c.readyState))C=null,a=c.getAttribute("data-requirecontext"),l=c.getAttribute("data-requiremodule"),D[a].completeLoad(l),c.detachEvent&&!ea?c.detachEvent("onreadystatechange",d.onScriptLoad):c.removeEventListener("load",d.onScriptLoad,!1)};d.attach=function(a,c,l,j,k,o){var p;
+if(I)return j=j||d.onScriptLoad,p=c&&c.config&&c.config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),p.type=k||c&&c.config.scriptType||"text/javascript",p.charset="utf-8",p.async=!y.skipAsync[a],c&&p.setAttribute("data-requirecontext",c.contextName),p.setAttribute("data-requiremodule",l),p.attachEvent&&!(p.attachEvent.toString&&p.attachEvent.toString().indexOf("[native code]")<0)&&!ea?(Q=!0,o?p.onreadystatechange=function(){if(p.readyState===
+"loaded")p.onreadystatechange=null,p.attachEvent("onreadystatechange",j),o(p)}:p.attachEvent("onreadystatechange",j)):p.addEventListener("load",j,!1),p.src=a,o||d.addScriptToDom(p),p;else da&&(importScripts(a),c.completeLoad(l));return null};if(I){o=document.getElementsByTagName("script");for(B=o.length-1;B>-1&&(w=o[B]);B--){if(!v)v=w.parentNode;if(F=w.getAttribute("data-main")){if(!u.baseUrl)o=F.split("/"),w=o.pop(),o=o.length?o.join("/")+"/":"./",u.baseUrl=o,F=w.replace(ba,"");u.deps=u.deps?u.deps.concat(F):
+[F];break}}}d.checkReadyState=function(){var a=y.contexts,c;for(c in a)if(!(c in L)&&a[c].waitCount)return;d.resourcesReady(!0)};d.resourcesReady=function(a){var c,l;d.resourcesDone=a;if(d.resourcesDone)for(l in a=y.contexts,a)if(!(l in L)&&(c=a[l],c.jQueryIncremented))V(c.jQuery,!1),c.jQueryIncremented=!1};d.pageLoaded=function(){if(document.readyState!=="complete")document.readyState="complete"};if(I&&document.addEventListener&&!document.readyState)document.readyState="loading",window.addEventListener("load",
+d.pageLoaded,!1);d(u);if(d.isAsync&&typeof setTimeout!=="undefined")z=y.contexts[u.context||"_"],z.requireWait=!0,setTimeout(function(){z.requireWait=!1;z.scriptCount||z.resume();d.checkReadyState()},0)}})();
diff --git a/js/slide-controller.js b/js/slide-controller.js
index 84388a9..571317b 100644
--- a/js/slide-controller.js
+++ b/js/slide-controller.js
@@ -72,7 +72,7 @@ SlideController.prototype.onMessage_ = function(e) {
// Restrict messages to being from this origin. Allow local developmet
// from file:// though.
// TODO: It would be dope if FF implemented location.origin!
- if (e.origin != ORIGIN_ && ORIGIN_ != 'file://') {
+ if (e.origin != ORIGIN_ && ORIGIN_.indexOf('file://') != 0) {
alert('Someone tried to postMessage from an unknown origin');
return;
}
diff --git a/js/slide-deck.js b/js/slide-deck.js
index a5308b9..50b9dc5 100644
--- a/js/slide-deck.js
+++ b/js/slide-deck.js
@@ -1,5 +1,6 @@
/**
- * @authors TODO
+ * @authors Luke Mahe
+ * @authors Eric Bidelman
* @fileoverview TODO
*/
document.cancelFullScreen = document.webkitCancelFullScreen ||
@@ -48,6 +49,16 @@ SlideDeck.prototype.getCurrentSlideFromHash_ = function() {
}
};
+/**
+ * @param {number} slideNo
+ */
+SlideDeck.prototype.loadSlide = function(slideNo) {
+ if (slideNo) {
+ this.curSlide_ = slideNo - 1;
+ this.updateSlides_();
+ }
+};
+
/**
* @private
*/
@@ -73,9 +84,20 @@ SlideDeck.prototype.onDomLoaded_ = function(e) {
this.updateSlides_();
// Add slide numbers and total slide count metadata to each slide.
+ var that = this;
for (var i = 0, slide; slide = this.slides[i]; ++i) {
slide.dataset.slideNum = i + 1;
slide.dataset.totalSlides = this.slides.length;
+
+ slide.addEventListener('click', function(e) {
+ if (document.body.classList.contains('overview')) {
+ that.loadSlide(this.dataset.slideNum);
+ e.preventDefault();
+ window.setTimeout(function() {
+ that.toggleOverview();
+ }, 500);
+ }
+ }, false);
}
// Note: this needs to come after addEventListeners_(), which adds a
@@ -152,6 +174,12 @@ SlideDeck.prototype.onBodyKeyDown_ = function(e) {
}
switch (e.keyCode) {
+ case 13: // Enter
+ if (document.body.classList.contains('overview')) {
+ this.toggleOverview();
+ }
+ break;
+
case 39: // right arrow
case 32: // space
case 34: // PgDn
@@ -167,20 +195,12 @@ SlideDeck.prototype.onBodyKeyDown_ = function(e) {
break;
case 40: // down arrow
- //if (this.isChromeVoxActive()) {
- // speakNextItem();
- //} else {
- this.nextSlide();
- //}
+ this.nextSlide();
e.preventDefault();
break;
case 38: // up arrow
- //if (this.isChromeVoxActive()) {
- // speakPrevItem();
- //} else {
- this.prevSlide();
- //}
+ this.prevSlide();
e.preventDefault();
break;
@@ -188,6 +208,10 @@ SlideDeck.prototype.onBodyKeyDown_ = function(e) {
document.body.classList.toggle('highlight-code');
break;
+ case 79: // O: Toggle overview
+ this.toggleOverview();
+ break;
+
case 80: // P
if (this.controller && this.controller.isPopup) {
document.body.classList.toggle('with-notes');
@@ -203,6 +227,10 @@ SlideDeck.prototype.onBodyKeyDown_ = function(e) {
case 27: // ESC: Hide notes and highlighting
document.body.classList.remove('with-notes');
document.body.classList.remove('highlight-code');
+
+ if (document.body.classList.contains('overview')) {
+ this.toggleOverview();
+ }
break;
case 70: // F: Toggle fullscreen
@@ -229,6 +257,27 @@ SlideDeck.prototype.onBodyKeyDown_ = function(e) {
}
};
+/**
+ *
+ */
+SlideDeck.prototype.focusOverview_ = function() {
+ var overview = document.body.classList.contains('overview');
+
+ for (var i = 0, slide; slide = this.slides[i]; i++) {
+ slide.style[Modernizr.prefixed('transform')] = overview ?
+ 'translateZ(-2500px) translate(' + (( i - this.curSlide_ ) * 105) +
+ '%, 0%)' : '';
+ }
+};
+
+/**
+ */
+SlideDeck.prototype.toggleOverview = function() {
+ document.body.classList.toggle('overview');
+
+ this.focusOverview_();
+};
+
/**
* @private
*/
@@ -276,34 +325,46 @@ SlideDeck.prototype.loadConfig_ = function(config) {
if (this.config_.presenters) {
var presenters = this.config_.presenters;
+ var dataConfigContact = document.querySelector('[data-config-contact]');
var html = [];
if (presenters.length == 1) {
- var p = presenters[0]
+ var p = presenters[0];
html = [p.name, p.company].join(' ');
var gplus = p.gplus ? 'g+ ' + p.gplus.replace('http://', '') + ' ' : '';
+ '">' + p.gplus.replace(/https?:\/\//, '') + '' : '';
var twitter = p.twitter ? 'twitter ' +
'' +
p.twitter + ' ' : '';
- var www = p.www ? 'www ' + p.www.replace('http://', '') + ' ' : '';
+ var www = p.www ? 'www ' + p.www.replace(/https?:\/\//, '') + ' ' : '';
- var html2 = [gplus, twitter, www].join(' ');
+ var github = p.github ? 'github ' + p.github.replace(/https?:\/\//, '') + ' ' : '';
- document.querySelector('[data-config-contact]').innerHTML = html2;
+ var html2 = [gplus, twitter, www, github].join(' ');
+
+ if (dataConfigContact) {
+ dataConfigContact.innerHTML = html2;
+ }
} else {
for (var i = 0, p; p = presenters[i]; ++i) {
html.push(p.name + ' - ' + p.company);
}
html = html.join(' ');
+ if (dataConfigContact) {
+ dataConfigContact.innerHTML = html;
+ }
}
- document.querySelector('[data-config-presenter]').innerHTML = html;
+ var dataConfigPresenter = document.querySelector('[data-config-presenter]');
+ if (dataConfigPresenter) {
+ document.querySelector('[data-config-presenter]').innerHTML = html;
+ }
}
/* Left/Right tap areas. Default to including. */
@@ -349,7 +410,8 @@ SlideDeck.prototype.loadConfig_ = function(config) {
SlideDeck.prototype.addFonts_ = function(fonts) {
var el = document.createElement('link');
el.rel = 'stylesheet';
- el.href = 'http://fonts.googleapis.com/css?family=' + fonts.join('|') + '&v2';
+ el.href = ('https:' == document.location.protocol ? 'https' : 'http') +
+ '://fonts.googleapis.com/css?family=' + fonts.join('|') + '&v2';
document.querySelector('head').appendChild(el);
};
@@ -379,10 +441,6 @@ SlideDeck.prototype.buildNextItem_ = function() {
toBuild.classList.remove('to-build');
toBuild.classList.add('build-current');
- /*if (isChromeVoxActive()) {
- speakAndSyncToNode(toBuild);
- }*/
-
return true;
};
@@ -412,7 +470,7 @@ SlideDeck.prototype.prevSlide = function(opt_dontPush) {
* @param {boolean=} opt_dontPush
*/
SlideDeck.prototype.nextSlide = function(opt_dontPush) {
- if (this.buildNextItem_()) {
+ if (!document.body.classList.contains('overview') && this.buildNextItem_()) {
return;
}
@@ -510,11 +568,13 @@ SlideDeck.prototype.updateSlides_ = function(opt_dontPush) {
// Give ourselves a good buffer to preload the next slide's iframes.
window.setTimeout(this.enableSlideFrames_.bind(this, curSlide + 2), 1000);
- /*if (isChromeVoxActive()) {
- speakAndSyncToNode(slideEls[curSlide]);
- }*/
-
this.updateHash_(dontPush);
+
+ if (document.body.classList.contains('overview')) {
+ this.focusOverview_();
+ return;
+ }
+
};
/**
diff --git a/js/slides.js b/js/slides.js
index 1af4bd5..3f6306e 100644
--- a/js/slides.js
+++ b/js/slides.js
@@ -1,15 +1,5 @@
-/**
- * ADD stuff here
- */
-(function() {
- var scs = ['modernizr.custom.45394.js', 'prettify/prettify.js', 'hammer.js',
- 'slide-controller.js', 'slide-deck.js'];
- var b = document.getElementsByTagName('script')[0];
- for (var i = 0, s; s = scs[i]; i++) {
- var sc = document.createElement('script');
- sc.type = 'text/javascript';
- sc.async = true;
- sc.src = 'js/' + s;
- b.parentNode.insertBefore(sc, b);
- }
-})();
+require(['order!../slide_config', 'order!modernizr.custom.45394',
+ 'order!prettify/prettify', 'order!hammer', 'order!slide-controller',
+ 'order!slide-deck'], function(someModule) {
+
+});
diff --git a/scripts/md/README.md b/scripts/md/README.md
new file mode 100644
index 0000000..136e465
--- /dev/null
+++ b/scripts/md/README.md
@@ -0,0 +1,5 @@
+Want to use markdown instead?
+
+`python render.py` can do that for you.
+
+Dependencies: jinja2, markdown.
diff --git a/scripts/md/base.html b/scripts/md/base.html
new file mode 100644
index 0000000..a469806
--- /dev/null
+++ b/scripts/md/base.html
@@ -0,0 +1,66 @@
+
+
+
+
+ Google IO 2012
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% for slide in slides %}
+
+
+ {{ slide.h1 }}
+ {{ slide.title }}
+
+
+ {{ slide.content }}
+
+
+{% endfor %}
+
+
+
+
+
+
+
+
diff --git a/scripts/md/render.py b/scripts/md/render.py
new file mode 100755
index 0000000..c634ea0
--- /dev/null
+++ b/scripts/md/render.py
@@ -0,0 +1,53 @@
+#!/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python
+import codecs
+import re
+import jinja2
+import markdown
+
+def process_slides():
+ with codecs.open('../presentation.html', 'w', encoding='utf8') as outfile:
+ md = codecs.open('slides.md', encoding='utf8').read()
+ md_slides = md.split('\n---\n')
+ print len(md_slides)
+
+ slides = []
+ # Process each slide separately.
+ for md_slide in md_slides:
+ slide = {}
+ sections = md_slide.split('\n\n')
+ # Extract metadata at the beginning of the slide (look for key: value)
+ # pairs.
+ metadata_section = sections[0]
+ metadata = parse_metadata(metadata_section)
+ slide.update(metadata)
+ remainder_index = metadata and 1 or 0
+ # Get the content from the rest of the slide.
+ content_section = '\n\n'.join(sections[remainder_index:])
+ html = markdown.markdown(content_section)
+ slide['content'] = postprocess_html(html, markdown)
+
+ slides.append(slide)
+
+ template = jinja2.Template(open('base.html').read())
+
+ outfile.write(template.render(locals()))
+
+def parse_metadata(section):
+ """Given the first part of a slide, returns metadata associated with it."""
+ metadata = {}
+ metadata_lines = section.split('\n')
+ for line in metadata_lines:
+ colon_index = line.find(':')
+ if colon_index != -1:
+ key = line[:colon_index].strip()
+ val = line[colon_index + 1:].strip()
+ metadata[key] = val
+
+ return metadata
+
+def postprocess_html(html, metadata):
+ """Returns processed HTML to fit into the slide template format."""
+ return html
+
+if __name__ == '__main__':
+ process_slides()
diff --git a/scripts/md/slides.md b/scripts/md/slides.md
new file mode 100644
index 0000000..064b8db
--- /dev/null
+++ b/scripts/md/slides.md
@@ -0,0 +1,64 @@
+title: Slide Title
+class: image
+
+![Mobile vs desktop users](image.png)
+
+---
+
+title: Agenda
+class: big
+
+Things we'll cover:
+
+- Bullet1
+- Bullet2
+- Bullet3
+
+---
+
+title: Today
+class: nobackground fill
+
+![Many kinds of devices.](image.png)
+
+source: place source info here
+
+---
+
+h1: Big Title Slide
+class: title-slide
+
+---
+
+title: Code Example
+
+Media Queries are sweet:
+
+
+@media screen and (max-width: 640px) {
+ #sidebar { display: none; }
+}
+
+
+---
+
+title: Once more, with JavaScript
+
+
+function isSmall() {
+ return window.matchMedia("(min-device-width: ???)").matches;
+}
+
+function hasTouch() {
+ return Modernizr.touch;
+}
+
+function detectFormFactor() {
+ var device = DESKTOP;
+ if (hasTouch()) {
+ device = isSmall() ? PHONE : TABLET;
+ }
+ return device;
+}
+
+
diff --git a/serve.sh b/serve.sh
index 9663bad..f2692fe 100755
--- a/serve.sh
+++ b/serve.sh
@@ -12,4 +12,11 @@ then
port=8000
fi
-open http://localhost:$port/template.html && python -m SimpleHTTPServer $port;
+if [ $(uname -s) == "Darwin" ]
+then
+ open=open
+else
+ open=xdg-open
+fi
+
+$open http://localhost:$port/template.html && python -m SimpleHTTPServer $port;
diff --git a/slide_config.js b/slide_config.js
new file mode 100644
index 0000000..1389ab3
--- /dev/null
+++ b/slide_config.js
@@ -0,0 +1,36 @@
+var SLIDE_CONFIG = {
+ // Slide settings
+ settings: {
+ title: 'Title Goes Here Up To Two Lines',
+ subtitle: 'Subtitle Goes Here',
+ useBuilds: true, // Default: true. False will turn off slide animation builds.
+ usePrettify: true, // Default: true
+ enableSlideAreas: true, // Default: true. False turns off the click areas on either slide of the slides.
+ enableTouch: true, // Default: true. If touch support should enabled. Note: the device must support touch.
+ //analytics: 'UA-XXXXXXXX-1', // TODO: Using this breaks GA for some reason (probably requirejs). Update your tracking code in template.html instead.
+ favIcon: 'images/google_developers_logo_tiny.png',
+ fonts: [
+ 'Open Sans:regular,semibold,italic,italicsemibold',
+ 'Inconsolata'
+ ],
+ //theme: ['mytheme'], // Add your own custom themes or styles in /theme/css. Leave off the .css extension.
+ },
+
+ // Author information
+ presenters: [{
+ name: 'Firstname Lastname',
+ company: 'Job Title, Google',
+ gplus: 'http://plus.google.com/1234567890',
+ twitter: '@yourhandle',
+ www: 'http://www.you.com',
+ github: 'http://github.com/you'
+ }/*, {
+ name: 'Second Name',
+ company: 'Job Title, Google',
+ gplus: 'http://plus.google.com/1234567890',
+ twitter: '@yourhandle',
+ www: 'http://www.you.com',
+ github: 'http://github.com/you'
+ }*/]
+};
+
diff --git a/slide_config.json b/slide_config.json
deleted file mode 100644
index 0b37874..0000000
--- a/slide_config.json
+++ /dev/null
@@ -1,34 +0,0 @@
-var SLIDE_CONFIG = {
- // Slide settings
- settings: {
- title: 'Title Goes Here Up To Two Lines',
- subtitle: 'Subtitle Goes Here',
- useBuilds: true, // Default: true. False will turn off slide animation builds.
- usePrettify: true, // Default: true
- enableSlideAreas: true, // Default: true. False turns off the click areas on either slide of the slides.
- enableTouch: true, // Default: true. If touch support should enabled. Note: the device must support touch.
- //analytics: 'UA-XXXXXXXX-1',
- favIcon: 'http://bleedinghtml5.appspot.com/images/chrome-logo-tiny2.png',
- fonts: [
- 'Open Sans:regular,semibold,italic,italicsemibold',
- 'Inconsolata'
- ],
- //theme: ['mytheme'], // Add your own custom themes or styles in /theme/css. Leave off the .css extension.
- },
-
- // Author information
- presenters: [{
- name: 'Firstname Lastname',
- company: 'Job Title, Google',
- gplus: 'http://plus.google.com/1234567890',
- twitter: '@yourhandle',
- www: 'http://www.you.com'
- }/*, {
- name: 'Eric Bidelman',
- gplus: 'http://plus.ericbidelman.com',
- company: 'Senior Developer Programs Engineer, Google Chrome',
- twitter: '@ebidel',
- www: 'http://www.ericbidelman.com'
- }*/]
-};
-
diff --git a/template.html b/template.html
index 9d19d59..3560397 100644
--- a/template.html
+++ b/template.html
@@ -20,8 +20,9 @@ URL: https://code.google.com/p/io-2012-slides
+
-
+
@@ -70,6 +71,8 @@ URL: https://code.google.com/p/io-2012-slides
Pressing 'h' highlights code snippets
Pressing 'p' toggles speaker notes (if they're on the current slide)
Pressing 'f' toggles fullscreen viewing
+ Pressing 'w' toggles widescreen
+ Pressing 'o' toggles overview mode
Pressing 'ESC' toggles off these goodies
Another list, but items fade as they build:
@@ -393,8 +396,18 @@ function helloWorld(world) {
-
-
+
+