Compare commits
8 commits
359f368d80
...
fff8079a63
| Author | SHA1 | Date | |
|---|---|---|---|
| fff8079a63 | |||
| 08a64d4987 | |||
| dd2f6be79f | |||
| 6aff39dfed | |||
| 5f342ae0ee | |||
| e9235d0b40 | |||
| 790f8a3016 | |||
| d0c8c9d9c0 |
14 changed files with 33 additions and 33 deletions
14
Gemfile
14
Gemfile
|
|
@ -11,11 +11,11 @@ gem 'mysql2', '~> 0.5.5'
|
||||||
|
|
||||||
# For reading the .env file, which you can use in development to more easily
|
# For reading the .env file, which you can use in development to more easily
|
||||||
# set environment variables for secret data.
|
# set environment variables for secret data.
|
||||||
gem 'dotenv-rails', '~> 2.8', '>= 2.8.1'
|
gem 'dotenv', '~> 3.2'
|
||||||
|
|
||||||
# For the asset pipeline: templates, CSS, JS, etc.
|
# For the asset pipeline: templates, CSS, JS, etc.
|
||||||
gem 'sprockets', '~> 4.2'
|
gem 'sprockets', '~> 4.2'
|
||||||
gem 'haml', '~> 6.1', '>= 6.1.1'
|
gem 'haml', '~> 7.2'
|
||||||
gem 'sass-rails', '~> 6.0'
|
gem 'sass-rails', '~> 6.0'
|
||||||
gem 'terser', '~> 1.1', '>= 1.1.17'
|
gem 'terser', '~> 1.1', '>= 1.1.17'
|
||||||
gem 'jsbundling-rails', '~> 1.3'
|
gem 'jsbundling-rails', '~> 1.3'
|
||||||
|
|
@ -74,7 +74,7 @@ end
|
||||||
gem 'bootsnap', '~> 1.16', require: false
|
gem 'bootsnap', '~> 1.16', require: false
|
||||||
|
|
||||||
# For investigating performance issues.
|
# For investigating performance issues.
|
||||||
gem "rack-mini-profiler", "~> 3.1"
|
gem 'rack-mini-profiler', '~> 4.0', '>= 4.0.1'
|
||||||
gem "memory_profiler", "~> 1.0"
|
gem "memory_profiler", "~> 1.0"
|
||||||
gem "stackprof", "~> 0.2.25"
|
gem "stackprof", "~> 0.2.25"
|
||||||
|
|
||||||
|
|
@ -86,9 +86,5 @@ gem "sentry-rails", "~> 5.12"
|
||||||
gem "shell", "~> 0.8.1"
|
gem "shell", "~> 0.8.1"
|
||||||
|
|
||||||
# For automated tests.
|
# For automated tests.
|
||||||
group :development, :test do
|
gem 'rspec-rails', '~> 8.0', '>= 8.0.2', group: [:development, :test]
|
||||||
gem "rspec-rails", "~> 7.0"
|
gem "webmock", "~> 3.24", group: [:test]
|
||||||
end
|
|
||||||
group :test do
|
|
||||||
gem "webmock", "~> 3.24"
|
|
||||||
end
|
|
||||||
|
|
|
||||||
25
Gemfile.lock
25
Gemfile.lock
|
|
@ -143,10 +143,7 @@ GEM
|
||||||
devise-encryptable (0.2.0)
|
devise-encryptable (0.2.0)
|
||||||
devise (>= 2.1.0)
|
devise (>= 2.1.0)
|
||||||
diff-lcs (1.6.2)
|
diff-lcs (1.6.2)
|
||||||
dotenv (2.8.1)
|
dotenv (3.2.0)
|
||||||
dotenv-rails (2.8.1)
|
|
||||||
dotenv (= 2.8.1)
|
|
||||||
railties (>= 3.2)
|
|
||||||
drb (2.2.3)
|
drb (2.2.3)
|
||||||
e2mmap (0.1.0)
|
e2mmap (0.1.0)
|
||||||
email_validator (2.2.4)
|
email_validator (2.2.4)
|
||||||
|
|
@ -184,7 +181,7 @@ GEM
|
||||||
fiber-storage (1.0.1)
|
fiber-storage (1.0.1)
|
||||||
globalid (1.3.0)
|
globalid (1.3.0)
|
||||||
activesupport (>= 6.1)
|
activesupport (>= 6.1)
|
||||||
haml (6.4.0)
|
haml (7.2.0)
|
||||||
temple (>= 0.8.2)
|
temple (>= 0.8.2)
|
||||||
thor
|
thor
|
||||||
tilt
|
tilt
|
||||||
|
|
@ -310,7 +307,7 @@ GEM
|
||||||
rack (3.2.4)
|
rack (3.2.4)
|
||||||
rack-attack (6.8.0)
|
rack-attack (6.8.0)
|
||||||
rack (>= 1.0, < 4)
|
rack (>= 1.0, < 4)
|
||||||
rack-mini-profiler (3.3.1)
|
rack-mini-profiler (4.0.1)
|
||||||
rack (>= 1.2.0)
|
rack (>= 1.2.0)
|
||||||
rack-oauth2 (2.3.0)
|
rack-oauth2 (2.3.0)
|
||||||
activesupport
|
activesupport
|
||||||
|
|
@ -383,10 +380,10 @@ GEM
|
||||||
rspec-mocks (3.13.7)
|
rspec-mocks (3.13.7)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.13.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-rails (7.1.1)
|
rspec-rails (8.0.2)
|
||||||
actionpack (>= 7.0)
|
actionpack (>= 7.2)
|
||||||
activesupport (>= 7.0)
|
activesupport (>= 7.2)
|
||||||
railties (>= 7.0)
|
railties (>= 7.2)
|
||||||
rspec-core (~> 3.13)
|
rspec-core (~> 3.13)
|
||||||
rspec-expectations (~> 3.13)
|
rspec-expectations (~> 3.13)
|
||||||
rspec-mocks (~> 3.13)
|
rspec-mocks (~> 3.13)
|
||||||
|
|
@ -493,9 +490,9 @@ DEPENDENCIES
|
||||||
debug (~> 1.9.2)
|
debug (~> 1.9.2)
|
||||||
devise (~> 4.9, >= 4.9.2)
|
devise (~> 4.9, >= 4.9.2)
|
||||||
devise-encryptable (~> 0.2.0)
|
devise-encryptable (~> 0.2.0)
|
||||||
dotenv-rails (~> 2.8, >= 2.8.1)
|
dotenv (~> 3.2)
|
||||||
falcon (~> 0.48.0)
|
falcon (~> 0.48.0)
|
||||||
haml (~> 6.1, >= 6.1.1)
|
haml (~> 7.2)
|
||||||
http_accept_language (~> 2.1, >= 2.1.1)
|
http_accept_language (~> 2.1, >= 2.1.1)
|
||||||
jsbundling-rails (~> 1.3)
|
jsbundling-rails (~> 1.3)
|
||||||
letter_opener (~> 1.8, >= 1.8.1)
|
letter_opener (~> 1.8, >= 1.8.1)
|
||||||
|
|
@ -506,11 +503,11 @@ DEPENDENCIES
|
||||||
omniauth-rails_csrf_protection (~> 2.0, >= 2.0.1)
|
omniauth-rails_csrf_protection (~> 2.0, >= 2.0.1)
|
||||||
omniauth_openid_connect (~> 0.7.1)
|
omniauth_openid_connect (~> 0.7.1)
|
||||||
rack-attack (~> 6.7)
|
rack-attack (~> 6.7)
|
||||||
rack-mini-profiler (~> 3.1)
|
rack-mini-profiler (~> 4.0, >= 4.0.1)
|
||||||
rails (~> 8.0, >= 8.0.1)
|
rails (~> 8.0, >= 8.0.1)
|
||||||
rails-i18n (~> 8.0, >= 8.0.1)
|
rails-i18n (~> 8.0, >= 8.0.1)
|
||||||
rdiscount (~> 2.2, >= 2.2.7.1)
|
rdiscount (~> 2.2, >= 2.2.7.1)
|
||||||
rspec-rails (~> 7.0)
|
rspec-rails (~> 8.0, >= 8.0.2)
|
||||||
ruby-vips (~> 2.2)
|
ruby-vips (~> 2.2)
|
||||||
sanitize (~> 7.0)
|
sanitize (~> 7.0)
|
||||||
sass-rails (~> 6.0)
|
sass-rails (~> 6.0)
|
||||||
|
|
|
||||||
|
|
@ -150,13 +150,13 @@ function updateStage() {
|
||||||
|
|
||||||
function updateCanvasDimensions() {
|
function updateCanvasDimensions() {
|
||||||
// Set the canvas's internal dimensions to be higher, if the device has high
|
// Set the canvas's internal dimensions to be higher, if the device has high
|
||||||
// DPI. Scale the movie clip to match, too.
|
// DPI. Scale the stage to match, too.
|
||||||
const internalWidth = canvas.offsetWidth * window.devicePixelRatio;
|
const internalWidth = canvas.offsetWidth * window.devicePixelRatio;
|
||||||
const internalHeight = canvas.offsetHeight * window.devicePixelRatio;
|
const internalHeight = canvas.offsetHeight * window.devicePixelRatio;
|
||||||
canvas.width = internalWidth;
|
canvas.width = internalWidth;
|
||||||
canvas.height = internalHeight;
|
canvas.height = internalHeight;
|
||||||
movieClip.scaleX = internalWidth / library.properties.width;
|
stage.scaleX = internalWidth / library.properties.width;
|
||||||
movieClip.scaleY = internalHeight / library.properties.height;
|
stage.scaleY = internalHeight / library.properties.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener("resize", () => {
|
window.addEventListener("resize", () => {
|
||||||
|
|
@ -176,23 +176,28 @@ window.addEventListener("resize", () => {
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
|
|
||||||
async function startMovie() {
|
async function startMovie() {
|
||||||
|
// Install the MotionGuidePlugin, which is needed for motion path animations.
|
||||||
|
createjs.MotionGuidePlugin.install();
|
||||||
|
|
||||||
// Load the movie's library (from the JS file already run), and use it to
|
// Load the movie's library (from the JS file already run), and use it to
|
||||||
// build a movie clip.
|
// build a movie clip.
|
||||||
library = await getLibrary();
|
library = await getLibrary();
|
||||||
movieClip = buildMovieClip(library);
|
movieClip = buildMovieClip(library);
|
||||||
|
|
||||||
updateCanvasDimensions();
|
|
||||||
|
|
||||||
if (canvas.getContext("2d") == null) {
|
if (canvas.getContext("2d") == null) {
|
||||||
console.warn(`Out of memory, can't use canvas for ${libraryUrl}.`);
|
console.warn(`Out of memory, can't use canvas for ${libraryUrl}.`);
|
||||||
// TODO: "Too many animations!"
|
// TODO: "Too many animations!"
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
stage = new window.createjs.Stage(canvas);
|
stage = new library.Stage(canvas);
|
||||||
stage.addChild(movieClip);
|
stage.addChild(movieClip);
|
||||||
|
updateCanvasDimensions();
|
||||||
updateStage();
|
updateStage();
|
||||||
|
|
||||||
|
// Signal to the library that the composition is ready.
|
||||||
|
AdobeAn.compositionLoaded(library.properties.id);
|
||||||
|
|
||||||
loadingStatus = "loaded";
|
loadingStatus = "loaded";
|
||||||
canvas.setAttribute("data-status", "loaded");
|
canvas.setAttribute("data-status", "loaded");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,9 @@ class ApplicationController < ActionController::Base
|
||||||
before_action :save_return_to_path,
|
before_action :save_return_to_path,
|
||||||
if: ->(c) { c.controller_name == 'sessions' && c.action_name == 'new' }
|
if: ->(c) { c.controller_name == 'sessions' && c.action_name == 'new' }
|
||||||
|
|
||||||
# Enable profiling tools if logged in as admin.
|
# Enable profiling tools in development or when logged in as an admin.
|
||||||
before_action do
|
before_action do
|
||||||
if current_user && current_user.admin?
|
Rack::MiniProfiler.authorize_request if Rails.env.development? || current_user&.admin?
|
||||||
Rack::MiniProfiler.authorize_request
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class AccessDenied < StandardError; end
|
class AccessDenied < StandardError; end
|
||||||
|
|
|
||||||
|
|
@ -390,6 +390,10 @@ export function loadMovieLibrary(librarySrc, { preferArchive = false } = {}) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
delete window.AdobeAn.compositions[compositionId];
|
delete window.AdobeAn.compositions[compositionId];
|
||||||
|
|
||||||
|
// Install the MotionGuidePlugin, which is needed for motion path animations.
|
||||||
|
window.createjs.MotionGuidePlugin.install();
|
||||||
|
|
||||||
const library = composition.getLibrary();
|
const library = composition.getLibrary();
|
||||||
|
|
||||||
// One more loading step as part of loading this library is loading the
|
// One more loading step as part of loading this library is loading the
|
||||||
|
|
|
||||||
BIN
vendor/cache/dotenv-2.8.1.gem
vendored
BIN
vendor/cache/dotenv-2.8.1.gem
vendored
Binary file not shown.
BIN
vendor/cache/dotenv-3.2.0.gem
vendored
Normal file
BIN
vendor/cache/dotenv-3.2.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/dotenv-rails-2.8.1.gem
vendored
BIN
vendor/cache/dotenv-rails-2.8.1.gem
vendored
Binary file not shown.
BIN
vendor/cache/haml-6.4.0.gem
vendored
BIN
vendor/cache/haml-6.4.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/haml-7.2.0.gem
vendored
Normal file
BIN
vendor/cache/haml-7.2.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/rack-mini-profiler-3.3.1.gem
vendored
BIN
vendor/cache/rack-mini-profiler-3.3.1.gem
vendored
Binary file not shown.
BIN
vendor/cache/rack-mini-profiler-4.0.1.gem
vendored
Normal file
BIN
vendor/cache/rack-mini-profiler-4.0.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/rspec-rails-7.1.1.gem
vendored
BIN
vendor/cache/rspec-rails-7.1.1.gem
vendored
Binary file not shown.
BIN
vendor/cache/rspec-rails-8.0.2.gem
vendored
Normal file
BIN
vendor/cache/rspec-rails-8.0.2.gem
vendored
Normal file
Binary file not shown.
Loading…
Reference in a new issue