New revs

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs
« Reply #1260, on January 17th, 2012, 11:18 PM »
rev 1260
(2 files, 1kb)

! Fixed incorrect positioning inside select box dropdown during its opening animation, as well as when first using the mouse wheel if not positioned at the top. (sbox.js)

! Fixed select box animation glitches when using Opera and select box is within an inline box or something. Well, technically I've hidden the problem under the carpet rather than fixed it, but whatever. (sbox.js)

* Simplified some of the select box code. Scrollbar didn't need updating when re-opening dropdowns. There was no need for openSB to check for the .open class either (it's always done before the function is called), and scrollbar creation was doing some extra hiding/showing work on the dropdown, which was already done in its parent function. All in all, saved a total of 32 bytes :) (sbox.js)

- Not sure why the yesno HTML had an extra div... (Media.template.php)
Re: New revs
« Reply #1261, on January 18th, 2012, 04:04 PM »
rev 1261
(3 files, 2kb)

! Browser test variables (is_*) were returning 'undefined' instead of 'false', causing an issue with opacity animation in the menus.[1] (script.js)

! Fixed Wedgeward credit not aligning correctly in old IE versions. (Credits.php)

* Translation fix. (Admin.french.php)
 1. I couldn't decide whether the opacity animation should actually stay or not, though. I like it in the main menu, but it's a bit overkill elsewhere.
Re: New revs
« Reply #1262, on January 20th, 2012, 04:52 PM »
rev 1262
(4 files, 11kb)

* I'm going to go slowly with that editor rewrite mentioned on the forums... First, I'm committing things not related to removing (or keeping) the iframe. Then we'll see where it starts to go crazy. (editor.js)

  - Removed blur/focus functions for IE. They weren't in use anyway.
  - Removed unprotectText, integrated it in the only place where it was used.
  - Removed debug breadcrumb, probably of some use to the SMF devs back in the day. Not anymore.
  ! Do not test for the existence of pasteHTML on a Range object that could very well be set to null...
  ! Fixed BBC tags being added in reverse order if the cursor is at the start of a line (in Chrome and Opera at least.)
    @ As suggested in SMF's bug report #4071, but never applied to SMF itself.

* Moved surroundText and replaceText back into the editor object. I figured that they're too specific to be decently usable by plugins. They might as well write their own code (or just copy it from there, not an issue.) (post.js, editor.js)

* The Send PM page didn't have the right title. (PersonalMessage.php)

- Removed MegaVideo from Aeva's video site list. In case you didn't hear on the news, it would seem that they're gone for good... (Subs-Aeva-Sites.php)
Re: New revs
« Reply #1263, on January 20th, 2012, 05:28 PM »
rev 1263
(1 file, 3kb)

* A few more incremental rewrites for the editor. (editor.js)

  * Renamed oTextHandle to oText, and made it a jQuery object. Rewrote related code to use jQuery as well.
  * Renamed oweEditorCurrentResize to oCurrentResize.
  * Renamed an onresize to onresizestart, to match the code in the PHP class.
  - Removed instanceRef variables, never used (known song.)
  - resizeTextArea() only takes one parameter. Removed all unrelated code, including that long function that calculated dimensions...
Re: New revs
« Reply #1264, on January 20th, 2012, 08:02 PM »
rev 1264
(1 file, 1kb)

* Setting editor frame's body to maximum height, allowing Opera users to click anywhere in the frame to select it (other browsers don't seem to work as well here.) (editor.js)

! Firefox still needed the 'silly hack' to focus, even if not showing the blinking cursor. It's all about disabling the navigation keys... (editor.js)
Re: New revs
« Reply #1265, on January 21st, 2012, 11:36 PM »
rev 1265
(2 files, 1kb)

* Simplified editor resizing code. document.mousemove() works perfectly across all browsers I tested, even if hovering the iframe. Which totally makes sense... Also, I didn't see why it should cancel the resizing process if trying to resize to zero height. Wedge will simply set a minimum height for the editor. And finally, removed the default resizers in Chrome and the latest Firefoxes, through CSS. (editor.js, editor.css)

- Removed rev 1264's iframe height hack, as it didn't actually work, even in Opera. A momentary lapse of reason. (editor.js)

- Removed a few unused variables and function names. (editor.js)
Re: New revs
« Reply #1266, on January 22nd, 2012, 09:40 AM »
rev 1266
(2 files, 4kb)

* Dozens of size optimizations. Really, that's all there is to this commit... Still, it's a lot of changes and I need to commit them separately. (editor.js)

- Removed bRTL parameter from editor -- using document's HTML dir instead. (editor.js, Class-Editor.php)
Re: New revs
« Reply #1267, on January 23rd, 2012, 10:50 AM »
rev 1267
(9 files, 9kb)

+ Added a section tag around all sidebar blocks. Although it's not 'mandatory' per se, it'd be good practice to separate sidebar blocks semantically, in case it has to be shown horizontally.[1] (Admin.template.php, Display.template.php, GenericMenu.template.php, index.template.php, InfoCenter.template.php, Media.template.php, MessageIndex.template.php)

! Avoid generating confusing PHP 'undefined index' errors when doing improper CSS nesting. This really calls for a error handler to be implemented, but for now I think I'd rather have the skin author get a 'visual' hint that they made a mistake (i.e. incorrect styles) than a PHP error, which they're not always likely to notice. (Class-CSS.php)

! Forgot (it seems to be my most common mistake?) the semi-colons on the surroundText/replaceText method reintroductions. Also optimized more code. (editor.js)

! Wysiwyg editor no longer worked in IE6 and IE7. (editor.js)

