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
3796
Features / Re: New revs
« on January 26th, 2013, 07:12 PM »
rev 1875 -- ask() fixes.
(4 files, 3kb)

! These JS ask boxes look great... But they break stuff, from time to time. Confronted to a choice between an ugly confirm box for the 'Delete post' link, and rewriting the mini-menu code, I chose the latter. So, removed the 'custom' option to add onclick events. Because jQuery has a .live() function to attach events to objects that aren't created yet, I can simply associate the function to the requested class. The code is a tiny bit longer, but it's in the footer... Heck, who likes confirm() over ask(), I'm asking? Yeah, thought so! :P (Display.php, topic.js)

! Fixed icon alignment in Add Ban area. (mana.css)

! Commenazi. (ManageSearchEngines.php)
3797
Features / Re: New revs
« on January 26th, 2013, 05:56 PM »
rev 1874 - iPad and JS lang fixes.
(5 files, 5kb)

! The language string integration for JS files was no longer working, not sure why... This relatively extensive rewrite of the feature should work. (Subs-Cache.php)

! iPads and Android tablets have a high enough resolution to handle any skin without going through the Wireless skin by default. So I'm removing them from the is_mobile test. Note that I could do a better job at searching for tablets... Right now it'll only find those Android tablets that follow Google's standards. (Class-System.php)

* iPads shouldn't go through the 'big font' path that is given to all iOS devices. (extra.ios.css)

! The gradient pseudo-rule in Wess wouldn't accept anything else than "top" and "left" as its third optional parameter, when it should have accepted any angles to "to left", etc... Fixed it to just mindlessly reproduce what you're putting in it. (Class-CSS.php)

* Translation. (index.french.php)
3798
Plugins / Re: Plugin JS language settings
« on January 26th, 2013, 05:48 PM »
Quote from Arantor on January 26th, 2013, 04:58 PM
Is that 'first request' for any language, or first request for 'non default languages'?
For any language. But it's actually more complicated than that...

Anyway, I've found a few errors I made earlier, and they should be fixed now. I'm not sure why, but it appears that French users would see the English files regardless... I'm pretty sure it worked back when I wrote the feature!
I've gotten rid of $final_file in the function params (as it can easily be rebuilt), and replaced it with $lang_name, which is more interesting. This one is passed by ref.
Quote
Also, here's a thought to make it more complex. How does one call @language for a plugin's language file? Since the plugin's path is never exposed to the plugin itself (a plugin, by design, should never need to know where it actually is or rely on hardcoded paths, when $context['plugins_dir'] should be supplying it), it must somehow pass the plugin id, perhaps @language Arantor:plugin:file which could be fun if they have a separate lang dir like I tend to do on bigger plugins... @language Arantor:plugin:dir/file,Arantor:plugin:dir/otherfile
@language xxx does exactly this: loadPluginLanguage('xxx')... It's up to you what you put in it ;)
If you're telling me that a LPL parameter can have slashes in it, I'll just add a more generic [^\n]+ to the regex.
Quote
That is their job, yes ;) The entire magic process is complicated, I don't understand most of its details any more, I've sort of come to rely on them 'just working', even though I'm aware there are issues with the CSS loader.
Well, even if I don't get it anymore, I know I'm in a good position to at least understand what I was doing after studying it.
So it's my duty to fix the system whenever it breaks...
Just like I did now. Hopefully :P
3799
Features / Re: Plugin revs
« on January 26th, 2013, 03:53 PM »
Sorry, had to commit despite what I'd said... I had a global power outage and my UPS was depleting fast, and I didn't want to lose the changelog and didn't know if I had the time to copy it into a new text file... So here it is. Partial commit :( Will probably revert part of it.

