MDL-69092 mod_lti: Fix typo.

This commit is contained in:
Ilya Tregubov 2021-11-19 09:13:03 +02:00
parent 36f3aee38e
commit 47c9289420
4 changed files with 4 additions and 9 deletions

View File

@ -1,2 +1,2 @@
define ("mod_lti/tool_configure_controller",["jquery","core/ajax","core/paged_content_factory","core/notification","core/templates","mod_lti/events","mod_lti/keys","mod_lti/tool_types_and_proxies","mod_lti/tool_type","mod_lti/tool_proxy","core/str","core/config"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m={EXTERNAL_REGISTRATION_CONTAINER:"#external-registration-container",EXTERNAL_REGISTRATION_PAGE_CONTAINER:"#external-registration-page-container",EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER:"#external-registration-template-container",CARTRIDGE_REGISTRATION_CONTAINER:"#cartridge-registration-container",CARTRIDGE_REGISTRATION_FORM:"#cartridge-registration-form",ADD_TOOL_FORM:"#add-tool-form",TOOL_CARD_CONTAINER:"#tool-card-container",TOOL_LIST_CONTAINER:"#tool-list-container",TOOL_CREATE_BUTTON:"#tool-create-button",TOOL_CREATE_LTILEGACY_BUTTON:"#tool-createltilegacy-button",REGISTRATION_CHOICE_CONTAINER:"#registration-choice-container",TOOL_URL:"#tool-url"},n=function(){return a(m.TOOL_LIST_CONTAINER)},o=function(){return a(m.TOOL_CARD_CONTAINER)},p=function(){return a(m.EXTERNAL_REGISTRATION_CONTAINER)},q=function(){return a(m.CARTRIDGE_REGISTRATION_CONTAINER)},r=function(){return a(m.REGISTRATION_CHOICE_CONTAINER)},s=function(b){if(b.data&&"org.imsglobal.lti.close"===b.data.subject){a(m.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER).empty();v();A();D();A();H()}},t=function(b){a(m.EXTERNAL_REGISTRATION_PAGE_CONTAINER).removeClass("hidden");var c=a(m.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER);c.append(a("<iframe src='startltiadvregistration.php?url="+encodeURIComponent(b)+"&sesskey="+l.sesskey+"'></iframe>"));y();window.addEventListener("message",s,!1)},u=function(){return a(m.TOOL_URL).val()},v=function(){p().addClass("hidden")},w=function(){q().addClass("hidden")},x=function(){r().addClass("hidden")},y=function(){w();x();p().removeClass("hidden");B(p())},z=function(a){v();x();var b=q();b.find("input").val("");b.removeClass("hidden");b.find(m.CARTRIDGE_REGISTRATION_FORM).attr("data-cartridge-url",a);B(b)},A=function(){v();w();r().removeClass("hidden");B(r())},B=function(a){var b=a.children().detach();b.appendTo(a)},C=function(){n().addClass("hidden")},D=function(){n().removeClass("hidden")},E=function(a){var b=a.error?"error":"success";d.addNotification({message:a.message,type:b})},F=function(a){a.addClass("loading")},G=function(a){a.removeClass("loading")},H=function(){M.cfg.js_pending("reloadToolList");var a=o(),b=n();I().done(function(d){c.createWithTotalAndLimit(d.count,60,function(a){return a.map(function(a){return J(a.limit,a.offset).then(function(a){return K(a)})})},{showFirstLast:!0}).done(function(b,c){e.replaceNodeContents(a,b,c)}).always(function(){G(b);M.cfg.js_complete("reloadToolList")})});F(b)},I=function(){return h.count({orphanedonly:!0}).done(function(a){return a}).catch(function(a){d.exception(a);return{count:0}})},J=function(a,b){var c={orphanedonly:!0};if(null!==a&&!Number.isNaN(a)){c.limit=a}if(null!==b&&!Number.isNaN(b)){c.offset=b}return h.query(c).done(function(a){return a}).catch(function(c){d.exception(c);return{types:[],proxies:[],limit:a,offset:b}})},K=function(a){var b={tools:a.types,proxies:a.proxies};return e.render("mod_lti/tool_list",b).done(function(a,b){return{html:a,js:b}})},L=function(){var b=u().trim();if(b){a(m.TOOL_URL).val("");C();t(b)}},N=function(){var b=u().trim();if(""===b){return a.Deferred().resolve()}var c=a(m.TOOL_CREATE_LTILEGACY_BUTTON);F(c);var e=i.isCartridge(b);e.always(function(){G(c)});e.done(function(c){if(c.iscartridge){a(m.TOOL_URL).val("");a(document).trigger(f.START_CARTRIDGE_REGISTRATION,b)}else{a(document).trigger(f.START_EXTERNAL_REGISTRATION,{url:b})}});e.fail(function(){k.get_string("errorbadurl","mod_lti").done(function(b){a(document).trigger(f.REGISTRATION_FEEDBACK,{message:b,error:!0})}).fail(d.exception)});return e},O=function(){a(document).on(f.NEW_TOOL_TYPE,function(){H()});a(document).on(f.START_EXTERNAL_REGISTRATION,function(){y();a(m.TOOL_URL).val("");C()});a(document).on(f.STOP_EXTERNAL_REGISTRATION,function(){D();A()});a(document).on(f.START_CARTRIDGE_REGISTRATION,function(a,b){z(b)});a(document).on(f.STOP_CARTRIDGE_REGISTRATION,function(){q().find(m.CARTRIDGE_REGISTRATION_FORM).removeAttr("data-cartridge-url");A()});a(document).on(f.REGISTRATION_FEEDBACK,function(a,b){E(b)});var b=a(m.TOOL_CREATE_LTILEGACY_BUTTON);b.click(function(a){a.preventDefault();N()});var c=a(m.TOOL_CREATE_BUTTON);c.click(function(a){a.preventDefault();L()})};return{init:function init(){O();H()}}});
define ("mod_lti/tool_configure_controller",["jquery","core/ajax","core/paged_content_factory","core/notification","core/templates","mod_lti/events","mod_lti/keys","mod_lti/tool_types_and_proxies","mod_lti/tool_type","mod_lti/tool_proxy","core/str","core/config"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m={EXTERNAL_REGISTRATION_CONTAINER:"#external-registration-container",EXTERNAL_REGISTRATION_PAGE_CONTAINER:"#external-registration-page-container",EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER:"#external-registration-template-container",CARTRIDGE_REGISTRATION_CONTAINER:"#cartridge-registration-container",CARTRIDGE_REGISTRATION_FORM:"#cartridge-registration-form",ADD_TOOL_FORM:"#add-tool-form",TOOL_CARD_CONTAINER:"#tool-card-container",TOOL_LIST_CONTAINER:"#tool-list-container",TOOL_CREATE_BUTTON:"#tool-create-button",TOOL_CREATE_LTILEGACY_BUTTON:"#tool-createltilegacy-button",REGISTRATION_CHOICE_CONTAINER:"#registration-choice-container",TOOL_URL:"#tool-url"},n=function(){return a(m.TOOL_LIST_CONTAINER)},o=function(){return a(m.TOOL_CARD_CONTAINER)},p=function(){return a(m.EXTERNAL_REGISTRATION_CONTAINER)},q=function(){return a(m.CARTRIDGE_REGISTRATION_CONTAINER)},r=function(){return a(m.REGISTRATION_CHOICE_CONTAINER)},s=function(b){if(b.data&&"org.imsglobal.lti.close"===b.data.subject){a(m.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER).empty();v();A();D();A();H()}},t=function(b){a(m.EXTERNAL_REGISTRATION_PAGE_CONTAINER).removeClass("hidden");var c=a(m.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER);c.append(a("<iframe src='startltiadvregistration.php?url="+encodeURIComponent(b)+"&sesskey="+l.sesskey+"'></iframe>"));y();window.addEventListener("message",s,!1)},u=function(){return a(m.TOOL_URL).val()},v=function(){p().addClass("hidden")},w=function(){q().addClass("hidden")},x=function(){r().addClass("hidden")},y=function(){w();x();p().removeClass("hidden");B(p())},z=function(a){v();x();var b=q();b.find("input").val("");b.removeClass("hidden");b.find(m.CARTRIDGE_REGISTRATION_FORM).attr("data-cartridge-url",a);B(b)},A=function(){v();w();r().removeClass("hidden");B(r())},B=function(a){var b=a.children().detach();b.appendTo(a)},C=function(){n().addClass("hidden")},D=function(){n().removeClass("hidden")},E=function(a){var b=a.error?"error":"success";d.addNotification({message:a.message,type:b})},F=function(a){a.addClass("loading")},G=function(a){a.removeClass("loading")},H=function(){M.util.js_pending("reloadToolList");var a=o(),b=n();I().done(function(d){c.createWithTotalAndLimit(d.count,60,function(a){return a.map(function(a){return J(a.limit,a.offset).then(function(a){return K(a)})})},{showFirstLast:!0}).done(function(b,c){e.replaceNodeContents(a,b,c)}).always(function(){G(b);M.util.js_complete("reloadToolList")})});F(b)},I=function(){return h.count({orphanedonly:!0}).done(function(a){return a}).catch(function(a){d.exception(a);return{count:0}})},J=function(a,b){var c={orphanedonly:!0};if(null!==a&&!Number.isNaN(a)){c.limit=a}if(null!==b&&!Number.isNaN(b)){c.offset=b}return h.query(c).done(function(a){return a}).catch(function(c){d.exception(c);return{types:[],proxies:[],limit:a,offset:b}})},K=function(a){var b={tools:a.types,proxies:a.proxies};return e.render("mod_lti/tool_list",b).done(function(a,b){return{html:a,js:b}})},L=function(){var b=u().trim();if(b){a(m.TOOL_URL).val("");C();t(b)}},N=function(){var b=u().trim();if(""===b){return a.Deferred().resolve()}var c=a(m.TOOL_CREATE_LTILEGACY_BUTTON);F(c);var e=i.isCartridge(b);e.always(function(){G(c)});e.done(function(c){if(c.iscartridge){a(m.TOOL_URL).val("");a(document).trigger(f.START_CARTRIDGE_REGISTRATION,b)}else{a(document).trigger(f.START_EXTERNAL_REGISTRATION,{url:b})}});e.fail(function(){k.get_string("errorbadurl","mod_lti").done(function(b){a(document).trigger(f.REGISTRATION_FEEDBACK,{message:b,error:!0})}).fail(d.exception)});return e},O=function(){a(document).on(f.NEW_TOOL_TYPE,function(){H()});a(document).on(f.START_EXTERNAL_REGISTRATION,function(){y();a(m.TOOL_URL).val("");C()});a(document).on(f.STOP_EXTERNAL_REGISTRATION,function(){D();A()});a(document).on(f.START_CARTRIDGE_REGISTRATION,function(a,b){z(b)});a(document).on(f.STOP_CARTRIDGE_REGISTRATION,function(){q().find(m.CARTRIDGE_REGISTRATION_FORM).removeAttr("data-cartridge-url");A()});a(document).on(f.REGISTRATION_FEEDBACK,function(a,b){E(b)});var b=a(m.TOOL_CREATE_LTILEGACY_BUTTON);b.click(function(a){a.preventDefault();N()});var c=a(m.TOOL_CREATE_BUTTON);c.click(function(a){a.preventDefault();L()})};return{init:function init(){O();H()}}});
//# sourceMappingURL=tool_configure_controller.min.js.map

