Jump to content

User:Novem Linguae/Scripts/VisualEditorEverywhere.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Novem Linguae (talk | contribs) at 19:23, 23 June 2023 (rewrite). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// <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>