From 2e93bfe7b72c4afe21a1c3abe548cb20ecc5a8df Mon Sep 17 00:00:00 2001 From: Franzz Date: Mon, 24 May 2021 18:49:44 +0200 Subject: [PATCH] Remove deprecated empty project detection --- inc/spot.php | 7 ++----- masks/project.html | 10 +++++----- readme.md | 3 ++- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/inc/spot.php b/inc/spot.php index f62acfb..7c84643 100755 --- a/inc/spot.php +++ b/inc/spot.php @@ -245,8 +245,6 @@ class Spot extends Main public function getMarkers() { $asMessages = $this->getSpotMessages(); - $bEmptyProject = empty($this->getMedias('posted_on') + $asMessages + $this->getPosts()); - $sDesc = ''; //Add medias if(!empty($asMessages)) { @@ -274,11 +272,10 @@ class Spot extends Main $asLastUpdate = array(); $this->addTimeStamp($asLastUpdate, $this->oProject->getLastUpdate()); - return self::getJsonResult(true, $sDesc, array( + return self::getJsonResult(true, '', array( 'messages' => $asMessages, 'maps' => $this->oProject->getMaps(), - 'last_update' => $asLastUpdate, - 'empty_project' => $bEmptyProject + 'last_update' => $asLastUpdate )); } diff --git a/masks/project.html b/masks/project.html index 9507dc5..54492f7 100644 --- a/masks/project.html +++ b/masks/project.html @@ -222,7 +222,7 @@ function initProject(sProjectCodeName, oFocusPost){ ).done(function(aoMessages, aoTracks) { var asData = aoMessages[0]['data']; setMapLayers(asData['maps']); - initSpotMessages(asData['messages'] || [], aoTracks[0], asData['empty_project']); + initSpotMessages(asData['messages'], aoTracks[0]); updateSettingsPanel(asData['last_update']); }); @@ -359,7 +359,7 @@ function setMapLayers(asLayers) { }); } -function initSpotMessages(aoMessages, aoTracks, bNoFeed) { +function initSpotMessages(aoMessages, aoTracks) { //Map var oMap = L.map(self.tmp('$Map')[0], { layers: [oSpot.tmp('layers')[oSpot.lang('map_satellite')]], @@ -546,7 +546,7 @@ function initSpotMessages(aoMessages, aoTracks, bNoFeed) { }).addTo(oMap)); //Centering map - var bWithFeedPanel = (!bNoFeed && !isMobile()); + var iPanelWidth = isMobile()?0:parseInt(self.tmp('$Feed').outerWidth(true)); if( self.vars(['project', 'mode']) == self.consts.modes.blog && aoMessages.length > 0 && @@ -555,9 +555,9 @@ function initSpotMessages(aoMessages, aoTracks, bNoFeed) { //Zoom on last message var oLastMsg = aoMessages[aoMessages.length-1]; oMap.setView(L.latLng(oLastMsg.latitude, oLastMsg.longitude), 15); - oMap.panBy([(bWithFeedPanel?1:0)*self.tmp('$Feed').outerWidth(true)/2, 0]); + oMap.panBy([iPanelWidth/2, 0]); } - else oMap.fitBounds(self.tmp('track').getBounds(), {paddingTopLeft: L.point(5, self.tmp('marker_size').height + 5), paddingBottomRight: L.point(5 + parseInt(bWithFeedPanel?self.tmp('$Feed').outerWidth(true):0), 5)}); + else oMap.fitBounds(self.tmp('track').getBounds(), {paddingTopLeft: L.point(5, self.tmp('marker_size').height + 5), paddingBottomRight: L.point(5 + iPanelWidth, 5)}); //Spot Messages $.each(aoMessages, function(iKey, oMsg){ diff --git a/readme.md b/readme.md index 156931e..c5d2830 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,8 @@ ## Getting started 1. Clone Git onto web server 2. Copy settings-sample.php to settings.php and populate -3. Go to #admin and create a new project +3. Go to #admin and create a new project & feed +4. Add a GPX file named .gpx to /geo/ ## To Do List * ECMA import/export * Reset zoom on image closing (lightbox)