Skip to content

Commit

Permalink
post merge cleanup
Browse files Browse the repository at this point in the history
fixed whitespace inconsistencies
@dash1291 - please take care with whitespace
use tabs rather than spaces
  • Loading branch information
jdlrobson committed Apr 16, 2012
1 parent ddc1346 commit ea4c281
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 83 deletions.
16 changes: 8 additions & 8 deletions assets/www/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -334,17 +334,17 @@ button#search
background: -moz-linear-gradient(#5F5F5F 0%, #4F4F4F 100%);
background: -ms-linear-gradient(#5F5F5F 0%, #4F4F4F 100%);
padding: 5px;
height:35px;
position: absolute;
bottom: 0px;
height:35px;
position: absolute;
bottom: 0px;
}

.nearby-view-switch button {
background-color: inherit;
border: none;
color: white;
margin-left: 30%;
width: 200px;
background-color: inherit;
border: none;
color: white;
margin-left: 30%;
width: 200px;
}

.titlebar > div:first-child {
Expand Down
50 changes: 25 additions & 25 deletions assets/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,16 @@
</div>
{{/languages}}
</script>
<script type="text/html" id="articles-list-template">
{{#geonames}}
<div class="listItemContainer" data-page-url="{{url}}" data-page-title="{{title}}">
<a class="listItem articleLink">
<span class="text">{{title}}</span>
</a>
</div>
{{/geonames}}
</script>

<script type="text/html" id="articles-list-template">
{{#geonames}}
<div class="listItemContainer" data-page-url="{{url}}" data-page-title="{{title}}">
<a class="listItem articleLink">
<span class="text">{{title}}</span>
</a>
</div>
{{/geonames}}
</script>
</div>

<header id="mainHeader">
Expand Down Expand Up @@ -263,21 +263,21 @@
</div>
</header>
<div id="map-container">
<div id="map"></div>
<div class="nearby-view-switch">
<button class="switch-view" id="switch-to-list" title-msg="switch-to-list">
<msg key="switch-to-list">Switch to list</msg>
</button>
</div>
</div>
<div id="articles-list-container">
<div id="articles-list"></div>
<div class="nearby-view-switch">
<button class="switch-view" id="switch-to-map" title-msg="switch-to-map">
<msg key="switch-to-map">Switch to map</msg>
</button>
</div>
</div>
<div id="map"></div>
<div class="nearby-view-switch">
<button class="switch-view" id="switch-to-list" title-msg="switch-to-list">
<msg key="switch-to-list">Switch to list</msg>
</button>
</div>
</div>
<div id="articles-list-container">
<div id="articles-list"></div>
<div class="nearby-view-switch">
<button class="switch-view" id="switch-to-map" title-msg="switch-to-map">
<msg key="switch-to-map">Switch to map</msg>
</button>
</div>
</div>
</div>

<menu id="appMenu" type="context">
Expand Down
63 changes: 31 additions & 32 deletions assets/www/js/chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,32 +133,31 @@ window.chrome = function() {
});

$(".closeButton").bind('click', function() {
if( geo.mapView ) {
showContent();
}
else {
$( "#switch-to-map" ).click();
}
});

function nearbyViewInit() {
geo.mapView = true;
$( "#articles-list-container" ).hide();
$( "#switch-to-map" ).bind('click', function() {
resetNearbyView();
$( "#map-container").show();
$( "#articles-list-container").hide();
geo.mapView = true;
});

$( "#switch-to-list" ).bind('click', function() {
resetNearbyView();
$( "#articles-list-container").show();
$( "#map-container" ).hide();
geo.mapView = false;
});
}
nearbyViewInit();
if( geo.mapView ) {
showContent();
} else {
$( "#switch-to-map" ).click();
}
});
function nearbyViewInit() {
geo.mapView = true;
$( "#articles-list-container" ).hide();
$( "#switch-to-map" ).bind('click', function() {
resetNearbyView();
$( "#map-container").show();
$( "#articles-list-container").hide();
geo.mapView = true;
});

$( "#switch-to-list" ).bind('click', function() {
resetNearbyView();
$( "#articles-list-container").show();
$( "#map-container" ).hide();
geo.mapView = false;
});
}

nearbyViewInit();
initContentLinkHandlers();
chrome.loadFirstPage();
doFocusHack();
Expand Down Expand Up @@ -214,12 +213,12 @@ window.chrome = function() {
}
}

function resetNearbyView() {
chrome.hideOverlays();
chrome.hideContent();
$("#nearby-overlay").localize().show();
chrome.doFocusHack();
}
function resetNearbyView() {
chrome.hideOverlays();
chrome.hideContent();
$("#nearby-overlay").localize().show();
chrome.doFocusHack();
}

function showNoConnectionMessage() {
alert(mw.message('error-offline-prompt'));
Expand Down
37 changes: 19 additions & 18 deletions assets/www/js/geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ window.geo = function() {
geo.map.attributionControl.addAttribution("<br />" + mw.message("attribution-osm"));

}

// @fixme load last-seen coordinates
geo.map.setView(new L.LatLng(args.lat, args.lon), 18);

var findAndDisplayNearby = function( lat, lon ) {
geoLookup( lat, lon, preferencesDB.get("language"), function( data ) {
geoAddMarkers( data );
populateArticlesList( data );
populateArticlesList( data );
}, function(err) {
console.log(JSON.stringify(err));
});
Expand Down Expand Up @@ -79,32 +80,32 @@ window.geo = function() {
function addShowNearbyLinks() {
$( 'span.geo-dms' ).each( function() {
var $coords = $( this ),
lat = $coords.find( 'span.latitude' ).text(),
lon = $coords.find( 'span.longitude' ).text();
lat = $coords.find( 'span.latitude' ).text(),
lon = $coords.find( 'span.longitude' ).text();

$coords.closest( 'a' ).attr( 'href', '#' ).click( function() {
showNearbyArticles( {
'lat': getFloatFromDMS( lat ),
'lon': getFloatFromDMS( lon ),
'current': false,
} );
} );
} );
} );
}

function populateArticlesList( data ) {
$.each(data.geonames, function(i, item) {
item.url = item.wikipediaUrl.replace(/^([a-z0-9-]+)\.wikipedia\.org/, 'https://$1.m.wikipedia.org');
});
var template = templates.getTemplate('articles-list-template');
var html = template.render(data);
$("#articles-list").html(html);
$(".articleLink").click(function() {
var parent = $(this).parents(".listItemContainer");
var url = parent.attr("data-page-url");
app.navigateToPage(url);
});
}
function populateArticlesList( data ) {
$.each(data.geonames, function(i, item) {
item.url = item.wikipediaUrl.replace(/^([a-z0-9-]+)\.wikipedia\.org/, 'https://$1.m.wikipedia.org');
});
var template = templates.getTemplate('articles-list-template');
var html = template.render(data);
$("#articles-list").html(html);
$(".articleLink").click(function() {
var parent = $(this).parents(".listItemContainer");
var url = parent.attr("data-page-url");
app.navigateToPage(url);
});
}


function geoLookup(latitude, longitude, lang, success, error) {
Expand Down Expand Up @@ -142,7 +143,7 @@ window.geo = function() {
}

return {
populateArticlesList: populateArticlesList,
populateArticlesList: populateArticlesList,
showNearbyArticles: showNearbyArticles,
addShowNearbyLinks: addShowNearbyLinks,
map: null
Expand Down

0 comments on commit ea4c281

Please sign in to comment.