MediaWiki:Wikiminiatlas.js: Difference between revisions

(fix typo)
(this needs some serious jshint cleanup (unfortunately that site is down right now))
Line 217: Line 217:
  // domain of the WMA
  // domain of the WMA
  wma_domain = useLabs ? '//wma.wmflabs.org' : '//toolserver.org',
  wma_domain = useLabs ? '//wma.wmflabs.org' : '//toolserver.org',
language = '', site = '', awt="0", rtl = /(^|\s)rtl(\s|$)/.test(document.body.className),
   
   
  // Get a specific, localized string
  // Get a specific, localized string
Line 224: Line 226:
  dbName = mw.config.get( 'wgDBname' ),
  dbName = mw.config.get( 'wgDBname' ),
   
   
language = '', site = '', awt="0", rtl = /(^|\s)rtl(\s|$)/.test(document.body.className),
  iframe = { div: null, iframe: null, closebutton: null, resizebutton: null, resizehelper: null, indom: false },
  iframe = { div: null, iframe: null, closebutton: null, resizebutton: null, resizehelper: null, indom: false },
   
   
Line 366: Line 367:
  if( wc.enabled === false ) { return; }
  if( wc.enabled === false ) { return; }


  site = ( dbName == "commonswiki" ) ? "commons" : mw.config.get( 'wgPageContentLanguage' );
  site = ( dbName==="commonswiki" ) ? "commons" : mw.config.get( 'wgPageContentLanguage' );
  language = mw.config.get( 'wgUserLanguage' );
  language = mw.config.get( 'wgUserLanguage' );


Line 435: Line 436:
   .css('padding', rtl ? '0px 0px 0px 3px' : '0px 3px 0px 0px' ).css('cursor', 'pointer');
   .css('padding', rtl ? '0px 0px 0px 3px' : '0px 3px 0px 0px' ).css('cursor', 'pointer');


   if( wc.alwaysTooltips || ( wc.flowTextTooltips && $(link).parents('li, table, #coordinates').length == 0 ) ) {
   if( wc.alwaysTooltips || ( wc.flowTextTooltips && $(link).parents('li, table, #coordinates').length===0 ) ) {
   // insert tooltip rather than icon to improve text readability
   // insert tooltip rather than icon to improve text readability
   mapbutton = $('<span>').append(mapbutton).append("&nbsp;WikiMiniAtlas").css('cursor','pointer');
   mapbutton = $('<span>').append(mapbutton).append("&nbsp;WikiMiniAtlas").css('cursor','pointer');
Line 572: Line 573:


     // insert blue globe
     // insert blue globe
     if( coord_list.length == 0 || ( !$('#coordinates').find('.wmamapbutton').length) ) {
     if (coord_list.length===0 || (!$('#coordinates').find('.wmamapbutton').length)) {
       // determine center
       // determine center
       alat = (la1+la2)/2;
       alat = (la1+la2)/2;
Line 595: Line 596:
  // detect "All Coordinates"
  // detect "All Coordinates"
  links = $('#coordinates>span>a');
  links = $('#coordinates>span>a');
  if( links.length>0 && links[0].href.substr(0,50) == "http://www.lenz-online.de/cgi-bin/wiki/wiki-osm.pl" ) {
  if (links.length>0 && links[0].href.substr(0,50)==="http://www.lenz-online.de/cgi-bin/wiki/wiki-osm.pl") {
   addTitleButton( 0, 0, 1 );
   addTitleButton( 0, 0, 1 );
   coordinates = true;
   coordinates = true;