University of Oregon

Re-wrap a modified JS function

The question came up recently about the possibility of modifying an existing javascript without duplicating it. Yesterday, I found out that it’s indeed possible. The key to the solutions is to re-wrap an existing function with it’s modifications in an ‘anonymous function.’
Here’s the scenario:
I have a page where I check for some required browser plugins before sending users on to our eLearning site; Adobe Flash, Reader and Java.

I also check for optimal OS / browser combinations.

So in this scenario I was leveraging available JS & jQuery functions as much as possible but in one particular case I need to accurately display the users browser but jQuery.brower treats all webkit browsers as Safari.

So instead of installing a new jQuery plug in or write a script to parse the user’s browser info I took advantage of a function in the Java detection script I pulled in.

Mailman as a bulk mailer – imported member managment tips

I have 20000 email subscribers for two email lists (cjobs and ucjobs). These were all imported into our new Mailman service.
I had a few settings I needed to change to accommodate using Mailman as a bulk mailer. And it’s going pretty well.
First there were normal things like pre-pending the default email subject, updating the list name and bounce protocols, making sure no-one can post to the list except the one authorized user (bulk moderate every user).
That was easy.

But then there’s a default setting where any list member can view all the other members of the list… not good.
First I updated the html docs, removing the relevant info.
Then I needed update all the users; but there’s no bulk operation for that.
Instead there’s a Member Mgmt screen with columns of check boxes. CheckBoxMate to the rescue…
Almost; Mailman displays a max of 30 members at a time… (20000 / 30 = ouch), that’s a lot of clicking and dragging. (more…)

Edit CSS and removing line breaks to process through js

I wanted to append the head of a doc with some styles but I didn’t want any line breaks.
So I used this function:

function removeLB($content){
	$content = str_replace(chr(10), " ", $content); //remove carriage returns
	$content = str_replace(chr(13), " ", $content); //remove carriage returns
	return $content;

That way I could edit with line breaks but send it through the jQuery append without.