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.
3241
Features / Re: Things I'm currently working on... (And not making progress on.)
« on April 8th, 2013, 06:51 PM »Actually, there wouldn't appear to be any conflicts ;)
My pending:
* update index.english-uk.php to specify the correct locale of en_GB rather than en_UK.
It's still saying hreflang="en" in index.template.php, should I update it myself..? Just so I don't forget...
* bug fix for ManageModeration.template.php due to what I'm still convinced is a jQuery bug but one I can't reproduce myself outside of Wedge, nasty fix.
I've been fighting for half an hour on my local install trying to figure out why my notifications disappeared. Turns out if was because all plugins had been disabled. Then I re-enabled them, played again, and ten minutes later... Bam, they were disabled, once again, all of them! I don't know why... The only thing I did today, was to move my forum to a different folder, and update the database to reflect it. I can understand the first time they got disabled, but not the second...
* everything else is related to the warnings replacement, which also strips out the last of the old code related to post moderation permissions (and all the attendant language strings etc.) and replaces it with the new infractions system and post-moderation-from-infractions as well as post-bans that are based on infractions... it's complicated but it hits a *ton* of files. But I think I hit most of the stuff that needed to be done, followed by slowly slogging through replacing the UI that needed to be replaced for the new features. It's slow and thoroughly frustrating :/
Sounds like you got some fun things ahead, all sounds good to me, including the general returnAjax thing you have in mind :)
3242
Off-topic / Re: Some advice when using jquery.ajax()
« on April 8th, 2013, 06:11 PM »
After years of maintaining and developing forums, I've learned to determine when someone is getting annoyed and is going to 'retire' their account, that's all I'm saying ;)
PS: I posted here because it was on-topic with what I had to say yesterday. By locking the topic again, you're preventing regular people from giving their opinion on my AJAX tweaks.
PS: I posted here because it was on-topic with what I had to say yesterday. By locking the topic again, you're preventing regular people from giving their opinion on my AJAX tweaks.
3243
Features / Things I'm currently working on... (And not making progress on.)
« on April 7th, 2013, 08:51 PM »
As mentioned in another topic... Let's see my uncommitted files one by one.
This topic is mainly to satisfy Pete's curiosity, if it exists. Also evaluate whether we'll have conflicts, and for anyone to give me their opinion on some topic when I'm unsure which way I should fix something...
It may also give you an insight into agenius madman's mind... :lol:
- Class-CSS: just disables can_flex manually... It's a hack. For testing. I still don't know what's best anyway.
- Class-DB: another file I've had in this state for months... It simply removes the return false on __clone(), and moves __construct() to the getInstance() code. I was planning to modify all files to do simpler things like that, but then I realized I really wasn't the guy to do the proper OO code optimizations, and I left it hanging... I'm guessing I'll leave it that way for another couple of years. Until I'm bored disabling the file's commit status, and remove my code. Maybe you want to do this kind of thing yourself...? Or maybe you think it's pointless..? I just don't think __construct() and getInstance() should both be in a class, as they have the same purpose really.
- Class-Notification: minor and short optimizations... Planning to commit this along with the rest of my notification changes.
- Feed: uhh... Just a spacinazi. But I'm not committing it, as it's a reminder that I should change all <' . '? strings to just have <?, since it's not going to change anything, and only ?> needs to be escaped... (Unless I'm wrong? In which case, there are plenty of files we need to fix!)
- JSEditor: part of my AJAX rewrite (i.e. remove Xml.template.php, and move everything to use returnAjax)
- JSModify: part of my AJAX rewrite
- Notifications: part of my Notifications rewrite
- QuoteFast: part of my AJAX rewrite
- Subs-Cache: this one has two changes:
- part of my quote escaping rewrite in JSE (code related to $txt handling inside JS files),
- and a stand-alone change that optimizes CSS filesize for Chrome and Firefox, by using a magic trick. It's actually been in use at Wedge.org for a few weeks, but I can't decide whether to commit or not, because (1) it's not a free hack, it takes time to run, (2) it only saves about 100 bytes... :(, (3) there's an alternative solution that involves moving my code to CSS files and only have a fallback implemented in Subs-Cache, it'd be more solid, but also more confusing to CSS developers...
- Subs-Template: has three changes...
- part of my Prism implementation; i.e. better syntax highlighter. Never finished that, as it doesn't play well with... flexbox. Ah.
- a one-liner that converts underscores to dashes in classes and ID's, at runtime. Only keeping it in there as a reminder that, well... It actually compresses worse :(
- part of my quote escaping rewrite in JSE (restore quotes after moving inline events.)
- Subs:
- my returnAjax hacks...
- my quote escaping rewrite in JSE -- not finishing it yet, because of issues with Wess.
- Suggest: part of my AJAX rewrite
- Home.template: a playground to see how I can easily vertically align embedded icons next to text, instead of having to use vertical-align. Well, although it does work, it also implies a site-wide rewrite, which I'm not excited about... So I'm leaving this as a reminder, again.
- index.template: part of my Notifications rewrite (moved the main skeleton's block there, for logical reasons.)
- ManagePermissions.template: part of my quote escaping rewrite in JSE.
- Notifications.template: part of my Notifications rewrite
- editor.js: I actually got rid of the iframe, in Wysiwyg mode... But couldn't figure out how to fix focus when clicking buttons.
- moved notifications.js to script.js, and heavily rewrote it.
- sbox.js: an IE hack that I never committed, for some reason... Probably because it works without the hack, but 'officially' I should be using the hack, so... This one has been in the file for at least a year. Every time I've committed sbox.js, I've ensured I didn't commit that single line change... I'm silly.
- topic.js: my flexbox fallback. It doesn't work in Firefox, so I'm not committing...
- editor.css: part of the Wysiwyg iframe rewrite. Saves 400 bytes of text, mostly comments...
- index.css: part of my Notifications rewrite
- sections.css: part of my flexbox hack. Uncommittable...
- Wine/extra.css: fixes some issues, but adds more issues in Warm -- and as I can't fix-commit Warm, I'm leaving this here.
- Warm/extra.css: quite a visible overhaul of the Warm skin... Only, I like the current one BETTER. Don't ask me... I should post screenshots, and ask for opinions. Generally speaking anyway, I'm thinking of tearing the skin apart and making it a Web 2.0-style skin.
- Xml.template.php: will eventually go away, part of my AJAX rewrite...
So, there you go. We've got about 4-5 main features I'm working on at the same time, none of which are ready for primetime (except maybe notifications).
This topic is mainly to satisfy Pete's curiosity, if it exists. Also evaluate whether we'll have conflicts, and for anyone to give me their opinion on some topic when I'm unsure which way I should fix something...
It may also give you an insight into a
- Class-CSS: just disables can_flex manually... It's a hack. For testing. I still don't know what's best anyway.
- Class-DB: another file I've had in this state for months... It simply removes the return false on __clone(), and moves __construct() to the getInstance() code. I was planning to modify all files to do simpler things like that, but then I realized I really wasn't the guy to do the proper OO code optimizations, and I left it hanging... I'm guessing I'll leave it that way for another couple of years. Until I'm bored disabling the file's commit status, and remove my code. Maybe you want to do this kind of thing yourself...? Or maybe you think it's pointless..? I just don't think __construct() and getInstance() should both be in a class, as they have the same purpose really.
- Class-Notification: minor and short optimizations... Planning to commit this along with the rest of my notification changes.
- Feed: uhh... Just a spacinazi. But I'm not committing it, as it's a reminder that I should change all <' . '? strings to just have <?, since it's not going to change anything, and only ?> needs to be escaped... (Unless I'm wrong? In which case, there are plenty of files we need to fix!)
- JSEditor: part of my AJAX rewrite (i.e. remove Xml.template.php, and move everything to use returnAjax)
- JSModify: part of my AJAX rewrite
- Notifications: part of my Notifications rewrite
- QuoteFast: part of my AJAX rewrite
- Subs-Cache: this one has two changes:
- part of my quote escaping rewrite in JSE (code related to $txt handling inside JS files),
- and a stand-alone change that optimizes CSS filesize for Chrome and Firefox, by using a magic trick. It's actually been in use at Wedge.org for a few weeks, but I can't decide whether to commit or not, because (1) it's not a free hack, it takes time to run, (2) it only saves about 100 bytes... :(, (3) there's an alternative solution that involves moving my code to CSS files and only have a fallback implemented in Subs-Cache, it'd be more solid, but also more confusing to CSS developers...
- Subs-Template: has three changes...
- part of my Prism implementation; i.e. better syntax highlighter. Never finished that, as it doesn't play well with... flexbox. Ah.
- a one-liner that converts underscores to dashes in classes and ID's, at runtime. Only keeping it in there as a reminder that, well... It actually compresses worse :(
- part of my quote escaping rewrite in JSE (restore quotes after moving inline events.)
- Subs:
- my returnAjax hacks...
- my quote escaping rewrite in JSE -- not finishing it yet, because of issues with Wess.
- Suggest: part of my AJAX rewrite
- Home.template: a playground to see how I can easily vertically align embedded icons next to text, instead of having to use vertical-align. Well, although it does work, it also implies a site-wide rewrite, which I'm not excited about... So I'm leaving this as a reminder, again.
- index.template: part of my Notifications rewrite (moved the main skeleton's block there, for logical reasons.)
- ManagePermissions.template: part of my quote escaping rewrite in JSE.
- Notifications.template: part of my Notifications rewrite
- editor.js: I actually got rid of the iframe, in Wysiwyg mode... But couldn't figure out how to fix focus when clicking buttons.
- moved notifications.js to script.js, and heavily rewrote it.
- sbox.js: an IE hack that I never committed, for some reason... Probably because it works without the hack, but 'officially' I should be using the hack, so... This one has been in the file for at least a year. Every time I've committed sbox.js, I've ensured I didn't commit that single line change... I'm silly.
- topic.js: my flexbox fallback. It doesn't work in Firefox, so I'm not committing...
- editor.css: part of the Wysiwyg iframe rewrite. Saves 400 bytes of text, mostly comments...
- index.css: part of my Notifications rewrite
- sections.css: part of my flexbox hack. Uncommittable...
- Wine/extra.css: fixes some issues, but adds more issues in Warm -- and as I can't fix-commit Warm, I'm leaving this here.
- Warm/extra.css: quite a visible overhaul of the Warm skin... Only, I like the current one BETTER. Don't ask me... I should post screenshots, and ask for opinions. Generally speaking anyway, I'm thinking of tearing the skin apart and making it a Web 2.0-style skin.
- Xml.template.php: will eventually go away, part of my AJAX rewrite...
So, there you go. We've got about 4-5 main features I'm working on at the same time, none of which are ready for primetime (except maybe notifications).
3244
Archived fixes / Re: Event delayer gets upset if there's a " in it
« on April 7th, 2013, 08:49 PM »You meanCode: [Select] onchange="$(\'input[name=infraction_duration_number]\').dostuff();"
would have been legal?
And even if it didn't validate, it's JavaScript, so it's not processed by validators anyway... :P
You wait until the commit I'm working on lands. I can't do it in bits because it all absolutely has to work together >_< So far, 25 modified, 3 added (will be 4 added by the time I'm finished, I'm not doing Eng-UK until I'm done)
Oh, speaking about Eng-UK, I stumbled upon the Google dev blog, which mentioned that hreflang="..." must use a string like "en-GB", while we're using "en_UK". We don't have "en-GB" in our language strings, but we do have "GB", so it might be possible to build the complete string from scratch by taking the paypal one and adding it to the generic language string, I don't know... What's your say?
Let's see... My uncommitted stuff... 26 modified files, 1 removed file. I'm in the same waters as you are..!
I'll post them in another topic for you to see, if you're curious!
3245
Features / Re: New revs
« on April 7th, 2013, 07:42 PM »
rev 2046 -- my skeleton object rocks. It just needs to be tested from a plugin author's point of view. ;)
(4 files, 5kb)
! Fixed a situation in skeleton handling that I didn't consider. If we're using a target array with a fallback to 'default', and the skeleton is currently hidden (e.g. an XML template), Wedge would still force the layer to be shown in default, even though it's very unlikely to be the desired solution. For instance, my current code has the Notification block added to all XML templates by default because of said fallback, effectively breaking all Ajax responses due to malformed XML. Eh, silly me... Obviously, fixed by ensuring we skip the block if we're in that situation. (Class-Skeleton.php)
+ Added a new skeleton method, insert(), which is basically a generic operation function to add a layer/block. Instead of doing wetem::add(array('somewhere', 'default'), 'block'), you can now do wetem::insert(array('somewhere' => 'add', 'default' => 'first'), 'block'), meaning that if the 'somewhere' layer is available, 'block' will be added ('add') to it, and if it isn't there, it will be prepended ('first') to the 'default' layer. Is that clear enough...? It gives you greater flexibility if you're writing a plugin and want to have a variety of layers or blocks as fallback targets. Calling for opinions on the method name, as I want it to be as generic as possible, and 'insert' might not be. Maybe 'push', or 'put'..? (Class-Skeleton.php)
* Disable CSS/JS output compression by default at install time on non-Apache servers. Output compression may work, but only if you declare the proper MIME types manually in your configuration files. (install.php, install.sql)
* Made $full_board available for 'determine_location' hooks to modify. Not that it'll be very helpful, though... (QueryString.php)
(4 files, 5kb)
! Fixed a situation in skeleton handling that I didn't consider. If we're using a target array with a fallback to 'default', and the skeleton is currently hidden (e.g. an XML template), Wedge would still force the layer to be shown in default, even though it's very unlikely to be the desired solution. For instance, my current code has the Notification block added to all XML templates by default because of said fallback, effectively breaking all Ajax responses due to malformed XML. Eh, silly me... Obviously, fixed by ensuring we skip the block if we're in that situation. (Class-Skeleton.php)
+ Added a new skeleton method, insert(), which is basically a generic operation function to add a layer/block. Instead of doing wetem::add(array('somewhere', 'default'), 'block'), you can now do wetem::insert(array('somewhere' => 'add', 'default' => 'first'), 'block'), meaning that if the 'somewhere' layer is available, 'block' will be added ('add') to it, and if it isn't there, it will be prepended ('first') to the 'default' layer. Is that clear enough...? It gives you greater flexibility if you're writing a plugin and want to have a variety of layers or blocks as fallback targets. Calling for opinions on the method name, as I want it to be as generic as possible, and 'insert' might not be. Maybe 'push', or 'put'..? (Class-Skeleton.php)
* Disable CSS/JS output compression by default at install time on non-Apache servers. Output compression may work, but only if you declare the proper MIME types manually in your configuration files. (install.php, install.sql)
* Made $full_board available for 'determine_location' hooks to modify. Not that it'll be very helpful, though... (QueryString.php)
3246
Archived fixes / Re: Wedge.org today
« on April 7th, 2013, 07:25 PM »
Didn't any feedback on this, so I'll just bump and add an extra one...
Tested the code in Firefox, and it doesn't follow the same standards as Chrome, ah ah... Basically, it's considering 'min-height' to be the same as 'height' (in a table-cell, it should be the reverse!), and on top of that, it completely ignores margins to enforce its maximum height... Bugger.
So, I changed the code to set the height instead of the min-height, and it started working... But broke horrible in Chrome! :lol:
That's a nice one... It looks like I just can't do anything that's cross-browser compatible[1]. Thank you, browser vendors... :-/
Tested the code in Firefox, and it doesn't follow the same standards as Chrome, ah ah... Basically, it's considering 'min-height' to be the same as 'height' (in a table-cell, it should be the reverse!), and on top of that, it completely ignores margins to enforce its maximum height... Bugger.
So, I changed the code to set the height instead of the min-height, and it started working... But broke horrible in Chrome! :lol:
That's a nice one... It looks like I just can't do anything that's cross-browser compatible[1]. Thank you, browser vendors... :-/
| 1. | Not that I'm particular happy with a JS solution, on the contrary... I very much prefer the flex model for that, but it seems to be even worse when it comes to browser implementation. To think that everyone is considering flexbox to be the holy grail of positioning... My ass! |
3247
Archived fixes / Re: Flexbox bug
« on April 7th, 2013, 07:22 PM »
Pete, do you still have this problem..?
3248
Off-topic / Re: Some advice when using jquery.ajax()
« on April 7th, 2013, 07:21 PM »
That was Suki's last post, so I guess she wasn't too thankful. Fair enough ;)
While I'm at it... One of the things I've been working on recently, is a rewrite to get rid of Xml.template.php. In order to do this, I wanted to have returnAjax handle things more gracefully, and in a more instinctive way. However, this requires a (small) rewrite that makes it sound like one of these hastily made PHP 'hacks', which I'm not sure we want in Wedge... There is, however, such a 'convenient function' in Wedge already, it's add_js(), where you can call multiple parameters and they'll be concatenated, so that existing inline JS can easily be transformed to use the function. It's neat, but it's a bit hackish.
So, right now, what returnAjax does is... Takes two parameters... A string and a type... Determines the type... If it's empty, it'll use a text/plain header, otherwise it'll use a MIME type that matches what we asked for, between text, XML and JSON.
Then it initializes the lot, and prints the string, and returns, making sure to bypass the template system but still go through ob_sessrewrite.
That's all good.
Except that if I want to send XML, it gets ugly quickly. The first thing I determined, is that since all XML responses have the <?xml...> header stuff in their content, I could add it automatically on the fly. Which I'm doing. But then I was thinking, doing this is ugly...
Code: [Select]
Mostly because the 'xml' is at the end. I don't know, I just don't feel like doing that...
So, I wanted to refactor it to:
Code: [Select]
And consider that if we have only one parameter, it's a text string, and use $type as the string. And if we have two parameters, $type is the type, and the second parameter is the string. It suddenly makes it a hack...
Also, another thing I wanted to look into, was do things as in add_js, i.e. multiple parameters are concatenated into a single string, allowing for easy conversion of existing echos.
But then it means that the ($type, $string = '') hack is no longer possible, because I could very well be doing returnAjax('xml', ' is something I hate'), and thus Wedge would consider this to be a XML string, instead of a text string split in two... Yes, it's unlikely to happen, but it just feels wrong.
So... Do I just leave the function as it is right now, or... Do something else..?
While I'm at it... One of the things I've been working on recently, is a rewrite to get rid of Xml.template.php. In order to do this, I wanted to have returnAjax handle things more gracefully, and in a more instinctive way. However, this requires a (small) rewrite that makes it sound like one of these hastily made PHP 'hacks', which I'm not sure we want in Wedge... There is, however, such a 'convenient function' in Wedge already, it's add_js(), where you can call multiple parameters and they'll be concatenated, so that existing inline JS can easily be transformed to use the function. It's neat, but it's a bit hackish.
So, right now, what returnAjax does is... Takes two parameters... A string and a type... Determines the type... If it's empty, it'll use a text/plain header, otherwise it'll use a MIME type that matches what we asked for, between text, XML and JSON.
Then it initializes the lot, and prints the string, and returns, making sure to bypass the template system but still go through ob_sessrewrite.
That's all good.
Except that if I want to send XML, it gets ugly quickly. The first thing I determined, is that since all XML responses have the <?xml...> header stuff in their content, I could add it automatically on the fly. Which I'm doing. But then I was thinking, doing this is ugly...
returnAjax('
<we>
<something />
</we>', 'xml');Mostly because the 'xml' is at the end. I don't know, I just don't feel like doing that...
So, I wanted to refactor it to:
returnAjax('xml', '
<we>
<something />
</we>');And consider that if we have only one parameter, it's a text string, and use $type as the string. And if we have two parameters, $type is the type, and the second parameter is the string. It suddenly makes it a hack...
Also, another thing I wanted to look into, was do things as in add_js, i.e. multiple parameters are concatenated into a single string, allowing for easy conversion of existing echos.
But then it means that the ($type, $string = '') hack is no longer possible, because I could very well be doing returnAjax('xml', ' is something I hate'), and thus Wedge would consider this to be a XML string, instead of a text string split in two... Yes, it's unlikely to happen, but it just feels wrong.
So... Do I just leave the function as it is right now, or... Do something else..?
3249
Archived fixes / Re: Event delayer gets upset if there's a " in it
« on April 7th, 2013, 06:57 PM »
It's not that a workaround was needed for this... I've always suppressed double quotes in these situations when embedding in an inline event. It's just that when you include some JSE string in these, sometimes you'll get a double quote, whether you want it to not. Originally it was handled differently (i.e. would convert it to a quot entity), but I recently figured (and documented it) that I could get away with a chr() call, like I'm doing in other situations.
I really need to get started committing stuff...!
I really need to get started committing stuff...!
3250
Archived fixes / Re: Event delayer gets upset if there's a " in it
« on April 7th, 2013, 06:47 PM »
You can remove the double quotes entirely. That solves your problem. Or use chr(24) or something like that. I don't remember the number exactly. This will stand for a double quote in one of my upcoming commits which precisely aims to fix that. ;)
3251
Off-topic / Re: The sites looking
« on April 7th, 2013, 04:49 PM »
Thanks!
Doing my best to finish a public version ASAP... But sometimes, hurrying up is not the 'solution'.
Doing my best to finish a public version ASAP... But sometimes, hurrying up is not the 'solution'.
3252
Plugins / [Plugin] Re: User Mentions v1.0 (9th March 2013)
« on April 6th, 2013, 01:46 PM »What about read notifications greyed?
The only reason I kept showing them in the popup was because I wanted to always have notifications in there for me to style the damn thing... :P Other than that, it probably makes more sense to have a separate page for all notifications, and a popup for unread ones.
Or did you prefer the 'all' solution...?
3253
Off-topic / Re: Zopfli compression
« on April 6th, 2013, 01:42 PM »
Yes of course, and that's really good news for jQuery distribution, among other things... Another kilobyte saved :)
There are two PHP implementations so far:
https://github.com/kjdev/php-ext-zopfli
https://github.com/clickalicious/php_zopfli
May the best one win!
Couldn't find a compiled DLL for local tests though, so I guess it'll have to wait... (And yes, I'm not against adding support for zopfli in Wess, as long as low-iteration passes have similar performance to gzip -9 and still save more bytes.)
There are two PHP implementations so far:
https://github.com/kjdev/php-ext-zopfli
https://github.com/clickalicious/php_zopfli
May the best one win!
Couldn't find a compiled DLL for local tests though, so I guess it'll have to wait... (And yes, I'm not against adding support for zopfli in Wess, as long as low-iteration passes have similar performance to gzip -9 and still save more bytes.)
3254
Archived fixes / Re: Flexbox bug
« on April 5th, 2013, 08:26 PM »
Then it's not a flexbox problem...
Although maybe it's a problem due to the reversal, ah ah..!
:edit: Quick Edit fixed! :)
Although maybe it's a problem due to the reversal, ah ah..!
:edit: Quick Edit fixed! :)
3255
Archived fixes / Re: Flexbox bug
« on April 5th, 2013, 07:37 PM »
I'm not seeing any of this, Pete... :-/
Can you analyze the DOM with dev tools..? Thanks.
(.postarea is what's supposed to have the flex display.)
:edit: Quick Edit fixed... :)
Can you analyze the DOM with dev tools..? Thanks.
(.postarea is what's supposed to have the flex display.)
:edit: Quick Edit fixed... :)