revert hammer js changes

This commit is contained in:
r888888888
2014-08-20 16:49:20 -07:00
parent f0ab7ae937
commit 81c5c15758
39 changed files with 49 additions and 52 deletions

View File

@@ -6,4 +6,4 @@
//= require jquery.storageapi.js
//= require rails.js
//= require common.js
//= require_tree ./default
//= require_tree .

View File

@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

View File

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

View File

@@ -1,2 +0,0 @@
//= require hammer.min.js
//= require jquery-1.10.1.min.js

View File

@@ -62,28 +62,4 @@ div#tags {
font-size: 24pt;
font-weight: bold;
}
.category-1 a, a.tag-type-1 {
color: #A00;
&:hover {
color: #B66;
}
}
.category-3 a, a.tag-type-3 {
color: #A0A;
&:hover {
color: #B6B;
}
}
.category-4 a, a.tag-type-4 {
color: #0A0;
&:hover {
color: #6B6;
}
}
}

View File

@@ -5,7 +5,7 @@
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<%= csrf_meta_tag %>
<%= stylesheet_link_tag "mobile", :media => "screen" %>
<%= javascript_include_tag "mobile/mobile" %>
<%= javascript_include_tag "mobile" %>
<%= Danbooru.config.custom_html_header_content %>
<%= yield :html_header %>
</head>

View File

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

View File

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

View File

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

File diff suppressed because one or more lines are too long

View File

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