input-autogrow
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "input-autogrow", | ||
"version": "1.0.0", | ||
"description": "jQuery autogrow plugin for inputs", | ||
"version": "1.0.1", | ||
"description": "Autogrow plugin for inputs", | ||
"main": "dist/input-autogrow.min.js", | ||
@@ -18,2 +18,3 @@ "directories": { | ||
"jquery", | ||
"zepto", | ||
"javascript", | ||
@@ -23,3 +24,3 @@ "js" | ||
"author": "Weston Ganger", | ||
"license": "GNU GPL", | ||
"license": "MIT", | ||
"bugs": { | ||
@@ -26,0 +27,0 @@ "url": "https://github.com/westonganger/input-autogrow/issues" |
/* | ||
* input-autogrow - jQuery autogrow plugin for inputs | ||
* @version v1.0.0 | ||
* input-autogrow - Autogrow plugin for inputs | ||
* @version v1.0.1 | ||
* @link http://github.com/westonganger/input-autogrow | ||
* @license GNU GPL | ||
* @license MIT | ||
*/ | ||
!function(t){var a="oninput"in document.createElement("input")?"input":"keydown";t.fn.inputAutogrow=function(i){if(i&&("destroy"===i||t(this).data("autogrow-span"))&&(this.each(function(){var i=t(this);i.off(a+".autogrow autogrow change");var n=i.data("autogrow-span");n.remove(),i.data("autogrow-span","")}),"destroy"===i))return input.data("original-width",""),this;if(t(this).data("original-width"))var n=t(this).data("original-width");else{var n=t(this).width();t(this).data("original-width",n)}var o=t.extend({maxWidth:t(this).parent().width(),minWidth:n,trailingSpace:0},i);return this.each(function(){var n=t(this),e=" ",r=i&&"trailingSpace"in i?o.trailingSpace:parseInt(n.css("fontSize")),s=t("<span/>").css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:n.css("fontSize"),fontFamily:n.css("fontFamily"),fontWeight:n.css("fontWeight"),letterSpacing:n.css("letterSpacing"),textTransform:n.css("textTransform"),whiteSpace:"nowrap",ariaHidden:!0}).appendTo("body"),h=function(t){if(e!==(e=n.val())||"autogrow"===t.type){e||(e=n.attr("placeholder")||""),s.html(e.replace(/&/g,"&").replace(/\s/g," ").replace(/</g,"<").replace(/>/g,">"));var a=s.width()+r,i="function"==typeof o.maxWidth?o.maxWidth():o.maxWidth;a>i?a=i:a<o.minWidth&&(a=o.minWidth),a!=n.width()&&n.width(a)}};n.data("autogrow-span",s),n.off(a+".autogrow autogrow change").on(a+".autogrow autogrow change",h),h()}),this}}(jQuery); | ||
!function(t){var a="oninput"in document.createElement("input")?"input":"keydown";t.fn.inputAutogrow=function(i){if(i&&("destroy"===i||t(this).data("autogrow-span"))&&(this.each(function(){var i=t(this);i.off(a+".autogrow autogrow change");var n=i.data("autogrow-span");n.remove(),i.data("autogrow-span","")}),"destroy"===i))return input.data("original-width",""),this;if(t(this).data("original-width"))var n=t(this).data("original-width");else{var n=t(this).width();t(this).data("original-width",n)}var o=t.extend({maxWidth:t(this).parent().width(),minWidth:n,trailingSpace:0},i);return this.each(function(){var n=t(this),e=" ",r=i&&"trailingSpace"in i?o.trailingSpace:parseInt(n.css("fontSize")),s=t("<span/>").css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:n.css("fontSize"),fontFamily:n.css("fontFamily"),fontWeight:n.css("fontWeight"),letterSpacing:n.css("letterSpacing"),textTransform:n.css("textTransform"),whiteSpace:"nowrap",ariaHidden:!0}).appendTo("body"),h=function(t){if(e!==(e=n.val())||"autogrow"===t.type){e||(e=n.attr("placeholder")||""),s.html(e.replace(/&/g,"&").replace(/\s/g," ").replace(/</g,"<").replace(/>/g,">"));var a=s.width()+r,i="function"==typeof o.maxWidth?o.maxWidth():o.maxWidth;a>i?a=i:a<o.minWidth&&(a=o.minWidth),a!=n.width()&&n.width(a)}};n.data("autogrow-span",s),n.off(a+".autogrow autogrow change").on(a+".autogrow autogrow change",h),h()}),this}}(window.jQuery||window.Zepto||window.$); |
{ | ||
"name": "input-autogrow", | ||
"version": "1.0.0", | ||
"description": "jQuery autogrow plugin for inputs", | ||
"version": "1.0.1", | ||
"description": "Autogrow plugin for inputs", | ||
"main": "dist/input-autogrow.min.js", | ||
@@ -18,2 +18,3 @@ "directories": { | ||
"jquery", | ||
"zepto", | ||
"javascript", | ||
@@ -23,3 +24,3 @@ "js" | ||
"author": "Weston Ganger", | ||
"license": "GNU GPL", | ||
"license": "MIT", | ||
"bugs": { | ||
@@ -30,3 +31,2 @@ "url": "https://github.com/westonganger/input-autogrow/issues" | ||
"dependencies": { | ||
"jquery": ">=1.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "devDependencies": { |
# input-autogrow | ||
<a href='https://ko-fi.com/A5071NK' target='_blank'><img height='32' style='border:0px;height:32px;' src='https://az743702.vo.msecnd.net/cdn/kofi1.png?v=a' border='0' alt='Buy Me a Coffee' /></a> | ||
`input-autogrow` is a jQuery plugin for autogrowing inputs. This plugin is different from others because most usually target `textarea` tags, this library is instead targeted at `input` tags. | ||
`input-autogrow` is a plugin for autogrowing inputs. This plugin is different from others because most usually target `textarea` tags, this library is instead targeted at `input` tags. | ||
Requires a DOM library such as jQuery, Zepto, or any that support $.fn extending. | ||
# Install | ||
@@ -10,7 +12,7 @@ | ||
``` | ||
yarn add chosen-material-theme | ||
yarn add input-autogrow | ||
npm install chosen-material-theme | ||
npm install input-autogrow | ||
bower install chosen-material-theme | ||
bower install input-autogrow | ||
``` | ||
@@ -17,0 +19,0 @@ |
/* | ||
* input-autogrow - jQuery autogrow plugin for inputs | ||
* @version v1.0.0 | ||
* input-autogrow - Autogrow plugin for inputs | ||
* @version v1.0.1 | ||
* @link http://github.com/westonganger/input-autogrow | ||
* @license GNU GPL | ||
* @license MIT | ||
*/ | ||
@@ -85,4 +85,5 @@ | ||
}); | ||
return this; | ||
} | ||
}(jQuery)); | ||
}; | ||
}(window.jQuery || window.Zepto || window.$)); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
0
0
0
100
136
64
11340
- Removedjquery@>=1.0
- Removedjquery@3.7.1(transitive)