Last modified: 2014-09-24 00:05:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 21119 - A button on the page to toggle hidden categories
A button on the page to toggle hidden categories
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-reviewed
Depends on:
Blocks: javascript
  Show dependency treegraph
 
Reported: 2009-10-12 23:38 UTC by Andrew Dunbar
Modified: 2014-09-24 00:05 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
It makes a link in the bottom of the page for the hidden category links (1.51 KB, patch)
2012-03-28 07:51 UTC, akshay chugh
Details

Description Andrew Dunbar 2009-10-12 23:38:54 UTC
Sometimes you want to see hidden categories of the article you're reading just for a moment. You don't want to navigate away to the preferences to change the hidden category setting then navigate back to the page you were reading.

This especially happens for people that mostly just read but sometimes edit.

Since the hidden categories are there just hidden by CSS it would be trivial to add a checkbox in JavaScript to toggle between display:none and display:block
Comment 1 Brion Vibber 2009-10-14 17:43:28 UTC
I, too, would welcome our new hidden-category overlords.

Andrew, maybe this would fit in with the category editing widget you were experimenting with?
Comment 2 Andrew Garrett 2009-10-14 17:46:20 UTC
(In reply to comment #1)
> I, too, would welcome our new hidden-category overlords.
> 
> Andrew, maybe this would fit in with the category editing widget you were
> experimenting with?

Possibly, although it'd be just as easy to add this separately.
Comment 3 akshay chugh 2012-03-28 07:51:40 UTC
Created attachment 10337 [details]
It makes a link in the bottom of the page for the hidden category links

Two changes have been made to achieve this effect :
1. Skin.php
if ( isset( $allCats['hidden'] ) ) {
....
.....
$s.='<a id="mw-toggle-cat" href="javascript:void(0)"><i>Show hidden categories</i></a>';
....
....
}
This statement adds an anchor element just below the div(#mw-normal-catlinks)

2. Mediawiki.page.ready.js
....
...
var toggleCatBool = true;
	$("#mw-toggle-cat").click(function(event){
			$("#mw-hidden-catlinks").toggle();
			var text='';
			if(toggleCatBool)
				text='Hide Hidden Category Links';
			else 
				text='Show Hidden Category Links';
			document.getElementById("mw-toggle-cat").innerHTML='<i>'+text+'</i>';
			toggleCatBool=!toggleCatBool;
	});
....
....
This manages the toggling behavior of div(#mw-hidden-catlinks)
Comment 4 Sumana Harihareswara 2012-03-28 16:52:28 UTC
Akshay, please go ahead and submit this as a branch in Git.

https://www.mediawiki.org/wiki/Git/Workflow

That way it can get reviewed faster.  Thanks.
Comment 5 Max Semenik 2012-03-29 21:22:28 UTC
> Akshay, please go ahead and submit this as a branch in Git.
This patch would require a complete rewrite, no point in pushing it at the moment.

* Unlocalised text.
* Weird <a id="mw-toggle-cat" href="javascript:void(0)"><i>Show hidden
categories</i></a> that will not work with JS disabled. Instead, JS should generate such links completely.
* Mix of jQuery and raw JS.
* Code style.
* Messages must use sentence case.
Comment 6 Sumana Harihareswara 2012-03-30 04:44:58 UTC
Marking patch reviewed.  Akshay, are you interested in rewriting to address Max's criticisms?
Comment 7 akshay chugh 2012-03-30 05:19:43 UTC
(In reply to comment #6)
> Marking patch reviewed.  Akshay, are you interested in rewriting to address
> Max's criticisms?

Okay , I would address the issues pointed out by Max and submit a new patch.
Comment 8 Max Semenik 2012-03-30 06:31:47 UTC
For the reference: https://www.mediawiki.org/wiki/Manual:Coding_conventions
Comment 9 akshay chugh 2012-03-30 12:48:16 UTC
(In reply to comment #5)
> > Akshay, please go ahead and submit this as a branch in Git.
> This patch would require a complete rewrite, no point in pushing it at the
> moment.
> 
> * Unlocalised text.
> * Weird <a id="mw-toggle-cat" href="javascript:void(0)"><i>Show hidden
> categories</i></a> that will not work with JS disabled. Instead, JS should
> generate such links completely.
> * Mix of jQuery and raw JS.
> * Code style.
> * Messages must use sentence case.

I have committed the changes to gerrit.
changeset link - https://gerrit.wikimedia.org/r/3981 
It takes care of all the issues you pointed out earlier.
Comment 10 Antoine "hashar" Musso (WMF) 2013-02-12 14:28:05 UTC
I have abandoned change 3981 for now so it does not clutter people dashboards. IF there is really an interest in such a feature and someone willing to continue this change, feel free to reopen it.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links