diff --git a/.eslintignore b/.eslintignore index 1deafa7..49b927d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,4 @@ -bower_component/** +bower_components/** dist/** external/** node_modules/** diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..17b610b --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,37 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # Node.js 10 is required by jQuery infra + NODE_VERSION: [10.x, 16.x] + NPM_SCRIPT: ["ci"] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock- + + - name: Use Node.js ${{ matrix.NODE_VERSION }} + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{ matrix.NODE_VERSION }} + + - name: Install dependencies + run: | + npm install + + - name: Run tests + run: | + npm run ${{ matrix.NPM_SCRIPT }} diff --git a/.gitignore b/.gitignore index e17adb3..8a6376e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ /dist /node_modules /package-lock.json +/*.log +/*.err diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8012f5d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -sudo: false -language: node_js -node_js: - - "14" -cache: - directories: - - node_modules -notifications: - irc: - channels: - - chat.freenode.net#jquery-dev - template: - - ! '%{repository}#%{build_number} (%{branch} - %{commit} %{author}): %{message} - - %{build_url}' -before_install: - - true && `base64 --decode <<< ZXhwb3J0IEJST1dTRVJTVEFDS19VU0VSTkFNRT1qcXVlcnljb2xvcjE=` - - true && `base64 --decode <<< ZXhwb3J0IEJST1dTRVJTVEFDS19LRVk9RllGR3Z1WWdyWHF6OHlrN1JXUWU=` -env: - - NPM_SCRIPT=ci -matrix: - fast_finish: true - include: - - node_js: "14" - env: NPM_SCRIPT=browserstack -script: - - npm run-script $NPM_SCRIPT diff --git a/Gruntfile.js b/Gruntfile.js index 2fdfd72..125e519 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -42,9 +42,10 @@ grunt.initConfig( { "git", "git.min" ], - "jquery-color": [ + "jquery-3": [ "3.x-git", "3.x-git.min", + "3.6.0", "3.5.1", "3.4.1", "3.3.1", @@ -53,7 +54,9 @@ grunt.initConfig( { "3.0.0", "2.2.4", "2.1.4", - "2.0.3", + "2.0.3" + ], + "jquery-color-2": [ "1.12.4", "1.11.3", "1.10.2", @@ -124,7 +127,10 @@ grunt.initConfig( { "jquery-3.4.1/LICENSE.txt": "jquery-3.4.1/LICENSE.txt", "jquery-3.5.1/jquery.js": "jquery-3.5.1/dist/jquery.js", - "jquery-3.5.1/LICENSE.txt": "jquery-3.5.1/LICENSE.txt" + "jquery-3.5.1/LICENSE.txt": "jquery-3.5.1/LICENSE.txt", + + "jquery-3.6.0/jquery.js": "jquery-3.6.0/dist/jquery.js", + "jquery-3.6.0/LICENSE.txt": "jquery-3.6.0/LICENSE.txt" } } }, @@ -148,7 +154,14 @@ grunt.initConfig( { }, qunit: { - files: "test/index.html" + files: "test/index.html", + options: { + puppeteer: { + args: process.env.JENKINS_HOME ? + [ "--no-sandbox", "--disable-setuid-sandbox" ] : + [] + } + } }, concat: concat, @@ -254,7 +267,13 @@ grunt.registerTask( "testswarm", function( commit, configFile, projectName, brow ); } ); -grunt.registerTask( "default", [ "eslint", "qunit", "build", "compare_size" ] ); +grunt.registerTask( "default", [ + "eslint", + "bowercopy", + "qunit", + "build", + "compare_size" +] ); grunt.registerTask( "build", [ "max", "concat", "uglify" ] ); grunt.registerTask( "ci", [ "eslint", "qunit" ] ); diff --git a/README.md b/README.md index 479aa31..6be235f 100644 --- a/README.md +++ b/README.md @@ -6,21 +6,19 @@ Supported jQuery versions: 1.5+ ## Browser Support -jQuery Color 3.x supports the following browsers: +jQuery Color 2.x supports the following browsers: Desktop: * Chrome: (Current - 1) and Current * Edge: (Current - 1) and Current, 18 * Firefox: (Current - 1) and Current, ESR -* Internet Explorer: 9+ -* Safari: (Current - 1) and Current +* Internet Explorer: 6+ +* Safari: 5.1+ * Opera: Current Mobile: -* Chrome on Android: (Current - 1) and Current -* Safari on iOS: (Current - 2), (Current - 1) and Current - -Information on browser support of jQuery Color 2.x can be found in the [Browser Support section](https://github.com/jquery/jquery-color/blob/2.x-stable/README.md#browser-support) in its README. +* Stock browser on Android 4.0+ +* Safari on iOS 7+ ## Using jQuery Color in Production 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: @@ -81,7 +79,7 @@ div { border: 1px solid green; } - +
diff --git a/bower.json b/bower.json index 8f03eff..80e465f 100644 --- a/bower.json +++ b/bower.json @@ -16,7 +16,7 @@ "test" ], "devDependencies": { - "qunit": "2.10.0", + "qunit": "1.23.1", "jquery-1.5.2": "jquery#1.5.2", "jquery-1.6.4": "jquery#1.6.4", "jquery-1.7.2": "jquery#1.7.2", @@ -33,6 +33,7 @@ "jquery-3.2.1": "jquery#3.2.1", "jquery-3.3.1": "jquery#3.3.1", "jquery-3.4.1": "jquery#3.4.1", - "jquery-3.5.1": "jquery#3.5.1" + "jquery-3.5.1": "jquery#3.5.1", + "jquery-3.6.0": "jquery#3.6.0" } } diff --git a/build/browserstack-current.json b/build/browserstack-current.json deleted file mode 100644 index 061b38f..0000000 --- a/build/browserstack-current.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "username": "BROWSERSTACK_USERNAME", - "key": "BROWSERSTACK_KEY", - "test_framework": "qunit", - "test_path": [ - "test/index.html" - ], - "browsers": [ - "chrome_current", - "firefox_current", - "opera_current", - "safari_current", - "ie_11", - "edge_18", - "edge_latest", - { - "os": "iOS", - "os_version": "11", - "device": "iPhone X" - }, - { - "os": "iOS", - "os_version": "12", - "device": "iPhone XS" - } - ] -} diff --git a/build/browserstack-legacy.json b/build/browserstack-legacy.json deleted file mode 100644 index a0a93d3..0000000 --- a/build/browserstack-legacy.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "username": "BROWSERSTACK_USERNAME", - "key": "BROWSERSTACK_KEY", - "test_framework": "qunit", - "test_path": [ - "test/index.html" - ], - "browsers": [ - "chrome_previous", - "firefox_previous", - "safari_previous", - "edge_previous", - "ie_10", - { - "os": "iOS", - "os_version": "7.0", - "device": "iPhone 5S", - "real_mobile": false - }, - { - "os": "iOS", - "os_version": "8.3", - "device": "iPhone 6", - "real_mobile": false - }, - { - "os": "iOS", - "os_version": "9.3", - "device": "iPhone 6S", - "real_mobile": false - } - ] -} diff --git a/build/release.js b/build/release.js index 60bce8c..187df60 100644 --- a/build/release.js +++ b/build/release.js @@ -1,20 +1,45 @@ "use strict"; module.exports = function( Release ) { - var - files = [ + var shell = require( "shelljs" ), + cdnFolder = "dist/cdn", + distFiles = [ "dist/jquery.color.js", "dist/jquery.color.min.js", "dist/jquery.color.plus-names.js", "dist/jquery.color.plus-names.min.js", "dist/jquery.color.svg-names.js", "dist/jquery.color.svg-names.min.js" - ]; + ], + releaseFiles = { + "jquery.color-@VERSION.js": "dist/jquery.color.js", + "jquery.color-@VERSION.min.js": "dist/jquery.color.min.js", + "jquery.color.plus-names-@VERSION.js": "dist/jquery.color.plus-names.js", + "jquery.color.plus-names-@VERSION.min.js": "dist/jquery.color.plus-names.min.js", + "jquery.color.svg-names-@VERSION.js": "dist/jquery.color.svg-names.js", + "jquery.color.svg-names-@VERSION.min.js": "dist/jquery.color.svg-names.min.js" + }; + + function makeReleaseCopies( Release ) { + shell.mkdir( "-p", cdnFolder ); + + Object.keys( releaseFiles ).forEach( function( key ) { + var builtFile = releaseFiles[ key ], + unpathedFile = key.replace( /@VERSION/g, Release.newVersion ), + releaseFile = cdnFolder + "/" + unpathedFile; + + shell.cp( "-f", builtFile, releaseFile ); + } ); + } Release.define( { npmPublish: true, issueTracker: "github", - cdnPublish: "dist", + cdnPublish: cdnFolder, + + changelogShell: function() { + return "# Changelog for jQuery Color v" + Release.newVersion + "\n"; + }, /** * Generates any release artifacts that should be included in the release. @@ -24,7 +49,12 @@ module.exports = function( Release ) { */ generateArtifacts: function( callback ) { Release.exec( "grunt", "Grunt command failed" ); - callback( files ); + makeReleaseCopies( Release ); + callback( distFiles ); } } ); }; + +module.exports.dependencies = [ + "shelljs@0.8.4" +]; diff --git a/build/run-browserstack.sh b/build/run-browserstack.sh deleted file mode 100644 index ef39d0b..0000000 --- a/build/run-browserstack.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -for run in \ - "./build/browserstack-current.json" \ - "./build/browserstack-legacy.json" -do - export BROWSERSTACK_JSON=$run - if ! node_modules/.bin/browserstack-runner ; then - exit 1 - fi -done - -exit 0 diff --git a/external/jquery-3.6.0/LICENSE.txt b/external/jquery-3.6.0/LICENSE.txt new file mode 100644 index 0000000..f642c3f --- /dev/null +++ b/external/jquery-3.6.0/LICENSE.txt @@ -0,0 +1,20 @@ +Copyright OpenJS Foundation and other contributors, https://openjsf.org/ + +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 to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, 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. diff --git a/external/jquery-3.6.0/jquery.js b/external/jquery-3.6.0/jquery.js new file mode 100644 index 0000000..fc6c299 --- /dev/null +++ b/external/jquery-3.6.0/jquery.js @@ -0,0 +1,10881 @@ +/*! + * jQuery JavaScript Library v3.6.0 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2021-03-02T17:08Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var flat = arr.flat ? function( array ) { + return arr.flat.call( array ); +} : function( array ) { + return arr.concat.apply( [], array ); +}; + + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + +var isFunction = function isFunction( obj ) { + + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML