From 42994efa9debccfad5949afc09d17347ccec8e45 Mon Sep 17 00:00:00 2001 From: chrisi51 Date: Thu, 4 Mar 2021 16:30:06 +0100 Subject: [PATCH 1/7] Added real autolinking and simpler adding of new url schemes to add additional URL Schemes just put your scheme to urlschemes --- packages/markdown/src/template-integration.js | 39 +++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/packages/markdown/src/template-integration.js b/packages/markdown/src/template-integration.js index 464d0d765..30074d777 100755 --- a/packages/markdown/src/template-integration.js +++ b/packages/markdown/src/template-integration.js @@ -6,23 +6,40 @@ var Markdown = require('markdown-it')({ breaks: true, }); + +// Static URL Scheme Listing +var urlschemes = [ + "aodroplink", + "thunderlink", + "cbthunderlink", + "onenote", + "file", + "abasurl", + "conisio", + "mailspring" +]; + +// Better would be a field in the admin backend to set this dynamically +// instead of putting all known or wanted url schemes here hard into code +// but i was not able to access those settings +// var urlschemes = currentSetting.automaticLinkedUrlSchemes.split('\n'); + +// put all url schemes into the linkify configuration to automatically make it clickable +for(var i=0; i Date: Thu, 4 Mar 2021 16:36:48 +0100 Subject: [PATCH 2/7] add automaticLinkedUrlSchemes --- client/components/settings/settingBody.jade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/components/settings/settingBody.jade b/client/components/settings/settingBody.jade index 80677f0f6..84d7a1b18 100644 --- a/client/components/settings/settingBody.jade +++ b/client/components/settings/settingBody.jade @@ -211,6 +211,10 @@ template(name='layoutSettings') .title {{_ 'custom-top-left-corner-logo-height'}} .form-group input.wekan-form-control#custom-top-left-corner-logo-height(type="text", placeholder="" value="{{currentSetting.customTopLeftCornerLogoHeight}}") + li.layout-form + .title {{_ 'automatic-linked-url-schemes'}} + .form-group + textarea#automatic-linked-url-schemes.wekan-form-control= currentSetting.automaticLinkedUrlSchemes li button.js-save-layout.primary {{_ 'save'}} From c1f52a5e5a509b98e3e5bce459a37a37853e026c Mon Sep 17 00:00:00 2001 From: Christian Hillebrand Date: Thu, 4 Mar 2021 16:38:47 +0100 Subject: [PATCH 3/7] add automaticLinkedUrlSchemes --- client/components/settings/settingBody.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 4708f70f7..68126589e 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -176,6 +176,9 @@ BlazeComponent.extendComponent({ const textBelowCustomLoginLogo = $('#text-below-custom-login-logo') .val() .trim(); + const automaticLinkedUrlSchemes = $('#automatic-linked-url-schemes') + .val() + .trim(); const customTopLeftCornerLogoImageUrl = $( '#custom-top-left-corner-logo-image-url', ) @@ -209,6 +212,7 @@ BlazeComponent.extendComponent({ customTopLeftCornerLogoHeight, displayAuthenticationMethod, defaultAuthenticationMethod, + automaticLinkedUrlSchemes, }, }); } catch (e) { From bc2556139a023df9c12b15568d6a5827b4c364c5 Mon Sep 17 00:00:00 2001 From: Christian Hillebrand Date: Thu, 4 Mar 2021 16:40:03 +0100 Subject: [PATCH 4/7] add automaticLinkedUrlSchemes --- models/settings.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/settings.js b/models/settings.js index 6aecddb5a..58f145199 100644 --- a/models/settings.js +++ b/models/settings.js @@ -62,6 +62,10 @@ Settings.attachSchema( type: String, optional: true, }, + automaticLinkedUrlScheme: { + type: String, + optional: true, + }, customTopLeftCornerLogoImageUrl: { type: String, optional: true, From 0f75234ed266f0b5b876d7414e583d8c45616b19 Mon Sep 17 00:00:00 2001 From: Christian Hillebrand Date: Thu, 4 Mar 2021 16:42:35 +0100 Subject: [PATCH 5/7] add automaticLinkedUrlSchemes --- server/publications/settings.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/publications/settings.js b/server/publications/settings.js index 877ca6096..829824dba 100644 --- a/server/publications/settings.js +++ b/server/publications/settings.js @@ -15,6 +15,7 @@ Meteor.publish('setting', () => { customLoginLogoImageUrl: 1, customLoginLogoLinkUrl: 1, textBelowCustomLoginLogo: 1, + automaticLinkedUrlSchemes: 1, customTopLeftCornerLogoImageUrl: 1, customTopLeftCornerLogoLinkUrl: 1, customTopLeftCornerLogoHeight: 1, From 0f4a97f3a602e74f4b2a894ec77d4ae32d8f38f0 Mon Sep 17 00:00:00 2001 From: Christian Hillebrand Date: Thu, 4 Mar 2021 16:45:16 +0100 Subject: [PATCH 6/7] add automatic-linked-url-schemes --- i18n/en.i18n.json | 1 + 1 file changed, 1 insertion(+) diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json index 0d435439e..7420018b8 100644 --- a/i18n/en.i18n.json +++ b/i18n/en.i18n.json @@ -532,6 +532,7 @@ "custom-login-logo-image-url": "Custom Login Logo Image URL", "custom-login-logo-link-url": "Custom Login Logo Link URL", "text-below-custom-login-logo": "Text below Custom Login Logo", + "automatic-linked-url-schemes": "Custom URL Schemes which should automatically be clickable. One URL Scheme per line", "username": "Username", "import-usernames": "Import Usernames", "view-it": "View it", From 28582b7e774c7f86cca6f95021d32e23d0555b0c Mon Sep 17 00:00:00 2001 From: Christian Hillebrand Date: Thu, 4 Mar 2021 17:04:29 +0100 Subject: [PATCH 7/7] correction of a typo --- models/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/settings.js b/models/settings.js index 58f145199..db69644fb 100644 --- a/models/settings.js +++ b/models/settings.js @@ -62,7 +62,7 @@ Settings.attachSchema( type: String, optional: true, }, - automaticLinkedUrlScheme: { + automaticLinkedUrlSchemes: { type: String, optional: true, },