Get SIMPLE_OPTIMIZATIONS working
[armadillo.git] / web_frontend / utils.js
1 //
2 // Armadillo File Manager
3 // Copyright (c) 2011, Robert Sesek <http://www.bluestatic.org>
4 //
5 // This program is free software: you can redistribute it and/or modify it under
6 // the terms of the GNU General Public License as published by the Free Software
7 // Foundation, either version 3 of the License, or any later version.
8 //
9
10 $.extend({
11 /**
12 * Defines a namespace.
13 * @param {string} ns
14 */
15 namespace: function(ns) {
16 var parent = window;
17 this.each(ns.split('.'), function (i, space) {
18 parent[space] = parent[space] || {};
19 parent = parent[space];
20 });
21 },
22
23 /**
24 * Shortcut for creating a DOM element.
25 * @param {string} elm
26 */
27 createDom: function(elm) {
28 return this(document.createElement(elm));
29 }
30 });