Skip to content

Commit c708286

Browse files
committedMar 14, 2015
init
0 parents  commit c708286

File tree

88 files changed

+3603
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+3603
-0
lines changed
 

‎client/head.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<head>
2+
<meta charset="utf-8">
3+
<title>Todos - All your todos synced wherever you happen to be</title>
4+
<meta name="description" content="The simple todo list that keeps your todos in sync everywhere free forever. Todo is open source and powered by Meteor.">
5+
<meta name="viewport" content="user-scalable=no, initial-scale=1, minimal-ui, maximum-scale=1, minimum-scale=1" />
6+
<link rel="shortcut icon" type="image/png" href="favicon.png?v1" sizes="16x16 32x32 64x64">
7+
<link rel="apple-touch-icon" sizes="120x120" href="apple-touch-icon-precomposed.png">
8+
</head>

‎client/lib/jquery.touchwipe.js

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/**
2+
* jQuery Plugin to obtain touch gestures from iPhone, iPod Touch and iPad, should also work with Android mobile phones (not tested yet!)
3+
* Common usage: wipe images (left and right to show the previous or next image)
4+
*
5+
* @author Andreas Waltl, netCU Internetagentur (http://www.netcu.de)
6+
* @version 1.1.1 (9th December 2010) - fix bug (older IE's had problems)
7+
* @version 1.1 (1st September 2010) - support wipe up and wipe down
8+
* @version 1.0 (15th July 2010)
9+
*/
10+
(function($) {
11+
$.fn.touchwipe = function(settings) {
12+
var config = {
13+
min_move_x: 20,
14+
min_move_y: 20,
15+
wipeLeft: function() { },
16+
wipeRight: function() { },
17+
wipeUp: function() { },
18+
wipeDown: function() { },
19+
preventDefaultEvents: true
20+
};
21+
22+
if (settings) $.extend(config, settings);
23+
24+
this.each(function() {
25+
var startX;
26+
var startY;
27+
var isMoving = false;
28+
29+
function cancelTouch() {
30+
this.removeEventListener('touchmove', onTouchMove);
31+
startX = null;
32+
isMoving = false;
33+
}
34+
35+
function onTouchMove(e) {
36+
if(config.preventDefaultEvents) {
37+
e.preventDefault();
38+
}
39+
if(isMoving) {
40+
var x = e.touches[0].pageX;
41+
var y = e.touches[0].pageY;
42+
var dx = startX - x;
43+
var dy = startY - y;
44+
if(Math.abs(dx) >= config.min_move_x) {
45+
cancelTouch();
46+
if(dx > 0) {
47+
config.wipeLeft();
48+
}
49+
else {
50+
config.wipeRight();
51+
}
52+
}
53+
else if(Math.abs(dy) >= config.min_move_y) {
54+
cancelTouch();
55+
if(dy > 0) {
56+
config.wipeDown();
57+
}
58+
else {
59+
config.wipeUp();
60+
}
61+
}
62+
}
63+
}
64+
65+
function onTouchStart(e)
66+
{
67+
if (e.touches.length == 1) {
68+
startX = e.touches[0].pageX;
69+
startY = e.touches[0].pageY;
70+
isMoving = true;
71+
this.addEventListener('touchmove', onTouchMove, false);
72+
}
73+
}
74+
if ('ontouchstart' in document.documentElement) {
75+
this.addEventListener('touchstart', onTouchStart, false);
76+
}
77+
});
78+
79+
return this;
80+
};
81+
82+
})(jQuery);

0 commit comments

Comments
 (0)
Please sign in to comment.