Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

explore-mrg #541

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ec0d98c
Create gh-pages branch via GitHub
mattcg Aug 7, 2012
c6ccb53
Add examples and src
mattcg Aug 7, 2012
e34e25b
Create gh-pages branch via GitHub
mattcg Aug 30, 2012
07c7e48
Merge branch 'master' into gh-pages
mattcg Aug 30, 2012
8b235cd
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Oct 24, 2012
7f3420b
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Oct 24, 2012
0e5effa
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Oct 30, 2012
d80397b
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Nov 13, 2012
0d3b2d8
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Nov 26, 2012
e4ec09d
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Nov 29, 2012
5015ae8
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Dec 18, 2012
27a2d4b
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Jan 6, 2013
24295a2
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Jan 11, 2013
19addf8
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Jan 11, 2013
3a33a2d
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Jan 14, 2013
e99135d
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Feb 11, 2013
5346700
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Mar 12, 2013
a4ba229
Merge branch 'gh-pages' of github.com:ftlabs/fastclick into gh-pages
mattcg Mar 22, 2013
8d1e729
Merge branch 'master' into gh-pages
mattcg Nov 12, 2013
6b2f92c
Merge remote-tracking branch 'origin/master' into gh-pages
matthew-andrews Mar 27, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>FastClick by ftlabs</title>

<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="wrapper">
<header>
<h1>FastClick</h1>
<p>Polyfill to remove click delays on browsers with touch UIs</p>

<p class="view"><a href="https://github.com/ftlabs/fastclick">View the Project on GitHub <small>ftlabs/fastclick</small></a></p>


<ul>
<li><a href="https://github.com/ftlabs/fastclick/zipball/master">Download <strong>ZIP File</strong></a></li>
<li><a href="https://github.com/ftlabs/fastclick/tarball/master">Download <strong>TAR Ball</strong></a></li>
<li><a href="https://github.com/ftlabs/fastclick">View On <strong>GitHub</strong></a></li>
</ul>
</header>
<section>
<h1>FastClick</h1>

<p>FastClick is a simple, easy-to-use library for eliminating the 300ms delay between a physical tap and the firing of a <code>click</code> event on mobile browsers. The aim is to make your application feel less laggy and more responsive while avoiding any interference with your current logic.</p>

<p>FastClick is developed by <a href="http://labs.ft.com/">FT Labs</a>, part of the Financial Times.</p>

<h2>Compatibility</h2>

<p>The library has been deployed as part of the <a href="http://app.ft.com/">FT Web App</a> and is tried and tested on the following mobile browsers:</p>

<ul>
<li>Mobile Safari on iOS 3 and upwards</li>
<li>Chrome on iOS 5 and upwards</li>
<li>Chrome on Android (ICS)</li>
<li>Opera Mobile 11.5 and upwards</li>
<li>Android Browser since Honeycomb</li>
<li>PlayBook OS 1 and upwards</li>
</ul><p>FastClick doesn't attach any listeners on desktop browsers as it is not needed. Those that have been tested are:</p>

<ul>
<li>Safari</li>
<li>Chrome</li>
<li>Internet Explorer</li>
<li>Firefox</li>
<li>Opera</li>
</ul><h2>Usage</h2>

<p>Include fastclick.js in your JavaScript bundle or add it to your HTML page like this:</p>

<div class="highlight"><pre><span class="nt">&lt;script </span><span class="na">type=</span><span class="s">'application/javascript'</span> <span class="na">src=</span><span class="s">'/path/to/fastclick.js'</span><span class="nt">&gt;&lt;/script&gt;</span>
</pre></div>

<p>The script must be loaded prior to instantiating FastClick on any element of the page.</p>

<p>To instantiate FastClick on the <code>body</code>, which is the recommended method of use:</p>

<div class="highlight"><pre><span class="nb">window</span><span class="p">.</span><span class="nx">addEventListener</span><span class="p">(</span><span class="s1">'load'</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">new</span> <span class="nx">FastClick</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">);</span>
<span class="p">},</span> <span class="kc">false</span><span class="p">);</span>
</pre></div>

<h2>Advanced</h2>

<p>Internally, FastClick uses <code>document.createEvent</code> to fire a synthetic <code>click</code> event as soon as <code>touchend</code> is fired by the browser. It then suppresses the additional <code>click</code> event created by the browser after that. In some cases, the non-synthetic <code>click</code> event created by the browser is required, as described in the <a href="http://ftlabs.github.com/fastclick/examples/focus.html">triggering focus example</a>.</p>

<p>This is where the <code>needsclick</code> class comes in. Add the class to any element that requires a non-synthetic click.</p>

<h2>Examples</h2>

<p>FastClick is designed to cope with many different browser oddities. Here are some examples to illustrate this:</p>

<ul>
<li>
<a href="http://ftlabs.github.com/fastclick/examples/layer.html">basic use</a> showing the increase in perceived responsiveness</li>
<li>
<a href="http://ftlabs.github.com/fastclick/examples/focus.html">triggering focus</a> on an input element from a <code>click</code> handler</li>
<li>
<a href="http://ftlabs.github.com/fastclick/examples/input.html">input element</a> which never receives fast clicks</li>
</ul><h2>Google Closure Compiler</h2>

