Forum:Move away from Anime-Common.js and company?

From Yugipedia
Jump to: navigation, search

While I appreciate the sentiment behind w:c:anime:MediaWiki:Anime-Common.js and its various subpages, this presents an excellent demonstration of just how out-of-date those pages can be, and the problems they can cause. Therefore, I'd like to know if there would be any objections to moving away from using these centralized scripts in favor of local not-quite-copies that we ourselves can maintain and update as necessary. Thoughts? ダイノガイ千?!? · ☎ Dinoguy1000 19:07, February 1, 2011 (UTC)

Period of silence = no objections xD -Falzar FZ- (talk page|useful stuff) 12:19, February 5, 2011 (UTC)
That's pretty much what I was thinking, though I was hoping for a comment from Delt one way or another first. =3 ダイノガイ千?!? · ☎ Dinoguy1000 16:40, February 5, 2011 (UTC)
Are you expecting to see this problem in more places? Would there be any problem in asking to have the Animepedia JS updated? -- Deltaneos (talk) 20:24, February 9, 2011 (UTC)
Not really; my line of thinking is more for future-proofing. If we have full control over what custom scripts and styles are applied on the wiki instead of having to request for someone else to update or make changes, we can more freely play around with stuff. In addition, as far as I can tell, the Anime Common scripts haven't really been touched since 2007, which doesn't inspire much hope for future maintenance, even if we ask Dantman to update the scripts for us this time. ダイノガイ千?!? · ☎ Dinoguy1000 01:19, February 10, 2011 (UTC)

I asked Dantman about it. You can see his reply here. -- Deltaneos (talk) 21:38, February 23, 2011 (UTC)


I finally got around to doing this. We no longer have doubled show/hide links, but, interestingly enough, some of the links still make the browser jump to the top of the page. I'm hoping this is just some other local code that's interfering with the collapsible code.

On that note, now would be a good time to look through the Javascript we currently have and figure out what we aren't using so we can remove it. For the record, we have the following JS in the MediaWiki namespace:

Particularly in Common.js, there's a lot of stuff I'm not sure we actually need, but would appreciate others with more JS knowhow telling me if we use specific functions or not (and if someone feels like stepping up and updating any of the functions we *do* use, it would be much appreciated ;) ). ダイノガイ千?!? · ☎ Dinoguy1000 06:56, March 2, 2011 (UTC)

Some show/hides that are supposed to default to hidden when there are at least two on the page are now defaulting to shown. e.g. Template:Decklist. -- Deltaneos (talk) 13:23, March 2, 2011 (UTC)
Yeah, I noticed that. I think it originates from {{DynamicNavigationBox}}'s use of NavFrame instead of the collapsible tables code. On the other hand, it's the collapsible tables show/hide links that are jumping to the top of pages... ダイノガイ千?!? · ☎ Dinoguy1000 17:55, March 2, 2011 (UTC)
Could it be that their JavaScirpt is interfering with each other? If we changed DynamicNavigationBox to use the same classes as Navbox and removed the NavFrame JS, might that fix things? -- Deltaneos (talk) 01:50, March 6, 2011 (UTC)
I doubt it... The scripts lived together without any problems on Wikipedia for years, and I have similarly used both concurrently without issue on several other wikis. I suspect it's something from Anime-Common.js & company interfering, but my script-fu isn't nearly strong enough to be able to spot any such conflicts, hence my request for review of the code copied here for anything we don't need or anything that could be rewritten. At the very least, the problem doesn't lie with the collapsible table and NavFrame scripts themselves; I re-copied them from Wikipedia to make sure nothing changed when I took care of the rest of this. ダイノガイ千?!? · ☎ Dinoguy1000 02:49, March 6, 2011 (UTC)
Okay. I don't know an awful lot about JavaScript, but looking at the remaining anime common JS.
  • I don't know what the "grabs data from query" stuff does.
  • Sitenotice functions (dismiss override, undismiss function, sitenotice changer). These are hardly the problem, but in the event that they are, sitenotice is now Monobook only and I don't think the few of us using Monobook would mind using the unaltered sitenotice.
  • I don't think the YUI Tabview JS is used anywhere other than a main page suggestion. Uiam, it caused problems with a Yahoo ad in the past. We don't particularly need it and can use Wikia's <tabview></tabview> instead.
