users: remove option to disable autocomplete.
This option was originally added in issue #1747. But only ~350 users ever disabled autocomplete, only ~120 of these were seen in the last year, and only 9 new users who signed up in the last year disabled it. Users wishing to disable autocomplete can use this CSS: .ui-autocomplete { display: none !important: } or this Javascript: $("[data-autocomplete]").autocomplete("disable");
This commit is contained in:
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
* Removed the option to disable keyboard shortcuts.
|
* Removed the option to disable keyboard shortcuts.
|
||||||
|
|
||||||
|
* Removed the option to disable tag autocomplete.
|
||||||
|
|
||||||
## 2021-01-12
|
## 2021-01-12
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|||||||
@@ -289,8 +289,8 @@ module ApplicationHelper
|
|||||||
%i[
|
%i[
|
||||||
id name level level_string theme always_resize_images can_upload_free
|
id name level level_string theme always_resize_images can_upload_free
|
||||||
can_approve_posts disable_categorized_saved_searches
|
can_approve_posts disable_categorized_saved_searches
|
||||||
disable_mobile_gestures disable_post_tooltips enable_auto_complete
|
disable_mobile_gestures disable_post_tooltips enable_safe_mode
|
||||||
enable_safe_mode hide_deleted_posts show_deleted_children style_usernames
|
hide_deleted_posts show_deleted_children style_usernames
|
||||||
default_image_size
|
default_image_size
|
||||||
] + User::Roles.map { |role| :"is_#{role}?" }
|
] + User::Roles.map { |role| :"is_#{role}?" }
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,37 +10,35 @@ Autocomplete.TAG_PREFIXES = "-|~|" + Object.keys(Autocomplete.TAG_CATEGORIES).ma
|
|||||||
Autocomplete.MAX_RESULTS = 10;
|
Autocomplete.MAX_RESULTS = 10;
|
||||||
|
|
||||||
Autocomplete.initialize_all = function() {
|
Autocomplete.initialize_all = function() {
|
||||||
if (CurrentUser.data("enable-auto-complete")) {
|
$.widget("ui.autocomplete", $.ui.autocomplete, {
|
||||||
$.widget("ui.autocomplete", $.ui.autocomplete, {
|
options: {
|
||||||
options: {
|
delay: 0,
|
||||||
delay: 0,
|
minLength: 1,
|
||||||
minLength: 1,
|
autoFocus: false,
|
||||||
autoFocus: false,
|
focus: function() { return false; },
|
||||||
focus: function() { return false; },
|
},
|
||||||
},
|
_create: function() {
|
||||||
_create: function() {
|
this.element.on("keydown.Autocomplete.tab", null, "tab", Autocomplete.on_tab);
|
||||||
this.element.on("keydown.Autocomplete.tab", null, "tab", Autocomplete.on_tab);
|
this._super();
|
||||||
this._super();
|
},
|
||||||
},
|
_renderItem: Autocomplete.render_item,
|
||||||
_renderItem: Autocomplete.render_item,
|
search: function(value, event) {
|
||||||
search: function(value, event) {
|
if ($(this).data("ui-autocomplete")) {
|
||||||
if ($(this).data("ui-autocomplete")) {
|
$(this).data("ui-autocomplete").menu.bindings = $();
|
||||||
$(this).data("ui-autocomplete").menu.bindings = $();
|
}
|
||||||
}
|
this._super(value, event);
|
||||||
this._super(value, event);
|
},
|
||||||
},
|
});
|
||||||
});
|
|
||||||
|
|
||||||
this.initialize_tag_autocomplete();
|
this.initialize_tag_autocomplete();
|
||||||
this.initialize_mention_autocomplete($("form div.input.dtext textarea"));
|
this.initialize_mention_autocomplete($("form div.input.dtext textarea"));
|
||||||
this.initialize_fields($('[data-autocomplete="tag"]'), "tag");
|
this.initialize_fields($('[data-autocomplete="tag"]'), "tag");
|
||||||
this.initialize_fields($('[data-autocomplete="artist"]'), "artist");
|
this.initialize_fields($('[data-autocomplete="artist"]'), "artist");
|
||||||
this.initialize_fields($('[data-autocomplete="pool"]'), "pool");
|
this.initialize_fields($('[data-autocomplete="pool"]'), "pool");
|
||||||
this.initialize_fields($('[data-autocomplete="user"]'), "user");
|
this.initialize_fields($('[data-autocomplete="user"]'), "user");
|
||||||
this.initialize_fields($('[data-autocomplete="wiki-page"]'), "wiki_page");
|
this.initialize_fields($('[data-autocomplete="wiki-page"]'), "wiki_page");
|
||||||
this.initialize_fields($('[data-autocomplete="favorite-group"]'), "favorite_group");
|
this.initialize_fields($('[data-autocomplete="favorite-group"]'), "favorite_group");
|
||||||
this.initialize_fields($('[data-autocomplete="saved-search-label"]'), "saved_search_label");
|
this.initialize_fields($('[data-autocomplete="saved-search-label"]'), "saved_search_label");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Autocomplete.initialize_fields = function($fields, type) {
|
Autocomplete.initialize_fields = function($fields, type) {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import CurrentUser from './current_user'
|
|
||||||
import Post from './posts.js.erb'
|
import Post from './posts.js.erb'
|
||||||
import Utility from './utility'
|
import Utility from './utility'
|
||||||
|
|
||||||
@@ -77,9 +76,7 @@ PostModeMenu.initialize_edit_form = function() {
|
|||||||
|
|
||||||
PostModeMenu.close_edit_form = function() {
|
PostModeMenu.close_edit_form = function() {
|
||||||
$("#quick-edit-div").slideUp("fast");
|
$("#quick-edit-div").slideUp("fast");
|
||||||
if (CurrentUser.data("enable-auto-complete")) {
|
$("#post_tag_string").data("uiAutocomplete").close();
|
||||||
$("#post_tag_string").data("uiAutocomplete").close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PostModeMenu.initialize_tag_script_field = function() {
|
PostModeMenu.initialize_tag_script_field = function() {
|
||||||
|
|||||||
@@ -117,9 +117,7 @@ Post.open_edit_dialog = function() {
|
|||||||
of: window
|
of: window
|
||||||
},
|
},
|
||||||
drag: function(e, ui) {
|
drag: function(e, ui) {
|
||||||
if (CurrentUser.data("enable-auto-complete")) {
|
$tag_string.data("uiAutocomplete").close();
|
||||||
$tag_string.data("uiAutocomplete").close();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
close: Post.close_edit_dialog
|
close: Post.close_edit_dialog
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -698,7 +698,6 @@ class User < ApplicationRecord
|
|||||||
|
|
||||||
def initialize_attributes
|
def initialize_attributes
|
||||||
self.new_post_navigation_layout = true
|
self.new_post_navigation_layout = true
|
||||||
self.enable_auto_complete = true
|
|
||||||
self.always_resize_images = true
|
self.always_resize_images = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -45,11 +45,10 @@ class UserPolicy < ApplicationPolicy
|
|||||||
:blacklisted_tags, :time_zone, :per_page, :custom_style, :theme,
|
:blacklisted_tags, :time_zone, :per_page, :custom_style, :theme,
|
||||||
:receive_email_notifications, :always_resize_images,
|
:receive_email_notifications, :always_resize_images,
|
||||||
:new_post_navigation_layout, :enable_private_favorites,
|
:new_post_navigation_layout, :enable_private_favorites,
|
||||||
:hide_deleted_posts, :style_usernames, :enable_auto_complete,
|
:hide_deleted_posts, :style_usernames, :show_deleted_children,
|
||||||
:show_deleted_children, :disable_categorized_saved_searches,
|
:disable_categorized_saved_searches, :disable_tagged_filenames,
|
||||||
:disable_tagged_filenames, :disable_cropped_thumbnails,
|
:disable_cropped_thumbnails, :disable_mobile_gestures, :enable_safe_mode,
|
||||||
:disable_mobile_gestures, :enable_safe_mode, :enable_desktop_mode,
|
:enable_desktop_mode, :disable_post_tooltips,
|
||||||
:disable_post_tooltips,
|
|
||||||
].compact
|
].compact
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,6 @@
|
|||||||
<%= f.input :new_post_navigation_layout, :as => :select, :label => "Navigation bar position", :include_blank => false, :collection => [["Below", "true"], ["Above", "false"]], :hint => "When browsing pools or posts, place navigation links above or below the image" %>
|
<%= f.input :new_post_navigation_layout, :as => :select, :label => "Navigation bar position", :include_blank => false, :collection => [["Below", "true"], ["Above", "false"]], :hint => "When browsing pools or posts, place navigation links above or below the image" %>
|
||||||
<%= f.input :hide_deleted_posts, :as => :select, :label => "Deleted post filter", :hint => "Remove deleted posts from search results", :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %>
|
<%= f.input :hide_deleted_posts, :as => :select, :label => "Deleted post filter", :hint => "Remove deleted posts from search results", :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %>
|
||||||
<%= f.input :show_deleted_children, :as => :select, :label => "Show deleted children", :hint => "Show thumbnail borders on parent posts even if the children are deleted", :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %>
|
<%= f.input :show_deleted_children, :as => :select, :label => "Show deleted children", :hint => "Show thumbnail borders on parent posts even if the children are deleted", :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %>
|
||||||
<%= f.input :enable_auto_complete, :as => :select, :hint => "Enable tag autocomplete in the search box", :collection => [["Yes", "true"], ["No", "false"]], :include_blank => false %>
|
|
||||||
<%= f.input :disable_categorized_saved_searches, :hint => "Don't show dialog box when creating a new saved search", :as => :select, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
|
<%= f.input :disable_categorized_saved_searches, :hint => "Don't show dialog box when creating a new saved search", :as => :select, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
|
||||||
<%= f.input :enable_private_favorites, :as => :select, :hint => "Make your favorites private", :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
|
<%= f.input :enable_private_favorites, :as => :select, :hint => "Make your favorites private", :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
|
||||||
<%= f.input :disable_tagged_filenames, :as => :select, :hint => "Don't include tags in image filenames", :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
|
<%= f.input :disable_tagged_filenames, :as => :select, :hint => "Don't include tags in image filenames", :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
|
||||||
|
|||||||
Reference in New Issue
Block a user