New revs

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs
« Reply #1650, on July 29th, 2012, 12:53 PM »
rev 1650
(12 files, 3kb)

! Hopefully fixed that annoying bug in Packer that forced me to split JavaScript strings over 255 bytes. It would seem that the regex for string parsing was simply too time-consuming. (Class-Packer.php, suggest.js)

* Finished replacing +new Date with $.now() where it made sense. (install.php, upgrade.php, restore_backup.php, Admin.template.php, Profile.template.php, Themes.template.php, editor-func.js, suggest.js)

- Mouse wheel events in the select box didn't seem to require an event fix after all... Tested in IE6 and I can't think of another browser that would have needed that. Hey, it saves bytes, so I'm all for it, gives me more room for my upcoming confirm() rewrite. (sbox.js)
Re: New revs
« Reply #1651, on August 1st, 2012, 11:46 PM »
rev 1651
(12 files, 14kb)

* Converted all sendXMLDocument/getXMLDocument calls to $.post, $.get (and $.ajax when not possible otherwise). It's hard to determine how much space was saved this way (some files are a bit larger, others are much shorter), but it's more important to be using a more 'standard' way of doing Ajax (through jQuery), rather than obscure SMF functions. (unittest.js, upgrade.php, Aeva-Subs-Vital.php, Packages.template.php, Split.template.php, Themes.template.php, mediadmin.js, post.js, register.js, script.js, topic.js)

- toggleView doesn't seem to require a &#38 conversion... Could use some further testing. Perhaps the same can be done to other areas... (editor.js)
Re: New revs
« Reply #1652, on August 2nd, 2012, 08:40 PM »
rev 1652
(10 files, 4kb)

* Added 'must confirm e-mail address before logging in' error type to the enableErrorPasswordLogging system. (Subs-Login.php)

! Fixed error handling for QuickModify object. Basically, $.ajax's callback is a success callback, not a complete callback, so I had to move the error handling to the Deferred object. Hopefully that works, because I couldn't test thoroughly... (topic.js)

! Restored the extra test in weUrl(), because Pretty URLs could fail to work without it. (script.js)

- Got rid of the .php_urlencode() function, because it was only barely used (most of its prior used were for URL encoding in Ajax calls, but $.ajax does it by itself already.) So, basically, use encodeURIComponent() if you ever need to encode stuff. (Packages.template.php, register.js, script.js, suggest.js)

- Removed is_gecko test in JS (it was never used anywhere), and replaced is_ff with a simpler $.browser.mozilla alias. (script.js)

* Simplified auto-suggest code. Saves many bytes. Oh well, that's just me... (suggest.js)

* Forgot to commit an obscure file with a getXMLDocument call. (other/unittest/templates/scripts/unittest.js)

* Whatever... Details. (ManageMedia.php, ManageMedia2.php, ManageMedia.template.php)
Re: New revs
« Reply #1653, on August 3rd, 2012, 12:18 AM »
rev 1653
(30 files, 11kb)

+ Adding a custom confirm() rewrite using the reqWin system. This allows us to use HTML in confirm boxes, which is nice to begin with. This 'only' costs an extra 192 gzipped bytes, which is much shorter than the savings I did these last few days. Also added a we_ok string, y'never know... (Subs-Template.php, Help.template.php, index.template.php, script.js, LANGUAGES: Admin, index, ManageMaintenance, ManageMembers, ManagePermissions, ManageSmileys, ManageTopics, ModerationCenter, Packages, Post, Profile, Search, Themes)

@ I would REALLY appreciate if you guys looked into the language files (or at least through the patch...) and checked whether it's all okay. Sometimes it's confusing to me because some strings have to retain their \n because they're used in e-mails.
Ideally, I'd like to be able to remove the .replace(/\n/g, '<br>') in the confirm() rewrite...
Re: New revs
« Reply #1654, on August 9th, 2012, 02:34 PM »
rev 1654 -- just a commit to ease my life on wedge.org... :P
(2 files, 3kb)

! Added a temporary fix for Opera 12.50 rev 1538. As you may know, Opera is my default browser and their latest alpha fixes the long-lived bug that I had to write a hack in SMF for, back in 2010. Unfortunately, that hack is no longer valid and all SMF installs are broken in that build, so I devised a slightly better way of handling line breaks. Used the opportunity to better compress that code block. My name is Nao and I like saving bytes. (editor.js)

! IE6 and IE7 don't like confirm() to be redefined without specifying its window namespace. Silly... (script.js)

+ Added reqWin support for alert(), although it's the same fight as confirm(): it can only be used successfully when within an event. I'll probably have to rename all calls to account for that... Thankfully there aren't a lot for alert(). (script.js)
Re: New revs
« Reply #1655, on August 16th, 2012, 05:44 PM »
rev 1655
(3 files +1-4, 20kb)