-- Deltaneos (talk) 14:26, March 6, 2011 (UTC)
I didn't look very carefully, but it looked like the "grabs data from query" function is used by other stuff. I'll do a more thorough search, and remove the other functions (I don't bother with the sitenotice myself, even just to dismiss it, and I'm not particularly worried about breaking a single, old suggestion page). Here's hoping this fixes the problem. =P ダイノガイ千?!? · ☎ Dinoguy1000 04:06, March 7, 2011 (UTC)
Aaaand... removed. As far as I can tell, queryString() was only used in the Sitenotice code, so it got axed as well (which means all the code from Anime-Common.js, except for hasclass() and the collapsible functions, has been removed). What about the accesskey assignments and the Folding Multi Wiki Tabs code, so we still need those (and if so, is there a newer, non-experimental version of the Tabs code we can switch to)? ダイノガイ千?!? · ☎ Dinoguy1000 04:11, March 7, 2011 (UTC)
Do the accesskeys work for anyone else? They don't work for me. I don't see the problem in removing them if they don't work. It would be handy if they were fixed, but that's another issue. The "Folding Multi Wiki Tabs" is for adding tabs like these. To my knowledge, it's not used anywhere here. The "cardlinks" stuff is all wrapped in an if(skin === "monaco"), so that can't be causing the problem, can it? -- Deltaneos (talk) 18:32, March 7, 2011 (UTC)
I'm not sure where to check to see if the accesskeys work; I can't think of any page that would feature them, unless they were used in conjunction with the code that cloned the card information links in Monaco (speaking of, should we try to update that so it works in Monobook/Wikia?) - that's what it looks like, based on the line $('#ca-nstab-'+wgCanonicalNamespace.toLowerCase()).text(wgCanonicalNamespace.replace(/^Card_/, ''));. I thought maybe the Folding Tabs code was used on the Main Page, but that seems not to be the case ({{Cast}}, {{Latest episode}}, and {{Latest chapter}} use <tabview/>). It's possible it's being used on some userpage somewhere, but I'm not worried about breaking those, truth be told. ダイノガイ千?!? · ☎ Dinoguy1000 19:00, March 7, 2011 (UTC)
And now I get to eat my words. I'm not sure why exactly that code should have caused the page to jump to the top when a collapsible link was clicked (as far as I can tell, the code return killEvt( evt ); should have stopped the click from "registering", and thus should have prevented the page from jumping like it was), but using an older version of the code from another wiki I work at seems to have fixed the issue. ダイノガイ千?!? · ☎ Dinoguy1000 19:16, March 7, 2011 (UTC)
Is checking if the accesskeys work not as simple as going to any page in namespaces listed in the JS and clicking [whatever] + C?
If you know how to get the cardlinks stuff to work in the Wikia skin, I'd say go ahead. I'm sure there are a number of people who don't realise that there are "other card information" links further down card articles.
We're still left with the NavFrame stuff not autocollapsing problem. Any idea what's causing this?
Should we re-add any of the JS that's confirmed not to be causing these problems? -- Deltaneos (talk) 21:00, March 7, 2011 (UTC)
Maybe, I'm still not sure exactly how they're being used (though they are definitely only being applied in the card information namespaces, unless I'm misreading the code (or missing some elsewhere)).
I'll have to see if I can do something with it then. A Monobook port probably won't be much trouble, but a Wikia port could be rather difficult, not least of all because I'm not sure where the best place for the links would be.
Not a clue... CardTable2 has been completely switched to the collapsible tables script, so there shouldn't be that many uses left, though I think {{Decklist}} still uses NavFrames. It would probably be best to move away from NavFrames completely at this point.
Not unless someone specifically requests them, I think. We shouldn't be serving unnecessary Javascript on every page load just because someone somewhere *might* use it (for everyone using the Wikia skin, God knows they already get enough crap pushed to them on a per-pageload basis). ダイノガイ千?!? · ☎ Dinoguy1000 22:17, March 7, 2011 (UTC)
Are we thinking of the same thing when we talk about accesskeys? When you press whatever key(s) your browser specifies + e, that's the same as clicking "edit", + h is the same is clicking "history". In the mainspace, + a is the same as clicking "article". In other namespaces, + c should be there instead of + a, but this only works in the MediaWiki namespaces. It doesn't work in custom namespaces or namespaces used for extensions. I thought that that JS was to get the "+ c" one working in the specified namespaces.
Would it be okay of we replace the content of Template:DynamicNavigationBox with something like {{Navbox|navbar=plain|Navbox parameter name = {{{DNB parameter name|}}}|Navbox parameter name 2 = {{{DNB parameter name 2|}}}|etc.}}? That should take care of >90% of NavFrames. Template:Hidden is another NavFrame template, which would need fixing. -- Deltaneos (talk) 22:37, March 7, 2011 (UTC)
Yes, that's what I was talking about. Many of the accesskeys that are used, I don't know where they are used at, not just these custom ones. If we create MediaWiki messages for the accesskeys, would it work, I wonder?
You mean turn DNB into a wrapper template for Navbox? I think that would be fine, though it also means that any pages currently using DNB would have Navbox contributing twice the amount to the page's template limits that it would if it were used on the page directly (bug 13260). ダイノガイ千?!? · ☎ Dinoguy1000 22:52, March 7, 2011 (UTC)
Well yeah, all pages using DNB should eventually be changed to Navbox. Although that transition could take a while. Is it okay to turn it into the wrapper template so pages don't appear broken for the time being? -- Deltaneos (talk) 23:29, March 7, 2011 (UTC)
All right, I've been wondering for a long time whether you planned to phase out DNB or keep it around. I wasn't arguing against turning it into a Navbox wrapper, really, merely pointing out what would happen if we did (since it means a few pages may end up surpassing the template limits). ダイノガイ千?!? · ☎ Dinoguy1000 05:55, March 8, 2011 (UTC)
I found an used template, which was using Folding Multi Wiki Tabs. -- Deltaneos (talk) 22:42, March 7, 2011 (UTC)
If it was updated to use <tabview/>, would there be any reason to keep it? ダイノガイ千?!? · ☎ Dinoguy1000 22:52, March 7, 2011 (UTC)
On a recent forum, someone asked if it was possible to have tabs set up to let you view different artworks on the main card article. I think this template was intended for something similar, so it might have use if we decide to do that. Although it'd probably be just as easy to put the code directly onto the CardTable2 template. -- Deltaneos (talk) 23:29, March 7, 2011 (UTC)
I think that would be needless complexity myself (as it would just serve to duplicate the Card Gallery and Card Artworks pages), but if it's the route the rest of the community wants to take, I won't fight it. If it does get done, though, we should probably implement the functionality directly into CardTable2, yes. ダイノガイ千?!? · ☎ Dinoguy1000 05:55, March 8, 2011 (UTC)
I don't think we should delete the Monaco css and js pages. They don't do anything, but they aren't interfering with anything and are part of the site's history. -- Deltaneos (talk) 11:17, March 3, 2011 (UTC)


I noticed an immediate difference with the various templates I use, including my talk page archive box, which is now useable again. Thanks a lot.--YamiWheeler (talkcontribs) 17:58, March 2, 2011 (UTC)

No problem, and sorry for breaking it in the first place. ;) ダイノガイ千?!? · ☎ Dinoguy1000 17:59, March 2, 2011 (UTC)