From 206e66d8f88186975bd6647791fe8690b582af40 Mon Sep 17 00:00:00 2001 From: Brad Humphrey Date: Tue, 6 Jan 2015 16:54:53 -0700 Subject: [PATCH] allow multple rce on the same page to launch resource selection test plan: - Add an editor button tool - Create a quiz - Add something from the LTI tool to the main RCE - Without refreshing create a quiz question, and add LTI content to it - Both RCEs should have LTI content fixes PLAT-698 Change-Id: Ie12f6d405fd321c059ea86fd5c9d4ea3483121f2 Reviewed-on: https://gerrit.instructure.com/46636 Tested-by: Jenkins Reviewed-by: Nathan Mills QA-Review: August Thornton Product-Review: Brad Humphrey --- public/javascripts/instructure_helper.js | 1 - .../editor_plugin.js | 115 +++++++++--------- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/public/javascripts/instructure_helper.js b/public/javascripts/instructure_helper.js index 5d57f27c1f9..826604af21f 100644 --- a/public/javascripts/instructure_helper.js +++ b/public/javascripts/instructure_helper.js @@ -56,7 +56,6 @@ define([ window.external_tool_dialog = { ready: function(data) { - $("#external_tool_button_dialog:visible").triggerHandler('selection', data); $("#resource_selection_dialog:visible").triggerHandler('selection', data); $("#homework_selection_dialog:visible").triggerHandler('selection', data); }, diff --git a/public/javascripts/tinymce/jscripts/tiny_mce/plugins/instructure_external_tools/editor_plugin.js b/public/javascripts/tinymce/jscripts/tiny_mce/plugins/instructure_external_tools/editor_plugin.js index 5d23035b038..8a4c6a526f6 100644 --- a/public/javascripts/tinymce/jscripts/tiny_mce/plugins/instructure_external_tools/editor_plugin.js +++ b/public/javascripts/tinymce/jscripts/tiny_mce/plugins/instructure_external_tools/editor_plugin.js @@ -77,64 +77,65 @@ define([ .appendTo("body"); }); }) - .bind('selection', function(event, data) { - var editor = $dialog.data('editor') || ed; - if(data.return_type == 'lti_launch_url') { - if($("#external_tool_retrieve_url").attr('href')) { - var external_url = $.replaceTags($("#external_tool_retrieve_url").attr('href'), 'url', data.url); - $("#" + ed.id).editorBox('create_link', { - url: external_url, - title: data.title, - text: data.text - }); - } else { - console.log("cannot embed basic lti links in this context"); - } - } else if(data.return_type == 'image_url') { - var html = $("
").append($("", { - src: data.url, - alt: data.alt - }).css({ - width: data.width, - height: data.height - })).html(); - $("#" + ed.id).editorBox('insert_code', html); - } else if(data.return_type == 'url') { - $("#" + ed.id).editorBox('create_link', { - url: data.url, - title: data.title, - text: data.text, - target: data.target == '_blank' ? '_blank' : null - }); - } else if(data.return_type == 'file') { - $("#" + ed.id).editorBox('create_link', { - url: data.url, - title: data.filename, - text: data.filename - }); - } else if(data.return_type == 'iframe') { - var html = $("
").append($("