MDL-73915 js: Upgrade babel and eslint

This commit is contained in:
Andrew Nicols
2022-02-23 08:51:44 +08:00
parent 3ee0da8f17
commit 034ffb924b
270 changed files with 3543 additions and 6252 deletions
+3 -2
View File
@@ -227,7 +227,7 @@
},
// We're using babel transpiling so use their parser
// for linting.
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
// Check AMD with some slightly stricter rules.
rules: {
'no-unused-vars': 'error',
@@ -300,7 +300,8 @@
},
parserOptions: {
'ecmaVersion': 9,
'sourceType': 'module'
'sourceType': 'module',
'requireConfigFile': false,
}
}
]
@@ -1 +1 @@
YUI.add("moodle-tool_capability-search",function(s,t){var e=function(){e.superclass.constructor.apply(this,arguments)};e.prototype={form:null,select:null,selectoptions:{},input:null,button:null,cancel:null,lastsearch:null,initializer:function(){this.form=s.one("#capability-overview-form"),this.select=this.form.one("select[data-search=capability]"),this.select.setStyle("minWidth",this.select.get("offsetWidth")),this.select.get("options").each(function(t){var e=t.get("value");this.selectoptions[e]=t},this),this.button=this.form.all("input[type=submit]"),this.lastsearch=this.form.one("input[name=search]");var t=s.Node.create('<div id="capabilitysearchui" class="input-group simplesearchform mb-2"data-fieldtype="text"></div>'),e=s.Node.create('<label for="capabilitysearch"><span class="sr-only"'+this.get("strsearch")+"</span></label>");this.cancel=s.Node.create('<a class="btn btn-clear d-none icon-no-margin"><i class="icon fa fa-times fa-fw " aria-hidden="true"></i></a>'),this.input=s.Node.create('<input type="text" class="form-control withclear" placeholder="'+this.get("strsearch")+'"id="capabilitysearch" />'),t.append(e).append(this.input).append(this.cancel),this.select.insert(t,"before"),this.input.on("keyup",this.typed,this),this.select.on("change",this.validate,this),this.cancel.on("click",function(){this.input.set("value",""),this.typed()},this),this.lastsearch&&(this.input.set("value",this.lastsearch.get("value")),this.typed(),this.select.one("option[selected]")&&this.select.set("scrollTop",this.select.one("option[selected]").get("getX"))),this.validate()},validate:function(){this.button.set("disabled",""===this.select.get("value"))},typed:function(){var t,e=this.input.get("value"),s=0,i=null;for(t in this.lastsearch&&this.lastsearch.set("value",e),this.select.all("option").remove(),this.selectoptions)0<=t.indexOf(e)&&(s++,i=this.selectoptions[t],this.select.append(this.selectoptions[t]));0===s?this.input.addClass("error"):(this.input.removeClass("error"),1===s&&i.set("selected",!0)),""!==e?this.cancel.removeClass("d-none"):this.cancel.addClass("d-none"),this.validate()}},s.extend(e,s.Base,e.prototype,{NAME:"tool_capability-search",ATTRS:{strsearch:{}}}),M.tool_capability=M.tool_capability||{},M.tool_capability.init_capability_search=function(t){new e(t)}},"@VERSION@",{requires:["base","node"]});
YUI.add("moodle-tool_capability-search",function(s,t){var e=function(){e.superclass.constructor.apply(this,arguments)};s.extend(e,s.Base,e.prototype={form:null,select:null,selectoptions:{},input:null,button:null,cancel:null,lastsearch:null,initializer:function(){this.form=s.one("#capability-overview-form"),this.select=this.form.one("select[data-search=capability]"),this.select.setStyle("minWidth",this.select.get("offsetWidth")),this.select.get("options").each(function(t){var e=t.get("value");this.selectoptions[e]=t},this),this.button=this.form.all("input[type=submit]"),this.lastsearch=this.form.one("input[name=search]");var t=s.Node.create('<div id="capabilitysearchui" class="input-group simplesearchform mb-2"data-fieldtype="text"></div>'),e=s.Node.create('<label for="capabilitysearch"><span class="sr-only"'+this.get("strsearch")+"</span></label>");this.cancel=s.Node.create('<a class="btn btn-clear d-none icon-no-margin"><i class="icon fa fa-times fa-fw " aria-hidden="true"></i></a>'),this.input=s.Node.create('<input type="text" class="form-control withclear" placeholder="'+this.get("strsearch")+'"id="capabilitysearch" />'),t.append(e).append(this.input).append(this.cancel),this.select.insert(t,"before"),this.input.on("keyup",this.typed,this),this.select.on("change",this.validate,this),this.cancel.on("click",function(){this.input.set("value",""),this.typed()},this),this.lastsearch&&(this.input.set("value",this.lastsearch.get("value")),this.typed(),this.select.one("option[selected]")&&this.select.set("scrollTop",this.select.one("option[selected]").get("getX"))),this.validate()},validate:function(){this.button.set("disabled",""===this.select.get("value"))},typed:function(){var t,e=this.input.get("value"),s=0,i=null;for(t in this.lastsearch&&this.lastsearch.set("value",e),this.select.all("option").remove(),this.selectoptions)0<=t.indexOf(e)&&(s++,i=this.selectoptions[t],this.select.append(this.selectoptions[t]));0===s?this.input.addClass("error"):(this.input.removeClass("error"),1===s&&i.set("selected",!0)),""!==e?this.cancel.removeClass("d-none"):this.cancel.addClass("d-none"),this.validate()}},{NAME:"tool_capability-search",ATTRS:{strsearch:{}}}),M.tool_capability=M.tool_capability||{},M.tool_capability.init_capability_search=function(t){new e(t)}},"@VERSION@",{requires:["base","node"]});
+1 -1
View File
@@ -1,2 +1,2 @@
define ("tool_dataprivacy/data_deletion",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var h={MARK_FOR_DELETION:"[data-action=\"markfordeletion\"]",SELECT_ALL:"[data-action=\"selectall\"]"},i={SELECTCONTEXT:".selectcontext"},j=function(){this.registerEvents()};j.prototype.registerEvents=function(){a(h.MARK_FOR_DELETION).click(function(b){b.preventDefault();var c=[];a(i.SELECTCONTEXT).each(function(){var b=a(this);if(b.is(":checked")){c.push(b.val())}});g(c)});a(h.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this);if(c.is(":checked")){a(i.SELECTCONTEXT).attr("checked","checked")}else{a(i.SELECTCONTEXT).removeAttr("checked")}})};function g(a){var g="";d.get_strings([{key:"confirm",component:"moodle"},{key:"confirmcontextdeletion",component:"tool_dataprivacy"}]).then(function(a){g=a[0];var b=a[1];return e.create({title:g,body:b,type:e.types.SAVE_CANCEL})}).then(function(d){d.setSaveButtonText(g);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_confirm_contexts_for_deletion",args:{ids:a}}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d}).done(function(a){a.show()}).fail(c.exception)}return j});
define ("tool_dataprivacy/data_deletion",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={MARK_FOR_DELETION:"[data-action=\"markfordeletion\"]",SELECT_ALL:"[data-action=\"selectall\"]"},h={SELECTCONTEXT:".selectcontext"},i=function(){this.registerEvents()};i.prototype.registerEvents=function(){a(g.MARK_FOR_DELETION).click(function(b){b.preventDefault();var c=[];a(h.SELECTCONTEXT).each(function(){var b=a(this);if(b.is(":checked")){c.push(b.val())}});j(c)});a(g.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this);if(c.is(":checked")){a(h.SELECTCONTEXT).attr("checked","checked")}else{a(h.SELECTCONTEXT).removeAttr("checked")}})};function j(a){var g="";d.get_strings([{key:"confirm",component:"moodle"},{key:"confirmcontextdeletion",component:"tool_dataprivacy"}]).then(function(a){g=a[0];var b=a[1];return e.create({title:g,body:b,type:e.types.SAVE_CANCEL})}).then(function(d){d.setSaveButtonText(g);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_confirm_contexts_for_deletion",args:{ids:a}}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d}).done(function(a){a.show()}).fail(c.exception)}return i});
//# sourceMappingURL=data_deletion.min.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define ("tool_dataprivacy/defaultsactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates"],function(a,b,c,d,f,g,h){var k={EDIT_LEVEL_DEFAULTS:"[data-action=\"edit-level-defaults\"]",NEW_ACTIVITY_DEFAULTS:"[data-action=\"new-activity-defaults\"]",EDIT_ACTIVITY_DEFAULTS:"[data-action=\"edit-activity-defaults\"]",DELETE_ACTIVITY_DEFAULTS:"[data-action=\"delete-activity-defaults\"]"},l=-1,m=function(){this.registerEvents()};m.prototype.registerEvents=function(){a(k.EDIT_LEVEL_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=e.data("category"),j=e.data("purpose"),k=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}}]),l=d.get_string("editdefaults","tool_dataprivacy",a("#defaults-header").text());a.when(k[0],k[1],l).then(function(a,b,c){var d=a.options,e=b.options;i(c,g,h,j,null,d,e,null);return!0}).catch(c.exception)});a(k.NEW_ACTIVITY_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}},{methodname:"tool_dataprivacy_get_activity_options",args:{nodefaults:!0}}]),j=d.get_string("addnewdefaults","tool_dataprivacy");a.when(h[0],h[1],h[2],j).then(function(a,b,c,d){var e=a.options,f=b.options,h=c.options;i(d,g,null,null,null,e,f,h);return!0}).catch(c.exception)});a(k.EDIT_ACTIVITY_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=e.data("category"),j=e.data("purpose"),k=e.data("activityname"),l=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}},{methodname:"tool_dataprivacy_get_activity_options",args:{}}]),m=d.get_string("editmoduledefaults","tool_dataprivacy");a.when(l[0],l[1],l[2],m).then(function(a,b,c,d){var e=a.options,f=b.options,l=c.options;i(d,g,h,j,k,e,f,l);return!0}).catch(c.exception)});a(k.DELETE_ACTIVITY_DEFAULTS).click(function(b){b.preventDefault();var e=a(this),i=e.data("contextlevel"),k=e.data("activityname"),m=e.data("activitydisplayname");f.create({title:d.get_string("deletedefaults","tool_dataprivacy",m),body:h.render("tool_dataprivacy/delete_activity_defaults",{activityname:m}),type:f.types.SAVE_CANCEL,large:!0}).then(function(a){a.setSaveButtonText(d.get_string("delete"));a.getRoot().on(g.save,function(){j(i,l,l,k,!1)});a.getRoot().on(g.hidden,function(){a.destroy()});a.show();return!0}).catch(c.exception)})};function i(b,d,e,i,k,l,m,n){if(null!==e){l.forEach(function(a){if(a.id===e){a.selected=!0}})}if(null!==i){m.forEach(function(a){if(a.id===i){a.selected=!0}})}var o={contextlevel:d,categoryoptions:l,purposeoptions:m};if(null!==n&&n.length){if(null===k){o.newactivitydefaults=!0}else{n.forEach(function(a){if(k===a.name){a.selected=!0}})}o.modemodule=!0;o.activityoptions=n}f.create({title:b,body:h.render("tool_dataprivacy/category_purpose_form",o),type:f.types.SAVE_CANCEL,large:!0}).then(function(b){b.getRoot().on(g.save,function(){var b=a("#activity"),c="undefined"!=typeof b?b.val():null,d=a("#override"),e="undefined"!=typeof d?d.is(":checked"):!1;j(a("#contextlevel").val(),a("#category").val(),a("#purpose").val(),c,e)});b.getRoot().on(g.hidden,function(){b.destroy()});b.show();return b}).catch(c.exception)}function j(a,c,d,e,f){b.call([{methodname:"tool_dataprivacy_set_context_defaults",args:{contextlevel:a,category:c,purpose:d,override:f,activity:e}}])[0].done(function(a){if(a.result){window.location.reload()}})}return{init:function init(){return new m}}});
define ("tool_dataprivacy/defaultsactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates"],function(a,b,c,d,f,g,h){var i={EDIT_LEVEL_DEFAULTS:"[data-action=\"edit-level-defaults\"]",NEW_ACTIVITY_DEFAULTS:"[data-action=\"new-activity-defaults\"]",EDIT_ACTIVITY_DEFAULTS:"[data-action=\"edit-activity-defaults\"]",DELETE_ACTIVITY_DEFAULTS:"[data-action=\"delete-activity-defaults\"]"},j=-1,k=function(){this.registerEvents()};k.prototype.registerEvents=function(){a(i.EDIT_LEVEL_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=e.data("category"),i=e.data("purpose"),j=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}}]),k=d.get_string("editdefaults","tool_dataprivacy",a("#defaults-header").text());a.when(j[0],j[1],k).then(function(a,b,c){var d=a.options,e=b.options;l(c,g,h,i,null,d,e,null);return!0}).catch(c.exception)});a(i.NEW_ACTIVITY_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}},{methodname:"tool_dataprivacy_get_activity_options",args:{nodefaults:!0}}]),i=d.get_string("addnewdefaults","tool_dataprivacy");a.when(h[0],h[1],h[2],i).then(function(a,b,c,d){var e=a.options,f=b.options,h=c.options;l(d,g,null,null,null,e,f,h);return!0}).catch(c.exception)});a(i.EDIT_ACTIVITY_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=e.data("category"),i=e.data("purpose"),j=e.data("activityname"),k=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}},{methodname:"tool_dataprivacy_get_activity_options",args:{}}]),m=d.get_string("editmoduledefaults","tool_dataprivacy");a.when(k[0],k[1],k[2],m).then(function(a,b,c,d){var e=a.options,f=b.options,k=c.options;l(d,g,h,i,j,e,f,k);return!0}).catch(c.exception)});a(i.DELETE_ACTIVITY_DEFAULTS).click(function(b){b.preventDefault();var e=a(this),i=e.data("contextlevel"),k=e.data("activityname"),l=e.data("activitydisplayname");f.create({title:d.get_string("deletedefaults","tool_dataprivacy",l),body:h.render("tool_dataprivacy/delete_activity_defaults",{activityname:l}),type:f.types.SAVE_CANCEL,large:!0}).then(function(a){a.setSaveButtonText(d.get_string("delete"));a.getRoot().on(g.save,function(){m(i,j,j,k,!1)});a.getRoot().on(g.hidden,function(){a.destroy()});a.show();return!0}).catch(c.exception)})};function l(b,d,e,i,j,k,l,n){if(null!==e){k.forEach(function(a){if(a.id===e){a.selected=!0}})}if(null!==i){l.forEach(function(a){if(a.id===i){a.selected=!0}})}var o={contextlevel:d,categoryoptions:k,purposeoptions:l};if(null!==n&&n.length){if(null===j){o.newactivitydefaults=!0}else{n.forEach(function(a){if(j===a.name){a.selected=!0}})}o.modemodule=!0;o.activityoptions=n}f.create({title:b,body:h.render("tool_dataprivacy/category_purpose_form",o),type:f.types.SAVE_CANCEL,large:!0}).then(function(b){b.getRoot().on(g.save,function(){var b=a("#activity"),c="undefined"!=typeof b?b.val():null,d=a("#override"),e="undefined"!=typeof d?d.is(":checked"):!1;m(a("#contextlevel").val(),a("#category").val(),a("#purpose").val(),c,e)});b.getRoot().on(g.hidden,function(){b.destroy()});b.show();return b}).catch(c.exception)}function m(a,c,d,e,f){b.call([{methodname:"tool_dataprivacy_set_context_defaults",args:{contextlevel:a,category:c,purpose:d,override:f,activity:e}}])[0].done(function(a){if(a.result){window.location.reload()}})}return{init:function init(){return new k}}});
//# sourceMappingURL=defaultsactions.min.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define ("tool_dataprivacy/myrequestactions",["exports","core/ajax","core/notification","core/pending","core/str"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=f(b);c=f(c);d=f(d);function f(a){return a&&a.__esModule?a:{default:a}}function g(a,b){return m(a)||l(a,b)||j(a,b)||h()}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(a,b){if(!a)return;if("string"==typeof a)return k(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return k(a,b)}function k(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function l(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function m(a){if(Array.isArray(a))return a}var n={CANCEL_REQUEST:"[data-action=\"cancel\"][data-requestid]"};a.init=function init(){document.addEventListener("click",function(a){var f=a.target.closest(n.CANCEL_REQUEST);if(null===f){return}a.preventDefault();(0,e.get_strings)([{key:"cancelrequest",component:"tool_dataprivacy"},{key:"cancelrequestconfirmation",component:"tool_dataprivacy"}]).then(function(a){var e=g(a,2),h=e[0],i=e[1];return c.default.confirm(h,i,h,null,function(){var a=new d.default("tool/dataprivacy:cancelRequest"),e={methodname:"tool_dataprivacy_cancel_data_request",args:{requestid:f.dataset.requestid}};b.default.call([e])[0].then(function(b){if(b.result){window.location.reload()}else{c.default.addNotification({type:"error",message:b.warnings[0].message})}return a.resolve()}).catch(c.default.exception)})}).catch()})}});
define ("tool_dataprivacy/myrequestactions",["exports","core/ajax","core/notification","core/pending","core/str"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=f(b);c=f(c);d=f(d);function f(a){return a&&a.__esModule?a:{default:a}}function g(a,b){return m(a)||l(a,b)||j(a,b)||h()}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(a,b){if(!a)return;if("string"==typeof a)return k(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(a);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return k(a,b)}function k(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function l(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null==c)return;var d=[],e=!0,f=!1,g,h;try{for(c=c.call(a);!(e=(g=c.next()).done);e=!0){d.push(g.value);if(b&&d.length===b)break}}catch(a){f=!0;h=a}finally{try{if(!e&&null!=c["return"])c["return"]()}finally{if(f)throw h}}return d}function m(a){if(Array.isArray(a))return a}var n={CANCEL_REQUEST:"[data-action=\"cancel\"][data-requestid]"};a.init=function init(){document.addEventListener("click",function(a){var f=a.target.closest(n.CANCEL_REQUEST);if(null===f){return}a.preventDefault();(0,e.get_strings)([{key:"cancelrequest",component:"tool_dataprivacy"},{key:"cancelrequestconfirmation",component:"tool_dataprivacy"}]).then(function(a){var e=g(a,2),h=e[0],i=e[1];return c.default.confirm(h,i,h,null,function(){var a=new d.default("tool/dataprivacy:cancelRequest"),e={methodname:"tool_dataprivacy_cancel_data_request",args:{requestid:f.dataset.requestid}};b.default.call([e])[0].then(function(b){if(b.result){window.location.reload()}else{c.default.addNotification({type:"error",message:b.warnings[0].message})}return a.resolve()}).catch(c.default.exception)})}).catch()})}});
//# sourceMappingURL=myrequestactions.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/myrequestactions.js"],"names":["SELECTORS","CANCEL_REQUEST","init","document","addEventListener","event","triggerElement","target","closest","preventDefault","key","component","then","cancelRequest","cancelConfirm","Notification","confirm","pendingPromise","Pending","request","methodname","args","requestid","dataset","Ajax","call","response","result","window","location","reload","addNotification","type","message","warnings","resolve","catch","exception"],"mappings":"kNAuBA,OACA,OACA,O,khCAGMA,CAAAA,CAAS,CAAG,CACdC,cAAc,CAAE,0CADF,C,QAOE,QAAPC,CAAAA,IAAO,EAAM,CACtBC,QAAQ,CAACC,gBAAT,CAA0B,OAA1B,CAAmC,SAAAC,CAAK,CAAI,CACxC,GAAMC,CAAAA,CAAc,CAAGD,CAAK,CAACE,MAAN,CAAaC,OAAb,CAAqBR,CAAS,CAACC,cAA/B,CAAvB,CACA,GAAuB,IAAnB,GAAAK,CAAJ,CAA6B,CACzB,MACH,CAEDD,CAAK,CAACI,cAAN,GAOA,kBALwB,CACpB,CAACC,GAAG,CAAE,eAAN,CAAuBC,SAAS,CAAE,kBAAlC,CADoB,CAEpB,CAACD,GAAG,CAAE,2BAAN,CAAmCC,SAAS,CAAE,kBAA9C,CAFoB,CAKxB,EAA4BC,IAA5B,CAAiC,WAAoC,cAAlCC,CAAkC,MAAnBC,CAAmB,MACjE,MAAOC,WAAaC,OAAb,CAAqBH,CAArB,CAAoCC,CAApC,CAAmDD,CAAnD,CAAkE,IAAlE,CAAwE,UAAM,IAC3EI,CAAAA,CAAc,CAAG,GAAIC,UAAJ,CAAY,gCAAZ,CAD0D,CAE3EC,CAAO,CAAG,CACZC,UAAU,CAAE,sCADA,CAEZC,IAAI,CAAE,CAACC,SAAS,CAAEhB,CAAc,CAACiB,OAAf,CAAuBD,SAAnC,CAFM,CAFiE,CAOjFE,UAAKC,IAAL,CAAU,CAACN,CAAD,CAAV,EAAqB,CAArB,EAAwBP,IAAxB,CAA6B,SAAAc,CAAQ,CAAI,CACrC,GAAIA,CAAQ,CAACC,MAAb,CAAqB,CACjBC,MAAM,CAACC,QAAP,CAAgBC,MAAhB,EACH,CAFD,IAEO,CACHf,UAAagB,eAAb,CAA6B,CACzBC,IAAI,CAAE,OADmB,CAEzBC,OAAO,CAAEP,CAAQ,CAACQ,QAAT,CAAkB,CAAlB,EAAqBD,OAFL,CAA7B,CAIH,CACD,MAAOhB,CAAAA,CAAc,CAACkB,OAAf,EACV,CAVD,EAUGC,KAVH,CAUSrB,UAAasB,SAVtB,CAWH,CAlBM,CAmBV,CApBD,EAoBGD,KApBH,EAqBH,CAlCD,CAmCH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * AMD module to enable users to manage their own data requests.\n *\n * @module tool_dataprivacy/myrequestactions\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Ajax from 'core/ajax';\nimport Notification from 'core/notification';\nimport Pending from 'core/pending';\nimport {get_strings as getStrings} from 'core/str';\n\nconst SELECTORS = {\n CANCEL_REQUEST: '[data-action=\"cancel\"][data-requestid]',\n};\n\n/**\n * Initialize module\n */\nexport const init = () => {\n document.addEventListener('click', event => {\n const triggerElement = event.target.closest(SELECTORS.CANCEL_REQUEST);\n if (triggerElement === null) {\n return;\n }\n\n event.preventDefault();\n\n const requiredStrings = [\n {key: 'cancelrequest', component: 'tool_dataprivacy'},\n {key: 'cancelrequestconfirmation', component: 'tool_dataprivacy'},\n ];\n\n getStrings(requiredStrings).then(([cancelRequest, cancelConfirm]) => {\n return Notification.confirm(cancelRequest, cancelConfirm, cancelRequest, null, () => {\n const pendingPromise = new Pending('tool/dataprivacy:cancelRequest');\n const request = {\n methodname: 'tool_dataprivacy_cancel_data_request',\n args: {requestid: triggerElement.dataset.requestid}\n };\n\n Ajax.call([request])[0].then(response => {\n if (response.result) {\n window.location.reload();\n } else {\n Notification.addNotification({\n type: 'error',\n message: response.warnings[0].message\n });\n }\n return pendingPromise.resolve();\n }).catch(Notification.exception);\n });\n }).catch();\n });\n};\n"],"file":"myrequestactions.min.js"}
{"version":3,"sources":["../src/myrequestactions.js"],"names":["SELECTORS","CANCEL_REQUEST","init","document","addEventListener","event","triggerElement","target","closest","preventDefault","key","component","then","cancelRequest","cancelConfirm","Notification","confirm","pendingPromise","Pending","request","methodname","args","requestid","dataset","Ajax","call","response","result","window","location","reload","addNotification","type","message","warnings","resolve","catch","exception"],"mappings":"kNAuBA,OACA,OACA,O,2hCAGMA,CAAAA,CAAS,CAAG,CACdC,cAAc,CAAE,0CADF,C,QAOE,QAAPC,CAAAA,IAAO,EAAM,CACtBC,QAAQ,CAACC,gBAAT,CAA0B,OAA1B,CAAmC,SAAAC,CAAK,CAAI,CACxC,GAAMC,CAAAA,CAAc,CAAGD,CAAK,CAACE,MAAN,CAAaC,OAAb,CAAqBR,CAAS,CAACC,cAA/B,CAAvB,CACA,GAAuB,IAAnB,GAAAK,CAAJ,CAA6B,CACzB,MACH,CAEDD,CAAK,CAACI,cAAN,GAOA,kBALwB,CACpB,CAACC,GAAG,CAAE,eAAN,CAAuBC,SAAS,CAAE,kBAAlC,CADoB,CAEpB,CAACD,GAAG,CAAE,2BAAN,CAAmCC,SAAS,CAAE,kBAA9C,CAFoB,CAKxB,EAA4BC,IAA5B,CAAiC,WAAoC,cAAlCC,CAAkC,MAAnBC,CAAmB,MACjE,MAAOC,WAAaC,OAAb,CAAqBH,CAArB,CAAoCC,CAApC,CAAmDD,CAAnD,CAAkE,IAAlE,CAAwE,UAAM,IAC3EI,CAAAA,CAAc,CAAG,GAAIC,UAAJ,CAAY,gCAAZ,CAD0D,CAE3EC,CAAO,CAAG,CACZC,UAAU,CAAE,sCADA,CAEZC,IAAI,CAAE,CAACC,SAAS,CAAEhB,CAAc,CAACiB,OAAf,CAAuBD,SAAnC,CAFM,CAFiE,CAOjFE,UAAKC,IAAL,CAAU,CAACN,CAAD,CAAV,EAAqB,CAArB,EAAwBP,IAAxB,CAA6B,SAAAc,CAAQ,CAAI,CACrC,GAAIA,CAAQ,CAACC,MAAb,CAAqB,CACjBC,MAAM,CAACC,QAAP,CAAgBC,MAAhB,EACH,CAFD,IAEO,CACHf,UAAagB,eAAb,CAA6B,CACzBC,IAAI,CAAE,OADmB,CAEzBC,OAAO,CAAEP,CAAQ,CAACQ,QAAT,CAAkB,CAAlB,EAAqBD,OAFL,CAA7B,CAIH,CACD,MAAOhB,CAAAA,CAAc,CAACkB,OAAf,EACV,CAVD,EAUGC,KAVH,CAUSrB,UAAasB,SAVtB,CAWH,CAlBM,CAmBV,CApBD,EAoBGD,KApBH,EAqBH,CAlCD,CAmCH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * AMD module to enable users to manage their own data requests.\n *\n * @module tool_dataprivacy/myrequestactions\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Ajax from 'core/ajax';\nimport Notification from 'core/notification';\nimport Pending from 'core/pending';\nimport {get_strings as getStrings} from 'core/str';\n\nconst SELECTORS = {\n CANCEL_REQUEST: '[data-action=\"cancel\"][data-requestid]',\n};\n\n/**\n * Initialize module\n */\nexport const init = () => {\n document.addEventListener('click', event => {\n const triggerElement = event.target.closest(SELECTORS.CANCEL_REQUEST);\n if (triggerElement === null) {\n return;\n }\n\n event.preventDefault();\n\n const requiredStrings = [\n {key: 'cancelrequest', component: 'tool_dataprivacy'},\n {key: 'cancelrequestconfirmation', component: 'tool_dataprivacy'},\n ];\n\n getStrings(requiredStrings).then(([cancelRequest, cancelConfirm]) => {\n return Notification.confirm(cancelRequest, cancelConfirm, cancelRequest, null, () => {\n const pendingPromise = new Pending('tool/dataprivacy:cancelRequest');\n const request = {\n methodname: 'tool_dataprivacy_cancel_data_request',\n args: {requestid: triggerElement.dataset.requestid}\n };\n\n Ajax.call([request])[0].then(response => {\n if (response.result) {\n window.location.reload();\n } else {\n Notification.addNotification({\n type: 'error',\n message: response.warnings[0].message\n });\n }\n return pendingPromise.resolve();\n }).catch(Notification.exception);\n });\n }).catch();\n });\n};\n"],"file":"myrequestactions.min.js"}
+1 -1
View File
@@ -1,2 +1,2 @@
define ("tool_dataprivacy/requestactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","tool_dataprivacy/data_request_modal","tool_dataprivacy/events"],function(a,b,c,d,e,f,g,h,i){var q={APPROVE_REQUEST:"[data-action=\"approve\"]",DENY_REQUEST:"[data-action=\"deny\"]",VIEW_REQUEST:"[data-action=\"view\"]",MARK_COMPLETE:"[data-action=\"complete\"]",CHANGE_BULK_ACTION:"[id=\"bulk-action\"]",CONFIRM_BULK_ACTION:"[id=\"confirm-bulk-action\"]",SELECT_ALL:"[data-action=\"selectall\"]"},r={APPROVE:1,DENY:2},s={SELECT_REQUEST:".selectrequests"},t=function(){this.registerEvents()};t.prototype.registerEvents=function(){a(q.VIEW_REQUEST).click(function(d){d.preventDefault();var k=a(this).data("requestid"),m=b.call([{methodname:"tool_dataprivacy_get_data_request",args:{requestid:k}}]);a.when(m[0]).then(function(a){if(a.result){return a.result}c.addNotification({message:a.warnings[0].message,type:"error"});return!1}).then(function(a){var b=g.render("tool_dataprivacy/request_details",a),c={approvedeny:a.approvedeny,canmarkcomplete:a.canmarkcomplete};return e.create({title:a.typename,body:b,type:h.TYPE,large:!0,templateContext:c})}).then(function(a){a.getRoot().on(i.approve,function(){o(i.approve,j(k))});a.getRoot().on(i.deny,function(){o(i.deny,l(k))});a.getRoot().on(i.complete,function(){p("tool_dataprivacy_mark_complete",{requestid:k})});a.getRoot().on(f.hidden,function(){a.destroy()});a.show()}).catch(c.exception)});a(q.APPROVE_REQUEST).click(function(b){b.preventDefault();var c=a(this).data("requestid");o(i.approve,j(c))});a(q.DENY_REQUEST).click(function(b){b.preventDefault();var c=a(this).data("requestid");o(i.deny,l(c))});a(q.MARK_COMPLETE).click(function(b){b.preventDefault();var c=a(this).data("requestid");o(i.complete,n(c))});a(q.CONFIRM_BULK_ACTION).click(function(){var b=[],e="",f={},g=[{key:"selectbulkaction",component:"tool_dataprivacy"},{key:"selectdatarequests",component:"tool_dataprivacy"},{key:"ok"}],h=parseInt(a("#bulk-action").val());if(h!=r.APPROVE&&h!=r.DENY){d.get_strings(g).done(function(a){c.alert("",a[0],a[2])}).fail(c.exception);return}a(".selectrequests:checked").each(function(){b.push(a(this).val())});if(1>b.length){d.get_strings(g).done(function(a){c.alert("",a[1],a[2])}).fail(c.exception);return}switch(h){case r.APPROVE:e=i.bulkApprove;f=k(b);break;case r.DENY:e=i.bulkDeny;f=m(b);}o(e,f)});a(q.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this).is(":checked");a(s.SELECT_REQUEST).prop("checked",c)})};function j(a){return{wsfunction:"tool_dataprivacy_approve_data_request",wsparams:{requestid:a}}}function k(a){return{wsfunction:"tool_dataprivacy_bulk_approve_data_requests",wsparams:{requestids:a}}}function l(a){return{wsfunction:"tool_dataprivacy_deny_data_request",wsparams:{requestid:a}}}function m(a){return{wsfunction:"tool_dataprivacy_bulk_deny_data_requests",wsparams:{requestids:a}}}function n(a){return{wsfunction:"tool_dataprivacy_mark_complete",wsparams:{requestid:a}}}function o(a,b){var g=[];switch(a){case i.approve:g=[{key:"approverequest",component:"tool_dataprivacy"},{key:"confirmapproval",component:"tool_dataprivacy"}];break;case i.bulkApprove:g=[{key:"bulkapproverequests",component:"tool_dataprivacy"},{key:"confirmbulkapproval",component:"tool_dataprivacy"}];break;case i.deny:g=[{key:"denyrequest",component:"tool_dataprivacy"},{key:"confirmdenial",component:"tool_dataprivacy"}];break;case i.bulkDeny:g=[{key:"bulkdenyrequests",component:"tool_dataprivacy"},{key:"confirmbulkdenial",component:"tool_dataprivacy"}];break;case i.complete:g=[{key:"markcomplete",component:"tool_dataprivacy"},{key:"confirmcompletion",component:"tool_dataprivacy"}];break;}var h="";d.get_strings(g).then(function(a){h=a[0];var b=a[1];return e.create({title:h,body:b,type:e.types.SAVE_CANCEL})}).then(function(a){a.setSaveButtonText(h);a.getRoot().on(f.save,function(){p(b.wsfunction,b.wsparams)});a.getRoot().on(f.hidden,function(){a.destroy()});a.show()}).catch(c.exception)}function p(a,d){b.call([{methodname:a,args:d}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)}return t});
define ("tool_dataprivacy/requestactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","tool_dataprivacy/data_request_modal","tool_dataprivacy/events"],function(a,b,c,d,e,f,g,h,i){var j={APPROVE_REQUEST:"[data-action=\"approve\"]",DENY_REQUEST:"[data-action=\"deny\"]",VIEW_REQUEST:"[data-action=\"view\"]",MARK_COMPLETE:"[data-action=\"complete\"]",CHANGE_BULK_ACTION:"[id=\"bulk-action\"]",CONFIRM_BULK_ACTION:"[id=\"confirm-bulk-action\"]",SELECT_ALL:"[data-action=\"selectall\"]"},k={APPROVE:1,DENY:2},l={SELECT_REQUEST:".selectrequests"},m=function(){this.registerEvents()};m.prototype.registerEvents=function(){a(j.VIEW_REQUEST).click(function(d){d.preventDefault();var j=a(this).data("requestid"),k=b.call([{methodname:"tool_dataprivacy_get_data_request",args:{requestid:j}}]);a.when(k[0]).then(function(a){if(a.result){return a.result}c.addNotification({message:a.warnings[0].message,type:"error"});return!1}).then(function(a){var b=g.render("tool_dataprivacy/request_details",a),c={approvedeny:a.approvedeny,canmarkcomplete:a.canmarkcomplete};return e.create({title:a.typename,body:b,type:h.TYPE,large:!0,templateContext:c})}).then(function(a){a.getRoot().on(i.approve,function(){s(i.approve,n(j))});a.getRoot().on(i.deny,function(){s(i.deny,p(j))});a.getRoot().on(i.complete,function(){t("tool_dataprivacy_mark_complete",{requestid:j})});a.getRoot().on(f.hidden,function(){a.destroy()});a.show()}).catch(c.exception)});a(j.APPROVE_REQUEST).click(function(b){b.preventDefault();var c=a(this).data("requestid");s(i.approve,n(c))});a(j.DENY_REQUEST).click(function(b){b.preventDefault();var c=a(this).data("requestid");s(i.deny,p(c))});a(j.MARK_COMPLETE).click(function(b){b.preventDefault();var c=a(this).data("requestid");s(i.complete,r(c))});a(j.CONFIRM_BULK_ACTION).click(function(){var b=[],e="",f={},g=[{key:"selectbulkaction",component:"tool_dataprivacy"},{key:"selectdatarequests",component:"tool_dataprivacy"},{key:"ok"}],h=parseInt(a("#bulk-action").val());if(h!=k.APPROVE&&h!=k.DENY){d.get_strings(g).done(function(a){c.alert("",a[0],a[2])}).fail(c.exception);return}a(".selectrequests:checked").each(function(){b.push(a(this).val())});if(1>b.length){d.get_strings(g).done(function(a){c.alert("",a[1],a[2])}).fail(c.exception);return}switch(h){case k.APPROVE:e=i.bulkApprove;f=o(b);break;case k.DENY:e=i.bulkDeny;f=q(b);}s(e,f)});a(j.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this).is(":checked");a(l.SELECT_REQUEST).prop("checked",c)})};function n(a){return{wsfunction:"tool_dataprivacy_approve_data_request",wsparams:{requestid:a}}}function o(a){return{wsfunction:"tool_dataprivacy_bulk_approve_data_requests",wsparams:{requestids:a}}}function p(a){return{wsfunction:"tool_dataprivacy_deny_data_request",wsparams:{requestid:a}}}function q(a){return{wsfunction:"tool_dataprivacy_bulk_deny_data_requests",wsparams:{requestids:a}}}function r(a){return{wsfunction:"tool_dataprivacy_mark_complete",wsparams:{requestid:a}}}function s(a,b){var g=[];switch(a){case i.approve:g=[{key:"approverequest",component:"tool_dataprivacy"},{key:"confirmapproval",component:"tool_dataprivacy"}];break;case i.bulkApprove:g=[{key:"bulkapproverequests",component:"tool_dataprivacy"},{key:"confirmbulkapproval",component:"tool_dataprivacy"}];break;case i.deny:g=[{key:"denyrequest",component:"tool_dataprivacy"},{key:"confirmdenial",component:"tool_dataprivacy"}];break;case i.bulkDeny:g=[{key:"bulkdenyrequests",component:"tool_dataprivacy"},{key:"confirmbulkdenial",component:"tool_dataprivacy"}];break;case i.complete:g=[{key:"markcomplete",component:"tool_dataprivacy"},{key:"confirmcompletion",component:"tool_dataprivacy"}];break;}var h="";d.get_strings(g).then(function(a){h=a[0];var b=a[1];return e.create({title:h,body:b,type:e.types.SAVE_CANCEL})}).then(function(a){a.setSaveButtonText(h);a.getRoot().on(f.save,function(){t(b.wsfunction,b.wsparams)});a.getRoot().on(f.hidden,function(){a.destroy()});a.show()}).catch(c.exception)}function t(a,d){b.call([{methodname:a,args:d}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)}return m});
//# sourceMappingURL=requestactions.min.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define ("tool_langimport/search",["exports","core/pending","core/utils"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function d(a,b){return j(a)||h(a,b)||f(a,b)||e()}function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(a,b){if(!a)return;if("string"==typeof a)return g(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return g(a,b)}function g(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function h(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function j(a){if(Array.isArray(a))return a}var k={AVAILABLE_LANG_SELECT:"select",AVAILABLE_LANG_SEARCH:"[data-action=\"search\"]"},l=250;a.default={init:function init(a){var e=a.querySelector(k.AVAILABLE_LANG_SELECT),f=function(a){var c=new b.default("tool_langimport/search:filter");e.querySelectorAll("option").forEach(function(a){a.remove()});var f=a.target.value.toLowerCase(),g=JSON.parse(e.dataset.availableLanguages),h=Object.keys(g).reduce(function(a,b){if(g[b].toLowerCase().includes(f)){a[b]=g[b]}return a},[]);Object.entries(h).forEach(function(a){var b=d(a,2),c=b[0],f=b[1],g=document.createElement("option");g.value=c;g.innerText=f;e.append(g)});c.resolve()},g={};e.querySelectorAll("option").forEach(function(a){g[a.value]=a.text});e.dataset.availableLanguages=JSON.stringify(g);var h=a.querySelector(k.AVAILABLE_LANG_SEARCH);h.addEventListener("keydown",function(a){if("Enter"===a.key){a.preventDefault()}});h.addEventListener("keyup",function(a){var d=new b.default("tool_langimport/search:keyup");(0,c.debounce)(f,l)(a);setTimeout(function(){d.resolve()},l)})}};return a.default});
define ("tool_langimport/search",["exports","core/pending","core/utils"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function d(a,b){return j(a)||h(a,b)||f(a,b)||e()}function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(a,b){if(!a)return;if("string"==typeof a)return g(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(a);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return g(a,b)}function g(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function h(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null==c)return;var d=[],e=!0,f=!1,g,h;try{for(c=c.call(a);!(e=(g=c.next()).done);e=!0){d.push(g.value);if(b&&d.length===b)break}}catch(a){f=!0;h=a}finally{try{if(!e&&null!=c["return"])c["return"]()}finally{if(f)throw h}}return d}function j(a){if(Array.isArray(a))return a}var k={AVAILABLE_LANG_SELECT:"select",AVAILABLE_LANG_SEARCH:"[data-action=\"search\"]"},l=250;a.default={init:function init(a){var e=a.querySelector(k.AVAILABLE_LANG_SELECT),f=function(a){var c=new b.default("tool_langimport/search:filter");e.querySelectorAll("option").forEach(function(a){a.remove()});var f=a.target.value.toLowerCase(),g=JSON.parse(e.dataset.availableLanguages),h=Object.keys(g).reduce(function(a,b){if(g[b].toLowerCase().includes(f)){a[b]=g[b]}return a},[]);Object.entries(h).forEach(function(a){var b=d(a,2),c=b[0],f=b[1],g=document.createElement("option");g.value=c;g.innerText=f;e.append(g)});c.resolve()},g={};e.querySelectorAll("option").forEach(function(a){g[a.value]=a.text});e.dataset.availableLanguages=JSON.stringify(g);var h=a.querySelector(k.AVAILABLE_LANG_SEARCH);h.addEventListener("keydown",function(a){if("Enter"===a.key){a.preventDefault()}});h.addEventListener("keyup",function(a){var d=new b.default("tool_langimport/search:keyup");(0,c.debounce)(f,l)(a);setTimeout(function(){d.resolve()},l)})}};return a.default});
//# sourceMappingURL=search.min.js.map
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
YUI.add("moodle-tool_monitor-dropdown",function(s,e){function t(){t.superclass.constructor.apply(this,arguments)}var n="#id_plugin",i="#id_eventname",a="option";s.extend(t,s.Base,{plugin:null,eventname:null,initializer:function(){this.plugin=s.one(n),this.eventname=s.one(i);var e=this.eventname.get("value");this.updateEventsList(),this.updateSelection(e),this.plugin.on("change",this.updateEventsList,this)},updateEventsList:function(){var n,e,t,i=this.plugin.get("value"),o="\\"+i+"\\";this.eventname.all(a).remove(!0),e=this.get("eventlist"),(t=s.Node.create('<option value="">'+e[""]+"</option>")).set("selected","selected"),this.eventname.appendChild(t),s.Object.each(e,function(e,t){t.substring(0,o.length)===o&&(n=s.Node.create('<option value="'+t+'">'+e+"</option>"),this.eventname.appendChild(n))},this)},updateSelection:function(t){this.eventname.get("options").each(function(e){e.get("value")===t&&e.set("selected","selected")},this)}},{NAME:"dropDown",ATTRS:{eventlist:null}}),s.namespace("M.tool_monitor.DropDown").init=function(e){return new t(e)}},"@VERSION@",{requires:["base","event","node"]});
YUI.add("moodle-tool_monitor-dropdown",function(o,e){function t(){t.superclass.constructor.apply(this,arguments)}var n="#id_plugin",i="#id_eventname",s="option";o.extend(t,o.Base,{plugin:null,eventname:null,initializer:function(){this.plugin=o.one(n),this.eventname=o.one(i);var e=this.eventname.get("value");this.updateEventsList(),this.updateSelection(e),this.plugin.on("change",this.updateEventsList,this)},updateEventsList:function(){var n,e,t=this.plugin.get("value"),i="\\"+t+"\\";this.eventname.all(s).remove(!0),t=this.get("eventlist"),(e=o.Node.create('<option value="">'+t[""]+"</option>")).set("selected","selected"),this.eventname.appendChild(e),o.Object.each(t,function(e,t){t.substring(0,i.length)===i&&(n=o.Node.create('<option value="'+t+'">'+e+"</option>"),this.eventname.appendChild(n))},this)},updateSelection:function(t){this.eventname.get("options").each(function(e){e.get("value")===t&&e.set("selected","selected")},this)}},{NAME:"dropDown",ATTRS:{eventlist:null}}),o.namespace("M.tool_monitor.DropDown").init=function(e){return new t(e)}},"@VERSION@",{requires:["base","event","node"]});
+1 -1
View File
@@ -1,2 +1,2 @@
define ("tool_policy/managedocsactions",["jquery","core/log","core/config","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){"use strict";var h={LINKS:"[data-action]",MAKE_CURRENT:"[data-action=\"makecurrent\"]",INACTIVATE:"[data-action=\"inactivate\"]",DELETE:"[data-action=\"delete\"]"};function g(a){this.base=a;this.initEvents()}g.prototype.initEvents=function(){var g=this;g.base.on("click",h.LINKS,function(g){g.stopPropagation();var i=a(g.currentTarget),j,k;if(i.is(h.MAKE_CURRENT)){j=d.get_strings([{key:"activating",component:"tool_policy"},{key:"activateconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"activateconfirmyes",component:"tool_policy"}])}else if(i.is(h.INACTIVATE)){j=d.get_strings([{key:"inactivating",component:"tool_policy"},{key:"inactivatingconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"inactivatingconfirmyes",component:"tool_policy"}])}else if(i.is(h.DELETE)){j=d.get_strings([{key:"deleting",component:"tool_policy"},{key:"deleteconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"delete",component:"core"}])}else{b.error("unknown action type detected","tool_policy/managedocsactions");return}g.preventDefault();j.then(function(a){k=a;return e.create({title:k[0],body:k[1],type:e.types.SAVE_CANCEL})}).then(function(a){a.setSaveButtonText(k[2]);a.getRoot().on(f.save,function(){window.location.href=i.attr("href")+"&sesskey="+c.sesskey+"&confirm=1"});a.getRoot().on(f.hidden,function(){a.destroy()});a.show();return!0}).catch(function(a){b.error(a);return!1})})};return{init:function init(b){var c=a(document.getElementById(b));if(c.length){return new g(c)}else{throw new Error("managedocsactions: Invalid base element identifier")}}}});
define ("tool_policy/managedocsactions",["jquery","core/log","core/config","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){"use strict";var g={LINKS:"[data-action]",MAKE_CURRENT:"[data-action=\"makecurrent\"]",INACTIVATE:"[data-action=\"inactivate\"]",DELETE:"[data-action=\"delete\"]"};function h(a){this.base=a;this.initEvents()}h.prototype.initEvents=function(){var h=this;h.base.on("click",g.LINKS,function(h){h.stopPropagation();var i=a(h.currentTarget),j,k;if(i.is(g.MAKE_CURRENT)){j=d.get_strings([{key:"activating",component:"tool_policy"},{key:"activateconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"activateconfirmyes",component:"tool_policy"}])}else if(i.is(g.INACTIVATE)){j=d.get_strings([{key:"inactivating",component:"tool_policy"},{key:"inactivatingconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"inactivatingconfirmyes",component:"tool_policy"}])}else if(i.is(g.DELETE)){j=d.get_strings([{key:"deleting",component:"tool_policy"},{key:"deleteconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"delete",component:"core"}])}else{b.error("unknown action type detected","tool_policy/managedocsactions");return}h.preventDefault();j.then(function(a){k=a;return e.create({title:k[0],body:k[1],type:e.types.SAVE_CANCEL})}).then(function(a){a.setSaveButtonText(k[2]);a.getRoot().on(f.save,function(){window.location.href=i.attr("href")+"&sesskey="+c.sesskey+"&confirm=1"});a.getRoot().on(f.hidden,function(){a.destroy()});a.show();return!0}).catch(function(a){b.error(a);return!1})})};return{init:function init(b){var c=a(document.getElementById(b));if(c.length){return new h(c)}else{throw new Error("managedocsactions: Invalid base element identifier")}}}});
//# sourceMappingURL=managedocsactions.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
YUI.add("moodle-availability_completion-form",function(o,e){M.availability_completion=M.availability_completion||{},M.availability_completion.form=o.Object(M.core_availability.plugin),M.availability_completion.form.initInner=function(e){this.cms=e},M.availability_completion.form.getNode=function(e){var i,l,t,a='<span class="col-form-label pr-3"> '+M.util.get_string("title","availability_completion")+'</span> <span class="availability-group form-group"><label><span class="accesshide">'+M.util.get_string("label_cm","availability_completion")+' </span><select class="custom-select" name="cm" title="'+M.util.get_string("label_cm","availability_completion")+'"><option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(i=0;i<this.cms.length;i++)a+='<option value="'+(l=this.cms[i]).id+'">'+l.name+"</option>";return a+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_completion","availability_completion")+' </span><select class="custom-select" name="e" title="'+M.util.get_string("label_completion","availability_completion")+'"><option value="1">'+M.util.get_string("option_complete","availability_completion")+'</option><option value="0">'+M.util.get_string("option_incomplete","availability_completion")+'</option><option value="2">'+M.util.get_string("option_pass","availability_completion")+'</option><option value="3">'+M.util.get_string("option_fail","availability_completion")+"</option></select></label></span>",t=o.Node.create('<span class="form-inline">'+a+"</span>"),e.cm!==undefined&&t.one("select[name=cm] > option[value="+e.cm+"]")&&t.one("select[name=cm]").set("value",""+e.cm),e.e!==undefined&&t.one("select[name=e]").set("value",""+e.e),M.availability_completion.form.addedEvents||(M.availability_completion.form.addedEvents=!0,o.one(".availability-field").delegate("change",function(){M.core_availability.form.update()},".availability_completion select")),t},M.availability_completion.form.fillValue=function(e,i){e.cm=parseInt(i.one("select[name=cm]").get("value"),10),e.e=parseInt(i.one("select[name=e]").get("value"),10)},M.availability_completion.form.fillErrors=function(i,e){var l,t=parseInt(e.one("select[name=cm]").get("value"),10);0===t&&i.push("availability_completion:error_selectcmid"),2!==(l=parseInt(e.one("select[name=e]").get("value"),10))&&3!==l||this.cms.forEach(function(e){e.id===t&&null===e.completiongradeitemnumber&&i.push("availability_completion:error_selectcmidpassfail")})}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_completion-form",function(o,e){M.availability_completion=M.availability_completion||{},M.availability_completion.form=o.Object(M.core_availability.plugin),M.availability_completion.form.initInner=function(e){this.cms=e},M.availability_completion.form.getNode=function(e){for(var i,l,t='<span class="col-form-label pr-3"> '+M.util.get_string("title","availability_completion")+'</span> <span class="availability-group form-group"><label><span class="accesshide">'+M.util.get_string("label_cm","availability_completion")+' </span><select class="custom-select" name="cm" title="'+M.util.get_string("label_cm","availability_completion")+'"><option value="0">'+M.util.get_string("choosedots","moodle")+"</option>",a=0;a<this.cms.length;a++)t+='<option value="'+(i=this.cms[a]).id+'">'+i.name+"</option>";return t+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_completion","availability_completion")+' </span><select class="custom-select" name="e" title="'+M.util.get_string("label_completion","availability_completion")+'"><option value="1">'+M.util.get_string("option_complete","availability_completion")+'</option><option value="0">'+M.util.get_string("option_incomplete","availability_completion")+'</option><option value="2">'+M.util.get_string("option_pass","availability_completion")+'</option><option value="3">'+M.util.get_string("option_fail","availability_completion")+"</option></select></label></span>",l=o.Node.create('<span class="form-inline">'+t+"</span>"),e.cm!==undefined&&l.one("select[name=cm] > option[value="+e.cm+"]")&&l.one("select[name=cm]").set("value",""+e.cm),e.e!==undefined&&l.one("select[name=e]").set("value",""+e.e),M.availability_completion.form.addedEvents||(M.availability_completion.form.addedEvents=!0,o.one(".availability-field").delegate("change",function(){M.core_availability.form.update()},".availability_completion select")),l},M.availability_completion.form.fillValue=function(e,i){e.cm=parseInt(i.one("select[name=cm]").get("value"),10),e.e=parseInt(i.one("select[name=e]").get("value"),10)},M.availability_completion.form.fillErrors=function(i,e){var l=parseInt(e.one("select[name=cm]").get("value"),10);0===l&&i.push("availability_completion:error_selectcmid"),2!==(e=parseInt(e.one("select[name=e]").get("value"),10))&&3!==e||this.cms.forEach(function(e){e.id===l&&null===e.completiongradeitemnumber&&i.push("availability_completion:error_selectcmidpassfail")})}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -1 +1 @@
YUI.add("moodle-availability_date-form",function(s,e){M.availability_date=M.availability_date||{},M.availability_date.form=s.Object(M.core_availability.plugin),M.availability_date.form.initInner=function(e,a){this.html=e,this.defaultTime=a},M.availability_date.form.getNode=function(e){var a,t,i,l,n='<span class="col-form-label pr-3">'+M.util.get_string("direction_before","availability_date")+'</span> <span class="availability-group"><label><span class="accesshide">'+M.util.get_string("direction_label","availability_date")+' </span><select name="direction" class="custom-select"><option value="&gt;=">'+M.util.get_string("direction_from","availability_date")+'</option><option value="&lt;">'+M.util.get_string("direction_until","availability_date")+"</option></select></label></span> "+this.html,o=s.Node.create("<span>"+n+"</span>");return e.t!==undefined?(o.setData("time",e.t),o.all("select:not([name=direction])").each(function(e){e.set("disabled",!0)}),a=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=fromtime&time="+e.t,s.io(a,{on:{success:function(e,a){var t,i,l=s.JSON.parse(a.responseText);for(t in l)(i=o.one("select[name=x\\["+t+"\\]]")).set("value",""+l[t]),i.set("disabled",!1)},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})):o.setData("time",this.defaultTime),e.d!==undefined&&o.one("select[name=direction]").set("value",e.d),M.availability_date.form.addedEvents||(M.availability_date.form.addedEvents=!0,(t=s.one(".availability-field")).delegate("change",function(){M.core_availability.form.update()},".availability_date select[name=direction]"),t.delegate("change",function(){M.availability_date.form.updateTime(this.ancestor("span.availability_date"))},".availability_date select:not([name=direction])")),o.one("a[href=#]")&&(M.form.dateselector.init_single_date_selector(o),i=o.one("select[name=x\\[year\\]]"),l=i.set,i.set=function(e,a){l.call(i,e,a),"selectedIndex"===e&&setTimeout(function(){M.availability_date.form.updateTime(o)},0)}),o},M.availability_date.form.updateTime=function(t){var e=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=totime&year="+t.one("select[name=x\\[year\\]]").get("value")+"&month="+t.one("select[name=x\\[month\\]]").get("value")+"&day="+t.one("select[name=x\\[day\\]]").get("value")+"&hour="+t.one("select[name=x\\[hour\\]]").get("value")+"&minute="+t.one("select[name=x\\[minute\\]]").get("value");s.io(e,{on:{success:function(e,a){t.setData("time",a.responseText),M.core_availability.form.update()},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})},M.availability_date.form.fillValue=function(e,a){e.d=a.one("select[name=direction]").get("value"),e.t=parseInt(a.getData("time"),10)}},"@VERSION@",{requires:["base","node","event","io","moodle-core_availability-form"]});
YUI.add("moodle-availability_date-form",function(o,e){M.availability_date=M.availability_date||{},M.availability_date.form=o.Object(M.core_availability.plugin),M.availability_date.form.initInner=function(e,a){this.html=e,this.defaultTime=a},M.availability_date.form.getNode=function(e){var t,i,a='<span class="col-form-label pr-3">'+M.util.get_string("direction_before","availability_date")+'</span> <span class="availability-group"><label><span class="accesshide">'+M.util.get_string("direction_label","availability_date")+' </span><select name="direction" class="custom-select"><option value="&gt;=">'+M.util.get_string("direction_from","availability_date")+'</option><option value="&lt;">'+M.util.get_string("direction_until","availability_date")+"</option></select></label></span> "+this.html,n=o.Node.create("<span>"+a+"</span>");return e.t!==undefined?(n.setData("time",e.t),n.all("select:not([name=direction])").each(function(e){e.set("disabled",!0)}),a=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=fromtime&time="+e.t,o.io(a,{on:{success:function(e,a){var t,i,l=o.JSON.parse(a.responseText);for(t in l)(i=n.one("select[name=x\\["+t+"\\]]")).set("value",""+l[t]),i.set("disabled",!1)},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})):n.setData("time",this.defaultTime),e.d!==undefined&&n.one("select[name=direction]").set("value",e.d),M.availability_date.form.addedEvents||(M.availability_date.form.addedEvents=!0,(a=o.one(".availability-field")).delegate("change",function(){M.core_availability.form.update()},".availability_date select[name=direction]"),a.delegate("change",function(){M.availability_date.form.updateTime(this.ancestor("span.availability_date"))},".availability_date select:not([name=direction])")),n.one("a[href=#]")&&(M.form.dateselector.init_single_date_selector(n),t=n.one("select[name=x\\[year\\]]"),i=t.set,t.set=function(e,a){i.call(t,e,a),"selectedIndex"===e&&setTimeout(function(){M.availability_date.form.updateTime(n)},0)}),n},M.availability_date.form.updateTime=function(t){var e=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=totime&year="+t.one("select[name=x\\[year\\]]").get("value")+"&month="+t.one("select[name=x\\[month\\]]").get("value")+"&day="+t.one("select[name=x\\[day\\]]").get("value")+"&hour="+t.one("select[name=x\\[hour\\]]").get("value")+"&minute="+t.one("select[name=x\\[minute\\]]").get("value");o.io(e,{on:{success:function(e,a){t.setData("time",a.responseText),M.core_availability.form.update()},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})},M.availability_date.form.fillValue=function(e,a){e.d=a.one("select[name=direction]").get("value"),e.t=parseInt(a.getData("time"),10)}},"@VERSION@",{requires:["base","node","event","io","moodle-core_availability-form"]});
@@ -1 +1 @@
YUI.add("moodle-availability_grade-form",function(o,a){M.availability_grade=M.availability_grade||{},M.availability_grade.form=o.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(a){this.grades=a,this.nodesSoFar=0},M.availability_grade.form.getNode=function(a){var e,i,l,t,n,r;for(this.nodesSoFar++,e='<label class="form-group"><span class="pr-3">'+M.util.get_string("title","availability_grade")+'</span> <span class="availability-group"><select name="id" class="custom-select"><option value="0">'+M.util.get_string("choosedots","moodle")+"</option>",i=0;i<this.grades.length;i++)e+='<option value="'+(l=this.grades[i]).id+'">'+l.name+"</option>";return e+='</select></span></label> <br><span class="availability-group form-group"><label><input type="checkbox" class="form-check-input mx-1" name="min"/>'+M.util.get_string("option_min","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_min","availability_grade")+'</span><input type="text" class="form-control mx-1" name="minval" title="'+M.util.get_string("label_min","availability_grade")+'"/></label>%</span><br><span class="availability-group form-group"><label><input type="checkbox" class="form-check-input mx-1" name="max"/>'+M.util.get_string("option_max","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_max","availability_grade")+'</span><input type="text" class="form-control mx-1" name="maxval" title="'+M.util.get_string("label_max","availability_grade")+'"/></label>%</span>',t=o.Node.create('<div class="d-inline-block form-inline">'+e+"</div>"),a.id!==undefined&&t.one("select[name=id] > option[value="+a.id+"]")&&t.one("select[name=id]").set("value",""+a.id),a.min!==undefined&&(t.one("input[name=min]").set("checked",!0),t.one("input[name=minval]").set("value",a.min)),a.max!==undefined&&(t.one("input[name=max]").set("checked",!0),t.one("input[name=maxval]").set("value",a.max)),n=function(a,e){var i=a.ancestor("label").next("label").one("input"),l=a.get("checked");return i.set("disabled",!l),e&&l&&i.focus(),l},t.all("input[type=checkbox]").each(n),M.availability_grade.form.addedEvents||(M.availability_grade.form.addedEvents=!0,(r=o.one(".availability-field")).delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),r.delegate("click",function(){n(this,!0),M.core_availability.form.update()},".availability_grade input[type=checkbox]"),r.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")),t},M.availability_grade.form.fillValue=function(a,e){a.id=parseInt(e.one("select[name=id]").get("value"),10),e.one("input[name=min]").get("checked")&&(a.min=this.getValue("minval",e)),e.one("input[name=max]").get("checked")&&(a.max=this.getValue("maxval",e))},M.availability_grade.form.getValue=function(a,e){var i,l=e.one("input[name="+a+"]").get("value");return!/^[0-9]+([.,][0-9]+)?$/.test(l)||(i=parseFloat(l.replace(",",".")))<0||100<i?l:i},M.availability_grade.form.fillErrors=function(a,e){var i={};this.fillValue(i,e),0===i.id&&a.push("availability_grade:error_selectgradeid"),i.min!==undefined&&"string"==typeof i.min||i.max!==undefined&&"string"==typeof i.max?a.push("availability_grade:error_invalidnumber"):i.min!==undefined&&i.max!==undefined&&i.max<=i.min&&a.push("availability_grade:error_backwardrange")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_grade-form",function(r,a){M.availability_grade=M.availability_grade||{},M.availability_grade.form=r.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(a){this.grades=a,this.nodesSoFar=0},M.availability_grade.form.getNode=function(a){var e,i,l,t,n;for(this.nodesSoFar++,e='<label class="form-group"><span class="pr-3">'+M.util.get_string("title","availability_grade")+'</span> <span class="availability-group"><select name="id" class="custom-select"><option value="0">'+M.util.get_string("choosedots","moodle")+"</option>",i=0;i<this.grades.length;i++)e+='<option value="'+(l=this.grades[i]).id+'">'+l.name+"</option>";return e+='</select></span></label> <br><span class="availability-group form-group"><label><input type="checkbox" class="form-check-input mx-1" name="min"/>'+M.util.get_string("option_min","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_min","availability_grade")+'</span><input type="text" class="form-control mx-1" name="minval" title="'+M.util.get_string("label_min","availability_grade")+'"/></label>%</span><br><span class="availability-group form-group"><label><input type="checkbox" class="form-check-input mx-1" name="max"/>'+M.util.get_string("option_max","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_max","availability_grade")+'</span><input type="text" class="form-control mx-1" name="maxval" title="'+M.util.get_string("label_max","availability_grade")+'"/></label>%</span>',t=r.Node.create('<div class="d-inline-block form-inline">'+e+"</div>"),a.id!==undefined&&t.one("select[name=id] > option[value="+a.id+"]")&&t.one("select[name=id]").set("value",""+a.id),a.min!==undefined&&(t.one("input[name=min]").set("checked",!0),t.one("input[name=minval]").set("value",a.min)),a.max!==undefined&&(t.one("input[name=max]").set("checked",!0),t.one("input[name=maxval]").set("value",a.max)),n=function(a,e){var i=a.ancestor("label").next("label").one("input"),a=a.get("checked");return i.set("disabled",!a),e&&a&&i.focus(),a},t.all("input[type=checkbox]").each(n),M.availability_grade.form.addedEvents||(M.availability_grade.form.addedEvents=!0,(a=r.one(".availability-field")).delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),a.delegate("click",function(){n(this,!0),M.core_availability.form.update()},".availability_grade input[type=checkbox]"),a.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")),t},M.availability_grade.form.fillValue=function(a,e){a.id=parseInt(e.one("select[name=id]").get("value"),10),e.one("input[name=min]").get("checked")&&(a.min=this.getValue("minval",e)),e.one("input[name=max]").get("checked")&&(a.max=this.getValue("maxval",e))},M.availability_grade.form.getValue=function(a,e){a=e.one("input[name="+a+"]").get("value");return!/^[0-9]+([.,][0-9]+)?$/.test(a)||(e=parseFloat(a.replace(",",".")))<0||100<e?a:e},M.availability_grade.form.fillErrors=function(a,e){var i={};this.fillValue(i,e),0===i.id&&a.push("availability_grade:error_selectgradeid"),i.min!==undefined&&"string"==typeof i.min||i.max!==undefined&&"string"==typeof i.max?a.push("availability_grade:error_invalidnumber"):i.min!==undefined&&i.max!==undefined&&i.max<=i.min&&a.push("availability_grade:error_backwardrange")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -1 +1 @@
YUI.add("moodle-availability_group-form",function(t,i){M.availability_group=M.availability_group||{},M.availability_group.form=t.Object(M.core_availability.plugin),M.availability_group.form.groups=null,M.availability_group.form.initInner=function(i){this.groups=i},M.availability_group.form.getNode=function(i){var a,e,l,o='<label><span class="pr-3">'+M.util.get_string("title","availability_group")+'</span> <span class="availability-group"><select name="id" class="custom-select"><option value="choose">'+M.util.get_string("choosedots","moodle")+'</option><option value="any">'+M.util.get_string("anygroup","availability_group")+"</option>";for(a=0;a<this.groups.length;a++)o+='<option value="'+(e=this.groups[a]).id+'">'+e.name+"</option>";return o+="</select></span></label>",l=t.Node.create('<span class="form-inline">'+o+"</span>"),i.creating===undefined&&(i.id!==undefined&&l.one("select[name=id] > option[value="+i.id+"]")?l.one("select[name=id]").set("value",""+i.id):i.id===undefined&&l.one("select[name=id]").set("value","any")),M.availability_group.form.addedEvents||(M.availability_group.form.addedEvents=!0,t.one(".availability-field").delegate("change",function(){M.core_availability.form.update()},".availability_group select")),l},M.availability_group.form.fillValue=function(i,a){var e=a.one("select[name=id]").get("value");"choose"===e?i.id="choose":"any"!==e&&(i.id=parseInt(e,10))},M.availability_group.form.fillErrors=function(i,a){var e={};this.fillValue(e,a),e.id&&"choose"===e.id&&i.push("availability_group:error_selectgroup")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_group-form",function(t,i){M.availability_group=M.availability_group||{},M.availability_group.form=t.Object(M.core_availability.plugin),M.availability_group.form.groups=null,M.availability_group.form.initInner=function(i){this.groups=i},M.availability_group.form.getNode=function(i){for(var a,e,l='<label><span class="pr-3">'+M.util.get_string("title","availability_group")+'</span> <span class="availability-group"><select name="id" class="custom-select"><option value="choose">'+M.util.get_string("choosedots","moodle")+'</option><option value="any">'+M.util.get_string("anygroup","availability_group")+"</option>",o=0;o<this.groups.length;o++)l+='<option value="'+(a=this.groups[o]).id+'">'+a.name+"</option>";return e=t.Node.create('<span class="form-inline">'+(l+="</select></span></label>")+"</span>"),i.creating===undefined&&(i.id!==undefined&&e.one("select[name=id] > option[value="+i.id+"]")?e.one("select[name=id]").set("value",""+i.id):i.id===undefined&&e.one("select[name=id]").set("value","any")),M.availability_group.form.addedEvents||(M.availability_group.form.addedEvents=!0,t.one(".availability-field").delegate("change",function(){M.core_availability.form.update()},".availability_group select")),e},M.availability_group.form.fillValue=function(i,a){a=a.one("select[name=id]").get("value");"choose"===a?i.id="choose":"any"!==a&&(i.id=parseInt(a,10))},M.availability_group.form.fillErrors=function(i,a){var e={};this.fillValue(e,a),e.id&&"choose"===e.id&&i.push("availability_group:error_selectgroup")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -1 +1 @@
YUI.add("moodle-availability_grouping-form",function(n,i){M.availability_grouping=M.availability_grouping||{},M.availability_grouping.form=n.Object(M.core_availability.plugin),M.availability_grouping.form.groupings=null,M.availability_grouping.form.initInner=function(i){this.groupings=i},M.availability_grouping.form.getNode=function(i){var a,e,l,o='<label><span class="pr-3">'+M.util.get_string("title","availability_grouping")+'</span> <span class="availability-group"><select name="id" class="custom-select"><option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>";for(a=0;a<this.groupings.length;a++)o+='<option value="'+(e=this.groupings[a]).id+'">'+e.name+"</option>";return o+="</select></span></label>",l=n.Node.create('<span class="form-inline">'+o+"</span>"),i.id!==undefined&&l.one("select[name=id] > option[value="+i.id+"]")&&l.one("select[name=id]").set("value",""+i.id),M.availability_grouping.form.addedEvents||(M.availability_grouping.form.addedEvents=!0,n.one(".availability-field").delegate("change",function(){M.core_availability.form.update()},".availability_grouping select")),l},M.availability_grouping.form.fillValue=function(i,a){var e=a.one("select[name=id]").get("value");i.id="choose"===e?"choose":parseInt(e,10)},M.availability_grouping.form.fillErrors=function(i,a){var e={};this.fillValue(e,a),"choose"===e.id&&i.push("availability_grouping:error_selectgrouping")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_grouping-form",function(n,i){M.availability_grouping=M.availability_grouping||{},M.availability_grouping.form=n.Object(M.core_availability.plugin),M.availability_grouping.form.groupings=null,M.availability_grouping.form.initInner=function(i){this.groupings=i},M.availability_grouping.form.getNode=function(i){for(var a,e,l='<label><span class="pr-3">'+M.util.get_string("title","availability_grouping")+'</span> <span class="availability-group"><select name="id" class="custom-select"><option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>",o=0;o<this.groupings.length;o++)l+='<option value="'+(a=this.groupings[o]).id+'">'+a.name+"</option>";return e=n.Node.create('<span class="form-inline">'+(l+="</select></span></label>")+"</span>"),i.id!==undefined&&e.one("select[name=id] > option[value="+i.id+"]")&&e.one("select[name=id]").set("value",""+i.id),M.availability_grouping.form.addedEvents||(M.availability_grouping.form.addedEvents=!0,n.one(".availability-field").delegate("change",function(){M.core_availability.form.update()},".availability_grouping select")),e},M.availability_grouping.form.fillValue=function(i,a){a=a.one("select[name=id]").get("value");i.id="choose"===a?"choose":parseInt(a,10)},M.availability_grouping.form.fillErrors=function(i,a){var e={};this.fillValue(e,a),"choose"===e.id&&i.push("availability_grouping:error_selectgrouping")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -1 +1 @@
YUI.add("moodle-availability_profile-form",function(f,e){M.availability_profile=M.availability_profile||{},M.availability_profile.form=f.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,i){this.standardFields=e,this.customFields=i},M.availability_profile.form.getNode=function(e){var i,l,a,t,o,s,n='<span class="availability-group"><label><span class="pr-3">'+M.util.get_string("conditiontitle","availability_profile")+'</span> <select name="field" class="custom-select"><option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>";for(l=0;l<this.standardFields.length;l++)n+='<option value="sf_'+(i=this.standardFields[l]).field+'">'+i.display+"</option>";for(l=0;l<this.customFields.length;l++)n+='<option value="cf_'+(i=this.customFields[l]).field+'">'+i.display+"</option>";for(n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_operator","availability_profile")+' </span><select name="op" title="'+M.util.get_string("label_operator","availability_profile")+'" class="custom-select">',a=["isequalto","contains","doesnotcontain","startswith","endswith","isempty","isnotempty"],l=0;l<a.length;l++)n+='<option value="'+a[l]+'">'+M.util.get_string("op_"+a[l],"availability_profile")+"</option>";return n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_value","availability_profile")+'</span><input name="value" type="text" class="form-control" style="width: 10em" title="'+M.util.get_string("label_value","availability_profile")+'"/></label></span>',t=f.Node.create('<span class="form-inline">'+n+"</span>"),e.sf!==undefined&&t.one("select[name=field] > option[value=sf_"+e.sf+"]")?t.one("select[name=field]").set("value","sf_"+e.sf):e.cf!==undefined&&t.one("select[name=field] > option[value=cf_"+e.cf+"]")&&t.one("select[name=field]").set("value","cf_"+e.cf),e.op!==undefined&&t.one("select[name=op] > option[value="+e.op+"]")&&(t.one("select[name=op]").set("value",e.op),"isempty"!==e.op&&"isnotempty"!==e.op||t.one("input[name=value]").set("disabled",!0)),e.v!==undefined&&t.one("input").set("value",e.v),M.availability_profile.form.addedEvents||(M.availability_profile.form.addedEvents=!0,o=function(e){var i=e.ancestor("span.availability_profile"),l=i.one("select[name=op]"),a="isempty"===l.get("value")||"isnotempty"===l.get("value");i.one("input[name=value]").set("disabled",a),M.core_availability.form.update()},(s=f.one(".availability-field")).delegate("change",function(){o(this)},".availability_profile select"),s.delegate("change",function(){o(this)},".availability_profile input[name=value]")),t},M.availability_profile.form.fillValue=function(e,i){var l,a=i.one("select[name=field]").get("value");"sf_"===a.substr(0,3)?e.sf=a.substr(3):"cf_"===a.substr(0,3)&&(e.cf=a.substr(3)),e.op=i.one("select[name=op]").get("value"),(l=i.one("input[name=value]")).get("disabled")||(e.v=l.get("value"))},M.availability_profile.form.fillErrors=function(e,i){var l={};this.fillValue(l,i),l.sf===undefined&&l.cf===undefined&&e.push("availability_profile:error_selectfield"),l.v!==undefined&&/^\s*$/.test(l.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_profile-form",function(n,e){M.availability_profile=M.availability_profile||{},M.availability_profile.form=n.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,i){this.standardFields=e,this.customFields=i},M.availability_profile.form.getNode=function(e){for(var i,l,a,t,o='<span class="availability-group"><label><span class="pr-3">'+M.util.get_string("conditiontitle","availability_profile")+'</span> <select name="field" class="custom-select"><option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>",s=0;s<this.standardFields.length;s++)o+='<option value="sf_'+(i=this.standardFields[s]).field+'">'+i.display+"</option>";for(s=0;s<this.customFields.length;s++)o+='<option value="cf_'+(i=this.customFields[s]).field+'">'+i.display+"</option>";for(o+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_operator","availability_profile")+' </span><select name="op" title="'+M.util.get_string("label_operator","availability_profile")+'" class="custom-select">',l=["isequalto","contains","doesnotcontain","startswith","endswith","isempty","isnotempty"],s=0;s<l.length;s++)o+='<option value="'+l[s]+'">'+M.util.get_string("op_"+l[s],"availability_profile")+"</option>";return o+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_value","availability_profile")+'</span><input name="value" type="text" class="form-control" style="width: 10em" title="'+M.util.get_string("label_value","availability_profile")+'"/></label></span>',a=n.Node.create('<span class="form-inline">'+o+"</span>"),e.sf!==undefined&&a.one("select[name=field] > option[value=sf_"+e.sf+"]")?a.one("select[name=field]").set("value","sf_"+e.sf):e.cf!==undefined&&a.one("select[name=field] > option[value=cf_"+e.cf+"]")&&a.one("select[name=field]").set("value","cf_"+e.cf),e.op!==undefined&&a.one("select[name=op] > option[value="+e.op+"]")&&(a.one("select[name=op]").set("value",e.op),"isempty"!==e.op&&"isnotempty"!==e.op||a.one("input[name=value]").set("disabled",!0)),e.v!==undefined&&a.one("input").set("value",e.v),M.availability_profile.form.addedEvents||(M.availability_profile.form.addedEvents=!0,t=function(e){var e=e.ancestor("span.availability_profile"),i=e.one("select[name=op]"),i="isempty"===i.get("value")||"isnotempty"===i.get("value");e.one("input[name=value]").set("disabled",i),M.core_availability.form.update()},(e=n.one(".availability-field")).delegate("change",function(){t(this)},".availability_profile select"),e.delegate("change",function(){t(this)},".availability_profile input[name=value]")),a},M.availability_profile.form.fillValue=function(e,i){var l=i.one("select[name=field]").get("value");"sf_"===l.substr(0,3)?e.sf=l.substr(3):"cf_"===l.substr(0,3)&&(e.cf=l.substr(3)),e.op=i.one("select[name=op]").get("value"),(l=i.one("input[name=value]")).get("disabled")||(e.v=l.get("value"))},M.availability_profile.form.fillErrors=function(e,i){var l={};this.fillValue(l,i),l.sf===undefined&&l.cf===undefined&&e.push("availability_profile:error_selectfield"),l.v!==undefined&&/^\s*$/.test(l.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
YUI.add("moodle-backup-backupselectall",function(g,e){M.core_backup=M.core_backup||{},M.core_backup.backupselectall=function(e){var t,n,i,c,o,l,a,u,s=null,d=function(e,t,i,n){var c,o;e.preventDefault(),c="",void 0!==n&&(c="setting_activity_"+n+"_"),o=i.length,g.all('input[type="checkbox"]').each(function(e){var n=e.get("name");c&&n.substring(0,c.length)!==c||n.substring(n.length-o)===i&&e.set("checked",t)}),s&&M.form&&M.form.updateFormState(s)},r=function(e,n,t,i){return void 0===i&&(i=""),'<div class="'+e+'"><div class="fitem fitem_fcheckbox backup_selector"><div class="fitemtitle">'+t+'</div><div class="felement"><a id="backup-all-'+n+'" href="#">'+M.util.get_string("all","moodle")+'</a> / <a id="backup-none-'+n+'" href="#">'+M.util.get_string("none","moodle")+"</a>"+i+"</div></div></div>"},p=g.one("fieldset#id_coursesettings .fcontainer.clearfix .grouped_settings.section_level");if(p&&p.one('input[type="checkbox"]')){for(l in s=p.ancestor("form").getAttribute("id"),t=!1,g.all('input[type="checkbox"]').each(function(e){var n=e.get("name");"_userdata"===n.substring(n.length-9)?t="_userdata":"_userinfo"===n.substring(n.length-9)&&(t="_userinfo")}),n=r("include_setting section_level","included",M.util.get_string("select","moodle"),' (<a id="backup-bytype" href="#">'+M.util.get_string("showtypes","backup")+"</a>)"),t&&(n+=r("normal_setting","userdata",M.util.get_string("select","moodle"))),i=g.Node.create('<div class="grouped_settings section_level">'+n+"</div>"),p.insert(i,"before"),c=function(e,n){g.one("#backup-all-mod_"+n).on("click",function(e){d(e,!0,"_included",n)}),g.one("#backup-none-mod_"+n).on("click",function(e){d(e,!1,"_included",n)}),t&&(g.one("#backup-all-userdata-mod_"+n).on("click",function(e){d(e,!0,t,n)}),g.one("#backup-none-userdata-mod_"+n).on("click",function(e){d(e,!1,t,n)}))},(o=g.Node.create('<div id="mod_select_links">')).hide(),o.currentlyshown=!1,i.appendChild(o),e)e.hasOwnProperty(l)&&(n=r("include_setting section_level","mod_"+l,e[l]),t&&(n+=r("normal_setting","userdata-mod_"+l,e[l])),a=g.Node.create('<div class="grouped_settings section_level">'+n+"</div>"),o.appendChild(a),c(a,l));u=function(){var e,n,t=g.one("#backup-bytype");o.currentlyshown?t.setHTML(M.util.get_string("showtypes","backup")):t.setHTML(M.util.get_string("hidetypes","backup")),o.currentlyshown=!o.currentlyshown,e={node:o,duration:.2},o.currentlyshown?(o.show(),e.to={maxHeight:o.get("clientHeight")+"px"},o.setStyle("maxHeight","0px"),(n=new g.Anim(e)).on("end",function(){o.setStyle("maxHeight","none")})):(e.to={maxHeight:"0px"},o.setStyle("maxHeight",o.get("clientHeight")+"px"),(n=new g.Anim(e)).on("end",function(){o.hide(),o.setStyle("maxHeight","none")})),n.run()},g.one("#backup-bytype").on("click",function(e){e.preventDefault(),u()}),g.one("#backup-all-included").on("click",function(e){d(e,!0,"_included")}),g.one("#backup-none-included").on("click",function(e){d(e,!1,"_included")}),t&&(g.one("#backup-all-userdata").on("click",function(e){d(e,!0,t)}),g.one("#backup-none-userdata").on("click",function(e){d(e,!1,t)}))}}},"@VERSION@",{requires:["node","event","node-event-simulate","anim"]});
YUI.add("moodle-backup-backupselectall",function(g,e){M.core_backup=M.core_backup||{},M.core_backup.backupselectall=function(e){var t,n,i,d,c,o,r,p,l=null,a=function(e,t,i,n){var c,o;e.preventDefault(),c=void 0!==n?"setting_activity_"+n+"_":"",o=i.length,g.all('input[type="checkbox"]').each(function(e){var n=e.get("name");c&&n.substring(0,c.length)!==c||n.substring(n.length-o)===i&&e.set("checked",t)}),l&&M.form&&M.form.updateFormState(l)},u=function(e,n,t,i){return void 0===i&&(i=""),'<div class="'+e+'"><div class="fitem fitem_fcheckbox backup_selector"><div class="fitemtitle">'+t+'</div><div class="felement"><a id="backup-all-'+n+'" href="#">'+M.util.get_string("all","moodle")+'</a> / <a id="backup-none-'+n+'" href="#">'+M.util.get_string("none","moodle")+"</a>"+i+"</div></div></div>"},s=g.one("fieldset#id_coursesettings .fcontainer.clearfix .grouped_settings.section_level");if(s&&s.one('input[type="checkbox"]')){for(o in l=s.ancestor("form").getAttribute("id"),t=!1,g.all('input[type="checkbox"]').each(function(e){e=e.get("name");"_userdata"===e.substring(e.length-9)?t="_userdata":"_userinfo"===e.substring(e.length-9)&&(t="_userinfo")}),n=u("include_setting section_level","included",M.util.get_string("select","moodle"),' (<a id="backup-bytype" href="#">'+M.util.get_string("showtypes","backup")+"</a>)"),t&&(n+=u("normal_setting","userdata",M.util.get_string("select","moodle"))),i=g.Node.create('<div class="grouped_settings section_level">'+n+"</div>"),s.insert(i,"before"),d=function(e,n){g.one("#backup-all-mod_"+n).on("click",function(e){a(e,!0,"_included",n)}),g.one("#backup-none-mod_"+n).on("click",function(e){a(e,!1,"_included",n)}),t&&(g.one("#backup-all-userdata-mod_"+n).on("click",function(e){a(e,!0,t,n)}),g.one("#backup-none-userdata-mod_"+n).on("click",function(e){a(e,!1,t,n)}))},(c=g.Node.create('<div id="mod_select_links">')).hide(),c.currentlyshown=!1,i.appendChild(c),e)e.hasOwnProperty(o)&&(n=u("include_setting section_level","mod_"+o,e[o]),t&&(n+=u("normal_setting","userdata-mod_"+o,e[o])),r=g.Node.create('<div class="grouped_settings section_level">'+n+"</div>"),c.appendChild(r),d(0,o));p=function(){var e,n=g.one("#backup-bytype");c.currentlyshown?n.setHTML(M.util.get_string("showtypes","backup")):n.setHTML(M.util.get_string("hidetypes","backup")),c.currentlyshown=!c.currentlyshown,n={node:c,duration:.2},c.currentlyshown?(c.show(),n.to={maxHeight:c.get("clientHeight")+"px"},c.setStyle("maxHeight","0px"),(e=new g.Anim(n)).on("end",function(){c.setStyle("maxHeight","none")})):(n.to={maxHeight:"0px"},c.setStyle("maxHeight",c.get("clientHeight")+"px"),(e=new g.Anim(n)).on("end",function(){c.hide(),c.setStyle("maxHeight","none")})),e.run()},g.one("#backup-bytype").on("click",function(e){e.preventDefault(),p()}),g.one("#backup-all-included").on("click",function(e){a(e,!0,"_included")}),g.one("#backup-none-included").on("click",function(e){a(e,!1,"_included")}),t&&(g.one("#backup-all-userdata").on("click",function(e){a(e,!0,t)}),g.one("#backup-none-userdata").on("click",function(e){a(e,!1,t)}))}}},"@VERSION@",{requires:["node","event","node-event-simulate","anim"]});
@@ -1 +1 @@
YUI.add("moodle-backup-confirmcancel",function(n,c){M.core_backup=M.core_backup||{},M.core_backup.confirmcancel={listeners:[],config:{},watch_cancel_buttons:function(c){this.config=c,this.listeners.push(n.one(n.config.doc.body).delegate("click",this.confirm_cancel,".confirmcancel",this))},confirm_cancel:function(e){e.preventDefault();var c=new M.core.confirm(this.config);c.on("complete-yes",function(){new n.EventHandle(M.core_backup.confirmcancel.listeners).detach();var c=e.currentTarget.one("input, select, button");c?c.simulate("click"):e.currentTarget.simulate("click")},this),c.show()}}},"@VERSION@",{requires:["node","node-event-simulate","moodle-core-notification-confirm"]});
YUI.add("moodle-backup-confirmcancel",function(n,c){M.core_backup=M.core_backup||{},M.core_backup.confirmcancel={listeners:[],config:{},watch_cancel_buttons:function(c){this.config=c,this.listeners.push(n.one(n.config.doc.body).delegate("click",this.confirm_cancel,".confirmcancel",this))},confirm_cancel:function(e){e.preventDefault();var c=new M.core.confirm(this.config);c.on("complete-yes",function(){new n.EventHandle(M.core_backup.confirmcancel.listeners).detach();var c=e.currentTarget.one("input, select, button");(c||e.currentTarget).simulate("click")},this),c.show()}}},"@VERSION@",{requires:["node","node-event-simulate","moodle-core-notification-confirm"]});
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core_badges/backpackactions",["exports","jquery","core_badges/selectors","core/str","core/pending","core/modal_factory","core/modal_events","core/config"],function(a,b,c,d,e,f,g,h){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=i(b);c=i(c);e=i(e);f=i(f);g=i(g);h=i(h);function i(a){return a&&a.__esModule?a:{default:a}}function j(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function k(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){j(h,d,e,f,g,"next",a)}function g(a){j(h,d,e,f,g,"throw",a)}f(void 0)})}}var l=function(){var a=new e.default,d=(0,b.default)(c.default.elements.main);m(d);a.resolve()};a.init=l;var m=function(a){a.on("click",c.default.actions.deletebackpack,function(){var a=k(regeneratorRuntime.mark(function a(c){var d,e;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:c.preventDefault();d=(0,b.default)(c.currentTarget);a.next=4;return n(d);case 4:e=a.sent;o(e,d);case 6:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}())},n=function(){var a=k(regeneratorRuntime.mark(function a(b){var e;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:e=b.closest(c.default.elements.backpackurl).attr("data-backpackurl");a.t0=f.default;a.next=4;return(0,d.get_string)("delexternalbackpack","core_badges");case 4:a.t1=a.sent;a.next=7;return(0,d.get_string)("delexternalbackpackconfirm","core_badges",e);case 7:a.t2=a.sent;a.t3=f.default.types.SAVE_CANCEL;a.t4={title:a.t1,body:a.t2,type:a.t3};return a.abrupt("return",a.t0.create.call(a.t0,a.t4));case 11:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),o=function(){var a=k(regeneratorRuntime.mark(function a(b,c){return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.t0=b;a.next=3;return(0,d.get_string)("delete","core");case 3:a.t1=a.sent;a.t0.setSaveButtonText.call(a.t0,a.t1);b.getRoot().on(g.default.save,function(){window.location.href=c.attr("href")+"&sesskey="+h.default.sesskey+"&confirm=1"});b.getRoot().on(g.default.hidden,function(){b.destroy()});b.show();case 8:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}()});
define ("core_badges/backpackactions",["exports","jquery","core_badges/selectors","core/str","core/pending","core/modal_factory","core/modal_events","core/config"],function(a,b,c,d,e,f,g,h){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=i(b);c=i(c);e=i(e);f=i(f);g=i(g);h=i(h);function i(a){return a&&a.__esModule?a:{default:a}}function j(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function k(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var f=a.apply(b,c);function g(a){j(f,d,e,g,h,"next",a)}function h(a){j(f,d,e,g,h,"throw",a)}g(void 0)})}}var l=function(){var a=new e.default,d=(0,b.default)(c.default.elements.main);m(d);a.resolve()};a.init=l;var m=function(a){a.on("click",c.default.actions.deletebackpack,function(){var a=k(regeneratorRuntime.mark(function c(a){var d,e;return regeneratorRuntime.wrap(function(c){while(1){switch(c.prev=c.next){case 0:a.preventDefault();d=(0,b.default)(a.currentTarget);c.next=4;return n(d);case 4:e=c.sent;o(e,d);case 6:case"end":return c.stop();}}},c)}));return function(){return a.apply(this,arguments)}}())},n=function(){var a=k(regeneratorRuntime.mark(function b(a){var e;return regeneratorRuntime.wrap(function(b){while(1){switch(b.prev=b.next){case 0:e=a.closest(c.default.elements.backpackurl).attr("data-backpackurl");b.t0=f.default;b.next=4;return(0,d.get_string)("delexternalbackpack","core_badges");case 4:b.t1=b.sent;b.next=7;return(0,d.get_string)("delexternalbackpackconfirm","core_badges",e);case 7:b.t2=b.sent;b.t3=f.default.types.SAVE_CANCEL;b.t4={title:b.t1,body:b.t2,type:b.t3};return b.abrupt("return",b.t0.create.call(b.t0,b.t4));case 11:case"end":return b.stop();}}},b)}));return function(){return a.apply(this,arguments)}}(),o=function(){var a=k(regeneratorRuntime.mark(function c(a,b){return regeneratorRuntime.wrap(function(c){while(1){switch(c.prev=c.next){case 0:c.t0=a;c.next=3;return(0,d.get_string)("delete","core");case 3:c.t1=c.sent;c.t0.setSaveButtonText.call(c.t0,c.t1);a.getRoot().on(g.default.save,function(){window.location.href=b.attr("href")+"&sesskey="+h.default.sesskey+"&confirm=1"});a.getRoot().on(g.default.hidden,function(){a.destroy()});a.show();case 8:case"end":return c.stop();}}},c)}));return function(){return a.apply(this,arguments)}}()});
//# sourceMappingURL=backpackactions.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("block_navigation/ajax_response_renderer",["jquery","core/templates","core/notification","core/url","core/aria"],function(a,b,c,d,e){var g={ACTIVITY:40,RESOURCE:50};function f(h,i){var j=a("<ul></ul>");j.attr("role","group");e.hide(j);a.each(i,function(e,h){if("object"!==_typeof(h)){return}var i=a("<li></li>"),k=a("<p></p>"),l=h.id||h.key+"_tree_item",m=null,n=h.expandable||h.haschildren?!0:!1;i.attr("role","treeitem");k.addClass("tree_item");k.attr("id",l);k.attr("tabindex","-1");if(h.requiresajaxloading){i.attr("data-requires-ajax",!0);i.attr("data-node-id",h.id);i.attr("data-node-key",h.key);i.attr("data-node-type",h.type)}if(n){i.addClass("collapsed contains_branch");i.attr("aria-expanded",!1);k.addClass("branch")}var o=null;if(h.link){var p=a("<a title=\""+h.title+"\" href=\""+h.link+"\"></a>");o=p;p.append("<span class=\"item-content-wrap\">"+h.name+"</span>");if(h.hidden){p.addClass("dimmed")}k.append(p)}else{var q=a("<span></span>");o=q;q.append("<span class=\"item-content-wrap\">"+h.name+"</span>");if(h.hidden){q.addClass("dimmed")}k.append(q)}if(h.icon&&(!n||h.type===g.ACTIVITY||h.type===g.RESOURCE)){i.addClass("item_with_icon");k.addClass("hasicon");if(h.type===g.ACTIVITY||h.type===g.RESOURCE){m=a("<img/>");m.attr("alt",h.icon.alt);m.attr("title",h.icon.title);m.attr("src",d.imageUrl(h.icon.pix,h.icon.component));a.each(h.icon.classes,function(a,b){m.addClass(b)});o.prepend(m)}else{if("moodle"==h.icon.component){h.icon.component="core"}b.renderPix(h.icon.pix,h.icon.component,h.icon.title).then(function(a){o.prepend(a)}).catch(c.exception)}}i.append(k);j.append(i);if(h.children&&h.children.length){f(i,h.children)}else if(n&&!h.requiresajaxloading){i.removeClass("contains_branch");k.addClass("emptybranch")}});h.append(j);var k=h.attr("id")+"_group";j.attr("id",k);h.attr("aria-owns",k);h.attr("role","treeitem")}return{render:function render(a,b){if(b.children&&b.children.length){f(a,b.children);var c=a.children("[role='treeitem']").first(),d=a.find("#"+c.attr("aria-owns"));c.attr("aria-expanded",!0);e.unhide(d)}else{if(a.hasClass("contains_branch")){a.removeClass("contains_branch");a.addClass("emptybranch")}}}}});
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("block_navigation/ajax_response_renderer",["jquery","core/templates","core/notification","core/url","core/aria"],function(a,b,c,d,e){var f={ACTIVITY:40,RESOURCE:50};function g(h,i){var j=a("<ul></ul>");j.attr("role","group");e.hide(j);a.each(i,function(e,h){if("object"!==_typeof(h)){return}var i=a("<li></li>"),k=a("<p></p>"),l=h.id||h.key+"_tree_item",m=null,n=h.expandable||h.haschildren?!0:!1;i.attr("role","treeitem");k.addClass("tree_item");k.attr("id",l);k.attr("tabindex","-1");if(h.requiresajaxloading){i.attr("data-requires-ajax",!0);i.attr("data-node-id",h.id);i.attr("data-node-key",h.key);i.attr("data-node-type",h.type)}if(n){i.addClass("collapsed contains_branch");i.attr("aria-expanded",!1);k.addClass("branch")}var o=null;if(h.link){var p=a("<a title=\""+h.title+"\" href=\""+h.link+"\"></a>");o=p;p.append("<span class=\"item-content-wrap\">"+h.name+"</span>");if(h.hidden){p.addClass("dimmed")}k.append(p)}else{var q=a("<span></span>");o=q;q.append("<span class=\"item-content-wrap\">"+h.name+"</span>");if(h.hidden){q.addClass("dimmed")}k.append(q)}if(h.icon&&(!n||h.type===f.ACTIVITY||h.type===f.RESOURCE)){i.addClass("item_with_icon");k.addClass("hasicon");if(h.type===f.ACTIVITY||h.type===f.RESOURCE){m=a("<img/>");m.attr("alt",h.icon.alt);m.attr("title",h.icon.title);m.attr("src",d.imageUrl(h.icon.pix,h.icon.component));a.each(h.icon.classes,function(a,b){m.addClass(b)});o.prepend(m)}else{if("moodle"==h.icon.component){h.icon.component="core"}b.renderPix(h.icon.pix,h.icon.component,h.icon.title).then(function(a){o.prepend(a)}).catch(c.exception)}}i.append(k);j.append(i);if(h.children&&h.children.length){g(i,h.children)}else if(n&&!h.requiresajaxloading){i.removeClass("contains_branch");k.addClass("emptybranch")}});h.append(j);var k=h.attr("id")+"_group";j.attr("id",k);h.attr("aria-owns",k);h.attr("role","treeitem")}return{render:function render(a,b){if(b.children&&b.children.length){g(a,b.children);var c=a.children("[role='treeitem']").first(),d=a.find("#"+c.attr("aria-owns"));c.attr("aria-expanded",!0);e.unhide(d)}else{if(a.hasClass("contains_branch")){a.removeClass("contains_branch");a.addClass("emptybranch")}}}}});
//# sourceMappingURL=ajax_response_renderer.min.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define ("block_navigation/nav_loader",["jquery","core/ajax","core/config","block_navigation/ajax_response_renderer"],function(a,b,c,d){var f=c.wwwroot+"/lib/ajax/getnavbranch.php";function e(a){return a.closest("[data-block]").attr("data-instanceid")}return{load:function load(b){b=a(b);var g=a.Deferred(),h={elementid:b.attr("data-node-id"),id:b.attr("data-node-key"),type:b.attr("data-node-type"),sesskey:c.sesskey,instance:e(b)};a.ajax(f,{type:"POST",dataType:"json",data:h}).done(function(a){d.render(b,a);g.resolve()});return g}}});
define ("block_navigation/nav_loader",["jquery","core/ajax","core/config","block_navigation/ajax_response_renderer"],function(a,b,c,d){var e=c.wwwroot+"/lib/ajax/getnavbranch.php";function f(a){return a.closest("[data-block]").attr("data-instanceid")}return{load:function load(b){b=a(b);var g=a.Deferred(),h={elementid:b.attr("data-node-id"),id:b.attr("data-node-key"),type:b.attr("data-node-type"),sesskey:c.sesskey,instance:f(b)};a.ajax(e,{type:"POST",dataType:"json",data:h}).done(function(a){d.render(b,a);g.resolve()});return g}}});
//# sourceMappingURL=nav_loader.min.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core_calendar/repository",["exports","core/ajax"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.getCourseGroupsData=a.getCalendarUpcomingData=a.updateEventStartDay=a.getCalendarDayData=a.getCalendarMonthData=a.submitCreateUpdateForm=a.getEventById=a.deleteEvent=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a){var c=1<arguments.length&&arguments[1]!==void 0?arguments[1]:!1;return b.default.call([{methodname:"core_calendar_delete_calendar_events",args:{events:[{eventid:a,repeat:c}]}}])[0]};a.deleteEvent=c;var d=function(a){return b.default.call([{methodname:"core_calendar_get_calendar_event_by_id",args:{eventid:a}}])[0]};a.getEventById=d;var e=function(a){return b.default.call([{methodname:"core_calendar_submit_create_update_form",args:{formdata:a}}])[0]};a.submitCreateUpdateForm=e;var f=function(a,c,d,e,f,g){var h=6<arguments.length&&arguments[6]!==void 0?arguments[6]:1;return b.default.call([{methodname:"core_calendar_get_calendar_monthly_view",args:{year:a,month:c,courseid:d,categoryid:e,includenavigation:f,mini:g,day:h}}])[0]};a.getCalendarMonthData=f;var g=function(a,c,d,e,f){return b.default.call([{methodname:"core_calendar_get_calendar_day_view",args:{year:a,month:c,day:d,courseid:e,categoryid:f}}])[0]};a.getCalendarDayData=g;var h=function(a,c){return b.default.call([{methodname:"core_calendar_update_event_start_day",args:{eventid:a,daytimestamp:c}}])[0]};a.updateEventStartDay=h;var i=function(a,c){return b.default.call([{methodname:"core_calendar_get_calendar_upcoming_view",args:{courseid:a,categoryid:c}}])[0]};a.getCalendarUpcomingData=i;var j=function(a){return b.default.call([{methodname:"core_group_get_course_groups",args:{courseid:a}}])[0]};a.getCourseGroupsData=j});
define ("core_calendar/repository",["exports","core/ajax"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.updateEventStartDay=a.submitCreateUpdateForm=a.getEventById=a.getCourseGroupsData=a.getCalendarUpcomingData=a.getCalendarMonthData=a.getCalendarDayData=a.deleteEvent=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a){var c=1<arguments.length&&arguments[1]!==void 0?arguments[1]:!1;return b.default.call([{methodname:"core_calendar_delete_calendar_events",args:{events:[{eventid:a,repeat:c}]}}])[0]};a.deleteEvent=c;var d=function(a){return b.default.call([{methodname:"core_calendar_get_calendar_event_by_id",args:{eventid:a}}])[0]};a.getEventById=d;var e=function(a){return b.default.call([{methodname:"core_calendar_submit_create_update_form",args:{formdata:a}}])[0]};a.submitCreateUpdateForm=e;var f=function(a,c,d,e,f,g){var h=6<arguments.length&&arguments[6]!==void 0?arguments[6]:1;return b.default.call([{methodname:"core_calendar_get_calendar_monthly_view",args:{year:a,month:c,courseid:d,categoryid:e,includenavigation:f,mini:g,day:h}}])[0]};a.getCalendarMonthData=f;var g=function(a,c,d,e,f){return b.default.call([{methodname:"core_calendar_get_calendar_day_view",args:{year:a,month:c,day:d,courseid:e,categoryid:f}}])[0]};a.getCalendarDayData=g;var h=function(a,c){return b.default.call([{methodname:"core_calendar_update_event_start_day",args:{eventid:a,daytimestamp:c}}])[0]};a.updateEventStartDay=h;var i=function(a,c){return b.default.call([{methodname:"core_calendar_get_calendar_upcoming_view",args:{courseid:a,categoryid:c}}])[0]};a.getCalendarUpcomingData=i;var j=function(a){return b.default.call([{methodname:"core_group_get_course_groups",args:{courseid:a}}])[0]};a.getCourseGroupsData=j});
//# sourceMappingURL=repository.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core_contentbank/actions",["jquery","core/ajax","core/notification","core/str","core/templates","core/url","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f,g,h){var l={DELETE_CONTENT:"[data-action=\"deletecontent\"]",RENAME_CONTENT:"[data-action=\"renamecontent\"]",SET_CONTENT_VISIBILITY:"[data-action=\"setcontentvisibility\"]"},m=function(){this.registerEvents()};m.prototype.registerEvents=function(){a(l.DELETE_CONTENT).click(function(b){b.preventDefault();var e=a(this).data("contentname"),f=a(this).data("uses"),j=a(this).data("contentid"),k=a(this).data("contextid"),l="";d.get_strings([{key:"deletecontent",component:"core_contentbank"},{key:"deletecontentconfirm",component:"core_contentbank",param:{name:e}},{key:"deletecontentconfirmlinked",component:"core_contentbank"},{key:"delete",component:"core"}]).then(function(a){var b=a[0],c=a[1];if(0<f){c+=" "+a[2]}l=a[3];return g.create({title:b,body:c,type:g.types.SAVE_CANCEL,large:!0})}).done(function(a){a.setSaveButtonText(l);a.getRoot().on(h.save,function(){return i(j,k)});a.getRoot().on(h.hidden,function(){a.destroy()});a.show()}).catch(c.exception)});a(l.RENAME_CONTENT).click(function(b){b.preventDefault();var f=a(this).data("contentname"),i=a(this).data("contentid"),k="";d.get_strings([{key:"renamecontent",component:"core_contentbank"},{key:"rename",component:"core_contentbank"}]).then(function(a){var b=a[0];k=a[1];return g.create({title:b,body:e.render("core_contentbank/renamecontent",{contentid:i,name:f}),type:g.types.SAVE_CANCEL})}).then(function(b){b.setSaveButtonText(k);b.getRoot().on(h.save,function(b){var e=a("#newname").val().trim();if(e){j(i,e)}else{d.get_strings([{key:"error"},{key:"emptynamenotallowed",component:"core_contentbank"}]).then(function(a){c.alert(a[0],a[1])}).catch(c.exception);b.preventDefault()}});b.getRoot().on(h.hidden,function(){b.destroy()});b.show()}).catch(c.exception)});a(l.SET_CONTENT_VISIBILITY).click(function(b){b.preventDefault();var c=a(this).data("contentid"),d=a(this).data("visibility");k(c,d)})};function i(a,d){var e="success";b.call([{methodname:"core_contentbank_delete_content",args:{contentids:{contentid:a}}}])[0].then(function(a){if(a.result){return"contentdeleted"}e="error";return"contentnotdeleted"}).done(function(a){var b={contextid:d};if("success"==e){b.statusmsg=a}else{b.errormsg=a}window.location.href=f.relativeUrl("contentbank/index.php",b,!1)}).fail(c.exception)}function j(a,d){var e="success";b.call([{methodname:"core_contentbank_rename_content",args:{contentid:a,name:d}}])[0].then(function(a){if(a.result){return"contentrenamed"}e="error";return a.warnings[0].message}).then(function(b){var d=null;if("success"==e){d={id:a,statusmsg:b};window.location.href=f.relativeUrl("contentbank/view.php",d,!1)}else{c.addNotification({message:b,type:"error"});c.fetchNotifications()}}).catch(c.exception)}function k(a,d){var e="success";b.call([{methodname:"core_contentbank_set_content_visibility",args:{contentid:a,visibility:d}}])[0].then(function(a){if(a.result){return"contentvisibilitychanged"}e="error";return a.warnings[0].message}).then(function(b){var d=null;if("success"==e){d={id:a,statusmsg:b};window.location.href=f.relativeUrl("contentbank/view.php",d,!1)}else{c.addNotification({message:b,type:"error"});c.fetchNotifications()}}).catch(c.exception)}return{init:function init(){return new m}}});
define ("core_contentbank/actions",["jquery","core/ajax","core/notification","core/str","core/templates","core/url","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f,g,h){var i={DELETE_CONTENT:"[data-action=\"deletecontent\"]",RENAME_CONTENT:"[data-action=\"renamecontent\"]",SET_CONTENT_VISIBILITY:"[data-action=\"setcontentvisibility\"]"},j=function(){this.registerEvents()};j.prototype.registerEvents=function(){a(i.DELETE_CONTENT).click(function(b){b.preventDefault();var e=a(this).data("contentname"),f=a(this).data("uses"),i=a(this).data("contentid"),j=a(this).data("contextid"),l="";d.get_strings([{key:"deletecontent",component:"core_contentbank"},{key:"deletecontentconfirm",component:"core_contentbank",param:{name:e}},{key:"deletecontentconfirmlinked",component:"core_contentbank"},{key:"delete",component:"core"}]).then(function(a){var b=a[0],c=a[1];if(0<f){c+=" "+a[2]}l=a[3];return g.create({title:b,body:c,type:g.types.SAVE_CANCEL,large:!0})}).done(function(a){a.setSaveButtonText(l);a.getRoot().on(h.save,function(){return k(i,j)});a.getRoot().on(h.hidden,function(){a.destroy()});a.show()}).catch(c.exception)});a(i.RENAME_CONTENT).click(function(b){b.preventDefault();var f=a(this).data("contentname"),i=a(this).data("contentid"),j="";d.get_strings([{key:"renamecontent",component:"core_contentbank"},{key:"rename",component:"core_contentbank"}]).then(function(a){var b=a[0];j=a[1];return g.create({title:b,body:e.render("core_contentbank/renamecontent",{contentid:i,name:f}),type:g.types.SAVE_CANCEL})}).then(function(b){b.setSaveButtonText(j);b.getRoot().on(h.save,function(b){var e=a("#newname").val().trim();if(e){l(i,e)}else{d.get_strings([{key:"error"},{key:"emptynamenotallowed",component:"core_contentbank"}]).then(function(a){c.alert(a[0],a[1])}).catch(c.exception);b.preventDefault()}});b.getRoot().on(h.hidden,function(){b.destroy()});b.show()}).catch(c.exception)});a(i.SET_CONTENT_VISIBILITY).click(function(b){b.preventDefault();var c=a(this).data("contentid"),d=a(this).data("visibility");m(c,d)})};function k(a,d){var e="success";b.call([{methodname:"core_contentbank_delete_content",args:{contentids:{contentid:a}}}])[0].then(function(a){if(a.result){return"contentdeleted"}e="error";return"contentnotdeleted"}).done(function(a){var b={contextid:d};if("success"==e){b.statusmsg=a}else{b.errormsg=a}window.location.href=f.relativeUrl("contentbank/index.php",b,!1)}).fail(c.exception)}function l(a,d){var e="success";b.call([{methodname:"core_contentbank_rename_content",args:{contentid:a,name:d}}])[0].then(function(a){if(a.result){return"contentrenamed"}e="error";return a.warnings[0].message}).then(function(b){var d=null;if("success"==e){d={id:a,statusmsg:b};window.location.href=f.relativeUrl("contentbank/view.php",d,!1)}else{c.addNotification({message:b,type:"error"});c.fetchNotifications()}}).catch(c.exception)}function m(a,d){var e="success";b.call([{methodname:"core_contentbank_set_content_visibility",args:{contentid:a,visibility:d}}])[0].then(function(a){if(a.result){return"contentvisibilitychanged"}e="error";return a.warnings[0].message}).then(function(b){var d=null;if("success"==e){d={id:a,statusmsg:b};window.location.href=f.relativeUrl("contentbank/view.php",d,!1)}else{c.addNotification({message:b,type:"error"});c.fetchNotifications()}}).catch(c.exception)}return{init:function init(){return new j}}});
//# sourceMappingURL=actions.min.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core_contentbank/search",["exports","jquery","core_contentbank/selectors","core/str","core/pending","core/utils"],function(a,b,c,d,e,f){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=g(b);c=g(c);e=g(e);function g(a){return a&&a.__esModule?a:{default:a}}function h(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function i(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function f(a){h(i,d,e,f,g,"next",a)}function g(a){h(i,d,e,f,g,"throw",a)}f(void 0)})}}var j=function(){var a=new e.default,d=(0,b.default)(c.default.regions.contentbank);k(d);a.resolve()};a.init=j;var k=function(a){var b=a.find(c.default.elements.searchinput)[0];a.on("click",c.default.actions.search,function(c){c.preventDefault();l(a,b.value)});a.on("click",c.default.actions.clearSearch,function(c){c.preventDefault();b.value="";b.focus();l(a,b.value)});b.addEventListener("input",(0,f.debounce)(function(){l(a,b.value)},300))},l=function(){var a=i(regeneratorRuntime.mark(function a(b,e){var f,g,h,i;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:f=b.find(c.default.actions.clearSearch)[0];g=b.find(c.default.elements.cbnavbarbreadcrumb)[0];h=b.find(c.default.elements.cbnavbartotalsearch)[0];i=m(b,e);if(!(0<e.length)){a.next=13;break}f.classList.remove("d-none");g.classList.add("d-none");a.next=9;return(0,d.get_string)("itemsfound","core_contentbank",i.length);case 9:h.innerHTML=a.sent;h.classList.remove("d-none");a.next=16;break;case 13:f.classList.add("d-none");g.classList.remove("d-none");h.classList.add("d-none");case 16:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),m=function(a,b){var d=Array.from(a.find(c.default.elements.listitem)),e=[];d.forEach(function(a){var d=a.getAttribute("data-name");if(""===b||d.toLowerCase().includes(b.toLowerCase())){e.push(a);var f=a.querySelector(c.default.regions.cbcontentname);f.innerHTML=n(d,b);a.classList.remove("d-none")}else{a.classList.add("d-none")}});return e},n=function(a,b){var c=a;if(""!==b){var d=a.toLowerCase().indexOf(b.toLowerCase());if(-1<d){c=a.substr(0,d)+"<span class=\"matchtext\">"+a.substr(d,b.length)+"</span>"+a.substr(d+b.length)}}return c}});
define ("core_contentbank/search",["exports","jquery","core_contentbank/selectors","core/str","core/pending","core/utils"],function(a,b,c,d,e,f){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=g(b);c=g(c);e=g(e);function g(a){return a&&a.__esModule?a:{default:a}}function h(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function i(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var f=a.apply(b,c);function g(a){h(f,d,e,g,i,"next",a)}function i(a){h(f,d,e,g,i,"throw",a)}g(void 0)})}}var j=function(){var a=new e.default,d=(0,b.default)(c.default.regions.contentbank);k(d);a.resolve()};a.init=j;var k=function(a){var b=a.find(c.default.elements.searchinput)[0];a.on("click",c.default.actions.search,function(c){c.preventDefault();l(a,b.value)});a.on("click",c.default.actions.clearSearch,function(c){c.preventDefault();b.value="";b.focus();l(a,b.value)});b.addEventListener("input",(0,f.debounce)(function(){l(a,b.value)},300))},l=function(){var a=i(regeneratorRuntime.mark(function e(a,b){var f,g,h,i;return regeneratorRuntime.wrap(function(e){while(1){switch(e.prev=e.next){case 0:f=a.find(c.default.actions.clearSearch)[0];g=a.find(c.default.elements.cbnavbarbreadcrumb)[0];h=a.find(c.default.elements.cbnavbartotalsearch)[0];i=m(a,b);if(!(0<b.length)){e.next=13;break}f.classList.remove("d-none");g.classList.add("d-none");e.next=9;return(0,d.get_string)("itemsfound","core_contentbank",i.length);case 9:h.innerHTML=e.sent;h.classList.remove("d-none");e.next=16;break;case 13:f.classList.add("d-none");g.classList.remove("d-none");h.classList.add("d-none");case 16:case"end":return e.stop();}}},e)}));return function(){return a.apply(this,arguments)}}(),m=function(a,b){var d=Array.from(a.find(c.default.elements.listitem)),e=[];d.forEach(function(a){var d=a.getAttribute("data-name");if(""===b||d.toLowerCase().includes(b.toLowerCase())){e.push(a);var f=a.querySelector(c.default.regions.cbcontentname);f.innerHTML=n(d,b);a.classList.remove("d-none")}else{a.classList.add("d-none")}});return e},n=function(a,b){var c=a;if(""!==b){var d=a.toLowerCase().indexOf(b.toLowerCase());if(-1<d){c=a.substr(0,d)+"<span class=\"matchtext\">"+a.substr(d,b.length)+"</span>"+a.substr(d+b.length)}}return c}});
//# sourceMappingURL=search.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core_course/copy_modal",["jquery","core/str","core/modal_factory","core/modal_events","core/ajax","core/fragment","core/notification","core/config"],function(a,b,c,d,f,g,h,i){var m={},n,o,p,q="<p class=\"text-center\"><i class=\"fa fa-spinner fa-pulse fa-2x fa-fw\"></i></p>";function j(){b.get_string("loading").then(function(a){c.create({type:c.types.DEFAULT,title:a,body:q,large:!0}).done(function(a){p=a;p.getRoot().on("click","#id_submitreturn",l);p.getRoot().on("click","#id_submitdisplay",function(a){a.formredirect=!0;l(a)});p.getRoot().on("click","#id_cancel",function(a){a.preventDefault();p.setBody(q);p.hide()})})}).catch(function(){h.exception(new Error("Failed to load string: loading"))})}function k(a){if("undefined"==typeof a){a={}}var c={jsonformdata:JSON.stringify(a),courseid:o.id};p.setBody(q);b.get_string("copycoursetitle","backup",o.shortname).then(function(a){p.setTitle(a);p.setBody(g.loadFragment("course","new_base_form",n,c))}).catch(function(){h.exception(new Error("Failed to load string: copycoursetitle"))})}function l(b){b.preventDefault();var c=p.getRoot().find("form").serialize(),d=JSON.stringify(c),e=a.merge(p.getRoot().find("[aria-invalid=\"true\"]"),p.getRoot().find(".error"));if(e.length){e.first().focus();return}f.call([{methodname:"core_backup_submit_copy_form",args:{jsonformdata:d}}])[0].done(function(){p.setBody(q);p.hide();if(!0==b.formredirect){var a=i.wwwroot+"/backup/copyprogress.php?id="+o.id;window.location.assign(a)}}).fail(function(){k(c)})}m.init=function(b){n=b;j();a(".action-copy").on("click",function(a){a.preventDefault();var b=new URL(this.getAttribute("href")),c=new URLSearchParams(b.search),d=c.get("id");f.call([{methodname:"core_course_get_courses",args:{options:{ids:[d]}}}])[0].done(function(a){o=a[0];k()}).fail(function(){h.exception(new Error("Failed to load course"))});p.show()})};return m});
define ("core_course/copy_modal",["jquery","core/str","core/modal_factory","core/modal_events","core/ajax","core/fragment","core/notification","core/config"],function(a,b,c,d,f,g,h,i){var j={},k,l,m,n="<p class=\"text-center\"><i class=\"fa fa-spinner fa-pulse fa-2x fa-fw\"></i></p>";function o(){b.get_string("loading").then(function(a){c.create({type:c.types.DEFAULT,title:a,body:n,large:!0}).done(function(a){m=a;m.getRoot().on("click","#id_submitreturn",q);m.getRoot().on("click","#id_submitdisplay",function(a){a.formredirect=!0;q(a)});m.getRoot().on("click","#id_cancel",function(a){a.preventDefault();m.setBody(n);m.hide()})})}).catch(function(){h.exception(new Error("Failed to load string: loading"))})}function p(a){if("undefined"==typeof a){a={}}var c={jsonformdata:JSON.stringify(a),courseid:l.id};m.setBody(n);b.get_string("copycoursetitle","backup",l.shortname).then(function(a){m.setTitle(a);m.setBody(g.loadFragment("course","new_base_form",k,c))}).catch(function(){h.exception(new Error("Failed to load string: copycoursetitle"))})}function q(b){b.preventDefault();var c=m.getRoot().find("form").serialize(),d=JSON.stringify(c),e=a.merge(m.getRoot().find("[aria-invalid=\"true\"]"),m.getRoot().find(".error"));if(e.length){e.first().focus();return}f.call([{methodname:"core_backup_submit_copy_form",args:{jsonformdata:d}}])[0].done(function(){m.setBody(n);m.hide();if(!0==b.formredirect){var a=i.wwwroot+"/backup/copyprogress.php?id="+l.id;window.location.assign(a)}}).fail(function(){p(c)})}j.init=function(b){k=b;o();a(".action-copy").on("click",function(a){a.preventDefault();var b=new URL(this.getAttribute("href")),c=new URLSearchParams(b.search),d=c.get("id");f.call([{methodname:"core_course_get_courses",args:{options:{ids:[d]}}}])[0].done(function(a){l=a[0];p()}).fail(function(){h.exception(new Error("Failed to load course"))});m.show()})};return j});
//# sourceMappingURL=copy_modal.min.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_course/downloadcontent",["exports","core/config","core/custom_interaction_events","core/modal_factory","jquery","core/pending","core/key_codes"],function(a,b,c,d,e,f,g){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=j(b);c=j(c);d=i(d);e=j(e);f=j(f);function h(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;h=function(){return a};return a}function i(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=h();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function j(a){return a&&a.__esModule?a:{default:a}}var k=function(){var a=new f.default;(0,e.default)("[data-downloadcourse]").on("click keydown",function(a){if("click"===a.type||a.which===g.enter||a.which===g.space){a.preventDefault();l(a.currentTarget)}});a.resolve()};a.init=k;var l=function(a){d.create({title:a.dataset.downloadTitle,type:d.types.SAVE_CANCEL,body:"<p>".concat(a.dataset.downloadBody,"</p>"),buttons:{save:a.dataset.downloadButtonText},templateContext:{classes:"downloadcoursecontentmodal"}}).then(function(b){b.show();var d=document.querySelector(".modal .downloadcoursecontentmodal [data-action=\"save\"]"),f=document.querySelector(".modal .downloadcoursecontentmodal [data-action=\"cancel\"]"),g=document.querySelector(".modal[data-region=\"modal-container\"]");(0,e.default)(d).on(c.default.events.activate,function(c){return m(c,a,b)});(0,e.default)(f).on(c.default.events.activate,function(){b.destroy()});if(g.querySelector(".downloadcoursecontentmodal")){(0,e.default)(g).on(c.default.events.activate,function(){b.destroy()})}})},m=function(a,c,d){a.preventDefault();var e=document.createElement("form");e.action=c.dataset.downloadLink;e.method="POST";e.target="_blank";var f=document.createElement("input");f.name="sesskey";f.value=b.default.sesskey;e.appendChild(f);e.style.display="none";document.body.appendChild(e);e.submit();document.body.removeChild(e);d.destroy()}});
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("core_course/downloadcontent",["exports","core/config","core/custom_interaction_events","core/modal_factory","jquery","core/pending","core/key_codes"],function(a,b,c,d,e,f,g){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=j(b);c=j(c);d=i(d);e=j(e);f=j(f);function h(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(h=function(a){return a?c:b})(a)}function i(a,b){if(!b&&a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var c=h(b);if(c&&c.has(a)){return c.get(a)}var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a){if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;if(g&&(g.get||g.set)){Object.defineProperty(d,f,g)}else{d[f]=a[f]}}}d.default=a;if(c){c.set(a,d)}return d}function j(a){return a&&a.__esModule?a:{default:a}}var k=function(){var a=new f.default;(0,e.default)("[data-downloadcourse]").on("click keydown",function(a){if("click"===a.type||a.which===g.enter||a.which===g.space){a.preventDefault();l(a.currentTarget)}});a.resolve()};a.init=k;var l=function(a){d.create({title:a.dataset.downloadTitle,type:d.types.SAVE_CANCEL,body:"<p>".concat(a.dataset.downloadBody,"</p>"),buttons:{save:a.dataset.downloadButtonText},templateContext:{classes:"downloadcoursecontentmodal"}}).then(function(b){b.show();var d=document.querySelector(".modal .downloadcoursecontentmodal [data-action=\"save\"]"),f=document.querySelector(".modal .downloadcoursecontentmodal [data-action=\"cancel\"]"),g=document.querySelector(".modal[data-region=\"modal-container\"]");(0,e.default)(d).on(c.default.events.activate,function(c){return m(c,a,b)});(0,e.default)(f).on(c.default.events.activate,function(){b.destroy()});if(g.querySelector(".downloadcoursecontentmodal")){(0,e.default)(g).on(c.default.events.activate,function(){b.destroy()})}})},m=function(a,c,d){a.preventDefault();var e=document.createElement("form");e.action=c.dataset.downloadLink;e.method="POST";e.target="_blank";var f=document.createElement("input");f.name="sesskey";f.value=b.default.sesskey;e.appendChild(f);e.style.display="none";document.body.appendChild(e);e.submit();document.body.removeChild(e);d.destroy()}});
//# sourceMappingURL=downloadcontent.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core_course/local/activitychooser/repository",["exports","core/ajax"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.fetchFooterData=a.unfavouriteModule=a.favouriteModule=a.activityModules=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a){return b.default.call([{methodname:"core_course_get_course_content_items",args:{courseid:a}}])[0]};a.activityModules=c;var d=function(a,c){return b.default.call([{methodname:"core_course_add_content_item_to_user_favourites",args:{componentname:a,contentitemid:c}}])[0]};a.favouriteModule=d;var e=function(a,c){return b.default.call([{methodname:"core_course_remove_content_item_from_user_favourites",args:{componentname:a,contentitemid:c}}])[0]};a.unfavouriteModule=e;var f=function(a,c){return b.default.call([{methodname:"core_course_get_activity_chooser_footer",args:{courseid:a,sectionid:c}}])[0]};a.fetchFooterData=f});
define ("core_course/local/activitychooser/repository",["exports","core/ajax"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.unfavouriteModule=a.fetchFooterData=a.favouriteModule=a.activityModules=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a){return b.default.call([{methodname:"core_course_get_course_content_items",args:{courseid:a}}])[0]};a.activityModules=c;var d=function(a,c){return b.default.call([{methodname:"core_course_add_content_item_to_user_favourites",args:{componentname:a,contentitemid:c}}])[0]};a.favouriteModule=d;var e=function(a,c){return b.default.call([{methodname:"core_course_remove_content_item_from_user_favourites",args:{componentname:a,contentitemid:c}}])[0]};a.unfavouriteModule=e;var f=function(a,c){return b.default.call([{methodname:"core_course_get_activity_chooser_footer",args:{courseid:a,sectionid:c}}])[0]};a.fetchFooterData=f});
//# sourceMappingURL=repository.min.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_course/manual_completion_toggle",["exports","core/templates","core/notification","core_course/repository","core_course/events"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=h(b);c=h(c);e=g(e);function f(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;f=function(){return a};return a}function g(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=f();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var g=d?Object.getOwnPropertyDescriptor(a,e):null;if(g&&(g.get||g.set)){Object.defineProperty(c,e,g)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function h(a){return a&&a.__esModule?a:{default:a}}function i(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function j(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){i(h,d,e,f,g,"next",a)}function g(a){i(h,d,e,f,g,"throw",a)}f(void 0)})}}var k={MANUAL_TOGGLE:"button[data-action=toggle-manual-completion]"},l={TOGGLE_MARK_DONE:"manual:mark-done",TOGGLE_UNDO:"manual:undo"},m=!1,n=function(){if(m){return}document.addEventListener("click",function(a){var b=a.target.closest(k.MANUAL_TOGGLE);if(b){a.preventDefault();o(b).catch(c.default.exception)}});m=!0};a.init=n;var o=function(){var a=j(regeneratorRuntime.mark(function a(f){var g,h,i,j,k,m,n,o,p,q,r,s;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:g=f.innerHTML;f.setAttribute("disabled","disabled");h=f.getAttribute("data-toggletype");i=f.getAttribute("data-cmid");j=f.getAttribute("data-activityname");k=h===l.TOGGLE_MARK_DONE;a.next=8;return b.default.render("core/loading",{});case 8:m=a.sent;a.next=11;return b.default.replaceNodeContents(f,m,"");case 11:a.prev=11;a.next=14;return(0,d.toggleManualCompletion)(i,k);case 14:n={cmid:i,activityname:j,overallcomplete:k,overallincomplete:!k,istrackeduser:!0};a.next=17;return b.default.renderForPromise("core_course/completion_manual",n);case 17:o=a.sent;a.next=20;return b.default.replaceNode(f,o.html,o.js);case 20:p=a.sent;q=p.pop();r=f.getAttribute("data-withavailability");s=new CustomEvent(e.manualCompletionToggled,{bubbles:!0,detail:{cmid:i,activityname:j,completed:k,withAvailability:r}});q.dispatchEvent(s);a.next=32;break;case 27:a.prev=27;a.t0=a["catch"](11);f.removeAttribute("disabled");f.innerHTML=g;c.default.exception(a.t0);case 32:case"end":return a.stop();}}},a,null,[[11,27]])}));return function(){return a.apply(this,arguments)}}()});
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("core_course/manual_completion_toggle",["exports","core/templates","core/notification","core_course/repository","core_course/events"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=h(b);c=h(c);e=g(e);function f(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(f=function(a){return a?c:b})(a)}function g(a,b){if(!b&&a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var c=f(b);if(c&&c.has(a)){return c.get(a)}var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a){if("default"!=g&&Object.prototype.hasOwnProperty.call(a,g)){var h=e?Object.getOwnPropertyDescriptor(a,g):null;if(h&&(h.get||h.set)){Object.defineProperty(d,g,h)}else{d[g]=a[g]}}}d.default=a;if(c){c.set(a,d)}return d}function h(a){return a&&a.__esModule?a:{default:a}}function i(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function j(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var f=a.apply(b,c);function g(a){i(f,d,e,g,h,"next",a)}function h(a){i(f,d,e,g,h,"throw",a)}g(void 0)})}}var k={MANUAL_TOGGLE:"button[data-action=toggle-manual-completion]"},l={TOGGLE_MARK_DONE:"manual:mark-done",TOGGLE_UNDO:"manual:undo"},m=!1,n=function(){if(m){return}document.addEventListener("click",function(a){var b=a.target.closest(k.MANUAL_TOGGLE);if(b){a.preventDefault();o(b).catch(c.default.exception)}});m=!0};a.init=n;var o=function(){var a=j(regeneratorRuntime.mark(function f(a){var g,h,i,j,k,m,n,o,p,q,r,s;return regeneratorRuntime.wrap(function(f){while(1){switch(f.prev=f.next){case 0:g=a.innerHTML;a.setAttribute("disabled","disabled");h=a.getAttribute("data-toggletype");i=a.getAttribute("data-cmid");j=a.getAttribute("data-activityname");k=h===l.TOGGLE_MARK_DONE;f.next=8;return b.default.render("core/loading",{});case 8:m=f.sent;f.next=11;return b.default.replaceNodeContents(a,m,"");case 11:f.prev=11;f.next=14;return(0,d.toggleManualCompletion)(i,k);case 14:n={cmid:i,activityname:j,overallcomplete:k,overallincomplete:!k,istrackeduser:!0};f.next=17;return b.default.renderForPromise("core_course/completion_manual",n);case 17:o=f.sent;f.next=20;return b.default.replaceNode(a,o.html,o.js);case 20:p=f.sent;q=p.pop();r=a.getAttribute("data-withavailability");s=new CustomEvent(e.manualCompletionToggled,{bubbles:!0,detail:{cmid:i,activityname:j,completed:k,withAvailability:r}});q.dispatchEvent(s);f.next=32;break;case 27:f.prev=27;f.t0=f["catch"](11);a.removeAttribute("disabled");a.innerHTML=g;c.default.exception(f.t0);case 32:case"end":return f.stop();}}},f,null,[[11,27]])}));return function(){return a.apply(this,arguments)}}()});
//# sourceMappingURL=manual_completion_toggle.min.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_course/view",["exports","core_course/events"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=d(b);function c(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;c=function(){return a};return a}function d(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=c();if(b&&b.has(a)){return b.get(a)}var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a){if(Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;if(g&&(g.get||g.set)){Object.defineProperty(d,f,g)}else{d[f]=a[f]}}}d.default=a;if(b){b.set(a,d)}return d}var e=!1,f=function(){if(e){return}document.addEventListener(b.manualCompletionToggled,function(a){var b=parseInt(a.detail.withAvailability);if(b){window.location.reload()}});e=!0};a.init=f});
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("core_course/view",["exports","core_course/events"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=d(b);function c(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,d=new WeakMap;return(c=function(a){return a?d:b})(a)}function d(a,b){if(!b&&a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var d=c(b);if(d&&d.has(a)){return d.get(a)}var e={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a){if("default"!=g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;if(h&&(h.get||h.set)){Object.defineProperty(e,g,h)}else{e[g]=a[g]}}}e.default=a;if(d){d.set(a,e)}return e}var e=!1,f=function(){if(e){return}document.addEventListener(b.manualCompletionToggled,function(a){var b=parseInt(a.detail.withAvailability);if(b){window.location.reload()}});e=!0};a.init=f});
//# sourceMappingURL=view.min.js.map
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sources":["../src/view.js"],"names":["registered","init","document","addEventListener","CourseEvents","manualCompletionToggled","e","withAvailability","parseInt","detail","window","location","reload"],"mappings":"ybAuBA,O,yiBAOIA,CAAAA,CAAU,G,CAKDC,CAAI,CAAG,UAAM,CACtB,GAAID,CAAJ,CAAgB,CACZ,MACH,CAEDE,QAAQ,CAACC,gBAAT,CAA0BC,CAAY,CAACC,uBAAvC,CAAgE,SAACC,CAAD,CAAO,CACnE,GAAMC,CAAAA,CAAgB,CAAGC,QAAQ,CAACF,CAAC,CAACG,MAAF,CAASF,gBAAV,CAAjC,CACA,GAAIA,CAAJ,CAAsB,CAElBG,MAAM,CAACC,QAAP,CAAgBC,MAAhB,EACH,CACJ,CAND,EAOAZ,CAAU,GACb,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * JS module for the course homepage.\n *\n * @module core_course/view\n * @copyright 2021 Jun Pataleta <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport * as CourseEvents from 'core_course/events';\n\n/**\n * Whether the event listener has already been registered for this module.\n *\n * @type {boolean}\n */\nlet registered = false;\n\n/**\n * Function to intialise and register event listeners for this module.\n */\nexport const init = () => {\n if (registered) {\n return;\n }\n // Listen for toggled manual completion states of activities.\n document.addEventListener(CourseEvents.manualCompletionToggled, (e) => {\n const withAvailability = parseInt(e.detail.withAvailability);\n if (withAvailability) {\n // Reload the page when the toggled manual completion button has availability conditions linked to it.\n window.location.reload();\n }\n });\n registered = true;\n};\n"],"file":"view.min.js"}
{"version":3,"sources":["../src/view.js"],"names":["registered","init","document","addEventListener","CourseEvents","manualCompletionToggled","e","withAvailability","parseInt","detail","window","location","reload"],"mappings":"waAuBA,O,olBAOIA,CAAAA,CAAU,G,CAKDC,CAAI,CAAG,UAAM,CACtB,GAAID,CAAJ,CAAgB,CACZ,MACH,CAEDE,QAAQ,CAACC,gBAAT,CAA0BC,CAAY,CAACC,uBAAvC,CAAgE,SAACC,CAAD,CAAO,CACnE,GAAMC,CAAAA,CAAgB,CAAGC,QAAQ,CAACF,CAAC,CAACG,MAAF,CAASF,gBAAV,CAAjC,CACA,GAAIA,CAAJ,CAAsB,CAElBG,MAAM,CAACC,QAAP,CAAgBC,MAAhB,EACH,CACJ,CAND,EAOAZ,CAAU,GACb,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * JS module for the course homepage.\n *\n * @module core_course/view\n * @copyright 2021 Jun Pataleta <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport * as CourseEvents from 'core_course/events';\n\n/**\n * Whether the event listener has already been registered for this module.\n *\n * @type {boolean}\n */\nlet registered = false;\n\n/**\n * Function to intialise and register event listeners for this module.\n */\nexport const init = () => {\n if (registered) {\n return;\n }\n // Listen for toggled manual completion states of activities.\n document.addEventListener(CourseEvents.manualCompletionToggled, (e) => {\n const withAvailability = parseInt(e.detail.withAvailability);\n if (withAvailability) {\n // Reload the page when the toggled manual completion button has availability conditions linked to it.\n window.location.reload();\n }\n });\n registered = true;\n};\n"],"file":"view.min.js"}
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
YUI.add("moodle-course-coursebase",function(e,o){var r="course-coursebase",s=function(){s.superclass.constructor.apply(this,arguments)};e.extend(s,e.Base,{registermodules:[],register_module:function(e){return this.registermodules.push(e),this},invoke_function:function(e,o){var r;for(r in this.registermodules)e in this.registermodules[r]&&this.registermodules[r][e](o);return this}},{NAME:r,ATTRS:{}}),M.course=M.course||{},M.course.coursebase=M.course.coursebase||new s,M.course.format=M.course.format||{},M.course.format.swap_sections=M.course.format.swap_sections||function(){return null},M.course.format.process_sections=M.course.format.process_sections||function(){return null},M.course.format.get_config=M.course.format.get_config||function(){return{container_node:null,container_class:null,section_wrapper_node:null,section_wrapper_class:null,section_node:null,section_class:null}},M.course.format.get_section_selector=M.course.format.get_section_selector||function(){var e=M.course.format.get_config();return e.section_node&&e.section_class?e.section_node+"."+e.section_class:null},M.course.format.get_section_wrapper=M.course.format.get_section_wrapper||function(e){var o=M.course.format.get_config();return o.section_wrapper_node&&o.section_wrapper_class?o.section_wrapper_node+"."+o.section_wrapper_class:M.course.format.get_section_selector(e)},M.course.format.get_containernode=M.course.format.get_containernode||function(){var e=M.course.format.get_config();if(e.container_node)return e.container_node},M.course.format.get_containerclass=M.course.format.get_containerclass||function(){var e=M.course.format.get_config();if(e.container_class)return e.container_class},M.course.format.get_sectionwrappernode=M.course.format.get_sectionwrappernode||function(){var e=M.course.format.get_config();return e.section_wrapper_node?e.section_wrapper_node:e.section_node},M.course.format.get_sectionwrapperclass=M.course.format.get_sectionwrapperclass||function(){var e=M.course.format.get_config();return e.section_wrapper_class?e.section_wrapper_class:e.section_class},M.course.format.get_sectionnode=M.course.format.get_sectionnode||function(){var e=M.course.format.get_config();if(e.section_node)return e.section_node},M.course.format.get_sectionclass=M.course.format.get_sectionclass||function(){var e=M.course.format.get_config();if(e.section_class)return e.section_class}},"@VERSION@",{requires:["base","node"]});
YUI.add("moodle-course-coursebase",function(e,o){var r=function(){r.superclass.constructor.apply(this,arguments)};e.extend(r,e.Base,{registermodules:[],register_module:function(e){return this.registermodules.push(e),this},invoke_function:function(e,o){for(var r in this.registermodules)e in this.registermodules[r]&&this.registermodules[r][e](o);return this}},{NAME:"course-coursebase",ATTRS:{}}),M.course=M.course||{},M.course.coursebase=M.course.coursebase||new r,M.course.format=M.course.format||{},M.course.format.swap_sections=M.course.format.swap_sections||function(){return null},M.course.format.process_sections=M.course.format.process_sections||function(){return null},M.course.format.get_config=M.course.format.get_config||function(){return{container_node:null,container_class:null,section_wrapper_node:null,section_wrapper_class:null,section_node:null,section_class:null}},M.course.format.get_section_selector=M.course.format.get_section_selector||function(){var e=M.course.format.get_config();return e.section_node&&e.section_class?e.section_node+"."+e.section_class:null},M.course.format.get_section_wrapper=M.course.format.get_section_wrapper||function(e){var o=M.course.format.get_config();return o.section_wrapper_node&&o.section_wrapper_class?o.section_wrapper_node+"."+o.section_wrapper_class:M.course.format.get_section_selector(e)},M.course.format.get_containernode=M.course.format.get_containernode||function(){var e=M.course.format.get_config();if(e.container_node)return e.container_node},M.course.format.get_containerclass=M.course.format.get_containerclass||function(){var e=M.course.format.get_config();if(e.container_class)return e.container_class},M.course.format.get_sectionwrappernode=M.course.format.get_sectionwrappernode||function(){var e=M.course.format.get_config();return e.section_wrapper_node||e.section_node},M.course.format.get_sectionwrapperclass=M.course.format.get_sectionwrapperclass||function(){var e=M.course.format.get_config();return e.section_wrapper_class||e.section_class},M.course.format.get_sectionnode=M.course.format.get_sectionnode||function(){var e=M.course.format.get_config();if(e.section_node)return e.section_node},M.course.format.get_sectionclass=M.course.format.get_sectionclass||function(){var e=M.course.format.get_config();if(e.section_class)return e.section_class}},"@VERSION@",{requires:["base","node"]});
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
YUI.add("moodle-course-formatchooser",function(i,o){var e=function(){e.superclass.constructor.apply(this,arguments)};i.extend(e,i.Base,{initializer:function(o){var e,n,r,t;o&&o.formid&&(e=i.one("#"+o.formid+" #id_updatecourseformat"),n=i.one("#"+o.formid+" #id_format"),r=e.ancestor("fieldset"),t=i.one("form.mform").get("action"),e&&n&&(e.setStyle("display","none"),n.on("change",function(){i.one("form.mform").set("action",t+"#"+r.get("id")),e.simulate("click")})))}}),M.course=M.course||{},M.course.init_formatchooser=function(o){return new e(o)}},"@VERSION@",{requires:["base","node","node-event-simulate"]});
YUI.add("moodle-course-formatchooser",function(t,o){var e=function(){e.superclass.constructor.apply(this,arguments)};t.extend(e,t.Base,{initializer:function(o){var e,n,r;o&&o.formid&&(e=t.one("#"+o.formid+" #id_updatecourseformat"),o=t.one("#"+o.formid+" #id_format"),n=e.ancestor("fieldset"),r=t.one("form.mform").get("action"),e&&o&&(e.setStyle("display","none"),o.on("change",function(){t.one("form.mform").set("action",r+"#"+n.get("id")),e.simulate("click")})))}}),M.course=M.course||{},M.course.init_formatchooser=function(o){return new e(o)}},"@VERSION@",{requires:["base","node","node-event-simulate"]});
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
YUI.add("moodle-course-util-cm",function(t,e){t.namespace("Moodle.core_course.util.cm"),t.Moodle.core_course.util.cm={CONSTANTS:{MODULEIDPREFIX:"module-"},SELECTORS:{COURSEMODULE:".activity",INSTANCENAME:".instancename"},getCourseModuleFromComponent:function(e){return t.one(e).ancestor(this.SELECTORS.COURSEMODULE,!0)},getId:function(e){var t=e.get("id").replace(this.CONSTANTS.MODULEIDPREFIX,"");return!("number"!=typeof(t=parseInt(t,10))||!isFinite(t))&&t},getName:function(e){var t=e.one(this.SELECTORS.INSTANCENAME);return t?t.get("firstChild").get("data"):null}}},"@VERSION@",{requires:["node","moodle-course-util-base"]});
YUI.add("moodle-course-util-cm",function(t,e){t.namespace("Moodle.core_course.util.cm"),t.Moodle.core_course.util.cm={CONSTANTS:{MODULEIDPREFIX:"module-"},SELECTORS:{COURSEMODULE:".activity",INSTANCENAME:".instancename"},getCourseModuleFromComponent:function(e){return t.one(e).ancestor(this.SELECTORS.COURSEMODULE,!0)},getId:function(e){e=e.get("id").replace(this.CONSTANTS.MODULEIDPREFIX,"");return!("number"!=typeof(e=parseInt(e,10))||!isFinite(e))&&e},getName:function(e){e=e.one(this.SELECTORS.INSTANCENAME);return e?e.get("firstChild").get("data"):null}}},"@VERSION@",{requires:["node","moodle-course-util-base"]});
@@ -1 +1 @@
YUI.add("moodle-course-util-section",function(e,o){e.namespace("Moodle.core_course.util.section"),e.Moodle.core_course.util.section={CONSTANTS:{SECTIONIDPREFIX:"section-"},getId:function(e){var o=e.get("id").replace(this.CONSTANTS.SECTIONIDPREFIX,"");return!("number"!=typeof(o=parseInt(o,10))||!isFinite(o))&&o}}},"@VERSION@",{requires:["node","moodle-course-util-base"]});
YUI.add("moodle-course-util-section",function(e,o){e.namespace("Moodle.core_course.util.section"),e.Moodle.core_course.util.section={CONSTANTS:{SECTIONIDPREFIX:"section-"},getId:function(e){e=e.get("id").replace(this.CONSTANTS.SECTIONIDPREFIX,"");return!("number"!=typeof(e=parseInt(e,10))||!isFinite(e))&&e}}},"@VERSION@",{requires:["node","moodle-course-util-base"]});
+1 -1
View File
@@ -1,2 +1,2 @@
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("enrol_manual/quickenrolment",["exports","core_table/dynamic","core/str","core/toast","core/config","core/fragment","core/modal_events","core/modal_factory","core/notification","jquery","core/pending","core/prefetch"],function(a,b,c,d,e,f,g,h,i,j,k,l){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=o(b);c=o(c);d=o(d);e=m(e);f=m(f);g=m(g);h=m(h);i=m(i);j=m(j);k=m(k);l=m(l);function m(a){return a&&a.__esModule?a:{default:a}}function n(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;n=function(){return a};return a}function o(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=n();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function p(a,b){return u(a)||t(a,b)||r(a,b)||q()}function q(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(a,b){if(!a)return;if("string"==typeof a)return s(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return s(a,b)}function s(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function t(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function u(a){if(Array.isArray(a))return a}var v={cohortSelector:"#id_cohortlist",triggerButtons:".enrolusersbutton.enrol_manual_plugin [type='submit']",unwantedHiddenFields:"input[value='_qf__force_multiselect_submission']",buttonWrapper:"[data-region=\"wrapper\"]"},w=function(a){return f.default.loadFragment("enrol_manual","enrol_users_form",a,{})},x=function(a){var c=a.closest(v.buttonWrapper);return b.getTableFromId(c.dataset.tableUniqueid)},y=function(a){document.addEventListener("click",function(b){if(b.target.closest(v.triggerButtons)){b.preventDefault();z(x(b.target),a)}})},z=function(a,b){var d=new k.default("enrol_manual/quickenrolment:showModal");return h.default.create({type:h.default.types.SAVE_CANCEL,large:!0,title:c.get_string("enrolusers","enrol_manual"),body:w(b),buttons:{save:c.get_string("enrolusers","enrol_manual")}}).then(function(b){b.getRoot().on(g.default.save,function(a){a.preventDefault();b.getRoot().find("form").submit()});b.getRoot().on("submit","form",function(c){c.preventDefault();A(a,b)});b.getRoot().on(g.default.hidden,function(){b.destroy()});b.show();return b}).then(function(a){return Promise.all([a,a.getBodyPromise()])}).then(function(a){var b=p(a,2),d=b[0],e=b[1];if(e.get(0).querySelector(v.cohortSelector)){return d.setSaveButtonText(c.get_string("enroluserscohorts","enrol_manual")).then(function(){return d})}return d}).then(function(a){d.resolve();return a}).catch(i.default.exception)},A=function(a,f){var g=f.getRoot().find("form");g.get(0).querySelectorAll(v.unwantedHiddenFields).forEach(function(a){return a.remove()});f.hide();f.destroy();j.default.ajax("".concat(e.default.wwwroot,"/enrol/manual/ajax.php?").concat(g.serialize()),{type:"GET",processData:!1,contentType:"application/json"}).then(function(a){if(a.error){throw new Error(a.error)}return a.count}).then(function(d){return Promise.all([c.get_string("totalenrolledusers","enrol",d),b.refreshTableContent(a)])}).then(function(a){var b=p(a,1),c=b[0];return c}).then(function(a){return d.add(a)}).catch(function(a){i.default.addNotification({message:a.message,type:"error"})})},B=function(a){var b=a.contextid;y(b);l.default.prefetchStrings("enrol_manual",["enrolusers","enroluserscohorts"]);l.default.prefetchString("enrol","totalenrolledusers")};a.init=B});
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("enrol_manual/quickenrolment",["exports","core_table/dynamic","core/str","core/toast","core/config","core/fragment","core/modal_events","core/modal_factory","core/notification","jquery","core/pending","core/prefetch"],function(a,b,c,d,e,f,g,h,i,j,k,l){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=o(b);c=o(c);d=o(d);e=m(e);f=m(f);g=m(g);h=m(h);i=m(i);j=m(j);k=m(k);l=m(l);function m(a){return a&&a.__esModule?a:{default:a}}function n(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(n=function(a){return a?c:b})(a)}function o(a,b){if(!b&&a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var c=n(b);if(c&&c.has(a)){return c.get(a)}var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a){if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;if(g&&(g.get||g.set)){Object.defineProperty(d,f,g)}else{d[f]=a[f]}}}d.default=a;if(c){c.set(a,d)}return d}function p(a,b){return u(a)||t(a,b)||r(a,b)||q()}function q(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(a,b){if(!a)return;if("string"==typeof a)return s(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(a);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return s(a,b)}function s(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function t(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null==c)return;var d=[],e=!0,f=!1,g,h;try{for(c=c.call(a);!(e=(g=c.next()).done);e=!0){d.push(g.value);if(b&&d.length===b)break}}catch(a){f=!0;h=a}finally{try{if(!e&&null!=c["return"])c["return"]()}finally{if(f)throw h}}return d}function u(a){if(Array.isArray(a))return a}var v={cohortSelector:"#id_cohortlist",triggerButtons:".enrolusersbutton.enrol_manual_plugin [type='submit']",unwantedHiddenFields:"input[value='_qf__force_multiselect_submission']",buttonWrapper:"[data-region=\"wrapper\"]"},w=function(a){return f.default.loadFragment("enrol_manual","enrol_users_form",a,{})},x=function(a){var c=a.closest(v.buttonWrapper);return b.getTableFromId(c.dataset.tableUniqueid)},y=function(a){document.addEventListener("click",function(b){if(b.target.closest(v.triggerButtons)){b.preventDefault();z(x(b.target),a)}})},z=function(a,b){var d=new k.default("enrol_manual/quickenrolment:showModal");return h.default.create({type:h.default.types.SAVE_CANCEL,large:!0,title:c.get_string("enrolusers","enrol_manual"),body:w(b),buttons:{save:c.get_string("enrolusers","enrol_manual")}}).then(function(b){b.getRoot().on(g.default.save,function(a){a.preventDefault();b.getRoot().find("form").submit()});b.getRoot().on("submit","form",function(c){c.preventDefault();A(a,b)});b.getRoot().on(g.default.hidden,function(){b.destroy()});b.show();return b}).then(function(a){return Promise.all([a,a.getBodyPromise()])}).then(function(a){var b=p(a,2),d=b[0],e=b[1];if(e.get(0).querySelector(v.cohortSelector)){return d.setSaveButtonText(c.get_string("enroluserscohorts","enrol_manual")).then(function(){return d})}return d}).then(function(a){d.resolve();return a}).catch(i.default.exception)},A=function(a,f){var g=f.getRoot().find("form");g.get(0).querySelectorAll(v.unwantedHiddenFields).forEach(function(a){return a.remove()});f.hide();f.destroy();j.default.ajax("".concat(e.default.wwwroot,"/enrol/manual/ajax.php?").concat(g.serialize()),{type:"GET",processData:!1,contentType:"application/json"}).then(function(a){if(a.error){throw new Error(a.error)}return a.count}).then(function(d){return Promise.all([c.get_string("totalenrolledusers","enrol",d),b.refreshTableContent(a)])}).then(function(a){var b=p(a,1),c=b[0];return c}).then(function(a){return d.add(a)}).catch(function(a){i.default.addNotification({message:a.message,type:"error"})})},B=function(a){var b=a.contextid;y(b);l.default.prefetchStrings("enrol_manual",["enrolusers","enroluserscohorts"]);l.default.prefetchString("enrol","totalenrolledusers")};a.init=B});
//# sourceMappingURL=quickenrolment.min.js.map
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
YUI.add("moodle-filter_glossary-autolinker",function(c,e){var t;t=function(){t.superclass.constructor.apply(this,arguments)},c.extend(t,c.Base,{overlay:null,alertpanels:{},initializer:function(){var a=this;require(["core/event"],function(r){c.delegate("click",function(e){e.preventDefault();var n,t,o=c.Node.create('<div id="glossaryfilteroverlayprogress"></div>'),i=new c.Overlay({headerContent:"",bodyContent:o});window.require(["core/templates"],function(e){e.renderPix("i/loading","core").then(function(e){o.append(e)})}),(a.overlay=i).render(c.one(document.body)),n=this.getAttribute("href").replace("showentry.php","showentry_ajax.php"),t={method:"get",context:a,on:{success:function(e,t){this.display_callback(t.responseText,r)},failure:function(e,t){var o=t.statusText;M.cfg.developerdebug&&(t.statusText+=" ("+n+")"),new M.core.exception({message:o})}}},c.io(n,t)},c.one(document.body),"a.glossary.autolink.concept")})},display_callback:function(e,t){var o,n,i,r,a,l;try{if((o=c.JSON.parse(e)).success){for(n in this.overlay.hide(),o.entries)a=o.entries[n].definition+o.entries[n].attachments,i=new M.core.alert({title:o.entries[n].concept,draggable:!0,message:a,modal:!1,yesLabel:M.util.get_string("ok","moodle")}),t.notifyFilterContentUpdated(i.get("boundingBox").getDOMNode()),c.Node.one("#id_yuialertconfirm-"+i.get("COUNT")).focus(),r="#moodle-dialogue-"+i.get("COUNT"),i.on("complete",this._deletealertpanel,this,r),c.Object.isEmpty(this.alertpanels)||(l=this._getLatestWindowPosition(),c.Node.one(r).setXY([l[0]+10,l[1]+10])),this.alertpanels[r]=c.Node.one(r).getXY();return!0}o.error&&new M.core.ajaxException(o)}catch(s){new M.core.exception(s)}return!1},_getLatestWindowPosition:function(){var t=[0,0];return c.Object.each(this.alertpanels,function(e){e[0]>t[0]&&(t=e)}),t},_deletealertpanel:function(e,t){delete this.alertpanels[t]}},{NAME:"Glossary filter autolinker",ATTRS:{url:{validator:c.Lang.isString,value:M.cfg.wwwroot+"/mod/glossary/showentry.php"},name:{validator:c.Lang.isString,value:"glossaryconcept"},options:{getter:function(){return{width:this.get("width"),height:this.get("height"),menubar:this.get("menubar"),location:this.get("location"),scrollbars:this.get("scrollbars"),resizable:this.get("resizable"),toolbar:this.get("toolbar"),status:this.get("status"),directories:this.get("directories"),fullscreen:this.get("fullscreen"),dependent:this.get("dependent")}},readOnly:!0},width:{value:600},height:{value:450},menubar:{value:!1},location:{value:!1},scrollbars:{value:!0},resizable:{value:!0},toolbar:{value:!0},status:{value:!0},directories:{value:!1},fullscreen:{value:!1},dependent:{value:!0}}}),M.filter_glossary=M.filter_glossary||{},M.filter_glossary.init_filter_autolinking=function(e){return new t(e)}},"@VERSION@",{requires:["base","node","io-base","json-parse","event-delegate","overlay","moodle-core-event","moodle-core-notification-alert","moodle-core-notification-exception","moodle-core-notification-ajaxexception"]});
YUI.add("moodle-filter_glossary-autolinker",function(c,e){var t=function(){t.superclass.constructor.apply(this,arguments)};c.extend(t,c.Base,{overlay:null,alertpanels:{},initializer:function(){var i=this;require(["core/event"],function(o){c.delegate("click",function(e){e.preventDefault();var n,t=c.Node.create('<div id="glossaryfilteroverlayprogress"></div>'),e=new c.Overlay({headerContent:"",bodyContent:t});window.require(["core/templates"],function(e){e.renderPix("i/loading","core").then(function(e){t.append(e)})}),(i.overlay=e).render(c.one(document.body)),n=this.getAttribute("href").replace("showentry.php","showentry_ajax.php"),c.io(n,{method:"get",context:i,on:{success:function(e,t){this.display_callback(t.responseText,o)},failure:function(e,t){var o=t.statusText;M.cfg.developerdebug&&(t.statusText+=" ("+n+")"),new M.core.exception({message:o})}}})},c.one(document.body),"a.glossary.autolink.concept")})},display_callback:function(e,t){var o,n,i,r,a,l;try{if((o=c.JSON.parse(e)).success){for(n in this.overlay.hide(),o.entries)a=o.entries[n].definition+o.entries[n].attachments,i=new M.core.alert({title:o.entries[n].concept,draggable:!0,message:a,modal:!1,yesLabel:M.util.get_string("ok","moodle")}),t.notifyFilterContentUpdated(i.get("boundingBox").getDOMNode()),c.Node.one("#id_yuialertconfirm-"+i.get("COUNT")).focus(),r="#moodle-dialogue-"+i.get("COUNT"),i.on("complete",this._deletealertpanel,this,r),c.Object.isEmpty(this.alertpanels)||(l=this._getLatestWindowPosition(),c.Node.one(r).setXY([l[0]+10,l[1]+10])),this.alertpanels[r]=c.Node.one(r).getXY();return!0}o.error&&new M.core.ajaxException(o)}catch(s){new M.core.exception(s)}return!1},_getLatestWindowPosition:function(){var t=[0,0];return c.Object.each(this.alertpanels,function(e){e[0]>t[0]&&(t=e)}),t},_deletealertpanel:function(e,t){delete this.alertpanels[t]}},{NAME:"Glossary filter autolinker",ATTRS:{url:{validator:c.Lang.isString,value:M.cfg.wwwroot+"/mod/glossary/showentry.php"},name:{validator:c.Lang.isString,value:"glossaryconcept"},options:{getter:function(){return{width:this.get("width"),height:this.get("height"),menubar:this.get("menubar"),location:this.get("location"),scrollbars:this.get("scrollbars"),resizable:this.get("resizable"),toolbar:this.get("toolbar"),status:this.get("status"),directories:this.get("directories"),fullscreen:this.get("fullscreen"),dependent:this.get("dependent")}},readOnly:!0},width:{value:600},height:{value:450},menubar:{value:!1},location:{value:!1},scrollbars:{value:!0},resizable:{value:!0},toolbar:{value:!0},status:{value:!0},directories:{value:!1},fullscreen:{value:!1},dependent:{value:!0}}}),M.filter_glossary=M.filter_glossary||{},M.filter_glossary.init_filter_autolinking=function(e){return new t(e)}},"@VERSION@",{requires:["base","node","io-base","json-parse","event-delegate","overlay","moodle-core-event","moodle-core-notification-alert","moodle-core-notification-exception","moodle-core-notification-ajaxexception"]});
@@ -1 +1 @@
YUI.add("moodle-filter_mathjaxloader-loader",function(n,e){M.filter_mathjaxloader=M.filter_mathjaxloader||{_lang:"",_configured:!1,configure:function(e){var t=document.createElement("script");t.type="text/x-mathjax-config",t[window.opera?"innerHTML":"text"]=e.mathjaxconfig,document.getElementsByTagName("head")[0].appendChild(t),this._lang=e.lang,n.on(M.core.event.FILTER_CONTENT_UPDATED,this.contentUpdated,this)},_setLocale:function(){if(!this._configured){var e=this._lang;"undefined"!=typeof window.MathJax&&(window.MathJax.Hub.Queue(function(){window.MathJax.Localization.setLocale(e)}),window.MathJax.Hub.Configured(),this._configured=!0)}},typeset:function(){if(!this._configured){var e=this;n.use("mathjax",function(){e._setLocale(),n.all(".filter_mathjaxloader_equation").each(function(e){"undefined"!=typeof window.MathJax&&window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,e.getDOMNode()])})})}},contentUpdated:function(t){var a=this;n.use("mathjax",function(){if("undefined"!=typeof window.MathJax){var e=window.MathJax.Hub.processSectionDelay;window.MathJax.Hub.processSectionDelay=0,window.MathJax.Hub.Config({positionToHash:!1}),a._setLocale(),t.nodes.each(function(e){e.all(".filter_mathjaxloader_equation").each(function(e){window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,e.getDOMNode()])})}),window.MathJax.Hub.processSectionDelay=e}})}}},"@VERSION@",{requires:["moodle-core-event"]});
YUI.add("moodle-filter_mathjaxloader-loader",function(n,e){M.filter_mathjaxloader=M.filter_mathjaxloader||{_lang:"",_configured:!1,configure:function(e){var t=document.createElement("script");t.type="text/x-mathjax-config",t[window.opera?"innerHTML":"text"]=e.mathjaxconfig,document.getElementsByTagName("head")[0].appendChild(t),this._lang=e.lang,n.on(M.core.event.FILTER_CONTENT_UPDATED,this.contentUpdated,this)},_setLocale:function(){var e;this._configured||(e=this._lang,"undefined"!=typeof window.MathJax&&(window.MathJax.Hub.Queue(function(){window.MathJax.Localization.setLocale(e)}),window.MathJax.Hub.Configured(),this._configured=!0))},typeset:function(){var e;this._configured||(e=this,n.use("mathjax",function(){e._setLocale(),n.all(".filter_mathjaxloader_equation").each(function(e){"undefined"!=typeof window.MathJax&&window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,e.getDOMNode()])})}))},contentUpdated:function(t){var a=this;n.use("mathjax",function(){var e;"undefined"!=typeof window.MathJax&&(e=window.MathJax.Hub.processSectionDelay,window.MathJax.Hub.processSectionDelay=0,window.MathJax.Hub.Config({positionToHash:!1}),a._setLocale(),t.nodes.each(function(e){e.all(".filter_mathjaxloader_equation").each(function(e){window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,e.getDOMNode()])})}),window.MathJax.Hub.processSectionDelay=e)})}}},"@VERSION@",{requires:["moodle-core-event"]});
@@ -1,2 +1,2 @@
define ("core_grades/grades/grader/gradingpanel/comparison",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.compareData=a.fillInitialValues=void 0;var b=function(a){Array.prototype.forEach.call(a.elements,function(a){if("submit"===a.type||"button"===a.type){}else if("radio"===a.type||"checkbox"===a.type){a.dataset.initialValue=JSON.stringify(a.checked)}else if("undefined"!=typeof a.value){a.dataset.initialValue=JSON.stringify(a.value)}else if("select-one"===a.type){Array.prototype.forEach.call(a.options,function(a){a.dataset.initialValue=JSON.stringify(a.selected)})}})};a.fillInitialValues=b;a.compareData=function compareData(a){var c=Array.prototype.some.call(a.elements,function(a){if("submit"===a.type||"button"===a.type){return!1}else if("radio"===a.type||"checkbox"===a.type){if("undefined"!=typeof a.dataset.initialValue){return a.dataset.initialValue!==JSON.stringify(a.checked)}}else if("undefined"!=typeof a.value){if("undefined"!=typeof a.dataset.initialValue){return a.dataset.initialValue!==JSON.stringify(a.value)}}else if("select-one"===a.type){return Array.prototype.some.call(a.options,function(a){if("undefined"!=typeof a.dataset.initialValue){return a.dataset.initialValue!==JSON.stringify(a.selected)}return!1})}return!0});b(a);return c}});
define ("core_grades/grades/grader/gradingpanel/comparison",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.fillInitialValues=a.compareData=void 0;var b=function(a){Array.prototype.forEach.call(a.elements,function(a){if("submit"===a.type||"button"===a.type){}else if("radio"===a.type||"checkbox"===a.type){a.dataset.initialValue=JSON.stringify(a.checked)}else if("undefined"!=typeof a.value){a.dataset.initialValue=JSON.stringify(a.value)}else if("select-one"===a.type){Array.prototype.forEach.call(a.options,function(a){a.dataset.initialValue=JSON.stringify(a.selected)})}})};a.fillInitialValues=b;a.compareData=function compareData(a){var c=Array.prototype.some.call(a.elements,function(a){if("submit"===a.type||"button"===a.type){return!1}else if("radio"===a.type||"checkbox"===a.type){if("undefined"!=typeof a.dataset.initialValue){return a.dataset.initialValue!==JSON.stringify(a.checked)}}else if("undefined"!=typeof a.value){if("undefined"!=typeof a.dataset.initialValue){return a.dataset.initialValue!==JSON.stringify(a.value)}}else if("select-one"===a.type){return Array.prototype.some.call(a.options,function(a){if("undefined"!=typeof a.dataset.initialValue){return a.dataset.initialValue!==JSON.stringify(a.selected)}return!1})}return!0});b(a);return c}});
//# sourceMappingURL=comparison.min.js.map
@@ -1,2 +1,2 @@
define ("core_grades/grades/grader/gradingpanel/normalise",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.failedUpdate=a.invalidResult=a.normaliseResult=void 0;a.normaliseResult=function normaliseResult(a){return{result:a,failed:!!a.warnings.length,success:!a.warnings.length,error:null}};a.invalidResult=function invalidResult(){return{success:!1,failed:!1,result:{},error:null}};a.failedUpdate=function failedUpdate(a){return{success:!1,failed:!0,result:{},error:a}}});
define ("core_grades/grades/grader/gradingpanel/normalise",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.normaliseResult=a.invalidResult=a.failedUpdate=void 0;a.normaliseResult=function normaliseResult(a){return{result:a,failed:!!a.warnings.length,success:!a.warnings.length,error:null}};a.invalidResult=function invalidResult(){return{success:!1,failed:!1,result:{},error:null}};a.failedUpdate=function failedUpdate(a){return{success:!1,failed:!0,result:{},error:a}}});
//# sourceMappingURL=normalise.min.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core_grades/grades/grader/gradingpanel/point",["exports","./repository","core_grades/grades/grader/gradingpanel/comparison","jquery","./normalise"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.storeCurrentGrade=a.fetchCurrentGrade=void 0;d=function(a){return a&&a.__esModule?a:{default:a}}(d);function f(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function g(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function g(a){f(i,d,e,g,h,"next",a)}function h(a){f(i,d,e,g,h,"throw",a)}g(void 0)})}}a.fetchCurrentGrade=function fetchCurrentGrade(){return(0,b.fetchGrade)("point").apply(void 0,arguments)};var h=function(){var a=g(regeneratorRuntime.mark(function a(f,g,h,i,j,k){var l,m;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:l=k.querySelector("form");m=l.querySelector("input[name=\"grade\"]");if(!(!m.checkValidity()||!m.value.trim())){a.next=4;break}return a.abrupt("return",e.invalidResult);case 4:if(!(!0===(0,c.compareData)(l))){a.next=10;break}a.next=7;return(0,b.saveGrade)("point")(f,g,h,i,j,(0,d.default)(l).serialize());case 7:return a.abrupt("return",a.sent);case 10:return a.abrupt("return","");case 11:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.storeCurrentGrade=h});
define ("core_grades/grades/grader/gradingpanel/point",["exports","./repository","core_grades/grades/grader/gradingpanel/comparison","jquery","./normalise"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.storeCurrentGrade=a.fetchCurrentGrade=void 0;d=function(a){return a&&a.__esModule?a:{default:a}}(d);function f(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function g(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var g=a.apply(b,c);function h(a){f(g,d,e,h,i,"next",a)}function i(a){f(g,d,e,h,i,"throw",a)}h(void 0)})}}a.fetchCurrentGrade=function fetchCurrentGrade(){return(0,b.fetchGrade)("point").apply(void 0,arguments)};var h=function(){var a=g(regeneratorRuntime.mark(function k(a,f,g,h,i,j){var l,m;return regeneratorRuntime.wrap(function(k){while(1){switch(k.prev=k.next){case 0:l=j.querySelector("form");m=l.querySelector("input[name=\"grade\"]");if(!(!m.checkValidity()||!m.value.trim())){k.next=4;break}return k.abrupt("return",e.invalidResult);case 4:if(!(!0===(0,c.compareData)(l))){k.next=10;break}k.next=7;return(0,b.saveGrade)("point")(a,f,g,h,i,(0,d.default)(l).serialize());case 7:return k.abrupt("return",k.sent);case 10:return k.abrupt("return","");case 11:case"end":return k.stop();}}},k)}));return function(){return a.apply(this,arguments)}}();a.storeCurrentGrade=h});
//# sourceMappingURL=point.min.js.map
@@ -1,2 +1,2 @@
define ("core_grades/grades/grader/gradingpanel/repository",["exports","core/ajax","./normalise"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.saveGrade=a.fetchGrade=void 0;function d(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function e(a){return function(){var b=this,c=arguments;return new Promise(function(e,f){var i=a.apply(b,c);function g(a){d(i,e,f,g,h,"next",a)}function h(a){d(i,e,f,g,h,"throw",a)}g(void 0)})}}a.fetchGrade=function fetchGrade(a){return function(c,d,e,f){return(0,b.call)([{methodname:"core_grades_grader_gradingpanel_".concat(a,"_fetch"),args:{component:c,contextid:d,itemname:e,gradeduserid:f}}])[0]}};a.saveGrade=function saveGrade(a){return function(){var d=e(regeneratorRuntime.mark(function d(e,f,g,h,i,j){return regeneratorRuntime.wrap(function(d){while(1){switch(d.prev=d.next){case 0:d.t0=c.normaliseResult;d.next=3;return(0,b.call)([{methodname:"core_grades_grader_gradingpanel_".concat(a,"_store"),args:{component:e,contextid:f,itemname:g,gradeduserid:h,notifyuser:i,formdata:j}}])[0];case 3:d.t1=d.sent;return d.abrupt("return",(0,d.t0)(d.t1));case 5:case"end":return d.stop();}}},d)}));return function(){return d.apply(this,arguments)}}()}});
define ("core_grades/grades/grader/gradingpanel/repository",["exports","core/ajax","./normalise"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.saveGrade=a.fetchGrade=void 0;function d(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function e(a){return function(){var b=this,c=arguments;return new Promise(function(e,f){var g=a.apply(b,c);function h(a){d(g,e,f,h,i,"next",a)}function i(a){d(g,e,f,h,i,"throw",a)}h(void 0)})}}a.fetchGrade=function fetchGrade(a){return function(c,d,e,f){return(0,b.call)([{methodname:"core_grades_grader_gradingpanel_".concat(a,"_fetch"),args:{component:c,contextid:d,itemname:e,gradeduserid:f}}])[0]}};a.saveGrade=function saveGrade(a){return function(){var d=e(regeneratorRuntime.mark(function j(d,e,f,g,h,i){return regeneratorRuntime.wrap(function(j){while(1){switch(j.prev=j.next){case 0:j.t0=c.normaliseResult;j.next=3;return(0,b.call)([{methodname:"core_grades_grader_gradingpanel_".concat(a,"_store"),args:{component:d,contextid:e,itemname:f,gradeduserid:g,notifyuser:h,formdata:i}}])[0];case 3:j.t1=j.sent;return j.abrupt("return",(0,j.t0)(j.t1));case 5:case"end":return j.stop();}}},j)}));return function(){return d.apply(this,arguments)}}()}});
//# sourceMappingURL=repository.min.js.map
@@ -1,2 +1,2 @@
define ("gradingform_guide/grades/grader/gradingpanel",["exports","core/ajax","core_grades/grades/grader/gradingpanel/normalise","core_grades/grades/grader/gradingpanel/comparison","jquery"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.storeCurrentGrade=a.fetchCurrentGrade=void 0;e=function(a){return a&&a.__esModule?a:{default:a}}(e);function f(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function g(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function g(a){f(i,d,e,g,h,"next",a)}function h(a){f(i,d,e,g,h,"throw",a)}g(void 0)})}}a.fetchCurrentGrade=function fetchCurrentGrade(a,c,d,e){return(0,b.call)([{methodname:"gradingform_guide_grader_gradingpanel_fetch",args:{component:a,contextid:c,itemname:d,gradeduserid:e}}])[0]};var h=function(){var a=g(regeneratorRuntime.mark(function a(f,g,h,i,j,k){var l;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:l=k.querySelector("form");if(!(!0===(0,d.compareData)(l))){a.next=9;break}a.t0=c.normaliseResult;a.next=5;return(0,b.call)([{methodname:"gradingform_guide_grader_gradingpanel_store",args:{component:f,contextid:g,itemname:h,gradeduserid:i,notifyuser:j,formdata:(0,e.default)(l).serialize()}}])[0];case 5:a.t1=a.sent;return a.abrupt("return",(0,a.t0)(a.t1));case 9:return a.abrupt("return","");case 10:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.storeCurrentGrade=h});
define ("gradingform_guide/grades/grader/gradingpanel",["exports","core/ajax","core_grades/grades/grader/gradingpanel/normalise","core_grades/grades/grader/gradingpanel/comparison","jquery"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.storeCurrentGrade=a.fetchCurrentGrade=void 0;e=function(a){return a&&a.__esModule?a:{default:a}}(e);function f(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function g(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var g=a.apply(b,c);function h(a){f(g,d,e,h,i,"next",a)}function i(a){f(g,d,e,h,i,"throw",a)}h(void 0)})}}a.fetchCurrentGrade=function fetchCurrentGrade(a,c,d,e){return(0,b.call)([{methodname:"gradingform_guide_grader_gradingpanel_fetch",args:{component:a,contextid:c,itemname:d,gradeduserid:e}}])[0]};var h=function(){var a=g(regeneratorRuntime.mark(function k(a,f,g,h,i,j){var l;return regeneratorRuntime.wrap(function(k){while(1){switch(k.prev=k.next){case 0:l=j.querySelector("form");if(!(!0===(0,d.compareData)(l))){k.next=9;break}k.t0=c.normaliseResult;k.next=5;return(0,b.call)([{methodname:"gradingform_guide_grader_gradingpanel_store",args:{component:a,contextid:f,itemname:g,gradeduserid:h,notifyuser:i,formdata:(0,e.default)(l).serialize()}}])[0];case 5:k.t1=k.sent;return k.abrupt("return",(0,k.t0)(k.t1));case 9:return k.abrupt("return","");case 10:case"end":return k.stop();}}},k)}));return function(){return a.apply(this,arguments)}}();a.storeCurrentGrade=h});
//# sourceMappingURL=gradingpanel.min.js.map
@@ -1,2 +1,2 @@
define ("gradingform_rubric/grades/grader/gradingpanel",["exports","core/ajax","core_grades/grades/grader/gradingpanel/normalise","core_grades/grades/grader/gradingpanel/comparison","jquery"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.storeCurrentGrade=a.fetchCurrentGrade=void 0;e=function(a){return a&&a.__esModule?a:{default:a}}(e);function f(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function g(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function g(a){f(i,d,e,g,h,"next",a)}function h(a){f(i,d,e,g,h,"throw",a)}g(void 0)})}}a.fetchCurrentGrade=function fetchCurrentGrade(a,c,d,e){return(0,b.call)([{methodname:"gradingform_rubric_grader_gradingpanel_fetch",args:{component:a,contextid:c,itemname:d,gradeduserid:e}}])[0]};var h=function(){var a=g(regeneratorRuntime.mark(function a(f,g,h,i,j,k){var l;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:l=k.querySelector("form");if(!(!0===(0,d.compareData)(l))){a.next=9;break}a.t0=c.normaliseResult;a.next=5;return(0,b.call)([{methodname:"gradingform_rubric_grader_gradingpanel_store",args:{component:f,contextid:g,itemname:h,gradeduserid:i,notifyuser:j,formdata:(0,e.default)(l).serialize()}}])[0];case 5:a.t1=a.sent;return a.abrupt("return",(0,a.t0)(a.t1));case 9:return a.abrupt("return","");case 10:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.storeCurrentGrade=h});
define ("gradingform_rubric/grades/grader/gradingpanel",["exports","core/ajax","core_grades/grades/grader/gradingpanel/normalise","core_grades/grades/grader/gradingpanel/comparison","jquery"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.storeCurrentGrade=a.fetchCurrentGrade=void 0;e=function(a){return a&&a.__esModule?a:{default:a}}(e);function f(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function g(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var g=a.apply(b,c);function h(a){f(g,d,e,h,i,"next",a)}function i(a){f(g,d,e,h,i,"throw",a)}h(void 0)})}}a.fetchCurrentGrade=function fetchCurrentGrade(a,c,d,e){return(0,b.call)([{methodname:"gradingform_rubric_grader_gradingpanel_fetch",args:{component:a,contextid:c,itemname:d,gradeduserid:e}}])[0]};var h=function(){var a=g(regeneratorRuntime.mark(function k(a,f,g,h,i,j){var l;return regeneratorRuntime.wrap(function(k){while(1){switch(k.prev=k.next){case 0:l=j.querySelector("form");if(!(!0===(0,d.compareData)(l))){k.next=9;break}k.t0=c.normaliseResult;k.next=5;return(0,b.call)([{methodname:"gradingform_rubric_grader_gradingpanel_store",args:{component:a,contextid:f,itemname:g,gradeduserid:h,notifyuser:i,formdata:(0,e.default)(l).serialize()}}])[0];case 5:k.t1=k.sent;return k.abrupt("return",(0,k.t0)(k.t1));case 9:return k.abrupt("return","");case 10:case"end":return k.stop();}}},k)}));return function(){return a.apply(this,arguments)}}();a.storeCurrentGrade=h});
//# sourceMappingURL=gradingpanel.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core/addblockmodal",["exports","core/modal_factory","core/templates","core/str","core/ajax"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=f(b);c=f(c);e=f(e);function f(a){return a&&a.__esModule?a:{default:a}}function g(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function h(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function f(a){g(i,d,e,f,h,"next",a)}function h(a){g(i,d,e,f,h,"throw",a)}f(void 0)})}}var i={ADD_BLOCK:"[data-key=\"addblock\"]"},j=null,k=function(a,b,c,d){document.addEventListener("click",function(f){if(f.target.closest(i.ADD_BLOCK)){f.preventDefault();if(j){j.show()}else{l().then(function(e){j=e;var f=m(c,a,b,d);e.setBody(f);e.show();return f}).catch(function(){j.destroy();j=null})}}})},l=function(){return b.default.create({type:b.default.types.CANCEL,title:(0,d.get_string)("addblock")})},m=function(){var a=h(regeneratorRuntime.mark(function a(b,d,e,f){var g;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.next=2;return n(d,e,f);case 2:g=a.sent;return a.abrupt("return",c.default.render("core/add_block_body",{blocks:g,url:b}));case 4:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),n=function(){var a=h(regeneratorRuntime.mark(function a(b,c,d){var f;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:f={methodname:"core_block_fetch_addable_blocks",args:{pagecontextid:M.cfg.contextid,pagetype:b,pagelayout:c,subpage:d}};return a.abrupt("return",e.default.call([f])[0]);case 2:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.init=function init(a,b,c){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:"";k(a,b,c,d)}});
define ("core/addblockmodal",["exports","core/modal_factory","core/templates","core/str","core/ajax"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=f(b);c=f(c);e=f(e);function f(a){return a&&a.__esModule?a:{default:a}}function g(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function h(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var f=a.apply(b,c);function h(a){g(f,d,e,h,i,"next",a)}function i(a){g(f,d,e,h,i,"throw",a)}h(void 0)})}}var i={ADD_BLOCK:"[data-key=\"addblock\"]"},j=null,k=function(a,b,c,d){document.addEventListener("click",function(f){if(f.target.closest(i.ADD_BLOCK)){f.preventDefault();if(j){j.show()}else{l().then(function(e){j=e;var f=m(c,a,b,d);e.setBody(f);e.show();return f}).catch(function(){j.destroy();j=null})}}})},l=function(){return b.default.create({type:b.default.types.CANCEL,title:(0,d.get_string)("addblock")})},m=function(){var a=h(regeneratorRuntime.mark(function f(a,b,d,e){var g;return regeneratorRuntime.wrap(function(f){while(1){switch(f.prev=f.next){case 0:f.next=2;return n(b,d,e);case 2:g=f.sent;return f.abrupt("return",c.default.render("core/add_block_body",{blocks:g,url:a}));case 4:case"end":return f.stop();}}},f)}));return function(){return a.apply(this,arguments)}}(),n=function(){var a=h(regeneratorRuntime.mark(function d(a,b,c){var f;return regeneratorRuntime.wrap(function(d){while(1){switch(d.prev=d.next){case 0:f={methodname:"core_block_fetch_addable_blocks",args:{pagecontextid:M.cfg.contextid,pagetype:a,pagelayout:b,subpage:c}};return d.abrupt("return",e.default.call([f])[0]);case 2:case"end":return d.stop();}}},d)}));return function(){return a.apply(this,arguments)}}();a.init=function init(a,b,c){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:"";k(a,b,c,d)}});
//# sourceMappingURL=addblockmodal.min.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core/aria",["exports","./local/aria/aria-hidden"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});Object.defineProperty(a,"hide",{enumerable:!0,get:function get(){return b.hide}});Object.defineProperty(a,"unhide",{enumerable:!0,get:function get(){return b.unhide}});Object.defineProperty(a,"hideSiblings",{enumerable:!0,get:function get(){return b.hideSiblings}});Object.defineProperty(a,"unhideSiblings",{enumerable:!0,get:function get(){return b.unhideSiblings}})});
define ("core/aria",["exports","./local/aria/aria-hidden"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});Object.defineProperty(a,"hide",{enumerable:!0,get:function get(){return b.hide}});Object.defineProperty(a,"hideSiblings",{enumerable:!0,get:function get(){return b.hideSiblings}});Object.defineProperty(a,"unhide",{enumerable:!0,get:function get(){return b.unhide}});Object.defineProperty(a,"unhideSiblings",{enumerable:!0,get:function get(){return b.unhideSiblings}})});
//# sourceMappingURL=aria.min.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/chart_base",["core/chart_series","core/chart_axis"],function(a,b){function c(){this._series=[];this._labels=[];this._xaxes=[];this._yaxes=[];this._setDefaults()}c.prototype._series=null;c.prototype._labels=null;c.prototype._legendOptions=null;c.prototype._title=null;c.prototype._xaxes=null;c.prototype._yaxes=null;c.prototype.COLORSET=["#f3c300","#875692","#f38400","#a1caf1","#be0032","#c2b280","#7f180d","#008856","#e68fac","#0067a5"];c.prototype._configColorSet=null;c.prototype.TYPE=null;c.prototype.addSeries=function(a){this._validateSeries(a);this._series.push(a);if(null===a.getColor()){var b=this.getConfigColorSet()||c.prototype.COLORSET;a.setColor(b[this._series.length%b.length])}};c.prototype.create=function(c,d){var e=new c;e.setConfigColorSet(d.config_colorset);e.setLabels(d.labels);e.setTitle(d.title);if(d.legend_options){e.setLegendOptions(d.legend_options)}d.series.forEach(function(b){e.addSeries(a.prototype.create(b))});d.axes.x.forEach(function(a,c){e.setXAxis(b.prototype.create(a),c)});d.axes.y.forEach(function(a,c){e.setYAxis(b.prototype.create(a),c)});return e};c.prototype.__getAxis=function(a,c,d){var e="x"===a?this._xaxes:this._yaxes,f=("x"===a?this.setXAxis:this.setYAxis).bind(this),g;c="undefined"==typeof c?0:c;d="undefined"==typeof d?!1:d;g=e[c];if("undefined"==typeof g){if(!d){throw new Error("Unknown axis.")}g=new b;f(g,c)}return g};c.prototype.getConfigColorSet=function(){return this._configColorSet};c.prototype.getLabels=function(){return this._labels};c.prototype.getLegendOptions=function(){return this._legendOptions};c.prototype.getSeries=function(){return this._series};c.prototype.getTitle=function(){return this._title};c.prototype.getType=function(){if(!this.TYPE){throw new Error("The TYPE property has not been set.")}return this.TYPE};c.prototype.getXAxes=function(){return this._xaxes};c.prototype.getXAxis=function(a,b){return this.__getAxis("x",a,b)};c.prototype.getYAxes=function(){return this._yaxes};c.prototype.getYAxis=function(a,b){return this.__getAxis("y",a,b)};c.prototype.setConfigColorSet=function(a){this._configColorSet=a};c.prototype._setDefaults=function(){};c.prototype.setLabels=function(a){if(a.length&&this._series.length&&this._series[0].length!=a.length){throw new Error("Series must match label values.")}this._labels=a};c.prototype.setLegendOptions=function(a){if("object"!==_typeof(a)){throw new Error("Setting legend with non-object value:"+a)}this._legendOptions=a};c.prototype.setTitle=function(a){this._title=a};c.prototype.setXAxis=function(a,b){b="undefined"==typeof b?0:b;this._validateAxis("x",a,b);this._xaxes[b]=a};c.prototype.setYAxis=function(a,b){b="undefined"==typeof b?0:b;this._validateAxis("y",a,b);this._yaxes[b]=a};c.prototype._validateAxis=function(a,b,c){c="undefined"==typeof c?0:c;if(0<c){var d="x"==a?this._xaxes:this._yaxes;if("undefined"==typeof d[c-1]){throw new Error("Missing "+a+" axis at index lower than "+c)}}};c.prototype._validateSeries=function(a){if(this._series.length&&this._series[0].getCount()!=a.getCount()){throw new Error("Series do not have an equal number of values.")}else if(this._labels.length&&this._labels.length!=a.getCount()){throw new Error("Series must match label values.")}};return c});
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("core/chart_base",["core/chart_series","core/chart_axis"],function(a,b){function c(){this._series=[];this._labels=[];this._xaxes=[];this._yaxes=[];this._setDefaults()}c.prototype._series=null;c.prototype._labels=null;c.prototype._legendOptions=null;c.prototype._title=null;c.prototype._xaxes=null;c.prototype._yaxes=null;c.prototype.COLORSET=["#f3c300","#875692","#f38400","#a1caf1","#be0032","#c2b280","#7f180d","#008856","#e68fac","#0067a5"];c.prototype._configColorSet=null;c.prototype.TYPE=null;c.prototype.addSeries=function(a){this._validateSeries(a);this._series.push(a);if(null===a.getColor()){var b=this.getConfigColorSet()||c.prototype.COLORSET;a.setColor(b[this._series.length%b.length])}};c.prototype.create=function(c,d){var e=new c;e.setConfigColorSet(d.config_colorset);e.setLabels(d.labels);e.setTitle(d.title);if(d.legend_options){e.setLegendOptions(d.legend_options)}d.series.forEach(function(b){e.addSeries(a.prototype.create(b))});d.axes.x.forEach(function(a,c){e.setXAxis(b.prototype.create(a),c)});d.axes.y.forEach(function(a,c){e.setYAxis(b.prototype.create(a),c)});return e};c.prototype.__getAxis=function(a,c,d){var e="x"===a?this._xaxes:this._yaxes,f=("x"===a?this.setXAxis:this.setYAxis).bind(this),g;c="undefined"==typeof c?0:c;d="undefined"==typeof d?!1:d;g=e[c];if("undefined"==typeof g){if(!d){throw new Error("Unknown axis.")}g=new b;f(g,c)}return g};c.prototype.getConfigColorSet=function(){return this._configColorSet};c.prototype.getLabels=function(){return this._labels};c.prototype.getLegendOptions=function(){return this._legendOptions};c.prototype.getSeries=function(){return this._series};c.prototype.getTitle=function(){return this._title};c.prototype.getType=function(){if(!this.TYPE){throw new Error("The TYPE property has not been set.")}return this.TYPE};c.prototype.getXAxes=function(){return this._xaxes};c.prototype.getXAxis=function(a,b){return this.__getAxis("x",a,b)};c.prototype.getYAxes=function(){return this._yaxes};c.prototype.getYAxis=function(a,b){return this.__getAxis("y",a,b)};c.prototype.setConfigColorSet=function(a){this._configColorSet=a};c.prototype._setDefaults=function(){};c.prototype.setLabels=function(a){if(a.length&&this._series.length&&this._series[0].length!=a.length){throw new Error("Series must match label values.")}this._labels=a};c.prototype.setLegendOptions=function(a){if("object"!==_typeof(a)){throw new Error("Setting legend with non-object value:"+a)}this._legendOptions=a};c.prototype.setTitle=function(a){this._title=a};c.prototype.setXAxis=function(a,b){b="undefined"==typeof b?0:b;this._validateAxis("x",a,b);this._xaxes[b]=a};c.prototype.setYAxis=function(a,b){b="undefined"==typeof b?0:b;this._validateAxis("y",a,b);this._yaxes[b]=a};c.prototype._validateAxis=function(a,b,c){c="undefined"==typeof c?0:c;if(0<c){var d="x"==a?this._xaxes:this._yaxes;if("undefined"==typeof d[c-1]){throw new Error("Missing "+a+" axis at index lower than "+c)}}};c.prototype._validateSeries=function(a){if(this._series.length&&this._series[0].getCount()!=a.getCount()){throw new Error("Series do not have an equal number of values.")}else if(this._labels.length&&this._labels.length!=a.getCount()){throw new Error("Series must match label values.")}};return c});
//# sourceMappingURL=chart_base.min.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core/chart_output_chartjs",["jquery","core/chartjs","core/chart_axis","core/chart_bar","core/chart_output_base","core/chart_line","core/chart_pie","core/chart_series"],function(a,b,c,d,e,f,g,h){var j=function(a,b){return"axis-"+a+"-"+b};function i(){e.prototype.constructor.apply(this,arguments);this._canvas=this._node;if("CANVAS"!=this._canvas.prop("tagName")){this._canvas=a("<canvas>");this._node.append(this._canvas)}this._build()}i.prototype=Object.create(e.prototype);i.prototype._config=null;i.prototype._chartjs=null;i.prototype._canvas=null;i.prototype._build=function(){this._config=this._makeConfig();this._chartjs=new b(this._canvas[0],this._config)};i.prototype._cleanData=function(b){if(b instanceof Array){return b.map(function(b){return a("<span>").html(b).text()})}else{return a("<span>").html(b).text()}};i.prototype._getChartType=function(){var a=this._chart.getType();if(this._chart.getType()===d.prototype.TYPE&&!0===this._chart.getHorizontal()){a="horizontalBar"}else if(this._chart.getType()===g.prototype.TYPE&&!0===this._chart.getDoughnut()){a="doughnut"}return a};i.prototype._makeAxisConfig=function(a,b,d){var e={id:j(b,d)};if(a.getPosition()!==c.prototype.POS_DEFAULT){e.position=a.getPosition()}if(null!==a.getLabel()){e.scaleLabel={display:!0,labelString:this._cleanData(a.getLabel())}}if(null!==a.getStepSize()){e.ticks=e.ticks||{};e.ticks.stepSize=a.getStepSize()}if(null!==a.getMax()){e.ticks=e.ticks||{};e.ticks.max=a.getMax()}if(null!==a.getMin()){e.ticks=e.ticks||{};e.ticks.min=a.getMin()}return e};i.prototype._makeConfig=function(){var a={type:this._getChartType(),data:{labels:this._cleanData(this._chart.getLabels()),datasets:this._makeDatasetsConfig()},options:{title:{display:null!==this._chart.getTitle(),text:this._cleanData(this._chart.getTitle())}}},b=this._chart.getLegendOptions();if(b){a.options.legend=b}this._chart.getXAxes().forEach(function(b,c){var d=b.getLabels();a.options.scales=a.options.scales||{};a.options.scales.xAxes=a.options.scales.xAxes||[];a.options.scales.xAxes[c]=this._makeAxisConfig(b,"x",c);if(null!==d){a.options.scales.xAxes[c].ticks.callback=function(a,b){return d[b]||""}}a.options.scales.xAxes[c].stacked=this._isStacked()}.bind(this));this._chart.getYAxes().forEach(function(b,c){var d=b.getLabels();a.options.scales=a.options.scales||{};a.options.scales.yAxes=a.options.scales.yAxes||[];a.options.scales.yAxes[c]=this._makeAxisConfig(b,"y",c);if(null!==d){a.options.scales.yAxes[c].ticks.callback=function(a){return d[parseInt(a,10)]||""}}a.options.scales.yAxes[c].stacked=this._isStacked()}.bind(this));a.options.tooltips={callbacks:{label:this._makeTooltip.bind(this)}};return a};i.prototype._makeDatasetsConfig=function(){var a=this._chart.getSeries().map(function(a){var b=a.hasColoredValues()?a.getColors():a.getColor(),c={label:this._cleanData(a.getLabel()),data:a.getValues(),type:a.getType(),fill:a.getFill(),backgroundColor:b,borderColor:this._chart.getType()==g.prototype.TYPE?"#fff":b,lineTension:this._isSmooth(a)?.3:0};if(null!==a.getXAxis()){c.xAxisID=j("x",a.getXAxis())}if(null!==a.getYAxis()){c.yAxisID=j("y",a.getYAxis())}return c}.bind(this));return a};i.prototype._makeTooltip=function(a,b){var c=this._chart.getSeries()[a.datasetIndex],d=c.getLabel(),e=c.getLabels(),f=b.datasets[a.datasetIndex].data,g=f[a.index],h=[];if(""==a.xLabel&&""==a.yLabel){var i=this._cleanData(this._chart.getLabels());h.push(i[a.index])}if(null!==e){h.push(this._cleanData(e[a.index]))}else{h.push(this._cleanData(d)+": "+g)}return h};i.prototype._isSmooth=function(a){var b=!1;if(this._chart.getType()===f.prototype.TYPE){b=a.getSmooth();if(null===b){b=this._chart.getSmooth()}}else if(a.getType()===h.prototype.TYPE_LINE){b=a.getSmooth()}return b};i.prototype._isStacked=function(){var a=!1;if(this._chart.getType()===d.prototype.TYPE){a=this._chart.getStacked()}return a};i.prototype.update=function(){a.extend(!0,this._config,this._makeConfig());this._chartjs.update()};return i});
define ("core/chart_output_chartjs",["jquery","core/chartjs","core/chart_axis","core/chart_bar","core/chart_output_base","core/chart_line","core/chart_pie","core/chart_series"],function(a,b,c,d,e,f,g,h){var i=function(a,b){return"axis-"+a+"-"+b};function j(){e.prototype.constructor.apply(this,arguments);this._canvas=this._node;if("CANVAS"!=this._canvas.prop("tagName")){this._canvas=a("<canvas>");this._node.append(this._canvas)}this._build()}j.prototype=Object.create(e.prototype);j.prototype._config=null;j.prototype._chartjs=null;j.prototype._canvas=null;j.prototype._build=function(){this._config=this._makeConfig();this._chartjs=new b(this._canvas[0],this._config)};j.prototype._cleanData=function(b){if(b instanceof Array){return b.map(function(b){return a("<span>").html(b).text()})}else{return a("<span>").html(b).text()}};j.prototype._getChartType=function(){var a=this._chart.getType();if(this._chart.getType()===d.prototype.TYPE&&!0===this._chart.getHorizontal()){a="horizontalBar"}else if(this._chart.getType()===g.prototype.TYPE&&!0===this._chart.getDoughnut()){a="doughnut"}return a};j.prototype._makeAxisConfig=function(a,b,d){var e={id:i(b,d)};if(a.getPosition()!==c.prototype.POS_DEFAULT){e.position=a.getPosition()}if(null!==a.getLabel()){e.scaleLabel={display:!0,labelString:this._cleanData(a.getLabel())}}if(null!==a.getStepSize()){e.ticks=e.ticks||{};e.ticks.stepSize=a.getStepSize()}if(null!==a.getMax()){e.ticks=e.ticks||{};e.ticks.max=a.getMax()}if(null!==a.getMin()){e.ticks=e.ticks||{};e.ticks.min=a.getMin()}return e};j.prototype._makeConfig=function(){var a={type:this._getChartType(),data:{labels:this._cleanData(this._chart.getLabels()),datasets:this._makeDatasetsConfig()},options:{title:{display:null!==this._chart.getTitle(),text:this._cleanData(this._chart.getTitle())}}},b=this._chart.getLegendOptions();if(b){a.options.legend=b}this._chart.getXAxes().forEach(function(b,c){var d=b.getLabels();a.options.scales=a.options.scales||{};a.options.scales.xAxes=a.options.scales.xAxes||[];a.options.scales.xAxes[c]=this._makeAxisConfig(b,"x",c);if(null!==d){a.options.scales.xAxes[c].ticks.callback=function(a,b){return d[b]||""}}a.options.scales.xAxes[c].stacked=this._isStacked()}.bind(this));this._chart.getYAxes().forEach(function(b,c){var d=b.getLabels();a.options.scales=a.options.scales||{};a.options.scales.yAxes=a.options.scales.yAxes||[];a.options.scales.yAxes[c]=this._makeAxisConfig(b,"y",c);if(null!==d){a.options.scales.yAxes[c].ticks.callback=function(a){return d[parseInt(a,10)]||""}}a.options.scales.yAxes[c].stacked=this._isStacked()}.bind(this));a.options.tooltips={callbacks:{label:this._makeTooltip.bind(this)}};return a};j.prototype._makeDatasetsConfig=function(){var a=this._chart.getSeries().map(function(a){var b=a.hasColoredValues()?a.getColors():a.getColor(),c={label:this._cleanData(a.getLabel()),data:a.getValues(),type:a.getType(),fill:a.getFill(),backgroundColor:b,borderColor:this._chart.getType()==g.prototype.TYPE?"#fff":b,lineTension:this._isSmooth(a)?.3:0};if(null!==a.getXAxis()){c.xAxisID=i("x",a.getXAxis())}if(null!==a.getYAxis()){c.yAxisID=i("y",a.getYAxis())}return c}.bind(this));return a};j.prototype._makeTooltip=function(a,b){var c=this._chart.getSeries()[a.datasetIndex],d=c.getLabel(),e=c.getLabels(),f=b.datasets[a.datasetIndex].data,g=f[a.index],h=[];if(""==a.xLabel&&""==a.yLabel){var i=this._cleanData(this._chart.getLabels());h.push(i[a.index])}if(null!==e){h.push(this._cleanData(e[a.index]))}else{h.push(this._cleanData(d)+": "+g)}return h};j.prototype._isSmooth=function(a){var b=!1;if(this._chart.getType()===f.prototype.TYPE){b=a.getSmooth();if(null===b){b=this._chart.getSmooth()}}else if(a.getType()===h.prototype.TYPE_LINE){b=a.getSmooth()}return b};j.prototype._isStacked=function(){var a=!1;if(this._chart.getType()===d.prototype.TYPE){a=this._chart.getStacked()}return a};j.prototype.update=function(){a.extend(!0,this._config,this._makeConfig());this._chartjs.update()};return j});
//# sourceMappingURL=chart_output_chartjs.min.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/chart_series",[],function(){function a(a,b){if("string"!=typeof a){throw new Error("Invalid label for series.")}else if("object"!==_typeof(b)){throw new Error("Values for a series must be an array.")}else if(1>b.length){throw new Error("Invalid values received for series.")}this._colors=[];this._label=a;this._values=b}a.prototype.TYPE_DEFAULT=null;a.prototype.TYPE_LINE="line";a.prototype._colors=null;a.prototype._fill=!1;a.prototype._label=null;a.prototype._labels=null;a.prototype._smooth=!1;a.prototype._type=a.prototype.TYPE_DEFAULT;a.prototype._values=null;a.prototype._xaxis=null;a.prototype._yaxis=null;a.prototype.create=function(b){var c=new a(b.label,b.values);c.setType(b.type);c.setXAxis(b.axes.x);c.setYAxis(b.axes.y);c.setLabels(b.labels);if(b.colors&&1<b.colors.length){c.setColors(b.colors)}else{c.setColor(b.colors[0])}c.setFill(b.fill);c.setSmooth(b.smooth);return c};a.prototype.getColor=function(){return this._colors[0]||null};a.prototype.getColors=function(){return this._colors};a.prototype.getCount=function(){return this._values.length};a.prototype.getFill=function(){return this._fill};a.prototype.getLabel=function(){return this._label};a.prototype.getLabels=function(){return this._labels};a.prototype.getSmooth=function(){return this._smooth};a.prototype.getType=function(){return this._type};a.prototype.getValues=function(){return this._values};a.prototype.getXAxis=function(){return this._xaxis};a.prototype.getYAxis=function(){return this._yaxis};a.prototype.hasColoredValues=function(){return this._colors.length==this.getCount()};a.prototype.setColor=function(a){this._colors=[a]};a.prototype.setColors=function(a){if(a&&a.length!=this.getCount()){throw new Error("When setting multiple colors there must be one per value.")}this._colors=a||[]};a.prototype.setFill=function(a){this._fill="undefined"==typeof a?null:a};a.prototype.setLabels=function(a){this._validateLabels(a);a="undefined"==typeof a?null:a;this._labels=a};a.prototype.setSmooth=function(a){a="undefined"==typeof a?null:a;this._smooth=a};a.prototype.setType=function(a){if(a!=this.TYPE_DEFAULT&&a!=this.TYPE_LINE){throw new Error("Invalid serie type.")}this._type=a||null};a.prototype.setXAxis=function(a){this._xaxis=a||null};a.prototype.setYAxis=function(a){this._yaxis=a||null};a.prototype._validateLabels=function(a){if(a&&0<a.length&&a.length!=this.getCount()){throw new Error("Series labels must match series values.")}};return a});
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("core/chart_series",[],function(){function a(a,b){if("string"!=typeof a){throw new Error("Invalid label for series.")}else if("object"!==_typeof(b)){throw new Error("Values for a series must be an array.")}else if(1>b.length){throw new Error("Invalid values received for series.")}this._colors=[];this._label=a;this._values=b}a.prototype.TYPE_DEFAULT=null;a.prototype.TYPE_LINE="line";a.prototype._colors=null;a.prototype._fill=!1;a.prototype._label=null;a.prototype._labels=null;a.prototype._smooth=!1;a.prototype._type=a.prototype.TYPE_DEFAULT;a.prototype._values=null;a.prototype._xaxis=null;a.prototype._yaxis=null;a.prototype.create=function(b){var c=new a(b.label,b.values);c.setType(b.type);c.setXAxis(b.axes.x);c.setYAxis(b.axes.y);c.setLabels(b.labels);if(b.colors&&1<b.colors.length){c.setColors(b.colors)}else{c.setColor(b.colors[0])}c.setFill(b.fill);c.setSmooth(b.smooth);return c};a.prototype.getColor=function(){return this._colors[0]||null};a.prototype.getColors=function(){return this._colors};a.prototype.getCount=function(){return this._values.length};a.prototype.getFill=function(){return this._fill};a.prototype.getLabel=function(){return this._label};a.prototype.getLabels=function(){return this._labels};a.prototype.getSmooth=function(){return this._smooth};a.prototype.getType=function(){return this._type};a.prototype.getValues=function(){return this._values};a.prototype.getXAxis=function(){return this._xaxis};a.prototype.getYAxis=function(){return this._yaxis};a.prototype.hasColoredValues=function(){return this._colors.length==this.getCount()};a.prototype.setColor=function(a){this._colors=[a]};a.prototype.setColors=function(a){if(a&&a.length!=this.getCount()){throw new Error("When setting multiple colors there must be one per value.")}this._colors=a||[]};a.prototype.setFill=function(a){this._fill="undefined"==typeof a?null:a};a.prototype.setLabels=function(a){this._validateLabels(a);a="undefined"==typeof a?null:a;this._labels=a};a.prototype.setSmooth=function(a){a="undefined"==typeof a?null:a;this._smooth=a};a.prototype.setType=function(a){if(a!=this.TYPE_DEFAULT&&a!=this.TYPE_LINE){throw new Error("Invalid serie type.")}this._type=a||null};a.prototype.setXAxis=function(a){this._xaxis=a||null};a.prototype.setYAxis=function(a){this._yaxis=a||null};a.prototype._validateLabels=function(a){if(a&&0<a.length&&a.length!=this.getCount()){throw new Error("Series labels must match series values.")}};return a});
//# sourceMappingURL=chart_series.min.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/drawer",["exports","jquery","core/pubsub","core/aria","core/drawer_events"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=h(b);c=g(c);d=g(d);e=h(e);function f(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;f=function(){return a};return a}function g(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=f();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var g=d?Object.getOwnPropertyDescriptor(a,e):null;if(g&&(g.get||g.set)){Object.defineProperty(c,e,g)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function h(a){return a&&a.__esModule?a:{default:a}}var i=function(a){a=(0,b.default)(a);d.unhide(a.get());a.removeClass("hidden");a.attr("aria-expanded",!0);a.focus();c.publish(e.default.DRAWER_SHOWN,a)},j=function(a){a=(0,b.default)(a);a.addClass("hidden");a.attr("aria-expanded",!1);d.hide(a.get());c.publish(e.default.DRAWER_HIDDEN,a)},k=function(a){var b=a.hasClass("hidden");return!b},l=function(a){if(k(a)){j(a)}else{i(a)}},m=function(a){a=(0,b.default)(a);return a.closest("[data-region=\"right-hand-drawer\"]")};a.default={hide:j,show:i,isVisible:k,toggle:l,registerToggles:function registerToggles(a,b){var c=null;b.attr("aria-expanded",k(a));b.on("click",function(d){d.preventDefault();var e=k(a);l(a);b.attr("aria-expanded",!e);if(!e){c=b.filter(function(a,b){return b==d.target||b.contains(d.target)})}else if(c){c.focus();c=null}})},getDrawerRoot:m};return a.default});
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("core/drawer",["exports","jquery","core/pubsub","core/aria","core/drawer_events"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=h(b);c=g(c);d=g(d);e=h(e);function f(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(f=function(a){return a?c:b})(a)}function g(a,b){if(!b&&a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var c=f(b);if(c&&c.has(a)){return c.get(a)}var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a){if("default"!=g&&Object.prototype.hasOwnProperty.call(a,g)){var h=e?Object.getOwnPropertyDescriptor(a,g):null;if(h&&(h.get||h.set)){Object.defineProperty(d,g,h)}else{d[g]=a[g]}}}d.default=a;if(c){c.set(a,d)}return d}function h(a){return a&&a.__esModule?a:{default:a}}var i=function(a){a=(0,b.default)(a);d.unhide(a.get());a.removeClass("hidden");a.attr("aria-expanded",!0);a.focus();c.publish(e.default.DRAWER_SHOWN,a)},j=function(a){a=(0,b.default)(a);a.addClass("hidden");a.attr("aria-expanded",!1);d.hide(a.get());c.publish(e.default.DRAWER_HIDDEN,a)},k=function(a){var b=a.hasClass("hidden");return!b},l=function(a){if(k(a)){j(a)}else{i(a)}},m=function(a){a=(0,b.default)(a);return a.closest("[data-region=\"right-hand-drawer\"]")};a.default={hide:j,show:i,isVisible:k,toggle:l,registerToggles:function registerToggles(a,b){var c=null;b.attr("aria-expanded",k(a));b.on("click",function(d){d.preventDefault();var e=k(a);l(a);b.attr("aria-expanded",!e);if(!e){c=b.filter(function(a,b){return b==d.target||b.contains(d.target)})}else if(c){c.focus();c=null}})},getDrawerRoot:m};return a.default});
//# sourceMappingURL=drawer.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core/local/aria/aria-hidden",["exports","core/normalise","./selectors"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.unhideSiblings=a.hideSiblings=a.unhide=a.hide=void 0;c=function(a){return a&&a.__esModule?a:{default:a}}(c);var d=new Map,e=new Map,f=function(){return MutationObserver&&"function"==typeof MutationObserver},g=function(a){if(!(a instanceof HTMLElement)){return}if(a.matches(c.default.elements.focusable)){h(a)}a.querySelectorAll(c.default.elements.focusable).forEach(h)},h=function(a){if("undefined"!=typeof a.dataset.ariaHiddenTabIndex){return}if(a.getAttribute("tabindex")){a.dataset.ariaHiddenTabIndex=a.getAttribute("tabindex")}else{a.dataset.ariaHiddenTabIndex=""}a.setAttribute("tabindex",-1)},i=function(a){if(!(a instanceof HTMLElement)){return}if(a.matches(c.default.elements.focusableToUnhide)){j(a)}a.querySelectorAll(c.default.elements.focusableToUnhide).forEach(j)},j=function(a){if(a.closest(c.default.aria.hidden)){return}var b=a.dataset.ariaHiddenTabIndex;if(""===b){a.removeAttribute("tabindex")}else{a.setAttribute("tabindex",b)}delete a.dataset.ariaHiddenTabIndex},k=function(a){return(0,b.getList)(a).forEach(l)};a.hide=k;var l=function(a){if(!(a instanceof HTMLElement)){return}if(a.closest(c.default.aria.hidden)){return}a.setAttribute("aria-hidden",!0);g(a);if(f()){var b=new MutationObserver(function(a){a.forEach(function(a){a.addedNodes.forEach(g)})});b.observe(a,{childList:!0,subtree:!0});d.set(a,b)}},m=function(a){return(0,b.getList)(a).forEach(n)};a.unhide=m;var n=function(a){if(!(a instanceof HTMLElement)){return}a.removeAttribute("aria-hidden");i(a);if(d.has(a)){d.get(a).disconnect();d.delete(a)}};a.hideSiblings=function hideSiblings(a){return(0,b.getList)(a).forEach(o)};var o=function(a){if(!(a instanceof HTMLElement)){return}if(!a.parentElement){return}a.parentElement.childNodes.forEach(function(b){if(b===a){return}k(b)});if(f()){var b=new MutationObserver(function(b){b.forEach(function(b){b.addedNodes.forEach(function(b){if(a.contains(b)){return}k(b)})})});b.observe(a.parentElement,{childList:!0,subtree:!0});e.set(a.parentElement,b)}};a.unhideSiblings=function unhideSiblings(a){return(0,b.getList)(a).forEach(p)};var p=function(a){if(!(a instanceof HTMLElement)){return}if(!a.parentElement){return}a.parentElement.childNodes.forEach(function(b){if(b===a){return}m(b)});if(e.has(a.parentElement)){e.get(a.parentElement).disconnect();e.delete(a.parentElement)}}});
define ("core/local/aria/aria-hidden",["exports","core/normalise","./selectors"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.unhideSiblings=a.unhide=a.hideSiblings=a.hide=void 0;c=function(a){return a&&a.__esModule?a:{default:a}}(c);var d=new Map,e=new Map,f=function(){return MutationObserver&&"function"==typeof MutationObserver},g=function(a){if(!(a instanceof HTMLElement)){return}if(a.matches(c.default.elements.focusable)){h(a)}a.querySelectorAll(c.default.elements.focusable).forEach(h)},h=function(a){if("undefined"!=typeof a.dataset.ariaHiddenTabIndex){return}if(a.getAttribute("tabindex")){a.dataset.ariaHiddenTabIndex=a.getAttribute("tabindex")}else{a.dataset.ariaHiddenTabIndex=""}a.setAttribute("tabindex",-1)},i=function(a){if(!(a instanceof HTMLElement)){return}if(a.matches(c.default.elements.focusableToUnhide)){j(a)}a.querySelectorAll(c.default.elements.focusableToUnhide).forEach(j)},j=function(a){if(a.closest(c.default.aria.hidden)){return}var b=a.dataset.ariaHiddenTabIndex;if(""===b){a.removeAttribute("tabindex")}else{a.setAttribute("tabindex",b)}delete a.dataset.ariaHiddenTabIndex},k=function(a){return(0,b.getList)(a).forEach(l)};a.hide=k;var l=function(a){if(!(a instanceof HTMLElement)){return}if(a.closest(c.default.aria.hidden)){return}a.setAttribute("aria-hidden",!0);g(a);if(f()){var b=new MutationObserver(function(a){a.forEach(function(a){a.addedNodes.forEach(g)})});b.observe(a,{childList:!0,subtree:!0});d.set(a,b)}},m=function(a){return(0,b.getList)(a).forEach(n)};a.unhide=m;var n=function(a){if(!(a instanceof HTMLElement)){return}a.removeAttribute("aria-hidden");i(a);if(d.has(a)){d.get(a).disconnect();d.delete(a)}};a.hideSiblings=function hideSiblings(a){return(0,b.getList)(a).forEach(o)};var o=function(a){if(!(a instanceof HTMLElement)){return}if(!a.parentElement){return}a.parentElement.childNodes.forEach(function(b){if(b===a){return}k(b)});if(f()){var b=new MutationObserver(function(b){b.forEach(function(b){b.addedNodes.forEach(function(b){if(a.contains(b)){return}k(b)})})});b.observe(a.parentElement,{childList:!0,subtree:!0});e.set(a.parentElement,b)}};a.unhideSiblings=function unhideSiblings(a){return(0,b.getList)(a).forEach(p)};var p=function(a){if(!(a instanceof HTMLElement)){return}if(!a.parentElement){return}a.parentElement.childNodes.forEach(function(b){if(b===a){return}m(b)});if(e.has(a.parentElement)){e.get(a.parentElement).disconnect();e.delete(a.parentElement)}}});
//# sourceMappingURL=aria-hidden.min.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core/local/modal/alert",["exports","core/modal"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){c=function(a){return typeof a}}else{c=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return c(a)}function d(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function e(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function f(a,b,c){if(b)e(a.prototype,b);if(c)e(a,c);return a}function g(a,b,c){if("undefined"!=typeof Reflect&&Reflect.get){g=Reflect.get}else{g=function(a,b,c){var d=h(a,b);if(!d)return;var e=Object.getOwnPropertyDescriptor(d,b);if(e.get){return e.get.call(c)}return e.value}}return g(a,b,c||a)}function h(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=p(a);if(null===a)break}return a}function i(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});if(b)j(a,b)}function j(a,b){j=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return j(a,b)}function k(a){return function(){var b=p(a),c;if(n()){var d=p(this).constructor;c=Reflect.construct(b,arguments,d)}else{c=b.apply(this,arguments)}return l(this,c)}}function l(a,b){if(b&&("object"===c(b)||"function"==typeof b)){return b}return m(a)}function m(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return!0}catch(a){return!1}}function p(a){p=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return p(a)}var q=function(a){i(b,a);var c=k(b);function b(){d(this,b);return c.apply(this,arguments)}f(b,[{key:"registerEventListeners",value:function registerEventListeners(){g(p(b.prototype),"registerEventListeners",this).call(this);this.registerCloseOnCancel()}}]);return b}(b.default);a.default=q;return a.default});
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("core/local/modal/alert",["exports","core/modal"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function d(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function e(a,b,c){if(b)d(a.prototype,b);if(c)d(a,c);Object.defineProperty(a,"prototype",{writable:!1});return a}function f(){if("undefined"!=typeof Reflect&&Reflect.get){f=Reflect.get}else{f=function(a,b,c){var d=g(a,b);if(!d)return;var e=Object.getOwnPropertyDescriptor(d,b);if(e.get){return e.get.call(3>arguments.length?a:c)}return e.value}}return f.apply(this,arguments)}function g(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=n(a);if(null===a)break}return a}function h(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});Object.defineProperty(a,"prototype",{writable:!1});if(b)i(a,b)}function i(a,b){i=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return i(a,b)}function j(a){var b=m();return function(){var c=n(a),d;if(b){var e=n(this).constructor;d=Reflect.construct(c,arguments,e)}else{d=c.apply(this,arguments)}return k(this,d)}}function k(a,b){if(b&&("object"===_typeof(b)||"function"==typeof b)){return b}else if(void 0!==b){throw new TypeError("Derived constructors may only return object or undefined")}return l(a)}function l(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return!0}catch(a){return!1}}function n(a){n=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return n(a)}var o=function(a){h(d,a);var b=j(d);function d(){c(this,d);return b.apply(this,arguments)}e(d,[{key:"registerEventListeners",value:function registerEventListeners(){f(n(d.prototype),"registerEventListeners",this).call(this);this.registerCloseOnCancel()}}]);return d}(b.default);a.default=o;return a.default});
//# sourceMappingURL=alert.min.js.map
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sources":["../../../src/local/modal/alert.js"],"names":["registerCloseOnCancel","Modal"],"mappings":"uJAuBA,uD,+mEAY6B,CAErB,2DAGA,KAAKA,qBAAL,EACH,C,cAVwBC,S","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Alert modal.\n *\n * @module core/modal_alert\n * @copyright 2020 Andrew Nicols <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\n\n/**\n * The Alert Modal\n *\n * @class\n * @extends Modal\n */\nexport default class extends Modal {\n /**\n * Register all event listeners.\n */\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on cancel.\n this.registerCloseOnCancel();\n }\n}\n"],"file":"alert.min.js"}
{"version":3,"sources":["../../../src/local/modal/alert.js"],"names":["registerCloseOnCancel","Modal"],"mappings":"yaAuBA,uD,4jEAYI,iCAAyB,CAErB,2DAGA,KAAKA,qBAAL,EACH,C,cAVwBC,S","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Alert modal.\n *\n * @module core/modal_alert\n * @copyright 2020 Andrew Nicols <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\n\n/**\n * The Alert Modal\n *\n * @class\n * @extends Modal\n */\nexport default class extends Modal {\n /**\n * Register all event listeners.\n */\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on cancel.\n this.registerCloseOnCancel();\n }\n}\n"],"file":"alert.min.js"}
+1 -1
View File
@@ -1,2 +1,2 @@
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}(function(a,b){"use strict";if("function"==typeof define&&define.amd){define ("core/loglevel",b)}else if("object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports){module.exports=b()}else{a.log=b()}})(this,function(){"use strict";var h=function(){},i="undefined",j=("undefined"==typeof window?"undefined":_typeof(window))!==i&&_typeof(window.navigator)!==i&&/Trident\/|MSIE /.test(window.navigator.userAgent),k=["trace","debug","info","warn","error"];function a(a,b){var c=a[b];if("function"==typeof c.bind){return c.bind(a)}else{try{return Function.prototype.bind.call(c,a)}catch(b){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}}function b(){if(console.log){if(console.log.apply){console.log.apply(console,arguments)}else{Function.prototype.apply.apply(console.log,[console,arguments])}}if(console.trace)console.trace()}function c(c){if("debug"===c){c="log"}if(("undefined"==typeof console?"undefined":_typeof(console))===i){return!1}else if("trace"===c&&j){return b}else if(console[c]!==void 0){return a(console,c)}else if(console.log!==void 0){return a(console,"log")}else{return h}}function d(a,b){for(var c=0,d;c<k.length;c++){d=k[c];this[d]=c<a?h:this.methodFactory(d,a,b)}this.log=this.debug}function e(a,b,c){return function(){if(("undefined"==typeof console?"undefined":_typeof(console))!==i){d.call(this,b,c);this[a].apply(this,arguments)}}}function f(a){return c(a)||e.apply(this,arguments)}function g(a,b,c){var h=this,j,l="loglevel";if("string"==typeof a){l+=":"+a}else if("symbol"===_typeof(a)){l=void 0}function e(a){var b=(k[a]||"silent").toUpperCase();if(("undefined"==typeof window?"undefined":_typeof(window))===i||!l)return;try{window.localStorage[l]=b;return}catch(a){}try{window.document.cookie=encodeURIComponent(l)+"="+b+";"}catch(a){}}function g(){var a;if(("undefined"==typeof window?"undefined":_typeof(window))===i||!l)return;try{a=window.localStorage[l]}catch(a){}if(_typeof(a)===i){try{var b=window.document.cookie,c=b.indexOf(encodeURIComponent(l)+"=");if(-1!==c){a=/^([^;]+)/.exec(b.slice(c))[1]}}catch(a){}}if(h.levels[a]===void 0){a=void 0}return a}h.name=a;h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5};h.methodFactory=c||f;h.getLevel=function(){return j};h.setLevel=function(b,c){if("string"==typeof b&&h.levels[b.toUpperCase()]!==void 0){b=h.levels[b.toUpperCase()]}if("number"==typeof b&&0<=b&&b<=h.levels.SILENT){j=b;if(!1!==c){e(b)}d.call(h,b,a);if(("undefined"==typeof console?"undefined":_typeof(console))===i&&b<h.levels.SILENT){return"No console available for logging"}}else{throw"log.setLevel() called with invalid level: "+b}};h.setDefaultLevel=function(a){if(!g()){h.setLevel(a,!1)}};h.enableAll=function(a){h.setLevel(h.levels.TRACE,a)};h.disableAll=function(a){h.setLevel(h.levels.SILENT,a)};var m=g();if(null==m){m=null==b?"WARN":b}h.setLevel(m,!1)}var l=new g,m={};l.getLogger=function(a){if("symbol"!==_typeof(a)&&"string"!=typeof a||""===a){throw new TypeError("You must supply a name when creating a logger.")}var b=m[a];if(!b){b=m[a]=new g(a,l.getLevel(),l.methodFactory)}return b};var n=("undefined"==typeof window?"undefined":_typeof(window))!==i?window.log:void 0;l.noConflict=function(){if(("undefined"==typeof window?"undefined":_typeof(window))!==i&&window.log===l){window.log=n}return l};l.getLoggers=function(){return m};l["default"]=l;return l});
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}(function(a,b){"use strict";if("function"==typeof define&&define.amd){define ("core/loglevel",b)}else if("object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports){module.exports=b()}else{a.log=b()}})(this,function(){"use strict";var a=function(){},b="undefined",c=("undefined"==typeof window?"undefined":_typeof(window))!==b&&_typeof(window.navigator)!==b&&/Trident\/|MSIE /.test(window.navigator.userAgent),d=["trace","debug","info","warn","error"];function e(a,b){var c=a[b];if("function"==typeof c.bind){return c.bind(a)}else{try{return Function.prototype.bind.call(c,a)}catch(b){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}}function f(){if(console.log){if(console.log.apply){console.log.apply(console,arguments)}else{Function.prototype.apply.apply(console.log,[console,arguments])}}if(console.trace)console.trace()}function g(d){if("debug"===d){d="log"}if(("undefined"==typeof console?"undefined":_typeof(console))===b){return!1}else if("trace"===d&&c){return f}else if(console[d]!==void 0){return e(console,d)}else if(console.log!==void 0){return e(console,"log")}else{return a}}function h(b,c){for(var e=0,f;e<d.length;e++){f=d[e];this[f]=e<b?a:this.methodFactory(f,b,c)}this.log=this.debug}function i(a,c,d){return function(){if(("undefined"==typeof console?"undefined":_typeof(console))!==b){h.call(this,c,d);this[a].apply(this,arguments)}}}function j(a){return g(a)||i.apply(this,arguments)}function k(a,c,e){var f=this,g,i="loglevel";if("string"==typeof a){i+=":"+a}else if("symbol"===_typeof(a)){i=void 0}function k(a){var c=(d[a]||"silent").toUpperCase();if(("undefined"==typeof window?"undefined":_typeof(window))===b||!i)return;try{window.localStorage[i]=c;return}catch(a){}try{window.document.cookie=encodeURIComponent(i)+"="+c+";"}catch(a){}}function l(){var a;if(("undefined"==typeof window?"undefined":_typeof(window))===b||!i)return;try{a=window.localStorage[i]}catch(a){}if(_typeof(a)===b){try{var c=window.document.cookie,d=c.indexOf(encodeURIComponent(i)+"=");if(-1!==d){a=/^([^;]+)/.exec(c.slice(d))[1]}}catch(a){}}if(f.levels[a]===void 0){a=void 0}return a}f.name=a;f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5};f.methodFactory=e||j;f.getLevel=function(){return g};f.setLevel=function(c,d){if("string"==typeof c&&f.levels[c.toUpperCase()]!==void 0){c=f.levels[c.toUpperCase()]}if("number"==typeof c&&0<=c&&c<=f.levels.SILENT){g=c;if(!1!==d){k(c)}h.call(f,c,a);if(("undefined"==typeof console?"undefined":_typeof(console))===b&&c<f.levels.SILENT){return"No console available for logging"}}else{throw"log.setLevel() called with invalid level: "+c}};f.setDefaultLevel=function(a){if(!l()){f.setLevel(a,!1)}};f.enableAll=function(a){f.setLevel(f.levels.TRACE,a)};f.disableAll=function(a){f.setLevel(f.levels.SILENT,a)};var m=l();if(null==m){m=null==c?"WARN":c}f.setLevel(m,!1)}var l=new k,m={};l.getLogger=function(a){if("symbol"!==_typeof(a)&&"string"!=typeof a||""===a){throw new TypeError("You must supply a name when creating a logger.")}var b=m[a];if(!b){b=m[a]=new k(a,l.getLevel(),l.methodFactory)}return b};var n=("undefined"==typeof window?"undefined":_typeof(window))!==b?window.log:void 0;l.noConflict=function(){if(("undefined"==typeof window?"undefined":_typeof(window))!==b&&window.log===l){window.log=n}return l};l.getLoggers=function(){return m};l["default"]=l;return l});
//# sourceMappingURL=loglevel.min.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core/modal_cancel",["exports","core/modal"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){c=function(a){return typeof a}}else{c=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return c(a)}function d(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function e(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function f(a,b,c){if(b)e(a.prototype,b);if(c)e(a,c);return a}function g(a,b,c){if("undefined"!=typeof Reflect&&Reflect.get){g=Reflect.get}else{g=function(a,b,c){var d=h(a,b);if(!d)return;var e=Object.getOwnPropertyDescriptor(d,b);if(e.get){return e.get.call(c)}return e.value}}return g(a,b,c||a)}function h(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=p(a);if(null===a)break}return a}function i(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});if(b)j(a,b)}function j(a,b){j=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return j(a,b)}function k(a){return function(){var b=p(a),c;if(n()){var d=p(this).constructor;c=Reflect.construct(b,arguments,d)}else{c=b.apply(this,arguments)}return l(this,c)}}function l(a,b){if(b&&("object"===c(b)||"function"==typeof b)){return b}return m(a)}function m(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return!0}catch(a){return!1}}function p(a){p=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return p(a)}var q=function(a){i(b,a);var c=k(b);function b(a){var e;d(this,b);e=c.call(this,a);if(!e.getFooter().find(e.getActionSelector("cancel")).length){Notification.exception({message:"No cancel button found"})}return e}f(b,[{key:"registerEventListeners",value:function registerEventListeners(){g(p(b.prototype),"registerEventListeners",this).call(this);this.registerCloseOnCancel()}}]);return b}(b.default);a.default=q;return a.default});
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("core/modal_cancel",["exports","core/modal"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function d(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function e(a,b,c){if(b)d(a.prototype,b);if(c)d(a,c);Object.defineProperty(a,"prototype",{writable:!1});return a}function f(){if("undefined"!=typeof Reflect&&Reflect.get){f=Reflect.get}else{f=function(a,b,c){var d=g(a,b);if(!d)return;var e=Object.getOwnPropertyDescriptor(d,b);if(e.get){return e.get.call(3>arguments.length?a:c)}return e.value}}return f.apply(this,arguments)}function g(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=n(a);if(null===a)break}return a}function h(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});Object.defineProperty(a,"prototype",{writable:!1});if(b)i(a,b)}function i(a,b){i=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return i(a,b)}function j(a){var b=m();return function(){var c=n(a),d;if(b){var e=n(this).constructor;d=Reflect.construct(c,arguments,e)}else{d=c.apply(this,arguments)}return k(this,d)}}function k(a,b){if(b&&("object"===_typeof(b)||"function"==typeof b)){return b}else if(void 0!==b){throw new TypeError("Derived constructors may only return object or undefined")}return l(a)}function l(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return!0}catch(a){return!1}}function n(a){n=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return n(a)}var o=function(a){h(d,a);var b=j(d);function d(a){var e;c(this,d);e=b.call(this,a);if(!e.getFooter().find(e.getActionSelector("cancel")).length){Notification.exception({message:"No cancel button found"})}return e}e(d,[{key:"registerEventListeners",value:function registerEventListeners(){f(n(d.prototype),"registerEventListeners",this).call(this);this.registerCloseOnCancel()}}]);return d}(b.default);a.default=o;return a.default});
//# sourceMappingURL=modal_cancel.min.js.map
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sources":["../src/modal_cancel.js"],"names":["root","getFooter","find","getActionSelector","length","Notification","exception","message","registerCloseOnCancel","Modal"],"mappings":"kJAsBA,uD,++DAOI,WAAYA,CAAZ,CAAkB,iBACd,cAAMA,CAAN,EAEA,GAAI,CAAC,EAAKC,SAAL,GAAiBC,IAAjB,CAAsB,EAAKC,iBAAL,CAAuB,QAAvB,CAAtB,EAAwDC,MAA7D,CAAqE,CACjEC,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,wBAAV,CAAvB,CACH,CALa,QAMjB,C,0EAKwB,CAErB,2DAGA,KAAKC,qBAAL,EACH,C,cAlBwBC,S","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Contain the logic for the cancel modal.\n *\n * @module core/modal_cancel\n * @copyright 2016 Ryan Wyllie <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Modal from 'core/modal';\n\n/**\n * @class\n * @extends module:core/modal\n */\nexport default class extends Modal {\n constructor(root) {\n super(root);\n\n if (!this.getFooter().find(this.getActionSelector('cancel')).length) {\n Notification.exception({message: 'No cancel button found'});\n }\n }\n\n /**\n * Register all event listeners.\n */\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on cancel.\n this.registerCloseOnCancel();\n }\n}\n"],"file":"modal_cancel.min.js"}
{"version":3,"sources":["../src/modal_cancel.js"],"names":["root","getFooter","find","getActionSelector","length","Notification","exception","message","registerCloseOnCancel","Modal"],"mappings":"oaAsBA,uD,69DAOI,WAAYA,CAAZ,CAAkB,iBACd,cAAMA,CAAN,EAEA,GAAI,CAAC,EAAKC,SAAL,GAAiBC,IAAjB,CAAsB,EAAKC,iBAAL,CAAuB,QAAvB,CAAtB,EAAwDC,MAA7D,CAAqE,CACjEC,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,wBAAV,CAAvB,CACH,CALa,QAMjB,C,yCAKD,iCAAyB,CAErB,2DAGA,KAAKC,qBAAL,EACH,C,cAlBwBC,S","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Contain the logic for the cancel modal.\n *\n * @module core/modal_cancel\n * @copyright 2016 Ryan Wyllie <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Modal from 'core/modal';\n\n/**\n * @class\n * @extends module:core/modal\n */\nexport default class extends Modal {\n constructor(root) {\n super(root);\n\n if (!this.getFooter().find(this.getActionSelector('cancel')).length) {\n Notification.exception({message: 'No cancel button found'});\n }\n }\n\n /**\n * Register all event listeners.\n */\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on cancel.\n this.registerCloseOnCancel();\n }\n}\n"],"file":"modal_cancel.min.js"}
+1 -1
View File
@@ -1,2 +1,2 @@
function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(!a)return;if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return _arrayLikeToArray(a,b)}function _arrayLikeToArray(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function _iterableToArrayLimit(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function _arrayWithHoles(a){if(Array.isArray(a))return a}define ("core/modal_factory",["jquery","core/modal_events","core/modal_registry","core/modal","core/modal_save_cancel","core/modal_cancel","core/local/modal/alert","core/templates","core/notification","core/custom_interaction_events","core/pending"],function(a,b,c,d,e,f,g,h,i,j,k){var l={DEFAULT:"core/modal",SAVE_CANCEL:"core/modal_save_cancel",CANCEL:"core/modal_cancel",ALERT:"core/local/modal/alert"},m={DEFAULT:"DEFAULT",SAVE_CANCEL:"SAVE_CANCEL",CANCEL:"CANCEL",ALERT:"ALERT"};c.register(m.DEFAULT,d,l.DEFAULT);c.register(m.SAVE_CANCEL,e,l.SAVE_CANCEL);c.register(m.CANCEL,f,l.CANCEL);c.register(m.ALERT,g,l.ALERT);var n=function(c,d,e){var f=null,g="function"==typeof e.preShowCallback,h=function(b,d){var h=new k("core/modal_factory:setUpTrigger:triggeredCallback");f=a(b.currentTarget);c.then(function(a){if(g){e.preShowCallback(f,a)}a.show();return a}).then(h.resolve);d.originalEvent.preventDefault()};if(Array.isArray(d)){var i=d[1];d=d[0];j.define(d,[j.events.activate]);d.on(j.events.activate,i,h)}else{j.define(d,[j.events.activate]);d.on(j.events.activate,h)}c.then(function(a){a.getRoot().on(b.hidden,function(){if(null!==f){f.focus()}});return a})},o=function(b,c){c=a(c);var d=b.module,e=new d(c);return e},p=function(b,c){var d=b.template,e=h.render(d,c).then(function(c){var d=a(c);return o(b,d)}).fail(i.exception);return e};return{create:function create(a,b){var d=a.type||m.DEFAULT,e=a.large?!0:!1,f=a.hasOwnProperty("scrollable")?a.scrollable:!0,g=null,h={};g=c.get(d);if(!g){i.exception({message:"Unable to find modal of type: "+d})}if("undefined"!=typeof a.templateContext){h=a.templateContext}var j=p(g,h).then(function(b){if("undefined"!=typeof a.title){b.setTitle(a.title)}if("undefined"!=typeof a.body){b.setBody(a.body)}if("undefined"!=typeof a.footer){b.setFooter(a.footer)}if(a.buttons){Object.entries(a.buttons).forEach(function(a){var c=_slicedToArray(a,2),d=c[0],e=c[1];b.setButtonText(d,e)})}if(e){b.setLarge()}if("undefined"!=typeof a.removeOnClose){b.setRemoveOnClose(a.removeOnClose)}b.setScrollable(f);return b});if("undefined"!=typeof b){n(j,b,a)}return j},types:m}});
function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(!a)return;if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(a);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return _arrayLikeToArray(a,b)}function _arrayLikeToArray(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function _iterableToArrayLimit(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null==c)return;var d=[],e=!0,f=!1,g,h;try{for(c=c.call(a);!(e=(g=c.next()).done);e=!0){d.push(g.value);if(b&&d.length===b)break}}catch(a){f=!0;h=a}finally{try{if(!e&&null!=c["return"])c["return"]()}finally{if(f)throw h}}return d}function _arrayWithHoles(a){if(Array.isArray(a))return a}define ("core/modal_factory",["jquery","core/modal_events","core/modal_registry","core/modal","core/modal_save_cancel","core/modal_cancel","core/local/modal/alert","core/templates","core/notification","core/custom_interaction_events","core/pending"],function(a,b,c,d,e,f,g,h,i,j,k){var l={DEFAULT:"core/modal",SAVE_CANCEL:"core/modal_save_cancel",CANCEL:"core/modal_cancel",ALERT:"core/local/modal/alert"},m={DEFAULT:"DEFAULT",SAVE_CANCEL:"SAVE_CANCEL",CANCEL:"CANCEL",ALERT:"ALERT"};c.register(m.DEFAULT,d,l.DEFAULT);c.register(m.SAVE_CANCEL,e,l.SAVE_CANCEL);c.register(m.CANCEL,f,l.CANCEL);c.register(m.ALERT,g,l.ALERT);var n=function(c,d,e){var f=null,g="function"==typeof e.preShowCallback,h=function(b,d){var h=new k("core/modal_factory:setUpTrigger:triggeredCallback");f=a(b.currentTarget);c.then(function(a){if(g){e.preShowCallback(f,a)}a.show();return a}).then(h.resolve);d.originalEvent.preventDefault()};if(Array.isArray(d)){var i=d[1];d=d[0];j.define(d,[j.events.activate]);d.on(j.events.activate,i,h)}else{j.define(d,[j.events.activate]);d.on(j.events.activate,h)}c.then(function(a){a.getRoot().on(b.hidden,function(){if(null!==f){f.focus()}});return a})},o=function(b,c){c=a(c);var d=b.module,e=new d(c);return e},p=function(b,c){var d=b.template,e=h.render(d,c).then(function(c){var d=a(c);return o(b,d)}).fail(i.exception);return e};return{create:function create(a,b){var d=a.type||m.DEFAULT,e=a.large?!0:!1,f=a.hasOwnProperty("scrollable")?a.scrollable:!0,g=null,h={};g=c.get(d);if(!g){i.exception({message:"Unable to find modal of type: "+d})}if("undefined"!=typeof a.templateContext){h=a.templateContext}var j=p(g,h).then(function(b){if("undefined"!=typeof a.title){b.setTitle(a.title)}if("undefined"!=typeof a.body){b.setBody(a.body)}if("undefined"!=typeof a.footer){b.setFooter(a.footer)}if(a.buttons){Object.entries(a.buttons).forEach(function(a){var c=_slicedToArray(a,2),d=c[0],e=c[1];b.setButtonText(d,e)})}if(e){b.setLarge()}if("undefined"!=typeof a.removeOnClose){b.setRemoveOnClose(a.removeOnClose)}b.setScrollable(f);return b});if("undefined"!=typeof b){n(j,b,a)}return j},types:m}});
//# sourceMappingURL=modal_factory.min.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define ("core/modal_save_cancel",["exports","core/modal"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){c=function(a){return typeof a}}else{c=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return c(a)}function d(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function e(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function f(a,b,c){if(b)e(a.prototype,b);if(c)e(a,c);return a}function g(a,b,c){if("undefined"!=typeof Reflect&&Reflect.get){g=Reflect.get}else{g=function(a,b,c){var d=h(a,b);if(!d)return;var e=Object.getOwnPropertyDescriptor(d,b);if(e.get){return e.get.call(c)}return e.value}}return g(a,b,c||a)}function h(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=p(a);if(null===a)break}return a}function i(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});if(b)j(a,b)}function j(a,b){j=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return j(a,b)}function k(a){return function(){var b=p(a),c;if(n()){var d=p(this).constructor;c=Reflect.construct(b,arguments,d)}else{c=b.apply(this,arguments)}return l(this,c)}}function l(a,b){if(b&&("object"===c(b)||"function"==typeof b)){return b}return m(a)}function m(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return!0}catch(a){return!1}}function p(a){p=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return p(a)}var q=function(a){i(b,a);var c=k(b);function b(a){var e;d(this,b);e=c.call(this,a);if(!e.getFooter().find(e.getActionSelector("save")).length){Notification.exception({message:"No save button found"})}if(!e.getFooter().find(e.getActionSelector("cancel")).length){Notification.exception({message:"No cancel button found"})}return e}f(b,[{key:"registerEventListeners",value:function registerEventListeners(){g(p(b.prototype),"registerEventListeners",this).call(this);this.registerCloseOnSave();this.registerCloseOnCancel()}},{key:"setFooter",value:function setFooter(){Notification.exception({message:"Can not change the footer of a save cancel modal"})}},{key:"setSaveButtonText",value:function setSaveButtonText(a){return this.setButtonText("save",a)}}]);return b}(b.default);a.default=q;return a.default});
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("core/modal_save_cancel",["exports","core/modal"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function d(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function e(a,b,c){if(b)d(a.prototype,b);if(c)d(a,c);Object.defineProperty(a,"prototype",{writable:!1});return a}function f(){if("undefined"!=typeof Reflect&&Reflect.get){f=Reflect.get}else{f=function(a,b,c){var d=g(a,b);if(!d)return;var e=Object.getOwnPropertyDescriptor(d,b);if(e.get){return e.get.call(3>arguments.length?a:c)}return e.value}}return f.apply(this,arguments)}function g(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=n(a);if(null===a)break}return a}function h(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});Object.defineProperty(a,"prototype",{writable:!1});if(b)i(a,b)}function i(a,b){i=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return i(a,b)}function j(a){var b=m();return function(){var c=n(a),d;if(b){var e=n(this).constructor;d=Reflect.construct(c,arguments,e)}else{d=c.apply(this,arguments)}return k(this,d)}}function k(a,b){if(b&&("object"===_typeof(b)||"function"==typeof b)){return b}else if(void 0!==b){throw new TypeError("Derived constructors may only return object or undefined")}return l(a)}function l(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return!0}catch(a){return!1}}function n(a){n=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return n(a)}var o=function(a){h(d,a);var b=j(d);function d(a){var e;c(this,d);e=b.call(this,a);if(!e.getFooter().find(e.getActionSelector("save")).length){Notification.exception({message:"No save button found"})}if(!e.getFooter().find(e.getActionSelector("cancel")).length){Notification.exception({message:"No cancel button found"})}return e}e(d,[{key:"registerEventListeners",value:function registerEventListeners(){f(n(d.prototype),"registerEventListeners",this).call(this);this.registerCloseOnSave();this.registerCloseOnCancel()}},{key:"setFooter",value:function setFooter(){Notification.exception({message:"Can not change the footer of a save cancel modal"})}},{key:"setSaveButtonText",value:function setSaveButtonText(a){return this.setButtonText("save",a)}}]);return d}(b.default);a.default=o;return a.default});
//# sourceMappingURL=modal_save_cancel.min.js.map
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sources":["../src/modal_save_cancel.js"],"names":["root","getFooter","find","getActionSelector","length","Notification","exception","message","registerCloseOnSave","registerCloseOnCancel","value","setButtonText","Modal"],"mappings":"uJAsBA,uD,++DASI,WAAYA,CAAZ,CAAkB,iBACd,cAAMA,CAAN,EAEA,GAAI,CAAC,EAAKC,SAAL,GAAiBC,IAAjB,CAAsB,EAAKC,iBAAL,CAAuB,MAAvB,CAAtB,EAAsDC,MAA3D,CAAmE,CAC/DC,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,sBAAV,CAAvB,CACH,CAED,GAAI,CAAC,EAAKN,SAAL,GAAiBC,IAAjB,CAAsB,EAAKC,iBAAL,CAAuB,QAAvB,CAAtB,EAAwDC,MAA7D,CAAqE,CACjEC,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,wBAAV,CAAvB,CACH,CATa,QAUjB,C,0EAKwB,CAErB,2DAGA,KAAKC,mBAAL,GACA,KAAKC,qBAAL,EACH,C,6CAKW,CACRJ,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,kDAAV,CAAvB,CAEH,C,4DAQiBG,C,CAAO,CACrB,MAAO,MAAKC,aAAL,CAAmB,MAAnB,CAA2BD,CAA3B,CACV,C,cAzCwBE,S","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Contain the logic for the save/cancel modal.\n *\n * @module core/modal_save_cancel\n * @copyright 2016 Ryan Wyllie <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Modal from 'core/modal';\n\n/**\n * The Save/Cancel Modal.\n *\n * @class\n * @extends module:core/modal\n */\nexport default class extends Modal {\n constructor(root) {\n super(root);\n\n if (!this.getFooter().find(this.getActionSelector('save')).length) {\n Notification.exception({message: 'No save button found'});\n }\n\n if (!this.getFooter().find(this.getActionSelector('cancel')).length) {\n Notification.exception({message: 'No cancel button found'});\n }\n }\n\n /**\n * Register all event listeners.\n */\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n\n /**\n * Override parent implementation to prevent changing the footer content.\n */\n setFooter() {\n Notification.exception({message: 'Can not change the footer of a save cancel modal'});\n return;\n }\n\n /**\n * Set the title of the save button.\n *\n * @param {String|Promise} value The button text, or a Promise which will resolve it\n * @returns{Promise}\n */\n setSaveButtonText(value) {\n return this.setButtonText('save', value);\n }\n}\n"],"file":"modal_save_cancel.min.js"}
{"version":3,"sources":["../src/modal_save_cancel.js"],"names":["root","getFooter","find","getActionSelector","length","Notification","exception","message","registerCloseOnSave","registerCloseOnCancel","value","setButtonText","Modal"],"mappings":"yaAsBA,uD,69DASI,WAAYA,CAAZ,CAAkB,iBACd,cAAMA,CAAN,EAEA,GAAI,CAAC,EAAKC,SAAL,GAAiBC,IAAjB,CAAsB,EAAKC,iBAAL,CAAuB,MAAvB,CAAtB,EAAsDC,MAA3D,CAAmE,CAC/DC,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,sBAAV,CAAvB,CACH,CAED,GAAI,CAAC,EAAKN,SAAL,GAAiBC,IAAjB,CAAsB,EAAKC,iBAAL,CAAuB,QAAvB,CAAtB,EAAwDC,MAA7D,CAAqE,CACjEC,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,wBAAV,CAAvB,CACH,CATa,QAUjB,C,yCAKD,iCAAyB,CAErB,2DAGA,KAAKC,mBAAL,GACA,KAAKC,qBAAL,EACH,C,yBAKD,oBAAY,CACRJ,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,kDAAV,CAAvB,CAEH,C,iCAQD,2BAAkBG,CAAlB,CAAyB,CACrB,MAAO,MAAKC,aAAL,CAAmB,MAAnB,CAA2BD,CAA3B,CACV,C,cAzCwBE,S","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Contain the logic for the save/cancel modal.\n *\n * @module core/modal_save_cancel\n * @copyright 2016 Ryan Wyllie <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Modal from 'core/modal';\n\n/**\n * The Save/Cancel Modal.\n *\n * @class\n * @extends module:core/modal\n */\nexport default class extends Modal {\n constructor(root) {\n super(root);\n\n if (!this.getFooter().find(this.getActionSelector('save')).length) {\n Notification.exception({message: 'No save button found'});\n }\n\n if (!this.getFooter().find(this.getActionSelector('cancel')).length) {\n Notification.exception({message: 'No cancel button found'});\n }\n }\n\n /**\n * Register all event listeners.\n */\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n\n /**\n * Override parent implementation to prevent changing the footer content.\n */\n setFooter() {\n Notification.exception({message: 'Can not change the footer of a save cancel modal'});\n return;\n }\n\n /**\n * Set the title of the save button.\n *\n * @param {String|Promise} value The button text, or a Promise which will resolve it\n * @returns{Promise}\n */\n setSaveButtonText(value) {\n return this.setButtonText('save', value);\n }\n}\n"],"file":"modal_save_cancel.min.js"}
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More