Current Path : C:/xampp/htdocs/moodle/mod/lti/amd/build/ |
Current File : C:/xampp/htdocs/moodle/mod/lti/amd/build/tool_proxy_card_controller.min.js |
define ("mod_lti/tool_proxy_card_controller",["jquery","core/ajax","core/notification","core/templates","mod_lti/tool_proxy","mod_lti/events","mod_lti/keys","core/str"],function(a,b,c,d,e,f,g,h){var i={DELETE_BUTTON:".delete",CAPABILITIES_CONTAINER:".capabilities-container",ACTIVATE_BUTTON:".tool-card-footer a.activate"},j=2e3,k=function(a){return a.find(i.DELETE_BUTTON)},l=function(a){return a.find(i.ACTIVATE_BUTTON)},m=function(a){return a.attr("data-proxy-id")},n=function(a){a.removeClass("announcement loading success fail capabilities")},o=function(a){n(a);a.addClass("announcement loading")},p=function(a){a.removeClass("announcement loading")},q=function(b){var c=a.Deferred();n(b);b.addClass("announcement success");setTimeout(function(){b.removeClass("announcement success");c.resolve()},j);return c},r=function(b){var c=a.Deferred();n(b);b.addClass("announcement fail");setTimeout(function(){b.removeClass("announcement fail");c.resolve()},j);return c},s=function(b){var d=a.Deferred(),f=m(b);o(b);if(""===f){return a.Deferred().resolve()}h.get_strings([{key:"delete",component:"mod_lti"},{key:"delete_confirmation",component:"mod_lti"},{key:"delete",component:"mod_lti"},{key:"cancel",component:"core"}]).done(function(a){c.confirm(a[0],a[1],a[2],a[3],function(){e.delete(f).done(function(){p(b);q(b).done(function(){b.remove();d.resolve()}).fail(c.exception)}).fail(function(a){r(b);d.reject(a)})},function(){p(b);d.resolve()})}).fail(function(a){p(b);c.exception(a);d.reject(a)});return d},t=function(b){var c={proxyid:m(b)};a(document).trigger(f.START_EXTERNAL_REGISTRATION,c)},u=function(a){var b=k(a);b.click(function(b){b.preventDefault();s(a)});b.keypress(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(a.keyCode==g.ENTER||a.keyCode==g.SPACE){a.preventDefault();b.click()}}});var c=l(a);c.click(function(b){b.preventDefault();t(a)});c.keypress(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(a.keyCode==g.ENTER||a.keyCode==g.SPACE){a.preventDefault();c.click()}}})};return{init:function init(a){u(a)}}}); //# sourceMappingURL=tool_proxy_card_controller.min.js.map