1 line
12 KiB
Plaintext
1 line
12 KiB
Plaintext
{"version":3,"sources":["../../loader/bootstrap.js","../controller/DeliveryServer/index.js","module-create.js"],"names":[],"mappings":"AAsBA,CAAA,UAAA,CACA,aADA,GAKA,CAAA,YAAA,CAAA,QAAA,CAAA,cAAA,CAAA,YAAA,CALA,CAMA,SAAA,CAAA,YAAA,CAAA,YAAA,CAAA,aAAA,CANA,CAOA,MAAA,CAAA,YAAA,CAAA,YAAA,CAAA,aAAA,CAPA,CASA,cAAA,CAAA,UAAA,IACA,CAAA,iBAAA,CAAA,EADA,CAEA,cAAA,CAAA,YAAA,CAAA,YAAA,CAAA,iBAAA,CAFA,CAGA,MAAA,CAAA,YAAA,CAAA,YAAA,CAAA,aAAA,CAHA,CAIA,GAAA,CACA,iBAAA,CAAA,IAAA,CAAA,KAAA,CAAA,MAAA,CACA,CAAA,MAAA,GAAA,CAAA,CACA,iBAAA,CAAA,EACA,CACA,MAAA,CAAA,OAAA,CAAA,CAAA,cAAA,CAAA,CAAA,SAAA,UAAA,CAAA,CACA,GAAA,CAAA,eAAA,CAAA,UAAA,CACA,MAAA,CAAA,OADA,GAEA,MAAA,CAAA,OAAA,GAFA,CAGA,UAAA,CAAA,KAAA,CAAA,iBAAA,CAHA,CAKA,CALA,CAMA,QAAA,CAAA,gBAAA,CAAA,kBAAA,CAAA,eAAA,IAPA,CAQA,UAAA,GAAA,QAAA,CAAA,UARA,EASA,eAAA,EAEA,CAXA,CAYA,CA9BA,CAiCA,MAAA,CAAA,OAAA,CAAA,CAAA,SAAA,CAAA,CAAA,UAAA,CAGA,MAAA,CAAA,WAHA,GAMA,MAAA,CAAA,MAAA,CAAA,EANA,CAaA,MAAA,CAAA,WAAA,CAAA,SAAA,OAAA,CAAA,CACA,OAAA,CAAA,OAAA,EAAA,EADA,CAEA,OAAA,CAAA,OAAA,CAAA,MAAA,CAAA,MAAA,CAAA,OAAA,CAFA,CAGA,OAAA,CAAA,OAAA,CAAA,MAAA,CAAA,SAAA,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AA,CAAA,eAAA,EAJA,CAMA,eAAA,EAAA,IAAA,CAAA,QAAA,CAAA,UAAA,CANA,EAOA,WAAA,CAAA,IAAA,CAAA,IAAA,GAAA,UAAA,CAEA,CATA,CAWA,CAnCA,UAAA,CAEA,CAAA,CAAA,iBAAA,CAAA,CAAA,IAAA,CAAA,CAAA,GAAA,CAAA,MAAA,CAAA,oBAAA,CAAA,OAAA,CAAA,MAAA,CAAA,CAAA,CACA,CAgCA,GArDA,CAsDA,CAAA,CAAA,cAAA,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,cAAA,CAtDA,CAuDA,CAAA,CAAA,cAAA,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,SAAA,CAAA,CAAA,CACA,2BAAA,CAAA,QAAA,CAAA,CAAA,CAAA,KAAA,CADA,EAEA,cAAA,CAAA,CAAA,CAEA,CAJA,CAvDA,CA8DA,MAAA,EAAA,CAAA,CAAA,OAAA,CAAA,MAAA,CAAA,WAAA,CAAA,EAAA,MAAA,CAAA,WAAA,CAAA,MA9DA,EA+DA,MAAA,CAAA,QAAA,CAAA,MAAA,CAAA,WAAA,CAEA,CAxEA,CA0EA,CA7HA,C,CCvBA,MAAA,CAAA,+CAAA,CAAA,UAAA,CAAA,CAAA,C","sourcesContent":["/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2016-2018 (original work) Open Assessment Technologies SA ;\n */\n\n/**\n * Bootstrap the app, start the entry controller\n * @author Bertrand Chevrier <bertrand@taotesting.com>\n */\n(function(){\n 'use strict';\n\n\n\n var loaderScript = document.getElementById('amd-loader');\n var configUrl = loaderScript.getAttribute('data-config');\n var bundle = loaderScript.getAttribute('data-bundle');\n\n var loadController = function loadController(){\n var controllerOptions = {};\n var controllerPath = loaderScript.getAttribute('data-controller');\n var params = loaderScript.getAttribute('data-params');\n try{\n controllerOptions = JSON.parse(params);\n } catch(err){\n controllerOptions = {};\n }\n window.require([controllerPath], function(controller) {\n var startController = function startController(){\n if(!window.started){\n window.started = true;\n controller.start(controllerOptions);\n }\n };\n document.addEventListener('readystatechange', startController, false);\n if (document.readyState === 'complete') {\n startController();\n }\n });\n };\n\n //always start to load the config\n window.require([configUrl], function() {\n\n //define the global loading mechanism\n if(!window.loadBundles){\n //keep tracl of loaded bundles, even if require does it,\n //this prevent some unecessary cycles\n window.loaded = {};\n\n /**\n * Loading entry point for inter bundle dependency,\n * always take the bundles from the params and window.bundles\n * @param {String[]} [bundles] - an optional list of bundle to load\n */\n window.loadBundles = function loadBundles(bundles){\n bundles = bundles || [];\n bundles = bundles.concat(window.bundles)\n bundles = bundles.filter( function(item, index){\n return item && bundles.indexOf(item) === index && window.loaded[item] !== true;\n });\n require(bundles, function(){\n bundles.forEach( function( item ) {\n window.loaded[item] = true;\n });\n loadController();\n });\n }\n }\n\n if(bundle || (window.bundles && window.bundles.length)) {\n window.loadBundles([bundle]);\n } else {\n loadController();\n }\n });\n})();\n\ndefine(\"loader/bootstrap\", function(){});\n\n","/*\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2016-2019 (original work) Open Assessment Technologies SA ;\n *\n */\n\n/**\n * The DeliveryServer/index controller.\n *\n * @author Bertrand Chevrier <bertrand@taotesting.com>\n */\ndefine('taoDelivery/controller/DeliveryServer/index',[\n 'jquery',\n 'lodash',\n 'i18n',\n 'module',\n 'core/router',\n 'ui/feedback',\n 'core/logger',\n 'layout/loading-bar',\n 'context',\n 'util/locale',\n 'url-polyfill'\n], function($, _, __, module, router, feedback, loggerFactory, loadingBar, context, locale){\n 'use strict';\n\n const logger = loggerFactory('deliveryServer');\n\n const accessibilityLaunchKeyCodes = [13, 32]; // \"enter\" or \"space\" - list of keys able to run delivery\n\n /**\n * Display a permanent message\n * @param {String} level - in supported feedbacks' levels\n * @param {String} content - the message to display\n */\n const displayPermanentMessage = (level, content) => {\n if(level && content){\n feedback($('.permanent-feedback'))[level](content, {\n timeout : -1,\n popup : false\n });\n }\n };\n\n /**\n * Extract standard LTI error parameters from query string\n * @returns {Object} LTI error parameters\n */\n const getLTIErrorParameters = () => {\n const { searchParams } = new URL(window.location.href);\n\n return ['lti_errormsg', 'lti_errorlog'].reduce((params, paramName) => {\n if (searchParams.has(paramName)) {\n params[paramName] = searchParams.get(paramName);\n }\n return params;\n }, {});\n };\n\n /**\n * The DeliveryServer/index controller\n */\n return {\n\n /**\n * Controller entry point\n * @param {Object} [parameters] - controller's data\n * @param {Object} [parameters.messages] - message data to display\n */\n start(parameters){\n let deliveryStarted = false;\n\n /**\n * Run/open the given delivery\n * @param {String} url - the delivery URL\n */\n const runDelivery = function runDelivery (url) {\n if(_.isString(url) && !_.isEmpty(url)){\n deliveryStarted = true;\n loadingBar.start();\n window.location.href = url;\n }\n };\n\n /**\n * improve UI to support rtl languages\n */\n const supportRTL = function supportRTL () {\n // adding attr for RTL languages\n $('.delivery-scope').attr({dir: locale.getLanguageDirection(context.locale)});\n };\n\n const config = module.config();\n\n // display as feedbacks any messages in parameters\n if (parameters && parameters.messages) {\n _.forEach(parameters.messages, message => {\n displayPermanentMessage(message.level, message.content);\n });\n }\n\n // display as feedbacks any LTI error messages from query string\n const { lti_errormsg: ltiErrorMsg, lti_errorlog: ltiErrorLog } = getLTIErrorParameters();\n\n if (ltiErrorMsg) {\n displayPermanentMessage('error', ltiErrorMsg.length ? ltiErrorMsg : __('An error occurred!'));\n };\n if (ltiErrorLog) {\n logger.error(ltiErrorLog);\n };\n\n const launchDelivery = function (e) {\n const $elt = $(e.currentTarget);\n\n e.preventDefault();\n e.stopPropagation();\n\n if(!deliveryStarted && !$elt.hasClass('disabled')){\n runDelivery($elt.data().launch_url);\n }\n };\n\n supportRTL();\n $('.entry-point').on('click', launchDelivery);\n $('.entry-point').on('keyup', (e) => {\n if(accessibilityLaunchKeyCodes.includes(e.which)) {\n launchDelivery(e);\n }\n });\n\n // dispatch any extra registered routes\n if (config && _.isArray(config.extraRoutes) && config.extraRoutes.length) {\n router.dispatch(config.extraRoutes);\n }\n }\n };\n});\n\n","\ndefine(\"taoDelivery/loader/deliveryServerIndex.bundle\", function(){});\n"]} |