Comparing version 1.3.3 to 1.4.0
@@ -20,3 +20,7 @@ /** | ||
return this; | ||
} | ||
}; | ||
HTMLElement.prototype.setContentHtml = function(html) { | ||
this.innerHTML = html; | ||
return this; | ||
}; | ||
} |
@@ -9,3 +9,26 @@ /** | ||
return ( this instanceof DocumentFragment ) ? new DocumentFragment() : child; | ||
} | ||
}; | ||
Node.prototype.insertNeighborBefore = function(child) { | ||
if ( !this.parentNode ) { | ||
throw new RangeError( "Reference element is currently in detached mode! No way to add neighbors!" ); | ||
} | ||
this.parentNode.insertBefore(child, this); | ||
return ( this instanceof DocumentFragment ) ? new DocumentFragment() : child; | ||
}; | ||
Node.prototype.insertNeighborAfter = function(child) { | ||
if ( !this.parentNode ) { | ||
throw new RangeError( "Reference element is currently in detached mode! No way to add neighbors!" ); | ||
} | ||
this.parentNode.insertBefore(child, this.nextSibling); | ||
return ( this instanceof DocumentFragment ) ? new DocumentFragment() : child; | ||
}; | ||
Node.prototype.setContentText = function(text) { | ||
this.textContent = text; | ||
return this; | ||
}; | ||
} |
{ | ||
"name": "extes", | ||
"version": "1.3.3", | ||
"version": "1.4.0", | ||
"description": "A tiny library that extends native js with some handy tools", | ||
@@ -5,0 +5,0 @@ "main": "index.mjs", |
22051
719