Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Mini-skeletons
« Reply #75, on March 10th, 2013, 10:40 PM »
So...

- First implementation of your request is in revision 1988.
- I only dealt with we::is tests, which don't encompass skin options.
- It should be trivial to add support for basic skin options in wedge_skin_condition() (also, feel free to rename the function.)
- But I didn't do it (yet!) because my focus was on harmonizing user/browser tests to also include other specifics that are in skin filenames, i.e. member (instead of just 'guest'), mXXX (member #XXX), bXXX and cXXX (specific boards and categories). And I'm trying to determine if skin options belong here..??! I'd tend to say 'yes, they do', but while it's easy to test against '!SKIN_MOBILE', it's more time-consuming to do more elaborate things like 'SKIN_SIDEBAR == left' in a we::is test... I'd be tempted to say, maybe SKIN_SIDEBAR should be renamed to SKIN_SIDEBAR_LEFT/SKIN_SIDEBAR_RIGHT/SKIN_SIDEBAR_NONE, at least it'd become a simple boolean test... What do you think?
- I've tested exclusively with a single test in skin.xml, where I'm loading a font for myself. It worked. It may break in other situations, and in skeletons.

It's 22:36 and although a bit early to go to bed, I've had a very, VERY long week, I'm tired, and I decided to commit this and let you play with it (and have a chance to comment on my design decisions, or even fix anything), instead of postponing my commit to tomorrow.

So... Have fun ;)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Mini-skeletons
« Reply #76, on March 11th, 2013, 02:22 PM »
Quote
at least it'd become a simple boolean test... What do you think?
I use booleans now. Booleans are cool. (Certainly cooler than using fecking static typed languages)

Haven't had chance to try it yet but I'm excited with the direction things are going :)
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Mini-skeletons
« Reply #77, on March 11th, 2013, 08:15 PM »
I agree, booties are cool.

What do you mean, though? That you agree I should use booleans for the sidebar constant..?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Mini-skeletons
« Reply #78, on March 11th, 2013, 08:20 PM »
I'm thinking it would probably be better, all in all, yes.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Mini-skeletons
« Reply #79, on March 12th, 2013, 08:26 AM »
Implemented, and working. :)
Oh, and you can do silly things like this:

<if !SKIN_MOBILE && member, guest, ie7 && SKIN_SIDEBAR_RIGHT>
  <my_monster_block />
</if>


I know... Very useful :lol:

I'm considering whether to allow for lowercase skin_* tests in skeletons and other we::is() places, though. It does feel more natural to me... I don't know..? Opinions please?

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
Re: Mini-skeletons
« Reply #80, on March 12th, 2013, 08:43 AM »
What does that mean? :P
The way it's meant to be

MultiformeIngegno

  • Posts: 1,337
Re: Mini-skeletons
« Reply #81, on March 12th, 2013, 08:50 AM »
Seems powerful, that block would be displayed to: members with mobile skin AND guests AND who has the right sidebar on. Right?

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Mini-skeletons
« Reply #82, on March 12th, 2013, 10:20 AM »
Nope, it would be displayed to: members if it's NOT a mobile skin, OR guests (in all situations), OR people running IE7 if the skin has set the sidebar to be on the right.

Maybe it's time to get rid of "," as an OR separator, and instead force the use of || everywhere, like in PHP or JavaScript... Since Wess is programmer-oriented and there's already support for brackets, bangs and ampersands, it would make more sense.
Posted: March 12th, 2013, 09:46 AM

The main problem with the <if> implementation, if anything, is that it's never going to be enough...
I've been working on rewriting the skin since last night, and found that:
- there are situations where part of a block is skipped in SKIN_MOBILE (msg_author_group) and forces me to have two identical functions, a mobile one and a desktop one, with the only difference being an extra code block for desktop,
- some blocks are unskippable... Namely, the _before and _after tricks. In msg_author_after, SKIN_MOBILE is also tested, and I can't "skip" this test from within the skeleton. It would force me to write a different wrapper from msg_author just for skins...

But that would result in: <if !skin_mobile><msg_author><blocks for desktop></msg_author></if><if skin_mobile><msg_author_mobile><blocks for mobile></msg_author_mobile></if>... So much for flexibility if we have to maintain two very similar versions of <msg_author>'s before and after pseudo-blocks. :-/

Meh...
I'm still converting the stuff. You'll all decide after that, I guess...
Posted: March 12th, 2013, 10:12 AM

Support for <else> added (and tested). It's so much easier when you don't have to care for indenting (as it's all pseudo-XML), I feel like a cheat! :lol: