It passed QA and is now available as Vimeo Listing

The funny thing is that it was made on a rainy weekend in January. After I had sent it for validation it took more than a month till I got the first feedback from the Joomla! QA team. Then I fixed the reported errors. A week later my extension was simply disappeared without any feedback. So I uploaded it again and another two month later they managed to take a look at it and approve.

How magnificent! I’m done with Joomla. Big time.

jQuery.each( collection, callback(indexInArray, valueOfElement) )
jQuery.map( array, callback(elementOfArray, indexInArray) )

Now I know why I have to start a $.map and $.each always with

$.map( elements, function ( i, el) {
    console.log(i, el);
});

and switch if I fail..

http://api.jquery.com/jQuery.each/
http://api.jquery.com/jQuery.map/

var myObject = function() {
    this.names = "pony,cat".split(",");
    this.prefix = "Mr. ";

};

/*
 * You can avoid _this/that/me extra aliases like here
 */
myObject.prototype.getNames = function() {
    var _this = this;
    return this.names.map(function(name){
        return _this.prefix + name;
    });
}; // ["Mr. pony", "Mr. cat"]

/*
 * with function(){}.bind(this);
 */
myObject.prototype.getNames = function() {
    return this.names.map(function(name){
        return this.prefix + name;
    }.bind(this));
}; // ["Mr. pony", "Mr. cat"]
(function (window, undefined) {

    var PoniesModule = {
        info: "Yeeey"
    };

    // node
    if (typeof module === "object" && typeof module.exports === "object") {
        module.exports = PoniesModule;
    }
    // window
    else {
        window.PoniesModule = PoniesModule;
        // requireJS
        if (typeof define === "function" && define.amd) {
            define("poniesmodule", [], function () {
                return PoniesModule;
            });
        }
    }

})(this);

Usage example

require.config({
    paths: {
        "poniesmodule": "http://jsbin.com/uyucoq/latest.js"
    }
});

require(['poniesmodule'], function (poniesmodule) {
    console.log('app.init..', poniesmodule);
});

Demos: definition | usage

I think one thing is missing: delete global after loading module with requireJS..

/*
 * AFAIK:
 */
@iconsize: 200px;

.my-class{
	...
	left: (@iconsize + 100px); // Okay
	left: (@iconsize+100px); // Okay
	left: (@iconsize+ 100px); // Fail
	left: (@iconsize +100px); // Fail
	top: -@iconsize* 1.2; // Doesn't give a shit
	...
}

Had a half-hour debug inside a WebView on android when I realized that I “mis-cased” one of my css’ name.

Related: It’s a bit strange that Node did not care about this by default (like an apache server on windows).

/*
 * This will cause 'illegal access' exception
 * on Android ~2.3 inbuilt browsers if getItem() returns 'null'
 * cuz JSON.parse can not handle null as a parameter
*/
var  a = JSON.parse(localStorage.getItem(_key));

/*
 * Possible easy solution
*/
var  a = localStorage.getItem(_key) ? JSON.parse(localStorage.getItem(_key)) : null;

Just replace the last line to match something like this:

(function($){
  $.fn.MyUselessPlugin = function (...) {
        [...]
    return this;
  };
})(this.jQuery || this.Zepto);

Please keep in mind that this hack will only work with plugins that use jQuery methods also implemented in Zepto.

1. Go To: Brackets\www\editor\EditorUtils.js

2. Edit the corresponding line. For example to support .JSP files:

switch (ext) {
	...
	case "jsp":
		return "htmlmixed";
	...

0. Try to configure Node.js with coffe compiler parameters at “Run” > “Edit Configurations..” > “Node.js”. If you fail, move on to step 1.

1. Set up a compiler as an External Tool in Settings. Name the tool as whatever you want. In “Tool Settings” > “Parameters” add compiler parameters as you can see in fig#1. “Insert macro..” button opens a helpful window to choose between different directory parameters. If you want to compile only the opened file, choose $FilePath$. For all .coffee files in current directory choose $FileDir$. If you want to compile all .coffee files in the whole project directory select $ProjectFileDir$

cofffecompiler1 webstorm phpstorm jetbrains

2. Bind this compiler to a key that you love most or hit a random one for fun.

cofffecompiler2 webstorm phpstorm jetbrains

3. Hit F5 to compile.. Yaay!

Update: this article has been requested to be part of
the official documentation at jetbrains.com (WEB-6121)

Google