URL Shortener

By Glendon Last update Dec 12, 2008 — Installed 710 times.

1.0 Release

in
Subscribe to 1.0 Release 3 posts, 2 voices



khopesh Scriptwright

Why did you add all that whitespace?

Nice to see you've put in some exceptions for wysiwyg editors.

 
Glendon Script's Author

I didn't intend to. Apparently, copying and pasting into the textbox did that.

 
khopesh Scriptwright

That's almost certainly a dos2unix issue (Linux/Unix uses \n for a line break whereas Windows uses \r\n). Jesse might be interested in it.

 

Another wysiwyg editor to add (quite the corner case since it's the admin panel for a colocation provider on the East Coast USA ... unless they're using some third-party code):

if ((e.id && e.id.match(/mceEditor|wys/i) || (e.className && e.className.match(/mceEditor|wys/i)))) {

becomes

if ((e.id && e.id.match(/mceEditor|wys|idContentoEdit/i) || (e.className && e.className.match(/mceEditor|wys|idContentoEdit/i)))) {

As items get added there, it becomes increasingly advantageous to abstract the regular expression, e.g.

var exceptions = /mceEditor|wys|idContentoEdit/i;
if ((e.id && e.id.match(exceptions) || (e.className && e.className.match(exceptions)))) {

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel