teste app
Autor: Fabiano Plabo | Publicado: 2017-06-06T11:47:00-03:00













function initEvents(){

 jQuery('[data-fb-locked]').closest('div.sprocket-mosaic-item').find('div.circle').css({opacity:0.2}); //.attr('id','circle-red');
// jQuery('[data-fb-locked]').closest('li').remove();
 jQuery('div.sprocket-mosaic ul').show();
 jQuery('ul.sprocket-mosaic-tags').hide();
 
 jQuery('#scroll-bar').slider("value", 0);

 if (jQuery('.sprocket-mosaic ul:first').data('drag-load')){
  jQuery('.sprocket-mosaic ul:first').draggable('destroy');
 }
 jQuery('.sprocket-mosaic ul:first').draggable({
   axis: "x"
   ,containment:[0,0,Math.max.apply(null,jQuery.map(jQuery('.sprocket-mosaic ul:first li[data-mosaic-item]'),function(n,i){ return (jQuery(n).position().left+jQuery(n).width()); }))-jQuery('.sprocket-mosaic ul:first'),0]
   ,drag:function(event,ui){
    jQuery('#scroll-bar').slider("value", jQuery('#scroll-bar').slider("value") - ui.position.left);
   }
   ,stop:function(event,ui){
    jQuery(this).css({'left':'0px'});
   }
 });

 jQuery('[data-mosaic-order-title]').each(function(){ 
  var d = new Date();
  d.setTime(d.getTime()-360000000);
  jQuery(this).attr('data-mosaic-order-date',dateFormat(d));
  
//  jQuery(this).attr('data-mosaic-order-date',0);
  var dataTitle = jQuery.trim(jQuery(this).closest('div.sprocket-mosaic-item').find('h2.sprocket-mosaic-title').text());
 
  jQuery(this).removeAttr('data-mosaic-order-title');
  if (dataTitle=='Dodaj'){
    jQuery(this).attr('data-last-order','1');
    jQuery(this).attr('data-mosaic-order-date',dateFormat(new Date(1990, 9, 11)));
    jQuery(this).attr('data-mosaic-order-title','zzzzzzzzzzzzzzz');
    
  } else {
    jQuery(this).attr('data-mosaic-order-title',dataTitle);
  }
//  console.log(dataTitle);
//  console.log(jQuery.attr('data-mosaic-order-title'));
 });

 jQuery('div.sprocket-mosaic-image-container a').each(function(){ 
 
   var clos = jQuery(this).closest('div.sprocket-mosaic-item');
   //clos.find('[data-mosaic-order-title]').attr('data-mosaic-order-title',clos.find('h2.sprocket-mosaic-title').text());
 
   jQuery(this).attr('href',
     jQuery(this).closest('li').find('[data-mosaic-order-title]').attr('data-mosaic-order-title') == 'zzzzzzzzzzzzzzz' ? '/manual' : 'javascript:;'
    );
   
   
   var id = clos.find('a[data-fb-id]').data('fb-id');
   jQuery(clos).find('div.sprocket-padding').css({border:'none'});
   jQuery(clos).find('div.circle').css({opacity:0.2});
   jQuery(clos).find('.sprocket-mosaic-hovercontent').text('');
   if  ((wotm.friendsGet(id)) && (!clos.find('a[data-fb-locked]').length)) {
    jQuery(this).on('click',function(){    

     
     if (modeRide && !jQuery(this).closest('li').hasClass("sprocket-tags-Aktywny")) return;
     
     wotm.zoomConst(false);
     var sel = wotm.getVisible(id);
     
     if (selectedUsers.length >= maxSelected && (!sel)) return;
     
     if (!sel) { selectedUsers.push(id.toString()); }
     var ind = selectedUsers.indexOf(id.toString());
     if (modeRide) {
      if (sel){
       if (ind >=0 && ind <2) {
        wotm.hideBetween(selectedUsers[0],selectedUsers[1]);
       }
      } 
     }
   
     wotm.setVisible(id,!wotm.getVisible(id));
     if (typeof(Storage) !== "undefined") { localStorage[id] = wotm.getVisible(id); }
     clearUserInfo();
     wotm.calendarRefresh();
     
     if (sel){
      var ind = selectedUsers.indexOf(id.toString());
      if (ind >=0) { selectedUsers.splice(ind,1); }
     }
     
     if (modeRide && wotm.countBetween()<1 && selectedUsers.length>1){
      
      wotm.showBetween(selectedUsers[0],selectedUsers[1]);
      setTimeout(function(){ updateActivity(true); },500);
     }

     if (selectedUsers.length > 1){
      clearUserInfo();
     }

     if (selectedUsers.length == 1){
      
      onOneSelected();     
     }
     
    }); //on click
   }   
  }) // each a

 updateActivity();
}

