Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

elements-lite

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elements-lite - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

63

elements-lite.js

@@ -5,3 +5,3 @@

/*
* @version 0.0.2
* @version 0.0.3
* @author Lauri Rooden - https://github.com/litejs/el-lite

@@ -34,33 +34,3 @@ * @license MIT License - http://lauri.rooden.ee/mit-license.txt

function extend(e, p, k) {
if (e) {
p = El[P]
for (k in p) e[k] = p[k]
}
return e
}
if (nativeEl === El[P]) {
/*
* IE 6-7
*/
var create = doc.createElement
doc.createElement = function(name) {return extend(create(name))}
extend(doc.body)
/*
* Remove background image flickers on hover in IE6
*
* You could also use CSS
* html { filter: expression(document.execCommand("BackgroundImageCache", false, true)); }
*/
/*@cc_on try{document.execCommand('BackgroundImageCache',false,true)}catch(e){}@*/
}
El[P] = nativeEl
/* TODO: Extend El api

@@ -210,3 +180,34 @@ * add El.siblings( [selector ] )

function extend(e, p, k) {
if (e) {
p = El[P]
for (k in p) e[k] = p[k]
}
return e
}
if (nativeEl === El[P]) {
/*
* IE 6-7
*/
var create = doc.createElement
doc.createElement = function(name) {return extend(create(name))}
extend(doc.body)
/*
* Remove background image flickers on hover in IE6
*
* You could also use CSS
* html { filter: expression(document.execCommand("BackgroundImageCache", false, true)); }
*/
/*@cc_on try{document.execCommand('BackgroundImageCache',false,true)}catch(e){}@*/
}
El[P] = nativeEl
El.get = function(el) {

@@ -213,0 +214,0 @@ if (typeof el == "string") el = doc.getElementById(el)

@@ -1,6 +0,6 @@

!function(l,f,g){function e(a,b){var d,c={};a=a.replace(m,function(a,b,d){c["."==b?(b="class",c[b]&&(d=c[b]+" "+d),b):"#"==b?"id":d]=d;return""})||"div";d=(h[a]||(h[a]=f.createElement(a))).cloneNode(!0).set(c);return j[a]&&j[a](d,b)||d.set(b)}function k(a,b,d){if(a)for(d in b=e[g],b)a[d]=b[d];return a}var h={},j={},c=(l.HTMLElement||l.Element||e)[g],m=/([.#:])([-\w]+)/g;if(c===e[g]){var n=f.createElement;f.createElement=function(a){return k(n(a))};k(f.body)}e[g]=c;c.append=function(a,b){if(a){if("string"==
typeof a||"number"==typeof a)a=e.text(a);else if(!("nodeType"in a)&&"length"in a){for(var d=a.length,c=0,g=f.createDocumentFragment();c<d;)this.append.call(g,a[c++]);a=g}a.nodeType&&this.insertBefore(a,b?!0===b?this.firstChild:"number"==typeof b?this.childNodes[b]:b:null);a.append_hook&&a.append_hook()}return this};c.after=function(a,b){a.parentNode.append(this,b?a:a.nextSibling);return this};c.to=function(a,b){a.append(this,b);return this};c.hasClass=function(a){return-1<(" "+this.className+" ").indexOf(" "+
a+" ")};c.addClass=function(a){this.className+=""==this.className?a:this.hasClass(a)?"":" "+a;return this};c.rmClass=function(a){this.className=(" "+this.className+" ").replace(" "+a+" "," ").trim();return this};c.toggleClass=function(a,b){void 0===b&&(b=!this.hasClass(a));this[b?"addClass":"rmClass"](a);return b};c.empty=function(){for(var a;a=this.firstChild;)this.kill.call(a);return this};c.kill=function(){this.parentNode&&this.parentNode.removeChild(this);Event.removeAll(this);this.empty&&this.empty();
this.kill_hook&&this.kill_hook();return this};c.on=function(a,b){Event.add(this,a,b);return this};c.non=function(a,b){Event.remove(this,a,b);return this};c.set=function(a){var b=typeof a,d;if(a)if("string"==b||"number"==b||a.nodeType||"length"in a)this.append(a);else for(b in a)d=a[b],"class"==b||"className"==b?this.addClass(d):"string"==typeof d?(this.setAttribute(b,d),"name"==b&&"\v"=="v"&&this.mergeAttributes(f.createElement("<INPUT name='"+b+"'/>"),!1)):d?this[b]=d:this.removeAttribute(b);return this};
c.find=f.querySelector?function(a){return this.querySelector(a)}:function(a){var b=0,d=["_"];a=a.replace(m,function(a,b,c){d.push("."==b?"(' '+_.className+' ').indexOf(' "+c+" ')>-1":"#"==b?"_.id=='"+c+"'":"_."+c);return""})||"*";for(var c=this.getElementsByTagName(a),e=d.join("&&").fn();a=c[b++];)if(e(a))return a.to?a:k(a)};e.get=function(a){"string"==typeof a&&(a=f.getElementById(a));return a&&a.to?a:k(a)};e.cache=function(a,b,c){h[a]="string"==typeof b?e(b):b;c&&(j[a]=c)};e.cache.el=h;e.cache.fn=
j;e.text=function(a){return f.createTextNode(a)};l.El=e}(this,document,"prototype");
!function(l,f,g){function e(a,b){var d,c={};a=a.replace(m,function(a,b,d){c["."==b?(b="class",c[b]&&(d=c[b]+" "+d),b):"#"==b?"id":d]=d;return""})||"div";d=(h[a]||(h[a]=f.createElement(a))).cloneNode(!0).set(c);return j[a]&&j[a](d,b)||d.set(b)}function k(a,b,d){if(a)for(d in b=e[g],b)a[d]=b[d];return a}var h={},j={},c=(l.HTMLElement||l.Element||e)[g],m=/([.#:])([-\w]+)/g;c.append=function(a,b){if(a){if("string"==typeof a||"number"==typeof a)a=e.text(a);else if(!("nodeType"in a)&&"length"in a){for(var d=
a.length,c=0,g=f.createDocumentFragment();c<d;)this.append.call(g,a[c++]);a=g}a.nodeType&&this.insertBefore(a,b?!0===b?this.firstChild:"number"==typeof b?this.childNodes[b]:b:null);a.append_hook&&a.append_hook()}return this};c.after=function(a,b){a.parentNode.append(this,b?a:a.nextSibling);return this};c.to=function(a,b){a.append(this,b);return this};c.hasClass=function(a){return-1<(" "+this.className+" ").indexOf(" "+a+" ")};c.addClass=function(a){this.className+=""==this.className?a:this.hasClass(a)?
"":" "+a;return this};c.rmClass=function(a){this.className=(" "+this.className+" ").replace(" "+a+" "," ").trim();return this};c.toggleClass=function(a,b){void 0===b&&(b=!this.hasClass(a));this[b?"addClass":"rmClass"](a);return b};c.empty=function(){for(var a;a=this.firstChild;)this.kill.call(a);return this};c.kill=function(){this.parentNode&&this.parentNode.removeChild(this);Event.removeAll(this);this.empty&&this.empty();this.kill_hook&&this.kill_hook();return this};c.on=function(a,b){Event.add(this,
a,b);return this};c.non=function(a,b){Event.remove(this,a,b);return this};c.set=function(a){var b=typeof a,d;if(a)if("string"==b||"number"==b||a.nodeType||"length"in a)this.append(a);else for(b in a)d=a[b],"class"==b||"className"==b?this.addClass(d):"string"==typeof d?(this.setAttribute(b,d),"name"==b&&"\v"=="v"&&this.mergeAttributes(f.createElement("<INPUT name='"+b+"'/>"),!1)):d?this[b]=d:this.removeAttribute(b);return this};c.find=f.querySelector?function(a){return this.querySelector(a)}:function(a){var b=
0,d=["_"];a=a.replace(m,function(a,b,c){d.push("."==b?"(' '+_.className+' ').indexOf(' "+c+" ')>-1":"#"==b?"_.id=='"+c+"'":"_."+c);return""})||"*";for(var c=this.getElementsByTagName(a),e=d.join("&&").fn();a=c[b++];)if(e(a))return a.to?a:k(a)};if(c===e[g]){var n=f.createElement;f.createElement=function(a){return k(n(a))};k(f.body)}e[g]=c;e.get=function(a){"string"==typeof a&&(a=f.getElementById(a));return a&&a.to?a:k(a)};e.cache=function(a,b,c){h[a]="string"==typeof b?e(b):b;c&&(j[a]=c)};e.cache.el=
h;e.cache.fn=j;e.text=function(a){return f.createTextNode(a)};l.El=e}(this,document,"prototype");
{
"name": "elements-lite",
"version": "0.0.2",
"version": "0.0.3",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "DOM buildel for browser",

@@ -11,3 +11,3 @@

Download [compressed][1]
(2641 bytes or 1158 bytes gzipped)
(2641 bytes or 1154 bytes gzipped)
or [uncompressed][2] source.

@@ -18,2 +18,4 @@

`<script src=sha-lite.js></script>` should place inside body.
```javascript

@@ -20,0 +22,0 @@ El("div", "test").to(document.body)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc