Extension talk:PreToClip

About this board

button does not appear after you save page via VisualEditor

4
Urfiner (talkcontribs)
  1. Edit page via VE
  2. Save it
  3. Without reload -- hover on <pre> element
  4. Button does not appear

Smth like that should help:

Osnard (talkcontribs)

Nice, thank you! I'll create a patch.

Osnard (talkcontribs)
Urfiner (talkcontribs)

Thanks!

Reply to "button does not appear after you save page via VisualEditor"

height changes for one-liner pre elements

1
2A02:8304:47:1809:0:DC77:D353:159 (talkcontribs)

If pre element is one line only, this extension changes the height of the lement on hover event to fit the button


Would be cool to preserver the height even for one liners.

Reply to "height changes for one-liner pre elements"

extension not working in MW 1.40.0

5
213.233.108.192 (talkcontribs)

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)

217.133.38.27 (talkcontribs)

It does't work

Oetterer (talkcontribs)

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.

Oetterer (talkcontribs)
Osnard (talkcontribs)

I have merged and released this fix as version 1.0.5. @Oetterer Thanks for the contribution.

Reply to "extension not working in MW 1.40.0"
There are no older topics
Return to "PreToClip" page.