mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
default apps: add configuration for geo: URIs
port: 1.5
This commit is contained in:
@@ -18,15 +18,21 @@ Item {
|
||||
|
||||
readonly property bool _descriptionIsHtml: /<[a-z][^>]*>/i.test((eventData && eventData.description) || "")
|
||||
|
||||
// _locationUrl returns the location when it is nothing but a URL so the
|
||||
// row can open it; links inside a street address surface as meetingUrl.
|
||||
// _locationUrl makes the location row clickable: the location itself when
|
||||
// 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() {
|
||||
const loc = ((eventData && eventData.location) || "").trim();
|
||||
if (loc === "")
|
||||
return "";
|
||||
if (/^https?:\/\/\S+$/i.test(loc))
|
||||
return loc;
|
||||
if (/^www\.\S+$/i.test(loc))
|
||||
return "https://" + loc;
|
||||
return "";
|
||||
if (eventData && eventData.meetingUrl)
|
||||
return eventData.meetingUrl;
|
||||
return "geo:0,0?q=" + encodeURIComponent(loc);
|
||||
}
|
||||
|
||||
function _styleAnchors(html) {
|
||||
|
||||
@@ -19,7 +19,8 @@ Item {
|
||||
PDFReader: 6,
|
||||
Mail: 7,
|
||||
Terminal: 8,
|
||||
Calendar: 9
|
||||
Calendar: 9,
|
||||
Maps: 10
|
||||
})
|
||||
|
||||
property string currentWebBrowserAppId: ""
|
||||
@@ -32,6 +33,7 @@ Item {
|
||||
property string currentMailAppId: ""
|
||||
property string currentTerminalAppId: ""
|
||||
property string currentCalendarAppId: ""
|
||||
property string currentMapsAppId: ""
|
||||
|
||||
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.Mail]: ["x-scheme-handler/mailto"],
|
||||
[root.appCategory.Calendar]: ["x-scheme-handler/calendar"],
|
||||
[root.appCategory.Maps]: ["x-scheme-handler/geo"],
|
||||
[root.appCategory.Terminal]: ["terminal"] // Special
|
||||
})
|
||||
|
||||
@@ -280,6 +283,13 @@ Item {
|
||||
tags: ["mail", "email"]
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user