Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/222246

Change subject: Load ext.cite.style once the source article loaded
......................................................................

Load ext.cite.style once the source article loaded

This module is defined in Cite extension. So we cannot load
it unconditionally. Hence loading in a try-catch block.

Loading is delayed till the article is ready.

Testplan:
Configure cxserver to use RESTBase beta instance.
http://restbase-beta.wmflabs.org/@lang.wikipedia.beta.wmflabs.org/v1/page/html/@title
Restart cxserver and load any article from enwiki(beta labs).
For example: African linsang article.
Without the Cite extension, the references at the bottom of article will
look like
1. ↑ 1 2 3...
With Cite extension, the numbers after up-arrow will look like super scripts.

Bug: T99870

Change-Id: I7da47f5ce1c1df322e04fb86961a0e2795cced6e
---
M modules/source/ext.cx.source.js
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/46/222246/1

diff --git a/modules/source/ext.cx.source.js b/modules/source/ext.cx.source.js
index cda252c..d7efeea 100644
--- a/modules/source/ext.cx.source.js
+++ b/modules/source/ext.cx.source.js
@@ -153,6 +153,12 @@
                this.$content.find( 'base' ).detach();
 
                mw.hook( 'mw.cx.source.ready' ).fire();
+               // Try to load ext.cite.style module. If Cite extension is not 
present, this can fail.
+               try {
+                       mw.loader.using( 'ext.cite.style' );
+               } catch ( e ) {
+                       mw.log( 'Could not load ext.cite.style, References will 
fallback to default style' );
+               }
        };
 
        /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7da47f5ce1c1df322e04fb86961a0e2795cced6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

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

Reply via email to