interface upgrade
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
function Film()
|
||||
{
|
||||
var self = this;
|
||||
this.consts = {'ugc_url':'http://www.ugc.fr/'};
|
||||
this.consts = {'ugc_url':'http://www.ugc.fr/', 'process_url':'index.php'};
|
||||
this._attr = {};
|
||||
this._anchor = {};
|
||||
this._ban = {status:false, reason:''};
|
||||
@@ -36,6 +36,12 @@ function Film()
|
||||
|
||||
this.poster = function(sPoster)
|
||||
{
|
||||
if(sPoster) //Set
|
||||
{
|
||||
var sExt = sPoster.substr(sPoster.lastIndexOf('.')+1).toLowerCase();
|
||||
if(sExt=='jpg') sExt = 'jpeg';
|
||||
var sPoster = this.consts.process_url+'?a=get_poster&type='+sExt+'&data[id]='+this.id()+'&data[url]='+encodeURIComponent(sPoster);
|
||||
}
|
||||
return this.attr('poster', sPoster);
|
||||
};
|
||||
|
||||
@@ -68,16 +74,17 @@ function Film()
|
||||
{
|
||||
//Init page
|
||||
this.onPageReady();
|
||||
|
||||
|
||||
//Add film to DOM
|
||||
this._anchor = $('<div>', {'class':'film', 'id':'film_'+this.id()})
|
||||
//.append($('<img>', {'class':'bg', 'src':this.poster()}))
|
||||
.append($('<img>', {'class':'poster', 'src':this.poster()}))
|
||||
.append($('<div>', {'class':'info'})
|
||||
.append($('<p>', {'class':'title'})
|
||||
.append($('<a>', {'class':'name', 'target':'_blank', 'href':this.consts.ugc_url+'film.html?id='+this.id()})
|
||||
.append($('<i>', {'class':'fa fa-fw fa-icon fa-film'}))
|
||||
.append(this.name()))
|
||||
.append($('<span>', {'class':'edito'}).text(this.edito()?' ['+this.edito()+']':'')))
|
||||
.append($('<span>', {'class':'edito'+(this.edito()?' fa fa-edito':'')}).text(this.edito()?' '+this.edito():'')))
|
||||
.append($('<p>', {'class':'trailer'})
|
||||
.append($('<a>', {'target':'_blank', 'href':this.trailer()})
|
||||
.append($('<i>', {'class':'fa fa-fw fa-icon fa-trailer'}))
|
||||
@@ -108,20 +115,24 @@ function Film()
|
||||
|
||||
this.renderTimetable = function(iCinemaId, asLang)
|
||||
{
|
||||
var sCinema = asCinemas[iCinemaId];
|
||||
$.each(asLang, function(iKey, sLang)
|
||||
{
|
||||
if(sLang=='VF' && ('VOSTF' in self.timetable(iCinemaId))) self.error('Hiding VF version of "'+self.name()+'" (VOSTF available)');
|
||||
if(sLang=='VF' && ('VOSTF' in self.timetable(iCinemaId))) self.error('Hiding VF version of "'+self.name()+'" @'+sCinema+' (VOSTF available)');
|
||||
else if(sLang=='VFSTF') self.error('Hiding hearing-impaired version ('+sLang+') of "'+self.name()+'" @'+sCinema)
|
||||
else
|
||||
{
|
||||
var $Timetable = $('<p>')
|
||||
.append($('<a>', {'class':'cinema', 'target':'_blank', 'href':self.consts.ugc_url+'cinemaAction!execute.action?page=7&id='+iCinemaId})
|
||||
.append($('<i>', {'class':'fa fa-fw fa-icon fa-cinema'}))
|
||||
.append(asCinemas[iCinemaId]+' '+sLang))
|
||||
.append(' : ')
|
||||
.append($('<i>', {'class':'fa fa-fw fa-icon fa-cinema'}))
|
||||
.append($('<span>', {'class':'cinema_name'}).text(sCinema)))
|
||||
.append($('<span>', {'class':'lang'}).text(sLang))
|
||||
.appendTo(self.anchor().find('.timetable'));
|
||||
|
||||
$.each(self.timetable(iCinemaId, sLang).sort(self.timeCompare), function(iKey, oTime){
|
||||
$Timetable.append($('<a>', {'class':'time', 'href':oTime.booking, 'target':'_blank'}).text(oTime.time+' '));
|
||||
$Timetable
|
||||
.append($('<a>', {'class':'time', 'href':oTime.booking, 'target':'_blank'}).text(oTime.time))
|
||||
.append(' '); //for line break
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -134,7 +145,8 @@ function Film()
|
||||
|
||||
this.error = function(sMsg)
|
||||
{
|
||||
$('#feedback').show().append($('<p>').text(sMsg));
|
||||
$('#feedback').show();
|
||||
$('#feed_content').append($('<p>').text(sMsg));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -271,12 +283,13 @@ function Affiche(oDate)
|
||||
|
||||
this.error = function(sMsg)
|
||||
{
|
||||
$('#feedback').show().append($('<p>').text(sMsg));
|
||||
$('#feedback').show();
|
||||
$('#feed_content').append($('<p>').text(sMsg));
|
||||
};
|
||||
}
|
||||
|
||||
function getUgcPage(sPath, asData, fOnSuccess, sType)
|
||||
{
|
||||
var asParams = {'a':'get_page', 'type':sType, 'data':{'path':sPath, 'vars':asData}};
|
||||
$.get('index.php', asParams, fOnSuccess, sType);
|
||||
$.get((new Film()).consts.process_url, asParams, fOnSuccess, sType);
|
||||
}
|
||||
Reference in New Issue
Block a user