function getIDUserNewest(){
 var d = "",idLast="";
 for (var i=0; i<wotm.params.friends.length; i++){
  if (wotm.friendsGet(wotm.params.friends[i][3]).lastDate > d){
   d = wotm.friendsGet(wotm.params.friends[i][3]).lastDate;
   idLast = wotm.params.friends[i][3];
  }
 }
 return idLast;
}

var scrListInterval;

function listTrainingUp(minimum){
 var hScroll = jQuery('.list-container div.training:eq(0)').height(); 
 var nScroll = minimum ? 0 : Math.max(0,jQuery('.list-container').scrollTop()-hScroll);
 jQuery('.list-container').scrollTop(nScroll);
}

function listTrainingDown(maximum){
 var hScroll = jQuery('.list-container div.training:eq(0)').height();  
 var cScroll = jQuery('.list-container div.training').length;
 var maxScroll = hScroll * cScroll;
 var nScroll = maximum ? maxScroll : Math.min(maxScroll,jQuery('.list-container').scrollTop()+hScroll);
 jQuery('.list-container').scrollTop(nScroll);
}

function clearTrainingList(text){
// jQuery('#training-table .title').html('loading...');
// jQuery('#training-table .title').html(''+wotm.friendsGet(wotm.params.me).title+' : trainings');
 jQuery('#training-table .title').html(''+wotm.friendsGet(wotm.params.me).title+' : ' + text + '');
 jQuery('#training-list-row,#training-info-space,#training-info-row,#training-facebook').hide();
 
 //jQuery('#training-table').hide();
 
 jQuery('.arrow-up a').off();
 jQuery('.arrow-down a').off();
 
 jQuery.each(wotm.friendsGet(wotm.params.me).trainingMarkers,function() { this.setVisible(false); });
 wotm.friendsGet(wotm.params.me).polyline.setVisible(false);
}

