diff --git a/.circleci/config.yml b/.circleci/config.yml index aa02b113da..fc4cead7a9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: build: docker: # Primary container image where all steps run. - - image: avalonmediasystem/avalon:7.5.0-dev-ruby3 + - image: avalonmediasystem/avalon:develop environment: - DATABASE_URL=postgresql://postgres@localhost:5432/postgres - FEDORA_URL=http://localhost:8080/fcrepo/rest @@ -21,7 +21,7 @@ jobs: environment: CATALINA_OPTS: '-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC' - image: zookeeper:3.4 - - image: solr:8-slim + - image: solr:9 environment: VERBOSE: yes SECURITY_JSON: '{"authentication":{"blockUnknown": false, "class":"solr.BasicAuthPlugin", "credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="}, "realm":"My Solr users", "forwardCredentials": false}, "authorization":{ "class":"solr.RuleBasedAuthorizationPlugin", "permissions":[{"name":"security-edit", "role":"admin"}], "user-role":{"solr":"admin"}}}' @@ -100,7 +100,7 @@ jobs: fi zip -1 -r solr_conf.zip ./* curl -H "Content-type:application/octet-stream" --data-binary @solr_conf.zip "http://solr:SolrRocks@127.0.0.1:<< parameters.solr_port >>/solr/admin/configs?action=UPLOAD&name=solrconfig" - curl -H 'Content-type: application/json' http://solr:SolrRocks@127.0.0.1:<< parameters.solr_port >>/api/collections/ -d '{create: {name: << parameters.core_name >>, config: solrconfig, numShards: 1}}' + curl "http://solr:SolrRocks@127.0.0.1:<< parameters.solr_port >>/solr/admin/collections?action=CREATE&name=hydra-test&numShards=1&collection.configName=solrconfig" - run: command: | @@ -113,11 +113,11 @@ jobs: # Pull in the parallel_rspec step and modify it to ensure that test results get stored # - samvera/parallel_rspec + - run: mkdir /tmp/test-results - run: name: Run rspec in parallel command: | - mkdir /tmp/test-results - bundle exec rspec --format progress --format RspecJunitFormatter -o /tmp/test-results/rspec.xml $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) + circleci tests glob "spec/**/*_spec.rb" | circleci tests run --command="xargs bundle exec rspec --format progress --format RspecJunitFormatter -o /tmp/test-results/rspec.xml" --verbose --split-by=timings # collect reports - store_test_results: path: /tmp/test-results diff --git a/.github/workflows/podman-image.yml b/.github/workflows/podman-image.yml new file mode 100644 index 0000000000..bce6d1937c --- /dev/null +++ b/.github/workflows/podman-image.yml @@ -0,0 +1,84 @@ +# Builds image and stores in ghcr.io then sends webhook to deploy new image +name: Podman Image CI + +on: + push: + branches: [ "main", "staging", "develop", "sandbox" ] + +env: + GHCR_USER: ${{ github.actor }} + GHCR_PASSWORD: ${{ github.token }} + GHCR_IMAGE_REGISTRY: ghcr.io/avalonmediasystem + DOCKERHUB_IMAGE_REGISTRY: docker.io/avalonmediasystem + DOCKERHUB_USER: ${{ secrets.dockerhub_user }} + DOCKERHUB_PASSWORD: ${{ secrets.dockerhub_password }} + IMAGE_TAG: ${{ fromJSON('{"refs/heads/main":"production","refs/heads/develop":"develop","refs/heads/staging":"staging","refs/heads/sandbox":"sandbox"}')[github.ref] }} + BRANCH: ${{ fromJSON('{"refs/heads/main":"main","refs/heads/develop":"develop","refs/heads/staging":"staging","refs/heads/sandbox":"sandbox"}')[github.ref] }} + BUILD_TARGET: ${{ fromJSON('{"refs/heads/main":"prod","refs/heads/develop":"dev","refs/heads/staging":"prod","refs/heads/sandbox":"prod"}')[github.ref] }} + +jobs: + + build: + runs-on: ubuntu-latest + + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: false + docker-images: false + swap-storage: false + - uses: actions/checkout@v3 + - name: Determine DockerHub image tags + id: determine_dockerhub_tags + run: | + AVALON_VERSION=`script/avalon_image_tags.rb -t` + echo "AVALON_VERSION=${AVALON_VERSION}" >> "$GITHUB_OUTPUT" + if [ $IMAGE_TAG = 'develop' ]; then + AVALON_TAGS=`script/avalon_image_tags.rb --branch ${BRANCH} -a ${AVALON_VERSION}-dev | awk 'gsub(","," ")'` + elif [ $IMAGE_TAG = 'production' ]; then + AVALON_TAGS=`script/avalon_image_tags.rb -s -t -a latest | awk 'gsub(","," ")'` + else + AVALON_TAGS="" + fi + echo "tags=${AVALON_TAGS}" >> "$GITHUB_OUTPUT" + echo "Will pushing to DockerHub with tags: ${AVALON_TAGS}" + - name: Build Image + id: build_image + uses: redhat-actions/buildah-build@v2 + with: + image: avalon + tags: ${{ env.IMAGE_TAG }} ${{ github.sha }} ${{ steps.determine_dockerhub_tags.outputs.tags }} + containerfiles: ./Dockerfile + oci: true + extra-args: --target ${{ env.BUILD_TARGET }} + - name: Push To GHCR + uses: redhat-actions/push-to-registry@v2 + with: + image: ${{ steps.build_image.outputs.image }} + tags: ${{ env.IMAGE_TAG }} ${{ github.sha }} + registry: ${{ env.GHCR_IMAGE_REGISTRY }} + username: ${{ env.GHCR_USER }} + password: ${{ env.GHCR_PASSWORD }} + extra-args: | + --disable-content-trust + - name: Push To Dockerhub + if: ${{ steps.determine_dockerhub_tags.outputs.tags != '' }} + uses: redhat-actions/push-to-registry@v2 + with: + image: ${{ steps.build_image.outputs.image }} + tags: ${{ steps.determine_dockerhub_tags.outputs.tags }} + registry: ${{ env.DOCKERHUB_IMAGE_REGISTRY }} + username: ${{ env.DOCKERHUB_USER }} + password: ${{ env.DOCKERHUB_PASSWORD }} + extra-args: | + --disable-content-trust diff --git a/Dockerfile b/Dockerfile index 2d46bfb7bf..45119f25e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,8 +52,10 @@ LABEL project=avalon RUN echo "deb http://ftp.us.debian.org/debian/ bullseye main contrib non-free" > /etc/apt/sources.list.d/bullseye.list \ && echo "deb-src http://ftp.us.debian.org/debian/ bullseye main contrib non-free" >> /etc/apt/sources.list.d/bullseye.list \ && cat /etc/apt/sources.list.d/bullseye.list \ - && apt-get update && apt-get install -y --no-install-recommends curl gnupg2 ffmpeg \ - && curl -sL http://deb.nodesource.com/setup_14.x | bash - \ + && mkdir -p /etc/apt/keyrings \ + && apt-get update && apt-get install -y --no-install-recommends curl ca-certificates gnupg2 ffmpeg \ + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \ && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ && echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && cat /etc/apt/sources.list.d/nodesource.list \ @@ -111,7 +113,7 @@ RUN bundle config set --local without 'development test' \ # Install node modules -FROM node:12-bullseye-slim as node-modules +FROM node:20-bullseye-slim as node-modules LABEL stage=build LABEL project=avalon RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates @@ -131,7 +133,6 @@ COPY --from=node-modules --chown=app:app /node_modules ./node_modules USER app ENV RAILS_ENV=production -RUN SECRET_KEY_BASE=$(ruby -r 'securerandom' -e 'puts SecureRandom.hex(64)') bundle exec rake webpacker:compile RUN SECRET_KEY_BASE=$(ruby -r 'securerandom' -e 'puts SecureRandom.hex(64)') bundle exec rake assets:precompile RUN cp config/controlled_vocabulary.yml.example config/controlled_vocabulary.yml diff --git a/Gemfile b/Gemfile index a6733c68bb..72503fe418 100644 --- a/Gemfile +++ b/Gemfile @@ -25,8 +25,8 @@ gem 'react-rails' gem 'sass', '3.4.22' gem 'sprockets-es6' gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript' -gem 'uglifier', '>= 1.3.0' -gem 'webpacker' +gem 'terser' +gem 'shakapacker' # Core Samvera gem 'active-fedora', '~> 14.0', '>= 14.0.1' @@ -49,11 +49,11 @@ gem 'active_annotations', '~> 0.4' gem 'activerecord-session_store', '>= 2.0.0' gem 'acts_as_list' gem 'api-pagination' -gem 'avalon-about', git: 'https://github.com/avalonmediasystem/avalon-about.git', tag: 'avalon-r6.4' +gem 'avalon-about', git: 'https://github.com/avalonmediasystem/avalon-about.git', tag: 'avalon-r7.7' #gem 'bootstrap-sass', '< 3.4.1' # Pin to less than 3.4.1 due to change in behavior with popovers gem 'bootstrap-toggle-rails' gem 'bootstrap_form' -gem 'iiif_manifest', '~> 1.3' +gem 'iiif_manifest', '>= 1.4.0' gem 'rack-cors', require: 'rack/cors' gem 'rails_same_site_cookie' gem 'recaptcha', require: 'recaptcha/rails' @@ -74,11 +74,10 @@ gem 'omniauth-lti', git: "https://github.com/avalonmediasystem/omniauth-lti.git" gem "omniauth-saml", "~> 2.0" # Media Access & Transcoding -gem 'active_encode', '~> 1.0', '>= 1.1.3' +gem 'active_encode', '>= 1.2.2' gem 'audio_waveform-ruby', '~> 1.0.7', require: 'audio_waveform' gem 'browse-everything', git: "https://github.com/avalonmediasystem/browse-everything.git", branch: 'v1.2-avalon' gem 'fastimage' -gem 'media_element_add_to_playlist', git: 'https://github.com/avalonmediasystem/media-element-add-to-playlist.git', tag: 'avalon-r6.5' gem 'mediainfo', git: "https://github.com/avalonmediasystem/mediainfo.git", tag: 'v0.7.1-avalon' gem 'rest-client', '~> 2.0' gem 'roo' @@ -103,6 +102,10 @@ gem 'jbuilder', '~> 2.0' gem 'parallel' gem 'with_locking' +# Reindexing script +gem 'sequel' +gem 'httpx' + group :development do gem 'capistrano', '~>3.6' gem 'capistrano-passenger', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 271d12d1db..fc57de7f85 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,8 +8,8 @@ GIT GIT remote: https://github.com/avalonmediasystem/avalon-about.git - revision: 8ae33197219cb6cb8b6fee1f616950c29f2b94ce - tag: avalon-r6.4 + revision: cc8d816b9751d6a04750399d9ef828a33e7ac7eb + tag: avalon-r7.7 specs: avalon-about (0.1.0) about_page @@ -38,14 +38,6 @@ GIT signet (~> 0.8) typhoeus -GIT - remote: https://github.com/avalonmediasystem/media-element-add-to-playlist.git - revision: dfde0084f6c17ca16fa675086eb025440f99a02d - tag: avalon-r6.5 - specs: - media_element_add_to_playlist (0.0.1) - rails (> 4.0) - GIT remote: https://github.com/avalonmediasystem/mediainfo.git revision: bea9479d33328c6b483ee19c008730f939d98266 @@ -143,7 +135,7 @@ GEM active_elastic_job (3.2.0) aws-sdk-sqs (~> 1) rails (>= 5.2.6, < 7.1) - active_encode (1.1.3) + active_encode (1.2.2) addressable (~> 2.8) rails active_fedora-datastreams (0.5.0) @@ -199,10 +191,10 @@ GEM autoprefixer-rails (10.4.7.0) execjs (~> 2) aws-eventstream (1.2.0) - aws-partitions (1.735.0) + aws-partitions (1.801.0) aws-record (2.10.1) aws-sdk-dynamodb (~> 1.18) - aws-sdk-cloudfront (1.75.0) + aws-sdk-cloudfront (1.76.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) aws-sdk-core (3.171.0) @@ -219,7 +211,7 @@ GEM aws-sdk-kms (1.63.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) - aws-sdk-rails (3.7.0) + aws-sdk-rails (3.7.1) aws-record (~> 2) aws-sdk-ses (~> 1) aws-sdk-sesv2 (~> 1) @@ -227,7 +219,7 @@ GEM aws-sessionstore-dynamodb (~> 2) concurrent-ruby (~> 1) railties (>= 5.2.0) - aws-sdk-s3 (1.119.2) + aws-sdk-s3 (1.122.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) @@ -237,19 +229,20 @@ GEM aws-sdk-sesv2 (1.31.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) - aws-sdk-sqs (1.53.0) + aws-sdk-sqs (1.55.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) aws-sessionstore-dynamodb (2.0.1) aws-sdk-dynamodb (~> 1) rack (~> 2) - aws-sigv4 (1.5.2) + aws-sigv4 (1.6.0) aws-eventstream (~> 1, >= 1.0.2) babel-source (5.8.35) babel-transpiler (0.7.0) babel-source (>= 4.0, < 6) execjs (~> 2.0) bcrypt (3.1.18) + bigdecimal (3.1.6) bindex (0.8.1) bixby (5.0.2) rubocop (= 1.28.2) @@ -278,13 +271,13 @@ GEM popper_js (>= 1.16.1, < 2) sassc-rails (>= 2.0.0) bootstrap-toggle-rails (2.2.1.0) - bootstrap_form (5.1.0) - actionpack (>= 5.2) - activemodel (>= 5.2) + bootstrap_form (5.2.3) + actionpack (>= 6.0) + activemodel (>= 6.0) builder (3.2.4) byebug (11.1.3) cancancan (3.4.0) - capistrano (3.17.1) + capistrano (3.17.3) airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) @@ -293,19 +286,19 @@ GEM capistrano (~> 3.1) capistrano-passenger (0.2.1) capistrano (~> 3.0) - capistrano-rails (1.6.2) + capistrano-rails (1.6.3) capistrano (~> 3.1) capistrano-bundler (>= 1.1, < 3) capistrano-rvm (0.1.2) capistrano (~> 3.0) sshkit (~> 1.2) - capistrano-sidekiq (2.3.0) + capistrano-sidekiq (2.3.1) capistrano (>= 3.9.0) capistrano-bundler sidekiq (>= 6.0) capistrano-yarn (2.0.2) capistrano (~> 3.0) - capybara (3.38.0) + capybara (3.39.2) addressable matrix mini_mime (>= 0.1.3) @@ -326,8 +319,8 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.2.2) - config (4.1.0) + concurrent-ruby (1.2.3) + config (4.2.1) deep_merge (~> 1.2, >= 1.2.1) dry-validation (~> 1.0, >= 1.0.0) connection_pool (2.3.0) @@ -336,8 +329,8 @@ GEM crass (1.0.6) daemons (1.4.1) dalli (3.2.3) - database_cleaner (2.0.1) - database_cleaner-active_record (~> 2.0.0) + database_cleaner (2.0.2) + database_cleaner-active_record (>= 2, < 3) database_cleaner-active_record (2.0.1) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) @@ -347,13 +340,13 @@ GEM deep_merge (1.2.2) deprecation (1.1.0) activesupport - devise (4.9.0) + devise (4.9.2) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - devise_invitable (2.0.7) + devise_invitable (2.0.8) actionmailer (>= 5.0) devise (>= 4.6) diff-lcs (1.5.0) @@ -407,7 +400,7 @@ GEM unicode-types (~> 1.8) edtf (3.1.1) activesupport (>= 3.0, < 8.0) - email_spec (2.2.1) + email_spec (2.2.2) htmlentities (~> 4.3.3) launchy (~> 2.1) mail (~> 2.7) @@ -424,8 +417,8 @@ GEM factory_bot_rails (6.2.0) factory_bot (~> 6.2.0) railties (>= 5.0.0) - fakefs (2.2.0) - faker (3.1.1) + fakefs (2.5.0) + faker (3.2.0) i18n (>= 1.8.11, < 2) faraday (2.7.4) faraday-net_http (>= 2.0, < 3.1) @@ -433,7 +426,7 @@ GEM faraday-encoding (0.0.5) faraday faraday-net_http (3.0.2) - fastimage (2.2.6) + fastimage (2.2.7) fcrepo_wrapper (0.9.0) ruby-progressbar ffi (1.15.5) @@ -466,14 +459,12 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) - haml (5.2.2) - temple (>= 0.8.0) - tilt hashdiff (1.0.1) hashie (5.0.0) hooks (0.4.1) uber (~> 0.0.14) htmlentities (4.3.4) + http-2-next (1.0.3) http (5.1.1) addressable (~> 2.8) http-cookie (~> 1.0) @@ -485,6 +476,8 @@ GEM http-form_data (2.3.0) http_logger (0.7.0) httpclient (2.8.3) + httpx (1.2.2) + http-2-next (>= 1.0.3) hydra-access-controls (12.1.0) active-fedora (>= 10.0.0) activesupport (>= 5.2, < 7.1) @@ -498,10 +491,10 @@ GEM hydra-access-controls (= 12.1.0) hydra-core (= 12.1.0) rails (>= 5.2, < 7.1) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) iconv (1.0.8) - iiif_manifest (1.3.1) + iiif_manifest (1.4.0) activesupport (>= 4) ims-lti (1.1.13) builder @@ -511,7 +504,7 @@ GEM activesupport (>= 5.0.0) jmespath (1.6.2) jquery-datatables (1.10.20) - jquery-rails (4.5.1) + jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -559,14 +552,14 @@ GEM llhttp-ffi (0.4.0) ffi-compiler (~> 1.0) rake (~> 13.0) - lograge (0.12.0) + lograge (0.13.0) actionpack (>= 4) activesupport (>= 4) railties (>= 4) request_store (~> 1.0) - loofah (2.19.1) + loofah (2.21.3) crass (~> 1.0.2) - nokogiri (>= 1.5.9) + nokogiri (>= 1.12.0) mail (2.8.1) mini_mime (>= 0.1.1) net-imap @@ -584,9 +577,9 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2022.0105) mini_mime (1.1.2) - mini_portile2 (2.8.1) + mini_portile2 (2.8.4) minitar (0.9) - minitest (5.18.0) + minitest (5.21.2) msgpack (1.6.0) multi_json (1.15.0) multi_xml (0.6.0) @@ -595,7 +588,7 @@ GEM net-imap (0.3.4) date net-protocol - net-ldap (0.17.1) + net-ldap (0.18.0) net-pop (0.1.2) net-protocol net-protocol (0.2.1) @@ -611,8 +604,8 @@ GEM noid-rails (3.1.0) actionpack (>= 5.0.0, < 7.1) noid (~> 0.9) - nokogiri (1.14.2) - mini_portile2 (~> 2.8.0) + nokogiri (1.15.3) + mini_portile2 (~> 2.8.2) racc (~> 1.4) nom-xml (1.2.0) i18n @@ -638,12 +631,12 @@ GEM orm_adapter (0.5.0) os (1.1.4) ostruct (0.5.5) - parallel (1.22.1) + parallel (1.23.0) paranoia (2.6.1) activerecord (>= 5.1, < 7.1) parser (3.2.1.0) ast (~> 2.4.1) - pg (1.4.5) + pg (1.5.3) popper_js (1.16.1) pretender (0.4.0) actionpack (>= 5.2) @@ -657,12 +650,12 @@ GEM pry (>= 0.10.4) psych (3.3.4) public_suffix (5.0.1) - puma (6.0.2) + puma (6.3.0) nio4r (~> 2.0) raabro (1.4.0) - racc (1.6.2) - rack (2.2.6.4) - rack-cors (1.1.1) + racc (1.7.1) + rack (2.2.8) + rack-cors (2.0.1) rack (>= 2.0.0) rack-protection (3.0.5) rack @@ -688,11 +681,13 @@ GEM actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) rails_same_site_cookie (0.1.9) rack (>= 1.5) user_agent_parser (~> 2.6) @@ -709,26 +704,17 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) rb-readline (0.5.5) - rdf (3.2.9) + rdf (3.2.11) link_header (~> 0.0, >= 0.0.8) - rdf-aggregate-repo (3.2.1) - rdf (~> 3.2) rdf-isomorphic (3.2.1) rdf (~> 3.2) rdf-ldp (0.1.0) deprecation rdf - rdf-rdfa (3.2.0) - haml (~> 5.2) + rdf-rdfxml (3.2.2) + builder (~> 3.2) htmlentities (~> 4.3) rdf (~> 3.2) - rdf-aggregate-repo (~> 3.2) - rdf-vocab (~> 3.2) - rdf-xsd (~> 3.2) - rdf-rdfxml (3.2.0) - htmlentities (~> 4.3) - rdf (~> 3.2) - rdf-rdfa (~> 3.2) rdf-xsd (~> 3.2) rdf-turtle (3.2.1) ebnf (~> 2.3) @@ -738,14 +724,13 @@ GEM rdf-xsd (3.2.1) rdf (~> 3.2) rexml (~> 3.2) - react-rails (2.6.2) + react-rails (2.7.1) babel-transpiler (>= 0.7.0) connection_pool execjs railties (>= 3.2) tilt - recaptcha (5.12.3) - json + recaptcha (5.14.0) redis (4.8.1) redis-actionpack (5.3.0) actionpack (>= 5, < 8) @@ -799,14 +784,14 @@ GEM rspec-mocks (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.1) + rspec-rails (6.0.3) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.11) - rspec-expectations (~> 3.11) - rspec-mocks (~> 3.11) - rspec-support (~> 3.11) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) rspec-retry (0.6.2) rspec-core (> 3.3) rspec-support (3.12.0) @@ -864,15 +849,23 @@ GEM childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) semantic_range (3.0.0) + sequel (5.77.0) + bigdecimal + shakapacker (7.0.2) + activesupport (>= 5.2) + rack-proxy (>= 0.6.1) + railties (>= 5.2) + semantic_range (>= 2.3.0) shoulda-matchers (5.3.0) activesupport (>= 5.2.0) - sidekiq (6.5.8) + sidekiq (6.5.9) connection_pool (>= 2.2.5, < 3) rack (~> 2.0) redis (>= 4.5.0, < 5) - sidekiq-cron (1.9.1) + sidekiq-cron (1.10.1) fugit (~> 1.8) - sidekiq (>= 4.2.1) + globalid (>= 1.0.1) + sidekiq (>= 6) signet (0.17.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) @@ -910,7 +903,7 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.6.0) + sqlite3 (1.6.3) mini_portile2 (~> 2.8.0) sshkit (1.21.3) net-scp (>= 1.1.2) @@ -923,8 +916,9 @@ GEM sxp (1.2.3) matrix (~> 0.4) rdf (~> 3.2) - temple (0.10.0) - thor (1.2.1) + terser (1.2.0) + execjs (>= 0.3.0, < 3) + thor (1.2.2) tilt (2.0.11) timeout (0.3.2) trailblazer-option (0.1.2) @@ -937,8 +931,6 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.0.15) - uglifier (4.2.0) - execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext unf_ext (0.0.8.2) @@ -965,11 +957,6 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webpacker (5.4.4) - activesupport (>= 5.2) - rack-proxy (>= 0.6.1) - railties (>= 5.2) - semantic_range (>= 2.3.0) webrick (1.8.1) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) @@ -979,7 +966,7 @@ GEM rexml xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.7) + zeitwerk (2.6.11) zk (1.10.0) zookeeper (~> 1.5.0) zookeeper (1.5.5) @@ -993,7 +980,7 @@ DEPENDENCIES active-fedora (~> 14.0, >= 14.0.1) active_annotations (~> 0.4) active_elastic_job - active_encode (~> 1.0, >= 1.1.3) + active_encode (>= 1.2.2) active_fedora-datastreams (~> 0.5) activejob-traffic_control activejob-uniqueness @@ -1047,9 +1034,10 @@ DEPENDENCIES google-analytics-rails (= 1.1.0) hashdiff (>= 1.0) hooks + httpx hydra-head (~> 12.0) iconv (~> 1.0.6) - iiif_manifest (~> 1.3) + iiif_manifest (>= 1.4.0) ims-lti (~> 1.1.13) jbuilder (~> 2.0) jquery-datatables @@ -1060,7 +1048,6 @@ DEPENDENCIES lograge mail (> 2.8.0.1) marc - media_element_add_to_playlist! mediainfo! mysql2 net-ldap @@ -1098,6 +1085,8 @@ DEPENDENCIES samvera-persona (~> 0.4, >= 0.4.1) sass (= 3.4.22) selenium-webdriver + sequel + shakapacker shoulda-matchers sidekiq (~> 6.2) sidekiq-cron (~> 1.9) @@ -1107,13 +1096,12 @@ DEPENDENCIES sprockets (~> 3.7.2) sprockets-es6 sqlite3 + terser twitter-typeahead-rails (= 0.11.1.pre.corejavascript) - uglifier (>= 1.3.0) wavefile (~> 1.0.1) web-console webdrivers (~> 3.0) webmock (~> 3.5) - webpacker with_locking zk zoom diff --git a/LICENSE_HEADER b/LICENSE_HEADER index 2cc4fd3914..113c308484 100644 --- a/LICENSE_HEADER +++ b/LICENSE_HEADER @@ -1,4 +1,4 @@ -Copyright 2011-2023, The Trustees of Indiana University and Northwestern +Copyright 2011-2024, The Trustees of Indiana University and Northwestern University. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/app/assets/images/add_to_playlist_icon.svg b/app/assets/images/add_to_playlist_icon.svg new file mode 100644 index 0000000000..3fb01d60de --- /dev/null +++ b/app/assets/images/add_to_playlist_icon.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + diff --git a/app/assets/images/me_icons.svg b/app/assets/images/me_icons.svg deleted file mode 100644 index 74c366ef74..0000000000 --- a/app/assets/images/me_icons.svg +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/assets/images/mejs4_icons-01.svg b/app/assets/images/mejs4_icons-01.svg deleted file mode 100755 index 2d875beca4..0000000000 --- a/app/assets/images/mejs4_icons-01.svg +++ /dev/null @@ -1,96 +0,0 @@ - - - - -mejs4_icons - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/assets/javascripts/access_control_step.js.coffee b/app/assets/javascripts/access_control_step.js.coffee index 7bfe9a1b84..2f1c79db5a 100644 --- a/app/assets/javascripts/access_control_step.js.coffee +++ b/app/assets/javascripts/access_control_step.js.coffee @@ -1,4 +1,4 @@ -# Copyright 2011-2023, The Trustees of Indiana University and Northwestern +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # diff --git a/app/assets/javascripts/add-playlist-option.js.coffee b/app/assets/javascripts/add-playlist-option.js.coffee new file mode 100644 index 0000000000..682f6ea7ca --- /dev/null +++ b/app/assets/javascripts/add-playlist-option.js.coffee @@ -0,0 +1,138 @@ +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern +# University. Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# --- END LICENSE_HEADER BLOCK --- + +# This script will enable support for the html5 form attribute +# This should only be needed for IE but is currently applied wholesale +# to all disjointed submit elements as is needed in some of the workflow steps + +$ -> + add_new_playlist_option() + +@add_new_playlist_option = () -> + addnew = 'Add new playlist' + select_element = $('#post_playlist_id') + select_options = $('#post_playlist_id > option') + add_success = false + has_new_opt = false + + # Prepend 'Add new playlist' option only when not present + select_options.each -> + if @value == addnew + has_new_opt = true + + if !has_new_opt + select_element.prepend(new Option(addnew)) + + getSearchTerm = () -> + return $('span.select2-search--dropdown input').val() + + matchWithNew = (params, data) -> + term = params.term || '' + term = term.toLowerCase() + text = data.text.toLowerCase() + if (text.includes(addnew.toLowerCase()) || text.includes(term)) + return data + return null + + sortWithNew = (data) -> + return data.sort((a, b) -> + if (b.text.trim() == addnew) + return 1 + if (a.text < b.text || a.text.trim() == addnew) + return -1 + if (a.text > b.text) + return 1 + return 0) + + formatAddNew = (data) -> + term = getSearchTerm() || '' + if (data.text == addnew ) + if (term != '') + term = addnew + ' "' + term + '"' + else + term = addnew + return ' + '+term+' + ' + else + start = data.text.toLowerCase().indexOf(term.toLowerCase()) + if (start != -1) + end = start+term.length-1 + return data.text.substring(0,start) + '' + data.text.substring(start, end+1) + '' + data.text.substring(end+1) + return data.text + + select_element.select2({ + templateResult: formatAddNew + escapeMarkup: + (markup) -> return markup + matcher: matchWithNew + sorter: sortWithNew + }) + .on('select2:selecting', + (evt) -> + choice = evt.params.args.data.text + if (choice.indexOf(addnew) != -1) + showNewPlaylistModal(getSearchTerm()) + ) + + showNewPlaylistModal = (playlistName) -> + #set to defaults first + $('#new_playlist_submit').val('Create') + $('#new_playlist_submit').prop("disabled", false) + $('#playlist_title').val(playlistName) + $('#playlist_comment').val("") + $('#playlist_visibility_private').prop('checked', true) + #remove any possible old errors + $('#title_error').remove() + $('#playlist_title').parent().removeClass('has-error') + add_success = false + #finally show + $('#add-playlist-modal').modal('show') + return true + + $('#add-playlist-modal').on('hidden.bs.modal', () -> + if (!add_success) + op = select_element.children()[1] + if (op) + newval = op.value + else + newval = -1 + select_element.val(newval).trigger('change.select2') + ) + + $('#playlist_form').submit( + () -> + if($('#playlist_title').val()) + $('#new_playlist_submit').val('Saving...') + $('#new_playlist_submit').prop("disabled", true) + return true + if($('#title_error').length == 0) + $('#playlist_title') + .after('
Name is required
') + $('#playlist_title').parent().addClass('has-error') + return false + ) + + $("#playlist_form").bind('ajax:success', + (event) -> + [data, status, xhr] = event.detail + $('#add-playlist-modal').modal('hide') + if (data.errors) + console.log(data.errors.title[0]) + else + add_success = true + select_element + .append(new Option(data.title, data.id.toString(), true, true)) + .trigger('change') + ) diff --git a/app/assets/javascripts/android_pre_play.js b/app/assets/javascripts/android_pre_play.js deleted file mode 100644 index 8184cd7a05..0000000000 --- a/app/assets/javascripts/android_pre_play.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern - * University. Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed - * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * --- END LICENSE_HEADER BLOCK --- -*/ - -(function() { - var _t = { - androidPrePlay: function(handler, player){ - _t.handler = handler; - _t.player = player; - _t.avalonStartTime = handler.stream_info.t || 0; - _t.avalonDuration = handler.stream_info.duration; - if (typeof _t.originalSetCurrentTime != 'function') - _t.originalSetCurrentTime = _t.player.setCurrentTime; - _t.player.setCurrentTime = _t.androidSetCurrentTime; - if (typeof _t.originalGetCurrentTime != 'function') - _t.originalGetCurrentTime = _t.player.getCurrentTime; - _t.player.getCurrentTime = _t.androidGetCurrentTime; - $(_t.player.durationD).html(mejs.Utility.secondsToTimeCode(parseInt(handler.stream_info.duration))); - _t.player.media.addEventListener('play', _t.androidFirstPlay, true); - }, - - durationChanged: function() { - console.log(_t.player.media.duration); - if (_t.player.media.duration == 0) - return; - _t.player.setCurrentTime(_t.avalonStartTime); - console.log(_t.player.media.duration + " " + _t.player.getCurrentTime() + " " + _t.player.media.seeking); - _t.player.media.removeEventListener('durationchange', _t.durationChanged); - }, - - androidSetCurrentTime: function(time) { - //don't actually call media.currentTime but update everything else manually - console.log('androidSetCurrentTime: ' + time); - _t.avalonStartTime = time; - _t.androidSetCurrentRail(time); - _t.androidUpdateCurrent(time); - _t.handler.setActiveSection(); - }, - - androidGetCurrentTime: function() { - return _t.avalonStartTime; - }, - - androidSetCurrentRail: function(time) { - var total = _t.player.controls.find('.mejs-time-total'); - var handle = _t.player.controls.find('.mejs-time-handle'); - var current = _t.player.controls.find('.mejs-time-current'); - - // update bar and handle - if (total && handle) { - var - newWidth = Math.round(total.width() * time / _t.avalonDuration), - handlePos = newWidth - Math.round(handle.outerWidth(true) / 2); - - current.width(newWidth); - handle.css('left', handlePos); - } - }, - - androidUpdateCurrent: function(time) { - var currenttime = _t.player.currenttime; - if (currenttime) { - currenttime.html(mejs.Utility.secondsToTimeCode(time, _t.player.options.alwaysShowHours || _t.avalonDuration > 3600, _t.player.options.showTimecodeFrameCount, _t.player.options.framesPerSecond || 25)); - } - }, - - androidFirstPlay: function() { - _t.player.setCurrentTime = _t.originalSetCurrentTime; - //_t.player.media.setCurrentTime = originalSetCurrentTime; - _t.player.getCurrentTime = _t.originalGetCurrentTime; - _t.player.media.addEventListener('durationchange', _t.durationChanged, true); - _t.player.media.removeEventListener("play", _t.androidFirstPlay); - } - }; - - (typeof exports !== "undefined" && exports !== null ? exports : this).AndroidShim = _t; -})(); diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index fd14f3b7ee..8e041b1aa6 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern + * Copyright 2011-2024, The Trustees of Indiana University and Northwestern * University. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * @@ -47,16 +47,8 @@ // include all of our vendored js //= require_tree ../../../vendor/assets/javascripts/. -// Exclude MediaElement 4 JS files in /vendor, as ME4 collides with the ME2 gem -//= stub mediaelement/mediaelement-and-player -//= stub mediaelement/plugins/markers -//= stub mediaelement/plugins/quality-avalon -//= stub mediaelement/plugins/quality-i18n -//= stub media_player_wrapper/mejs4_plugin_add_to_playlist -//= stub media_player_wrapper/mejs4_plugin_add_marker_to_playlist -//= stub media_player_wrapper/mejs4_plugin_create_thumbnail -//= stub media_player_wrapper/mejs4_plugin_track_scrubber -//= stub media_player_wrapper/mejs4_link_back -//= stub media_player_wrapper/mejs4_plugin_playlist_items +// Require VideoJS and VideoJS quality selector for embedded player +//= require video.js/dist/video.min.js +//= require @silvermine/videojs-quality-selector/dist/js/silvermine-videojs-quality-selector.min.js //= require_tree . diff --git a/app/assets/javascripts/autocomplete.js.coffee b/app/assets/javascripts/autocomplete.js.coffee index 8156236b8b..5e5561c897 100644 --- a/app/assets/javascripts/autocomplete.js.coffee +++ b/app/assets/javascripts/autocomplete.js.coffee @@ -1,4 +1,4 @@ -# Copyright 2011-2023, The Trustees of Indiana University and Northwestern +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # @@ -19,7 +19,7 @@ datumTokenizer: Bloodhound.tokenizers.whitespace('display') queryTokenizer: Bloodhound.tokenizers.whitespace remote: - url: "#{$('body').data('mountpoint')}autocomplete?q=%QUERY&t=#{$t.data('model')}" + url: "#{$('body').data('mountpoint')}autocomplete?q=%QUERY&t=#{$t.data('model')}&id=#{$t.data('media-object-id')}" wildcard: '%QUERY' ) mySource.initialize() @@ -36,7 +36,7 @@ limit: 10 ).on("typeahead:selected typeahead:autocompleted", (event, suggestion, dataset) -> target = $("##{$t.data('target')}") - target.val suggestion["id"] + target.val suggestion["id"] || suggestion["display"] $t.data('matched_val',suggestion["display"]) return ).on("keypress", (e) -> diff --git a/app/assets/javascripts/avalon.js b/app/assets/javascripts/avalon.js index 0185f4bd44..10ddb3ff8b 100644 --- a/app/assets/javascripts/avalon.js +++ b/app/assets/javascripts/avalon.js @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern + * Copyright 2011-2024, The Trustees of Indiana University and Northwestern * University. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * @@ -72,14 +72,17 @@ $(document).ready(function () { false ); - $('#content').focus(function () { - $('.mejs-controls').css('visibility', 'visible'); - $('.mejs-controls button:first').focus(); - }); - // Set CSS to push the page content above footer $('.content-wrapper').css('padding-bottom', $('#footer').css('height')); + // Re-set the space between content-wrapper and footer on window resize. + // With this the main content height is adjusted when orientation changes when + // using mobile devices, avoiding main content bleeding into the footer. + window.addEventListener("resize", () => { + $('.content-wrapper').css('padding-bottom', $('#footer').css('height')); + }, true); + + /* Toggle CSS classes for global search form */ const $searchWrapper = $('.global-search-wrapper'); const $searchSubmit = $('.global-search-submit'); diff --git a/app/assets/javascripts/avalon_playlists/playlist_items.js b/app/assets/javascripts/avalon_playlists/playlist_items.js index 7737980863..8c8f740017 100644 --- a/app/assets/javascripts/avalon_playlists/playlist_items.js +++ b/app/assets/javascripts/avalon_playlists/playlist_items.js @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern + * Copyright 2011-2024, The Trustees of Indiana University and Northwestern * University. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * diff --git a/app/assets/javascripts/avalon_playlists/playlists.js.coffee b/app/assets/javascripts/avalon_playlists/playlists.js.coffee index 9789d1dcc0..2a75ed6e46 100644 --- a/app/assets/javascripts/avalon_playlists/playlists.js.coffee +++ b/app/assets/javascripts/avalon_playlists/playlists.js.coffee @@ -1,4 +1,4 @@ -# Copyright 2011-2023, The Trustees of Indiana University and Northwestern +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # @@ -78,9 +78,3 @@ $('input[name="playlist[visibility]"]').on('click', () -> new_text = $('.human_friendly_visibility_'+new_val).attr('title') $('.visibility-help-text').text(new_text) ) - -# Hide instead of delete Bootstrap's dismissable alerts -$('.mejs-form-alert').on('close.bs.alert', (e) -> - e.preventDefault() - $(this).slideUp() -) diff --git a/app/assets/javascripts/avalon_progress.js.coffee b/app/assets/javascripts/avalon_progress.js.coffee index 3e5cb9efe1..5e12342855 100644 --- a/app/assets/javascripts/avalon_progress.js.coffee +++ b/app/assets/javascripts/avalon_progress.js.coffee @@ -1,4 +1,4 @@ -# Copyright 2011-2023, The Trustees of Indiana University and Northwestern +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # @@ -68,12 +68,6 @@ class AvalonProgress return info.success + info.error < 100 - click_section: (section_id) -> - data = @data[section_id] - if data.status != 'COMPLETED' or data.complete < 100 - window.currentPlayer = null - $('.avalon-player').html('
') - $(document).ready -> if $('.progress-bar').length == 0 return @@ -90,6 +84,3 @@ $(document).ready -> progress_controller.retrieve(true) $('.progress-inline').click -> $(this).nextAll('.status-detail').slideToggle() - - $('a[data-segment]').bind 'streamswitch', -> - progress_controller.click_section($(this).data('segment')) diff --git a/app/assets/javascripts/avalon_timelines/timelines.js.coffee b/app/assets/javascripts/avalon_timelines/timelines.js.coffee index 870ea53faa..bacf87e260 100644 --- a/app/assets/javascripts/avalon_timelines/timelines.js.coffee +++ b/app/assets/javascripts/avalon_timelines/timelines.js.coffee @@ -1,4 +1,4 @@ -# Copyright 2011-2023, The Trustees of Indiana University and Northwestern +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # @@ -65,7 +65,8 @@ $('#copy-timeline-form').submit( ) $('#copy-timeline-form').bind('ajax:success', - (event, data, status, xhr) -> + (event) -> + [data, status, xhr] = event.detail if (data.errors) console.log(data.errors.title[0]) else @@ -75,7 +76,8 @@ $('#copy-timeline-form').bind('ajax:success', if ( $('#with_refresh').val() ) location.reload() ).bind('ajax:error', - (e, xhr, status, error) -> + (event) -> + [data, status, xhr] = event.detail console.log(xhr.responseJSON.errors) ) @@ -88,9 +90,3 @@ $('input[name="timeline[visibility]"]').on('click', () -> else $('#timeline_lti_share').show() ) - -# Hide instead of delete Bootstrap's dismissable alerts -$('.mejs-form-alert').on('close.bs.alert', (e) -> - e.preventDefault() - $(this).slideUp() -) diff --git a/app/assets/javascripts/blacklight/facet_load.js b/app/assets/javascripts/blacklight/facet_load.js index bc69b6ff80..0bc96bccbd 100644 --- a/app/assets/javascripts/blacklight/facet_load.js +++ b/app/assets/javascripts/blacklight/facet_load.js @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern + * Copyright 2011-2024, The Trustees of Indiana University and Northwestern * University. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * diff --git a/app/assets/javascripts/button_confirmation.js.coffee b/app/assets/javascripts/button_confirmation.js.coffee index 2d5b636bbe..7003991be3 100644 --- a/app/assets/javascripts/button_confirmation.js.coffee +++ b/app/assets/javascripts/button_confirmation.js.coffee @@ -1,4 +1,4 @@ -# Copyright 2011-2023, The Trustees of Indiana University and Northwestern +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # diff --git a/app/assets/javascripts/crop_upload.js b/app/assets/javascripts/crop_upload.js index a690c2279e..d12bea59e0 100644 --- a/app/assets/javascripts/crop_upload.js +++ b/app/assets/javascripts/crop_upload.js @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern + * Copyright 2011-2024, The Trustees of Indiana University and Northwestern * University. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * diff --git a/app/assets/javascripts/datatables.js b/app/assets/javascripts/datatables.js index 938410976f..753c43df70 100644 --- a/app/assets/javascripts/datatables.js +++ b/app/assets/javascripts/datatables.js @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern + * Copyright 2011-2024, The Trustees of Indiana University and Northwestern * University. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * diff --git a/app/assets/javascripts/direct_upload.js.coffee b/app/assets/javascripts/direct_upload.js.coffee index 10ec9d9df8..a65d1e06e6 100644 --- a/app/assets/javascripts/direct_upload.js.coffee +++ b/app/assets/javascripts/direct_upload.js.coffee @@ -1,4 +1,4 @@ -# Copyright 2011-2023, The Trustees of Indiana University and Northwestern +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # diff --git a/app/assets/javascripts/display_returned_items.js b/app/assets/javascripts/display_returned_items.js index c61e734670..2df57baca3 100644 --- a/app/assets/javascripts/display_returned_items.js +++ b/app/assets/javascripts/display_returned_items.js @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern + * Copyright 2011-2024, The Trustees of Indiana University and Northwestern * University. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * diff --git a/app/assets/javascripts/dynamic_fields.js.coffee b/app/assets/javascripts/dynamic_fields.js.coffee index 0e65682b9b..9c5eaae349 100644 --- a/app/assets/javascripts/dynamic_fields.js.coffee +++ b/app/assets/javascripts/dynamic_fields.js.coffee @@ -1,4 +1,4 @@ -# Copyright 2011-2023, The Trustees of Indiana University and Northwestern +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # diff --git a/app/assets/javascripts/expand_filename.js b/app/assets/javascripts/expand_filename.js index bc533f37a1..168aa3722e 100644 --- a/app/assets/javascripts/expand_filename.js +++ b/app/assets/javascripts/expand_filename.js @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern + * Copyright 2011-2024, The Trustees of Indiana University and Northwestern * University. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * diff --git a/app/assets/javascripts/file_browse.js.coffee b/app/assets/javascripts/file_browse.js.coffee index 487a09f7bd..5dd77deb6f 100644 --- a/app/assets/javascripts/file_browse.js.coffee +++ b/app/assets/javascripts/file_browse.js.coffee @@ -1,4 +1,4 @@ -# Copyright 2011-2023, The Trustees of Indiana University and Northwestern +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # diff --git a/app/assets/javascripts/file_upload_step.js.coffee b/app/assets/javascripts/file_upload_step.js.coffee index f72b32eeaa..f1ad088c3c 100644 --- a/app/assets/javascripts/file_upload_step.js.coffee +++ b/app/assets/javascripts/file_upload_step.js.coffee @@ -1,4 +1,4 @@ -# Copyright 2011-2023, The Trustees of Indiana University and Northwestern +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # diff --git a/app/assets/javascripts/fix_console.js b/app/assets/javascripts/fix_console.js index 9b1060dea5..585f2ea616 100644 --- a/app/assets/javascripts/fix_console.js +++ b/app/assets/javascripts/fix_console.js @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern + * Copyright 2011-2024, The Trustees of Indiana University and Northwestern * University. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * diff --git a/app/assets/javascripts/hydra/hydra-head.js b/app/assets/javascripts/hydra/hydra-head.js index 994087a1fa..5f34d0cc19 100644 --- a/app/assets/javascripts/hydra/hydra-head.js +++ b/app/assets/javascripts/hydra/hydra-head.js @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern + * Copyright 2011-2024, The Trustees of Indiana University and Northwestern * University. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * diff --git a/app/assets/javascripts/import_button.js.coffee b/app/assets/javascripts/import_button.js.coffee index f77c985c5f..6e8f8d3fbb 100644 --- a/app/assets/javascripts/import_button.js.coffee +++ b/app/assets/javascripts/import_button.js.coffee @@ -1,4 +1,4 @@ -# Copyright 2011-2023, The Trustees of Indiana University and Northwestern +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # diff --git a/app/assets/javascripts/input_form_attribute_support.js.coffee b/app/assets/javascripts/input_form_attribute_support.js.coffee index 759a414b67..3b49a6f17d 100644 --- a/app/assets/javascripts/input_form_attribute_support.js.coffee +++ b/app/assets/javascripts/input_form_attribute_support.js.coffee @@ -1,4 +1,4 @@ -# Copyright 2011-2023, The Trustees of Indiana University and Northwestern +# Copyright 2011-2024, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # diff --git a/app/assets/javascripts/intercom_push.js b/app/assets/javascripts/intercom_push.js index be8eb9d68a..4a302102fb 100644 --- a/app/assets/javascripts/intercom_push.js +++ b/app/assets/javascripts/intercom_push.js @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern + * Copyright 2011-2024, The Trustees of Indiana University and Northwestern * University. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * diff --git a/app/assets/javascripts/localize_times.js b/app/assets/javascripts/localize_times.js index 9c536ff61d..c454648c1f 100644 --- a/app/assets/javascripts/localize_times.js +++ b/app/assets/javascripts/localize_times.js @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023, The Trustees of Indiana University and Northwestern + * Copyright 2011-2024, The Trustees of Indiana University and Northwestern * University. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * @@ -23,3 +23,16 @@ function localize_times() { $(document).ready(localize_times); $(document).on('draw.dt', localize_times); +// This interval is necessary to make sure CDL return time is calculated +// and displayed on pages that have a Ramp player. The message renders in Ramp so +// we need to wait until it is initialized to run localize_times. +$(document).ready(function () { + let timeCheck = setInterval(initLocalizeTimes, 500); + function initLocalizeTimes() { + // Check readyState to avoid constant interval polling on non-Ramp pages. + if (document.readyState === 'complete') { + clearInterval(timeCheck); + localize_times(); + } + } +}); diff --git a/app/assets/javascripts/media_player_wrapper/avalon_player_new.es6 b/app/assets/javascripts/media_player_wrapper/avalon_player_new.es6 deleted file mode 100644 index 5615aa5a9e..0000000000 --- a/app/assets/javascripts/media_player_wrapper/avalon_player_new.es6 +++ /dev/null @@ -1,806 +0,0 @@ -// Copyright 2011-2022, The Trustees of Indiana University and Northwestern -// University. Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -// declaring currentPlayer as global variable as it's used in multiple places outside the class -var currentPlayer; - -/** - * @class MEJSPlayer - * @classdesc Wrapper for MediaElementPlayer interactions - */ -class MEJSPlayer { - /** - * Class constructor - * @param {Object} currentStreamInfo JSON of current media stream info - * @param {Object} customConfig Custom configuration for player - * @return {void} [description] - */ - constructor(configObj) { - this.mejsUtility = new MEJSUtility(); - this.mejsTimeRailHelper = new MEJSTimeRailHelper(); - this.mejsMarkersHelper = new MEJSMarkersHelper(); - this.mejsQualityHelper = new MEJSQualityHelper(); - this.localStorage = window.localStorage; - this.canvasIndex = 0; - - // Unpack player configuration object for the new player. - // This allows for variable params to be sent in. - this.currentStreamInfo = configObj.currentStreamInfo || {}; - this.features = configObj.features || {}; - this.highlightRail = configObj.highlightRail; - this.playlistItem = configObj.playlistItem || {}; - this.defaultQuality = configObj.defaultQuality || 'auto'; - - // Tracks whether we're loading the page or just reloading player - this.isFirstLoad = true; - - // Wrapper for MediaElement instance which interfaces with properties, events, etc. - this.mediaElement = null; - // Actual MediaElement instance - this.player = null; - - this.node = null; - // Add click listeners - this.addSectionsClickListener(); - // audio or video file? - this.mediaType = this.mejsUtility.getMediaType( - this.currentStreamInfo.is_video - ); - - // Helper object when loading a new MEJS player instance (ie. a different media object source section link clicked) - this.switchPlayerHelper = { - active: false, - data: {}, - paused: false - }; - - // Initialize switchPlayerHelper for mediafragment, if one exists - if (this.currentStreamInfo.t && this.currentStreamInfo.t[0] > 0) { - this.switchPlayerHelper.active = true; - this.switchPlayerHelper.data = { - fragmentbegin: this.currentStreamInfo.t[0], - fragmentend: this.currentStreamInfo.t[1] - }; - this.switchPlayerHelper.paused = true; - } - - // Array of all current segments for media object - this.segmentsMap = this.mejsUtility.createSegmentsMap( - document.getElementById('accordion'), - this.currentStreamInfo - ); - // Holder for currently active segment DOM element 'id' attribute - this.activeSegmentId = ''; - - // Initialize the player - this.initializePlayer(); - } - - /** - * Add a listener for clicks on the 'Sections' links - * @function addSectionsClickListener - * @return {void} - */ - addSectionsClickListener() { - const $accordionEl = $('#accordion.media-show-page'); - if ($accordionEl.length > 0) { - $accordionEl[0].addEventListener( - 'click', - this.handleSectionClick.bind(this) - ); - } - } - - /** - * Create the pieces for a new MediaElement player - * @function createNewPlayer - * @return {void} - */ - createNewPlayer() { - let itemScope = document.querySelector('[itemscope="itemscope"]'); - let node = this.mejsUtility.createHTML5MediaNode( - this.mediaType, - this.currentStreamInfo, - this.canvasIndex - ); - - // Mount new