TextMate JavaScript Prototype & Script.aculo.us
Howdy. I’ve just been fiddling around with the official Subversion and JavaScript bundles.
Prototype, Script.aculo.us & JavaScript
I just added a new bundle for Prototype & Script.aculo.us
- The original bundle was created by Justin Palmer in the Textmate Vibrant Ink Theme and Prototype Bundle
- Martin Ström added a bunch of handy snippets in his TextMate Prototype & Scriptaculous Bundle
- For the longest time I’ve had my Javascript Extras Bundle in my personal Svn Repo, where I’ve had a great hodgepodge or random carp.
Since Martin announced his new bundle in the TextMate Mailing List I’ve decided that it’s time our stuff is used by the masses (whether they like it or not). The new Prototype & Script.aculo.us is in the official TextMate subversion repository.
How to get it?
You’ll have to check out the latest version of the Javascript bundle, Then you need to checkout the Prototype & Script.aculo.us bundle.
-Or just download a zip of them all here- disabled this download since it’s like way old
-That zip contains subversion checkouts of each bundle. All you have to do to keep them up to date is run svn up *
on them.-
What’s it got?
Snippets galore
Martin Ström created about 72 snippets:
- Ajax.PeriodicalUpdater
- Enum.each
- Event.observe
- Field.…
- Form.…
- Effects.…
- Position.…
- etc, etc, etc…
JavaScript Language Syntax
There were some things that I had in the language syntaxes that were more generic and should be put in the main JavaScript language. So i did that. I also put in a better indent pattern preference.
Prototype & Script.aculo.us Language Syntax
The language syntax was originally created by Justin Palmer. Martin Ström added some FireBug keywords and some other stuff to the language. I, Thomas Aylott added support for:
- class.instance.constructor
- string based property.function’s
- a way to guess what is a regular variable
- Much better Symbol list support for OOP style javascript.
- other random tweaks & carp
Bracketed Language Syntax
This is a wrapper for the main Prototype & Script.aculo.us language.
It has nested scopes for round, curly & square brackets. It also has a special curly bracket scope for JavaScript functions.
I also updated my Brilliance Black theme to fully support these crazy new scopes.
- Curly brackets, groups and delimiters
- Round brackets, groups and delimiters
- Square brackets, groups and delimiters
- Curly Function brackets, groups and delimiters
The bracketed wrapper is really meant to be for Javascript what the XHTML strict syntax is for xhtml.
The idea is that it should better understand the larger parts of the language.
The first useful upshot of all that is the fancy coloring possibilities that it allows.
But you could use the scopes to make function block specific snippets or what-have-you.
The reason I don’t just use it for prototype or javascript itself is that it reduces parsing performance on large and complex scripts (like the prototype library).
Other than that, it doesn’t hurt anything.
Maybe I should move it into Experimental?
There’s way more to be said for collaboration and sharing and how wonderful and great it all is, but everyone stopped reading half way through so there’s not much point in me continuing on about it ;)