forked from ReDEnergy/SessionSync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdom.js
More file actions
30 lines (21 loc) · 672 Bytes
/
Copy pathdom.js
File metadata and controls
30 lines (21 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
define(function(require, exports, module) {
'use strict';
const NS_HTML = 'http://www.w3.org/1999/xhtml';
// ------------------------------------------------------------------------
// Generic Node Creator
function Node(ns, type, attrs) {
var elem = document.createElementNS(ns, type);
attrs && Object.keys(attrs).forEach(function(attr) {
elem.setAttribute(attr, attrs[attr]);
});
return elem;
}
function HTMLCreator() {
return Node.bind(null, NS_HTML);
}
// ------------------------------------------------------------------------
// Public API
exports.HTMLCreator = HTMLCreator;
});
// ES6 module
// export { HTMLCreator , XULCreator };