Skip to content

Commit

Permalink
temporarily disable alpheios for performance in ff
Browse files Browse the repository at this point in the history
Temporarily turn off Alpheios Tools due to performance issues in
Firefox. When enabled, it causes the browser to lock up for 200-500ms
for some reason.

Possibly re-enable it with a later version of configure it to activate
when a user clicks a button (see
alpheios-project/embed-lib#118 (comment))
  • Loading branch information
zfletch committed Jul 27, 2020
1 parent ae16fd1 commit 3107343
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// that code so it'll be compiled.

require("@rails/ujs").start()
// require("turbolinks").start()
require("turbolinks").start()
// require("@rails/activestorage").start()
require("channels")

Expand Down
34 changes: 17 additions & 17 deletions app/views/layouts/_alpheios.html.erb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function(event) {
import('https://cdn.jsdelivr.net/npm/alpheios-embedded@latest/dist/alpheios-embedded.min.js').then(embedLib => {
window.AlpheiosEmbed.importDependencies({
mode: 'cdn'
}).then(Embedded => {
new Embedded({
clientId: 'stoic-commentary',
enabledSelector: '[lang=grc], [lang=lat]',
}).activate();
}).catch(e => {
console.error(`Import of Alpheios embedded library dependencies failed: ${e}`)
})

}).catch(e => {
console.error(`Import of Alpheios Embedded library failed: ${e}`)
})
});
// document.addEventListener('DOMContentLoaded', function(event) {
// import('https://cdn.jsdelivr.net/npm/alpheios-embedded@latest/dist/alpheios-embedded.min.js').then(embedLib => {
// window.AlpheiosEmbed.importDependencies({
// mode: 'cdn'
// }).then(Embedded => {
// new Embedded({
// clientId: 'stoic-commentary',
// enabledSelector: '[lang=grc], [lang=lat]',
// }).activate();
// }).catch(e => {
// console.error(`Import of Alpheios embedded library dependencies failed: ${e}`)
// })
//
// }).catch(e => {
// console.error(`Import of Alpheios Embedded library failed: ${e}`)
// })
// });
</script>
2 changes: 2 additions & 0 deletions spec/support/system_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ def sign_in(user = nil, email: user.email, password: 'p@ssw0rd')
RSpec.configure do |config|
config.include SystemSpecHelper, type: :system

Capybara.default_max_wait_time = 4

config.before(:each, type: :system) do
driven_by :selenium, using: :headless_chrome, screen_size: [1366, 768]
end
Expand Down

0 comments on commit 3107343

Please sign in to comment.