Skip to content

Commit

Permalink
Continuous Release 1.11.0
Browse files Browse the repository at this point in the history
Merge pull request #605 from MaMpf-HD/dev
Annotation Tool 🙌
  • Loading branch information
Splines authored Apr 2, 2024
2 parents a0e26f8 + ac7808f commit c81dc10
Show file tree
Hide file tree
Showing 84 changed files with 4,677 additions and 1,116 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
// Spell Checker
//////////////////////////////////////
"cSpell.words": [
"commontator",
"turbolinks"
]
}
11 changes: 11 additions & 0 deletions app/abilities/annotation_ability.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class AnnotationAbility
include CanCan::Ability

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

can [:new, :create, :update_annotations, :num_nearby_posted_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, :statistics,
:render_medium_tags, :fill_quizzable_area,
Expand Down
48 changes: 45 additions & 3 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,53 @@
//= require talks
//= require terms
//= require tex_preview
//= require thyme
//= require thyme_editor
//= require upload
//= require users
//= require vertices
//= require watchlists
//= require turbolinks
//= require search_tags

//= require search_tags

/*
* THYME RELATED SCRIPTS
* (warning: the order of the scripts is important
* - do not switch to alphabetical order!)
*/
//= require thyme/components/component
//= require thyme/components/add_item_button
//= require thyme/components/add_reference_button
//= require thyme/components/add_screenshot_button
//= require thyme/components/annotation_category_toggle
//= require thyme/components/annotations_toggle
//= require thyme/components/annotation_button
//= require thyme/components/full_screen_button
//= require thyme/components/ia_button
//= require thyme/components/ia_back_button
//= require thyme/components/ia_close_button
//= require thyme/components/mute_button
//= require thyme/components/next_chapter_button
//= require thyme/components/play_button
//= require thyme/components/previous_chapter_button
//= require thyme/components/seek_bar
//= require thyme/components/speed_selector
//= require thyme/components/time_button
//= require thyme/components/volume_bar
//= require thyme/annotations/category_enum
//= require thyme/annotations/category
//= require thyme/annotations/subcategory
//= require thyme/annotations/annotation
//= require thyme/annotations/annotation_area
//= require thyme/annotations/annotation_manager
//= require thyme/attributes
//= require thyme/chapter_manager
//= require thyme/control_bar_hider
//= require thyme/display_manager
//= require thyme/heatmap
//= require thyme/key_shortcuts
//= require thyme/metadata_manager
//= require thyme/resizer
//= require thyme/utility
//= require thyme/thyme_player
//= require thyme/thyme_editor
//= require thyme/thyme_feedback
23 changes: 23 additions & 0 deletions app/assets/javascripts/lectures.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,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

0 comments on commit c81dc10

Please sign in to comment.