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
2701
Features / Re: More sidebar complications...
« on July 18th, 2013, 06:14 PM »
Whether it's legal or not, I don't really care... Apple doesn't like Windows users, and wants to force them into using OS X to debug websites running under Safari Mobile. Good for them. But it doesn't mean I have to fork out $1K for a crappy machine that's going to make me miserable, just like their mobile OS made me miserable over the years. Mind you, I'm not a pro-Google either -- I just installed their new Maps update, and it sucks -- but they're still the ones who innovated on the mobile front in the last few years, and with terms that were far more user-centric...

Anyway, all I need to say is:
- I don't have an iPad, nor do I have plans to buy one. (Maybe an iPad Mini, in the far future, if Google starts trailing iOS...)
- Wedge.org runs okay on my iPod 4 + Safari Mobile.
- Thus, I have no reason to install OS X and debug something that doesn't happen to me...
- Unless they provide an iPad emulator over there, of course.

Do they..?
2702
Features / Re: New revs
« on July 18th, 2013, 09:31 AM »
rev 2185 -- outing!
(3 files, 2kb)

! A faulty equation sign change broke the flood management code in late January, and thus people would be forever locked out of Wedge after failing to log in 5 times. How awkward. Thanks to Farjo for being the one to tell me first, and to myself for reproducing, and finally fixing some code I only touched once, long ago. I hate that. (Subs-Login.php)

! Fixed a couple of minor DOM logic issues with the infinite scroll code, although I have yet to determine whether I'm keeping it this way, or rewriting it from scratch, or not caring at all. (topic.js)

* Spacinazi. Long time uh..? (Login2.php)
2703
Archived fixes / Re: Password flood bug from rev 1879
« on July 18th, 2013, 09:31 AM »
Yeah, on second thought, your version had the same issue, i.e. once the time stamp is older than 10 seconds, it never gets updated again, and thus doesn't serve a purpose anymore... ;)
It was past midnight, etc.

As for screwing up the logic, I'm not going to blame anyone for it, these things happen. It's just unfortunate that in this case, people who were locked out of wedge.org didn't consider e-mailing me, or creating a new account and telling us... :^^;:
2704
Archived fixes / Re: Password flood bug from rev 1879
« on July 18th, 2013, 07:13 AM »
What about the last bit of code? Which one is right, smf's or ours?
2705
Archived fixes / Re: Password flood bug from rev 1879
« on July 18th, 2013, 12:15 AM »
(Moved to a new topic, makes more sense really...)
2706
Archived fixes / Password flood bug from rev 1879
« on July 18th, 2013, 12:13 AM »
As mentioned in the thoughts (private ones[1]), someone has been having trouble logging into the forum.
I looked into it, reset their password, and it still didn't work... They got a brute force warning.

Now, here's the thing. I remembered that Pete had committed some SMF fixes for Wedge, regarding brute force issues, and I'm thinking, that's where the problem lies -- in this fix.
So, is it an SMF bug, or a Wedge bug..?

The SMF 2.1 rewrite:

Code: [Select]
$number_tries = $time_stamp < time() - 20 ? 2 : $number_tries;

The Wedge rewrite:

Code: [Select]
$number_tries = time() - $time_stamp < 20 ? 2 : $number_tries;

From what I understand: first one means, "if recorded flood timestamp is older than 20 seconds ago, reset it to 2, otherwise don't touch it.
Second one means the exact opposite... Meaning, once the flood record is older than 20 seconds, the user is forever locked out of the forum.
It took me an hour to finally find the culprit, and I'd like to know what exactly went into this rewrite..?

Also, the Elk version is cleaner, and much shorter...

Code: [Select]
// Timestamp invalid or non-existent?
if (empty($number_tries) || $time_stamp < (time() - 10))
{
// If it wasn't *that* long ago, don't give them another five goes.
$number_tries = !empty($number_tries) && $time_stamp < (time() - 20) ? 2 : 0;
$time_stamp = time();
}

Finally, a note about the code that tests the timestamp and resets it if it's too recent.. (?)

In SMF 2.1:

Code: [Select]
if ($time_stamp < time() - 10)

(Means "if time stamp is older than 10 seconds...")

in Wedge:

Code: [Select]
if (time() - $time_stamp < 10)

(Means "if time stamp is more recent than 10 seconds ago...")

