}); jQuery('.arrow-down a').click(function(){ clearInterval(scrListInterval); listTrainingDown(); return false; }).on('mousedown',function(){ clearInterval(scrListInterval); scrListInterval = setInterval(listTrainingDown,100); return false; }).on('mouseup,mouseleave',function(){ clearInterval(scrListInterval); }); for (var i=0; i 108){ listTrainingDown(true); } else { jQuery('.arrow-up,.arrow-down').hide(); } jQuery('#training-table-info td:eq(0)').text('Distance'); jQuery('#training-table-info td:eq(1)').text(tDistance); jQuery('#training-table-info td:eq(2)').text('Time'); jQuery('#training-table-info td:eq(3)').text(tDuration); jQuery('#training-table-info td:eq(4)').text('Speed'); jQuery('#training-table-info td:eq(5)').text(tSpeed); jQuery('#training-table-info td:eq(6)').text('Max'); jQuery('#training-table-info td:eq(7)').text(tSpeedMax); if ( (tType == 'Rower') || (tType == 'Jazda Konna') || (tType == 'Bieganie') || (tType == 'Chodzenie') || (tType == 'Rolki') || (tType == 'Hulajnoga') ) { jQuery('#training-table-info td:eq(8)').text('Calories'); jQuery('#training-table-info td:eq(9)').text(tCalories); }// showUserInfo(wotm.params.me);// jQuery('#user-info-picture img').attr('src',imgType);}function showBordersSelected(){ jQuery.each(selectedUsers,function(i,f){ jQuery('.sprocket-tags-Aktywny').find('div.sprocket-padding').parent().find('[data-fb-id="'+f+'"]').closest('div').parent().find('div.sprocket-padding').css('border',''); });}function onOneSelected(){ if (lastUserInfo) { clearUserInfo(); } lastUserInfo = selectedUsers[0]; showUserInfo(wotm.friendsGet(lastUserInfo)); wotm.friendsGet(lastUserInfo).showStopsMarkers();}function blinkUser(f){ var jQ = jQuery("div.sprocket-mosaic-item a[data-fb-id='"+ f.id +"']").closest('div').parent().find('div.sprocket-padding'), cnt=0, border = jQ.css('border'); var timer = setInterval(function () { if (cnt++ == 8){ jQ.css({border:border}); clearInterval(timer); } else { cnt % 2 == 1 ? jQ.css({'border':''}) : jQ.css({'border':'none'}); } }, 250);}function updateUserInfo(f){ if (!wotm.isToday()) return; var styleTitle = 'class="user-info-title"'; var styleDesc = 'class="user-info-desc"'; var activ = timeInSecounds(new Date().getTime(),newDate(f.lastDate).getTime()); console.log('activ = ' + activ); if ((activ-60) > 59 && activ<(90*60)){ activ = timeInMinutes(new Date().getTime(),newDate(f.lastDate).getTime()) + ' min ago'; } else if (activ >= (90*60) && activ <= 172800){ activ = (timeInMinutes(new Date().getTime(),newDate(f.lastDate).getTime())/60).toFixed(0) + ' h ago;' } else if (activ > 172800){ activ = (timeInMinutes(new Date().getTime(),newDate(f.lastDate).getTime())/(60*24)).toFixed(0) + ' days ago'; } else { activ += ' sec. temu'; }// jQuery('#user-info-info').html('Aktywnosc:'+timeInMinutes(new Date().getTime(),newDate(f.lastDate).getTime())+'min. temuDystans:' + (f.distance/1000).toFixed(1).replace('.',',') +'kmPredkosc:'+(f.speed * 3.6).toFixed(1).replace('.',',') + 'km/hSrednio:' + (f.averagespeed * 3.6).toFixed(1).replace('.',',') + 'km/hMax:'+(f.maxspeed * 3.6).toFixed(1).replace('.',',') + 'km/h'); var GPSOff = (f.add_info['GPSOff']) ? 'ON' : 'OFF'; var SwitchGPSOff = parseInt(f.add_info['SwitchGPSOff'])==0 ? 'ON' : 'OFF'; var SwitchEnergySaver = parseInt(f.add_info['SwitchEnergySaver']) ? 'ON' : 'OFF'; var TrackEnergySaver = parseInt(f.add_info['SwitchEnergySaver'])==0 ? f.add_info['TrackEnergySaver'] + ' sec.' : f.add_info['TrackEnergySaver'] + ' min'; var still = parseInt(f.add_info['still']) ? 'yes' : 'moving'; var span1 = 'Activity:'+activ+'Distance:' + (f.distance/1000).toFixed(1).replace('.',',') +' kmSpeed:'+(f.speed * 3.6).toFixed(1).replace('.',',') + ' km/hAverage:' + (f.averagespeed * 3.6).toFixed(1).replace('.',',') + ' km/hMax speed:'+(f.maxspeed * 3.6).toFixed(1).replace('.',',') + ' km/h'; var span2 = 'GPS:'+GPSOff +'Show:' + SwitchGPSOff +'Energy saving:'+ SwitchEnergySaver + 'Interval:' + TrackEnergySaver + 'Still:'+ still + '' jQuery('#user-info-info div').html(''+span1+''+span2+'');}function clearUserInfo(){ jQuery('#user-info-name').removeClass('user-info-name').html(''); jQuery('#user-info-picture').html(''); jQuery('#user-info-info div').html(''); jQuery('#user-info-more').html(''); jQuery('#user-info-info div').css({left: 0}); wotm.setTracking(0,false); if (lastUserInfo) wotm.friendsGet(lastUserInfo).hideStopsMarkers(); lastUserInfo = 0;}function showUserInfo(f){/* jQuery('#user-info-picture').html(jQuery("div.sprocket-mosaic-item a[data-fb-id='"+ f.id +"']").closest('div').parent().find('div.sprocket-padding').clone(). attr("class","rt-overlay-dark sprocket-mosaic sprocket-mosaic-item sprocket-padding")); jQuery('#user-info-picture').find(":hidden").remove();*/ var a = jQuery("div.sprocket-mosaic-item a[data-fb-id='"+ f.id +"']"); jQuery('#user-info-picture').append(''); jQuery('#user-info-name').addClass('user-info-name').html(a.attr('data-fb-fullname')); jQuery('#user-info-more').html('Next'); // jQuery('#user-info-picture').append(''); jQuery('#user-info-more a').click(function(){ var a = jQuery(this); if (a.hasClass('ui-datepicker-prev')){ a.addClass('ui-datepicker-next').removeClass('ui-datepicker-prev'); jQuery('#user-info-info div').animate({left: 0}, 300); } else { a.addClass('ui-datepicker-prev').removeClass('ui-datepicker-next'); jQuery('#user-info-info div').animate({left: -jQuery('#user-info-info').width()}, 300); } }); // sprocket-mosaic-image // attr("class","rt-overlay-dark sprocket-mosaic sprocket-padding")).find(":hidden").remove(); updateUserInfo(f);}function updateActivity(force){ if (firstActive && !force){ selectedUsers.length=0; selectedUsers=[]; } for (var i=0; i 80){ opacity = 0.2; } else { opacity = 1 - minutes/100; } console.log('UPDATE ACTIVITY TIME ['+wotm.params.friends[i][3]+'] = '+minutes+','+opacity); var clos = jQuery("div [data-mosaic='100'] li[data-mosaic-item] a[data-fb-id='" + wotm.params.friends[i][3] + "']").closest('div.sprocket-mosaic-item'); clos.find('div.circle').css({opacity:opacity });// clos.find('[data-mosaic-order-date]').attr('data-mosaic-order-date',minutes); clos.find('[data-mosaic-order-date]').attr('data-mosaic-order-date',dateFormat(newDate(wotm.friendsGet(wotm.params.friends[i][3]).lastDate))); if (modeRide && !firstActive) continue;// if ( (firstFromLocal) && (wotm.params.saveOnStorage) && (typeof(Storage) !== "undefined") && (!modeRide)){ if ( (firstFromLocal) && (wotm.params.saveOnStorage) && (typeof(Storage) !== "undefined") ){ var vis = localStorage.getItem(wotm.params.friends[i][3]); if (vis){ vis = (localStorage[wotm.params.friends[i][3]] == 'true') ? true : false; } else { vis = wotm.getVisible(wotm.params.friends[i][3]); } wotm.setVisible(wotm.params.friends[i][3],vis); } else { wotm.setVisible(wotm.params.friends[i][3],wotm.getVisible(wotm.params.friends[i][3])); } } firstFromLocal = false; jQuery('#circle-red').css({opacity:1}); jQuery('[data-last-order]').closest('div').parent().find('.circle').css({opacity:1}); if (firstActive && !force){ var v=0; jQuery('.sprocket-tags-Aktywny').find('div.sprocket-padding').each(function(){ // console.log('tutaj -');// console.log(this);// var sel =