speich.net logo

How to create JavaScript documentation in PhpStorm

July 27th, 2010 Simon No comments

PhpStorm’s code assist feature nicely displays our own JavaScript code documentation. But what if you wanted to create a separate documentation you can hand out or integrate into your website? Then you should use jsdoc-toolkit. You can configure and run jsdoc-toolkit directly from PhpStorm. Here is what you have to do:

Read more…

How to get code assist for dojo in PHPStorm

July 16th, 2010 Simon No comments

In case you were wondering how you get dojo code support in PHPStorm even if dojo is not in your project folder, here’s the solution:

Install dojo in PHPStorm from external directory.

Make code assist for dojo work if it is in an external directory.

1. Open Project Settings

2. Select Directories

3. Add the path to your dojo folder as a new Content Root.

4. Mark the directories dijit, dojo, dojox as a Resource Root

That’s it.

Categories: JavaScript Tags: , ,

JavaScript and dojo with PhpStorm

July 16th, 2010 Simon No comments

Just a quick post about the new PHP IDE  by JetBRAINS. So far I’ve been working with Aptana Studio. I also tried NetBeans and Comodo Edit, but none was really satisfying, because either dojo or ftp support was missing (if I find time, I’ll write a post in more detail about the differences between those IDEs).

But now there is PhpStorm. I’m really impressed and enthused by its features, especially code completion for JavaScript. Since JavaScript is a loosely typed language, it’s difficult to write a good code assist. But PhpStorm just picks up everything.  For example, if I use dojo.hitch to set the scope of a function, it catches what ‘this’ refers to within the anonymous function !

Code Assist in action

PHPStorm's amazing code assist in action. Notice that setting the scope with dojo.hitch is reflected in code assist!

Categories: JavaScript, PHP Tags: ,

Check if node in tree is already selected

March 20th, 2010 Simon No comments

It took me a long time to figure out how to check if a node in a dijit.tree is already set to selected, when the user clicks on it. So I thought I share what I found out:

dojo.connect(this.tree, 'onMouseDown', this, function(evt) {
  var node = dijit.getEnclosingWidget(evt.target);
  if (node.item == this.tree.attr('selectedItem')) {
    console.debug('selected');
  }
 });
Categories: JavaScript Tags:

Tutorial Part 1: REST with Dojo and PHP

February 13th, 2010 Simon No comments

I only started recently to dig into REST, so I’m in no way an expert in this field. There are not that many tutorials on the internet, and the ones I found were only of limited help. They all seemed to miss something or, rather, I missed something. So I decided to write my own tutorial about my findings to help others that might have the same problems. On the client side, I’ll use the Dojo Toolkit, on the server side, PHP.

I will focus mainly on providing and explaining some working code examples including server PHP code. At the end of this article you can find all code as a downloadable zip-file. As an introduction to REST, read some of the tutorials linked at the end of this article, because I’m not going to repeat some of the things you can read there.

Read more…

Categories: JavaScript, PHP Tags: ,

Mozilla Testcase for DHMTL Performance

October 18th, 2009 Simon No comments

It started 2003 as a little project to learn the basics of 3D-programming and with a question on how to improve performance in the mozillaZine Forums. I was asked to file a bug (Bug 229391) and to create the Mozilla Testcase Slow (3D) DHTML performance compared to IE for it . From there it made it into the performance suites Dromaeo, SunSpider and The Betanews Comprehensive Relative Performance Index (CRPI) to measure browser speed.

The test is also mentioned in the article “Surf-Triathlon – Geschwindigkeit und Speicherverbrauch aktueller Browser” in the German computer magazine c’t from 19/2008 on page 182.

Categories: JavaScript Tags:

Dojo BorderContainer Demo

January 23rd, 2009 Simon No comments

Demonstration eines mit der Bibliothek Dojo erstellten Layouts, in welchem die Dijit-Klassen BorderContainer, TabContainer und ContentPane zur Anwendung gelangen.

Categories: JavaScript Tags:

Visualisierung mit jsviz

September 14th, 2007 Simon No comments

Beispiel einer Visualisierung von Datenbankvariablen mit der JavaScript Bibliothek jsviz. Da die Klasse ForceDirectedLayout nur Linien, aber keine Pfeile als Verbindung zwischen zwei Knoten zeichnet, musste die Bibliothek für das Projekt NAFIDAS des Schweizerischen Landesforstinventars LFI um diese Funktion erweitert werden (siehe auch die Google Groups von jsviz).

  • Knoten des Graphen können mit der Maus durch Klicken und Ziehen verschoben werden.
  • Doppelklick auf einen Knoten blendet Info aus/ein.
Categories: JavaScript Tags:

© 2009 speich.net, Konzept und Programmierung Simon Speich.

Die Artikel auf dieser Seite laufen mit WordPress. Theme by NeoEase