├── .gitignore ├── README.md ├── jquery ├── spec.js ├── package.json ├── Gruntfile.js └── README.md ├── at ├── spec.js ├── package.json ├── Gruntfile.js └── README.md ├── _tasks └── download │ ├── package.json │ └── tasks │ └── download.js ├── caret ├── spec.js ├── package.json ├── Gruntfile.js └── README.md ├── easing ├── spec.js ├── package.json └── Gruntfile.js ├── select2 ├── spec.js ├── package.json ├── Gruntfile.js └── README.md ├── spectrum ├── spec.js ├── package.json ├── Gruntfile.js └── README.md ├── datatables ├── spec.js ├── README.md ├── package.json └── Gruntfile.js ├── treetable ├── spec.js ├── README.md ├── package.json └── Gruntfile.js ├── handsontable ├── spec.js ├── Gruntfile.js └── package.json ├── blueimp-file-upload ├── spec.js ├── Gruntfile.js ├── package.json └── README.md ├── color ├── spec.js ├── package.json ├── Gruntfile.js └── README.md ├── package.json ├── tablesorter ├── spec.js ├── package.json └── Gruntfile.js ├── index.html └── Gruntfile.js /.gitignore: -------------------------------------------------------------------------------- 1 | _tests/ 2 | dist/ 3 | src/ 4 | node_modules/ 5 | sea-modules/ 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 引入 CMD 模块指南 2 | 3 | 见 https://github.com/cmdjs/gallery#gallery -------------------------------------------------------------------------------- /jquery/spec.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | var module = require('./dist/jquery'); 3 | describe('jquery', function() { 4 | it('should has ajax method', function() { 5 | expect(module.ajax).to.be.a('function'); 6 | }); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /at/spec.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 3 | describe('at.js', function() { 4 | 5 | it('should has atwho method', function() { 6 | require('./dist/atwho'); 7 | var $ = require('$'); 8 | expect($.fn.atwho).to.be.a('function'); 9 | }); 10 | }); 11 | 12 | }); 13 | -------------------------------------------------------------------------------- /_tasks/download/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "download", 3 | "description": "grunt tasks for download.", 4 | "version": "0.1.1a1", 5 | "author": { 6 | "name": "Hsiaoming Yang", 7 | "email": "lepture@me.com" 8 | }, 9 | "dependencies": { 10 | "request": "~2.12.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /caret/spec.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 3 | describe('caret.js', function() { 4 | 5 | it('should has caret method', function() { 6 | require('./dist/caret'); 7 | var $ = require('$'); 8 | expect($.fn.caret).to.be.a('function'); 9 | }); 10 | }); 11 | 12 | }); 13 | -------------------------------------------------------------------------------- /easing/spec.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 3 | var $ = require("$"); 4 | require('./dist/easing'); 5 | 6 | describe('easing', function() { 7 | it('should has easing name swing', function() { 8 | expect($.easing.swing).to.be.a('function'); 9 | }); 10 | }); 11 | 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /select2/spec.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 3 | var $ = require("$"); 4 | var Select2 = require('./dist/select2'); 5 | 6 | describe('select2', function() { 7 | it('should has select2 method', function() { 8 | expect($.fn.select2).to.be.a('function'); 9 | }); 10 | }); 11 | 12 | }); 13 | -------------------------------------------------------------------------------- /spectrum/spec.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 3 | var $ = require("$"); 4 | var Spectrum = require('./dist/spectrum'); 5 | 6 | describe('Spectrum', function() { 7 | it('should has spectrum method', function() { 8 | expect($.fn.spectrum).to.be.a('function'); 9 | }); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /datatables/spec.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 3 | describe('datatables', function() { 4 | it('should has dataTable method', function() { 5 | var $ = require('$'); 6 | require('./dist/datatables'); 7 | expect($.fn.dataTable).to.be.a('function'); 8 | }); 9 | }); 10 | 11 | }); 12 | -------------------------------------------------------------------------------- /datatables/README.md: -------------------------------------------------------------------------------- 1 | # dataTables 2 | 3 | ## 使用 4 | 5 | ``` 6 | require('dataTables'); 7 | var $ = require('$'); 8 | $('xxx').dataTables(); 9 | ``` 10 | 11 | 或者 12 | 13 | ``` 14 | seajs.use(['$', 'dataTables'], function($){ 15 | $('xxx').dataTables(); 16 | }); 17 | ``` 18 | 19 | ## 文档 20 | 21 | [http://www.datatables.net/](http://www.datatables.net/) -------------------------------------------------------------------------------- /treetable/spec.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 3 | var $ = require("$"); 4 | var Treetable = require('./dist/treetable'); 5 | 6 | describe('Treetable', function() { 7 | it('should has treetable method', function() { 8 | expect($.fn.treetable).to.be.a('function'); 9 | expect(Treetable.Tree).to.be.a('function'); 10 | }); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /handsontable/spec.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 3 | var $ = require("$"); 4 | require('./dist/handsontable'); 5 | 6 | describe('handsontable', function() { 7 | it('should has handsontable method', function() { 8 | expect($.fn.handsontable).to.be.a('function'); 9 | expect($.support.htmlMenuitem).to.be.a('boolean'); 10 | }); 11 | }); 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /blueimp-file-upload/spec.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 3 | var $ = require("$"); 4 | require('./dist/fileupload'); 5 | require('./dist/iframe-transport'); 6 | 7 | describe('fileupload', function() { 8 | it('should has some methods', function() { 9 | expect($.widget).to.be.a('function'); 10 | expect($.fn.fileupload).to.be.a('function'); 11 | }); 12 | }); 13 | 14 | }); 15 | -------------------------------------------------------------------------------- /color/spec.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 3 | var $ = require('$'); 4 | 5 | describe('color', function() { 6 | it('should has no color method', function() { 7 | expect($).to.not.have.property('Color'); 8 | }); 9 | 10 | it('should has color method', function() { 11 | require('./dist/color'); 12 | console.log($); 13 | expect($.Color).to.be.a('function'); 14 | }); 15 | }); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-family", 3 | "version": "1.0.0", 4 | "description": "jquery and its family members", 5 | "dependencies": { 6 | "seajs": "*", 7 | "mocha": "*", 8 | "expect.js": "*", 9 | "request": "*", 10 | "grunt": "*", 11 | "semver": "*", 12 | "async": "*" 13 | }, 14 | "spm": { 15 | "engines": { 16 | "jquery": "jquery/jquery/1.7.2/jquery", 17 | "seajs": "seajs/seajs/2.1.1/sea" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tablesorter/spec.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 3 | describe('tablesorter', function() { 4 | it('should has no tablesorter method', function() { 5 | var $ = require('$'); 6 | expect($.fn).to.not.have.property('tablesorter'); 7 | }); 8 | 9 | it('should has tablesorter method', function() { 10 | require('./src/tablesorter'); 11 | var $ = require('$'); 12 | expect($.fn.tablesorter).to.be.a('function'); 13 | }); 14 | }); 15 | 16 | }); 17 | -------------------------------------------------------------------------------- /easing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "family": "jquery", 3 | "name" : "jquery-easing", 4 | "version" : "1.3.0", 5 | "description" : "jQuery Easing", 6 | "homepage" : "http://gsgd.co.uk/sandbox/jquery/easing", 7 | "dependencies" : { 8 | "jquery" : ">= 1.7.x" 9 | }, 10 | "keywords" : [ 11 | "jquery", 12 | "easing" 13 | ], 14 | "author" : { 15 | "name" : "George McGinley Smith", 16 | "web" : "http://gsgd.co.uk/freelance" 17 | }, 18 | 19 | "repository": { 20 | "type": "git", 21 | "url": "git://github.com/danro/jquery-easing.git" 22 | }, 23 | "spm": { 24 | "alias": { 25 | "$": "$" 26 | }, 27 | "output": ["easing.js"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /jquery/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "family": "jquery", 4 | "description": "JavaScript library for DOM operations", 5 | "version": "2.1.0", 6 | "package": "https://raw.github.com/jquery/jquery/master/package.json", 7 | "homepage": "http://jquery.com", 8 | "author": { 9 | "name": "jQuery Foundation and other contributors", 10 | "url": "https://github.com/jquery/jquery/blob/master/AUTHORS.txt" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/jquery/jquery.git" 15 | }, 16 | "bugs": { 17 | "url": "http://bugs.jquery.com" 18 | }, 19 | "licenses": [{ 20 | "type": "MIT", 21 | "url": "https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt" 22 | }], 23 | "spm": { 24 | "output": ["jquery.js"] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /at/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "family": "jquery", 3 | "name": "at", 4 | "version": "0.4.9", 5 | "package": "https://github.com/ichord/At.js/blob/master/package.json", 6 | "description": "Add Github like mentions autocomplete to your application.", 7 | "homepage": "https://github.com/ichord/At.js", 8 | "author": "Harold.luo ", 9 | "maintainers": [{ 10 | "name": "Harold.luo", 11 | "url": "https://github.com/ichord", 12 | "email": "chord.luo@gmail.com" 13 | }], 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/ichord/at.js" 17 | }, 18 | "bugs": "https://github.com/ichord/at.js/issues", 19 | "licenses": [{ 20 | "type": "MIT", 21 | "url": "http://www.opensource.org/licenses/mit-license.php" 22 | }], 23 | "keywords": [], 24 | "spm": { 25 | "alias": { 26 | "$": "$", 27 | "caret": "jquery/caret/0.0.8/caret" 28 | }, 29 | "output": ["atwho.js", "atwho.css"] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /caret/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "family": "jquery", 3 | "name": "caret", 4 | "version": "0.0.8", 5 | "package": "https://github.com/ichord/Caret.js/blob/master/package.json", 6 | "description": "Get caret position and offset from inputor", 7 | "homepage": "https://github.com/ichord/Caret.js", 8 | "author": "Harold.luo ", 9 | "maintainers": [{ 10 | "name": "Harold.luo", 11 | "url": "https://github.com/ichord", 12 | "email": "chord.luo@gmail.com" 13 | }], 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/ichord/Caret.js" 17 | }, 18 | "bugs": "https://github.com/ichord/Caret.js/issues", 19 | "licenses": [{ 20 | "type": "MIT", 21 | "url": "http://www.opensource.org/licenses/mit-license.php" 22 | }], 23 | "keywords": [ 24 | "jquery", 25 | "caret", 26 | "offset", 27 | "position" 28 | ], 29 | "spm": { 30 | "alias": { 31 | "$": "$" 32 | }, 33 | "output": { 34 | "caret.js": "." 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /treetable/README.md: -------------------------------------------------------------------------------- 1 | # jQuery treetable 2 | 3 | jQuery treetable is a plugin for jQuery, the 'Write Less, Do More, JavaScript 4 | Library'. With this plugin you can display a tree in an HTML table, e.g. a 5 | directory structure or a nested list. Why not use a list, you say? Because lists 6 | are great for displaying a tree, and tables are not. Oh wait, but this plugin 7 | uses tables, doesn't it? Yes. Why do I use a table to display a list? Because I 8 | need multiple columns to display additional data besides the tree. 9 | 10 | Download the latest release from the jQuery Plugin Registry or grab the source 11 | code from Github. Please report issues through Github issues. This plugin is 12 | released under both the MIT and the GPLv2 license by Ludo van den Boom. 13 | 14 | ## Documentation and Examples 15 | 16 | See index.html for technical documentation and examples. The most recent version 17 | of this document is also available online at 18 | http://ludo.cubicphuse.nl/jquery-treetable. An AJAX enabled example built with 19 | Ruby on Rails can be found at 20 | https://github.com/ludo/jquery-treetable-ajax-example. 21 | -------------------------------------------------------------------------------- /easing/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var pkg = grunt.file.readJSON('package.json'); 3 | 4 | grunt.initConfig({ 5 | pkg: pkg, 6 | 7 | download: { 8 | options: { 9 | dest: 'src' 10 | }, 11 | js: { 12 | options: { 13 | transform: function(code) { 14 | return [ 15 | "define(function(require, exports, module) {", 16 | "var jQuery = require('$');", 17 | code, 18 | "});" 19 | ].join('\n'); 20 | } 21 | }, 22 | url: 'https://raw.github.com/danro/jquery-easing/master/jquery.easing.js', 23 | name: 'easing.js' 24 | } 25 | } 26 | }); 27 | 28 | grunt.loadGlobalTasks('spm-build'); 29 | grunt.util._.merge(grunt.config.data, require('spm-build').config); 30 | 31 | grunt.loadTasks('../_tasks/download/tasks'); 32 | grunt.registerTask('build', ['download', 'spm-build']); 33 | 34 | }; 35 | -------------------------------------------------------------------------------- /color/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "family": "jquery", 3 | "name": "color", 4 | "version": "2.1.2", 5 | "package": "https://raw.github.com/jquery/jquery-color/master/package.json", 6 | "description": "jQuery plugin for color manipulation and animation support.", 7 | "homepage": "https://github.com/jquery/jquery-color", 8 | "author": { 9 | "name": "jQuery Foundation and other contributors", 10 | "url": "https://github.com/jquery/jquery-color/blob/master/AUTHORS.txt" 11 | }, 12 | "maintainers": [ 13 | { 14 | "name": "Corey Frang", 15 | "email": "gnarf37@gmail.com", 16 | "url": "http://gnarf.net" 17 | } 18 | ], 19 | "repository": { 20 | "type": "git", 21 | "url": "git://github.com/jquery/jquery-color.git" 22 | }, 23 | "bugs": "https://github.com/jquery/jquery-color/issues", 24 | "licenses": [ 25 | { 26 | "type": "MIT", 27 | "url": "https://github.com/jquery/jquery-color/blob/master/MIT-LICENSE.txt" 28 | } 29 | ], 30 | "keywords": [ "color", "animation" ], 31 | "spm": { 32 | "alias": { 33 | "$": "$" 34 | }, 35 | "output": [ 36 | "color.js" 37 | ] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /datatables/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "datatables", 3 | "family": "jquery", 4 | "description": "DataTables enhances HTML tables with the ability to sort, filter and page the data in the table very easily. It provides a comprehensive API and set of configuration options, allowing you to consume data from virtually any data source.", 5 | "version": "1.9.4", 6 | "package": "https://raw.github.com/DataTables/DataTables/master/package.json", 7 | "homepage": "http://www.datatables.net/", 8 | "author": { 9 | "name": "Allan Jardine", 10 | "url": "http://sprymedia.co.uk" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/DataTables/DataTables.git" 15 | }, 16 | "bugs": { 17 | "url": "https://github.com/DataTables/DataTables.git" 18 | }, 19 | "licenses": [ 20 | { 21 | "type": "BSD", 22 | "url": "http://datatables.net/license_bsd" 23 | }, 24 | { 25 | "type": "GPLv2", 26 | "url": "http://datatables.net/license_gpl2" 27 | } 28 | ], 29 | "spm": { 30 | "alias": { 31 | "$": "$" 32 | }, 33 | "output": [ 34 | "datatables.js" 35 | ] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spectrum/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "family": "jquery", 3 | "name": "spectrum", 4 | "version": "1.3.4", 5 | "title": "Spectrum Colorpicker", 6 | "description": "The No Hassle jQuery Colorpicker", 7 | "docs": "http://bgrins.github.com/spectrum", 8 | "homepage": "http://bgrins.github.com/spectrum", 9 | "demo": "http://jsfiddle.net/bgrins/ctkY3/", 10 | "author": { 11 | "name" : "Brian Grinstead", 12 | "email" : "briangrinstead@gmail.com", 13 | "url" : "http://briangrinstead.com/" 14 | }, 15 | "keywords": [ 16 | "color", 17 | "colorpicker", 18 | "ui" 19 | ], 20 | "licenses": [ 21 | { 22 | "type": "MIT", 23 | "url": "https://github.com/bgrins/spectrum/blob/master/LICENSE" 24 | } 25 | ], 26 | "dependencies": { 27 | "jquery": ">=1.7.2" 28 | }, 29 | "repository": { 30 | "type": "git", 31 | "url": "git://github.com/bgrins/spectrum.git" 32 | }, 33 | "spm": { 34 | "alias": { 35 | "$": "$" 36 | }, 37 | "output": [ 38 | "spectrum.css", "spectrum.js" 39 | ] 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /caret/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var pkg = grunt.file.readJSON('package.json'); 3 | 4 | grunt.initConfig({ 5 | pkg: pkg, 6 | 7 | download: { 8 | options: { 9 | dest: 'src' 10 | }, 11 | js: { 12 | options: { 13 | transform: function(code) { 14 | return [ 15 | 'define(function(require, exports, module) {', 16 | "var jQuery = require('$');", 17 | code.replace('window.jQuery', 'jQuery'), 18 | "});" 19 | ].join('\n'); 20 | } 21 | }, 22 | url: 'https://raw.github.com/ichord/Caret.js/v<%= pkg.version%>/src/jquery.caret.js', 23 | name: 'caret.js' 24 | } 25 | } 26 | }); 27 | 28 | var config = require('spm-build').config; 29 | grunt.loadGlobalTasks('spm-build'); 30 | grunt.util._.merge(grunt.config.data, config); 31 | 32 | grunt.loadTasks('../_tasks/download/tasks'); 33 | grunt.registerTask('build', ['download', 'spm-build']); 34 | }; 35 | -------------------------------------------------------------------------------- /color/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var pkg = grunt.file.readJSON('package.json'); 3 | 4 | grunt.initConfig({ 5 | pkg: pkg, 6 | 7 | download: { 8 | options: { 9 | dest: 'dist', 10 | }, 11 | src: { 12 | options: { 13 | header: [ 14 | 'define("<%= pkg.family %>/<%= pkg.name %>/<%= pkg.version %>/color-debug", ["$-debug"], function(require) {', 15 | ' var jQuery = require("$-debug"); ' 16 | ].join('\n'), 17 | footer: '});' 18 | }, 19 | url: 'http://code.jquery.com/color/jquery.color-<%= pkg.version %>.js', 20 | name: 'color-debug.js' 21 | }, 22 | min: { 23 | options: { 24 | header: [ 25 | 'define("<%= pkg.family %>/<%= pkg.name %>/<%= pkg.version %>/color", ["$"], function(require) {', 26 | ' var jQuery = require("$"); ' 27 | ].join('\n'), 28 | footer: '});' 29 | }, 30 | url: 'http://code.jquery.com/color/jquery.color-<%= pkg.version %>.min.js', 31 | name: 'color.js' 32 | } 33 | } 34 | }); 35 | 36 | grunt.loadTasks('../_tasks/download/tasks'); 37 | grunt.registerTask('build', ['download']); 38 | 39 | }; 40 | -------------------------------------------------------------------------------- /datatables/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var pkg = grunt.file.readJSON('package.json'); 3 | 4 | grunt.initConfig({ 5 | pkg: pkg, 6 | 7 | download: { 8 | options: { 9 | dest: 'dist', 10 | }, 11 | src: { 12 | options: { 13 | header: [ 14 | 'define("<%= pkg.family %>/<%= pkg.name %>/<%= pkg.version %>/datatables-debug", ["$-debug"], function(require) {', 15 | ' var jQuery = require("$-debug"); ' 16 | ].join('\n'), 17 | footer: '});' 18 | }, 19 | url: 'http://ajax.aspnetcdn.com/ajax/jquery.dataTables/<%= pkg.version %>/jquery.dataTables.js', 20 | name: 'datatables-debug.js' 21 | }, 22 | min: { 23 | options: { 24 | header: [ 25 | 'define("<%= pkg.family %>/<%= pkg.name %>/<%= pkg.version %>/datatables", ["$"], function(require) {', 26 | ' var jQuery = require("$"); ' 27 | ].join('\n'), 28 | footer: '});' 29 | }, 30 | url: 'http://ajax.aspnetcdn.com/ajax/jquery.dataTables/<%= pkg.version %>/jquery.dataTables.min.js', 31 | name: 'datatables.js' 32 | } 33 | } 34 | }); 35 | 36 | grunt.loadTasks('../_tasks/download/tasks'); 37 | grunt.registerTask('build', ['download']); 38 | 39 | }; 40 | -------------------------------------------------------------------------------- /jquery/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var pkg = grunt.file.readJSON('package.json'); 3 | 4 | function repl(code, filename) { 5 | var id = pkg.family + '/' + pkg.name + '/' + pkg.version + '/' + filename; 6 | code = code.replace(/&&\s*define\.amd\s*(&&\s*define\.amd\.jQuery)?/, ''); 7 | code = code.replace(/&&\s*define\.amd\s*/, ''); 8 | code = code.replace(/define\(\s*"jquery/, 'define("' + id); 9 | code = code + '\n;$.noConflict();\n'; 10 | return code; 11 | } 12 | 13 | grunt.initConfig({ 14 | pkg: pkg, 15 | 16 | download: { 17 | options: { 18 | dest: 'dist', 19 | }, 20 | src: { 21 | options: { 22 | transform: function(code) { 23 | return repl(code, 'jquery-debug'); 24 | } 25 | }, 26 | url: 'http://code.jquery.com/jquery-<%= pkg.version %>.js', 27 | name: 'jquery-debug.js' 28 | }, 29 | min: { 30 | options: { 31 | transform: function(code) { 32 | return repl(code, 'jquery'); 33 | } 34 | }, 35 | url: 'http://code.jquery.com/jquery-<%= pkg.version %>.min.js', 36 | name: 'jquery.js' 37 | } 38 | } 39 | }); 40 | 41 | grunt.loadTasks('../_tasks/download/tasks'); 42 | grunt.registerTask('build', ['download']); 43 | 44 | }; 45 | -------------------------------------------------------------------------------- /handsontable/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var pkg = grunt.file.readJSON('package.json'); 3 | 4 | grunt.initConfig({ 5 | pkg: pkg, 6 | 7 | download: { 8 | options: { 9 | dest: 'src' 10 | }, 11 | js: { 12 | options: { 13 | transform: function(code) { 14 | return [ 15 | 'define(function(require, exports, module) {', 16 | "var jQuery = require('$');", 17 | code, 18 | "});" 19 | ].join('\n'); 20 | } 21 | }, 22 | url: 'https://raw.github.com/warpech/jquery-handsontable/v<%= pkg.version%>/dist/jquery.handsontable.full.js', 23 | name: 'handsontable.js' 24 | }, 25 | css: { 26 | url: 'https://raw.github.com/warpech/jquery-handsontable/v<%= pkg.version%>/dist/jquery.handsontable.full.css', 27 | name: "handsontable.css" 28 | } 29 | } 30 | }); 31 | 32 | grunt.loadGlobalTasks('spm-build'); 33 | grunt.util._.merge(grunt.config.data, require('spm-build').config); 34 | 35 | grunt.loadTasks('../_tasks/download/tasks'); 36 | grunt.registerTask('build', ['download', 'spm-build']); 37 | 38 | }; 39 | -------------------------------------------------------------------------------- /handsontable/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "family": "jquery", 3 | "root": "jquery", 4 | "name": "handsontable", 5 | "title": "Handsontable", 6 | "version": "0.9.12", 7 | "author": { 8 | "name": "Marcin Warpechowski", 9 | "email": "marcin@nextgen.pl", 10 | "url": "http://www.nextgen.pl/" 11 | }, 12 | "licenses": [ 13 | { 14 | "type": "MIT", 15 | "url": "https://raw.github.com/warpech/jquery-handsontable/master/LICENSE" 16 | } 17 | ], 18 | "description": "Minimalistic spreadsheet-like data grid editor that provides copy/paste functionality compatible with Excel/Google Docs", 19 | "homepage": "http://handsontable.com/", 20 | "docs": "https://github.com/warpech/jquery-handsontable", 21 | "demo": "http://handsontable.com/", 22 | "download": "https://github.com/warpech/jquery-handsontable/archive/master.zip", 23 | "keywords": [ 24 | "grid", 25 | "datagrid", 26 | "table", 27 | "ui", 28 | "input", 29 | "ajax", 30 | "handsontable", 31 | "spreadsheet" 32 | ], 33 | "bugs": "https://github.com/warpech/jquery-handsontable/issues", 34 | "dependencies": { 35 | "jquery": ">=1.7", 36 | "bootstrap-typeahead.js": "2.1.1", 37 | "contextMenu": ">=1.5.25" 38 | }, 39 | "repository": { 40 | "type": "git", 41 | "url": "git://github.com/warpech/jquery-handsontable.git" 42 | }, 43 | "spm": { 44 | "alias": { 45 | "$": "$" 46 | }, 47 | "output": ["handsontable.js", "handsontable.css"] 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /select2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "family": "jquery", 3 | "name": "select2", 4 | "title": "Select2", 5 | "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.", 6 | "keywords": [ 7 | "select", 8 | "autocomplete", 9 | "typeahead", 10 | "dropdown", 11 | "multiselect", 12 | "tag", 13 | "tagging" 14 | ], 15 | "version": "3.4.6", 16 | "author": { 17 | "name": "Igor Vaynberg", 18 | "url": "https://github.com/ivaynberg" 19 | }, 20 | "licenses": [ 21 | { 22 | "type": "Apache", 23 | "url": "http://www.apache.org/licenses/LICENSE-2.0" 24 | }, 25 | { 26 | "type": "GPL v2", 27 | "url": "http://www.gnu.org/licenses/gpl-2.0.html" 28 | } 29 | ], 30 | "bugs": "https://github.com/ivaynberg/select2/issues", 31 | "homepage": "http://ivaynberg.github.com/select2", 32 | "docs": "http://ivaynberg.github.com/select2/", 33 | "download": "https://github.com/ivaynberg/select2/tags", 34 | "dependencies": { 35 | "jquery": ">=1.7.1" 36 | }, 37 | "repository": { 38 | "type": "git", 39 | "url": "git://github.com/ivaynberg/select2.git" 40 | }, 41 | "spm": { 42 | "alias": { 43 | "$": "$" 44 | }, 45 | "output": ["select2.js", "select2-zh-cn.js", "select2.css"] 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /spectrum/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var pkg = grunt.file.readJSON('package.json'); 3 | 4 | grunt.initConfig({ 5 | pkg: pkg, 6 | 7 | download: { 8 | options: { 9 | dest: 'src' 10 | }, 11 | js: { 12 | options: { 13 | transform: function(code) { 14 | return [ 15 | 'define(function(require, exports, module) {', 16 | "var jQuery = require('$');", 17 | code, 18 | "});" 19 | ].join('\n'); 20 | } 21 | }, 22 | url: 'https://raw.github.com/bgrins/spectrum/<%= pkg.version%>/spectrum.js', 23 | name: 'spectrum.js' 24 | }, 25 | css: { 26 | options: { 27 | transform: function(code) { 28 | return code.replace(/\.\.\/images\//g, './'); 29 | } 30 | }, 31 | url: 'https://raw.github.com/bgrins/spectrum/<%= pkg.version%>/spectrum.css', 32 | name: "spectrum.css" 33 | } 34 | } 35 | }); 36 | 37 | grunt.loadGlobalTasks('spm-build'); 38 | grunt.util._.merge(grunt.config.data, require('spm-build').config); 39 | 40 | grunt.loadTasks('../_tasks/download/tasks'); 41 | grunt.registerTask('build', ['download', 'spm-build']); 42 | 43 | }; 44 | -------------------------------------------------------------------------------- /treetable/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "family": "jquery", 3 | "name": "treetable", 4 | "title": "jQuery treetable", 5 | "description": "jQuery plugin for displaying a tree structure in a (HTML) table, i.e. a directory structure or a nested list.", 6 | "keywords": [ 7 | "explorer", 8 | "file", 9 | "table", 10 | "tree", 11 | "ui" 12 | ], 13 | "version": "3.1.0", 14 | "author": { 15 | "name": "Ludo van den Boom", 16 | "url": "http://ludovandenboom.com" 17 | }, 18 | "maintainers": [ 19 | { 20 | "name": "Ludo van den Boom", 21 | "url": "http://ludovandenboom.com" 22 | } 23 | ], 24 | "licenses": [ 25 | { 26 | "type": "GPLv2", 27 | "url": "https://github.com/ludo/jquery-treetable/blob/3.0.2/GPL-LICENSE.txt" 28 | }, 29 | { 30 | "type": "MIT", 31 | "url": "https://github.com/ludo/jquery-treetable/blob/3.0.2/MIT-LICENSE.txt" 32 | } 33 | ], 34 | "bugs": "https://github.com/ludo/jquery-treetable/issues", 35 | "homepage": "https://github.com/ludo/jquery-treetable", 36 | "docs": "http://ludo.cubicphuse.nl/jquery-treetable/", 37 | "dependencies": { 38 | "jquery": ">=1.6" 39 | }, 40 | "repository": { 41 | "type": "git", 42 | "url": "git://github.com/ludo/jquery-treetable.git" 43 | }, 44 | "spm": { 45 | "alias": { 46 | "$": "$" 47 | }, 48 | "output": ["treetable.js", "treetable.css", "treetable.theme.default.css"] 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /blueimp-file-upload/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var pkg = grunt.file.readJSON('package.json'); 3 | 4 | grunt.initConfig({ 5 | pkg: pkg, 6 | 7 | download: { 8 | options: { 9 | dest: 'src' 10 | }, 11 | widget: { 12 | options: { 13 | transform: function(code) { 14 | return code.replace(' && define.amd', ''); 15 | } 16 | }, 17 | url: 'https://raw.github.com/blueimp/jQuery-File-Upload/<%= pkg.version %>/js/vendor/jquery.ui.widget.js', 18 | name: 'jquery.ui.widget.js' 19 | }, 20 | fileupload: { 21 | options: { 22 | transform: function(code) { 23 | code = code.replace(' && define.amd', ''); 24 | code = code.replace('jquery.ui.widget', './jquery.ui.widget'); 25 | return code; 26 | } 27 | }, 28 | url: 'https://raw.github.com/blueimp/jQuery-File-Upload/<%= pkg.version %>/js/jquery.fileupload.js', 29 | name: 'fileupload.js' 30 | }, 31 | iframe: { 32 | options: { 33 | transform: function(code) { 34 | return code.replace(' && define.amd', ''); 35 | } 36 | }, 37 | url: 'https://raw.github.com/blueimp/jQuery-File-Upload/<%= pkg.version %>/js/jquery.iframe-transport.js', 38 | name: 'iframe-transport.js' 39 | } 40 | } 41 | }); 42 | 43 | grunt.loadGlobalTasks('spm-build'); 44 | grunt.util._.merge(grunt.config.data, require('spm-build').config); 45 | 46 | grunt.loadTasks('../_tasks/download/tasks'); 47 | grunt.registerTask('build', ['download', 'spm-build']); 48 | 49 | }; 50 | -------------------------------------------------------------------------------- /at/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var pkg = grunt.file.readJSON('package.json'); 3 | 4 | grunt.initConfig({ 5 | pkg: pkg, 6 | 7 | download: { 8 | options: { 9 | dest: 'src' 10 | }, 11 | js: { 12 | options: { 13 | transform: function(code) { 14 | return [ 15 | 'define(function(require, exports, module) {', 16 | "require('caret');", 17 | "var jQuery = require('$');", 18 | code.replace('window.jQuery', 'jQuery'), 19 | "});" 20 | ].join('\n'); 21 | } 22 | }, 23 | url: 'https://raw.github.com/ichord/At.js/v<%= pkg.version%>/dist/js/jquery.atwho.js', 24 | name: 'atwho.js' 25 | }, 26 | css: { 27 | options: { 28 | transform: function(code) { 29 | return [ 30 | code 31 | ].join('\n'); 32 | } 33 | }, 34 | url: 'https://raw.github.com/ichord/At.js/v<%= pkg.version%>/dist/css/jquery.atwho.css', 35 | name: 'atwho.css' 36 | } 37 | } 38 | }); 39 | 40 | grunt.loadGlobalTasks('spm-build'); 41 | grunt.util._.merge(grunt.config.data, require('spm-build').config); 42 | 43 | grunt.loadTasks('../_tasks/download/tasks'); 44 | grunt.registerTask('build', ['download', 'spm-build']); 45 | 46 | }; 47 | -------------------------------------------------------------------------------- /caret/README.md: -------------------------------------------------------------------------------- 1 | Caret.js 2 | ======== 3 | 4 | Get caret postion or offset from inputor 5 | 6 | This is the core function that working in [At.js](http://ichord.github.com/At.js). 7 | Now, It just become an simple jquery plugin so that everybody can use it. 8 | And, of course, **At.js** is using this plugin too. 9 | 10 | * support iframe context 11 | 12 | Live Demo 13 | ========= 14 | 15 | http://ichord.github.com/Caret.js/ 16 | 17 | 18 | Usage 19 | ===== 20 | 21 | ```javascript 22 | 23 | // Get caret position 24 | // not working in `contentEditable` mode 25 | $('#inputor').caret('position'); // => {left: 15, top: 30, height: 20} 26 | $('#inputor').caret('iframe', iframe1).caret('position') 27 | 28 | // Get caret offset 29 | $('#inputor').caret('offset'); // => {left: 300, top: 400, height: 20} 30 | 31 | var fixPos = 20 32 | // Get position of the 20th char in the inputor. 33 | // not working in `contentEditable` mode 34 | $('#inputor').caret('position', fixPos); 35 | 36 | // Get offset of the 20th char. 37 | // not working in `contentEditable` mode 38 | $('#inputor').caret('offset', fixPos); 39 | 40 | // more 41 | 42 | // Get caret position from first char in inputor. 43 | $('#inputor').caret('pos'); // => 15 44 | 45 | // Set caret position in the inputor 46 | // not working in contentEditable mode 47 | $('#inputor').caret('pos', 15); 48 | 49 | // set iframe context 50 | // oftenly you don't need to set iframe context because caret.js will find the iframe object automatically 51 | // but some iframe editor will prevent caret.js to finding for security reasons, 52 | // so you may have to set the iframe manually 53 | $('#inputor').caret({iframe: theIframe}); 54 | $('#inputor').caret('offset'); 55 | $('#inputor').caret('pos', 15); 56 | 57 | ``` 58 | -------------------------------------------------------------------------------- /tablesorter/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "family": "jquery", 3 | "root": "jquery", 4 | "name": "tablesorter", 5 | "version": "2.13.3", 6 | "package": "https://raw.github.com/Mottie/tablesorter/master/package.json", 7 | "description": "tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell. This forked version adds lots of new enhancements including: alphanumeric sorting, pager callback functons, multiple widgets providing column styling, ui theme application, sticky headers, column filters and resizer, as well as extended documentation with a lot more demos.", 8 | "homepage": "http://mottie.github.com/tablesorter/", 9 | "author": { 10 | "name": "Christian Bach", 11 | "url": "http://tablesorter.com/" 12 | }, 13 | "maintainers": [{ 14 | "name": "Rob Garrison", 15 | "url": "https://github.com/Mottie", 16 | "email": "wowmotty@gmail.com" 17 | }], 18 | "repository": { 19 | "type": "git", 20 | "url": "git://github.com/Mottie/tablesorter.git" 21 | }, 22 | "bugs": "https://github.com/Mottie/tablesorter/issues", 23 | "licenses": [{ 24 | "type": "MIT", 25 | "url": "http://www.opensource.org/licenses/mit-license.php" 26 | },{ 27 | "type": "GPL", 28 | "url": "http://www.gnu.org/licenses/gpl.html" 29 | }], 30 | "keywords": [ 31 | "table", 32 | "sort", 33 | "sorting", 34 | "alphanumeric", 35 | "natural" 36 | ], 37 | "spm": { 38 | "alias": { 39 | "$": "$" 40 | }, 41 | "output": { 42 | "metadata.js": ".", 43 | "tablesorter.js": ".", 44 | "widgets.js": ".", 45 | "widgets-filter-formatter.js": "." 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /blueimp-file-upload/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "blueimp-file-upload", 3 | "version": "9.5.7", 4 | "title": "jQuery File Upload", 5 | "description": "File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.", 6 | "keywords": [ 7 | "jquery", 8 | "file", 9 | "upload", 10 | "widget", 11 | "multiple", 12 | "selection", 13 | "drag", 14 | "drop", 15 | "progress", 16 | "preview", 17 | "cross-domain", 18 | "cross-site", 19 | "chunk", 20 | "resume", 21 | "gae", 22 | "go", 23 | "python", 24 | "php", 25 | "bootstrap" 26 | ], 27 | "homepage": "https://github.com/blueimp/jQuery-File-Upload", 28 | "author": { 29 | "name": "Sebastian Tschan", 30 | "url": "https://blueimp.net" 31 | }, 32 | "maintainers": [ 33 | { 34 | "name": "Sebastian Tschan", 35 | "url": "https://blueimp.net" 36 | } 37 | ], 38 | "repository": { 39 | "type": "git", 40 | "url": "git://github.com/blueimp/jQuery-File-Upload.git" 41 | }, 42 | "bugs": "https://github.com/blueimp/jQuery-File-Upload/issues", 43 | "licenses": [ 44 | { 45 | "type": "MIT", 46 | "url": "http://www.opensource.org/licenses/MIT" 47 | } 48 | ], 49 | "devDependencies": { 50 | "grunt": "~0.4.1", 51 | "grunt-bump-build-git": "~1.1.0", 52 | "grunt-contrib-jshint": "~0.7.2" 53 | }, 54 | "family": "jquery", 55 | "spm": { 56 | "alias": { 57 | "$": "$", 58 | "jquery": "$" 59 | }, 60 | "output": ["fileupload.js", "iframe-transport.js"] 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Gallery 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 |
JQuery Family
34 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /treetable/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var pkg = grunt.file.readJSON('package.json'); 3 | 4 | grunt.initConfig({ 5 | pkg: pkg, 6 | 7 | download: { 8 | options: { 9 | dest: 'src' 10 | }, 11 | js: { 12 | options: { 13 | transform: function(code) { 14 | return [ 15 | 'define(function(require, exports, module) {', 16 | 'var previousJQuery = this.jQuery;', 17 | "this.jQuery = require('$');", 18 | code, 19 | "module.exports = this.TreeTable;", 20 | "this.jQuery = previousJQuery;", 21 | "});" 22 | ].join('\n'); 23 | } 24 | }, 25 | url: 'https://raw.github.com/ludo/jquery-treetable/<%= pkg.version%>/javascripts/src/jquery.treetable.js', 26 | name: 'treetable.js' 27 | }, 28 | css1: { 29 | options: { 30 | transform: function(code) { 31 | return code.replace(/\.\.\/images\//g, './'); 32 | } 33 | }, 34 | url: 'https://raw.github.com/ludo/jquery-treetable/<%= pkg.version%>/stylesheets/jquery.treetable.theme.default.css', 35 | name: "treetable.theme.default.css" 36 | }, 37 | css2: { 38 | url: 'https://raw.github.com/ludo/jquery-treetable/<%= pkg.version%>/stylesheets/jquery.treetable.css', 39 | name: "treetable.css" 40 | } 41 | } 42 | }); 43 | 44 | grunt.loadGlobalTasks('spm-build'); 45 | grunt.util._.merge(grunt.config.data, require('spm-build').config); 46 | 47 | grunt.loadTasks('../_tasks/download/tasks'); 48 | grunt.registerTask('build', ['download', 'spm-build']); 49 | 50 | }; 51 | -------------------------------------------------------------------------------- /_tasks/download/tasks/download.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Hsiaoming Yang 3 | * Licensed under the MIT license. 4 | */ 5 | 6 | /* example of config 7 | grunt.initConfig({ 8 | pkg: grunt.file.readJSON('package.json'), 9 | 10 | download: { 11 | options: { 12 | dest: 'src', 13 | header: 'define(function(require) {', 14 | footer: [ 15 | 'return $.noConflict(true);', 16 | '});' 17 | ].join('\n') 18 | }, 19 | src: { 20 | options: { 21 | transform: function(code) { 22 | return code; 23 | } 24 | }, 25 | url: 'http://code.jquery.com/jquery-<%= pkg.version %>.js', 26 | name: 'jquery-debug.js' 27 | }, 28 | min: { 29 | url: 'http://code.jquery.com/jquery-<%= pkg.version %>.min.js', 30 | name: 'jquery.js' 31 | } 32 | } 33 | }); 34 | */ 35 | 36 | var request = require('request'); 37 | var path = require('path'); 38 | 39 | module.exports = function(grunt) { 40 | grunt.registerMultiTask('download', function() { 41 | var done = this.async(); 42 | 43 | var options = this.options({dest: 'src'}); 44 | var data = this.data; 45 | 46 | grunt.log.writeln('downloading ' + data.url); 47 | request.get(data.url, function(err, res, body) { 48 | if (err) { 49 | grunt.log.error(err); 50 | } else if (res.statusCode !== 200) { 51 | grunt.log.error('status code: ' + res.statusCode); 52 | } else { 53 | var code = body; 54 | if (options.transform && typeof options.transform === 'function') { 55 | grunt.log.writeln('Transform code'); 56 | code = options.transform(code); 57 | } else if (options.header || options.footer ) { 58 | grunt.log.writeln('Add header and footer'); 59 | code = [options.header || '', code, options.footer || ''].join('\n'); 60 | } 61 | grunt.file.write(path.join(options.dest, data.name), code); 62 | grunt.log.ok(); 63 | } 64 | done(); 65 | }); 66 | }); 67 | 68 | grunt.registerTask('spm-build', ['clean:build', 'transport:src', 'concat:js', 'copy:build', 'uglify:js', 'clean:dist', 'copy:dist', 'clean:build', 'spm-newline']); 69 | }; 70 | -------------------------------------------------------------------------------- /select2/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var pkg = grunt.file.readJSON('package.json'); 3 | 4 | grunt.initConfig({ 5 | pkg: pkg, 6 | 7 | download: { 8 | options: { 9 | dest: 'src' 10 | }, 11 | js: { 12 | options: { 13 | transform: function(code) { 14 | return [ 15 | 'define(function(require, exports, module) {', 16 | "var jQuery = require('$');", 17 | code.replace('', ''), // 第一个字符是个不可见字符要替换掉 18 | "module.exports = window.Select2;", 19 | "});" 20 | ].join('\n'); 21 | } 22 | }, 23 | url: 'https://raw.github.com/ivaynberg/select2/<%= pkg.version%>/select2.js', 24 | name: 'select2.js' 25 | }, 26 | lang: { 27 | options: { 28 | transform: function(code) { 29 | return [ 30 | 'define(function(require, exports, module) {', 31 | "var jQuery = require('$');", 32 | "var select2 = require('./select2');", 33 | code.replace('', ''), 34 | "});" 35 | ].join('\n'); 36 | } 37 | }, 38 | url: 'https://raw.github.com/ivaynberg/select2/<%= pkg.version%>/select2_locale_zh-CN.js', 39 | name: 'select2-zh-cn.js' 40 | }, 41 | css: { 42 | options: { 43 | transform: function(code) { 44 | code = code.replace(/select2\.png/g, "https://i.alipayobjects.com/e/201310/1JC9IarS8D.png"); 45 | code = code.replace(/select2-spinner\.gif/g, "https://i.alipayobjects.com/e/201310/1JCGcxNz9Z.gif"); 46 | code = code.replace(/select2x2\.png/g, "https://i.alipayobjects.com/e/201310/1JCHRnbuYf.png"); 47 | 48 | return code 49 | } 50 | }, 51 | url: 'https://raw.github.com/ivaynberg/select2/<%= pkg.version%>/select2.css', 52 | name: "select2.css" 53 | } 54 | } 55 | }); 56 | 57 | grunt.loadGlobalTasks('spm-build'); 58 | grunt.util._.merge(grunt.config.data, require('spm-build').config); 59 | 60 | grunt.loadTasks('../_tasks/download/tasks'); 61 | grunt.registerTask('build', ['download', 'spm-build']); 62 | 63 | }; 64 | -------------------------------------------------------------------------------- /spectrum/README.md: -------------------------------------------------------------------------------- 1 | # Spectrum 2 | ## The No Hassle Colorpicker 3 | 4 | See the demo and docs: http://bgrins.github.io/spectrum. 5 | 6 | I wanted a colorpicker that didn't require images, and that had an API that made sense to me as a developer who has worked with color in a number of applications. I had tried a number of existing plugins, but decided to try and make a smaller, simpler one. 7 | 8 | I started using canvas, then switched to CSS gradients, since it turned out to be easier to manage, and provided better cross browser support. 9 | 10 | ### Basic Usage 11 | 12 | Head over to the [docs](http://bgrins.github.io/spectrum) for more information. There is a visual demo of the different options hosted at: http://bgrins.github.io/spectrum. 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | ### jQuery Plugin Repository 26 | 27 | Spectrum is registered as a jQuery plugin on the jQuery plugin repository here: http://plugins.jquery.com/spectrum/ 28 | 29 | ### Bower 30 | 31 | Spectrum is registered as a package with [Bower](http://bower.io/), so it can be pulled down using: 32 | 33 | bower install spectrum 34 | 35 | ### Continuous Integration 36 | 37 | [![Build Status](https://secure.travis-ci.org/bgrins/spectrum.png?branch=master)](http://travis-ci.org/bgrins/spectrum) 38 | 39 | Visit https://travis-ci.org/bgrins/spectrum to view the status of the automated tests. 40 | 41 | ### Building Spectrum Locally 42 | 43 | If you'd like to download and use the plugin, head over to http://bgrins.github.io/spectrum/ and click the 'Download Zip' button. 44 | 45 | If you'd like to run the development version, spectrum uses Grunt to automate the testing, linting, and building. Head over to http://gruntjs.com/getting-started for more information. First, clone the repository, then run: 46 | 47 | npm install -g grunt-cli 48 | npm install 49 | 50 | # runs jshint and the unit test suite 51 | grunt 52 | 53 | # runs jshint, the unit test suite, and builds a minified version of the file. 54 | grunt build 55 | 56 | ### Internationalization 57 | 58 | If you are able to translate the text in the UI to another language, please do! You can do so by either [filing a pull request](https://github.com/bgrins/spectrum/pulls) or [opening an issue]( https://github.com/bgrins/spectrum/issues) with the translation. The existing languages are listed at: https://github.com/bgrins/spectrum/tree/master/i18n. 59 | 60 | For an example, see the [Dutch translation](i18n/jquery.spectrum-nl.js). 61 | -------------------------------------------------------------------------------- /at/README.md: -------------------------------------------------------------------------------- 1 | **An autocompletion library to autocomplete mentions, smileys etc. just like on Github or Twitter!** [![Build Status](https://travis-ci.org/ichord/At.js.png)](https://travis-ci.org/ichord/At.js) 2 | 3 | #### Notice 4 | 5 | At.js now **depends on** [Caret.js](https://github.com/ichord/Caret.js). 6 | 7 | This branch has been updated to `v0.4.x`. Please read **CHANGELOG.md** for more details. 8 | English Documentation will keep improving. Maybe **you can do me a favor?** 9 | 10 | ### Demo 11 | 12 | http://ichord.github.com/At.js 13 | 14 | 15 | ### Features Preview 16 | 17 | * Supports HTML5 [**contentEditable**](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_Editable) elements (NOT include IE 8) 18 | * Can listen to any character and not just '@'. Can set up multiple listeners for different characters with different behavior and data 19 | * Listener events can be bound to multiple inputors. 20 | * Format returned data using templates 21 | * Keyboard controls in addition to mouse 22 | - `Tab` or `Enter` keys select the value 23 | - `Up` and `Down` navigate between values (and `Ctrl-P` and `Ctrl-N` also) 24 | - `Right` and `left` will re-search the keyword. 25 | * Custom data handlers and template renderers using a group of configurable callbacks 26 | * Supports AMD 27 | 28 | ### Requirements 29 | 30 | * jQuery >= 1.7.0. 31 | * [Caret.js](https://github.com/ichord/Caret.js) 32 | (You can use `Component` or `Bower` to install it.) 33 | 34 | ### Documentation 35 | https://github.com/ichord/At.js/wiki 36 | 37 | ### Integrating with your Application 38 | 39 | Simply include the following files in your HTML and you are good to go. 40 | 41 | ```html 42 | 43 | 44 | 45 | 46 | ``` 47 | 48 | ```javascript 49 | $('#inputor').atwho({ 50 | at: "@", 51 | data:['Peter', 'Tom', 'Anne'] 52 | }) 53 | ``` 54 | 55 | #### Bower & Component 56 | For installing using Bower you can use `jquery.atwho` and for Component please use `ichord/At.js`. 57 | 58 | #### Rails 59 | You can include At.js in your `Rails` application using the gem [`jquery-atwho-rails`](https://github.com/ichord/jquery-atwho-rails). 60 | 61 | 62 | ### Version History 63 | 64 | * branch `stable-v0.3` with tag `v0.3.3` 65 | * branch `stable-v0.2` with tag `v0.2.x` 66 | * branch `stable-v0.1.x` and tag `v0.1.7` 67 | 68 | ### Core Team Members 69 | 70 | * [@ichord](https://twitter.com/_ichord) 71 | 72 | #### PS 73 | Let me know if you are using **At.js**. It will motivate me to work harder. 74 | And if you like **At.js**, just email me and add your website [here](https://github.com/ichord/At.js/wiki/Sites) 75 | Hope you like it, Thanks! :) 76 | 77 | --- 78 | 79 | Project is a member of the [OSS Manifesto](http://ossmanifesto.org/). 80 | -------------------------------------------------------------------------------- /tablesorter/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var pkg = grunt.file.readJSON('package.json'); 3 | 4 | grunt.initConfig({ 5 | pkg: pkg, 6 | 7 | download: { 8 | options: { 9 | dest: 'src' 10 | }, 11 | tablesorter: { 12 | options: { 13 | transform: function(code) { 14 | return [ 15 | 'define(function(require, exports, module) {', 16 | "var jQuery = require('$');", 17 | code, 18 | "});" 19 | ].join('\n'); 20 | } 21 | }, 22 | url: 'https://raw.github.com/Mottie/tablesorter/v<%= pkg.version%>/js/jquery.tablesorter.js', 23 | name: 'tablesorter.js' 24 | }, 25 | widgets: { 26 | options: { 27 | transform: function(code) { 28 | return [ 29 | 'define(function(require, exports, module) {', 30 | "var jQuery = require('$');", 31 | code, 32 | "});" 33 | ].join('\n'); 34 | } 35 | }, 36 | url: 'https://raw.github.com/Mottie/tablesorter/v<%= pkg.version%>/js/jquery.tablesorter.widgets.js', 37 | name: 'widgets.js' 38 | }, 39 | metadata: { 40 | options: { 41 | transform: function(code) { 42 | return [ 43 | 'define(function(require, exports, module) {', 44 | "var jQuery = require('$');", 45 | code, 46 | "});" 47 | ].join('\n'); 48 | } 49 | }, 50 | url: 'https://raw.github.com/Mottie/tablesorter/v<%= pkg.version%>/js/jquery.metadata.js', 51 | name: 'metadata.js' 52 | }, 53 | formatter: { 54 | options: { 55 | transform: function(code) { 56 | return [ 57 | 'define(function(require, exports, module) {', 58 | "var jQuery = require('$');", 59 | code, 60 | "});" 61 | ].join('\n'); 62 | } 63 | }, 64 | url: 'https://raw.github.com/Mottie/tablesorter/v<%= pkg.version%>/js/jquery.tablesorter.widgets-filter-formatter.js', 65 | name: 'widgets-filter-formatter.js' 66 | } 67 | } 68 | }); 69 | 70 | grunt.loadTasks('../_tasks/download/tasks'); 71 | grunt.registerTask('default', ['download']); 72 | }; 73 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var fs = require('fs'); 3 | var async = require('async'); 4 | var request = require('request'); 5 | var semver = require('semver'); 6 | 7 | var modules = fs.readdirSync('.').filter(function(name) { 8 | return fs.statSync(name).isDirectory() && !grunt.util._.contains(['.git', '_tasks', 'node_modules', 'sea-modules'], name); 9 | }); 10 | 11 | grunt.registerTask('check', function() { 12 | var done = this.async(); 13 | 14 | var q = async.queue(function(pkg, callback) { 15 | grunt.log.verbose.writeln('processing ' + pkg.name); 16 | checkupdate(pkg, function(err, version) { 17 | if (err) { 18 | grunt.log.warn(err); 19 | } else { 20 | if (version && version !== pkg.version) { 21 | grunt.log.writeln(print(pkg.name, pkg.version, version)); 22 | } else { 23 | grunt.log.writeln(print(pkg.name, pkg.version)); 24 | } 25 | } 26 | }); 27 | }, modules.length); 28 | 29 | modules.forEach(function(m) { 30 | try { 31 | var pkg = require('./' + m + '/package.json'); 32 | q.push(pkg, function(err) { 33 | if (err) { 34 | grunt.log.verbose.error(err); 35 | } else { 36 | grunt.log.verbose.writeln('add task ' + pkg.name); 37 | } 38 | }); 39 | } catch (e) { 40 | grunt.log.verbose.error(e); 41 | } 42 | }); 43 | 44 | q.drain = function() { 45 | done(); 46 | }; 47 | }); 48 | grunt.registerTask('default', ['check']); 49 | 50 | function checkupdate(pkg, callback) { 51 | if (pkg.package) { 52 | grunt.log.verbose.writeln(pkg.package); 53 | request({json: true, url: pkg.package}, function(err, res, body) { 54 | if (err) { 55 | callback(err); 56 | } else if (res.statusCode !== 200) { 57 | callback('status code: ' + res.statusCode + ' ' + pkg.package); 58 | } else { 59 | callback(null, body.version); 60 | } 61 | }); 62 | } else if (pkg.repository) { 63 | var repo = pkg.repository.url; 64 | repo = repo.replace('https://github.com/', ''); 65 | repo = repo.replace('git://github.com/', ''); 66 | repo = repo.replace('git@github.com:', ''); 67 | repo = repo.replace('.git', ''); 68 | getVersion(repo, callback); 69 | } else { 70 | callback('check ' + pkg.homepage); 71 | } 72 | } 73 | 74 | function getVersion(repo, callback) { 75 | var uri = 'https://api.github.com/repos/' + repo + '/tags' 76 | request({ 77 | json: true, 78 | url: uri, 79 | headers: { 80 | 'User-Agent': 'request' 81 | } 82 | }, function(err, res, body) { 83 | if (err) { 84 | callback(err); 85 | } else if (res.statusCode !== 200) { 86 | callback('status code: ' + res.statusCode + ' ' + uri); 87 | } else { 88 | var names = body.map(function(tag) { 89 | var version = semver.valid(tag.name); 90 | if (version) return version; 91 | }); 92 | callback(null, names.sort().pop()); 93 | } 94 | }); 95 | } 96 | 97 | function print(name, version, latest) { 98 | var s = name + new Array(25 - name.length).join(' '); 99 | s += version + new Array(15 - version.length).join(' '); 100 | s += latest || ''; 101 | return s; 102 | } 103 | }; 104 | 105 | -------------------------------------------------------------------------------- /select2/README.md: -------------------------------------------------------------------------------- 1 | Select2 2 | ======= 3 | 4 | Select2 is a jQuery-based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results. 5 | 6 | To get started, checkout examples and documentation at http://ivaynberg.github.com/select2 7 | 8 | Use cases 9 | --------- 10 | 11 | * Enhancing native selects with search. 12 | * Enhancing native selects with a better multi-select interface. 13 | * Loading data from JavaScript: easily load items via ajax and have them searchable. 14 | * Nesting optgroups: native selects only support one level of nested. Select2 does not have this restriction. 15 | * Tagging: ability to add new items on the fly. 16 | * Working with large, remote datasets: ability to partially load a dataset based on the search term. 17 | * Paging of large datasets: easy support for loading more pages when the results are scrolled to the end. 18 | * Templating: support for custom rendering of results and selections. 19 | 20 | Browser compatibility 21 | --------------------- 22 | * IE 8+ 23 | * Chrome 8+ 24 | * Firefox 10+ 25 | * Safari 3+ 26 | * Opera 10.6+ 27 | 28 | Integrations 29 | ------------ 30 | 31 | * [Wicket-Select2](https://github.com/ivaynberg/wicket-select2) (Java / [Apache Wicket](http://wicket.apache.org)) 32 | * [select2-rails](https://github.com/argerim/select2-rails) (Ruby on Rails) 33 | * [AngularUI](http://angular-ui.github.com/#directives-select2) ([AngularJS](angularjs.org)) 34 | * [Django](https://github.com/applegrew/django-select2) 35 | * [Symfony](https://github.com/19Gerhard85/sfSelect2WidgetsPlugin) 36 | * [Symfony2](https://github.com/avocode/FormExtensions) 37 | * [Bootstrap 2](https://github.com/t0m/select2-bootstrap-css) and [Bootstrap 3](https://github.com/t0m/select2-bootstrap-css/tree/bootstrap3) (CSS skins) 38 | * [Meteor](https://github.com/nate-strauser/meteor-select2) (modern reactive JavaScript framework; + [Bootstrap 3 skin](https://github.com/esperadomedia/meteor-select2-bootstrap3-css/)) 39 | * [Yii](https://github.com/tonybolzan/yii-select2) 40 | 41 | Internationalization (i18n) 42 | --------------------------- 43 | 44 | Select2 supports multiple languages by simply including the right 45 | language JS file (`select2_locale_it.js`, `select2_locale_nl.js`, etc.). 46 | 47 | Missing a language? Just copy `select2_locale_en.js.template`, translate 48 | it, and make a pull request back to Select2 here on GitHub. 49 | 50 | Bug tracker 51 | ----------- 52 | 53 | Have a bug? Please create an issue here on GitHub! 54 | 55 | https://github.com/ivaynberg/select2/issues 56 | 57 | Mailing list 58 | ------------ 59 | 60 | Have a question? Ask on our mailing list! 61 | 62 | select2@googlegroups.com 63 | 64 | https://groups.google.com/d/forum/select2 65 | 66 | 67 | Copyright and license 68 | --------------------- 69 | 70 | Copyright 2012 Igor Vaynberg 71 | 72 | This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU 73 | General Public License version 2 (the "GPL License"). You may choose either license to govern your 74 | use of this software only upon the condition that you accept all of the terms of either the Apache 75 | License or the GPL License. 76 | 77 | You may obtain a copy of the Apache License and the GPL License in the LICENSE file, or at: 78 | 79 | http://www.apache.org/licenses/LICENSE-2.0 80 | http://www.gnu.org/licenses/gpl-2.0.html 81 | 82 | Unless required by applicable law or agreed to in writing, software distributed under the Apache License 83 | or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 84 | either express or implied. See the Apache License and the GPL License for the specific language governing 85 | permissions and limitations under the Apache License and the GPL License. 86 | -------------------------------------------------------------------------------- /blueimp-file-upload/README.md: -------------------------------------------------------------------------------- 1 | # jQuery File Upload Plugin 2 | 3 | ## Demo 4 | [Demo File Upload](http://blueimp.github.io/jQuery-File-Upload/) 5 | 6 | ## Description 7 | File Upload widget with multiple file selection, drag&drop support, progress bars, validation and preview images, audio and video for jQuery. 8 | Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads. 9 | 10 | ## Setup 11 | * [How to setup the plugin on your website](https://github.com/blueimp/jQuery-File-Upload/wiki/Setup) 12 | * [How to use only the basic plugin (minimal setup guide).](https://github.com/blueimp/jQuery-File-Upload/wiki/Basic-plugin) 13 | 14 | ## Support 15 | 16 | * **[Support Forum](https://groups.google.com/d/forum/jquery-fileupload)** 17 | **Support requests** and **general discussions** about the File Upload plugin can be posted to the official 18 | [Support Forum](https://groups.google.com/d/forum/jquery-fileupload). 19 | If your question is not directly related to the File Upload plugin, you might have a better chance to get a reply by posting to [Stack Overflow](http://stackoverflow.com/questions/tagged/blueimp+jquery+file-upload). 20 | 21 | * Bugs and Feature requests 22 | **Bugs** and **Feature requests** can be reported using the [issues tracker](https://github.com/blueimp/jQuery-File-Upload/issues). 23 | Please read the [issue guidelines](https://github.com/blueimp/jQuery-File-Upload/blob/master/CONTRIBUTING.md) before posting. 24 | 25 | ## Features 26 | * **Multiple file upload:** 27 | Allows to select multiple files at once and upload them simultaneously. 28 | * **Drag & Drop support:** 29 | Allows to upload files by dragging them from your desktop or filemanager and dropping them on your browser window. 30 | * **Upload progress bar:** 31 | Shows a progress bar indicating the upload progress for individual files and for all uploads combined. 32 | * **Cancelable uploads:** 33 | Individual file uploads can be canceled to stop the upload progress. 34 | * **Resumable uploads:** 35 | Aborted uploads can be resumed with browsers supporting the Blob API. 36 | * **Chunked uploads:** 37 | Large files can be uploaded in smaller chunks with browsers supporting the Blob API. 38 | * **Client-side image resizing:** 39 | Images can be automatically resized on client-side with browsers supporting the required JS APIs. 40 | * **Preview images, audio and video:** 41 | A preview of image, audio and video files can be displayed before uploading with browsers supporting the required APIs. 42 | * **No browser plugins (e.g. Adobe Flash) required:** 43 | The implementation is based on open standards like HTML5 and JavaScript and requires no additional browser plugins. 44 | * **Graceful fallback for legacy browsers:** 45 | Uploads files via XMLHttpRequests if supported and uses iframes as fallback for legacy browsers. 46 | * **HTML file upload form fallback:** 47 | Allows progressive enhancement by using a standard HTML file upload form as widget element. 48 | * **Cross-site file uploads:** 49 | Supports uploading files to a different domain with cross-site XMLHttpRequests or iframe redirects. 50 | * **Multiple plugin instances:** 51 | Allows to use multiple plugin instances on the same webpage. 52 | * **Customizable and extensible:** 53 | Provides an API to set individual options and define callBack methods for various upload events. 54 | * **Multipart and file contents stream uploads:** 55 | Files can be uploaded as standard "multipart/form-data" or file contents stream (HTTP PUT file upload). 56 | * **Compatible with any server-side application platform:** 57 | Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads. 58 | 59 | ## Requirements 60 | 61 | ### Mandatory requirements 62 | * [jQuery](http://jquery.com/) v. 1.6+ 63 | * [jQuery UI widget factory](http://api.jqueryui.com/jQuery.widget/) v. 1.9+ (included) 64 | * [jQuery Iframe Transport plugin](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.iframe-transport.js) (included) 65 | 66 | The jQuery UI widget factory is a requirement for the basic File Upload plugin, but very lightweight without any other dependencies from the jQuery UI suite. 67 | 68 | The jQuery Iframe Transport is required for [browsers without XHR file upload support](https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support). 69 | 70 | ### Optional requirements 71 | * [JavaScript Templates engine](https://github.com/blueimp/JavaScript-Templates) v. 2.5.3+ 72 | * [JavaScript Load Image library](https://github.com/blueimp/JavaScript-Load-Image) v. 1.11.0+ 73 | * [JavaScript Canvas to Blob polyfill](https://github.com/blueimp/JavaScript-Canvas-to-Blob) v. 2.1.0+ 74 | * [blueimp Gallery](https://github.com/blueimp/Gallery) v. 2.12.0+ 75 | * [Bootstrap CSS framework](http://getbootstrap.com/) v. 3.0.0+ 76 | * [Glyphicons](http://glyphicons.com/) 77 | 78 | The JavaScript Templates engine is used to render the selected and uploaded files for the Basic Plus UI and jQuery UI versions. 79 | 80 | The JavaScript Load Image library and JavaScript Canvas to Blob polyfill are required for the image previews and resizing functionality. 81 | 82 | The blueimp Gallery is used to display the uploaded images in a lightbox. 83 | 84 | The user interface of all versions except the jQuery UI version is built with Twitter's [Bootstrap](http://getbootstrap.com/) framework and icons from [Glyphicons](http://glyphicons.com/). 85 | 86 | ### Cross-domain requirements 87 | [Cross-domain File Uploads](https://github.com/blueimp/jQuery-File-Upload/wiki/Cross-domain-uploads) using the [Iframe Transport plugin](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.iframe-transport.js) require a redirect back to the origin server to retrieve the upload results. The [example implementation](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/main.js) makes use of [result.html](https://github.com/blueimp/jQuery-File-Upload/blob/master/cors/result.html) as a static redirect page for the origin server. 88 | 89 | The repository also includes the [jQuery XDomainRequest Transport plugin](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/cors/jquery.xdr-transport.js), which enables limited cross-domain AJAX requests in Microsoft Internet Explorer 8 and 9 (IE 10 supports cross-domain XHR requests). 90 | The XDomainRequest object allows GET and POST requests only and doesn't support file uploads. It is used on the [Demo](http://blueimp.github.io/jQuery-File-Upload/) to delete uploaded files from the cross-domain demo file upload service. 91 | 92 | ## Browsers 93 | 94 | ### Desktop browsers 95 | The File Upload plugin is regularly tested with the latest browser versions and supports the following minimal versions: 96 | 97 | * Google Chrome 98 | * Apple Safari 4.0+ 99 | * Mozilla Firefox 3.0+ 100 | * Opera 11.0+ 101 | * Microsoft Internet Explorer 6.0+ 102 | 103 | ### Mobile browsers 104 | The File Upload plugin has been tested with and supports the following mobile browsers: 105 | 106 | * Apple Safari on iOS 6.0+ 107 | * Google Chrome on iOS 6.0+ 108 | * Google Chrome on Android 4.0+ 109 | * Default Browser on Android 2.3+ 110 | * Opera Mobile 12.0+ 111 | 112 | ### Supported features 113 | For a detailed overview of the features supported by each browser version please have a look at the [Extended browser support information](https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support). 114 | 115 | ## License 116 | Released under the [MIT license](http://www.opensource.org/licenses/MIT). 117 | 118 | ## Donations 119 | jQuery File Upload is free software, but you can donate to support the developer, Sebastian Tschan: 120 | 121 | Flattr: [![Flattr](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/thing/286433/jQuery-File-Upload-Plugin) 122 | 123 | PayPal: [![PayPal](https://www.paypalobjects.com/WEBSCR-640-20110429-1/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PYWYSYP77KL54) 124 | -------------------------------------------------------------------------------- /color/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](http://jenkins.jquery.com/job/jQuery%20Color/badge/icon)](http://jenkins.jquery.com/job/jQuery%20Color/) 2 | 3 | # jQuery Color 4 | 5 | ## Using jQuery Color in Production 6 | We release jQuery Color by itself, or in a bundle. The extended names can be included as a jQuery Color plugin, or you can download the version of jQuery Color that includes the names. Choose your build from the following list: 7 | 8 | **Current version: 2.1.2** 9 | 10 | * jQuery Color [Compressed](http://code.jquery.com/color/jquery.color-2.1.2.min.js) [Uncompressed](http://code.jquery.com/color/jquery.color-2.1.2.js) 11 | * jQuery Color Extended Names [Compressed](http://code.jquery.com/color/jquery.color.svg-names-2.1.2.min.js) [Uncompressed](http://code.jquery.com/color/jquery.color.svg-names-2.1.2.js) 12 | * jQuery Color & Extended Names(previous two combined) [Compressed](http://code.jquery.com/color/jquery.color.plus-names-2.1.2.min.js) [Uncompressed](http://code.jquery.com/color/jquery.color.plus-names-2.1.2.js) 13 | 14 | ## How to build and test jQuery Color 15 | 16 | First, get a copy of the git repo by running: 17 | 18 | ```shell 19 | git clone git://github.com/jquery/jquery-color.git 20 | ``` 21 | 22 | Enter the directory and install the node dependencies: 23 | 24 | ```shell 25 | cd jquery-color && npm install 26 | ``` 27 | 28 | Make sure you have `grunt` installed by testing: 29 | 30 | ```shell 31 | grunt -version 32 | ``` 33 | 34 | If not, run: 35 | 36 | ```shell 37 | npm install -g grunt 38 | ``` 39 | 40 | To run tests locally, run `grunt`, and this will run the tests in PhantomJS. 41 | 42 | You can also run the tests in a browser by navigating to the `test/` directory, but first run `grunt` to install submodules. 43 | 44 | ## Animated colors 45 | 46 | This plugins installs a [`cssHook`](http://api.jquery.com/jQuery.cssHooks/) which allows jQuery's [`.animate()`](http://api.jquery.com/animate) to animate between two colors. 47 | 48 | ## Supported properties 49 | `backgroundColor`, `borderBottomColor`, `borderLeftColor`, `borderRightColor`, `borderTopColor`, `color`, `columnRuleColor`, `outlineColor`, `textDecorationColor`, `textEmphasisColor` 50 | 51 | ## Example use 52 | 53 | ```html 54 | 55 | 56 | 57 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
Hello!
71 | 83 | 84 | 85 | ``` 86 | 87 | ## Supporting other properties 88 | The `jQuery.Color.hook()` function can be called to support additional css properties as colors, and allow them to be animated. 89 | 90 | ## Example use 91 | ```javascript 92 | // we want to animate SVG fill and stroke properties 93 | jQuery.Color.hook( "fill stroke" ); 94 | ``` 95 | 96 | ## The jQuery.Color Factory 97 | 98 | The `jQuery.Color()` function allows you to create and manipulate color objects that are accepted by jQuery's `.animate()` and `.css()` functions. 99 | 100 | * Returns a new Color object, similar to `jQuery()` or `jQuery.Event` 101 | * Accepts many formats to create a new Color object with a `jQuery.Color.fn` prototype 102 | 103 | ### Example uses: 104 | 105 | ```javascript 106 | // Parsing String Colors: 107 | jQuery.Color( "#abcdef" ); 108 | jQuery.Color( "rgb(100,200,255)" ); 109 | jQuery.Color( "rgba(100,200,255,0.5)" ); 110 | jQuery.Color( "aqua" ); 111 | 112 | // Creating Color Objects in Code: 113 | // use null or undefined for values you wish to leave out 114 | jQuery.Color( red, green, blue, alpha ); 115 | jQuery.Color([ red, green, blue, alpha ]); 116 | jQuery.Color({ red: red, green: green, blue: blue, alpha: alpha }); 117 | jQuery.Color({ hue: hue, saturation: saturation, lightness: lightness, alpha: alpha }); 118 | 119 | // Helper to get value from CSS 120 | jQuery.Color( element, cssProperty ); 121 | ``` 122 | ## jQuery.Color.fn / prototype / the Color Object methods 123 | 124 | ### Getters / Setters: 125 | 126 | ```javascript 127 | red() // returns the "red" component of the color ( Integer from 0 - 255 ) 128 | red( val ) // returns a copy of the color object with the red set to val 129 | green() // returns the "green" component of the color from ( Integer from 0 - 255 ) 130 | green( val ) // returns a copy of the color object with the green set to val 131 | blue() // returns the "blue" component of the color from ( Integer from 0 - 255 ) 132 | blue( val ) // returns a copy of the color object with the blue set to val 133 | alpha() // returns the "alpha" component of the color from ( Float from 0.0 - 1.0 ) 134 | alpha( val ) // returns a copy of the color object with the alpha set to val 135 | hue() // returns the "hue" component of the color ( Integer from 0 - 359 ) 136 | hue( val ) // returns a copy of the color object with the hue set to val 137 | saturation() // returns the "saturation" component of the color ( Float from 0.0 - 1.0 ) 138 | saturation( val ) // returns a copy of the color object with the saturation set to val 139 | lightness() // returns the "lightness" component of the color ( Float from 0.0 - 1.0 ) 140 | lightness( val ) // returns a copy of the color object with the lightness set to val 141 | // all of the above values can also take strings in the format of "+=100" or "-=100" 142 | 143 | rgba() // returns a rgba "tuple" [ red, green, blue, alpha ] 144 | // rgba() setters: returns a copy of the color with any defined values set to the new value 145 | rgba( red, green, blue, alpha ) 146 | rgba({ red: red, green: green, blue: blue, alpha: alpha }) 147 | rgba([ red, green, blue, alpha ]) 148 | 149 | hsla() // returns a HSL tuple [ hue, saturation, lightness, alpha ] 150 | // much like the rgb setter - returns a copy with any defined values set 151 | hsla( hue, saturation, lightness, alpha ) 152 | hsla({ hue: hue, saturation: saturation, lightness: lightness, alpha: alpha ) 153 | hsla([ hue, saturation, lightness, alpha ]) 154 | ``` 155 | 156 | ### String methods 157 | 158 | ```javascript 159 | toRgbaString() // returns a css string "rgba(255, 255, 255, 0.4)" 160 | toHslaString() // returns a css string "hsla(330, 75%, 25%, 0.4)" 161 | toHexString( includeAlpha ) // returns a css string "#abcdef", with "includeAlpha" uses "#rrggbbaa" (alpha *= 255) 162 | ``` 163 | 164 | The `toRgbaString` and `toHslaString` methods will only include the alpha channel if it is not `1`. They will return `rgb(...)` and `hsl(...)` strings if the alpha is set to `1`. 165 | ### Working with other colors: 166 | 167 | ```javascript 168 | transition( othercolor, distance ) // the color distance ( 0.0 - 1.0 ) of the way between this color and othercolor 169 | blend( othercolor ) // Will apply this color on top of the other color using alpha blending 170 | is( othercolor ) // Will determine if this color is equal to all defined properties of othercolor 171 | ``` 172 | 173 | ## jQuery.Color properties 174 | 175 | 176 | ## Internals on The Color Object 177 | * Internally, RGBA values are stored as `color._rgba[0] = red, color._rgba[1] = green, color._rgba[2] = blue, color._rgba[3] = alpha`. However, please remember there are nice convenient setters and getters for each of these properties. 178 | * `undefined`/`null` values for colors indicate non-existence. This signals the `transition()` function to keep whatever value was set in the other end of the transition. For example, animating to `jQuery.Color([ 255, null, null, 1 ])` would only animate the red and alpha values of the color. 179 | 180 | ### `jQuery.Color.names` 181 | 182 | A list of named colors is stored on the `jQuery.Color.names` object. The value they contain should be parseable by `jQuery.Color()`. All names on this object should be lowercased. I.E. `jQuery.Color("Red")` is the same as doing `jQuery.Color( jQuery.Color.names["red"] );` 183 | 184 | There is also a named color `"_default"` which by default is white, this is used for situations where a color is unparseable. 185 | 186 | ### `"transparent"` 187 | 188 | A special note about the color `"transparent"` - It returns `null` for red green and blue unless you specify colors for these values. 189 | 190 | ```javascript 191 | jQuery.Color("#abcdef").transition("transparent", 0.5) 192 | ``` 193 | 194 | Animating to or from the value `"transparent"` will still use "#abcdef" for red green and blue. 195 | 196 | ## HSLA Support 197 | 198 | If a color is created using any of the HSLA functions or parsers, it will keep the `_rgba` array up to date as well as having a `_hsla` array. Once an RGBA operation is performed on HSLA, however, the `_hsla` cache is removed and all operations will continue based off of rgb (unless you go back into HSLA). The `._hsla` array follows the same format as `._rbga`, `[hue, saturation, lightness, alpha ]`. If you need to build an HSLA color from an HSLA array, `jQuery.Color().hsla( array )` works for that purpose. 199 | 200 | **Colors with 0 saturation, or 100%/0% lightness will be stored with a hue of 0** 201 | 202 | ## Extensibility 203 | 204 | It is possible for you to add your own functions to the color object. For instance, this function will tell you if its better to use black or white on a given background color. 205 | 206 | 207 | ```javascript 208 | // method taken from https://gist.github.com/960189 209 | jQuery.Color.fn.contrastColor = function() { 210 | var r = this._rgba[0], g = this._rgba[1], b = this._rgba[2]; 211 | return (((r*299)+(g*587)+(b*144))/1000) >= 131.5 ? "black" : "white"; 212 | }; 213 | 214 | // usage examples: 215 | jQuery.Color("#bada55").contrastColor(); // "black" 216 | element.css( "color", jQuery.Color( element, "backgroundColor" ).contrastColor() ); 217 | ``` 218 | -------------------------------------------------------------------------------- /jquery/README.md: -------------------------------------------------------------------------------- 1 | [jQuery](http://jquery.com/) - New Wave JavaScript 2 | ================================================== 3 | 4 | Contribution Guides 5 | -------------------------------------- 6 | 7 | In the spirit of open source software development, jQuery always encourages community code contribution. To help you get started and before you jump into writing code, be sure to read these important contribution guidelines thoroughly: 8 | 9 | 1. [Getting Involved](http://contribute.jquery.org/) 10 | 2. [Core Style Guide](http://contribute.jquery.org/style-guide/js/) 11 | 3. [Writing Code for jQuery Foundation Projects](http://contribute.jquery.org/code/) 12 | 13 | 14 | Environments in which to use jQuery 15 | -------------------------------------- 16 | 17 | - [Browser support](http://jquery.com/browser-support/) differs between the master (2.x) branch and the 1.x-master branch. Specifically, 2.x does not support legacy browsers such as IE6-8. The jQuery team continues to provide support for legacy browsers on the 1.x-master branch. Use the latest 1.x release if support for those browsers is required. See [browser support](http://jquery.com/browser-support/) for more info. 18 | - To use jQuery in Node, browser extensions, and other non-browser environments, use only **2.x** releases. 1.x does not support these environments. 19 | 20 | 21 | What you need to build your own jQuery 22 | -------------------------------------- 23 | 24 | In order to build jQuery, you need to have Node.js/npm latest and git 1.7 or later. 25 | (Earlier versions might work OK, but are not tested.) 26 | 27 | For Windows you have to download and install [git](http://git-scm.com/downloads) and [Node.js](http://nodejs.org/download/). 28 | 29 | Mac OS users should install [Homebrew](http://mxcl.github.com/homebrew/). Once Homebrew is installed, run `brew install git` to install git, 30 | and `brew install node` to install Node.js. 31 | 32 | Linux/BSD users should use their appropriate package managers to install git and Node.js, or build from source 33 | if you swing that way. Easy-peasy. 34 | 35 | 36 | How to build your own jQuery 37 | ---------------------------- 38 | 39 | Clone a copy of the main jQuery git repo by running: 40 | 41 | ```bash 42 | git clone git://github.com/jquery/jquery.git 43 | ``` 44 | 45 | Enter the jquery directory and run the build script: 46 | ```bash 47 | cd jquery && npm run build 48 | ``` 49 | The built version of jQuery will be put in the `dist/` subdirectory, along with the minified copy and associated map file. 50 | 51 | If you want create custom build or help with jQuery development, it would be better to install [grunt command line interface](https://github.com/gruntjs/grunt-cli) as a global package: 52 | 53 | ``` 54 | npm install -g grunt-cli 55 | ``` 56 | Make sure you have `grunt` installed by testing: 57 | ``` 58 | grunt -v 59 | ``` 60 | 61 | Now by running `grunt` command, in the jquery directory, you could build full version of jQuery, just like with `npm run build` command: 62 | ``` 63 | grunt 64 | ``` 65 | 66 | There are many other tasks available for jQuery Core: 67 | ``` 68 | grunt -help 69 | ``` 70 | 71 | ### Modules 72 | 73 | Special builds can be created that exclude subsets of jQuery functionality. 74 | This allows for smaller custom builds when the builder is certain that those parts of jQuery are not being used. 75 | For example, an app that only used JSONP for `$.ajax()` and did not need to calculate offsets or positions of elements could exclude the offset and ajax/xhr modules. 76 | 77 | Any module may be excluded except for `core`, and `selector`. To exclude a module, pass its path relative to the `src` folder (without the `.js` extension). 78 | 79 | Some example modules that can be excluded are: 80 | 81 | - **ajax**: All AJAX functionality: `$.ajax()`, `$.get()`, `$.post()`, `$.ajaxSetup()`, `.load()`, transports, and ajax event shorthands such as `.ajaxStart()`. 82 | - **ajax/xhr**: The XMLHTTPRequest AJAX transport only. 83 | - **ajax/script**: The `