diff --git a/app/assets/javascripts/posts.js b/app/assets/javascripts/posts.js index 054f192ad..267358e26 100644 --- a/app/assets/javascripts/posts.js +++ b/app/assets/javascripts/posts.js @@ -50,9 +50,9 @@ $("body").hammer().bind("pan", function(e) { var percentage = 100 * e.gesture.deltaX / window.innerWidth; if (percentage < -10) { - $("body").css({"transition-duration": "0.1s", "transform": "translateX(" + percentage + "%)"}); + $("body").css({"transition-timing-function": "linear", "transition-duration": "0.1s", "transform": "translateX(" + percentage + "%)"}); } else if (percentage > 10) { - $("body").css({"transition-duration": "0.1s", "transform": "translateX(" + percentage + "%)"}); + $("body").css({"transition-timing-function": "linear", "transition-duration": "0.1s", "transform": "translateX(" + percentage + "%)"}); } }); @@ -62,10 +62,10 @@ $("body").hammer().bind("panend", function(e) { var percentage = e.gesture.deltaX / window.innerWidth; if (hasPrev && percentage > 0.3) { - $("body").css({"transition-timing-function": "linear", "transition-duration": "0.3s", "opacity": "0", "transform": "translateX(150%)"}); + $("body").css({"transition-timing-function": "ease", "transition-duration": "0.3s", "opacity": "0", "transform": "translateX(150%)"}); $.timeout(250).done(function() {Danbooru.Post.nav_prev(e)}); } else if (hasNext && percentage < -0.3) { - $("body").css({"transition-timing-function": "linear", "transition-duration": "0.3s", "opacity": "0", "transform": "translateX(-150%)"}); + $("body").css({"transition-timing-function": "ease", "transition-duration": "0.3s", "opacity": "0", "transform": "translateX(-150%)"}); $.timeout(250).done(function() {Danbooru.Post.nav_next(e)}); } else { $("body").css({"transition-timing-function": "ease", "transition-duration": "0.5s", "transform": "none"}); diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 374f9a4f3..60778d866 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,6 +1,7 @@ class UsersController < ApplicationController respond_to :html, :xml, :json skip_before_filter :api_check + before_filter :process_session_actions, only: [:update] def new @user = User.new @@ -78,6 +79,16 @@ class UsersController < ApplicationController private + def process_session_actions + if params[:user].has_key?(:desktop_mode) + if params[:user].delete(:desktop_mode) == "0" + cookies.delete(:dm) + else + cookies[:dm] = "1" + end + end + end + def check_privilege(user) raise User::PrivilegeError unless (user.id == CurrentUser.id || CurrentUser.is_admin?) end diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 282560602..328339cad 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -74,11 +74,7 @@ <%= f.input :disable_tagged_filenames, :as => :select, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %> - <%= f.input :disable_cropped_thumbnails, :as => :select, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %> - - <%= f.input :enable_recent_searches, :as => :select, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %> - - <%= f.input :favorite_tags, :label => "Frequent tags", :hint => "A list of tags that you use often. They will appear when using the list of Related Tags.", :input_html => { :rows => 5, :data => { :autocomplete => "tag-query" } } %> + <%#= f.input :disable_cropped_thumbnails, :as => :select, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>