From f296cbcb80b89e14f43d8a690f17dddce059bb50 Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Tue, 17 Oct 2017 08:54:40 +0200 Subject: [PATCH 01/12] Use pyftpsync 2.0 --- Gruntfile.coffee | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index cbb5dd1..d46f43e 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 --progress 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"] @@ -104,7 +106,7 @@ module.exports = (grunt) -> # "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 @@ -209,7 +211,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 +224,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"] From 0648d5368c25e993c7161728a67b090cd3177457 Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Tue, 17 Oct 2017 08:54:59 +0200 Subject: [PATCH 02/12] Recommend jQuery UI 1.12 --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 67a5897..234bea9 100644 --- a/README.md +++ b/README.md @@ -43,19 +43,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 - - - + + + ``` From 499446fda75e0e26764975b276b961ec15fbb225 Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Mon, 1 Jan 2018 17:57:56 +0100 Subject: [PATCH 03/12] Update to pyftpsync 2.0 --- Gruntfile.coffee | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index cbb5dd1..d4ea245 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,7 @@ 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,.*,_*" + cmd: "pyftpsync upload . ftp://www.wwwendt.de/tech/demo/jquery-contextmenu --progress --delete-unmatched --exclude dist,node_modules,.*,_*" jscs: src: ["jquery.ui-contextmenu.js", "test/tests.js"] @@ -104,7 +104,7 @@ module.exports = (grunt) -> # "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 @@ -209,7 +209,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 +222,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"] From b0df5750ba9320285a2876f384fb4ab248d8d2ec Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Sun, 14 Jan 2018 17:15:07 +0100 Subject: [PATCH 04/12] Fix travis (upgrade node) --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 784622ac43543dced95a7e372517300e69ee8b15 Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Tue, 23 Jan 2018 21:34:31 +0100 Subject: [PATCH 05/12] Add appendTo option --- CHANGELOG.md | 3 ++- jquery.ui-contextmenu.js | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d481972..f1e2df2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ -# 1.18.2 / Unreleased +# 1.19.0 / Unreleased + - Add `appendTo` option. # 1.18.1 / 2017-08-28 diff --git a/jquery.ui-contextmenu.js b/jquery.ui-contextmenu.js index 8b11028..8e366aa 100644 --- a/jquery.ui-contextmenu.js +++ b/jquery.ui-contextmenu.js @@ -35,6 +35,7 @@ $.widget("moogle.contextmenu", { options: { addClass: "ui-contextmenu", // Add this class to the outer
    closeOnWindowBlur: true, // Close menu when window loses focus + appendTo: "body", // Set keyboard focus to first entry on open autoFocus: false, // Set keyboard focus to first entry on open autoTrigger: true, // open menu on browser's `contextmenu` event delegate: null, // selector @@ -143,7 +144,7 @@ $.widget("moogle.contextmenu", { } else if (this.$menu) { this.$menu .menu("destroy") - .removeClass(this.options.addClass) + .removeClass(opts.addClass) .hide(); } this.$menu = null; @@ -153,7 +154,7 @@ $.widget("moogle.contextmenu", { if ( !menuDef ) { return; } else if ($.isArray(menuDef)) { - this.$menu = $.moogle.contextmenu.createMenuMarkup(menuDef); + this.$menu = $.moogle.contextmenu.createMenuMarkup(menuDef, null, opts); this.menuIsTemp = true; }else if ( typeof menuDef === "string" ) { this.$menu = $(menuDef); @@ -579,10 +580,12 @@ $.extend($.moogle.contextmenu, { } }, /** Convert a nested array of command objects into a