Browse code

1. Removed pullquote and improved semantics of blockquote plugin. 2. Removed iterator plugin as it was not being used. 3. Added initial support for html5 video with flash fallback. 4. Added responsive scaling for embedded youtube and vimeo videos. 5. Improved footer styleing.

Brandon Mathis authored on 13/06/2011 at 20:41:03
Showing 7 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 #
2 2
 # Author: Josediaz Gonzalez - https://github.com/josegonzalez
3 3
 # Source URL: https://github.com/josegonzalez/josediazgonzalez.com/blob/master/_plugins/blockquote.rb
4
-# Modified by Brandon Mathis
4
+# Modified by Brandon Mathis removed pullquotes and added simple cite paramaters
5 5
 #
6 6
 require './_plugins/titlecase.rb'
7 7
 module Jekyll
... ...
@@ -45,65 +45,14 @@ module Jekyll
45 45
       if @by.nil?
46 46
         '<blockquote><p>' + output.join + '</p></blockquote>'
47 47
       elsif !@title.nil?
48
-        '<blockquote><p>' + output.join + '</p></blockquote>' + '<p><cite><strong>' + @by + '</strong>' + '<a class="source" href="' + @source + '">' + @title + '</a></cite></p>'
48
+        '<blockquote><p>' + output.join + '</p>' + '<p><strong>' + @by + '</strong>' + '<cite><a class="source" href="' + @source + '">' + @title + '</a></cite></p></blockquote>'
49 49
       elsif !@source.nil?
50
-        '<blockquote><p>' + output.join + '</p></blockquote>' + '<p><cite><strong>' + @by + '</strong>' + '<a class="source" href="' + @source + '">source</a></cite></p>'
50
+        '<blockquote><p>' + output.join + '</p>' + '<p><strong>' + @by + '</strong>' + '<cite><a class="source" href="' + @source + '">source</a></cite></p></blockquote>'
51 51
       else
52
-        '<blockquote><p>' + output.join + '</p></blockquote>' + '<p><cite><strong>' + @by + '</strong></cite></p>'
53
-      end
54
-    end
55
-  end
56
-
57
-  # Outputs a string with a given attribution as a pullquote
58
-  #
59
-  #   {% blockquote John Paul Jones %}
60
-  #     Monkeys!
61
-  #   {% endblockquote %}
62
-  #   ...
63
-  #   <blockquote class="pullquote">
64
-  #     Monkeys!
65
-  #     <br />
66
-  #     John Paul Jones
67
-  #   </blockquote>
68
-  #
69
-  class Pullquote < Liquid::Block
70
-    FullCiteWithTitle = /([\w\s]+)(http:\/\/|https:\/\/)(\S+)([\w\s]+)/i
71
-    FullCite = /([\w\s]+)(http:\/\/|https:\/\/)(\S+)/i
72
-    Author =  /([\w\s]+)/
73
-
74
-    def initialize(tag_name, markup, tokens)
75
-      @by = nil
76
-      @source = nil
77
-      @title = nil
78
-      if markup =~ FullCiteWithTitle
79
-        @by = $1
80
-        @source = $2 + $3
81
-        @title = $4
82
-      elsif markup =~ FullCite
83
-        @by = $1
84
-        @source = $2 + $3
85
-      elsif markup =~ Author
86
-        @by = $1
87
-      end
88
-      super
89
-    end
90
-
91
-    def render(context)
92
-      output = super
93
-      if @by.nil?
94
-        '<blockquote class="pullquote"><p>' + output.join + '</p></blockquote>'
95
-      elsif @title
96
-        '<blockquote class="pullquote"><p>' + output.join + '</p></blockquote>' + '<p><cite><strong>' + @by + '</strong>' + ' <a class="source" href="' + @source + '">' + @title + '</a></cite></p>'
97
-      elsif @source
98
-        '<blockquote class="pullquote"><p>' + output.join + '</p></blockquote>' + '<p><cite><strong>' + @by + '</strong>' + ' <a class="source" href="' + @source + '">source</a></cite></p>'
99
-      elsif @by
100
-        '<blockquote class="pullquote"><p>' + output.join + '</p></blockquote>' + '<p><cite><strong>' + @by + '</strong></cite></p>'
52
+        '<blockquote><p>' + output.join + '</p>' + '<p><strong>' + @by + '</strong></p></blockquote>'
101 53
       end
102 54
     end
103 55
   end
104 56
 end
105 57
 
106 58
 Liquid::Template.register_tag('blockquote', Jekyll::Blockquote)
107
-Liquid::Template.register_tag('pullquote', Jekyll::Pullquote)
108
-
109
-
110 59
deleted file mode 100644
... ...
@@ -1,49 +0,0 @@
1
-##
2
-## Author: Jose Gonzalez - https://github.com/josegonzalez
3
-## Source URL: https://github.com/josegonzalez/josediazgonzalez.com/blob/master/_plugins/iterator.rb
4
-##
5
-
6
-#module Jekyll
7
-  #class Site
8
-    #alias_method :orig_site_payload, :site_payload
9
-
10
-    ## Constuct an array of hashes that will allow the user, using Liquid, to
11
-    ## iterate through the keys of _kv_hash_ and be able to iterate through the
12
-    ## elements under each key.
13
-    ##
14
-    ## Example:
15
-    ##   categories = { 'Ruby' => [<Post>, <Post>] }
16
-    ##   make_iterable(categories, :index => 'name', :items => 'posts')
17
-    ## Will allow the user to iterate through all categories and then iterate
18
-    ## though each post in the current category like so:
19
-    ##   {% for category in site.categories %}
20
-    ##     h1. {{ category.name }}
21
-    ##     <ul>
22
-    ##       {% for post in category.posts %}
23
-    ##         <li>{{ post.title }}</li>
24
-    ##       {% endfor %}
25
-    ##       </ul>
26
-    ##   {% endfor %}
27
-    ##
28
-    ## Returns [ {<index> => <kv_hash_key>, <items> => kv_hash[<kv_hash_key>]}, ... ]
29
-
30
-    #def make_iterable(kv_hash, options)
31
-      #options = {:index => 'name', :items => 'items'}.merge(options)
32
-      #result = []
33
-      #kv_hash.sort.each do |key, value|
34
-        #result << { options[:index] => key, options[:items] => value }
35
-      #end
36
-      #result
37
-    #end
38
-
39
-    #def site_payload
40
-      #payload = orig_site_payload
41
-      #payload['site']['iterable'].merge!({
42
-        #'categories'  => make_iterable(self.categories, :index => 'name', :items => 'posts'),
43
-        #'tags'        => make_iterable(self.tags, :index => 'name', :items => 'posts')
44
-      #})
45
-      #payload
46
-    #end
47
-
48
-  #end
49
-#end
... ...
@@ -35,7 +35,30 @@ $border: inline-image('dotted-border.png');
35 35
       }
