settings
This commit is contained in:
@@ -67,6 +67,11 @@ function Film()
|
||||
}
|
||||
};
|
||||
|
||||
this.removeSpinner = function()
|
||||
{
|
||||
this.anchor().find('.timetable').removeClass('fa fa-fw fa-spinner fa-spin');
|
||||
}
|
||||
|
||||
this.anchor = function()
|
||||
{
|
||||
if(Object.keys(this._anchor).length > 0) return this._anchor;
|
||||
@@ -162,6 +167,12 @@ function Affiche(oDate)
|
||||
this.consts = { days:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
||||
months:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]};
|
||||
|
||||
this.isLoaded = function()
|
||||
{
|
||||
//TODO
|
||||
return true;
|
||||
};
|
||||
|
||||
this.loadCinemas = function()
|
||||
{
|
||||
//Today timestamp
|
||||
@@ -170,12 +181,12 @@ function Affiche(oDate)
|
||||
$.each(asCinemas, function(iCinemaId, sCinemaName){
|
||||
getUgcPage( 'filmsAjaxAction!getFilmsForPageCinema.action',
|
||||
{cinemaId:iCinemaId, cinemaCode:'', page:'7', filmId:'', filmId_widget:'', '_':Date.now()},
|
||||
self.addCinema,
|
||||
function(hDom){self.addCinema(iCinemaId, hDom)},
|
||||
'html');
|
||||
});
|
||||
};
|
||||
|
||||
this.addCinema = function(hDom)
|
||||
this.addCinema = function(iCinemaId, hDom)
|
||||
{
|
||||
var $Page = $(hDom);
|
||||
var $Films = $Page.find('.FilmDiv');
|
||||
@@ -183,7 +194,6 @@ function Affiche(oDate)
|
||||
{
|
||||
var $Film = $(this);
|
||||
var iFilmId = $Film.find('input[name="filmId"]').val();
|
||||
var iCinemaId = $Film.find('input[name="cinemaId"]').val();
|
||||
var oFilm = self.film(iFilmId);
|
||||
|
||||
if(!oFilm)
|
||||
@@ -222,16 +232,15 @@ function Affiche(oDate)
|
||||
getUgcPage( 'filmsAfficheAction!loadDatesList.action',
|
||||
{filmId:oFilm.id(), cinemaId:iCinemaId, cinemaCode:'', day:''},
|
||||
function(jData){
|
||||
var sDate = jData.dates[self.date.timestamp];
|
||||
if(!(self.date.timestamp in jData.dates))
|
||||
{
|
||||
self.error('No times today for "'+oFilm.name()+'" @'+asCinemas[iCinemaId]+' (first date available: '+jData.dates[Object.keys(jData.dates)[0]]+')');
|
||||
oFilm.anchor().find('.timetable').removeClass('fa fa-fw fa-spinner fa-spin');
|
||||
if(self.isLoaded()) oFilm.removeSpinner();
|
||||
}
|
||||
else
|
||||
{
|
||||
getUgcPage( 'filmsAfficheAction!reloadSeancesList.action',
|
||||
{filmId:jData.filmId, cinemaId:jData.cinemaId, cinemaCode:'', day:self.date.timestamp},
|
||||
{filmId:oFilm.id(), cinemaId:iCinemaId, cinemaCode:'', day:self.date.timestamp},
|
||||
function(hData){
|
||||
var sLang = '';
|
||||
var asLangs = [];
|
||||
@@ -249,13 +258,13 @@ function Affiche(oDate)
|
||||
$Div.find('a').each(function(iKey, oLink){
|
||||
var $Time = $(oLink);
|
||||
oTime = {'time':$.trim($Time.find('span').text()), 'booking':oFilm.consts.ugc_url+$Time.attr('href')};
|
||||
oFilm.timetable(jData.cinemaId, sLang, oTime);
|
||||
oFilm.timetable(iCinemaId, sLang, oTime);
|
||||
});
|
||||
}
|
||||
});
|
||||
asLangs.push(sLang);
|
||||
oFilm.renderTimetable(iCinemaId, asLangs);
|
||||
oFilm.anchor().find('.timetable').removeClass('fa fa-fw fa-spinner fa-spin');
|
||||
if(self.isLoaded()) oFilm.removeSpinner();
|
||||
},
|
||||
'html');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user