simple-dom
Advanced tools
Comparing version 0.2.1 to 0.2.2
(function() { | ||
"use strict"; | ||
function $$document$node$$Node(nodeType, nodeName, nodeValue) { | ||
function simple$dom$document$node$$Node(nodeType, nodeName, nodeValue) { | ||
this.nodeType = nodeType; | ||
@@ -8,3 +8,3 @@ this.nodeName = nodeName; | ||
this.childNodes = new $$document$node$$ChildNodes(this); | ||
this.childNodes = new simple$dom$document$node$$ChildNodes(this); | ||
@@ -18,7 +18,7 @@ this.parentNode = null; | ||
$$document$node$$Node.prototype._cloneNode = function() { | ||
return new $$document$node$$Node(this.nodeType, this.nodeName, this.nodeValue); | ||
simple$dom$document$node$$Node.prototype._cloneNode = function() { | ||
return new simple$dom$document$node$$Node(this.nodeType, this.nodeName, this.nodeValue); | ||
}; | ||
$$document$node$$Node.prototype.cloneNode = function(deep) { | ||
simple$dom$document$node$$Node.prototype.cloneNode = function(deep) { | ||
var node = this._cloneNode(); | ||
@@ -39,5 +39,5 @@ | ||
$$document$node$$Node.prototype.appendChild = function(node) { | ||
if (node.nodeType === $$document$node$$Node.DOCUMENT_FRAGMENT_NODE) { | ||
$$document$node$$insertFragment(node, this, this.lastChild, null); | ||
simple$dom$document$node$$Node.prototype.appendChild = function(node) { | ||
if (node.nodeType === simple$dom$document$node$$Node.DOCUMENT_FRAGMENT_NODE) { | ||
simple$dom$document$node$$insertFragment(node, this, this.lastChild, null); | ||
return; | ||
@@ -60,3 +60,3 @@ } | ||
function $$document$node$$insertFragment(fragment, newParent, before, after) { | ||
function simple$dom$document$node$$insertFragment(fragment, newParent, before, after) { | ||
if (!fragment.firstChild) { return; } | ||
@@ -89,3 +89,3 @@ | ||
$$document$node$$Node.prototype.insertBefore = function(node, refNode) { | ||
simple$dom$document$node$$Node.prototype.insertBefore = function(node, refNode) { | ||
if (refNode == null) { | ||
@@ -95,4 +95,4 @@ return this.appendChild(node); | ||
if (node.nodeType === $$document$node$$Node.DOCUMENT_FRAGMENT_NODE) { | ||
$$document$node$$insertFragment(node, this, refNode ? refNode.previousSibling : null, refNode); | ||
if (node.nodeType === simple$dom$document$node$$Node.DOCUMENT_FRAGMENT_NODE) { | ||
simple$dom$document$node$$insertFragment(node, this, refNode ? refNode.previousSibling : null, refNode); | ||
return; | ||
@@ -117,3 +117,3 @@ } | ||
$$document$node$$Node.prototype.removeChild = function(refNode) { | ||
simple$dom$document$node$$Node.prototype.removeChild = function(refNode) { | ||
if (this.firstChild === refNode) { | ||
@@ -136,20 +136,20 @@ this.firstChild = refNode.nextSibling; | ||
$$document$node$$Node.ELEMENT_NODE = 1; | ||
$$document$node$$Node.ATTRIBUTE_NODE = 2; | ||
$$document$node$$Node.TEXT_NODE = 3; | ||
$$document$node$$Node.CDATA_SECTION_NODE = 4; | ||
$$document$node$$Node.ENTITY_REFERENCE_NODE = 5; | ||
$$document$node$$Node.ENTITY_NODE = 6; | ||
$$document$node$$Node.PROCESSING_INSTRUCTION_NODE = 7; | ||
$$document$node$$Node.COMMENT_NODE = 8; | ||
$$document$node$$Node.DOCUMENT_NODE = 9; | ||
$$document$node$$Node.DOCUMENT_TYPE_NODE = 10; | ||
$$document$node$$Node.DOCUMENT_FRAGMENT_NODE = 11; | ||
$$document$node$$Node.NOTATION_NODE = 12; | ||
simple$dom$document$node$$Node.ELEMENT_NODE = 1; | ||
simple$dom$document$node$$Node.ATTRIBUTE_NODE = 2; | ||
simple$dom$document$node$$Node.TEXT_NODE = 3; | ||
simple$dom$document$node$$Node.CDATA_SECTION_NODE = 4; | ||
simple$dom$document$node$$Node.ENTITY_REFERENCE_NODE = 5; | ||
simple$dom$document$node$$Node.ENTITY_NODE = 6; | ||
simple$dom$document$node$$Node.PROCESSING_INSTRUCTION_NODE = 7; | ||
simple$dom$document$node$$Node.COMMENT_NODE = 8; | ||
simple$dom$document$node$$Node.DOCUMENT_NODE = 9; | ||
simple$dom$document$node$$Node.DOCUMENT_TYPE_NODE = 10; | ||
simple$dom$document$node$$Node.DOCUMENT_FRAGMENT_NODE = 11; | ||
simple$dom$document$node$$Node.NOTATION_NODE = 12; | ||
function $$document$node$$ChildNodes(node) { | ||
function simple$dom$document$node$$ChildNodes(node) { | ||
this.node = node; | ||
} | ||
$$document$node$$ChildNodes.prototype.item = function(index) { | ||
simple$dom$document$node$$ChildNodes.prototype.item = function(index) { | ||
var child = this.node.firstChild; | ||
@@ -164,5 +164,5 @@ | ||
var $$document$node$$default = $$document$node$$Node; | ||
var simple$dom$document$node$$default = simple$dom$document$node$$Node; | ||
function $$document$element$$Element(tagName) { | ||
function simple$dom$document$element$$Element(tagName) { | ||
tagName = tagName.toUpperCase(); | ||
@@ -175,8 +175,8 @@ | ||
$$document$element$$Element.prototype = Object.create($$document$node$$default.prototype); | ||
$$document$element$$Element.prototype.constructor = $$document$element$$Element; | ||
$$document$element$$Element.prototype.nodeConstructor = $$document$node$$default; | ||
simple$dom$document$element$$Element.prototype = Object.create(simple$dom$document$node$$default.prototype); | ||
simple$dom$document$element$$Element.prototype.constructor = simple$dom$document$element$$Element; | ||
simple$dom$document$element$$Element.prototype.nodeConstructor = simple$dom$document$node$$default; | ||
$$document$element$$Element.prototype._cloneNode = function() { | ||
var node = new $$document$element$$Element(this.tagName); | ||
simple$dom$document$element$$Element.prototype._cloneNode = function() { | ||
var node = new simple$dom$document$element$$Element(this.tagName); | ||
@@ -190,3 +190,3 @@ node.attributes = this.attributes.map(function(attr) { | ||
$$document$element$$Element.prototype.getAttribute = function(_name) { | ||
simple$dom$document$element$$Element.prototype.getAttribute = function(_name) { | ||
var attributes = this.attributes; | ||
@@ -204,3 +204,3 @@ var name = _name.toLowerCase(); | ||
$$document$element$$Element.prototype.setAttribute = function(_name, value) { | ||
simple$dom$document$element$$Element.prototype.setAttribute = function(_name, value) { | ||
var attributes = this.attributes; | ||
@@ -223,3 +223,3 @@ var name = _name.toLowerCase(); | ||
$$document$element$$Element.prototype.removeAttribute = function(name) { | ||
simple$dom$document$element$$Element.prototype.removeAttribute = function(name) { | ||
var attributes = this.attributes; | ||
@@ -235,3 +235,3 @@ for (var i=0, l=attributes.length; i<l; i++) { | ||
var $$document$element$$default = $$document$element$$Element; | ||
var simple$dom$document$element$$default = simple$dom$document$element$$Element; | ||
@@ -246,5 +246,5 @@ function $$document$text$$Text(text) { | ||
$$document$text$$Text.prototype = Object.create($$document$node$$default.prototype); | ||
$$document$text$$Text.prototype = Object.create(simple$dom$document$node$$default.prototype); | ||
$$document$text$$Text.prototype.constructor = $$document$text$$Text; | ||
$$document$text$$Text.prototype.nodeConstructor = $$document$node$$default; | ||
$$document$text$$Text.prototype.nodeConstructor = simple$dom$document$node$$default; | ||
@@ -261,5 +261,5 @@ var $$document$text$$default = $$document$text$$Text; | ||
$$document$comment$$Comment.prototype = Object.create($$document$node$$default.prototype); | ||
$$document$comment$$Comment.prototype = Object.create(simple$dom$document$node$$default.prototype); | ||
$$document$comment$$Comment.prototype.constructor = $$document$comment$$Comment; | ||
$$document$comment$$Comment.prototype.nodeConstructor = $$document$node$$default; | ||
$$document$comment$$Comment.prototype.nodeConstructor = simple$dom$document$node$$default; | ||
@@ -276,5 +276,5 @@ var $$document$comment$$default = $$document$comment$$Comment; | ||
$$document$document$fragment$$DocumentFragment.prototype = Object.create($$document$node$$default.prototype); | ||
$$document$document$fragment$$DocumentFragment.prototype = Object.create(simple$dom$document$node$$default.prototype); | ||
$$document$document$fragment$$DocumentFragment.prototype.constructor = $$document$document$fragment$$DocumentFragment; | ||
$$document$document$fragment$$DocumentFragment.prototype.nodeConstructor = $$document$node$$default; | ||
$$document$document$fragment$$DocumentFragment.prototype.nodeConstructor = simple$dom$document$node$$default; | ||
@@ -285,4 +285,4 @@ var $$document$document$fragment$$default = $$document$document$fragment$$DocumentFragment; | ||
this.nodeConstructor(this, 9, '#document', null); | ||
this.documentElement = new $$document$element$$default('html'); | ||
this.body = new $$document$element$$default('body'); | ||
this.documentElement = new simple$dom$document$element$$default('html'); | ||
this.body = new simple$dom$document$element$$default('body'); | ||
this.documentElement.appendChild(this.body); | ||
@@ -292,8 +292,8 @@ this.appendChild(this.documentElement); | ||
simple$dom$document$$Document.prototype = Object.create($$document$node$$default.prototype); | ||
simple$dom$document$$Document.prototype = Object.create(simple$dom$document$node$$default.prototype); | ||
simple$dom$document$$Document.prototype.constructor = simple$dom$document$$Document; | ||
simple$dom$document$$Document.prototype.nodeConstructor = $$document$node$$default; | ||
simple$dom$document$$Document.prototype.nodeConstructor = simple$dom$document$node$$default; | ||
simple$dom$document$$Document.prototype.createElement = function(tagName) { | ||
return new $$document$element$$default(tagName); | ||
return new simple$dom$document$element$$default(tagName); | ||
}; | ||
@@ -526,2 +526,4 @@ | ||
return { | ||
Node: simple$dom$document$node$$default, | ||
Element: simple$dom$document$element$$default, | ||
Document: simple$dom$document$$default, | ||
@@ -528,0 +530,0 @@ voidMap: simple$dom$void$map$$default, |
@@ -0,1 +1,3 @@ | ||
import Node from 'simple-dom/document/node'; | ||
import Element from 'simple-dom/document/element'; | ||
import Document from 'simple-dom/document'; | ||
@@ -7,2 +9,4 @@ import HTMLParser from 'simple-dom/html-parser'; | ||
export { | ||
Node, | ||
Element, | ||
Document, | ||
@@ -9,0 +13,0 @@ HTMLParser, |
/* global define:false, module:false */ | ||
import { Document, HTMLParser, HTMLSerializer, voidMap } from './simple-dom'; | ||
import { Node, Element, Document, HTMLParser, HTMLSerializer, voidMap } from './simple-dom'; | ||
@@ -14,2 +14,4 @@ (function (root, factory) { | ||
return { | ||
Node: Node, | ||
Element: Element, | ||
Document: Document, | ||
@@ -16,0 +18,0 @@ voidMap: voidMap, |
{ | ||
"name": "simple-dom", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "A simple JS DOM.", | ||
@@ -5,0 +5,0 @@ "main": "dist/simple-dom.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
271693
1893