mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
begin of schedule editor
This commit is contained in:
2
public/js/plugins/contextLoader.min.js
vendored
Normal file
2
public/js/plugins/contextLoader.min.js
vendored
Normal 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
38
public/js/plugins/schedule/editor.js
vendored
Normal 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')
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user