Comparing version 0.3.0 to 0.3.1
@@ -237,3 +237,3 @@ (function (global, factory) { | ||
var document = new Document(); | ||
assign(document, document.defaultView = { document: document, Document: Document, Node: Node, Text: Text, Element: Element, Event: Event }); | ||
assign(document, document.defaultView = { document: document, Document: Document, Node: Node, Text: Text, Element: Element, SVGElement:Element, Event: Event }); | ||
assign(document, { documentElement:document, createElement: createElement, createElementNS: createElementNS, createTextNode: createTextNode }); | ||
@@ -240,0 +240,0 @@ document.appendChild(document.body = createElement('body')); |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.undom=e()}(this,function(){function t(t,e){for(var n in e)t[n]=e[n]}function e(t){return String(t).toLowerCase()}function n(t,e,n,r){var i=t?o(t,e,!0,r):-1;return~i&&(n?t.splice(i,0,n):t.splice(i,1)),i}function o(t,e,n,o){for(var r=t.length;r--&&("function"!=typeof e||o?t[r]!==e:!e(t[r])););return n?r:t[r]}function r(t,n){return function(o){return o.ns===t&&e(o.name)===e(n)}}function i(){function i(t){return 1===t.nodeType}function u(t){return new a(null,String(t).toUpperCase())}function s(t,e){var n=u(e);return n.namespace=t,n}function p(t){return new l(t)}function c(){var e=new f;return t(e,e.defaultView={document:e,Document:f,Node:d,Text:l,Element:a,Event:b}),t(e,{documentElement:e,createElement:u,createElementNS:s,createTextNode:p}),e.appendChild(e.body=u("body")),e}var d=function(t,e){this.nodeType=t,this.nodeName=e,this.childNodes=[]},h={nextSibling:{},previousSibling:{},firstChild:{},lastChild:{}};h.nextSibling.get=function(){var t=this.parentNode;if(t)return t.childNodes[o(t.childNodes,this,!0)+1]},h.previousSibling.get=function(){var t=this.parentNode;if(t)return t.childNodes[o(t.childNodes,this,!0)-1]},h.firstChild.get=function(){return this.childNodes[0]},h.lastChild.get=function(){return this.childNodes[this.childNodes.length-1]},d.prototype.appendChild=function(t){this.insertBefore(t)},d.prototype.insertBefore=function(t,e){t.remove(),t.parentNode=this,e?n(this.childNodes,e,t):this.childNodes.push(t)},d.prototype.replaceChild=function(t,e){e.parentNode===this&&(this.insertBefore(t,e),e.remove())},d.prototype.removeChild=function(t){n(this.childNodes,t)},d.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)},Object.defineProperties(d.prototype,h);var l=function(t){function e(e){t.call(this,3,"#text"),this.nodeValue=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={textContent:{}};return n.textContent.set=function(t){this.nodeValue=t},n.textContent.get=function(){return this.nodeValue},Object.defineProperties(e.prototype,n),e}(d),a=function(t){function u(e,n){t.call(this,e||1,n),this.attributes=[],this.__handlers={}}t&&(u.__proto__=t),u.prototype=Object.create(t&&t.prototype),u.prototype.constructor=u;var s={children:{}};return s.children.get=function(){return this.childNodes.filter(i)},u.prototype.setAttribute=function(t,e){this.setAttributeNS(null,t,e)},u.prototype.getAttribute=function(t){return this.getAttributeNS(null,t)},u.prototype.removeAttribute=function(t){this.removeAttributeNS(null,t)},u.prototype.setAttributeNS=function(t,e,n){var i=o(this.attributes,r(t,e));i||this.attributes.push(i={ns:t,name:e}),i.value=String(n)},u.prototype.getAttributeNS=function(t,e){var n=o(this.attributes,r(t,e));return n&&n.value},u.prototype.removeAttributeNS=function(t,e){n(this.attributes,r(t,e))},u.prototype.addEventListener=function(t,n){(this.__handlers[e(t)]||(this.__handlers[e(t)]=[])).push(n)},u.prototype.removeEventListener=function(t,o){n(this.__handlers[e(t)],o,0,!0)},u.prototype.dispatchEvent=function(t){var n,o,r=t.currentTarget=this,i=t.cancelable;do if(n=r.__handlers[e(t.type)])for(o=n.length;o--&&(n[o](t)!==!1&&!t._end||!i););while(t.bubbles&&(!i||!t._stop)&&(t.target=r=r.parentNode));return!t.defaultPrevented},Object.defineProperties(u.prototype,s),u}(d),f=function(t){function e(){t.call(this,9,"#document")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a),b=function(t,e){this.type=t,this.bubbles=!!e.bubbles,this.cancelable=!!e.cancelable};return b.prototype.stopPropagation=function(){this._stop=!0},b.prototype.stopImmediatePropagation=function(){this._end=this._stop=!0},b.prototype.preventDefault=function(){this.defaultPrevented=!0},c()}return i}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.undom=e()}(this,function(){function t(t,e){for(var n in e)t[n]=e[n]}function e(t){return String(t).toLowerCase()}function n(t,e,n,r){var i=t?o(t,e,!0,r):-1;return~i&&(n?t.splice(i,0,n):t.splice(i,1)),i}function o(t,e,n,o){for(var r=t.length;r--&&("function"!=typeof e||o?t[r]!==e:!e(t[r])););return n?r:t[r]}function r(t,n){return function(o){return o.ns===t&&e(o.name)===e(n)}}function i(){function i(t){return 1===t.nodeType}function u(t){return new a(null,String(t).toUpperCase())}function s(t,e){var n=u(e);return n.namespace=t,n}function p(t){return new l(t)}function c(){var e=new f;return t(e,e.defaultView={document:e,Document:f,Node:d,Text:l,Element:a,SVGElement:a,Event:b}),t(e,{documentElement:e,createElement:u,createElementNS:s,createTextNode:p}),e.appendChild(e.body=u("body")),e}var d=function(t,e){this.nodeType=t,this.nodeName=e,this.childNodes=[]},h={nextSibling:{},previousSibling:{},firstChild:{},lastChild:{}};h.nextSibling.get=function(){var t=this.parentNode;if(t)return t.childNodes[o(t.childNodes,this,!0)+1]},h.previousSibling.get=function(){var t=this.parentNode;if(t)return t.childNodes[o(t.childNodes,this,!0)-1]},h.firstChild.get=function(){return this.childNodes[0]},h.lastChild.get=function(){return this.childNodes[this.childNodes.length-1]},d.prototype.appendChild=function(t){this.insertBefore(t)},d.prototype.insertBefore=function(t,e){t.remove(),t.parentNode=this,e?n(this.childNodes,e,t):this.childNodes.push(t)},d.prototype.replaceChild=function(t,e){e.parentNode===this&&(this.insertBefore(t,e),e.remove())},d.prototype.removeChild=function(t){n(this.childNodes,t)},d.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)},Object.defineProperties(d.prototype,h);var l=function(t){function e(e){t.call(this,3,"#text"),this.nodeValue=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={textContent:{}};return n.textContent.set=function(t){this.nodeValue=t},n.textContent.get=function(){return this.nodeValue},Object.defineProperties(e.prototype,n),e}(d),a=function(t){function u(e,n){t.call(this,e||1,n),this.attributes=[],this.__handlers={}}t&&(u.__proto__=t),u.prototype=Object.create(t&&t.prototype),u.prototype.constructor=u;var s={children:{}};return s.children.get=function(){return this.childNodes.filter(i)},u.prototype.setAttribute=function(t,e){this.setAttributeNS(null,t,e)},u.prototype.getAttribute=function(t){return this.getAttributeNS(null,t)},u.prototype.removeAttribute=function(t){this.removeAttributeNS(null,t)},u.prototype.setAttributeNS=function(t,e,n){var i=o(this.attributes,r(t,e));i||this.attributes.push(i={ns:t,name:e}),i.value=String(n)},u.prototype.getAttributeNS=function(t,e){var n=o(this.attributes,r(t,e));return n&&n.value},u.prototype.removeAttributeNS=function(t,e){n(this.attributes,r(t,e))},u.prototype.addEventListener=function(t,n){(this.__handlers[e(t)]||(this.__handlers[e(t)]=[])).push(n)},u.prototype.removeEventListener=function(t,o){n(this.__handlers[e(t)],o,0,!0)},u.prototype.dispatchEvent=function(t){var n,o,r=t.currentTarget=this,i=t.cancelable;do if(n=r.__handlers[e(t.type)])for(o=n.length;o--&&(n[o](t)!==!1&&!t._end||!i););while(t.bubbles&&(!i||!t._stop)&&(t.target=r=r.parentNode));return!t.defaultPrevented},Object.defineProperties(u.prototype,s),u}(d),f=function(t){function e(){t.call(this,9,"#document")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a),b=function(t,e){this.type=t,this.bubbles=!!e.bubbles,this.cancelable=!!e.cancelable};return b.prototype.stopPropagation=function(){this._stop=!0},b.prototype.stopImmediatePropagation=function(){this._end=this._stop=!0},b.prototype.preventDefault=function(){this.defaultPrevented=!0},c()}return i}); | ||
//# sourceMappingURL=undom.min.js.map |
{ | ||
"name": "undom", | ||
"amdName": "undom", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Minimally viable DOM Document implementation.", | ||
@@ -6,0 +6,0 @@ "main": "dist/undom.js", |
@@ -8,5 +8,5 @@ # undom | ||
> Need a bare-bones HTML DOM where you don't have one? If you want the DOM but not a parser, this might be for you. | ||
> A bare-bones HTML DOM in a box. If you want the DOM but not a parser, this might be for you. | ||
> | ||
> `1kb` and works in Node and browsers. | ||
> `1kB`, works in Node and browsers, plugins coming soon! | ||
@@ -16,3 +16,5 @@ | ||
[![preview](https://i.gyazo.com/7fcca9dd3e562b076293ef2cf3979d23.gif)](https://jsfiddle.net/developit/4qv3v6r3/) | ||
--- | ||
@@ -19,0 +21,0 @@ |
if (typeof global!=='undefined' && !global.document) { | ||
global.window = require('.').defaultView; | ||
global.window = require('.')().defaultView; | ||
for (var i in global.window) global[i] = global.window[i]; | ||
} |
@@ -189,3 +189,3 @@ import { | ||
let document = new Document(); | ||
assign(document, document.defaultView = { document, Document, Node, Text, Element, Event }); | ||
assign(document, document.defaultView = { document, Document, Node, Text, Element, SVGElement:Element, Event }); | ||
assign(document, { documentElement:document, createElement, createElementNS, createTextNode }); | ||
@@ -192,0 +192,0 @@ document.appendChild(document.body = createElement('body')); |
Sorry, the diff of this file is not supported yet
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
50491
710
115