-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gulp for min build, move script to src folder, bump to v1.1.0
- Loading branch information
Showing
6 changed files
with
70 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "jquery.otherdropdown", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"authors": [ | ||
"TheBox193 <[email protected]>" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var gulp = require('gulp'); | ||
var uglify = require('gulp-uglify'); | ||
var rename = require('gulp-rename'); | ||
|
||
gulp.task('default', function() { | ||
return gulp.src('src/jquery.otherdropdown.js') | ||
.pipe(uglify({preserveComments: "some"})) | ||
.pipe(rename({ | ||
suffix: '.min' | ||
})) | ||
.pipe(gulp.dest('src')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "jquery.otherdropdown", | ||
"version": "1.0.2", | ||
"description": "A dropdown select box where choosing 'other' prompts the user for an alternate response.", | ||
"main": "jquery.otherdropdown.js", | ||
"scripts": { | ||
"test": "" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/TheBox193/jquery.otherdropdown.git" | ||
}, | ||
"keywords": [ | ||
"other", | ||
"select", | ||
"dropdown", | ||
"text", | ||
"input", | ||
"option", | ||
"textbox" | ||
], | ||
"author": "Jonathan Stassen", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/TheBox193/jquery.otherdropdown/issues" | ||
}, | ||
"homepage": "https://github.com/TheBox193/jquery.otherdropdown#readme", | ||
"devDependencies": { | ||
"gulp": "^3.9.0", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-uglify": "^1.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* @license | ||
* @name jquery.otherdropdown | ||
* @description A small jQuery plugin to support a text area when selecting an 'Other' option in a dropdown | ||
* @version 1.1.0 | ||
* @author Jonathan Stassen <jstassen.com> | ||
* @see https://github.com/TheBox193/jquery.otherdropdown | ||
*/ | ||
$.fn.otherDropdown=function(e){var a=this,l=$.extend({},{value:"other"},e);l.name_lower=l.value.toLowerCase(),l.name_upper=l.value.charAt(0).toUpperCase()+l.value.slice(1),l.placeholder=l.placeholder||l.name_upper,a.change(function(e){(this.value===l.name_lower||this.value===l.name_upper)&&(a.hide().after(r),r.focus())});var r=$('<input type="text" class="otherdropdown" placeholder="'+l.placeholder+'" />');l.classes&&r.addClass(l.classes),r.blur(function(e){var r=this.value;if(this.value="",this.remove(),a.show(),""!==r&&r!==l.name_lower&&r!==l.name_upper){var o=a.children('[value="'+r+'"]');if(o.length<1){var n=$('<option value="'+r+'">'+r+"</option>");a.append(n)}a.val(r)}})}; |