1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-04 12:38:31 -04:00

default apps: add configuration for geo: URIs

port: 1.5
(cherry picked from commit d0a4c1c56e)
This commit is contained in:
bbedward
2026-07-09 12:23:13 -04:00
committed by dms-ci[bot]
parent 6d08b91004
commit e84e63fa3a
2 changed files with 20 additions and 4 deletions
@@ -18,15 +18,21 @@ Item {
readonly property bool _descriptionIsHtml: /<[a-z][^>]*>/i.test((eventData && eventData.description) || "") readonly property bool _descriptionIsHtml: /<[a-z][^>]*>/i.test((eventData && eventData.description) || "")
// _locationUrl returns the location when it is nothing but a URL so the // _locationUrl makes the location row clickable: the location itself when
// row can open it; links inside a street address surface as meetingUrl. // it is a URL, the meeting link when the event has one (conference
// events carry placeholder locations like "Microsoft Teams Meeting"),
// otherwise a geo: search (RFC 5870) so addresses open in the maps app.
function _locationUrl() { function _locationUrl() {
const loc = ((eventData && eventData.location) || "").trim(); const loc = ((eventData && eventData.location) || "").trim();
if (loc === "")
return "";
if (/^https?:\/\/\S+$/i.test(loc)) if (/^https?:\/\/\S+$/i.test(loc))
return loc; return loc;
if (/^www\.\S+$/i.test(loc)) if (/^www\.\S+$/i.test(loc))
return "https://" + loc; return "https://" + loc;
return ""; if (eventData && eventData.meetingUrl)
return eventData.meetingUrl;
return "geo:0,0?q=" + encodeURIComponent(loc);
} }
function _styleAnchors(html) { function _styleAnchors(html) {
+11 -1
View File
@@ -19,7 +19,8 @@ Item {
PDFReader: 6, PDFReader: 6,
Mail: 7, Mail: 7,
Terminal: 8, Terminal: 8,
Calendar: 9 Calendar: 9,
Maps: 10
}) })
property string currentWebBrowserAppId: "" property string currentWebBrowserAppId: ""
@@ -32,6 +33,7 @@ Item {
property string currentMailAppId: "" property string currentMailAppId: ""
property string currentTerminalAppId: "" property string currentTerminalAppId: ""
property string currentCalendarAppId: "" property string currentCalendarAppId: ""
property string currentMapsAppId: ""
property var categoryModels: ({}) property var categoryModels: ({})
@@ -48,6 +50,7 @@ Item {
[root.appCategory.PDFReader]: ["application/pdf", "application/x-ext-pdf", "application/x-bzpdf", "application/x-gzpdf", "application/vnd.comicbook-rar", "application/vnd.comicbook+zip"], [root.appCategory.PDFReader]: ["application/pdf", "application/x-ext-pdf", "application/x-bzpdf", "application/x-gzpdf", "application/vnd.comicbook-rar", "application/vnd.comicbook+zip"],
[root.appCategory.Mail]: ["x-scheme-handler/mailto"], [root.appCategory.Mail]: ["x-scheme-handler/mailto"],
[root.appCategory.Calendar]: ["x-scheme-handler/calendar"], [root.appCategory.Calendar]: ["x-scheme-handler/calendar"],
[root.appCategory.Maps]: ["x-scheme-handler/geo"],
[root.appCategory.Terminal]: ["terminal"] // Special [root.appCategory.Terminal]: ["terminal"] // Special
}) })
@@ -280,6 +283,13 @@ Item {
tags: ["mail", "email"] tags: ["mail", "email"]
description: I18n.tr("Handles mailto links", "Handles mailto links") description: I18n.tr("Handles mailto links", "Handles mailto links")
} }
AppSelector {
text: I18n.tr("Maps", "Maps")
category: root.appCategory.Maps
tags: ["maps", "geo", "location"]
description: I18n.tr("Handles geo: location links", "Handles geo: location links")
}
} }
SettingsCard { SettingsCard {