The nights are closing in again
After overdoing things in November, I took things easier during Advent.
New features
- You can get a link to any audio files related to a writeup by adjusting the appropriate setting at Advanced Settings. This was Oolong's work, I only switched it on.
- Editors can disable adding entire nodetypes to categories. This feature has been used to disable adding users to categories. We don't pigeon-hole people around here.
- The WYSIWYG text editor is resizable and can edit tables. It will not remove all the linebreaks from your html code.
- Your browser will not give you a cached version of your previous backup from Node Backup. The backup file has a datestamp in its name. You can opt to get a backup of your nodes as entered and as displayed both at once.
- The Notifications nodelet will display its settings if you don't have any notifications turned on. If you turn off all notifications, a magic link appears at the bottom of the settings to turn off the nodelet itself.
Maintenance and repair
- There is a horrible bug in jQuery which makes the jQuery add() function unbelievably slow when it is processing more than a small number of elements in Internet Explorer (it gets slower exponentially with larger numbers of elements). We no longer use the add() function, so 'slow script' warnings should be a thing of the past. It would be nice if the jQuery team would fix the problem, but they currently see it as a symbol of their virtue.
- For similar reasons, we don't use the andSelf() function, either.
Improvements in the machinery
- The e2() function got more flexible and easier to use. This is the function that activates the the JavaScript magic when an E2 page is loaded and passes it on to any bits of the page that are updated by AJAX. Doing:
e2(selector, 'functionname', argument);
will make e2 do:
jQuery(selector).functionname(argument);
when the page is loaded and on anything that matches the selector in new content whenever e2.ajax updates it.
e2(selector, function);
is equivalent to:
e2(selector, 'each', function);
If you need more than one argument, just feed it an array. I should probably turn this into a jQuery extension some time.
- The code using the new e2() function is easier to read. Yes, edev members, I'm thinking of you. I've put in more and better comments as well.
- The function that triggers an AJAX update based on information in a form is considerably less hairy and shares more code with the generalised update trigger function. Instructions for AJAX updates are only processed when the update is triggered, and the parameters for an update are passed around the code in a civilised fashion, not as properties of page elements.
- Various pieces of code were moved out of e2.ajax to make a clearer distinction between the provision of general functions and their use for particular features. Maybe December should be declared UN World Code Readability Month.