adding avant-première movies (option)
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
<h1>Theaters<span id="ok_settings" class="button no_bg square fa fa-ok"></span></h1>
|
||||
<div id="buffer_settings"><i class="fa fa-spinner fa-spin"></i></div>
|
||||
<ul class="cinemas"></ul>
|
||||
<div class="switches"><i id="premiere" class="fa fa-lg inline"></i><span>Include Avant-première</span></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -17,8 +17,8 @@ function Film(oSettings)
|
||||
{
|
||||
this._ban.status = true;
|
||||
this._ban.reason = sReason;
|
||||
this.feedback('Hidding movie "'+this.name()+'": '+this.ban().reason);
|
||||
this.anchor().addClass('banned');
|
||||
this.feedback('Hidding movie "'+this.name()+'": '+this.ban().reason);
|
||||
}
|
||||
else this.error('Setting ban status with no reason');
|
||||
}
|
||||
@@ -84,9 +84,12 @@ function Film(oSettings)
|
||||
{
|
||||
var sEdito = this.edito() || '';
|
||||
var iRank = 0;
|
||||
if(this.ban().status) iRank -= 10000000;
|
||||
else if(sEdito=='Nouveau') iRank += 10000000;
|
||||
else if(sEdito.slice(-7)=='semaine') iRank += 100000*parseInt(sEdito.substr(0, sEdito.indexOf('è')));
|
||||
if(this.ban().status) iRank -= 1000000000; //Banned movies
|
||||
else if(sEdito=='Avant-première') iRank += 1000000000; //Special event
|
||||
else if(sEdito=='Nouveau') iRank += 10000000; //New releases
|
||||
else if(sEdito.slice(-7)=='semaine')iRank += 100000 * parseInt(sEdito.substr(0, sEdito.indexOf('è'))); //Popular movies
|
||||
|
||||
//Adding movie ID (newer movies have greater IDs)
|
||||
iRank += parseInt(this.id(), 10);
|
||||
return iRank;
|
||||
};
|
||||
@@ -225,7 +228,7 @@ function Ugc()
|
||||
|
||||
this.onPostLoad = function()
|
||||
{
|
||||
$Films = $('.film');
|
||||
var $Films = $('.film');
|
||||
|
||||
//Remove movies with no screening
|
||||
$Films.not('.banned').each(function(iKey, hFilm){
|
||||
@@ -286,7 +289,7 @@ function Ugc()
|
||||
oFilm.anchor();
|
||||
|
||||
//Ban if wrong edito
|
||||
if(sEdito=='Avant-première' || sEdito=='UGC Culte' || sEdito=='Soirée Club') oFilm.ban(true, sEdito);
|
||||
if((sEdito=='Avant-première' && !self.settings.premiere()) || sEdito=='UGC Culte' || sEdito=='Soirée Club') oFilm.ban(true, sEdito);
|
||||
|
||||
//Append film to Ugc
|
||||
self.film(iFilmId, oFilm);
|
||||
@@ -391,6 +394,18 @@ function Settings()
|
||||
},
|
||||
function(){self.error('Error: Could not load cinema list');},
|
||||
'json');
|
||||
|
||||
//Avant-Première switch
|
||||
var bCookiePremiere = Cookies.getJSON('premiere');
|
||||
this.premiere(bCookiePremiere==null?false:bCookiePremiere);
|
||||
$('.switches').click(function(){self.premiere(!self.premiere());});
|
||||
};
|
||||
|
||||
this.premiere = function(bActive)
|
||||
{
|
||||
var $Premiere = $('#premiere');
|
||||
if(bActive==null) return $Premiere.hasClass('fa-on');
|
||||
else $Premiere.removeClass('fa-on fa-off').addClass(bActive?'fa-on':'fa-off');
|
||||
};
|
||||
|
||||
this.ugcCinemas = function(asCinemas)
|
||||
@@ -506,7 +521,7 @@ function Settings()
|
||||
.attr('id', 'cinema_'+iCinemaId)
|
||||
.data('id', iCinemaId)
|
||||
.toggleClass('include', (iCinemaId in self.cinemas()))
|
||||
.click(function(){$(this).toggleClass('include')})
|
||||
.click(function(){$(this).toggleClass('include');})
|
||||
.text(sCinemaName));
|
||||
});
|
||||
|
||||
@@ -523,6 +538,7 @@ function Settings()
|
||||
asCines[$Cine.data('id')] = $Cine.text();
|
||||
});
|
||||
Cookies.set('cinemas', asCines);
|
||||
Cookies.set('premiere', self.premiere()?'true':'false');
|
||||
reload();
|
||||
});
|
||||
};
|
||||
|
||||
0
style/_big_screen.scss
Normal file → Executable file
0
style/_big_screen.scss
Normal file → Executable file
0
style/_small_screen.scss
Normal file → Executable file
0
style/_small_screen.scss
Normal file → Executable file
2
style/ugc.css
Normal file → Executable file
2
style/ugc.css
Normal file → Executable file
File diff suppressed because one or more lines are too long
2
style/ugc.css.map
Normal file → Executable file
2
style/ugc.css.map
Normal file → Executable file
File diff suppressed because one or more lines are too long
@@ -117,6 +117,15 @@ select {
|
||||
.fa-down:before {
|
||||
content: "\f0d7";
|
||||
}
|
||||
.fa-on:before {
|
||||
content: "\f205";
|
||||
}
|
||||
.fa-off:before {
|
||||
content: "\f204";
|
||||
}
|
||||
.fa-on, .fa-off {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Sections */
|
||||
|
||||
@@ -354,6 +363,14 @@ footer {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#settings .switches {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
#settings .switches .fa-on + span {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Mobile Support */
|
||||
|
||||
@import 'small_screen';
|
||||
|
||||
Reference in New Issue
Block a user