I’ve been trying to customize the script in the lostwave’s finest wiki but i can’t seem to find how or where to customize it.
I’ve been trying to customize the script in the lostwave’s finest wiki but i can’t seem to find how or where to customize it.
Hey,
So I'm trying to make make LinkPreview ignore certain templates such as the quote template. I tried adding code described by Fngplg here on the talk page. But the quote template is still being included in the LinkPreview. What am I doing wrong?
Here's my code: https://imgur.com/2nEF6iP
Hello! I add to my wiki LinkPreview script, but it add images from infbox firstly, but main image of article is on the left.
Green circle — main image. Red circle — infoicon, but it I see in link preview. Now I add all images to ignor and now is displaying only load image.
Who can help me rewrite this code? I copy it to my wiki, so the changes will only affect my Wiki.
I know JS (my level, all of it is written by me), but don`t know jQuery.
If you can help me on Russian language it would be great, because I know only a little English.
Hello,
I have imported LinkPreview script from the Dev wiki.
It works fine for most part but seems to bug out on certain things. There are some things I'm having trouble with when testing it, even after going through the documentation and the talk page.
A version is currently live on the wiki:
https://anthem.fandom.com/wiki/MediaWiki:Common.js
I'm trying to get the following things to happen, because the script is behaving weirdly. Sometimes, it is straight up ignoring text or images in section 0, especially if transuded from templates:
Ignore the contents (text and image) of templates such as quote and disambiguation and other hatnotes, all mentioned in window.pPreview.RegExp.iparents
Ignore the text mentioned in the captions of an image in the preview text. For some reason, captions show up.
Ignore the text in the Table of Contents. I don’t know why this happens. I tried doing the same as with iparents by using __TOC__ (But I think it is wrong).
Ignore any headings. Again, I don’t know why this happens either, but sometimes, if pages do not have anything in Section 0, section 1 contents with headings show up. I don’t mind the contents showing up, but the heading makes the preview text read oddly)
I also want to know if text can be shown in the preview if it is transcluded from a template.
Any insight on this would be very helpful.
-------------------------------------------------------------------
Edit:
Example:
https://anthem.fandom.com/wiki/Ranger
Links are mentioned in bold and italicized words in the list below. All of them appear in the above mentioned page.
Hover over Ranger Mark One. to see a new issue where no text shows up in the preview at all.
Hover over Icetide to see an the image and text inside a disambiguation template (and a quote) in the preview.
Hover over Corvus to see a quote inside the Quote2 template showing. (Everything before the word Corvus in the text preview is a quote and its attribution. In contrast, if you hover over Dawn Shield, you will notice the quote being completely ignored.)
Hover over Cortex Entry: Ranger Ultimate—Micro-Missiles to see the heading show up (the Heading is H3 level and is named Ranger Ultimate—Micro-Missiles.)
Hover over Components to see the caption used in the image show in the preview. (The caption is Icon used for Components.)
Hover over Richards to see the table of contents and section 1 heading to show up. (the Table of Contents shows up as Contents 1 Characters 2 story 3 Trivia 4 References. And the heading is h2 level and shows up as Characters [ | ] and Story [ | ] in the preview)
(Added examples to show the issues)