Пример #1
0
 exports.stations = function(bus){
     var stations = bus.stations,
         stationsLength = stations.length,
         $item, ul = '';
     
     message.hide();
     
     if ( 0 === stationsLength ){
         message.show('ZERO');
         return;
     }
     
     $item = createItem();
     
     $.each( stations, function( i, station ){
         if ( !station ){
             return;
         }
         ul += '<li>' + renderStations( station, i ) + '</li>';
     } );
     
     $item.html( '<ul>' + ul + '</ul>' );
     
     stationClick( $item, bus );
 };
Пример #2
0
 exports.lines = function(bus){
     var lines = bus.lines,
         linesLength = lines.length,
         $item, ul = '';
     
     message.hide();
     
     if ( 0 === linesLength ){
         message.show('ZERO');
         return;
     }
     
     $item = createItem();
     
     $.each( lines, function( i, line ){
         if ( !line ){
             return;
         }
         ul += '<li>' + renderLines( line, i ) + '</li>';
     } );
     
     $item.html( '<ul>' + ul + '</ul>' );
     
     lineClick( $item, bus );
 };
Пример #3
0
 exports.is = function( $input ){
     if ( !!$input.val() ){
         message.show('SEARCHING');
         return true;
     }
     $input.addClass('error');
     return false;
 };
Пример #4
0
 success: function(o){
     if ( o.level !== -1 ){
         data.set( address, o );
         search( from, to );
         return;
     }
     message.show('ERROR');
 },
Пример #5
0
 exports.route = function(bus){
     var routes = bus.routes,
         routesLength = routes.length,
         $item, ul = '';
     
     message.hide();
     
     if ( 0 === routesLength ){
         message.show('ZERO');
         return;
     }
     
     $item = createItem();
     
     $.each( routes, function( i, route ){
         if ( !route ){
             return;
         }
         ul += '<li>' + renderRoute(route) + '</li>';
     } );
     
     $item.html( '<ul>' + ul + '</ul>' );
 };
Пример #6
0
 error: function(){
     message.show('ERROR');
 }