Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Nao
3676
Features / Re: Mini-skeletons
« on February 8th, 2013, 09:27 PM »
Quote from Arantor on February 8th, 2013, 07:13 PM
Tempting, very tempting.
Could even just show the links to individual posts, without bothering to show the posts... Hmm?
Quote
I'm still wrangling with design work for the new warning system right now.
Warning? Like, soft banning..?
Quote
Sounds great to me.
Yeah, but it's not so great when it comes to consistency.
I think I should just do <skeleton id="pm" extends="msg" /> and be done with it..?!
Then have skeleton commands like <move> elsewhere. I don't know. But this is also the kind of situation where I wonder, "should a move to the parent skeleton affect the child skeleton as well...?", and then BAAAAAH.
Quote
Not even close. The f-bomb has been dropped many more times today. Lots of stupidity out here in real life.
Err... Okay?
3677
Features / Re: Mini-skeletons
« on February 8th, 2013, 06:42 PM »
'kay, since it'll take a while to answer this, I'll just commit my current work so you can look into it in the meantime!

Done.
Quote from Arantor on February 8th, 2013, 05:47 PM
I've been doing it for months. Look at the time stamps of commits. Even as far back as last May, commits from me for 3am or later were becoming increasingly common. If you look at my stats, there is no hour of the day that doesn't have at least 17 posts attached, and 5am ish has quite a few...
All right Sherlock :P
I guess it just didn't jump to me that it was that regular.
Heck I didn't realize I myself posted a few messages at ALL hours of the day! But apparently, except for 3 posts, 4am is the hour where I'm sure to be asleep!
(Feature suggestion™: make these links clickable to actually see the posts I made at 4am... Wondering if they're intelligible at all :lol:)
Quote
That makes sense.
Implemented :)
Quote
I'd sort of prefer something not in $context but that sounds like where it should be.
Don't worry, as soon as I implemented it, I renamed it to an internal array... It made way more sense as it was a per-skeleton thing anyway.

Oh, can you believe that for the first time in my nearly 38 years of existence, I actually built an OBJECT from the ground up, that is not a SINGLETON, and that is actually more USEFUL than any equivalent procedural/functional code, and easier to read?
I'm astonished. I've always been anti-objects, but weSkeleton at least proved that large, complex code can benefit from being objectified... Well, not the case for Wess though, but I did my best too ;)
Quote
OK, I'll kick off a discussion on it. There are a lot of other things to consider about the aspects attached, and I'll bring them all up.
Thanks!
Quote
That makes sense to me :)
We'll just need to split the existing skeleton into more functions, to make it possible to do these.
I really did a basic one, as you'll see. <msg_author> is just a single block of code, I just didn't feel like splitting it into as many functions as needed. Feel free to do it by yourself, otherwise I'll just do it later on.
Quote
Have whatever that indicates the prefix as part of the subject template bone[1] and that way it can be sorted out by the template.
 1. If it's a skeleton, part of it is a bone.
You mean "new weSkeleton('msg')"? Have a look at the source, that's what I did eventually ;)
Originally I used 'msg' as a prefix, but I figured it was best used as a proper ID, for rendering quirks, i.e. main skeleton vs mini-skeletons. There were at least two places that needed to test against the main skeleton.
Quote
Let the source indicate it is a reply through whatever means it has to but then the template can display it, whether it wants to use an icon or anything else.
My code uses the <skeleton id>, so it wouldn't be able to see the context unless we use a modified skeleton with a different ID.
Hmm, maybe we could do something like... (prototype ahead!)

<copy-skeleton from="msg" to="pm">
  <rename from="msg_author" to="pm_author">
</copy-skeleton>

Or something like that... Thus, no need to copy the actual skeleton, meaning that inherited skins can simply modify the parent skeleton and the rest will follow.
Quote
Makes sense.
Most used word of the day. :angel:
3678
Features / Re: New revs
« on February 8th, 2013, 06:28 PM »
rev 1905 -- Display is now a mini-skeleton! Also, celebrating page 2^7 of this topic :P
(5 files, 17kb)

+ Finally adding the mini-skeleton system we've been talking about for weeks. The Display template now relies on weSkeleton to show individual posts. You can reorder elements in posts as much as you like. Life is beautiful. (Class-Skeleton.php, Subs-Cache.php, Display.template.php, skeleton.xml)