function showTrainingList(isMe){

 var dn = (parseInt(wotm.dateNOW.month)<10 ? '0':'') + wotm.dateNOW.month + '-' + (parseInt(wotm.dateNOW.day)<10 ? '0':'') + wotm.dateNOW.day;

 if (!trainingList) {
  clearTrainingList('no trainings');
  return;
 }
 if (!trainingList[dn]) {
  clearTrainingList('loading...');
  return;
 }

 wotm.setVisible(wotm.params.me,true);
 jQuery('#training-table').show();
 
 var child = jQuery('.list-container')[0];
 var pxLeft = child.offsetWidth - child.clientWidth + "px";
 jQuery('.list-container,#training-table-info').css('left',pxLeft);
 
 jQuery('.arrow-up a').click(function(){ 
  clearInterval(scrListInterval); 
  listTrainingUp();
  return false;
 }).on('mousedown',function(){
  clearInterval(scrListInterval);  
  scrListInterval = setInterval(listTrainingUp,100);
  return false;  
 }).on('mouseup,mouseleave',function(){
  clearInterval(scrListInterval); 
  return false;
 });
 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<trainingList[dn].length; i++){
  
  classAdd = '';
  if (parseInt(wotm.params.trainingId) == parseInt(trainingList[dn][i].start)){
   var classAdd=' active';
   var imgType = 'http://www.gdzienamapie.pl/images/trening/trening-' + trainingList[dn][i].type.toLowerCase().replace(' ','') + '.png';
   var tDistance = parseFloat(trainingList[dn][i].distance/1000).toFixed(parseFloat(trainingList[dn][i].distance/1000) == parseInt(trainingList[dn][i].distance/1000) ? 0 : 2) + ' km';
   var tDuration = trainingList[dn][i].duration;  
   var tSpeed =  trainingList[dn][i].speed.toFixed(parseFloat(trainingList[dn][i].speed) == parseInt(trainingList[dn][i].speed) ? 0 : 2) + ' km/h';
   var tSpeedMax = trainingList[dn][i].maxSpeed + ' km/h';
   var tCalories = trainingList[dn][i].calories;
   var tType = trainingList[dn][i].type;
  }
  
  var dFixed = parseFloat(trainingList[dn][i].distance/1000) == parseInt(trainingList[dn][i].distance/1000) ? 0 : 2;
  var textHref = parseFloat(trainingList[dn][i].distance/1000).toFixed(dFixed) + ' km ' + textsTrening[trainingList[dn][i].type][0];
  if ( (parseInt(wotm.params.trainingId) == parseInt(trainingList[dn][i].start)) || isMe ){
   jQuery('#training-list-row .list-container').append(''+textHref+'
');
  }
 }

 jQuery('#training-table .title').show().html(''+wotm.friendsGet(wotm.params.me).title+' : trainings');
 jQuery('#training-list-row .image').append('');
 jQuery('#training-info-row .image').append('');

 if (isMe){
  if (fbShareStatus){
   jQuery('#training-facebook td').append('
Training was shared
');
  } else {
   jQuery('#training-facebook td').append('
Share on Facebook

');
   jQuery('#training-facebook a').click(function(){
   
   jQuery('#training-facebook td').empty().append('
Training is sharing...
');
    document.location.href = 'http://www.gdzienamapie.pl/run/sharetraining.php?myid='+wotm.params.trainingId;
    return false;
   }).attr('href','http://www.gdzienamapie.pl/run/sharetraining.php?myid='+wotm.params.trainingId);
 
  }

 } else {

 }

 if ( (jQuery('.list-container div.training:eq(0)').height() * jQuery('.list-container div.training').length) > 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('Aktywność:'+timeInMinutes(new Date().getTime(),newDate(f.lastDate).getTime())+'min. temuDystans:' + (f.distance/1000).toFixed(1).replace('.',',') +'kmPrędkość:'+(f.speed * 3.6).toFixed(1).replace('.',',') + 'km/hŚrednio:' + (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<wotm.params.friends.length;i++){
  var minutes = timeInMinutes(new Date().getTime(), newDate(wotm.friendsGet(wotm.params.friends[i][3]).lastDate).getTime() );
  var opacity = 1;
  if (minutes<=20){
   opacity = 1;
  } else if (minutes > 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 = !jQuery(this).css('border').match(/none/);
   var fid = jQuery(this).parent().find('[data-fb-id]').attr('data-fb-id').toString();
   v++;
   if (wotm.friendsGet(fid).visible && selectedUsers.length<maxSelected) {
    selectedUsers.push(fid);
   }
  }); 
  
  if (selectedUsers.length==1 && !modeRide){
    onOneSelected();
  }
  
  if (modeRide){
  
   var isl = wotm.countBetween();
   if (isl == 0 && v>1){ // dodajemy kolejnego    
    
    jQuery('.sprocket-tags-Aktywny').find('div.sprocket-padding').each(function(){ 
     var fid = jQuery(this).parent().find('[data-fb-id]').attr('data-fb-id').toString();
     if (!wotm.friendsGet(fid).visible) { selectedUsers.push(fid); }
    });
   }
   console.log('to ten przypadek!');

   wotm.showBetween(selectedUsers[0],selectedUsers[1]);
   wotm.setVisible(selectedUsers[0],true);
   wotm.setVisible(selectedUsers[1],true);
   setTimeout(function(){ updateActivity(true); },500);
  }
 } else {
 }
 if (modeRide){
//  if (timeInSecounds(new Date(),lastUserUpdate) > 0){
  if (selectedUsers.length>1){
   if ((lastUpdateId.toString() == selectedUsers[0].toString()) || (lastUpdateId.toString() == selectedUsers[1].toString())){
    console.log('update between');
    wotm.updateBetween(selectedUsers[0],selectedUsers[1]);
    wotm.forceRedraw();
   }
  }
 }
 
 
// if (
}


var wotm,lastUserInfo,firstActive=true,firstFromLocal=true;
var lastIndexBetween=-2;
var modeRide = false;
var modeTraining = false;
var maxSelected = 100;
var selectedUsers = [];
var fbShareStatus = 0;
var textsTrening = {'Bike':['cycling',''], 
     'Horse':['horseback',''],
     'Jogging':['jogging','jogging'],
     'Walking':['on foot','on foot'],
     'Motorbike':['motorcycling','motorcycling'],
     'Motorcycle':['motorcycling','motorcycling'],
     'Rolki':['by rollers','by rollers'],
     'Scooter':['by scooter','by scooter'],
     'Car':['by car','car riding'],
     'Aeroplane':['by plane','flying']};
var trainingList;
var triggerDay = true;
var monthChanged = false;
var lastUpdateId = -1;
var lastUserUpdate = new Date();
var showUserAdd = false;
function initApp(){

 jQuery(window).load(function(){
  wotm = new WhereOnTheMap({
   slider:'slider-range',
      friends:
  [
  [-7.87267,-35.4422,'Fabiano da Silva','951417734960575','2017-06-06 11:39:57'],[-7.87261,-35.4422,'Roselita Regina','796451120533656','2017-06-06 11:29:37']],
   me:'951417734960575',
   isMyTraining: true,
   initWWW:true,
   mapNoZoomWhenTracking:true,
   saveOnStorage:true,
   stopMarkerSize:42,
   infoBetweenMarkerSize:42,
   rideMode:modeRide,
   noSlider:modeTraining,
   trainingMode:modeTraining,
   trainingId:0,
   onChangeVisible:function(f){
    if (wotm){
     if ((wotm.friendsGet(f.id).position.lat() << 0) == 0 && (wotm.friendsGet(f.id).position.lng() << 0) == 0) return false;
    }
    
    var par = jQuery("div.sprocket-mosaic-item a[data-fb-id='"+ f.id +"']").closest('div').parent();
    
//    if (modeRide){
//    } else {
     if (f.visible){
      jQuery(par).find('div.sprocket-padding').css({border:''});
      jQuery(par).find('.sprocket-mosaic-hovercontent').text('Hide');
     } else {
      f.hideStopsMarkers();
      jQuery(par).find('div.sprocket-padding').css({border:'none'});
      jQuery(par).find('.sprocket-mosaic-hovercontent').text('Show');     
     }
//    }
   },
   onNewData:function(f,result){ 
    lastUpdateId = f.id;  
    updateActivity();
    lastUserUpdate = new Date();
    if (firstActive){
     firstActive = false;
     jQuery('.sprocket-mosaic-order li:eq(0)').removeClass('active').before(jQuery('li[data-mosaic-orderby="date"]').addClass('active').trigger('click'));
            if (jQuery('.sprocket-tags-Aktywny').length){
        var id = getIDUserNewest(); //wotm.params.friends[wotm.params.friends.length-1][3];
        if (selectedUsers.length == 0) {
         jQuery('[data-fb-id="'+id+'"]').closest('li').find('div.sprocket-mosaic-image-container a').trigger('click');
        } else
        if (selectedUsers.length == 1){
         //setTimeout(function(){ google.maps.event.trigger(wotm.friendsGet(id).marker, 'click'); },200);
        }
       }
         }
    if (f.id == lastUserInfo){
     updateUserInfo(f);
    }
   },
   onNewDataToday:function(f,result){
    blinkUser(f);    
   },
   onSlide:function(ui){
    jQuery('#slider-hours').html(addZero(ui.values[0])+':00-'+addZero(ui.values[1]+1)+':00');
   },
   onMarkerClick:function(f){
    if (!wotm.isToday()) return;
    
    clearUserInfo();
    
    if (wotm){
     if ((wotm.friendsGet(f.id).position.lat() << 0) == 0 && (wotm.friendsGet(f.id).position.lng() << 0) == 0) return false;
    }
    
    if (lastUserInfo == f.id && !(selectedUsers.length == 1 && selectedUsers[0] == f.id)){
     clearUserInfo();
     wotm.friendsGet(f.id).hideStopsMarkers();
     return;
    } else {
     if (lastUserInfo) { wotm.friendsGet(lastUserInfo).hideStopsMarkers(); }
    }

    if (selectedUsers.length == 1 && selectedUsers[0] == f.id){
     wotm.setTracking(f.id,true);
     wotm.friendsGet(f.id).showStopsMarkers();
      if (showUserAdd) { showUserInfo(f); } showUserAdd=!showUserAdd;     
    } else {
     lastUserInfo = f.id;
     wotm.setTracking(f.id,true);
     showUserInfo(f);
     wotm.friendsGet(f.id).showStopsMarkers();
    }    
   }
     }); // new WhereOnTheMap
  
  jQuery('.sprocket-mosaic ul:first').wrap("
");
//  jQuery('div.scroll-content').wrap('

');
//  jQuery('div.m-scroll-content').after('



');
  jQuery('.sprocket-mosaic ul:first').after('



');
  
  var scrollContent = jQuery('.sprocket-mosaic ul:first'),scrollPane = jQuery('.m-scroll-content');
  scrollPane.css({'overflow':'hidden','float':'left','width':scrollContent.css('width')});
    
  jQuery( "#scroll-bar" ).slider({
   slide: function( event, ui ) {
    scrollPaneWidth = Math.max.apply(null,jQuery.map(jQuery('.sprocket-mosaic ul:first li[data-mosaic-item]'),function(n,i){ return (jQuery(n).position().left+jQuery(n).width()); }));
    if (scrollPaneWidth > scrollPane.width() ) {
     scrollContent.css( "margin-left", Math.round(
      -ui.value / 100 * ( scrollPaneWidth - scrollContent.width() )
     ) + "px" );
    } else {
     scrollContent.css( "margin-left", 0 );
    }
   },
   change:function( event, ui ) {
    scrollPaneWidth = Math.max.apply(null,jQuery.map(jQuery('.sprocket-mosaic ul:first li[data-mosaic-item]'),function(n,i){ return (jQuery(n).position().left+jQuery(n).width()); }));
    if (scrollPaneWidth > scrollPane.width() ) {
     scrollContent.css( "margin-left", Math.round(
      -ui.value / 100 * ( scrollPaneWidth - scrollContent.width() )
     ) + "px" );
    } else {
     scrollContent.css( "margin-left", 0 );
    }
   }
  });
  
  jQuery('div.scroll-bar-wrap').css({'position':'absolute','bottom':'-5px','width':(scrollContent.width() - 19) + 'px'});

//  console.log('scrollPaneWidth-scrollContent.width()');
//  console.log(jQuery('.sprocket-mosaic ul:first li:last').position().left+jQuery('.sprocket-mosaic ul:first li:last').width());
//  console.log(scrollPaneWidth + ' - ' + scrollContent.width());
  initEvents();
  
     
   jQuery('li.Aktywny').text('ACTIVE');
   jQuery('div[data-last-order="1"]').parent().find('h2 a').text('Add');
   
    
  jQuery('.sprocket-mosaic ul:first').data('drag-load',1);
  jQuery('.sprocket-mosaic-filter li,span.loadmore-more').on('click',function(){ 
   var int = setInterval(function(){
    if (jQuery('.sprocket-mosaic-container li').length > 20){
     jQuery('div.sprocket-mosaic-image-container a').unbind('click');
     clearInterval(int);
     setTimeout(initEvents,200);
    }  
   },200);
    }); // on click filter,loadmore
  
  jQuery('li.Aktywny').click(function() { jQuery('[data-last-order="1"]').closest('li').remove(); });
  
  jQuery('.sprocket-mosaic-filter li.all').click(function(){ 
   var int = setInterval(function(){
    if (jQuery('.sprocket-mosaic-container li').length > 20){
     clearInterval(int);
     setTimeout(function() {       
      jQuery('.sprocket-mosaic-order li.active').trigger('click'); 
//     },1200);
     },1200);     
    }  
   },200);  
  });
    jQuery('div.sprocket-mosaic ul').show("fast", 
   function() { 
    //jQuery('.sprocket-mosaic-filter li.all').preBind('click',function(e){  setTimeout(function() { jQuery('.sprocket-mosaic-order li.active').trigger('click'); return false; },100); e.stopPropagation(); e.preventDefault(); return false; });
    //jQuery('.sprocket-mosaic-filter li.all').off('click').click(function(){jQuery('.sprocket-mosaic-order li.active').trigger('click'); });
    //initEvents(); 
   });
  
//  jQuery('.sprocket-mosaic-order li').preBind('click',function(){ alert(jQuery(this).text()); });
  
  //jQuery('#rt-feature,#rt-maintop').css('visibility','visible');
  setTimeout(function(){ jQuery('#preloading').remove(); },1000);
 }); // window onload
 
}



@-webkit-keyframes rotating /* Safari and Chrome */ {
  from {
    -ms-transform: rotateY(0deg);
    -moz-transform: rotateY(0deg);
    -webkit-transform: rotateY(0deg);
    -o-transform: rotateY(0deg);
    transform: rotateY(0deg);
  }
  to {
    -ms-transform: rotateY(360deg);
    -moz-transform: rotateY(360deg);
    -webkit-transform: rotateY(360deg);
    -o-transform: rotateY(360deg);
    transform: rotateY(360deg);
  }
}
@keyframes rotating {
  from {
    -ms-transform: rotateY(0deg);
    -moz-transform: rotateY(0deg);
    -webkit-transform: rotateY(0deg);
    -o-transform: rotateY(0deg);
    transform: rotateY(0deg);
  }
  to {
    -ms-transform: rotateY(360deg);
    -moz-transform: rotateY(360deg);
    -webkit-transform: rotateY(360deg);
    -o-transform: rotateY(360deg);
    transform: rotateY(360deg);
  }
}
.rotating {
 height:auto;
  -webkit-animation: rotating 2s linear infinite;
  -moz-animation: rotating 2s linear infinite;
  -ms-animation: rotating 2s linear infinite;
  -o-animation: rotating 2s linear infinite;
  animation: rotating 2s linear infinite;
}


jQuery('#rt-main-surround').prepend('

Loading...

');
//jQuery('#rt-feature,#rt-maintop').css('visibility','hidden');
var rokInt = setInterval(function() { 
 if (jQuery('.sprocket-mosaic-order li.active').length){
  clearInterval(rokInt);
  jQuery('.sprocket-mosaic-order li.active').removeClass('active');
  jQuery('li[data-mosaic-orderby="date"]').addClass('active').trigger('click');  
 }
},100);











































































































Dados do mapa

Dados cartográficos ©2017 Google












Dados do mapaDados cartográficos ©2017 Google




Dados cartográficos ©2017 Google









Termos de Uso











Informar erro no mapa






































Mapa





Relevo




Satélite





Marcadores







jQuery('#map').closest('.rt-block').css('width','98%'); jQuery('#system-message-container').remove();