moodle_local_treestudyplan/amd/build/page-view-plan copy.min.js

3 lines
7.5 KiB
JavaScript
Raw Normal View History

define("local_treestudyplan/page-view-plan copy",["exports","core/ajax","core/notification","./vue","./debugger","./string-helper","./studyplan-processor","./treestudyplan-components","./report-viewer-components","./modedit-modal","./portal-vue","./bootstrap-vue"],(function(_exports,_ajax,_notification,_vue,_debugger,_stringHelper,_studyplanProcessor,_treestudyplanComponents,_reportViewerComponents,_modeditModal,_portalVue,_bootstrapVue){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=function(_contextid,categoryid){(void 0===_contextid||!Number.isInteger(_contextid)||_contextid<1)&&(_contextid=1);void 0!==categoryid&&Number.isInteger(categoryid)||(categoryid=0);window.addEventListener("resize",_studyplanProcessor.fixLineWrappers);var app=new _vue.default({el:"#root",data:{displayedstudyplan:null,activestudyplan:null,associatedstudents:[],selectedstudent:null,studentstudyplan:null,loadingstudyplan:!1,studyplans:[],text:strings.studyplan,toolbox:{right:!0},usedcontexts:[]},created:function(){var _this=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function(_context){for(;;)switch(_context.prev=_context.next){case 0:_this.$root.$on("redrawLines",(function(){(0,_studyplanProcessor.fixLineWrappers)()}));case 1:case"end":return _context.stop()}}),_callee)})))()},updated:function(){setTimeout(_studyplanProcessor.fixLineWrappers,50)},mounted:function(){return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){return regeneratorRuntime.wrap((function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:(0,_studyplanProcessor.fixLineWrappers)(),(0,_ajax.call)([{methodname:"local_treestudyplan_list_studyplans",args:{context_id:_contextid}}])[0].done((function(response){var timingval={present:0,past:1,future:2};response.sort((function(a,b){var timinga=_treestudyplanComponents.default.studyplanTiming(a),timingb=_treestudyplanComponents.default.studyplanTiming(b),t=timingval[timinga]-timingval[timingb];return 0==t?a.name.localeCompare(b.name):t})),app.studyplans=response;var parts=location.hash.replace("#","").split("-");if(parts&&parts.length>0)for(var idx in app.studyplans)if(app.studyplans[idx].id==parts[0]){app.selectStudyplan(app.studyplans[idx],parts[1]);break}})).fail(_notification.default.exception),(0,_ajax.call)([{methodname:"local_treestudyplan_list_used_categories",args:{operation:"view"}}])[0].done((function(response){var contexts=[];for(var ix in response)response[ix].studyplancount>0&&contexts.push(response[ix]);app.usedcontexts=contexts})).fail(_notification.default.exception);case 3:case"end":return _context2.stop()}}),_callee2)})))()},computed:{dropdown_title:function(){return this.activestudyplan&&this.activestudyplan.name?this.activestudyplan.name:this.text.studyplan_select_placeholder},contextid:function(){return _contextid}},methods:{switchContext:function(ctx){var params=new URLSearchParams(location.search);params.set("categoryid",ctx.id),window.location.search=params.toString()},closeStudyplan:function(){app.activestudyplan=null,app.associatedstudents=[],app.studentstudyplan=[],app.displayedstudyplan=null},selectStudyplan:function(studyplan,studentid){app.loadingstudyplan=!0,app.activestudyplan=null,app.associatedstudents=[],app.s
//# sourceMappingURL=page-view-plan copy.min.js.map