_t = (key) -> new Gettext().gettext(key) App.LegislationAnnotatable = renderAnnotationComments: (event) -> $('.comment-box').offset(top: event.offset) $.ajax method: "GET" url: event.annotation_url + "/annotations/" + event.annotation_id + "/comments" dataType: 'script' viewerExtension: (viewer) -> viewer._onHighlightMouseover = (event) -> App.LegislationAllegations.show_comments() $("#comments-box").show() $.event.trigger type: "renderLegislationAnnotation" annotation_id: $(event.target).data("annotation-id") annotation_url: $(event.target).closest(".legislation-annotatable").data("legislation-annotatable-base-url") offset: $(event.target).offset()["top"] scrollToAnchor: -> annotationsLoaded: (annotations) -> if anchor = $(location).attr('hash') ann_id = anchor.split("-")[-1..] el = $("span[data-annotation-id='" + ann_id + "']") App.LegislationAllegations.show_comments() $('html,body').animate({scrollTop: el.offset().top}) $.event.trigger type: "renderLegislationAnnotation" annotation_id: ann_id annotation_url: el.closest(".legislation-annotatable").data("legislation-annotatable-base-url") offset: el.offset()["top"] initialize: -> $(document).on("renderLegislationAnnotation", App.LegislationAnnotatable.renderAnnotationComments) current_user_id = $('html').data('current-user-id') if current_user_id == "" annotator.ui.editor.Editor.template = [ '