diff options
author | Johann-S <johann.servoire@gmail.com> | 2018-09-18 16:52:10 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2018-09-18 16:52:10 +0300 |
commit | 75f83da5399dac94d8dd93c78cc5a727548ddda4 (patch) | |
tree | 48f745dc519170b5ce0ceb0d2b31b3cbc6170968 | |
parent | c8fd9ddd976fe6529b9edab3804a355e96eba31c (diff) |
use bsCustomFileInput in our documentation (#27264)
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | site/_includes/scripts.html | 1 | ||||
-rw-r--r-- | site/docs/4.1/assets/js/vendor/bs-custom-file-input.min.js | 7 | ||||
-rw-r--r-- | site/docs/4.1/components/forms.md | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/package.json b/package.json index d85ea56f9c..b39a3c70a9 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "js-minify": "npm-run-all --parallel js-minify-*", "js-minify-standalone": "uglifyjs --compress typeofs=false --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.js.map,includeSources,url=bootstrap.min.js.map\" --output dist/js/bootstrap.min.js dist/js/bootstrap.js", "js-minify-bundle": "uglifyjs --compress typeofs=false --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.bundle.js.map,includeSources,url=bootstrap.bundle.min.js.map\" --output dist/js/bootstrap.bundle.min.js dist/js/bootstrap.bundle.js", - "js-minify-docs": "uglifyjs --mangle --comments \"/^!/\" --output site/docs/4.1/assets/js/docs.min.js site/docs/4.1/assets/js/vendor/anchor.min.js site/docs/4.1/assets/js/vendor/clipboard.min.js site/docs/4.1/assets/js/vendor/holder.min.js \"site/docs/4.1/assets/js/src/*.js\"", + "js-minify-docs": "uglifyjs --mangle --comments \"/^!/\" --output site/docs/4.1/assets/js/docs.min.js site/docs/4.1/assets/js/vendor/anchor.min.js site/docs/4.1/assets/js/vendor/clipboard.min.js site/docs/4.1/assets/js/vendor/holder.min.js site/docs/4.1/assets/js/vendor/bs-custom-file-input.min.js \"site/docs/4.1/assets/js/src/*.js\"", "js-test": "npm-run-all js-test-karma*", "js-test-karma": "karma start js/tests/karma.conf.js", "js-test-karma-old": "cross-env USE_OLD_JQUERY=true npm run js-test-karma", diff --git a/site/_includes/scripts.html b/site/_includes/scripts.html index 5880fcf814..346f97b00f 100644 --- a/site/_includes/scripts.html +++ b/site/_includes/scripts.html @@ -17,6 +17,7 @@ <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/vendor/anchor.min.js"></script> <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/vendor/clipboard.min.js"></script> <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/vendor/holder.min.js"></script> + <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/vendor/bs-custom-file-input.min.js"></script> <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/src/application.js"></script> <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/src/search.js"></script> <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/src/ie-emulation-modes-warning.js"></script> diff --git a/site/docs/4.1/assets/js/vendor/bs-custom-file-input.min.js b/site/docs/4.1/assets/js/vendor/bs-custom-file-input.min.js new file mode 100644 index 0000000000..e7c99e20aa --- /dev/null +++ b/site/docs/4.1/assets/js/vendor/bs-custom-file-input.min.js @@ -0,0 +1,7 @@ +/*! + * bsCustomFileInput v1.2.0 (https://github.com/Johann-S/bs-custom-file-input) + * Copyright 2018 Johann-S <johann.servoire@gmail.com> + * Licensed under MIT (https://github.com/Johann-S/bs-custom-file-input/blob/master/LICENSE) + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.bsCustomFileInput=t()}(this,function(){"use strict";var d={CUSTOMFILE:'.custom-file input[type="file"]',CUSTOMFILELABEL:".custom-file-label",FORM:"form",INPUT:"input"},r=function(e){if(0<e.childNodes.length)for(var t=[].slice.call(e.childNodes),n=0;n<t.length;n++){var r=t[n];if(3!==r.nodeType)return r}return e},u=function(e){var t=e.bsCustomFileInput.defaultText,n=e.parentNode.querySelector(d.CUSTOMFILELABEL);n&&(r(n).innerHTML=t)},t=!!window.File,n=function(e){return e.hasAttribute("multiple")&&t?[].slice.call(e.files).map(function(e){return e.name}).join(", "):e.value};function v(){var e=this.parentNode.querySelector(d.CUSTOMFILELABEL);e&&(r(e).innerHTML=n(this))}function p(){for(var e=[].slice.call(this.querySelectorAll(d.INPUT)).filter(function(e){return!!e.bsCustomFileInput}),t=0,n=e.length;t<n;t++)u(e[t])}var m="bsCustomFileInput",L="reset",y="change";return{init:function(e,t){void 0===e&&(e=d.CUSTOMFILE),void 0===t&&(t=d.FORM);for(var n,r,l,i=[].slice.call(document.querySelectorAll(e)),o=[].slice.call(document.querySelectorAll(t)),u=0,c=i.length;u<c;u++){var f=i[u];Object.defineProperty(f,m,{value:{defaultText:(n=f,r=void 0,void 0,r="",l=n.parentNode.querySelector(d.CUSTOMFILELABEL),l&&(r=l.innerHTML),r)},writable:!0}),f.addEventListener(y,v)}for(var s=0,a=o.length;s<a;s++)o[s].addEventListener(L,p),Object.defineProperty(o[s],m,{value:!0,writable:!0})},destroy:function(){for(var e=[].slice.call(document.querySelectorAll(d.FORM)).filter(function(e){return!!e.bsCustomFileInput}),t=[].slice.call(document.querySelectorAll(d.INPUT)).filter(function(e){return!!e.bsCustomFileInput}),n=0,r=t.length;n<r;n++){var l=t[n];u(l),l[m]=void 0,l.removeEventListener(y,v)}for(var i=0,o=e.length;i<o;i++)e[i].removeEventListener(L,p),e[i][m]=void 0}}}); +//# sourceMappingURL=bs-custom-file-input.min.js.map diff --git a/site/docs/4.1/components/forms.md b/site/docs/4.1/components/forms.md index 6369168d84..41a12daab8 100644 --- a/site/docs/4.1/components/forms.md +++ b/site/docs/4.1/components/forms.md @@ -1269,7 +1269,7 @@ By default, range inputs "snap" to integer values. To change this, you can speci ### File browser {% capture callout %} -Recommended plugin to animate custom file input: [bs-custom-file-input](https://www.npmjs.com/package/bs-custom-file-input) +The recommended plugin to animate custom file input: [bs-custom-file-input](https://www.npmjs.com/package/bs-custom-file-input), that's what we are using currently here in our docs. {% endcapture %} {% include callout.html content=callout type="info" %} |