airstruck / love-wiki-version-picker

A version picker for Love's wiki.
The Unlicense
1 stars 2 forks source link

Support box notes #3

Open bartbes opened 8 years ago

bartbes commented 8 years ago

See https://love2d.org/wiki/love.event.push. These boxes provide a nicer UI, and work better with longer lists, see https://love2d.org/wiki/CanvasFormat.

We can, of course, change the template to provide easier access to the available data. Unfortunately I'm not quite familiar with how the code works or I would've done it myself.

From what I can tell the result is two divs, one for the header, and one for the contents, I propose we modify the template to:

I see there's some custom attributes in the page already, so it should be fairly easy to add those to the wrapper div.

airstruck commented 8 years ago

I added some custom attributes to one (or two?) of the other templates with the intention of querying for those instead of text scraping, but never updated the code to look for it. There was something I wasn't able figure out how to do the way I wanted to in the template, but I can't remember what it was now. Something like the version string was enclosed in quotes like "0.10.0" and I wanted to strip it off. I'll take another look later and try to refresh my memory.

bartbes commented 8 years ago

I did notice one of the tags had an attribute (data-version, iirc) with the version as a link, i.e. [[0.10.0]], maybe that's what you're thinking of?

airstruck commented 8 years ago

Yeah, that would be it. If I'm remembering right it ended up as "0.10.0" (with quotes as part of the string) instead of 0.10.0 somewhere, and that was somehow a problem. Could be misremembering though, will take a look tonight when I have more time.

I pretty much have no clue what I'm doing with mediawikia, so I probably managed to screw something up there (it wasn't supposed to be a link, just a string).

bartbes commented 8 years ago

I got it most of the way there by adding the attributes to the templates. As you can see, they do filter now, but their boxes don't fully disappear.

airstruck commented 8 years ago

I guess the only time that blue border (defined by inline style on that div) should show up is when "all versions" are selected. Could move that inline style into stylesheet, use a css class instead, make up a special data- property for those boxes, and whenever picker is updated, give everything with that data- property the css class if "all versions" is selected or remove the css class if anything else is selected.

Nice job getting that working without changing the script btw, didn't think of that approach. We could probably do that in some other places instead of having the script do it.

Is there a way to load the wiki without the version picker so I can test stuff?

bartbes commented 8 years ago

The version picker is tied to the skin, so you can append ?useskin=Vector to the url to disable it.