tao-test/app/taoDeliveryRdf/views/js/loader/taoDeliveryRdf.min.js

2 lines
9.5 KiB
JavaScript
Raw Normal View History

2022-08-29 20:14:13 +02:00
define("css!taoDeliveryRdfCss/delivery-rdf",[],function(){}),define("taoDeliveryRdf/controller/DeliveryMgmt/editDelivery",["jquery","util/url","ui/modal","css!taoDeliveryRdfCss/delivery-rdf.css"],function($,urlUtil){'use strict';return{start:function start(){$("#exclude-btn").click(function(){var delivery=$(this).data("delivery");$("#testtaker-form").load(urlUtil.route("excludeTesttaker","DeliveryMgmt","taoDeliveryRdf",{uri:delivery}),function(){$("body").prepend($("#modal-container")),$("#testtaker-form").modal()})})}}}),define("taoDeliveryRdf/controller/DeliveryMgmt/testtaker",["jquery","i18n","helpers","module","layout/section","ui/feedback"],function($,__,helpers,module,section,feedback){'use strict';function switchList(){var target,current=$(this).parent().attr("id");"excludedList"==current?target=$("#assignedList"):"assignedList"==current&&(target=$("#excludedList")),"undefined"!=typeof target&&(target.append(this),this.scrollIntoView())}var timeout,$search=$("#tt-filter"),$list=$("#assignedList"),liveSearch=function(){var pattern=$search.val();clearTimeout(timeout),timeout=setTimeout(function(){filterList(new RegExp(pattern),$list)},300)},filterList=function(regex,list){list.children().each(function(index,element){null===$(element).text().match(regex)?$(element).hide():$(element).show()})};return{start:function start(){$("#save-tt").click(function(){var excluded=[];$("#excludedList > li").each(function(){excluded.push($(this).data("uri"))});var assemblyUri=$("input[name=\"assemblyUri\"]").val();$.ajax({url:helpers._url("saveExcluded","DeliveryMgmt","taoDeliveryRdf"),type:"POST",data:{uri:assemblyUri,excluded:JSON.stringify(excluded)},dataType:"json",success:function success(response){response.saved&&(feedback().success(__("Selection saved successfully")),section.loadContentBlock(helpers._url("editDelivery","DeliveryMgmt","taoDeliveryRdf"),{uri:assemblyUri}))}})}),$("#assignedList > li").click(switchList),$("#excludedList > li").click(switchList),$("#close-tt").click(function(){$("#testtaker-form").modal("close")}),$search.keyup(liveSearch).siblings(".ctrl").click(liveSearch)}}}),define("taoDeliveryRdf/util/providers/testsProvider",["jquery","i18n","util/url"],function($,__,urlUtils){'use strict';return{listTests:function listTests(data){return new Promise(function(resolve,reject){$.ajax({url:urlUtils.route("getAvailableTests","DeliveryMgmt","taoDeliveryRdf"),data:{q:data.q,page:data.page},type:"GET",dataType:"JSON"}).done(function(tests){tests?resolve(tests):reject(new Error(__("Unable to load tests")))}).fail(function(){reject(new Error(__("Unable to load tests")))})})}}}),define("taoDeliveryRdf/util/forms/deliveryFormHelper",["jquery","lodash","i18n","ui/filter","ui/feedback","layout/actions","ui/taskQueue/taskQueue","ui/taskQueueButton/standardButton"],function($,_,__,filterFactory,feedback,actionManager,taskQueue,taskCreationButtonFactory){'use strict';var refreshTree=function(uriResource){actionManager.trigger("refresh",{uri:uriResource})};return{createSelectorInput:function createSelectorInput(_ref){var $filterContainer=_ref.$filterContainer,$inputElement=_ref.$inputElement,taskButton=_ref.taskButton,dataProvider=_ref.dataProvider,_ref$inputPlaceholder=_ref.inputPlaceholder,inputPlaceholder=void 0===_ref$inputPlaceholder?__("Select the test you want to publish to the test-takers"):_ref$inputPlaceholder,_ref$inputLabel=_ref.inputLabel,inputLabel=void 0===_ref$inputLabel?__("Select the test"):_ref$inputLabel;return filterFactory($filterContainer,{placeholder:inputPlaceholder,label:inputLabel,width:"64%",quietMillis:1e3}).on("change",function(selection){$inputElement.val(selection),selection?taskButton.enable():taskButton.disable()}).on("request",function(params){dataProvider.list(params.data).then(function(data){params.success(data)}).catch(function(err){params.error(err),feedback().error(err)})}).render("<%- text %>")},replaceSubmitWithTaskButton:function replaceSubmitWithTaskButton(_ref2){var $form=_ref2.$form,$reportContainer=_ref2.$reportContainer,_ref2$buttonTitle=_ref2.buttonTitle,buttonTitle=void 0===_
//# sourceMappingURL=taoDeliveryRdf.min.js.map