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
106
Features / Plugin revs
« on June 16th, 2012, 04:15 PM »
I thought that it's best to centralize revisions for the plugin depository as well... (Didn't do it until now because, well, I wasn't even sure there was a plugin depo... :P)

rev 37
(7 files, 3kb)

! [users_online_today] Harmonized visible/hidden numbers for both moderators and regular members. (OnlineToday.php)
! [pm_flash] Fixed JavaScript to use the newest DOM. (PersonalMessageFlash.php)
! [theme_selector] Fixed wedge_show_skins to use newest version without level param. (ThemeSelector.php)
* [theme_selector] Adapted skin selector to sidebar code standards, added a language string in case we want to offer positioning. (ThemeSelector.php)
* [theme_selector] Simplified JS code. A lot. Tested to work, but who knows... (ThemeSelector.php)
107
Bug reports / Cleaning up duplicate language strings
« on June 11th, 2012, 06:06 PM »
So, I made a quick and dirty script to find duplicate keys in the language folder...
There are PLENTY, actually.
And some of them do look like they should be removed.

I'm just going to ask: are there any strings below which you think are safe to remove, and if yes, from which files...?

/Admin.english.php
/Login.english.php


(
    [registration_agreement] => Registration Agreement
)

/Admin.english.php
/ManageMembers.english.php


(
    [not_activated] => Not activated
    [membergroups_add_group] => Add group
)

/Admin.english.php
/ManagePaid.english.php


(
    [paid_subs_view] => View Subscriptions
)

/Admin.english.php
/Profile.english.php


(
    [display_name] => Display name
    [ip_address] => IP address
    [date_format] => (YYYY-MM-DD)
    [age] => User age
)

/Admin.english.php
/index.english.php


(
    [search_for] => Search for
    [spiders] => Spiders
)

/Errors.english.php
/Login.english.php


(
    [no_password] => Password field empty
)

/Errors.english.php
/Profile.english.php


(
    [incorrect_answer] => Sorry, but you did not answer your question correctly. Please click back to try again, or click back twice to use the default method of obtaining your password.
)

/Install.english.php
/index.english.php


(
    [lang_rtl] =>
    [error_invalid_characters_username] => Invalid character used in Username.
)

/Login.english.php
/Admin.english.php


(
    [registration_agreement] => Registration Agreement
)

/Login.english.php
/Errors.english.php


(
    [no_password] => You didn't enter your password.
)

/ManageMembers.english.php
/Admin.english.php


(
    [membergroups_add_group] => Add group
    [not_activated] => Not activated
)

/ManagePaid.english.php
/Admin.english.php


(
    [paid_subs_view] => View Subscriptions
)

/ManagePaid.english.php
/Profile.english.php


(
    [subscriptions] => Subscriptions
)

/ManagePaid.english.php
/index.english.php


(
    [yes] => Yes
    [no] => No
)

/ManageSettings.english.php
/PersonalMessage.english.php


(
    [pm_read] => Groups allowed to read their messages
)

/ManageSettings.english.php
/Profile.english.php


(
    [signature_minposts] => Minimum number of posts for signatures to be visible
)

/Media.english.php
/Post.english.php


(
     => Media
)

/Packages.english.php
/index.english.php


(
    [remove] => Remove
)

/PersonalMessage.english.php
/ManageSettings.english.php


(
    [pm_read] => Read
)

/PersonalMessage.english.php
/Profile.english.php


(
    [pm_display_mode_all] => All at once
    [pm_display_mode_one] => One at a time
    [pm_display_mode_linked] => As a conversation
    [showDrafts] => Show Drafts
    [showDrafts_desc] => This section shows you all the draft messages you have saved, or were saved on your behalf.
    [show_drafts_none] => You have no draft messages saved at this time.
    [edit_draft] => Edit draft
    [draftAutoPurge] =>         (
            [1] => Drafts are stored on the server for up to a day, and if not posted or modified in that time, they will be removed.
            [n] => Drafts are stored on the server for up to %s days, and if not posted or modified in that time, they will be removed.
        )

    [remove_all_drafts] => Remove all drafts
    [remove_all_drafts_confirm] => Are you sure you want to remove all of your draft messages? (This operation is not reversible.)
)

