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

bootstrap.native

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootstrap.native - npm Package Compare versions

Comparing version 2.0.13 to 2.0.14

14

dist/polyfill.js

@@ -13,5 +13,6 @@ /* Native JavaScript for Bootstrap 3 IE8+ Polyfill

className = 'className', add = 'add', classList = 'classList', remove = 'remove', contains = 'contains',
CLASS = 'class', setATTRIBUTE = 'setAttribute', getATTRIBUTE = 'getAttribute',
// object | array related
prototype = 'prototype', indexOf = 'indexOf', length = 'length',
prototype = 'prototype', indexOf = 'indexOf', length = 'length', split = 'split',

@@ -34,3 +35,3 @@ // event related

var arraylike = this instanceof String ? this.split('') : this,
var arraylike = this instanceof String ? this[split]('') : this,
lengthValue = Math.max(Math.min(arraylike[length], 9007199254740991), 0) || 0,

@@ -54,4 +55,4 @@ index = Number(arguments[1]) || 0;

var ClassLIST = function(elem){
var classArr = elem[className].replace(/^\s+|\s+$/g,'').split(/\s+/) || [];
var classArr = (elem[getATTRIBUTE](CLASS)||'').replace(/^\s+|\s+$/g,'')[split](/\s+/) || [];
// methods

@@ -64,3 +65,3 @@ hasClass = this[contains] = function(classNAME){

classArr.push(classNAME);
elem[className] = classArr.join(' ');
elem[setATTRIBUTE](CLASS, classArr.join(' '));
}

@@ -71,3 +72,3 @@ },

classArr.splice(classArr[indexOf](classNAME),1);
elem[className] = classArr.join(' ');
elem[setATTRIBUTE](CLASS, classArr.join(' '));
}

@@ -79,3 +80,2 @@ },

};
}

@@ -82,0 +82,0 @@ Object.defineProperty(ELEMENT[prototype], classList, { get: function () { return new ClassLIST(this); } });

// Native JavaScript for Bootstrap 3 Polyfill
!function(){var a="Document",b=document,c=this[a]||this.HTMLDocument,d="Window",e=window,f=this.constructor||this[d]||Window,g="HTMLElement",h="documentElement",i=Element,j="className",k="add",l="classList",m="remove",n="contains",o="prototype",p="indexOf",q="length",r="Event",s="CustomEvent",t="_events",u="type",v="target",w="currentTarget",x="relatedTarget",y="cancelable",z="bubbles",A="cancelBubble",B="cancelImmediate",C="detail",D="addEventListener",E="removeEventListener",F="dispatchEvent";if(e[g]||(e[g]=e[i]),Array[o][p]||(Array[o][p]=function(a){if(void 0===this||null===this)throw new TypeError(this+" is not an object");var b=this instanceof String?this.split(""):this,c=Math.max(Math.min(b[q],9007199254740991),0)||0,d=Number(arguments[1])||0;for(d=(d<0?Math.max(c+d,0):d)-1;++d<c;)if(d in b&&b[d]===a)return d;return-1}),!(l in i[o])){var G=function(a){var b=a[j].replace(/^\s+|\s+$/g,"").split(/\s+/)||[];hasClass=this[n]=function(a){return b[p](a)>-1},addClass=this[k]=function(c){hasClass(c)||(b.push(c),a[j]=b.join(" "))},removeClass=this[m]=function(c){hasClass(c)&&(b.splice(b[p](c),1),a[j]=b.join(" "))},toggleClass=this.toggle=function(a){hasClass(a)?removeClass(a):addClass(a)}};Object.defineProperty(i[o],l,{get:function(){return new G(this)}})}e[r]&&f[o][r]||(e[r]=f[o][r]=c[o][r]=i[o][r]=function(a,c){if(!a)throw new Error("Not enough arguments");var d,e=!(!c||void 0===c[z])&&c[z],f=!(!c||void 0===c[y])&&c[y];return"createEvent"in b?(d=b.createEvent(r),d.initEvent(a,e,f)):(d=b.createEventObject(),d[u]=a,d[z]=e,d[y]=f),d}),s in e&&s in f[o]||(e[s]=f[o][s]=c[o][s]=Element[o][s]=function(a,b){if(!a)throw Error("CustomEvent TypeError: An event name must be provided.");var c=new Event(a,b);return c[C]=b&&b[C]||null,c}),e[D]&&f[o][D]||(e[D]=f[o][D]=c[o][D]=i[o][D]=function(){var a=this,c=arguments[0],d=arguments[1];a[t]||(a[t]={}),a[t][c]||(a[t][c]=function(c){var i,d=a[t][c[u]].list,e=d.slice(),f=-1,g=e[q];for(c.preventDefault=function(){c[y]!==!1&&(c.returnValue=!1)},c.stopPropagation=function(){c[A]=!0},c.stopImmediatePropagation=function(){c[A]=!0,c[B]=!0},c[w]=a,c[x]=c[x]||c.fromElement||null,c[v]=c[v]||c.srcElement||a,c.timeStamp=(new Date).getTime(),c.clientX&&(c.pageX=c.clientX+b[h].scrollLeft,c.pageY=c.clientY+b[h].scrollTop);++f<g&&!c[B];)f in e&&(i=e[f],d[p](i)!==-1&&"function"==typeof i&&i.call(a,c))},a[t][c].list=[],a.attachEvent&&a.attachEvent("on"+c,a[t][c])),a[t][c].list.push(d)},e[E]=f[o][E]=c[o][E]=i[o][E]=function(){var d,a=this,b=arguments[0],c=arguments[1];a[t]&&a[t][b]&&a[t][b].list&&(d=a[t][b].list[p](c),d!==-1&&(a[t][b].list.splice(d,1),a[t][b].list[q]||(a.detachEvent&&a.detachEvent("on"+b,a[t][b]),delete a[t][b])))}),e[F]&&f[o][F]&&c[o][F]&&i[o][F]||(e[F]=f[o][F]=c[o][F]=i[o][F]=function(a){if(!arguments[q])throw new Error("Not enough arguments");if(!a||"string"!=typeof a[u])throw new Error("DOM Events Exception 0");var b=this,c=a[u];try{if(!a[z]){a[A]=!0;var d=function(a){a[A]=!0,(b||e).detachEvent("on"+c,d)};this.attachEvent("on"+c,d)}this.fireEvent("on"+c,a)}catch(d){a[v]=b;do a[w]=b,t in b&&"function"==typeof b[t][c]&&b[t][c].call(b,a),"function"==typeof b["on"+c]&&b["on"+c].call(b,a),b=9===b.nodeType?b.parentWindow:b.parentNode;while(b&&!a[A])}return!0})}();
!function(){var e=document,t=this.Document||this.HTMLDocument,n=window,s=this.constructor||this.Window||Window,i=Element,a="prototype";if(n.HTMLElement||(n.HTMLElement=n[i]),Array[a].indexOf||(Array[a].indexOf=function(e){if(void 0===this||null===this)throw new TypeError(this+" is not an object");var t=this instanceof String?this.split(""):this,n=Math.max(Math.min(t.length,9007199254740991),0)||0,s=Number(arguments[1])||0;for(s=(s<0?Math.max(n+s,0):s)-1;++s<n;)if(s in t&&t[s]===e)return s;return-1}),!("classList"in i[a])){var r=function(e){var t=(e.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(/\s+/)||[];hasClass=this.contains=function(e){return t.indexOf(e)>-1},addClass=this.add=function(n){hasClass(n)||(t.push(n),e.setAttribute("class",t.join(" ")))},removeClass=this.remove=function(n){hasClass(n)&&(t.splice(t.indexOf(n),1),e.setAttribute("class",t.join(" ")))},toggleClass=this.toggle=function(e){hasClass(e)?removeClass(e):addClass(e)}};Object.defineProperty(i[a],"classList",{get:function(){return new r(this)}})}n.Event&&s[a].Event||(n.Event=s[a].Event=t[a].Event=i[a].Event=function(t,n){if(!t)throw new Error("Not enough arguments");var s,i=!(!n||void 0===n.bubbles)&&n.bubbles,a=!(!n||void 0===n.cancelable)&&n.cancelable;return"createEvent"in e?(s=e.createEvent("Event")).initEvent(t,i,a):((s=e.createEventObject()).type=t,s.bubbles=i,s.cancelable=a),s}),"CustomEvent"in n&&"CustomEvent"in s[a]||(n.CustomEvent=s[a].CustomEvent=t[a].CustomEvent=Element[a].CustomEvent=function(e,t){if(!e)throw Error("CustomEvent TypeError: An event name must be provided.");var n=new Event(e,t);return n.detail=t&&t.detail||null,n}),n.addEventListener&&s[a].addEventListener||(n.addEventListener=s[a].addEventListener=t[a].addEventListener=i[a].addEventListener=function(){var t=this,n=arguments[0],s=arguments[1];t._events||(t._events={}),t._events[n]||(t._events[n]=function(n){var s,i=t._events[n.type].list,a=i.slice(),r=-1,o=a.length;for(n.preventDefault=function(){!1!==n.cancelable&&(n.returnValue=!1)},n.stopPropagation=function(){n.cancelBubble=!0},n.stopImmediatePropagation=function(){n.cancelBubble=!0,n.cancelImmediate=!0},n.currentTarget=t,n.relatedTarget=n.relatedTarget||n.fromElement||null,n.target=n.target||n.srcElement||t,n.timeStamp=(new Date).getTime(),n.clientX&&(n.pageX=n.clientX+e.documentElement.scrollLeft,n.pageY=n.clientY+e.documentElement.scrollTop);++r<o&&!n.cancelImmediate;)r in a&&(s=a[r],-1!==i.indexOf(s)&&"function"==typeof s&&s.call(t,n))},t._events[n].list=[],t.attachEvent&&t.attachEvent("on"+n,t._events[n])),t._events[n].list.push(s)},n.removeEventListener=s[a].removeEventListener=t[a].removeEventListener=i[a].removeEventListener=function(){var e,t=this,n=arguments[0],s=arguments[1];t._events&&t._events[n]&&t._events[n].list&&-1!==(e=t._events[n].list.indexOf(s))&&(t._events[n].list.splice(e,1),t._events[n].list.length||(t.detachEvent&&t.detachEvent("on"+n,t._events[n]),delete t._events[n]))}),n.dispatchEvent&&s[a].dispatchEvent&&t[a].dispatchEvent&&i[a].dispatchEvent||(n.dispatchEvent=s[a].dispatchEvent=t[a].dispatchEvent=i[a].dispatchEvent=function(e){if(!arguments.length)throw new Error("Not enough arguments");if(!e||"string"!=typeof e.type)throw new Error("DOM Events Exception 0");var t=this,s=e.type;try{if(!e.bubbles){e.cancelBubble=!0;var i=function(e){e.cancelBubble=!0,(t||n).detachEvent("on"+s,i)};this.attachEvent("on"+s,i)}this.fireEvent("on"+s,e)}catch(n){e.target=t;do{e.currentTarget=t,"_events"in t&&"function"==typeof t._events[s]&&t._events[s].call(t,e),"function"==typeof t["on"+s]&&t["on"+s].call(t,e),t=9===t.nodeType?t.parentWindow:t.parentNode}while(t&&!e.cancelBubble)}return!0})}();
{
"name": "bootstrap.native",
"version": "2.0.13",
"version": "2.0.14",
"description": "Native Javascript for Bootstrap, the sweetest Javascript library without jQuery.",

@@ -5,0 +5,0 @@ "main": "dist/bootstrap-native.js",

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