mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Added autocompletion
This commit is contained in:
27
public_html/js/Services/TagList.js
Normal file
27
public_html/js/Services/TagList.js
Normal file
@ -0,0 +1,27 @@
|
||||
var App = App || {};
|
||||
App.Services = App.Services || {};
|
||||
|
||||
App.Services.TagList = function(jQuery) {
|
||||
var tags = [];
|
||||
|
||||
jQuery.ajax({
|
||||
success: function(data, textStatus, xhr) {
|
||||
tags = data;
|
||||
},
|
||||
error: function(xhr, textStatus, errorThrown) {
|
||||
console.log(new Error(errorThrown));
|
||||
},
|
||||
type: 'GET',
|
||||
url: '/data/tags.json',
|
||||
});
|
||||
|
||||
function getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
return {
|
||||
getTags: getTags,
|
||||
};
|
||||
};
|
||||
|
||||
App.DI.registerSingleton('tagList', ['jQuery'], App.Services.TagList);
|
Reference in New Issue
Block a user