<p>FastClick supports compilation with <code>ADVANCED_OPTIMIZATIONS</code> ('advanced mode'), which should reduce its size by about 70% (60% gzipped). Note that exposure of the <code>FastClick</code> variable isn't forced therefore you must compile it along with all of your code.</p>

<h2>Credits and collaboration</h2>

<p>The lead developer of FastClick is <a href="http://twitter.com/rowanbeentje">Rowan Beentje</a> at FT Labs. This fork is currently maintained by <a href="http://twitter.com/mcaruanagalizia">Matthew Caruana Galizia</a>, also at FT Labs. All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request. Enjoy.</p>
</section>
<footer>
<p>This project is maintained by <a href="https://github.com/ftlabs">ftlabs</a></p>
<p><small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
</footer>
</div>
<script src="javascripts/scale.fix.js"></script>

</body>
</html>
17 changes: 17 additions & 0 deletions javascripts/scale.fix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
document.addEventListener("gesturestart", gestureStart, false);
}
function gestureStart() {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6";
}
}
}
1 change: 1 addition & 0 deletions params.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"FastClick","tagline":"Polyfill to remove click delays on browsers with touch UIs","body":"# FastClick\r\n\r\nFastClick is a simple, easy-to-use library for eliminating the 300ms delay between a physical tap and the firing of a `click` event on mobile browsers. The aim is to make your application feel less laggy and more responsive while avoiding any interference with your current logic.\r\n\r\nFastClick is developed by [FT Labs](http://labs.ft.com/), part of the Financial Times.\r\n\r\n## Compatibility\r\n\r\nThe library has been deployed as part of the [FT Web App](http://app.ft.com/) and is tried and tested on the following mobile browsers:\r\n\r\n* Mobile Safari on iOS 3 and upwards\r\n* Chrome on iOS 5 and upwards\r\n* Chrome on Android (ICS)\r\n* Opera Mobile 11.5 and upwards\r\n* Android Browser since Honeycomb\r\n* PlayBook OS 1 and upwards\r\n\r\nFastClick doesn't attach any listeners on desktop browsers as it is not needed. Those that have been tested are:\r\n\r\n* Safari\r\n* Chrome\r\n* Internet Explorer\r\n* Firefox\r\n* Opera\r\n\r\n## Usage\r\n\r\nInclude fastclick.js in your JavaScript bundle or add it to your HTML page like this:\r\n\r\n```html\r\n<script type='application/javascript' src='/path/to/fastclick.js'></script>\r\n```\r\n\r\nThe script must be loaded prior to instantiating FastClick on any element of the page.\r\n\r\nTo instantiate FastClick on the `body`, which is the recommended method of use:\r\n\r\n```js\r\nwindow.addEventListener('load', function() {\r\n\tnew FastClick(document.body);\r\n}, false);\r\n```\r\n\r\n## Advanced\r\n\r\nInternally, FastClick uses `document.createEvent` to fire a synthetic `click` event as soon as `touchend` is fired by the browser. It then suppresses the additional `click` event created by the browser after that. In some cases, the non-synthetic `click` event created by the browser is required, as described in the [triggering focus example](http://ftlabs.github.com/fastclick/examples/focus.html).\r\n\r\nThis is where the `needsclick` class comes in. Add the class to any element that requires a non-synthetic click.\r\n\r\n## Examples\r\n\r\nFastClick is designed to cope with many different browser oddities. Here are some examples to illustrate this:\r\n\r\n* [basic use](http://ftlabs.github.com/fastclick/examples/layer.html) showing the increase in perceived responsiveness\r\n* [triggering focus](http://ftlabs.github.com/fastclick/examples/focus.html) on an input element from a `click` handler\r\n* [input element](http://ftlabs.github.com/fastclick/examples/input.html) which never receives fast clicks\r\n\r\n## Google Closure Compiler\r\n\r\nFastClick supports compilation with `ADVANCED_OPTIMIZATIONS` ('advanced mode'), which should reduce its size by about 70% (60% gzipped). Note that exposure of the `FastClick` variable isn't forced therefore you must compile it along with all of your code.\r\n\r\n## Credits and collaboration\r\n\r\nThe lead developer of FastClick is [Rowan Beentje](http://twitter.com/rowanbeentje) at FT Labs. This fork is currently maintained by [Matthew Caruana Galizia](http://twitter.com/mcaruanagalizia), also at FT Labs. All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request. Enjoy.","note":"Don't delete this file! It's used internally to help with page regeneration.","google":""}
69 changes: 69 additions & 0 deletions stylesheets/pygment_trac.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kn { font-weight: bold } /* Keyword.Namespace */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */

.type-csharp .highlight .k { color: #0000FF }
.type-csharp .highlight .kt { color: #0000FF }
.type-csharp .highlight .nf { color: #000000; font-weight: normal }
.type-csharp .highlight .nc { color: #2B91AF }
.type-csharp .highlight .nn { color: #000000 }
.type-csharp .highlight .s { color: #A31515 }
.type-csharp .highlight .sc { color: #A31515 }
Loading