You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CiteHighlighter: highlight citations in edit previews & diffs
- highlight citations in edit previews more accurately
- highlight citations in Special:Undelete previews
- highlight citations in diffs
- highlight citations in old revisions
fixes#252 (I think it was this code change, not sure though)
fixes#108
// Note: Any wikicode containing a lot of domain names included in CiteHighlighter will be slow, unless added to isSlowPage(). This is because addHTMLClassesToRefs() checks the wikicode before trying to add classes to CSS.
30
37
this.addHTMLClassesToRefs();
31
38
this.addHTMLClassesForUnreliableWords();
32
39
this.observeAndAddClassesToTooltips();
33
40
}
34
41
42
+
asyncgetWikicodeVariable(){
43
+
// Is it a preview page or a regular page? This will determine where we get our wikicode from. A preview page will contain both parser output and a textarea.
// Fire after wiki content is added to the DOM, such as when first loading a page, or when a gadget such as the XTools gadget loads.
412
-
mw.hook('wikipage.content').add(async()=>{
422
+
asyncfunctionexecuteCiteHighlighter(){
413
423
awaitmw.loader.using(
414
424
['mediawiki.util','mediawiki.api'],
415
425
async()=>{
416
426
await(newCiteHighlighter(window,$,mw)).execute();
417
427
}
418
428
);
419
-
});
429
+
}
430
+
431
+
// Fire after wiki content is added to the DOM, such as when first loading a page, when loading a diff, or when a gadget such as the XTools gadget loads.
0 commit comments