Why does dojo require firebug after a dojo build? - javascript

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.

Related

ngCordova Plugins - Issue getting cordova.js included properly

I've been trying everything for the past two days to solve this issue. I'm well and truly stumped. Perhaps someone with greater knowledge than I can shed some light on the issue:
Basically, I'm building an app in AngularJS with the purpose of building Android and iOS apps from it using Cordova. I should specify that I am using cordova-cli on Linux and ngCordova (wrapper around plugins). I am NOT using Ionic Framework.
My app works fine in Chrome. I followed the ngCordova installation guide perfectly: http://ngcordova.com/docs/install/
I used bower to install. Then included the following in the index.html of my Web App project (not the Cordova project):
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
It didn't work. I thought maybe it's because the ng-cordova.js went into my bower components directory. So I changed that script tag to:
bower_components/ngCordova/dist/ng-cordova.js
When I go to my cordova project directory and set up the platforms, plugins etc... and run:
cordova build android
followed by
cordova run android
The app runs on my device (Nexus 5). I use chrome://inspect to see what happens when I click the button which should be using the email composer plugin: I get a cordova not defined error.
I went into the controller and put this in
console.log($cordovaEmailComposer);
I can examine this in chrome://insepct and it has all the correct functions etc.. so ng-cordova.js is running fine (thats where the factory for the plugin is).
I'm 99% sure the issue is that somewhere along the line cordova.js is being lost. When I go into the cordova project in the ProjectName/www/index.html the tag for cordova.js is commented out.
Same in the platforms/android/assets/www/index.html file.
I traced it back and the same is true in WebAppProject/dist/index.html file. It's commented out. So it seems that when I run grunt build cordova.js is being removed. I thought maybe it's because cordova.js wasn't in the WebAppProject so I brought it into the root directory (same locations as index.html) and it still happened.
Can anyone explain how to properly get this working? I'm totally at a loss. I've tried a million different ways of including cordova.js. I even manually uncommented it out in the cordovaproject/www/index.html. The app builds but crashs upon opening (white screen then dies) suggesting a missing script (despite cordova.js being n that directory too...).
Is this the grunt build process? Or am I totally setting up an ngCordova project incorrectly without realising... I would post some code but I'm 99% sure the issue is with cordova.js or the way the project is building upon either grunt build or cordova build.
Any help would be much appreciated. :)
Cheers,
D
Make sure to include ngCordova before cordova.js and after angular.js.
<script src="/path/to/angular.js"></script>
<script src="/path/to/ng-cordova.js"></script>
<script src="/path/to/cordova.js"></script>

Eclipse building workspace hangs after importing existing maven project because of JavaScript validation

When running Eclipse Kepler and importing an existing Maven project, Eclipse hangs during "Building Workspace (XX%)". Switching to the Progress tab reveals a "Validating nnn"; it looks like it’s validating a directory containing JavaScript files.
Kill Eclipse process.
Go to project folder and edit .project file.
Remove the following lines (it will disable failing JavaScript validator):
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
Save file.
Re-open Eclipse.
I faced the same problem when I tried to install Angular.js with bower in my project. I seems bower has lots of javascript files it downloaded automatically which caused my IDE to stuck in validation process for a long time. So, I solved this problem this way,
I first installed tern.js 0.9.0.
Then I went to the project properties, selected tern script path
included only the path I needed for validation, My project's
javascript folder. I excluded other path like placeholders,
Angular.js files, Jquery files.
I selected the Javascript from the properties again and did the same
things in include path's source.
My IDE currently working without freezing. I took help from there. Tern
I guess it can be helpful, where any IDE stuck due to lots of Javascript file.

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 to create JavaScript projects in Netbeans 7?

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.

How do I fix PhoneGap build errors?

I am trying to build a PhoneGap-based iPhone application, but I keep getting the following two errors:
./build-phonegap.sh: line 6: ./configure: No such file or directory
cp: lib/iphone/phonegap-min.js: No such file or directory
I built and installed the latest version of PhoneGap from the source on GitHub. I have checked to make sure that the PHONEGAPLIB variable is indeed set in XCode.
Where do I get the files listed? Where do I put them (to what are those paths relative)? And why aren't they already there?
Later
It seems the problem was that the project had been created with one version of PhoneGap (one that doesn't reference an external lib directory), but I was trying to run it with a newer one. Recreating the project with my latest version and copying over the www directory fixed the problem.
I am confused. What steps do I take? I just downloaded phonegap. I don't know how to "install" it. Do I have to run some git command or some build command before I can open it in xcode?
UPDATE:
Figured it out. I downloaded it. Unzipped it. Went into the phonegap folder. Duplicated the iphone folder. Opened xcode and hit build and go. It worked.
Apparently your iphone gap projects need to be a subfolder of the phonegap folder. That can probably be fixed/changed if you know what you're doing.
This video here helped me verify that all you need to do is download, unzip and open. The files inside your www do work by default.
http://www.youtube.com/watch?v=LcES5nIbMkk

Categories

Resources