remove jquery.hammer.min.js dependency

This commit is contained in:
r888888888
2014-08-15 13:22:44 -07:00
parent ac57534f97
commit 75da8dc340
5 changed files with 22 additions and 44 deletions

View File

@@ -1,7 +1 @@
//= require jquery-1.10.1.min.js
//= require hammer.min.js
//= require jquery.hammer.min.js
$(function() {
$(document).hammer();
});

View File

@@ -11,25 +11,20 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<script type="text/javascript">
$(function() {
$(document)
.hammer()
.on("swipeleft", function(e) {
if (e.gesture.distance > 125) {
var href = $(".paginator a[rel=next]").attr("href");
if (href) {
window.location = href;
}
}
})
.on("swiperight", function(e) {
if (e.gesture.distance > 125) {
var href = $(".paginator a[rel=prev]").attr("href");
if (href) {
window.location = href;
}
}
});
})
var doc = new Hammer(document);
doc.on("swipeleft", function(e) {
var href = $(".paginator a[rel=next]").attr("href");
if (href) {
window.location = href;
}
});
doc.on("swiperight", function(e) {
var href = $(".paginator a[rel=prev]").attr("href");
if (href) {
window.location = href;
}
});
});
</script>
<% end %>

View File

@@ -13,19 +13,16 @@
<meta name="viewport" content="width=device-width,initial-scale=<%= @post.device_scale %>">
<script type="text/javascript">
$(function() {
$(document).on("swipeleft", function(e) {
if (e.gesture.distance > 150) {
var href = $(".paginator a[rel=next]").attr("href");
if (href) {
window.location = href;
}
var doc = new Hammer(document);
doc.on("swipeleft", function(e) {
var href = $(".paginator a[rel=next]").attr("href");
if (href) {
window.location = href;
}
});
$(document).on("swiperight", function(e) {
if (e.gesture.distance > 150) {
window.history.back();
}
doc.on("swiperight", function(e) {
window.history.back();
})
});
</script>

View File

@@ -4,7 +4,7 @@ module Danbooru
class Configuration
# The version of this Danbooru.
def version
"2.57.0"
"2.57.1"
end
# The name of this Danbooru.

View File

@@ -1,8 +0,0 @@
/*! jQuery plugin for Hammer.JS - v1.1.3 - 2014-05-20
* http://eightmedia.github.com/hammer.js
*
* Copyright (c) 2014 Jorik Tangelder <j.tangelder@gmail.com>;
* Licensed under the MIT license */
!function(a,b){"use strict";function c(a,c){Date.now||(Date.now=function(){return(new Date).getTime()}),a.utils.each(["on","off"],function(d){a.utils[d]=function(a,e,f){c(a)[d](e,function(a){var d=c.extend({},a.originalEvent,a);d.button===b&&(d.button=a.which-1),f.call(this,d)})}}),a.Instance.prototype.trigger=function(a,b){var d=c(this.element);return d.has(b.target).length&&(d=c(b.target)),d.trigger({type:a,gesture:b})},c.fn.hammer=function(b){return this.each(function(){var d=c(this),e=d.data("hammer");e?e&&b&&a.utils.extend(e.options,b):d.data("hammer",new a(this,b||{}))})}}"function"==typeof define&&define.amd?define(["hammerjs","jquery"],c):c(a.Hammer,a.jQuery||a.Zepto)}(window);
//# sourceMappingURL=jquery.hammer.min.map