aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinweiClarkChao <[email protected]>2014-02-20 12:50:15 +0800
committerJinweiClarkChao <[email protected]>2014-02-20 12:52:51 +0800
commit31fb10f393fbfd4d7adf528ec70624d2b8d247a8 (patch)
tree1009bb2a4f5fe89b8bc822b68104018ea8df5261 /Blocks/Flipboard/js
parentbe404e3e01ca839e730c884309c25abef10863c9 (diff)
downloadjinwei.me-31fb10f393fbfd4d7adf528ec70624d2b8d247a8.tar.gz
Six Blocks Version
Diffstat (limited to 'Blocks/Flipboard/js')
-rw-r--r--Blocks/Flipboard/js/core.string.js240
-rw-r--r--Blocks/Flipboard/js/jquery.flips.js965
-rw-r--r--Blocks/Flipboard/js/jquery.history.js1
-rw-r--r--Blocks/Flipboard/js/jquery.tmpl.min.js1
-rw-r--r--Blocks/Flipboard/js/jquery.touchSwipe-1.2.5.js478
-rw-r--r--Blocks/Flipboard/js/modernizr.custom.08464.js4
6 files changed, 1689 insertions, 0 deletions
diff --git a/Blocks/Flipboard/js/core.string.js b/Blocks/Flipboard/js/core.string.js
new file mode 100644
index 0000000..312a42e
--- /dev/null
+++ b/Blocks/Flipboard/js/core.string.js
@@ -0,0 +1,240 @@
1/**
2 * @depends nothing
3 * @name core.string
4 * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
5 */
6
7/**
8 * Return a new string with any spaces trimmed the left and right of the string
9 * @version 1.0.0
10 * @date June 30, 2010
11 * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
12 * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
13 * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
14 * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
15 */
16String.prototype.trim = String.prototype.trim || function() {
17 // Trim off any whitespace from the front and back
18 return this.replace(/^\s+|\s+$/g, '');
19};
20
21/**
22 * Return a new string with the value stripped from the left and right of the string
23 * @version 1.1.1
24 * @date July 22, 2010
25 * @since 1.0.0, June 30, 2010
26 * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
27 * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
28 * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
29 * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
30 */
31String.prototype.strip = String.prototype.strip || function(value,regex){
32 // Strip a value from left and right, with optional regex support (defaults to false)
33 value = String(value);
34 var str = this;
35 if ( value.length ) {
36 if ( !(regex||false) ) {
37 // We must escape value as we do not want regex support
38 value = value.replace(/([\[\]\(\)\^\$\.\?\|\/\\])/g, '\\$1');
39 }
40 str = str.replace(eval('/^'+value+'+|'+value+'+$/g'), '');
41 }
42 return String(str);
43}
44
45/**
46 * Return a new string with the value stripped from the left of the string
47 * @version 1.1.1
48 * @date July 22, 2010
49 * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
50 * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
51 * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
52 * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
53 */
54String.prototype.stripLeft = String.prototype.stripLeft || function(value,regex){
55 // Strip a value from the left, with optional regex support (defaults to false)
56 value = String(value);
57 var str = this;
58 if ( value.length ) {
59 if ( !(regex||false) ) {
60 // We must escape value as we do not want regex support
61 value = value.replace(/([\[\]\(\)\^\$\.\?\|\/\\])/g, '\\$1');
62 }
63 str = str.replace(eval('/^'+value+'+/g'), '');
64 }
65 return String(str);
66}
67
68/**
69 * Return a new string with the value stripped from the right of the string
70 * @version 1.1.1
71 * @date July 22, 2010
72 * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
73 * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
74 * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
75 * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
76 */
77String.prototype.stripRight = String.prototype.stripRight || function(value,regex){
78 // Strip a value from the right, with optional regex support (defaults to false)
79 value = String(value);
80 var str = this;
81 if ( value.length ) {
82 if ( !(regex||false) ) {
83 // We must escape value as we do not want regex support
84 value = value.replace(/([\[\]\(\)\^\$\.\?\|\/\\])/g, '\\$1');
85 }
86 str = str.replace(eval('/'+value+'+$/g'), '');
87 }
88 return String(str);
89}
90
91/**
92 * Return a int of the string
93 * @version 1.0.0
94 * @date June 30, 2010
95 * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
96 * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
97 * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
98 * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
99 */
100String.prototype.toInt = String.prototype.toInt || function(){
101 // Convert to a Integer
102 return parseInt(this,10);
103};
104
105/**
106 * Return a new string of the old string wrapped with the start and end values
107 * @version 1.0.0
108 * @date June 30, 2010
109 * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
110 * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
111 * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
112 * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
113 */
114String.prototype.wrap = String.prototype.wrap || function(start,end){
115 // Wrap the string
116 return start+this+end;
117};
118
119/**
120 * Return a new string of a selection of the old string wrapped with the start and end values
121 * @version 1.0.0
122 * @date June 30, 2010
123 * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
124 * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
125 * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
126 * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
127 */
128String.prototype.wrapSelection = String.prototype.wrapSelection || function(start,end,a,z){
129 // Wrap the selection
130 if ( typeof a === 'undefined' || a === null ) a = this.length;
131 if ( typeof z === 'undefined' || z === null ) z = this.length;
132 return this.substring(0,a)+start+this.substring(a,z)+end+this.substring(z);
133};
134
135/**
136 * Return a new string of the slug of the old string
137 * @version 1.1.0
138 * @date July 16, 2010
139 * @since 1.0.0, June 30, 2010
140 * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
141 * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
142 * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
143 * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
144 */
145String.prototype.toSlug = String.prototype.toSlug || function(){
146 // Convert a string to a slug
147 return this.toLowerCase().replace(/[\s_]/g, '-').replace(/[^-a-z0-9]/g, '').replace(/--+/g, '-').replace(/^-+|-+$/g,'');
148}
149
150/**
151 * Return a new JSON object of the old string.
152 * Turns:
153 * file.js?a=1&amp;b.c=3.0&b.d=four&a_false_value=false&a_null_value=null
154 * Into:
155 * {"a":1,"b":{"c":3,"d":"four"},"a_false_value":false,"a_null_value":null}
156 * @version 1.1.0
157 * @date July 16, 2010
158 * @since 1.0.0, June 30, 2010
159 * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
160 * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
161 * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
162 * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
163 */
164String.prototype.queryStringToJSON = String.prototype.queryStringToJSON || function ( )
165{ // Turns a params string or url into an array of params
166 // Prepare
167 var params = String(this);
168 // Remove url if need be
169 params = params.substring(params.indexOf('?')+1);
170 // params = params.substring(params.indexOf('#')+1);
171 // Change + to %20, the %20 is fixed up later with the decode
172 params = params.replace(/\+/g, '%20');
173 // Do we have JSON string
174 if ( params.substring(0,1) === '{' && params.substring(params.length-1) === '}' )
175 { // We have a JSON string
176 return eval(decodeURIComponent(params));
177 }
178 // We have a params string
179 params = params.split(/\&(amp\;)?/);
180 var json = {};
181 // We have params
182 for ( var i = 0, n = params.length; i < n; ++i )
183 {
184 // Adjust
185 var param = params[i] || null;
186 if ( param === null ) { continue; }
187 param = param.split('=');
188 if ( param === null ) { continue; }
189 // ^ We now have "var=blah" into ["var","blah"]
190
191 // Get
192 var key = param[0] || null;
193 if ( key === null ) { continue; }
194 if ( typeof param[1] === 'undefined' ) { continue; }
195 var value = param[1];
196 // ^ We now have the parts
197
198 // Fix
199 key = decodeURIComponent(key);
200 value = decodeURIComponent(value);
201 try {
202 // value can be converted
203 value = eval(value);
204 } catch ( e ) {
205 // value is a normal string
206 }
207
208 // Set
209 // window.console.log({'key':key,'value':value}, split);
210 var keys = key.split('.');
211 if ( keys.length === 1 )
212 { // Simple
213 json[key] = value;
214 }
215 else
216 { // Advanced (Recreating an object)
217 var path = '',
218 cmd = '';
219 // Ensure Path Exists
220 $.each(keys,function(ii,key){
221 path += '["'+key.replace(/"/g,'\\"')+'"]';
222 jsonCLOSUREGLOBAL = json; // we have made this a global as closure compiler struggles with evals
223 cmd = 'if ( typeof jsonCLOSUREGLOBAL'+path+' === "undefined" ) jsonCLOSUREGLOBAL'+path+' = {}';
224 eval(cmd);
225 json = jsonCLOSUREGLOBAL;
226 delete jsonCLOSUREGLOBAL;
227 });
228 // Apply Value
229 jsonCLOSUREGLOBAL = json; // we have made this a global as closure compiler struggles with evals
230 valueCLOSUREGLOBAL = value; // we have made this a global as closure compiler struggles with evals
231 cmd = 'jsonCLOSUREGLOBAL'+path+' = valueCLOSUREGLOBAL';
232 eval(cmd);
233 json = jsonCLOSUREGLOBAL;
234 delete jsonCLOSUREGLOBAL;
235 delete valueCLOSUREGLOBAL;
236 }
237 // ^ We now have the parts added to your JSON object
238 }
239 return json;
240}; \ No newline at end of file
diff --git a/Blocks/Flipboard/js/jquery.flips.js b/Blocks/Flipboard/js/jquery.flips.js
new file mode 100644
index 0000000..5c25d87
--- /dev/null
+++ b/Blocks/Flipboard/js/jquery.flips.js
@@ -0,0 +1,965 @@
1/**
2 * jquery.flips.js
3 *
4 * Copyright 2011, Pedro Botelho / Codrops
5 * Free to use under the MIT license.
6 *
7 * Date: Fri May 4 2012
8 */
9
10/**
11 * Note: This is highly experimental and just a proof-of-concept!
12 * There are some few "hacks", probably some bugs, and some functionality
13 * is incomplete... definitely not ready for a production environment.
14 *
15 *
16 * Tested and working on:
17 * - Google Chrome 18.0.1025.168
18 * - Apple Safari 5.1.5
19 * - Apple Safari 5.1 Mobile
20 *
21 */
22
23(function( window, undefined ) {
24
25 $.Flips = function( options, element ) {
26
27 this.$el = $( element );
28 this._init( options );
29
30 };
31
32 $.Flips.defaults = {
33 flipspeed : 900,
34 fliptimingfunction : 'linear',
35 current : 0
36 };
37
38 $.Flips.prototype = {
39 _init : function( options ) {
40
41 this.options = $.extend( true, {}, $.Flips.defaults, options );
42 this.$pages = this.$el.children( 'div.f-page' );
43 this.pagesCount = this.$pages.length;
44 this.History = window.History;
45 this.currentPage = this.options.current;
46 this._validateOpts();
47 this._getWinSize();
48 this._getState();
49 this._layout();
50 this._initTouchSwipe();
51 this._loadEvents();
52 this._goto();
53
54 },
55 _validateOpts : function() {
56
57 if( this.currentPage < 0 || this.currentPage > this.pagesCount ) {
58
59 this.currentPage = 0;
60
61 }
62
63 },
64 _getWinSize : function() {
65
66 var $win = $( window );
67
68 this.windowProp = {
69 width : $win.width(),
70 height : $win.height()
71 };
72
73 },
74 _goto : function() {
75
76 var page = ( this.state === undefined ) ? this.currentPage : this.state;
77
78 if( !this._isNumber( page ) || page < 0 || page > this.flipPagesCount ) {
79
80 page = 0;
81
82 }
83
84 this.currentPage = page;
85
86 },
87 _getState : function() {
88
89 this.state = this.History.getState().url.queryStringToJSON().page;
90
91 },
92 _isNumber : function( n ) {
93
94 return parseFloat( n ) == parseInt( n ) && !isNaN( n ) && isFinite( n );
95
96 },
97 _adjustLayout : function( page ) {
98
99 var _self = this;
100
101 this.$flipPages.each( function( i ) {
102
103 var $page = $(this);
104
105 if( i === page - 1 ) {
106
107 $page.css({
108 '-webkit-transform' : 'rotateY( -180deg )',
109 '-moz-transform' : 'rotateY( -180deg )',
110 'z-index' : _self.flipPagesCount - 1 + i
111 });
112
113 }
114 else if( i < page ) {
115
116 $page.css({
117 '-webkit-transform' : 'rotateY( -181deg )', // todo: fix this (should be -180deg)
118 '-moz-transform' : 'rotateY( -181deg )', // todo: fix this (should be -180deg)
119 'z-index' : _self.flipPagesCount - 1 + i
120 });
121
122 }
123 else {
124
125 $page.css({
126 '-webkit-transform' : 'rotateY( 0deg )',
127 '-moz-transform' : 'rotateY( 0deg )',
128 'z-index' : _self.flipPagesCount - 1 - i
129 });
130
131 }
132
133 } );
134
135 },
136 _saveState : function() {
137
138 // adds a new state to the history object and triggers the statechange event on the window
139 var page = this.currentPage;
140
141 if( this.History.getState().url.queryStringToJSON().page !== page ) {
142
143 this.History.pushState( null, null, '?page=' + page );
144
145 }
146
147 },
148 _layout : function() {
149
150 this._setLayoutSize();
151
152 for( var i = 0; i <= this.pagesCount - 2; ++i ) {
153
154 var $page = this.$pages.eq( i ),
155 pageData = {
156 theClass : 'page',
157 theContentFront : $page.html(),
158 theContentBack : ( i !== this.pagesCount ) ? this.$pages.eq( i + 1 ).html() : '',
159 theStyle : 'z-index: ' + ( this.pagesCount - i ) + ';left: ' + ( this.windowProp.width / 2 ) + 'px;',
160 theContentStyleFront : 'width:' + this.windowProp.width + 'px;',
161 theContentStyleBack : 'width:' + this.windowProp.width + 'px;'
162 };
163
164 if( i === 0 ) {
165
166 pageData.theClass += ' cover';
167
168 }
169 else {
170
171 pageData.theContentStyleFront += 'left:-' + ( this.windowProp.width / 2 ) + 'px';
172
173 if( i === this.pagesCount - 2 ) {
174
175 pageData.theClass += ' cover-back';
176
177 }
178
179 }
180
181 $( '#pageTmpl' ).tmpl( pageData ).appendTo( this.$el );
182
183 }
184
185 this.$pages.remove();
186 this.$flipPages = this.$el.children( 'div.page' );
187 this.flipPagesCount = this.$flipPages.length;
188
189 this._adjustLayout( ( this.state === undefined ) ? this.currentPage : this.state );
190
191 },
192 _setLayoutSize : function() {
193
194 this.$el.css( {
195 width : this.windowProp.width,
196 height : this.windowProp.height
197 } );
198
199 },
200 _initTouchSwipe : function() {
201
202 var _self = this;
203
204 this.$el.swipe( {
205 threshold : 0,
206 swipeStatus : function( event, phase, start, end, direction, distance ) {
207
208 var startX = start.x,
209 endX = end.x,
210 sym, angle,
211 oob = false,
212 noflip = false;
213
214 // check the "page direction" to flip:
215 // if the page flips from the right to the left (right side page)
216 // or from the left to the right (left side page).
217 // check only if not animating
218 if( !_self._isAnimating() ) {
219
220 ( startX < _self.windowProp.width / 2 ) ? _self.flipSide = 'l2r' : _self.flipSide = 'r2l';
221
222 }
223
224 if( direction === 'up' || direction === 'down' ) {
225
226 if( _self.angle === undefined || _self.angle === 0 ) {
227
228 _self._removeOverlays();
229 return false;
230
231 }
232 else {
233
234 ( _self.angle < 90 ) ? direction = 'right' : direction = 'left';
235
236 }
237
238 };
239
240 _self.flipDirection = direction;
241
242 // on the first & last page neighbors we don't flip
243 if( _self.currentPage === 0 && _self.flipSide === 'l2r' || _self.currentPage === _self.flipPagesCount && _self.flipSide === 'r2l' ) {
244
245 return false;
246
247 }
248
249 // save ending point (symetric point):
250 // if we touch / start dragging on, say [x=10], then
251 // we need to drag until [window's width - 10] in order to flip the page 100%.
252 // if the symetric point is too close we are giving some margin:
253 // if we would start dragging right next to [window's width / 2] then
254 // the symmetric point would be very close to the starting point. A very short swipe
255 // would be enough to flip the page..
256 sym = _self.windowProp.width - startX;
257
258 var symMargin = 0.9 * ( _self.windowProp.width / 2 );
259 if( Math.abs( startX - sym ) < symMargin ) {
260
261 ( _self.flipSide === 'r2l' ) ? sym -= symMargin / 2 : sym += symMargin / 2;
262
263 }
264
265 // some special cases:
266 // Page is on the right side,
267 // and we drag/swipe to the same direction
268 // ending on a point > than the starting point
269 // -----------------------
270 // | | |
271 // | | |
272 // | sym | s |
273 // | | e |
274 // | | |
275 // -----------------------
276 if( endX > startX && _self.flipSide === 'r2l' ) {
277
278 angle = 0;
279 oob = true;
280 noflip = true;
281
282 }
283 // Page is on the right side,
284 // and we drag/swipe to the opposite direction
285 // ending on a point < than the symmetric point
286 // -----------------------
287 // | | |
288 // | | |
289 // | sym | s |
290 // | e | |
291 // | | |
292 // -----------------------
293 else if( endX < sym && _self.flipSide === 'r2l' ) {
294
295 angle = 180;
296 oob = true;
297
298 }
299 // Page is on the left side,
300 // and we drag/swipe to the opposite direction
301 // ending on a point > than the symmetric point
302 // -----------------------
303 // | | |
304 // | | |
305 // | s | sym |
306 // | | e |
307 // | | |
308 // -----------------------
309 else if( endX > sym && _self.flipSide === 'l2r' ) {
310
311 angle = 0;
312 oob = true;
313
314 }
315 // Page is on the left side,
316 // and we drag/swipe to the same direction
317 // ending on a point < than the starting point
318 // -----------------------
319 // | | |
320 // | | |
321 // | s | sym |
322 // | e | |
323 // | | |
324 // -----------------------
325 else if( endX < startX && _self.flipSide === 'l2r' ) {
326
327 angle = 180;
328 oob = true;
329 noflip = true;
330
331 }
332 // we drag/swipe to a point between
333 // the starting point and symetric point
334 // -----------------------
335 // | | |
336 // | s | sym |
337 // | sym | s |
338 // | e| |
339 // | | |
340 // -----------------------
341 else {
342
343 var s, e, val;
344
345 ( _self.flipSide === 'r2l' ) ?
346 ( s = startX, e = sym, val = startX - distance ) :
347 ( s = sym, e = startX , val = startX + distance );
348
349 angle = _self._calcAngle( val, s, e );
350
351 if( ( direction === 'left' && _self.flipSide === 'l2r' ) || ( direction === 'right' && _self.flipSide === 'r2l' ) ) {
352
353 noflip = true;
354
355 }
356
357 }
358
359 switch( phase ) {
360
361 case 'start' :
362
363 if( _self._isAnimating() ) {
364
365 // the user can still grab a page while one is flipping (in this case not being able to move)
366 // and once the page is flipped the move/touchmove events are triggered..
367 _self.start = true;
368 return false;
369
370 }
371 else {
372
373 _self.start = false;
374
375 }
376
377 // check which page is clicked/touched
378 _self._setFlippingPage();
379
380 // check which page comes before & after the one we are clicking
381 _self.$beforePage = _self.$flippingPage.prev();
382 _self.$afterPage = _self.$flippingPage.next();
383
384 break;
385
386 case 'move' :
387
388 if( distance > 0 ) {
389
390 if( _self._isAnimating() || _self.start ) {
391
392 return false;
393
394 }
395
396 // adds overlays: shows shadows while flipping
397 if( !_self.hasOverlays ) {
398
399 _self._addOverlays();
400
401 }
402
403 // save last angle
404 _self.angle = angle;
405 // we will update the rotation value of the page while we move it
406 _self._turnPage( angle , true );
407
408 }
409 break;
410
411 case 'end' :
412
413 if( distance > 0 ) {
414
415 if( _self._isAnimating() || _self.start ) return false;
416
417 _self.isAnimating = true;
418
419 // keep track if the page was actually flipped or not
420 // the data flip will be used later on the transitionend event
421 ( noflip ) ? _self.$flippingPage.data( 'flip', false ) : _self.$flippingPage.data( 'flip', true );
422
423 // if out of bounds we will "manually" flip the page,
424 // meaning there will be no transition set
425 if( oob ) {
426
427 if( !noflip ) {
428
429 // the page gets flipped (user dragged from the starting point until the symmetric point)
430 // update current page
431 _self._updatePage();
432
433 }
434
435 _self._onEndFlip( _self.$flippingPage );
436
437 }
438 else {
439
440 // save last angle
441 _self.angle = angle;
442 // calculate the speed to flip the page:
443 // the speed will depend on the current angle.
444 _self._calculateSpeed();
445
446 switch( direction ) {
447
448 case 'left' :
449
450 _self._turnPage( 180 );
451
452 if( _self.flipSide === 'r2l' ) {
453
454 _self._updatePage();
455
456 }
457
458 break;
459
460 case 'right' :
461
462 _self._turnPage( 0 );
463
464 if( _self.flipSide === 'l2r' ) {
465
466 _self._updatePage();
467
468 }
469
470 break;
471
472 };
473
474 }
475
476 }
477
478 break;
479
480 };
481
482 }
483
484 } );
485
486 },
487 _setFlippingPage : function() {
488
489 var _self = this;
490
491 ( this.flipSide === 'l2r' ) ?
492 this.$flippingPage = this.$flipPages.eq( this.currentPage - 1 ) :
493 this.$flippingPage = this.$flipPages.eq( this.currentPage );
494
495 this.$flippingPage.on( 'webkitTransitionEnd.flips transitionend.flips OTransitionEnd.flips', function( event ) {
496
497 if( $( event.target ).hasClass( 'page' ) ) {
498
499 _self._onEndFlip( $(this) );
500
501 }
502
503 });
504
505 },
506 _updatePage : function() {
507
508 if( this.flipSide === 'r2l' ) {
509
510 ++this.currentPage;
511
512 }
513 else if( this.flipSide === 'l2r' ) {
514
515 --this.currentPage;
516
517 }
518
519 },
520 _isAnimating : function() {
521
522 if( this.isAnimating ) {
523
524 return true;
525
526 }
527
528 return false;
529
530 },
531 _loadEvents : function() {
532
533 var _self = this;
534
535 $( window ).on( 'resize.flips', function( event ) {
536
537 _self._getWinSize();
538 _self._setLayoutSize();
539
540 var $contentFront = _self.$flipPages.children( 'div.front' ).find( 'div.content' ),
541 $contentBack = _self.$flipPages.children( 'div.back' ).find( 'div.content' )
542
543 _self.$flipPages.css( 'left', _self.windowProp.width / 2 );
544
545 $contentFront.filter( function( i ) {
546 return i > 0;
547 }).css( {
548 width : _self.windowProp.width,
549 left : -_self.windowProp.width / 2
550 } );
551 $contentFront.eq( 0 ).css( 'width', _self.windowProp.width );
552
553 $contentBack.css( 'width', _self.windowProp.width );
554
555 } );
556
557 $( window ).on( 'statechange.flips', function( event ) {
558
559 _self._getState();
560 _self._goto();
561 if( !_self.isAnimating ) {
562
563 _self._adjustLayout( _self.currentPage );
564
565 }
566
567 } );
568
569 this.$flipPages.find( '.box' ).on( 'click.flips', function( event ) {
570
571 var $box = $(this),
572 $boxClose = $( '<span class="box-close">close</span>' ),
573 transitionProp = {
574 speed : 450,
575 timingfunction : 'linear'
576 },
577 $overlay = $( '<div class="overlay">close</div>' ).css( {
578 'z-index' : 9998,
579 '-webkit-transition' : 'opacity ' + transitionProp.speed + 'ms ' + transitionProp.timingfunction,
580 '-moz-transition' : 'opacity ' + transitionProp.speed + 'ms ' + transitionProp.timingfunction
581 } ).prependTo( $( 'body' ) ),
582 prop = {
583 width : $box.outerWidth(true),
584 height : $box.outerHeight(true),
585 left : $box.offset().left,
586 top : $box.offset().top
587 },
588 $placeholder = $box.clone().css( {
589 'position' : 'absolute',
590 'width' : prop.width,
591 'height' : prop.height,
592 'left' : prop.left,
593 'top' : prop.top,
594 'zIndex' : 9999,
595 'overflow-y' : 'auto',
596 '-webkit-transition': 'all ' + transitionProp.speed + 'ms ' + transitionProp.timingfunction,
597 '-moz-transition': 'all ' + transitionProp.speed + 'ms ' + transitionProp.timingfunction
598 } )
599 .insertAfter( $overlay )
600 .end()
601 .append( $boxClose.on( 'click.flips', function( event ) {
602
603 $overlay.css( 'opacity', 0 );
604
605 $placeholder.children().hide().end().removeClass( 'box-expanded' ).css( {
606 width : _self.windowProp.width,
607 height : _self.windowProp.height,
608 'overflow-y' : 'hidden'
609 } );
610
611 setTimeout( function() {
612 $placeholder.css( {
613 left : prop.left,
614 top : prop.top,
615 width : prop.width,
616 height : prop.height,
617 '-webkit-transition' : 'all ' + transitionProp.speed + 'ms ' + transitionProp.timingfunction,
618 '-moz-transition' : 'all ' + transitionProp.speed + 'ms ' + transitionProp.timingfunction
619 });
620 }, 0 );
621
622 }) )
623 .children()
624 .hide()
625 .end()
626 .on( 'webkitTransitionEnd.flips transitionend.flips OTransitionEnd.flips', function( event ) {
627
628 if( $( event.target ).hasClass( 'box-expanded' ) ) { // expanding
629
630 $(this).css( {
631 width : '100%',
632 height : '100%',
633 '-webkit-transition' : 'none',
634 '-moz-transition' : 'none'
635 } ).children().fadeIn();
636
637 }
638 else { // collapsing
639
640 $overlay.remove();
641 $(this).remove();
642
643 }
644
645 });
646
647 setTimeout( function() {
648
649 $overlay.css( {
650 opacity : 1
651 } );
652
653 $placeholder.addClass( 'box-expanded' ).css( {
654 left : 0,
655 top : 0,
656 width : _self.windowProp.width,
657 height : _self.windowProp.height
658 });
659
660 }, 0 );
661
662 } );
663
664 },
665 _onEndFlip : function( $page ) {
666
667 // if the page flips from left to right we will need to change the z-index of the flipped page
668 if( ( this.flipSide === 'l2r' && $page.data( 'flip' ) ) ||
669 ( this.flipSide === 'r2l' && !$page.data( 'flip' ) ) ) {
670
671 $page.css( 'z-index', this.pagesCount - 2 - $page.index() );
672
673 }
674
675 this.$flippingPage.css( {
676 '-webkit-transition' : 'none',
677 '-moz-transition' : 'none'
678 } );
679
680 // remove overlays
681 this._removeOverlays();
682 this._saveState();
683 this.isAnimating = false;
684
685 // hack (todo: issues with safari / z-indexes)
686 if( this.flipSide === 'r2l' || ( this.flipSide === 'l2r' && !$page.data( 'flip' ) ) ) {
687
688 this.$flippingPage.find('.back').css( '-webkit-transform', 'rotateY(-180deg)' );
689
690 }
691
692 },
693 // given the touch/drag start point (s), the end point (e) and a value in between (x)
694 // calculate the respective angle ( 0deg - 180deg )
695 _calcAngle : function( x, s, e ) {
696
697 return ( -180 / ( s - e ) ) * x + ( ( s * 180 ) / ( s - e ) );
698
699 },
700 // given the current angle and the default speed, calculate the respective speed to accomplish the flip
701 _calculateSpeed : function() {
702
703 ( this.flipDirection === 'right' ) ?
704 this.flipSpeed = ( this.options.flipspeed / 180 ) * this.angle :
705 this.flipSpeed = - ( this.options.flipspeed / 180 ) * this.angle + this.options.flipspeed;
706
707 },
708 _turnPage : function( angle, update ) {
709
710 // hack / todo: before page that was set to -181deg should have -180deg
711 this.$beforePage.css({
712 '-webkit-transform' : 'rotateY( -180deg )',
713 '-moz-transform' : 'rotateY( -180deg )'
714 });
715
716 // if not moving manually set a transition to flip the page
717 if( !update ) {
718
719 this.$flippingPage.css( {
720 '-webkit-transition' : '-webkit-transform ' + this.flipSpeed + 'ms ' + this.options.fliptimingfunction,
721 '-moz-transition' : '-moz-transform ' + this.flipSpeed + 'ms ' + this.options.fliptimingfunction
722 } );
723
724 }
725
726 // if page is a right side page, we need to set its z-index higher as soon the page starts to flip.
727 // this will make the page be on "top" of the left ones.
728 // note: if the flipping page is on the left side then we set the z-index after the flip is over.
729 // this is done on the _onEndFlip function.
730 var idx = ( this.flipSide === 'r2l' ) ? this.currentPage : this.currentPage - 1;
731 if( this.flipSide === 'r2l' ) {
732
733 this.$flippingPage.css( 'z-index', this.flipPagesCount - 1 + idx );
734
735 }
736
737 // hack (todo: issues with safari / z-indexes)
738 this.$flippingPage.find('.back').css( '-webkit-transform', 'rotateY(180deg)' );
739
740 // update the angle
741 this.$flippingPage.css( {
742 '-webkit-transform' : 'rotateY(-' + angle + 'deg)',
743 '-moz-transform' : 'rotateY(-' + angle + 'deg)'
744 } );
745
746 // show overlays
747 this._overlay( angle, update );
748
749 },
750 _addOverlays : function() {
751
752 var _self = this;
753
754 // remove current overlays
755 this._removeOverlays();
756
757 this.hasOverlays = true;
758
759 // overlays for the flipping page. One in the front, one in the back.
760
761 this.$frontoverlay = $( '<div class="flipoverlay"></div>' ).appendTo( this.$flippingPage.find( 'div.front > .outer' ) );
762 this.$backoverlay = $( '<div class="flipoverlay"></div>' ).appendTo( this.$flippingPage.find( 'div.back > .outer' ) )
763
764 // overlay for the page "under" the flipping page.
765 if( this.$afterPage ) {
766
767 this.$afterOverlay = $( '<div class="overlay"></div>' ).appendTo( this.$afterPage.find( 'div.front > .outer' ) );
768
769 }
770
771 // overlay for the page "before" the flipping page
772 if( this.$beforePage ) {
773
774 this.$beforeOverlay = $( '<div class="overlay"></div>' ).appendTo( this.$beforePage.find( 'div.back > .outer' ) );
775
776 }
777
778 },
779 _removeOverlays : function() {
780
781 // removes the 4 overlays
782 if( this.$frontoverlay )
783 this.$frontoverlay.remove();
784 if( this.$backoverlay )
785 this.$backoverlay.remove();
786 if( this.$afterOverlay )
787 this.$afterOverlay.remove();
788 if( this.$beforeOverlay )
789 this.$beforeOverlay.remove();
790
791 this.hasOverlays = false;
792
793 },
794 _overlay : function( angle, update ) {
795
796 // changes the opacity of each of the overlays.
797 if( update ) {
798
799 // if update is true, meaning we are manually flipping the page,
800 // we need to calculate the opacity that corresponds to the current angle
801 var afterOverlayOpacity = - ( 1 / 90 ) * angle + 1,
802 beforeOverlayOpacity = ( 1 / 90 ) * angle - 1;
803
804 if( this.$afterOverlay ) {
805
806 this.$afterOverlay.css( 'opacity', afterOverlayOpacity );
807
808 }
809 if( this.$beforeOverlay ) {
810
811 this.$beforeOverlay.css( 'opacity', beforeOverlayOpacity );
812
813 }
814
815 // the flipping page will have a fixed value.
816 // todo: add a gradient instead.
817 var flipOpacity = 0.1;
818 this.$frontoverlay.css( 'opacity', flipOpacity );
819 this.$backoverlay.css( 'opacity', flipOpacity );
820
821 }
822 else {
823
824 var _self = this;
825
826 // if we release the mouse / touchend then we will set a transition for the overlays.
827 // we will need to take in consideration the current angle, the speed (given the angle)
828 // and the delays for each overlay (the opacity of the overlay will only change
829 // when the flipping page is on the same side).
830 var afterspeed = this.flipSpeed,
831 beforespeed = this.flipSpeed,
832 margin = 60; // hack (todo: issues with safari / z-indexes)
833
834 if( this.$afterOverlay ) {
835
836 var afterdelay = 0;
837
838 if( this.flipDirection === 'right' ) {
839
840 if( this.angle > 90 ) {
841
842 afterdelay = Math.abs( this.flipSpeed - this.options.flipspeed / 2 - margin );
843 afterspeed = this.options.flipspeed / 2 - margin ;
844
845 }
846 else {
847
848 afterspeed -= margin;
849
850 }
851
852 }
853 else {
854
855 afterspeed = Math.abs( this.flipSpeed - this.options.flipspeed / 2 );
856
857 }
858
859 if( afterspeed <= 0 ) afterspeed = 1;
860
861 this.$afterOverlay.css( {
862 '-webkit-transition' : 'opacity ' + afterspeed + 'ms ' + this.options.fliptimingfunction + ' ' + afterdelay + 'ms',
863 '-moz-transition' : 'opacity ' + afterspeed + 'ms ' + this.options.fliptimingfunction + ' ' + afterdelay + 'ms',
864 'opacity' : ( this.flipDirection === 'left' ) ? 0 : 1
865 } ).on( 'webkitTransitionEnd.flips transitionend.flips OTransitionEnd.flips', function( event ) {
866 if( _self.$beforeOverlay ) _self.$beforeOverlay.off( 'webkitTransitionEnd.flips transitionend.flips OTransitionEnd.flips');
867 setTimeout( function() {
868 _self._adjustLayout(_self.currentPage);
869 }, _self.options.flipspeed / 2 - margin );
870 } );
871
872 }
873
874 if( this.$beforeOverlay ) {
875
876 var beforedelay = 0;
877
878 if( this.flipDirection === 'left' ) {
879
880 if( this.angle < 90 ) {
881
882 beforedelay = Math.abs( this.flipSpeed - this.options.flipspeed / 2 - margin ) ;
883 beforespeed = this.options.flipspeed / 2 - margin;
884
885 }
886 else {
887
888 beforespeed -= margin;
889
890 }
891
892 }
893 else {
894
895 beforespeed = Math.abs( this.flipSpeed - this.options.flipspeed / 2 );
896
897 }
898
899 if( beforespeed <= 0 ) beforespeed = 1;
900
901 this.$beforeOverlay.css( {
902 '-webkit-transition' : 'opacity ' + beforespeed + 'ms ' + this.options.fliptimingfunction + ' ' + beforedelay + 'ms',
903 '-moz-transition' : 'opacity ' + beforespeed + 'ms ' + this.options.fliptimingfunction + ' ' + beforedelay + 'ms',
904 'opacity' : ( this.flipDirection === 'left' ) ? 1 : 0
905 } ).on( 'webkitTransitionEnd.flips transitionend.flips OTransitionEnd.flips', function( event ) {
906 if( _self.$afterOverlay ) _self.$afterOverlay.off( 'webkitTransitionEnd.flips transitionend.flips OTransitionEnd.flips');
907 _self._adjustLayout(_self.currentPage);
908 } );
909
910 }
911
912 }
913
914 }
915 };
916
917 var logError = function( message ) {
918 if ( this.console ) {
919 console.error( message );
920 }
921 };
922
923 $.fn.flips = function( options ) {
924
925 if ( typeof options === 'string' ) {
926
927 var args = Array.prototype.slice.call( arguments, 1 );
928
929 this.each(function() {
930
931 var instance = $.data( this, 'flips' );
932
933 if ( !instance ) {
934 logError( "cannot call methods on flips prior to initialization; " +
935 "attempted to call method '" + options + "'" );
936 return;
937 }
938
939 if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
940 logError( "no such method '" + options + "' for flips instance" );
941 return;
942 }
943
944 instance[ options ].apply( instance, args );
945
946 });
947
948 }
949 else {
950
951 this.each(function() {
952
953 var instance = $.data( this, 'flips' );
954 if ( !instance ) {
955 $.data( this, 'flips', new $.Flips( options, this ) );
956 }
957 });
958
959 }
960
961 return this;
962
963 };
964
965})( window ); \ No newline at end of file
diff --git a/Blocks/Flipboard/js/jquery.history.js b/Blocks/Flipboard/js/jquery.history.js
new file mode 100644
index 0000000..8d4edcd
--- /dev/null
+++ b/Blocks/Flipboard/js/jquery.history.js
@@ -0,0 +1 @@
window.JSON||(window.JSON={}),function(){function f(a){return a<10?"0"+a:a}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return typeof b=="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g=gap,h,i=b[a];i&&typeof i=="object"&&typeof i.toJSON=="function"&&(i=i.toJSON(a)),typeof rep=="function"&&(i=rep.call(b,a,i));switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";gap+=indent,h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;c<f;c+=1)h[c]=str(c,i)||"null";return e=h.length===0?"[]":gap?"[\n"+gap+h.join(",\n"+gap)+"\n"+g+"]":"["+h.join(",")+"]",gap=g,e}if(rep&&typeof rep=="object"){f=rep.length;for(c=0;c<f;c+=1)d=rep[c],typeof d=="string"&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e))}else for(d in i)Object.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e));return e=h.length===0?"{}":gap?"{\n"+gap+h.join(",\n"+gap)+"\n"+g+"}":"{"+h.join(",")+"}",gap=g,e}}"use strict",typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()});var JSON=window.JSON,cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(a,b,c){var d;gap="",indent="";if(typeof c=="number")for(d=0;d<c;d+=1)indent+=" ";else typeof c=="string"&&(indent=c);rep=b;if(!b||typeof b=="function"||typeof b=="object"&&typeof b.length=="number")return str("",{"":a});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&typeof e=="object")for(c in e)Object.hasOwnProperty.call(e,c)&&(d=walk(e,c),d!==undefined?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),function(a,b){"use strict";var c=a.History=a.History||{},d=a.jQuery;if(typeof c.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");c.Adapter={bind:function(a,b,c){d(a).bind(b,c)},trigger:function(a,b,c){d(a).trigger(b,c)},extractEventData:function(a,c,d){var e=c&&c.originalEvent&&c.originalEvent[a]||d&&d[a]||b;return e},onDomLoad:function(a){d(a)}},typeof c.init!="undefined"&&c.init()}(window),function(a,b){"use strict";var c=a.document,d=a.setTimeout||d,e=a.clearTimeout||e,f=a.setInterval||f,g=a.History=a.History||{};if(typeof g.initHtml4!="undefined")throw new Error("History.js HTML4 Support has already been loaded...");g.initHtml4=function(){if(typeof g.initHtml4.initialized!="undefined")return!1;g.initHtml4.initialized=!0,g.enabled=!0,g.savedHashes=[],g.isLastHash=function(a){var b=g.getHashByIndex(),c;return c=a===b,c},g.saveHash=function(a){return g.isLastHash(a)?!1:(g.savedHashes.push(a),!0)},g.getHashByIndex=function(a){var b=null;return typeof a=="undefined"?b=g.savedHashes[g.savedHashes.length-1]:a<0?b=g.savedHashes[g.savedHashes.length+a]:b=g.savedHashes[a],b},g.discardedHashes={},g.discardedStates={},g.discardState=function(a,b,c){var d=g.getHashByState(a),e;return e={discardedState:a,backState:c,forwardState:b},g.discardedStates[d]=e,!0},g.discardHash=function(a,b,c){var d={discardedHash:a,backState:c,forwardState:b};return g.discardedHashes[a]=d,!0},g.discardedState=function(a){var b=g.getHashByState(a),c;return c=g.discardedStates[b]||!1,c},g.discardedHash=function(a){var b=g.discardedHashes[a]||!1;return b},g.recycleState=function(a){var b=g.getHashByState(a);return g.discardedState(a)&&delete g.discardedStates[b],!0},g.emulated.hashChange&&(g.hashChangeInit=function(){g.checkerFunction=null;var b="",d,e,h,i;return g.isInternetExplorer()?(d="historyjs-iframe",e=c.createElement("iframe"),e.setAttribute("id",d),e.style.display="none",c.body.appendChild(e),e.contentWindow.document.open(),e.contentWindow.document.close(),h="",i=!1,g.checkerFunction=function(){if(i)return!1;i=!0;var c=g.getHash()||"",d=g.unescapeHash(e.contentWindow.document.location.hash)||"";return c!==b?(b=c,d!==c&&(h=d=c,e.contentWindow.document.open(),e.contentWindow.document.close(),e.contentWindow.document.location.hash=g.escapeHash(c)),g.Adapter.trigger(a,"hashchange")):d!==h&&(h=d,g.setHash(d,!1)),i=!1,!0}):g.checkerFunction=function(){var c=g.getHash();return c!==b&&(b=c,g.Adapter.trigger(a,"hashchange")),!0},g.intervalList.push(f(g.checkerFunction,g.options.hashChangeInterval)),!0},g.Adapter.onDomLoad(g.hashChangeInit)),g.emulated.pushState&&(g.onHashChange=function(b){var d=b&&b.newURL||c.location.href,e=g.getHashByUrl(d),f=null,h=null,i=null,j;return g.isLastHash(e)?(g.busy(!1),!1):(g.doubleCheckComplete(),g.saveHash(e),e&&g.isTraditionalAnchor(e)?(g.Adapter.trigger(a,"anchorchange"),g.busy(!1),!1):(f=g.extractState(g.getFullUrl(e||c.location.href,!1),!0),g.isLastSavedState(f)?(g.busy(!1),!1):(h=g.getHashByState(f),j=g.discardedState(f),j?(g.getHashByIndex(-2)===g.getHashByState(j.forwardState)?g.back(!1):g.forward(!1),!1):(g.pushState(f.data,f.title,f.url,!1),!0))))},g.Adapter.bind(a,"hashchange",g.onHashChange),g.pushState=function(b,d,e,f){if(g.getHashByUrl(e))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(f!==!1&&g.busy())return g.pushQueue({scope:g,callback:g.pushState,args:arguments,queue:f}),!1;g.busy(!0);var h=g.createStateObject(b,d,e),i=g.getHashByState(h),j=g.getState(!1),k=g.getHashByState(j),l=g.getHash();return g.storeState(h),g.expectedStateId=h.id,g.recycleState(h),g.setTitle(h),i===k?(g.busy(!1),!1):i!==l&&i!==g.getShortUrl(c.location.href)?(g.setHash(i,!1),!1):(g.saveState(h),g.Adapter.trigger(a,"statechange"),g.busy(!1),!0)},g.replaceState=function(a,b,c,d){if(g.getHashByUrl(c))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(d!==!1&&g.busy())return g.pushQueue({scope:g,callback:g.replaceState,args:arguments,queue:d}),!1;g.busy(!0);var e=g.createStateObject(a,b,c),f=g.getState(!1),h=g.getStateByIndex(-2);return g.discardState(f,e,h),g.pushState(e.data,e.title,e.url,!1),!0}),g.emulated.pushState&&g.getHash()&&!g.emulated.hashChange&&g.Adapter.onDomLoad(function(){g.Adapter.trigger(a,"hashchange")})},typeof g.init!="undefined"&&g.init()}(window),function(a,b){"use strict";var c=a.console||b,d=a.document,e=a.navigator,f=a.sessionStorage||!1,g=a.setTimeout,h=a.clearTimeout,i=a.setInterval,j=a.clearInterval,k=a.JSON,l=a.alert,m=a.History=a.History||{},n=a.history;k.stringify=k.stringify||k.encode,k.parse=k.parse||k.decode;if(typeof m.init!="undefined")throw new Error("History.js Core has already been loaded...");m.init=function(){return typeof m.Adapter=="undefined"?!1:(typeof m.initCore!="undefined"&&m.initCore(),typeof m.initHtml4!="undefined"&&m.initHtml4(),!0)},m.initCore=function(){if(typeof m.initCore.initialized!="undefined")return!1;m.initCore.initialized=!0,m.options=m.options||{},m.options.hashChangeInterval=m.options.hashChangeInterval||100,m.options.safariPollInterval=m.options.safariPollInterval||500,m.options.doubleCheckInterval=m.options.doubleCheckInterval||500,m.options.storeInterval=m.options.storeInterval||1e3,m.options.busyDelay=m.options.busyDelay||250,m.options.debug=m.options.debug||!1,m.options.initialTitle=m.options.initialTitle||d.title,m.intervalList=[],m.clearAllIntervals=function(){var a,b=m.intervalList;if(typeof b!="undefined"&&b!==null){for(a=0;a<b.length;a++)j(b[a]);m.intervalList=null}},m.debug=function(){(m.options.debug||!1)&&m.log.apply(m,arguments)},m.log=function(){var a=typeof c!="undefined"&&typeof c.log!="undefined"&&typeof c.log.apply!="undefined",b=d.getElementById("log"),e,f,g,h,i;a?(h=Array.prototype.slice.call(arguments),e=h.shift(),typeof c.debug!="undefined"?c.debug.apply(c,[e,h]):c.log.apply(c,[e,h])):e="\n"+arguments[0]+"\n";for(f=1,g=arguments.length;f<g;++f){i=arguments[f];if(typeof i=="object"&&typeof k!="undefined")try{i=k.stringify(i)}catch(j){}e+="\n"+i+"\n"}return b?(b.value+=e+"\n-----\n",b.scrollTop=b.scrollHeight-b.clientHeight):a||l(e),!0},m.getInternetExplorerMajorVersion=function(){var a=m.getInternetExplorerMajorVersion.cached=typeof m.getInternetExplorerMajorVersion.cached!="undefined"?m.getInternetExplorerMajorVersion.cached:function(){var a=3,b=d.createElement("div"),c=b.getElementsByTagName("i");while((b.innerHTML="<!--[if gt IE "+ ++a+"]><i></i><![endif]-->")&&c[0]);return a>4?a:!1}();return a},m.isInternetExplorer=function(){var a=m.isInternetExplorer.cached=typeof m.isInternetExplorer.cached!="undefined"?m.isInternetExplorer.cached:Boolean(m.getInternetExplorerMajorVersion());return a},m.emulated={pushState:!Boolean(a.history&&a.history.pushState&&a.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(e.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(e.userAgent)),hashChange:Boolean(!("onhashchange"in a||"onhashchange"in d)||m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8)},m.enabled=!m.emulated.pushState,m.bugs={setHash:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),safariPoll:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),ieDoubleCheck:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<7)},m.isEmptyObject=function(a){for(var b in a)return!1;return!0},m.cloneObject=function(a){var b,c;return a?(b=k.stringify(a),c=k.parse(b)):c={},c},m.getRootUrl=function(){var a=d.location.protocol+"//"+(d.location.hostname||d.location.host);if(d.location.port||!1)a+=":"+d.location.port;return a+="/",a},m.getBaseHref=function(){var a=d.getElementsByTagName("base"),b=null,c="";return a.length===1&&(b=a[0],c=b.href.replace(/[^\/]+$/,"")),c=c.replace(/\/+$/,""),c&&(c+="/"),c},m.getBaseUrl=function(){var a=m.getBaseHref()||m.getBasePageUrl()||m.getRootUrl();return a},m.getPageUrl=function(){var a=m.getState(!1,!1),b=(a||{}).url||d.location.href,c;return c=b.replace(/\/+$/,"").replace(/[^\/]+$/,function(a,b,c){return/\./.test(a)?a:a+"/"}),c},m.getBasePageUrl=function(){var a=d.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(a,b,c){return/[^\/]$/.test(a)?"":a}).replace(/\/+$/,"")+"/";return a},m.getFullUrl=function(a,b){var c=a,d=a.substring(0,1);return b=typeof b=="undefined"?!0:b,/[a-z]+\:\/\//.test(a)||(d==="/"?c=m.getRootUrl()+a.replace(/^\/+/,""):d==="#"?c=m.getPageUrl().replace(/#.*/,"")+a:d==="?"?c=m.getPageUrl().replace(/[\?#].*/,"")+a:b?c=m.getBaseUrl()+a.replace(/^(\.\/)+/,""):c=m.getBasePageUrl()+a.replace(/^(\.\/)+/,"")),c.replace(/\#$/,"")},m.getShortUrl=function(a){var b=a,c=m.getBaseUrl(),d=m.getRootUrl();return m.emulated.pushState&&(b=b.replace(c,"")),b=b.replace(d,"/"),m.isTraditionalAnchor(b)&&(b="./"+b),b=b.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),b},m.store={},m.idToState=m.idToState||{},m.stateToId=m.stateToId||{},m.urlToId=m.urlToId||{},m.storedStates=m.storedStates||[],m.savedStates=m.savedStates||[],m.normalizeStore=function(){m.store.idToState=m.store.idToState||{},m.store.urlToId=m.store.urlToId||{},m.store.stateToId=m.store.stateToId||{}},m.getState=function(a,b){typeof a=="undefined"&&(a=!0),typeof b=="undefined"&&(b=!0);var c=m.getLastSavedState();return!c&&b&&(c=m.createStateObject()),a&&(c=m.cloneObject(c),c.url=c.cleanUrl||c.url),c},m.getIdByState=function(a){var b=m.extractId(a.url),c;if(!b){c=m.getStateString(a);if(typeof m.stateToId[c]!="undefined")b=m.stateToId[c];else if(typeof m.store.stateToId[c]!="undefined")b=m.store.stateToId[c];else{for(;;){b=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof m.idToState[b]=="undefined"&&typeof m.store.idToState[b]=="undefined")break}m.stateToId[c]=b,m.idToState[b]=a}}return b},m.normalizeState=function(a){var b,c;if(!a||typeof a!="object")a={};if(typeof a.normalized!="undefined")return a;if(!a.data||typeof a.data!="object")a.data={};b={},b.normalized=!0,b.title=a.title||"",b.url=m.getFullUrl(m.unescapeString(a.url||d.location.href)),b.hash=m.getShortUrl(b.url),b.data=m.cloneObject(a.data),b.id=m.getIdByState(b),b.cleanUrl=b.url.replace(/\??\&_suid.*/,""),b.url=b.cleanUrl,c=!m.isEmptyObject(b.data);if(b.title||c)b.hash=m.getShortUrl(b.url).replace(/\??\&_suid.*/,""),/\?/.test(b.hash)||(b.hash+="?"),b.hash+="&_suid="+b.id;return b.hashedUrl=m.getFullUrl(b.hash),(m.emulated.pushState||m.bugs.safariPoll)&&m.hasUrlDuplicate(b)&&(b.url=b.hashedUrl),b},m.createStateObject=function(a,b,c){var d={data:a,title:b,url:c};return d=m.normalizeState(d),d},m.getStateById=function(a){a=String(a);var c=m.idToState[a]||m.store.idToState[a]||b;return c},m.getStateString=function(a){var b,c,d;return b=m.normalizeState(a),c={data:b.data,title:a.title,url:a.url},d=k.stringify(c),d},m.getStateId=function(a){var b,c;return b=m.normalizeState(a),c=b.id,c},m.getHashByState=function(a){var b,c;return b=m.normalizeState(a),c=b.hash,c},m.extractId=function(a){var b,c,d;return c=/(.*)\&_suid=([0-9]+)$/.exec(a),d=c?c[1]||a:a,b=c?String(c[2]||""):"",b||!1},m.isTraditionalAnchor=function(a){var b=!/[\/\?\.]/.test(a);return b},m.extractState=function(a,b){var c=null,d,e;return b=b||!1,d=m.extractId(a),d&&(c=m.getStateById(d)),c||(e=m.getFullUrl(a),d=m.getIdByUrl(e)||!1,d&&(c=m.getStateById(d)),!c&&b&&!m.isTraditionalAnchor(a)&&(c=m.createStateObject(null,null,e))),c},m.getIdByUrl=function(a){var c=m.urlToId[a]||m.store.urlToId[a]||b;return c},m.getLastSavedState=function(){return m.savedStates[m.savedStates.length-1]||b},m.getLastStoredState=function(){return m.storedStates[m.storedStates.length-1]||b},m.hasUrlDuplicate=function(a){var b=!1,c;return c=m.extractState(a.url),b=c&&c.id!==a.id,b},m.storeState=function(a){return m.urlToId[a.url]=a.id,m.storedStates.push(m.cloneObject(a)),a},m.isLastSavedState=function(a){var b=!1,c,d,e;return m.savedStates.length&&(c=a.id,d=m.getLastSavedState(),e=d.id,b=c===e),b},m.saveState=function(a){return m.isLastSavedState(a)?!1:(m.savedStates.push(m.cloneObject(a)),!0)},m.getStateByIndex=function(a){var b=null;return typeof a=="undefined"?b=m.savedStates[m.savedStates.length-1]:a<0?b=m.savedStates[m.savedStates.length+a]:b=m.savedStates[a],b},m.getHash=function(){var a=m.unescapeHash(d.location.hash);return a},m.unescapeString=function(b){var c=b,d;for(;;){d=a.unescape(c);if(d===c)break;c=d}return c},m.unescapeHash=function(a){var b=m.normalizeHash(a);return b=m.unescapeString(b),b},m.normalizeHash=function(a){var b=a.replace(/[^#]*#/,"").replace(/#.*/,"");return b},m.setHash=function(a,b){var c,e,f;return b!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.setHash,args:arguments,queue:b}),!1):(c=m.escapeHash(a),m.busy(!0),e=m.extractState(a,!0),e&&!m.emulated.pushState?m.pushState(e.data,e.title,e.url,!1):d.location.hash!==c&&(m.bugs.setHash?(f=m.getPageUrl(),m.pushState(null,null,f+"#"+c,!1)):d.location.hash=c),m)},m.escapeHash=function(b){var c=m.normalizeHash(b);return c=a.escape(c),m.bugs.hashEscape||(c=c.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),c},m.getHashByUrl=function(a){var b=String(a).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return b=m.unescapeHash(b),b},m.setTitle=function(a){var b=a.title,c;b||(c=m.getStateByIndex(0),c&&c.url===a.url&&(b=c.title||m.options.initialTitle));try{d.getElementsByTagName("title")[0].innerHTML=b.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(e){}return d.title=b,m},m.queues=[],m.busy=function(a){typeof a!="undefined"?m.busy.flag=a:typeof m.busy.flag=="undefined"&&(m.busy.flag=!1);if(!m.busy.flag){h(m.busy.timeout);var b=function(){var a,c,d;if(m.busy.flag)return;for(a=m.queues.length-1;a>=0;--a){c=m.queues[a];if(c.length===0)continue;d=c.shift(),m.fireQueueItem(d),m.busy.timeout=g(b,m.options.busyDelay)}};m.busy.timeout=g(b,m.options.busyDelay)}return m.busy.flag},m.busy.flag=!1,m.fireQueueItem=function(a){return a.callback.apply(a.scope||m,a.args||[])},m.pushQueue=function(a){return m.queues[a.queue||0]=m.queues[a.queue||0]||[],m.queues[a.queue||0].push(a),m},m.queue=function(a,b){return typeof a=="function"&&(a={callback:a}),typeof b!="undefined"&&(a.queue=b),m.busy()?m.pushQueue(a):m.fireQueueItem(a),m},m.clearQueue=function(){return m.busy.flag=!1,m.queues=[],m},m.stateChanged=!1,m.doubleChecker=!1,m.doubleCheckComplete=function(){return m.stateChanged=!0,m.doubleCheckClear(),m},m.doubleCheckClear=function(){return m.doubleChecker&&(h(m.doubleChecker),m.doubleChecker=!1),m},m.doubleCheck=function(a){return m.stateChanged=!1,m.doubleCheckClear(),m.bugs.ieDoubleCheck&&(m.doubleChecker=g(function(){return m.doubleCheckClear(),m.stateChanged||a(),!0},m.options.doubleCheckInterval)),m},m.safariStatePoll=function(){var b=m.extractState(d.location.href),c;if(!m.isLastSavedState(b))c=b;else return;return c||(c=m.createStateObject()),m.Adapter.trigger(a,"popstate"),m},m.back=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.back,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.back(!1)}),n.go(-1),!0)},m.forward=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.forward,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.forward(!1)}),n.go(1),!0)},m.go=function(a,b){var c;if(a>0)for(c=1;c<=a;++c)m.forward(b);else{if(!(a<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(c=-1;c>=a;--c)m.back(b)}return m};if(m.emulated.pushState){var o=function(){};m.pushState=m.pushState||o,m.replaceState=m.replaceState||o}else m.onPopState=function(b,c){var e=!1,f=!1,g,h;return m.doubleCheckComplete(),g=m.getHash(),g?(h=m.extractState(g||d.location.href,!0),h?m.replaceState(h.data,h.title,h.url,!1):(m.Adapter.trigger(a,"anchorchange"),m.busy(!1)),m.expectedStateId=!1,!1):(e=m.Adapter.extractEventData("state",b,c)||!1,e?f=m.getStateById(e):m.expectedStateId?f=m.getStateById(m.expectedStateId):f=m.extractState(d.location.href),f||(f=m.createStateObject(null,null,d.location.href)),m.expectedStateId=!1,m.isLastSavedState(f)?(m.busy(!1),!1):(m.storeState(f),m.saveState(f),m.setTitle(f),m.Adapter.trigger(a,"statechange"),m.busy(!1),!0))},m.Adapter.bind(a,"popstate",m.onPopState),m.pushState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.pushState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.pushState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0},m.replaceState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.replaceState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.replaceState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0};if(f){try{m.store=k.parse(f.getItem("History.store"))||{}}catch(p){m.store={}}m.normalizeStore()}else m.store={},m.normalizeStore();m.Adapter.bind(a,"beforeunload",m.clearAllIntervals),m.Adapter.bind(a,"unload",m.clearAllIntervals),m.saveState(m.storeState(m.extractState(d.location.href,!0))),f&&(m.onUnload=function(){var a,b;try{a=k.parse(f.getItem("History.store"))||{}}catch(c){a={}}a.idToState=a.idToState||{},a.urlToId=a.urlToId||{},a.stateToId=a.stateToId||{};for(b in m.idToState){if(!m.idToState.hasOwnProperty(b))continue;a.idToState[b]=m.idToState[b]}for(b in m.urlToId){if(!m.urlToId.hasOwnProperty(b))continue;a.urlToId[b]=m.urlToId[b]}for(b in m.stateToId){if(!m.stateToId.hasOwnProperty(b))continue;a.stateToId[b]=m.stateToId[b]}m.store=a,m.normalizeStore(),f.setItem("History.store",k.stringify(a))},m.intervalList.push(i(m.onUnload,m.options.storeInterval)),m.Adapter.bind(a,"beforeunload",m.onUnload),m.Adapter.bind(a,"unload",m.onUnload));if(!m.emulated.pushState){m.bugs.safariPoll&&m.intervalList.push(i(m.safariStatePoll,m.options.safariPollInterval));if(e.vendor==="Apple Computer, Inc."||(e.appCodeName||"")==="Mozilla")m.Adapter.bind(a,"hashchange",function(){m.Adapter.trigger(a,"popstate")}),m.getHash()&&m.Adapter.onDomLoad(function(){m.Adapter.trigger(a,"hashchange")})}},m.init()}(window) \ No newline at end of file
diff --git a/Blocks/Flipboard/js/jquery.tmpl.min.js b/Blocks/Flipboard/js/jquery.tmpl.min.js
new file mode 100644
index 0000000..f08e81d
--- /dev/null
+++ b/Blocks/Flipboard/js/jquery.tmpl.min.js
@@ -0,0 +1 @@
(function(a){var r=a.fn.domManip,d="_tmplitem",q=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,b={},f={},e,p={key:0,data:{}},h=0,c=0,l=[];function g(e,d,g,i){var c={data:i||(d?d.data:{}),_wrap:d?d._wrap:null,tmpl:null,parent:d||null,nodes:[],calls:u,nest:w,wrap:x,html:v,update:t};e&&a.extend(c,e,{nodes:[],parent:d});if(g){c.tmpl=g;c._ctnt=c._ctnt||c.tmpl(a,c);c.key=++h;(l.length?f:b)[h]=c}return c}a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(f,d){a.fn[f]=function(n){var g=[],i=a(n),k,h,m,l,j=this.length===1&&this[0].parentNode;e=b||{};if(j&&j.nodeType===11&&j.childNodes.length===1&&i.length===1){i[d](this[0]);g=this}else{for(h=0,m=i.length;h<m;h++){c=h;k=(h>0?this.clone(true):this).get();a.fn[d].apply(a(i[h]),k);g=g.concat(k)}c=0;g=this.pushStack(g,f,i.selector)}l=e;e=null;a.tmpl.complete(l);return g}});a.fn.extend({tmpl:function(d,c,b){return a.tmpl(this[0],d,c,b)},tmplItem:function(){return a.tmplItem(this[0])},template:function(b){return a.template(b,this[0])},domManip:function(d,l,j){if(d[0]&&d[0].nodeType){var f=a.makeArray(arguments),g=d.length,i=0,h;while(i<g&&!(h=a.data(d[i++],"tmplItem")));if(g>1)f[0]=[a.makeArray(d)];if(h&&c)f[2]=function(b){a.tmpl.afterManip(this,b,j)};r.apply(this,f)}else r.apply(this,arguments);c=0;!e&&a.tmpl.complete(b);return this}});a.extend({tmpl:function(d,h,e,c){var j,k=!c;if(k){c=p;d=a.template[d]||a.template(null,d);f={}}else if(!d){d=c.tmpl;b[c.key]=c;c.nodes=[];c.wrapped&&n(c,c.wrapped);return a(i(c,null,c.tmpl(a,c)))}if(!d)return[];if(typeof h==="function")h=h.call(c||{});e&&e.wrapped&&n(e,e.wrapped);j=a.isArray(h)?a.map(h,function(a){return a?g(e,c,d,a):null}):[g(e,c,d,h)];return k?a(i(c,null,j)):j},tmplItem:function(b){var c;if(b instanceof a)b=b[0];while(b&&b.nodeType===1&&!(c=a.data(b,"tmplItem"))&&(b=b.parentNode));return c||p},template:function(c,b){if(b){if(typeof b==="string")b=o(b);else if(b instanceof a)b=b[0]||{};if(b.nodeType)b=a.data(b,"tmpl")||a.data(b,"tmpl",o(b.innerHTML));return typeof c==="string"?(a.template[c]=b):b}return c?typeof c!=="string"?a.template(null,c):a.template[c]||a.template(null,q.test(c)?c:a(c)):null},encode:function(a){return(""+a).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}});a.extend(a.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){_=_.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(_,$1,$2);_=[];",close:"call=$item.calls();_=call._.concat($item.wrap(call,_));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){_.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){_.push($.encode($1a));}"},"!":{open:""}},complete:function(){b={}},afterManip:function(f,b,d){var e=b.nodeType===11?a.makeArray(b.childNodes):b.nodeType===1?[b]:[];d.call(f,b);m(e);c++}});function i(e,g,f){var b,c=f?a.map(f,function(a){return typeof a==="string"?e.key?a.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+d+'="'+e.key+'" $2'):a:i(a,e,a._ctnt)}):e;if(g)return c;c=c.join("");c.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(f,c,e,d){b=a(e).get();m(b);if(c)b=j(c).concat(b);if(d)b=b.concat(j(d))});return b?b:j(c)}function j(c){var b=document.createElement("div");b.innerHTML=c;return a.makeArray(b.childNodes)}function o(b){return new Function("jQuery","$item","var $=jQuery,call,_=[],$data=$item.data;with($data){_.push('"+a.trim(b).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(m,l,j,d,b,c,e){var i=a.tmpl.tag[j],h,f,g;if(!i)throw"Template command not found: "+j;h=i._default||[];if(c&&!/\w$/.test(b)){b+=c;c=""}if(b){b=k(b);e=e?","+k(e)+")":c?")":"";f=c?b.indexOf(".")>-1?b+c:"("+b+").call($item"+e:b;g=c?f:"(typeof("+b+")==='function'?("+b+").call($item):("+b+"))"}else g=f=h.$1||"null";d=k(d);return"');"+i[l?"close":"open"].split("$notnull_1").join(b?"typeof("+b+")!=='undefined' && ("+b+")!=null":"true").split("$1a").join(g).split("$1").join(f).split("$2").join(d?d.replace(/\s*([^\(]+)\s*(\((.*?)\))?/g,function(d,c,b,a){a=a?","+a+")":b?")":"";return a?"("+c+").call($item"+a:d}):h.$2||"")+"_.push('"})+"');}return _;")}function n(c,b){c._wrap=i(c,true,a.isArray(b)?b:[q.test(b)?b:a(b).html()]).join("")}function k(a){return a?a.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function s(b){var a=document.createElement("div");a.appendChild(b.cloneNode(true));return a.innerHTML}function m(o){var n="_"+c,k,j,l={},e,p,i;for(e=0,p=o.length;e<p;e++){if((k=o[e]).nodeType!==1)continue;j=k.getElementsByTagName("*");for(i=j.length-1;i>=0;i--)m(j[i]);m(k)}function m(j){var p,i=j,k,e,m;if(m=j.getAttribute(d)){while(i.parentNode&&(i=i.parentNode).nodeType===1&&!(p=i.getAttribute(d)));if(p!==m){i=i.parentNode?i.nodeType===11?0:i.getAttribute(d)||0:0;if(!(e=b[m])){e=f[m];e=g(e,b[i]||f[i],null,true);e.key=++h;b[h]=e}c&&o(m)}j.removeAttribute(d)}else if(c&&(e=a.data(j,"tmplItem"))){o(e.key);b[e.key]=e;i=a.data(j.parentNode,"tmplItem");i=i?i.key:0}if(e){k=e;while(k&&k.key!=i){k.nodes.push(j);k=k.parent}delete e._ctnt;delete e._wrap;a.data(j,"tmplItem",e)}function o(a){a=a+n;e=l[a]=l[a]||g(e,b[e.parent.key+n]||e.parent,null,true)}}}function u(a,d,c,b){if(!a)return l.pop();l.push({_:a,tmpl:d,item:this,data:c,options:b})}function w(d,c,b){return a.tmpl(a.template(d),c,b,this)}function x(b,d){var c=b.options||{};c.wrapped=d;return a.tmpl(a.template(b.tmpl),b.data,c,b.item)}function v(d,c){var b=this._wrap;return a.map(a(a.isArray(b)?b.join(""):b).filter(d||"*"),function(a){return c?a.innerText||a.textContent:a.outerHTML||s(a)})}function t(){var b=this.nodes;a.tmpl(null,null,null,this).insertBefore(b[0]);a(b).remove()}})(jQuery) \ No newline at end of file
diff --git a/Blocks/Flipboard/js/jquery.touchSwipe-1.2.5.js b/Blocks/Flipboard/js/jquery.touchSwipe-1.2.5.js
new file mode 100644
index 0000000..f007f55
--- /dev/null
+++ b/Blocks/Flipboard/js/jquery.touchSwipe-1.2.5.js
@@ -0,0 +1,478 @@
1/*
2 * touchSwipe - jQuery Plugin
3 * http://plugins.jquery.com/project/touchSwipe
4 * http://labs.skinkers.com/touchSwipe/
5 *
6 * Copyright (c) 2010 Matt Bryson (www.skinkers.com)
7 * Dual licensed under the MIT or GPL Version 2 licenses.
8 *
9 * $version: 1.2.5
10 *
11 * Changelog
12 * $Date: 2010-12-12 (Wed, 12 Dec 2010) $
13 * $version: 1.0.0
14 * $version: 1.0.1 - removed multibyte comments
15 *
16 * $Date: 2011-21-02 (Mon, 21 Feb 2011) $
17 * $version: 1.1.0 - added allowPageScroll property to allow swiping and scrolling of page
18 * - changed handler signatures so one handler can be used for multiple events
19 * $Date: 2011-23-02 (Wed, 23 Feb 2011) $
20 * $version: 1.2.0 - added click handler. This is fired if the user simply clicks and does not swipe. The event object and click target are passed to handler.
21 * - If you use the http://code.google.com/p/jquery-ui-for-ipad-and-iphone/ plugin, you can also assign jQuery mouse events to children of a touchSwipe object.
22 * $version: 1.2.1 - removed console log!
23 *
24 * $version: 1.2.2 - Fixed bug where scope was not preserved in callback methods.
25 *
26 * $Date: 2011-28-04 (Thurs, 28 April 2011) $
27 * $version: 1.2.4 - Changed licence terms to be MIT or GPL inline with jQuery. Added check for support of touch events to stop non compatible browsers erroring.
28 *
29 * $Date: 2011-27-09 (Tues, 27 September 2011) $
30 * $version: 1.2.5 - Added support for testing swipes with mouse on desktop browser (thanks to https://github.com/joelhy)
31
32 * A jQuery plugin to capture left, right, up and down swipes on touch devices.
33 * You can capture 2 finger or 1 finger swipes, set the threshold and define either a catch all handler, or individual direction handlers.
34 * Options:
35 * swipe Function A catch all handler that is triggered for all swipe directions. Handler is passed 3 arguments, the original event object, the direction of the swipe : "left", "right", "up", "down" and the distance of the swipe.
36 * swipeLeft Function A handler that is triggered for "left" swipes. Handler is passed 3 arguments, the original event object, the direction of the swipe : "left", "right", "up", "down" and the distance of the swipe.
37 * swipeRight Function A handler that is triggered for "right" swipes. Handler is passed 3 arguments, the original event object, the direction of the swipe : "left", "right", "up", "down" and the distance of the swipe.
38 * swipeUp Function A handler that is triggered for "up" swipes. Handler is passed 3 arguments, the original event object, the direction of the swipe : "left", "right", "up", "down" and the distance of the swipe.
39 * swipeDown Function A handler that is triggered for "down" swipes. Handler is passed 3 arguments, the original event object, the direction of the swipe : "left", "right", "up", "down" and the distance of the swipe.
40 * swipeStatus Function A handler triggered for every phase of the swipe. Handler is passed 4 arguments: event : The original event object, phase:The current swipe face, either "start?, "move?, "end? or "cancel?. direction : The swipe direction, either "up?, "down?, "left " or "right?.distance : The distance of the swipe.
41 * click Function A handler triggered when a user just clicks on the item, rather than swipes it. If they do not move, click is triggered, if they do move, it is not.
42 *
43 * fingers int Default 1. The number of fingers to trigger the swipe, 1 or 2.
44 * threshold int Default 75. The number of pixels that the user must move their finger by before it is considered a swipe.
45 * triggerOnTouchEnd Boolean Default true If true, the swipe events are triggered when the touch end event is received (user releases finger). If false, it will be triggered on reaching the threshold, and then cancel the touch event automatically.
46 * allowPageScroll String Default "auto". How the browser handles page scrolls when the user is swiping on a touchSwipe object.
47 * "auto" : all undefined swipes will cause the page to scroll in that direction.
48 * "none" : the page will not scroll when user swipes.
49 * "horizontal" : will force page to scroll on horizontal swipes.
50 * "vertical" : will force page to scroll on vertical swipes.
51 *
52 * This jQuery plugin will only run on devices running Mobile Webkit based browsers (iOS 2.0+, android 2.2+)
53 */
54(function($)
55{
56
57
58
59 $.fn.swipe = function(options)
60 {
61 if (!this) return false;
62
63 // Default thresholds & swipe functions
64 var defaults = {
65
66 fingers : 1, // int - The number of fingers to trigger the swipe, 1 or 2. Default is 1.
67 threshold : 75, // int - The number of pixels that the user must move their finger by before it is considered a swipe. Default is 75.
68
69 swipe : null, // Function - A catch all handler that is triggered for all swipe directions. Accepts 2 arguments, the original event object and the direction of the swipe : "left", "right", "up", "down".
70 swipeLeft : null, // Function - A handler that is triggered for "left" swipes. Accepts 3 arguments, the original event object, the direction of the swipe : "left", "right", "up", "down" and the distance of the swipe.
71 swipeRight : null, // Function - A handler that is triggered for "right" swipes. Accepts 3 arguments, the original event object, the direction of the swipe : "left", "right", "up", "down" and the distance of the swipe.
72 swipeUp : null, // Function - A handler that is triggered for "up" swipes. Accepts 3 arguments, the original event object, the direction of the swipe : "left", "right", "up", "down" and the distance of the swipe.
73 swipeDown : null, // Function - A handler that is triggered for "down" swipes. Accepts 3 arguments, the original event object, the direction of the swipe : "left", "right", "up", "down" and the distance of the swipe.
74 swipeStatus : null, // Function - A handler triggered for every phase of the swipe. Handler is passed 4 arguments: event : The original event object, phase:The current swipe face, either "start?, "move?, "end? or "cancel?. direction : The swipe direction, either "up?, "down?, "left " or "right?.distance : The distance of the swipe.
75 click : null, // Function - A handler triggered when a user just clicks on the item, rather than swipes it. If they do not move, click is triggered, if they do move, it is not.
76
77 triggerOnTouchEnd : true, // Boolean, if true, the swipe events are triggered when the touch end event is received (user releases finger). If false, it will be triggered on reaching the threshold, and then cancel the touch event automatically.
78 allowPageScroll : "auto" /* How the browser handles page scrolls when the user is swiping on a touchSwipe object.
79 "auto" : all undefined swipes will cause the page to scroll in that direction.
80 "none" : the page will not scroll when user swipes.
81 "horizontal" : will force page to scroll on horizontal swipes.
82 "vertical" : will force page to scroll on vertical swipes.
83 */
84 };
85
86
87 //Constants
88 var LEFT = "left";
89 var RIGHT = "right";
90 var UP = "up";
91 var DOWN = "down";
92 var NONE = "none";
93 var HORIZONTAL = "horizontal";
94 var VERTICAL = "vertical";
95 var AUTO = "auto";
96
97 var PHASE_START="start";
98 var PHASE_MOVE="move";
99 var PHASE_END="end";
100 var PHASE_CANCEL="cancel";
101
102 var hasTouch = 'ontouchstart' in window,
103 START_EV = hasTouch ? 'touchstart' : 'mousedown',
104 MOVE_EV = hasTouch ? 'touchmove' : 'mousemove',
105 END_EV = hasTouch ? 'touchend' : 'mouseup',
106 CANCEL_EV = 'touchcancel';
107
108 var phase="start";
109
110 if (options.allowPageScroll==undefined && (options.swipe!=undefined || options.swipeStatus!=undefined))
111 options.allowPageScroll=NONE;
112
113 if (options)
114 $.extend(defaults, options);
115
116
117 /**
118 * Setup each object to detect swipe gestures
119 */
120 return this.each(function()
121 {
122 var that = this;
123 var $this = $(this);
124
125 var triggerElementID = null; // this variable is used to identity the triggering element
126 var fingerCount = 0; // the current number of fingers being used.
127
128 //track mouse points / delta
129 var start={x:0, y:0};
130 var end={x:0, y:0};
131 var delta={x:0, y:0};
132 // added by Codrops
133 var lastPositionX = 0;
134
135 /**
136 * Event handler for a touch start event.
137 * Stops the default click event from triggering and stores where we touched
138 */
139 function touchStart(event)
140 {
141 var evt = hasTouch ? event.touches[0] : event;
142
143 phase = PHASE_START;
144
145 if (hasTouch) {
146 // get the total number of fingers touching the screen
147 fingerCount = event.touches.length;
148 }
149
150 //clear vars..
151 distance=0;
152 direction=null;
153
154 // check the number of fingers is what we are looking for
155 if (fingerCount == defaults.fingers || !hasTouch)
156 {
157 // get the coordinates of the touch
158 start.x = end.x = evt.pageX;
159 start.y = end.y = evt.pageY;
160 // changed by Codrops
161 lastPositionX = end.x;
162
163 if (defaults.swipeStatus)
164 triggerHandler(event, phase, start, end);
165 }
166 else
167 {
168 //touch with more/less than the fingers we are looking for
169 touchCancel(event);
170 }
171
172 that.addEventListener(MOVE_EV, touchMove, false);
173 that.addEventListener(END_EV, touchEnd, false);
174
175 }
176
177 /**
178 * Event handler for a touch move event.
179 * If we change fingers during move, then cancel the event
180 */
181 function touchMove(event)
182 {
183 if (phase == PHASE_END || phase == PHASE_CANCEL)
184 return;
185
186 var evt = hasTouch ? event.touches[0] : event;
187
188 end.x = evt.pageX;
189 end.y = evt.pageY;
190
191 // changed by Codrops
192 direction = calculateDirection();
193 lastPositionX = end.x;
194
195 if (hasTouch) {
196 fingerCount = event.touches.length;
197 }
198
199 phase = PHASE_MOVE
200
201 //Check if we need to prevent default evnet (page scroll) or not
202 validateDefaultEvent(event, direction);
203
204 if ( fingerCount == defaults.fingers || !hasTouch)
205 {
206 distance = caluculateDistance();
207
208 if (defaults.swipeStatus)
209 triggerHandler(event, phase, start, end, direction, distance);
210
211 //If we trigger whilst dragging, not on touch end, then calculate now...
212 if (!defaults.triggerOnTouchEnd)
213 {
214 // if the user swiped more than the minimum length, perform the appropriate action
215 if ( distance >= defaults.threshold )
216 {
217 phase = PHASE_END;
218 triggerHandler(event, phase, start, end);
219 touchCancel(event); // reset the variables
220 }
221 }
222 }
223 else
224 {
225 phase = PHASE_CANCEL;
226 triggerHandler(event, phase, start, end);
227 touchCancel(event);
228 }
229 }
230
231 /**
232 * Event handler for a touch end event.
233 * Calculate the direction and trigger events
234 */
235 function touchEnd(event)
236 {
237 event.preventDefault();
238
239 distance = caluculateDistance();
240
241 //changed by codrops
242 //direction = caluculateDirection();
243
244 if (defaults.triggerOnTouchEnd)
245 {
246 phase = PHASE_END;
247 // check to see if more than one finger was used and that there is an ending coordinate
248 if ( (fingerCount == defaults.fingers || !hasTouch) && end.x != 0 )
249 {
250 // if the user swiped more than the minimum length, perform the appropriate action
251 if ( distance >= defaults.threshold )
252 {
253 triggerHandler(event, phase, start, end);
254 touchCancel(event); // reset the variables
255 }
256 else
257 {
258 phase = PHASE_CANCEL;
259 triggerHandler(event, phase, start, end);
260 touchCancel(event);
261 }
262 }
263 else
264 {
265 phase = PHASE_CANCEL;
266 triggerHandler(event, phase, start, end);
267 touchCancel(event);
268 }
269 }
270 else if (phase == PHASE_MOVE)
271 {
272 phase = PHASE_CANCEL;
273 triggerHandler(event, phase, start, end);
274 touchCancel(event);
275 }
276 that.removeEventListener(MOVE_EV, touchMove, false);
277 that.removeEventListener(END_EV, touchEnd, false);
278 }
279
280 /**
281 * Event handler for a touch cancel event.
282 * Clears current vars
283 */
284 function touchCancel(event)
285 {
286 // reset the variables back to default values
287 fingerCount = 0;
288
289 start.x = 0;
290 start.y = 0;
291 end.x = 0;
292 end.y = 0;
293 delta.x = 0;
294 delta.y = 0;
295 }
296
297
298 /**
299 * Trigger the relevant event handler
300 * The handlers are passed the original event, the element that was swiped, and in the case of the catch all handler, the direction that was swiped, "left", "right", "up", or "down"
301 */
302 // changed by Codrops added start & end
303 function triggerHandler(event, phase, start, end)
304 {
305 //update status
306 if (defaults.swipeStatus)
307 defaults.swipeStatus.call($this,event, phase, start, end, direction || null, distance || 0);
308
309
310 if (phase == PHASE_CANCEL)
311 {
312 if (defaults.click && (fingerCount==1 || !hasTouch) && (isNaN(distance) || distance==0))
313 defaults.click.call($this,event, event.target);
314 }
315
316 if (phase == PHASE_END)
317 {
318 //trigger catch all event handler
319 if (defaults.swipe)
320 {
321
322 defaults.swipe.call($this,event, direction, distance);
323
324 }
325 //trigger direction specific event handlers
326 switch(direction)
327 {
328 case LEFT :
329 if (defaults.swipeLeft)
330 defaults.swipeLeft.call($this,event, direction, distance);
331 break;
332
333 case RIGHT :
334 if (defaults.swipeRight)
335 defaults.swipeRight.call($this,event, direction, distance);
336 break;
337
338 case UP :
339 if (defaults.swipeUp)
340 defaults.swipeUp.call($this,event, direction, distance);
341 break;
342
343 case DOWN :
344 if (defaults.swipeDown)
345 defaults.swipeDown.call($this,event, direction, distance);
346 break;
347 }
348 }
349 }
350
351
352 /**
353 * Checks direction of the swipe and the value allowPageScroll to see if we should allow or prevent the default behaviour from occurring.
354 * This will essentially allow page scrolling or not when the user is swiping on a touchSwipe object.
355 */
356 function validateDefaultEvent(event, direction)
357 {
358 if( defaults.allowPageScroll==NONE )
359 {
360 event.preventDefault();
361 }
362 else
363 {
364 var auto=defaults.allowPageScroll==AUTO;
365
366 switch(direction)
367 {
368 case LEFT :
369 if ( (defaults.swipeLeft && auto) || (!auto && defaults.allowPageScroll!=HORIZONTAL))
370 event.preventDefault();
371 break;
372
373 case RIGHT :
374 if ( (defaults.swipeRight && auto) || (!auto && defaults.allowPageScroll!=HORIZONTAL))
375 event.preventDefault();
376 break;
377
378 case UP :
379 if ( (defaults.swipeUp && auto) || (!auto && defaults.allowPageScroll!=VERTICAL))
380 event.preventDefault();
381 break;
382
383 case DOWN :
384 if ( (defaults.swipeDown && auto) || (!auto && defaults.allowPageScroll!=VERTICAL))
385 event.preventDefault();
386 break;
387 }
388 }
389
390 }
391
392
393
394 /**
395 * Calcualte the length / distance of the swipe
396 */
397 function caluculateDistance()
398 {
399 //return Math.round(Math.sqrt(Math.pow(end.x - start.x,2) + Math.pow(end.y - start.y,2)));
400 return Math.round(Math.abs(end.x - start.x));
401 }
402
403 /**
404 * Calcualte the angle of the swipe
405 */
406 function caluculateAngle()
407 {
408 var X = start.x-end.x;
409 var Y = end.y-start.y;
410 var r = Math.atan2(Y,X); //radians
411 var angle = Math.round(r*180/Math.PI); //degrees
412
413 //ensure value is positive
414 if (angle < 0)
415 angle = 360 - Math.abs(angle);
416
417 return angle;
418 }
419
420 /**
421 * Calcualte the direction of the swipe
422 * This will also call caluculateAngle to get the latest angle of swipe
423 */
424 function caluculateDirection()
425 {
426 var angle = caluculateAngle();
427
428 if ( (angle <= 45) && (angle >= 0) )
429 return LEFT;
430
431 else if ( (angle <= 360) && (angle >= 315) )
432 return LEFT;
433
434 else if ( (angle >= 135) && (angle <= 225) )
435 return RIGHT;
436
437 else if ( (angle > 45) && (angle < 135) )
438 return DOWN;
439
440 else
441 return UP;
442 }
443
444 // added by codrops
445 function calculateDirection()
446 {
447 var dir;
448 if( end.x < lastPositionX ) {
449 dir = LEFT
450 }
451 else if( end.x > lastPositionX ) {
452 dir = RIGHT;
453 }
454 else {
455 dir = UP
456 }
457 return dir;
458 }
459
460 // Add gestures to all swipable areas if supported
461 try
462 {
463
464 this.addEventListener(START_EV, touchStart, false);
465 this.addEventListener(CANCEL_EV, touchCancel);
466 }
467 catch(e)
468 {
469 //touch not supported
470 }
471
472 });
473 };
474
475
476
477
478})(jQuery);
diff --git a/Blocks/Flipboard/js/modernizr.custom.08464.js b/Blocks/Flipboard/js/modernizr.custom.08464.js
new file mode 100644
index 0000000..5325668
--- /dev/null
+++ b/Blocks/Flipboard/js/modernizr.custom.08464.js
@@ -0,0 +1,4 @@
1/* Modernizr 2.5.3 (Custom Build) | MIT & BSD
2 * Build: http://www.modernizr.com/download/#-csstransforms3d-csstransitions-shiv-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load
3 */
4;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a)if(j[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.5.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),k.appendChild(j);return f=["&#173;","<style>",a,"</style>"].join(""),k.id=h,(l?k:m).innerHTML+=f,m.appendChild(k),l||(m.style.background="",g.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e});var G=function(a,c){var d=a.join(""),f=c.length;w(d,function(a,c){var d=b.styleSheets[b.styleSheets.length-1],g=d?d.cssRules&&d.cssRules[0]?d.cssRules[0].cssText:d.cssText||"":"",h=a.childNodes,i={};while(f--)i[h[f].id]=h[f];e.csstransforms3d=(i.csstransforms3d&&i.csstransforms3d.offsetLeft)===9&&i.csstransforms3d.offsetHeight===3},f,c)}([,["@media (",m.join("transform-3d),("),h,")","{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join("")],[,"csstransforms3d"]);q.csstransforms3d=function(){var a=!!F("perspective");return a&&"webkitPerspective"in g.style&&(a=e.csstransforms3d),a},q.csstransitions=function(){return F("transition")};for(var H in q)y(q,H)&&(v=H.toLowerCase(),e[v]=q[H](),t.push((e[v]?"":"no-")+v));return z(""),i=k=null,function(a,b){function g(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function h(){var a=k.elements;return typeof a=="string"?a.split(" "):a}function i(a){var b={},c=a.createElement,e=a.createDocumentFragment,f=e();a.createElement=function(a){var e=(b[a]||(b[a]=c(a))).cloneNode();return k.shivMethods&&e.canHaveChildren&&!d.test(a)?f.appendChild(e):e},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+h().join().replace(/\w+/g,function(a){return b[a]=c(a),f.createElement(a),'c("'+a+'")'})+");return n}")(k,f)}function j(a){var b;return a.documentShived?a:(k.shivCSS&&!e&&(b=!!g(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),f||(b=!i(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea)$/i,e,f;(function(){var a=b.createElement("a");a.innerHTML="<xyz></xyz>",e="hidden"in a,f=a.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var k={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:j};a.html5=k,j(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){a!="img"&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),a!="img"&&(r||y[c]===2?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},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=s?l:n.parentNode,l=a.opera&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,f,g,i):(y[j.url]?j.noexec=!0:y[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),y[j.url]=2})))}function i(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var j,l,m=this.yepnope.loader;if(e(a))g(a,0,m,0);else if(w(a))for(j=0;j<a.length;j++)l=a[j],e(l)?g(l,0,m,0):w(l)?B(l):Object(l)===l&&i(l,m);else Object(a)===a&&i(a,m)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))}; \ No newline at end of file
Powered by cgit v1.2.3 (git 2.41.0)