File diff suppressed because one or more lines are too long

View File

@ -300,7 +300,7 @@ define(['jquery', 'core/ajax', 'core/paged_content_factory', 'core/notification'
*/
var reloadToolList = function() {
// Behat tests should wait for the tool list to load.
M.cfg.js_pending('reloadToolList');
M.util.js_pending('reloadToolList');
const cardContainer = getToolCardContainer();
const listContainer = getToolListContainer();
@ -327,7 +327,7 @@ define(['jquery', 'core/ajax', 'core/paged_content_factory', 'core/notification'
})
.always(function() {
stopLoading(listContainer);
M.cfg.js_complete('reloadToolList');
M.util.js_complete('reloadToolList');
});
});
startLoading(listContainer);

View File

@ -14,7 +14,6 @@ Feature: Navigate existing LTI tool types using pagination
Scenario: View first page of tool types.
Given I log in as "admin"
When I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
And I wait until the page is ready
Then I should see "Test tool 30"
And "Test tool 70" "text" should not be visible
@ -22,9 +21,7 @@ Feature: Navigate existing LTI tool types using pagination
Scenario: View second page of tool types using page 2 button.
Given I log in as "admin"
When I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
And I wait until the page is ready
And I click on "2" "link"
And I wait until the page is ready
Then I should see "Test tool 70"
And "Test tool 30" "text" should not be visible
@ -32,8 +29,6 @@ Feature: Navigate existing LTI tool types using pagination
Scenario: View last page of tool types using page 2 button.
Given I log in as "admin"
When I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
And I wait until the page is ready
And I click on "Last" "link"
And I wait until the page is ready
Then I should see "Test tool 70"
And "Test tool 30" "text" should not be visible