Remove a few calls do document.createElement
[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 /**
11 * Defines a namespace.
12 * @param {string} ns
13 */
14 jQuery.namespace = function(ns) {
15 var parent = window;
16 this.each(ns.split('.'), function (i, space) {
17 parent[space] = parent[space] || {};
18 parent = parent[space];
19 });
20 }
21
22 /**
23 * Shortcut for creating a DOM element.
24 * @param {string} elm
25 */
26 jQuery.createDom = function(elm) {
27 return this(document.createElement(elm));
28 }