Compare commits

..

No commits in common. "fff8079a631ad40c5c81b43caa2e0aadb8d46eeb" and "359f368d80b95c5e5b21a5f3bc8f2efecef8c1e0" have entirely different histories.

14 changed files with 33 additions and 33 deletions

14
Gemfile
View file

@ -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', '~> 3.2' gem 'dotenv-rails', '~> 2.8', '>= 2.8.1'
# 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', '~> 7.2' gem 'haml', '~> 6.1', '>= 6.1.1'
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', '~> 4.0', '>= 4.0.1' gem "rack-mini-profiler", "~> 3.1"
gem "memory_profiler", "~> 1.0" gem "memory_profiler", "~> 1.0"
gem "stackprof", "~> 0.2.25" gem "stackprof", "~> 0.2.25"
@ -86,5 +86,9 @@ gem "sentry-rails", "~> 5.12"
gem "shell", "~> 0.8.1" gem "shell", "~> 0.8.1"
# For automated tests. # For automated tests.
gem 'rspec-rails', '~> 8.0', '>= 8.0.2', group: [:development, :test] group :development, :test do
gem "webmock", "~> 3.24", group: [:test] gem "rspec-rails", "~> 7.0"
end
group :test do
gem "webmock", "~> 3.24"
end

View file

@ -143,7 +143,10 @@ 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 (3.2.0) dotenv (2.8.1)
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)
@ -181,7 +184,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 (7.2.0) haml (6.4.0)
temple (>= 0.8.2) temple (>= 0.8.2)
thor thor
tilt tilt
@ -307,7 +310,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 (4.0.1) rack-mini-profiler (3.3.1)
rack (>= 1.2.0) rack (>= 1.2.0)
rack-oauth2 (2.3.0) rack-oauth2 (2.3.0)
activesupport activesupport
@ -380,10 +383,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 (8.0.2) rspec-rails (7.1.1)
actionpack (>= 7.2) actionpack (>= 7.0)
activesupport (>= 7.2) activesupport (>= 7.0)
railties (>= 7.2) railties (>= 7.0)
rspec-core (~> 3.13) rspec-core (~> 3.13)
rspec-expectations (~> 3.13) rspec-expectations (~> 3.13)
rspec-mocks (~> 3.13) rspec-mocks (~> 3.13)
@ -490,9 +493,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 (~> 3.2) dotenv-rails (~> 2.8, >= 2.8.1)
falcon (~> 0.48.0) falcon (~> 0.48.0)
haml (~> 7.2) haml (~> 6.1, >= 6.1.1)
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)
@ -503,11 +506,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 (~> 4.0, >= 4.0.1) rack-mini-profiler (~> 3.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 (~> 8.0, >= 8.0.2) rspec-rails (~> 7.0)
ruby-vips (~> 2.2) ruby-vips (~> 2.2)
sanitize (~> 7.0) sanitize (~> 7.0)
sass-rails (~> 6.0) sass-rails (~> 6.0)

View file

@ -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 stage to match, too. // DPI. Scale the movie clip 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;
stage.scaleX = internalWidth / library.properties.width; movieClip.scaleX = internalWidth / library.properties.width;
stage.scaleY = internalHeight / library.properties.height; movieClip.scaleY = internalHeight / library.properties.height;
} }
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
@ -176,28 +176,23 @@ 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 library.Stage(canvas); stage = new window.createjs.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");

View file

@ -12,9 +12,11 @@ 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 in development or when logged in as an admin. # Enable profiling tools if logged in as admin.
before_action do before_action do
Rack::MiniProfiler.authorize_request if Rails.env.development? || current_user&.admin? if current_user && current_user.admin?
Rack::MiniProfiler.authorize_request
end
end end
class AccessDenied < StandardError; end class AccessDenied < StandardError; end

View file

@ -390,10 +390,6 @@ 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 Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/dotenv-rails-2.8.1.gem vendored Normal file

Binary file not shown.

BIN
vendor/cache/haml-6.4.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/rspec-rails-7.1.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.