Permalink
Browse files

Merge pull request #7 from Trott/master

rm cruft
  • Loading branch information...
2 parents 1392f6f + c029818 commit 4d20b86d95943ae283f48b16fd36012cb953c722 @Trott Trott committed Dec 6, 2012
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
@@ -1,53 +0,0 @@
-var sectionHeight = function() {
- var total = $(window).height(),
- $section = $('section').css('height','auto');
-
- if ($section.outerHeight(true) < total) {
- var margin = $section.outerHeight(true) - $section.height();
- $section.height(total - margin - 20);
- } else {
- $section.css('height','auto');
- }
-}
-
-$(window).resize(sectionHeight);
-
-$(document).ready(function(){
- $("section h1, section h2").each(function(){
- $("nav ul").append("<li class='tag-" + this.nodeName.toLowerCase() + "'><a href='#" + $(this).text().toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g,'') + "'>" + $(this).text() + "</a></li>");
- $(this).attr("id",$(this).text().toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g,''));
- $("nav ul li:first-child a").parent().addClass("active");
- });
-
- $("nav ul li").on("click", "a", function(event) {
- var position = $($(this).attr("href")).offset().top - 190;
- $("html, body").animate({scrollTop: position}, 400);
- $("nav ul li a").parent().removeClass("active");
- $(this).parent().addClass("active");
- event.preventDefault();
- });
-
- sectionHeight();
-
- $('img').load(sectionHeight);
-});
-
-fixScale = function(doc) {
-
- var addEvent = 'addEventListener',
- type = 'gesturestart',
- qsa = 'querySelectorAll',
- scales = [1, 1],
- meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];
-
- function fix() {
- meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
- doc.removeEventListener(type, fix, true);
- }
-
- if ((meta = meta[meta.length - 1]) && addEvent in doc) {
- fix();
- scales = [.25, 1.6];
- doc[addEvent](type, fix, true);
- }
-};
View
@@ -1 +0,0 @@
-{"name":"Lightning Touch","body":"Lightning Touch\r\n===============\r\n\r\nLightning Touch makes links responsive without the several hundred millisecond delay typical in a hendheld touchscreen browser.\r\n\r\nTo see it in action, check out the **Sites That Use Lightning Touch** section below.\r\n\r\n## Using Lightning Touch\r\n\r\n* Put `LightningTouch.js` (or better yet, the minified version in the `demo` directory) in a sensible place on your web server. \r\n* In the web page that you wish to make Lightning Touch-enabled, link to the Lightning Touch JS file. For example:\r\n\r\n```\r\n<script async src=\"/js/LightningTouch.js\"></script>\r\n```\r\n\r\n* If your site has consistent header, footer, navigation, or other content that exists in its own block element, you can leave that stuff alone and it will appear on all the pages that result from Lightning Touch.\r\n* Take the main content of each of your pages and:\r\n * Wrap it in a block element (e.g., `<div>`). Assign a value to the `id` attribute. Use inline style or a stylesheet to set `display:none` unless the block is the default/main content. (Shameful admission: I've only tested this extensively with inline styles. For stylesheets, my testing has been minimal. If you use it with stylesheets, let me know the results!)\r\n * Take each anchor (`<a>`) element that you wish to Lightning Touch-enable and add a `data-target-id` indicating the `id` of the block element that anchor should link to. (Don't worry; `data-target-id` is a totally valid attribute in HTML5.)\r\n\r\n```\r\n<div id=\"lightning-main\">\r\n <h1>Lightning Touch</h1>\r\n <h2>Awesomeness!</h2>\r\n <a href=\"awesome.html\" data-target-id=\"awesome\">Tap for Lightning Touch!</a>\r\n</div>\r\n\r\n<div id=\"awesome\" style=\"display:none\">\r\n <h1>Whoa!</h1>\r\n <h2>That was awesome!</h2>\r\n <a href=\"main.html\" data-target-id=\"lightning-main\">Go back to main page!</a>\r\n</div>\r\n```\r\n\r\n* Indicate the id of your default/main content with a `data-default-target-id` attribute on the `body` element.\r\n\r\n```\r\n<body data-default-target-id=\"lightning-main\">\r\n```\r\n\r\nThat's it! You should have some really fast links on touch-enabled devices like iPhones, iPads, Android devices, and Blackberry devices that are not ancient.\r\n\r\n## Sites That Use Lightning Touch\r\n\r\n* [UCSF Mobile](http://m.ucsf.edu/)\r\n\r\n## Additional Usage Notes\r\n\r\n### Fallback\r\n\r\nBrowsers that do not work with Lightning Touch (e.g., Internet Explorer) will go to the URL specified in the `href` attribute of the anchor as usual. This does mean you need to have your content available in two places. A template engine or other dynamic content generation mechanism can reduce or eliminate the need to repeat the content in two places.\r\n\r\n### Reducing Payload\r\n\r\nEvery visitor will load all the Lightning Touch-enabled content on every visit. Consider using [HTML5 offline appcaching](http://www.html5rocks.com/en/tutorials/appcache/beginner/) to mitigate the network payload.\r\n\r\n### Google Analytics\r\n\r\nTo track Google Analytics Lightning Touch \"page\" loads, add an event listener for `hashchange`:\r\n\r\n```\r\nwindow.addEventListener('hashchange', function() { _gaq.push([\"_trackPageview\", window.location.hash])}, false);\r\n```\r\n\r\nYou can use `substr()` to strip off the hash mark and the prepended slash if you prefer. This is especially useful if your `id` attributes always correspond to your `href` values and you would like them to be treated as the same thing by Google Analytics.\r\n\r\n```\r\nwindow.addEventListener('hashchange', function() { _gaq.push([\"_trackPageview\", window.location.hash.substr(2)])}, false);\r\n```\r\n\r\n## License\r\n\r\nCopyright (c) 2012, Regents of the University of California\r\nAll rights reserved.\r\n\r\nRedistribution and use in source and binary forms, with or without\r\nmodification, are permitted provided that the following conditions are met:\r\n\r\n* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r\n* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\r\n* Neither the name of the University of California nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\r\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY\r\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n\r\n## Notes\r\n\r\nLightning Touch was written by Rich Trott at the [UCSF Library and Center for Knowledge Management](http://library.ucsf.edu). You can find him on Twitter: [@trott](http://twitter.com/trott)\r\n\r\nLightning Touch started with a portion of [fastButtons](http://code.google.com/mobile/articles/fast_buttons.html) created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.\r\n","tagline":"JavaScript utility to make web site navigation crazy-fast on touchscreen devices like iPhone, iPad, Android, and Blackberry.","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
Oops, something went wrong.

0 comments on commit 4d20b86

Please sign in to comment.