MediaWiki:Wikiminiatlas.js: Difference between revisions

no edit summary
(per Alex's suggestion on talk)
No edit summary
Line 436: Line 436:
   }
   }
  } ); //end each
  } ); //end each
// awareness tooltip
// (experiment, only shown to anonymous users on en.wp if the browser supports localStorage)
if( wgUserName === null && wgDBname === 'enwiki' &&
    window.localStorage &&
    window.localStorage.getItem('wmatooltipdismissed') === null ) {
  (function() {
  var wrap, span=$('#coordinates>span>span>img')
    , bubble = $('<div><div>').css( { width: '150px', border: '1px solid #ddd', borderRadius: '8px', position: 'absolute', top: '27px', right: '-4px', whiteSpace: 'normal', textAlign: 'left', padding: '0.25em 0.75em 0.25em 0.75em', fontSize: '90%', backgroundColor: '#f9f9f9', zIndex: 31, boxShadow: '4px 4px 10px rgba(0,0,0,0.2)' } ).text('Click the blue globe to open an interactive map.').append( $('<div></div>').css({position: 'absolute', width: 0, height: 0, top: '-10px', right: '10px', borderTop:0, borderLeft: '5px solid transparent', borderRight:  '5px solid transparent', borderBottom:  '10px solid #ddd'})  ).append( $('<div></div>').css({position: 'absolute', width: 0, height: 0, top: '-9px', right: '10px', borderTop:0, borderLeft: '5px solid transparent', borderRight:  '5px solid transparent', borderBottom:  '10px solid #f9f9f9'})  ).hide();
  if( span.length>0 ) {
    wrap = $('<span></span>').css( { width: '20px', height: '17px', position: 'relative' } );
    span.wrap(wrap).parent().append(bubble.fadeIn().click(function(){ bubble.fadeOut(); window.localStorage.setItem('wmatooltipdismissed','yes') }));
    setTimeout( function() { bubble.fadeOut() }, 10*1000 );
  }
  })();
}


  // detect and load KML
  // detect and load KML
Anonymous user