Closed wikipedia-mabdul closed 11 years ago
Yes, it's been on my bucket list for a while.
(function($, mw) {
// Code
}(jQuery, mediaWiki));
REVERTED -- this caused global variables in core.js to not be accessible to the other branches of the scripts. So the encapsulation appears to be a BAD thing for our multi-file script... i'm inclined to actually WONTFIX this now, since interplay between different .js files is critical to the script.
then, well, let us change the variable names (and function names, etc) using a prefix "afch_" (or so).
I don't think you understand...at all.... that's not what the problem is.
http://stackoverflow.com/a/1643340/1934901
It makes the variables not global between files. Bad.
sry, I mean that, if we can't capsule the code within a function, we shouldn't do it and we should use a prefix for EVERYTHING (esp. variables)
oops.
WONFIX as we are currently a multifile global-loving project. Bad us.
/ perhaps a window.afch namespace? /
see code of https://en.wikipedia.org/wiki/User:PleaseStand/segregate-refs.js
that is a really good idea I think. ;-)