diff --git a/src/jquery-filestyle.css b/src/jquery-filestyle.css
index aa71e99..c8ec4ed 100644
--- a/src/jquery-filestyle.css
+++ b/src/jquery-filestyle.css
@@ -1,6 +1,7 @@
/*
* jquery-filestyle
- * http://dev.tudosobreweb.com.br/jquery-filestyle/
+ * doc: http://markusslima.github.io/jquery-filestyle/
+ * github: https://github.com/markusslima/jquery-filestyle
*
* Copyright (c) 2015 Markus Vinicius da Silva Lima
* Version 1.5.0
diff --git a/src/jquery-filestyle.js b/src/jquery-filestyle.js
index 44671d1..fb9722f 100644
--- a/src/jquery-filestyle.js
+++ b/src/jquery-filestyle.js
@@ -4,7 +4,7 @@
* github: https://github.com/markusslima/jquery-filestyle
*
* Copyright (c) 2015 Markus Vinicius da Silva Lima
- * Version 1.4.0
+ * Version 1.5.0
* Licensed under the MIT license.
*/
(function ($) {
@@ -74,22 +74,6 @@
}
},
- icon: function (value) {
- if (value === true) {
- if (!this.options.icon) {
- this.options.icon = true;
- this.$elementjFilestyle.find('label').prepend(this.htmlIcon());
- }
- } else if (value === false) {
- if (this.options.icon) {
- this.options.icon = false;
- this.$elementjFilestyle.find('i').remove();
- }
- } else {
- return this.options.icon;
- }
- },
-
input: function (value) {
if (value === true) {
if (!this.options.input) {
@@ -122,45 +106,28 @@
return this.options.buttonText;
}
},
-
- iconName: function (value) {
- if (value !== undefined) {
- this.options.iconName = value;
- if (this.options.theme.search(/blue|green|red|orange|black/i) !== -1) {
- this.$elementjFilestyle.find('label').find('i').attr({'class': 'icon-white '+this.options.iconName});
- } else {
- this.$elementjFilestyle.find('label').find('i').attr({'class': this.options.iconName});
- }
- } else {
- return this.options.iconName;
- }
- },
-
- size: function (value) {
+
+ inputSize: function (value) {
if (value !== undefined) {
- this.options.size = value;
- this.$elementjFilestyle.find(':text').css('width', this.options.size);
+ this.options.inputSize = value;
+ this.$elementjFilestyle.find(':text').css('width', this.options.inputSize);
} else {
- return this.options.size;
- }
- },
-
- htmlIcon: function () {
- if (this.options.icon) {
- var colorIcon = '';
- if (this.options.theme.search(/blue|green|red|orange|black/i) !== -1) {
- colorIcon = ' icon-white ';
- }
-
- return ' ';
- } else {
- return '';
+ return this.options.inputSize;
}
},
+
+ placeholder : function(value) {
+ if (value !== undefined) {
+ this.options.placeholder = value;
+ this.$elementjFilestyle.find(':text').attr('placeholder', value);
+ } else {
+ return this.options.placeholder;
+ }
+ },
htmlInput: function () {
if (this.options.input) {
- return ' ';
+ return ' ';
} else {
return '';
}
@@ -199,14 +166,14 @@
files = [];
if (id === '' || !id) {
- id = 'jfilestyle-'+$('.jfilestyle').length;
+ id = 'jfilestyle-' + nextId;
_self.$element.attr({'id': id});
+ nextId++;
}
html = ''+
''+
'';
@@ -295,11 +262,9 @@
$.fn.jfilestyle.defaults = {
'buttonText': 'Choose file',
'input': true,
- 'iconName': 'icon-folder-open',
- 'icon': true,
'disabled': false,
'buttonBefore': false,
- 'size': '200px',
+ 'inputSize': '200px',
'theme': '',
'placeholder': ''
};
@@ -315,12 +280,10 @@
var $this = $(this),
options = {
'buttonText': $this.attr('data-buttonText'),
- 'iconName': $this.attr('data-iconName'),
- 'icon': $this.attr('data-icon') === 'false' ? false : true,
'input': $this.attr('data-input') === 'false' ? false : true,
'disabled': $this.attr('data-disabled') === 'true' ? true : false,
'buttonBefore': $this.attr('data-buttonBefore') === 'true' ? true : false,
- 'size': $this.attr('data-size'),
+ 'inputSize': $this.attr('data-inputSize'),
'theme': $this.attr('data-theme'),
'placeholder': $this.attr('data-placeholder')
};