diff --git a/masks/index.html b/masks/index.html index 5ae7874..e31a091 100755 --- a/masks/index.html +++ b/masks/index.html @@ -26,7 +26,9 @@
')
@@ -136,7 +137,6 @@ function Film()
.append($('', {'class':'cinema_name'}).text(sCinema)))
.append($('', {'class':'lang'}).text(sLang))
.appendTo(self.anchor().find('.timetable'));
-
var test = self.timetable(iCinemaId, sLang);
if(!test) console.log('cinema '+iCinemaId+' lang '+sLang+' film '+self.id());
@@ -154,10 +154,15 @@ function Film()
return (Date.parse('01/01/1970 '+sTime1.time+':00') > Date.parse('01/01/1970 '+sTime2.time+':00'));
};
- this.error = function(sMsg)
+ this.feedback = function(sMsg)
{
$('#feed_content').append($(' ').text(sMsg));
};
+
+ this.error = function(sMsg)
+ {
+ console.log('Film Error: '+sMsg);
+ };
}
function Affiche(oDate)
@@ -173,16 +178,11 @@ 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.$Header = $('header');
this.$Main = $('main');
this.$Footer = $('footer');
this.$Feedback = $('#feedback');
- this.isLoaded = function()
- {
- //TODO
- return true;
- };
-
this.wip = function(iProgress)
{
if(!iProgress) return this._wip;
@@ -195,19 +195,30 @@ function Affiche(oDate)
this.onPostLoad = function()
{
- //Sort films
$Films = $('.film');
- $Films.sort(function(oFilm1, oFilm2)
- {
- return ($(oFilm1).data('rank') < $(oFilm2).data('rank'))?1:-1;
+
+ //Display Header
+ this.$Header.css('visibility', 'visible');
+
+ //Sort films
+ $Films.sort(function(oFilm1, oFilm2){return ($(oFilm1).data('rank') < $(oFilm2).data('rank'))?1:-1;}).detach();
+
+ //Remove movies with no screening
+ $Films.not('.banned').each(function(iKey, hFilm){
+ var $Film = $(hFilm);
+ if($Film.find('.timetable').is(':empty'))
+ {
+ var oFilm = self.film($Film.data('id'));
+ self.feedback('Hiding movie "'+oFilm.name()+'". No screening today');
+ $Film.addClass('banned');
+ }
});
-
+
+ //Remove loading
this.$Main.find('#buffer').hide();
- $Films
- .detach()
- .appendTo(this.$Main)
- .not('.banned')
- .show();
+
+ //Add films (except bans)
+ $Films.appendTo(this.$Main).not('.banned').slideDown('slow');
this.$Footer.add(this.$Feedback).show();
};
@@ -272,12 +283,7 @@ function Affiche(oDate)
getUgcPage( 'filmsAfficheAction!loadDatesList.action',
{filmId:oFilm.id(), cinemaId:iCinemaId, cinemaCode:'', day:''},
function(jData){
- 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]]+')');
- //if(self.isLoaded()) oFilm.removeSpinner();
- self.wip(-1);
- }
+ if(!(self.date.timestamp in jData.dates)) self.wip(-1);
else
{
getUgcPage( 'filmsAfficheAction!reloadSeancesList.action',
@@ -305,19 +311,18 @@ function Affiche(oDate)
});
asLangs.push(sLang);
oFilm.renderTimetable(iCinemaId, asLangs);
- //if(self.isLoaded()) oFilm.removeSpinner();
self.wip(-1);
},
function(){
self.wip(-1);
- self.error('Error detected on film "'+oFilm.name()+'" @'+asCinemas[iCinemaId]+'. UGC website Temporarily Unavailable');
+ self.error('Ajax Error detected on movie "'+oFilm.name()+'" @'+asCinemas[iCinemaId]+'. UGC website Temporarily Unavailable');
},
'html');
}
},
function(){
self.wip(-1);
- self.error('Error detected on film "'+oFilm.name()+'" @'+asCinemas[iCinemaId]+'. UGC website Temporarily Unavailable');
+ self.error('Ajax Error detected on movie "'+oFilm.name()+'" @'+asCinemas[iCinemaId]+'. UGC website Temporarily Unavailable');
},
'json');
}
@@ -341,10 +346,15 @@ function Affiche(oDate)
else this._films[iFilmId] = oFilm;
};
- this.error = function(sMsg)
+ this.feedback = function(sMsg)
{
$('#feed_content').append($(' ').text(sMsg));
};
+
+ this.error = function(sMsg)
+ {
+ console.log('Affiche Error: '+sMsg);
+ };
}
function getUgcPage(sPath, asData, fOnSuccess, fOnFail, sType)
diff --git a/style/ugc.css b/style/ugc.css
index 9a93ce4..6091d7a 100755
--- a/style/ugc.css
+++ b/style/ugc.css
@@ -67,6 +67,7 @@ header {
margin:0 0 0 0.5em;
font-size: 2em;
color:#08288B;
+ visibility:hidden;
}
/* Section - Main */
@@ -76,7 +77,18 @@ main {
}
#buffer {
+ position: fixed;
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ bottom: 0px;
+ width: 1em;
+ height: 1em;
+ margin: auto;
+ padding: 0px;
font-size:2em;
+ color:#08288B;
+ padding-bottom: 0.5em;
}
/* Section - Film */