2 lines
8.8 KiB
JavaScript
2 lines
8.8 KiB
JavaScript
|
function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}define("taoDelivery/controller/DeliveryServer/index",["jquery","lodash","i18n","module","core/router","ui/feedback","core/logger","layout/loading-bar","context","util/locale","url-polyfill"],function($,_,__,module,router,feedback,loggerFactory,loadingBar,context,locale){'use strict';var logger=loggerFactory("deliveryServer"),accessibilityLaunchKeyCodes=[13,32],displayPermanentMessage=function(level,content){level&&content&&feedback($(".permanent-feedback"))[level](content,{timeout:-1,popup:!1})},getLTIErrorParameters=function(){var _URL=new URL(window.location.href),searchParams=_URL.searchParams;return["lti_errormsg","lti_errorlog"].reduce(function(params,paramName){return searchParams.has(paramName)&&(params[paramName]=searchParams.get(paramName)),params},{})};return{start:function start(parameters){var deliveryStarted=!1,runDelivery=function(url){_.isString(url)&&!_.isEmpty(url)&&(deliveryStarted=!0,loadingBar.start(),window.location.href=url)},config=module.config();parameters&¶meters.messages&&_.forEach(parameters.messages,function(message){displayPermanentMessage(message.level,message.content)});var _getLTIErrorParameter=getLTIErrorParameters(),ltiErrorMsg=_getLTIErrorParameter.lti_errormsg,ltiErrorLog=_getLTIErrorParameter.lti_errorlog;ltiErrorMsg&&displayPermanentMessage("error",ltiErrorMsg.length?ltiErrorMsg:__("An error occurred!"));ltiErrorLog&&logger.error(ltiErrorLog);var launchDelivery=function(e){var $elt=$(e.currentTarget);e.preventDefault(),e.stopPropagation(),deliveryStarted||$elt.hasClass("disabled")||runDelivery($elt.data().launch_url)};(function(){$(".delivery-scope").attr({dir:locale.getLanguageDirection(context.locale)})})(),$(".entry-point").on("click",launchDelivery),$(".entry-point").on("keyup",function(e){accessibilityLaunchKeyCodes.includes(e.which)&&launchDelivery(e)}),config&&_.isArray(config.extraRoutes)&&config.extraRoutes.length&&router.dispatch(config.extraRoutes)}}}),define("taoDelivery/controller/routes",[],function(){'use strict';return{}}),define("tpl!taoDelivery/tpl/fullscreen-modal-feedback",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var stack1,helper,buffer="";return buffer+="(",(helper=helpers.launchButton)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.launchButton,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+")",buffer}function program3(depth0,data){var helper,options,buffer="";return buffer+="\n <button class=\"btn-info small enter-full-screen\" type=\"button\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Enter full screen",options):helperMissing.call(depth0,"__","Enter full screen",options)))+"</button>\n ",buffer}function program5(depth0,data){var helper,options,buffer="";return buffer+="\n <button class=\"btn-info small close-full-screen-prompt\" type=\"button\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Close this prompt",options):helperMissing.call(depth0,"__","Close this prompt",options)))+"</button>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var stack1,helper,options,buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,self=this;return buffer+="<div class=\"modal-feedback modal full-screen-modal\">\n <div class=\"modal-body clearfix\">\n <p class=\"message\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"This test needs to be taken in full screen
|
||
|
//# sourceMappingURL=taoDelivery.min.js.map
|