Update: JavaScript Tools is no longer maintained by me and is available on GitHub.
One bundle I found myself using consistently within TextMate is JavaScript Tools. The bundle gives you a number of great tools right at your fingertips for working with JavaScript. I decided to begin porting what I can to a Coda plugin.
JavaScript Tools Coda Plugin
One of the most useful parts of the JavaScript Tools bundle was the ability to Minify or Pack your source within TextMate. Having the ability to compress and obfuscate your JavaScript is of great benefit, and I did my part when I could. Minification and Packing are two different technologies, both with pros and cons. I decided to integrate both as they are my tools of choice.
I ran into some issues when putting this plugin together, however. While testing, I was using one of the many jQuery plugins and compression was going great. As I continued my testing, I attempted to Minify jQuery. That’s when things started getting a bit sticky. When invoking the compression of a larger JavaScript file, Coda began to act a bit strange. The application itself would seem to choke and eventually freeze. After a few seconds of locking up, my entire machine would freeze, forcing a hard reboot. I’m currently in contact with Panic to see if there is an issue with my personal machine, or something else entirely.
When working properly, the plugin operates like this:
I hope to work with Panic over the next few days to come up with a solution to the ‘large file problem’ and I’ll post a revision as soon as some new information surfaces. In the meantime, if you’d like to crack open the plugin and see if you spot any red flags, I’d be greatly appreciative. Currently the plugin misbehaves whether you Minify or Pack, so I’m lead to believe it’s an issue outside one class or the other.
Future plans include the incorporation of the YUI Compressor as well as JSLint. After solving the issue of working with larger files, I’m going to work on integrating those technologies.
Download JavaScript Tools
- Version 0.5
- December 15, 2008 – Initial release
Comments
First cool that you convert the tm bundles to coda plugins ! very cool. But I have the same issue like with the comment banner. I am using a mamp version for php, that means I have symlinked my mamp php to the standart Os X installation, which is used by coda (I think so). I need that to do command line execution for several frameworks like symfony. The issue is the error level. Maybe you can use the inbuild error handler of php to catch these notices or surpress all output which is not allowed. I havn’t done this with coda but I will try to solve thise use on the weekend. Its quite interessting. (output buffering is maybe a keyword)
BR Thomas
Woo! I just found your CSS Tools plugin, which led me to this. Bugs aside, I’m sure this will be a great tool to have. Keep up the amazing work!
What about adding “unpack” and “unminify”? 🙂
Hey,
I just locked up my system the same way you did.
Hope you can fix the problem!
Regards,
Samy
@Jlevitt: Great suggestions! I’ll add them to my to-do’s.
@Samuel Vogel: Unfortunately, I haven’t heard back from Panic quite yet, but I’ll continue seeing if there is anything else I can do!
This looks great, but I’m having the same problems with large files. :/
[…] ). Certains proposent également de “minifier” ou de “packer” vos sources Javascript ou CSS. Bref les possibilités sont […]
This looks like a wonderful tool, however I’m receiving the following errors:
Minify:
Notice: Undefined variable: input in /Users/rob/Library/Application Support/Coda/Plug-ins/JavaScript Tools.codaplugin/Contents/Resources/DE90E0FB-2161-4269-A34B-E46B1BF60E02/minifyjs.php on line 13
Pack:
Notice: Undefined variable: input in /Users/rob/Library/Application Support/Coda/Plug-ins/JavaScript Tools.codaplugin/Contents/Resources/606ADC5D-BBD3-4BB3-A4F9-78593FF4FA29/packjs.php on line 13
Even though it shows the errors in the code, it looks like it is minifying/packing the code, but I have not saved and tested, for fear of the errors.
Any idea what could be the cause?
Thanks for giving us such a wonderful tool!
[…] Javascript Tools Coda Plugin […]
Rob – Those are not errors per se. It’s a notice that the developer has not declared or initialized the variables before using them – which is fine. It is a convention to declare your variables but it’s not a must in all scripting languages.
Those notices are not affecting the script.
Amazing plugin, makes it easy compressing js files within a few clicks.
Do you plan to continue this project and including YUI compressor & JSLint, or is this project “dead” ?
I’m hoping this project isn’t dead and that you’ll look to implement YUI Compressor & JSLint as I use both of those religiously!
If you could email me to let me know either way.
Many thanks 🙂
Hey everyone, no, this project is definitely not dead. It has been in part shelved due to some other work taking precedence but I’m going to do my best to issue a new release as soon as possible!
I’d LOVE to see this project continued. You’re one of top search results on Google for “Coda YUI” and currently our only hope. Of course I’m pretty close to just writing the plugin myself, but perhaps you’re nearly finished?
Keep up the good work!!
Hey Eric, I’m definitely not opposed to other people picking up where I left off. In fact I don’t see any reason to not put it on GitHub. I’ll do that this weekend. Please, by all means feel free to contribute!
hey jonathan, did this ever make it up to github? if so, can you post a link?
thanks
Hi there Jonathan, did this plugin every get completed? If so can you email me to let me know how I can get hold of it 🙂
Thanks!
Great Plugin! Really easy and fast!
Only thing, that would be great was already mentioned by Jlevitt.
“Unpack” and “Unminify” 😉
At the moment I have to make a backup of the packed JavaScript or use http://jsbeautifier.org/ to get my written code back;-)
But still it’s a really useful Plugin!
Thank your very much for your work!
Couldn’t find the github link on here so: https://github.com/jchristopher/JavaScript-Tools-Coda-Plugin – in case you are looking for it.
It looks great and it’s one run seems to have worked well on my code 🙂
Thanks!