Hello and thank you for this wonderful extension. However, on my MW 1.40.0 website it doesn't really work. It's rather strange – it is always visible and functional when previewing pages with PRE tags, and also visible right after submitting the edit. In any other circumstances, the pageloader merely ignores it – there is no HTML of it in the code. Any idea ? I've tried both the 1.39 (not at al functional) and master version. Thank you, 213.233.108.192 08:12, 20 October 2023 (UTC)
Topic on Extension talk:PreToClip/Flow
Appearance
It does't work
I have the same problem, using MW1_39. The copy button does only appear right after an edit. On subsequent page calls, no buttons are shown. A look in the javascript console showed the following error:
Uncaught ReferenceError: OO is not defined createPreToClipButton https://<host>/extensions/PreToClip/resources/ext.preToClip.js?4b2c4:23 <anonymous> https://<host>/extensions/PreToClip/resources/ext.preToClip.js?4b2c4:11 <anonymous> https://<host>/extensions/PreToClip/resources/ext.preToClip.js?4b2c4:42 ext.preToClip.js:23:20
After getting a little bit aquainted with the OOUI Library I added a line to the extension's extension.json
:
{
"ResourceModules": {
"ext.preToClip": {
"localBasePath": "resources",
"remoteExtPath": "PreToClip/resources",
"scripts": [
"ext.preToClip.js"
],
"styles": [
"ext.preToClip.css"
],
"dependencies": [
"mediawiki.ui.button",
"oojs-ui-core",
"oojs-ui.styles.icons-editing-advanced"
],
"messages": [
"pretoclip-button-tooltip",
"pretoclip-button-notification-text"
]
}
}
}
And now it works fine.
PS: I would like to have submitted a gerrit patch, alas I'm a github user and digging into gerrit-manuals was too much a strain on my time. Sorry.
Ok, took the time (what else is there to do). Here is the link to the patch: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PreToClip/+/968990
Would be nice, if you could backport this patch into branch REL1_39.
I have merged and released this fix as version 1.0.5. @Oetterer Thanks for the contribution.