New revs

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs
« Reply #1845, on January 13th, 2013, 09:01 PM »
(7 files, 2KB)

Revision: 1845
Author: arantor
Date: 13 January 2013 20:01:09
Message:
! Removing the rest of the things I forgot to remove before regarding max_urlLength (install.sql, ManagePosts.php, Admin language file)

! Added softban being able to redirect users to another site. (ManageBans.php, Security.php, ManageBans language file)
----
Modified : /trunk/Sources/ManageBans.php
Modified : /trunk/Sources/ManagePosts.php
Modified : /trunk/Sources/Security.php
Modified : /trunk/Themes/default/languages/Admin.english.php
Modified : /trunk/Themes/default/languages/Admin.french.php
Modified : /trunk/Themes/default/languages/ManageBans.english.php
Modified : /trunk/root/install.sql
Re: New revs
« Reply #1846, on January 13th, 2013, 10:19 PM »
(3 files, 2KB)

Revision: 1846
Author: arantor
Date: 13 January 2013 21:18:47
Message:
! More soft-banning magic: ability to set a random delay of up to 15 seconds for miscreants. (ManageBans.php, Security.php, ManageBans language file)
----
Modified : /trunk/Sources/ManageBans.php
Modified : /trunk/Sources/Security.php
Modified : /trunk/Themes/default/languages/ManageBans.english.php
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs
« Reply #1847, on January 15th, 2013, 08:15 PM »
rev 1847
(10 files -2, 7kb)

! Reduced minimum recorded version of Firefox from 16 to 15, to account for the (yet to be upgraded) Pale Moon fork. Hopefully they release v19 soon so I can restore the minimum requirement. (Class-System.php)

! Fixed OS version not being stored in Opera Mini for Android. Actually, they don't even show the Android version in the UA... Not that it's a big deal, as Opera Mini is supposed to look the same across all platforms. (Class-System.php)

! Fixed error log not being able to show source code in context for files outside of the Sources folder. (ManageErrors.php)

