From 6976a20362c82a33ffd5d402d92470ca94466852 Mon Sep 17 00:00:00 2001 From: thednp Date: Thu, 26 Jan 2017 17:16:50 +0200 Subject: [PATCH] Fixing SEMVER issue https://github.com/thednp/bootstrap.native/commit/2a079b06c2304a1cebdc16a385f5049024911857#commitcomment-20626482 --- bower.json | 2 +- dist/bootstrap-native.js | 2 +- dist/bootstrap-native.min.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index 341de184..b382a26c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "bootstrap.native", - "version": "1.3.0", + "version": "2.0.0", "homepage": "http://thednp.github.io/bootstrap.native/", "authors": [ "dnp_theme" diff --git a/dist/bootstrap-native.js b/dist/bootstrap-native.js index 0cbb2e21..4b0b1121 100644 --- a/dist/bootstrap-native.js +++ b/dist/bootstrap-native.js @@ -1,4 +1,4 @@ -// Native Javascript for Bootstrap 3 v1.3.0 | © dnp_theme | MIT-License +// Native Javascript for Bootstrap 3 v2.0.0 | © dnp_theme | MIT-License (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD support: diff --git a/dist/bootstrap-native.min.js b/dist/bootstrap-native.min.js index 5dd64b65..ab39b6d9 100644 --- a/dist/bootstrap-native.min.js +++ b/dist/bootstrap-native.min.js @@ -1,2 +1,2 @@ -// Native Javascript for Bootstrap 3 v1.3.0 | © dnp_theme | MIT-License +// Native Javascript for Bootstrap 3 v2.0.0 | © dnp_theme | MIT-License !function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var n=e();t.Affix=n.Affix,t.Alert=n.Alert,t.Button=n.Button,t.Carousel=n.Carousel,t.Collapse=n.Collapse,t.Dropdown=n.Dropdown,t.Modal=n.Modal,t.Popover=n.Popover,t.ScrollSpy=n.ScrollSpy,t.Tab=n.Tab,t.Tooltip=n.Tooltip}}(this,function(){var t="undefined"!=typeof t?t:this||window,e=document.documentElement,n=document.body,i=null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)&&parseFloat(RegExp.$1),o="data-toggle",a="data-dismiss",l="data-spy",r="data-ride",s="Affix",c="Alert",u="Button",d="Carousel",f="Collapse",h="Dropdown",p="Modal",m="Popover",v="ScrollSpy",g="Tab",y="Tooltip",T="data-backdrop",x="data-keyboard",b="data-duration",w="data-target",I="data-interval",C="data-height",E="data-pause",L="data-original-title",A="data-original-text",S="data-dismissible",k="data-trigger",M="data-animation",B="data-placement",D="data-delay",H="data-offset-top",N="data-offset-bottom",P="backdrop",O="keyboard",W="delay",$="duration",R="content",j="target",z="interval",q="pause",F="animation",U="placement",X="container",Y="offsetTop",G="offsetBottom",J="scrollTop",K="scrollLeft",Q="clientWidth",V="clientHeight",Z="offsetWidth",_="offsetHeight",tt="innerWidth",et="innerHeight",nt="scrollHeight",it="height",ot="aria-expanded",at="aria-hidden",lt="click",rt="hover",st="keydown",ct="resize",ut="scroll",dt="show",ft="shown",ht="hide",pt="hidden",mt="close",vt="closed",gt="slid",yt="slide",Tt="change",xt="getAttribute",bt="setAttribute",wt="hasAttribute",It="getElementsByTagName",Ct="getBoundingClientRect",Et="collapsing",Lt="parentNode",At="length",St="active",kt="disabled",Mt="loading",Bt="left",Dt="right",Ht="top",Nt="bottom",Pt="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Ot=/\b(top|bottom|left|top)+/,Wt=function(t,e){t.classList.add(e)},$t=function(t,e){t.classList.remove(e)},Rt=function(t,e){return t.classList.contains(e)},jt=function(t,e){var n=8===i?"querySelectorAll":"getElementsByClassName";return t[n](8===i?"."+e.replace(/\s(?=[a-z])/g,"."):e)},zt=function(t,e){var n=e?e:document;return"object"==typeof t?t:/^#/.test(t)?document.getElementById(t.replace("#","")):n.querySelector(t)},qt=function(t,e){for(var n=e.charAt(0);t&&t!==document;t=t[Lt]){if(("."===n||"#"!==n)&&null!==zt(e,t[Lt]))return t;if("#"===n&&t.id===e.substr(1))return t}return!1},Ft=function(t,e,n){t.addEventListener(e,n,!1)},Ut=function(t,e,n){t.removeEventListener(e,n,!1)},Xt=function(t,e,n){var i=new CustomEvent(t+".bs."+e);i.relatedTarget=n,this.dispatchEvent(i)},Yt=document[It]("*"),Gt=function(t,e,n,i){for(var o=i&&i[At]?i:Yt,a=0;a-1||l===r)&&new e(o[a])}},Jt=function(e){var n=e&&(e.currentStyle||t.getComputedStyle(e)),i=/px/.test(n.borderTopWidth)?Math.round(n.borderTopWidth.replace("px","")):0,o=/px/.test(n.borderBottomWidth)?Math.round(n.borderBottomWidth.replace("px","")):0,a=/px/.test(n.marginTop)?Math.round(n.marginTop.replace("px","")):0,l=/px/.test(n.marginBottom)?Math.round(n.marginBottom.replace("px","")):0;return e[V]+parseInt(i)+parseInt(o)+parseInt(a)+parseInt(l)},Kt=function(t){for(var e=0,n=0,i=t.children[At];n=0&&i[Bt]>=0&&i[Nt]<=(t[et]||e[V])&&i[Dt]<=(t[tt]||e[Q])},Vt=function(){return{y:t.pageYOffset||e[J],x:t.pageXOffset||e[K]}},Zt=function(t,e,n){var i=t[Ct](),o=Vt(),a={w:i[Dt]-i[Bt],h:i[Nt]-i[Ht]},l={w:e[Z],h:e[_]};n===Ht?(e.style[Ht]=i[Ht]+o.y-l.h+"px",e.style[Bt]=i[Bt]+o.x-l.w/2+a.w/2+"px"):n===Nt?(e.style[Ht]=i[Ht]+o.y+a.h+"px",e.style[Bt]=i[Bt]+o.x-l.w/2+a.w/2+"px"):n===Bt?(e.style[Ht]=i[Ht]+o.y-l.h/2+a.h/2+"px",e.style[Bt]=i[Bt]+o.x-l.w+"px"):n===Dt&&(e.style[Ht]=i[Ht]+o.y-l.h/2+a.h/2+"px",e.style[Bt]=i[Bt]+o.x+a.w+"px"),e.className.indexOf(n)===-1&&(e.className=e.className.replace(Ot,n))},_t=function(t){return t===Ht?Nt:t===Nt?Ht:t===Bt?Dt:t===Dt?Bt:t},te=function(o,a){o=zt(o),a=a||{};var l=o[xt](w),r=o[xt](H),c=o[xt](N),u="affix",d="affixed",f="function",h="update",p="affix-top",m="affixed-top",v="affix-bottom",g="affixed-bottom";if(this[j]=a[j]?zt(a[j]):zt(l)||null,this[Y]=a[Y]?a[Y]:parseInt(r)||0,this[G]=a[G]?a[G]:parseInt(c)||0,this[j]||this[Y]||this[G]){var y,T,x,b,I,C,E=this,L=i&&i<10?500:50,A=!1,S=!1,k=function(){return Math.max(n[nt],n[_],e[V],e[nt],e[_])},M=function(){return null!==E[j]?E[j][Ct]()[Ht]+b:E[Y]?parseInt(typeof E[Y]===f?E[Y]():E[Y]||0):void 0},B=function(){if(E[G])return x-o[_]-parseInt(typeof E[G]===f?E[G]():E[G]||0)},D=function(){x=k(),b=parseInt(Vt().y,0),y=M(),T=B(),I=parseInt(y)-b<0&&b>parseInt(y),C=parseInt(T)-b<0&&b>parseInt(T)},P=function(){A||Rt(o,u)||(Xt.call(o,u,u),Xt.call(o,p,u),Wt(o,u),A=!0,Xt.call(o,d,u),Xt.call(o,m,u))},O=function(){A&&Rt(o,u)&&($t(o,u),A=!1)},W=function(){S||Rt(o,v)||(Xt.call(o,u,u),Xt.call(o,v,u),Wt(o,v),S=!0,Xt.call(o,d,u),Xt.call(o,g,u))},$=function(){S&&Rt(o,v)&&($t(o,v),S=!1)},R=function(){C?(I&&O(),W()):($(),I?P():O())};this[h]=function(){D(),R()},s in o||(Ft(t,ut,this[h]),Ft(t,ct,function(){setTimeout(function(){E[h]()},L)}),o[s]=this),this[h]()}};Gt(s,te,l);var ee=function(t){t=zt(t);var e=this,n="alert",o=qt(t,"."+n),l=i&&i<10?0:300,r=function(i){var l=i[j];l=l[wt](a)?l:l[Lt],l&&l[wt](a)&&(o=qt(l,"."+n),t=zt("["+a+'="'+n+'"]',o),(t===l||t===l[Lt])&&o&&e.close())};this.close=function(){o&&t&&Rt(o,"in")&&(Xt.call(o,mt,n),$t(o,"in"),setTimeout(function(){o&&(Xt.call(o,vt,n),Ut(t,lt,r),o[Lt].removeChild(o))},l))},c in t||(Ft(t,lt,r),t[c]=this)};Gt(c,ee,a);var ne=function(t,e){t=zt(t),e=e||null;var n=!1,i="button",o="checked",a="reset",l="LABEL",r="INPUT",s=function(){e&&e!==a&&(e===Mt&&(Wt(t,kt),t[bt](kt,kt)),t[bt](A,t.innerHTML.replace(/^\s+|\s+$/g,"")),t.innerHTML=t[xt]("data-"+e+"-text"))},c=function(){t[xt](A)&&((Rt(t,kt)||t[xt](kt)===kt)&&($t(t,kt),t.removeAttribute(kt)),t.innerHTML=t[xt](A))},d=function(e){var a=e[j][Lt],s=e[j].tagName===l?e[j]:a.tagName===l?a:null;if(s){var c=this,u=jt(c,"btn"),d=s[It](r)[0];if(d){if("checkbox"===d.type&&(d[o]?($t(s,St),d[xt](o),d.removeAttribute(o),d[o]=!1):(Wt(s,St),d[xt](o),d[bt](o,o),d[o]=!0),n||(n=!0,Xt.call(d,Tt,i),Xt.call(t,Tt,i))),"radio"===d.type&&!n&&!d[o]){Wt(s,St),d[bt](o,o),d[o]=!0,Xt.call(d,Tt,i),Xt.call(t,Tt,i),n=!0;for(var f=0,h=u[At];fp||n===y-1&&0===p)&&(T=h[u]=Dt),h.slideTo(p)}},D=function(t){if(t.preventDefault(),!v){var e=t.currentTarget||t.srcElement;e===L?(p++,T=h[u]=Bt,p===y-1?p=y-1:p===y&&(p=0)):e===C&&(p--,T=h[u]=Dt,0===p?p=0:p<0&&(p=y-1)),h.slideTo(p)}},H=function(t){if(!v){switch(t.which){case 39:p++,T=h[u]=Bt,p==y-1?p=y-1:p==y&&(p=0);break;case 37:p--,T=h[u]=Dt,0==p?p=0:p<0&&(p=y-1);break;default:return}h.slideTo(p)}},N=function(t){for(var e=0,n=S[At];e-1)&&(n.persist||l))return;s=null,v()}(/\#$/.test(r.href)||/\#$/.test(r[Lt].href))&&e.preventDefault()}},m=function(){Xt.call(a,dt,l,s),Wt(a,r),c[bt](ot,!0),Xt.call(a,ft,l,s),Ft(document,st,f),i=!0},v=function(){Xt.call(a,ht,l,s),$t(a,r),c[bt](ot,!1),Xt.call(a,pt,l,s),Ut(document,st,f),i=!1},g=0,y=d[At]||0;ge[V],m=A()},k=function(){r.style[u]=!f&&h?m+"px":"",r.style[d]=f&&!h?m+"px":""},M=function(){r.style[u]="",r.style[d]=""},B=function(){var t=document.createElement("div");v=zt("."+modalBackdropString),null===v&&(t[bt]("class",modalBackdropString+" fade"),v=t,n.appendChild(v))},D=function(){v=zt("."+modalBackdropString),v&&null!==v&&"object"==typeof v&&(n.removeChild(v),v=null)},H=function(){Rt(r,"in")?Ut(document,st,q):Ft(document,st,q)},N=function(){Rt(r,"in")?Ut(t,ct,this.update):Ft(t,ct,this.update)},W=function(){Rt(r,"in")?Ut(r,lt,F):Ft(r,lt,F)},z=function(t){var e=t[j];e=e[wt](w)||e[wt]("href")?e:e[Lt],t.defaultPrevented||y||e!==o||Rt(r,"in")||(r.modalTrigger=o,I=o,g.show(),t.preventDefault(),setTimeout(function(){t.defaultPrevented=!1},50))},q=function(t){var e=t.which||t.keyCode;g[O]&&27==e&&y&&g.hide()},F=function(t){var e=t[j];!t.defaultPrevented&&y&&(e[Lt][xt](a)===s||e[xt](a)===s||e===r&&g[P]!==c)&&(g.hide(),I=null,t.preventDefault(),setTimeout(function(){t.defaultPrevented=!1},50))};this.toggle=function(){y&&Rt(r,"in")?this.hide():this.show()},this.show=function(){Xt.call(r,dt,s,I);var t=jt(document,s+" in")[0];t&&t!==r&&t.modalTrigger[p].hide(),this[P]&&B(),v&&!Rt(v,"in")&&setTimeout(function(){Wt(v,"in")},0),setTimeout(function(){r.style.display="block",S(),E(),k(),N(),W(),H(),Wt(n,s+"-open"),Wt(r,"in"),r[bt](at,!1)},this[$]/2),setTimeout(function(){y=!0,Xt.call(r,ft,s,I)},this[$])},this.hide=function(){Xt.call(r,ht,s),v=zt("."+modalBackdropString),null!==v&&$t(v,"in"),$t(r,"in"),r[bt](at,!0),setTimeout(function(){$t(n,s+"-open"),N(),W(),H(),M(),L(),r.style.display=""},this[$]/2),setTimeout(function(){jt(document,s+" in")[0]||D(),y=!1,Xt.call(r,pt,s)},this[$])},this.setContent=function(t){zt("."+s+"-content",r).innerHTML=t},this.update=function(){y&&(S(),E(),k())},p in o||(this[R]&&this.setContent(this[R]),Ft(o,lt,z),o[p]=this)};Gt(p,le,o);var re=function(e,o){e=zt(e);var a=e[xt](k),l=e[xt](M),r=e[xt](b),s=e[xt](B),c=e[xt](S),u=e[xt](D),d="popover",f="template",h="trigger",p="class",v="div",g="fade",y="data-title",T="data-content",x="dismissible",w='';o=o||{},this[f]=o[f]?o[f]:null,this[h]=o[h]?o[h]:a||rt,this[F]=o[F]&&o[F]!==g?o[F]:l||g,this[U]=o[U]?o[U]:s||Ht,this[W]=parseInt(o[W]||u)||100,this[x]=!(!o[x]&&"true"!==c),this[$]=i&&i<10?0:parseInt(o[$]||r)||150,this[X]=zt(o[X])||n;var I=this,C=e[xt](y)||null,E=e[xt](T)||null;if(E||this[f]){var L=null,A=0,H=this[U],N=function(t){null!==L&&t[j]===zt(".close",L)&&I.hide()},P=function(){I[X].removeChild(L),A=null,L=null},O=function(){if(C=e[xt](y),E=e[xt](T),L=document.createElement(v),null!==E&&null===I[f]){if(L[bt]("role","tooltip"),null!==C){var t=document.createElement("h3");t[bt](p,d+"-title"),t.innerHTML=I[x]?C+w:C,L.appendChild(t)}var n=document.createElement(v),i=document.createElement(v);n[bt](p,"arrow"),i[bt](p,d+"-content"),L.appendChild(n),L.appendChild(i),i.innerHTML=I[x]&&null===C?E+w:E}else{var o=document.createElement(v);o.innerHTML=I[f],L.innerHTML=o.firstChild.innerHTML}I[X].appendChild(L),L.style.display="block",L[bt](p,d+" "+H+" "+I[F])},R=function(){!Rt(L,"in")&&Wt(L,"in")},z=function(){Zt(e,L,H),Qt(L)||(H=_t(H),Zt(e,L,H))};this.toggle=function(){null===L?I.show():I.hide()},this.show=function(){clearTimeout(A),A=setTimeout(function(){null===L&&(H=I[U],O(),z(),R(),Xt.call(e,dt,d),setTimeout(function(){Xt.call(e,ft,d)},I[$]))},20)},this.hide=function(){clearTimeout(A),A=setTimeout(function(){L&&null!==L&&Rt(L,"in")&&(Xt.call(e,ht,d),$t(L,"in"),setTimeout(function(){P(),Xt.call(e,pt,d)},I[$]))},I[W])},m in e||(I[h]===rt?(Ft(e,Pt[0],I.show),I[x]||Ft(e,Pt[1],I.hide)):/^(click|focus)$/.test(I[h])&&(Ft(e,I[h],I.toggle),I[x]||Ft(e,"blur",I.hide)),I[x]&&Ft(document,lt,N),i&&i<9||Ft(t,ct,I.hide),e[m]=I)}};Gt(m,re,o);var se=function(e,n){e=zt(e);var o=zt(e[xt](w));if(n=n||{},n[j]||o){for(var a,l=n[j]&&zt(n[j])||o,r=l&&l[It]("A"),s=[],c=[],u=e[_]-1?i[Lt][Y]:0,l=d&&i[Ct](),r=Rt(n,St)||!1,u=d?l[Ht]+a:i[Y]+o,f=d?l[Nt]+a:u+i[_],h=a>=u&&f>a;if(!r&&h)"LI"!==n.tagName||Rt(n,St)||(Wt(n,St),r=!0,Xt.call(e,"activate","scrollspy",s[t]));else if(h){if(!h&&!r||r&&h)return}else"LI"===n.tagName&&Rt(n,St)&&($t(n,St),r=!1)},y=function(){a=d?Vt().y:e[J];for(var t=0,n=s[At];t1&&(t=e[e[At]-1]):t=e[0],t[It]("A")[0]},p=function(){return zt(h()[xt]("href"))},m=function(t){t.preventDefault(),s=t[j],u.show()};this.show=function(){var e=zt(s[xt]("href")),n=h(),i=p();n[r]&&s[r]||Rt(s[Lt],St)||(n[r]=s[r]=!0,$t(n[Lt],St),Wt(s[Lt],St),f&&(Rt(t[Lt][Lt],"dropdown-menu")?Rt(f,St)||Wt(f,St):Rt(f,St)&&$t(f,St)),c&&(c.style[l]=Kt(i)+"px"),Xt.call(n,ht,a,s),setTimeout(function(){$t(i,"in")},10),setTimeout(function(){c&&Wt(c,Et),$t(i,St),Wt(e,St),setTimeout(function(){Wt(e,"in")},10),Xt.call(s,dt,a,n),Xt.call(n,pt,a,s),c&&(c.style[l]=Kt(e)+"px")},.7*u[$]),setTimeout(function(){Xt.call(s,ft,a,n),c&&($t(c,Et),c.style[l]=""),n[r]=s[r]=!1},1.5*u[$]))},g in t||(this[l]&&(c=p()[Lt]),Ft(t,lt,m),t[g]=this)};Gt(g,ce,o);var ue=function(t,e){t=zt(t);var o=t[xt](M);placementData=t[xt](B),durationData=t[xt](b),delayData=t[xt](D),component="tooltip",classString="class",title="title",fade="fade",div="div",e=e||{},this[F]=e[F]&&e[F]!==fade?e[F]:o||fade,this[U]=e[U]?e[U]:placementData||Ht,this[W]=parseInt(e[W]||delayData)||100,this[$]=i&&i<10?0:parseInt(e[$]||durationData)||150,this[X]=zt(e[X])||n;var a=this,l=0,r=this[U],s=null,c=t[xt](title)||t[xt](L);if(c){var u=function(){a[X].removeChild(s),s=null,l=null},d=function(){c=t[xt](title)||t[xt](L),s=document.createElement(div),s[bt]("role",component);var e=document.createElement(div),n=document.createElement(div);e[bt](classString,component+"-arrow"),n[bt](classString,component+"-inner"),s.appendChild(e),s.appendChild(n),n.innerHTML=c,a[X].appendChild(s),s[bt](classString,component+" "+r+" "+a[F])},f=function(){Zt(t,s,r),Qt(s)||(r=_t(r),Zt(t,s,r))},h=function(){!Rt(s,"in")&&Wt(s,"in")};this.show=function(){clearTimeout(l),l=setTimeout(function(){null===s&&(r=a[U],d(),f(),h(),Xt.call(t,dt,component),setTimeout(function(){Xt.call(t,ft,component)},a[$]))},20)},this.hide=function(){clearTimeout(l),l=setTimeout(function(){s&&null!==s&&Rt(s,"in")&&(Xt.call(t,ht,component),$t(s,"in"),setTimeout(function(){u(),Xt.call(t,pt,component)},a[$]))},a[W])},this.toggle=function(){s?a.hide():a.show()},y in t||(t[bt](L,c),t.removeAttribute(title),Ft(t,Pt[0],this.show),Ft(t,Pt[1],this.hide),t[y]=this)}};return Gt(y,ue,o),{Affix:te,Alert:ee,Button:ne,Carousel:ie,Collapse:oe,Dropdown:ae,Modal:le,Popover:re,ScrollSpy:se,Tab:ce,Tooltip:ue}}); diff --git a/package.json b/package.json index 22396598..9b74ecf1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap.native", - "version": "1.3.0", + "version": "2.0.0", "description": "Native Javascript for Bootstrap 3, the sweetest Javascript library without jQuery.", "main": "dist/bootstrap-native.js", "scripts": {