diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..5c9953a --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,30 @@ +name: Mark stale issues and pull requests + +on: + schedule: + - cron: "0 0 * * *" + +jobs: + stale: + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: | + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. + Thank you for your contributions. + stale-pr-message: | + This pull request has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. + Thank you for your contributions. + stale-issue-label: 'stale' + exempt-issue-label: 'pinned' + stale-pr-label: 'stale' + exempt-pr-label: 'pinned' + days-before-stale: 90 + days-before-close: 14 + operations-per-run: 5 diff --git a/.travis.yml b/.travis.yml index 3f05c45..a238abe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: node_js node_js: - - 0.10 + # - 0.10 + - "8" sudo: false before_script: - npm install -g grunt-cli diff --git a/CHANGELOG.md b/CHANGELOG.md index d481972..f1655ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ -# 1.18.2 / Unreleased +# 1.19.0 / Unreleased + - [FEATURE] Add `appendTo` option. # 1.18.1 / 2017-08-28 diff --git a/Gruntfile.coffee b/Gruntfile.coffee index cbb5dd1..bb281e4 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -1,8 +1,8 @@ -#jshint node: true, camelcase: false +#jshint node: true, camelcase: false "use strict" module.exports = (grunt) -> grunt.initConfig - pkg: + pkg: grunt.file.readJSON("package.json") connect: @@ -32,7 +32,9 @@ module.exports = (grunt) -> upload: # FTP upload the demo files (requires https://github.com/mar10/pyftpsync) - cmd: "pyftpsync --progress upload . ftp://www.wwwendt.de/tech/demo/jquery-contextmenu --delete-unmatched --omit dist,node_modules,.*,_*" + stdin: true # Allow interactive console + cmd: "pyftpsync upload . ftp://www.wwwendt.de/tech/demo/jquery-contextmenu --delete-unmatched --exclude dist,node_modules,.*,_*" + # cmd: "pyftpsync --progress upload . ftp://www.wwwendt.de/tech/demo/jquery-contextmenu --delete-unmatched --omit dist,node_modules,.*,_*" jscs: src: ["jquery.ui-contextmenu.js", "test/tests.js"] @@ -46,115 +48,73 @@ module.exports = (grunt) -> jshintrc: ".jshintrc" qunit: - all: ["test/index.html", "test/index-jquery-ui-1-10.html"] - - # replace: # grunt-text-replace - # production: - # src: ["build/**/*.js"] - # overwrite : true - # replacements: [ { - # from : /@DATE/g - # # https://github.com/felixge/node-dateformat - # to : "<%= grunt.template.today('isoUtcDateTime') %>" - # },{ - # from : /buildType:\s*\"[a-zA-Z]+\"/g - # to : "buildType: \"production\"" - # },{ - # from : /debugLevel:\s*[0-9]/g - # to : "debugLevel: 1" - # } ] - # release: - # src: ["dist/**/*.js"] - # overwrite : true - # replacements: [ { - # from : /@VERSION/g - # to : "<%= pkg.version %>" - # } ] + all: [ + "test/test-jquery-3-ui-1.12.html", + "test/test-jquery-1.12-ui-1.12.html", + "test/test-jquery-1.11-ui-1.11.html", + "test/test-jquery-1.9-ui-1.10.html", + ] "saucelabs-qunit": - ui_10: + options: + build: process.env.TRAVIS_JOB_ID + throttled: 5 + # statusCheckAttempts: 180 + recordVideo: false + videoUploadOnPass: false + + ui_12: options: + testname: "jquery.ui-contextmenu qunit tests (jQuery UI 12)" urls: [ - # "http://localhost:9999/test/index.html", - "http://localhost:9999/test/test-jquery-1.9-ui-1.10.html" + "http://localhost:9999/test/test-jquery-3-ui-1.12.html" ] - build: process.env.TRAVIS_JOB_ID - throttled: 5 browsers: [ { browserName: "chrome", platform: "Windows 8.1" } - # { browserName: "firefox", platform: "Windows 8.1" } + { browserName: "firefox", platform: "Windows 8.1" } { browserName: "firefox", platform: "Linux" } - # { browserName: "internet explorer", version: "6", platform: "Windows XP" } - # { browserName: "internet explorer", version: "7", platform: "Windows XP" } - # { browserName: "internet explorer", version: "8", platform: "Windows 7" } + # jQuery UI 12+ stopped support for IE <= 10 { browserName: "internet explorer", version: "11", platform: "Windows 8.1" } { browserName: "microsoftedge", platform: "Windows 10" } - # { browserName: "safari", version: "9", platform: "OS X 10.11" } + # { browserName: "safari", version: "6", platform: "OS X 10.8" } + # { browserName: "safari", version: "7", platform: "OS X 10.9" } + # { browserName: "safari", version: "8", platform: "OS X 10.10" } + { browserName: "safari", version: "9", platform: "OS X 10.11" } { browserName: "safari", version: "10", platform: "OS X 10.12" } + { browserName: "safari", version: "11", platform: "OS X 10.12" } ] - testname: "jquery.ui-contextmenu qunit tests (jQuery UI 10)" - # statusCheckAttempts: 180 - recordVideo: false - videoUploadOnPass: false - ui_11: # UI Menu 11+ dropped support for IE7 + ui_11: # UI Menu 11+ dropped support for IE7 options: + testname: "jquery.ui-contextmenu qunit tests (jQuery UI 11+)" urls: [ "http://localhost:9999/test/test-jquery-1.11-ui-1.11.html" - # "http://localhost:9999/test/index.html", - # "http://localhost:9999/test/index-jquery-ui-1-10.html" ] - - # username: process.env.SAUCE_USERNAME, - # key: process.env.SAUCE_ACCESS_KEY, - build: process.env.TRAVIS_JOB_ID - throttled: 5 browsers: [ { browserName: "chrome", platform: "Windows 8.1" } - # { browserName: "firefox", platform: "Windows 8.1" } - # { browserName: "firefox", platform: "Windows XP" } { browserName: "firefox", platform: "Linux" } # jQuery UI 11+ stopped support for IE <= 7 - { browserName: "internet explorer", version: "8", platform: "Windows 7" } + # { browserName: "internet explorer", version: "8", platform: "Windows 7" } { browserName: "internet explorer", version: "9", platform: "Windows 7" } { browserName: "internet explorer", version: "10", platform: "Windows 8" } { browserName: "internet explorer", version: "11", platform: "Windows 8.1" } { browserName: "microsoftedge", platform: "Windows 10" } - # { browserName: "safari", version: "6", platform: "OS X 10.8" } - # { browserName: "safari", version: "7", platform: "OS X 10.9" } - # { browserName: "safari", version: "8", platform: "OS X 10.10" } - # { browserName: "safari", version: "9", platform: "OS X 10.11" } { browserName: "safari", version: "10", platform: "OS X 10.12" } ] - testname: "jquery.ui-contextmenu qunit tests (jQuery UI 11+)" - # statusCheckAttempts: 180 - recordVideo: false - videoUploadOnPass: false - ui_12: + ui_10: options: + testname: "jquery.ui-contextmenu qunit tests (jQuery UI 10)" urls: [ - "http://localhost:9999/test/test-jquery-3-ui-1.12.html" + "http://localhost:9999/test/test-jquery-1.9-ui-1.10.html" ] - build: process.env.TRAVIS_JOB_ID - throttled: 5 browsers: [ { browserName: "chrome", platform: "Windows 8.1" } - { browserName: "firefox", platform: "Windows 8.1" } { browserName: "firefox", platform: "Linux" } - # jQuery UI 12+ stopped support for IE <= 10 { browserName: "internet explorer", version: "11", platform: "Windows 8.1" } { browserName: "microsoftedge", platform: "Windows 10" } - # { browserName: "safari", version: "6", platform: "OS X 10.8" } - # { browserName: "safari", version: "7", platform: "OS X 10.9" } - # { browserName: "safari", version: "8", platform: "OS X 10.10" } - { browserName: "safari", version: "9", platform: "OS X 10.11" } { browserName: "safari", version: "10", platform: "OS X 10.12" } ] - testname: "jquery.ui-contextmenu qunit tests (jQuery UI 12)" - # statusCheckAttempts: 180 - recordVideo: false - videoUploadOnPass: false uglify: options: @@ -209,7 +169,7 @@ module.exports = (grunt) -> # Load "grunt*" dependencies for key of grunt.file.readJSON("package.json").devDependencies grunt.loadNpmTasks key if key isnt "grunt" and key.indexOf("grunt") is 0 - + grunt.registerTask "server", ["connect:demo"] grunt.registerTask "dev", ["connect:dev", "watch:dev"] grunt.registerTask "test", ["jshint", "jscs", "qunit"] @@ -222,7 +182,7 @@ module.exports = (grunt) -> grunt.registerTask "travis", ["test", "sauce"] grunt.registerTask "default", ["test"] grunt.registerTask "ci", ["test"] # Called by 'npm test' - + # "sauce", grunt.registerTask "build", ["exec:tabfix", "test", "uglify"] grunt.registerTask "upload", ["build", "exec:upload"] diff --git a/LICENSE.txt b/LICENSE.txt index adfa23f..ff1e001 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright 2013-2017 Martin Wendt and others (see commiter list on GitHub) +Copyright 2013-2018 Martin Wendt and others (see commiter list on GitHub) https://github.com/mar10/jquery-ui-contextmenu Permission is hereby granted, free of charge, to any person obtaining diff --git a/README.md b/README.md index 67a5897..bcbb8d6 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://travis-ci.org/mar10/jquery-ui-contextmenu.svg?branch=master)](https://travis-ci.org/mar10/jquery-ui-contextmenu) [![Selenium Test Status](https://saucelabs.com/buildstatus/sauce-contextmenu)](https://saucelabs.com/u/sauce-contextmenu) [![npm](https://img.shields.io/npm/dm/ui-contextmenu.svg)](https://www.npmjs.com/package/ui-contextmenu) +[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/ui-contextmenu/badge)](https://www.jsdelivr.com/package/npm/ui-contextmenu), > A jQuery plugin that provides a context menu (based on the standard [jQueryUI menu] widget). @@ -43,19 +44,20 @@ See also the unit tests and live examples First, include dependencies: -* jQuery 1.7+ (1.10 or later recommended) -* jQuery UI 1.9+ (at least core, widget, menu), 1.11+ recommended +* jQuery 1.7+ (3.x or later recommended) +* jQuery UI 1.9+ (at least core, widget, menu), 1.12+ recommended * One of the ThemeRoller CSS themes or a custom one * jquery.ui-contextmenu.js (also available as CDN on [![](https://data.jsdelivr.com/v1/package/npm/ui-contextmenu/badge)](https://www.jsdelivr.com/package/npm/ui-contextmenu), [cdnjs](https://cdnjs.com/libraries/jquery.ui-contextmenu), or [UNPKG](https://unpkg.com/ui-contextmenu@latest/jquery.ui-contextmenu.min.js)) +for example ```html - - - + + + ``` diff --git a/jquery.ui-contextmenu.js b/jquery.ui-contextmenu.js index 8b11028..a8fcf73 100644 --- a/jquery.ui-contextmenu.js +++ b/jquery.ui-contextmenu.js @@ -5,7 +5,7 @@ * * @see https://github.com/mar10/jquery-ui-contextmenu * - * Copyright (c) 2013-2017, Martin Wendt (http://wwWendt.de). Licensed MIT. + * Copyright (c) 2013-2018, Martin Wendt (http://wwWendt.de). Licensed MIT. */ (function( factory ) { @@ -35,6 +35,7 @@ $.widget("moogle.contextmenu", { options: { addClass: "ui-contextmenu", // Add this class to the outer