/Post.english.php
/Media.english.php


(
     => Upload a media file
)

/Post.english.php
/index.english.php


(
    [message_icon] => Message icon
    [regards_team] => Regards,
The {forum_name} Team.
    [change_color] => Change Color
    [notify_replies] => Notify me of replies.
    [awaiting_approval] => Awaiting approval
)

/Profile.english.php
/Admin.english.php


(
    [age] => Age
    [date_format] => The format here will be used to show dates throughout this forum.
    [display_name] => Display name
    [ip_address] => IP address
)

/Profile.english.php
/Errors.english.php


(
    [incorrect_answer] => Sorry, but you did not specify a valid combination of Secret Question and Answer in your profile. Please click on the back button, and use the default method of obtaining your password.
)

/Profile.english.php
/ManagePaid.english.php


(
    [subscriptions] => Paid Subscriptions
)

/Profile.english.php
/ManageSettings.english.php


(
    [signature_minposts] =>         (
            [1] => Your signature will not be shown to other members until you have made at least 1 post.
            [n] => Your signature will not be shown to other members until you have made at least %s posts.
        )

)

/Profile.english.php
/PersonalMessage.english.php


(
    [showDrafts] => Show Drafts
    [showDrafts_desc] => This section shows you all the draft posts you have saved, or were saved on your behalf.
    [show_drafts_none] => You have no draft messages saved at this time.
    [edit_draft] => Edit draft
    [draftAutoPurge] =>         (
            [1] => Drafts are stored on the server for up to a day, and if not posted or modified in that time, they will be removed.
            [n] => Drafts are stored on the server for up to %s days, and if not posted or modified in that time, they will be removed.
        )

    [remove_all_drafts] => Remove all drafts
    [remove_all_drafts_confirm] => Are you sure you want to remove all of your draft messages? (This operation is not reversible.)
    [pm_display_mode_all] => All at once
    [pm_display_mode_one] => One at a time
    [pm_display_mode_linked] => As a conversation
)

/Profile.english.php
/Reports.english.php


(
    [none] => None
)

/Profile.english.php
/index.english.php


(
    [hidden] => hidden
    [notification] => Notifications
)

/Reports.english.php
/Profile.english.php


(
    [none] => None
)

/Search.english.php
/index.english.php


(
    [search_date_posted] => Date Posted
    [spider] => Spider
)

/index.english.php
/Admin.english.php


(
    [search_for] => Search for
    [spiders] => Spiders
)

/index.english.php
/Install.english.php


(
    [lang_rtl] =>
    [error_invalid_characters_username] => Invalid character used in Username.
)

/index.english.php
/ManagePaid.english.php


(
    [yes] => Yes
    [no] => No
)

/index.english.php
/Packages.english.php


(
    [remove] => Remove
)

/index.english.php
/Post.english.php


(
    [regards_team] => Regards,
The {forum_name} Team.
    [notify_replies] => Notify of replies
    [awaiting_approval] => Awaiting Approval
    [message_icon] => Message Icon
    [change_color] => Change Color
)

/index.english.php
/Profile.english.php


(
    [notification] => Notification
    [hidden] => Hidden
)

/index.english.php
/Search.english.php


(
    [spider] => Spider
    [search_date_posted] => Posted:
)
108
Archived fixes / Admin search issues
« on June 11th, 2012, 12:52 PM »
Here's the list of language files that admin search will work its magic on:

'Help', 'ManageMail', 'ManageSettings', 'ManageBoards', 'ManagePaid', 'ManagePermissions', 'Search',
'Login', 'ManageSmileys', 'ManageMaintenance',


As you can see, it doesn't have Profile in it...

However, if I do a search on 'minposts' (signature_minposts), it returns to me the string from the Profile page, instead of the one from the Admin page. The profile page one is multilingual-ready, so it would return an error but I fixed that one in my local install (I'll commit it later, it's actually pretty big compared to the relevance of that bug...)

