Jump to content

Extension talk:PreToClip/Flow

About this board

Double end line characters

4
79.116.74.254 (talkcontribs)

Hi

Using MW 1.42.3, the copied source code gets a double "end line characters" for every line.

For example

line 1
line 2
line 3

line 4

gets copied as

line 1

line 2

line 3



line 4

79.116.74.254 (talkcontribs)

To add some more detail, the result is the same when the destination file is either Linux format or Windows format

Osnard (talkcontribs)
Osnard (talkcontribs)

Or maybe better remove "carriage returns"

var clipboardText = pre.innerText.replace(/\r/gm, "");
Reply to "Double end line characters"

height changes for one-liner pre elements

2
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.

95.80.245.74 (talkcontribs)

I also agree that this would be a nice change, changing the css for the whole Wiki for pre elements to include min-height property might be a workaround.

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

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"

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