I'm inclined to believe the Wedge version is the correct one here, but honestly, I have no fucking idea. I'm just not comfortable enough with the whole validatePasswordFlood function, to be clear. I understand what it does, but not the magic of it.
So, err... Need your opinion, guys..?

Hopefully Pete sees this topic through the magic of 3G, or something... :^^;:
Posted: July 18th, 2013, 12:08 AM

Additional note...

Looks like I can login with my hardcoded flood value, but it doesn't get reset to nothing, so I'm still with the same flood value after that... (?!)
 1. I thought that using a public topic for this was okay, because I'm not going into specifics with the source code, and it's close enough to the SMF version anyway, which is freely available on github, so...
2707
Features / Re: New revs
« on July 17th, 2013, 03:46 PM »
rev 2184 -- responsive reload, sidebarred!
(6 files, 7kb)

* More rewrites for the responsive sidebar. (script.js)
  - Sidebar's counterpart should now be found more easily, you don't have to call it with id 'main' or 'offside' anymore.
  - You can now show the sidebar even when zooming in mobile devices, as this limitation was only due to the (removed) swipe gesture.
  - Sidebar showing up should no longer 'bump' the main content by a few pixels; this was due to an outdated use of innerHeight().
  - Hardware acceleration is now also enabled when the sidebar is shown from the left, which wasn't possible before (see the 'transform: none' tweak.)
  - Hardware acceleration detection is now done properly, rather than with browser sniffing. Basically, obscure browsers FTW.
  - Fixed a logic issue with non-hardware mode, but you don't want to know about it, so forget I said anything.
  - More comments around. Comments are good, they allow you to understand what's going on. I hope.

* More tweaks to the sidebar button. (script.js, index.css, sections.css, Wine/extra.css)
  - Added two extra divs to the sidebar button HTML, allowing to customize the bars without playing with border sizes.
  - Moved sidebar button to the beginning of top_bar, rather than the end, allowing for easier placement.
  - Tweaked sidebar button to always keep the same size in mobile devices, whatever the zoom level is.

* Sidebar layout tweaks for Wine and Wuthering. (Wine/extra.css, Wuthering/extra.css)