@ This is a multi-part HUGE commit. It is, basically, due to my realizing that the current SVN was so much behind my CSS rewrites that it was more buggy than my local install.

+ Added support for the virtual keyword in WeCSS. It allows you to specify a CSS selector that is to be inherited by other rules, but that shouldn't appear itself in the final file. If no other selectors inherit it, then it'll be safely removed. (Class-CSS.php)

! Fixed an incredibly annoying bug that was fixed through a half-arsed attempt back in revision 562, where the generated CSS could sometimes be very different from what was expected, depending on the rule's position in the file. The problem lied in the fact that the sorting wasn't done correctly, and on top of that, WeCSS needed to do extra sorting on the target list. (Class-CSS.php)

- Got rid of the value list (deg, px, mm...) in the math plugin for WeCSS, because I realized that several new value types had been introduced since I last touched it, and I don't want to spend my life on this. So from now on, it'll only be checking for strings between 2 and 4 characters located right after a number. Seems to work well enough... (Class-CSS.php)

+ Added proper support for animation/transition/transform properties in CSS3. (Subs-Cache.php, Class-CSS.php)

+ Added support for unprefixed gradients. I'd recommend the use of angles to indicate the direction, because Wedge will automatically convert the angle between versions. (Class-CSS.php)

* Moved prefixer code from Subs-Cache to Class-CSS, because it's directly linked to the CSS preprocessor, rather than the cache system. (Subs-Cache.php, Class-CSS.php)

+ Added support for browser versions in macros, CSS filenames or CSS conditions (e.g. in skin.xml), and adapted IE to use the new system. The agent is now 'ie' rather than an exact version number, and CSS filenames should have index.ie[6].css instead of index.ie6.css for instance. The good news is, you can now easily say "IE7 or later" (ie[7-]), "IE7, IE8 or IE9" (ie[7-9]), "up to IE7" (ie[-7]) and just "IE" (ie, yep.) iOS devices will now use the iOS version as the browser version, rather than the browser version itself, because the information it gives away is more important. If you're wondering, the main reason for doing all of this was to allow for the prefixer plugin to determine precisely whether or not the current browser accepts a prefix. (Load.php, Subs-Cache.php)

+ Added an automatic cache purge function that gets called every month to remove files older than a month ago. This should allow for old browser versions to naturally disappear from the file list and avoid stressing the filesystem when accessing the cache folder. (Subs-Cache.php)

+ Added a 'hacks' file category (final name TBA) to the main CSS list, which is executed right after 'index' and 'sections', allowing skins to override an 'index' category file without having to use the 'sections' category name. If you know what I mean... If you don't, don't fret, just use 'hacks' instead of 'index' for skins if you want to be on the safe side. (Subs-Cache.php)

* Moved a couple of files around. (buttons.png, grad250.png, grad700.png)

@ Note on virtuals: this is still (very slightly) buggy, in that it seems to delete the entries in some situations, even if they're inherited. This should be easy enough to fix, as it's reproduceable on the .grad40 class. Not for now though...
Re: New revs
« Reply #1656, on August 16th, 2012, 05:53 PM »
rev 1656
(7 files, 7kb)

* Converted default macros to use the hasBrowser() syntax. (index.template.php)

* Moved page ID hooking from the body tag to the frame div right below the content ID. This is to avoid applying page-specific styling to generic areas like the menu or the sidebar. Fixed after seeing it happen on the stats page... (index.template.php)

* Partially reverted the confirm rewrite. Although technically exciting, it wasn't solid enough and IE made it even more complicated, as always. Instead, I'm renaming the function to 'ask' and 'say' (respectively confirm and alert), and will rename manually every occurrence where it makes sense to have an improved confirm (or alert). Additionally, you can now provide a callback function, which makes sense within a non-event codeblock. (Subs-Template.php, script.js)

* Simplified JS code for error removal in error log. There was no reason to have the lastClicked variable around. Especially in Wedge with delayed events. (Errors.template.php)

* My select box now uses a proper unicode character to stand for the triangle, rather than the neat CSS triangle that still required a IE6 hack and had trouble getting aligned vertically. (sbox.js)

! Fixed a silly JS error introduced when converting to jQuery. (stats.js)

* Saved a few bytes off the weres() function calling process. (index.template.php)

! Forgot to complete a comment line in the ed
Re: New revs
« Reply #1657, on August 16th, 2012, 06:33 PM »
rev 1657 -- the final CSS frontier.
(11 files +29-32, 46kb)

+ Added 'the' list of CSS virtuals. Nuff said, now you can safely use them in your own plugin files. (common.css, index.css)

