JSUtilities.js – Nifty little JavaScript Utilities

Here’s an interesting little JavaScript utilities file:

  • array.push (if unsupported)
  • array.shift (if unsupported)
  • function.apply (if unsupported)
  • inArray() [Port from PHP] Hunts for a value in the specified array
  • isArray() [Port from PHP] verifies if something is an array
  • ksort() [Port from PHP] sorts an array by key names
  • addClass() appends the specified class to the object
  • removeClass() removes the specified class to the object
  • lastChildContainingText() finds the last block-level text-containing element within an object

http://old.easy-designs.net/code/jsUtilities/working/jsUtilities.js

WordPressMU Bug Trac for fixing target=”_blank”

W3C - World Wide Web ConsortiumOnce upon a time, we had a vexing problem where we couldn’t set the @target (OT: @target is tech-speak/jargon/euphemism for ‘target attribute’). Actually, you could set it, but when you ‘saved’ the post or story, TinyMCE (that nifty toolbar interface for formatting blog posts used by WordPress and a million other places). Here’s where I figured out what was wrong. I don’t know why they ‘broke’ the @target attribute, although I do know that the ‘target’ attribute was deprecated in HTML 4.01, as well as XHTML 1.0. However, there are ways around it, like via JavaScript and XHTML modules which are pretty darn cool.

Anyway, when we upgrade WordPressMU to the next version, we’ll likely need to ‘fix’ this again, so here’s $98 bucks worth of direction:

Changeset 1022 – WordPress MU Trac – Trac

Just change this:

$allowedposttags = array(
‘address’ => array(),
‘a’ => array(
‘href’ => array(), ‘title’ => array(),
‘rel’ => array(), ‘rev’ => array(),
‘name’ => array()
),

to this:

$allowedposttags = array(
‘address’ => array(),
‘a’ => array(
‘href’ => array(), ‘title’ => array(),
‘rel’ => array(), ‘rev’ => array(),
‘name’ => array(), ‘target’ => array()
),

NOTE: This change was downgraded to determine if it inexplicably affects bandwidth performance.

WordPressMU Bug Trac for fixing target=”_blank”

W3C - World Wide Web ConsortiumOnce upon a time, we had a vexing problem where we couldn’t set the @target (OT: @target is tech-speak/jargon/euphemism for ‘target attribute’). Actually, you could set it, but when you ‘saved’ the post or story, TinyMCE (that nifty toolbar interface for formatting blog posts used by WordPress and a million other places). Here’s where I figured out what was wrong. I don’t know why they ‘broke’ the @target attribute, although I do know that the ‘target’ attribute was deprecated in HTML 4.01, as well as XHTML 1.0. However, there are ways around it, like via JavaScript and XHTML modules which are pretty darn cool.

Anyway, when we upgrade WordPressMU to the next version, we’ll likely need to ‘fix’ this again, so here’s $98 bucks worth of direction:

Changeset 1022 – WordPress MU Trac – Trac

Just change this:

$allowedposttags = array(
‘address’ => array(),
‘a’ => array(
‘href’ => array(), ‘title’ => array(),
‘rel’ => array(), ‘rev’ => array(),
‘name’ => array()
),

to this:

$allowedposttags = array(
‘address’ => array(),
‘a’ => array(
‘href’ => array(), ‘title’ => array(),
‘rel’ => array(), ‘rev’ => array(),
‘name’ => array(), ‘target’ => array()
),

NOTE: This change was downgraded to determine if it inexplicably affects bandwidth performance.