MediaWiki talk:Common.js/Archive 8: Difference between revisions

Content deleted Content added
nowiki code to be displayed
m <code>...<code> → <code>...</code>
Line 366:
:::: Are you completely sure about that? Objects in javascript can be treated a associative arrays, so one would expect that the reverse would also hold. —''[[User:Ruud Koot|Ruud]]'' 20:30, 24 July 2007 (UTC)
:::::Array in Javascript is not "Associative" by itself, I think [http://www.andrewdupont.net/2006/05/18/javascript-associative-arrays-considered-harmful/ this article] should explain it better than me. In any case, <code>javascript:alert("user" in wgUserGroups)</code> (in browser address field) shows false in all browsers I tried.
:::::By the way, everybody seems to have their own version of "call Sysop.js" code, here's mine: <code> if (wgUserGroups && (wgUserGroups[0] == "sysop" ) && !window.disableSysopJS)</code>. Advantages: most simple and efficient; works right now; if it stops working, people who notice will be able to fix it :) ∴ [[User:Alex Smotrov|Alex Smotrov]] 03:49, 25 July 2007 (UTC)
 
::::::Personally I just use something like <code>wgUserGroups.join(' ').indexOf('sysop')</code>. --[[User:Splarka|Splarka]] ([[User_talk:Splarka|rant]]) 07:16, 25 July 2007 (UTC)