jenkins-bot has submitted this change and it was merged.

Change subject: Don't hardcode magic link URLs
......................................................................


Don't hardcode magic link URLs

These are actually configurable via MediaWiki messages, so use those
instead of hardcoding the default URLs.

Change-Id: Ie66a1b53f9c011947fe9e8db198a5904373f3192
---
M extension.json
M modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js
2 files changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Esanders: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index efcc68f..c32e16a 100644
--- a/extension.json
+++ b/extension.json
@@ -1457,7 +1457,9 @@
                                
"visualeditor-magiclinknodeinspector-convert-link",
                                
"visualeditor-magiclinknodeinspector-title-isbn",
                                
"visualeditor-magiclinknodeinspector-title-pmid",
-                               "visualeditor-magiclinknodeinspector-title-rfc"
+                               "visualeditor-magiclinknodeinspector-title-rfc",
+                               "rfcurl",
+                               "pubmedurl"
                        ],
                        "targets": [
                                "desktop",
diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js 
b/modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js
index 8b6b3cd..e63fdf7 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js
@@ -386,7 +386,7 @@
 OO.inheritClass( ve.dm.MWMagicLinkPmidType, ve.dm.MWMagicLinkType );
 
 ve.dm.MWMagicLinkPmidType.prototype.getHref = function () {
-       return '//www.ncbi.nlm.nih.gov/pubmed/' + this.code + '?dopt=Abstract';
+       return mw.msg( 'pubmedurl', this.code );
 };
 
 /**
@@ -407,7 +407,7 @@
 OO.inheritClass( ve.dm.MWMagicLinkRfcType, ve.dm.MWMagicLinkType );
 
 ve.dm.MWMagicLinkRfcType.prototype.getHref = function () {
-       return '//tools.ietf.org/html/rfc' + this.code;
+       return mw.msg( 'rfcurl', this.code );
 };
 
 /* Registration */

-- 
To view, visit https://gerrit.wikimedia.org/r/316200
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie66a1b53f9c011947fe9e8db198a5904373f3192
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Alex Monk <a...@wikimedia.org>
Gerrit-Reviewer: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to