MediaWiki talk:Gadget-ExtraTabs2.js

Latest comment: 1 year ago by 2607:FB91:151E:8BE5:7D41:170B:9F65:767A in topic Facebook


From MediaWiki_talk:Extra-tabs.js edit

Secure server edit

This doesn't work on the secure server.  :-( I'll try to think of an if-then + regex block that will fix it, but I cannot guarantee anything.  ;-) --Iamunknown 21:07, 12 October 2007 (UTC)Reply

Opt-out badly needed edit

The old way of opting out of having these tabs doesn't work. Would someone please figure it out; see my recent edits to this, MediaWiki:Monobook.js, MediaWiki:Gadget-RemoveImageTools.js for an idea that I couldn't get to work, though it does at en.wikibooks. – Mike.lifeguard | @en.wb 22:14, 3 April 2008 (UTC)Reply

Just delete the definition var load_extratabs = true at the top of MediaWiki:Monobook.js, and it'll work. You forgot that in your edit. Lupo 06:31, 4 April 2008 (UTC)Reply
/me hugs lupo :D – Mike.lifeguard | @en.wb 14:45, 4 April 2008 (UTC)Reply

Links broken on secure server edit

{{editprotected}} See e.g. [1]. The fix is fairly simple: change all URLs starting with '/w/index.php?' to start with wgScript + '?' instead, and similarly change the one instance of '/wiki/Image:' + imagetitle to wgArticlePath.replace(/\$1/, 'Image:' + imagetitle). I'd just do it myself, but I'm not an admin here. —Ilmari Karonen 08:05, 9 May 2008 (UTC)Reply

Should work now. – Mike.lifeguard | @en.wb 19:17, 9 May 2008 (UTC)Reply
Are the recent changes to this page the reason why the "check usage" and "wikipedia" tabs are no longer present on image pages? —Angr 10:57, 10 May 2008 (UTC)Reply
That's what I thought, but reverting didn't help. Rocket000 11:12, 10 May 2008 (UTC)Reply
Looks like someone broke Common.js yesterday. —Ilmari Karonen 13:10, 10 May 2008 (UTC)Reply
I fixed the problem with Common.js, and js seems to be working for me at least. Could someone confirm that this now works properly on the secure server? – Mike.lifeguard | @en.wb 14:45, 10 May 2008 (UTC)Reply
All I know is images still have no "Check usage" and no Wikipedia links. —Angr 20:37, 10 May 2008 (UTC)Reply
Could you please provide a less vague error report? – Mike.lifeguard | @en.wb 22:44, 10 May 2008 (UTC)Reply
Clear your browser cache. —Ilmari Karonen 01:02, 11 May 2008 (UTC)Reply

...and yes, it seems to mostly work now on the secure server. The toolserver links on user pages are still broken, though; to fix those in a way that can be reused on other projects, you'd need to add something like the following code after the line that reads var tab_project = wgServer.replace("http://", "");:

if (wgServer == "https://secure.wikimedia.org") {
    // on the secure server, the project name must be extracted from the path
    tab_project = wgScriptPath.replace(/^\/([a-z0-9\-]+)\/([a-z0-9\-]+)\/w$/, "$2.$1.org");
    tab_project = tab_project.replace(/^(commons|species|meta|incubator)\.wikipedia\.org$/, "$1.wikimedia.org");
    if (tab_project == "foundation.wikipedia.org") tab_project = "wikimediafoundation.org";
    // add other exceptions (e.g. wikipedia/mediawiki -> mediawiki.org) here, if support for them is added on toolserver 
}

Ilmari Karonen 01:28, 11 May 2008 (UTC)Reply

Did that & thanks for the code :) – Mike.lifeguard | @en.wb 13:56, 11 May 2008 (UTC)Reply

URL-encoding breakage edit

{{editprotected}}

The prematurely applied URL-encoding of the page title is causing the code in global_add_user_tabs() to fail to strip any subpage suffix from the username. A simple fix would be to replace the line

username = username.split("/")[0];

