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.

Topics - Nao
46
Features / One theme to rule them all?
« on November 10th, 2013, 11:09 PM »
So, these days, the skin system has become really, really powerful. Powerful enough to be able to replace themes altogether, but it's up to you to decide.

- Theme settings: the equivalent is in skin.xml, in a thoroughly documented XML format; you can provide your own settings in custom.xml.
- Templates: while right now you can't simply replace an existing template, you can:
   (1) write replacement functions for any template in your own Custom.template.php
   (2) write replacement functions for any template in skin.xml (or custom.xml, etc),
   (3) add code before or after an existing template function (through methods 1 or 2)
   (4) very easily add any custom JavaScript or CSS to any template.
   --> Overall, I think I could also provide the ability to override entire templates, but I'd like to avoid it, as it may easily break compatibility in the future. But really, it's just a matter of checking the skin folder, and loading the template there, instead of the 'default' template folder.
- Plugins, and skins, can already override, or add to any template functions, manipulate the layout skeleton so that one element will be shown before another instead of after it, etc.
- The only thing that isn't possible for now is completely overriding image sets, or language files, or scripts. I may write code in the future to account for these.

I don't really see anything that can't be done in skins. Granted, it might be easier to do some things in SMF and the theme system, but it's also true that some other things are much easier in Wedge, so... All in all, I think the skin system is better, more modern, and better suited to designers.
Removing themes from Wedge would allow me to...
- Simplify the folder structure. All folders in /Themes/default/ would be moved to the forum root.
- Remove a lot of legacy code from Wedge that I don't even know if it still works at this point. (I think it does.)
Drawbacks:
- It will postpone the first beta release by at least another two weeks.
- Likely to create bugs in the first phase of implementation.
- Heck, personally, I certainly hope I can still 'blame' files and view the 'commit history' for any files that have been moved, without any disruption. I think it'll be all right, but really, it's one of the things I'm worried about. I like blame, it's one of the best tools for debugging in (D)CVS software. Certainly saves me a lot of time.

So, please vote if you have any opinion on this!
47
Features / Relative dates
« on November 10th, 2013, 12:42 PM »
Talking with Pandos reminded me that I needed to open a topic about this.

So, a few weeks ago, I wrote a quick, rough implementation of relative dates for Wedge. They behave like in Facebook or other 'modern' software, or, closer to us, ElkArte. I wanted pages to validate, and still use valid semantic tags, so I adopted the time tag, and used DATE_W3C as the datetime format, it's longer but more 'solid', and takes timezones into account.

At that point, I had: <time datetime="w3c valid date">Absolute date</time>
Okay.

I used JS to transform absolute dates to relative dates, and it's pretty neat and tidy. I'm happy with it.
But JS has this tiny little problem: it doesn't execute immediately (whatever you may think), and as such, the browser first shows the page with absolute dates, then executes the JS, and replaces dates with relative dates.
The problem is that I didn't realize this because I usually do page reloads, and Chrome is smart enough to execute the JS ASAP and thus I never see the absolute dates. However, if I simply move to a new page, I can see the absolute dates for a split second. I don't like that.

The solution would be to then use relative dates right in the HTML, but what if I want to know the exact date a message was posted at..? I'll have to keep it in a title tag (when right now, the title tag is generated on the fly from the contents of the time tag. Smart enough.) So, that makes this kind of line: <time datetime="w3c valid date" title="Absolute date">Relative date</time>

And, believe me, I think it's wayyyy overkill just for providing an accessible way of getting a relative date. I was already unsure about committing my HTML/JS work with the first version, but this one... Well, it's just not cool.
Not only that, but what if the user likes absolute dates better? Oh, well, I guess I can then simply change the HTML I'm printing out, I guess... I can wrap it up inside a small helper function, provide it a timestamp and then expect Wedge to do all the work for me. Okay, I'm okay with that. I can do that. The only thing I'm not looking forward to, is adding the UI for it, even if it's simple, because I'm rather remove user options than add them, but well, I think it's something that polarizes users more than "number of topics per page", I'd say.

But the extra length of time tags, I'm not sure it's worth it... :-/

