Skip to content

Commit

Permalink
Updated the chosen plugin to the latest stable release
Browse files Browse the repository at this point in the history
  • Loading branch information
micmania1 committed Feb 22, 2014
1 parent 7cbd7ed commit a0d9f6b
Show file tree
Hide file tree
Showing 37 changed files with 6,469 additions and 5,588 deletions.
8 changes: 8 additions & 0 deletions admin/thirdparty/chosen/.gitignore
@@ -0,0 +1,8 @@
.DS_Store
node_modules
.project
dist/
public/*.js
public/*.css
chosen.zip
.sass-cache
8 changes: 0 additions & 8 deletions admin/thirdparty/chosen/.piston.yml

This file was deleted.

177 changes: 0 additions & 177 deletions admin/thirdparty/chosen/Cakefile

This file was deleted.

3 changes: 3 additions & 0 deletions admin/thirdparty/chosen/Gemfile
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem 'compass'
16 changes: 16 additions & 0 deletions admin/thirdparty/chosen/Gemfile.lock
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
chunky_png (1.2.8)
compass (0.12.2)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
fssm (0.2.10)
sass (3.2.9)

PLATFORMS
ruby

DEPENDENCIES
compass
129 changes: 129 additions & 0 deletions admin/thirdparty/chosen/Gruntfile.coffee
@@ -0,0 +1,129 @@
module.exports = (grunt) ->
version = ->
grunt.file.readJSON("package.json").version
version_tag = ->
"v#{version()}"

grunt.initConfig
pkg: grunt.file.readJSON("package.json")
comments: """
/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
Version <%= pkg.version %>
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
*/
\n
"""
minified_comments: "/* Chosen #{version_tag()} | (c) 2011-2013 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */\n"

concat:
options:
banner: "<%= comments %>"
jquery:
src: ["public/chosen.jquery.js"]
dest: "public/chosen.jquery.js"
proto:
src: ["public/chosen.proto.js"]
dest: "public/chosen.proto.js"
css:
src: ["public/chosen.css"]
dest: "public/chosen.css"

coffee:
options:
join: true
compile:
files:
'public/chosen.jquery.js': ['coffee/lib/select-parser.coffee', 'coffee/lib/abstract-chosen.coffee', 'coffee/chosen.jquery.coffee']
'public/chosen.proto.js': ['coffee/lib/select-parser.coffee', 'coffee/lib/abstract-chosen.coffee', 'coffee/chosen.proto.coffee']

uglify:
options:
mangle:
except: ['jQuery', 'AbstractChosen', 'Chosen', 'SelectParser']
banner: "<%= minified_comments %>"
minified_chosen_js:
files:
'public/chosen.jquery.min.js': ['public/chosen.jquery.js']
'public/chosen.proto.min.js': ['public/chosen.proto.js']

compass:
chosen_css:
options:
specify: ['sass/chosen.scss']

cssmin:
minified_chosen_css:
options:
banner: "<%= minified_comments %>"
keepSpecialComments: 0
src: 'public/chosen.css'
dest: 'public/chosen.min.css'

watch:
scripts:
files: ['coffee/**/*.coffee', 'sass/*.scss']
tasks: ['build']

copy:
dist:
files: [
{ cwd: "public", src: ["index.html", "index.proto.html", "chosen.jquery.js", "chosen.jquery.min.js", "chosen.proto.js", "chosen.proto.min.js", "chosen.css", "chosen-sprite.png", "chosen-sprite@2x.png"], dest: "dist/", expand: true, flatten: true, filter: 'isFile' }
{ src: ["public/docsupport/**"], dest: "dist/docsupport/", expand: true, flatten: true, filter: 'isFile' }
]

clean:
dist: ["dist/"]
chosen_zip: ["*.zip"]

build_gh_pages:
gh_pages: {}

dom_munger:
latest_version:
src: ['public/index.html', 'public/index.proto.html', 'public/options.html']
options:
callback: ($) ->
$("#latest-version").text(version_tag())
zip:
chosen:
cwd: 'public/'
src: ['public/**/*']
dest: "chosen_#{version_tag()}.zip"

grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-compass'
grunt.loadNpmTasks 'grunt-contrib-cssmin'
grunt.loadNpmTasks 'grunt-build-gh-pages'
grunt.loadNpmTasks 'grunt-zip'
grunt.loadNpmTasks 'grunt-dom-munger'

grunt.registerTask 'default', ['build']
grunt.registerTask 'build', ['coffee', 'compass', 'concat', 'uglify', 'cssmin']
grunt.registerTask 'gh_pages', ['copy:dist', 'build_gh_pages:gh_pages']
grunt.registerTask 'prep_release', ['build', 'dom_munger:latest_version', 'zip:chosen','package_jquery']

grunt.registerTask 'package_jquery', 'Generate a jquery.json manifest file from package.json', () ->
src = "package.json"
dest = "chosen.jquery.json"
pkg = grunt.file.readJSON(src)
json1 =
"name": pkg.name
"description": pkg.description
"version": version()
"licenses": pkg.licenses
json2 = pkg.jqueryJSON
json1[key] = json2[key] for key of json2
json1.author.name = pkg.author
grunt.file.write('chosen.jquery.json', JSON.stringify(json1, null, 2))
9 changes: 4 additions & 5 deletions admin/thirdparty/chosen/LICENSE.md
@@ -1,10 +1,9 @@
# Chosen, a Select Box Enhancer for jQuery and Protoype
## by Patrick Filler for [Harvest](http://getharvest.com)
#### Chosen
- by Patrick Filler for [Harvest](http://getharvest.com)
- Copyright (c) 2011-2013 by Harvest

Available for use under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)

Copyright (c) 2011 by Harvest

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand All @@ -21,4 +20,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.

0 comments on commit a0d9f6b

Please sign in to comment.