Last modified: 2014-05-17 08:38:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T25807, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23807 - Vector: Allow setting collapsiblenav state from user JS
Vector: Allow setting collapsiblenav state from user JS
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
unspecified
All All
: Low enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-05 16:32 UTC by Roan Kattouw
Modified: 2014-05-17 08:38 UTC (History)
10 users (show)

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


Attachments

Description Roan Kattouw 2010-06-05 16:32:08 UTC
For stewards who do lots of crosswiki stuff and have hacked up global user JS for themselves. Also allow disabling EditWarning this way.
Comment 1 Krinkle 2010-06-05 17:46:20 UTC
+1

being able to set something like this:

 `VectorPreferences.editwarning.enable = 0;`

in my @meta global.js would be great
Comment 2 Platonides 2010-06-05 20:46:37 UTC
Just add to your file:
wgVectorEnabledModules.collapsiblenav = 0;

and for editwarning:
wgVectorEnabledModules.editwarning = 0;
Comment 3 Roan Kattouw 2010-06-05 21:36:42 UTC
(In reply to comment #2)
> Just add to your file:
> wgVectorEnabledModules.collapsiblenav = 0;
> 
> and for editwarning:
> wgVectorEnabledModules.editwarning = 0;
This works in vector.js itself, but not in files included with importScriptURI() because of script loading order.
Comment 4 Krinkle 2010-06-07 13:36:29 UTC
Just thought I'd explain this for others to read:

The Vector extension / Vector preferences, in contrary to other extensions and preferences, dont have an effect the enable/disable state directly.

Instead it echo'es something like the following on the page:

<code>
<script type="text/javascript">var wgVectorPreferences = {
	"collapsiblenav": {
		"enable": 1
	},
	"editwarning": {
		"enable": 1
	}
};
var wgVectorEnabledModules = {
	"collapsiblenav": true,
	"collapsibletabs": true,
	"editwarning": true,
	"footercleanup": false,
	"simplesearch": true
};</script>
</code> 

And somewhere after this the actual extension is loaded via javascript and when it initialises it checks these variables.

Because of this it is possible to override the above by putting something in the local user-custom vector.js file because it is loaded in the head-section.

However, functions like onloadHook and importScriptURI() aren't excecuted untill after the page has finished loading (and the extention is initialized) - so toggling some variable switches isn't having any effect anymore then.

--
Krinkle
Comment 5 Andre Klapper 2013-08-31 14:46:25 UTC
[Moving Vector stuff to Vector extension]
Comment 6 MZMcBride 2013-10-01 23:00:07 UTC
Andre: did you mean to mark this bug as unconfirmed?
Comment 7 Krinkle 2013-10-01 23:01:14 UTC
[Moving back as collapsibleNav is now part of core]
Comment 8 Andre Klapper 2013-10-02 08:08:01 UTC
(In reply to comment #6)
> Andre: did you mean to mark this bug as unconfirmed?

Probably mass-reset to UNCONFIRMED due to fixing bug 52943. 
Feel free to reconfirm.
Comment 9 Donald Lancon 2013-10-19 03:01:07 UTC
The ability to override the collapsing of the sidebar items should be restored to a user preference (or a gadget).  Users shouldn't have to cobble together a custom CSS or JS solution to counteract this rudeness.

I don't know why anyone thought "hiding" user interface items was a good idea the first place....
Comment 10 Nemo 2014-05-17 08:38:53 UTC
Problem solved by bug 39035.

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


Navigation
Links