So, two questions... Do you like absolute or relative dates better, and do you think it's all worth implementing (considering if I do, I'll add a setting to let you choose your preference)?
Also, when it comes to relative dates, how far away (ago?) do you think it's worth reverting back to absolute dates? I'm not exactly the kind of guy who enjoys seeing a "6 years ago" date. I prefer to see "May 2007", but maybe that's just me. I also don't like seeing "3 months ago" either, but I'm fine with "5 days ago", so... I guess it's a fair question.

PS: oh, another one... I also think it'd be really cool to see "5 days ago at 8:54" rather than just "5 days ago". Oddly, I've never seen this kind of implementation, anywhere...
48
Features / Getting jolly well lost in Wess color transforms...
« on November 6th, 2013, 01:49 PM »
So, in case you didn't know, the Wess engine for CSS pre-processing allows you to apply several functions to color values.

For instance, darker(#fff, 10%) would return something like #eee (not exactly that value, but you get the point.)

Yesterday, I was looking into taking rgb values without an alpha channel, and apply a channel to them. To do that, I did alpha(rgb(99,99,99), .1), hoping for it to return rgba(99,99,99, .1)... Of course, it didn't do that. It return rgb(99,99,99), because the '.1' was understood was Wess as "add .1 (10%) of the alpha channel's currently value to the variable". Given that the current value was 1 (100%), the final value would be just the same, as it's clamped to 1.

So, I looked into my code a bit, and yes, I never documented it, and yes I always meant to, and no I don't have much time for documenting my stuff these days.
It's still a pretty powerful system, but what you need to know is: you can never 'force' a value with it, you can only influence an existing value. For instance, to return rgba(99,99,99, .1), I should instead do alpha(rgb(99,99,99), -.9) or alpha(rgb(99,99,99), -90%).
That makes sense. But what when you don't know the original value, and you just want to set a default alpha value..?

I figured out that thing: if you add a sign before the number, it should be a relative value to apply, and with no sign (- or +), it should be an absolute value.
I then proceeded to rewrite my code, and am done now, but I'm at a loss when it comes to 'understanding' it all, and most importantly, helping others understanding it.

I'm going to try, but please tell me if there's a better way to do this all, or if I forgot anything.

alpha(rgba(9,9,9, .5),  33%) => rgba(9,9,9,  .33) (forced, so: 33% = 0.33)
alpha(rgba(9,9,9, .5), +33%) => rgba(9,9,9, .665) (0.5 + (0.5*33%) = 0.665)
alpha(rgba(9,9,9, .5), -33%) => rgba(9,9,9, .335) (0.5 - (0.5*33%) = 0.335

alpha(rgba(9,9,9, .5),  .33) => rgba(9,9,9, .33) (forced, so: .33)
alpha(rgba(9,9,9, .5), +.33) => rgba(9,9,9, .83) (0.5 + 0.33 = 0.83)
alpha(rgba(9,9,9, .5), -.33) => rgba(9,9,9, .17) (0.5 - 0.33 = 0.17)

So, basically, you can do any operations you like this way, but of course I'm concerned about the fact that percentage values aren't the same as floating point values when using signs. Is it too complicated? Or does it, on the contrary, make sense..?
Or maybe, even better, I just need to point people to this topic, so that it can make sense to them...? :P
49
The Pub / Stupid git?
« on October 23rd, 2013, 09:48 PM »
I'm doing this topic in the public area, in the hopes that:
(1) my issues may be resolved by more people,
(2) anyone can learn, too, and later be able to contribute to the repo when it's made public.

So... Wedge is now a git repo (yaaaaay...), and leaves SVN behind. (I'm not completely finished with it, as I plan to restore revision numbers through either tags or notes, whatever is best, in the future, when I have a bit more time to devote to that.)

Git is a complicated beast to master, and I'm only getting started.

Notably, what needs to be 'understood' is how communicating between repos is made. Since it's not stored on a central server, no repo is the 'right' repo, so I consider the right repo to be my local repo. For all intent though, it's exactly like the BitBucket private repo I have right now, since my 'origin' ref is set to that one.

There are 4 matters that I wish to solve before I can continue. (Maybe 5, but I can't remember the last one, it'll come back to me.)

1/ When doing a pull from my remote origin, TortoiseGit fails because some files I've edited locally were changed in the meantime on the remote repo. It told me to stash my uncommitted changes, but I can't find a stash command in TortoiseGit. So, I fired up SmartGit, and tried to pull from there. It offered me a choice between merging and rebasing. I chose merging as it's the default Git behavior, but they recommend rebasing. However, I want to keep branches, to make it easier to find areas that were pulled from another branch obviously. Apparently, it was the right choice, because my logs are identical between HEAD and origin/master, so it looks like it copied the history straight from the remote origin, right..? Still, I'm lost, I'm not sure what's best for communication between my repos.

2/ In my current situation, I'm pushing my own changes to the remote origin directly, when I could be doing a repo on my account, and then push it to the team account's repo. However, I don't know how to do these pushes manually or automatically, especially on a remote server, so... A bit stuck. FWIW, I don't know how the current collaborators (Pandos and TE) can merge their own branches with the updates on the official repo. Honestly, it eludes me. I need some frigging documentation on that, I guess.

3/ Bitbucket sucks, somehow. They won't allow me to add a fake e-mail address to my account, so I can't associate nao@wedge with my own account. Sucks. Big time. However, since it will end up at github eventually, it won't be a problem, soon. However, my biggest problem is that Bitbucket uses my 'actual' e-mail address for web-based commits (e.g. pull requests), thus I currently have, in the online (private!) repo, my e-mail address in the clear. I don't want that. Github provides no-spam addresses, so I'm okay with that, but BB doesn't have anything. I'm forced to commit with that e-mail address, no way to conceal it.
I tried 'amending' my latest commit, but it didn't work. I don't know if it's because the latest commit is not technically from my git account that I can't seem to actually amend it, or if it's just how it works (doesn't work). I did 'git commit --amend --reset-author' in a bash window, and it simply launched a Vim page with the commit data. I didn't know what to do, so I just closed the window. TortoiseGit didn't offer to amend. SmartGit offered to do it, but I can't seem to make it work. Finally, Git Gui did the amend as I asked, but it didn't change the author at all (couldn't find an option to --reset-author, which probably didn't help.)
Anyone knows how I can fix that particular commit....?

:edit: Actually-- I just restarted my TortoiseGit log (which I'd only 'refreshed'), and it marked the commit as using my dummy e-mail address. Yoohoo! Well, it's still not cool that I'm going to have to amend all of my future pull request merges, but... Well, it's an extra incentive to hurry up and go public, ah ah...!

4/ Right now I have 36 uncommitted files, with three thematic changesets: privacy rewrite, contact list stuff, and miscellaneous one-bits. Is there a way to split these into several branches, so that I can safely work on them separately, and then commit as needed? Or do I absolutely need to create a branch, then start my stuff? I'm guessing I could always 'stash' the changes, then create a branch, then unstash..? (But then I need to selectively stash for each file, which I don't think is possible, ah ah...)

Okay, that's all for now...

I'm a bit annoyed that I've been spending the better part of the last 3 days working on the git innards, instead of actually committing my private rewrites, but... Whatever. I have to do it. It's the only way Wedge can keep up, at this point. It's so easy to do pull requests, I want to enable anyone to do them. I'm just hoping I can live up to it, see..? What's a fantastic git repo, if the maintainer isn't able to do the basic stuff...? :P
50
Features: Miscellaneous / Contact lists
« on October 19th, 2013, 01:20 PM »
Feature: Contact lists
Developer: Nao
Target: users
Status: 80% (contact lists implemented, format is final; privacy implemented. need to remove buddy lists.)
Comment: this is a bit like the Facebook feature, but Noisen-style. Feel free to ask if you want more details.
51
Development blog / The zombie strikes back
« on September 18th, 2013, 11:10 AM »
So... It's been over a year since the last blog post, and a few weeks since we celebrated the 3rd anniversary of the creation of this little project called Wedge, that took the life of two promising web developers and turned them into lifeless zombies with a crave for blood. Oh, maybe I meant vampires.

For those of you who didn't follow the latest developments on the forum, I'm sad to announce that one of the zombies is now officially resting in peace, carrying his own head, basking in the glory of his past achievements. Said zombie we called Arantor, and in pure retirony style, he decided to call it quits a couple of days before the anniversary. And I'd planned to show up at his door on that day and give him cookies! Well, no cookies then. Blame that good old UK craze about cookies.

And here we are. It's lonely at the top, but at least it means I get to make some hard decisions that we always postponed because we weren't sure about them. Same for Pete on his side, I'm guessing, albeit with other projects. I'm hoping we'll still see him pop up from time to time, and share his disbelief about how badly I handled the project. I always appreciate constructive criticism, after all.

Now, here's the point I wanted to address. There you go, Pete's state of mind up to this point was that we had no plans to release Wedge in the near future, that we didn't even have a tentative release date, and that it was even unlikely to ever happen. I understand his position, I'm not going to put the blame on anything; fact is, yes we slowly drifted apart as collaborators in the last couple of years, mostly because of real life issues for each of us, and because the weight of the project started to get very heavy year after year. The longer you wait until release, the more pressure you put on yourself to make it worthy of the wait.

And this is my first decision.

I'm putting Wedge on the road it should never have left: the road to release. Not the road to completion, which is a different thing altogether. With such a huge project, one man alone just can't complete the project. At most, he can do 80% of it, but he has to rely on other people to do the rest, simply because there are always some tasks where you know that other people will do a better job; that's what kept Pete and I together for so long, and I was hoping it would remain that way, because we really were complementary on most points. Working alone is not easy. Some days, you just want to say "screw Wedge!", and watch a movie or a TV show for hours. And you know what? I'll do just that. I've seen tons of silly and better movies, and I'm still going back to Wedge every day, because if there's something I'll never, ever give up before it's out for the public to enjoy, it's Wedge. Even if it doesn't bring me a dime, I need to finish it.

So, what's the tentative release date? Nope, sorry... There still isn't any. And before you ask why -- ask yourself whether you prefer to be given a wrong release date, or be told exactly what remains to be done to have a releasable product. To the former, I'll just say this: I'm hoping to release a public beta before the end of the year, and a final 1.0 in early 2014. Do what you want with that silly date, and if you're in too much of a hurry, and you consider yourself to be a hardened, hardboiled, hardcore, hard-wired forum administrator with a taste for trouble and a love for HTML/JS/CSS/PHP/FTP tweaks, you can always contact me with a request for private beta access and a copy of the SMF importer code.

To the latter, I'll be more thorough. First, I'll try to list a few of the things I wanted to do since day one, and will probably not do in the first release... Aeva Media is a monster to handle, it used to be my full-time (unpaid) job. I wanted to redo so many parts of it. Most importantly, I wanted to replacement attachments with media items; I'm still planning to do it, but if it's not done when everything else is ready, I'll still release. Also, Noisen.com features... I wrote many features for my personal website around 2007-2008, and was adamant I'd include them. Pete persuaded me otherwise, for very good reasons mainly, but now that he's gone, I can decide, if I want, to fail in a spectacular fasion. Go get the pop-corn. Again: if it's not ready when the rest is, I'll still release.

And now, for the features that I can't see myself release without.

- Privacy (estimated amount of work: a few weeks) : there are already some privacy features in; thoughts have privacy. Topics have some sort of privacy. I'm hoping I can do board privacy, à la Noisen, and profile privacy, à la Facebook. And fix an annoying bug in the 'Contacts' option: if you post a thought for your contact list, and someone replies to it, and you're not in their contact list, then you won't be able to view their reply. To be honest, I've thought of several solutions for that, but it's hardly anything solid, or at least efficient.

- Contact lists (a few weeks): so far, Wedge has been using SMF buddy lists, while Noisen has been using a customized version of Ultimate Profile (a nice little SMF mod from back in the day), where I allowed you to 'hide' a contact from view, and nice little things like that. Contact lists are my biggest project right now, I've already started work on them, but still need to write the UI, and some other things, to make them usable. The idea is that you can categorize your friends into multiple lists, choose the list name, and even determine the visibility of said list to profile viewers; you should be able to add people to multiple lists, and target a thought/topic privacy to a specific list. (Not multiple lists -- it's already complicated as it is, UI-wise.) My biggest issue right now, is handling the aftermath of adding someone to a list. Should they be notified of it? Should a list have a setting to determine if notifications should be issued? Et cetera, et cetera...

- Skins (a few weeks?): there are two things here.

(1) I'm not sure whether I should enforce sub-skins to be put inside a parent skin's folder (which I always found to be a natural thing to do), or simply require them to specify the name of their parent (author:skin_name) in a skin option. The latter option would allow skins to have folders for images, templates, etc. without the need for a different folder naming scheme, such as adding an underscore (_) before the name of any folder that isn't a sub-skin.

(2) As I discussed recently in the Friends board, I'm very, very tempted to remove themes from Wedge entirely. Just like Pete removed SMF packages when he finished his implementation of plugins, I'm in a similar situation where my skin system can do 99% of what templates can do, and it's just tempting to say, "themers have to re-learn mostly everything anyway, so I might as well get rid of that relic." Recently, I implemented one of the last things missing from skin features -- the ability to override/before/after a template function from within a skin.xml file. It was already possible to override a function through the use of a Custom.template.php file inside the skin, but it's not a rock solid solution because of the possibility of conflicting function names, and I only added this as a way for themers to 'test' their replacement code in a comfortable PHP editing environment, before they simply move their functions to an XML editing environment, without the proper syntax highlighting.

- AeMe comments (a week?): I'm planning to remove them entirely, and replace them with regular board topics. The idea is to create a generic board (hidden or not), where topics are created on the fly when posting a comment to an album or a media item. The advantage is that you get to comment on whole albums as well, and that you can search inside media item comments. The drawback is that I'm not planning to write an import tool for existing comments. They'll either have to go, or Thorsten (@TE) will have to account for them in his fantastic OpenImporter tool. Oh yes, and another drawback-- I'll have to handle attempts to access a media comment topic directly, by redirecting to said media item (or album). I don't know how I can do it efficiently, though.

- Others (weeks? months?): There are, I'm afraid, many other things that I'll attempt to fix before I go public, but none of these should be as big as the aforementioned items. When added up, though, they will probably take more time than them to complete, and there's always the tiny issue that my to-do list always seems to grow twice faster than I can shorten it. I'll have to pick a time when I figure that, well, it's okay Nao, it's okay... You can release.

With great power, comes gr... Oh no, not that Spider-Man crap again. But still, Wedge is an important project, one that could bring a nice breath of fresh air to the forum world, and even to the CMS world. As in, "community management system", not "content". I'm devoted to making Wedge a great, fun way to communicate with people, be they your friends or ephemeral guests, and help them feel at home and find the answers they seek.

And if it works, then maybe, in some way, it wiil also be the answer I've been looking for.
Get to work, Nao... Now!
52
Archived fixes / User box screwing up post height in quick edit mode
« on August 28th, 2013, 11:18 PM »
This is a downside of the nice user box code... If you quick edit a long post, the post won't resize to adjust to the textarea. This is because the user box area is 'fixed' in height.

Can be solved in at least two ways...
- Temporarily un-fixing the user box when editing a post. Downside: if the user box is position:fixed at that exact moment, it will potentially overflow to the next post.
- Adjusting the textarea height to the current post height (with a set minimum). This seems to make more sense, but if the post is more than one page tall, it's obviously not going to work... So, it's even worse.

I guess I can't expect anyone to know my code well enough to offer a third suggestion, but just in case... Please let me know ;)
53
The Pub / Font size in Chrome Android
« on August 28th, 2013, 11:12 PM »
Story of my life...

(click to show/hide)
I've been having some quite *shitty* week, so far.... After my very bad news from last week; after Pete calling it quits; now I've got a friend who came to visit, and showed me his CloudMobile (which I recommended to him, although I'd never seen it in action, and wanted to), and I wanted to show him a 'bare' Android install and installed CyanogenMod on my second ROM, and then it turned out that it was the first ROM and the stupid device had wiped my entire data set... GREAT!!!

So, if I have to reinstall, I thought, I'll install Android 4.2.2 (instead of 4.1.2), and on my S3 it's not an official ROM, it's basically a leak from Samsung, and there are many things missing, in addition to the, err, additions. Mostly, I think I preferred my old ROM, so I'll probably take another few hours to reinstall it (boo hoo...), but in the meantime:

- It has no Helvetica S (ouch), although it has a very interesting Samsung Sans font,
- Its Roboto is horrible. The font size is much smaller than on my previous ROM. I don't know if it's due to being 4.2.2, or the custom ROM I used being too... bold.

As a result, the wedge.org homepage shows much smaller characters to me in Chrome for Android, and it's like I have to restart from scratch... Obviously, I don't want to play the 'guess' game, and I'd like to ask you guys to... post a screenshot of your wedge.org page being rendered in your mobile device.

- You can either choose the wedge.org homepage, or this very post. It would make more sense to choose this post, as you can take a screenshot right now... ;)
- You can use Chrome for Android, or the stock browser on your device. Not anything else, please. You can do both, if you want.
- If you have the same results as someone else with the same setup who posted a screenshot before you, please don't post your screenshot, just confirm or like their post.
- On Android, the screenshot shortcut is usually Power + Volume Down. On some devices, you need to swipe your entire hand (the pinky should pretty much touch the screen, and the hand should be perpendicular to the screen), from left to right, to generate a screenshot.
- On iOS, it's Power + Home.
- Just attach the screenshot in your post.
- Indicate: your OS and OS version, your browser name and version, and any changes you may have applied to your setup (e.g. whether it's a custom ROM, or you did something to change the font face, or size, etc.)

This should, hopefully, help me determine what's the 'correct' size right now, and what I should be aiming for.
54
Features / Getting rid of zebra classes
« on August 21st, 2013, 06:00 PM »
Quote from Arantor on August 20th, 2013, 04:34 PM
You don't need to get rid of windowbg everywhere.
Oh, on the contrary, I need to...
I think we need to have a 'generic' class for areas that need to apply a background, whether striped or not, but I don't really know... Just 'bg', maybe, would be fine..? But form vs. function, etc... So, just 'window' or 'win'...? Well, 'windowbg' never really made sense, I mean, it was never about 'windows', more about simply areas with alternating colors, so... 'zebra'? No, we need to ensure that the class can also be used on non-alternating areas, hmmm...
Quote
One at a time - there's already postbg specifically for posts, target that first. Then one for the thoughts list, and so on and so on. Eventually yes, windowbg will go and that's a good thing. Ideally each major area should have its own set of classes so that it's easier to style at will - while it will take slightly more CSS, the per-page saving could be surprising - because you wouldn't necessarily need to leave in all the classes; I don't know what 'root' does but I see no reason why you couldn't flatten down 'root postbg(2)' to simply postbg,
.root is mainly used by JS to determine the closest message ID, but over time, I started styling it as a 'generic' way to target a post container, and it can be renamed as you wish.
Quote
There are precisely two XenForo sites I know of that don't look like XenForo. Every other installation just screams XenForo. Ditto for IPB. Anything that introduces behaviour that is dependent on rewriting layout markup is going to be fragile.
It's always a fine line, between creativity and customizability... Just ask Bloc, I guess... ;)
55
Off-topic / 3D'ing
« on August 3rd, 2013, 11:22 AM »
It would mean 140k, though... :^^;:
56
Features / Soft merging of posts
« on July 24th, 2013, 11:07 AM »
Better temperatures here today, so I figured I could get more work done on Wedge...

In terms of innovations, I'm not particularly fond of trying to figure out new ones, but I have to say it feels good to do things that I haven't seen done elsewhere, and I'm trying not to get stopped by 'reality', and do things my own way.

So, one of the things that have always bothered me, is merging of double-posts. It's a feature I've loved since day one (as you may remember from my stint on the 'Merge double posts' mod on sm.org, and generally adding the same feature in here by default), but that was in contradiction with another feature I wanted in: threaded view.

The trouble with threadles

Threaded view, as controversial it is, as 'outdated' it might be to some (and I'm not saying it isn't), implies that if you answer every single post in a thread, you'll end up with a lot of double posts, but if you start merging them, you'll end up with a long post that loses its association to the thread parents, and that is, if you'll forgive me, absolutely FUCKED UP.

I started considering doing a 'soft' merging of these posts, i.e.: the posts are not physically merged in the database, and instead they're only merged in the template if there are two or more posts by a same user in the same level.

Skeletons in the closet

Here's where it gets complicated. Ever since I introduced mini-skeletons for topic posts, it became harder to do anything like rendering only parts of a post. I made a modification to the skeleton class, where you could specifically ask it to render just a single layer from a skeleton, and I still have that code around (uncommitted), but it was getting too complex, even for me, and I wrote the whole damn thing... Essentially, it's too fragile.

I'm still considering doing it this way, though, because it's so 'clean'. But the code changes, alas, wouldn't be... So, this morning, I figured I'd try doing it with my favorite little hobby...

Ne vous déplaise, en dansant la Javanaise... ♫

And it worked. I wrote 10 lines of JavaScript, about 370 unminified bytes, and it does exactly what I wanted.
Actually, I even tested it on wedge.org, so you can get a feel of it...

http://wedge.org/pub/feats/6108/new-revs/2160/

As you can see, all of the double posts are now merged into one, and they all retain their respective action bars. Really, it's just all about removing the duplicate signature and user box areas.

It takes one to know one.

There are a few caveats to this technique, and I'm weary of committing my code, so here's the list of problems, and possible fixes, and I'd really, REALLY appreciate if you guys could share your feelings about this implementation, and whether it's worth it.

- Since it executes at render time, you can for a very short time see the unmodified posts. I've fixed this by putting the code into the script.js file, instead of topic.js, as it executes earlier, but it's not exactly a noticeable improvement, so I'll probably end up putting it back into topic.js later, and anyway, if you don't actually refresh the page, it's unlikely you'll notice the difference when simply browsing through pages, which is what you'll be doing most of the time, anyway.

- This doesn't fix postbg/postbg2 alternance. Well, I'll fix that one next... But, more importantly, because it's JS, it means that if you do alternances differently (or not at all) in your version, it'll be broken by my upcoming fix.

- Anchor links are broken. e.g., if you're in a soft-merged post, and you click the subject, you'll end up on the same page, but at the top, because it won't find the message ID, which was suppressed by JS. A possible fix would be to just move the message ID to the postheader for the corresponding soft-merged post, but it'll also break any code that accesses .root and then gets the message ID through this. Very, very bad idea either way... I need to fix this one, ASAP.

- I haven't tested all action menu options, maybe some will be broken, potentially by the change just above this one.

So... Thoughts, please..? Or just Likes :P
57
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...
58
Features / More sidebar complications...
« on June 26th, 2013, 10:04 PM »
So, I was requesting the other day, whether I could do some tests in here... I'm afraid it's not ready for testing yet, though.

Here's what I'm, hmm, trying to do...

See the Google+ or Facebook apps on mobile? They both have (and aren't the only ones) the 'navigation drawer' feature, which is something Google standardized for Android apps, where you swipe the screen to show a sidebar, and swipe it again to hide it.

Thing is, this is something that makes sense on mobile, and it reminded me that the original sidebar for Wedge was very similar to that... If you'll remember, if you didn't have enough room on the screen, it moved your sidebar to the extreme left, only showing a small portion of it, and when hovering that portion, it would bring it into view (position: absolute), with a nice animation and all.

Honestly, I can't for the life of me remember why I gave up on it, but here we are.

The main advantage of the current responsive sidebar, is that you can easily see its contents by just scrolling your mouse wheel, so it doesn't require much action on your part; that is its advantage, and really, its only one...

I've been doing LOTS of tests trying to get it right, started with a few lines of CSS, then added a few lines of JS, then expanded it even more, added more goodies, etc, the usual stuff, and now my current code is, like, 200 gzipped bytes added to the script file... Hmm. It's a lot to me, but I know I shouldn't be too worried about this kind of increase, especially since we still have 7.5KB for the entire script file, and it can easily go up to 10KB without me getting too worried, so... Whatever.

Here's what it's been doing until today... Hovering the left portion of the screen (about 30px wide) would bring the sidebar into view, position: fixed, with a scrollbar if too long, and a subtle but nice animation effect (basically, on mobile you get the bare animation, but on desktop you also get a parallax scroll effect on the whole page, which is nice really.)

There are two points where I'm currently stuck.

1/ The convenience. Of course, none of the sidebar information is vital, but still... it's a bit annoying, having to hover something so far on the left... Would like opinions on whether this is important, or not...

2/ The main menu. Up until today, I didn't touch it, but then I suddenly decided that it would be nice, at least on mobile, to automatically move the main menu to the sidebar. I got it working, but it's really hard.

(a) All items are developed, as intended, but I realized that as an admin, I have way too many entries, and it forces me to scroll wayyyy down just to be able to view the actual sidebar content...

(b) It's probably best to collapse them, then, but it suddenly implies an extra tap for mobile users. Swipe left to open sidebar, tap the menu item you want, then tap the option you want. The only advantage, I guess, is that since we're in the sidebar, I can easily control the menu item sizes, and thus you'll never have to zoom in to ensure you're tapping the right item, I guess... Opinions..?

(c) It also occurred to me that I could open *two* sidebars, eh... For instance, have the sidebar show up on the left, but at the same time, have the main menu unfold in a new sidebar on the right. This implies, however, that the sidebar can never fill more than half (or 60%) of the screen, otherwise you can only have one, or the other. I like the idea, though...

(d) Any .note classes will be hidden from view, obviously, if the menu is hidden by default... I mean, you won't get to see the number of admin errors, or PM number, or unseen media number. I could shove these up somewhere in the visible UI, but it doesn't make a lot of sense, or it might be more work than deserved, I don't know...

Okay, I'll end this long post here, given how my previous long post asking for feedback scared the hell out of everyone, I suppose it's for the best, eheh... :P

I'll post screenshots once I'm satisfied with the layout, but it certainly won't be today, and perhaps not tomorrow either, that's how much I'm NOT happy with it, but you know how much of a perfectionist I can be, so...

PS: in case you missed these, there are two uncommitted features that made their way into wedge.org last week: (1) infinite scroll now works on mobile, (2) previewing a notification will now mark it as read automatically, yay.
59
Off-topic / Welcome to prehistoric times.
« on June 3rd, 2013, 09:26 AM »
So, during this weekend, I found myself in an interesting position. My Windows 7 started behaving like it's 1995.
Basically, all of the fonts somehow forgot how to show Unicode characters. That is, I have plenty of Japanese programs and folders -- they show up as squares in the Start Menu and in my File Explorer. I was using PT Sans as my main font, so I changed it to my alternative preference, Tahoma, with the same effect. I tried many, many fonts, and it seems that only one font recognizes Japanese (and CJK in general) characters, and that is Segoe UI. Heck, even Arial and Times New Roman don't work, eh..?!

I've temporarily set my font to Segoe UI, but even though I love it for web design, I hate that font for daily use, I find it too... stylish, and not as well hinted for my monitor as PT Sans is, for instance.

I've done countless web searches on this issue, and it seems I'm not alone, but I really can't fix it, and was wondering if anyone had ever had the same issue..? Of course, not everyone needs Japanese support on their system, but whatever...

Maybe a reboot will fix it, but currently I'm still working on my NAS setup, so it's a no-go.

That weekend really, absolutely, pathetically SUCKED. -_-
60
Archived fixes / Strange buddy list error...
« on June 3rd, 2013, 09:17 AM »
Subs-Members.php, member removal code:

Code: [Select]
while ($row = wesql::fetch_assoc($request))
wesql::query('
UPDATE {db_prefix}members
SET
pm_ignore_list = {string:pm_ignore_list},
buddy_list = {string:buddy_list}
WHERE id_member = {int:id_member}',
array(
'id_member' => $row['id_member'],
'pm_ignore_list' => implode(',', array_diff(explode(',', $row['pm_ignore_list']), $users)),
'buddy_list' => implode(',', array_diff(explode(',', $row['buddy_list']), $users)),
)
);
wesql::free_result($request);

Profile-Modify.php, buddy removal code:

Code: [Select]
foreach ($buddiesArray as $key => $buddy)
if ($buddy == (int) $_GET['remove'])
unset($buddiesArray[$key]);

// Make the changes.
$user_profile[$memID]['buddy_list'] = implode(',', $buddiesArray);
updateMemberData($memID, array('buddy_list' => $user_profile[$memID]['buddy_list']));

Btoh seem alright to me... And I can't think of another place, that could remove buddies.
Problem is, live627 has this string in the member table for buddy list: ',xxx' (where x is the only buddy he has. Don't remember the number, don't wanna know..!!)

Where does the extra comma come from..?
John, do you remember removing a buddy from your list? Or adding someone to the list that's not in your current list..?
This causes any visit to your PM area, to trigger an error in the log, which is really odd. (Well, it's due to getContactList, but you know what I mean.)

I could do a 'quick fix' by forcing an array_filter() on $users at loadMemberData time, but to me it's a cop-out, and I'd instead like to ensure this doesn't happen any longer, eh...

PS: this won't last, anyway... Once I'm done with contact lists, all buddy code will be removed, so... It's just for my peace of mind, I guess..!!!