36 36
     }
37 37
     .entry-content {
38
-      img { max-width: 100%; }
38
+      img, video { max-width: 100%; height: auto; }
39
+      video { display: block; margin-bottom: 1.5em;
40
+        padding: .8em; background: #fff; border: 1px solid #eee;
41
+        @include box-sizing(border-box);
42
+      }
43
+      .flash-video {
44
+        max-width: 100%;
45
+        padding: .8em; background: #fff; border: 1px solid #eee;
46
+        > div {
47
+          position: relative;
48
+          display: block;
49
+          padding-bottom: 56.25%;
50
+          padding-top: 1px;
51
+          height: 0;
52
+          overflow: hidden;
53
+          iframe, object, embed {
54
+            position: absolute;
55
+            top: 0;
56
+            left: 0;
57
+            width: 100%;
58
+            height: 100%;
59
+          }
60
+        }
61
+      }
39 62
     }
40 63
     #disqus_thread { }
41 64
     .meta {
... ...
@@ -9,6 +9,8 @@ body > footer {
9 9
   position: relative;
10 10
   padding-top: 1em;
11 11
   padding-bottom: 1em;
12
+  margin-bottom: 3em;
13
+  @include border-bottom-radius(.4em);
12 14
   z-index: 1;
13 15
   a {
14 16
     @include link-colors($nav-color, $nav-color-hover);
15 17
new file mode 100644
... ...
@@ -0,0 +1,298 @@
0
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/>
1
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
2
+*/
3
+
4
+var swfobject = function() {
5
+
6
+	var UNDEF = "undefined",
7
+		OBJECT = "object",
8
+		SHOCKWAVE_FLASH = "Shockwave Flash",
9
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
10
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
11
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
12
+
13
+		win = window,
14
+		doc = document,
15
+		nav = navigator,
16
+
17
+		plugin = false,
18
+		regObjArr = [],
19
+		objIdArr = [],
20
+		storedAltContent,
21
+		storedAltContentId,
22
+		storedCallbackFn,
23
+		storedCallbackObj,
24
+		autoHideShow = true,
25
+
26
+	/* Centralized function for browser feature detection
27
+		- User agent string detection is only used when no good alternative is possible
28
+		- Is executed directly for optimal performance
29
+	*/
30
+	ua = function() {
31
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
32
+			u = nav.userAgent.toLowerCase(),
33
+			p = nav.platform.toLowerCase(),
34
+			windows = p ? /win/.test(p) : /win/.test(u),
35
+			mac = p ? /mac/.test(p) : /mac/.test(u),
36
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
37
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
38
+			playerVersion = [0,0,0],
39
+			d = null;
40
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
41
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
42
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
43
+				plugin = true;
44
+				ie = false; // cascaded feature detection for Internet Explorer
45
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
46
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
47
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
48
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
49
+			}
50
+		}
51
+		else if (typeof win.ActiveXObject != UNDEF) {
52
+			try {
53
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
54
+				if (a) { // a will return null when ActiveX is disabled
55
+					d = a.GetVariable("$version");
56
+					if (d) {
57
+						ie = true; // cascaded feature detection for Internet Explorer
58
+						d = d.split(" ")[1].split(",");
59
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
60
+					}
61
+				}
62
+			}
63
+			catch(e) {}
64
+		}
65
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
66
+	}()
67
+
68
+
69
+	/* Main function
70
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
71
+	*/
72
+	function main() {
73
+		if (plugin) { testPlayerVersion(); }
74
+		else { matchVersions(); }
75
+	}
76
+
77
+	/* Detect the Flash Player version for non-Internet Explorer browsers
78
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
79
+		  a. Both release and build numbers can be detected
80
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
81
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
82
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
83
+	*/
84
+	function testPlayerVersion() {
85
+		var b = doc.getElementsByTagName("body")[0];
86
+		var o = createElement(OBJECT);
87
+		o.setAttribute("type", FLASH_MIME_TYPE);
88
+		var t = b.appendChild(o);
89
+		if (t) {
90
+			var counter = 0;
91
+			(function(){
92
+				if (typeof t.GetVariable != UNDEF) {
93
+					var d = t.GetVariable("$version");
94
+					if (d) {
95
+						d = d.split(" ")[1].split(",");
96
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
97
+					}
98
+				}
99
+				else if (counter < 10) {
100
+					counter++;
101
+					setTimeout(arguments.callee, 10);
102
+					return;
103
+				}
104
+				b.removeChild(o);
105
+				t = null;
106
+				matchVersions();
107
+			})();
108
+		}
109
+		else {
110
+			matchVersions();
111
+		}
112
+	}
113
+
114
+
115
+	/* Cross-browser dynamic SWF creation
116
+	*/
117
+	function createSWF(attObj, parObj, id) {
118
+		var r, el = getElementById(id);
119
+		if (ua.wk && ua.wk < 312) { return r; }
120
+		if (el) {
121
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
122
+				attObj.id = id;
123
+			}
124
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
125
+				var att = "";
126
+				for (var i in attObj) {
127
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
128
+						if (i.toLowerCase() == "data") {
129
+							parObj.movie = attObj[i];
130
+						}
131
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
132
+							att += ' class="' + attObj[i] + '"';
133
+						}
134
+						else if (i.toLowerCase() != "classid") {
135
+							att += ' ' + i + '="' + attObj[i] + '"';
136
+						}
137
+					}
138
+				}
139
+				var par = "";
140
+				for (var j in parObj) {
141
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
142
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
143
+					}
144
+				}
145
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
146
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
147
+				r = getElementById(attObj.id);
148
+			}
149
+			else { // well-behaving browsers
150
+				var o = createElement(OBJECT);
151
+				o.setAttribute("type", FLASH_MIME_TYPE);
152
+				for (var m in attObj) {
153
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
154
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
155
+							o.setAttribute("class", attObj[m]);
156
+						}
157
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
158
+							o.setAttribute(m, attObj[m]);
159
+						}
160
+					}
161
+				}
162
+				for (var n in parObj) {
163
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
164
+						createObjParam(o, n, parObj[n]);
165
+					}
166
+				}
167
+				el.parentNode.replaceChild(o, el);
168
+				r = o;
169
+			}
170
+		}
171
+		return r;
172
+	}
173
+
174
+	function createObjParam(el, pName, pValue) {
175
+		var p = createElement("param");
176
+		p.setAttribute("name", pName);
177
+		p.setAttribute("value", pValue);
178
+		el.appendChild(p);
179
+	}
180
+
181
+	/* Cross-browser SWF removal
182
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
183
+	*/
184
+	/* Functions to optimize JavaScript compression
185
+	*/
186
+	function getElementById(id) {
187
+		var el = null;
188
+		try {
189
+			el = doc.getElementById(id);
190
+		}
191
+		catch (e) {}
192
+		return el;
193
+	}
194
+
195
+	function createElement(el) {
196
+		return doc.createElement(el);
197
+	}
198
+
199
+	/* Flash Player and SWF content version matching
200
+	*/
201
+	function hasPlayerVersion(rv) {
202
+		var pv = ua.pv, v = rv.split(".");
203
+		v[0] = parseInt(v[0], 10);
204
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
205
+		v[2] = parseInt(v[2], 10) || 0;
206
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
207
+	}
208
+
209
+
210
+	/* Filter to avoid XSS attacks
211
+	*/
212
+	function urlEncodeIfNecessary(s) {
213
+		var regex = /[\\\"<>\.;]/;
214
+		var hasBadChars = regex.exec(s) != null;
215
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
216
+	}
217
+
218
+	return {
219
+		/* Public API
220
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
221
+		*/
222
+
223
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, flashvarsObj, parObj, attObj, callbackFn) {
224
+			var callbackObj = {success:false, id:replaceElemIdStr};
225
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
226
+              widthStr += ""; // auto-convert to string
227
+              heightStr += "";
228
+              var att = {};
229
+              if (attObj && typeof attObj === OBJECT) {
230
+                for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
231
+                  att[i] = attObj[i];
232
+                }
233
+              }
234
+              att.data = swfUrlStr;
235
+              att.width = widthStr;
236
+              att.height = heightStr;
237
+              var par = {};
238
+              if (parObj && typeof parObj === OBJECT) {
239
+                for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
240
+                  par[j] = parObj[j];
241
+                }
242
+              }
243
+              if (flashvarsObj && typeof flashvarsObj === OBJECT) {
244
+                for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
245
+                  if (typeof par.flashvars != UNDEF) {
246
+                    par.flashvars += "&" + k + "=" + flashvarsObj[k];
247
+                  }
248
+                  else {
249
+                    par.flashvars = k + "=" + flashvarsObj[k];
250
+                  }
251
+                }
252
+              }
253
+              if (hasPlayerVersion(swfVersionStr)) { // create SWF
254
+                var obj = createSWF(att, par, replaceElemIdStr);
255
+                callbackObj.success = true;
256
+                callbackObj.ref = obj;
257
+              }
258
+              if (callbackFn) { callbackFn(callbackObj); }
259
+			}
260
+			else if (callbackFn) { callbackFn(callbackObj);	}
261
+		},
262
+
263
+		ua: ua,
264
+
265
+		getFlashPlayerVersion: function() {
266
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
267
+		},
268
+
269
+		hasFlashPlayerVersion: hasPlayerVersion,
270
+
271
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
272
+			if (ua.w3) {
273
+				return createSWF(attObj, parObj, replaceElemIdStr);
274
+			}
275
+			else {
276
+				return undefined;
277
+			}
278
+		},
279
+
280
+		getQueryParamValue: function(param) {
281
+			var q = doc.location.search || doc.location.hash;
282
+			if (q) {
283
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
284
+				if (param == null) {
285
+					return urlEncodeIfNecessary(q);
286
+				}
287
+				var pairs = q.split("&");
288
+				for (var i = 0; i < pairs.length; i++) {
289
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
290
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
291
+					}
292
+				}
293
+			}
294
+			return "";
295
+		}
296
+	};
297
+}();
... ...
@@ -1,5 +1,5 @@
1
-/* Modernizr 2.0.3 (Custom Build) | MIT & BSD
2
- * Contains: iepp | respond | mq | cssclasses | teststyles | testprop | testallprops | domprefixes | load
3
- * Build URL: http://j.mp/iGWrVM
1
+/* Modernizr 2.0.4 (Custom Build) | MIT & BSD
2
+ * Contains: video | iepp | respond | mq | cssclasses | teststyles | testprop | testallprops | prefixes | domprefixes | load
3
+ * Build URL: http://j.mp/m1H1Y1
4 4
  */
