Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

post merge cleanup

fixed whitespace inconsistencies
@dash1291 - please take care with whitespace
use tabs rather than spaces
  • Loading branch information...
commit ea4c281c241cda31ff9b0ad78b9d3ce5173148c9 1 parent ddc1346
@jdlrobson authored
View
16 assets/www/app.css
@@ -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 {
View
50 assets/www/index.html
@@ -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">
@@ -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">
View
63 assets/www/js/chrome.js
@@ -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();
@@ -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'));
View
37 assets/www/js/geo.js
@@ -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));
});
@@ -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) {
@@ -142,7 +143,7 @@ window.geo = function() {
}
return {
- populateArticlesList: populateArticlesList,
+ populateArticlesList: populateArticlesList,
showNearbyArticles: showNearbyArticles,
addShowNearbyLinks: addShowNearbyLinks,
map: null
Please sign in to comment.
Something went wrong with that request. Please try again.