begin of schedule editor

This commit is contained in:
Mathieu Lagace
2019-12-21 18:40:01 -05:00
parent 90b551ad31
commit 997abf460e
19 changed files with 1954 additions and 225 deletions

View File

@@ -0,0 +1,2 @@
contextLoader={};contextLoader.htmlContent='<div class="timeline-item"><div class="animated-background"><div class="background-masker header-top"></div><div class="background-masker header-left"></div><div class="background-masker header-right"></div><div class="background-masker header-bottom"></div><div class="background-masker subheader-left"></div><div class="background-masker subheader-right"></div><div class="background-masker subheader-bottom"></div><div class="background-masker content-top"></div><div class="background-masker content-first-end"></div><div class="background-masker content-second-line"></div><div class="background-masker content-second-end"></div><div class="background-masker content-third-line"></div><div class="background-masker content-third-end"></div></div></div>';contextLoader.addLoader = function(theDiv){document.querySelector(theDiv).innerHTML = contextLoader.htmlContent;}

38
public/js/plugins/schedule/editor.js vendored Normal file
View File

@@ -0,0 +1,38 @@
function initScheduleEditor(id, periode, niveau)
{
$.ajax({
type: 'GET',
url: '/api/schedule/editor/init?api_token='+api_token,
success: function (template) {
$("#"+id).html(template);
for (let pniveau = 1; pniveau <= 3; pniveau++) {
for (let pperiode = 1; pperiode <= 3; pperiode++) {
loadCourse(pniveau,pperiode);
}
}
initAutoComplete("AutoComplete");
},
error: function () {
showNotification('error','Impossible d\'initialiser l\'éditeur d\'horaire ...','top', 'center')
}
})
}
function loadTemplate(id)
{
$.get('/api/schedule/editor/init?api_token='+api_token, function ( data ) {$("#"+id).html(data);});
}
function loadCourse(periode,niveau)
{
$.ajax({
type: 'GET',
url: '/api/schedule/editor/course/'+niveau+'/'+periode+'?api_token='+api_token,
success: function (course) {
$("#container-"+niveau+"-"+periode).html(course);
},
error: function () {
showNotification('error','Impossible de charger les cours ...','top', 'center')
}
})
}