User:Novem Linguae/Scripts/VisualEditorEverywhere.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | This user script seems to have a documentation page at User:Novem Linguae/Scripts/VisualEditorEverywhere. |
// <nowiki>
// TODO: fix the race condition. still present as of 08/31/22. got it when clicking from WT:NPPC to WP:NPPC. not consistently reproducible. use mw.hook( 've.activationComplete' )? list of VE hooks: https://codesearch.wmcloud.org/deployed/?q=mw%5C.hook.*%5C.fire&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FVisualEditor
// TODO: add support for [edit] links in diffs
// in Visual Editor, the display:none CSS is at https://gerrit.wikimedia.org/g/mediawiki/extensions/VisualEditor/+/5a792b6558060de5ba8d6bbb231048a37c54a576/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.noscript.less#18
// simply add display:inline at a higher specificity. this will keep it turned on all the time
mw.util.addCSS( `
.client-nojs,
.ve-not-available {
#ca-ve-edit,
.mw-editsection-divider,
.mw-editsection-visualeditor {
display: inline;
}
}
` );
// </nowiki>