rev 70
(7 files, didn't have time to see the size)

! [topic_solved] Fixed icon alignment for Mark Topic Solved. It'll probably look different on some browsers though... But not worse than it was before. (src/TopicSolved-Display.php)

* [mass_upload] Updated plugin to latest Github version, and moved language strings to the JS file itself. (attachui.js, plugin.english.php, plugin.french.php, plugin.php)

! [edit_history] Fixed popup layout to use the new generic popup. (EditHistory.php, EditHistory.template.php)
3800
Plugins / Re: Plugin JS language settings
« on January 26th, 2013, 01:49 PM »
Blame me all you will, it won't do you any good... 8-)

Although in this case you're absolutely right. It looks like I always tend to forget to update the plugin function when I'm modifying the main one... That's valid for both CSS and JS. OTOH, I've long thought we really should merge both functions, even if it means having a slower function overall, because it'd be easier to update altogether.

So... I've updated the plugin function, not much to do, only had to add a global and an extra line to determine the language.
However, I'm not sure I'm "doing it right", even if it works... From what I understand in my code, Wedge first determines if the current JS file has language strings in it (!empty($settings['js_lang'][$id]]). If yes, it adds the language to the filename (but only if it's not the default language, i.e. English here and French on my local install). Then it checks for the file's existence, and if not there, it regenerates it. Only, that's only during regeneration that the file has a @language tag, and thus fills in the js_lang array with $id... OOPS.
Fact is, it WILL work, but NOT on the first request, but it won't even be noticeable if the first request is done by someone who's using the default board language... (Because in any case it'll have the same filename.)
Is it worth fixing or not?
It can be fixed, I'd think, by fudging[1] the language name at the end of $id in wedge_cache_js, and obviously by making $id a pass-by-ref variable in the param list. It's not very pretty, though... I could also pass the language name in the param list but it's already very long as it is...
The more I see that caching function, the more I'm scared by the sheer complexity of it, although it's nowhere near that of Class-CSS's... Then again, they do their job :P
Quote
In theory, the add_js_file and add_plugin_js_file should behave consistently from calling perspective, i.e. they add the file requested. If the backend wants to perform some magic, it should do it consistently the same for both.
Sure it should.
Then again, I don't tend to use plugins a lot... So I forget a lot, too.

BTW, Dragooon, I internally renamed Dragooon:MultiAttach to Wedgeward:MassUpload, is that alright with you? I'm not committing that without your permission, obviously, but I think we should have as much 'Wedgeward' plugins as possible, and this one would be a good example, having been partly developed by myself.
 1. © Peter Spicer, circa 201x.
3801
Archived fixes / Re: Input boxes not working in Chrome
« on January 25th, 2013, 07:03 PM »
Bug reproduced three times... (Three restarts.)

And DEFINITELY a Chrome bug.

You know what fixed it...?

Removing the :focus and :hover border in select/textarea/input.
This is incredible.
And I have no frigging idea why it would work when applying background/padding-left/height elements to the same stuff (e.g. input.search), but I don't even want to know. Chrome can do without the focus border, really! It's just a nice detail... And it has the outline anyway.
3802
Plugins / Re: Plugin CSS in regular files?
« on January 25th, 2013, 07:01 PM »
Hmmm... Makes sense to ask these ;)
I don't think I would accept the drawbacks over the advantages, I guess...
3803
Archived fixes / Re: Previous/next topics don't work properly
« on January 25th, 2013, 07:00 PM »
Sure, but there's also the update server to deal with... (If we do.)
3804
Plugins / Plugin JS language settings
« on January 25th, 2013, 06:50 PM »
This will act as a reminder to self to fix this...

Or if Pete can do it for me. Because it's plugin-related, I'm always wary of fixing stuff, even though I wrote that one particular feature.

So, in Subs-Cache:873, I'm doing the @language check for JS files, and it accepts plugin files as well. I just tested it, it works fine, except for the filename: it doesn't add the language name to it, unlike the non-plugin JS files.

Is this a plugin-related issue, or something I forgot at some point...?
3805
Archived fixes / Re: Previous/next topics don't work properly
« on January 25th, 2013, 04:12 PM »
Oh, bug fixing is fun once you're done... :P It can be rewarding. I know I was really glad I managed to spot the AeMe bug yesterday. It "only" took me a couple of hours...

What's NOT fun at all is building everything around Wedge: documentation mostly, and server stuff. I'm not really looking forward to this one... If I ever do it, actually!
3806
Bug reports / Re: Weaving & Warm issues in iOS
« on January 25th, 2013, 04:11 PM »
Can someone test this site under an iPad now...?
I've added a minor change to ensure iPads don't change the main font size.


Please tell me if it works for you!
3807
Archived fixes / Re: Input boxes not working in Chrome
« on January 25th, 2013, 03:55 PM »
In this case it actually works better than textarea... ^^
3808
Plugins / Plugin CSS in regular files?
« on January 25th, 2013, 03:39 PM »
I was thinking of something...
Perhaps it's already implemented that way, but I doubt it.

How about having a function (or extend add_plugin_css_file or something to do it), that takes a request from a plugin to 'add some CSS to this or that general file'.
- It the file doesn't exist, just create it...
- If it does exist, then add somewhere in a variable that next time we flush the file (say, index.css), we'll need to get some extra CSS from that list of plugins, and add it to the end of our file. Or something.

That would save having to use an extra HTTP request or inline CSS for some minor feature we want on every page.

Then again -- maybe it's already all implemented... Maybe it's not even doable. But Pete asked me to open new topics for every little idea or suggestion I have, so there I am... :P
3809
Archived fixes / Re: Previous/next topics don't work properly
« on January 25th, 2013, 03:32 PM »
Ah yes, I'm not good enough with MySQL that I could have thought of the UNION trick, so that was definitely yours ;)


Gosh I didn't realize we had so many bugs to fix... It seems like I'm only working on fixing stuff, these days!
3810
Bug reports / Re: Weaving & Warm issues in iOS
« on January 25th, 2013, 03:23 PM »
Not unexpected...
Technically it's all like I said... Before yesterday, there was a Safari header shared for all platforms. Now there's a Safari header just between iOS devices. It's still not enough, apparently.

So, yes, I could add a variable again... But what is it about, really? It's about element sizing. And what is the difference between iPhones and iPads..? Stuff that can be seen through CSS.
So the solution is to use a media query *even* when ios is already determined.
I'll look into that one... I've never used the DPI-specific ones. (Only pixel-specific. Although it could be enough, as the iPad resolutions are always > 960x640 anyway...).