Page MenuHomePhabricator

(Changed) element IDs and scripts
Closed, ResolvedPublic

Description

In the current version of the vector skin several element id's have been changed from the parent monobook.js skin. Several of these changes were without any obvious technical need but are breaking the compatibility with existing user scripts and gadgets.

As a workaround for this, people had to create "compatibility layers" that are now added as gadgets that unnecessarily clog the preference page (see http://en.wikipedia.org/wiki/Wikipedia_talk:Twinkle/Bugs#TW-B-305), script developers have to add additional code to their script just to keep their scripts compatible with monobook as well as vector, and user scripts that are no longer actively maintained have stopped working.

I kindly ask the skin developers to undo these (cosmetic and invisible) ID changes as long as this is possible and, in the future, keep the script developers in mind when improving the skin. Some of the affected elements are (from http://en.wikipedia.org/wiki/MediaWiki:Gadget-vectorskin-thunks.js):

p-cactions -> actions
p-personal -> personal
p-search -> p-navigation (?)
p-logo -> logo
column-one -> panel
column-content -> content
globalWrapper -> content (?)

Thanks in advance.


Version: unspecified
Severity: normal

Details

Reference
bz19527

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:37 PM
bzimport set Reference to bz19527.

Amalthea.wikimedia wrote:

FWIW, I endorse that. In addition to the ones above, others have been changed without apparent reason, for example the namespace pages:

  • ca-nstab-main → ca-main
  • ca-talk → ca-main_talk, ca-template_talk (this has some merit in my opinion, but you only went half the way since the captions are still all taken from the same msg:vector-namespace-talk)
  • ca-nstab-project → ca-wikipedia (this one is very bad, the ids should always follow the canonical namespace names so that scripts and css are easily portable between all languages, and of course at e.g. ru-wiki you end up with the "ca-.D0.B2.D0.B8.D0.BA.D0.B8.D0.BF.D0.B5.D0.B4.D0.B8.D1.8F")
  • ...?

For something related, is it really a good move to add skin-specific messages?

I second this as well. Any such changes where these can be avoided, please avoid. The skins are too much of a mess already for most of the scripters.

The one change that i like is the namespaces change, but I would like to see the talk page tabs getting a class of their own (ca-talk?). That will make it easier to find the talkpages in the namespace area.

At the very least, would it be possible to get the older classes added as alternates to the new Vector ones?

E.g. <span class="ca-nstab-main ca-main">

(In reply to comment #3)

At the very least, would it be possible to get the older classes added as
alternates to the new Vector ones?

E.g. <span class="ca-nstab-main ca-main">

We're not talking about classes, but about IDs. An element cannot have multiple IDs.

(In reply to comment #1)

  • ca-talk → ca-main_talk, ca-template_talk (this has some merit in my

opinion,

but you only went half the way since the captions are still all taken from
the same msg:vector-namespace-talk)
  • ca-nstab-project → ca-wikipedia (this one is very bad, the ids should

always

follow the canonical namespace names so that scripts and css are easily
portable between all languages, and of course at e.g. ru-wiki you end up
with the "ca-.D0.B2.D0.B8.D0.BA.D0.B8.D0.BF.D0.B5.D0.B4.D0.B8.D1.8F")
  • ...?

All of these were fixed in r52806.

For something related, is it really a good move to add skin-specific messages?

Brion says it is...

  • Bug 19502 has been marked as a duplicate of this bug. ***

The following are working now, just as they were in monobook...

  • p-personal
  • p-search
  • p-logo

The following will not work, because vector works fundamentally differently, and if we make these IDs the same, it will cause unwanted results anyways.

  • p-cactions
  • column-one
  • column-content
  • globalWrapper

(In reply to comment #4)

(In reply to comment #3)

At the very least, would it be possible to get the older classes added as
alternates to the new Vector ones?

E.g. <span class="ca-nstab-main ca-main">

We're not talking about classes, but about IDs. An element cannot have multiple
IDs.

Aah, that would be my bad, then.

actions -> p-cactions in r52855

i don't think changing #search to #p-search is a good idea.

some old scripts expect #p-search to be in the left column, but now, it is not there anymore. if it's named #search now, this can be a message telling script developers to change their method of using left column and search box.

if someone needs to locate the search box, he/she can use #searchform, both in monobook and vector. it's what i'm doing.

sorry for clicking on a wrong radio button.

I do not see why you have to break scripts that might work perfectly fine just to tell a message to somebody who might even no longer be available.

it's not working properly, and it may make debugging more difficult.
also, if #p-search doesn't exist, we can make -thunks.js to "redirect" it. if it exists, then...

The change in r52816 is the desired functionality.