Thread:Sylvandyr/@comment-7733174-20130910172414/@comment-4830404-20130910181751

Okay, I do have a suggestion on how to do that.

First thing I want to inform you about is the difference between MediaWiki content pages vs. MediaWiki javascript pages.

MediaWiki caches javascript pages aggressively. This means that any change to a .js file will almost always require a user-side cache clear if the changes are to be viewed immediately. There is nothing you can do except encourage people to clear their caches to get new javascript. So, the most preferable thing to do is put as little into the javascript as you can possibly manage, hopefully stuff that doesn't change very often.

The structures that you have here: http://marvel-war-of-heroes.wikia.com/wiki/MediaWiki:CardSearch.js

These should be put on a MediaWiki page only (non-js). I would rename it to MediaWiki:CardSearch. MediaWiki content pages do not need a user-side cache clear. You can force them to update by using ?action=purge. So http://marvel-war-of-heroes.wikia.com/wiki/MediaWiki:CardSearch.js?action=purge would refresh that page for everyone on your wiki.

The next thing you should think about is creating a separate MediaWiki content page with the card data, which can be updated as you please and immediately refreshed for everyone with ?action=purge. I do not know of a good way to pull from your page here: http://marvel-war-of-heroes.wikia.com/wiki/List_of_All_Cards

In my opinion, you should decide on a convenient structure for your data and then go with that. For example this is our data page for the Breeding Calculator, you can see the variables with View Source: http://dragon-story.wikia.com/wiki/MediaWiki:BreedingCalculatorData

You don't need to go to that length obviously. This is only an example as I do not know what kinds of variable settings best benefit you; you will know that better. But it could be something like this:

cards = {

abombplus: { cardname: "[Going Nuclear] A-Bomb+", charactername: "A-Bomb", alignment: "Bruiser", gender: "Male", rarity: "Ultimate Rare", usage: "Average" },

abomination: { cardname: "[Gamma Experiment] Abomination", charactername: "Abomination", alignment: "Bruiser", gender: "Male", rarity: "Super Special Rare", usage: "Average" },

abominationplus: { cardname: "[Gamma Experiment] Abomination+", charactername: "Abomination", alignment: "Bruiser", gender: "Male", rarity: "Ultimate Rare", usage: "Average" }

};

Note that the id keys inside a dictionary variable must be strings (abcdef not 1234) and they must not contain spaces or punctuation of any kind. Using antivenom as an id would work but the compiler will scream at you if you use anti-venom as an id. The id does not have to resemble the data inside in any way, you could use an id of icecream for a card with a name of "Apocalypse" and it won't matter. Do make sure to have unique ids though. Data doesn't have to be unique, but ids do - you have a lot of "Angel" card names but if you assign different ids, you can differentiate between them.

Once you decide on how to structure your data and stuff or if you have any other questions before you start, feel free to come back and ask :)