Skip to content
This repository has been archived by the owner on Nov 27, 2021. It is now read-only.

Commit

Permalink
Merge pull request #161 from wwwouaiebe/v2.3.0-dev
Browse files Browse the repository at this point in the history
V2.3.0 dev
  • Loading branch information
wwwouaiebe authored May 1, 2021
2 parents 93791b6 + 0022977 commit a98f266
Show file tree
Hide file tree
Showing 51 changed files with 622 additions and 434 deletions.
2 changes: 1 addition & 1 deletion buildNumber.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "buildNumber" : "00825"}
{ "buildNumber" : "00077"}
18 changes: 9 additions & 9 deletions dist/TravelNotes.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/TravelNotesProviders/GraphHopperRouteProvider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/TravelNotesProviders/MapboxRouteProvider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/TravelNotesProviders/MapzenValhallaRouteProvider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/TravelNotesProviders/OSRMRouteProvider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/TravelNotesProviders/PolylineRouteProvider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/TravelNotesProviders/PublicTransportRouteProvider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/TravelNotesRoadbook.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<body id='TravelNotes-Top'>
<div id="TravelNotes-Roadbook-Menu">
<div id='TravelNotes-Roadbook-GoTop'><a href='#TravelNotes-Top'>&#x1f53a;</a></div>
<div><input type="checkbox" checked id="TravelNotes-Travel-ShowNotes" /> <label id="TravelNotes-Travel-ShowNotesLabel" for="TravelNotes-Travel-ShowNotes">Notes du voyage</label></div>
<div><input type="checkbox" id="TravelNotes-Travel-ShowNotes" /> <label id="TravelNotes-Travel-ShowNotesLabel" for="TravelNotes-Travel-ShowNotes">Notes du voyage</label></div>
<div><input type="checkbox" id="TravelNotes-Routes-ShowManeuvers" /> <label id="TravelNotes-Routes-ShowManeuversLabel" for="TravelNotes-Routes-ShowManeuvers">Itinéraire</label></div>
<div><input type="checkbox" checked id="TravelNotes-Routes-ShowNotes" /> <label id="TravelNotes-Routes-ShowNotesLabel" for="TravelNotes-Routes-ShowNotes">Notes de l'itinéraire</label></div>
<div><input type="checkbox" id="TravelNotes-Routes-ShowNotes" /> <label id="TravelNotes-Routes-ShowNotesLabel" for="TravelNotes-Routes-ShowNotes">Notes de l'itinéraire</label></div>
</div>
<div id='TravelNotes'>
<div class="TravelNotes-Roadbook-Travel">Pour des raisons de sécurité liées à la configuration de votre navigateur, cette page ne peut pas être affichée (cookies désactivés).</div>
Expand Down
8 changes: 4 additions & 4 deletions dist/TravelNotesRoadbook.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="stylesheet" href="TravelNotes.min.css" />
</head>
<body>
<script src="leaflet/leaflet.js"></script><noscript id="noscript"><div id="TravelNotes-Noscript-Bike"><div id="TravelNotes-Noscript-BikeIcon"></div></div><div id="TravelNote-Noscript-Text">Oh oh. Javascript is not enabled. It's impossible to display this page without javascript.</div></noscript>
<script src="leaflet/leaflet.js"></script><noscript id="noscript"><div id="TravelNotes-Noscript-Bike"><div id="TravelNotes-Noscript-BikeIcon"></div></div><div id="TravelNote-Noscript-Text">Oh oh. Javascript is not enabled. It's impossible to display this map without javascript.</div></noscript>
<script src="TravelNotes.min.js"></script>
<script src="TravelNotesProviders/OpenRouteServiceRouteProvider.min.js"></script>
<script src="TravelNotesProviders/MapzenValhallaRouteProvider.min.js"></script>
Expand Down
10 changes: 5 additions & 5 deletions dist/viewer/TravelNotesViewer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="stylesheet" href="TravelNotesViewer.min.css" />
</head>
<body>
<script src="../leaflet/leaflet.js"></script><noscript id="noscript"><div id="TravelNotes-Noscript-Bike"><div id="TravelNotes-Noscript-BikeIcon"></div></div><div id="TravelNote-Noscript-Text">Oh oh. Javascript is not enabled. It's impossible to display this page without javascript.</div></noscript>
<script src="../leaflet/leaflet.js"></script><noscript id="noscript"><div id="TravelNotes-Noscript-Bike"><div id="TravelNotes-Noscript-BikeIcon"></div></div><div id="TravelNote-Noscript-Text">Oh oh. Javascript is not enabled. It's impossible to display this map without javascript.</div></noscript>
<script defer src="TravelNotesViewer.min.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "leaflet.travelnotes",
"version": "2.2.0",
"description": "Editable markers and routing engine for leaflet",
"version": "2.3.0",
"description": "A mapping and routing application.",
"main": "src/main/main.js",
"dependencies": {
"leaflet": "^1.7.1"
Expand Down
18 changes: 6 additions & 12 deletions src/UI/AttributionsUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Tests ...
import { theHTMLElementsFactory } from '../util/HTMLElementsFactory.js';
import { theHTMLSanitizer } from '../util/HTMLSanitizer.js';

let ourAttributionsDiv = null;

/**
@------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -74,13 +76,7 @@ class AttributionsUI {
*/

createUI ( ) {
theHTMLElementsFactory.create (
'div',
{
id : 'TravelNotes-AttributionsUI'
},
document.querySelector ( 'body' )
);
ourAttributionsDiv = theHTMLElementsFactory.create ( 'div', { id : 'TravelNotes-AttributionsUI' }, document.body );
this.attributions = '';
}

Expand All @@ -97,12 +93,10 @@ class AttributionsUI {
'| © <a href="https://github.com/wwwouaiebe" target="_blank" ' +
'title="https://github.com/wwwouaiebe">Travel & Notes</a>';

let attributionsDiv = document.getElementById ( 'TravelNotes-AttributionsUI' );
while ( attributionsDiv.firstChild ) {
attributionsDiv.removeChild ( attributionsDiv.firstChild );
while ( ourAttributionsDiv.firstChild ) {
ourAttributionsDiv.removeChild ( ourAttributionsDiv.firstChild );
}

theHTMLSanitizer.sanitizeToHtmlElement ( attributionsString, attributionsDiv );
theHTMLSanitizer.sanitizeToHtmlElement ( attributionsString, ourAttributionsDiv );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/UI/ErrorsUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class ErrorsUI {
id : 'TravelNotes-ErrorsUI',
className : 'TravelNotes-ErrorsUI-Hidden'
},
document.querySelector ( 'body' )
document.body
);
}

Expand Down
8 changes: 1 addition & 7 deletions src/UI/LayersToolbarUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,7 @@ class LayersToolbarUI {
*/

createUI ( ) {
ourLayersToolbar = theHTMLElementsFactory.create (
'div',
{
id : 'TravelNotes-LayersToolbarUI'
},
document.querySelector ( 'body' )
);
ourLayersToolbar = theHTMLElementsFactory.create ( 'div', { id : 'TravelNotes-LayersToolbarUI' }, document.body );
theHTMLElementsFactory.create (
'div',
{
Expand Down
8 changes: 1 addition & 7 deletions src/UI/MouseUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,7 @@ class MouseUI {
theHTMLElementsFactory.create (
'span',
null,
theHTMLElementsFactory.create (
'div',
{
id : 'TravelNotes-MouseUI'
},
document.querySelector ( 'body' )
)
theHTMLElementsFactory.create ( 'div', { id : 'TravelNotes-MouseUI' }, document.body )
);
theTravelNotesData.map.on ( 'mousemove', ourOnMapMouseMove );
theTravelNotesData.map.on ( 'zoomend', ourOnMapZoomEnd );
Expand Down
7 changes: 3 additions & 4 deletions src/UI/ProvidersToolbarUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function ourSetTransitMode ( transitMode ) {
if ( activeTransitModeButton ) {
activeTransitModeButton.classList.remove ( 'TravelNotes-ProvidersToolbarUI-ActiveTransitModeImgButton' );
}
document.getElementById ( 'TravelNotes-ProvidersToolbarUI-' + transitMode + 'ImgButton' )
document.querySelector ( '#TravelNotes-ProvidersToolbarUI-' + transitMode + 'ImgButton' )
.classList.add ( 'TravelNotes-ProvidersToolbarUI-ActiveTransitModeImgButton' );
}

Expand Down Expand Up @@ -175,12 +175,11 @@ function ourOnTransitModeButtonClick ( clickEvent ) {

function ourSetProvider ( providerName ) {
theTravelNotesData.routing.provider = providerName;
let activeProviderButton =
document.querySelector ( '.TravelNotes-ProvidersToolbarUI-ActiveProviderImgButton' );
let activeProviderButton = document.querySelector ( '.TravelNotes-ProvidersToolbarUI-ActiveProviderImgButton' );
if ( activeProviderButton ) {
activeProviderButton.classList.remove ( 'TravelNotes-ProvidersToolbarUI-ActiveProviderImgButton' );
}
document.getElementById ( 'TravelNotes-ProvidersToolbarUI-' + providerName + 'ImgButton' )
document.querySelector ( '#TravelNotes-ProvidersToolbarUI-' + providerName + 'ImgButton' )
.classList.add ( 'TravelNotes-ProvidersToolbarUI-ActiveProviderImgButton' );

// activating the transit mode buttons, depending of the capabilities of the provider
Expand Down
6 changes: 2 additions & 4 deletions src/UI/ViewerLayersToolbarUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,8 @@ class ViewerLayersToolbarUI {
createUI ( ) {
ourLayersToolbar = theHTMLElementsFactory.create (
'div',
{
id : 'TravelNotes-ViewerLayersToolbarUI'
},
document.querySelector ( 'body' )
{ id : 'TravelNotes-ViewerLayersToolbarUI' },
document.body
);

// Don't test the https protocol. On some mobile devices with an integreted GPS
Expand Down
37 changes: 6 additions & 31 deletions src/UI/WaitUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,43 +87,18 @@ function ourNewWaitUI ( ) {
*/

createUI ( ) {
if ( document.getElementById ( 'TravelNotes-WaitUI' ) ) {
if ( document.querySelector ( '#TravelNotes-WaitUI' ) ) {
return;
}
myBackgroundDiv = theHTMLElementsFactory.create (
'div',
{
className : 'TravelNotes-Background'
},
document.querySelector ( 'body' )
);
let waitDiv = theHTMLElementsFactory.create (
'div',
{
id : 'TravelNotes-WaitUI'
},
myBackgroundDiv
);
myMessageDiv = theHTMLElementsFactory.create (
'div',
{
id : 'TravelNotes-WaitUI-MessageDiv'
},
waitDiv
);
myBackgroundDiv = theHTMLElementsFactory.create ( 'div', { className : 'TravelNotes-Background' }, document.body );
let waitDiv = theHTMLElementsFactory.create ( 'div', { id : 'TravelNotes-WaitUI' }, myBackgroundDiv );
myMessageDiv = theHTMLElementsFactory.create ( 'div', { id : 'TravelNotes-WaitUI-MessageDiv' }, waitDiv );
theHTMLElementsFactory.create (
'div',
{
className : 'TravelNotes-WaitAnimationBullet'
},
theHTMLElementsFactory.create (
'div',
{
className : 'TravelNotes-WaitAnimation'
},
waitDiv
)
);
theHTMLElementsFactory.create ( 'div', { className : 'TravelNotes-WaitAnimation' }, waitDiv ) );
}

/**
Expand All @@ -140,7 +115,7 @@ function ourNewWaitUI ( ) {
*/

close ( ) {
document.querySelector ( 'body' ).removeChild ( myBackgroundDiv );
document.body.removeChild ( myBackgroundDiv );
myBackgroundDiv = null;
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/contextMenus/BaseContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,12 @@ function ourNewBaseContextMenu ( contextMenuEvent, menuItems, parentDiv ) {

function myMoveContainer ( ) {

let body = document.querySelector ( 'body' );

// a dummy div is created to find the screen width and height
let dummyDiv = theHTMLElementsFactory.create ( 'div', { className : 'TravelNotes-ContextMenu-DummyDiv' }, body );
let dummyDiv =
theHTMLElementsFactory.create ( 'div', { className : 'TravelNotes-ContextMenu-DummyDiv' }, document.body );
let screenWidth = dummyDiv.clientWidth;
let screenHeight = dummyDiv.clientHeight;
body.removeChild ( dummyDiv );
document.body.removeChild ( dummyDiv );

// the menu is positionned ( = top left where the user have clicked but the menu must be completely in the window...
let menuTop = Math.min (
Expand Down Expand Up @@ -467,7 +466,7 @@ function ourNewBaseContextMenu ( contextMenuEvent, menuItems, parentDiv ) {
ourMouseFocusIsOnItem = INVALID_OBJ_ID;
ourCurrentFocusItem = INVALID_OBJ_ID;
ourCloseButton = null;
ourParentDiv = parentDiv || document.querySelector ( 'body' );
ourParentDiv = parentDiv || document.body;
ourMenuItems = menuItems;

myBuildContainer ( );
Expand Down
Loading

0 comments on commit a98f266

Please sign in to comment.