add option for desktop mode in user settings
This commit is contained in:
@@ -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"});
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
<div class="input text optional field_with_hint">
|
||||
<label class="text optional" for="user_dmail_filter_attributes_words">Dmail filter</label>
|
||||
@@ -87,6 +83,16 @@
|
||||
<span class="hint">A list of banned words (space delimited). Any dmail you receive with a banned word will automatically be deleted.</span>
|
||||
</div>
|
||||
|
||||
<%= 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" } } %>
|
||||
|
||||
<div class="input select field_with_hint">
|
||||
<label class="select optional" for="user_desktop_mode">Desktop mode</label>
|
||||
<%= select_tag "user[desktop_mode]", options_for_select([["No", "0"], ["Yes", "1"]], cookies[:dm]), :class => "select optional" %>
|
||||
<span class="hint">Force desktop version of site even on mobile.</span>
|
||||
</div>
|
||||
|
||||
<%= f.input :custom_style, :label => "Custom <a href='http://en.wikipedia.org/wiki/Cascading_Style_Sheets'>CSS</a> style".html_safe, :hint => "Style to apply to the whole site.", :input_html => {:size => "40x5"} %>
|
||||
</fieldset>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user