This was first added by Sparkla: <http://eq2.wikia.com/index.php?title=MediaWiki%3ACommon.js&diff=140053&oldid=139000>
What it needs to test first is if wgUserGroups is defined So the "if" clause must be: if (window.wgUserGroups && <add here the rest of the if clause>) If wgUserGroups is not defined, null or false, the if clause won't continue to test the other conditions, and it wouldn't break. Any sysop of eq2 wiki could fix it. 2007/12/9, Chris Stafford wrote: > in Firefox2 > > Error: wgUserGroups has no properties > Source File: > http://eq2.wikia.com/index.php?title=-&action=raw&gen=js > Line: 245 > > in ie6 > > Line: 246 > char: 1 > Error: 'wgUserGroups' is null or not an object > code: 0 > url: <doesnt matter, same for all pages while not logged in> > > when logged in (atleast for me, milage may vary by user) > var wgUserGroups = ["bureaucrat", "sysop", "*", "user", "autoconfirmed", > "emailconfirmed"]; > > when not logged in, this varible does not exist, so it its not an array. > > > > from whatever/where ever title=- loads from > > // > ************************************************************************************************ > > // Admin tool displayer > // If an object has class="adminTools" and style="display:none;", > // it will be displayed for sysops > if(wgUserGroups.join(' ').indexOf('staff') + > wgUserGroups.join(' ').indexOf('sysop') > -2) > addOnloadHook(addMainPageTools) > function addMainPageTools() { > var at = > getElementsByClassName(document.getElementById('bodyContent'),'*','adminTools'); > > if(at.length==0) return > for(var i=0;i<at.length;i++) { > at[i].style.display = 'block'; > at[i].className += ' plainlinks'; > } > } > the above code need to check that wgUserGroups is an array first, before > attempting to use it like an array > > http://www.google.com/search?q=javascript+check+for+array > > lots of examples > > > _______________________________________________ > Wikia-l mailing list > [email protected] > http://lists.wikia.com/mailman/listinfo/wikia-l > > _______________________________________________ Wikia-l mailing list [email protected] http://lists.wikia.com/mailman/listinfo/wikia-l
