Merge branch 'master' into feat-eslint
This commit is contained in:
@@ -246,9 +246,7 @@ Autocomplete.initialize_wiki_autocomplete = function($fields) {
|
||||
};
|
||||
|
||||
Autocomplete.normal_source = function(term, resp) {
|
||||
if (Utility.is_global_hook_defined("Danbooru.Autocomplete.normal_source")) {
|
||||
return window.Danbooru.Autocomplete.normal_source(term, resp);
|
||||
}
|
||||
var key = "ac-" + term.replace(/\./g,'\uFFFF');
|
||||
|
||||
return $.ajax({
|
||||
url: "/tags/autocomplete.json",
|
||||
@@ -435,10 +433,6 @@ Autocomplete.static_metatag_source = function(term, resp, metatag) {
|
||||
}
|
||||
|
||||
Autocomplete.user_source = function(term, resp, metatag) {
|
||||
if (Utility.is_global_hook_defined("Danbooru.Autocomplete.user_source")) {
|
||||
return window.Danbooru.Autocomplete.user_source(term, resp, metatag);
|
||||
}
|
||||
|
||||
return $.ajax({
|
||||
url: "/users.json",
|
||||
data: {
|
||||
@@ -473,10 +467,6 @@ Autocomplete.user_source = function(term, resp, metatag) {
|
||||
}
|
||||
|
||||
Autocomplete.pool_source = function(term, resp, metatag) {
|
||||
if (Utility.is_global_hook_defined("Danbooru.Autocomplete.pool_source")) {
|
||||
return window.Danbooru.Autocomplete.pool_source(term, resp, metatag);
|
||||
}
|
||||
|
||||
return $.ajax({
|
||||
url: "/pools.json",
|
||||
data: {
|
||||
@@ -500,10 +490,6 @@ Autocomplete.pool_source = function(term, resp, metatag) {
|
||||
}
|
||||
|
||||
Autocomplete.favorite_group_source = function(term, resp, metatag) {
|
||||
if (Utility.is_global_hook_defined("Danbooru.Autocomplete.favorite_group_source")) {
|
||||
return window.Danbooru.Autocomplete.favorite_group_source(term, resp, metatag);
|
||||
}
|
||||
|
||||
return $.ajax({
|
||||
url: "/favorite_groups.json",
|
||||
data: {
|
||||
@@ -524,10 +510,6 @@ Autocomplete.favorite_group_source = function(term, resp, metatag) {
|
||||
}
|
||||
|
||||
Autocomplete.saved_search_source = function(term, resp) {
|
||||
if (Utility.is_global_hook_defined("Danbooru.Autocomplete.saved_search_source")) {
|
||||
return window.Danbooru.Autocomplete.saved_search_source(term, resp);
|
||||
}
|
||||
|
||||
return SavedSearch.labels(term).then(function(labels) {
|
||||
resp(labels.map(function(label) {
|
||||
return {
|
||||
@@ -541,3 +523,6 @@ Autocomplete.saved_search_source = function(term, resp) {
|
||||
$(document).ready(function() {
|
||||
Autocomplete.initialize_all();
|
||||
});
|
||||
|
||||
export default Autocomplete;
|
||||
|
||||
|
||||
@@ -122,18 +122,6 @@ Utility.sorttable = function(table) {
|
||||
});
|
||||
};
|
||||
|
||||
Utility.is_global_hook_defined = function(path) {
|
||||
let objs = path.split(/\./g);
|
||||
let obj = window;
|
||||
objs.forEach(x => {
|
||||
if (obj) {
|
||||
obj = obj[x]
|
||||
}
|
||||
});
|
||||
|
||||
return typeof obj === 'function';
|
||||
}
|
||||
|
||||
$.fn.selectRange = function(start, end) {
|
||||
return this.each(function() {
|
||||
if (this.setSelectionRange) {
|
||||
|
||||
Reference in New Issue
Block a user