But I don't see Profile in that list. So I enabled debugging locally, and looked at the language list... Wow, what a load of fun.

Fichiers de langue (42) : index.english (default), index.french (default), Admin.english (default), Admin.french (default), Help.english (default), ManageMail.english (default), ManageSettings.english (default), ManageBoards.english (default), ManagePaid.english (default), ManagePermissions.english (default), Search.english (default), Login.english (default), ManageSmileys.english (default), ManageMaintenance.english (default), Help.french (default), ManageMail.french (default), ManageSettings.french (default), ManageBoards.french (default), ManagePaid.french (default), ManagePermissions.french (default), Search.french (default), Login.french (default), ManageSmileys.french (default), ManageMaintenance.french (default), Help.english (default), Help.french (default), ManageSettings.english (default), ManageSettings.french (default), Help.english (default), Help.french (default), ManageSettings.english (default), ManageSettings.french (default), ManageSettings.english (default), ManageSettings.french (default), ManageSettings.english (default), ManageSettings.french (default), ManageSettings.english (default), ManageSettings.french (default), ManageSettings.english (default), ManageSettings.french (default), Profile.english (default), Profile.french (default).

There are two issues in this:
- The Profile language is loaded at the very end. I don't see where it's coming from...?! This call needs to be removed.
- The other files are loaded multiple times. It's likely that they're stopped at the gates before they're loaded one time too many (?), but it seems to happen on a lot of pages... For instance on a topic page with media items, it'll load Media.english, Media.french, Media.english and Media.french in sequence. Here, it's done in that order: (Whole lot).english, then (Whole lot).french, then (Help.english, Help.french...) * count(Whole lot). (Or Whole lot.length, depending on your language of choice.)

The latter is definitely a 'bug' to me, as the language files are only listed if they're actually included. Because it's an array we're sending, the first two Whole lot loops are as expected. It's the last one that doesn't make sense. And the Profile calls. Any ideas...?
109
Archived fixes / Optimizing parse_bbc() and Aeva
« on May 27th, 2012, 12:20 PM »
(Split from 'BBC whitespace trimming'.)

Would be helpful to see external tests.

Eh maybe one of my earlier micro optimizations fixed it ahah.
110
Archived fixes / BBC whitespace trimming
« on May 26th, 2012, 10:46 AM »
So, some time ago I changed quote tags to use whitespace trimming, so that I could precisely style the space between quotes and surrounding text.

