js: reorganize Javascript file structure.
Move Javascript files from app/components/**/*.js back to app/javascript/src/javascripts/*.js. This way Javascript files are in one place, which simplifies import paths and makes it easier to see all Javascript at once.
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
class SourceDataComponent {
|
||||
static initialize() {
|
||||
$(document).on("click.danbooru", ".source-data-fetch", SourceDataComponent.fetchData);
|
||||
}
|
||||
|
||||
static async fetchData(e) {
|
||||
let url = $("#post_source").val();
|
||||
let ref = $("#post_referer_url").val();
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
if (/^https?:\/\//.test(url)) {
|
||||
$(".source-data").addClass("loading");
|
||||
await $.get("/source.js", { url: url, ref: ref });
|
||||
$(".source-data").removeClass("loading");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(SourceDataComponent.initialize);
|
||||
|
||||
export default SourceDataComponent;
|
||||
Reference in New Issue
Block a user