Giter VIP home page Giter VIP logo

javascript-tools.tmbundle's Introduction

How to install

  1. [Get with **GitHub for Mac**](http://mac.github.com/ "GitHub for Mac")

  2. Clone it to your ~/Library/Application Support/TextMate/Pristine Copy/Bundles
  3. In TextMate choose the menu item… Bundles / Bundle Editor / Reload Bundles
  4. If node is not installed in your PATH, go to TextMate → Preferences → Advanced → Shell Variables and add /usr/local/bin, basically the path to where node lives on your machine (which node).

1. Click the "Download Source" button.
2. Unzip the download
3. Rename the folder to JavaScript-tools.tmbundle
4. Double-click
5. TextMate handles the rest!

NOTE: These docs are now a little out-of-date.

JavaScript Tools TextMate Bundle

Help

Opens this help file.

Run JavaScript (⌘R)

Attempts to run the current javascript document or selection in TextMate's Web Preview window.

JavaScript Lint

With JavaScript Lint, you can check all your JavaScript source code for common mistakes without actually running the script or opening the web page. http://javascriptlint.com/

  • Validate Syntax (⌃⇧V) uses Matthias Miller's JavaScript Lint to check your script for errors and warnings and shows the results in a new window. The Validate JavaScript window will give you a description and hyperlink when problems are found. The hyperlink will take you straight to the line and column where JavaScript Lint suspects the problem arises.

  • Validate Syntax Quick (⌘S) same as above except that instead of a dedicated window you simply get a tooltip showing the number of errors and warnings. This command overrides the Save behavior so every time you save your javascript it will be passed through jslint. Of course it only applies to javascript files so you don't need to worry about accidentally jslint'ing your non-javascript files.

  • Edit Lint Validation settings allows you to customize what jslint considers when checking your script. The format and meaning of the options are straightforward and well documented within the settings file itself.

Formatting / Compression

  • Format JavaScript (⌃Q) attempts to beautify your javascript by inserting uniform line breaks and indentation throughout your current document or selection.

  • Compress (current file) (⌃⌘C) uses a custom Rhino build from the Dojo Toolkit project to compress your current javascript document. Before compressing it attempts to insert missing semi-colons so you should consider running Validate Syntax and fixing missing semi-colons prior to using this command.

  • Dean Edwards Packer (current file) (⌃⌘C) compresses and obfuscates your current javascript document. It currently relies on the Packr ruby port which is based on version 3 of Packer. According to Dean Edwards, "All statements, including function declarations, must be correctly terminated with semi-colons" before you run this command. After an email exchange with James Coglan, author of Packr, it's been decided that base62 encoding not be on by default as having it off yields more efficiency when your scripts are gzipped.
    However, if you would like base62 encoding, just set the Variable TM_JST_PB62 to true in the Advanced pane of the TextMate preferences or in your TextMate Project variables (see the TextMate documentation for more info on setting environment variables).

  • YUI! Compressor (current file) (⌃⌘C) compresses your current javascript document. By default it assumes your character set is UTF-8. Additionally it strictly preserves semi-colons, i.e. it will not drop or attempt to insert any semi-colons. Both of these settings can be easily changed by opening the Bundle editor and adjusting the second line of this command through the Bundle editor.

  • Minimize (current file) (⌃⌘C) uses Douglas Crockford's JSMin to minimize your current javascript document. It will not do any semi-colon insertion or removal.

  • Minimize selection (⌃⌥⇧Q) same as the above except it only applies to the selected portion of your current javascript document.

  • Convert JavaScript to Bookmarklet (⌃⌥⇧Q) turns your current javascript selection or document into a bookmarklet for use in a web browser.

  • Convert Bookmarklet to JavaScript (⌃⌥⇧Q) does the opposite of the above; turns an existing bookmarklet into a standard javascript.

Licenses

javascript-tools.tmbundle's People

Contributors

infininight avatar savetheclocktower avatar stepheneb avatar subtlegradient avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

javascript-tools.tmbundle's Issues

Could not find node

I installed this in a clean install of TextMate on OS X Lion (Node.js installed, too), but when saving a .js file with ⌘S I get an error saying that node was not found, and a list of path's where it looked for it.

Is this a known issue?

Thanks!

Validation Errors should move cursor to error line

In PHP, if you validate the file and syntax errors are found, the cursor jumps to the problematic line. Also it would be nice if a list of line numbers and/or errors was shown in the tooltip as I tend to miss the errors a lot)

Getting an error for js lint

Hi,
I get this error when I run the jsl lint from your package

Assertion failure: sprop->getter == js_GetLocalVariable, at jsparse.c:2812
Abort trap

I get it in textmate but to isloate I ran this command from the command line

riverusual-lm:bin alexkess$ ./jsl -conf ../conf/jsl.textmate.conf -process /Users/alexkess/Dropbox/Public/js/class.js
JavaScript Lint 0.3.0 (JavaScript-C 1.5 2004-09-24)
Developed by Matthias Miller (http://www.JavaScriptLint.com)

class.js
Assertion failure: sprop->getter == js_GetLocalVariable, at jsparse.c:2812
Abort trap

Request/Question: Inline JSLint/Hint errors

Vim has a really nice jslint plugin that will highlight lint errors in red. MacVim shows these really nicely with a red underline. It would be cool to have this plugin do this.
Do you know how I could go about adding this functionality?

Cannot save with JSHint (Quick)

Hi there,

This is a strange error because I got it working on my other computer, but I'm having troubles saving. The paths are set up correctly, because the bundle is working. I'm just unable to save even if I have zero errors.

The only difference I can think of is that one computer is running snow leopard, the other lion. Do you know anything about this?

thanks!
Matt

⌘S doesn't save

Hello! cool bundle but I had to uninstall it. for some reason, it overrided ⌘S and gives an error that it cant find NodeJS instead of saving the document like you would expect. just thought you might like to know. Once you get all the bugs worked out, I'd love to use it.

Best,

Validate with JSHint error

When save I got this window error:

title. Validate with JSHint error (Quick)

body.

Couldn't find node

Locations searched:

/Users/alessio/Library/Application Support/TextMate/Bundles/javascript-tools.tmbundle/Support/bin
/Applications/TextMate.app/Contents/SharedSupport/Support/bin/CocoaDialog.app/Contents/MacOS
/usr/bin
/bin
/usr/sbin
/sbin
/Applications/TextMate.app/Contents/SharedSupport/Support/bin

Validate with JSHint displays

When i run Validate with JSHint In the webpreview window, i see the following text:

/Applications/TextMate.app/Contents/SharedSupport/Support/lib/escape.rb:23:in e_url': private methodgsub' called for nil:NilClass (NoMethodError) from (erb):20:in header' from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/htmloutput.rb:90:inheader' from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/web_preview.rb:4:in `html_head' from -:4

I am running ruby 1.8.7 on snow leopard.

On a side note, it doesn't appear to interfere with any functionality.

Help people install node.js

This bundle now requires node.js.

I need to add some documentation describing how to install it and how to configure your PATH in TextMate.

jsbeautify and node.js issue

Trying to use the Node.js version results:

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
at Function. (module.js:376:11)
at Object. (/Users/Mark/Library/Application Support/TextMate/Pristine Copy/Bundles/JavaScript Tools.tmbundle/Support/node_modules/js-beautify-node/beautify-node.js:32:8)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.