! In some rare situations (frankly it's probably down to the filesystem..?), wedge_cache_css_files seems to not be able to create new folders in time for the final recording of the cached file. Just @ignore the error for now... (Subs-Cache.php)

* Moved main CSS IE9 hacks to index.css file. Moved an Opera hack to media.css just the same. Simplified some stuff that seemed to be outdated and no longer needed. (extra.ie9.css, index.css, media.opera.css, media.css)

* Slight improvements to Wuthering header. Moved a single hack for IE6 and IE7 to main file, too. (extra.css, extra.ie6.css, extra.ie7.css)

* Translation. (ManageBans.french.php)

* Spacinazi. (ManageBans.english.php)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs
« Reply #1848, on January 16th, 2013, 05:27 AM »
(6 files, 11KB)

Revision: 1848
Author: arantor
Date: 16 January 2013 04:26:33
Message:
+ New news UI, including privacy of news items and fun things like that. Doesn't include pulling from a board, haven't made my mind up about how that needs to work yet. Should have cleaned house on the template and language strings. (ManageNews.php, ManageNews.template.php, Admin language file)

! Spacinazi. (Home.php)
----
Modified : /trunk/Sources/Home.php
Modified : /trunk/Sources/ManageNews.php
Modified : /trunk/Sources/Subs.php
Modified : /trunk/Themes/default/ManageNews.template.php
Modified : /trunk/Themes/default/languages/Admin.english.php
Modified : /trunk/Themes/default/languages/Admin.french.php
Re: New revs
« Reply #1849, on January 16th, 2013, 03:35 PM »
(1 file, 1KB)

Revision: 1849
Author: arantor
Date: 16 January 2013 14:34:45
Message:
! Some fringe bugs relating to news items (admin permission not enforced properly, errors thrown in the event items were not visible to guests) (Subs.php)
----
Modified : /trunk/Sources/Subs.php

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs
« Reply #1850, on January 17th, 2013, 09:43 AM »
rev 1850
(2 files, 3kb)

! The mixin regex was using an incorrect back-reference (\3 instead of \1), resulting in mixed selectors only inserting their first property into parent selectors. Oops. This was unfixed until now because I'm only using the 'mixes' keyword for a single selector and it only needed the first property in most situations. (Class-CSS.php)

! The mixin regex also didn't accept blank lines in selector declarations. Considering that the tree parser (which is executed later) does accept them, it makes sense to include support for them. As a reminder, regular selectors that you want to use in 'mixes' keywords should be at the root of the file, i.e. don't indent them with tabs. (Class-CSS.php)

* Slight micro-optimization in a loop. (Class-CSS.php)

* Saved an extra declaration for Firefox 2 and below. I know, it doesn't represent a lot of users, but it's still what allowed me to discover the mixin bug, ah ah. As well as a dysfunctional Wuthering linktree, also in Firefox. (common.css)
Re: New revs
« Reply #1851, on January 17th, 2013, 11:10 PM »
rev 1851
(8 files +1, 4kb)

- Replaced some JS substring() calls with substr(), which saves bytes everywhere because substr() was already used a lot. (script.js, editor-func.js, player.js, respond.js)

! Chrome was incorrectly setting the JS is_ff flag to true. Rewrote is_ff to basically mean 'has Mozilla flag, but isn't IE or WebKit.' Saves another 6 gzipped bytes, by the way... (script.js)

! Firefox needed an extra fix for Wuthering linktrees. (Wuthering/extra.css)

* Moved Wine's variable overrides to common.css; reason being that if a file such as editor.css wants to use one of those common variables, they'll first take the value from Weaving's common.css file, then fail to see an override anywhere, because the editor (for instance) doesn't have any interaction with the extra.css file. A bit complicated, I admit, but completely logical. (Wine/common.css, Wine/extra.css)

* Translation. (Admin.french.php)

@ Editor fixes coming later, or at least separately... I'm not 100% happy with them right now, and will take some time to review them.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs
« Reply #1852, on January 18th, 2013, 02:39 AM »
(4 files, 2KB)

Revision: 1852
Author: arantor
Date: 18 January 2013 01:28:23
Message:
! SMF bug: disallow checking of email address for activation purposes if the account is not in a state where it should be approving such things. (Activate.php)

! Typo in Class-DBPackages, thanks Dragooon. (Class-DBPackages.php)

! SMF bug: force serializer to PHP's own for DB sessions, as there are other serializers out there that could cause trouble, e.g. igbinary. While I was hesitant to suggest it for SMF, it does fit with things we can do in future. (Load.php)

! SMF bug: XSS validation not performed in the admin panel for selecting a default language. (ManageServer.php)
----
Modified : /trunk/Sources/Activate.php
Modified : /trunk/Sources/Class-DBPackages.php
Modified : /trunk/Sources/Load.php
Modified : /trunk/Sources/ManageServer.php
Re: New revs
« Reply #1853, on January 18th, 2013, 05:54 AM »
(4 files, 2KB)

Revision: 1853
Author: arantor
Date: 18 January 2013 04:53:28
Message:
! A few more language tidy-ups to use number_context. Nothing major, just a little bit of housekeeping while the subject came up. Still more to do though. (PersonalMessage.php, ManageMaintenance.template.php, ManageMaintenance and PersonalMessage language files)
----
Modified : /trunk/Sources/PersonalMessage.php
Modified : /trunk/Themes/default/ManageMaintenance.template.php
Modified : /trunk/Themes/default/languages/ManageMaintenance.english.php
Modified : /trunk/Themes/default/languages/PersonalMessage.english.php

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs
« Reply #1854, on January 18th, 2013, 09:14 AM »
rev 1854
(7 files, 4kb)

* Replaced CSS long URL shortener with a JavaScript one. It has the main advantage of allowing users to copy and paste complete URLs even if they don't show up as complete in the page. Also, it only adds about 60 gzipped bytes to the JS and removes 4 bytes per URL and saves 24 gzipped bytes from the CSS file, which is really nice. Finally, it shouldn't impair any forums, except maybe really slow ones at load time. The alternative solution would be to do this at PHP time, but I'm not sure it's worth the, albeit minor, extra server load, apart from saving the 60 bytes off JS. I'm keeping my options open about implementing it in PHP. (install.sql, script.js, index.css)

* Added $version variables to add_jquery_ui() and weInitJS(), to make it simpler to update the jQuery versions if patches are released for it. Note that currently, I'm still waiting for Google to update their CDN with jQuery 1.9, to which we'll make the jump then. Because jQuery 2.0 will be shorter than 1.5, it'll be beneficial to all non-IE browsers eventually. (Load.php, Subs-Cache.php)

! Half-assed hack to prevent errors from being generated by permission checks before permissions are loaded. Unfortunately, this doesn't fix the error in itself, but at least it doesn't prevent normal use of a forum, and this error won't be logged any more. (Security.php)

! Just because dns_get_record is callable doesn't mean it's not going to return errors. Meh. Another @ fix... I hate those. (Subs.php)
Re: New revs
« Reply #1855, on January 18th, 2013, 01:20 PM »
rev 1855
(6 files, 4kb) (it seems I'm subscribed to 4kb commits these days...?!)

* Improved JS URL shortener: ampersands are now properly cut (through a php_unhtmlspecialchars call), increased maximum length to the usual default of 50 chars instead of 30 (it was really just for my tests), and if a container is too narrow to show even 50 chars, Wedge now inserts a wbr tag after the ellipsis, that allows for the URL to be shown over two lines. And it doesn't take any additional byte to add all of this, yay. (script.js)

! Fixed Wuthering linktree in IE7. It needs a mixin (rather than a base) because of the parent skin. Soon, I'll start working on moving Wuthering and Warm to the root. Should be simpler to manage in the end... Child skins really should be there only to change a few lines, not create completely new skins. Just because I could doesn't mean I should have. I need to see a doctor. (Wuthering/extra.css)

! Typo (number_content instead of number_context). (PersonalMessage.php)

* Translation. (ManageMaintenance.french.php, PersonalMessage.french.php)

* Saving a gzipped byte by reordering two lines. Really. I need a doctor. Now. (index.css)
Re: New revs
« Reply #1856, on January 18th, 2013, 05:50 PM »Last edited on January 18th, 2013, 10:33 PM
rev 1856
(16 files, 7kb)

+ Added HTTPS support for CDN-based jQuery includes. This will prevent IE (and some other browsers) from shouting at you if your $scripturl has https:// in it. (Load.php, Subs-Cache.php)

* So... I went to see my doctor, and he diagnosed a rare case of bytophobia. He said it can't be cured. He also added that .slice() is one byte shorter than .substr() and behaves similarly to .substring() but with support for negative indices, so he recommended that I'd focus on turning all of my substr calls to slice. This saved quite a lot of gzipped bytes in a few files. Although I'm starting to wonder if he really was an actual doctor... (captcha.js, editor-func.js, editor.js, ie6hover.js, mediadmin.js, player.js, post.js, respond.js, script.js, spellcheck.js, stats.js, suggest.js, topic.js, up.js)

@ For those interested, I also saved bytes by: (1) removing txlen1 and txlen2 variables from the editor (they were introduced as an Opera fix, which is no longer needed, and I forgot to remove them entirely), (2) removing an unneeded filename.length in post.js, (3) turning a very silly (also in SMF!) sText.substr(0, aResult.index).length) into just aResult.index, (4) turning a str.substr(x, 1) into str[x] in captcha.js, and (5) removing an unneeded file.name.length in up.js. I'm surprised that 'this' in $.fn.mime is correctly typed as a string instead of an array when calling .slice() on it. Eh, you never know... It still saves one byte doing that, so it's definitely worth the risk. Ah ah.

:edit: Fixed wrong HTML in this post.
Re: New revs
« Reply #1857, on January 18th, 2013, 10:34 PM »
rev 1857
(14 files, 3kb)

* Finished converting all .substr() calls to .slice()... I'm surprised that none of the .substr() had any reason to stay, and overall we're saving bytes everywhere. (attic/Unused-testStyle.js, attic/text-overflow.js, create_backup.php, smfinfo.php, ManageSmileys.php, Aeva-Subs-Vital.php, TEMPLATES: Admin, Display, PersonalMessage, Poll, Profile, Split, Themes)

! Fixed URL shortener when the link contained an image. The rewrite is one gzipped byte shorter, and should be 100% safe. (script.js)

- Removed a very, very well hidden (and as expected totally useless) Easter egg. Someone in the SMF 1.0 dev team was definitely a Gwen Stefani fan. For those wondering, the egg is still in SMF 2.x, so I'm not the only one who missed it. (Profile.template.php)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs
« Reply #1858, on January 19th, 2013, 05:32 AM »
(10 files, 19KB)

Revision: 1858
Author: arantor
Date: 19 January 2013 04:31:11
Message:
! A few more $scripturl removals. (MessageIndex.php)

! I didn't really want to commit this yet but other changes to Display.php forced my hand somewhat (I don't like partial commits of files or any such nonsense.) So here's the first code that sets up for Disemvowelling bad users' posts. It relies on a new parameter being available to the bbc parser, but one I've talked about doing before, it's just that now I'm actually doing it, though in a very slightly different manner to before. The vowel stripping is particularly nasty and I don't have a smarter way of doing it at this stage. (Display.php, Subs-BBC.php)

! Bug in previous/next topics not taking into account pinned topics, ordered or otherwise. (Display.php)

! Allow for reordering of pinned topics. Not all of this was necessarily in the best places, but it seems to make some kind of sense. (JSModify.php, MessageIndex.php, Pin.php, Post2.php, Post.template.php, language files: index, Post, Errors)
----
Modified : /trunk/Sources/Display.php
Modified : /trunk/Sources/JSModify.php
Modified : /trunk/Sources/MessageIndex.php
Modified : /trunk/Sources/Pin.php
Modified : /trunk/Sources/Post2.php
Modified : /trunk/Sources/Subs-BBC.php
Modified : /trunk/Themes/default/Post.template.php
Modified : /trunk/Themes/default/languages/Errors.english.php
Modified : /trunk/Themes/default/languages/Post.english.php
Modified : /trunk/Themes/default/languages/index.english.php
Re: New revs
« Reply #1859, on January 19th, 2013, 06:06 AM »
(1 file, 1KB)

Revision: 1859
Author: arantor
Date: 19 January 2013 05:06:06
Message:
! A variable was getting cleared too early which could cause errors. (ManageBoards.php)
----
Modified : /trunk/Sources/ManageBoards.php