with the line

username = username.split("%2F")[0];

I'd say the preferable change would be to pass the titles around unencoded (or not pass it at all, and just refer to the global wgScript as needed), and only call encodeURIComponent() when something is actually being embedded in an URI. That would require more changes to the code than I can conveniently summarize here on the talk page, though. —Ilmari Karonen (talk) 19:07, 24 December 2008 (UTC)Reply

  Done, but if you'd like to put code here or on a subpage for a better fix, feel free.  — Mike.lifeguard | @en.wb 05:27, 25 December 2008 (UTC)Reply

Tab for user pages (Geocoding) edit

Please note my proposal at Commons talk:Geocoding#"Geocoding todo" and User pages. It was announced on VP on Saturday (COM:VP#Geocoding). It would imply to add the following to this script:

Details
Line to add to the interface strings
 var tab_geocodetodo = 'Geocoding todo';
Line to add to the function global_add_user_tabs (username), after " 'ca-untagged'); "
 global_append_tab('http://toolserver.org/~para/GeoCommons/geocodingtodo.php?user=' + username , tab_geocodetodo, 'ca-geocodetodo');

Depending on the outcome of the discussion, I will make a protected edit request. -- User:Docu at 14:18, 27 July 2009 (UTC)Reply

I think it should be a gadget. Kwj2772 (msg) 14:23, 27 July 2009 (UTC)Reply
Please participate in the discussion at Commons talk:Geocoding#"Geocoding todo" and User pages. -- User:Docu at 14:26, 27 July 2009 (UTC)Reply

Duplicate Purge tab edit

This script adds a duplicate Purge tab on image pages if a user has Gadget-purgetab enabled. It should check if #ca-purge exists before adding it. Edokter (talk) — 17:02, 25 June 2011 (UTC)Reply

This is the talk page for Extra-tabs. Maybe you should try the one for Gadget-purgetab. --  Docu  at 20:34, 25 June 2011 (UTC)Reply
Why? This gadget produces the duplicate (and incomplete) one. Since it also already has checks in place, it would seem easier to correct it here. Edokter (talk) — 21:02, 25 June 2011 (UTC)Reply

Rewrite: Version 2 edit

Moved to MediaWiki talk:Gadget-ExtraTabs2.js.

Please help us testing this new gadget and report errors there. This script should be deactivated ASAP.

New default gadget? edit

Hi folks,

I rewrote this script at MediaWiki:Gadget-ExtraTabs2.js. A bit more object oriented, documentation comments and brought up to date by using more built-in functionality from the mediaWiki and jQuery library. I'd appreciate it if some people try it out and let me know if there are no regressions.

Localization

Interface messages now use MediaWiki's native javascript msg functionality by adding the key/value pars to the mw.messages Map and getting them through mw.msg(). This also makes it easy for translations since it doesn't require translating everything at once. Nor does it break when a new message is added to the English object.

The reason for this change is in preparation for ResourceLoader version 2, which, among other features, will add native localization support to Gadgets. Just like gadgets have scripts/styles/dependencies/rights right now, they will also get a list of messages which ResourceLoader will preload from core, extensions and MediaWiki-namespace. This will make it even easier for translators and completely removes the need for JavaScript knowledge in order to handle localization.

Some translations still have to be ported. Compare this with that).

Links

