Last modified: 2013-04-22 16:16:59 UTC
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.
(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?
We can close it.