Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add annotation tool & migrate to JS in Thyme Player #533

Merged
merged 307 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
307 commits
Select commit Hold shift + click to select a range
eaf717d
Outsource resize and fullscreen functions for thyme players.
Frodo161 Sep 7, 2023
efa108c
Outsource chapter functionality of the (normal) thyme player.
Frodo161 Sep 7, 2023
eb65eff
Fix some minor errors and clean up.
Frodo161 Sep 8, 2023
c8b1ba1
Outsource emergency button to separate file.
Frodo161 Sep 8, 2023
1c9a4fc
Outsource heatmap functionality to separate JavaScript file.
Frodo161 Sep 8, 2023
577be0d
Make heatmap a variable of thyme feedback.
Frodo161 Sep 8, 2023
2b716b2
Made some auxiliary functions private.
Frodo161 Sep 9, 2023
dd81825
Outsource functionaly of the annotation toggle and improve behaviour.
Frodo161 Sep 9, 2023
c126759
Outsource some parts of the functionality of thyme which checks if th…
Frodo161 Sep 9, 2023
d55ba1d
Improve display manager.
Frodo161 Sep 10, 2023
4416e75
Outscource video reference into thyme_attributes.js.
Frodo161 Sep 10, 2023
dc546d9
Put element field back into the constructors of buttons such that the…
Frodo161 Sep 10, 2023
de35c55
Remove speed selector from thyme feedback player and adjust some CSS …
Frodo161 Sep 10, 2023
fccb6c7
Outsource speed selector functionality in separate file.
Frodo161 Sep 10, 2023
aba434b
Rename update_markers into update_annotations (now also in non-JS-fil…
Frodo161 Sep 10, 2023
ecca344
Remove reference on the video control bar in the java script files as…
Frodo161 Sep 10, 2023
e9e21db
Outsource global annotation function into a new class called "Annotat…
Frodo161 Sep 10, 2023
6a54fdc
Restructure annotation area.
Frodo161 Sep 12, 2023
b371444
Fix some properties of the annotation-tool.
Frodo161 Sep 12, 2023
47264a1
Bring toggle-visible-for-teacher-annotations function (fully) to fron…
Frodo161 Sep 12, 2023
aa78613
Fix controller method to make the last commit work.
Frodo161 Sep 12, 2023
eb31f46
Rename thyme.js into thyme_player.js.
Frodo161 Sep 12, 2023
7588aea
Clean up.
Frodo161 Sep 12, 2023
db5cb3c
Remove annotationSort() from utility.js as this function is now part …
Frodo161 Sep 12, 2023
5165c77
Remove function annotationIndex() from utility.js as this function is…
Frodo161 Sep 12, 2023
91e0b7c
Outsource the parts of the thyme player scripts which set up the max …
Frodo161 Sep 12, 2023
7ff5535
Code clean up and fix error message for editing annotations.
Frodo161 Sep 13, 2023
21e21b7
Remove comment and made the function sortAnnotations() static.
Frodo161 Sep 13, 2023
37535ba
Next and previous annotation buttons now consider only valid annotati…
Frodo161 Sep 13, 2023
7a7fdbb
Move attribute activeAnnotationId to the class AnnotationArea (now sa…
Frodo161 Sep 13, 2023
af59d7a
Optical and structural improvements of code and fix of updating annot…
Frodo161 Sep 13, 2023
a647ce7
Rename class Button as Component.
Frodo161 Sep 13, 2023
42add6a
Outsource hide functionality of the control bar.
Frodo161 Sep 13, 2023
cded3ba
Rename class ControlBar as ControlBarHider and restyle some parts of …
Frodo161 Sep 13, 2023
ccb09a8
Outsource ia button.
Frodo161 Sep 13, 2023
4684501
Outsource ia-close button.
Frodo161 Sep 14, 2023
caa863a
Replace expressions of the form "$('#' + component.id)" by "$(compone…
Frodo161 Sep 14, 2023
7b2da5a
Renamed chapters.js into chapter_manager.js and wrap the functionalit…
Frodo161 Sep 14, 2023
20d5090
Remove function iconClass() as it seems to be used nowhere.
Frodo161 Sep 14, 2023
d57fa4a
Made max height of the heatmap a static attribute.
Frodo161 Sep 14, 2023
fbae459
Outsource chapter functionality into chapter manager class. Remove ba…
Frodo161 Sep 14, 2023
c38efde
Changed fixed chapters id into an attribute of the chapter manager co…
Frodo161 Sep 15, 2023
dc51141
Remove parameter from nextChapterStart() and previousChapterStart() (…
Frodo161 Sep 15, 2023
6ddb082
Remove chapter class as modelling chapters as objects seems to make t…
Frodo161 Sep 15, 2023
2517949
Remove unused variable from chapter manager.
Frodo161 Sep 15, 2023
2ea0b2d
Outsource metadata functionality.
Frodo161 Sep 15, 2023
4bd1451
Made metadataBefore() and metadataAfter() private.
Frodo161 Sep 15, 2023
4de2bdf
Clean up.
Frodo161 Sep 15, 2023
d859d13
Add back button again.
Frodo161 Sep 16, 2023
49d4835
Remove unnecessary variables from thyme editor and fix use of thymeUt…
Frodo161 Sep 16, 2023
b6a1031
Change var to let or const in the thyme editor script.
Frodo161 Sep 16, 2023
d50042b
Add missing ; in for-loop and fix variable declaration.
Frodo161 Sep 17, 2023
97e7ff9
Make time in the plus/minus (ten) button variable.
Frodo161 Sep 17, 2023
9131b32
Replace comment.
Frodo161 Sep 17, 2023
b7c4f75
Use play, mute and plus/minus x seconds buttons from the new classes.
Frodo161 Sep 17, 2023
6bdea85
Use seek bar from the new class and fix an event listener.
Frodo161 Sep 17, 2023
7dafa8c
Use volume bar from the new class.
Frodo161 Sep 17, 2023
7c90f4c
Use setUpMaxTime() from thymeUtility and remove unnecessary time upda…
Frodo161 Sep 17, 2023
b60bbe0
Move dataURLtoBlob() to thymeUtility.
Frodo161 Sep 17, 2023
c0393a9
Outsource add item/reference/screenshot button.
Frodo161 Sep 17, 2023
8d49ec2
Rename near_mistake_annotations by num_nearby_mistake_annotations and…
Frodo161 Sep 17, 2023
bbd8e35
Replace find_by_id by find_by.
Frodo161 Sep 17, 2023
75c8015
Clean up medium model.
Frodo161 Sep 17, 2023
1a139fe
Get rid of unused comment.
Frodo161 Sep 17, 2023
98edf9b
Rename id.
Frodo161 Sep 17, 2023
e856795
Change id name.
Frodo161 Sep 17, 2023
8f82640
Capitalized the German words Du, Deine, etc.
Frodo161 Sep 17, 2023
22bd9cc
Fix emergency link feature and made "You need further help? ..." invi…
Frodo161 Sep 17, 2023
e475705
Split up thyme CSS.
Frodo161 Sep 18, 2023
b7752fd
Remove global CSS which is not needed.
Frodo161 Sep 18, 2023
ab72d20
Remove duplication of the color map.
Frodo161 Sep 20, 2023
edf5994
Update annotation area when annotations are updated.
Frodo161 Sep 20, 2023
5de8fde
Fix bad behaviour of ia-button, interactive area and annotation area.
Frodo161 Sep 21, 2023
0668b84
Replace CoffeeScript by JavaScript in app/views/annotations and clean…
Frodo161 Sep 21, 2023
7950a8b
Add tooltips for the category radio buttons and for the "post as comm…
Frodo161 Sep 21, 2023
4027387
Clean up code.
Frodo161 Sep 27, 2023
5a3eaac
Add comment.
Frodo161 Sep 27, 2023
16f09dc
Put thyme player scripts in the thyme folder, separate load of thyme …
Frodo161 Sep 27, 2023
ec4fab0
Fix missing Latex preview in the annotation modal.
Frodo161 Sep 27, 2023
8334b75
Lower the opacity of previous/next button in the annotation area if t…
Frodo161 Sep 27, 2023
3acaf01
Correct language.
Frodo161 Sep 30, 2023
282b493
Select necessary annotation attributes in backend, not in frontend.
Frodo161 Sep 30, 2023
ec2c830
Improve interaction between annotation and associated comment.
Frodo161 Sep 30, 2023
99af744
Set default value of visible_for_teacher to false, whenever the annot…
Frodo161 Sep 30, 2023
57e7a11
Fix wrong/missing annotation subtext in the annotation area.
Frodo161 Sep 30, 2023
901c739
Remove warning locales from the form html file and put it into the lo…
Frodo161 Sep 30, 2023
f234db9
Make the annotations in the thyme player appear (uniformly) in the sa…
Frodo161 Sep 30, 2023
14ae65a
Code clean up.
Frodo161 Oct 1, 2023
9ad187d
Replace text "subtext" by enum "subcategory" in the annotation table …
Frodo161 Oct 1, 2023
7e77f80
Add (sub)category class (+ superclass) to remove hardcoded categories…
Frodo161 Oct 1, 2023
4bb2844
Comment update implies annotation update.
Frodo161 Oct 5, 2023
91552a5
Change label "Enable emergency button?" and add helpdesk.
Frodo161 Oct 5, 2023
6150d64
Add case "Thymestamp not found" to update_comments.
Frodo161 Oct 6, 2023
198536b
Code clean up.
Frodo161 Oct 6, 2023
2c34cdd
Code clean up.
Frodo161 Oct 7, 2023
cc741a2
Fix resize.
Frodo161 Oct 7, 2023
b460aed
link Commontator::Comment and Annotation models
fosterfarrell9 Oct 8, 2023
c313dd2
Merge branch 'mampf-next' into annotation-tool
Splines Oct 17, 2023
b1af812
Delete unwanted .ruby-version file
Splines Oct 17, 2023
38da1b8
Update pdfcomprezzor to version on mampf-next
Splines Oct 17, 2023
e61d6d1
Fix resize and IA bugs.
Frodo161 Oct 21, 2023
e2cc6d8
Merge branch 'annotation-tool' of https://github.com/MaMpf-HD/mampf i…
Frodo161 Oct 21, 2023
cd517d4
Remove "video is not null" check from thyme players.
Frodo161 Oct 21, 2023
3117939
Remove test for Internet Explorer
Frodo161 Oct 21, 2023
0b95bbc
Set default values for annotations_status
Frodo161 Oct 21, 2023
4296e62
Update annotations without delay
Frodo161 Oct 21, 2023
758a85b
Replace plus/minus button by time button.
Frodo161 Oct 21, 2023
1c5d4ad
Add shortcuts for prev/next annotation.
Frodo161 Oct 21, 2023
3fd11ce
Merge remote-tracking branch 'origin/annotation-tool-experiments' int…
Frodo161 Oct 22, 2023
526bc08
Merge together multiple annotation-related migrations
Splines Oct 22, 2023
735585f
Improve code comment
Splines Oct 22, 2023
759d99c
Remove renaming of "this" in JS class
Splines Oct 22, 2023
8092424
Redesign "post as comment" checkbox
Splines Oct 23, 2023
afadcff
Restructure cancel/close buttons
Splines Oct 23, 2023
dcc0d1c
Improve annotation commontator::comment association
Frodo161 Oct 26, 2023
a968275
Code clean up
Frodo161 Oct 26, 2023
b23f5e1
Code clean-up
Frodo161 Oct 27, 2023
951fc64
Merge origin/annotation-tool
Frodo161 Oct 27, 2023
03c7d31
Replace name "emergency button" by "annotation button"
Frodo161 Oct 27, 2023
480c3b5
Add color check
Frodo161 Oct 28, 2023
8cb24a7
Fix comment is nil bug
Frodo161 Oct 28, 2023
0f6e562
Code clean-up
Frodo161 Oct 28, 2023
e39fcb5
Add non-null constraint for category
Frodo161 Oct 28, 2023
3123db5
CSS improvement and bugfix
Frodo161 Oct 28, 2023
f74cdc7
Correct locales
Frodo161 Oct 28, 2023
63c15ea
Add null constraint to category in original migration
Splines Oct 30, 2023
9c81e0a
Rearrange save button
Splines Oct 30, 2023
b6c1327
Quick fix thyme feedback resize.
Frodo161 Nov 4, 2023
854470f
Add non-nil constraint
Frodo161 Nov 4, 2023
d9674e4
Add constraint to AnnotationsController
Frodo161 Nov 4, 2023
9cb9021
Improve code style
Frodo161 Nov 5, 2023
86442e4
Merge origin/annotation-tool
Frodo161 Nov 5, 2023
4c02f5a
Rename variables to proper camelCase
Frodo161 Nov 7, 2023
e08812f
Improve code style
Frodo161 Nov 7, 2023
55e893a
Revert time_stamp.rb
Frodo161 Nov 7, 2023
ec696e9
Remove ==/!= null statements
Frodo161 Nov 7, 2023
0770f98
Add newline after/before function
Frodo161 Nov 7, 2023
53320d7
Add comment
Frodo161 Nov 7, 2023
4182d20
Clean up code/fix bug
Frodo161 Nov 8, 2023
e272579
Check timestamp in backend
Frodo161 Nov 8, 2023
50bb82b
Add annotations status check + update
Frodo161 Nov 8, 2023
5143f20
Fix user authorization
Frodo161 Nov 11, 2023
8cd4341
Reduce complexity of small/large display checks
Splines Nov 12, 2023
958af8f
Implement locking to prevent unnecessary DB calls
Splines Nov 12, 2023
a54d370
Merge branch 'annotation-tool' of github.com:MaMpf-HD/mampf into anno…
Splines Nov 12, 2023
8fcc238
Rewrite handling of annotation update
Splines Nov 12, 2023
741267f
Use gender-neutral pronoun
Splines Nov 12, 2023
0a426d1
Replace alert() by Bootstrap alert
Splines Nov 13, 2023
ee11dc0
Use JQuery syntax and lint file
Splines Nov 13, 2023
921ee6a
Add tooltip (helpdesk) for category
Splines Nov 13, 2023
f95295c
Make color picker elements round
Splines Nov 13, 2023
69914a1
Use paddings instead of line breaks
Splines Nov 13, 2023
3e75dbc
Don't show warnings if annotation was posted
Splines Nov 13, 2023
5359ec6
Show further help link in new tab
Splines Nov 13, 2023
fbfa6f5
Fix unwanted line indentation
Splines Nov 13, 2023
327f724
Use bootstrap switch for preview toggle
Splines Nov 13, 2023
8b83c5a
Use bootstrap switch for annotation toggle
Splines Nov 13, 2023
3a58dca
Fix alignment of preview column & make more responsive
Splines Nov 14, 2023
0ac625f
Fix case-sensitive color lookup bug
Splines Nov 14, 2023
0f95c01
Pause video also when editing an annotation
Splines Nov 14, 2023
ef91b49
Update modal background according to annotation color
Splines Nov 14, 2023
48906d4
Fix another non-capitalized color bug
Splines Nov 14, 2023
689579b
Add transition to modal header background color
Splines Nov 14, 2023
e85913b
Add more restrictive color check
Frodo161 Nov 15, 2023
97f9607
Don't show toggle if it doesn't do anything
Frodo161 Nov 15, 2023
2df9210
Put radius to backend
Frodo161 Nov 16, 2023
0ffd07f
Merge origin/annotation-tool
Frodo161 Nov 16, 2023
8884707
Add cypress rules to ESLint & ignore some patterns
Splines Dec 19, 2023
d1593f1
Allow usage of tempusDominus global variable
Splines Dec 20, 2023
144135e
Ignore JS files with Sprocket syntax
Splines Dec 20, 2023
19342f7
Further improve rules, e.g. allow common globals
Splines Jan 3, 2024
70dbfed
Ignore sprocket syntax in cable.js
Splines Jan 3, 2024
9b9c082
Autofix all `.js` and `.js.erb` files
Splines Jan 3, 2024
cedd0c4
Fix variables in turbolink fix
Splines Jan 3, 2024
f8366ab
Prepend unused variables with "_"
Splines Jan 3, 2024
bc87b65
Get rid of unused widget variable
Splines Jan 3, 2024
a8fc972
Fix specs comment tab alignment
Splines Jan 3, 2024
2fd19b6
Merge branch 'lint/eslint-all' into annotation-tool
Splines Jan 3, 2024
d7e6a2a
Bump active record schema version
Splines Jan 3, 2024
964cdce
Run ESLint autofixes
Splines Jan 3, 2024
1617a4b
Hack: Add Thyme & Annotation tool globals to ESLint globals
Splines Jan 3, 2024
9b5e012
Rename resize to Resizer to avoid name conflicts
Splines Jan 3, 2024
c583150
Show correct modal title.
Frodo161 Jan 4, 2024
8fb59d1
Fix duplicate comment bug
Frodo161 Jan 7, 2024
edd1867
Execute Rubocop safe autocorrect.
Frodo161 Jan 9, 2024
f636d0f
Warn about too long GitHub commit messages (#586)
Splines Jan 11, 2024
2e8e43b
Fix safe rubocops (manually)
Frodo161 Jan 14, 2024
c98ff14
Fix unsafe autocorrections
Frodo161 Jan 16, 2024
eb9484a
Fix comment status (#585)
Splines Jan 16, 2024
475fc04
Migrate `unread_comments` flag (fix inconsistencies) (#587)
Splines Jan 17, 2024
4e6b348
Merge branch 'dev' into annotation-tool
Splines Jan 19, 2024
33a1b23
Use `.instance_of` (fix unwanted merge artifact)
Splines Jan 19, 2024
16fddc6
Clean up annotation migrations
Splines Jan 19, 2024
783e73e
Fix wrong table changing in migration & update schema
Splines Jan 19, 2024
104e77c
Improve annotation area css
Splines Jan 19, 2024
c44a74b
Fix scrollable video bug
Splines Jan 19, 2024
e4b6a2a
Improve icons in annotation area
Splines Jan 19, 2024
0609d39
Increase button click area
Splines Jan 19, 2024
ddf68bc
Change annotation button icon
Splines Jan 19, 2024
c55fd8f
Fix spacing between annotation area buttons
Splines Jan 19, 2024
bf4426a
Add title directly on <a> tags & replace close button
Splines Jan 19, 2024
82a231d
Fix alignment of video control bar
Splines Jan 19, 2024
42a6806
Redesign annotation markers (use map pin icon)
Splines Jan 20, 2024
1484e92
Highlight currently active annotation marker
Splines Jan 21, 2024
0f73732
Reregister hotkeys also after *edit* modal closes
Splines Jan 21, 2024
77535cd
Improve styling of annotation button
Splines Jan 21, 2024
c2fa803
Add subtle gradient to video control bar
Splines Jan 21, 2024
66b6891
Show active annotation marker in front
Splines Jan 21, 2024
bcf96cc
Fix ESLint warnings
Frodo161 Jan 21, 2024
cc3400c
Delete duplicate line
Frodo161 Jan 24, 2024
d32fcab
Remove unused variables resp. add underscore
Frodo161 Jan 24, 2024
ce9aade
Delete unnecessary `annotations.coffee` file
Splines Feb 12, 2024
b068e1a
Show new annotation directly in AnnotationArea
Splines Feb 12, 2024
212707e
Add shortcut to jump to current annotation
Splines Feb 13, 2024
a27e2fd
Make annotation button more prominent
Splines Feb 13, 2024
198ab02
Merge branch 'dev' into annotation-tool
Splines Feb 26, 2024
c4b7b24
Show preview by default in annotation modal
Splines Feb 26, 2024
8fdfed3
Make delete button id more specific
Splines Feb 26, 2024
fbaf525
Add icons to save/delete in annotation modal
Splines Feb 26, 2024
9e356e1
Improve feedback player (CSS, category toggles etc.)
Splines Feb 26, 2024
fcb5459
Remove syntax error (duplicated line)
Splines Feb 26, 2024
8f4c8bc
Remove unnecessary console log
Splines Feb 26, 2024
b2338c3
Fix broken key listeners in feedback player
Splines Feb 26, 2024
db0566b
Improve positioning of heatmap & toggle spikes as well
Splines Feb 26, 2024
090f9fb
Also show heatmap spikes for "mistake" annotations
Splines Feb 26, 2024
09bc0eb
Avoid heatmap being cut off at the sides
Splines Feb 26, 2024
7b3d863
Fix video size in feedback player
Splines Feb 26, 2024
9b99813
Fix small gap in thyme player resize issue
Splines Feb 26, 2024
7f15b0c
Fix wrong resizing when exiting full screen mode
Splines Feb 26, 2024
34d4bc8
Disable annotation key listeners when area closed
Splines Mar 19, 2024
1a4aeb6
Increase width of timeline in feedback player
Splines Mar 19, 2024
e72860a
Fix keyboard shortcut abbreviation hint
Splines Mar 19, 2024
933b8e6
Merge branch 'dev' into annotation-tool
Splines Mar 21, 2024
000774d
Update schema & timestamps for annotation DB migrations
Splines Mar 21, 2024
bd1662c
Ignore other lib paths in autoloading
Splines Mar 22, 2024
6a7f1ce
Do not load Commontator extension in precompiling
Splines Mar 22, 2024
1d20ada
Get rid of "@extend" in SCSS, use CSS classes instead
Splines Mar 22, 2024
047fede
Fix amplitude of heatmap if no annotations are present
Splines Mar 22, 2024
5833428
Use string interpolation to construct heatmap string
Splines Mar 22, 2024
7ecf5e6
Don't rescue `NoDatabaseError`
Splines Mar 22, 2024
d792ed9
Fix nulldb error
Splines Mar 22, 2024
2f4c3bf
Add "sure to delete" warning in annotation modal
Splines Mar 22, 2024
1f880c0
Merge branch 'dev' into annotation-tool
Splines Mar 22, 2024
5b4a69e
Change annotation status numbering & activate by default
Splines Mar 22, 2024
5edfb83
Rename "Thymestamp" to "Timestamp"
Splines Mar 22, 2024
2a43798
Update annotation db migration timestamps (one last time)
Splines Mar 29, 2024
d09470d
Merge branch 'dev' into annotation-tool
Splines Mar 29, 2024
57ba6e6
Use enum for status in emergency link update
Splines Mar 30, 2024
3fff03f
Prepend emergency link with "https://" if necessary
Splines Mar 30, 2024
4cf3692
Remove unwanted change
Splines Mar 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/abilities/annotation_ability.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class AnnotationAbility
include CanCan::Ability

def initialize(user)
can [:edit, :update, :destroy], Annotation do |annotation|
annotation.user == user
end

can [:new, :create, :update_markers, :near_mistake_annotations], Annotation
end

end
4 changes: 2 additions & 2 deletions app/abilities/medium_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def initialize(user)
user ||= User.new
clear_aliased_actions

can [:index, :new, :search], Medium
can [:index, :new, :search, :check_annotation_visibility], Medium

can [:show, :show_comments], Medium do |medium|
medium.visible_for_user?(user) &&
Expand All @@ -16,7 +16,7 @@ def initialize(user)
!user.generic? && medium.visible_for_user?(user)
end

can [:edit, :update, :enrich, :publish, :destroy, :cancel_publication,
can [:edit, :update, :enrich, :feedback, :publish, :destroy, :cancel_publication,
:add_item, :add_reference, :add_screenshot, :remove_screenshot,
:import_script_items, :import_manuscript, :get_statistics,
:render_medium_tags, :fill_quizzable_area,
Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/annotations.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
2 changes: 2 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@
//= require talks
//= require terms
//= require tex_preview
//= require thyme_func
//= require thyme
//= require thyme_editor
//= require thyme_feedback
//= require upload
//= require users
//= require vertices
Expand Down
24 changes: 23 additions & 1 deletion app/assets/javascripts/lectures.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ disableExceptOrganizational = ->
return

$(document).on 'turbolinks:load', ->

# activate all popovers
$('[data-bs-toggle="popover"]').popover()

Expand Down Expand Up @@ -206,6 +205,29 @@ $(document).on 'turbolinks:load', ->
userModalContent.dataset.filled = 'true'
return

# Dynamically render content for entering emergency links.
updateEmergencyLink = (value) ->
if value == "no_link"
$('#direct-link-field').hide()
$('#lecture-link-field').hide()
if value == "lecture_link"
$('#direct-link-field').hide()
$('#lecture-link-field').show()
if value == "direct_link"
$('#lecture-link-field').hide()
$('#direct-link-field').show()
return

emergencyLinkRadios = document.getElementById('emergency-link-status-radios')

if (emergencyLinkRadios != null)
$('#emergency-link-status-radios input:radio:checked').each ->
updateEmergencyLink(this.value)
return
emergencyLinkRadios.addEventListener 'click', (evt) ->
if evt.target && event.target.matches("input[type='radio']")
updateEmergencyLink(evt.target.value)
return

# on small mobile display, use shortened tag badges and
# shortened course titles
Expand Down
Loading