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.
3706
Features / Re: New revs
« on February 5th, 2013, 05:12 PM »
Oh my, we need to do something about the like styling in thoughts... I guess it's going to force me to do my thought mini-menu earlier than hoped... :^^;:
rev 1902
(3 files +1, 35kb)
* Split Subs-Template's wetem object into its own file, Class-Skeleton. This was long overdue, especially considering it represented about a third of the more generic template code. (Class-Skeleton.php, Subs.php, Subs-Template.php)
* Moved <move> XML commands upstream, to avoid storing them in a variable for no reason other than legacy code. (Subs-Cache.php)
! oldIE has a very odd bug (who's surprised?), where it loads a CSS file twice if we linked to it without a protocol (i.e. //domain). Although it's unlikely you'd want to point to an external stylesheet in your code, it's still a possibility, so until further notice I'll be adding this extra regex to protect external stylesheets. (Subs-Template.php)
rev 1902
(3 files +1, 35kb)
* Split Subs-Template's wetem object into its own file, Class-Skeleton. This was long overdue, especially considering it represented about a third of the more generic template code. (Class-Skeleton.php, Subs.php, Subs-Template.php)
* Moved <move> XML commands upstream, to avoid storing them in a variable for no reason other than legacy code. (Subs-Cache.php)
! oldIE has a very odd bug (who's surprised?), where it loads a CSS file twice if we linked to it without a protocol (i.e. //domain). Although it's unlikely you'd want to point to an external stylesheet in your code, it's still a possibility, so until further notice I'll be adding this extra regex to protect external stylesheets. (Subs-Template.php)
3707
Features: Forward thinking / Re: jQuery support
« on February 5th, 2013, 12:58 PM »Wait, what? Am I seriously reading this correctly?Quote from Nao on February 4th, 2013, 11:13 PM So... This is a totally undocumented bug. I don't know if I should care to 'report' it. I've read a bug report from v1.8 saying that the jQuery team has deprecated { async: false } in $.ajax, just because they didn't like that, basically... Apparently to them, it's important that 'A'jax is always 'A'synchronous, so synchronous calls should be done from a function called $.sjax... Lol. Well, anyway, the stuff is still there, and usable and all, but it simply doesn't return a proper responseXML. Only a responseText. So I thought about it and looked into the Wedge codebase, this is the only place where I'm doing a synchronous call, and turning it into an asynchronous call would be disastrous. So, you know what I did...?
As for the bug, I decided to report it to the team, because Wedge is one thing, but the entire interwebs (or at least 55% of them) are another.
http://bugs.jquery.com/ticket/13388
That makes a lot of sense :) Actually there aren't many places we do export XML, it's more internal use. I did contemplate - briefly, mind - using JSON for the plugin manager but the one thing XML does that JSON doesn't cleanly do is be able to attach attributes to elements in a multidimensional fashion, e.g. <element attr="value"> without making it another level of nesting.
I don't think this is a feature change that would hurt plugins or themes if we postponed it to after the gold release, so it's not urgent whatsoever, but it'd be nice.
Also, you're not the Wesley Crusher of gzipping, you're the Data of gzipping. Being the Wesley Crusher makes you the smart-arse no-one likes (and one person even told him to his face that it's a good thing he's cute otherwise he could be obnoxious), whereas being the Data of gzipping means it's cool to be intense about it.
3708
Features / Re: New revs
« on February 4th, 2013, 11:39 PM »
rev 1900
(4 files +2, 7kb)
+ Preliminary implementation of the skeleton rewrite. This involves separating skin.xml skeletons into their own files, and removing the template_skeleton function from the index template, to be replaced by a (simpler?) skeleton.xml file in the skins folder. Currently, the only drawback is that you can no longer override a skeleton just with the magic of custom.xml, but OTOH I don't really see a reason for doing that, you're better off use <move> commands in that file. Perhaps I should also add custom.xml commands to <add> or <remove> elements from a skeleton..? (Load.php, Subs-Cache.php, index.template.php, skins/skeleton.xml, Warm/skeleton.xml, Warm/skin.xml)
(4 files +2, 7kb)
+ Preliminary implementation of the skeleton rewrite. This involves separating skin.xml skeletons into their own files, and removing the template_skeleton function from the index template, to be replaced by a (simpler?) skeleton.xml file in the skins folder. Currently, the only drawback is that you can no longer override a skeleton just with the magic of custom.xml, but OTOH I don't really see a reason for doing that, you're better off use <move> commands in that file. Perhaps I should also add custom.xml commands to <add> or <remove> elements from a skeleton..? (Load.php, Subs-Cache.php, index.template.php, skins/skeleton.xml, Warm/skeleton.xml, Warm/skin.xml)
3709
Features / Re: New revs
« on February 4th, 2013, 11:25 PM »
rev 1899
(3 files, 1kb)
! Fixed a jQuery 1.9-induced bug where editing a thought that had a smiley or a BBC tag would return an empty text string instead of the existing thought. Funny thing is, this fix actually removes 12 gzipped bytes from the script file... I'm the Wesley Crusher of gzipping. I pwn gzip, and people hate me for that. (script.js, Ajax.php)
* Just renamed a deprecated .error() to .fail()... Whatever. Looks like the jQuery team has a lot of time on their hands... ;) (topic.js)
(3 files, 1kb)
! Fixed a jQuery 1.9-induced bug where editing a thought that had a smiley or a BBC tag would return an empty text string instead of the existing thought. Funny thing is, this fix actually removes 12 gzipped bytes from the script file... I'm the Wesley Crusher of gzipping. I pwn gzip, and people hate me for that. (script.js, Ajax.php)
* Just renamed a deprecated .error() to .fail()... Whatever. Looks like the jQuery team has a lot of time on their hands... ;) (topic.js)
3710
Features: Forward thinking / Re: jQuery support
« on February 4th, 2013, 11:13 PM »
So... This is a totally undocumented bug. I don't know if I should care to 'report' it. I've read a bug report from v1.8 saying that the jQuery team has deprecated { async: false } in $.ajax, just because they didn't like that, basically... Apparently to them, it's important that 'A'jax is always 'A'synchronous, so synchronous calls should be done from a function called $.sjax... Lol. Well, anyway, the stuff is still there, and usable and all, but it simply doesn't return a proper responseXML. Only a responseText. So I thought about it and looked into the Wedge codebase, this is the only place where I'm doing a synchronous call, and turning it into an asynchronous call would be disastrous. So, you know what I did...?
I just rewrote Ajax.php to return a simple text string. Voilà. And it makes script.js a bit shorter, too... It's not as clean as before, but anyway we already discussed returning JSON instead of XML for all calls, haven't worked on that because it's a lot of work for a result that may not be that rewarding, but at least in that particular case, getting rid of XML felt good... ;)
I just rewrote Ajax.php to return a simple text string. Voilà. And it makes script.js a bit shorter, too... It's not as clean as before, but anyway we already discussed returning JSON instead of XML for all calls, haven't worked on that because it's a lot of work for a result that may not be that rewarding, but at least in that particular case, getting rid of XML felt good... ;)
3711
Features: Forward thinking / Re: jQuery support
« on February 4th, 2013, 05:16 PM »
I'm not exactly thrilled with jQuery 1.9, really... -_-
After the .prop() fiasco of today (see thoughts page for this), a new bug has emerged. If you edit a thought that has HTML in it, it gives you an empty text input.
The reason: HTML strings trigger a request to the server to get an HTML-free version. This is sent through Ajax (because we're worthy), and returned via a <?xml> page, processed with responseXML, and shown in the text input.
However, for an unknown reason, even when trying to force the 'xml' dataType, jQuery INSISTS on returning a plain text string instead of an XML object... i.e. the result is in responseText, not responseXML.
It can "easily be fixed" by replacing responseXML with responseText, but... WHY? Oh, WHY???!!!
Why the hell is jQuery full of bugs now? There were a few bugs in v1.5 but they were nothing to be angry about! This one is!
Are we gonna find bugs forever like this? Or will they fix them in v1.9.1 and we just have to be patient..?!
After the .prop() fiasco of today (see thoughts page for this), a new bug has emerged. If you edit a thought that has HTML in it, it gives you an empty text input.
The reason: HTML strings trigger a request to the server to get an HTML-free version. This is sent through Ajax (because we're worthy), and returned via a <?xml> page, processed with responseXML, and shown in the text input.
However, for an unknown reason, even when trying to force the 'xml' dataType, jQuery INSISTS on returning a plain text string instead of an XML object... i.e. the result is in responseText, not responseXML.
It can "easily be fixed" by replacing responseXML with responseText, but... WHY? Oh, WHY???!!!
Why the hell is jQuery full of bugs now? There were a few bugs in v1.5 but they were nothing to be angry about! This one is!
Are we gonna find bugs forever like this? Or will they fix them in v1.9.1 and we just have to be patient..?!
3712
Features / Re: New revs
« on February 4th, 2013, 04:45 PM »
rev 1898
(3 files, 71kb)
! The jQuery CDN (code.jquery.com) doesn't support HTTPS, so don't bother using it when that particular CDN is selected. (Load.php, Subs-Cache.php)
* Committed by mistake a custom minified version of jQuery 2.0... While it was about 600 bytes smaller than the official one, it didn't compress as well. Beats me. (jquery-2.0.0b1.min.js)
(3 files, 71kb)
! The jQuery CDN (code.jquery.com) doesn't support HTTPS, so don't bother using it when that particular CDN is selected. (Load.php, Subs-Cache.php)
* Committed by mistake a custom minified version of jQuery 2.0... While it was about 600 bytes smaller than the official one, it didn't compress as well. Beats me. (jquery-2.0.0b1.min.js)
3713
Features / Re: New revs
« on February 4th, 2013, 04:44 PM »
rev 1897
(22 files, 6kb)
! Thank you very much jQuery, for being so obscure when it comes to the .attr()/.prop() change in v1.9. I'm not so stupid, but it was made very unclear that you reverted back to v1.6.0's behavior, and moreover it's totally erratical, e.g. doing .attr('disabled', true) still works. Nevertheless, I've taken the time to replace access to all of our boolean properties with a .prop() call or direct DOM access. This fixes a bug in the admin registration page, and most importantly a big one in the Select Box which was due to .attr('selected') not being taken into account. Here's hoping I didn't screw up anything else with my rewrites. (upgrade.php, install.php, ManageBoards.php, ManageMemberOptions.php, ManageNews.php, ManagePaid.php, ManageRegistration.php, ManageSearchEngines.php, ManageSettings.php, sbox.js, spellcheck.js, TEMPLATES: Admin, ManageBoards, ManageMaintenance, ManageMembergroups, ManagePaid, ManagePermissions, ManageSmileys, Packages, PersonalMessage, Profile, Register)
* Forgot to commit a portion of the sortable rewrite for membergroup badges. (ManageMembergroups.template.php)
(22 files, 6kb)
! Thank you very much jQuery, for being so obscure when it comes to the .attr()/.prop() change in v1.9. I'm not so stupid, but it was made very unclear that you reverted back to v1.6.0's behavior, and moreover it's totally erratical, e.g. doing .attr('disabled', true) still works. Nevertheless, I've taken the time to replace access to all of our boolean properties with a .prop() call or direct DOM access. This fixes a bug in the admin registration page, and most importantly a big one in the Select Box which was due to .attr('selected') not being taken into account. Here's hoping I didn't screw up anything else with my rewrites. (upgrade.php, install.php, ManageBoards.php, ManageMemberOptions.php, ManageNews.php, ManagePaid.php, ManageRegistration.php, ManageSearchEngines.php, ManageSettings.php, sbox.js, spellcheck.js, TEMPLATES: Admin, ManageBoards, ManageMaintenance, ManageMembergroups, ManagePaid, ManagePermissions, ManageSmileys, Packages, PersonalMessage, Profile, Register)
* Forgot to commit a portion of the sortable rewrite for membergroup badges. (ManageMembergroups.template.php)
3714
Features: Forward thinking / Re: jQuery support
« on February 3rd, 2013, 11:59 PM »
Basically: keep it as it is.
What they're not telling us, or telling us in a convoluted manner, is that:
- you can use .attr() on anything (attributes and properties), jQuery will do the cleaning up,
- you should use .prop() on properties, and you REALLY should use it on properties that accept/return a boolean value (there's a list hidden in the migrate plugin, includes checked, disabled, autoplay, readOnly, etc...)....
- ...BUT you don't HAVE to use .prop() anywhere, it's just a matter of semantics really, and .prop() is also 4 times faster,
- and basically, if you want speed, you should directly access the DOM property, rather than use a jQuery method.
So, in the end: jQuery 1.9 didn't require ANY changes in Wedge, except for the .live() function being removed, and I used it a total of 3 times. The rest is just either semantics on their side, or changes that allow me to save a few extra bytes so I'm adopting them. But even then, it would be easy to come back to a v1.5 implementation.
What they're not telling us, or telling us in a convoluted manner, is that:
- you can use .attr() on anything (attributes and properties), jQuery will do the cleaning up,
- you should use .prop() on properties, and you REALLY should use it on properties that accept/return a boolean value (there's a list hidden in the migrate plugin, includes checked, disabled, autoplay, readOnly, etc...)....
- ...BUT you don't HAVE to use .prop() anywhere, it's just a matter of semantics really, and .prop() is also 4 times faster,
- and basically, if you want speed, you should directly access the DOM property, rather than use a jQuery method.
So, in the end: jQuery 1.9 didn't require ANY changes in Wedge, except for the .live() function being removed, and I used it a total of 3 times. The rest is just either semantics on their side, or changes that allow me to save a few extra bytes so I'm adopting them. But even then, it would be easy to come back to a v1.5 implementation.
3715
Features / Re: New revs
« on February 3rd, 2013, 10:56 PM »
rev 1895 -- invented a new word! A day not wasted.
(9 files, 5kb)
+ Added a couple of menu separators in crowded submenus. (Admin.php)
* Updated jQuery UI to version 1.10, the latest available. (Subs-Cache.php)
* Rewrote sortable handler in Membergroup Badge and Order Pinned Topics pages to be more visible. Harmonized both sortable to use similar CSS. (Post.template.php, mana.css)
* Naoism: saving a microcycle. (Load.php)
* Naoism: comment typos. Also, Pete, you must have a 4K screen if you're able to read that MessageIndex comment without scrolling... ;) (MessageIndex.php, Pin.php)
* Naoism: slight changes to arrow color/size in menus and linktrees. Still not perfect, but it looks better than originally in Chrome. And since I'm no longer using Opera as my default browser these days (oh, how I miss you, good ol' Opera 9.2x days...), it's important to make them look perfect in the widest used browser. (What? IE? Never heard about that.) (common.css, index.css)
* Naoism: slightly less aggressive menu background color for IE9. I was about to use the same for Chrome, but I chickened out at the last minute. There's a barely noticeable delay in loading them... I'm wary of seeing older computers in pain. (index.css)
@ For those wondering, Naoism is the opposite of Taoism. It means that bickering about every little stupid detail is what life is really about.
(9 files, 5kb)
+ Added a couple of menu separators in crowded submenus. (Admin.php)
* Updated jQuery UI to version 1.10, the latest available. (Subs-Cache.php)
* Rewrote sortable handler in Membergroup Badge and Order Pinned Topics pages to be more visible. Harmonized both sortable to use similar CSS. (Post.template.php, mana.css)
* Naoism: saving a microcycle. (Load.php)
* Naoism: comment typos. Also, Pete, you must have a 4K screen if you're able to read that MessageIndex comment without scrolling... ;) (MessageIndex.php, Pin.php)
* Naoism: slight changes to arrow color/size in menus and linktrees. Still not perfect, but it looks better than originally in Chrome. And since I'm no longer using Opera as my default browser these days (oh, how I miss you, good ol' Opera 9.2x days...), it's important to make them look perfect in the widest used browser. (What? IE? Never heard about that.) (common.css, index.css)
* Naoism: slightly less aggressive menu background color for IE9. I was about to use the same for Chrome, but I chickened out at the last minute. There's a barely noticeable delay in loading them... I'm wary of seeing older computers in pain. (index.css)
@ For those wondering, Naoism is the opposite of Taoism. It means that bickering about every little stupid detail is what life is really about.
3716
Features / Re: New revs - Public comments
« on February 3rd, 2013, 10:16 PM »
Bump for my post above. I think that doing that robots.txt thing or htaccess or whatever should be discussed.
@Lorenzo> I'm surprised a CDN not advertised on jquery.com would offer it..? Anyway, isn't this only for cloudflare customers?
I wouldn't be fussed over whether we should add it or not, but I just don't know if they're going to keep up with jQuery's releases, precisely because they're not officially sanctioned. It'd be a disaster if I started having to check whether all CDNs provide the version I'm targeting... Right now I'm only doing a special test for beta versions -- forcing the CDN to code.jquery.com (which is the only one to host beta versions), in case a beta or RC tag is found in the filename. (I think that one's a good idea. :cool:)Quote from Arantor on February 3rd, 2013, 04:29 AM I'm not sure, but that's the idea :)
I've had a look at your code, and you're too kind with suggest.js, you shouldn't have kept the opt.sTextDeletItem stuff at all I'd say... ;) Who's going to change it anyway..? A plugin? Bad semantics, bad karma!
Also, I was thinking we could rename pm.js to member.js and instead include in that file all of the small functions that aren't targeted to guests... e.g. the draft auto-save, things like that. But if it forces members to load the PM JS code on every page where draft auto-saving is required (for instance), it might not be that helpful.
Haven't looked at all the functions that could benefit from being moved there.Quote Yup, definitely the idea ;)Quote Yep yep yep, my you're scaring me! :lol:Quote Okay, seriously... Have I started tainting you with my madness? I'm so sorry... :^^;:
Anyway, I did a few @language stunts when I implemented the thing, then I pretty much stopped because of a bug which I only fixed recently, and then I was too busy with other things to think of it.
I looked into the code and found some more...
- txt.done in spellcheck.js -- however, I'd advise against adding it for one reason: if you're not using the default language, you'll get another instance of your language name in the spellcheck JS URL, while the txt.done string seems to be initialized only in the spellcheck popup. Actually, I'd be interested in knowing why spellcheck.js is loaded at all in the editor, when all of the operations are done from the popup (which can load the JS file by itself...)
- your very own draft auto-save code :) I don't think there's anything preventing that one from being passed on.
- the YUI uploader -- we need to rewrite it to use HTML5, by the way... :-/
- the upshrink description for toggles could be a 'default' instead of being explicitly set (it's the only text string that's actually sent to them, except from a few "-" here and there.) Either with something like altExpanded: 'default', or not setting it at all in the HTML -- although we'd have to ensure that it 'works' on all toggles that don't specify an alt. It's important to check on this one -- it's on every single page! :)
- message_txt_delete in wedgeAttachSelect is a given :)
- register.js always uses the same regTextStrings, with the Register page adding a few strings compared to the Reminder page. We could, instead of sending the text strings, send a boolean determining whether register.js will use one set of strings or the other.
That's all I could find for now... (Okay, "forever", since I'm unlikely to do that again!)
I searched through "JavaScriptEscape($txt", by the way, in case you know of a few places where we don't sanitize the strings when passing them to JS. I don't think there are any ;)
Do you want to do them all, or split the job, or let me do them?
Whichever you prefer. Right now I'm busy at work on splitting skeleton stuff anyway.
@Lorenzo> I'm surprised a CDN not advertised on jquery.com would offer it..? Anyway, isn't this only for cloudflare customers?
I wouldn't be fussed over whether we should add it or not, but I just don't know if they're going to keep up with jQuery's releases, precisely because they're not officially sanctioned. It'd be a disaster if I started having to check whether all CDNs provide the version I'm targeting... Right now I'm only doing a special test for beta versions -- forcing the CDN to code.jquery.com (which is the only one to host beta versions), in case a beta or RC tag is found in the filename. (I think that one's a good idea. :cool:)
! Did I mention that I love the @language embedding into script files?
I've had a look at your code, and you're too kind with suggest.js, you shouldn't have kept the opt.sTextDeletItem stuff at all I'd say... ;) Who's going to change it anyway..? A plugin? Bad semantics, bad karma!
Also, I was thinking we could rename pm.js to member.js and instead include in that file all of the small functions that aren't targeted to guests... e.g. the draft auto-save, things like that. But if it forces members to load the PM JS code on every page where draft auto-saving is required (for instance), it might not be that helpful.
Haven't looked at all the functions that could benefit from being moved there.
Set a default string from index, set it once and never have to explicitly set it again in any of the multiple places it is called (unless you *really* want to).
All this for the 'delete item' help text on the auto suggest... it's the same everywhere, so just embed it in to the suggester as a default! It bugged me, mkay? (all files)
@ And since it's now embedded in the suggest file, it will not only be gzipped and cached, it no longer has to be inlined into all the pages it's in, or declared in those pages where used. I would imagine that's actually a tidy little saving everywhere that uses the auto suggester, all in all. Every little helps.
Anyway, I did a few @language stunts when I implemented the thing, then I pretty much stopped because of a bug which I only fixed recently, and then I was too busy with other things to think of it.
I looked into the code and found some more...
- txt.done in spellcheck.js -- however, I'd advise against adding it for one reason: if you're not using the default language, you'll get another instance of your language name in the spellcheck JS URL, while the txt.done string seems to be initialized only in the spellcheck popup. Actually, I'd be interested in knowing why spellcheck.js is loaded at all in the editor, when all of the operations are done from the popup (which can load the JS file by itself...)
- your very own draft auto-save code :) I don't think there's anything preventing that one from being passed on.
- the YUI uploader -- we need to rewrite it to use HTML5, by the way... :-/
- the upshrink description for toggles could be a 'default' instead of being explicitly set (it's the only text string that's actually sent to them, except from a few "-" here and there.) Either with something like altExpanded: 'default', or not setting it at all in the HTML -- although we'd have to ensure that it 'works' on all toggles that don't specify an alt. It's important to check on this one -- it's on every single page! :)
- message_txt_delete in wedgeAttachSelect is a given :)
- register.js always uses the same regTextStrings, with the Register page adding a few strings compared to the Reminder page. We could, instead of sending the text strings, send a boolean determining whether register.js will use one set of strings or the other.
That's all I could find for now... (Okay, "forever", since I'm unlikely to do that again!)
I searched through "JavaScriptEscape($txt", by the way, in case you know of a few places where we don't sanitize the strings when passing them to JS. I don't think there are any ;)
Do you want to do them all, or split the job, or let me do them?
Whichever you prefer. Right now I'm busy at work on splitting skeleton stuff anyway.
3717
Features / Re: Plugin revs
« on February 3rd, 2013, 07:12 PM »
rev 72
(it's complicated, 3kb)
* Renamed MassUpload to MassAttach -- not because of any Tim Burton references, but to clarify that this isn't Aeva Media's mass-upload feature. Dragooon, I'm still waiting for your approval to change the author ID to Wedgeward ;) (mass_attach/*)
* Updated several files to use .on/.off instead of .bind/.unbind. This isn't mandatory, but might as well try and use what's being used in Wedge. (calendar/js/dateinput.js, disable_right_click/DisableRightClick.php, mass_attach/attachui.js)
! Fixed $.browser to is_safari for jQuery compatibility. (mass_attach/attachui.js)
(it's complicated, 3kb)
* Renamed MassUpload to MassAttach -- not because of any Tim Burton references, but to clarify that this isn't Aeva Media's mass-upload feature. Dragooon, I'm still waiting for your approval to change the author ID to Wedgeward ;) (mass_attach/*)
* Updated several files to use .on/.off instead of .bind/.unbind. This isn't mandatory, but might as well try and use what's being used in Wedge. (calendar/js/dateinput.js, disable_right_click/DisableRightClick.php, mass_attach/attachui.js)
! Fixed $.browser to is_safari for jQuery compatibility. (mass_attach/attachui.js)
3718
Features / Re: New revs
« on February 3rd, 2013, 06:49 PM »
rev 1894 - jQuery... Can't live with you, can't live without you!
(23 files +2 -1, 182kb -- including 171kb of jQuery code.)
+ Updated jQuery from v1.5.2 to a dual v1.9/2.0, where 1.9 is used for IE 6/7/8 while 2.0 is used for other browsers. Also added support for beta and RC versions of jQuery by redirecting Google and Microsoft CDNs to the jQuery CDN if a beta version is requested (like for the current 2.0 release.) In case you're wondering, we're mainly upgrading jQuery because v2.0 is actually (for the first time!) smaller and tighter than v1.5.2. Yay. (Load.php, jquery-1.5.2.min.js, jquery-1.9.0.min.js, jquery-2.0.0b1.min.js)
* Changed .bind(), .unbind() and .andSelf() respectively to .on(), .off() and .addBack(), recommended methods in jQuery. Saves a couple of bytes off each file. (attic/Unused-SelectBox.js, attic/Unused-events.js, attic/Unused-tie.js, Admin.template.php, ManageModeration.template.php, Profile.template.php, mediadmin.js, player.js, sbox.js, script.js, suggest.js, topic.js, zoomedia.js)
* Changed .live() and .die() to custom .on() and .off() versions which should be faster. One occurrence was instead replaced with a .one() sent at editor creation time (remember that seldom used function..?), which is way more efficient than a live() call anyway. (Display.php, editor.js, editor-func.js)
* Turning some leftover <whatever /> tags to <whatever> in help files. (Admin.english.php, Admin.french.php, Help.english.php, Help.french.php)
* French translation. (ManageBans)
@ Just realized I posted this at 18:49 French time... That's an anagram of rev 1894 :p
(23 files +2 -1, 182kb -- including 171kb of jQuery code.)
+ Updated jQuery from v1.5.2 to a dual v1.9/2.0, where 1.9 is used for IE 6/7/8 while 2.0 is used for other browsers. Also added support for beta and RC versions of jQuery by redirecting Google and Microsoft CDNs to the jQuery CDN if a beta version is requested (like for the current 2.0 release.) In case you're wondering, we're mainly upgrading jQuery because v2.0 is actually (for the first time!) smaller and tighter than v1.5.2. Yay. (Load.php, jquery-1.5.2.min.js, jquery-1.9.0.min.js, jquery-2.0.0b1.min.js)
* Changed .bind(), .unbind() and .andSelf() respectively to .on(), .off() and .addBack(), recommended methods in jQuery. Saves a couple of bytes off each file. (attic/Unused-SelectBox.js, attic/Unused-events.js, attic/Unused-tie.js, Admin.template.php, ManageModeration.template.php, Profile.template.php, mediadmin.js, player.js, sbox.js, script.js, suggest.js, topic.js, zoomedia.js)
* Changed .live() and .die() to custom .on() and .off() versions which should be faster. One occurrence was instead replaced with a .one() sent at editor creation time (remember that seldom used function..?), which is way more efficient than a live() call anyway. (Display.php, editor.js, editor-func.js)
* Turning some leftover <whatever /> tags to <whatever> in help files. (Admin.english.php, Admin.french.php, Help.english.php, Help.french.php)
* French translation. (ManageBans)
@ Just realized I posted this at 18:49 French time... That's an anagram of rev 1894 :p
3719
Features: Forward thinking / Re: jQuery support
« on February 3rd, 2013, 10:53 AM »
I'm astounded...
1/ There's an old jQuery blog post that mentions 'in passing' a list of properties that should be used by .prop(), and it's not "everything should use prop more or less", it's just the *boolean* properties that should go through .prop()...
2/ Even worse. I was completely misled both by the migration guide (read that particular paragraph!), and by the jQuery Migrate plugin's source code. While it does indicate that using .attr() for these shouldn't be done, it does NOT mean that the .attr() compatibility code was removed from jQuery 1.9/2.0, EVEN though the plugin proceeds to implement such compatibility... This is where I got screwed. Look for 'rboolean' in both jQuery 1.9 and jQuery Migrate plugin. They're both defined, and tested again. That's madness. I'm disgusted -- wasted a day trying to find proper documentation when all in all, it was still in it.
I sincerely hope that they never frigging enforce the .prop() behavior. If they do, I'll just resort to using it ONLY for boolean properties (the only difference is that a gzipped script.js+sbox.js will take an additional 3 bytes, as only .attr('readOnly', true) is concerned here.)
I will not waste another minute of my time trying to figure out what to do, what to change.
They still have a long list of things that should be checked against re: the upgrade guide... I'm very tempted to call it quits and just go with it.
I know I'll finish it, but I'm still pissed.
Quote from Nao on February 3rd, 2013, 10:03 AM There are also two .attr('selected', true) lines in sbox.js, but I don't know if it'd change the byte count.
Not that it matters... As I said, it works right now, and I don't want to even think of separating the two functions.
jQuery's one and ONLY goal is to give developers helper functions to make their life easier. I don't *care* if it makes life hell for the jQuery team. It's not that I don't like them -- it's that they should be happy they're used on half the largest sites of the world. It means what they've been doing is USEFUL. It means they're making JavaScript FUN to use. It means they're making their life hell so that ours isn't. It's a sacrifice for the greater good. So I don't care that I should use .prop() instead of .attr(). So, .attr() is four times slower than .prop() when used on properties? Big deal. If my .attr() calls were time-sensitive, I wouldn't call object.attr(property) or .prop() at all -- I'd call the property directly on the DOM object, that's all.
It's not that I think they should revert their behavior, since that's what they did in 1.6.1... It's that I think they should stop telling people that using .attr() is bad. YES, we KNOW it's bad. Just like using jQuery is BAD on time-sensitive loops, but you'll never see them mention that, will you...? Nothing is bad per se. What is bad is what bothers you. What bothers me is a wasted byte in a gzipped file. That's why I switched Wedge to use jQuery 2.0 -- because it's smaller than v1.5 overall, not for the extra features or bug fixes.
Ahh... Feels good to talk about it.
I knew there was a Google result that made me jump to my guns and start looking into the migration plugin code! :lol:
https://github.com/bcardarella/client_side_validations/pull/466
So, I guess it was an 'unfortunate series of events' that led me to believe they'd dropped .attr() support for properties...
1/ There's an old jQuery blog post that mentions 'in passing' a list of properties that should be used by .prop(), and it's not "everything should use prop more or less", it's just the *boolean* properties that should go through .prop()...
2/ Even worse. I was completely misled both by the migration guide (read that particular paragraph!), and by the jQuery Migrate plugin's source code. While it does indicate that using .attr() for these shouldn't be done, it does NOT mean that the .attr() compatibility code was removed from jQuery 1.9/2.0, EVEN though the plugin proceeds to implement such compatibility... This is where I got screwed. Look for 'rboolean' in both jQuery 1.9 and jQuery Migrate plugin. They're both defined, and tested again. That's madness. I'm disgusted -- wasted a day trying to find proper documentation when all in all, it was still in it.
I sincerely hope that they never frigging enforce the .prop() behavior. If they do, I'll just resort to using it ONLY for boolean properties (the only difference is that a gzipped script.js+sbox.js will take an additional 3 bytes, as only .attr('readOnly', true) is concerned here.)
I will not waste another minute of my time trying to figure out what to do, what to change.
They still have a long list of things that should be checked against re: the upgrade guide... I'm very tempted to call it quits and just go with it.
I know I'll finish it, but I'm still pissed.
Posted: February 3rd, 2013, 10:03 AM
I sincerely hope that they never frigging enforce the .prop() behavior. If they do, I'll just resort to using it ONLY for boolean properties (the only difference is that a gzipped script.js+sbox.js will take an additional 3 bytes, as only .attr('readOnly', true) is concerned here.)
Not that it matters... As I said, it works right now, and I don't want to even think of separating the two functions.
jQuery's one and ONLY goal is to give developers helper functions to make their life easier. I don't *care* if it makes life hell for the jQuery team. It's not that I don't like them -- it's that they should be happy they're used on half the largest sites of the world. It means what they've been doing is USEFUL. It means they're making JavaScript FUN to use. It means they're making their life hell so that ours isn't. It's a sacrifice for the greater good. So I don't care that I should use .prop() instead of .attr(). So, .attr() is four times slower than .prop() when used on properties? Big deal. If my .attr() calls were time-sensitive, I wouldn't call object.attr(property) or .prop() at all -- I'd call the property directly on the DOM object, that's all.
It's not that I think they should revert their behavior, since that's what they did in 1.6.1... It's that I think they should stop telling people that using .attr() is bad. YES, we KNOW it's bad. Just like using jQuery is BAD on time-sensitive loops, but you'll never see them mention that, will you...? Nothing is bad per se. What is bad is what bothers you. What bothers me is a wasted byte in a gzipped file. That's why I switched Wedge to use jQuery 2.0 -- because it's smaller than v1.5 overall, not for the extra features or bug fixes.
Ahh... Feels good to talk about it.
Posted: February 3rd, 2013, 10:34 AM
I knew there was a Google result that made me jump to my guns and start looking into the migration plugin code! :lol:
https://github.com/bcardarella/client_side_validations/pull/466
So, I guess it was an 'unfortunate series of events' that led me to believe they'd dropped .attr() support for properties...
3720
Features / Re: Pages: [1] 2 3 styling
« on February 2nd, 2013, 09:51 PM »That's not what I mean, will still have to go edit the source to remove that. Though personally I'd rather not have the [] anyway...
It's just a matter of searching for [<strong> and removing the [.
I quite like the [] myself, but I'm not fussed. I think the main point in [] is that it helps differentiate the current page from other pages when neither the color contrast and font weight (depending on the used font) are enough to spot the difference.
nav strong
font-weight: 700 // can be changed or removed, obviously...
:before
content: "["
:after
content: "]"And removing it for a sub-skin should be as easy as...
@remove nav strong:before
content: "["
@remove nav strong:after
content: "]"I should implement a way to entirely remove something without having to specify the code to remove... (Originally, @remove didn't even accept an extra parameter with the specific selector to impact.)