Skip to content

Commit

Permalink
🚸 Add an option to append the custom area to the permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ENT8R committed Feb 22, 2024
1 parent 534ee8d commit 781b106
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
10 changes: 8 additions & 2 deletions app/js/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,17 @@ export default class Query {
delete data.order;

// Shapes of countries does not need to be included if the list of selected countries is already known
if (data.countries !== '') {
if (data.countries !== null) {
delete data.polygon;
}

if (!document.getElementById('show-map').checked) {
// Remove the selected shape if the user does not want to add it
if (!document.getElementById('share-polygon').checked) {
delete data.polygon;
}

// Remove the current position of the map if the user does not want to add it
if (!document.getElementById('share-map').checked) {
delete data.map;
}

Expand Down
3 changes: 2 additions & 1 deletion app/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
},
"author": "The author is the user who created the note",
"user": "A user is any user who left a comment on the note\n(including the author)",
"customArea": "Select countries by clicking on them or draw a custom shape using the toolbar on the left"
"customArea": "Select countries by clicking on them or draw a custom shape using the toolbar on the left",
"sharePolygon": "Share shape for custom area selection (may be unreadable)"
},
"settings": {
"choose": "Choose an option",
Expand Down
8 changes: 7 additions & 1 deletion app/templates/modals/share.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@

<div class="form-group">
<label class="form-checkbox">
<input type="checkbox" class="update-permalink" id="show-map">
<input type="checkbox" class="update-permalink" id="share-map">
<i class="form-icon"></i>
<span data-i18n="description.shareView">Share current view of the map</span>
</label>

<label class="form-checkbox">
<input type="checkbox" class="update-permalink" id="share-polygon">
<i class="form-icon"></i>
<span data-i18n="description.sharePolygon">Share shape for custom area selection (may be unreadable)</span>
</label>
</div>
</div>

Expand Down

0 comments on commit 781b106

Please sign in to comment.