From 30e9f0b996ab811d468bf0211a0b212cc9cf30fe Mon Sep 17 00:00:00 2001 From: Markus Lima Date: Mon, 14 Aug 2017 14:03:05 -0300 Subject: [PATCH] New version Stable 1.2.3 --- README.md | 2 +- bootstrap-filestyle.jquery.json | 2 +- bower.json | 2 +- package.json | 2 +- src/bootstrap-filestyle.js | 2 +- src/bootstrap-filestyle.min.js | 2 +- test/index.html | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index da3dcf8..13a6e70 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# [Bootstrap FileStyle v1.2.1](http://markusslima.github.io/bootstrap-filestyle/) +# [Bootstrap FileStyle v1.2.3 Stable](http://markusslima.github.io/bootstrap-filestyle/) Bootstrap FileStyle is a quick and simple plugin to help style your form's file upload inputs. diff --git a/bootstrap-filestyle.jquery.json b/bootstrap-filestyle.jquery.json index 71cae3f..a00ff7e 100644 --- a/bootstrap-filestyle.jquery.json +++ b/bootstrap-filestyle.jquery.json @@ -1,7 +1,7 @@ { "name": "bootstrap-filestyle", "title": "Bootstrap styling input file", - "version": "v1.2", + "version": "v1.2.3", "description": "jQuery FileStyle for Bootstrap - Customization of input html file for Bootstrap Twitter", "keywords": ["jquery", "file", "upload", "boostrap", "multiple", "input", "style"], "homepage": "http://markusslima.github.io/bootstrap-filestyle/", diff --git a/bower.json b/bower.json index 40a14d5..831bd00 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "bootstrap-filestyle", - "version": "1.2.1", + "version": "1.2.3", "homepage": "https://github.com/markusslima/bootstrap-filestyle", "authors": [ "Markus Lima @markusslima" diff --git a/package.json b/package.json index ed9b221..d579aa8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-filestyle", - "version": "1.2.1", + "version": "1.2.3", "description": "Bootstrap FileStyle is a quick and simple plugin to help style your form's file upload inputs.", "main": "src/bootstrap-filestyle.js", "directories": { diff --git a/src/bootstrap-filestyle.js b/src/bootstrap-filestyle.js index 4f34005..33ddf1a 100644 --- a/src/bootstrap-filestyle.js +++ b/src/bootstrap-filestyle.js @@ -4,7 +4,7 @@ * github: https://github.com/markusslima/bootstrap-filestyle * * Copyright (c) 2017 Markus Vinicius da Silva Lima - * Version 1.2.2 + * Version 1.2.3 * Licensed under the MIT license. */ (function($) { diff --git a/src/bootstrap-filestyle.min.js b/src/bootstrap-filestyle.min.js index 8c643a6..9aa702c 100644 --- a/src/bootstrap-filestyle.min.js +++ b/src/bootstrap-filestyle.min.js @@ -4,7 +4,7 @@ * github: https://github.com/markusslima/bootstrap-filestyle * * Copyright (c) 2017 Markus Vinicius da Silva Lima - * Version 1.2.2 + * Version 1.2.3 * Licensed under the MIT license. */ !function(t){"use strict";var e=0,i=function(e,i){this.options=i,this.$elementFilestyle=[],this.$element=t(e)};i.prototype={clear:function(){this.$element.val(""),this.$elementFilestyle.find(":text").val(""),this.$elementFilestyle.find(".badge").remove()},destroy:function(){this.$element.removeAttr("style").removeData("filestyle"),this.$elementFilestyle.remove()},disabled:function(t){if(!0===t)this.options.disabled||(this.$element.attr("disabled","true"),this.$elementFilestyle.find("label").attr("disabled","true"),this.options.disabled=!0);else{if(!1!==t)return this.options.disabled;this.options.disabled&&(this.$element.removeAttr("disabled"),this.$elementFilestyle.find("label").removeAttr("disabled"),this.options.disabled=!1)}},buttonBefore:function(t){if(!0===t)this.options.buttonBefore||(this.options.buttonBefore=!0,this.options.input&&(this.$elementFilestyle.remove(),this.constructor(),this.pushNameFiles()));else{if(!1!==t)return this.options.buttonBefore;this.options.buttonBefore&&(this.options.buttonBefore=!1,this.options.input&&(this.$elementFilestyle.remove(),this.constructor(),this.pushNameFiles()))}},icon:function(t){if(!0===t)this.options.icon||(this.options.icon=!0,this.$elementFilestyle.find("label").prepend(this.htmlIcon()));else{if(!1!==t)return this.options.icon;this.options.icon&&(this.options.icon=!1,this.$elementFilestyle.find(".icon-span-filestyle").remove())}},input:function(t){if(!0===t)this.options.input||(this.options.input=!0,this.options.buttonBefore?this.$elementFilestyle.append(this.htmlInput()):this.$elementFilestyle.prepend(this.htmlInput()),this.$elementFilestyle.find(".badge").remove(),this.pushNameFiles(),this.$elementFilestyle.find(".group-span-filestyle").addClass("input-group-btn"));else{if(!1!==t)return this.options.input;if(this.options.input){this.options.input=!1,this.$elementFilestyle.find(":text").remove();var e=this.pushNameFiles();e.length>0&&this.options.badge&&this.$elementFilestyle.find("label").append(' '+e.length+""),this.$elementFilestyle.find(".group-span-filestyle").removeClass("input-group-btn")}}},size:function(t){if(void 0===t)return this.options.size;var e=this.$elementFilestyle.find("label"),i=this.$elementFilestyle.find("input");e.removeClass("btn-lg btn-sm"),i.removeClass("input-lg input-sm"),"nr"!=t&&(e.addClass("btn-"+t),i.addClass("input-"+t))},placeholder:function(t){if(void 0===t)return this.options.placeholder;this.options.placeholder=t,this.$elementFilestyle.find("input").attr("placeholder",t)},buttonText:function(t){if(void 0===t)return this.options.buttonText;this.options.buttonText=t,this.$elementFilestyle.find("label .buttonText").html(this.options.buttonText)},buttonName:function(t){if(void 0===t)return this.options.buttonName;this.options.buttonName=t,this.$elementFilestyle.find("label").attr({class:"btn "+this.options.buttonName})},iconName:function(t){if(void 0===t)return this.options.iconName;this.$elementFilestyle.find(".icon-span-filestyle").attr({class:"icon-span-filestyle "+this.options.iconName})},htmlIcon:function(){return this.options.icon?' ':""},htmlInput:function(){return this.options.input?' ':""},pushNameFiles:function(){var t="",e=[];void 0===this.$element[0].files?e[0]={name:this.$element[0]&&this.$element[0].value}:e=this.$element[0].files;for(var i=0;i",n=i.options.buttonBefore?l+i.htmlInput():i.htmlInput()+l,i.$elementFilestyle=t('
'+n+"
"),i.$elementFilestyle.find(".group-span-filestyle").attr("tabindex","0").keypress(function(t){if(13===t.keyCode||32===t.charCode)return i.$elementFilestyle.find("label").click(),!1}),i.$element.css({position:"absolute",clip:"rect(0px 0px 0px 0px)"}).attr("tabindex","-1").after(i.$elementFilestyle),(i.options.disabled||i.$element.attr("disabled"))&&i.$element.attr("disabled","true"),i.$element.change(function(){var t=i.pushNameFiles();0==i.options.input&&i.options.badge?0==i.$elementFilestyle.find(".badge").length?i.$elementFilestyle.find("label").append(' '+t.length+""):0==t.length?i.$elementFilestyle.find(".badge").remove():i.$elementFilestyle.find(".badge").html(t.length):i.$elementFilestyle.find(".badge").remove()}),window.navigator.userAgent.search(/firefox/i)>-1&&i.$elementFilestyle.find("label").click(function(){return i.$element.click(),!1})}};var n=t.fn.filestyle;t.fn.filestyle=function(e,n){var s="",l=this.each(function(){if("file"===t(this).attr("type")){var l=t(this),o=l.data("filestyle"),a=t.extend({},t.fn.filestyle.defaults,e,"object"==typeof e&&e);o||(l.data("filestyle",o=new i(this,a)),o.constructor()),"string"==typeof e&&(s=o[e](n))}});return void 0!==typeof s?s:l},t.fn.filestyle.defaults={buttonText:"Choose file",iconName:"glyphicon glyphicon-folder-open",buttonName:"btn-default",size:"nr",input:!0,badge:!0,icon:!0,buttonBefore:!1,disabled:!1,placeholder:""},t.fn.filestyle.noConflict=function(){return t.fn.filestyle=n,this},t(function(){t(".filestyle").each(function(){var e=t(this),i={input:"false"!==e.attr("data-input"),icon:"false"!==e.attr("data-icon"),buttonBefore:"true"===e.attr("data-buttonBefore"),disabled:"true"===e.attr("data-disabled"),size:e.attr("data-size"),buttonText:e.attr("data-buttonText"),buttonName:e.attr("data-buttonName"),iconName:e.attr("data-iconName"),badge:"false"!==e.attr("data-badge"),placeholder:e.attr("data-placeholder")};e.filestyle(i)})})}(window.jQuery); \ No newline at end of file diff --git a/test/index.html b/test/index.html index dc1b5f1..c3c28d0 100644 --- a/test/index.html +++ b/test/index.html @@ -16,7 +16,7 @@ - +