FEATURE: Multi-file javascript support for themes (#7526)

You can now add javascript files under `/javascripts/*` in a theme, and they will be loaded as if they were included in core, or a plugin. If you give something the same name as a core/plugin file, it will be overridden. Support file extensions are `.js.es6`, `.hbs` and `.raw.hbs`.
This commit is contained in:
David Taylor
2019-06-03 10:41:00 +01:00
committed by GitHub
parent ba3bc6b2fe
commit 7500eed4c0
10 changed files with 156 additions and 14 deletions

View File

@ -1,6 +1,7 @@
# frozen_string_literal: true
class JavascriptCache < ActiveRecord::Base
belongs_to :theme_field
belongs_to :theme
validate :content_cannot_be_nil
@ -26,14 +27,21 @@ end
# Table name: javascript_caches
#
# id :bigint not null, primary key
# theme_field_id :bigint not null
# theme_field_id :bigint
# digest :string
# content :text not null
# created_at :datetime not null
# updated_at :datetime not null
# theme_id :bigint
#
# Indexes
#
# index_javascript_caches_on_digest (digest)
# index_javascript_caches_on_theme_field_id (theme_field_id)
# index_javascript_caches_on_theme_id (theme_id)
#
# Foreign Keys
#
# fk_rails_... (theme_field_id => theme_fields.id) ON DELETE => cascade
# fk_rails_... (theme_id => themes.id) ON DELETE => cascade
#