- External files no longer need the extra inline-block mixin. (admenu.css, editor.*.css)

* Renamed all CSS index files to 'hacks' when they're actually intended to be listed *after* the 'sections.css' file category, mostly in sub-skins. (The category for the main file list are listed in that order: common, index, sections, hacks, custom.) (index.*.css, hacks.*.css)

! An AWFUL lot of fixes for Internet Explorer, mainly in sub-skins. Because I'm not spending my days testing these silly browsers, or even my sub-skins for that matter... Just gonna add: it's not perfect (mini-menus still don't work), but it's damn more than what its old versions deserve. (hacks.ie[*].css)

* And even more tweaks for all browsers, making Weaving (and sometimes sub-skins) look better overall. Things like backgrounds, reqWin popups, gradients have all been overhauled... And possibly broken in places. It's a major rewrite, and it's working for me. Good enough for a commit! (*.css)
Re: New revs
« Reply #1658, on August 16th, 2012, 11:12 PM »
rev 1658
(4 files +2-2, 4kb)

* Admin homepage no longer needs to declare inline-block class on every item. Also added a plugin_from class to the plugin page to avoid using the class in HTML. (Admin.template.php, mana.css)

* Using a hardcoded style is bad... Well. Whatever. (Profile.template.php)

! Typonazi. (skins/Wireless/hacks.css)

! Fixed Wireless by renaming sections.* to hacks.*... I know, it's quite complicated. (skins/Wireless/hacks.*.css)
Re: New revs
« Reply #1659, on August 17th, 2012, 12:26 AM »
rev 1659 -- back to short commits... Phew :) :)
(1 file, 1kb)

! Fixed mini-menus in IE6. (hacks.ie[6].css)
Re: New revs
« Reply #1660, on August 17th, 2012, 10:10 AM »
rev 1660
(1 file +26-26, 24kb)

* Renamed 'hacks' CSS filename category to 'extra', which is probably more neutral and better suited to both sub-skin additions and browser hacks. (Subs-Cache.php, hacks.*.css, extra.*.css)
Re: New revs
« Reply #1661, on August 18th, 2012, 10:05 AM »
rev 1661
(3 files, 3kb)

! Fixed handling of @keyframes in WeCSS. (Class-CSS.php)

! Fixed a bug in surroundText() that made it fail when called with an empty selection (e.g. smart quote splitter.) (editor.js)

! And fixed another bug in surroundText() that made the focus go to the end of the post because of a last-minute pre-commit optimization -- you know, my biggest flaw. At least I'm aware of it. (editor.js)

! Bytesizenazi. (editor-func.js)
Re: New revs
« Reply #1662, on August 20th, 2012, 06:43 PM »
rev 1662 -- a couple more are coming up.
(1 file, 1kb)

! Undefined variable in keyframes fixer. Woops. (Class-CSS.php)

+ Added support for fallback conversion from standard to prefixed syntax in radial gradients, allowing you to provide only the 'at' syntax. (Class-CSS.php)

! CSS transitions are not limited to the 'transition' keyword. (Class-CSS.php)
Re: New revs
« Reply #1663, on August 20th, 2012, 06:48 PM »
rev 1663 -- and a couple more are coming, as always it's sorted thematically...
(5 files +10-10, 10kb)

* Removed fallback gradient from the index CSS file (as allowed by the previous commit), and optimized/fixed a couple of other gradients. (index.css)

* Renamed all *.ie[6].css (or other versions) to *.ie6.css, because on a philosophical level, the brackets should really only be used for providing ranges. (*.css, skin.xml)

! Fixed inverted gradient in Zoomedia. (zoom.css)
Re: New revs
« Reply #1664, on August 20th, 2012, 06:49 PM »
rev 1664 (one left to commit -- the JavaScript stuff -- probably not coming immediately though.)
(2 files, 7kb)

* Simplified, strengthened and sped up the hasBrowser function, by a very decent factor! So, now you can use index.ie6,ie7.css if you want, or index.ie[6-7].css, or index.ie[-7].css. Or even index.ie6,firefox[-15],safari[5-].css or whatever you want, really. I'm not going to judge you. I have issues of my own. (Load.php, Subs-Cache.php)

* Reworked detectBrowser() in a similar fashion. Chromium always provides a Chrome version number so we don't need the Chromium detection. Chrome for iOS, however, provides CriOS instead of Version, so I'm now accounting for that. Version numbers are now simplified to the first significant sub-version. For instance, v2.01 would be recorded as '2', v2.1.7 as '2.1' and v2.50.3 as '2.5'. If browser makers don't start screwing up with version numbers, everybody should be happy. Especially me. (Load.php, Subs-Cache.php)