dijit tree example - dojo

I've been trying to copy and paste dijit tree examples from the web that use the ajax.google.com version of dojo 1.7.2 and I cannot get anything to work. Does anyone know of a single page whose source I can view, copy, and paste, and have a functional tree right away? There are lots of examples of bits and pieces of trees (just the javascript, trees with dijit installed on a server, etc.) but nothing that anyone could copy and paste to get a fully functional tree.
Thanks for your help!

Although uses <1.7 syntax... its good for headstart as minor modifications need to be done for 1.7.2 version
http://dojocampus.com/explorer/#Dijit_Tree_Basic

Related

intelliJ shows Bootstrap classes as typos

I just created a new static web project using the Bootstrap template. In my html files it is marking the names of Bootstrap css classes as typos. Surely the worlds smartest IDE is better than that? How do I make it aware of Bootstrap classes? I know I can disable spell checking but that seems like an awful solution.
Please follow WI-4762 for updates to be notified on any progress with it. For now, I can only suggest to either disable the spell checker or add the words shown as typos to dictionary

AppleTV and CommonJS or AMD (require.js)

Is there anyone who successfully used either require.js or one of the commonJS implementations in apple tv apps? I wanted to give a try to require.js, but spotted right away that require.js uses window object and maybe some other stuff that simply doesn't exist on apple tv. So maybe I should look for other options? How do you guys deal with modules? My predecessor just concatenated bunch of .js files and made a mess with literally tens of thousands lines of code. Incredibly messy.
upd: Still trying to make require.js work but apple tv won't let me have data-main attribute in script tag, I guess you can run require.config in the next script that loads right after
upd2: Doesn't work... apple tv doesn't have window object... Darn you Apple... I'll try to make changes to require.js file itself
No... definitely require.js not suited, even after major refactoring and changing browser specific stuff in the lib to ATV specific, still doesn't work. :(

Automatic generation of HAML from HTML in SublimeText 2?

I would like to have SublimeText show the HTML result of parsing my HAML in another window, live, as I type the HAML.
Does anyone have an idea of how to make this happen? In, e.g., WebStorm there are file watchers that do this, but is there something like that built into ST2?
I did something similar to this with Typescript, only I only updated the Javascript output when I saved the file. First, I would say to take a look at SublimeBuildOnSave. That'll show you how to hook into the save function and see what file is being saved.
When you've got the general idea, you can take a look here and mess around with opening another pane (or using the existing pane) to show the compiled output.
It's pretty simple to make a simple version of this. If you want more advanced features like live compiling, it'll take a bit more effort, but it's not impossible. But the above scenario worked just fine for Typescript for me. (If I find where I left that code, I'll post it.)

Creating Dijit > Editor > Plugins

I have been googling this subject for hours. Does anyone have an examples of a custom plugin being deployed in Dijit's Editor. I'd be really interested to look at it because I have been following this without much success and of the few examples that exist out there none of them come with working examples :(
(I'm looking to create a pulldown menu like the one for font selection)
There's no difference between a custom plugin and a "builtin" plugin, so I suggest just looking at a small builtin example like TabIndent, and then move on to the font selection itself.

JSLint, when using JS frameworks

I use the Dojo framework, which I load from an url.
How should I deal with the 'dojo' was used before it was defined errors, and the alike?
Yes, my feeling really get hurt, when running code through JSlint.
Perhaps you can put something like
/* globals dojo */
in the beggining of your file to tell JSLint that dojo exists?
I personaly use JSHint (a fork of JSLint that is less nitpicky) instead and one of the preconfigured options is support for Dojo.
Sounds like you need to put Dojo first in your JavaScript. The message suggests that you have an ordering problem.
Don't take it personally. You are not your code. Just make it better, learn something, and don't do it again.
If you scroll all the way down to the bottom there is a "predefined" textbox. Simply put in any of the variables you need into there (comma separated).