Move JS libraries to vendor/javascript

The silly motivation is that I wanted to remove `.prettierignore`,
which just exists to omit that one folder from `npm run format`. But it
also seems like this is the standard place to put them—a standard
created long after we first set this up lol
This commit is contained in:
Emi Matchu 2024-09-13 21:16:46 -07:00
parent 0a5d369735
commit 5bf2ef42a0
16 changed files with 14 additions and 12 deletions

View file

@ -1 +0,0 @@
/app/assets/javascripts/lib

View file

@ -1,5 +1,6 @@
//= link_tree ../images
//= link_tree ../javascripts .js
//= link_tree ../../../vendor/javascript .js
//= link_tree ../stylesheets .css
//= link_directory ../fonts .otf
//= link_tree ../builds

View file

@ -24,8 +24,8 @@ class SwfAssetsController < ApplicationController
policy.script_src -> {
src_list(
helpers.javascript_url("lib/easeljs.min"),
helpers.javascript_url("lib/tweenjs.min"),
helpers.javascript_url("easeljs.min"),
helpers.javascript_url("tweenjs.min"),
helpers.javascript_url("swf_assets/show"),
@swf_asset.canvas_movie_library_url,
)

View file

@ -152,7 +152,7 @@
- content_for :javascripts do
= include_javascript_libraries :jquery, :jquery_tmpl
= javascript_include_tag 'ajax_auth', 'lib/jquery.ui', 'lib/jquery.jgrowl',
= javascript_include_tag 'ajax_auth', 'jquery.ui', 'jquery.jgrowl',
defer: true
- content_for :javascripts_body do
@ -167,4 +167,4 @@
%meta{
name: "trade-matches-wants",
value: @items.select(&:wanted?).map(&:id).join(",")
}
}

View file

@ -126,6 +126,6 @@
= page_stylesheet_link_tag "items/show"
- content_for :javascripts do
= javascript_include_tag "lib/idiomorph", async: true
= javascript_include_tag "idiomorph", async: true
= javascript_include_tag "outfit-viewer", async: true
= javascript_include_tag "items/show", async: true

View file

@ -130,7 +130,7 @@
- content_for :javascripts do
= include_javascript_libraries :jquery, :jquery_tmpl
= javascript_include_tag 'ajax_auth', 'lib/jquery.timeago', defer: true
= javascript_include_tag 'ajax_auth', 'jquery.timeago', defer: true
- content_for :javascripts_body do
= javascript_include_tag 'outfits/new', defer: true

View file

@ -21,8 +21,8 @@
-# Load the scripts: EaselJS libs first, then the asset's "library" file,
-# then our page script that starts the movie.
= javascript_include_tag "lib/easeljs.min", defer: true, debug: false
= javascript_include_tag "lib/tweenjs.min", defer: true, debug: false
= javascript_include_tag "easeljs.min", defer: true, debug: false
= javascript_include_tag "tweenjs.min", defer: true, debug: false
= javascript_include_tag @swf_asset.canvas_movie_library_url, defer: true,
id: "canvas-movie-library"
= javascript_include_tag "swf_assets/show", defer: true, debug: false
@ -33,4 +33,4 @@
-# the browser won't bother to load it if it's not used.
= image_tag @swf_asset.image_url, id: "fallback", alt: "", loading: "lazy"
- else
= image_tag @swf_asset.image_url, alt: "", id: "asset-image"
= image_tag @swf_asset.image_url, alt: "", id: "asset-image"

View file

@ -57,7 +57,6 @@ module OpenneoImpressItems
config.assets.enabled = true
config.assets.version = '1.0'
config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
config.assets.precompile << '*.js'
config.assets.initialize_on_precompile = false
config.assets.css_compressor = nil # Sass's compressor can't handle all modern CSS…

View file

@ -4,7 +4,10 @@
Rails.application.config.assets.version = "1.0"
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
Rails.application.config.assets.paths += [
Rails.root.join('app', 'assets', 'fonts'),
Rails.root.join('vendor', 'javascript'),
]
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets