diff -r 67df6092aebe -r 8d64ffdaf5e3 integ/js/iri-buzz.js --- a/integ/js/iri-buzz.js Thu Apr 18 11:33:19 2013 +0200 +++ b/integ/js/iri-buzz.js Thu Apr 18 11:56:24 2013 +0200 @@ -10,18 +10,29 @@ $(".sidebar .content").css('height', newHeight); } +*/ -$(".central").mCustomScrollbar({ - advanced:{ - updateOnContentResize: true - } -}); + -*/ +var CONFIG = { + wChart : 150, + hVS : 200, + now : new Date(), + dayLimit : 1, + timelineMin : 5, + bar : [] +}; + function init(){ var wWin = ($(window).width()>520) ? $(window).width() : 520; $('.timer-bar').width(wWin - 170); + var stepHour = CONFIG.dayLimit * 24 / 12; + var hourText = 0; + $('.hours li').each(function(k, v){ + $(v).text(hourText+'h'); + hourText = hourText + stepHour; + }); var wTimerBar = $('.timer-bar').width(), nbIndicator = $('.hours li').length-1; @@ -32,6 +43,13 @@ var mr = mrIndicator - $('.hours li:last-child').width()/2 - $(v).width()/2; $(v).css('margin-right', mr); }); + + + var spaceTop = 100, spaceBotPoster = 200; + CONFIG.hVS = $(window).height() - $('footer').height() - $('header').height() - spaceTop - spaceBotPoster; + CONFIG.hVS = (CONFIG.hVS>200) ? CONFIG.hVS : 200; + + showHorloge(); } init(); @@ -58,17 +76,11 @@ }); } -var CONFIG = { - wChart : 100, - now : new Date(), - dayLimit : 1, - timelineMin : 5, - bar : [] -}; + var bcSettings = { width : 960, - height : 400, + height : CONFIG.hVS, chart : { spacer : 5 }, @@ -126,10 +138,12 @@ if(_.isUndefined(userReviewCount))userReviewCount = 0; var initValue = userReviewCount; + initValue = 0; + bcSettings.data.strata.push([{initValue: initValue }]); /* var item = $('
  • ').attr('data-poster', dataMovie.posterUrl).attr('id', 'movie-'+dataMovie.code ).attr('id', 'movie-'+dataMovie.code ).css('width', wItem); - var nbReview = $('').addClass('nbReview').text(userReviewCount); + var nbReview = $('').addClass('nbReview').text(userReviewCount); item.append(nbReview); item.appendTo('.info-movies'); */ @@ -138,8 +152,9 @@ resizeImg('.posters'); barChart = $("#data-viz").vs(bcSettings).data('visualSedimentation'); + barChart.settings.sedimentation.token.size.minimum=0; }); -/* + var now = new Date(); function reviewAllowSince(dateReview){ @@ -159,33 +174,31 @@ } function showHorloge(){ + var timestampDateLimit = CONFIG.now.getTime() - ((CONFIG.dayLimit*24)*60*60*1000); var dateLimit = new Date(timestampDateLimit); + var diff = CONFIG.now.getTime() - timestampDateLimit; var oneHour = (CONFIG.timelineMin * 60 * 1000) / (CONFIG.dayLimit*24); var oneMinute = oneHour / 60; - displayHorloge(timestampDateLimit); + + var wTimerBar = $('.timer-bar').width(); + var timerBarValue = $('.timer-bar-value'); + timerBarValue.width(0); + var indice = 0; setInterval(function(){ - if(timestampDateLimit>=CONFIG.now.getTime()) return; - timestampDateLimit = timestampDateLimit + (60 * 1000); - displayHorloge(timestampDateLimit); + if(indice>=diff) return; + indice = indice + (60 * 1000); + var wTimerBarValue = wTimerBar * indice / diff; + timerBarValue.width(wTimerBarValue); },oneMinute); } -function displayHorloge(timestampDateLimit){ - timestampDateLimit = timestampDateLimit+(60*1000); - var dateLimit = new Date(timestampDateLimit); - var horlogeHour = dateLimit.getHours(); - var horlogeMin = dateLimit.getMinutes(); - if(horlogeMin.toString().length==1)horlogeMin = '0'+horlogeMin; - var horlogeDay = dateLimit.getDate(); - var horlogeMonth = dateLimit.getMonth()+1; - $('.horloge').html(horlogeDay+' / '+horlogeMonth+'
    '+horlogeHour+'h'+horlogeMin); -} + function getReviewsByFilm(codeFilm){ @@ -280,7 +293,12 @@ rating : rating, author : author, category:barCharCat, - size:3, + size:1, +shape:{ + type:'box', + width:75, + height:2.5 +}, callback:{ mouseover:function(token){ var commentaire = token.attr('commentaire'); @@ -295,5 +313,20 @@ } }); } -*/ + +$('a.rejouer').bind('click', function(e){ + e.preventDefault(); + addTokenTest() +}); + +function addTokenTest(){ + barChart.addToken({ + category:0, + size:1, + + callback:{ + + } + }); +} });//load \ No newline at end of file