Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first commit

  • Loading branch information...
commit 8711830d976366cf8b6b3818f7abf1f278d7df30 1 parent ac92ae7
@chadsmith authored
View
BIN  apple-touch-icon-114x114-precomposed.png
Deleted file not rendered
View
BIN  apple-touch-icon-57x57-precomposed.png
Deleted file not rendered
View
BIN  apple-touch-icon-72x72-precomposed.png
Deleted file not rendered
View
BIN  apple-touch-icon-precomposed.png
Deleted file not rendered
View
BIN  apple-touch-icon.png
Deleted file not rendered
View
8 css/handheld.css
@@ -1,8 +0,0 @@
-* {
- float: none; /* Screens are not big enough to account for floats */
- background: #fff; /* As much contrast as possible */
- color: #000;
-}
-
-/* Slightly reducing font size to reduce need to scroll */
-body { font-size: 80%; }
View
67 css/style.css
@@ -75,8 +75,8 @@ pre, code, kbd, samp { font-family: monospace, sans-serif; }
* Minimal base styles.
*/
-/* Always force a scrollbar in non-IE */
-html { overflow-y: scroll; }
+/* Prevent mobile zooming while remain desktop zooming: github.com/shichuan/mobile-html5-boilerplate/issues/closed#issue/14 */
+html { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
/* j.mp/webkit-tap-highlight-color */
a:link { -webkit-tap-highlight-color: #FF5E99; }
@@ -109,12 +109,12 @@ pre {
padding: 15px;
}
-.ie6 legend, .ie7 legend { margin-left: -7px; }
+.ie6 legend, .ie7 legend, .iem7 legend { margin-left: -7px; }
/* Align checkboxes, radios, text inputs with their label by: Thierry Koblentz tjkdesign.com/ez-css/css/base.css */
input[type="radio"] { vertical-align: text-bottom; }
input[type="checkbox"] { vertical-align: bottom; }
-.ie7 input[type="checkbox"] { vertical-align: baseline; }
+.ie7 input[type="checkbox"], .iem7 input[type="checkbox"] { vertical-align: baseline; }
.ie6 input { vertical-align: text-bottom; }
/* Hand cursor on clickable input elements */
@@ -144,9 +144,13 @@ input:invalid, textarea:invalid {
::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
::selection { background:#FF5E99; color:#fff; text-shadow: none; }
+/* Make buttons play nice in IE:
+ www.viget.com/inspire/styling-the-button-element-in-internet-explorer/ */
+button { width: auto; overflow: visible; }
+
/* Bicubic resizing for non-native sized IMG:
code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ */
-.ie7 img { -ms-interpolation-mode: bicubic; }
+.ie7 img, .iem7 img { -ms-interpolation-mode: bicubic; }
/**
@@ -163,6 +167,25 @@ body, select, input, textarea {
/* Headers (h1, h2, etc) have no default font-size or margin; define those yourself */
h1, h2, h3, h4, h5, h6 { font-weight: bold; }
+/*
+ * Helper classes
+ */
+
+/* prevent callout */
+.nocallout {-webkit-touch-callout: none;}
+
+/* Text overflow with ellipsis */
+.ellipsis {
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+/* A hack for HTML5 contenteditable attribute on mobile */
+textarea.contenteditable {-webkit-appearance: none;}
+
+/* A workaround for S60 3.x and 5.0 devices which do not animated gif images if they have been set as display: none */
+.gifhidden {position: absolute; left: -100%;}
/**
* Primary styles
@@ -212,31 +235,27 @@ h1, h2, h3, h4, h5, h6 { font-weight: bold; }
.clearfix:after { clear: both; }
.clearfix { zoom: 1; }
-
-
-/**
- * Media queries for responsive design.
- *
- * These follow after primary styles so they will successfully override.
+/*
+ * Media queries for responsive design https://github.com/shichuan/mobile-html5-boilerplate/wiki/The-Style
*/
-@media all and (orientation:portrait) {
- /* Style adjustments for portrait mode goes here */
+/* iPhones, Android */
+@media only screen and (min-width: 480px) {
}
-
-@media all and (orientation:landscape) {
- /* Style adjustments for landscape mode goes here */
+/* iPads */
+@media only screen and (min-width: 768px) {
}
+/* Netbooks */
+@media only screen and (min-width: 992px) {
+ html { overflow-y: scroll; }
+}
+/* and up */
+@media only screen and (min-width: 1382px) {
+}
-/* Grade-A Mobile Browsers (Opera Mobile, Mobile Safari, Android Chrome)
- consider this: www.cloudfour.com/css-media-query-for-mobile-is-fools-gold/ */
-@media screen and (max-device-width: 480px) {
-
-
- /* Uncomment if you don't want iOS and WinMobile to mobile-optimize the text for you: j.mp/textsizeadjust */
- /* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */
+@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2) {
}
@@ -259,4 +278,4 @@ h1, h2, h3, h4, h5, h6 { font-weight: bold; }
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3{ page-break-after: avoid; }
-}
+}
View
18 default.appcache
@@ -0,0 +1,18 @@
+CACHE MANIFEST
+# version 1
+img/l/apple-touch-icon.png
+img/l/apple-touch-icon-precomposed.png
+img/l/splash.png
+img/m/apple-touch-icon.png
+img/h/apple-touch-icon.png
+img/h/splash.png
+css/style.css
+js/libs/dd_belatedpng.js
+js/libs/jquery-1.5.2.min.js
+js/libs/modernizr-custom.js
+js/libs/respond.min.js
+
+NETWORK:
+#http://example.com/api/
+
+FALLBACK:
View
BIN  img/h/apple-touch-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  img/h/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  img/l/apple-touch-icon-precomposed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  img/l/apple-touch-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  img/l/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  img/m/apple-touch-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
64 index.html
@@ -1,9 +1,12 @@
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
-<!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]-->
-<!--[if IE 7]> <html class="no-js ie7" lang="en"> <![endif]-->
-<!--[if IE 8]> <html class="no-js ie8" lang="en"> <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
+<!-- Conditional comment for mobile ie7 http://blogs.msdn.com/b/iemobile/ -->
+<!-- Appcache Facts http://appcachefacts.info/ -->
+<!--[if IEMobile 7]><html class="no-js iem7" manifest="default.appcache?v=1"><![endif]-->
+<!--[if lt IE 7]><html class="no-js ie6" lang="en"><![endif]-->
+<!--[if (IE 7)&!(IEMobile)]><html class="no-js ie7" lang="en"><![endif]-->
+<!--[if (IE 8)&!(IEMobile)]><html class="no-js ie8" lang="en"><![endif]-->
+<!--[if (gte IE 9)|(gt IEMobile 7)|!(IE)]><!--><html class="no-js" manifest="default.appcache?v=1" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
@@ -15,22 +18,38 @@
<meta name="description" content="">
<meta name="author" content="">
- <!-- Mobile viewport optimized: j.mp/bplateviewport -->
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
- <!-- Place favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
- <link rel="shortcut icon" href="/favicon.ico">
- <link rel="apple-touch-icon" href="/apple-touch-icon.png">
-
-
- <!-- CSS: implied media="all" -->
- <link rel="stylesheet" href="css/style.css">
-
- <!-- Uncomment if you are specifically targeting less enabled mobile browsers
- <link rel="stylesheet" media="handheld" href="css/handheld.css"> -->
+ <!-- Mobile viewport optimization http://goo.gl/b9SaQ -->
+ <meta name="HandheldFriendly" content="true">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1">
+
+ <!-- Home screen icon Mathias Bynens http://goo.gl/6nVq0 -->
+ <!-- For iPhone 4 with high-resolution Retina display: -->
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/h/apple-touch-icon.png">
+ <!-- For first-generation iPad: -->
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/m/apple-touch-icon.png">
+ <!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
+ <link rel="apple-touch-icon-precomposed" href="img/l/apple-touch-icon-precomposed.png">
+ <!-- For nokia devices: -->
+ <link rel="shortcut icon" href="img/l/apple-touch-icon.png">
+
+ <!--iOS web app, deletable if not needed -->
+ <!--<meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-status-bar-style" content="black">
+ <link rel="apple-touch-startup-image" href="img/l/splash.png">-->
+
+ <!-- Mobile IE allows us to activate ClearType technology for smoothing fonts for easy reading -->
+ <meta http-equiv="cleartype" content="on">
+
+ <!-- more tags for your 'head' to consider https://gist.github.com/849231 -->
+
+ <!-- Main Stylesheet -->
+ <link rel="stylesheet" href="css/style.css?v=1">
<!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects -->
- <script src="js/libs/modernizr-1.7.min.js"></script>
+ <script src="js/libs/modernizr-custom.js"></script>
+ <!-- Media Queries Polyfill https://github.com/shichuan/mobile-html5-boilerplate/wiki/Media-Queries-Polyfill -->
+ <script>Modernizr.mq('(min-width:0)') || document.write("<script src='js/libs/respond.min.js'>\x3C/script>")</script>
</head>
@@ -57,16 +76,23 @@
<!-- scripts concatenated and minified via ant build script-->
+ <script src="js/mylibs/helper.js"></script>
<script src="js/plugins.js"></script>
<script src="js/script.js"></script>
<!-- end scripts-->
+ <script>
+ // iPhone Scale Bug Fix, read this when using http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
+ MBP.scaleFix();
+ </script>
<!--[if lt IE 7 ]>
<script src="js/libs/dd_belatedpng.js"></script>
<script>DD_belatedPNG.fix("img, .png_bg"); // Fix any <img> or .png_bg bg-images. Also, please read goo.gl/mZiyb </script>
<![endif]-->
+ <!-- Debugger - remove for production -->
+ <!-- <script src="https://getfirebug.com/firebug-lite.js"></script> -->
<!-- mathiasbynens.be/notes/async-analytics-snippet Change UA-XXXXX-X to be your site's ID -->
<script>
@@ -77,4 +103,4 @@
</script>
</body>
-</html>
+</html>
View
2  js/libs/modernizr-1.7.min.js
@@ -1,2 +0,0 @@
-// Modernizr v1.7 www.modernizr.com
-window.Modernizr=function(a,b,c){function G(){e.input=function(a){for(var b=0,c=a.length;b<c;b++)t[a[b]]=!!(a[b]in l);return t}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)l.setAttribute("type",f=a[d]),e=l.type!=="text",e&&(l.value=m,l.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&l.style.WebkitAppearance!==c?(g.appendChild(l),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(l,null).WebkitAppearance!=="textfield"&&l.offsetHeight!==0,g.removeChild(l)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=l.checkValidity&&l.checkValidity()===!1:/^color$/.test(f)?(g.appendChild(l),g.offsetWidth,e=l.value!=m,g.removeChild(l)):e=l.value!=m)),s[a[d]]=!!e;return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}function F(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+p.join(c+" ")+c).split(" ");return!!E(d,b)}function E(a,b){for(var d in a)if(k[a[d]]!==c&&(!b||b(a[d],j)))return!0}function D(a,b){return(""+a).indexOf(b)!==-1}function C(a,b){return typeof a===b}function B(a,b){return A(o.join(a+";")+(b||""))}function A(a){k.cssText=a}var d="1.7",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l=b.createElement("input"),m=":)",n=Object.prototype.toString,o=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),p="Webkit Moz O ms Khtml".split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v,w=function(a){var c=b.createElement("style"),d=b.createElement("div"),e;c.textContent=a+"{#modernizr{height:3px}}",h.appendChild(c),d.id="modernizr",g.appendChild(d),e=d.offsetHeight===3,c.parentNode.removeChild(c),d.parentNode.removeChild(d);return!!e},x=function(){function d(d,e){e=e||b.createElement(a[d]||"div");var f=(d="on"+d)in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=C(e[d],"function"),C(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y=({}).hasOwnProperty,z;C(y,c)||C(y.call,c)?z=function(a,b){return b in a&&C(a.constructor.prototype[b],c)}:z=function(a,b){return y.call(a,b)},r.flexbox=function(){function c(a,b,c,d){a.style.cssText=o.join(b+":"+c+";")+(d||"")}function a(a,b,c,d){b+=":",a.style.cssText=(b+o.join(c+";"+b)).slice(0,-b.length)+(d||"")}var d=b.createElement("div"),e=b.createElement("div");a(d,"display","box","width:42px;padding:0;"),c(e,"box-flex","1","width:10px;"),d.appendChild(e),g.appendChild(d);var f=e.offsetWidth===42;d.removeChild(e),g.removeChild(d);return f},r.canvas=function(){var a=b.createElement("canvas");return a.getContext&&a.getContext("2d")},r.canvastext=function(){return e.canvas&&C(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){return!!a.WebGLRenderingContext},r.touch=function(){return"ontouchstart"in a||w("@media ("+o.join("touch-enabled),(")+"modernizr)")},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){var b=!!a.openDatabase;return b},r.indexedDB=function(){for(var b=-1,c=p.length;++b<c;){var d=p[b].toLowerCase();if(a[d+"_indexedDB"]||a[d+"IndexedDB"])return!0}return!1},r.hashchange=function(){return x("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return !!(a.history&&history.pushState)},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){return"WebSocket"in a},r.rgba=function(){A("background-color:rgba(150,255,150,.5)");return D(k.backgroundColor,"rgba")},r.hsla=function(){A("background-color:hsla(120,40%,100%,.5)");return D(k.backgroundColor,"rgba")||D(k.backgroundColor,"hsla")},r.multiplebgs=function(){A("background:url(//:),url(//:),red url(//:)");return(new RegExp("(url\\s*\\(.*?){3}")).test(k.background)},r.backgroundsize=function(){return F("backgroundSize")},r.borderimage=function(){return F("borderImage")},r.borderradius=function(){return F("borderRadius","",function(a){return D(a,"orderRadius")})},r.boxshadow=function(){return F("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){B("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return F("animationName")},r.csscolumns=function(){return F("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";A((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return D(k.backgroundImage,"gradient")},r.cssreflections=function(){return F("boxReflect")},r.csstransforms=function(){return!!E(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!E(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=w("@media ("+o.join("transform-3d),(")+"modernizr)"));return a},r.csstransitions=function(){return F("transitionProperty")},r.fontface=function(){var a,c,d=h||g,e=b.createElement("style"),f=b.implementation||{hasFeature:function(){return!1}};e.type="text/css",d.insertBefore(e,d.firstChild),a=e.sheet||e.styleSheet;var i=f.hasFeature("CSS2","")?function(b){if(!a||!b)return!1;var c=!1;try{a.insertRule(b,0),c=/src/i.test(a.cssRules[0].cssText),a.deleteRule(a.cssRules.length-1)}catch(d){}return c}:function(b){if(!a||!b)return!1;a.cssText=b;return a.cssText.length!==0&&/src/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(b.split(" ")[0])===0};c=i('@font-face { font-family: "font"; src: url(data:,); }'),d.removeChild(e);return c},r.video=function(){var a=b.createElement("video"),c=!!a.canPlayType;if(c){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return c},r.audio=function(){var a=b.createElement("audio"),c=!!a.canPlayType;c&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webWorkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="<svg/>";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,f&&a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function p(a,b){var c=-1,d=a.length,e,f=[];while(++c<d)e=a[c],(b=e.media||b)!="screen"&&f.push(p(e.imports,b),e.cssText);return f.join("")}function o(a){var b=-1;while(++b<e)a.createElement(d[b])}var c="abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",d=c.split("|"),e=d.length,f=new RegExp("(^|\\s)("+c+")","gi"),g=new RegExp("<(/*)("+c+")","gi"),h=new RegExp("(^|[^\\n]*?\\s)("+c+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),i=b.createDocumentFragment(),j=b.documentElement,k=j.firstChild,l=b.createElement("body"),m=b.createElement("style"),n;o(b),o(i),k.insertBefore(m,k.firstChild),m.media="print",a.attachEvent("onbeforeprint",function(){var a=-1,c=p(b.styleSheets,"all"),k=[],o;n=n||b.body;while((o=h.exec(c))!=null)k.push((o[1]+o[2]+o[3]).replace(f,"$1.iepp_$2")+o[4]);m.styleSheet.cssText=k.join("\n");while(++a<e){var q=b.getElementsByTagName(d[a]),r=q.length,s=-1;while(++s<r)q[s].className.indexOf("iepp_")<0&&(q[s].className+=" iepp_"+d[a])}i.appendChild(n),j.appendChild(l),l.className=n.className,l.innerHTML=n.innerHTML.replace(g,"<$1font")}),a.attachEvent("onafterprint",function(){l.innerHTML="",j.removeChild(l),j.appendChild(n),m.styleSheet.cssText=""})}(a,b),e._enableHTML5=f,e._version=d,g.className=g.className.replace(/\bno-js\b/,"")+" js "+u.join(" ");return e}(this,this.document)
View
14 js/libs/modernizr-custom.js
@@ -0,0 +1,14 @@
+/*!
+ * Modernizr v1.8pre
+ * http://www.modernizr.com
+ *
+ * Developed by:
+ * - Faruk Ates http://farukat.es/
+ * - Paul Irish http://paulirish.com/
+ *
+ * Copyright (c) 2009-2011
+ * Dual-licensed under the BSD or MIT licenses.
+ * http://www.modernizr.com/license/
+ */
+window.Modernizr=(function(o,v,k){var e="1.8pre",H={},x=true,F=v.documentElement,h=v.head||v.getElementsByTagName("head")[0],G="modernizr",D=v.createElement(G),B=D.style,g=v.createElement("input"),E=":)",y=Object.prototype.toString,z=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),q="Webkit Moz O ms Khtml".split(" "),I={svg:"http://www.w3.org/2000/svg"},j={},d={},w={},C=[],A,m=v.getElementsByTagName("script")[0],c=(function(L){var J={},M=v.createElement("body"),K=v.createElement("div");K.id=G+"-mqtest";M.appendChild(K);return function(O){if(J[O]==k){if(o.matchMedia){return(J[O]=matchMedia(O).matches)}var N=v.createElement("style"),P="@media "+O+" { #"+G+"-mqtest { position: absolute; } }";N.type="text/css";if(N.styleSheet){N.styleSheet.cssText=P}else{N.appendChild(v.createTextNode(P))}m.parentNode.insertBefore(M,m);m.parentNode.insertBefore(N,m);J[O]=(o.getComputedStyle?getComputedStyle(K,null):K.currentStyle)["position"]=="absolute";M.parentNode.removeChild(M);N.parentNode.removeChild(N)}return J[O]}})(),t=(function(){var K={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function J(L,N){N=N||v.createElement(K[L]||"div");L="on"+L;var M=(L in N);if(!M){if(!N.setAttribute){N=v.createElement("div")}if(N.setAttribute&&N.removeAttribute){N.setAttribute(L,"");M=l(N[L],"function");if(!l(N[L],k)){N[L]=k}N.removeAttribute(L)}}N=null;return M}return J})();var r=({}).hasOwnProperty,p;if(!l(r,k)&&!l(r.call,k)){p=function(J,K){return r.call(J,K)}}else{p=function(J,K){return((K in J)&&l(J.constructor.prototype[K],k))}}function u(J){B.cssText=J}function b(K,J){return u(z.join(K+";")+(J||""))}function l(K,J){return typeof K===J}function n(K,J){return !!~(""+K).indexOf(J)}function f(K,L){for(var J in K){if(B[K[J]]!==k&&(!L||L(K[J],D))){return true}}}function a(M,L){var K=M.charAt(0).toUpperCase()+M.substr(1),J=(M+" "+q.join(K+" ")+K).split(" ");return !!f(J,L)}j.flexbox=function(){function K(P,R,Q,O){R+=":";P.style.cssText=(R+z.join(Q+";"+R)).slice(0,-R.length)+(O||"")}function M(P,R,Q,O){P.style.cssText=z.join(R+":"+Q+";")+(O||"")}var N=v.createElement("div"),L=v.createElement("div");K(N,"display","box","width:42px;padding:0;");M(L,"box-flex","1","width:10px;");N.appendChild(L);F.appendChild(N);var J=L.offsetWidth===42;N.removeChild(L);F.removeChild(N);return J};j.canvas=function(){var J=v.createElement("canvas");return !!(J.getContext&&J.getContext("2d"))};j.canvastext=function(){return !!(H.canvas&&l(v.createElement("canvas").getContext("2d").fillText,"function"))};j.webgl=function(){return !!o.WebGLRenderingContext};j.touch=function(){return("ontouchstart" in o)||c("("+z.join("touch-enabled),(")+"modernizr)")};j.geolocation=function(){return !!navigator.geolocation};j.postmessage=function(){return !!o.postMessage};j.websqldatabase=function(){var J=!!o.openDatabase;return J};j.indexedDB=function(){for(var K=-1,J=q.length;++K<J;){if(o[q[K].toLowerCase()+"IndexedDB"]){return true}}return !!o.indexedDB};j.hashchange=function(){return t("hashchange",o)&&(v.documentMode===k||v.documentMode>7)};j.history=function(){return !!(o.history&&history.pushState)};j.draganddrop=function(){return t("dragstart")&&t("drop")};j.websockets=function(){return("WebSocket" in o)};j.rgba=function(){u("background-color:rgba(150,255,150,.5)");return n(B.backgroundColor,"rgba")};j.hsla=function(){u("background-color:hsla(120,40%,100%,.5)");return n(B.backgroundColor,"rgba")||n(B.backgroundColor,"hsla")};j.multiplebgs=function(){u("background:url(//:),url(//:),red url(//:)");return new RegExp("(url\\s*\\(.*?){3}").test(B.background)};j.backgroundsize=function(){return a("backgroundSize")};j.borderimage=function(){return a("borderImage")};j.borderradius=function(){return a("borderRadius","",function(J){return n(J,"orderRadius")})};j.boxshadow=function(){return a("boxShadow")};j.textshadow=function(){return v.createElement("div").style.textShadow===""};j.opacity=function(){b("opacity:.55");return/^0.55$/.test(B.opacity)};j.cssanimations=function(){return a("animationName")};j.csscolumns=function(){return a("columnCount")};j.cssgradients=function(){var L="background-image:",K="gradient(linear,left top,right bottom,from(#9f9),to(white));",J="linear-gradient(left top,#9f9, white);";u((L+z.join(K+L)+z.join(J+L)).slice(0,-L.length));return n(B.backgroundImage,"gradient")};j.cssreflections=function(){return a("boxReflect")};j.csstransforms=function(){return !!f(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])};j.csstransforms3d=function(){var J=!!f(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);if(J&&"webkitPerspective" in F.style){J=c("("+z.join("transform-3d),(")+"modernizr)")}return J};j.csstransitions=function(){return a("transitionProperty")};j.fontface=function(){var N,K,M=h||F,O=v.createElement("style"),J=v.implementation||{hasFeature:function(){return false}};O.type="text/css";M.insertBefore(O,M.firstChild);N=O.sheet||O.styleSheet;var L=J.hasFeature("CSS2","")?function(R){if(!(N&&R)){return false}var P=false;try{N.insertRule(R,0);P=(/src/i).test(N.cssRules[0].cssText);N.deleteRule(N.cssRules.length-1)}catch(Q){}return P}:function(P){if(!(N&&P)){return false}N.cssText=P;return N.cssText.length!==0&&(/src/i).test(N.cssText)&&N.cssText.replace(/\r+|\n+/g,"").indexOf(P.split(" ")[0])===0};K=L('@font-face { font-family: "font"; src: url("//:"); }');M.removeChild(O);return K};j.video=function(){var L=v.createElement("video"),J=!!L.canPlayType;if(J){J=new Boolean(J);J.ogg=L.canPlayType('video/ogg; codecs="theora"');var K='video/mp4; codecs="avc1.42E01E';J.h264=L.canPlayType(K+'"')||L.canPlayType(K+', mp4a.40.2"');J.webm=L.canPlayType('video/webm; codecs="vp8, vorbis"')}return J};j.audio=function(){var K=v.createElement("audio"),J=!!K.canPlayType;if(J){J=new Boolean(J);J.ogg=K.canPlayType('audio/ogg; codecs="vorbis"');J.mp3=K.canPlayType("audio/mpeg;");J.wav=K.canPlayType('audio/wav; codecs="1"');J.m4a=K.canPlayType("audio/x-m4a;")||K.canPlayType("audio/aac;")}return J};j.localstorage=function(){try{return !!localStorage.getItem}catch(J){return false}};j.sessionstorage=function(){try{return !!sessionStorage.getItem}catch(J){return false}};j.webWorkers=function(){return !!o.Worker};j.applicationcache=function(){return !!o.applicationCache};j.svg=function(){return !!v.createElementNS&&!!v.createElementNS(I.svg,"svg").createSVGRect};j.inlinesvg=function(){var J=v.createElement("div");J.innerHTML="<svg/>";return(J.firstChild&&J.firstChild.namespaceURI)==I.svg};j.smil=function(){return !!v.createElementNS&&/SVG/.test(y.call(v.createElementNS(I.svg,"animate")))};j.svgclippaths=function(){return !!v.createElementNS&&/SVG/.test(y.call(v.createElementNS(I.svg,"clipPath")))};function s(){H.input=(function(L){for(var K=0,J=L.length;K<J;K++){w[L[K]]=!!(L[K] in g)}return w})("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));H.inputtypes=(function(M){for(var L=0,K,O,N,J=M.length;L<J;L++){g.setAttribute("type",O=M[L]);K=g.type!=="text";if(K){g.value=E;g.style.cssText="position:absolute;visibility:hidden;";if(/^range$/.test(O)&&g.style.WebkitAppearance!==k){F.appendChild(g);N=v.defaultView;K=N.getComputedStyle&&N.getComputedStyle(g,null).WebkitAppearance!=="textfield"&&(g.offsetHeight!==0);F.removeChild(g)}else{if(/^(search|tel)$/.test(O)){}else{if(/^(url|email)$/.test(O)){K=g.checkValidity&&g.checkValidity()===false}else{if(/^color$/.test(O)){F.appendChild(g);F.offsetWidth;K=g.value!=E;F.removeChild(g)}else{K=g.value!=E}}}}}d[M[L]]=!!K}return d})("search tel url email datetime date month week time datetime-local number range color".split(" "))}for(var i in j){if(p(j,i)){A=i.toLowerCase();H[A]=j[i]();C.push((H[A]?"":"no-")+A)}}if(!H.input){s()}H.crosswindowmessaging=H.postmessage;H.historymanagement=H.history;H.addTest=function(J,K){J=J.toLowerCase();if(H[J]){return}K=!!(K());F.className+=" "+(K?"":"no-")+J;H[J]=K;return H};u("");D=g=null;if(x&&o.attachEvent&&(function(){var J=v.createElement("div");J.innerHTML="<elem></elem>";return J.childNodes.length!==1})()){(function(P,aa){P.iepp=P.iepp||{};var Q=P.iepp,Z=Q.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",K=Z.split("|"),Y=K.length,X=new RegExp("(^|\\s)("+Z+")","gi"),W=new RegExp("<(/*)("+Z+")","gi"),O=/^\s*[\{\}]\s*$/,J=new RegExp("(^|[^\\n]*?\\s)("+Z+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),M=aa.createDocumentFragment(),U=aa.documentElement,R=U.firstChild,S=aa.createElement("body"),N=aa.createElement("style"),V=/print|all/,T;function L(ac){var ab=-1;while(++ab<Y){ac.createElement(K[ab])}}Q.getCSS=function(af,ad){if(af+""===k){return""}var ac=-1,ab=af.length,ag,ae=[];while(++ac<ab){ag=af[ac];if(ag.disabled){continue}ad=ag.media||ad;if(V.test(ad)){ae.push(Q.getCSS(ag.imports,ad),ag.cssText)}ad="all"}return ae.join("")};Q.parseCSS=function(ac){var ab=[],ad;while((ad=J.exec(ac))!=null){ab.push(((O.exec(ad[1])?"\n":ad[1])+ad[2]+ad[3]).replace(X,"$1.iepp_$2")+ad[4])}return ab.join("\n")};Q.writeHTML=function(){var ac=-1;T=T||aa.body;while(++ac<Y){var ad=aa.getElementsByTagName(K[ac]),ae=ad.length,ab=-1;while(++ab<ae){if(ad[ab].className.indexOf("iepp_")<0){ad[ab].className+=" iepp_"+K[ac]}}}M.appendChild(T);U.appendChild(S);S.className=T.className;S.id=T.id;S.innerHTML=T.innerHTML.replace(W,"<$1font")};Q._beforePrint=function(){N.styleSheet.cssText=Q.parseCSS(Q.getCSS(aa.styleSheets,"all"));Q.writeHTML()};Q.restoreHTML=function(){S.innerHTML="";U.removeChild(S);U.appendChild(T)};Q._afterPrint=function(){Q.restoreHTML();N.styleSheet.cssText=""};L(aa);L(M);if(Q.disablePP){return}R.insertBefore(N,R.firstChild);N.media="print";N.className="iepp-printshim";P.attachEvent("onbeforeprint",Q._beforePrint);P.attachEvent("onafterprint",Q._afterPrint)})(o,v)}H._enableHTML5=x;H._version=e;H.mq=c;H.isEventSupported=t;F.className=F.className.replace(/\bno-js\b/,"")+" js "+C.join(" ");return H})(this,this.document);
+/*yepnope1.0.1|WTFPL*/(function(a,b,c){function H(){var a=z;a.loader={load:G,i:0};return a}function G(a,b,c){var e=b=="c"?r:q;i=0,b=b||"j",u(a)?F(e,a,b,this.i++,d,c):(h.splice(this.i++,0,a),h.length==1&&E());return this}function F(a,c,d,g,j,l){function q(){!o&&A(n.readyState)&&(p.r=o=1,!i&&B(),n.onload=n.onreadystatechange=null,e(function(){m.removeChild(n)},0))}var n=b.createElement(a),o=0,p={t:d,s:c,e:l};n.src=n.data=c,!k&&(n.style.display="none"),n.width=n.height="0",a!="object"&&(n.type=d),n.onload=n.onreadystatechange=q,a=="img"?n.onerror=q:a=="script"&&(n.onerror=function(){p.e=p.r=1,E()}),h.splice(g,0,p),m.insertBefore(n,k?null:f),e(function(){o||(m.removeChild(n),p.r=p.e=o=1,B())},z.errorTimeout)}function E(){var a=h.shift();i=1,a?a.t?e(function(){a.t=="c"?D(a):C(a)},0):(a(),B()):i=0}function D(a){var c=b.createElement("link"),d;c.href=a.s,c.rel="stylesheet",c.type="text/css",!a.e&&(o||j)?function g(a){e(function(){if(!d)try{a.sheet.cssRules.length?(d=1,B()):g(a)}catch(b){b.code==1e3||b.message=="security"||b.message=="denied"?(d=1,e(function(){B()},0)):g(a)}},0)}(c):(c.onload=function(){d||(d=1,e(function(){B()},0))},a.e&&c.onload()),e(function(){d||(d=1,B())},z.errorTimeout),!a.e&&f.parentNode.insertBefore(c,f)}function C(a){var c=b.createElement("script"),d;c.src=a.s,c.onreadystatechange=c.onload=function(){!d&&A(c.readyState)&&(d=1,B(),c.onload=c.onreadystatechange=null)},e(function(){d||(d=1,B())},z.errorTimeout),a.e?c.onload():f.parentNode.insertBefore(c,f)}function B(){var a=1,b=-1;while(h.length- ++b)if(h[b].s&&!(a=h[b].r))break;a&&E()}function A(a){return!a||a=="loaded"||a=="complete"}var d=b.documentElement,e=a.setTimeout,f=b.getElementsByTagName("script")[0],g=({}).toString,h=[],i=0,j="MozAppearance"in d.style,k=j&&!!b.createRange().compareNode,l=j&&!k,m=k?d:f.parentNode,n=a.opera&&g.call(a.opera)=="[object Opera]",o="webkitAppearance"in d.style,p=o&&"async"in b.createElement("script"),q=j?"object":n||p?"img":"script",r=o?"img":q,s=Array.isArray||function(a){return g.call(a)=="[object Array]"},t=function(a){return typeof a=="object"},u=function(a){return typeof a=="string"},v=function(a){return g.call(a)=="[object Function]"},w=[],x={},y,z;z=function(a){function h(a,b){function i(a){if(u(a))g(a,f,b,0,c);else if(t(a))for(h in a)a.hasOwnProperty(h)&&g(a[h],f,b,h,c)}var c=!!a.test,d=c?a.yep:a.nope,e=a.load||a.both,f=a.callback,h;i(d),i(e),a.complete&&b.load(a.complete)}function g(a,b,d,e,g){var h=f(a),i=h.autoCallback;if(!h.bypass){b&&(b=v(b)?b:b[a]||b[e]||b[a.split("/").pop().split("?")[0]]);if(h.instead)return h.instead(a,b,d,e,g);d.load(h.url,h.forceCSS||!h.forceJS&&/css$/.test(h.url)?"c":c,h.noexec),(v(b)||v(i))&&d.load(function(){H(),b&&b(h.origUrl,g,e),i&&i(h.origUrl,g,e)})}}function f(a){var b=a.split("!"),c=w.length,d=b.pop(),e=b.length,f={url:d,origUrl:d,prefixes:b},g,h;for(h=0;h<e;h++)g=x[b[h]],g&&(f=g(f));for(h=0;h<c;h++)f=w[h](f);return f}var b,d,e=this.yepnope.loader;if(u(a))g(a,0,e,0);else if(s(a))for(b=0;b<a.length;b++)d=a[b],u(d)?g(d,0,e,0):s(d)?z(d):t(d)&&h(d,e);else t(a)&&h(a,e)},z.addPrefix=function(a,b){x[a]=b},z.addFilter=function(a){w.push(a)},z.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",y=function(){b.removeEventListener("DOMContentLoaded",y,0),b.readyState="complete"},0)),a.yepnope=H()})(this,this.document)
View
7 js/libs/respond.min.js
@@ -0,0 +1,7 @@
+/*
+ * respond.js - A small and fast polyfill for min/max-width CSS3 Media Queries
+ * Copyright 2011, Scott Jehl, scottjehl.com
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * Usage: Check out the readme file or github.com/scottjehl/respond
+*/
+(function(e,h){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=h;if(h){return}var u=e.document,r=u.documentElement,i=[],k=[],p=[],o={},g=30,f=u.getElementsByTagName("head")[0]||r,b=f.getElementsByTagName("link"),d=[],a=function(){var B=b,w=B.length;for(var z=0;z<w;z++){var y=B[z],x=y.href,A=y.media,v=y.rel&&y.rel.toLowerCase()==="stylesheet";if(!!x&&v&&!o[x]){if(!/^([a-zA-Z]+?:(\/\/)?(www\.)?)/.test(x)||x.replace(RegExp.$1,"").split("/")[0]===e.location.host){d.push({href:x,media:A})}else{o[x]=true}}}t()},t=function(){if(d.length){var v=d.shift();n(v.href,function(w){m(w,v.href,v.media);o[v.href]=true;t()})}},m=function(G,v,x){var E=G.match(/@media ([^\{]+)\{([\S\s]+?)(?=\}[\s]*\/\*\/mediaquery\*\/)/gmi),H=E&&E.length||0,v=v.substring(0,v.lastIndexOf("/")),w=function(I){return I.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+v+"$2$3")},y=!H&&x;if(v.length){v+="/"}if(y){H=1}for(var B=0;B<H;B++){var C;if(y){C=x;k.push(w(G))}else{C=E[B].match(/@media ([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1;k.push(RegExp.$2&&w(RegExp.$2))}var z=C.split(","),F=z.length;for(var A=0;A<F;A++){var D=z[A];i.push({media:D.match(/(only\s+)?([a-zA-Z]+)(\sand)?/)&&RegExp.$2,rules:k.length-1,minw:D.match(/\(min\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1),maxw:D.match(/\(max\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1)})}}j()},l,q,j=function(E){var v="clientWidth",x=r[v],D=u.compatMode==="CSS1Compat"&&x||u.body[v]||x,z={},C=u.createDocumentFragment(),B=b[b.length-1],w=(new Date()).getTime();if(E&&l&&w-l<g){clearTimeout(q);q=setTimeout(j,g);return}else{l=w}for(var y in i){var F=i[y];if(!F.minw&&!F.maxw||(!F.minw||F.minw&&D>=F.minw)&&(!F.maxw||F.maxw&&D<=F.maxw)){if(!z[F.media]){z[F.media]=[]}z[F.media].push(k[F.rules])}}for(var y in p){if(p[y]&&p[y].parentNode===f){f.removeChild(p[y])}}for(var y in z){var G=u.createElement("style"),A=z[y].join("\n");G.type="text/css";G.media=y;if(G.styleSheet){G.styleSheet.cssText=A}else{G.appendChild(u.createTextNode(A))}C.appendChild(G);p.push(G)}f.insertBefore(C,B.nextSibling)},n=function(v,x){var w=c();if(!w){return}w.open("GET",v,true);w.onreadystatechange=function(){if(w.readyState!=4||w.status!=200&&w.status!=304){return}x(w.responseText)};if(w.readyState==4){return}w.send()},c=(function(){var v=false,w=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new XMLHttpRequest()}],y=w.length;while(y--){try{v=w[y]()}catch(x){continue}break}return function(){return v}})();a();respond.update=a;function s(){j(true)}if(e.addEventListener){e.addEventListener("resize",s,false)}else{if(e.attachEvent){e.attachEvent("onresize",s)}}})(this,(function(f){if(f.matchMedia){return true}var e,i=document,c=i.documentElement,g=c.firstElementChild||c.firstChild,h=!i.body,d=i.body||i.createElement("body"),b=i.createElement("div"),a="only all";b.id="mq-test-1";b.style.cssText="position:absolute;top:-99em";d.appendChild(b);b.innerHTML='_<style media="'+a+'"> #mq-test-1 { width: 9px; }</style>';if(h){c.insertBefore(d,g)}b.removeChild(b.firstChild);e=b.offsetWidth==9;if(h){c.removeChild(d)}else{d.removeChild(b)}return e})(this));
View
147 js/mylibs/helper.js
@@ -0,0 +1,147 @@
+/*
+ * MBP - Mobile boilerplate helper functions
+ */
+(function(document){
+
+window.MBP = window.MBP || {};
+
+// Fix for iPhone viewport scale bug
+// http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
+
+MBP.viewportmeta = document.querySelector && document.querySelector('meta[name="viewport"]');
+MBP.ua = navigator.userAgent;
+
+MBP.scaleFix = function () {
+ if (MBP.viewportmeta && /iPhone|iPad/.test(MBP.ua) && !/Opera Mini/.test(MBP.ua)) {
+ MBP.viewportmeta.content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
+ document.addEventListener("gesturestart", MBP.gestureStart, false);
+ }
+};
+MBP.gestureStart = function () {
+ MBP.viewportmeta.content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6";
+};
+
+
+// Hide URL Bar for iOS
+// http://remysharp.com/2010/08/05/doing-it-right-skipping-the-iphone-url-bar/
+
+MBP.hideUrlBar = function () {
+ /iPhone/.test(MBP.ua) && !pageYOffset && !location.hash && setTimeout(function () {
+ window.scrollTo(0, 1);
+ }, 1000);
+};
+
+
+// Fast Buttons - read wiki below before using
+// https://github.com/shichuan/mobile-html5-boilerplate/wiki/JavaScript-Helper
+
+MBP.fastButton = function (element, handler) {
+ this.element = element;
+ this.handler = handler;
+ if (element.addEventListener) {
+ element.addEventListener('touchstart', this, false);
+ element.addEventListener('click', this, false);
+ }
+};
+
+MBP.fastButton.prototype.handleEvent = function(event) {
+ switch (event.type) {
+ case 'touchstart': this.onTouchStart(event); break;
+ case 'touchmove': this.onTouchMove(event); break;
+ case 'touchend': this.onClick(event); break;
+ case 'click': this.onClick(event); break;
+ }
+};
+
+MBP.fastButton.prototype.onTouchStart = function(event) {
+ event.stopPropagation();
+ this.element.addEventListener('touchend', this, false);
+ document.body.addEventListener('touchmove', this, false);
+ this.startX = event.touches[0].clientX;
+ this.startY = event.touches[0].clientY;
+ this.element.style.backgroundColor = "rgba(0,0,0,.7)";
+};
+
+MBP.fastButton.prototype.onTouchMove = function(event) {
+ if(Math.abs(event.touches[0].clientX - this.startX) > 10 || Math.abs(event.touches[0].clientY - this.startY) > 10) {
+ this.reset();
+ }
+};
+
+MBP.fastButton.prototype.onClick = function(event) {
+ event.stopPropagation();
+ this.reset();
+ this.handler(event);
+ if(event.type == 'touchend') {
+ MBP.preventGhostClick(this.startX, this.startY);
+ }
+ this.element.style.backgroundColor = "";
+};
+
+MBP.fastButton.prototype.reset = function() {
+ this.element.removeEventListener('touchend', this, false);
+ document.body.removeEventListener('touchmove', this, false);
+ this.element.style.backgroundColor = "";
+};
+
+MBP.preventGhostClick = function (x, y) {
+ MBP.coords.push(x, y);
+ window.setTimeout(function (){
+ MBP.coords.splice(0, 2);
+ }, 2500);
+};
+
+MBP.ghostClickHandler = function (event) {
+ for(var i = 0, len = MBP.coords.length; i < len; i += 2) {
+ var x = MBP.coords[i];
+ var y = MBP.coords[i + 1];
+ if(Math.abs(event.clientX - x) < 25 && Math.abs(event.clientY - y) < 25) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ }
+};
+
+if (document.addEventListener) {
+ document.addEventListener('click', MBP.ghostClickHandler, true);
+}
+
+MBP.coords = [];
+
+
+// iOS Startup Image
+// https://github.com/shichuan/mobile-html5-boilerplate/issues#issue/2
+
+MBP.splash = function () {
+ var filename = navigator.platform === 'iPad' ? 'h/' : 'l/';
+ document.write('<link rel="apple-touch-startup-image" href="/img/' + filename + 'splash.png" />' );
+};
+
+
+// Autogrow
+// http://googlecode.blogspot.com/2009/07/gmail-for-mobile-html5-series.html
+
+MBP.autogrow = function (element, lh) {
+
+ function handler(e){
+ var newHeight = this.scrollHeight,
+ currentHeight = this.clientHeight;
+ if (newHeight > currentHeight) {
+ this.style.height = newHeight + 3 * textLineHeight + "px";
+ }
+ }
+
+ var setLineHeight = (lh) ? lh : 12,
+ textLineHeight = element.currentStyle ? element.currentStyle.lineHeight :
+ getComputedStyle(element, null).lineHeight;
+
+ textLineHeight = (textLineHeight.indexOf("px") == -1) ? setLineHeight :
+ parseInt(textLineHeight, 10);
+
+ element.style.overflow = "hidden";
+ element.addEventListener ? element.addEventListener('keyup', handler, false) :
+ element.attachEvent('onkeyup', handler);
+};
+
+})(document);
+
Please sign in to comment.
Something went wrong with that request. Please try again.