+ Added ability to skip a block/layer only in the next render pass. Just call $your_skeleton->skip('your_block') before $your_skeleton->render(). (Class-Skeleton.php)

* Moved all of the skeleton parsing (and skin-dictated skeleton moves) to the skeleton class, rather than Subs-Cache... (Class-Skeleton.php, Load.php, Subs-Cache.php)

* Naoism: weSkeleton->build didn't really need a reference to the array. I probably did that in memory of the days I didn't know PHP did copy-on-write. (Class-Skeleton.php)

- $removableMessageIDs was not used since rev 1546, where I removed its raison d'être. I forgot to remove it, though... Bad me. Note to SMF/Elk devs: you can also remove it easily and do a search on a specific class name instead... It's always good to save bytes. Also, $alternate wasn't used either (being a duplicate). (Display.template.php)
3679
Features / Re: Mini-skeletons
« on February 8th, 2013, 05:36 PM »
Quote from Arantor on February 8th, 2013, 03:05 PM
I've had sleep, I'm back to bed at 5am, up at just past lunchtime. This is my normal routine, really.
I don't really remember you doing that other than for the last few weeks, except occasionally...
Quote
Actually, I came across a theory about why we work better at night - http://swizec.com/blog/why-programmers-work-at-night/swizec/3198
Started reading... Will have to forward to Milady, maybe it'll help her understand why I'm always systematically pulling a Cinderella... :P
Quote
I'm trying to conceptualise where a temp disable would actually be used. I think the idea's great but I don't yet see an actual 'example case' for it.
Well, this came up when I wrote the mini-skeleton for Msg, really.
For instance, in the template, you get <footer> tags around the footer area if $context['ignoring'] is set. Instead of adding two tests in _before and _after, I figured I could simply disable these functions earlier in the code flow. Then it struck me that I couldn't disable _before and _after function calls, only the entirety of the block (_before, _after and the actual block itself), and adding a setting to disable only the _before and _after would make it look fucked up.
But just after that, I had to create a $context['show_action_bar'] variable to determine whether the action bar should be shown... And it's tested in all three places: before, during and after. In that particular case, having a temp disable could help me disabling the action bar very quickly.

