Page MenuHomePhabricator

Add edit count metric (wgEditCount) to user-specific config information available in page source
Closed, ResolvedPublic

Description

I'm not sure it's still technically CDATA, but there are values in the page source that JavaScript scripts can easily look up (e.g., wgPageName and wgCanonicalNamespace). It would be helpful to be able to easily look up a user's edit count using a wgEditCount variable. This would help with targeting scripts to more experienced or inexperienced users, for example, without needing a separate API call.

I'm not sure what the behavior should be for logged out users. I think wgEditCount = 0 makes the most sense, though maybe there are better alternatives.


Version: unspecified
Severity: enhancement

Details

Reference
bz28484

Event Timeline

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

(In reply to comment #0)

I'm not sure it's still technically CDATA, but there are values in the page
source that JavaScript scripts can easily look up (e.g., wgPageName and
wgCanonicalNamespace). It would be helpful to be able to easily look up a
user's edit count using a wgEditCount variable. This would help with targeting
scripts to more experienced or inexperienced users, for example, without
needing a separate API call.

Per-user stuff should be added in Skin::makeGlobalVariablesScript() IIRC.

I'm not sure what the behavior should be for logged out users. I think
wgEditCount = 0 makes the most sense, though maybe there are better
alternatives.

Zero sounds good to me. Scripts can already detect whether the user is logged in or not anyway.

See https://gerrit.wikimedia.org/r/#/c/45257/ , by Ori Livneh.

I think null is less misleading than 0, though.

(In reply to comment #2)

See https://gerrit.wikimedia.org/r/#/c/45257/

Patch obsoleted by https://gerrit.wikimedia.org/r/#/c/51081/ and merged.
Is anything else needed or can this be closed as FIXED?