Share your image gallery from a server's directory without need for a database thanks to strong encryption. Users can be authenticated via authentication module, e.g. implementing LDAP.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.6 KiB
69 lines
2.6 KiB
/* swipe up and down */ |
|
(function() { |
|
var supportTouch = $.support.touch, |
|
scrollEvent = "touchmove scroll", |
|
touchStartEvent = supportTouch ? "touchstart" : "mousedown", |
|
touchStopEvent = supportTouch ? "touchend" : "mouseup", |
|
touchMoveEvent = supportTouch ? "touchmove" : "mousemove"; |
|
$.event.special.swipeupdown = { |
|
setup: function() { |
|
var thisObject = this; |
|
var $this = $(thisObject); |
|
$this.bind(touchStartEvent, function(event) { |
|
var data = event.originalEvent.touches ? |
|
event.originalEvent.touches[ 0 ] : |
|
event, |
|
start = { |
|
time: (new Date).getTime(), |
|
coords: [ data.pageX, data.pageY ], |
|
origin: $(event.target) |
|
}, |
|
stop; |
|
|
|
function moveHandler(event) { |
|
if (!start) { |
|
return; |
|
} |
|
var data = event.originalEvent.touches ? |
|
event.originalEvent.touches[ 0 ] : |
|
event; |
|
stop = { |
|
time: (new Date).getTime(), |
|
coords: [ data.pageX, data.pageY ] |
|
}; |
|
|
|
// prevent scrolling |
|
if (Math.abs(start.coords[1] - stop.coords[1]) > 10) { |
|
event.preventDefault(); |
|
} |
|
} |
|
$this |
|
.bind(touchMoveEvent, moveHandler) |
|
.one(touchStopEvent, function(event) { |
|
$this.unbind(touchMoveEvent, moveHandler); |
|
if (start && stop) { |
|
if (stop.time - start.time < 1000 && |
|
Math.abs(start.coords[1] - stop.coords[1]) > 60 && |
|
Math.abs(start.coords[0] - stop.coords[0]) < 20) { |
|
start.origin |
|
.trigger("swipeupdown") |
|
.trigger(start.coords[1] > stop.coords[1] ? "swipeup" : "swipedown"); |
|
} |
|
} |
|
start = stop = undefined; |
|
}); |
|
}); |
|
} |
|
}; |
|
$.each({ |
|
swipedown: "swipeupdown", |
|
swipeup: "swipeupdown" |
|
}, function(event, sourceEvent){ |
|
$.event.special[event] = { |
|
setup: function(){ |
|
$(this).bind(sourceEvent, $.noop); |
|
} |
|
}; |
|
}); |
|
|
|
})();
|
|
|