commit b8452caa26a84f6a43fdc0f5ffcaf047e5500420 Author: Zach Wise Date: Mon Feb 20 11:12:31 2012 -0600 First Commit diff --git a/examples/.DS_Store b/examples/.DS_Store new file mode 100644 index 0000000..9ed1a1a Binary files /dev/null and b/examples/.DS_Store differ diff --git a/examples/kitchen-sink/data.json b/examples/kitchen-sink/data.json new file mode 100644 index 0000000..cb33222 --- /dev/null +++ b/examples/kitchen-sink/data.json @@ -0,0 +1,172 @@ + +{ + "timeline": + { + "headline":"The Kitchen Sink, Évier de la Cuisine ", + "type":"default", + "startDate":"1888", + "text":"An example of the different kinds of stuff you can do.", + "asset": + { + "media":"http://2.bp.blogspot.com/-dxJbW0CG8Zs/TmkoMA5-cPI/AAAAAAAAAqw/fQpsz9GpFdo/s1600/voyage-dans-la-lune-1902-02-g.jpg", + "credit":"", + "caption":"" + }, + "date": [ + { + "startDate":"2012,1,18", + "headline":"YouTube", + "text":"To add a YouTube video, just add a link to it.", + "asset": + { + "media":"http://youtu.be/yRvJylbSg7o", + "credit":"", + "caption":"Directed and Edited by Matt Mayer, Produced by Seth Keim, Written by Eliot Glazer. Featuring Eliot and Ilana Glazer, who are siblings, not married." + } + }, + { + "startDate":"1980,1,18", + "headline":"Google Map", + "text":"", + "asset": + { + "media":"http://maps.google.com/?ll=42.054932,-87.674654&spn=0.014785,0.023754&hnear=1630+Lake+Ave,+Wilmette,+Illinois+60091&t=v&z=16", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2000,1,18", + "headline":"Google Map", + "text":"Just add the link to the map!", + "asset": + { + "media":"http://maps.google.com/maps?q=Northwestern+University,+Sheridan+Road,+Evanston,+IL&hl=en&ll=42.056972,-87.676907&spn=0.02957,0.047507&sll=42.054932,-87.674654&sspn=0.014785,0.023754&oq=northwestern+&t=v&hq=Northwestern+University,+Sheridan+Road,+Evanston,+IL&z=15", + "credit":"", + "caption":"" + } + }, + + { + "startDate":"1899", + "headline":"Le portrait mystérieux ", + "text":"To add a YouTube video, just add a link to it.", + "asset": + { + "media":"http://youtu.be/lIvftGgps24", + "credit":"Georges Méliès", + "caption":"Le portrait mystérieux" + } + }, + { + "startDate":"1902", + "headline":"L'oeuf du sorcier", + "text":"", + "asset": + { + "media":"http://youtu.be/JdBqHgwN7Pg", + "credit":"Georges Méliès", + "caption":"L'oeuf du sorcier" + } + }, + { + "startDate":"1905", + "headline":"Le juif errant", + "text":"", + "asset": + { + "media":"http://youtu.be/SvmM_YSnWX8", + "credit":"Georges Méliès", + "caption":"Le juif errant" + } + }, + { + "startDate":"1903", + "headline":"Le tonnerre de Jupiter", + "text":"", + "asset": + { + "media":"http://youtu.be/nIylL8ufx3Y", + "credit":"Georges Méliès", + "caption":"Le tonnerre de Jupiter" + } + }, + { + "startDate":"1980,2,7", + "headline":"Flickr", + "text":"", + "asset": + { + "media":"http://www.flickr.com/photos/zachwise/6856858425/in/photostream", + "credit":"Zach Wise", + "caption":"Feels like Siberia again" + } + }, + { + "startDate":"1990,2,7", + "headline":"Flickr", + "text":"", + "asset": + { + "media":"http://www.flickr.com/photos/zachwise/6687123779/in/photostream", + "credit":"Zach Wise", + "caption":"Enjoying the snow while sheltered at the train station" + } + }, + { + "startDate":"2012,2,7", + "headline":"A Tweet", + "text":"To add a tweet, just add the link.", + "asset": + { + "media":"https://twitter.com/#!/neonmarg/status/167006310850760706", + "credit":"", + "caption":"" + } + }, + + { + "startDate":"2012,1,18", + "headline":"SoundCloud ", + "text":"Just add a link to the track", + "asset": + { + "media":"http://soundcloud.com/radiohead/radiohead_separator-anstam-rmx", + "credit":"Radiohead Separator - Anstam RMX", + "caption":"" + } + }, + { + "startDate":"2011,12,23", + "headline":"Vimeo", + "text":"

Whitestone Motion Pictures proudly presents ‘Jack and the Dustbowl’, a short film about overcoming adversity and making the impossible, possible.

Jack Spriggs, a poor dust bowl farmer from Alabama, is determined to keep his family’s land. Set during the Great Depression, record heat waves and over-farming have turned the once fertile soil into worthless dust. Refusing to become a victim of his circumstances, Jack embraces his surroundings and digs in. Jack’s tenacious spirit and ingenuity will either keep his family together or he'll lose everything trying.

", + "asset": + { + "media":"https://vimeo.com/34724990", + "credit":"Whitestone Motion Pictures", + "caption":"Whitestone Motion Pictures proudly presents ‘Jack and the Dustbowl’, a short film about overcoming adversity and making the impossible, possible." + } + }, + { + "startDate":"2011,2,10", + "headline":"Some Tweet Response also", + "asset": + { + "media":"http://twitter.com/alykat/status/164184609519697920", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2011,12,10", + "headline":"Some Tweet Response", + "asset": + { + "media":"http://twitter.com/ArjunaSoriano/status/164181156147900416", + "credit":"", + "caption":"" + } + } + ] + } +} \ No newline at end of file diff --git a/examples/kitchen-sink/index.html b/examples/kitchen-sink/index.html new file mode 100644 index 0000000..eb734ee --- /dev/null +++ b/examples/kitchen-sink/index.html @@ -0,0 +1,56 @@ + + + + + Kitchen Sink Timeline + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/examples/template_googlespreadsheet/.DS_Store b/examples/template_googlespreadsheet/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/examples/template_googlespreadsheet/.DS_Store differ diff --git a/examples/template_googlespreadsheet/index.html b/examples/template_googlespreadsheet/index.html new file mode 100644 index 0000000..98d58ce --- /dev/null +++ b/examples/template_googlespreadsheet/index.html @@ -0,0 +1,59 @@ + + + + + Timeline Google Spreadsheet Template + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/examples/template_html/.DS_Store b/examples/template_html/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/examples/template_html/.DS_Store differ diff --git a/examples/template_html/index.html b/examples/template_html/index.html new file mode 100755 index 0000000..0e17e9c --- /dev/null +++ b/examples/template_html/index.html @@ -0,0 +1,180 @@ + + + + + Elizabeth Taylor 1932-2011 - Timeline + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +

The Main Timeline Headline

+
+

The main text goes here. You can have p tags or anything really.

+
+
+ + John Doe/Millennium Magazine +
Caption goes here.
+
+
+ + + + +
+ + + + diff --git a/examples/template_json/data.json b/examples/template_json/data.json new file mode 100644 index 0000000..7b49f88 --- /dev/null +++ b/examples/template_json/data.json @@ -0,0 +1,248 @@ + +{ + "timeline": + { + "headline":"The Kitchen Sink", + "type":"default", + "startDate":"2011,9,1", + "text":"An example of the different kinds of stuff you can do.", + "date": [ + { + "startDate":"2012,1,26", + "headline":"Sh*t Politicians Say", + "text":"

Sh*t Politicians Say landed just hours before Thursday night’s Republican presidential debate and stars actor Joe Leon. In true political fashion, his character rattles off common jargon heard from people running for office.

Do these ring a bell? Moral fiber, family values, trust me, three-point plan, earmarks, tough question, children are our future, Washington outsider, jobs, my opponent — all sound familiar.

", + "asset": + { + "media":"http://youtu.be/u4XpeU9erbg", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2012,1,10", + "headline":"Sh*t Nobody Says", + "text":"

Have you ever heard someone say “can I burn a copy of your Nickelback CD?” or “my Bazooka gum still has flavor!” Nobody says that.

", + "asset": + { + "media":"http://youtu.be/f-x8t0JOnVw", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2012,1,26", + "headline":"Sh*t Chicagoans Say", + "text":"", + "asset": + { + "media":"http://youtu.be/Ofy5gNkKGOo", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2011,12,12", + "headline":"Sh*t Girls Say", + "text":"", + "asset": + { + "media":"http://youtu.be/u-yLGIH7W9Y", + "credit":"", + "caption":"Writers & Creators: Kyle Humphrey & Graydon Sheppard" + } + }, + { + "startDate":"2012,1,4", + "headline":"Sh*t Broke People Say", + "text":"", + "asset": + { + "media":"http://youtu.be/zyyalkHjSjo", + "credit":"", + "caption":"" + } + }, + + { + "startDate":"2012,1,4", + "headline":"Sh*t Silicon Valley Says", + "text":"", + "asset": + { + "media":"http://youtu.be/BR8zFANeBGQ", + "credit":"", + "caption":"written, filmed, and edited by Kate Imbach & Tom Conrad" + } + }, + { + "startDate":"2011,12,25", + "headline":"Sh*t Vegans Say", + "text":"", + "asset": + { + "media":"http://youtu.be/OmWFnd-p0Lw", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2012,1,23", + "headline":"Sh*t Graphic Designers Say", + "text":"", + "asset": + { + "media":"http://youtu.be/KsT3QTmsN5Q", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2011,12,30", + "headline":"Sh*t Wookiees Say", + "text":"", + "asset": + { + "media":"http://youtu.be/vJpBCzzcSgA", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2012,1,17", + "headline":"Sh*t People Say About Sh*t People Say Videos", + "text":"", + "asset": + { + "media":"http://youtu.be/c9ehQ7vO7c0", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2012,1,20", + "headline":"Sh*t Social Media Pros Say", + "text":"", + "asset": + { + "media":"http://youtu.be/eRQe-BT9g_U", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2012,1,11", + "headline":"Sh*t Old People Say About Computers", + "text":"", + "asset": + { + "media":"http://youtu.be/HRmc5uuoUzA", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2012,1,11", + "headline":"Sh*t College Freshmen Say", + "text":"", + "asset": + { + "media":"http://youtu.be/rwozXzo0MZk", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2011,12,16", + "headline":"Sh*t Girls Say - Episode 2", + "text":"", + "asset": + { + "media":"http://youtu.be/kbovd-e-hRg", + "credit":"", + "caption":"Writers & Creators: Kyle Humphrey & Graydon Sheppard" + } + }, + { + "startDate":"2011,12,24", + "headline":"Sh*t Girls Say - Episode 3 Featuring Juliette Lewis", + "text":"", + "asset": + { + "media":"http://youtu.be/bDHUhT71JN8", + "credit":"", + "caption":"Writers & Creators: Kyle Humphrey & Graydon Sheppard" + } + }, + { + "startDate":"2012,1,27", + "headline":"Sh*t Web Designers Say", + "text":"", + "asset": + { + "media":"http://youtu.be/MEOb_meSHhQ", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2012,1,12", + "headline":"Sh*t Hipsters Say", + "text":"No meme is complete without a bit of hipster-bashing.", + "asset": + { + "media":"http://youtu.be/FUhrSVyu0Kw", + "credit":"", + "caption":"Written, Directed, Conceptualized and Performed by Carrie Valentine and Jessica Katz" + } + }, + { + "startDate":"2012,1,6", + "headline":"Sh*t Cats Say", + "text":"No meme is complete without cats. This had to happen, obviously.", + "asset": + { + "media":"http://youtu.be/MUX58Vi-YLg", + "credit":"", + "caption":"" + } + }, + { + "startDate":"2012,1,21", + "headline":"Sh*t Cyclists Say", + "text":"", + "asset": + { + "media":"http://youtu.be/GMCkuqL9IcM", + "credit":"", + "caption":"Video script, production, and editing by Allen Krughoff of Hardcastle Photography" + } + }, + { + "startDate":"2011,12,30", + "headline":"Sh*t Yogis Say", + "text":"", + "asset": + { + "media":"http://youtu.be/IMC1_RH_b3k", + "credit":"", + "caption":"" + } + }, + + + + + { + "startDate":"2012,1,18", + "headline":"Sh*t New Yorkers Say", + "text":"", + "asset": + { + "media":"http://youtu.be/yRvJylbSg7o", + "credit":"", + "caption":"Directed and Edited by Matt Mayer, Produced by Seth Keim, Written by Eliot Glazer. Featuring Eliot and Ilana Glazer, who are siblings, not married." + } + } + ] + } +} \ No newline at end of file diff --git a/examples/template_json/index.html b/examples/template_json/index.html new file mode 100644 index 0000000..7c30f5a --- /dev/null +++ b/examples/template_json/index.html @@ -0,0 +1,56 @@ + + + + + Timeline JSON Template + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/jquery-min.js b/jquery-min.js new file mode 100644 index 0000000..ee02337 --- /dev/null +++ b/jquery-min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/source/.DS_Store b/source/.DS_Store new file mode 100644 index 0000000..ea1bca9 Binary files /dev/null and b/source/.DS_Store differ diff --git a/source/css/mixins.css b/source/css/mixins.css new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/source/css/mixins.css @@ -0,0 +1 @@ + diff --git a/source/css/reset.css b/source/css/reset.css new file mode 100644 index 0000000..3f8d0d6 --- /dev/null +++ b/source/css/reset.css @@ -0,0 +1,20 @@ +#timeline h1,#timeline h2,#timeline h3,#timeline h4,#timeline h5,#timeline h6,#timeline p,#timeline blockquote,#timeline pre,#timeline a,#timeline abbr,#timeline acronym,#timeline address,#timeline cite,#timeline code,#timeline del,#timeline dfn,#timeline em,#timeline img,#timeline q,#timeline s,#timeline samp,#timeline small,#timeline strike,#timeline strong,#timeline sub,#timeline sup,#timeline tt,#timeline var,#timeline dd,#timeline dl,#timeline dt,#timeline li,#timeline ol,#timeline ul,#timeline fieldset,#timeline form,#timeline label,#timeline legend,#timeline button,#timeline table,#timeline caption,#timeline tbody,#timeline tfoot,#timeline thead,#timeline tr,#timeline th,#timeline td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:1;font-family:inherit;} +#timeline table{border-collapse:collapse;border-spacing:0;} +#timeline ol,#timeline ul{list-style:none;} +#timeline q:before,#timeline q:after,#timeline blockquote:before,#timeline blockquote:after{content:"";} +#timeline a:focus{outline:thin dotted;} +#timeline a:hover,#timeline a:active{outline:0;} +#timeline article,#timeline aside,#timeline details,#timeline figcaption,#timeline figure,#timeline footer,#timeline header,#timeline hgroup,#timeline nav,#timeline section{display:block;} +#timeline audio,#timeline canvas,#timeline video{display:inline-block;*display:inline;*zoom:1;} +#timeline audio:not([controls]){display:none;} +#timeline sub,#timeline sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;} +#timeline sup{top:-0.5em;} +#timeline sub{bottom:-0.25em;} +#timeline img{border:0;-ms-interpolation-mode:bicubic;} +#timeline button,#timeline input,#timeline select,#timeline textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;} +#timeline button,#timeline input{line-height:normal;*overflow:visible;} +#timeline button::-moz-focus-inner,#timeline input::-moz-focus-inner{border:0;padding:0;} +#timeline button,#timeline input[type="button"],#timeline input[type="reset"],#timeline input[type="submit"]{cursor:pointer;-webkit-appearance:button;} +#timeline input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;} +#timeline input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;} +#timeline textarea{overflow:auto;vertical-align:top;} diff --git a/source/css/structure-slider.css b/source/css/structure-slider.css new file mode 100644 index 0000000..c9fc9ba --- /dev/null +++ b/source/css/structure-slider.css @@ -0,0 +1,119 @@ +#timeline h1,#timeline h2,#timeline h3,#timeline h4,#timeline h5,#timeline h6,#timeline p,#timeline blockquote,#timeline pre,#timeline a,#timeline abbr,#timeline acronym,#timeline address,#timeline cite,#timeline code,#timeline del,#timeline dfn,#timeline em,#timeline img,#timeline q,#timeline s,#timeline samp,#timeline small,#timeline strike,#timeline strong,#timeline sub,#timeline sup,#timeline tt,#timeline var,#timeline dd,#timeline dl,#timeline dt,#timeline li,#timeline ol,#timeline ul,#timeline fieldset,#timeline form,#timeline label,#timeline legend,#timeline button,#timeline table,#timeline caption,#timeline tbody,#timeline tfoot,#timeline thead,#timeline tr,#timeline th,#timeline td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:1;font-family:inherit;} +#timeline table{border-collapse:collapse;border-spacing:0;} +#timeline ol,#timeline ul{list-style:none;} +#timeline q:before,#timeline q:after,#timeline blockquote:before,#timeline blockquote:after{content:"";} +#timeline a:focus{outline:thin dotted;} +#timeline a:hover,#timeline a:active{outline:0;} +#timeline article,#timeline aside,#timeline details,#timeline figcaption,#timeline figure,#timeline footer,#timeline header,#timeline hgroup,#timeline nav,#timeline section{display:block;} +#timeline audio,#timeline canvas,#timeline video{display:inline-block;*display:inline;*zoom:1;} +#timeline audio:not([controls]){display:none;} +#timeline sub,#timeline sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;} +#timeline sup{top:-0.5em;} +#timeline sub{bottom:-0.25em;} +#timeline img{border:0;-ms-interpolation-mode:bicubic;} +#timeline button,#timeline input,#timeline select,#timeline textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;} +#timeline button,#timeline input{line-height:normal;*overflow:visible;} +#timeline button::-moz-focus-inner,#timeline input::-moz-focus-inner{border:0;padding:0;} +#timeline button,#timeline input[type="button"],#timeline input[type="reset"],#timeline input[type="submit"]{cursor:pointer;-webkit-appearance:button;} +#timeline input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;} +#timeline input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;} +#timeline textarea{overflow:auto;vertical-align:top;} +#timeline{font-family:"Georgia",Times New Roman,Times,serif;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;font-size:14px;font-weight:normal;line-height:20px;}#timeline p{font-size:14px;font-weight:normal;line-height:20px;margin-bottom:20px;color:#666666;}#timeline p small{font-size:12px;} +#timeline p:first-child{margin-top:20px;} +#timeline .navigation p{color:#999999;} +#timeline .feature h3,#timeline .feature h4,#timeline .feature h5,#timeline .feature h6{margin-bottom:15px;} +#timeline .feature p{color:#666666;} +#timeline h1,#timeline h2,#timeline h3,#timeline h4,#timeline h5,#timeline h6{font-weight:normal;color:#000000;}#timeline h1 small,#timeline h2 small,#timeline h3 small,#timeline h4 small,#timeline h5 small,#timeline h6 small{color:#999999;} +#timeline h1.date,#timeline h2.date,#timeline h3.date,#timeline h4.date,#timeline h5.date,#timeline h6.date{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:bold;} +#timeline h1{margin-bottom:15px;font-size:28px;line-height:30px;}#timeline h1 small{font-size:18px;} +#timeline h2{margin-bottom:15px;font-size:24px;line-height:28px;}#timeline h2 small{font-size:14px;} +#timeline h3,#timeline h4,#timeline h5,#timeline h6{line-height:40px;}#timeline h3 .active,#timeline h4 .active,#timeline h5 .active,#timeline h6 .active{color:#ff0000;} +#timeline h3{font-size:18px;line-height:22px;}#timeline h3 small{font-size:14px;} +#timeline h4{font-size:16px;line-height:18px;}#timeline h4 small{font-size:12px;} +#timeline h5{font-size:14px;line-height:16px;} +#timeline h6{font-size:13px;line-height:14px;text-transform:uppercase;} +#timeline .credit,#timeline .caption{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;} +#timeline .credit{color:#999999;text-align:right;font-size:10px;line-height:5px;display:block;margin:0 auto;} +#timeline .caption{text-align:left;margin-top:10px;color:#666666;font-size:11px;line-height:14px;} +html,body{height:100%;padding:0px;margin:0px;} +#timeline{width:100%;height:100%;padding:0px;margin:0px;background-color:#ffffff;position:absolute;overflow:hidden;}#timeline .feedback{position:absolute;display:table;overflow:hidden;top:0px;left:0px;z-index:2000;width:100%;height:100%;background-color:#e9e9e9;border:1px solid #cccccc;}#timeline .feedback .messege{display:table-cell;vertical-align:middle;font-size:28px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:bold;text-transform:uppercase;line-height:36px;width:75%;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;text-align:center;} +#timeline .container.main{position:absolute;top:0px: left:0px;padding-bottom:3px;padding-top:15px;width:auto;height:auto;margin:0px;clear:both;} +#timeline img,#timeline embed,#timeline object,#timeline video,#timeline iframe{max-width:100%;} +#timeline img{max-height:100%;} +#timeline a{color:#0069d6;text-decoration:none;} +#timeline a:hover{color:#00438a;text-decoration:underline;} +#timeline .twitter{max-width:500px;background-color:#ffffff;margin-left:auto;margin-right:auto;}#timeline .twitter blockquote{font-size:14px;line-height:20px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;color:#666666;}#timeline .twitter blockquote p{font-size:28px;line-height:36px;margin-bottom:6px;padding-top:10px;background-color:#ffffff;font-family:"Georgia",Times New Roman,Times,serif;color:#000000;} +#timeline .twitter a{color:#0084b4;text-decoration:none;} +#timeline .twitter a:hover{color:#004c68;text-decoration:underline;} +#timeline .thumbnail{width:24px;height:24px;overflow:hidden;float:left;margin-right:5px;border:1px solid #cccccc;} +#timeline .thumbnail.twitter{background-image:url(gfx/icons/twitter.png);background-repeat:no-repeat;} +#timeline .thumbnail.vimeo{background-image:url(gfx/icons/vimeo.png);background-repeat:no-repeat;} +#timeline .thumbnail.youtube{background-image:url(gfx/icons/youtube.png);background-repeat:no-repeat;} +#timeline .zFront{z-index:500;} +#timeline{}#timeline .slider .slider-container-mask{width:720px;height:400px;overflow:hidden;position:relative;margin-right:100px;margin-left:100px;display:block;margin-left:auto;margin-right:auto;}#timeline .slider .slider-container-mask .slider-container{position:absolute;top:0px;left:-2160px;background-color:#ffffff;}#timeline .slider .slider-container-mask .slider-container .slider-item-container .slider-item{width:720px;top:0px;position:absolute;} +#timeline .slider .nav-previous,#timeline .slider .nav-next{position:absolute;top:0px;width:100px;color:#cccccc;font-size:11px;}#timeline .slider .nav-previous .nav-container,#timeline .slider .nav-next .nav-container{height:100px;position:absolute;} +#timeline .slider .nav-previous .icon,#timeline .slider .nav-next .icon{margin-bottom:15px;} +#timeline .slider .nav-previous .date,#timeline .slider .nav-next .date{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:bold;line-height:20px;text-transform:uppercase;margin-bottom:5px;} +#timeline .slider .nav-previous .date,#timeline .slider .nav-next .date,#timeline .slider .nav-previous .title,#timeline .slider .nav-next .title{line-height:14px;} +#timeline .slider .nav-previous:hover,#timeline .slider .nav-next:hover{color:#333333;cursor:pointer;} +#timeline .slider .nav-previous{float:left;text-align:left;}#timeline .slider .nav-previous .icon{margin-left:10px;padding-left:20px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAWCAMAAAD6gTxzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRF2dnZWVlZsrKyv7+/TU1NzMzMjY2Nc3Nz5eXlgICAQEBA8vLymZmZZmZmMzMz////CXz3iwAAABB0Uk5T////////////////////AOAjXRkAAAB1SURBVHjafNFXDsAgDAPQAKWDUd//tq2EnS6p+eNJECcYWLmzklFq2Ud1iAKlVNFG2c/zoCiJIJlkA6lOlFBFXU+vIM26lkHypxvzmCnjgg91J6TPRaDJktMVwvATFc+ur7Gb02MCrfA2py/6amGe2b/jEGAA5cYUouw7P64AAAAASUVORK5CYII=) no-repeat scroll 0% 50%;} +#timeline .slider .nav-previous .date,#timeline .slider .nav-previous .title{text-align:left;padding-left:10px;} +#timeline .slider .nav-previous:hover .icon{margin-left:5px;padding-left:20px;} +#timeline .slider .nav-next{float:right;text-align:right;}#timeline .slider .nav-next .icon{margin-right:10px;padding-right:20px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAWCAMAAAD6gTxzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRF2dnZWVlZsrKyv7+/TU1NzMzMjY2Nc3Nz5eXlgICAQEBA8vLymZmZZmZmMzMz////CXz3iwAAABB0Uk5T////////////////////AOAjXRkAAABySURBVHjabNFLEoAgDAPQAiJ/ev/buqCJONjlm5GkVcKwEbWR5uaaq4E0V7NB0mg0b5J2mCdpMqpC+kasaNkjrE3Ac530RgSSDkaQ0kFbN6N9g0X5KPFTteAzLuSPtQVScJyGpx1PyNo8NH9HxB6PAAMAzkAUorcBvvAAAAAASUVORK5CYII=) no-repeat scroll 100% 50%;} +#timeline .slider .nav-next .date,#timeline .slider .nav-next .title{text-align:right;padding-right:10px;} +#timeline .slider .nav-next:hover .icon{margin-right:5px;padding-right:20px;} +#timeline .slider .slider-item{padding:0px;overflow:hidden;}#timeline .slider .slider-item .content{background-color:#ffffff;padding:0px;zoom:1;width:720px;margin-left:auto;margin-right:auto;}#timeline .slider .slider-item .content:before,#timeline .slider .slider-item .content:after{display:table;content:"";zoom:1;} +#timeline .slider .slider-item .content:after{clear:both;} +#timeline .slider .slider-item .content .layout-text .text{width:100%;height:100%;}#timeline .slider .slider-item .content .layout-text .text .container{width:75%;margin-left:auto;margin-right:auto;} +#timeline .slider .slider-item .content .layout-media .text{width:100%;height:100%;}#timeline .slider .slider-item .content .layout-media .text .container{width:100%;margin-left:auto;margin-right:auto;} +#timeline .slider .slider-item .content .layout-media .media{width:100%;}#timeline .slider .slider-item .content .layout-media .media .container{width:auto;} +#timeline .slider .slider-item .content .layout-text-media{height:100%;zoom:1;display:table;}#timeline .slider .slider-item .content .layout-text-media:before,#timeline .slider .slider-item .content .layout-text-media:after{display:table;content:"";zoom:1;} +#timeline .slider .slider-item .content .layout-text-media:after{clear:both;} +#timeline .slider .slider-item .content .layout-text-media .text{width:33%;min-width:150px;display:table-cell;vertical-align:middle;}#timeline .slider .slider-item .content .layout-text-media .text .container{display:table-cell;vertical-align:middle;float:right;padding-right:15px;} +#timeline .slider .slider-item .content .layout-text-media .media{width:100%;display:inline-block;}#timeline .slider .slider-item .content .layout-text-media .media .media-wrapper{margin-left:auto;margin-right:auto;display:table;vertical-align:middle;}#timeline .slider .slider-item .content .layout-text-media .media .media-wrapper .media-container{overflow:hidden;line-height:0px;padding:0px;border:1px solid #cccccc;margin-left:auto;margin-right:auto;background-color:#cccccc;} +#timeline .slider .slider-item .content .layout-text-media .media.text-media .media-wrapper .media-container{border:none;background-color:#ffffff;} +#timeline .feature{width:100%;}#timeline .feature .slider{width:100%;float:left;position:relative;} +#timeline .navigation{clear:both;width:100%;height:200px;overflow:hidden;border-top:1px solid #cccccc;position:relative;}#timeline .navigation .timenav-background{position:absolute;top:0px;left:0px;height:150px;width:100%;background-color:#e9e9e9;}#timeline .navigation .timenav-background .timenav-line{position:absolute;top:0px;left:50%;width:2px;height:150px;background:#ff0000;z-index:500;} +#timeline .navigation .timenav{position:absolute;top:0px;left:-250px;z-index:1;}#timeline .navigation .timenav .content{position:relative;}#timeline .navigation .timenav .content .marker.active .dot{background:#ff0000;} +#timeline .navigation .timenav .content .marker.active .line .event-line{background:#ff0000;} +#timeline .navigation .timenav .content .marker.active .flag{z-index:200;}#timeline .navigation .timenav .content .marker.active .flag .flag-content h3{color:#ff0000;} +#timeline .navigation .timenav .content .marker.active:hover{cursor:default;}#timeline .navigation .timenav .content .marker.active:hover .flag .flag-content h3{color:#ff0000;} +#timeline .navigation .timenav .content .marker.active:hover .flag .flag-content h4{color:#999999;} +#timeline .navigation .timenav .content .marker{position:absolute;top:0px;left:150px;display:block;}#timeline .navigation .timenav .content .marker .dot{position:absolute;top:150px;left:0px;display:block;width:6px;height:6px;background:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;z-index:21;} +#timeline .navigation .timenav .content .marker .line{position:absolute;top:0px;left:3px;width:1px;height:150px;background:#cccccc;z-index:22;}#timeline .navigation .timenav .content .marker .line .event-line{position:absolute;z-index:22;left:0px;height:1px;width:1px;background:#666666;filter:alpha(opacity=10);-khtml-opacity:0.1;-moz-opacity:0.1;opacity:0.1;} +#timeline .navigation .timenav .content .marker .flag{position:absolute;top:15px;left:3px;padding:0px;display:block;z-index:23;width:153px;height:56px;overflow:hidden;background-image:url(gfx/TimeFlag.png);background-repeat:no-repeat;}#timeline .navigation .timenav .content .marker .flag .flag-content{padding:5px 7px 17px 5px;overflow:hidden;}#timeline .navigation .timenav .content .marker .flag .flag-content h3{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:bold;line-height:20px;font-size:11px;line-height:12px;color:#666666;margin-bottom:2px;} +#timeline .navigation .timenav .content .marker .flag .flag-content h4{font-size:10px;line-height:11px;color:#999999;} +#timeline .navigation .timenav .content .marker .flag .flag-content .thumbnail{margin-bottom:15px;} +#timeline .navigation .timenav .content .marker .flag:hover{cursor:pointer;}#timeline .navigation .timenav .content .marker .flag:hover .flag-content h3{color:#333333;} +#timeline .navigation .timenav .content .marker .flag:hover .flag-content h4{color:#666666;} +#timeline .navigation .timenav .content .marker .flag.row1{z-index:25;top:48px;} +#timeline .navigation .timenav .content .marker .flag.row2{z-index:24;top:96px;} +#timeline .navigation .timenav .content .marker .flag.row3{z-index:23;top:1px;} +#timeline .navigation .timenav .content .marker .flag.zFront{z-index:100;} +#timeline .navigation .timenav .time{position:absolute;left:0px;top:150px;height:50px;background-color:#ffffff;}#timeline .navigation .timenav .time .time-interval-minor{height:6px;white-space:nowrap;position:absolute;top:-9px;left:8px;z-index:10;}#timeline .navigation .timenav .time .time-interval-minor .minor{position:relative;top:0px;display:inline-block;background:#ffffff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAMCAMAAACdvocfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFzMzM////040VdgAAAAJ0Uk5T/wDltzBKAAAAEklEQVR42mJgYAQCBopJgAADAAbwADHy2qHzAAAAAElFTkSuQmCC);width:15px;height:6px;background-position:center top;white-space:nowrap;color:#333333;margin-top:0px;padding-top:0px;} +#timeline .navigation .timenav .time .time-interval{white-space:nowrap;position:absolute;top:5px;left:0px;}#timeline .navigation .timenav .time .time-interval h5{background:#ffffff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAMCAMAAACdvocfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFzMzM////040VdgAAAAJ0Uk5T/wDltzBKAAAAEklEQVR42mJgYAQCBopJgAADAAbwADHy2qHzAAAAAElFTkSuQmCC);background-position:center top;background-repeat:no-repeat;padding-top:15px;display:inline-block;width:150px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-weight:normal;line-height:20px;text-transform:uppercase;text-align:center;white-space:nowrap;color:#333333;margin-left:0px;margin-right:0px;margin-top:1px;} +.slider{width:100%;height:100%;overflow:hidden;}.slider .slider-container-mask{text-align:center;width:100%;height:100%;overflow:hidden;}.slider .slider-container-mask .slider-container{position:absolute;top:0px;left:80px;overflow:hidden;text-align:center;width:100%;height:100%;width:800px;height:600px;text-align:center;display:table;}.slider .slider-container-mask .slider-container .slider-item-container{overflow:hidden;display:table-cell;vertical-align:middle;} +.slider img,.slider embed,.slider object,.slider video,.slider iframe{max-width:100%;} +.slider a{color:#0069d6;text-decoration:none;} +.slider a:hover{color:#00438a;text-decoration:underline;} +.slider .nav-previous,.slider .nav-next{position:absolute;top:0px;width:100px;color:#cccccc;font-size:11px;}.slider .nav-previous .nav-container,.slider .nav-next .nav-container{height:100px;position:absolute;} +.slider .nav-previous .icon,.slider .nav-next .icon{margin-bottom:15px;} +.slider .nav-previous .date,.slider .nav-next .date{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:bold;line-height:20px;text-transform:uppercase;margin-bottom:5px;} +.slider .nav-previous .date,.slider .nav-next .date,.slider .nav-previous .title,.slider .nav-next .title{line-height:14px;} +.slider .nav-previous:hover,.slider .nav-next:hover{color:#333333;cursor:pointer;} +.slider .nav-previous{float:left;text-align:left;}.slider .nav-previous .icon{margin-left:10px;padding-left:20px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAWCAMAAAD6gTxzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRF2dnZWVlZsrKyv7+/TU1NzMzMjY2Nc3Nz5eXlgICAQEBA8vLymZmZZmZmMzMz////CXz3iwAAABB0Uk5T////////////////////AOAjXRkAAAB1SURBVHjafNFXDsAgDAPQAKWDUd//tq2EnS6p+eNJECcYWLmzklFq2Ud1iAKlVNFG2c/zoCiJIJlkA6lOlFBFXU+vIM26lkHypxvzmCnjgg91J6TPRaDJktMVwvATFc+ur7Gb02MCrfA2py/6amGe2b/jEGAA5cYUouw7P64AAAAASUVORK5CYII=) no-repeat scroll 0% 50%;} +.slider .nav-previous .date,.slider .nav-previous .title{text-align:left;padding-left:10px;} +.slider .nav-previous:hover .icon{margin-left:5px;padding-left:20px;} +.slider .nav-next{float:right;text-align:right;}.slider .nav-next .icon{margin-right:10px;padding-right:20px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAWCAMAAAD6gTxzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRF2dnZWVlZsrKyv7+/TU1NzMzMjY2Nc3Nz5eXlgICAQEBA8vLymZmZZmZmMzMz////CXz3iwAAABB0Uk5T////////////////////AOAjXRkAAABySURBVHjabNFLEoAgDAPQAiJ/ev/buqCJONjlm5GkVcKwEbWR5uaaq4E0V7NB0mg0b5J2mCdpMqpC+kasaNkjrE3Ac530RgSSDkaQ0kFbN6N9g0X5KPFTteAzLuSPtQVScJyGpx1PyNo8NH9HxB6PAAMAzkAUorcBvvAAAAAASUVORK5CYII=) no-repeat scroll 100% 50%;} +.slider .nav-next .date,.slider .nav-next .title{text-align:right;padding-right:10px;} +.slider .nav-next:hover .icon{margin-right:5px;padding-right:20px;} +.slider .slider-item{width:700px;border:1px solid #CCC;padding:0px;margin:0px;overflow:hidden;display:table;margin-left:auto;margin-right:auto;}.slider .slider-item .content{} +.slider .slider-item .content .layout-text .text{width:100%;height:100%;}.slider .slider-item .content .layout-text .text .container{width:75%;margin-left:auto;margin-right:auto;} +.slider .slider-item .content .layout-media .text{width:100%;height:100%;}.slider .slider-item .content .layout-media .text .container{width:100%;margin-left:auto;margin-right:auto;} +.slider .slider-item .content .layout-media .media{width:100%;}.slider .slider-item .content .layout-media .media .container{width:auto;} +.slider .slider-item .content .layout-text-media{display:table;vertical-align:middle;}.slider .slider-item .content .layout-text-media .text{width:25%;min-width:120px;display:table-cell;vertical-align:middle;}.slider .slider-item .content .layout-text-media .text .container{display:table-cell;vertical-align:middle;text-align:left;padding-right:15px;} +.slider .slider-item .content .layout-text-media .media{width:100%;float:left;}.slider .slider-item .content .layout-text-media .media .media-wrapper{margin-left:auto;margin-right:auto;}.slider .slider-item .content .layout-text-media .media .media-wrapper .media-container{display:inline-block;overflow:hidden;line-height:0px;padding:0px;}.slider .slider-item .content .layout-text-media .media .media-wrapper .media-container img{border:1px solid #cccccc;max-height:350px;} +.slider .slider-item .content .layout-text-media .media .media-wrapper .media-container .credit,.slider .slider-item .content .layout-text-media .media .media-wrapper .media-container .caption{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;} +.slider .slider-item .content .layout-text-media .media .media-wrapper .media-container .credit{color:#999999;text-align:right;font-size:10px;line-height:5px;display:block;margin:0 auto;margin-top:2px;} +.slider .slider-item .content .layout-text-media .media .media-wrapper .media-container .caption{text-align:left;margin-top:10px;color:#666666;font-size:11px;line-height:14px;} +.slider .slider-item .content .layout-text-media .media.text-media .media-wrapper .media-container{border:none;background-color:#ffffff;} diff --git a/source/css/structure.css b/source/css/structure.css new file mode 100644 index 0000000..8f3d785 --- /dev/null +++ b/source/css/structure.css @@ -0,0 +1 @@ +#timeline{} diff --git a/source/css/variables.css b/source/css/variables.css new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/source/css/variables.css @@ -0,0 +1 @@ + diff --git a/source/gfx/.DS_Store b/source/gfx/.DS_Store new file mode 100644 index 0000000..ba70dea Binary files /dev/null and b/source/gfx/.DS_Store differ diff --git a/source/gfx/Sprites/.DS_Store b/source/gfx/Sprites/.DS_Store new file mode 100644 index 0000000..9dcbaa8 Binary files /dev/null and b/source/gfx/Sprites/.DS_Store differ diff --git a/source/gfx/Sprites/TimeFlag.psd b/source/gfx/Sprites/TimeFlag.psd new file mode 100644 index 0000000..f9ac1b8 Binary files /dev/null and b/source/gfx/Sprites/TimeFlag.psd differ diff --git a/source/gfx/Sprites/Zoom.psd b/source/gfx/Sprites/Zoom.psd new file mode 100644 index 0000000..b98585d Binary files /dev/null and b/source/gfx/Sprites/Zoom.psd differ diff --git a/source/gfx/Sprites/chevron-next.psd b/source/gfx/Sprites/chevron-next.psd new file mode 100644 index 0000000..1dfc49d Binary files /dev/null and b/source/gfx/Sprites/chevron-next.psd differ diff --git a/source/gfx/Sprites/chevron-prev.psd b/source/gfx/Sprites/chevron-prev.psd new file mode 100644 index 0000000..7809978 Binary files /dev/null and b/source/gfx/Sprites/chevron-prev.psd differ diff --git a/source/gfx/Sprites/sprites.zip b/source/gfx/Sprites/sprites.zip new file mode 100644 index 0000000..8e5d668 Binary files /dev/null and b/source/gfx/Sprites/sprites.zip differ diff --git a/source/gfx/Sprites/sprites/TimeFlagSmall.png b/source/gfx/Sprites/sprites/TimeFlagSmall.png new file mode 100644 index 0000000..8a63d80 Binary files /dev/null and b/source/gfx/Sprites/sprites/TimeFlagSmall.png differ diff --git a/source/gfx/Sprites/sprites/TimeFlagSmallActive.png b/source/gfx/Sprites/sprites/TimeFlagSmallActive.png new file mode 100644 index 0000000..990cf9f Binary files /dev/null and b/source/gfx/Sprites/sprites/TimeFlagSmallActive.png differ diff --git a/source/gfx/Sprites/sprites/chevron-next.png b/source/gfx/Sprites/sprites/chevron-next.png new file mode 100644 index 0000000..47b6c65 Binary files /dev/null and b/source/gfx/Sprites/sprites/chevron-next.png differ diff --git a/source/gfx/Sprites/sprites/chevron-prev.png b/source/gfx/Sprites/sprites/chevron-prev.png new file mode 100644 index 0000000..2624fda Binary files /dev/null and b/source/gfx/Sprites/sprites/chevron-prev.png differ diff --git a/source/gfx/Sprites/sprites/icon-facebook.png b/source/gfx/Sprites/sprites/icon-facebook.png new file mode 100644 index 0000000..d6947f9 Binary files /dev/null and b/source/gfx/Sprites/sprites/icon-facebook.png differ diff --git a/source/gfx/Sprites/sprites/icon-map-pin.png b/source/gfx/Sprites/sprites/icon-map-pin.png new file mode 100644 index 0000000..a5d99d6 Binary files /dev/null and b/source/gfx/Sprites/sprites/icon-map-pin.png differ diff --git a/source/gfx/Sprites/sprites/icon-map.png b/source/gfx/Sprites/sprites/icon-map.png new file mode 100644 index 0000000..f3b1adf Binary files /dev/null and b/source/gfx/Sprites/sprites/icon-map.png differ diff --git a/source/gfx/Sprites/sprites/icon-microphone.png b/source/gfx/Sprites/sprites/icon-microphone.png new file mode 100644 index 0000000..7c8c5b4 Binary files /dev/null and b/source/gfx/Sprites/sprites/icon-microphone.png differ diff --git a/source/gfx/Sprites/sprites/icon-music.png b/source/gfx/Sprites/sprites/icon-music.png new file mode 100644 index 0000000..f1c8a89 Binary files /dev/null and b/source/gfx/Sprites/sprites/icon-music.png differ diff --git a/source/gfx/Sprites/sprites/icon-soundcloud.png b/source/gfx/Sprites/sprites/icon-soundcloud.png new file mode 100644 index 0000000..fb10802 Binary files /dev/null and b/source/gfx/Sprites/sprites/icon-soundcloud.png differ diff --git a/source/gfx/Sprites/sprites/icon-speaker.png b/source/gfx/Sprites/sprites/icon-speaker.png new file mode 100644 index 0000000..1efb1e2 Binary files /dev/null and b/source/gfx/Sprites/sprites/icon-speaker.png differ diff --git a/source/gfx/Sprites/sprites/icon-twitter.png b/source/gfx/Sprites/sprites/icon-twitter.png new file mode 100644 index 0000000..1b28b21 Binary files /dev/null and b/source/gfx/Sprites/sprites/icon-twitter.png differ diff --git a/source/gfx/Sprites/sprites/icon-vimeo.png b/source/gfx/Sprites/sprites/icon-vimeo.png new file mode 100644 index 0000000..6ef83fb Binary files /dev/null and b/source/gfx/Sprites/sprites/icon-vimeo.png differ diff --git a/source/gfx/Sprites/sprites/icon-youtube.png b/source/gfx/Sprites/sprites/icon-youtube.png new file mode 100644 index 0000000..d1153e5 Binary files /dev/null and b/source/gfx/Sprites/sprites/icon-youtube.png differ diff --git a/source/gfx/Sprites/sprites/icon-youtube_alt.png b/source/gfx/Sprites/sprites/icon-youtube_alt.png new file mode 100644 index 0000000..113dc2c Binary files /dev/null and b/source/gfx/Sprites/sprites/icon-youtube_alt.png differ diff --git a/source/gfx/Sprites/sprites/icon-youtube_alt2.png b/source/gfx/Sprites/sprites/icon-youtube_alt2.png new file mode 100644 index 0000000..86a8c83 Binary files /dev/null and b/source/gfx/Sprites/sprites/icon-youtube_alt2.png differ diff --git a/source/gfx/Sprites/sprites/time-interval-bg.png b/source/gfx/Sprites/sprites/time-interval-bg.png new file mode 100644 index 0000000..275befc Binary files /dev/null and b/source/gfx/Sprites/sprites/time-interval-bg.png differ diff --git a/source/gfx/Sprites/sprites/time-interval.png b/source/gfx/Sprites/sprites/time-interval.png new file mode 100644 index 0000000..8191396 Binary files /dev/null and b/source/gfx/Sprites/sprites/time-interval.png differ diff --git a/source/gfx/Sprites/sprites/zback-to-begin-16.png b/source/gfx/Sprites/sprites/zback-to-begin-16.png new file mode 100644 index 0000000..d3b47fc Binary files /dev/null and b/source/gfx/Sprites/sprites/zback-to-begin-16.png differ diff --git a/source/gfx/Sprites/sprites/zback-to-begin-24.png b/source/gfx/Sprites/sprites/zback-to-begin-24.png new file mode 100755 index 0000000..02e826e Binary files /dev/null and b/source/gfx/Sprites/sprites/zback-to-begin-24.png differ diff --git a/source/gfx/Sprites/sprites/zoom-in-24.png b/source/gfx/Sprites/sprites/zoom-in-24.png new file mode 100644 index 0000000..191fdc9 Binary files /dev/null and b/source/gfx/Sprites/sprites/zoom-in-24.png differ diff --git a/source/gfx/Sprites/sprites/zoom-in.png b/source/gfx/Sprites/sprites/zoom-in.png new file mode 100644 index 0000000..d7bf9af Binary files /dev/null and b/source/gfx/Sprites/sprites/zoom-in.png differ diff --git a/source/gfx/Sprites/sprites/zoom-out-24.png b/source/gfx/Sprites/sprites/zoom-out-24.png new file mode 100644 index 0000000..d7b4aae Binary files /dev/null and b/source/gfx/Sprites/sprites/zoom-out-24.png differ diff --git a/source/gfx/Sprites/sprites/zoom-out.png b/source/gfx/Sprites/sprites/zoom-out.png new file mode 100644 index 0000000..2047642 Binary files /dev/null and b/source/gfx/Sprites/sprites/zoom-out.png differ diff --git a/source/gfx/timeline.png b/source/gfx/timeline.png new file mode 100644 index 0000000..a0abcb7 Binary files /dev/null and b/source/gfx/timeline.png differ diff --git a/source/gfx/timeline.psd b/source/gfx/timeline.psd new file mode 100644 index 0000000..ca8d0a5 Binary files /dev/null and b/source/gfx/timeline.psd differ diff --git a/source/js/.DS_Store b/source/js/.DS_Store new file mode 100644 index 0000000..d114035 Binary files /dev/null and b/source/js/.DS_Store differ diff --git a/source/js/VMM.Core.js b/source/js/VMM.Core.js new file mode 100644 index 0000000..8fed283 --- /dev/null +++ b/source/js/VMM.Core.js @@ -0,0 +1,645 @@ +/* Core +================================================== */ + + +/* Sequence +================================================== */ +if(typeof VMM != 'undefined' && typeof VMM.Sequence == 'undefined') { + + + VMM.Sequence = Class.extend({ + + initialize: function(length,index) { + trace('sequence init'); + + // PUBLIC + this.increment = 1; + this.decrement = 1; + this.wrap = false; + + // PRIVATE + this.length = (length == null) ? 0 : length; + this.index = (index == null) ? ((length == 0) ? -1 : 0) : (index >= length) ? length-1 : index; + this.synced = []; + }, + setLength: function(i) { + + this.length = i; + + this.setIndex(this.index); + }, + + getLength: function() { + + return this.length; + }, + + setIndex: function(i) { + + if(this.length <= 0) { + + this.index = -1; + + return; + } + + if(i < 0) i = (this.wrap) ? this.length - (i%this.length) : 0; + else if(i >= this.length) i = (this.wrap) ? (i%this.length) : this.length-1; + + var pi = this.index; + + this.index = i; + + if(pi != this.index) { + + // update sequences + for(var j=0; j -(VMM.Element.position(slides[current_slide]).left) + (config.width/3)) { + onPrevClick(); + } else { + VMM.Element.animate($slider_container, config.duration, config.ease, {"left": -(VMM.Element.position(slides[current_slide]).left)}); + } + } else { + VMM.Element.animate($slider_container, config.duration, config.ease, {"left": -(VMM.Element.position(slides[current_slide]).left)}); + } + + if (typeof b.top == "number") { + VMM.Element.animate($slider_container, config.duration, config.ease, {"top": -b.top}); + //VMM.Element.animate(layout, _duration, _ease, {scrollTop: VMM.Element.prop(layout, "scrollHeight") + b.top }); + //VMM.Element.animate(layout, _duration, _ease, {scrollTop: VMM.Element.prop(layout, "scrollHeight") + VMM.Element.height(layout) }); + //VMM.Element.animate($slider_container, config.duration, config.ease, {"top": -400}); + } else { + + } + }; + + function upDate() { + VMM.fireEvent(layout, "UPDATE"); + }; + /* PRIVATE FUNCTIONS + ================================================== */ + + var getData = function(d) { + data = d; + }; + + /* SLIDES + ================================================== */ + // BUILD SLIDES + var buildSlides = function(d) { + + // Clear out existing content + VMM.attachElement($slides_items, ""); + + for(var i = 0; i < d.length; i++) { + var bw = ""; + var _slide; + var _media; + + bw = VMM.createElement("div", d[i].content, "content"); + _slide = VMM.appendAndGetElement($slides_items, "
", "slider-item" , bw); + slides.push(_slide); + } + + + } + + // POSITION SLIDES AND SIZE THEM + var positionSlides = function() { + + /* SIZE SLIDES + ================================================== */ + + VMM.Element.css(".slider-item", "width", config.content_width ); + VMM.Element.height(".slider-item", config.height); + VMM.Element.css(".slider-item .layout-text-media .media .media-container img", "max-height", config.height - 50 ); + VMM.Element.css(".slider-item .layout-media .media .media-container img", "max-height", config.height - 150 ); + + + + VMM.Element.css(".slider-item .media .media-container .soundcloud", "max-height", 168 ); + + /* RESIZE IFRAME MEDIA ELEMENTS + ================================================== */ + //var _iframe_height = Math.round(config.height) - 60; + var _iframe_height_full = Math.round(config.height) - 160; + //var _iframe_width = Math.round((_iframe_height / 9) * 16); + var _iframe_width_full = Math.round((_iframe_height_full / 9) * 16); + + var _iframe_width = (config.content_width/100)*60 ; + var _iframe_height = Math.round((_iframe_width / 16) * 9) + 25; + + + // NORMAL + VMM.Element.height(".slider-item .media .media-container .media-frame", _iframe_height); + VMM.Element.width(".slider-item .media .media-container .media-frame", _iframe_width); + //VMM.Element.width(".slider-item .media .media-container .media-frame", _iframe_width); + //VMM.Element.css(".slider-item .media .media-container .media-frame", "max-width", config.content_width ); + + // IFRAME FULL SIZE VIDEO + VMM.Element.height(".slider-item .layout-media .media .media-container .media-frame", _iframe_height_full); + VMM.Element.width(".slider-item .layout-media .media .media-container .media-frame", _iframe_width_full); + + // IFRAME FULL SIZE NON VIDEO + VMM.Element.height(".slider-item .layout-media .media .media-container .soundcloud", config.height - 150); + VMM.Element.width(".slider-item .layout-media .media .media-container .soundcloud", config.content_width); + VMM.Element.width(".slider-item .layout-text-media .media .media-container .soundcloud", _iframe_width); + + // MAPS + VMM.Element.height(".slider-item .media .media-container .map", _iframe_height_full); + + // MAX WIDTH + VMM.Element.css(".slider-item .layout-text-media .media .media-container .media-frame", "max-width", config.content_width ); + //VMM.Element.width(".slider-item .layout-text-media .media .media-container .media-frame", _iframe_width); + //VMM.Element.css(".slider-item .layout-text-media .media .media-container .media-frame", "max-height", _iframe_height ); + + /* POSITION SLIDES + ================================================== */ + var pos = 0; + for(var i = 0; i < slides.length; i++) { + pos = i * (config.width+config.spacing); + VMM.Element.css(slides[i], "left", pos); + } + + } + + var opacitySlides = function(n) { + var _ease = "linear"; + for(var i = 0; i < slides.length; i++) { + if (i == current_slide) { + VMM.Element.animate(slides[i], config.duration, _ease, {"opacity": 1}); + } else if (i == current_slide - 1) { + VMM.Element.animate(slides[i], config.duration, _ease, {"opacity": 0.1}); + } else if (i == current_slide + 1) { + VMM.Element.animate(slides[i], config.duration, _ease, {"opacity": 0.1}); + } else { + VMM.Element.css(slides[i], "opacity", n); + } + + } + } + + // Go to slide + //goToSlide(n, ease, duration); + var goToSlide = function(n, ease, duration, fast, firstrun) { + + /* STOP ANY VIDEO PLAYERS ACTIVE + ================================================== */ + VMM.ExternalAPI.youtube.stopPlayers(); + + // Set current slide + current_slide = n; + + var _ease = config.ease; + var _duration = config.duration; + var is_last = false; + var is_first = false; + + if (current_slide == 0) { + is_first = true; + } + if (current_slide +1 == slides.length) { + is_last = true + } + + if (ease != null && ease != "") {_ease = ease}; + if (duration != null && duration != "") {_duration = duration}; + + /* get slide position + ================================================== */ + var _pos = VMM.Element.position(slides[current_slide]); + + /* set proper nav titles and dates etc. + ================================================== */ + if (is_first) { + VMM.Element.visible(navigation.prevBtn, false); + } else { + VMM.Element.visible(navigation.prevBtn, true); + if (config.timeline) { + VMM.attachElement(navigation.prevDate, data[current_slide - 1].date); + } + VMM.attachElement(navigation.prevTitle, VMM.Util.unlinkify(data[current_slide - 1].title)); + } + if (is_last) { + VMM.Element.visible(navigation.nextBtn, false); + } else { + VMM.Element.visible(navigation.nextBtn, true); + if (config.timeline) { + VMM.attachElement(navigation.nextDate, data[current_slide + 1].date); + } + VMM.attachElement(navigation.nextTitle, VMM.Util.unlinkify(data[current_slide + 1].title) ); + } + + /* ANIMATE SLIDE + ================================================== */ + if (fast) { + VMM.Element.css($slider_container, "left", -(_pos.left - config.content_padding)); + } else{ + VMM.Element.stop($slider_container); + VMM.Element.animate($slider_container, _duration, _ease, {"left": -(_pos.left - config.content_padding)}); + } + + if (firstrun) { + VMM.fireEvent(layout, "LOADED"); + } + + /* SET Vertical Scoll + ================================================== */ + //opacitySlides(0.85); + if (VMM.Element.height(slides[current_slide]) > config.height) { + VMM.Element.css(".slider", "overflow-y", "scroll" ); + } else { + VMM.Element.css(layout, "overflow-y", "hidden" ); + VMM.Element.animate(layout, _duration, _ease, {scrollTop: VMM.Element.prop(layout, "scrollHeight") - VMM.Element.height(layout) }); + + } + + + } + + /* NAVIGATION + ================================================== */ + var buildNavigation = function() { + + var temp_icon = "
 
"; + + navigation.nextBtn = VMM.appendAndGetElement($slider, "
", "nav-next"); + navigation.prevBtn = VMM.appendAndGetElement($slider, "
", "nav-previous"); + navigation.nextBtnContainer = VMM.appendAndGetElement(navigation.nextBtn, "
", "nav-container", temp_icon); + navigation.prevBtnContainer = VMM.appendAndGetElement(navigation.prevBtn, "
", "nav-container", temp_icon); + if (config.timeline) { + navigation.nextDate = VMM.appendAndGetElement(navigation.nextBtnContainer, "
", "date", "1957"); + navigation.prevDate = VMM.appendAndGetElement(navigation.prevBtnContainer, "
", "date", "1957"); + } + navigation.nextTitle = VMM.appendAndGetElement(navigation.nextBtnContainer, "
", "title", "Title Goes Here"); + navigation.prevTitle = VMM.appendAndGetElement(navigation.prevBtnContainer, "
", "title", "Title Goes Here"); + + VMM.bindEvent(".nav-next", onNextClick); + VMM.bindEvent(".nav-previous", onPrevClick); + } + + /* BUILD + ================================================== */ + var build = function() { + + // Clear out existing content + VMM.attachElement(layout, ""); + + // Get DOM Objects to local objects + $slider = VMM.getElement("div.slider"); + $slider_mask = VMM.appendAndGetElement($slider, "
", "slider-container-mask"); + $slider_container = VMM.appendAndGetElement($slider_mask, "
", "slider-container"); + $slides_items = VMM.appendAndGetElement($slider_container, "
", "slider-item-container"); + + // BUILD NAVIGATION + buildNavigation(); + + // ATTACH SLIDES + buildSlides(data); + + /* MAKE SLIDER TOUCHABLE + ================================================== */ + + var __duration = 3000; + + if (VMM.Browser.device == "tablet" || VMM.Browser.device == "mobile") { + config.duration = 500; + __duration = 1000; + VMM.TouchSlider.createPanel($slider_container, $slider_container, VMM.Element.width(slides[0]), config.spacing, true); + VMM.bindEvent($slider_container, onTouchUpdate, "TOUCHUPDATE"); + } else if (VMM.Browser.device == "mobile") { + + } else { + //VMM.DragSlider.createPanel($slider_container, $slider_container, VMM.Element.width(slides[0]), config.spacing, true); + } + + reSize(false, true); + VMM.Element.visible(navigation.prevBtn, false); + // GO TO FIRST SLIDE + goToSlide(0, "easeOutExpo", __duration, true, true); + + _active = true; + }; + + }; + + + + +} + + + + diff --git a/source/js/VMM.Util.js b/source/js/VMM.Util.js new file mode 100644 index 0000000..882faaa --- /dev/null +++ b/source/js/VMM.Util.js @@ -0,0 +1,491 @@ +/* Utilities and Useful Functions +================================================== */ +if(typeof VMM != 'undefined' && typeof VMM.Util == 'undefined') { + + VMM.Util = ({ + + init: function() { + return this; + }, + + /* RANDOM BETWEEN + ================================================== */ + //VMM.Util.randomBetween(1, 3) + randomBetween: function(min, max) { + return Math.floor(Math.random() * (max - min + 1) + min); + }, + /* CUSTOM SORT + ================================================== */ + + customSort: function(a, b) { + var a1= a, b1= b; + if(a1== b1) return 0; + return a1> b1? 1: -1; + }, + + /* Given an int or decimal, turn that into string in $xxx,xxx.xx format. + ================================================== */ + number2money: function(n, symbol, padding) { + var symbol = (symbol !== null) ? symbol : true; // add $ + var padding = (padding !== null) ? padding : false; //pad with .00 + var number = VMM.Math2.floatPrecision(n,2); // rounded correctly to two digits, if decimals passed + var formatted = this.niceNumber(number); + // no decimal and padding is enabled + if (!formatted.split(/\./g)[1] && padding) formatted = formatted + ".00"; + // add money sign + if (symbol) formatted = "$"+formatted; + return formatted; + }, + + + /* Returns a word count number + ================================================== */ + wordCount: function(s) { + var fullStr = s + " "; + var initial_whitespace_rExp = /^[^A-Za-z0-9\'\-]+/gi; + var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, ""); + var non_alphanumerics_rExp = /[^A-Za-z0-9\'\-]+/gi; + var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " "); + var splitString = cleanedStr.split(" "); + var word_count = splitString.length -1; + if (fullStr.length <2) { + word_count = 0; + } + return word_count; + }, + /* Parse Date + ================================================== */ + // VMM.Util.parseDate(str) + parseDate: function(d) { + var _date; + + if ( d.match(/,/gi) ) { + + + var _d_array = d.split(","); + + + for(var i = 0; i < _d_array.length; i++) { + _d_array[i] = parseInt(_d_array[i]); + + } + + _date = new Date(); + if (_d_array[0] ) { _date.setFullYear(_d_array[0]); } + if (_d_array[1] > 1 ) { _date.setMonth(_d_array[1] - 1); } else { _date.setMonth(0); } + if (_d_array[2] > 1 ) { _date.setDate(_d_array[2]); } else { _date.setDate(1); } + if (_d_array[3] > 1 ) { _date.setHours(_d_array[3]); } else { _date.setHours(0); } + if (_d_array[4] > 1 ) { _date.setMinutes(_d_array[4]); } else { _date.setMinutes(0); } + if (_d_array[5] > 1 ) { _date.setSeconds(_d_array[5]); } else { _date.setSeconds(0); } + if (_d_array[6] > 1 ) { _date.setMilliseconds(_d_array[6]); } else { _date.setMilliseconds(0); } + } else if (d.match("/")) { + _date = new Date(d); + } else if (d.length < 5) { + _date = new Date(); + _date.setFullYear(parseInt(d)); + _date.setMonth(0); + _date.setDate(1); + _date.setHours(0); + _date.setMinutes(0); + _date.setSeconds(0); + _date.setMilliseconds(0); + }else { + _date = new Date( + parseInt(d.slice(0,4)), + parseInt(d.slice(4,6)) - 1, + parseInt(d.slice(6,8)), + parseInt(d.slice(8,10)), + parseInt(d.slice(10,12)) + ); + } + + return _date; + }, + /* Get the corresponding ratio number + ================================================== */ + // VMM.Util.ratio.r16_9(w, h) // Returns corresponding number + ratio: { + r16_9: function(w,h) { + if (w !== null && w !== "") { + return Math.round((h / 16) * 9); + } else if (h !== null && h !== "") { + return Math.round((w / 9) * 16); + } + }, + r4_3: function(w,h) { + if (w !== null && w !== "") { + return Math.round((h / 4) * 3); + } else if (h !== null && h !== "") { + return Math.round((w / 3) * 4); + } + } + }, + // VMM.Util.date.day[0]; + // VMM.Util.date.get12HRTime(time, seconds_true); + date: { + // somestring = VMM.Util.date.month[2]; // Returns March + month: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + // somestring = VMM.Util.date.month_abbrev[1]; // Returns Feb. + month_abbr: ["Jan.", "Feb.", "March", "April", "May", "June", "July", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."], + day: ["Sunday","Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + day_abbr: ["Sun.","Mon.", "Tues.", "Wed.", "Thurs.", "Fri.", "Sat."], + hour: [1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12], + hour_suffix: ["am"], + //VMM.Util.date.prettyDate(d, is_abbr) + prettyDate: function(d, is_abbr, date_type) { + var _date = ""; + + if (type.of(d) == "date") { + if (d.getMonth() === 0 && d.getDate() == 1 && d.getHours() === 0 && d.getMinutes() === 0 ) { + // trace("YEAR ONLY"); + _date = d.getFullYear(); + } else { + if (d.getDate() <= 1 && d.getHours() === 0 && d.getMinutes() === 0) { + // trace("YEAR MONTH"); + if (is_abbr) { + _date = VMM.Util.date.month_abbr[d.getMonth()]; + + } else { + _date = VMM.Util.date.month[d.getMonth()] + " " + d.getFullYear() ; + } + + } else if (d.getHours() === 0 && d.getMinutes() === 0) { + // trace("YEAR MONTH DAY"); + if (is_abbr) { + _date = VMM.Util.date.month_abbr[d.getMonth()] + " " + d.getDate(); + } else { + _date = VMM.Util.date.month[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear() ; + } + } else if (d.getMinutes() === 0) { + // trace("YEAR MONTH DAY HOUR"); + if (is_abbr){ + //_date = VMM.Util.date.get12HRTime(d) + " " + (d.getMonth()+1) + "/" + d.getDate() + "/" + d.getFullYear() ; + _date = VMM.Util.date.get12HRTime(d); + } else { + _date = VMM.Util.date.get12HRTime(d) + "
" + VMM.Util.date.month[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear() + " "; + } + } else { + // trace("YEAR MONTH DAY HOUR MINUTE"); + if (is_abbr){ + _date = VMM.Util.date.day[d.getDay()] + ", " + VMM.Util.date.month_abbr[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear() + " at " + VMM.Util.date.get12HRTime(d); + } else { + _date = VMM.Util.date.get12HRTime(d) + "
" + VMM.Util.date.day[d.getDay()] + ", " + VMM.Util.date.month[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear() + " "; + } + } + + } + //_date = d.getFullYear(); + + + } else { + trace("NOT A VALID DATE?"); + trace(d); + } + + return _date; + }, + + prettyMonth: function(m, is_year) { + var _month = ""; + if (type.of(t) == "date") { + + + } + return _month; + }, + + get12HRTime: function(t, is_seconds) { + var _time = ""; + + if (type.of(t) == "date") { + + _time = VMM.Util.date.theHour(t.getHours()) + ":" + VMM.Util.date.minuteZeroFill(t.getMinutes()); + + if (is_seconds) { + _time = _time + ":" + VMM.Util.date.minuteZeroFill(t.getSeconds()); + } + + _time = _time + VMM.Util.date.hourSuffix(t.getHours()); + + } + + return _time; + }, + + theHour: function(hr) { + if (hr > 0 && hr < 13) { + return (hr); + } + if (hr == "0") { + hr = 12; + return (hr); + } + if (hr === 0) { + return (12); + } + return (hr-12); + }, + minuteZeroFill: function(v) { + if (v > 9) { + return "" + v; + } + return "0" + v; + }, + hourSuffix: function(t) { + if (t < 12) { + return (" am"); + } + return (" pm"); + } + }, + + // VMM.Util.doubledigit(number). + doubledigit: function(n) { + return (n < 10 ? '0' : '') + n; + }, + + + /* Returns a truncated segement of a long string of between min and max words. If possible, ends on a period (otherwise goes to max). + ================================================== */ + truncateWords: function(s, min, max) { + + if (!min) min = 30; + if (!max) max = min; + + var initial_whitespace_rExp = /^[^A-Za-z0-9\'\-]+/gi; + var left_trimmedStr = s.replace(initial_whitespace_rExp, ""); + var words = left_trimmedStr.split(" "); + + var result = []; + + min = Math.min(words.length, min); + max = Math.min(words.length, max); + + for (var i = 0; i'+ url +''; + else return "'" + url + "" ; + }); + + return text; + }, + /* Turns plain text links into real links + ================================================== */ + // VMM.Util.unlinkify(); + unlinkify: function(text) { + if(!text) return text; + text = text.replace(/]*>/i,""); + text = text.replace(/<\/a>/i, ""); + return text; + }, + + /* TK + ================================================== */ + nl2br: function(text) { + return text.replace(/(\r\n|[\r\n]|\\n|\\r)/g,"
"); + }, + + /* Generate a Unique ID + ================================================== */ + // VMM.Util.unique_ID(size); + unique_ID: function(size) { + + var getRandomNumber = function(range) { + return Math.floor(Math.random() * range); + }; + + var getRandomChar = function() { + var chars = "abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQURSTUVWXYZ"; + return chars.substr( getRandomNumber(62), 1 ); + }; + + var randomID = function(size) { + var str = ""; + for(var i = 0; i < size; i++) { + str += getRandomChar(); + } + return str; + }; + + return randomID(size); + }, + /* Tells you if a number is even or not + ================================================== */ + // VMM.Util.isEven(n) + isEven: function(n){ + return (n%2 === 0) ? true : false; + }, + /* Get URL Variables + ================================================== */ + // var somestring = VMM.Util.getUrlVars(str_url)["varname"]; + getUrlVars: function(str) { + var vars = [], hash; + var hashes = str.slice(str.indexOf('?') + 1).split('&'); + for(var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + trace(vars); + return vars; + }, + + /* Cleans up strings to become real HTML + ================================================== */ + toHTML: function(text) { + + text = this.nl2br(text); + text = this.linkify(text); + + return text.replace(/\s\s/g,"  "); + }, + + /* Returns text strings as CamelCase + ================================================== */ + toCamelCase: function(s,forceLowerCase) { + + if(forceLowerCase !== false) forceLowerCase = true; + + var sps = ((forceLowerCase) ? s.toLowerCase() : s).split(" "); + + for(var i=0; i true + +var n = new Ninja(); +n.dance(); // => false +n.swingSword(); // => true + +// Should all be true +p instanceof Person && p instanceof Class && +n instanceof Ninja && n instanceof Person && n instanceof Class +*/ + + + +/* Access to the Global Object + * access the global object without hard-coding the identifier window +================================================== */ + +var global = (function () { + return this || (1,eval)('this'); +}()); + + +/* VMM +================================================== */ + +if (typeof VMM == 'undefined') { + + /* Main Scope Container + ================================================== */ + //var VMM = {}; + var VMM = Class.extend({ + + }); + + /* Master Config + ================================================== */ + //VMM.master_config.youtube_array + VMM.master_config = ({ + + init: function() { + return this; + }, + + youtube: { + active: false, + array: [], + api_loaded:false + }, + + }).init(); + + VMM.master_config = ({ + + init: function() { + return this; + }, + + youtube: { + active: false, + array: [], + api_loaded:false, + que: [] + }, + + }).init(); + + /* Abstract out DOM element creation to make independent of library + ================================================== */ + //VMM.createElement(tag, value, cName, attrs, styles); + VMM.createElement = function(tag, value, cName, attrs, styles) { + + var ce = ""; + + if (tag != null && tag != "") { + + // TAG + ce += "<" + tag; + if (cName != null && cName != "") { + ce += " class='" + cName + "'"; + }; + + if (attrs != null && attrs != "") { + ce += " " + attrs; + }; + + if (styles != null && styles != "") { + ce += " " + styles; + }; + + ce += ">"; + + if (value != null && value != "") { + ce += value; + } + + // CLOSE TAG + ce = ce + ""; + } + + return ce; + + }; + + VMM.createMediaElement = function(media, caption, credit) { + + var ce = ""; + + var _valid = false; + + ce += "
"; + + if (media != null && media != "") { + + valid = true; + + ce += ""; + + // CREDIT + if (credit != null && credit != "") { + ce += VMM.createElement("div", credit, "credit"); + } + + // CAPTION + if (caption != null && caption != "") { + ce += VMM.createElement("div", caption, "caption"); + } + + } + + ce += "
"; + + return ce; + + }; + + + + /* LIBRARY ABSTRACTION + ================================================== */ + + //VMM.attachElement(element, content); + VMM.attachElement = function(element, content) { + if( typeof( jQuery ) != 'undefined' ){ + $(element).html(content); + } + + }; + //VMM.appendElement(element, content); + VMM.appendElement = function(element, content) { + + if( typeof( jQuery ) != 'undefined' ){ + $(element).append(content); + } + + }; + + VMM.getHTML = function(element) { + var e; + if( typeof( jQuery ) != 'undefined' ){ + e = $(element).html(); + return e; + } + + }; + //VMM.getElement(element); + VMM.getElement = function(element, p) { + var e; + if( typeof( jQuery ) != 'undefined' ){ + if (p) { + e = $(element).parent().get(0); + + } else { + e = $(element).get(0); + } + return e; + } + + }; + //VMM.bindEvent(element, the_handler, the_event_type, event_data); + //VMM.bindEvent(window, the_handler, "event type", {event_data}); + VMM.bindEvent = function(element, the_handler, the_event_type, event_data) { + var e; + var _event_type = "click"; + var _event_data = {}; + + if (the_event_type != null && the_event_type != "") { + _event_type = the_event_type; + } + + if (_event_data != null && _event_data != "") { + _event_data = event_data; + } + + if( typeof( jQuery ) != 'undefined' ){ + $(element).bind(_event_type, _event_data, the_handler); + + //return e; + } + + }; + //VMM.unbindEvent(window, the_handler, "event type"); + VMM.unbindEvent = function(element, the_handler, the_event_type) { + var e; + var _event_type = "click"; + var _event_data = {}; + + if (the_event_type != null && the_event_type != "") { + _event_type = the_event_type; + } + + if( typeof( jQuery ) != 'undefined' ){ + $(element).unbind(_event_type, the_handler); + + //return e; + } + + }; + //VMM.fireEvent(element, "resize", [data]); + VMM.fireEvent = function(element, the_event_type, the_data) { + var e; + var _event_type = "click"; + var _data = []; + + if (the_event_type != null && the_event_type != "") { + _event_type = the_event_type; + } + if (the_data != null && the_data != "") { + _data = the_data; + } + + if( typeof( jQuery ) != 'undefined' ){ + $(element).trigger(_event_type, _data); + + //return e; + } + + }; + + // VMM.getJSON(url, the_function); + VMM.getJSON = function(url, the_function) { + if( typeof( jQuery ) != 'undefined' ){ + $.getJSON(url, the_function); + } + } + + // ADD ELEMENT AND RETURN IT + // VMM.appendAndGetElement(append_to_element, tag, cName, content, [attrib]); + VMM.appendAndGetElement = function(append_to_element, tag, cName, content) { + var e; + var _tag = "
"; + var _class = ""; + var _content = ""; + + + if (tag != null && tag != "") { + _tag = tag; + } + + if (cName != null && cName != "") { + _class = cName; + } + + if (content != null && content != "") { + _content = content; + } + + if( typeof( jQuery ) != 'undefined' ){ + + e = $(tag); + + e.addClass(_class); + e.html(_content); + + $(append_to_element).append(e); + + //$(e).appendTo(element); + + } + + return e; + + }; + + VMM.Element = ({ + + init: function() { + return this; + }, + // VMM.Element.hide(element); + hide: function(element, duration) { + if (duration != null && duration != "") { + if( typeof( jQuery ) != 'undefined' ){ + $(element).hide(duration); + } + } else { + if( typeof( jQuery ) != 'undefined' ){ + $(element).hide(); + } + } + + }, + // VMM.Element.remove(element); + remove: function(element) { + if( typeof( jQuery ) != 'undefined' ){ + $(element).remove(); + } + }, + // VMM.Element.detach(element); + detach: function(element) { + if( typeof( jQuery ) != 'undefined' ){ + $(element).detach(); + } + }, + // VMM.Element.append(element, value); + append: function(element, value) { + if( typeof( jQuery ) != 'undefined' ){ + $(element).append(value); + } + }, + // VMM.Element.show(element); + show: function(element, duration) { + if (duration != null && duration != "") { + if( typeof( jQuery ) != 'undefined' ){ + $(element).show(duration); + } + } else { + if( typeof( jQuery ) != 'undefined' ){ + $(element).show(); + } + } + + }, + // VMM.Element.load(element, callback_function, event_data); + load: function(element, callback_function, event_data) { + var _event_data = {elem:element}; // return element by default + if (_event_data != null && _event_data != "") { + _event_data = event_data; + } + if( typeof( jQuery ) != 'undefined' ){ + $(element).load(_event_data, callback_function); + } + }, + //VMM.Element.addClass(element, cName); + addClass: function(element, cName) { + if( typeof( jQuery ) != 'undefined' ){ + $(element).addClass(cName); + } + }, + //VMM.Element.removeClass(element, cName); + removeClass: function(element, cName) { + if( typeof( jQuery ) != 'undefined' ){ + $(element).removeClass(cName); + } + }, + //VMM.Element.attr(element, aName, value); + attr: function(element, aName, value) { + if (value != null && value != "") { + if( typeof( jQuery ) != 'undefined' ){ + $(element).attr(aName, value); + } + } else { + if( typeof( jQuery ) != 'undefined' ){ + return $(element).attr(aName); + } + } + }, + //VMM.Element.prop(element, aName, value); + prop: function(element, aName, value) { + if (typeof jQuery == 'undefined' || !/[1-9]\.[3-9].[1-9]/.test($.fn.jquery)) { + VMM.Element.attribute(element, aName, value); + } else { + $(element).prop(aName, value); + } + }, + //VMM.Element.attribute(element, aName, value); + attribute: function(element, aName, value) { + + if (value != null && value != "") { + if( typeof( jQuery ) != 'undefined' ){ + $(element).attr(aName, value); + } + } else { + if( typeof( jQuery ) != 'undefined' ){ + return $(element).attr(aName); + } + } + }, + /* Sets or gets the visability of a dom element + ================================================== */ + //VMM.Element.visible(element, show); + visible: function(element, show) { + if (show != null) { + if( typeof( jQuery ) != 'undefined' ){ + if (show) { + $(element).show(0); + } else { + $(element).hide(0); + } + } + } else { + if( typeof( jQuery ) != 'undefined' ){ + if ( $(element).is(':visible')){ + return true; + } else { + return false; + } + } + } + }, + /* Sets a style for the specified element or gets the style + ================================================== */ + //VMM.Element.css(element, prop, value); + css: function(element, prop, value) { + + if (value != null && value != "") { + if( typeof( jQuery ) != 'undefined' ){ + $(element).css(prop, value); + } + } else { + if( typeof( jQuery ) != 'undefined' ){ + return $(element).css(prop); + } + } + }, + + cssmultiple: function(element, propval) { + + if( typeof( jQuery ) != 'undefined' ){ + return $(element).css(propval); + } + }, + /* Gets offset + ================================================== */ + //VMM.Element.offset(element); + offset: function(element) { + var p; + if( typeof( jQuery ) != 'undefined' ){ + p = $(element).offset(); + } + return p; + }, + /* Gets position + ================================================== */ + //VMM.Element.position(element); + position: function(element) { + var p; + if( typeof( jQuery ) != 'undefined' ){ + p = $(element).position(); + } + return p; + }, + /* Sets or gets the width of a dom element + ================================================== */ + //VMM.Element.width(element, s); + width: function(element, s) { + if (s != null && s != "") { + if( typeof( jQuery ) != 'undefined' ){ + $(element).width(s); + } + } else { + if( typeof( jQuery ) != 'undefined' ){ + return $(element).width(); + } + } + }, + /* Sets or gets the width of a dom element + ================================================== */ + height: function(element, s) { + if (s != null && s != "") { + if( typeof( jQuery ) != 'undefined' ){ + $(element).height(s); + } + } else { + if( typeof( jQuery ) != 'undefined' ){ + return $(element).height(); + } + } + }, + /* TOGGLE CLASS + ================================================== */ + // VMM.Element.toggleClass(element, cName); + toggleClass: function(element, cName) { + if( typeof( jQuery ) != 'undefined' ){ + $(element).toggleClass(cName); + } + }, + /* Each + ================================================== */ + // VMM.Element.each(element, return_function); + each:function(element, return_function) { + if( typeof( jQuery ) != 'undefined' ){ + $(element).each(return_function); + } + + }, + /* Each + ================================================== */ + // VMM.Element.html(element, str); + html: function(element, str) { + var e; + if( typeof( jQuery ) != 'undefined' ){ + e = $(element).html(); + return e; + } + + if (str != null && str != "") { + if( typeof( jQuery ) != 'undefined' ){ + $(element).html(str); + } + } else { + var e; + if( typeof( jQuery ) != 'undefined' ){ + e = $(element).html(); + return e; + } + } + + }, + /* Find + ================================================== */ + // VMM.Element.find(element, selec); + find: function(element, selec) { + if( typeof( jQuery ) != 'undefined' ){ + return $(element).find(selec); + } + }, + /* Animate + ================================================== */ + // VMM.Element.stop(element); + stop: function(element) { + if( typeof( jQuery ) != 'undefined' ){ + $(element).stop(); + } + }, + // VMM.Element.animate(element, duration, ease, att, callback_function); + animate: function(element, duration, ease, att, callback_function) { + + var _ease = "easein"; + var _duration = 1000; + var _att = {}; + + if (duration != null) { + if (duration < 1) { + _duration = 1; + } else { + _duration = Math.round(duration); + } + + } + + if (ease != null && ease != "") { + _ease = ease; + } + + if (att != null) { + _att = att + } else { + _att = {opacity: 0} + } + + + if (VMM.Browser.device == "mobile" || VMM.Browser.device == "tablet") { + + var _tdd = Math.round((_duration/1500)*10)/10 + var __duration = _tdd + 's'; + VMM.Element.css(element, '-webkit-transition', 'all '+ __duration + ' ease'); + VMM.Element.css(element, '-moz-transition', 'all '+ __duration + ' ease'); + VMM.Element.css(element, '-o-transition', 'all '+ __duration + ' ease'); + VMM.Element.css(element, '-ms-transition', 'all '+ __duration + ' ease'); + VMM.Element.css(element, 'transition', 'all '+ __duration + ' ease'); + VMM.Element.cssmultiple(element, _att); + + //callback_function(); + /* + if( typeof( jQuery ) != 'undefined' ){ + if (callback_function != null && callback_function != "") { + $(element).animate(_att, {queue:false, duration:_duration, easing:"ease", complete:callback_function} ); + } else { + $(element).animate(_att, {queue:false, duration:_duration, easing:"ease"} ); + } + } + */ + + } else { + if( typeof( jQuery ) != 'undefined' ){ + if (callback_function != null && callback_function != "") { + $(element).animate(_att, {queue:false, duration:_duration, easing:_ease, complete:callback_function} ); + } else { + $(element).animate(_att, {queue:false, duration:_duration, easing:_ease} ); + } + } + } + + + /* + VMM.Element.cssmultiple(element, { + '-webkit-transition': 'all 1s ease-in-out', + '-moz-transition': 'all 1s ease-in-out', + '-o-transition': 'all 1s ease-in-out', + '-ms-transition': 'all 1s ease-in-out', + 'transition': 'all 1s ease-in-out', + + }); + */ + }, + + }).init(); + + /* TOUCH + ================================================== */ + // VMM.TouchSlider.createSlidePanel(touch_object, move_object, w, padding, vertical, h) ; + VMM.TouchSlider = { + createPanel: function(touch_object, move_object, w, padding, vertical, h) { + VMM.TouchSlider.vertical = false; + VMM.TouchSlider.vertical = vertical; + + var x = padding; + VMM.TouchSlider.width = w; + VMM.TouchSlider.height = h; + VMM.TouchSlider.makeTouchable(touch_object, move_object); + /* + if (sticky != null && sticky != "") { + VMM.TouchSlider.sticky = sticky; + } else { + VMM.TouchSlider.sticky = false; + } + */ + // VMM.TouchSlider.sticky = sticky; + + }, + + removePanel: function(touch_object) { + VMM.unbindEvent(touch_object, VMM.TouchSlider.onTouchStart, "touchstart"); + VMM.unbindEvent(touch_object, VMM.TouchSlider.onTouchMove, "touchmove"); + VMM.unbindEvent(touch_object, VMM.TouchSlider.onTouchEnd, "touchend"); + }, + + makeTouchable: function(touch_object, move_object) { + VMM.bindEvent(touch_object, VMM.TouchSlider.onTouchStart, "touchstart", {element: move_object}); + VMM.bindEvent(touch_object, VMM.TouchSlider.onTouchMove, "touchmove", {element: move_object}); + VMM.bindEvent(touch_object, VMM.TouchSlider.onTouchEnd, "touchend", {element: move_object}); + }, + onTouchStart: function(e) { + VMM.TouchSlider.touchStart(e.data.element, e); + e.preventDefault(); + e.stopPropagation(); + return true; + }, + onTouchEnd: function(e) { + e.preventDefault(); + e.stopPropagation(); + + if (VMM.TouchSlider.sliding) { + VMM.TouchSlider.sliding = false; + VMM.TouchSlider.touchEnd(e.data.element, e); + return false; + } else { + return true; + } + + }, + onTouchMove: function(e) { + VMM.TouchSlider.touchMove(e.data.element, e); + e.preventDefault(); + e.stopPropagation(); + return false; + }, + getLeft: function(elem) { + return parseInt(VMM.Element.css(elem, 'left').substring(0, VMM.Element.css(elem, 'left').length - 2), 10); + }, + getTop: function(elem) { + return parseInt(VMM.Element.css(elem, 'top').substring(0, VMM.Element.css(elem, 'top').length - 2), 10); + }, + touchStart: function(elem, e) { + + VMM.Element.css(elem, '-webkit-transition-duration', '0'); + + VMM.TouchSlider.startX = e.originalEvent.touches[0].screenX; + VMM.TouchSlider.startY = e.originalEvent.touches[0].screenY; + + VMM.TouchSlider.startLeft = VMM.TouchSlider.getLeft(elem); + VMM.TouchSlider.startTop = VMM.TouchSlider.getTop(elem); + + VMM.TouchSlider.touchStartTime = new Date().getTime(); + + }, + touchEnd: function(elem, e) { + if (VMM.TouchSlider.getLeft(elem) > 0) { + + //This means they dragged to the right past the first item + + if (VMM.TouchSlider.vertical) { + VMM.Element.animate(elem, 1000, "", {"top": 0}); + } else { + VMM.Element.animate(elem, 1000, "", {"left": 0}); + } + + VMM.TouchSlider.startX = null; + VMM.TouchSlider.startY = null; + + VMM.fireEvent(elem, "TOUCHUPDATE", [0]); + + } else { + //This means they were just dragging within the bounds of the grid and we just need to handle the momentum and snap to the grid. + VMM.TouchSlider.slideMomentum(elem, e); + } + }, + slideMomentum: function(elem, e) { + var slideAdjust = (new Date().getTime() - VMM.TouchSlider.touchStartTime) * 10; + var timeAdjust = slideAdjust; + + var left = VMM.TouchSlider.getLeft(elem); + var top = VMM.TouchSlider.getTop(elem); + + var changeX = 6000 * (Math.abs(VMM.TouchSlider.startLeft) - Math.abs(left)); + var changeY = 6000 * (Math.abs(VMM.TouchSlider.startTop) - Math.abs(top)); + + slideAdjust = Math.round(changeX / slideAdjust); + slideAdjustY = Math.round(changeY / slideAdjust); + + var newLeft = slideAdjust + left; + var newTop = slideAdjustY + top; + + var y = newTop % VMM.TouchSlider.height; + var t = newLeft % VMM.TouchSlider.width; + + + var _r_object = { + top: Math.min(0, newTop), + left: Math.min(0, newLeft), + time: timeAdjust + } + VMM.fireEvent(elem, "TOUCHUPDATE", [_r_object]); + /* + if (VMM.TouchSlider.sticky) { + trace("sticky"); + if ((Math.abs(t)) > ((VMM.TouchSlider.width / 2))) { + //Show the next cell + newLeft -= (VMM.TouchSlider.width - Math.abs(t)); + } else { + //Stay on the current cell + newLeft -= t; + } + + VMM.fireEvent(elem, "TOUCHUPDATE", [Math.min(0, newLeft)]); + + } else { + trace("not sticky"); + //VMM.TouchSlider.doSlide(elem, Math.min(0, newLeft), '0.5s'); + VMM.Element.animate(elem, 500, "", {"left": Math.min(0, newLeft)}); + } + */ + + VMM.TouchSlider.startX = null; + VMM.TouchSlider.startY = null; + + }, + doSlide: function(elem, x, duration) { + VMM.Element.css(elem, '-webkit-transition-property', 'left'); + VMM.Element.css(elem, '-webkit-transition-duration', duration); + VMM.Element.css(elem, 'left', x); + }, + touchMove: function(elem, e) { + + if (!VMM.TouchSlider.sliding) { + //elem.parent().addClass('sliding'); + } + + VMM.TouchSlider.sliding = true; + + if (VMM.TouchSlider.vertical) { + + if (VMM.TouchSlider.startY > e.originalEvent.touches[0].screenY) { + VMM.Element.css(elem, 'top', -(VMM.TouchSlider.startY - e.originalEvent.touches[0].screenY - VMM.TouchSlider.startTop)); + VMM.TouchSlider.slidingTop = true; + } else { + var top = (e.originalEvent.touches[0].screenY - VMM.TouchSlider.startY + VMM.TouchSlider.startTop); + VMM.Element.css(elem, 'top', -(VMM.TouchSlider.startY - e.originalEvent.touches[0].screenY - VMM.TouchSlider.startTop)); + VMM.TouchSlider.slidingTop = false; + } + + } else { + + if (VMM.TouchSlider.startX > e.originalEvent.touches[0].screenX) { + VMM.Element.css(elem, 'left', -(VMM.TouchSlider.startX - e.originalEvent.touches[0].screenX - VMM.TouchSlider.startLeft)); + VMM.TouchSlider.slidingLeft = true; + } else { + var left = (e.originalEvent.touches[0].screenX - VMM.TouchSlider.startX + VMM.TouchSlider.startLeft); + VMM.Element.css(elem, 'left', -(VMM.TouchSlider.startX - e.originalEvent.touches[0].screenX - VMM.TouchSlider.startLeft)); + VMM.TouchSlider.slidingLeft = false; + } + + } + + + } + } + + // Hide URL Bar for iOS and Android by Scott Jehl + // https://gist.github.com/1183357 + + VMM.hideUrlBar = function () { + var win = window, + doc = win.document; + + // If there's a hash, or addEventListener is undefined, stop here + if( !location.hash || !win.addEventListener ){ + + //scroll to 1 + window.scrollTo( 0, 1 ); + var scrollTop = 1, + + //reset to 0 on bodyready, if needed + bodycheck = setInterval(function(){ + if( doc.body ){ + clearInterval( bodycheck ); + scrollTop = "scrollTop" in doc.body ? doc.body.scrollTop : 1; + win.scrollTo( 0, scrollTop === 1 ? 0 : 1 ); + } + }, 15 ); + + win.addEventListener( "load", function(){ + setTimeout(function(){ + //reset to hide addr bar at onload + win.scrollTo( 0, scrollTop === 1 ? 0 : 1 ); + }, 0); + }, false ); + } + }; + + /* DRAG + ================================================== */ + // VMM.DragSlider.createSlidePanel(drag_object, move_object, w, padding, sticky); + // VMM.DragSlider.cancelSlide(); + VMM.DragSlider = { + createPanel: function(drag_object, move_object, w, padding, sticky) { + + + + var x = padding; + VMM.DragSlider.width = w; + VMM.DragSlider.makeDraggable(drag_object, move_object); + VMM.DragSlider.drag_elem = drag_object; + /* + if (sticky != null && sticky != "") { + VMM.TouchSlider.sticky = sticky; + } else { + VMM.TouchSlider.sticky = false; + } + */ + VMM.DragSlider.sticky = sticky; + }, + makeDraggable: function(drag_object, move_object) { + VMM.bindEvent(drag_object, VMM.DragSlider.onDragStart, "mousedown", {element: move_object, delement: drag_object}); + //VMM.bindEvent(drag_object, VMM.DragSlider.onDragMove, "mousemove", {element: move_object}); + VMM.bindEvent(drag_object, VMM.DragSlider.onDragEnd, "mouseup", {element: move_object, delement: drag_object}); + VMM.bindEvent(drag_object, VMM.DragSlider.onDragLeave, "mouseleave", {element: move_object, delement: drag_object}); + }, + cancelSlide: function(e) { + VMM.unbindEvent(VMM.DragSlider.drag_elem, VMM.DragSlider.onDragMove, "mousemove"); + //VMM.DragSlider.drag_elem.preventDefault(); + //VMM.DragSlider.drag_elem.stopPropagation(); + return true; + }, + onDragLeave: function(e) { + + VMM.unbindEvent(e.data.delement, VMM.DragSlider.onDragMove, "mousemove"); + e.preventDefault(); + e.stopPropagation(); + return true; + }, + onDragStart: function(e) { + VMM.DragSlider.dragStart(e.data.element, e.data.delement, e); + + e.preventDefault(); + e.stopPropagation(); + return true; + }, + onDragEnd: function(e) { + e.preventDefault(); + e.stopPropagation(); + + if (VMM.DragSlider.sliding) { + VMM.DragSlider.sliding = false; + VMM.DragSlider.dragEnd(e.data.element, e.data.delement, e); + return false; + } else { + return true; + } + + }, + onDragMove: function(e) { + VMM.DragSlider.dragMove(e.data.element, e); + e.preventDefault(); + e.stopPropagation(); + return false; + }, + dragStart: function(elem, delem, e) { + + VMM.DragSlider.startX = e.pageX; + + VMM.DragSlider.startLeft = VMM.DragSlider.getLeft(elem); + VMM.DragSlider.dragStartTime = new Date().getTime(); + VMM.DragSlider.dragWidth = VMM.Element.width(delem); + + // CANCEL CURRENT ANIMATION IF ANIMATING + var _newx = Math.round(VMM.DragSlider.startX - e.pageX - VMM.DragSlider.startLeft); + + VMM.Element.stop(elem); + VMM.bindEvent(delem, VMM.DragSlider.onDragMove, "mousemove", {element: elem}); + + }, + dragEnd: function(elem, delem, e) { + VMM.unbindEvent(delem, VMM.DragSlider.onDragMove, "mousemove"); + //VMM.DragSlider.dragMomentum(elem, e); + if (VMM.DragSlider.getLeft(elem) > 0) { + //(VMM.DragSlider.dragWidth/2) + //This means they dragged to the right past the first item + //VMM.Element.animate(elem, 1000, "linear", {"left": 0}); + + //VMM.fireEvent(elem, "DRAGUPDATE", [0]); + } else { + //This means they were just dragging within the bounds of the grid and we just need to handle the momentum and snap to the grid. + VMM.DragSlider.dragMomentum(elem, e); + } + }, + dragMove: function(elem, e) { + if (!VMM.DragSlider.sliding) { + //elem.parent().addClass('sliding'); + } + + VMM.DragSlider.sliding = true; + if (VMM.DragSlider.startX > e.pageX) { + //Sliding to the left + VMM.Element.css(elem, 'left', -(VMM.DragSlider.startX - e.pageX - VMM.DragSlider.startLeft)); + VMM.DragSlider.slidingLeft = true; + } else { + //Sliding to the right + var left = (e.pageX - VMM.DragSlider.startX + VMM.DragSlider.startLeft); + VMM.Element.css(elem, 'left', -(VMM.DragSlider.startX - e.pageX - VMM.DragSlider.startLeft)); + VMM.DragSlider.slidingLeft = false; + } + }, + dragMomentum: function(elem, e) { + var slideAdjust = (new Date().getTime() - VMM.DragSlider.dragStartTime) * 10; + var timeAdjust = slideAdjust; + var left = VMM.DragSlider.getLeft(elem); + + var changeX = 6000 * (Math.abs(VMM.DragSlider.startLeft) - Math.abs(left)); + //var changeX = 6000 * (VMM.DragSlider.startLeft - left); + slideAdjust = Math.round(changeX / slideAdjust); + + var newLeft = left + slideAdjust; + + var t = newLeft % VMM.DragSlider.width; + //left: Math.min(0, newLeft), + var _r_object = { + left: Math.min(newLeft), + time: timeAdjust + } + + VMM.fireEvent(elem, "DRAGUPDATE", [_r_object]); + var _ease = "easeOutExpo"; + if (_r_object.time > 0) { + VMM.Element.animate(elem, _r_object.time, _ease, {"left": _r_object.left}); + }; + + + //VMM.DragSlider.startX = null; + }, + getLeft: function(elem) { + return parseInt(VMM.Element.css(elem, 'left').substring(0, VMM.Element.css(elem, 'left').length - 2), 10); + } + + } + + /* DEVICE + ================================================== */ + + VMM.Browser = { + init: function () { + this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; + this.version = this.searchVersion(navigator.userAgent) + || this.searchVersion(navigator.appVersion) + || "an unknown version"; + this.OS = this.searchString(this.dataOS) || "an unknown OS"; + this.device = this.searchDevice(navigator.userAgent); + + }, + searchDevice: function(d) { + if (d.match(/Android/i) || d.match(/iPhone|iPod/i)) { + return "mobile"; + } else if (d.match(/iPad/i)) { + return "tablet"; + } else if (d.match(/BlackBerry/i) || d.match(/IEMobile/i)) { + return "other mobile"; + } else { + return "desktop"; + } + }, + searchString: function (data) { + for (var i=0;i
"; + return mediaElem; + } else if (m.type == "flickr") { + mediaElem = "
"; + return mediaElem; + } else if (m.type == "youtube") { + mediaElem = "
"; + return mediaElem; + } else if (m.type == "vimeo") { + mediaElem = "
"; + return mediaElem; + } else if (m.type == "twitter"){ + mediaElem = ""; + return mediaElem; + } else if (m.type == "twitter-ready") { + mediaElem = ""; + return mediaElem; + } else if (m.type == "soundcloud") { + mediaElem = "
"; + return mediaElem; + } else if (m.type == "google-map") { + mediaElem = "
"; + return mediaElem; + } else { + mediaElem = "
"; + return mediaElem; + } + } + }, + //VMM.MediaElement.create(element, data, returntrue); + create: function(element, data, __return, w, h) { + + _return = __return; + _w = 500; + _h = 400; + $mediacontainer = element; + //VMM.MediaElement.container = element; + var _valid = false; + if (w != null && w != "") { + _w = w; + } + if (h != null && h != "") { + _h = h; + } + + if (data.media != null && data.media != "") { + + _valid = true; + var mediaElem = ""; + var captionElem = ""; + var creditElem = ""; + var m = {}; + var media_height = (_h - 50); + var isTextMedia = false; + + // CREDIT + if (data.credit != null && data.credit != "") { + creditElem = "
" + data.credit + "
"; + } + // CAPTION + if (data.caption != null && data.caption != "") { + captionElem = "
" + data.caption + "
"; + } + + // MEDIA TYPE + m = VMM.MediaType(data.media); //returns an object with .type and .id + + // CREATE MEDIA CODE + if (m.type == "image") { + mediaElem = ""; + } else if (m.type == "flickr") { + var flickr_id = "flickr_" + m.id; + mediaElem = ""; + VMM.ExternalAPI.flickr.getPhoto(m.id, "#" + flickr_id); + } else if (m.type == "youtube") { + mediaElem = "
Loading YouTube video...
"; + VMM.ExternalAPI.youtube.init(m.id); + //mediaElem = ""; + } else if (m.type == "vimeo") { + mediaElem = ""; + } else if (m.type == "twitter"){ + mediaElem = ""; + //VMM.ExternalAPI.twitter.getHTML(m.id); + trace("TWITTER"); + VMM.ExternalAPI.twitter.prettyHTML(m.id); + isTextMedia = true; + } else if (m.type == "twitter-ready") { + mediaElem = m.id; + } else if (m.type == "soundcloud") { + var soundcloud_id = "soundcloud_" + VMM.Util.unique_ID(5); + mediaElem = "
Loading Sound
"; + VMM.ExternalAPI.soundcloud.getSound(m.id, soundcloud_id) + } else if (m.type = "google-map") { + trace("GOOGLE MAP MEDIA CREATE"); + mediaElem = "" + //mediaElem = ""; + } else { + trace("NO KNOWN MEDIA TYPE FOUND"); + trace(m.type); + } + // WRAP THE MEDIA ELEMENT + mediaElem = "
" + mediaElem + creditElem + captionElem + "
"; + + if (_return) { + if (isTextMedia) { + return "
" + mediaElem + "
"; + } else { + return "
" + mediaElem + "
"; + } + } else { + VMM.appendElement($mediacontainer, mediaElem); + VMM.appendElement($mediacontainer, creditElem); + VMM.appendElement($mediacontainer, captionElem); + } + }; + + }, + + }).init(); + + VMM.Keys = { + flickr: "6d6f59d8d30d79f4f402a7644d5073e3", + } + + VMM.ExternalAPI = { + twitter: { + tweetArray: [], + // VMM.ExternalAPI.twitter.getHTML(id); + getHTML: function(id) { + var the_url = "https://api.twitter.com/1/statuses/oembed.json?id=" + id+ "&callback=?"; + + VMM.getJSON(the_url, function(d) { + VMM.ExternalAPI.twitter.onJSONLoaded(d, id); + }); + }, + onJSONLoaded: function(d, id) { + VMM.attachElement("#"+id, VMM.ExternalAPI.twitter.linkify(d.html) ); + }, + //somestring = VMM.ExternalAPI.twitter.linkify(d); + linkify: function(d) { + return d.replace(/[@]+[A-Za-z0-9-_]+/g, function(u) { + var username = u.replace("@",""); + + return u.link("http://twitter.com/"+username); + }); + }, + // VMM.ExternalAPI.twitter.parseTwitterDate(date); + parseTwitterDate: function(d) { + var date = new Date(Date.parse(d)); + /* + var t = d.replace(/(\d{1,2}[:]\d{2}[:]\d{2}) (.*)/, '$2 $1'); + t = t.replace(/(\+\S+) (.*)/, '$2 $1'); + var date = new Date(Date.parse(t)).toLocaleDateString(); + var time = new Date(Date.parse(t)).toLocaleTimeString(); + */ + return date; + }, + + prettyParseTwitterDate: function(d) { + var date = new Date(Date.parse(d)); + return VMM.Util.date.prettyDate(date, true); + }, + + // VMM.ExternalAPI.twitter.getTweets(tweets_array); + getTweets: function(tweets) { + var tweetArray = []; + var number_of_tweets = tweets.length; + + for(var i = 0; i < tweets.length; i++) { + + var twitter_id = ""; + + + /* FIND THE TWITTER ID + ================================================== */ + if (tweets[i].tweet.match("status\/")) { + twitter_id = tweets[i].tweet.split("status\/")[1]; + } else if (tweets[i].tweet.match("statuses\/")) { + twitter_id = tweets[i].tweet.split("statuses\/")[1]; + } else { + twitter_id = ""; + } + + /* FETCH THE DATA + ================================================== */ + var the_url = "https://api.twitter.com/1/statuses/show.json?id=" + twitter_id + "&include_entities=true&callback=?"; + VMM.getJSON(the_url, function(d) { + + var tweet = {} + /* FORMAT RESPONSE + ================================================== */ + var twit = ""; + + tweet.content = twit; + tweet.raw = d; + + tweetArray.push(tweet); + + + /* CHECK IF THATS ALL OF THEM + ================================================== */ + if (tweetArray.length == number_of_tweets) { + var the_tweets = {tweetdata: tweetArray} + VMM.fireEvent(global, "TWEETSLOADED", the_tweets); + } + }); + + } + + + }, + + // VMM.ExternalAPI.twitter.getTweetSearch(search string); + getTweetSearch: function(tweets, number_of_tweets) { + + + var _number_of_tweets = 40; + if (number_of_tweets != null && number_of_tweets != "") { + _number_of_tweets = number_of_tweets; + } + + var the_url = "http://search.twitter.com/search.json?q=" + tweets + "&rpp=" + _number_of_tweets + "&include_entities=true&result_type=mixed"; + var tweetArray = []; + VMM.getJSON(the_url, function(d) { + + /* FORMAT RESPONSE + ================================================== */ + for(var i = 0; i < d.results.length; i++) { + var tweet = {} + var twit = ""; + tweet.content = twit; + tweet.raw = d.results[i]; + tweetArray.push(tweet); + } + var the_tweets = {tweetdata: tweetArray} + VMM.fireEvent(global, "TWEETSLOADED", the_tweets); + }); + + }, + // VMM.ExternalAPI.twitter.prettyHTML(id); + prettyHTML: function(id) { + + // https://api.twitter.com/1/statuses/show.json?id=164165553810976768&include_entities=true + var the_url = "https://api.twitter.com/1/statuses/show.json?id=" + id + "&include_entities=true&callback=?"; + VMM.getJSON(the_url, function(d) { + VMM.ExternalAPI.twitter.formatJSON(d, id); + }); + }, + formatJSON: function(d, id) { + var twit = "

"; + var td = VMM.Util.linkify(d.text); + td = td.replace(/(@([\w]+))/g,"$1"); + td = td.replace(/(#([\w]+))/g,"$1"); + //twit += VMM.Util.linkify(d.text); + twit += td; + twit += "

"; + twit += "— " + d.user.name + " (@" + d.user.screen_name + ") " + d.created_at + "
"; + /* + + */ + VMM.attachElement("#"+id, twit ); + //VMM.attachElement("#"+id, VMM.ExternalAPI.twitter.linkify(twit) ); + } + + }, + maps: { + + }, + + flickr: { + + getPhoto: function(mid, id) { + // http://soundcloud.com/oembed?iframe=true&url=http://soundcloud.com/erasedtapes/olafur-arnalds-poland + var the_url = "http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key=" + VMM.Keys.flickr + "&photo_id=" + mid + "&format=json&nojsoncallback=1"; + VMM.getJSON(the_url, function(d) { + + var flickr_large_id = id + "_large"; + var flickr_thumb_id = id + "_thumb"; + var flickr_img_large = d.sizes.size[d.sizes.size.length - 1].source; + var flickr_img_thumb = d.sizes.size[0].source; + + VMM.Element.attr(flickr_large_id, "src", flickr_img_large); + VMM.Element.attr(flickr_thumb_id, "src", flickr_img_thumb); + }); + }, + + + }, + + soundcloud: { + // VMM.ExternalAPI.soundcloud.getSound(url, id) + getSound: function(url, id) { + // http://soundcloud.com/oembed?iframe=true&url=http://soundcloud.com/erasedtapes/olafur-arnalds-poland + var the_url = "http://soundcloud.com/oembed?iframe=true&url=" + url + ""; + VMM.getJSON(the_url, function(d) { + VMM.attachElement("#"+id, d.html ); + }); + }, + }, + + // VMM.ExternalAPI.youtube.init(id); + youtube: { + init: function(id) { + + if (VMM.master_config.youtube.active) { + VMM.master_config.youtube.createPlayer(id); + } else { + + VMM.master_config.youtube.que.push(id); + + if (VMM.master_config.youtube.api_loaded) { + + } else { + var tag = document.createElement('script'); + tag.src = "http://www.youtube.com/player_api"; + var firstScriptTag = document.getElementsByTagName('script')[0]; + firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); + VMM.master_config.youtube.api_loaded = true; + } + + } + }, + + onAPIReady: function() { + VMM.master_config.youtube.active = true; + + for(var i = 0; i < VMM.master_config.youtube.que.length; i++) { + VMM.ExternalAPI.youtube.createPlayer(VMM.master_config.youtube.que[i]); + } + }, + // VMM.ExternalAPI.youtube.createPlayer(id); + createPlayer: function(id) { + var p = { + active:false, + player: {}, + name:'youtube_'+id, + playing:false + }; + + p.player['youtube_'+id] = new YT.Player('youtube_'+id, { + height: '390', + width: '640', + playerVars: { + enablejsapi:1, + color: 'white', + showinfo:0, + theme: 'light', + rel:0, + origin:'http://dev.verite.co' + }, + videoId: id, + events: { + 'onReady': VMM.ExternalAPI.youtube.onPlayerReady, + 'onStateChange': VMM.ExternalAPI.youtube.onStateChange + } + }); + + VMM.master_config.youtube.array.push(p); + }, + + //VMM.ExternalAPI.youtube.stopPlayers(); + stopPlayers: function() { + for(var i = 0; i < VMM.master_config.youtube.array.length; i++) { + if (VMM.master_config.youtube.array[i].playing) { + var the_name = VMM.master_config.youtube.array[i].name; + VMM.master_config.youtube.array[i].player[the_name].stopVideo(); + } + } + }, + + onStateChange: function(e) { + for(var i = 0; i < VMM.master_config.youtube.array.length; i++) { + var the_name = VMM.master_config.youtube.array[i].name; + if (VMM.master_config.youtube.array[i].player[the_name] == e.target) { + if (e.data == YT.PlayerState.PLAYING) { + VMM.master_config.youtube.array[i].playing = true; + } + } + } + }, + + onPlayerReady: function(e) { + + } + + + } + } + //VMM.mediaType.youtube(d); //should return a true or false + // VMM.MediaType(url); //returns an object with .type and .id + VMM.MediaType = function(d) { + var success = false; + var media = {}; + if (d.match("div class='twitter'")) { + media.type = "twitter-ready"; + media.id = d; + success = true; + } else if (d.match('(www.)?youtube|youtu\.be')) { + if (d.match('embed')) { + youtube_id = d.split(/embed\//)[1].split('"')[0]; + } else { + youtube_id = d.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]; + } + //youtube_id = d.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]; + media.type = "youtube"; + media.id = youtube_id; + success = true; + } else if (d.match('(player.)?vimeo\.com')) { + //vimeo_id = d.split(/video\/|http:\/\/vimeo\.com\//)[1].split(/[?&]/)[0]; + vimeo_id = d.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0]; + + media.type = "vimeo"; + media.id = vimeo_id; + success = true; + } else if (d.match('(player.)?soundcloud\.com')) { + //soundcloud_url = unescape(d.split(/value="/)[1].split(/["]/)[0]); + //soundcloud_id = soundcloud_url.split(/tracks\//)[1].split(/[&"]/)[0]; + media.type = "soundcloud"; + media.id = d; + success = true; + } else if (d.match('(www.)?twitter\.com')) { + trace("TWITTER MATCH"); + // https://twitter.com/#!/twitterapi/statuses/133640144317198338 + // https://twitter.com/#!/DeliciousHot/status/23189589820702720 + if (d.match("status\/")) { + twitter_id = d.split("status\/")[1]; + } else if (d.match("statuses\/")) { + twitter_id = d.split("statuses\/")[1]; + } else { + twitter_id = ""; + } + + media.type = "twitter"; + media.id = twitter_id; + success = true; + } else if (d.match("maps.google.com")) { + //maps.google.com + media.type = "google-map"; + media.id = d.split(/src=['|"][^'|"]*?['|"]/gi); + trace("google map " + media.id); + success = true; + } else if (d.match("flickr.com")) { + media.type = "flickr"; + //media.id = d.split('/photos/[^/]+/([0-9]+)/gi'); + media.id = d.split("photos\/")[1].split("/")[1]; + //media.id = media.id.split("/")[1]; + trace("FLICKR " + media.id); + success = true; + } else if (d.match(/jpg|png|gif/i)) { + media.type = "image"; + media.id = d; + success = true; + } + + if (success) { + return media; + } else { + trace("No valid media id detected"); + trace(d); + } + return false; + } + + /* MEDIA + ================================================== */ + // something = new VMM.Media(parent, w, h, {thedata}); + VMM.Media = function(parent, w, h, thedata) { + + /* PRIVATE VARS + ================================================== */ + var data = {}; // HOLDS DATA + + var _valid = false; + + var config = { + width: 720, + height: 400, + content_width: 720, + content_height: 400, + ease: "easeInOutExpo", + duration: 1000, + spacing: 15 + }; + /* ELEMENTS + ================================================== */ + var $media = ""; + var $container = ""; + var $mediacontainer = ""; + var $mediaelement = ""; + var layout = parent; // expecting media div + + if (w != null && w != "") {config.width = w}; + if (h != null && h != "") {config.height = h}; + /* + if (typeof thedata != "undefined") { + data = thedata; + this.init(data); + } + */ + /* PUBLIC FUNCTIONS + ================================================== */ + this.init = function(d) { + if(typeof d != 'undefined') { + this.setData(d); + } else { + trace("WAITING ON DATA"); + } + }; + + var build = function(media, caption, credit) { + + $media = VMM.appendAndGetElement(layout, "
", "media"); + $container = VMM.appendAndGetElement($media, "
", "container"); + $mediacontainer = VMM.appendAndGetElement($container, "
", "media-container"); + + + if (data.media != null && data.media != "") { + + _valid = true; + var m = {}; + + m = VMM.MediaType(data.media); //returns an object with .type and .id + + if (m.type == "image") { + VMM.appendElement($mediacontainer, ""); + } else if (m.type == "youtube") { + VMM.appendElement($mediacontainer, "";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type="google-map"){trace("GOOGLE MAP MEDIA CREATE");g=""}else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init();VMM.Keys={flickr:"6d6f59d8d30d79f4f402a7644d5073e3"};VMM.ExternalAPI={twitter:{tweetArray:[],getHTML:function(a){var b="https://api.twitter.com/1/statuses/oembed.json?id="+a+"&callback=?";VMM.getJSON(b,function(b){VMM.ExternalAPI.twitter.onJSONLoaded(b,a)})},onJSONLoaded:function(a,b){VMM.attachElement("#"+b,VMM.ExternalAPI.twitter.linkify(a.html))},linkify:function(a){return a.replace(/[@]+[A-Za-z0-9-_]+/g,function(a){var b=a.replace("@","");return a.link("http://twitter.com/"+b)})},parseTwitterDate:function(a){var b=new Date(Date.parse(a));return b},prettyParseTwitterDate:function(a){var b=new Date(Date.parse(a));return VMM.Util.date.prettyDate(b,!0)},getTweets:function(a){var b=[],c=a.length;for(var d=0;d
";d.content=e;d.raw=a;b.push(d);if(b.length==c){var g={tweetdata:b};VMM.fireEvent(global,"TWEETSLOADED",g)}})}},getTweetSearch:function(a,b){var c=40;b!=null&&b!=""&&(c=b);var d="http://search.twitter.com/search.json?q="+a+"&rpp="+c+"&include_entities=true&result_type=mixed",e=[];VMM.getJSON(d,function(a){for(var b=0;b
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a){var b="https://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?";VMM.getJSON(b,function(b){VMM.ExternalAPI.twitter.formatJSON(b,a)})},formatJSON:function(a,b){var c="

",d=VMM.Util.linkify(a.text);d=d.replace(/(@([\w]+))/g,"$1");d=d.replace(/(#([\w]+))/g,"$1");c+=d;c+="

";c+="— "+a.user.name+" (@"+a.user.screen_name+") "+a.created_at+"
";VMM.attachElement("#"+b,c)}},maps:{},flickr:{getPhoto:function(a,b){var c="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+VMM.Keys.flickr+"&photo_id="+a+"&format=json&nojsoncallback=1";VMM.getJSON(c,function(a){var c=b+"_large",d=b+"_thumb",e=a.sizes.size[a.sizes.size.length-1].source,f=a.sizes.size[0].source;VMM.Element.attr(c,"src",e);VMM.Element.attr(d,"src",f)})}},soundcloud:{getSound:function(a,b){var c="http://soundcloud.com/oembed?iframe=true&url="+a+"";VMM.getJSON(c,function(a){VMM.attachElement("#"+b,a.html)})}},youtube:{init:function(a){if(VMM.master_config.youtube.active)VMM.master_config.youtube.createPlayer(a);else{VMM.master_config.youtube.que.push(a);if(!VMM.master_config.youtube.api_loaded){var b=document.createElement("script");b.src="http://www.youtube.com/player_api";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c);VMM.master_config.youtube.api_loaded=!0}}},onAPIReady:function(){VMM.master_config.youtube.active=!0;for(var a=0;a