Links are now centrally kept in a group of arrays with the properties (link target, link label and target portlet). I wanted to turn it into a literal (ie. extraTabs.links = { file: [ ... ], user: [ ... ] } but because the username is dynamic (ie. SpecialBlockIp and SpecialContributions set it later) I kept it as a function.

Try it

Go to Special:Preferences#preftab-gadgets and enable ExtraTabs2 (it automatically disables the current version).

Thanks, –Krinkletalk 00:19, 26 August 2011 (UTC)Reply

Some comments:
  1. It still produces a duplicate Purge link. Common links should be checked for existense.
  2. Add properties for title captions and hotkeys. Edokter (talk) — 09:06, 10 September 2011 (UTC)Reply

Localization: can we please have localizations as subpages of the current script location, i.e. of MediaWiki:Gadget-ExtraTabs2.js and not of MediaWiki:ExtraTabs2.js. Thanks. Rd232 (talk) 16:29, 23 November 2011 (UTC)Reply

  Done Hopefully I didn't break anything. -- RE rillke questions? 17:36, 23 November 2011 (UTC)Reply
Thanks. Tested OK with nl interface language, so seems fine. Rd232 (talk) 19:36, 23 November 2011 (UTC)Reply
I dont see these header tabs translated in Dutch, while all other tabs are. Does it still works? Michiel1972 (talk) 17:50, 5 May 2012 (UTC)Reply
I guess you have a fast machine and a normal or slow connection or your browser simply treats JS different.
The script currently does not wait for the translation to be loaded. If it is loaded after the document is ready, the tabs are not translated. We would have to apply a similar fix like on MediaWiki:Gadget-Stockphoto.js but not if Gadgets 2.0 come in-between the next month. Perhaps Krinkle knows when we'll get Gadgets 2.0 where we can use MW-messages for translation. Regards -- RE rillke questions? 20:07, 5 May 2012 (UTC)Reply

WikiSeense gallery edit

Special:ListFiles is a poor substitute of [2]. I think we should change the gallery tab of Special:Contributions to the later, or at least provide both tools. Platonides (talk) 22:24, 18 July 2012 (UTC)Reply

It was changed to Special:ListFiles when Toolserver was down. What about changing this tab to Gallery tool? -- Rillke(q?) 08:42, 19 July 2012 (UTC)Reply
Looks good. Moreover WikiSense Gallery could be linked there at the side of Filelist, in case it turns out to be more useful for someone. Platonides (talk) 13:46, 28 July 2012 (UTC)Reply

Translations edit

Translations do not work. I've tried changing my preferences to some languages with subpages avalaible but tabs headers appear always in English. Two years ago there was a comment above about translations. Not sure if it was fixed or it is still pending. --V.Riullop (talk) 15:15, 23 February 2014 (UTC)Reply

Yes, I can confirm that, I've never seen an translation of this. I saw this only that there is one by an hint from Rillke (maybe it is better to use not the importScript function, because of the asynchronous load time ). Is is also not better to use mw.language.getFallbackLanguageChain()!?User: Perhelion (Commons: = crap?)  18:48, 24 March 2015 (UTC)Reply
Something to fix for @Krinkle: Whether translations are used or not depends on whether the $(document).ready event fires before translation is loaded through AJAX or after. About the fallback - this will be a little hard - script would have to either know which translations exist or it has to try up the chain one by one. -- Rillke(q?) 20:09, 24 March 2015 (UTC)Reply
@Rillke and Krinkle: I mean this load technique at beginning would solve this issue!? @Rillke I mean we can also solve this alone!? :PUser: Perhelion (Commons: = crap?)  09:34, 2 June 2015 (UTC)Reply
@Rillke and Perhelion: Fixed, Special:Diff/162414304. –Krinkletalk 14:34, 2 June 2015 (UTC)Reply
  Done It works! Thank you! (And sorry I posted to wrong diff-link, fixed now)User: Perhelion (Commons: = crap?)  17:35, 2 June 2015 (UTC)Reply

Toolserver edit

{{Edit request}}

All toolserver links are down, please substitute or delete. --2A02:810D:1080:23D8:90B8:A19C:CB1:67A5 19:39, 23 March 2015 (UTC)Reply

Can you give us a hand and specify what to substitute and what to delete? Thanks! -- Rillke(q?) 21:15, 23 March 2015 (UTC)Reply
Wikisense is here now: http://tools.wmflabs.org/wikisense/ . Catdown seems to be lost. --2A02:810D:1080:23D8:90B8:A19C:CB1:67A5 22:37, 23 March 2015 (UTC)Reply
  Not done Stale request. --Jarekt (talk) 14:10, 6 November 2015 (UTC)Reply

Request: change naming "Gallery" edit

Hello, there is a conflict in the naming of the so called "Gallery" functionality, because lately there are also more videos and sounds uploaded, and another wide-used gadget used the name Uploads for the same functionality with the small distinction for the own files. (This all comes to speak in the German Forum and the #Translation fault). The meaning of Gallery is also more like an prefabricated and representative view (not only on Commons) and not an arbitrary upload history. What do you mean? RegardsUser: Perhelion (Commons: = crap?)  22:23, 24 March 2015 (UTC)Reply

Broken i18n of "Generate thumbnail" edit

As User:MaGa pointed outhere, the translation of "Generate thumbnail" seems to be broken. It is handled by "extratabs-thumbPurge-label" and it is defined in many languages; however it does not seem to show up in those languages. For example:

I do not understand JS very well but it seems to be set up at MediaWiki:Gadget-ThumbnailPurger.js which is called somehow by MediaWiki:Gadget-ExtraTabs2.js. --Jarekt (talk) 18:32, 11 January 2016 (UTC)Reply

  Fixed -- Rillke(q?) 18:49, 11 January 2016 (UTC)Reply
  This section is resolved and can be archived. If you disagree, replace this template with your comment. Rillke(q?) 18:49, 11 January 2016 (UTC)

Catscan edit

{{Edit request}} Link to catscan should be updated:

//tools.wmflabs.org/catscan3/catscan2.php?
//petscan.wmflabs.org/?

--тнояsтеn 19:04, 30 October 2016 (UTC)Reply

I think we should just add a link to petscan but keep catscan around, as it has much simpler interface. --Jarekt (talk) 14:40, 18 November 2016 (UTC)Reply
Any admin keen on doing it? --тнояsтеn 06:25, 18 April 2017 (UTC)Reply
  Done --02:46, 9 May 2017 (UTC)
Thank you. --тнояsтеn 06:13, 9 May 2017 (UTC)Reply
  This section is resolved and can be archived. If you disagree, replace this template with your comment. тнояsтеn 06:13, 9 May 2017 (UTC)

Fix links edit

{{Edit protected}} When checking the links this gadget creates from File:Whose Knowledge? logo.svg, I noticed that a few of them were broken because of the question mark in the filename. When looking into the script, I also noticed it uses the deprecated wgTitle parameter, so I went ahead and adapted the script to use wgPageName instead. So I made some changes to the script, and can confirm they are all working as they should, so could someone please make those same changes in this script? Thanks. Jon Harald Søby (talk) 11:11, 4 April 2018 (UTC)Reply

  Done Awesome! Thank you! -- User: Perhelion 19:20, 28 June 2018 (UTC)Reply

CatScan a.k.a PetSacn edit

{{Editprotected}} Please remove CatScan from this tool because 1) it doesn't work properly; 2) it exists as a separate tool (MediaWiki:Gadget-CatScan2-link.js). 4nn1l2 (talk) 13:22, 27 April 2019 (UTC)Reply

For more background information, please see Special:Permalink/347468493#CatScan and Petscan. 4nn1l2 (talk) 13:34, 27 April 2019 (UTC)Reply

  Done Awesome! Thank you! Zhuyifei1999 (talk) 16:55, 1 June 2019 (UTC)Reply

Usage of all files edit

It seems that the link leads to a wrong page on glamtools. For example, on Category:Own works by rubin16 it leads to
https://glamtools.toolforge.org/glamorous.php?doit=Do%20it!&category=Category%3AOwn_works_by_rubin16
but it should be
https://glamtools.toolforge.org/glamorous.php?doit=Do%20it!&category=Own_works_by_rubin16
I wasn't able to find the way to fix it at the moment :( rubin16 (talk) 14:17, 3 August 2022 (UTC)Reply

Facebook edit

Blocked account 2607:FB91:151E:8BE5:7D41:170B:9F65:767A 16:27, 12 September 2022 (UTC)Reply

Return to "Gadget-ExtraTabs2.js" page.