@ Note: it STILL doesn't work properly, i.e. focus is broken, like my infamous iframe-less rewrite... Looks like this has been the case for some time, though, actually even before I started the rewrite.

@ Note: the thought editor seems to disappear in some situations. I'll get to that.
 1. Which, as you can guess, I've always wanted to do -- like on Wedge.org -- and am now doing quite properly in Worg...
Re: New revs
« Reply #1268, on January 23rd, 2012, 11:19 AM »
rev 1268
(2 files, 1kb)

! Fixed the thought editor bug mentioned in the last commit. Code is also a bit tighter now... (script.js)

* 800ms is a tiny bit too much for gallery animations, I'd say... Yeah, I need to apply that to other areas too. (zoomedia.js)
Re: New revs
« Reply #1269, on January 24th, 2012, 10:11 AM »Last edited on January 25th, 2012, 11:38 PM by Nao
rev 1269
(4 files, 2kb)

* Quotenazi. (Class-Editor.php)

* PM rule descriptions should put more emphasis on the and/or switch, so I'm setting it to bold instead of italics. (PersonalMessage.language.php)

! Auto-suggest dropdown wasn't removed when using the Backspace key on an entry with three characters. This was due to an incorrect 'this' reference in the setTimeout call. (suggest.js)
Re: New revs
« Reply #1270, on January 25th, 2012, 11:38 PM »Last edited on January 27th, 2012, 10:52 AM by Nao
rev 1270
(5 files, 4kb)

! Fixed this most *annoying* IE 6-10 bug that took me over a week to find and neutralize, where the cursor position was reset to the message's beginning when clicking a smiley or button in Wysiwyg mode. Note for anyone at SMF tempted to use sprites for buttons in the editor: don't even think of getting rid of the img tag. Or at least, just having an empty div will break your stuff. Trust me, you don't wanna waste a week debugging this. (Class-Editor.php)

! Fixed another IE bug where it didn't correctly convert smileys from Wysiwyg to non-Wysiwyg mode. This is because it seems to reorder img tag parameters instead of using whatever was requested originally. Bad IE. (Class-Editor.php)

! Fixed installer's first page: CSS cache generation was broken (resulting in unstyled HTML), and the language select box wouldn't show up. (other/install.php, install.css)

* Moved New/Modify links in the Thought editor to inside the block, rather than in the block header. I'd say I should avoid putting links in short headers, because it can break the overall layout easily. (index.template.php)

* Forgot to document the 'include' keyword for code tags in skin files. (Warm/skin.xml)

:edit: - Removed Arial Black font from font list. Latest versions of Firefox, due to their font engine rewrite, will now ignore a simple "font-family: Arial Black" and instead expect "font-family: Arial; font-weight: 800" to show it. This is too complicated to implement with regards to the limited interest of that font face.
Re: New revs
« Reply #1271, on January 26th, 2012, 12:48 AM »
rev 1271
(3 files, 14kb)

* Dozens of extra size optimizations on the Wysiwyg editor, most notably all for () loops were replaced with my beloved $.each() call. That was NOT easy, though, especially in post.js... Still, over one kilobyte saved on the gzipped minified file? Not something to complain about! (editor.js, post.js)

* I try to avoid code evaluation when possible, such as in setInterval calls. (post.js)

! Chrome didn't correctly retrieve the current font face when navigating the Wysywig editor. Seems to be working for all three font parameters in IE, Chrome, Firefox and Opera. Last time I checked, it wasn't the case... Let's not ask too many questions. (editor.js)

! updateEditorControls()'s breadcrumb builder would actually execute way too much code in one of its loops, as most of it only needed to be called once. (editor.js)

! Fixed a bug in rev 1270 where I wrote some JavaScript when I meant to be using PHP. Perhaps I was *too* thrilled I'd fixed that bug... (Class-Editor.php)
Re: New revs
« Reply #1272, on January 27th, 2012, 10:46 AM »
rev 1272
(3 files, 9kb)

* WYSIWYG: Rewrote a lot of the updateEditorControls code to work properly across all browsers I could test against. (editor.js)

+ WYSIWYG: Added an .insertStyle(object) function to the editor object, where you specify a key/value object similar to .css(object) to add specific styles to the selection. Note: if using styleWithCSS, we'd also have to match span[style*="xxx-large"]. Thankfully I removed that one. Also, it could be interesting to actually re-use this code to replace most of the complex insertions like insertCustomHTML... (editor.js)

! WYSIWYG: Only update select boxes if their contents were actually changed. It's not a free process, you know. (post.js)

! WYSIWYG: Ensure select boxes don't try to select an invalid value. (post.js)

* Harmonized editor's textarea and iframe to have the same sizes and appearances. (Well, internal iframe padding is off by a pixel in some browsers but it's the best I could do.) The main trick was to actually set their display to block, as odd as it may sound. (editor.js, editor.css)

:edit: Updated rev 1270's changelog with an item I forgot to document.
Re: New revs
« Reply #1273, on January 27th, 2012, 12:35 PM »
1273
(5 files, 1kb)

- Removed a few unused global declarations of $user_settings. (ManageServer.php, PersonalMessage.php, Profile.php, Security.php, Subs-Auth.php)
Re: New revs
« Reply #1274, on January 27th, 2012, 12:38 PM »
rev 1274
(1 file, 2kb)

+ Added a transparency flag to attachments. Yep. You know what I'm gonna do. I just need a couple of hours to grab a snack and check my implementation's elegance. (install.sql)

! Turning BBC size 1-7 to use the equivalent point size instead of em's, to match whatever's in the Wysiwyg editor. (install.sql)

(Next commit will be a bit bigger.)