MediaWiki talk:Gadget-popups.js: Difference between revisions
→Protected edit request on 19 April 2016: Responded to edit request (EPH) |
→Protected edit request on 19 April 2016: Responded to edit request (EPH) |
(No difference)
|
Revision as of 08:01, 19 April 2016
To help centralise discussions and keep related topics together, MediaWiki talk:Gadget-navpop.css redirects here. |
This page is for gadget-specific discussion. For most issues, please visit Wikipedia talk:Tools/Navigation popups. |
Crash
LOL. I can't view this in Firefox without freezing. Perhaps I need to download more RAM? --- RockMFR 19:44, 5 December 2007 (UTC)
- It works for me...if I be absolutely still while it is loading. :P FunPika 02:19, 9 December 2007 (UTC)
About the CSS
- This section was moved here from MediaWiki talk:Gadget-navpop.css, so that talkpage can be redirected here. --David Göthberg (talk) 06:44, 29 November 2009 (UTC)
{{editprotected}}
Please create this page with the text found in User:Lupin/navpop.css. FunPika 02:32, 9 December 2007 (UTC)
Change request
{{editprotected}}
Please remove the following section from the page (as MediaWiki:Gadget-navpop.css should be able to handle that part's functions if I understand the code correctly):
////////////////////////////////////////////////////////////////////
// Import stylesheet(s)
//
if ( window.localCSS ) {
document.write('<link rel="stylesheet" type="text/css" href="http://localhost:8080/js/navpop.css">');
} else {
document.write('<link rel="stylesheet" type="text/css" href="' +
'http://en.wikipedia.org/w/index.php?title=User:Lupin/navpop.css' +
'&action=raw&ctype=text/css&dontcountme=s">');
}
FunPika 03:56, 9 December 2007 (UTC)
- Done - I may not technically know JavaScript, but the purpose of that code is obvious. Nihiltres{t.l} 13:45, 9 December 2007 (UTC)
Fixes for various bugs
{{editprotected}}
This is a list of several issues that have been found in Lupin's code, since it was made a gadget. Lupin seems mostly MIA lately, so little has been done with these things so far. However they all fix important and annoying issues or spelling bugs, and all have been tested by multiple people. --TheDJ (talk • contribs) 15:07, 29 February 2008 (UTC)
- Security fix implemented by Krimpet diff
- Spelling error diff
- Avoid including full copies of images in contributions and histories when these images are mentioned in the edit summary. solution. (changes [[Image:]] into [[:Image:]] in those cases)
- getParamValue uses decodeURI(), but should use decodeURIComponent() explanation by Lupo
- Safari workaround for some (un)escaping issue. diff explanation by Makotoy.
I think it is important to have these fixes applied and since some of this has been lingering since December, without much action by Lupin, I think it is best if they are tackled here. --TheDJ (talk • contribs) 15:07, 29 February 2008 (UTC)
- Could you point me to the code to copy over the current code? (I'm aware of that security problem as well, and agree that it, in particular, needs fixing.) --ais523 19:50, 3 March 2008 (UTC)
- I have made this version which has all of the above suggestions applied. This is the diff with the currently installed Gadget code. --TheDJ (talk • contribs) 20:29, 3 March 2008 (UTC)
References preview
{{editprotected}}
This diff should fix previewing references. A while ago this broke because the ids for the notes were changed in the cite extension. --TheDJ (talk • contribs) 14:04, 26 March 2008 (UTC)
- Done Implemented by MZMcBride in this diff --TheDJ (talk • contribs) 19:44, 26 March 2008 (UTC)
Porting to another mediawiki installation
I'm a total n00b at JS (give me Ruby any day!) and I am a little overwhelmed by the amount of code here. I run my own wiki using the same software as Wikipedia and this gadget would be cool to have. The problem is that I use the short URL scheme (i.e. mywiki.com/Article). I can find the url/regex that does that here. Any advice on porting popup? --Aquatiki (talk) 07:47, 10 April 2008 (UTC)
- Have you tried the methods in WP:POPFAQ? —mjb (talk) 02:31, 22 April 2008 (UTC)
Enhancement to disable popups on certain elements
There was already a built-in function that removes popups from an article's table of contents (i.e., from all anchors under the HTML element with ID 'toc'), but this wasn't generalized so that it could be used with other elements. I really didn't like popups appearing on the special character links under the edit box on article edit pages, so I experimented a bit to figure out what could be done. I found I couldn't disable the popups via code in my monobook.js, so I resorted to patching popups.js directly.
Patches, along with original and patched versions of popups.js, are available here (click). Here are direct links to the patches themselves (identical code in all of them):
- popups.js.diff, made against User:Lupin/popups.js version "Sat Mar 10 21:40:16 UTC 2007"
- gadget-popups.js.diff, made against Mediawiki:Gadget-popups.js version "Sat Mar 3 20:18:00 UTC 2008 en:MediaWiki:Gadget-popups.js" (though the other diff will work just as well)
- apipopups.diff, made against User:TheDJ/apipopups.js version "DJ Fork Sun Mar 30 14:03:00 UTC 2008"
Once the patch is applied and you've edited your monobook.js to load the patched file (such as User:Mjb/popups.js, which is what I use, instead of User:Lupin/popups.js or User:TheDJ/apipopups.js), you can further test it by adding noPopupElements=['editpage-specialchars'];
to your monobook.js. Then go to an edit page, shift-reload or do whatever you need to do to clear your cache, and now you should observe no popups when you mouseover the special character links under the edit box.
Peer review appreciated. If it works for people, perhaps this could be incorporated into the official scripts? —mjb (talk) 03:02, 22 April 2008 (UTC); updated 06:58, 27 August 2008 (UTC)
- This is interesting. Can you give a recipe for disabling popups when hovering over a rollback link when viewing a diff? Philip Trueman (talk) 10:30, 1 May 2008 (UTC)
- The revision, edit, and undo links at the top of each column on a diff page are all in a pair of divs with ID "mw-diff-otitle1" and "mw-diff-ntitle1". You could disable popups on that set of links by adding those IDs to your noPopupElements array.
noPopupElements=['editpage-specialchars', 'mw-diff-otitle1', 'mw-diff-ntitle1'];
- —mjb (talk) 21:00, 1 May 2008 (UTC)
- I like the idea. I'm reluctant to add more functionality to popups in general, but I do see this like a potential thing that we ought to consider. --TheDJ (talk • contribs) 19:07, 1 May 2008 (UTC)
Broken
{{editprotected}}
Popups is broken since the last change. I believe it's the missing comma at the end of the following line:
"hu": [ "Média", "Speciális", "Vita", "Szerkesztő", "Szerkesztővita", "Wikipédia", "Wikipédia-vita", "Kép", "Képvita", "MediaWiki", "MediaWiki-vita", "Sablon", "Sablonvita", "Segítség", "Segítségvita", "Kategória", "Kategóriavita", "Portál", "Portálvita"]
Can someone fix that please? --AmaltheaTalk 21:52, 22 October 2008 (UTC)
- Also at User talk:Lupin/popups.js please. --AmaltheaTalk 21:58, 22 October 2008 (UTC)
Credit
Who gets credit for writing Popups? Lupin? Are there other major contributors? ☺Coppertwig(talk) 13:57, 23 November 2008 (UTC)
Auto-save option
{{editprotected}}
As there is an option to auto-save when "fixing" a redirect, there should also be an option to auto-save when disambiguating a link (which is usually a more important task). This option would be easy to add, just make these changes:
In the "// redirs, dabs, reversion" section, add this line:
newOption('popupDisambigAutoClick', 'wpDiff');
And change three remaining instances of:
clickButton: "wpDiff" |
or | clickButton: 'wpDiff' |
to
clickButton: getValueOf('popupDisambigAutoClick')
This way it will still do 'wpDiff' but people can over-ride it to 'wpSave' if they want to.
P.S. Why are we maintaining two versions of this tool? Seems like we should merge these and add whatever configuration settings are needed to preserve any intentional differences between the two. — CharlotteWebb 17:04, 11 March 2009 (UTC)
- Hmm, is this really a good idea? With redirects it makes sense since there is only one way to "fix" them. With DAB, as BrownHairedGirl said, a link might need different disambiguations.
As to why the versions are seperated, I have no idea. There's no reason I know of, and would support merging them. --Amalthea 17:27, 11 March 2009 (UTC)- Well, users are liable for their own mistakes, and nobody has to use this feature. I just figured it would make editing more efficient for some. Anyway a wrong choice isn't going to be any more obvious when you look at the diff than it is in the previous step where you select which button to push. — CharlotteWebb 17:59, 11 March 2009 (UTC)
- Right. So we're looking at this change, for both gadget and User:Lupin/popups.js? One of the wpDiff's was for automatic redlink removal, so I made that configurable with its own option.
Haven't tested it yet.
Cheers, Amalthea 18:52, 11 March 2009 (UTC)
- Right. So we're looking at this change, for both gadget and User:Lupin/popups.js? One of the wpDiff's was for automatic redlink removal, so I made that configurable with its own option.
- Well, users are liable for their own mistakes, and nobody has to use this feature. I just figured it would make editing more efficient for some. Anyway a wrong choice isn't going to be any more obvious when you look at the diff than it is in the previous step where you select which button to push. — CharlotteWebb 17:59, 11 March 2009 (UTC)
Foreign 'pedia
Some namespaces have changed on it.wiki. Can someone add this line
"it": [m, "Speciale", "Discussione", "Utente", "Discussioni utente", "Wikipedia", "Discussioni Wikipedia", "File", "Discussioni file", "MediaWiki", "Discussioni MediaWiki", "Template", "Discussioni template", "Aiuto", "Discussioni aiuto", "Categoria", "Discussioni categoria", "Portale", "Discussioni portale", "Progetto", "Discussioni progetto"]
please? Lenore (talk) 19:27, 17 April 2009 (UTC)
- Done. Cheers, Amalthea 20:14, 17 April 2009 (UTC)
Some updates for pl.wiki:
- namespaces
"pl": [m, "Specjalna", "Dyskusja", "Wikipedysta", "Dyskusja wikipedysty", "Wikipedia", "Dyskusja Wikipedii", "Plik", "Dyskusja pliku", "MediaWiki", "Dyskusja MediaWiki", "Szablon", "Dyskusja szablonu", "Pomoc", "Dyskusja pomocy", "Kategoria", "Dyskusja kategorii", "Portal", "Dyskusja portalu","Wikiprojekt","Dyskusja Wikiprojektu"],
- redirects
'pl': [ R, 'PATRZ', 'PRZEKIERUJ', 'TAM' ],
Thanks. Invisible Idiot (talk) 15:19, 3 July 2009 (UTC)
- Done. Cheers, Amalthea 15:51, 3 July 2009 (UTC)
Update italian alias for redirect
{{editprotect}} Can anyone add this line to "function setRedirs()"?
'it': [ R, 'RINVIA', 'Rinvia'],
See this for example. Thank you --Melos (talk) 14:03, 9 July 2009 (UTC)
- Done. Please report if it didn't work. —TheDJ (talk • contribs) 14:31, 9 July 2009 (UTC)
Image namespace renamed
"File" (de: Datei, sv: Fil) should be recognized as a synonym to the "Image" (de,sv: Bild) namespace. --LA2 (talk) 13:58, 1 October 2009 (UTC)
- It already should be recognized. Unfortunately per language only 1 non-english translation is supported however. (namespace aliases predate the design of navigation popups). —TheDJ (talk • contribs) 19:03, 1 October 2009 (UTC)
German redirect alias
{{editprotected}} Could someone add the German alias for redirects ("#WEITERLEITUNG") to the code? Thank you, --The Evil IP address (talk) 23:17, 29 March 2010 (UTC)
- Did that, but: de-wikipedia uses their own copy of popups, and doesn't pull it from here. That means that if you wanted it for there, you'll have to ask for it on de:MediaWiki Diskussion:Gadget-navigation-popups.js.
Amalthea 23:35, 29 March 2010 (UTC)
de.wikipedia now directly uses the en.wikipedia version. --Leyo 08:16, 29 March 2012 (UTC)
Namespace renaming and file issue
Hi, we Esperanto Wikipedians have some problems with this tool:
- Namespaces should be updated because they changed: see there for updated names
- If an image is inserted with Esperanto namespace "Dosiero:" ("File:") aŭ "Bildo:" ("Image:") the popup links to Commons uncorrectly (example the Image of the Day, Dosiero:Wildpferde Tripsdrill.jpg: the popup links to http://commons.wikimedia.org/wiki/Dosiero:Wildpferde_Tripsdrill.jpg)
Please, could someone fix these errors? Thank you! Friendly, --Airon90 (talk) 14:54, 4 August 2010 (UTC)
- As noted 2 threads higher up "Unfortunately per language only 1 non-english translation is supported". To change that is a bit of work, which is on my todo list, but it is a rather large list unfortunately. —TheDJ (talk • contribs) 15:34, 4 August 2010 (UTC)
- I have updated the table for the eo namespaces. Only the User namespaces were incorrect as far as I can see. I think I also fixed the Commons link issue, but please leave a message if it is still broken. —TheDJ (talk • contribs) 15:50, 4 August 2010 (UTC)
- Sorry for the double req :S I didn't see it before. Don't worry and take your time! --Airon90 (talk) 16:28, 4 August 2010 (UTC)
- I have updated the table for the eo namespaces. Only the User namespaces were incorrect as far as I can see. I think I also fixed the Commons link issue, but please leave a message if it is still broken. —TheDJ (talk • contribs) 15:50, 4 August 2010 (UTC)
Is it possible to localize 'History preview failed :-(' text
Hi. now I'm translating navigation popups in Japanese wikipedia(draft). Only 'History preview failed :-(' text looks impossible to be replaced by local text(pop up this page, and try to show tokyo and paris article's history. It will needs this text). Is it possible to localize that text? thank you. --Was a bee (talk) 04:39, 15 August 2010 (UTC)
- I tested below
return 'History preview failed :-(';
- changed to
return popupString('History preview failed :-(');
- and add
'History preview failed :-(': 'History preview failed :-(',
- to the "article-related actions and info" section of pg.string[1]. After that, edit local file. This solved problem. Somebody help to edit... Thanks! --Was a bee (talk) 05:02, 15 August 2010 (UTC) add more info--Was a bee (talk) 05:46, 15 August 2010 (UTC)
- It's an error. In general i don't make error and debug messages translatable, since they should not normally be user visible. And if they do appear, you will need English to get them fixed :D —TheDJ (talk • contribs) 12:16, 15 August 2010 (UTC)
- Hi TheDJ. yes... your explanation is perfectly rational and reasonable. The error message should be like that. I got it. Thank you for your reply :> --Was a bee (talk) 22:33, 15 August 2010 (UTC)
- It's an error. In general i don't make error and debug messages translatable, since they should not normally be user visible. And if they do appear, you will need English to get them fixed :D —TheDJ (talk • contribs) 12:16, 15 August 2010 (UTC)
Namespaces in gl.wp
{{editprotected}}
Please, add this line with the translation for the namespaces in Galician Wikipedia:
"gl": [m, "Especial", "Conversa", "Usuario", "Conversa usuario", "Wikipedia", "Conversa Wikipedia", "Ficheiro", "Conversa ficheiro", "MediaWiki", "Conversa MediaWiki", "Modelo", "Conversa modelo", "Axuda", "Conversa axuda", "Categoría", "Conversa categoría"],
Thanks! --Toliño (talk) 15:48, 30 August 2010 (UTC)
- Done. Also added in support for "REDIRECCIÓN" and "REDIRECIONAMENTO" redirect markers. Amalthea 16:13, 30 August 2010 (UTC)
"Editors" button not working
{{editprotected}}
The link to Tim's WP Stats is outdated, and as such is no longer available. Instead of this, how about that (from Soxred's Tools)? --Slgrandson (How's my egg-throwing coleslaw?) 10:03, 30 September 2010 (UTC)
- Done The current version of popups uses Soxred's tools for edit counter and article stats. AxelBoldt (talk) 13:52, 3 June 2011 (UTC)
Enabling support for IE9
Currently the script does not work in IE9. Some debugging traces the cause of the problem to the setSiteInfo
function. IE9 (Platform Preview 7) seemingly reports location.port == '80'
regardless of whether the port number appears in location.href
. That causes pg.wiki.sitebase
to undesirably contain ':80'
. This malformed pg.wiki.sitebase
is then used to construct the regular expression pg.re.basenames
in the setTitleBase
function, which causes the test pg.re.basenames.test(h)
to fail in the isPopupLink
function. That failure causes the addTooltip
function to abandon prematurely without creating any popups. When this problem is worked around, Navpopup will work in IE9 as it does in other browsers.
Furthermore, in the setBrowserHacks
function, it is probably better to treat IE9 (and possibly IE8) just like other modern browsers and leave useOriginal
as false
. This will allow a better look for Navpopup in IE9 (and IE8). Kxx (talk | contribs) 05:50, 11 December 2010 (UTC)
- Thx for the tip, when I have access to a Windows machine (might take a while), I'll try to take a look at these issues. —TheDJ (talk • contribs) 20:59, 13 December 2010 (UTC)
- It seems that Microsoft has fixed the location.port problem as of IE 9.0.8112; it correctly reports "" instead of "80". However all IE versions currently have problems with popups--previews of IP user contributions and image pages don't show up. The reason is that the API currently doesn't work for these browsers if the request contains a period, the result of circumventing some security issue in IE6 (bug 288840). It's a high priority bug and supposedly a partial fix is in the works. AxelBoldt (talk) 17:42, 3 June 2011 (UTC)
- Thanks for the fix. The behavior with
location.port
seems to be specific to the Platform Previews and intentional/by design. IE9 Beta, RC and RTM return an emptylocation.port
, but IE10 PP1 again returns":80"
. Hope that bug 28840 gets fixed soon. It is impacting much more than just navpopups. Kxx (talk | contribs) 21:24, 4 June 2011 (UTC)
- Thanks for the fix. The behavior with
Portuguese
{{editprotected}} Please replace the following line:
"pt": [m, "Especial", "Discussão", "Usuário", "Usuário Discussão", "Wikipedia", "Wikipedia Discussão", "Imagem", "Imagem Discussão", "MediaWiki", "MediaWiki Discussão", "Predefinição", "Predefinição Discussão", "Ajuda", "Ajuda Discussão", "Categoria", "Categoria Discussão"],
with this line:
"pt": [m, "Especial", "Discussão", "Utilizador", "Utilizador Discussão", "Wikipédia", "Wikipédia Discussão", "Ficheiro", "Ficheiro Discussão", "MediaWiki", "MediaWiki Discussão", "Predefinição", "Predefinição Discussão", "Ajuda", "Ajuda Discussão", "Categoria", "Categoria Discussão"],
Francisco talk-contribs 22:52, 17 February 2011 (UTC)
- Done —TheDJ (talk • contribs) 13:01, 18 February 2011 (UTC)
{{editprotected}}
- "Utilizador" namespace is now again "Usuário". Consider reupdating pt namespaces by replacing "Utilizador" with "Usuário". Francisco talk-contribs 16:38, 19 February 2011 (UTC)
- Done — Martin (MSGJ · talk) 17:36, 21 February 2011 (UTC)
- "Utilizador" namespace is now again "Usuário". Consider reupdating pt namespaces by replacing "Utilizador" with "Usuário". Francisco talk-contribs 16:38, 19 February 2011 (UTC)
Trying to import to another wiki
Gday. I am trying to import this script to another wiki, though while I can get the script fine, the stylesheet is missing, and it is not evident (to me) which css stylesheet is being called to make it function. Previously I have just copied the script, however, I would prefer to just call it as then it collects new stuff. Some advice around this would be very helpful. Thanks. billinghurst sDrewth 13:20, 7 March 2011 (UTC)
- CSS is at MediaWiki:Gadget-navpop.css; You can also import User:Lupin/popups.js instead, which will append the CSS automatically. Amalthea 13:36, 7 March 2011 (UTC)
- Found that out as I poked around, and found that I needed to import it and to make sure that it was added to Gadgets-definition, though still I cannot get the style to function. I was looking to import a mw controlled version (though I know that both are effectively similarly controlled), though that may be useful at least as a test. billinghurst sDrewth 14:19, 7 March 2011 (UTC)
Hovering over author||discussion thows error on firefox 4
I come from commons and since the recent changes, hovering over userpagelink does not work properly. Here is the error:
Error: text.replace is not a function Sourcefile: http://bits.wikimedia.org/commons.wikimedia.org/load.php?debug=false&lang=de&modules=ext.gadget.popups%7Cjquery.autoEllipsis%7Cjquery.checkboxShiftClick%7Cjquery.client%7Cjquery.collapsibleTabs%7Cjquery.cookie%7Cjquery.delayedBind%7Cjquery.highlightText%7Cjquery.placeholder%7Cjquery.suggestions%7Cjquery.tabIndex%7Cmediawiki.language%7Cmediawiki.legacy.ajax%7Cmediawiki.legacy.ajaxwatch%7Cmediawiki.legacy.mwsuggest%7Cmediawiki.legacy.wikibits%7Cmediawiki.util&skin=vector&version=20110414T075236Z Line: 61
Symptoms: Popup opens only one time; hovering again does not recreate the popup. Edit count is not shown.
It is a bit annoying: Either the server has problems, my internet connection crashes or somebody is playing with the .js. Can you please fix it. This script is excellent work and it's a pity when I can't use it. I hope I traced it back correctly. If not I am sorry for disturbing. -- Rillke (talk) 21:00, 14 April 2011 (UTC)
- Was my fault, and I fixed it about fifty minutes ago. Can you try bypassing your browser cache, please? Amalthea 21:12, 14 April 2011 (UTC)
- Thanks. Works now. -- Rillke (talk) 21:14, 14 April 2011 (UTC)
Redirect alias for 'uk'
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please add to redirLists
array the row:
'uk': [ R, 'ПЕРЕНАПРАВЛЕННЯ', 'ПЕРЕНАПР' ],
--Anatoliy (Talk) 11:17, 24 May 2011 (UTC)
Namespaces for id.wiki
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
old:
- "id": [m, "Istimewa", "Bicara", "Pengguna", "Bicara Pengguna", "Wikipedia", "Pembicaraan Wikipedia", "Gambar", "Pembicaraan Gambar", "MediaWiki", "Pembicaraan MediaWiki", "Templat", "Pembicaraan Templat", "Bantuan", "Pembicaraan Bantuan", "Kategori", "Pembicaraan Kategori"],
new
- "id": [m, "Istimewa", "Pembicaraan", "Pengguna", "Pembicaraan Pengguna", "Wikipedia", "Pembicaraan Wikipedia", "Berkas", "Pembicaraan Berkas", "MediaWiki", "Pembicaraan MediaWiki", "Templat", "Pembicaraan Templat", "Bantuan", "Pembicaraan Bantuan", "Kategori", "Pembicaraan Kategori"],
Bennylin (talk) 11:59, 14 July 2011 (UTC)
- Done, also localized Portal/Portal talk. Amalthea 12:41, 14 July 2011 (UTC)
i18 for Special:Contributions
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Hi!
A user noticed that the popup is not shown on Portuguese Wikipedia when the mouse is over a "contribs" link (e.g. on histories). I can confirm that changing "Contributions" to "Contribui%C3%A7%C3%B5es" would solve the problem there, but I would like to request that some of the maintainers provide a general fix for this, which would also work for wikis in other languages. Maybe it could get the translated name of the special page and then use it instead of hardcoding "Contributions" in the regex?
Would that be possible? Helder 17:08, 22 August 2011 (UTC)
- The translated name can be obtained from "My Contributions" link, using something like
var href = $('#pt-mycontris').find('a').attr('href'),
reContr = new RegExp(
mw.config.get('wgArticlePath').replace(
'$1',
mw.config.get('wgFormattedNamespaces')['-1'] + ':' + '(.+?)/'
)
),
match = href.match( reContr ),
pageName = (match && match[1]) || 'Contributions';
- See also this request: Wikipedia_talk:Tools/Navigation popups/Archive 8#Localization_for_Special:Contributions_and_Special:WhatLinksHere. Helder 18:19, 22 August 2011 (UTC)
- Sorry I am not qualified to check your code. Perhaps you could ask someone who is familiar with javascript? Please reactivate when you're sure it will work! — Martin (MSGJ · talk) 19:55, 29 August 2011 (UTC)
- Someone simply (well not that simple actually) should build in support for wgFormattedNamespaces. Web scraping should not be used. No time here though :D. —TheDJ (talk • contribs) 21:06, 30 August 2011 (UTC)
- Sorry I am not qualified to check your code. Perhaps you could ask someone who is familiar with javascript? Please reactivate when you're sure it will work! — Martin (MSGJ · talk) 19:55, 29 August 2011 (UTC)
I went back to get this to work and I managed to. There are two problems for it to work in ptwiki, but I figure one probably is very localized.
- First there is the problem that "Contributions" is used as a string literal three times in the text. Changing it to popupString('Contributions') and setting 'Contributions': 'Contributions' as one of the pg.strings is enough to actually make it work on most languages.
Note, however that Contributions must be encoded in % notation: 'Contributions': 'Contribui%C3%A7%C3%B5es' in pt; 'Contributions': 'Beitr%C3%A4ge' in de and so on and so forth. Encoding the strings shouldn't be very hard tough, but I've spent enough time on this already. - The second problem actually baffled me for quite some time, in pt.wiki when the regex is run in line 2301 (after I fixed the localization problem) the result included a undefined result where the username should be(contribs[3]) and placed the user name in the next spot (contribs[4]) it took me a while to notice that the "user" namespace in ptwiki uses parenthesis to denote a neutral gender "usuário(a)" so that spot was the absence of the a.
I again did a very dirty hack checking if contribs[3] was empty and using contribs[4] if that is the case. But if the namespace is escaped there is no need for it.
- I don't know if other wikis use parenthesis in the user namespace
, if it is used a single time my hack will work just fine.
- I don't know if other wikis use parenthesis in the user namespace
So here is the code I got User:Chicocvenancio/popups-test.js. The changes from the original are:
- In lines 4417, 5847, 6254 I changed "'Contributions'" for "popupString('Contributions')".
- In line 7585 I placed "'Contributions': 'Contributions'" as one of the pg.strings so that the script remains functional in English projects.
In line 2303 I placed the very ugly hack to get around the extra group when "usuário(a)" is in the regex.
Chico Venancio (talk) 09:06, 28 April 2012 (UTC) (edited to strike)
Actually there is a very simple way to do it. I just put encode()mw.util.rawurlencode() arround the areas I needed to encode and Voila! Since this is a very simple change now and the request for this feature to be present in other languages is pretty old I am reopening the edit request. The change needed is this. The full file with these changes can be found at User:Chicocvenancio/popups-test.js and a "show changes" confirm these are the only changes made.
With these changes, all the translators will have to do is add a 'Contributions':'Contribuitions in whatever language (all unicode characters allowed)'. Chico Venancio (talk) 10:55, 28 April 2012 (UTC)
- I trust that you've tested this thoroughly. deployed — Martin (MSGJ · talk) 19:06, 14 May 2012 (UTC)
- Perhaps not, navpops now seem to be broken. Revert? — Richardguk (talk) 19:19, 14 May 2012 (UTC)
- I think perhaps the topmost change was unintended...? I don't have long so I've just reverted for now. - Jarry1250 [Deliberation needed] 19:25, 14 May 2012 (UTC)
- Yes, that wasn't my best move. Tried again, hopefully all working this time? — Martin (MSGJ · talk) 19:37, 14 May 2012 (UTC)
- Seems good now, thanks all! Salutary to be reminded how useful popups are when they were momentarily gone. — Richardguk (talk) 19:43, 14 May 2012 (UTC)
- Yes, that wasn't my best move. Tried again, hopefully all working this time? — Martin (MSGJ · talk) 19:37, 14 May 2012 (UTC)
- I think perhaps the topmost change was unintended...? I don't have long so I've just reverted for now. - Jarry1250 [Deliberation needed] 19:25, 14 May 2012 (UTC)
- Perhaps not, navpops now seem to be broken. Revert? — Richardguk (talk) 19:19, 14 May 2012 (UTC)
Sorry to reactivate such an old request, but I have been inactive for some time...
@MSGJ: It wasn't clear to me if the edit was reverted in error or if my changes caused trouble for some people. Contributions are still not working on ptwiki without my changes. Has someone reported an error with it or was it Krinkle's edit that caused the problem and it was all reverted? I'll test things again but I don't see how this can cause problems... Chico Venancio (talk) 13:34, 2 December 2015 (UTC)
- For what it's worth, I notice the same behaviour (described above for pt:Especial:Contribuições) at de:Spezial:Beiträge. The obvious conclusion is that diacritics are not handled correctly for this type of popups. I don't use this function a lot, so I'm not much bothered by its failure. -- Michael Bednarek (talk) 18:04, 2 December 2015 (UTC)
- Sorry I have no idea. You could try WP:VPT perhaps? — Martin (MSGJ · talk) 14:27, 7 December 2015 (UTC)
Namespaces changed in es:wiki
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please can anybody change the "es" line in var nsLists
From current existing line:
"es": [m, "Especial", "Discusión", "Usuario", "Usuario Discusión", "Wikipedia", "Wikipedia Discusión", "Imagen", "Imagen Discusión", "MediaWiki", "MediaWiki Discusión", "Plantilla", "Plantilla Discusión", "Ayuda", "Ayuda Discusión", "Categoría", "Categoría Discusión"],
To this new actualized line:
"es": [m, "Especial", "Discusión", "Usuario", "Usuario discusión", "Wikipedia", "Wikipedia discusión", "Archivo", "Archivo discusión", "MediaWiki", "MediaWiki discusión", "Plantilla", "Plantilla discusión", "Ayuda", "Ayuda discusión", "Categoría", "Categoría discusión"],
Differences are:
- lowercase Discusión → discusión (except for main Talk, which remains Discusión)
- Imagen → Archivo
Thanks in advance, Gustronico (talk) 16:25, 12 September 2011 (UTC)
- Done — Martin (MSGJ · talk) 15:54, 14 September 2011 (UTC)·
Patch for watch/unwatch action
I have created a patch regarding Unwatching with Popups now has additional (unwelcome) prompt. I have already applied this change on all Polish projects.
--- MediaWiki:Gadget-Popups.js 2012-01-15 09:27:08.000000000 +0100
+++ MediaWiki:Gadget-Popups.js 2012-01-15 12:03:51.317596960 +0100
@@ -6219,7 +6220,9 @@
case 'deletelog': this.print=specialLink; this.specialpage='Log'; this.sep='&type=delete&page='; break;
case 'userSpace': this.print=specialLink; this.specialpage='PrefixIndex'; this.sep='&namespace=2&prefix='; break;
case 'search': this.print=specialLink; this.specialpage='Search'; this.sep='&fulltext=Search&search='; break;
- case 'history': case 'historyfeed': case 'unwatch': case 'watch':
+ case 'unwatch': case 'watch':
+ this.print=magicWatchLink; this.action=this.id; break;
+ case 'history': case 'historyfeed':
case 'unprotect': case 'protect':
this.print=wikiLink; this.action=this.id; break;
@@ -6837,6 +6840,35 @@
title: title, text: l.text, noPopup: l.noPopup});
}
+function magicWatchLink( l ) {
+ var jsUrl = simplePrintf( 'javascript:modifyWatchlist(\'%s\',\'%s\')', [l.article.toString( true ).split( "'" ).join( "\\'" ), this.id] );
+
+ return generalNavLink( {
+ url: jsUrl,
+ // can't have new windows with JS links, I think
+ newWin: false,
+ title: l.title,
+ text: l.text,
+ noPopup: l.noPopup
+ } );
+}
+
+function modifyWatchlist( title, action ) {
+ var request = {
+ action: 'watch',
+ title: title,
+ token: mw.user.tokens.get( 'watchToken' ),
+ format: 'json'
+ };
+ if ( action == 'unwatch' ) {
+ request.unwatch = true;
+ }
+
+ jQuery.post( mw.util.wikiScript( 'api' ), request, function( response ) {
+ mw.util.jsMessage( response.watch.message, 'ajaxwatch' );
+ }, 'json' );
+}
+
function popupMenuLink(l) {
var jsUrl=simplePrintf('javascript:%s()', [l.id]);
var title=popupString(simplePrintf('%sHint', [l.id]));
I hope this helps. Beau.pacynka (talk) 11:16, 15 January 2012 (UTC)
- Thanks for the patch! I've now added code to do that, more or less yours, with some modifications to avoid code injection, and to still allow opening the (un)watch link in a new window if one so desires. Amalthea 19:02, 25 January 2012 (UTC)
A fix for the "roadindex" set index renaming
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
{{roaddis}} was renamed to {{roadindex}} a while ago:
So please update the dab regex. I'm pretty sure its as simple as:
Old
newOption('popupDabRegexp', '([{][{]\\s*disambig|disambig\\s*[}][}]|disamb\\s*[}][}]|dab\\s*[}][}])|[{][{]\\s*(((geo|hn|road?|school|number)dis)|[234][lc][acw]|shipindex)(\\s*[|][^}]*)?\\s*[}][}]|is a .*disambiguation.*page');
New
newOption('popupDabRegexp', '([{][{]\\s*disambig|disambig\\s*[}][}]|disamb\\s*[}][}]|dab\\s*[}][}])|[{][{]\\s*(((geo|hn|road?|school|number)dis)|[234][lc][acw]|(ship|road)index)(\\s*[|][^}]*)?\\s*[}][}]|is a .*disambiguation.*page');
in other words
s,ship,(ship|road),
KelleyCook (talk) 17:06, 25 January 2012 (UTC)
- Done, thanks! Amalthea 17:21, 25 January 2012 (UTC)
- Worked like a charm, thanks for the quick response -- KelleyCook (talk) 17:50, 25 January 2012 (UTC)
Documentation for gadget authors
We're trying to start a library for gadget authors to use. Please check it out and post any questions or comments there. -- ☠MarkAHershberger☢(talk)☣ 00:53, 9 March 2012 (UTC)
"/" in front of page names?
I copied this script to the mediawiki pages of another wiki (Omegawiki.org). The script has nearly the same behavior there as here in Wikipedia, except that the namespace is preceded with a "/" character. For example my user page looks like "/User:InfoCan" when I hover over my name, rather than "User:InfoCan", and if I click on it it takes me to an non-existant page. What might be the cause of this problem? --İnfoCan (talk) 20:29, 15 March 2012 (UTC)
- I asked the developer who set up the wiki whether his setup was any different from wikipedia. He says:
It's just a guess, but it might be because of the format of what MediaWiki calls "short URLs" ( i.e. www.omegawiki.org/User:Kipcool instead of www.omegawiki.org/index.php?title=User:Kipcool ). OmegaWiki uses a different short URL, namely www.omegawiki.org/User:Kipcool instead of www.omegawiki.org/wiki/User:Kipcool. I have $wgArticlePath = "/$1";
- If this is indeed the reason, how can I modify the javascript to handle this situation? Or could you modify the code here so it is more universally usable? --İnfoCan (talk) 10:51, 16 March 2012 (UTC)
I got exactly the same problem on my website http://ribewiki.dk and I use short pretty URL's as well.
Please let me know, if you find the solution. --Ribewiki (talk) 16:56, 15 April 2012 (UTC)
- Fixed now, there was special code for such short URLs that actually made it break now, removing it fixed it. Amalthea 18:38, 16 April 2012 (UTC)
image alignment on rtl wikis
so the code has (around line #3686) the following line:
function imageHTML(article, idNumber) {
return simplePrintf('<a id="popupImageLink$1">' +
'<img align="right" valign="top" id="popupImg$1" style="display: none;"></img>' +
'</a>', [ idNumber ]);
}
it would work better for RTL sites if the align="right"
could be changed, either by some use of css, or by calculating the "right" : "left" yourself with conditional alignment.
one way to determine whether the page is rtl or ltr is by use of something like
(document.body.currentStyle || getComputedStyle(document.body)).direction
of course, it's much easier to just ask $('body').is('.ltr')
if you allow jquery use.
probably the simplest thing would be to just use CSS instead of setting the alignment directly in the code, and let rtl wikis worry about their own navpopup css overrides.
anywhoo, it would be nice if there was some way for RTL wikis to have the image on the left.
peace - קיפודנחש (talk) 13:52, 26 March 2012 (UTC)
EmailuserHint
Because of the lowercase u in EmailuserHint the string 'Send an email to %s' is never shown in the menu, instead there shows "EmailUserHint". Capitalizing U should fix it. Tried with the German translation, works there. --Ivla (talk) 13:32, 21 April 2012 (UTC)
Disambiguations on frwiki
Hi,
I have activated this gadget on frwiki, and I'm trying to make it correctly detect links to disambiguation pages. Currently, it only detects some of them, depending on the template used in the disambiguation page (works for {{Homonymie}} but not for {{Batailles homonymes}} for example). Is there a way to configure it for detecting all dab links correctly ? If it helps, every disambiguation page in frwiki is directly in the category "Homonymie".
--NicoV (talk) 20:45, 2 May 2012 (UTC)
A link that breaks the Popups gadget
Go here, and then hover over the third link the editor added (just before the text "where I replace hyphens in the intro"). When I hover over this link, I don't get a popup box, and my JavaScript error console logs the following error:
- Error: malformed URI sequence
- Source File: http://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-popups.js&action=raw&ctype=text/javascript&493031562
- Line: 2342
Line 2342 appears to be inside the Title.prototype.decodeNasties function.
Additionally, when I click on the link in question, I get
- Error: malformed URI sequence
- Source File: http://en.wikipedia.org/w/index.php?title=Special:BannerController&cache=/cn.js&303-4
- Line: 149
which appears to involve a decodeURIComponent call within a function called getQueryStringVariables.
Even more strangely, when I try to include the link here in my talk page report via a fullurl call — [{{fullurl:Charles_Andr%A9_Julien|diff=495291312&oldid=494889006}}] — the fullurl doesn't work, and I get yet another error:
- Error: invalid regular expression flag n
- Source File: http://en.wikipedia.org/w/index.php?title=MediaWiki_talk:Gadget-popups.js&action=submit
- Line: 1, Column: 4
- Source Code:
- /w/index.php?title=MediaWiki_talk:Gadget-popups.js&action=submit
I suspect there is something amiss with the link in question — but I would have expected/hoped that the problem would have been caught cleanly rather than having it break popups and fullurl.
I'm running Firefox 12.0 on an Ubuntu Natty system.
Does anyone else see this same problem on their system? Any ideas? — Richwales 18:20, 1 June 2012 (UTC)
- I've seen this before, but not with popups: Bug 25846. Helder 21:12, 1 June 2012 (UTC)
Blank spaces in popups display
Suddenly, today, all popups are displaying with a blank line before and after the title of the page that is being previewed. For example, if I hover my cursor over the link Fubar, instead of seeing this:
Fubar ⋅ actions ⋅ popups 9.4kB, 43 wikiLinks, 0 images, 1 category, 3 days 1 hour old
I see this:
Fubar ⋅ actions ⋅ popups 9.4kB, 43 wikiLinks, 0 images, 1 category, 3 days 1 hour old
Further investigation suggests that this is happening because the "⋅" characters have had extra padding or line-spacing added above and below them. This is puzzling, since neither of the gadget files seems to have been changed recently. How could the display have changed when the CSS hasn't changed? --R'n'B (call me Russ) 11:07, 22 June 2012 (UTC)
- After further investigation this seems to be an issue caused by Firefox 13.0.1, which I just installed today; it doesn't occur on Chrome. The "⋅" character is U+22C5, or
⋅
, and Firefox for some unknown reason wants to display this character as being three lines high. It happens in some but not all contexts, too, which is even stranger. Probably a corrupted font file; anyway, nothing we can do about it here, so never mind. --R'n'B (call me Russ) 11:23, 22 June 2012 (UTC)
CSS class for the popup box
Would it be possible to assign a distinctive CSS class name for the popup box (for example, MediaWikiPopup) so that it can be re-styled by user-side stylesheets such as my stylesheets for low vision? Silas S. Brown (talk) 18:17, 15 August 2012 (UTC)
Ah, I see it has class "navpopup", and you can style it in your browser's preferences by addressing it as:
body.mediawiki > div.navpopup
My stylesheets for low vision were setting all elements to position static to work around layout problems on sites that try to do pixel-based layouts without being aware of larger font sizes; I have now added an exception for MediaWiki nav popups. (The simpler "Reference Tooltips" extension can also be styled via "body.mediawiki .referencetooltip".) Silas S. Brown (talk) 19:22, 15 August 2012 (UTC)
Split into smaller JS pages
Hi!
During the presentation about Gadgets and ResourceLoader on Berlin Hackathon 2012, Krinkle suggested this file should be splitted into smaller ones, which would be loaded together by the Gadgets extension (in a single request as it is right now). I believe this would make it easier to load the source code (which currently takes a while), edit and/or debug it. Helder 00:48, 2 October 2012 (UTC)
- One problem is that lots of external wikis are hot-loading this script, e.g. de:MediaWiki:Gadget-navigation-popups.js. This script would thus need to be replaced by a loader of all the parts (which needs to work with parallel loading), and all external wikis would then have to pull multiple scripts.
An alternative would be to move any development of the script to github, and combine it to this gadget page through a synch script. That's what we do with WP:Twinkle (gadget/repo).
Amalthea 09:36, 2 October 2012 (UTC)
New feature proposal: lead only
popupPreviewFirstParOnly
limits the popup to the first paragraph. It would be useful if we could tell the script to present the whole lead, using something like popupPreviewLeadOnly
. Coupled to this, a popupMaxPreviewParagraphs
would limit the size of the lead (as opposed to popupMaxPreviewSentences
, which might cut a paragraph in half). I suggest three things:
- that support for
popupPreviewLeadOnly
is added, defaulting to false to preserve current behavior; - that support for
popupMaxPreviewParagraphs
is added, defaulting to 3 (allowing a value offalse
for unlimited) - that
popupMaxPreviewSentences
andpopupMaxPreviewCharacters
are changed to support thefalse
value, and default to that
Below I offer a proposed implementation for #1 and #2. Line changes are marked with + (added), * (changed) or > (moved). I haven't written javascript in a while so please take a look to see if there are any errors.
...
newOption('popupSummaryData', true);
+ newOption('popupPreviewLeadOnly', false);
+ newOption('popupMaxPreviewParagraphs', 3);
newOption('popupMaxPreviewSentences', 5);
...
...
Previewmaker.prototype.firstBit = function () {
> var d=this.data;
+
+ if (getValueOf('popupPreviewLeadOnly')) {
+ // Remove everything from the first heading onwards
+ // Here we use [\s\S]+ instead of .+ because Javascript doesn't support the s (dotall) modifier,
+ // See http://stackoverflow.com/a/1068308/266309
+ this.data=this.data.replace(RegExp('\\s*^\\s*==[\s\S]+'), '');
* } else if (getValueOf('popupPreviewCutHeadings')) {
> /// first we "normalize" section headings, removing whitespace after, adding before
this.data=this.data.replace(RegExp('\\s*(==+[^=]*==+)\\s*', 'g'), '\n\n$1 ');
/// then we want to get rid of paragraph breaks whose text ends badly
this.data=this.data.replace(RegExp('([:;]) *\\n{2,}', 'g'), '$1\n');
this.data=this.data.replace(RegExp('^[\\s\\n]*'), '');
stuff=(RegExp('^([^\\n]|\\n[^\\n\\s])*')).exec(this.data);
if (stuff) { d = stuff[0]; }
if (!getValueOf('popupPreviewFirstParOnly')) { d = this.data; }
/// now put \n\n after sections so that bullets and numbered lists work
d = d.replace(RegExp('(==+[^=]*==+)\\s*', 'g'), '$1\n\n');
}
// Split sentences. Superfluous sentences are RIGHT OUT.
// note: exactly 1 set of parens here needed to make the slice work
d = d.parenSplit(RegExp('([!?.]+["'+"'"+']*\\s)', 'g'));
// leading space is bad, mmkay?
d[0] = d[0].replace(RegExp('^\\s*'), '');
var notSentenceEnds=RegExp('([^.][a-z][.] *[a-z]|etc|sic|Dr|Mr|Mrs|Ms|St|no|op|cit|\\[[^\\]]*|\\s[A-Zvclm])$', 'i');
d = this.fixSentenceEnds(d, notSentenceEnds);
+
> // dont't be givin' me no subsequent paragraphs, you hear me?
+ var popupMaxPreviewParagraphs = getValueOf('popupMaxPreviewParagraphs');
+ if (typeof popupMaxPreviewParagraphs == 'number') {
+ d = d.slice(0, popupMaxPreviewParagraphs);
+ }
this.fullLength=d.join('').length;
var maxChars=getValueOf('popupMaxPreviewCharacters') + this.extraCharacters;
var n=this.maxSentences;
var dd=this.firstSentences(d,n);
do {
dd=this.firstSentences(d,n); --n;
} while ( dd.length > this.maxCharacters && n != 0 );
this.data = dd;
};
...
What do you think? --Waldir talk 15:31, 8 October 2012 (UTC)
- Strong support, this seems like a great idea. I'm curious, and I don't mean to sidetrack the discussion, but could you think of a way to remove the actions menu from popups? There has been some discussion of creating a form of popups that unregistered readers to use and it wouldn't be beneficial if they were accidentally reverting edits. Ryan Vesey 00:30, 18 October 2012 (UTC)
- I believe
popupStructure = 'lite';
does that. update: even more appropriate seems to bepopupNavLinks=false
. --Waldir talk 00:40, 18 October 2012 (UTC)
- I believe
page size discrepancy
so the gadget displays the page size. way it calculates the page size, is to read the data in raw format, and display data.length (with some rudimentary formatting of the number).
however, this number can largely disagree with the page size as seen in version history or reading the page size through the API (query prop 'revisions'). i am not sure what causes this discrepancy, but i suspect it has something to do with encoding: javascript uses utf16 encoding, while the DB and the display are using utf8. whatever the reason, this can be very significant diff in languages where almost all characters use 2 or more bytes.
foe example, for this page in hewiki: he:ויקיפדיה:דלפק ייעוץ/ארכיון157, popup shows 159.3 KB, while history page shows 254,215 bytes. this is some 40% error. if i go to this page, and enter editing mode, and then in the console i check for $('#wpTextbox1').val().length
, i get a value of 159,277. it is possible to find pages in enwiki with discrepancy also, but i doubt you'll find 40% error.
i am not sure if this problem is worth fixing, but maybe it is worth noting somewhere, e.g., indicate somewhere that the "page size" is not the same as the page size one sees in history, esp. for languages with multibyte characters.
peace - קיפודנחש (talk) 00:26, 6 November 2012 (UTC)
- i think i understand it now: when you look at "data.length", you get the string length, where the "string" is the content of the page as a string. this means that each character is counted as 1. however, in multibyte strings (i.e., practically in all languages with non-latin character set), a character typically weighs between 2 and 4 bytes. the simplest fix would be just to change the string that report the weight of the page from "kB" to something that will signal "kilo character". another fix would be to use
$.byteLength(data)
instead ofdata.length
(this is a mediawiki extension that teaches jquery to give you the weight of a string in bytes. it's somewhat recent, so you may want to test that it's a function before calling it) - peace - קיפודנחש (talk) 17:04, 6 November 2012 (UTC)
- i think i understand it now: when you look at "data.length", you get the string length, where the "string" is the content of the page as a string. this means that each character is counted as 1. however, in multibyte strings (i.e., practically in all languages with non-latin character set), a character typically weighs between 2 and 4 bytes. the simplest fix would be just to change the string that report the weight of the page from "kB" to something that will signal "kilo character". another fix would be to use
Opera popups menu fix
Hi. I managed to fix actions menu for Opera browser and seem to also work fine at least for latest Firefox and Chrome. You'll find the fixed CSS at pl.wiki [2]. The first block/rule is not needed bu I think it works better when you have all menus below. As for JS the fix is needed in setBrowserHacks [3]
Regards, Nux (talk) 18:30, 7 January 2013 (UTC)
Reference Tooltips
Gadget Reference Tooltips doesn't turn on when popups are turned on. Yes, because there's a conflict. We could disable attaching Popup event to reflinks by simply checking if(a.parentElement.className!='reference'){…}. Please, please, add it. Kaligula (talk) 22:40, 12 June 2013 (UTC)
small bug that affects some users
so function autoClickToken calls mw.user.sessionId();
however, this functionality is not necessarily always available. one needs to explicitly load mediawiki.user for all the "mw.user" functionality to be available. please add somewhere mw.loader.using('mediawiki.user')
. peace - קיפודנחש (aka kipod) (talk) 14:43, 13 June 2013 (UTC)
Use the 'wikipage.content' hook
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
A user reported on bugzilla:51565#c12 that this gadget is not working after the page is saved using the Visual Editor. Since bugzilla:30713 was fixed, MW core calls the 'wikipage.content' hook, which should be used by scripts which need to run then the content of the page is loaded. Moreover, there was a change in Visual Editor extension to also call this hook, allowing gadgets like this to work also with the new editing system (for another example of a script which needs a similar fix, see mw:Talk:Snippets/Last revision action). For more information, see the documentation of this hook system.
Could someone update this gadget to work with the new hook? Helder 00:21, 24 August 2013 (UTC)
- Not done: Sorry, but I'd need the actual code to enact this request. Actually, not many of the admins who answer protected edit requests know JavaScript. Maybe you could ask at WP:VPT to see if anyone could work up the code? — Mr. Stradivarius ♪ talk ♪ 07:02, 24 August 2013 (UTC)
Heh, I came here to post an editprotected request where I implemented this exact thing coming from Template:Bug, and I see there's already one.
Please replace the entire code on the gadget page with code copied from here: http://pastebin.com/LHhkyZ3S (there's a copy-pasteable textbox at the bottom). The changes are small, but spread across the file, so I just pasted it there.
This will simplify and make better the code used to make MediaWiki's live preview work, make popups work with VisualEditor (related to Template:Bug) and with Notifications flyout (Template:Bug). Matma Rex talk 20:52, 27 August 2013 (UTC)
- Actually, wait a second, this won't work with VE yet. Lemme just fix it. Matma Rex talk 20:58, 27 August 2013 (UTC)
- Fixed code: http://pastebin.com/Snzvgd1X Matma Rex talk 21:06, 27 August 2013 (UTC)
- Done. Thanks for taking the time to code this up. Let me know if there are any issues with it. — Mr. Stradivarius ♪ talk ♪ 10:53, 28 August 2013 (UTC)
- Fixed code: http://pastebin.com/Snzvgd1X Matma Rex talk 21:06, 27 August 2013 (UTC)
setupPopups called with something that looks like a load event
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
function setupPopups( callback ) { ----------------------^
which will in turn throw an error when attempted being called:
if ( callback ) { callback(); --------^ ERROR: callback is not a function.
Issue observed at Commons. -- Rillke (talk) 14:41, 28 August 2013 (UTC)
- Ughhh… I guess this should use
if ( $.isFunction( callback ) )
instead. Matma Rex talk 14:44, 28 August 2013 (UTC)
It possibly comes from there:
hookEvent('load', setupPopups);
-- Rillke (talk) 14:45, 28 August 2013 (UTC)
- Again, I will need some actual code in order to enact this request. Or if you want me to revert the latest change, that can be done as well. As it stands, though, this is more of a conversation than an edit request. What action would you like performed? — Mr. Stradivarius ♪ talk ♪ 15:05, 28 August 2013 (UTC)
-if ( callback ) {
+if ( $.isFunction( callback ) ) {
is was Matma suggested, I think. -- Rillke (talk) 15:31, 28 August 2013 (UTC)
- Ok, Done. Thanks for spelling it out for me. :) — Mr. Stradivarius ♪ talk ♪ 15:45, 28 August 2013 (UTC)
Redirect alias for Japanese
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please add the following line to redirLists
.
'ja': [ R, '転送' ],
See this for example. Thank you. --Atysn (talk) 10:37, 19 September 2013 (UTC)
deprecation
hi.
this gadget uses some deprecated calls, such as getElementsByClassName, hookEvent, addOnloadHook, and prolly some more. it's my understanding that very soon these will not be supported, so i think it's about time to clean it up. while doing so, the gadget code can become more streamlined. e.g.,
// example of existing function in current code:
function fixVectorMenuPopups() {
var vmenus = getElementsByClassName( document, 'div', 'vectorMenu');
for( i= 0; vmenus && i<vmenus.length; i++ ) {
var h5 = vmenus[i].getElementsByTagName('h5')[0];
if( h5) var a = h5.getElementsByTagName('a')[0];
if( a ) a.inNopopupSpan=true;
}
}
// using jquesry, this becomes:
function fixVectorMenuPopups() {
$('div.vectorMenu h5:first a:first').attr('inNopopupSpan', true);
}
as a side, vector menus switched some time ago (maybe a year or so) from "h5" to "h3" - this function is completely useless since, and the fact that nobody noticed is strange. peace - קיפודנחש (aka kipod) (talk) 22:16, 9 November 2013 (UTC)
- That should be
.prop('inNopopupSpan', true)
instead of.attr('inNopopupSpan', true)
. The old code uses a property (a.inNopopupSpan = true
), not an attribute (a.setAttribute('inNopopupSpan', 'true')
. Mixing them up will likely break something. Krinkle (talk) 21:46, 13 November 2013 (UTC)- thanks for the clarification - i stand corrected. of course, this error would break nothing - as i mentioned above, the selector will find nothing - vectorMenu does not have any "h5" elements for quite some time now (don't remember exactly when they were switched to "h3" - prolly over a year ago). i wrote the snippet above mainly to demonstrate how Doing The Right Thing® would make the code shorter and clearer.
- in the meantime, i'd like to point that even though references to getElementsByClassName were removed, there are still calls to deprecated stuff - cursory view revealed hookEvent() and addOnloadHook(), but i doubt very much these are the only two. this page contains a short and sweet explanation how to use "grep" to find all the uses of deprecated functions in some arbitrary JS source file. peace - קיפודנחש (aka kipod) (talk) 16:16, 14 November 2013 (UTC)
- The whole script is one big example of 'old code'. If you want to fix it, please do. Below I suggested opening up a github to facilitate collaboration. Personally, as long as it works, i'm still good with it. peace —TheDJ (talk • contribs) 23:24, 14 November 2013 (UTC)
- in its current state (some 7.7KLocs, over 30 different editors over the years, very few of which are still actively involved with it), it would be a nice surprise if there'll be significant activity on this github project. personally, i think it would be easier to start from scratch a new codebase, rather than modernize this one. FWIW, i created a gadget on hewiki that implements a small fraction of what this gadget does (only show the popup with a summary of the intro - without any frills whatsoever. i used some relatively new APIs and JS - i use "prop=extract" query to get the text, which was developed as part of the mobile project, and jquery.tipsy to show the popup. the whole thing is about 50 lines - you can see it here, if you're interested: he:Mediawiki:Gadget-showIntroOnHover.js). peace - קיפודנחש (aka kipod) (talk) 19:07, 24 November 2013 (UTC)
- The whole script is one big example of 'old code'. If you want to fix it, please do. Below I suggested opening up a github to facilitate collaboration. Personally, as long as it works, i'm still good with it. peace —TheDJ (talk • contribs) 23:24, 14 November 2013 (UTC)
Localisation
Last week popups broke on nl-wiki, probably due to the same reason as the previous topic, using obsoleted methods. We could have dived into bug fixing, but there are not a lot of coders on nl-wiki, so instead I proposed to use the English version instead, now that it is possible to include javascript crosswiki. The first thing we noticed however that we have the English text again in the interface. Instead of making a copy again and translating everything, it seems beneficial to look at localizing the code. All the text should already be available as mediawiki messages so it should only be a matter of calling the correct messages. Are people willing to look into this? Once done, it could be included on more wiki's and also, for users on en-wiki using another language for the interface, it would be in there prefered language.
Second problem we saw was that the disambiguation feature doesn't work anymore. That also seems to relate back to translation. I am told that can also be solved using the api, via MediaWiki:Disambiguationspage, you can find the relevant templates. Are people willing to look into this as well? Akoopal (talk) 20:31, 13 November 2013 (UTC)
- Does anyone think it might be a good idea to setup a github for popups, just as there is for Twinkle ? The script needs a lot of work, but I can't do it, and it's so much work that many people are somewhat put off to start to it as well I guess. Perhaps setting up a github might create the momentum that might be required. —TheDJ (talk • contribs) 21:52, 13 November 2013 (UTC)
- @Akoopal: You can already localize popups, have a look at the dewiki setup (localization in de:MediaWiki:Gadget-navigation-popups.js/de, loaded via de:MediaWiki:Gadget-navigation-popups.js). Amalthea 10:20, 15 November 2013 (UTC)
- Well that doesn't work 100% reliable of course, since there is no load order guarantee. —TheDJ (talk • contribs) 12:51, 15 November 2013 (UTC)
- That should only show if you /use/ popups before the loca script is loaded, and the texts could always be moved to the loader script. Amalthea 17:21, 15 November 2013 (UTC)
- @Amalthea, yes, that can work, but if I set my language on for example en-wiki to dutch, I also expect popups to be in dutch. I think it is really worth the effort to look into this, and seeing this, it is basically only this procedure you need to change. But for now, I will look into this as it is probably quicker. Will this also solve the disambiguation problem, or is more needed for that? Akoopal (talk) 22:26, 15 November 2013 (UTC)
- That should only show if you /use/ popups before the loca script is loaded, and the texts could always be moved to the loader script. Amalthea 17:21, 15 November 2013 (UTC)
- Well that doesn't work 100% reliable of course, since there is no load order guarantee. —TheDJ (talk • contribs) 12:51, 15 November 2013 (UTC)
Redirect alias for greek
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please add the following line to redirLists
.
'el': [ R, 'ΑΝΑΚΑΤΕΥΘΥΝΣΗ'],
Thank you. --geraki TL 13:50, 13 March 2014 (UTC)
- done —TheDJ (talk • contribs) 13:20, 23 March 2014 (UTC)
External links icons removed
Hello! If this CSS adds or modifies icons shown after external links, you'll be interested in knowing that such icons have been removed from MediaWiki core, a change which will reach this wiki in few days. You may want to consider whether you still need them. If you have questions, please ask at bugzilla:63725. Regards, Nemo 09:45, 10 April 2014 (UTC)
Edit request
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Change var soxredToolUrl='//tools.wmflabs.org/xtools/pcount/index.php?name=$1&lang=$2&wiki=$3';
to var soxredToolUrl='//tools.wmflabs.org/supercount/index.php?user=$1&project=$2.$3';
JV Smithy (talk) 15:40, 21 April 2014 (UTC)
Deprecated functions
The lines
hookEvent('load', setupPopups); addOnloadHook(autoEdit);
causes the following warnings:
- Use of "hookEvent" is deprecated. Use jQuery instead.
- Use of "addOnloadHook" is deprecated. Use jQuery instead.
Could someone fix them? Helder.wiki 15:26, 19 May 2014 (UTC)
Protected edit request on 16 June 2014
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please replace:
var h='<hr><tt>' + download.data.entify().split('\\n').join('<br>\\n') + '</tt>';
With:
var h='<hr /><span style="font-family: monospace;">' + download.data.entify().split('\\n').join('<br />\\n') + '</span>';
To remove deprecated <tt>
element and replace them with the equivelent css enriched span. — {{U|Technical 13}} (e • t • c) 20:24, 16 June 2014 (UTC)
- What's wrong with using
<code>...</code>
? That's what we've been doing elsewhere, as advised at http://www.w3.org/TR/html5/obsolete.html#tt --Redrose64 (talk) 22:23, 16 June 2014 (UTC)- It's not a one-to-one replacement, as
<code>...</code>
tags force a white background as well as a monospace font. So it depends what the<tt>...</tt>
tags were being used for. In this case it looks like it's used for previewing template code, so switching to code tags is probably ok. Technical 13, what do you think? — Mr. Stradivarius ♪ talk ♪ 03:20, 17 June 2014 (UTC)- I avoided requesting this switched to code tags because the navigational popups have a yellow background. — {{U|Technical 13}} (e • t • c) 03:49, 17 June 2014 (UTC)
- Done That's a good point. — Mr. Stradivarius ♪ talk ♪ 04:51, 17 June 2014 (UTC)
- It's possible to use
<code style="background: inherit;">...</code>
: PopupCode
Popup That way, the semantic use of thecode
element - to represent a fragment of computer code - is indicated. The span element just changes the appearance, it does not convey meaning. --Redrose64 (talk) 10:33, 17 June 2014 (UTC)
- It's possible to use
- Done That's a good point. — Mr. Stradivarius ♪ talk ♪ 04:51, 17 June 2014 (UTC)
- I avoided requesting this switched to code tags because the navigational popups have a yellow background. — {{U|Technical 13}} (e • t • c) 03:49, 17 June 2014 (UTC)
- It's not a one-to-one replacement, as
Not working on user contributions
The script suddenly stopped working on Special:Contributions. Can someone look into that? Thanks. —howcheng {chat} 17:03, 6 August 2014 (UTC)
- It turned out there was a bug in User:Ais523/topcontrib.js. Since that editor has since retired, I rewrote his script in jQuery and fixed the bug. —howcheng {chat} 02:29, 10 August 2014 (UTC)
Bug popupModifier
This option is annoying and not really working. If tested all mod keys (except of meta) and none of them are really usable. I get the problem which was already mentioned here : 2009 also my browser get always freezed after some time (FF and Chrome on Win 7). So I propose the stroke this option out or mark it as beta, or improve the code. Thanks for the tool, best regards → User: Perhelion 08:36, 7 August 2014 (UTC)
Show source text at modules
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Hi! At templates, this script shows the source text of the page. It would be even more useful at modules, because now it shows usually just local p={}
. Can somebody add it to the script (I think it's around the 550. line)? Thanks, --Tacsipacsi (talk) 11:05, 28 September 2014 (UTC)
- Not done: @Tacsipacsi: Sorry, but really we need the code to be ready and working before we can enact edit requests like this one, and also not many (any?) users who are good with JavaScript patrol these edit requests. If you need help with the coding, WP:VPT is the best place to ask. Best regards — Mr. Stradivarius ♪ talk ♪ 09:05, 30 September 2014 (UTC)
Feature request: Popups display of Special:Diff links
Hello. I was wondering, why the popups gadget does'nt display Special:Diff links. Special:Diff is the preferred method to link diff links since February 2014. --Ptolusque (talk) 22:55, 28 September 2014 (UTC)
- I've deactivated the edit request, as edit requests aren't meant for requesting code features (see Wikipedia:Edit requests). If you have the code needed to make this work, though, feel free to reactivate the request. — Mr. Stradivarius ♪ talk ♪ 23:38, 30 September 2014 (UTC)
- Understood. I was asked in the German Wikipedia to put that feature request. The Template:Diff in the German Wikipedia seems to be corrupted. Therefore its recommended to use Special:Diff. But Special:Diff doesn't comply with Gadget-popups.js. First of all, I'll discuss this issue in the German Wikipedia. If required, then I'll try to code a template addition. --Ptolusque (talk) 00:26, 1 October 2014 (UTC)
- @Ptolusque: You can also try posting at the technical village pump for assistance, and we can try asking the two most active maintainers of the tool, TheDJ and Amalthea. — Mr. Stradivarius ♪ talk ♪ 00:36, 1 October 2014 (UTC)
- @Ptolusque: Should be working now: Special:Diff/613903522, Special:Diff/613903522/next, Special:Diff/613903522/prev, Special:Diff/613903522/cur. Amalthea 12:13, 1 October 2014 (UTC)
- Great, thank you! --Leyo 21:45, 1 October 2014 (UTC)
- Excellent, Amalthea! Thanks. --Ptolusque (talk) 23:58, 1 October 2014 (UTC)
- Great, thank you! --Leyo 21:45, 1 October 2014 (UTC)
- @Ptolusque: Should be working now: Special:Diff/613903522, Special:Diff/613903522/next, Special:Diff/613903522/prev, Special:Diff/613903522/cur. Amalthea 12:13, 1 October 2014 (UTC)
- @Ptolusque: You can also try posting at the technical village pump for assistance, and we can try asking the two most active maintainers of the tool, TheDJ and Amalthea. — Mr. Stradivarius ♪ talk ♪ 00:36, 1 October 2014 (UTC)
- Understood. I was asked in the German Wikipedia to put that feature request. The Template:Diff in the German Wikipedia seems to be corrupted. Therefore its recommended to use Special:Diff. But Special:Diff doesn't comply with Gadget-popups.js. First of all, I'll discuss this issue in the German Wikipedia. If required, then I'll try to code a template addition. --Ptolusque (talk) 00:26, 1 October 2014 (UTC)
First of all, thanks for this improvement! I've been wanting this since I started using popups! I just have one question: Why does it work on Special:Diff/620573180/620804084 as a link, but selected in the source, it shows a cache key? —PC-XT+ 04:22, 14 October 2014 (UTC)
Most recent edit popup broken
This edit by Amalthea breaks the popup for the "most recent edit" action. The popup always shows the most recent edit to Main Page because getWiki()
creates a URL with the title
parameter set to the empty string. In this case, since oldid=cur
, MediaWiki has no idea that we want a particular page's last revision, so it chooses Main Page by default. It seems like the old version of that function would've always been correct: even if given a numeric oldid
for a page other than article
, MediaWiki would always prefer oldid
. – Minh Nguyễn 💬 04:52, 28 October 2014 (UTC)
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Amalthea, please apply this fix. It fixes the "most recent edit" links and their popups while preserving the behavior of Special:Diff links. Thank you. – Minh Nguyễn 💬 10:27, 15 November 2014 (UTC)
- Done. Sorry this took so long. — Martin (MSGJ · talk) 15:56, 20 November 2014 (UTC)
Update not to reference magnify-clip.png directly
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Popups references the magnify-clip.png file directly using its path, which is silly because it doesn't even need to. The file is going to be removed soon. See bugzilla:69277 and bugzilla:69678#c10.
Proposed patch:
Remove these lines | Replace with these lines |
---|---|
images_fallback: '//upload.wikimedia.org/wikipedia/commons/', magnify_icon: 'skins/common/images/magnify-clip.png' |
images_fallback: '//upload.wikimedia.org/wikipedia/commons/' |
o += f("<div style='width:?px;'>?", 2+width*1, make_image(filename, caption, width)) + f("<div class='thumbcaption'><div class='magnify' style='float:right'><a href='?' class='internal' title='Enlarge'><img src='?'></a></div>?</div>", htmlescape_attr(Insta.conf.paths.articles + Insta.conf.locale.image + ':' + filename), Insta.conf.paths.magnify_icon, parse_inline_nowiki(caption) ) |
o += f("<div style='width:?px;'>?", 2+width*1, make_image(filename, caption, width)) + f("<div class='thumbcaption'><div class='magnify' style='float:right'><a href='?' title='Enlarge'></a></div>?</div>", htmlescape_attr(Insta.conf.paths.articles + Insta.conf.locale.image + ':' + filename), parse_inline_nowiki(caption) ) |
Matma Rex talk 20:37, 10 November 2014 (UTC)
- Well it worked since 2003, so i'm not sure if that is 'silly', but it is outdated. ;) —TheDJ (talk • contribs) 13:53, 11 November 2014 (UTC)
- Done hopefully. For future info, a sandbox diff of the required change would be appreciated! — Martin (MSGJ · talk) 16:06, 20 November 2014 (UTC)
ResourceLoader
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
I noticed that this gadget doesn't use ResourceLoader, so it isn't getting minified automatically. As a test, I tried enabling ResourceLoader for the Vietnamese Wiktionary's copy of NavPop and quickly ran into a couple of JavaScript errors that broke the gadget. The errors would be fixed by these changes. These changes break support for IE 4–6, which should be perfectly fine because MediaWiki no longer loads JavaScript in IE 7 and below as of MediaWiki 1.24wmf21 (deployed to this wiki in September 2014). Would an administrator please apply these three changes and enable ResourceLoader for this gadget at MediaWiki:Gadgets-definition? Thanks! – Minh Nguyễn 💬 11:12, 15 November 2014 (UTC)
- Please detail the exact change you need to MediaWiki:Gadgets-definition, because I assume these two edits need toi be made simultaneously — Martin (MSGJ · talk) 16:08, 20 November 2014 (UTC)
- Yes, the three edits linked above (633924853, 633925432, and 633986818), as well as the following change to MediaWiki:Gadgets-definition, are all required for this script to work with ResourceLoader:
− * Navigation_popups|popups.js|navpop.css+ * Navigation_popups[ResourceLoader]|popups.js|navpop.css
- – Minh Nguyễn 💬 18:07, 21 November 2014 (UTC)
- Sorry I've lost the diff due to the request above. — Martin (MSGJ · talk) 20:32, 24 November 2014 (UTC)
- – Minh Nguyễn 💬 18:07, 21 November 2014 (UTC)
- User:Mxn/popups.js is up to date with 634705181. – Minh Nguyễn 💬 07:07, 25 November 2014 (UTC)
- Done. Sorry for the delay. I only responded to this because no one else did! — Martin (MSGJ · talk) 10:37, 25 November 2014 (UTC)
- User:Mxn/popups.js is up to date with 634705181. – Minh Nguyễn 💬 07:07, 25 November 2014 (UTC)
- Note: MSGJ — Mxn: Please see Wikipedia_talk:Tools/Navigation_popups#Did_popups_just_stop_working.3F in which this change seems to have broken the tool. — {{U|Technical 13}} (e • t • c) 15:48, 25 November 2014 (UTC)
- Reverted for now — Martin (MSGJ · talk) 17:24, 25 November 2014 (UTC)
- Wow, sorry for the inconvenience! I tested these changes by deploying them at the Vietnamese Wiktionary, and so far there have been no complaints. (That script is identical except for a some code at the end that localizes various strings.) – Minh Nguyễn 💬 20:39, 25 November 2014 (UTC)
Legacy JavaScript
Template:JS migration
Hello! This script has been detected as using deprecated parameters that need to be replaced with the updated version. Examples include addOnloadHook( ... )
needs to be replaced with $( function() { ... } )
; all wgGlobalVariables need to be properly gotten with mw.config.get( 'wgGlobalVariable' )
; and addPortletLink
needs to be called with mw.util.addPortletLink
. Please see MW:ResourceLoader/Legacy JavaScript for details. Thank you. — {{U|Technical 13}} (e • t • c)
20:24, 19 January 2015 (UTC)
- @Technical 13: Could you draft the updated version? --Leyo 00:17, 14 April 2015 (UTC)
- I'm sorry Leyo, I have too much going on to properly code an update for this script at this time. @Amalthea, Krinkle, Helder.wiki, and MSGJ: may have the time and be willing to look it over and make the needed changes though. —
{{U|Technical 13}} (e • t • c)
00:28, 14 April 2015 (UTC)
- I'm sorry Leyo, I have too much going on to properly code an update for this script at this time. @Amalthea, Krinkle, Helder.wiki, and MSGJ: may have the time and be willing to look it over and make the needed changes though. —
JSON parsing
This edit makes the module depend on RL module 'JSON'. —TheDJ (talk • contribs) 20:02, 5 July 2015 (UTC)
- as far as i know, JSON.(stringify|parse) is a JS inbuilt thingy. peace - קיפודנחש (aka kipod) (talk) 16:18, 6 July 2015 (UTC)
- In more modern browsers, yes. In older ones not. In vague ones not. It's better to make sure, actually, it's probably already running because of other dependencies, just not declared. —TheDJ (talk • contribs) 18:54, 6 July 2015 (UTC)
- what i was trying to say is, ttbomk there is no RL module named JSON (or "mediawiki.JSON"). you are probably correct that it would have been more polite to verify that "JSON" is not null, and even better, that
typeof(JSON.parse)==='function'
(and maybe fallback to the previous call toeval()
), but i don't think the first statement of this section is correct. peace - קיפודנחש (aka kipod) (talk) 19:28, 7 July 2015 (UTC) - Right, the module is called json, not JSON —TheDJ (talk • contribs) 11:23, 12 August 2015 (UTC)
- what i was trying to say is, ttbomk there is no RL module named JSON (or "mediawiki.JSON"). you are probably correct that it would have been more polite to verify that "JSON" is not null, and even better, that
- In more modern browsers, yes. In older ones not. In vague ones not. It's better to make sure, actually, it's probably already running because of other dependencies, just not declared. —TheDJ (talk • contribs) 18:54, 6 July 2015 (UTC)
Protected edit request on 25 August 2015
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please deploy the following version of navpopups: source diff. This fixes an error when trying to preview images that are hosted on Commons. —TheDJ (talk • contribs) 21:37, 25 August 2015 (UTC) —TheDJ (talk • contribs) 21:37, 25 August 2015 (UTC)
Gadget-popups.js support for global user accounts via meta global.js and / or gadject selection in meta preferences
- https://en.wikipedia.org/?curid=14574453#global_user_accounts links here
- re: m:MediaWiki:Gadget-popups.js and MediaWiki:Gadget-popups.css (and MediaWiki:Gadget-navpop.css)
- att: / cc: @Amalthea, @Edokter, @JV Smithy, @Krenair, @Krinkle, @Legoktm, @Mr. Stradivarius, @MSGJ, @Nakon, @Salix alba, @Schnark, @TheDJ, @Waldir
Dear friends; I contact you because you have been editing the actual gadget JavaScript code or have been involved in security and other issues about the gadget.
m:MediaWiki:Gadget-popups.js (and the empty m:MediaWiki:Gadget-popups.css) allow user to select the gadget functionality by selecting the gadget in m:special:Preferences#mw-prefsection-gadgets. Unfortunatelly it will not be active at other projects via the (unified?) global user account.
https://meta.wikimedia.org/?oldid=15121460# created by simple copy and paste allowed te generation of some links but did not provide the full functionality known from w:en:, m: etc. Can you please help to get a working version running at meta supporting global accounts? Thanks in advance for all your efforts. Best regards Gangleri (talk) 07:30, 14 December 2015 (UTC)
- Hi! I added code to load MediaWiki:Gadget-navpop.css at https://meta.wikimedia.org/?oldid=15130039# and was verry pleased about the work the gadget code does. In general I select the local language in preferences at every wiki where I sign in. I made a brief tour at wikt:is:, w:is:, w:tn:, testwiki: and w:arc and have find it a good start with Gadget-popups.js despite the fact that not all links have provided popup functionality. In addition the Right To Left (RTL) project in Aramaic was showing some minor directionality issues (the size in bytes is rightmost while the corresponding unit is leftmost). That is all for now. Please do not hesitate to write abouut your experience and list the issues you have detected.
- Best regards user:Gangleri also aka בײַ מיר ביסטו שיין (talk) 19:29, 14 December 2015 (UTC)
- kudos. one small comment to בײַ מיר ביסטו שיין: even though the title _is_ "size in bytes", the actual value navpop shows (unlike history tab) is "size in characters". peace - קיפודנחש (aka kipod) (talk) 21:58, 14 December 2015 (UTC)
- Any more news here? I18n (talk) 18:45, 25 December 2015 (UTC)
- kudos. one small comment to בײַ מיר ביסטו שיין: even though the title _is_ "size in bytes", the actual value navpop shows (unlike history tab) is "size in characters". peace - קיפודנחש (aka kipod) (talk) 21:58, 14 December 2015 (UTC)
@Gangleri: Any user can effectively make this gadget a global gadget for themself by adding a call to the file from their m:Special:mypage/global.js page.
//popups mw.loader.load('//en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-popups.js&action=raw&ctype=text/javascript');
the only difficulty that I have is that it fails for me with an @import of the navpop.css page to that pair. So I cheated and manually copied the whole navpop.css file to my m:Special:mypage/global.css, which works for me, though doesn't update with fixes and improvements.
As I have typed this response I have asked again about that issue to see if we can find a solution. If you need a hand to set up your stuff globally, please ping me at meta m:User talk:Billinghurst — billinghurst sDrewth 06:33, 22 February 2016 (UTC)
short, shorter and shortest url especially for pages with utf-8 titles, whitespaces, RTL characters etc.
- revID: 716004337 diff · PAGEID: 14574453 links here · W3C CSS Validator – ⧼code-rev-purge-link⧽ ↺
- https://en.wikipedia.org/?curid=14574453#shortest_url links here
Hi! Since earliest WMF times wikipedians contributing to non-Latin language versions expressed their wish to have the option to use shorter urls then available through UTF-8 url encoding. The shortest variant for WMF type page urls known to me is
https:{{SERVER}}/?curid={{PAGEID}}#
I think it would be a significant improvement to add PAGEID to the available popups. PAGEID is preserved during page moves but (to my knowledge) not after undelete and for shure not after reimports. These two situalions occur quite seldom so PAGEID would be a good approach.
- notes: a) The "diff"-link is intended for an exploit of diff which allows to analyse the difference between two different but same style wiki pages as in https://test.wikipedia.org/?diff=254163&oldid=254616 . It would make much more sense to create and use a further LUA module which could extract the / all "mw.config.set" values from an arbitrary wiki page and use
https://test.wikipedia.org/?diff={{REVISIONID}}&oldid={{#mw.config.set: wgCurRevisionId | template talk:4x4 type square/T065}}
- Please contact me at the #kavehoyz freenode IRC channel to discuss this plan.
- b) I experimented a lot with portable wiki code between all WMF projects and used interwiki links to the local wiki as in w:en:most-perfect magic square. I am not sure if the gadget code will handle this link as a link to the local wiki. It does not.
- c) Local links in general and "shortest links" in particular should be handeled as normal local wiki links. Example https://en.wikipedia.org/?curid=706451# for the same page as mentioned at b).
- Will be happy for any comment. Best regards Gangleri also aka בײַ מיר ביסטו שיין (talk) 01:36, 15 December 2015 (UTC) / 02:57, 15 December 2015 (UTC)
- Any news here? I18n (talk) 18:44, 25 December 2015 (UTC) / I18n (talk) 06:44, 26 December 2015 (UTC)
Problem with comments and new line in lists
This edit request has been answered. Set the |answered=
or |ans=
parameter to no to reactivate your request.
Hi, sorry for my English! A problem was reported in the German Wikipedia. If the source code for a list element ends with a HTML comment, this comment and also the following new line are deleted for the preview and the next list element appears with a leading star on the same line and not with a bullet or number on a new line. I suggest to change the code in line 3832 to
this.data=this.data.replace(RegExp('^<!--[^$]*?-->\\n|\\n<!--[^$]*?-->(?=\\n)|<!--[^$]*?-->', 'g'), '');
This would delete lines including a new line, if they only consist of a HTML comment, and delete the HTML comment in other cases without joining lines together. Thank you --Wiegels (talk) 23:41, 24 January 2016 (UTC)
- Added a template to call an admin :-) --nenntmichruhigip (Diskussion) 23:47, 12 February 2016 (UTC)
- Done . No other comments so I have deployed this code — Martin (MSGJ · talk) 11:03, 16 February 2016 (UTC)
- Thank you MSGJ! The line 3833 can be omitted now, it was replaced by the code in the new line 3832.
- Another problem occurred after solving the first one. Could you please replace lines 1939 to 1943 by the following lines?
// [[Common links]]
replace(/\[\[([^[|]*?)\]\](\w*)/g, function($0,$1,$2){return f("<a href='?'>?</a>", Insta.conf.paths.articles + htmlescape_attr($1), htmlescape_text($1) + htmlescape_text($2)); }).
// [[Replaced|Links]]
replace(/\[\[([^[]*?)\|([^\]]+?)\]\](\w*)/g, function($0,$1,$2,$3){return f("<a href='?'>?</a>", Insta.conf.paths.articles + htmlescape_attr($1), htmlescape_text($2) + htmlescape_text($3)); }).
- This explicitly prevents the regular expression from matching opening brackets in the first match in each case. The new code was tested successfully. Thanks again --Wiegels (talk) 19:26, 19 February 2016 (UTC)
- Done — Martin (MSGJ · talk) 14:51, 22 February 2016 (UTC)
Feature request for files: have metadata available in pop-up
This script is used universally, and there would be value to have the following added/available to the popup display
- where a file is linked, that the metadata of the file is available, ie. dimensions of file, the size of the file, and if a multipage file eg.djvu, the number of pages of the file.
Now, not everyone is going to want that data, so maybe it is a configurable option. Thanks if someone technically competent can manage that. — billinghurst sDrewth 06:01, 22 February 2016 (UTC)
Protected edit request on 14 April 2016
This edit request to MediaWiki:Gadget-navpop.js has been answered. Set the |answered=
or |ans=
parameter to no to reactivate your request.
I implemented this feature request. The popup that appears when hovering over a user now contains a small gender symbol in the style of userinfo.js.
Line 4328 should be changed to:
url += 'list=users&usprop=blockinfo|groups|editcount|registration|gender&ususers=' + usernameart + "&meta=globaluserinfo&guiprop=groups|unattached&guiuser="+ usernameart;
And the following code should be inserted between lines 4631 and 4632:
if( user.gender ) {
switch( user.gender ) {
case "male": ret.push( popupString( "\u2642" ) ); break;
case "female": ret.push( popupString( "\u2640" ) ); break;
}
}
- xaosflux, maybe you'd want to take a look at this? APerson (talk!) 03:11, 15 April 2016 (UTC)
- APerson was this tested somewhere with someone who had set, then unset their gender (i.e. is it now a nul value, or is it some other value that this doesn't have a default to?) — xaosflux Talk 03:15, 15 April 2016 (UTC)
- xaosflux, yes, I have tested this with people who haven't specified their genders. In that case, no gender symbol gets displayed. APerson (talk!) 03:19, 15 April 2016 (UTC)
- APerson Did you test with someone who did specify, and then later unspecified? — xaosflux Talk 03:34, 15 April 2016 (UTC)
- xaosflux, I switched my gender to unspecified, verified that the symbol didn't appear, then switched it back to male. Do you think I should ask someone on IRC to do so? APerson (talk!) 03:36, 15 April 2016 (UTC)
- Just asked someone on IRC to specify and then unspecify their gender. The patch worked with no issues. APerson (talk!) 03:39, 15 April 2016 (UTC)
- APerson I want to make sure I don't mess up your line numbers bringing this live, I just synced it to: User talk:APerson/jssandbox; can you make your go-live edit there and ping me back here please? — xaosflux Talk 03:44, 15 April 2016 (UTC)
- Done — xaosflux Talk 03:52, 15 April 2016 (UTC)
- APerson - !! this IS the page you wanted edited correct - I think your edit request was pointing at the .css page.?? — xaosflux Talk 03:58, 15 April 2016 (UTC)
- This is the correct page, yeah. APerson (talk!) 04:19, 15 April 2016 (UTC)
Protected edit request on 14 April 2016 (2)
This edit request has been answered. Set the |answered=
or |ans=
parameter to no to reactivate your request.
I implemented this feature request. A "send thanks" option is now available on the action menu for diffs. A version of the code file with this feature implemented is at User:APerson/sandbox/Gadget-popups-with-thanks.js (diff from current code). Thanks!
APerson (talk!) 22:14, 14 April 2016 (UTC)
- Done — Martin (MSGJ · talk) 14:34, 18 April 2016 (UTC)
Protected edit request on 15 April 2016
This edit request has been answered. Set the |answered=
or |ans=
parameter to no to reactivate your request.
Please add the extendedconfirmed group to the list of groups that are not included in the navpop when you hover of a username. This can be done by adding
case 'extendedconfirmed':
to the list underneath
switch (user.groups[i]) {
Thanks
Majora (talk) 01:52, 15 April 2016 (UTC)
Protected edit request on 19 April 2016
This edit request has been answered. Set the |answered=
or |ans=
parameter to no to reactivate your request.
Per this discussion, I've added an option, popupShowGender, to specify whether a gender symbol should be shown on the user popup. This diff shows the change necessary to add the new option, and this version of the script has the option implemented.
APerson (talk!) 03:09, 19 April 2016 (UTC)
- Done — Martin (MSGJ · talk) 08:01, 19 April 2016 (UTC)