I agree, though, that there's nothing that couldn't be addressed by what I'm doing right now -- $context variable tests in the individual functions.
But it's also an easy addition, I think... (?)
Just set $context['temp_disables'] or something (do you have a better name to suggest...?), and in the render_recursive function, if isset($context['temp_disables'][$id]) then return directly, do not pass Go. Then at the end of the render process, just unset the context var.
Quote
There's absolutely no way to edit a PM once it is sent. I have never once questioned this logic, perhaps I should.
Here's a suggestion... Why don't you post a poll or at least create a new topic to discuss this? I'm sure it's a feature that many people would want -- and also, possibly, would dislike. I personally would rather have it.
Heck, we could even have a feature to delay sending of PM notifications by a minute or so, just like Gmail does to give you time to cancel a sent message ("You're fired!" -- Oops, wrong To: field... Where's that Cancel button?!)
If it detects you're editing the message when it's supposed to send it, it can delay it by an additional minute, etc...
Okay, it's probably a BIT much for not much in return...! But sometimes, it could be helpful. I think.
Quote
OK... what benefit would it serve to be able to edit a PM? Would it serve a benefit? It's not like it's mass-audience[1] and if there's any ambiguity or confusion, it can be followed up with private messages.
 1. In most cases, anyway.
Which is why it may be a 'bit much'.
Alright, we could also simply disable the Quick Edit button in the msg skeleton... :lol:
Quote
This seems to make sense but I think it's the sort of thing that will only truly make sense when it is done and can be poked and prodded.
Plus, I've resumed work on it... Did a few (lot of?) changes in the code path followed to create the main skeleton. For instance, wetem::hide() is called automatically by Wedge if the main skeleton can't be found -- which is either intentional (Ajax data), or accidental (not uploading skeleton.xml to the skins folder). At the very least, you'll be getting the default layer, instead of the "corrupted skin" fatal error. One could argue that the corrupted error is better for debugging, but I'm just not sure about it. For instance, if someone reloads your page WHILE you're upload a new copy of skeleton.xml, they might end up with that error, instead of at the very least getting the content they wanted.

Anyway, all of this can be reverted later...

I've also gotten rid of the prefix.
Will commit my WIP soon. At least, it's working... ;)
Quote
This affects both types of message, incidentally. I'd put it as part of however the subject is set up.
Whadayamean..?
Posted: February 8th, 2013, 03:41 PM

(I've implemented 'temp disables' and renamed it to just... 'skip', which makes more sense. The function is accompanied with a description that explains it's just for the next pass.)
3680
Because thoughts aren't? :P
Granted, there's a hidden option to delete year-old thoughts, but I don't think it's enabled at all... ;)
3681
Features / Re: Mini-skeletons
« on February 8th, 2013, 02:41 PM »
Quote from Arantor on February 8th, 2013, 02:21 PM
I haven't formed an opinion on what's best yet, haven't had my morning caffeine dose. :/
So, you're back to your days under the moon eh..? Preference or just plain chance?
Back in the early 00's, I usually went to bed at 5am and woke up at 11, it wasn't really good for me. True, I work better at night, but come to think of it, I simply work better when I'm off from bed or bed time is closing in. It's not really a matter of being a night owl... To me at least.
Quote
If it's semantically better in the sources, do it. It's not like it is now limiting what theme authors can do with it...
Sure, but theming is precisely one of the arguments that could come in when thinking of whether it's best or not.
If I allow for temp disables for instance, I'm sure themers would be glad to have the ability to do it on their side, regardless of the source file's decision. (Of course, they can also remove the skeleton bit they want out, but temp disabling is precisely about letting go of one item in one particular occurrence, e.g. a first post in the page, or whatever.)
Quote
Message template in a new file is fine, though be careful: PM is slightly different. The buttons are different (there's no quick edit, no mini menu and if there were, the options would be different),
Well, why no quick edit..? I certainly can't think of any reason why there shouldn't be. Email notifications, maybe? The problem is a bit of the same with normal posts...
Quote
PMs do not have an icon, they do have a 'sent to:' bar.
It's the kind of thing that you can hack into...
Possible solutions: include every possible function in Msg.template.php (or whatever), and add/remove skeleton items at Template time. In the skeleton, provide something like <skeleton id="msg" context="topic"> and then the skeleton... And <skeleton id="msg" context="pm"> for PMs. Then provide two different skeletons using the same source. Or have <skeleton id="msg" file="Msg"> for topics, or <skeleton id="msg" file="Msg,PersonalMessage" for PMs, where the skeleton would take both templates and take their functions from both templates. Hmm... No, it would make more sense to do it all by code... In the PM template, run $skeleton = new weSkeleton($message_skeleton) then manually do a $skeleton->replace('body', 'pm_body'), for instance... You'd just need to have a function template_msg_pm_body() in your PM template to accomodate for this.

As of now, Wedge is already smart enough to do that...
It still needs some discussing. Also, the prefix thing... I'm not all too sure about that. It'd probably be confusing and would be best to have a skeleton filled with <msg_...> blocks, even if it makes it a bit bigger. It'll still have the same number of lines...
3682
Lorenzo posted it earlier today in the thoughts I think ;)
3683
Features / Re: Mini-skeletons
« on February 8th, 2013, 02:16 PM »
No problem. What about my other ideas?
Posted: February 8th, 2013, 02:14 PM

Another suggestion. Moving the message template to a new file. Makes it easier to call it from pm or recent posts or whatever. I think I'll do that :)
Posted: February 8th, 2013, 02:15 PM

Oh I misread your post. Do you want to move the render stage to sources then?
3684
Features / Re: Mini-skeletons
« on February 8th, 2013, 11:06 AM »
Mini-skeletons... Done!! :eheh:

The good news is that it doesn't look like it takes a lot of CPU cycles out of the new system. I'm doing reloads on a page and seeing 0.10s-0.13s in 'old' mode, and 0.11s-0.13s in 'new' mode. Could probably get 0.10s too, but I don't really mind... Even if it cost an additional 0.01s per page load, seriously... Who cares?!

I kind of dislike having to reproduce globals for every little mini-block, but that's really the only price to pay at this point...

I have a very basic skeleton for messages, I guess considering the good performance, we could look into expanding it more, to add more flexibility to it.

All in all... A good use of this last hour eheh.
Posted: February 8th, 2013, 09:29 AM

I'm bored! :P Waiting for an e-mail that never comes...

Implemented a prefix system, i.e. if you have a series of template_msg_block functions, you don't have to define 'msg_block' in your skeleton, only 'block', but I don't know if it's very useful or self-explained... Maybe it could add more confusion if anything, I don't know. What do you think..?

Was considering also adding a 'temp disabling' of blocks/layers, i.e. on the next render() call (and only this one), Wedge will automatically skip anything that's in a special array of temporarily disabled blocks and layers. This makes it possible to remove a few tests out of the functions themselves, and move them to the database loop where we get $ignored and other things. Bad or good idea?

And finally, the current system is simple, I'm calling ->render() on every loop as mentioned above, but some people might see it as "moving the source code out of Sources and into Templates". What's best? Calling ->render from where you INTEND to place it, or for instance setting up a 'trigger point' to launch all of the rendering in one go (i.e. no loops in the Display template), after initializing all mini-skeletons in a go from the Sources file? Pro: it's semantically better. Con: we lose the benefit of saving memory... Still, I don't it as a big issue either. Maybe it was important in 2003...? But the number of posts per page hasn't increased in 10 years...
3685
Features: Theming / Re: New theme
« on February 8th, 2013, 10:40 AM »
Quote from Maxx on January 13th, 2013, 01:03 AM
if anyone needs my help on any new theme variations themes, I'd also be glad to give it a go!
What do you mean, don't like mine? :niark:
3686
Features / Re: Template edits
« on February 7th, 2013, 10:46 PM »
I made the commit, so you should be able to get a feel of it for yourself -- there's nothing new compared to what I posted above, though..! Just a few name changes and all.
3687
Features / Re: New revs
« on February 7th, 2013, 10:44 PM »
rev 1904 -- doing this update separately so it doesn't increase the KB count artificially.
(+1-1 file, 238kb)

* Updated jQuery UI local version to 1.10, just like the remote versions. I don't know, though, if it's really a good thing to provide a 222KB minified file for local use... (scripts/jquery-ui-*.min.js)
3688
Features / Re: New revs
« on February 7th, 2013, 10:37 PM »
rev 1903 -- introducing weSkeleton, and fixing plenty of little bugs.
(7 files, 17kb)

+ Rewrote static 'wetem' class into dynamic class 'weSkeleton', allowing for multiple skeletons to be dealt with. wetem is now a separate (but still static) class dealing exclusively with the main skeleton, of course. So you can keep using wetem::load('block') or whatever. (Class-Skeleton.php, Load.php)

! Fixed IP address button (in profile mini-menus) not working at all, and actually even breaking JS entirely on the page. Took time to fix because the codepath wasn't triggered for admins... (Display.php)

! Fixed smileys regenerating their cache on... every... single... page... load. Thank... you... typos. (Subs-BBC.php)

! Fixed HTML validation for user status icons. Thanks... to... the HTML5 standard chickening out -- once again. (Display.template.php, sections.css)

! Fixed JavaScript not loading in Firefox 3.6 and below. This was due to jQuery 2.0 no longer being compatible with it... So we're now falling back to v1.9 for these, too. (Load.php)
3689
Features / Re: Template edits
« on February 7th, 2013, 10:07 PM »
From what I could read, function call > dynamic method > static method, which are the slowest, but it's all in the vicinity of, like, a 5% difference...
Posted: February 7th, 2013, 09:53 PM

We could also, "why not", use this: wetem::$main->load(), where wetem is really limited to just holding a 'public static $main' variable and a singleton to initialize it... Hmm well... :^^;: It's a bit long, though, but it'd be the fastest method, by a small margin.
3690
Archived fixes / Re: Tabs in code tags
« on February 7th, 2013, 09:51 PM »
Quote from Arantor on February 7th, 2013, 09:28 PM
Code: [Select]
<script><!-- // --><![CDATA[
$("img.resized").click(function () { this.style.width = this.style.height = (this.style.width == "auto" ? null : "auto"); });
$(".actions").on("click, ".ip_button", function (e) { return reqWin(this); });

generates the Unexpeced token ILLEGAL on that last line because of the missing " after click.
Didn't need all the headers if it was just that... :P
Okay, so here was the problem: it worked for me because as an admin, I see a different IP link on user names, which redirects me to the IP tracker, rather than a popup (which required the live function call.)
Sorry again...
Quote from Nao on February 7th, 2013, 09:09 PM
My bad, it's not bbc_span, it's bbc_pre
Changed, thank you :)
It works better indeed. The tab size isn't exactly faithful, but there are worse things than that. ;)