5
-;window.Modernizr=function(a,b,c){function C(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+n.join(c+" ")+c).split(" ");return B(d,b)}function B(a,b){for(var d in a)if(k[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function A(a,b){return!!~(""+a).indexOf(b)}function z(a,b){return typeof a===b}function y(a,b){return x(prefixes.join(a+";")+(b||""))}function x(a){k.cssText=a}var d="2.0.3",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l,m=Object.prototype.toString,n="Webkit Moz O ms Khtml".split(" "),o={},p={},q={},r=[],s=function(a,c,d,e){var f,h,j,k=b.createElement("div");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:i+(d+1),k.appendChild(j);f=["&shy;","<style>",a,"</style>"].join(""),k.id=i,k.innerHTML+=f,g.appendChild(k),h=c(k,a),k.parentNode.removeChild(k);return!!h},t=function(b){if(a.matchMedia)return matchMedia(b).matches;var c;s("@media "+b+" { #"+i+" { position: absolute; } }",function(b){c=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position=="absolute"});return c},u,v={}.hasOwnProperty,w;!z(v,c)&&!z(v.call,c)?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],c)};for(var D in o)w(o,D)&&(u=D.toLowerCase(),e[u]=o[D](),r.push((e[u]?"":"no-")+u));x(""),j=l=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function s(a){var b=-1;while(++b<g)a.createElement(f[b])}a.iepp=a.iepp||{};var d=a.iepp,e=d.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",f=e.split("|"),g=f.length,h=new RegExp("(^|\\s)("+e+")","gi"),i=new RegExp("<(/*)("+e+")","gi"),j=/^\s*[\{\}]\s*$/,k=new RegExp("(^|[^\\n]*?\\s)("+e+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),l=b.createDocumentFragment(),m=b.documentElement,n=m.firstChild,o=b.createElement("body"),p=b.createElement("style"),q=/print|all/,r;d.getCSS=function(a,b){if(a+""===c)return"";var e=-1,f=a.length,g,h=[];while(++e<f){g=a[e];if(g.disabled)continue;b=g.media||b,q.test(b)&&h.push(d.getCSS(g.imports,b),g.cssText),b="all"}return h.join("")},d.parseCSS=function(a){var b=[],c;while((c=k.exec(a))!=null)b.push(((j.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(h,"$1.iepp_$2")+c[4]);return b.join("\n")},d.writeHTML=function(){var a=-1;r=r||b.body;while(++a<g){var c=b.getElementsByTagName(f[a]),d=c.length,e=-1;while(++e<d)c[e].className.indexOf("iepp_")<0&&(c[e].className+=" iepp_"+f[a])}l.appendChild(r),m.appendChild(o),o.className=r.className,o.id=r.id,o.innerHTML=r.innerHTML.replace(i,"<$1font")},d._beforePrint=function(){p.styleSheet.cssText=d.parseCSS(d.getCSS(b.styleSheets,"all")),d.writeHTML()},d.restoreHTML=function(){o.innerHTML="",m.removeChild(o),m.appendChild(r)},d._afterPrint=function(){d.restoreHTML(),p.styleSheet.cssText=""},s(b),s(l);d.disablePP||(n.insertBefore(p,n.firstChild),p.media="print",p.className="iepp-printshim",a.attachEvent("onbeforeprint",d._beforePrint),a.attachEvent("onafterprint",d._afterPrint))}(a,b),e._version=d,e._domPrefixes=n,e.mq=t,e.testProp=function(a){return B([a])},e.testAllProps=C,e.testStyles=s,g.className=g.className.replace(/\bno-js\b/,"")+(f?" js "+r.join(" "):"");return e}(this,this.document),function(a,b){function u(){r(!0)}a.respond={},respond.update=function(){},respond.mediaQueriesSupported=b;if(!b){var c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=j.getElementsByTagName("link"),l=[],m=function(){var b=k,c=b.length,d=0,e,f,g,i;for(;d<c;d++)e=b[d],f=e.href,g=e.media,i=e.rel&&e.rel.toLowerCase()==="stylesheet",!!f&&i&&!h[f]&&(!/^([a-zA-Z]+?:(\/\/)?(www\.)?)/.test(f)||f.replace(RegExp.$1,"").split("/")[0]===a.location.host?l.push({href:f,media:g}):h[f]=!0);n()},n=function(){if(l.length){var a=l.shift();s(a.href,function(b){o(b,a.href,a.media),h[a.href]=!0,n()})}},o=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]+\{[^\}\{]+\})+/gi),g=d&&d.length||0,b=b.substring(0,b.lastIndexOf("/")),h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c,j=0,k,l,m,n,o;b.length&&(b+="/"),i&&(g=1);for(;j<g;j++){k=0,i?(l=c,f.push(h(a))):(l=d[j].match(/@media ([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),n=l.split(","),o=n.length;for(;k<o;k++)m=n[k],e.push({media:m.match(/(only\s+)?([a-zA-Z]+)(\sand)?/)&&RegExp.$2,rules:f.length-1,minw:m.match(/\(min\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1),maxw:m.match(/\(max\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1)})}r()},p,q,r=function(a){var b="clientWidth",h=d[b],l=c.compatMode==="CSS1Compat"&&h||c.body[b]||h,m={},n=c.createDocumentFragment(),o=k[k.length-1],s=(new Date).getTime();if(a&&p&&s-p<i)clearTimeout(q),q=setTimeout(r,i);else{p=s;for(var t in e){var u=e[t];if(!u.minw&&!u.maxw||(!u.minw||u.minw&&l>=u.minw)&&(!u.maxw||u.maxw&&l<=u.maxw))m[u.media]||(m[u.media]=[]),m[u.media].push(f[u.rules])}for(var t in g)g[t]&&g[t].parentNode===j&&j.removeChild(g[t]);for(var t in m){var v=c.createElement("style"),w=m[t].join("\n");v.type="text/css",v.media=t,v.styleSheet?v.styleSheet.cssText=w:v.appendChild(c.createTextNode(w)),n.appendChild(v),g.push(v)}j.insertBefore(n,o.nextSibling)}},s=function(a,b){var c=t();if(!!c){c.open("GET",a,!0),c.onreadystatechange=function(){c.readyState==4&&(c.status==200||c.status==304)&&b(c.responseText)};if(c.readyState==4)return;c.send()}},t=function(){var a=!1,b=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new XMLHttpRequest}],c=b.length;while(c--){try{a=b[c]()}catch(d){continue}break}return function(){return a}}();m(),respond.update=m,a.addEventListener?a.addEventListener("resize",u,!1):a.attachEvent&&a.attachEvent("onresize",u)}}(this,Modernizr.mq("only all")),function(a,b,c){function k(a){return!a||a=="loaded"||a=="complete"}function j(){var a=1,b=-1;while(p.length- ++b)if(p[b].s&&!(a=p[b].r))break;a&&g()}function i(a){var c=b.createElement("script"),d;c.src=a.s,c.onreadystatechange=c.onload=function(){!d&&k(c.readyState)&&(d=1,j(),c.onload=c.onreadystatechange=null)},m(function(){d||(d=1,j())},H.errorTimeout),a.e?c.onload():n.parentNode.insertBefore(c,n)}function h(a){var c=b.createElement("link"),d;c.href=a.s,c.rel="stylesheet",c.type="text/css",!a.e&&(w||r)?function a(b){m(function(){if(!d)try{b.sheet.cssRules.length?(d=1,j()):a(b)}catch(c){c.code==1e3||c.message=="security"||c.message=="denied"?(d=1,m(function(){j()},0)):a(b)}},0)}(c):(c.onload=function(){d||(d=1,m(function(){j()},0))},a.e&&c.onload()),m(function(){d||(d=1,j())},H.errorTimeout),!a.e&&n.parentNode.insertBefore(c,n)}function g(){var a=p.shift();q=1,a?a.t?m(function(){a.t=="c"?h(a):i(a)},0):(a(),j()):q=0}function f(a,c,d,e,f,h){function i(){!o&&k(l.readyState)&&(r.r=o=1,!q&&j(),l.onload=l.onreadystatechange=null,m(function(){u.removeChild(l)},0))}var l=b.createElement(a),o=0,r={t:d,s:c,e:h};l.src=l.data=c,!s&&(l.style.display="none"),l.width=l.height="0",a!="object"&&(l.type=d),l.onload=l.onreadystatechange=i,a=="img"?l.onerror=i:a=="script"&&(l.onerror=function(){r.e=r.r=1,g()}),p.splice(e,0,r),u.insertBefore(l,s?null:n),m(function(){o||(u.removeChild(l),r.r=r.e=o=1,j())},H.errorTimeout)}function e(a,b,c){var d=b=="c"?z:y;q=0,b=b||"j",C(a)?f(d,a,b,this.i++,l,c):(p.splice(this.i++,0,a),p.length==1&&g());return this}function d(){var a=H;a.loader={load:e,i:0};return a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=r&&!s,u=s?l:n.parentNode,v=a.opera&&o.call(a.opera)=="[object Opera]",w="webkitAppearance"in l.style,x=w&&"async"in b.createElement("script"),y=r?"object":v||x?"img":"script",z=w?"img":y,A=Array.isArray||function(a){return o.call(a)=="[object Array]"},B=function(a){return typeof a=="object"},C=function(a){return typeof a=="string"},D=function(a){return o.call(a)=="[object Function]"},E=[],F={},G,H;H=function(a){function f(a){var b=a.split("!"),c=E.length,d=b.pop(),e=b.length,f={url:d,origUrl:d,prefixes:b},g,h;for(h=0;h<e;h++)g=F[b[h]],g&&(f=g(f));for(h=0;h<c;h++)f=E[h](f);return f}function e(a,b,e,g,h){var i=f(a),j=i.autoCallback;if(!i.bypass){b&&(b=D(b)?b:b[a]||b[g]||b[a.split("/").pop().split("?")[0]]);if(i.instead)return i.instead(a,b,e,g,h);e.load(i.url,i.forceCSS||!i.forceJS&&/css$/.test(i.url)?"c":c,i.noexec),(D(b)||D(j))&&e.load(function(){d(),b&&b(i.origUrl,h,g),j&&j(i.origUrl,h,g)})}}function b(a,b){function c(a){if(C(a))e(a,h,b,0,d);else if(B(a))for(i in a)a.hasOwnProperty(i)&&e(a[i],h,b,i,d)}var d=!!a.test,f=d?a.yep:a.nope,g=a.load||a.both,h=a.callback,i;c(f),c(g),a.complete&&b.load(a.complete)}var g,h,i=this.yepnope.loader;if(C(a))e(a,0,i,0);else if(A(a))for(g=0;g<a.length;g++)h=a[g],C(h)?e(h,0,i,0):A(h)?H(h):B(h)&&b(h,i);else B(a)&&b(a,i)},H.addPrefix=function(a,b){F[a]=b},H.addFilter=function(a){E.push(a)},H.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",G=function(){b.removeEventListener("DOMContentLoaded",G,0),b.readyState="complete"},0)),a.yepnope=d()}(this,this.document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
5
+;window.Modernizr=function(a,b,c){function D(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+o.join(c+" ")+c).split(" ");return C(d,b)}function C(a,b){for(var d in a)if(k[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function B(a,b){return!!~(""+a).indexOf(b)}function A(a,b){return typeof a===b}function z(a,b){return y(n.join(a+";")+(b||""))}function y(a){k.cssText=a}var d="2.0.4",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l,m=Object.prototype.toString,n=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),o="Webkit Moz O ms Khtml".split(" "),p={},q={},r={},s=[],t=function(a,c,d,e){var f,h,j,k=b.createElement("div");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:i+(d+1),k.appendChild(j);f=["&shy;","<style>",a,"</style>"].join(""),k.id=i,k.innerHTML+=f,g.appendChild(k),h=c(k,a),k.parentNode.removeChild(k);return!!h},u=function(b){if(a.matchMedia)return matchMedia(b).matches;var c;t("@media "+b+" { #"+i+" { position: absolute; } }",function(b){c=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position=="absolute"});return c},v,w={}.hasOwnProperty,x;!A(w,c)&&!A(w.call,c)?x=function(a,b){return w.call(a,b)}:x=function(a,b){return b in a&&A(a.constructor.prototype[b],c)},p.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}}catch(e){}return c};for(var E in p)x(p,E)&&(v=E.toLowerCase(),e[v]=p[E](),s.push((e[v]?"":"no-")+v));y(""),j=l=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function s(a){var b=-1;while(++b<g)a.createElement(f[b])}a.iepp=a.iepp||{};var d=a.iepp,e=d.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",f=e.split("|"),g=f.length,h=new RegExp("(^|\\s)("+e+")","gi"),i=new RegExp("<(/*)("+e+")","gi"),j=/^\s*[\{\}]\s*$/,k=new RegExp("(^|[^\\n]*?\\s)("+e+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),l=b.createDocumentFragment(),m=b.documentElement,n=m.firstChild,o=b.createElement("body"),p=b.createElement("style"),q=/print|all/,r;d.getCSS=function(a,b){if(a+""===c)return"";var e=-1,f=a.length,g,h=[];while(++e<f){g=a[e];if(g.disabled)continue;b=g.media||b,q.test(b)&&h.push(d.getCSS(g.imports,b),g.cssText),b="all"}return h.join("")},d.parseCSS=function(a){var b=[],c;while((c=k.exec(a))!=null)b.push(((j.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(h,"$1.iepp_$2")+c[4]);return b.join("\n")},d.writeHTML=function(){var a=-1;r=r||b.body;while(++a<g){var c=b.getElementsByTagName(f[a]),d=c.length,e=-1;while(++e<d)c[e].className.indexOf("iepp_")<0&&(c[e].className+=" iepp_"+f[a])}l.appendChild(r),m.appendChild(o),o.className=r.className,o.id=r.id,o.innerHTML=r.innerHTML.replace(i,"<$1font")},d._beforePrint=function(){p.styleSheet.cssText=d.parseCSS(d.getCSS(b.styleSheets,"all")),d.writeHTML()},d.restoreHTML=function(){o.innerHTML="",m.removeChild(o),m.appendChild(r)},d._afterPrint=function(){d.restoreHTML(),p.styleSheet.cssText=""},s(b),s(l);d.disablePP||(n.insertBefore(p,n.firstChild),p.media="print",p.className="iepp-printshim",a.attachEvent("onbeforeprint",d._beforePrint),a.attachEvent("onafterprint",d._afterPrint))}(a,b),e._version=d,e._prefixes=n,e._domPrefixes=o,e.mq=u,e.testProp=function(a){return C([a])},e.testAllProps=D,e.testStyles=t,g.className=g.className.replace(/\bno-js\b/,"")+(f?" js "+s.join(" "):"");return e}(this,this.document),function(a,b){function u(){r(!0)}a.respond={},respond.update=function(){},respond.mediaQueriesSupported=b;if(!b){var c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=j.getElementsByTagName("link"),l=[],m=function(){var b=k,c=b.length,d=0,e,f,g,i;for(;d<c;d++)e=b[d],f=e.href,g=e.media,i=e.rel&&e.rel.toLowerCase()==="stylesheet",!!f&&i&&!h[f]&&(!/^([a-zA-Z]+?:(\/\/)?(www\.)?)/.test(f)||f.replace(RegExp.$1,"").split("/")[0]===a.location.host?l.push({href:f,media:g}):h[f]=!0);n()},n=function(){if(l.length){var a=l.shift();s(a.href,function(b){o(b,a.href,a.media),h[a.href]=!0,n()})}},o=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]+\{[^\}\{]+\})+/gi),g=d&&d.length||0,b=b.substring(0,b.lastIndexOf("/")),h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c,j=0,k,l,m,n,o;b.length&&(b+="/"),i&&(g=1);for(;j<g;j++){k=0,i?(l=c,f.push(h(a))):(l=d[j].match(/@media ([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),n=l.split(","),o=n.length;for(;k<o;k++)m=n[k],e.push({media:m.match(/(only\s+)?([a-zA-Z]+)(\sand)?/)&&RegExp.$2,rules:f.length-1,minw:m.match(/\(min\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1),maxw:m.match(/\(max\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1)})}r()},p,q,r=function(a){var b="clientWidth",h=d[b],l=c.compatMode==="CSS1Compat"&&h||c.body[b]||h,m={},n=c.createDocumentFragment(),o=k[k.length-1],s=(new Date).getTime();if(a&&p&&s-p<i)clearTimeout(q),q=setTimeout(r,i);else{p=s;for(var t in e){var u=e[t];if(!u.minw&&!u.maxw||(!u.minw||u.minw&&l>=u.minw)&&(!u.maxw||u.maxw&&l<=u.maxw))m[u.media]||(m[u.media]=[]),m[u.media].push(f[u.rules])}for(var t in g)g[t]&&g[t].parentNode===j&&j.removeChild(g[t]);for(var t in m){var v=c.createElement("style"),w=m[t].join("\n");v.type="text/css",v.media=t,v.styleSheet?v.styleSheet.cssText=w:v.appendChild(c.createTextNode(w)),n.appendChild(v),g.push(v)}j.insertBefore(n,o.nextSibling)}},s=function(a,b){var c=t();if(!!c){c.open("GET",a,!0),c.onreadystatechange=function(){c.readyState==4&&(c.status==200||c.status==304)&&b(c.responseText)};if(c.readyState==4)return;c.send()}},t=function(){var a=!1,b=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new XMLHttpRequest}],c=b.length;while(c--){try{a=b[c]()}catch(d){continue}break}return function(){return a}}();m(),respond.update=m,a.addEventListener?a.addEventListener("resize",u,!1):a.attachEvent&&a.attachEvent("onresize",u)}}(this,Modernizr.mq("only all")),function(a,b,c){function k(a){return!a||a=="loaded"||a=="complete"}function j(){var a=1,b=-1;while(p.length- ++b)if(p[b].s&&!(a=p[b].r))break;a&&g()}function i(a){var c=b.createElement("script"),d;c.src=a.s,c.onreadystatechange=c.onload=function(){!d&&k(c.readyState)&&(d=1,j(),c.onload=c.onreadystatechange=null)},m(function(){d||(d=1,j())},H.errorTimeout),a.e?c.onload():n.parentNode.insertBefore(c,n)}function h(a){var c=b.createElement("link"),d;c.href=a.s,c.rel="stylesheet",c.type="text/css",!a.e&&(w||r)?function a(b){m(function(){if(!d)try{b.sheet.cssRules.length?(d=1,j()):a(b)}catch(c){c.code==1e3||c.message=="security"||c.message=="denied"?(d=1,m(function(){j()},0)):a(b)}},0)}(c):(c.onload=function(){d||(d=1,m(function(){j()},0))},a.e&&c.onload()),m(function(){d||(d=1,j())},H.errorTimeout),!a.e&&n.parentNode.insertBefore(c,n)}function g(){var a=p.shift();q=1,a?a.t?m(function(){a.t=="c"?h(a):i(a)},0):(a(),j()):q=0}function f(a,c,d,e,f,h){function i(){!o&&k(l.readyState)&&(r.r=o=1,!q&&j(),l.onload=l.onreadystatechange=null,m(function(){u.removeChild(l)},0))}var l=b.createElement(a),o=0,r={t:d,s:c,e:h};l.src=l.data=c,!s&&(l.style.display="none"),l.width=l.height="0",a!="object"&&(l.type=d),l.onload=l.onreadystatechange=i,a=="img"?l.onerror=i:a=="script"&&(l.onerror=function(){r.e=r.r=1,g()}),p.splice(e,0,r),u.insertBefore(l,s?null:n),m(function(){o||(u.removeChild(l),r.r=r.e=o=1,j())},H.errorTimeout)}function e(a,b,c){var d=b=="c"?z:y;q=0,b=b||"j",C(a)?f(d,a,b,this.i++,l,c):(p.splice(this.i++,0,a),p.length==1&&g());return this}function d(){var a=H;a.loader={load:e,i:0};return a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=r&&!s,u=s?l:n.parentNode,v=a.opera&&o.call(a.opera)=="[object Opera]",w="webkitAppearance"in l.style,x=w&&"async"in b.createElement("script"),y=r?"object":v||x?"img":"script",z=w?"img":y,A=Array.isArray||function(a){return o.call(a)=="[object Array]"},B=function(a){return typeof a=="object"},C=function(a){return typeof a=="string"},D=function(a){return o.call(a)=="[object Function]"},E=[],F={},G,H;H=function(a){function f(a){var b=a.split("!"),c=E.length,d=b.pop(),e=b.length,f={url:d,origUrl:d,prefixes:b},g,h;for(h=0;h<e;h++)g=F[b[h]],g&&(f=g(f));for(h=0;h<c;h++)f=E[h](f);return f}function e(a,b,e,g,h){var i=f(a),j=i.autoCallback;if(!i.bypass){b&&(b=D(b)?b:b[a]||b[g]||b[a.split("/").pop().split("?")[0]]);if(i.instead)return i.instead(a,b,e,g,h);e.load(i.url,i.forceCSS||!i.forceJS&&/css$/.test(i.url)?"c":c,i.noexec),(D(b)||D(j))&&e.load(function(){d(),b&&b(i.origUrl,h,g),j&&j(i.origUrl,h,g)})}}function b(a,b){function c(a){if(C(a))e(a,h,b,0,d);else if(B(a))for(i in a)a.hasOwnProperty(i)&&e(a[i],h,b,i,d)}var d=!!a.test,f=d?a.yep:a.nope,g=a.load||a.both,h=a.callback,i;c(f),c(g),a.complete&&b.load(a.complete)}var g,h,i=this.yepnope.loader;if(C(a))e(a,0,i,0);else if(A(a))for(g=0;g<a.length;g++)h=a[g],C(h)?e(h,0,i,0):A(h)?H(h):B(h)&&b(h,i);else B(a)&&b(a,i)},H.addPrefix=function(a,b){F[a]=b},H.addFilter=function(a){E.push(a)},H.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",G=function(){b.removeEventListener("DOMContentLoaded",G,0),b.readyState="complete"},0)),a.yepnope=d()}(this,this.document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
... ...
@@ -40,7 +40,7 @@ function testFeatures() {
40 40
 function addDivLines(){
41 41
   $('div.highlight pre code').each(function(el){
42 42
     var content = bonzo(el).html();
43
-    var lines = content.split('\n');
43
+    var lines = content.replace(/\s*$/g, '').split('\n');
44 44
     var count = lines.length;
45 45
     bonzo(lines).each(function(line, index){
46 46
       if(line == '') line = ' ';
... ...
@@ -63,9 +63,48 @@ function preToTable(){
63 63
     $(code).html(table);
64 64
   });
65 65
 }
66
+
67
+function flashVideoFallback(){
68
+  var flashplayerlocation = "/assets/jwplayer/player.swf",
69
+  flashplayerskin = "/assets/jwplayer/glow/glow.xml";
70
+  $('video').each(function(video){
71
+    video = $(video);
72
+    if(!Modernizr.video.h264 && swfobject.getFlashPlayerVersion() || window.location.hash.indexOf("flash-test") != -1){
73
+      video.children('source[src$=mp4]').first().map(function(source){;
74
+        var src = $(source).attr('src'),
75
+        id = 'video_'+Math.round(1 + Math.random()*(100000)),
76
+        width = video.attr('width'),
77
+        height = parseInt(video.attr('height')) + 30;
78
+        video.after('<div class="flash-video" style="width: '+width+'px; height: '+height+'px;"><div><div id='+id+'>');
79
+        swfobject.embedSWF(flashplayerlocation, id, width, height + 30, "9.0.0",
80
+          { file : src, image : video.attr('poster'), skin : flashplayerskin } ,
81
+          { movie : src, wmode : "opaque", allowfullscreen : "true" });
82
+      });
83
+      video.remove();
84
+    }
85
+  });
86
+}
87
+
88
+function wrapFlashVideos(){
89
+  $('object').each(function(object){
90
+    object = $(object);
91
+    if(object.children('param[name=movie]')){
92
+      var wrapper = object.before('<div class="flash-video"><div>').previous();
93
+      $(wrapper).children().append(object);
94
+    }
95
+  });
96
+  $('iframe[src*=vimeo],iframe[src*=youtube]').each(function(iframe){
97
+    iframe = $(iframe);
98
+    var wrapper = iframe.before('<div class="flash-video"><div>').previous();
99
+    $(wrapper).children().append(iframe);
100
+  });
101
+}
102
+
66 103
 $.domReady(function(){
67 104
   testFeatures();
68 105
   addDivLines();
106
+  flashVideoFallback();
107
+  wrapFlashVideos();
69 108
   preToTable();
70 109
   getNav();
71 110
   addSidebarToggler();
... ...
@@ -91,3 +130,17 @@ $.domReady(function(){
91 91
     doc[addEvent](type, fix, true);
92 92
   }
93 93
 }(document));
94
+
95
+/*!	SWFObject v2.2 modified by Brandon Mathis to contain only what is necessary to dynamically embed flash objects
96
+  * Uncompressed source in javascripts/libs/swfobject-dynamic.js
97
+  * <http://code.google.com/p/swfobject/>
98
+	released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
99
+*/
100
+var swfobject=function(){function s(a,b,d){var q,k=n(d);if(g.wk&&g.wk<312)return q;if(k){if(typeof a.id==l)a.id=d;if(g.ie&&g.win){var e="",c;for(c in a)if(a[c]!=Object.prototype[c])c.toLowerCase()=="data"?b.movie=a[c]:c.toLowerCase()=="styleclass"?e+=' class="'+a[c]+'"':c.toLowerCase()!="classid"&&(e+=" "+c+'="'+a[c]+'"');c="";for(var f in b)b[f]!=Object.prototype[f]&&(c+='<param name="'+f+'" value="'+b[f]+'" />');k.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+e+">"+c+
101
+"</object>";q=n(a.id)}else{f=i.createElement(o);f.setAttribute("type",m);for(var h in a)a[h]!=Object.prototype[h]&&(h.toLowerCase()=="styleclass"?f.setAttribute("class",a[h]):h.toLowerCase()!="classid"&&f.setAttribute(h,a[h]));for(e in b)b[e]!=Object.prototype[e]&&e.toLowerCase()!="movie"&&(a=f,c=e,h=b[e],d=i.createElement("param"),d.setAttribute("name",c),d.setAttribute("value",h),a.appendChild(d));k.parentNode.replaceChild(f,k);q=f}}return q}function n(a){var b=null;try{b=i.getElementById(a)}catch(d){}return b}
102
+function t(a){var b=g.pv,a=a.split(".");a[0]=parseInt(a[0],10);a[1]=parseInt(a[1],10)||0;a[2]=parseInt(a[2],10)||0;return b[0]>a[0]||b[0]==a[0]&&b[1]>a[1]||b[0]==a[0]&&b[1]==a[1]&&b[2]>=a[2]?!0:!1}function u(a){return/[\\\"<>\.;]/.exec(a)!=null&&typeof encodeURIComponent!=l?encodeURIComponent(a):a}var l="undefined",o="object",m="application/x-shockwave-flash",v=window,i=document,j=navigator,g=function(){var a=typeof i.getElementById!=l&&typeof i.getElementsByTagName!=l&&typeof i.createElement!=l,
103
+b=j.userAgent.toLowerCase(),d=j.platform.toLowerCase(),g=d?/win/.test(d):/win/.test(b),d=d?/mac/.test(d):/mac/.test(b),b=/webkit/.test(b)?parseFloat(b.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,k=!+"\u000b1",e=[0,0,0],c=null;if(typeof j.plugins!=l&&typeof j.plugins["Shockwave Flash"]==o){if((c=j.plugins["Shockwave Flash"].description)&&!(typeof j.mimeTypes!=l&&j.mimeTypes[m]&&!j.mimeTypes[m].enabledPlugin))k=!1,c=c.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),e[0]=parseInt(c.replace(/^(.*)\..*$/,"$1"),
104
+10),e[1]=parseInt(c.replace(/^.*\.(.*)\s.*$/,"$1"),10),e[2]=/[a-zA-Z]/.test(c)?parseInt(c.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}else if(typeof v.ActiveXObject!=l)try{var f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(f&&(c=f.GetVariable("$version")))k=!0,c=c.split(" ")[1].split(","),e=[parseInt(c[0],10),parseInt(c[1],10),parseInt(c[2],10)]}catch(h){}return{w3:a,pv:e,wk:b,ie:k,win:g,mac:d}}();return{embedSWF:function(a,b,d,i,k,e,c,f,h){var j={success:!1,id:b};if(g.w3&&!(g.wk&&g.wk<312)&&
105
+a&&b&&d&&i&&k){d+="";i+="";var p={};if(f&&typeof f===o)for(var m in f)p[m]=f[m];p.data=a;p.width=d;p.height=i;a={};if(c&&typeof c===o)for(var n in c)a[n]=c[n];if(e&&typeof e===o)for(var r in e)typeof a.flashvars!=l?a.flashvars+="&"+r+"="+e[r]:a.flashvars=r+"="+e[r];if(t(k))b=s(p,a,b),j.success=!0,j.ref=b}h&&h(j)},ua:g,getFlashPlayerVersion:function(){return{major:g.pv[0],minor:g.pv[1],release:g.pv[2]}},hasFlashPlayerVersion:t,createSWF:function(a,b,d){if(g.w3)return s(a,b,d)},getQueryParamValue:function(a){var b=
106
+i.location.search||i.location.hash;if(b){/\?/.test(b)&&(b=b.split("?")[1]);if(a==null)return u(b);for(var b=b.split("&"),d=0;d<b.length;d++)if(b[d].substring(0,b[d].indexOf("="))==a)return u(b[d].substring(b[d].indexOf("=")+1))}return""}}}();
107
+