Turned out that it didn't work very well.
The first problem was with margins. I used margin collapsing to allow for an opener quote not to take any useless space at the top of a post, but if you quoted that, it would add the extra space inside the new quote. I fixed it this morning by adding an extra div directly above the blockquote tag. I fought long and hard against that (even trying for pseudo-elements to fill in the gap...), until I realized I'd provisioned for an empty <footer> tag in the markup. So I simply removed the footer tag (which can very well be 'emulated' through pseudo-elements, like .bbc_quote:after, well, maybe not, but it can always be re-inserted by a plugin through a SQL query), and replaced them with the div tags. 'div' is shorter than 'footer', and it's acceptable. (Heck, I'm even considering turning <div class="bbc_quote"> into <section class="bbc_quote"> because of the header, but whatever...)

So, problem solved.
Now, there's an extra problem. The trimming code.
Let's say you have some text, then a few empty lines, then a quote, then a few empty lines, then some text.
Wedge (and SMF, I guess) will only remove the TRAILING empty lines. Any empty lines BEFORE the quote tag are left as is.
I was wondering why, and it turned out that... Well, it seems that these are never even looked against...?!
So, quotes are set to trim 'outside', to me that means "before and after the tag"...
But it seems that the two 'outside' trimming code blocks are both about 'anything coming after the tag'.
And if anything -- the regexps both start with '^' and have no closer '$', which doesn mean "look for whitespace at the beginning of the string...", when we should have at some point a test against whitespace soming before the tag, i.e. a test against substr($message, 0, $pos) (with $pos representing the start of a tag, and a regexp ending with $), instead of substr($message, $pos), with $pos representing the end of the tag and the regexp starting with ^, like it is now...

Do you think it's an oversight? In SMF, 'outside' is only used on 'td' and 'li'. I can understand that one would want to only test for whitespace once because if anything, there's little chance of having any text between two td or li tags, so if you test for trailing whitespace, you don't need to test for leading whitespace on the next tag because it's likely to have been removed already... Yet, it isn't working that way in my opinion.

Maybe I should add support for a new trimming codeword that would cover both directions... I don't know.

Anyone here knows about everything I've been talking about...?
111
Bug reports / Sub-boards not marked as new...
« on May 25th, 2012, 03:52 PM »
I think it's also a SMF bug, but it's worth mentioning either way.
I had a sub-board marked as 'New' in the board list. I click it, went to reply the first unread topic, came back to the homepage, and it was no longer marked as new.
Problem is -- there still are unread posts in this specific board...
So it would seem that in the board list, sub-boards are marked as unread only in specific situations, totally unrelated to whether or not there are unread posts in them.

It may be 'desirable', but I'd rather know why it works that way ;)
112
The Pub / One more stupid animation...
« on May 21st, 2012, 04:16 PM »
So, I couldn't be arsed to keep working on the tons of features I'm supposed to finish, so I just made a new animation...

Just press the Quick Edit button to see a (probably weird) transition between the post and the textarea.
I tried many variations to get the most 'natural' feeling, but I don't know if it adds anything to the feature, or actually distracts from it, I don't know...

Hence this new topic to post about new animations, and your opinions on them :P
113
Features / Rewriting the skin file parser...
« on May 14th, 2012, 07:47 AM »
Re: suffixes, I forgot to say...
I want to do a rewrite because the current implementation is a bit flawed (in at least an edge case.)
My main goal with the rewrite would be to allow for comma-separated lists of suffixes in any file.
index.ie6,ie7,ie9,member1.css would thus target member #1 if he uses ie except ie8.
To achieve this, I suspect that doing a glob() call would be enough. Then for each file -- explode the suffixes, and check whether they're in our list.

Only thing I'm not sure about -- performance. Is glob() optimized enough, does the folder list stay in memory as much as possible..? I suspect so, but I don't know for now.
114
Features / Scratching my head on CSS margin collapsing...
« on May 4th, 2012, 06:31 PM »
There's a feature in CSS that you may not know about.
I actually learned about it only very recently, and it suddenly made it clear that many of the "CSS issues" I had were due to my lack of knowledge about that particular feature.

Let's say you have three divs nesting into each other:

.div1________
|
|   .div2______
|   |
|   |   .quote___
|   |   |

.div1 isn't styled at all. Now, consider the idea that .quote is a quote block that has some padding and margin to make the text breathable.
We want any text located between the beginning of .div2 and the beginning of .quote to be separated from .quote by a few pixels.

.quote
   margin-top: 8px

All right. Now we want the text before .quote to be readable as well, so we add padding around .div2...

.div2
   padding: 8px
   border: 1px solid #999

All good. Except that if you don't have any text at the beginning of .div2, then you end up with a 8px padding (from div2) and 8px margin (from quote), making a 16px block of whitespace. It sucks.
I would usually 'fix' that with classes or complex CSS, or even some HTML, but there's another way of doing that.

.div1
   border: 1px solid #999

.div2
   margin: 8px

Now we have, inside .div2, two adjoining 8px margins from both .div2 and .quote.
The magic of CSS makes it actually reduce itself to the maximum of both margins (here, max(8px, 8px) = 8px).
So, we essentially cancel our quote's top margin and get some proper positioning.

Yay.

So I did exactly that for Wedge's quote blocks. It works perfectly, although I need to figure out how to remove the extra HTML linebreaks that are inserted before a quote.

Now, here's my problem... Which I only noticed this morning.
A quote nested inside another quote.

.quote____
|
|   .quote__
|   |

The outer quote has some *padding* to make the text inside it actually readable. The inner quote has margins and paddings, too. But because padding and margin aren't mutually exclusive, the inner quote doesn't get the benefits of margin collapsing, and thus a disgracious extra padding shows up.

So... What solution do we have?

- Removing the padding, and replacing it with a margin. The HTML is a bit more complex than what I show above, but it basically works... Somehow. However, we use extra borders and, more importantly, extra backgrounds, that require using paddings and NOT margins if we don't want the inner text to 'stick' to the background's boundaries. The solution would be to use background-origin: margin-box, where the background extends to the margins... Except that there is NO such property in CSS -- it only supports content, padding or border, but doesn't extend to margins at all. Well, if that isn't a useful CSS property eh...?

- We could add an extra div layer inside the .quote, so that we need not apply padding to .quote... In this case, the outer quote has a natural border, which stops any collapsing, then inside it, no padding, then a div with no padding but a margin that is there for text, and finally an inner quote that has a margin, and will 'collapse' against its outer div's margin.

Yeah, you can already see it... It's *extra markup*, just to fix something that should be a natural, or at least be taken into account by a CSS property.

So... Any ideas anyone?
Posted: May 4th, 2012, 04:14 PM

(Another possibility would be to add a br tag at the beginning of the quote html, and then strip br's away from the beginning of the post, and I think we already do that...)
115
Features / Action buttons: positioning
« on May 4th, 2012, 04:32 PM »
So... It's been a few days/weeks since I moved the action bar from the top of a post to the bottom.

I haven't got around to dealing with the moderation checkbox and the Quick Edit button, though.

Still, I think it's a good time to determine what's best for a 'default' setup.

(1) TOP

Pros:
- It's what every SMF user is used to...
- Pretty much immediate recognition of the Quote button's position.

Cons:
- It makes it harder (much harder) to make the post header look good, as on smaller widths + longer titles it will breaks these titles, or make them warp on a small width which is even worse...
- Vertical positioning isn't easy. I had to resort to using CSS table emulation, which I'd rather avoid as much as possible...

(2) BOTTOM

Pros:
- It fits nicely into the 'Last edited' box.
- The quick edit button takes space anyway -- might as well use that space...
- Logic says that you're more likely to answer a post after you're done reading it, rather than before you read it (it's not always the case, i.e. very long posts in a two-man discussion, I tend to favor answering first), thus the Quote button would be more useful at the end of the post...
- It just looks better, layout-wise. Just like FluxBB's default layout, it feels a bit more organized. Better thought-out.

Cons:
- Seriously... I can't get the hang of it. It's been days, weeks, and I still have to look twice before I find that damned Quote button!

So... There's only one con that I can think of, but it makes it hard for me to actually commit my changes. Looking for opinions! Will add a poll, too...

PS: a freebie for teatime... How come if you edit a post in the middle of a topic, your Topic Summary has the last posts *before* that post, but if you quote the same post, the Topic Summary has the latest posts in the topic instead..? I understand the idea, I just don't know if it makes sense for the common man...
116
Bug reports / Minor bug with drafts and entities
« on May 3rd, 2012, 10:11 AM »
Was looking into a draft bug (no biggie, presentational issue, I fixed it), and noticed two things in my drafts area.
First of all -- well, I still have recent (yesterday etc) drafts that should have been deleted after I submitted the final post... They're still there. Perhaps it's on my side though -- I have two posts from yesterday, then a post from April 30, then April 27 onwards was due to the earlier bug IIRC.

Secondly, my bug report for the cache key length had this code:

aeva-embed-link-[url=http://www.youtube.com/watch?v=OgCjpA03mOI#ws]B+ Episode 5 - &#1576;&#1575;&#1587;&#1605; &#1610;&#1608;&#1587;&#1601; &#1588;&#1608; (&#1605;&#1593; &#1578;&#1575;&#1605;&#1585; &#1605;&#1606; &#1594;&#1605;&#1585;&#1577;) &#1575;&#1604;&#1581;&#1604;&#1602;&#1577; &#1637;[/url]

However, in the draft area, it has this instead:

log_online-updateaeva-embed-link-[url=http://www.youtube.com/watch?v=OgCjpA03mOI#ws]B+ Episode 5 - باسم يوسف شو (مع تامر من غمرة) الحلقة ٥[/url]

I don't know if it's a bug in the draft saving code, or if it's due to my changing the location of weSaveEntities(). (But because it's in editor-func.js, it should be loaded on all topic pages as well...)
It's probably due to drafts not going through weSaveEntities() before saving the post, I guess. Or maybe I'm mistaken...
117
Archived fixes / Logging password errors
« on May 2nd, 2012, 07:26 PM »
If there's one type of error that really bothers me in the error log, it's the "Password incorrect" error...
I believe it is logged every time someone enters an incorrect password when logging in.
Because it's the kind of thing that really I couldn't care less about, I'd suggest that we only log these (or at least offer a setting to...) when there have been X consecutive failed password attempts. That would still take care of brute force attempt warnings, while still leaving admins in peace without the need to systematically check their error log only to find these errors...

I'm not sure there's even a system in place to allow for logging errors according to their gravity level.
118
Archived fixes / Long cache keys make the cache fail.
« on April 30th, 2012, 12:53 PM »
If you go to this page:
http://wedge.org/do/media/?sa=item;in=29

There will be a cache request. The key is generated as such:

aeva-embed-link-[url=http://www.youtube.com/watch?v=OgCjpA03mOI#ws]B+ Episode 5 - &#1576;&#1575;&#1587;&#1605; &#1610;&#1608;&#1587;&#1601; &#1588;&#1608; (&#1605;&#1593; &#1578;&#1575;&#1605;&#1585; &#1605;&#1606; &#1594;&#1605;&#1585;&#1577;) &#1575;&#1604;&#1581;&#1604;&#1602;&#1577; &#1637;[/url]

Funny eh..?
Well, it generates an error saying the filename is too long -- and indeed, with bin2hex being used on the key, it does make it extra long...!
I don't know what would be the best fix here... Direct or indirect?

PS: sorry I'm being so silent these days... I try to keep up with reading but I definitely can't post or work on Wedge (too much) -- hectic RL. It's likely that it'll be similar in the next few days, too... I hate that.
119
Archived fixes / Attachment handler bug
« on April 28th, 2012, 03:02 PM »
This is minor but should be fixed because there's code in the implementation that doesn't work as expected.

Reproducing: attach 2 files to a post (let's say there are 4 attachments max), and save.

Edit post again. There are two files in there, let's click to add one.. Done... Click again to add one... Done. The Browse button is still active, even though we technically reached the limit.
Now, go to post.js and do this.checkActive() BEFORE current_element is assigned to element. This fixes the bug.
However, it creates another one -- if you then click Delete to remove one of the files, the Browse button is still disabled. This bug might be due to my rewrite though, as I changed a few blocks in here (which is why I'd rather we discuss this bug than commit something and force me to resolve the conflict, eh eh.)

Anyway, I'm sure it's an easy fix, but I didn't write the code logic so I'm not sure how best to handle it without looking into it very seriously. (And I have to leave for now.)
120
Archived fixes / Error when posting a large image...
« on April 26th, 2012, 04:39 PM »
Was testing the attachment handler after rewriting post.js to save another 60+ bytes off it...[1]

Fatal error: Call to undefined function checkGD() in Sources\Subs-Graphics.php on line 203
Call Stack
#   Time   Memory   Function   Location
1   0.0006   827208   {main}( )   ..\index.php:0
2   0.0440   7867680   Post2( )   ..\index.php:198
3   0.0827   14061376   createAttachment( )   ..\Post2.php:683
4   0.0881   14258216   reencodeImage( )   ..\Subs-Post.php:1699

There's a checkGD2() function defined in install.php but that's all. Is this is GD-only function...? If yes, we should use function_exists() on it first...
 1. I should say that I simply turned its methods into private ones, so basically you can't call them from outside (except for checkActive because it's actually used outside), I know it's not something I should do without thinking because one might want to add a prototype for a Wedge object later and they won't be able to access its private variables -- but still, I don't want to put the extra load on everyone when we have no idea whether people will actually want to extend an object... If they do want to, I'll just consider turning the object back into a list of prototypes. Is that okay with you?