Last active
July 5, 2016 14:10
-
-
Save christopher-b/16488b5385d4fdc04e2946441b968fca to your computer and use it in GitHub Desktop.
Canvas LMS: Add a button to the sidebar to trigger RTE LTI Launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
var $body = $('body'); | |
// Add a button to launch the Outline Builder, which triggers the RTE LTI Launch | |
if($body.hasClass('syllabus')) { | |
// #editor_tabs is only visible when the RTE is active | |
$('#editor_tabs').prepend('<div style="padding-bottom:1em;"><a class="Button Button--primary icon-compose" id="launch_outline_editor_button">Course Outline Builder</a></div>'); | |
$('#launch_outline_editor_button').click(function(){ | |
// Existing RTE LTI buttons are added with aria-label set to the "Name" of the tool, as defined in the tool settings UI, not the XML | |
$('div[aria-label="Outline Builder"]').click(); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment