How to create JavaScript projects in Netbeans 7? - javascript

I have the basic Java version of NetBeans installed, but I want to be able to create JavaScript/HTML projects with auto-completion and other IDE-supported functionality. I can't seem to find out what I need to install to do this. What do I need to do?

There is no dedicated Javascript project type in Netbeans 7. There are still various possibilities to work on HTML/JS files:
Add a JS/HTML file to any of the available projects, e.g. a PHP project.
Open the JS/HTML file directly without having a project by using
File/Open.
Define own project type. This is likely not so easy.
In any case you will be able to edit the file and utilize the IDE language features like autocompletion, etc. But you will not be able to run/debug the JS file. For debugging you will need to use the debuggers integrated with the browsers (Developer Tools in IE, Chrome; Firebug in Firefox, etc.)

You install the PHP plugin from the Plugin directory. This isn't explained anywhere that I can see, I just had to guess.

You can download the php bundle for netbeans here.You can also create xml,json,css,php pages with it.

Related

Why does dojo require firebug after a dojo build?

I am trying to figure out why, after building a dojo application into a single layer does dojo still include the extra file for dojo/_firebug/firebug?
It does not download the file in Chrome on Windows 7 on a desktop PC, however, it does download it on Chrome on a Windows 8 tablet.
The reason this is a problem, is because I have a grunt task that runs after the dojo build to remove all extra .js files (all javascript files are being built into a layer).
Woops, I figured this out thanks to #tik27. The debug:true flag was set in my dojoConfig so it was downloading this extra file.
Cheers.

Firefox add-on review with external libs

I would like to submit an add-on into FF AMO. My project includes some external libs and after uploading my xpi to the store I got the message that I need to fix the following issues to have the faster automated review and signing:
Markup should not be passed to innerHTML dynamically.
Access to the Function global
It finds this issues for example inside the following files:
data/Pages/bower_components/jquery/src/core.js
data/Pages/lib/underscore.js
What could I do to ignore files from review process?
Is there any options to do that?
Thanks in advance!
After a lot of work our automatic review was successful.
In this case with the third party libs the problems and the solutions were the followings:
Third party source codes installed with bower and stored in bower_components can be detected as third party libs and if they are in the FF review system already - like angular, jquery - they will be ignored. Everything is OK.
Using third-party libs added to the project in a custom way - copying a minified file into a custom named folder will be detected as own code and will be reviewed. Do not use them like that way. Install them with bower instead.
But as you could see it was problem with a bower installed file as well in the Question: data/Pages/bower_components/jquery/src/core.js. Before creating the xpi that you will upload it is recommended to clear (better in an automatized way e.g. with gulp) the bower_compontents as well from the source codes. Keep only the dist file or files of bower_components.

Intellisense and JsHint support for Ext Js in VisualStudio

I want to work with Senach Ext Js in a Website project in VisualStudio 2013.
The problem: VisualStudio respectively WebEssentials throws warnings like:
JsHint (W117): 'Ext' is not defined.
Here is the situation as it looks today:
The project is exactly what Sencha Cmd produced for me.
At the moment I want only a Website project and no server sided code involved (therefore I did not make a MVC or Web API project).
I know that there is a way to define some global symbols in each JavaScript file for JsHint, but I want to get the intellisense working too. So I am looking for the correct configuration for both use cases: WebEssential JSHint Warnings and Intellisense.
Maybe both problems need to be addressed separately. That would be fine too.
Is my directory structure correct (just took what Sencha Cmd built for me)?
How to address the problem to make intellisense working?
(How to avoid Webessential JavaScript warnings (it seems most or all of them are JsHint)?)
Update: Related question:
Enabling JSHint Support for Ext.js in Intellij Idea
Update:
"An _references.js file in any other location than
“~/Scripts/_references.js” will be just like any other JS file and
won’t be used for global intellisense. Even putting the file in the
root of your web project will not work as well."
Source: http://gurustop.net/blog/2012/03/03/javascript-js-intellisense-auto_complete-in-visual-studio-11-beta-the-web-_references-js-file/
still not working when I have the _references in a new "Script" folder:
So it seems like the final answer was to add a file called ~/scripts/_reference.js and then include a line to reference Ext JS in there. This enables Visual Studio to index the Ext JS source for Intellisense. For example:
/// <reference path="../ext/ext-all-debug-full.js" />
More on the Intellisense and _reference.js:
http://msdn.microsoft.com/en-us/library/bb385682.aspx
Note that due to the size of the Ext JS codebase, Visual Studio might take a few minutes to complete the indexing process and for Intellisense to start working smoothly.

Netbeans 7.0.1 in Ubuntu has no javascript support?

I just installed netbeans 7.0.1 in ubuntu 12.04, and there NO JAVASCRIPT support whatsoever. I am not getting any errors, but my .js files just appear as regular text files with no syntax highlighting.
My situation is different from this post because when I go to Tools -> Options -> Misc -> Files, under "Associated File Type (MIME)" i don't have an option for "text/javascript".
Also in my previous installation of netbeans, I could right-click on the "Source Files" folder of my project, select New -> other and I could create a new .JS file like this. But now there is no option for .js files. Only PHP (since i installed the PHP plugin), XML, SQL, CSS and a handful of others.
Another thing, I often embed javascript in .php files. My embedded js just shows up as plain text, no syntax highlighting.
I also checked for additional plugins for JS, but nothing jumped out at me as being the solution. Does anyone know how I can enable the JS file recognition and syntax highlighting?
Thanks!
** UPDATE **
This installation is acting very weird (when editing text, pressing enter has no reaction, no line return, nothing) so I will try re-installing, will update with results.
** UPDATE 2 **
Installed 7.1 for linux from the netbeans website and everything is working well. It must have been a faulty installation from the Ubuntu software center.
I was using Netbeans 7.0.1 on Ubuntu 12.04 64-bit. Installing Netbeans 7.1.2 fixed my color/syntax problems.
For those who need to re-install, here is the download page: http://netbeans.org/downloads/index.html
Be sure to check Tools -> Options -> Misc -> Files to ensure that everything looks right.
P.S. #jeffery_the_wind Thank you for your update! This had been driving me crazy today, and I googled for hours and couldn't find the solution.

How do you automagically minify your JS and CSS on OS X or in Webstorm?

I use two different IDE's based on what I'm doing. My primary IDE is Visual Studio, whereby I use Chirpy to mash and minify my code. It works flawlessly and I love it. Problem is that when I'm not on my Windows box, I don't have access to it.
When not using Visual Studio, I'm usually writing Javascript apps in Webstorm on my Macbook Pro. Here in lies the problem. I haven't found a Webstorm plugin or any other app that I can configure to watch my scripts and mash/minify them.
How do you Mac users mash/minify your JS and CSS at design time with minimal effort?
For those who have now updated to WebStorm 6, this functionality is in-built. Simply go to File (or whatever the Mac equivalent is) -> Settings -> File Watchers and define a file watcher for the type of file you need to watch.
The relevant help documentation is here - http://www.jetbrains.com/webstorm/webhelp/using-file-watchers.html
You could use YUI Compressor without Command Line with these little Apps:
http://www.webmaster-source.com/minimus/ – free
http://www.matmartinez.net/delivery/ – free
I'm neither a Mac nor Webstorm user, but this might still be relevant.
For javascript I use the closure compiler as part of an upload script to minify. It doesn't monitor the files, it runs when I run the upload (a bash file).
If you wanted to keep it all in the IDE, it looks like Webstorm has an Ant plugin http://plugins.intellij.net/plugin/?webide&id=4526 that you could use to execute the closure compiler.
If you can find a command line css minifier then you could put that in the Ant script as well.
I use lessc and uglifyjs to concatenate and minify my css and js files. Here's a makefile from Twitter Bootstrap that I used a modified version of:
https://github.com/twitter/bootstrap/blob/master/Makefile
It's simple since all I do is type make in the command line whenever I want to compile.
I use Minify. It's on the Mac App Store.
I developed it to support my own workflow. minifyapp.com

Categories

Resources