- Wine doesn't need to move the linktree around, really. (Wine/skin.xml)
2708
Features / Re: More sidebar complications...
« on July 17th, 2013, 01:53 PM »
Quote from Arantor on July 17th, 2013, 03:23 AM
So, here we are in a hotel room with decent wifi and we thought we'd check out the sidebar.
Your non-wifi connection seems decent enough, with Louis posting daily video updates on the road.. ;)
(I must say, it's interesting that I was finally able to see you 'live' after 3 years working together and only knowing you from a single picture, and yet you're 20 times further away from me than you usually are... :^^;:)
Quote
We have an iPad 2 and an iPad 3 (so, one 1024x768 and one 2048x1536 retina display) both running Safari with iOS 6.1.3, neither has been modified or running dev code at this time.
Okay, my setup is (still) as such (I feel I need to make it clear that I can't test everywhere):
- Windows 7, main dev browser has been Chrome Canary for 6+ months, usual test browsers are Opera 15, IE10, and sometimes Firefox Aurora. These days, also Opera 12.16 (cf. comments in the thoughts.)
- S3 smartphone with Android 4.1.2, rooted, using the regular Chrome, with Firefox Beta as my occasional test browser, and very rarely, the stock browser (which I think sucks.)
- iPod 4 with iOS 5.1.x (probably just 5.1), rooted, using the regular Chrome. The only reason I've re-charged it these days, is to play Ron Gilbert's Scurvy Scallywags (very nice game, albeit a bit hard, so reliant on (bad) luck that it can get troublesome...), and Safari used to crash on me, but apparently, these days it doesn't, so I just tried on it...

It looks like the current Safari + iPod version gives me a different result... Instead of having the fixed button on the top right, it shows it on the top left (?!), and only a very small portion of the button, uh... Yeah, sure, great devs at Apple...
Quote
Here's where it gets funky. On the iPad 3 (retina one), I don't see a sidebar displayed, even in landscape. It's hidden and I have to unhide it, which is fine.
Hmm, I think it should have shown it...
You definitely should try remote debugging Wedge from your Mac. You have a Mac, I believe..? Since I don't, and don't plan to ever buy one, I can't debug their stupid Safari, and thus, can't see which media queries are triggered, etc...

The media queries are as such, IIRC ($response = max-width: 1000px):
- "$responsive" hides the sidebar, and shows the sidebar button in the top_bar, where it sits next to the Upshrink icon and Search form.
- "$responsive and min-resolution: 1.5dppx" additionally makes the sidebar button a fixed button, and moves it to the top right corner.
And, that's all there is to it...
The first query should run everywhere (including iPads), if the windows is shrunk. The second query specifically targets smartphones, by ensuring we're both in a low res, AND we have a Retina screen or better. Of course, I could simply test against the OS, or the 'mobile' variable, or both, as it would thus take bad screens into account... But, well. I'm not sure about this.
Normally, an iPad 2 shouldn't trigger the second query, but an iPad 3 and iPhone/iPod 4+ should. As I said, my iPod 4 doesn't show the button entirely, but that's probably down to a change I made yesterday, which I'm bound to cancel at some point, i.e. I changed the button width to use vw units (percentile of viewport width), which is great, but messes up the button in desktop mode, ah ah... (I even had to add an @if mobile test, to ensure it wouldn't screw up.)
Quote
The iPad 2 on the other hand, shows the sidebar all the time, even in portrait mode, even after refreshing the page.
It shouldn't... So, Apple is giving you the complete opposite of what normal browsers would give you. Try Chrome for iPad, will you..? I'm sure it'll magically start working, then...
Quote
Also, I assume the sidebar button is positioned at the top of the viewport when going to a page? I don't entirely know what is intended but here's what I'm seeing on iPad 3: the button appears at the top of the page for wherever I go to. So for this page for example, I came here from other navigation and arrived at #new, so looking at the last post and the sidebar button is aligned with the last post.
Hmm yes.
Quote
Now, aligning it with the top of the page when the user lands somewhere is neat - provided it follows them. Otherwise they could easily jump to the mid point of a page and then not be able to find the sidebar again because the button is somewhere on the page. Now, if it is supposed to follow my movements, it's not doing that.
Then, it's another Safari bug.
iOS didn't support position: fixed at all, years ago, but now it's supposed to... In fact, it does support it on my iPod+Safari, if you don't take the button size into account.
Quote
I did, while writing a long post, see the sidebar button manifest itself on the far right of the page just above the quick reply area, but only for a short while before it disappeared to who knows where - I was writing a long post and didn't see where it went.
It shouldn't happen.
Quote
Wait, if I'm in the editor and delete a line of text, such that I force the content to come back down to me (e.g. long post, I double-hit enter to make new lines then delete those lines) the button will appear on the far right of the page but will move if I cause the editor to scroll in any direction.
Is iOS 7 out, already..? I'm sure they'll do something for Safari, won't they..?
Quote
It's interesting but it seems unreliable to me :( (it's a shame because I can see how hard you've worked but I keep finding things that cause it to break)
It should work much better than before really; reason being, the new implementation is a different philosophy. Instead of doing plenty of changes, it simply hides the sidebar, and then it relies on JavaScript to show the sidebar again, and do the nice animation, when clicking the sidebar button... :-/
So, I'm definitely not going to give up on this, but I'm guessing I'll have to rely on someone with a Mac to do the debugging for me, because I'm not buying a friggin' Apple computer just for the sake of ensuring they didn't screw up with my code, eh...
2709
Features / Re: More sidebar complications...
« on July 15th, 2013, 04:09 PM »
Okay, did some extra modifications... Tested in oldOpera, oldIE, and Chrome. Tested with all skins. Now the skins should all be working great, *and* hardware acceleration is enabled even on Warm and Wine, which is nice. And finally --- the best part is that I'm no longer doing browser sniffing to determine if you can have hardware acceleration, so it should be working 100% for everyone, at last...
2710
Features / Re: More sidebar complications...
« on July 15th, 2013, 03:42 PM »
Yes, I fixed some additional issues with the sidebar. Opera < 15 still doesn't do great, mostly because it has the same problem as Firefox (middle-click -> can't cancel the default behavior for it, but it'll still toggle the sidebar.)
I don't really care about Opera < 15 to be honest, because it's outdated now, and eventually Presto will be used by a tiny, tiny fraction of web users. Opera Blink is still very far from Opera Presto's coolness, and it'll be a long time before I use it by default on my computer, but at least it works when it comes to the sidebar, so... No need to bother too much, just like I decided not to bother with IE6/7 and not give them a responsive sidebar. (Makes things much easier, ah ah...)

As for the extra click -- it's irrelevant. Most implementations of a toggable sidebar do the same, i.e. if you click OUTSIDE of the sidebar, the software assumes you want to get away from it, and thus it hides it. Showing it again, is just a click away.
If you click INSIDE the sidebar, of course it's not going to go away. Actually, I even added some code to ensure that clicking outside the sidebar, but inside a scrollbar, will not close it either.
Posted: July 15th, 2013, 03:40 PM

(Edited.)
2711
Features / Re: More sidebar complications...
« on July 15th, 2013, 12:47 AM »
@spoogs, I'm not sure how I missed that, eh eh... It was a precedence problem, fixed in the latest commit.

@icari> the trigger is 1000px width, not including the scrollbar. Generally, a maximized window in 1024x768 won't trigger it, but if it does, it's not really a problem, considering a ~700px window (sidebar not included) is too narrow to really enjoy a forum, I think.

Anyway, any bugs in Wedge.org should be accompanied with: OS used, browser used (+ version if relevant), and skin used.
Ideally, if you could debug visual issues by yourself, and indicate what went wrong for you, it'd be obviously even better, because I can't access some of the platform combinations...
2712
Features / Re: New revs
« on July 15th, 2013, 12:39 AM »
rev 2183 -- responsive sidebar, reloaded!
(5 files, 5kb)

! Here's hoping I fixed all of the responsive sidebar issues for good... I ended up doing many steps back, and settling on a table layout even in responsive mode. You'll see-- it works fine. (script.js, sections.css)

+ When opening the sidebar in responsive mode, Wedge will attempt to position its content in the most convenient way for you. It's a kind of magic. (script.js)

+ Added left-to-right scrolling for responsive sidebar, when the sidebar is originally shown on the left. Hard-scroll is disabled in these cases, but it shouldn't be much of an issue. (script.js)

@ All of the feature changes above add 500 bytes of JS, but save about 200 bytes of CSS, so it's a fair compromise.

* Increased sidebar width by 20px, because I can. (common.css)

* A few tweaks to Weaving paddings, I'll apply them to other skins later. (index.css)

! Moved Warm's top_bar to its regular place, in an empty version. This should help force the menu button to be visible in Warm, which was not really a given in the first place. (Warm/skeleton.xml)
2713
Features / Re: New revs
« on July 15th, 2013, 12:21 AM »
rev 2182 -- skeleton operations.
(5 files, 4kb)

! The skins, they are a'fixing. It's still far from perfect, but then again, what is? (Wine/extra.css, Warm/extra.css, Wuthering/extra.css)

! Skeleton operations should be doable from within the skin.xml, and I swear I thought it was already possible, hmm... Hopefully, I'm not breaking something else in the process. (Subs-Cache.php)

* Noticed that I never committed a primordial change to the Wuthering skin, hmm... Moving linktrees out of the #edge area. Also demonstrates what skin operations are capable of. (Wuthering/skin.xml)
2714
The Pub / Re: Decluttering/rejigging the top menu a little
« on July 12th, 2013, 04:46 PM »
Or you can just revert the responsive sidebar to the dull one, if you're so insistent that you don't like my new ones...
(Even then, the menu being moved to the sidebar is due to a usability concern of mine -- menus are close to unusable in mobile devices, while the new one IS, and I'm happy with that. Of course we'll need to move the Admin and PM numbers outside of it at some point, but it's not a priority for me. I'm still fighting to get the sidebar to behave everywhere...)

Rest of the post = TL;DR for now.

Re: footnotes, I thought they already behave like that for any block type or something..?
2715
Other software / Re: Powered by SMF footer
« on July 12th, 2013, 11:10 AM »
Removing the credit is something that can be done for SMF, but not for Wedge -- unless we establish some kind of paid 'authorization' to do that per site, right now there's no other way to get known (and thus used) than through this kind of exposition, of course...

But when it comes to SMF itself, I'm sure if it became more widespread, bots would simply get smarter and look for ?action=whatever in the URL, or whatever is SMF-only that doesn't relate to using footer text, really...