Correction action-script.js.

This commit is contained in:
xdrm-brackets 2016-04-15 12:19:18 +02:00
parent 0cd68d7fbb
commit 544e5464c8
1 changed files with 218 additions and 215 deletions

View File

@ -1,34 +1,16 @@
/* [-1] On recupere la liste des pages /* [0] Initialisation des variables en local
=========================================================*/ =========================================================*/
pageManagerClass.prototype.ajax('/f/json/menu/conf', function(pagelistSerialized){ var DOM = {
// On initialise la liste des pages
var pagelist = [];
// On deserialise le bordel
var pagelistObject = JSON.parse(pagelistSerialized);
// On recupere chaque page
for( var i = 0 ; i < pagelistObject.length; i++ )
pagelist.push( pagelistObject[i]['attributes']['data-link'] );
DOM = {
WRAPPER: $('WRAPPER'), WRAPPER: $('WRAPPER'),
HEADER: $('HEADER'), HEADER: $('HEADER'),
MENUSIDE: $('MENU-SIDE'), MENUSIDE: $('MENU-SIDE'),
CONTAINER: $('CONTAINER') CONTAINER: $('CONTAINER')
}; };
var pageManager;
// On cree une instance de l'api
/* [0] Instanciation api = new APIClass('/api/');
===========================================*/
var pageManager = new pageManagerClass();
pageManager.setPage(null, '/view', DOM.CONTAINER, pagelist );
var api = new APIClass('/api/');
@ -172,7 +154,7 @@ pageManagerClass.prototype.ajax('/f/json/menu/conf', function(pagelistSerialized
}, false); }, false);
} }
}navMenu(pageManager.page); }
@ -226,4 +208,25 @@ pageManagerClass.prototype.ajax('/f/json/menu/conf', function(pagelistSerialized
LOGIN.hide.addEventListener('click', function(e){ LOGIN.page.className = ''; }, false); LOGIN.hide.addEventListener('click', function(e){ LOGIN.page.className = ''; }, false);
}, 'GET')
/* [7] On recupere la liste des pages et on lance pageManager
=========================================================*/
pageManagerClass.prototype.ajax('/f/json/menu/conf', function(pagelistSerialized){
// On initialise la liste des pages
var pagelist = [];
// On deserialise le bordel
var pagelistObject = JSON.parse(pagelistSerialized);
// On recupere chaque page
for( var i = 0 ; i < pagelistObject.length; i++ )
pagelist.push( pagelistObject[i]['attributes']['data-link'] );
/* (1) On initialisa pageManager */
pageManager = new pageManagerClass();
pageManager.setPage(null, '/view', DOM.CONTAINER, pagelist );
/* (2) On charge la premiere page */
navMenu(pageManager.page);
}, 'GET');