From 8e70642b8730e0416373ebcfda56e9230bd0ec65 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Fri, 31 Oct 2014 19:10:38 -0400 Subject: [PATCH] Lint the Gruntfile --- Gruntfile.js | 128 ++++++++++++++++++------------------ dist/js/select2.full.js | 2 - dist/js/select2.full.min.js | 2 +- 3 files changed, 65 insertions(+), 67 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index fab271db..4856e9df 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -35,146 +35,146 @@ module.exports = function (grunt) { jshintrc: true }, code: { - src: ["src/js/**/*.js"] + src: ['src/js/**/*.js'] }, tests: { - src: ["tests/**/*.js"] + src: ['tests/**/*.js'] } }, sass: { dist: { options: { - outputStyle: "compressed" + outputStyle: 'compressed' }, files: { - "dist/css/select2.min.css": [ - "src/scss/core.scss", - "src/scss/theme/default/layout.css" + 'dist/css/select2.min.css': [ + 'src/scss/core.scss', + 'src/scss/theme/default/layout.css' ] } }, dev: { options: { - outputStyle: "nested" + outputStyle: 'nested' }, files: { - "dist/css/select2.css": [ - "src/scss/core.scss", - "src/scss/theme/default/layout.css" + 'dist/css/select2.css': [ + 'src/scss/core.scss', + 'src/scss/theme/default/layout.css' ] } } }, requirejs: { - "dist": { + 'dist': { options: { - baseUrl: "src/js", - optimize: "none", - name: "select2/core", - out: "dist/js/select2.js", + baseUrl: 'src/js', + optimize: 'none', + name: 'select2/core', + out: 'dist/js/select2.js', include: amdIncludes.concat(includes), paths: { - almond: "../../vendor/almond-0.2.9", - jquery: "jquery.shim" + almond: '../../vendor/almond-0.2.9', + jquery: 'jquery.shim' } } }, - "dist.full": { + 'dist.full': { options: { - baseUrl: "src/js", - optimize: "none", - name: "select2/core", - out: "dist/js/select2.full.js", + baseUrl: 'src/js', + optimize: 'none', + name: 'select2/core', + out: 'dist/js/select2.full.js', include: amdIncludes.concat(fullIncludes), paths: { - almond: "../../vendor/almond-0.2.9", - jquery: "../../vendor/jquery-2.1.0" + almond: '../../vendor/almond-0.2.9', + jquery: '../../vendor/jquery-2.1.0' } } }, - "amd": { + 'amd': { options: { - baseUrl: "src/js", - optimize: "none", - name: "select2/core", - out: "dist/js/select2.amd.js", + baseUrl: 'src/js', + optimize: 'none', + name: 'select2/core', + out: 'dist/js/select2.amd.js', include: includes, paths: { - jquery: "empty:" + jquery: 'empty:' } } }, - "amd.full": { + 'amd.full': { options: { - baseUrl: "src/js", - optimize: "none", - name: "select2/core", - out: "dist/js/select2.amd.full.js", + baseUrl: 'src/js', + optimize: 'none', + name: 'select2/core', + out: 'dist/js/select2.amd.full.js', include: fullIncludes, paths: { - jquery: "empty:" + jquery: 'empty:' } } } }, concat: { - "dist": { + 'dist': { src: [ - "src/js/start.js", - "dist/js/select2.js", - "src/js/end.js" + 'src/js/start.js', + 'dist/js/select2.js', + 'src/js/end.js' ], - dest: "dist/js/select2.js" + dest: 'dist/js/select2.js' }, - "dist.full": { + 'dist.full': { src: [ - "src/js/start.js", - "dist/js/select2.full.js", - "src/js/end.js" + 'src/js/start.js', + 'dist/js/select2.full.js', + 'src/js/end.js' ], - dest: "dist/js/select2.full.js" + dest: 'dist/js/select2.full.js' } }, watch: { js: { files: [ - "src/js/select2/**/*.js", - "tests/**/*.js", + 'src/js/select2/**/*.js', + 'tests/**/*.js' ], tasks: [ - "compile", - "test", + 'compile', + 'test', 'minify' ] }, css: { files: [ - "src/scss/**/*.scss" + 'src/scss/**/*.scss' ], tasks: [ - "compile", + 'compile', 'minify' ] } } }); - grunt.loadNpmTasks("grunt-contrib-concat") - grunt.loadNpmTasks("grunt-contrib-jshint") - grunt.loadNpmTasks("grunt-contrib-qunit") - grunt.loadNpmTasks("grunt-contrib-requirejs") - grunt.loadNpmTasks("grunt-contrib-uglify") - grunt.loadNpmTasks("grunt-contrib-watch") + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-qunit'); + grunt.loadNpmTasks('grunt-contrib-requirejs'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks("grunt-sass") + grunt.loadNpmTasks('grunt-sass'); - grunt.registerTask("default", ["compile", "test", "minify"]) + grunt.registerTask('default', ['compile', 'test', 'minify']); - grunt.registerTask("compile", ["requirejs", "sass:dev", "concat"]) - grunt.registerTask("minify", ["uglify", "sass:dist"]) - grunt.registerTask("test", ["qunit", "jshint"]) -} + grunt.registerTask('compile', ['requirejs', 'sass:dev', 'concat']); + grunt.registerTask('minify', ['uglify', 'sass:dist']); + grunt.registerTask('test', ['qunit', 'jshint']); +}; diff --git a/dist/js/select2.full.js b/dist/js/select2.full.js index 1182eb9d..4be5fa91 100644 --- a/dist/js/select2.full.js +++ b/dist/js/select2.full.js @@ -9534,8 +9534,6 @@ define("almond", function(){}); return jQuery; })); -define("jquery", function(){}); - define('select2/utils',[], function () { var Utils = {}; diff --git a/dist/js/select2.full.min.js b/dist/js/select2.full.min.js index 2ead2fa7..128512ff 100644 --- a/dist/js/select2.full.min.js +++ b/dist/js/select2.full.min.js @@ -1,4 +1,4 @@ var requirejs,require,define;!function(a){function b(a,b){return r.call(a,b)}function c(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=p.map,q=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,p.nodeIdCompat&&t.test(a[g])&&(a[g]=a[g].replace(t,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||q)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function d(b,c){return function(){return k.apply(a,s.call(arguments,0).concat([b,c]))}}function e(a){return function(b){return c(b,a)}}function f(a){return function(b){n[a]=b}}function g(c){if(b(o,c)){var d=o[c];delete o[c],q[c]=!0,j.apply(a,d)}if(!b(n,c)&&!b(q,c))throw new Error("No "+c);return n[c]}function h(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function i(a){return function(){return p&&p.config&&p.config[a]||{}}}var j,k,l,m,n={},o={},p={},q={},r=Object.prototype.hasOwnProperty,s=[].slice,t=/\.js$/;l=function(a,b){var d,f=h(a),i=f[0];return a=f[1],i&&(i=c(i,b),d=g(i)),i?a=d&&d.normalize?d.normalize(a,e(b)):c(a,b):(a=c(a,b),f=h(a),i=f[0],a=f[1],i&&(d=g(i))),{f:i?i+"!"+a:a,n:a,pr:i,p:d}},m={require:function(a){return d(a)},exports:function(a){var b=n[a];return"undefined"!=typeof b?b:n[a]={}},module:function(a){return{id:a,uri:"",exports:n[a],config:i(a)}}},j=function(c,e,h,i){var j,k,p,r,s,t,u=[],v=typeof h;if(i=i||c,"undefined"===v||"function"===v){for(e=!e.length&&h.length?["require","exports","module"]:e,s=0;s0&&b-1 in a}function d(a,b,c){if(ab.isFunction(b))return ab.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return ab.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(hb.test(b))return ab.filter(b,a,c);b=ab.filter(b,a)}return ab.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=ob[a]={};return ab.each(a.match(nb)||[],function(a,c){b[c]=!0}),b}function g(){$.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),ab.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=ab.expando+Math.random()}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ub,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:tb.test(c)?ab.parseJSON(c):c}catch(e){}sb.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return $.activeElement}catch(a){}}function m(a,b){return ab.nodeName(a,"table")&&ab.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Kb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)rb.set(a[c],"globalEval",!b||rb.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(rb.hasData(a)&&(f=rb.access(a),g=rb.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)ab.event.add(b,e,j[e][c])}sb.hasData(a)&&(h=sb.access(a),i=ab.extend({},h),sb.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&ab.nodeName(a,b)?ab.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&yb.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d=ab(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:ab.css(d[0],"display");return d.detach(),e}function u(a){var b=$,c=Ob[a];return c||(c=t(a,b),"none"!==c&&c||(Nb=(Nb||ab("