General > Support

Readable Javascript

(1/2) > >>

Daren:
Hi, where can I find human-readable versions of the Javascript files (brws.js, chat.js, common.js, users.js)?

I've run them through a few different pretty-printers, and they do an OK job, but obviously aren't very useful for turning things like "nr=this.pq.qr?this.pq.qr:fq;" into readable (thus more easily understood) code.

Since OpenWebIM is open-source, having these files would be helpful. Sorry if they're available and I've just missed the link.

bofh:
Ah, glad somebody else noticed this.  In fact, the javascript code appears to be intentionally obfuscated, making it REALLY hard to modify and improve.  I had to run the javascript through two separate de-obfuscation tools to make it somewhat readable.  Function and variable names are still meaningless two-letter combinations, but with all the strings decoded and indenting added, I think I might be able to make useful changes now.  First, I ran the code through:
http://www.brianfolts.com/un/

That decoded all the strings, but didn't do too well with indenting.  So then I ran it through:
http://www.gosu.pl/JsDecoder/

Which makes it look pretty nice.  Still, why is the javascript so obfuscated?

Daren:

--- Quote from: bofh on March 04, 2009, 02:38:17 PM ---Still, why is the javascript so obfuscated?

--- End quote ---

I can understand a degree of obfuscation for the purpose of minimising file sizes.

While the obfuscated javascript is clearly available to be read and modified, it's not really in the spirit of open source provisions. One might reasonably expect that the original source files have meaningful names and comments to aid understanding. 

If the author(s) really code their javascript using anonymous 2-letter method and variable names, without any comments, they're clearly far better JS coders than me. =)

Hopefully the author will be along shortly.

Inspirer:
View:
http://webim.svn.sourceforge.net/viewvc/webim/tags/1.5.2/js/

Checkout and build:
svn co https://webim.svn.sourceforge.net/svnroot/webim/tags/1.5.2 webim
cd webim/js
ant

(obfuscated/minimized files are in webim/webim/js)

PS: Sorry for the late response. Just returned from a vacation.

bofh:
Ok - great to get the unobfuscated javascript!  Still, two issues:
- Why is it obfuscated in the first place?  The space saving is minimal, and string obfuscation actually makes the file larger!
- I think there really should be a true source distribution that includes unobfuscated source

Navigation

[0] Message Index

[#] Next page

Go to full version