From 621e821cca2bd732e18190c8392099180ab9fac8 Mon Sep 17 00:00:00 2001 From: Harold Paulson Date: Tue, 16 Mar 2021 20:50:02 -0700 Subject: [PATCH] import vhost-audit --- .DS_Store | Bin 0 -> 6148 bytes README.md | 0 bin/cron.pl | 27 + bin/vhost-audit.pl | 103 + contrib/contextmenu/README.md | 412 ++ contrib/contextmenu/bower.json | 43 + contrib/contextmenu/contextMenu.jquery.json | 30 + .../dist/font/context-menu-icons.eot | Bin 0 -> 3380 bytes .../dist/font/context-menu-icons.ttf | Bin 0 -> 3172 bytes .../dist/font/context-menu-icons.woff | Bin 0 -> 2068 bytes .../dist/font/context-menu-icons.woff2 | Bin 0 -> 1564 bytes .../contextmenu/dist/jquery.contextMenu.css | 206 + .../contextmenu/dist/jquery.contextMenu.js | 1904 +++++++ .../dist/jquery.contextMenu.min.css | 16 + .../dist/jquery.contextMenu.min.css.map | 1 + .../dist/jquery.contextMenu.min.js | 18 + .../dist/jquery.contextMenu.min.js.map | 1 + .../contextmenu/dist/jquery.ui.position.js | 517 ++ .../dist/jquery.ui.position.min.js | 4 + .../contextmenu/documentation/CONTRIBUTE.md | 5 + .../contextmenu/documentation/couscous.yml | 142 + contrib/contextmenu/documentation/demo.md | 76 + .../documentation/demo/accesskeys.md | 44 + .../documentation/demo/accesskeys_test.md | 42 + .../documentation/demo/async-create.md | 64 + .../documentation/demo/callback.md | 49 + .../documentation/demo/callback_test.md | 48 + .../documentation/demo/custom-command.md | 94 + .../documentation/demo/custom-command_test.md | 94 + .../documentation/demo/disabled-callback.md | 46 + .../demo/disabled-callback_test.md | 44 + .../documentation/demo/disabled-changing.md | 52 + .../demo/disabled-changing_test.md | 50 + .../documentation/demo/disabled-menu.md | 58 + .../documentation/demo/disabled.md | 36 + .../documentation/demo/disabled_test.md | 35 + .../documentation/demo/dynamic-create.md | 49 + .../contextmenu/documentation/demo/dynamic.md | 55 + .../documentation/demo/html5-import.md | 52 + .../demo/html5-polyfill-firefox8.md | 66 + .../documentation/demo/html5-polyfill.md | 55 + .../contextmenu/documentation/demo/input.md | 121 + .../demo/keeping-contextmenu-open.md | 45 + .../documentation/demo/menu-title.md | 143 + .../documentation/demo/on-dom-element.md | 56 + .../documentation/demo/sub-menus.md | 66 + .../documentation/demo/sub-menus_test.md | 64 + .../documentation/demo/trigger-custom.md | 53 + .../demo/trigger-hover-autohide.md | 45 + .../documentation/demo/trigger-hover.md | 45 + .../documentation/demo/trigger-left-click.md | 43 + .../documentation/demo/trigger-swipe.md | 65 + contrib/contextmenu/documentation/docs.md | 398 ++ .../docs/custom-command-types.md | 35 + .../documentation/docs/customize.md | 26 + .../contextmenu/documentation/docs/events.md | 111 + .../documentation/docs/html5-polyfill.md | 68 + .../documentation/docs/input-helpers.md | 61 + .../contextmenu/documentation/docs/items.md | 489 ++ .../documentation/docs/plugin-commands.md | 70 + .../documentation/docs/runtime-options.md | 118 + contrib/contextmenu/documentation/index.md | 55 + .../contextmenu/documentation/website/LICENSE | 23 + .../documentation/website/README.md | 99 + .../documentation/website/couscous.yml | 27 + .../documentation/website/css/screen.css | 172 + .../documentation/website/css/theme-fixes.css | 24 + .../documentation/website/css/theme.css | 4919 +++++++++++++++++ .../documentation/website/default.twig | 129 + .../website/fonts/2C6A5F_0_0.eot | Bin 0 -> 78071 bytes .../website/fonts/2C6A5F_0_0.svg | 2056 +++++++ .../website/fonts/2C6A5F_0_0.ttf | Bin 0 -> 140108 bytes .../website/fonts/2C6A5F_0_0.woff | Bin 0 -> 92623 bytes .../website/fonts/2C6A5F_0_0.woff2 | Bin 0 -> 74718 bytes .../website/fonts/2C6A5F_1_0.eot | Bin 0 -> 82412 bytes .../website/fonts/2C6A5F_1_0.svg | 2009 +++++++ .../website/fonts/2C6A5F_1_0.ttf | Bin 0 -> 139660 bytes .../website/fonts/2C6A5F_1_0.woff | Bin 0 -> 95365 bytes .../website/fonts/2C6A5F_1_0.woff2 | Bin 0 -> 78925 bytes .../website/fonts/2D5240_0_0.eot | Bin 0 -> 28883 bytes .../website/fonts/2D5240_0_0.ttf | Bin 0 -> 112880 bytes .../website/fonts/2D5240_0_0.woff | Bin 0 -> 40011 bytes .../website/fonts/2D5240_0_0.woff2 | Bin 0 -> 25981 bytes .../website/fonts/2D5240_1_0.eot | Bin 0 -> 25508 bytes .../website/fonts/2D5240_1_0.ttf | Bin 0 -> 98248 bytes .../website/fonts/2D5240_1_0.woff | Bin 0 -> 34743 bytes .../website/fonts/2D5240_1_0.woff2 | Bin 0 -> 23074 bytes .../website/fonts/2D5240_2_0.eot | Bin 0 -> 58866 bytes .../website/fonts/2D5240_2_0.ttf | Bin 0 -> 209648 bytes .../website/fonts/2D5240_2_0.woff | Bin 0 -> 83458 bytes .../website/fonts/2D5240_2_0.woff2 | Bin 0 -> 54711 bytes .../website/fonts/FontAwesome.otf | Bin 0 -> 62856 bytes .../website/fonts/ProximaNova-Reg-webfont.eot | Bin 0 -> 19681 bytes .../website/fonts/ProximaNova-Reg-webfont.svg | 555 ++ .../website/fonts/ProximaNova-Reg-webfont.ttf | Bin 0 -> 50296 bytes .../fonts/ProximaNova-Reg-webfont.woff | Bin 0 -> 22232 bytes .../fonts/ProximaNova-Sbold-webfont.eot | Bin 0 -> 19409 bytes .../fonts/ProximaNova-Sbold-webfont.svg | 555 ++ .../fonts/ProximaNova-Sbold-webfont.ttf | Bin 0 -> 48408 bytes .../fonts/ProximaNova-Sbold-webfont.woff | Bin 0 -> 22024 bytes .../website/fonts/fontawesome-webfont.eot | Bin 0 -> 38205 bytes .../website/fonts/fontawesome-webfont.svg | 414 ++ .../website/fonts/fontawesome-webfont.ttf | Bin 0 -> 80652 bytes .../website/fonts/fontawesome-webfont.woff | Bin 0 -> 44432 bytes .../website/images/swis-logo.jpg | Bin 0 -> 32955 bytes .../documentation/website/js/main.js | 36 + .../documentation/website/js/theme.js | 47 + .../website/original-theme/bower.json | 6 + .../website/original-theme/css/badge_only.css | 2 + .../original-theme/sass/_theme_badge.sass | 93 + .../original-theme/sass/_theme_badge_fa.sass | 68 + .../sass/_theme_breadcrumbs.sass | 25 + .../_theme_font_awesome_compatibility.sass | 22 + .../original-theme/sass/_theme_layout.sass | 292 + .../original-theme/sass/_theme_mathjax.sass | 5 + .../original-theme/sass/_theme_rst.sass | 282 + .../original-theme/sass/_theme_variables.sass | 12 + .../original-theme/sass/badge_only.sass | 16 + .../website/original-theme/sass/theme.sass | 53 + .../documentation/website/screenshot.png | Bin 0 -> 144199 bytes .../screenshots/jquery-contextMenu.png | Bin 0 -> 17118 bytes .../screenshots/jquery-contextMenu.subs.png | Bin 0 -> 16884 bytes .../screenshots/native.firefox-9.0a1.png | Bin 0 -> 21566 bytes contrib/contextmenu/gulpfile.js | 176 + contrib/contextmenu/karma.conf.js | 76 + contrib/contextmenu/package.json | 97 + contrib/contextmenu/src/icons/add.svg | 1 + contrib/contextmenu/src/icons/copy.svg | 1 + contrib/contextmenu/src/icons/cut.svg | 1 + contrib/contextmenu/src/icons/delete.svg | 1 + contrib/contextmenu/src/icons/edit.svg | 1 + contrib/contextmenu/src/icons/paste.svg | 1 + contrib/contextmenu/src/icons/quit.svg | 1 + contrib/contextmenu/src/jquery.contextMenu.js | 1904 +++++++ contrib/contextmenu/src/jquery.ui.position.js | 517 ++ .../contextmenu/src/jquery.ui.position.min.js | 4 + contrib/contextmenu/src/sass/_icons.scss | 22 + contrib/contextmenu/src/sass/_variables.scss | 49 + .../src/sass/icons/_icon_classes.scss.tpl | 4 + .../contextmenu/src/sass/icons/_mixins.scss | 78 + .../src/sass/icons/_variables.scss | 11 + .../src/sass/icons/_variables.scss.tpl | 5 + .../src/sass/jquery.contextMenu.scss | 147 + contrib/contextmenu/test/index.html | 24 + .../test/integration/accesskeys.js | 48 + .../test/integration/async-create.js | 15 + .../contextmenu/test/integration/callback.js | 60 + .../test/integration/custom-command.js | 42 + .../test/integration/disabled-callback.js | 32 + .../test/integration/disabled-changing.js | 51 + .../test/integration/disabled-menu.js | 54 + .../contextmenu/test/integration/disabled.js | 32 + .../test/integration/dynamic-create.js | 16 + .../contextmenu/test/integration/dynamic.js | 39 + .../test/integration/html/accesskeys.html | 365 ++ .../integration/html/accesskeys_test.html | 369 ++ .../test/integration/html/async-create.html | 385 ++ .../test/integration/html/callback.html | 371 ++ .../test/integration/html/callback_test.html | 375 ++ .../test/integration/html/custom-command.html | 414 ++ .../integration/html/custom-command_test.html | 419 ++ .../integration/html/disabled-callback.html | 366 ++ .../html/disabled-callback_test.html | 370 ++ .../integration/html/disabled-changing.html | 373 ++ .../html/disabled-changing_test.html | 377 ++ .../test/integration/html/disabled-menu.html | 377 ++ .../test/integration/html/disabled.html | 358 ++ .../test/integration/html/disabled_test.html | 362 ++ .../test/integration/html/dynamic-create.html | 370 ++ .../test/integration/html/dynamic.html | 374 ++ .../test/integration/html/html5-import.html | 362 ++ .../html/html5-polyfill-firefox8.html | 366 ++ .../test/integration/html/html5-polyfill.html | 362 ++ .../test/integration/html/input.html | 442 ++ .../html/keeping-contextmenu-open.html | 366 ++ .../test/integration/html/menu-title.html | 452 ++ .../test/integration/html/on-dom-element.html | 373 ++ .../test/integration/html/sub-menus.html | 387 ++ .../test/integration/html/sub-menus_test.html | 391 ++ .../test/integration/html/trigger-custom.html | 373 ++ .../html/trigger-hover-autohide.html | 366 ++ .../test/integration/html/trigger-hover.html | 365 ++ .../integration/html/trigger-left-click.html | 364 ++ .../test/integration/html/trigger-swipe.html | 383 ++ contrib/contextmenu/test/integration/input.js | 39 + .../integration/keeping-contextmenu-open.js | 40 + .../test/integration/on-dom-element.js | 25 + .../contextmenu/test/integration/sub-menus.js | 68 + .../test/integration/trigger-custom.js | 19 + .../test/integration/trigger-left-click.js | 18 + .../test/integration/trigger-right-click.js | 17 + .../test/integration_test_helper.js | 27 + contrib/contextmenu/test/unit/test-events.js | 143 + file.php | 120 + index.php | 192 + json/abaretirement.com-ignore.json | 310 ++ json/abaretirement.com.json | 30 + json/activitytickets.com-ignore.json | 66 + json/activitytickets.com.json | 35 + json/blog.financialpsychology.com-ignore.json | 38 + json/blog.financialpsychology.com.json | 35 + json/dvdreview.com-ignore.json | 370 ++ json/dvdreview.com.json | 934 ++++ json/kathleengurney.com-ignore.json | 38 + json/kathleengurney.com.json | 35 + json/masonmaloofdesigns.com-ignore.json | 198 + json/masonmaloofdesigns.com.json | 35 + json/new.abaretirement.com-ignore.json | 62 + json/new.abaretirement.com.json | 35 + json/pabulletin.abaretirement.com-ignore.json | 154 + json/pabulletin.abaretirement.com.json | 30 + ...perspectives.abaretirement.com-ignore.json | 198 + json/perspectives.abaretirement.com.json | 30 + json/roundhillpinesresort.com-ignore.json | 350 ++ json/roundhillpinesresort.com.json | 43 + json/sierraweb.com.json | 46 + json/tahoedog.com-ignore.json | 46 + json/tahoedog.com.json | 35 + json/tahoetransportation.org-ignore.json | 2834 ++++++++++ json/tahoetransportation.org.json | 3431 ++++++++++++ json/thovanyenson.com.json | 0 sites.txt | 7 + template.php | 176 + templates/index.php | 302 + 224 files changed, 44154 insertions(+) create mode 100644 .DS_Store create mode 100644 README.md create mode 100644 bin/cron.pl create mode 100644 bin/vhost-audit.pl create mode 100644 contrib/contextmenu/README.md create mode 100644 contrib/contextmenu/bower.json create mode 100644 contrib/contextmenu/contextMenu.jquery.json create mode 100644 contrib/contextmenu/dist/font/context-menu-icons.eot create mode 100644 contrib/contextmenu/dist/font/context-menu-icons.ttf create mode 100644 contrib/contextmenu/dist/font/context-menu-icons.woff create mode 100644 contrib/contextmenu/dist/font/context-menu-icons.woff2 create mode 100644 contrib/contextmenu/dist/jquery.contextMenu.css create mode 100644 contrib/contextmenu/dist/jquery.contextMenu.js create mode 100644 contrib/contextmenu/dist/jquery.contextMenu.min.css create mode 100644 contrib/contextmenu/dist/jquery.contextMenu.min.css.map create mode 100644 contrib/contextmenu/dist/jquery.contextMenu.min.js create mode 100644 contrib/contextmenu/dist/jquery.contextMenu.min.js.map create mode 100644 contrib/contextmenu/dist/jquery.ui.position.js create mode 100644 contrib/contextmenu/dist/jquery.ui.position.min.js create mode 100644 contrib/contextmenu/documentation/CONTRIBUTE.md create mode 100644 contrib/contextmenu/documentation/couscous.yml create mode 100644 contrib/contextmenu/documentation/demo.md create mode 100644 contrib/contextmenu/documentation/demo/accesskeys.md create mode 100644 contrib/contextmenu/documentation/demo/accesskeys_test.md create mode 100644 contrib/contextmenu/documentation/demo/async-create.md create mode 100644 contrib/contextmenu/documentation/demo/callback.md create mode 100644 contrib/contextmenu/documentation/demo/callback_test.md create mode 100644 contrib/contextmenu/documentation/demo/custom-command.md create mode 100644 contrib/contextmenu/documentation/demo/custom-command_test.md create mode 100644 contrib/contextmenu/documentation/demo/disabled-callback.md create mode 100644 contrib/contextmenu/documentation/demo/disabled-callback_test.md create mode 100644 contrib/contextmenu/documentation/demo/disabled-changing.md create mode 100644 contrib/contextmenu/documentation/demo/disabled-changing_test.md create mode 100644 contrib/contextmenu/documentation/demo/disabled-menu.md create mode 100644 contrib/contextmenu/documentation/demo/disabled.md create mode 100644 contrib/contextmenu/documentation/demo/disabled_test.md create mode 100644 contrib/contextmenu/documentation/demo/dynamic-create.md create mode 100644 contrib/contextmenu/documentation/demo/dynamic.md create mode 100644 contrib/contextmenu/documentation/demo/html5-import.md create mode 100644 contrib/contextmenu/documentation/demo/html5-polyfill-firefox8.md create mode 100644 contrib/contextmenu/documentation/demo/html5-polyfill.md create mode 100644 contrib/contextmenu/documentation/demo/input.md create mode 100644 contrib/contextmenu/documentation/demo/keeping-contextmenu-open.md create mode 100644 contrib/contextmenu/documentation/demo/menu-title.md create mode 100644 contrib/contextmenu/documentation/demo/on-dom-element.md create mode 100644 contrib/contextmenu/documentation/demo/sub-menus.md create mode 100644 contrib/contextmenu/documentation/demo/sub-menus_test.md create mode 100644 contrib/contextmenu/documentation/demo/trigger-custom.md create mode 100644 contrib/contextmenu/documentation/demo/trigger-hover-autohide.md create mode 100644 contrib/contextmenu/documentation/demo/trigger-hover.md create mode 100644 contrib/contextmenu/documentation/demo/trigger-left-click.md create mode 100644 contrib/contextmenu/documentation/demo/trigger-swipe.md create mode 100644 contrib/contextmenu/documentation/docs.md create mode 100644 contrib/contextmenu/documentation/docs/custom-command-types.md create mode 100644 contrib/contextmenu/documentation/docs/customize.md create mode 100644 contrib/contextmenu/documentation/docs/events.md create mode 100644 contrib/contextmenu/documentation/docs/html5-polyfill.md create mode 100644 contrib/contextmenu/documentation/docs/input-helpers.md create mode 100644 contrib/contextmenu/documentation/docs/items.md create mode 100644 contrib/contextmenu/documentation/docs/plugin-commands.md create mode 100644 contrib/contextmenu/documentation/docs/runtime-options.md create mode 100644 contrib/contextmenu/documentation/index.md create mode 100644 contrib/contextmenu/documentation/website/LICENSE create mode 100644 contrib/contextmenu/documentation/website/README.md create mode 100644 contrib/contextmenu/documentation/website/couscous.yml create mode 100644 contrib/contextmenu/documentation/website/css/screen.css create mode 100644 contrib/contextmenu/documentation/website/css/theme-fixes.css create mode 100644 contrib/contextmenu/documentation/website/css/theme.css create mode 100644 contrib/contextmenu/documentation/website/default.twig create mode 100644 contrib/contextmenu/documentation/website/fonts/2C6A5F_0_0.eot create mode 100644 contrib/contextmenu/documentation/website/fonts/2C6A5F_0_0.svg create mode 100644 contrib/contextmenu/documentation/website/fonts/2C6A5F_0_0.ttf create mode 100644 contrib/contextmenu/documentation/website/fonts/2C6A5F_0_0.woff create mode 100644 contrib/contextmenu/documentation/website/fonts/2C6A5F_0_0.woff2 create mode 100644 contrib/contextmenu/documentation/website/fonts/2C6A5F_1_0.eot create mode 100644 contrib/contextmenu/documentation/website/fonts/2C6A5F_1_0.svg create mode 100644 contrib/contextmenu/documentation/website/fonts/2C6A5F_1_0.ttf create mode 100644 contrib/contextmenu/documentation/website/fonts/2C6A5F_1_0.woff create mode 100644 contrib/contextmenu/documentation/website/fonts/2C6A5F_1_0.woff2 create mode 100644 contrib/contextmenu/documentation/website/fonts/2D5240_0_0.eot create mode 100644 contrib/contextmenu/documentation/website/fonts/2D5240_0_0.ttf create mode 100644 contrib/contextmenu/documentation/website/fonts/2D5240_0_0.woff create mode 100644 contrib/contextmenu/documentation/website/fonts/2D5240_0_0.woff2 create mode 100644 contrib/contextmenu/documentation/website/fonts/2D5240_1_0.eot create mode 100644 contrib/contextmenu/documentation/website/fonts/2D5240_1_0.ttf create mode 100644 contrib/contextmenu/documentation/website/fonts/2D5240_1_0.woff create mode 100644 contrib/contextmenu/documentation/website/fonts/2D5240_1_0.woff2 create mode 100644 contrib/contextmenu/documentation/website/fonts/2D5240_2_0.eot create mode 100644 contrib/contextmenu/documentation/website/fonts/2D5240_2_0.ttf create mode 100644 contrib/contextmenu/documentation/website/fonts/2D5240_2_0.woff create mode 100644 contrib/contextmenu/documentation/website/fonts/2D5240_2_0.woff2 create mode 100644 contrib/contextmenu/documentation/website/fonts/FontAwesome.otf create mode 100644 contrib/contextmenu/documentation/website/fonts/ProximaNova-Reg-webfont.eot create mode 100644 contrib/contextmenu/documentation/website/fonts/ProximaNova-Reg-webfont.svg create mode 100644 contrib/contextmenu/documentation/website/fonts/ProximaNova-Reg-webfont.ttf create mode 100644 contrib/contextmenu/documentation/website/fonts/ProximaNova-Reg-webfont.woff create mode 100644 contrib/contextmenu/documentation/website/fonts/ProximaNova-Sbold-webfont.eot create mode 100644 contrib/contextmenu/documentation/website/fonts/ProximaNova-Sbold-webfont.svg create mode 100644 contrib/contextmenu/documentation/website/fonts/ProximaNova-Sbold-webfont.ttf create mode 100644 contrib/contextmenu/documentation/website/fonts/ProximaNova-Sbold-webfont.woff create mode 100644 contrib/contextmenu/documentation/website/fonts/fontawesome-webfont.eot create mode 100644 contrib/contextmenu/documentation/website/fonts/fontawesome-webfont.svg create mode 100644 contrib/contextmenu/documentation/website/fonts/fontawesome-webfont.ttf create mode 100644 contrib/contextmenu/documentation/website/fonts/fontawesome-webfont.woff create mode 100644 contrib/contextmenu/documentation/website/images/swis-logo.jpg create mode 100644 contrib/contextmenu/documentation/website/js/main.js create mode 100644 contrib/contextmenu/documentation/website/js/theme.js create mode 100644 contrib/contextmenu/documentation/website/original-theme/bower.json create mode 100644 contrib/contextmenu/documentation/website/original-theme/css/badge_only.css create mode 100644 contrib/contextmenu/documentation/website/original-theme/sass/_theme_badge.sass create mode 100644 contrib/contextmenu/documentation/website/original-theme/sass/_theme_badge_fa.sass create mode 100644 contrib/contextmenu/documentation/website/original-theme/sass/_theme_breadcrumbs.sass create mode 100644 contrib/contextmenu/documentation/website/original-theme/sass/_theme_font_awesome_compatibility.sass create mode 100644 contrib/contextmenu/documentation/website/original-theme/sass/_theme_layout.sass create mode 100644 contrib/contextmenu/documentation/website/original-theme/sass/_theme_mathjax.sass create mode 100644 contrib/contextmenu/documentation/website/original-theme/sass/_theme_rst.sass create mode 100644 contrib/contextmenu/documentation/website/original-theme/sass/_theme_variables.sass create mode 100644 contrib/contextmenu/documentation/website/original-theme/sass/badge_only.sass create mode 100644 contrib/contextmenu/documentation/website/original-theme/sass/theme.sass create mode 100644 contrib/contextmenu/documentation/website/screenshot.png create mode 100644 contrib/contextmenu/documentation/website/screenshots/jquery-contextMenu.png create mode 100644 contrib/contextmenu/documentation/website/screenshots/jquery-contextMenu.subs.png create mode 100644 contrib/contextmenu/documentation/website/screenshots/native.firefox-9.0a1.png create mode 100644 contrib/contextmenu/gulpfile.js create mode 100644 contrib/contextmenu/karma.conf.js create mode 100644 contrib/contextmenu/package.json create mode 100644 contrib/contextmenu/src/icons/add.svg create mode 100644 contrib/contextmenu/src/icons/copy.svg create mode 100644 contrib/contextmenu/src/icons/cut.svg create mode 100644 contrib/contextmenu/src/icons/delete.svg create mode 100644 contrib/contextmenu/src/icons/edit.svg create mode 100644 contrib/contextmenu/src/icons/paste.svg create mode 100644 contrib/contextmenu/src/icons/quit.svg create mode 100644 contrib/contextmenu/src/jquery.contextMenu.js create mode 100644 contrib/contextmenu/src/jquery.ui.position.js create mode 100644 contrib/contextmenu/src/jquery.ui.position.min.js create mode 100644 contrib/contextmenu/src/sass/_icons.scss create mode 100644 contrib/contextmenu/src/sass/_variables.scss create mode 100644 contrib/contextmenu/src/sass/icons/_icon_classes.scss.tpl create mode 100644 contrib/contextmenu/src/sass/icons/_mixins.scss create mode 100644 contrib/contextmenu/src/sass/icons/_variables.scss create mode 100644 contrib/contextmenu/src/sass/icons/_variables.scss.tpl create mode 100644 contrib/contextmenu/src/sass/jquery.contextMenu.scss create mode 100644 contrib/contextmenu/test/index.html create mode 100644 contrib/contextmenu/test/integration/accesskeys.js create mode 100644 contrib/contextmenu/test/integration/async-create.js create mode 100644 contrib/contextmenu/test/integration/callback.js create mode 100644 contrib/contextmenu/test/integration/custom-command.js create mode 100644 contrib/contextmenu/test/integration/disabled-callback.js create mode 100644 contrib/contextmenu/test/integration/disabled-changing.js create mode 100644 contrib/contextmenu/test/integration/disabled-menu.js create mode 100644 contrib/contextmenu/test/integration/disabled.js create mode 100644 contrib/contextmenu/test/integration/dynamic-create.js create mode 100644 contrib/contextmenu/test/integration/dynamic.js create mode 100644 contrib/contextmenu/test/integration/html/accesskeys.html create mode 100644 contrib/contextmenu/test/integration/html/accesskeys_test.html create mode 100644 contrib/contextmenu/test/integration/html/async-create.html create mode 100644 contrib/contextmenu/test/integration/html/callback.html create mode 100644 contrib/contextmenu/test/integration/html/callback_test.html create mode 100644 contrib/contextmenu/test/integration/html/custom-command.html create mode 100644 contrib/contextmenu/test/integration/html/custom-command_test.html create mode 100644 contrib/contextmenu/test/integration/html/disabled-callback.html create mode 100644 contrib/contextmenu/test/integration/html/disabled-callback_test.html create mode 100644 contrib/contextmenu/test/integration/html/disabled-changing.html create mode 100644 contrib/contextmenu/test/integration/html/disabled-changing_test.html create mode 100644 contrib/contextmenu/test/integration/html/disabled-menu.html create mode 100644 contrib/contextmenu/test/integration/html/disabled.html create mode 100644 contrib/contextmenu/test/integration/html/disabled_test.html create mode 100644 contrib/contextmenu/test/integration/html/dynamic-create.html create mode 100644 contrib/contextmenu/test/integration/html/dynamic.html create mode 100644 contrib/contextmenu/test/integration/html/html5-import.html create mode 100644 contrib/contextmenu/test/integration/html/html5-polyfill-firefox8.html create mode 100644 contrib/contextmenu/test/integration/html/html5-polyfill.html create mode 100644 contrib/contextmenu/test/integration/html/input.html create mode 100644 contrib/contextmenu/test/integration/html/keeping-contextmenu-open.html create mode 100644 contrib/contextmenu/test/integration/html/menu-title.html create mode 100644 contrib/contextmenu/test/integration/html/on-dom-element.html create mode 100644 contrib/contextmenu/test/integration/html/sub-menus.html create mode 100644 contrib/contextmenu/test/integration/html/sub-menus_test.html create mode 100644 contrib/contextmenu/test/integration/html/trigger-custom.html create mode 100644 contrib/contextmenu/test/integration/html/trigger-hover-autohide.html create mode 100644 contrib/contextmenu/test/integration/html/trigger-hover.html create mode 100644 contrib/contextmenu/test/integration/html/trigger-left-click.html create mode 100644 contrib/contextmenu/test/integration/html/trigger-swipe.html create mode 100644 contrib/contextmenu/test/integration/input.js create mode 100644 contrib/contextmenu/test/integration/keeping-contextmenu-open.js create mode 100644 contrib/contextmenu/test/integration/on-dom-element.js create mode 100644 contrib/contextmenu/test/integration/sub-menus.js create mode 100644 contrib/contextmenu/test/integration/trigger-custom.js create mode 100644 contrib/contextmenu/test/integration/trigger-left-click.js create mode 100644 contrib/contextmenu/test/integration/trigger-right-click.js create mode 100644 contrib/contextmenu/test/integration_test_helper.js create mode 100644 contrib/contextmenu/test/unit/test-events.js create mode 100644 file.php create mode 100644 index.php create mode 100644 json/abaretirement.com-ignore.json create mode 100644 json/abaretirement.com.json create mode 100644 json/activitytickets.com-ignore.json create mode 100644 json/activitytickets.com.json create mode 100644 json/blog.financialpsychology.com-ignore.json create mode 100644 json/blog.financialpsychology.com.json create mode 100644 json/dvdreview.com-ignore.json create mode 100644 json/dvdreview.com.json create mode 100644 json/kathleengurney.com-ignore.json create mode 100644 json/kathleengurney.com.json create mode 100644 json/masonmaloofdesigns.com-ignore.json create mode 100644 json/masonmaloofdesigns.com.json create mode 100644 json/new.abaretirement.com-ignore.json create mode 100644 json/new.abaretirement.com.json create mode 100644 json/pabulletin.abaretirement.com-ignore.json create mode 100644 json/pabulletin.abaretirement.com.json create mode 100644 json/perspectives.abaretirement.com-ignore.json create mode 100644 json/perspectives.abaretirement.com.json create mode 100644 json/roundhillpinesresort.com-ignore.json create mode 100644 json/roundhillpinesresort.com.json create mode 100644 json/sierraweb.com.json create mode 100644 json/tahoedog.com-ignore.json create mode 100644 json/tahoedog.com.json create mode 100644 json/tahoetransportation.org-ignore.json create mode 100644 json/tahoetransportation.org.json create mode 100644 json/thovanyenson.com.json create mode 100644 sites.txt create mode 100644 template.php create mode 100644 templates/index.php diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8d6a5d0cb8fce1fcf8c00953f2add26e1034954e GIT binary patch literal 6148 zcmeHKJ8r`;3?h6Ww+l6f_84h*_zHXoWdYj!B=x8wZc>7q4|BNd=;as-E5`>< bio9ZT?AOFO(CLUf9mt;n(}hL_{#$`7BYqXB literal 0 HcmV?d00001 diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/bin/cron.pl b/bin/cron.pl new file mode 100644 index 0000000..689f243 --- /dev/null +++ b/bin/cron.pl @@ -0,0 +1,27 @@ +#!/usr/bin/perl -w + +use strict; +use vars qw( $BASE_PATH ); +use Cwd 'abs_path'; +use File::Basename; + +$BASE_PATH = dirname(dirname(abs_path($0))); + +# read in sites.txt +open(SITES, "$BASE_PATH/sites.txt") + || die("Error: could not read sites.txt file $!\n"); + +while () { + # FIXME: handle comments, blank lines! + chomp(my $path = $_); + my @parts = split('/', $path); + my $site_name = $parts[-2]; + my $cmd = "$BASE_PATH/bin/vhost-audit.pl $path > $BASE_PATH/json/$site_name.json"; +# print("$cmd\n"); + # FIXME: would be better if we wrote out these files ourselves. + open(AUDIT, "$cmd |") + || die("Error: could sudit site ($site_name) $!\n"); + close(AUDIT); +} + +close(SITES); diff --git a/bin/vhost-audit.pl b/bin/vhost-audit.pl new file mode 100644 index 0000000..e22caf2 --- /dev/null +++ b/bin/vhost-audit.pl @@ -0,0 +1,103 @@ +#!/usr/bin/perl -w + +use strict; +use vars qw( + $DEBUG $BAK_BASE @BAK_VERSIONS %RESULTS @SCRIPT_PATTERNS + %CHANGES %SCRIPTS +); +use Cwd 'abs_path'; +use JSON; + +$DEBUG = 1; + +$BAK_BASE = '/.zfs/snapshot/'; +@BAK_VERSIONS = ( + 'daily.0', + 'daily.1', + 'daily.2', + 'weekly.0' +); + +@SCRIPT_PATTERNS = ('.php$', '^.htaccess$', '.js$'); + + +%RESULTS = (); +if (@ARGV) { + chomp(my $site = $ARGV[0]); + my $real_site = abs_path($site); + foreach my $bak_vers ( @BAK_VERSIONS ) { + my $bak_site = $BAK_BASE . $bak_vers . $real_site; + if ( -e $BAK_BASE . $bak_vers ) { + my @bak_stat = stat($BAK_BASE . $bak_vers); + my $bak_date = $bak_stat[9]; + $RESULTS{'data'}{$bak_date} = (); + $RESULTS{'data'}{$bak_date}{'files'} = (); + $RESULTS{'data'}{$bak_date}{'added'} = 0; + $RESULTS{'data'}{$bak_date}{'deleted'} = 0; + $RESULTS{'data'}{$bak_date}{'changed'} = 0; + $RESULTS{'data'}{$bak_date}{'scripts'} = 0; + open(DIFF, "diff -qr $real_site $bak_site |") + || die("Could not diff, $!\n"); + while () { + if ( m/^Files (.+) and (.+) differ/ ) { + my $file = substr($1, length($real_site)); + $RESULTS{'data'}{$bak_date}{'files'}{$file} = 'changed'; + $RESULTS{'data'}{$bak_date}{'changed'}++; + foreach my $script (@SCRIPT_PATTERNS) { + if ( $file =~ m/$script/ ) { + $RESULTS{'data'}{$bak_date}{'scripts'}++; + $SCRIPTS{$file} = 1; + last; + } + } + $CHANGES{$file} = 1; + } + elsif ( m/^Only in (.+): (.+)/ ) { + if ( substr($1, 0, length($real_site)) eq $real_site) { + my $file = substr($1, length($real_site)) . '/' . $2; + $RESULTS{'data'}{$bak_date}{'files'}{$file} = 'added'; + $RESULTS{'data'}{$bak_date}{'added'}++; + foreach my $script (@SCRIPT_PATTERNS) { + if ( $file =~ m/$script/ ) { + $RESULTS{'data'}{$bak_date}{'scripts'}++; + $SCRIPTS{$file} = 1; + last; + } + } + $CHANGES{$file} = 1; + } + else { + my $file = substr($1, length($bak_site)) . '/' . $2; + $RESULTS{'data'}{$bak_date}{'files'}{$file} = 'deleted'; + $RESULTS{'data'}{$bak_date}{'deleted'}++; + foreach my $script (@SCRIPT_PATTERNS) { + if ( $file =~ m/$script/ ) { + $RESULTS{'data'}{$bak_date}{'scripts'}++; + $SCRIPTS{$file} = 1; + last; + } + } + $CHANGES{$file} = 1; + } + } + else { + print('# ' . $_); + } + + } + close(DIFF); + } + else { + print STDERR ($BAK_BASE . $bak_vers . " does not exist\n"); + } + } +} +else { + die "Usage: $0 DocumentRoot\n"; +} + + +$RESULTS{'lastrun'} = time(); +$RESULTS{'changes'} = scalar(keys %CHANGES); +$RESULTS{'scripts'} = scalar(keys %SCRIPTS); +print(to_json(\%RESULTS, {pretty => 1}) ); diff --git a/contrib/contextmenu/README.md b/contrib/contextmenu/README.md new file mode 100644 index 0000000..b590886 --- /dev/null +++ b/contrib/contextmenu/README.md @@ -0,0 +1,412 @@ +# jQuery contextMenu plugin & polyfill # + +--- + +> [**This repository now has a new maintainer**](https://github.com/swisnl/jQuery-contextMenu/issues/257) + +--- + +__IMPORTANT: 2.0.0 is release and has change the default names of the icon classes in order to stop CSS conflicts with frameworks which define the class 'icon'.__ + + +[![Travis Build Status](https://travis-ci.org/swisnl/jQuery-contextMenu.svg?branch=master)](https://travis-ci.org/swisnl/jQuery-contextMenu) + +$.contextMenu is a management facility for - you guessed it - context menus. It was designed for an application where there are hundreds of elements that may show a context menu - so intialization speed and memory usage are kept fairly small. It also allows to register context menus without providing actual markup, as $.contextMenu generates DOMElements as needed. + +[features](http://swisnl.github.io/jQuery-contextMenu/index.html) - +[demo](http://swisnl.github.io/jQuery-contextMenu/demo.html) - +[documentation](http://swisnl.github.io/jQuery-contextMenu/docs.html) + + +## Dependencies ## + +* jQuery >=1.8.2 +* jQuery UI position (optional but recommended) + +## Usage ## + +register contextMenu from javascript: + +```javascript +$.contextMenu({ + // define which elements trigger this menu + selector: ".with-cool-menu", + // define the elements of the menu + items: { + foo: {name: "Foo", callback: function(key, opt){ alert("Foo!"); }}, + bar: {name: "Bar", callback: function(key, opt){ alert("Bar!") }} + } + // there's more, have a look at the demos and docs... +}); +``` + +have a look at the [demos](http://swisnl.github.io/jQuery-contextMenu/demo.html). + + +## HTML5 Compatibility ## + +Firefox 8 implemented contextmenu using the <menuitem> tags for menu-structure. The specs however state that <command> tags should be used for this purpose. $.contextMenu accepts both. + +Firefox 8 does not yet fully implement the contextmenu specification ([Ticket #617528](https://bugzilla.mozilla.org/show_bug.cgi?id=617528)). The elements +[a](http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-a-element-to-define-a-command), +[button](http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-button-element-to-define-a-command), +[input](http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-input-element-to-define-a-command) and +[option](http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-option-element-to-define-a-command) +usable as commands are being ignored altogether. It also doesn't (optically) distinguish between checkbox/radio and regular commands ([Bug #705292](https://bugzilla.mozilla.org/show_bug.cgi?id=705292)). + +* [contextmenu specs](http://www.w3.org/TR/html5/interactive-elements.html#context-menus) +* [command specs](http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html) +* [Browser support according to caniuse.com](http://caniuse.com/#search=context%20menu) + +Note: While the specs note <option>s to be renderd as regular commands, $.contextMenu will render an actual <select>. import contextMenu from HTML5 <menu>: + +```javascript +$.contextMenu("html5"); +``` + +## Interaction Principles ## + +You're (obviously) able to use the context menu with your mouse. Once it is opened, you can also use the keyboard to (fully) navigate it. + +* ↑ (up) previous item in list, will skip disabled elements and wrap around +* ↓ (down) next item in, will skip disabled elements and wrap around +* → (right) dive into sub-menu +* ← (left) rise from sub-menu +* ↵ (return) invoke command +* ⇥ (tab) next item or input element, will skip disabled elements and wrap around +* ⇪ ⇥ (shift tab) previous item or input element, will skip disabled elements and wrap around +* ⎋ (escape) close menu +* ⌴ (space) captured and ignore to avoid page scrolling (for consistency with native menus) +* ⇞ (page up) captured and ignore to avoid page scrolling (for consistency with native menus) +* ⇟ (page down) captured and ignore to avoid page scrolling (for consistency with native menus) +* ↖ (home) first item in list, will skip disabled elements +* ↘ (end) last item in list, will skip disabled elements + +Besides the obvious, browser also react to alphanumeric key strokes. Hitting r in a context menu will make Firefox (8) reload the page immediately. Chrome selects the option to see infos on the page, Safari selects the option to print the document. Awesome, right? Until trying the same on Windows I did not realize that the browsers were using the access-key for this. I would've preferred typing the first character of something, say "s" for "save" and then iterate through all the commands beginning with s. But that's me - what do I know about UX? Anyways, $.contextMenu now also supports accesskey handling. + + +## Authors ## + +* [Björn Brala](https://github.com/swisnl) +* [Rodney Rehm](https://github.com/rodneyrehm) (original creator) +* [Christiaan Baartse](https://github.com/christiaan) (single callback per menu) +* [Addy Osmani](https://github.com/addyosmani) (compatibility with native context menu in Firefox 8) + + +## License ## + +$.contextMenu is published under the [MIT license](http://www.opensource.org/licenses/mit-license) + +## Special thanks ## + +Font-Awesome icons used from [encharm/Font-Awesome-SVG-PNG](https://github.com/encharm/Font-Awesome-SVG-PNG). + +## Changelog ## + +### 2.1.1 ### + +* Fixed a problem when using the open function with custom arguments (thanks @RareDevil) +* `width` is increased when repoening menu. Fixed by using outerwidth to calculate width. Fixes #360 (thanks @anseki) +* Submenus are not collapsed when the menu is closed fixes #358 (thanks @anseki) +* Small delay in checking for autohide to fix missing the menu by a pixel or two. Fixes #347 (thanks @Risord) +* Check if an item is not hidden in any way when scrolling through items with the keyboard. Fixes #348 +* Change links and base url of documentation to https as mentioned by @OmgImAlexis in PR#345 + +### 2.1.0 ### + +* Added support for providing a function as zIndex value in options object (thanks @eivindga) +* Fixed a switch to use the correct type for separators (thanks @RareDevil) +* Fixed the problem with submenus size wrongly ([Issue #308](https://github.com/swisnl/jQuery-contextMenu/issues/308)) (thanks @RareDevil) +* Incorrect entry on package.json ([Issue #336](https://github.com/swisnl/jQuery-contextMenu/issues/336)) (thanks @Dijir) +* Gray out disabled icons as well as text ([Issue #337](https://github.com/swisnl/jQuery-contextMenu/issues/337)) (thanks @r02b) +* Optimized generated CSS so that ``context-menu-icon`` class can be used to overwrite icon CSS. +* Positioning of contextmenu when using appendTo (thanks @mrMarco) +* Check to see if target have a higher zIndex than the contextmenu in the key event handler (thanks @RareDevil) + +### 2.0.1 (December 3rd 2015) ### + +* Remove executable bit from jquery.contextMenu.js (thanks @jacknagel) +* Fixed a problem there was when using a function for icons (thanks @RareDevil) +* Fixed a problem where submenus resized wrong (thanks @RareDevil) +* Fixed a problem where the contextmenu would open another menu (thanks @RareDevil) - ([Issue #252](https://github.com/swisnl/jQuery-contextMenu/issues/252) and [Issue #293](https://github.com/swisnl/jQuery-contextMenu/issues/293)) +* Fixed regression of node name's not being appended to the label of input elements. (thanks @RareDevil) +* Add check that root.$layer exists, to prevent calling hide() on an defined object. (thanks @andreasrosdal) + + +### 2.0.0 (October 28th 2015) ### + +* __This version changes the default names of the icon classes in order to stop CSS conflicts with frameworks which define the class 'icon'.__ In order to keep the icon names the same as before this change you can change the defaults on the classnames for the icons ([docs on classNames option](http://swisnl.github.io/jQuery-contextMenu/docs.html#options-classNames)). The classnames will probably be "context-menu-icon-*" as proposed earlier by @rodneyrehm. +* You can not use SASS to customize your contextmenu. The gulp command build-icons takes all the SVG icons from src/icons and builds them into a font. In order to this we needed to break backwards compatibility. This does mean the new CSS does not have the old .icon class defined which makes it a lot more stable within CSS frameworks. The first revision of the documentation is found [here](documentation/docs/customize.md). +* The 1.x branch will be maintained for a while with bugfixes. But support for 1.x will be dropped in the coming months. +* Reverted the change from 1.7.0: .html() changed back to .text() since it is an security issue (thanks @arai-a) + +### 1.10.1 (October 25th 2015) ### + +* Added gulp command (integration-test-paths) to change the paths in the integration tests to the correct path after they are overwritten by the documentation generator. +* Make sure the contextmenu is not outside the client area by (thanks to @arai-a) +* Update jQuery dependecy so that it will not result in double installation of jQuery when using npm (thanks to @fredericlb) + +### 1.9.1 (October 11th 2015) ### + +* Fixed a bug where the classNames options would fail on a submenu. +* New documentation site and generation using [couscous](https://github.com/CouscousPHP/Couscous) + +### 1.9.0 (October 1st 2015) ### + +* Make classes configurable for those that can easily conflict. See the [docs on classNames option](http://swisnl.github.io/jQuery-contextMenu/docs.html#options-classNames). This also prepares to change classnames to non conflicting defaults so the hassle with frameworks as bootstrap will stop. +* Fix for handling of seperator string. It threw an error on the protected property of String.$node +* Fix for opening the contextmenu at coordinate 0,0 (by [Andreme](https://github.com/andreme)) +* Fixed check for jQuery UI ([Issue #182](https://github.com/swisnl/jQuery-contextMenu/issues/182)) +* Updated doc for function argument for icon + +### 1.8.1 (September 14th 2015) ### + +* Updated readme. +* Updated dist files + +### 1.8.0 (September 14th 2015) - dist files not updated! ### + +* Added dist folder with compiled JS and CSS, added these files to package and bower configuration. +* Fixed doc link for jQuery UI position ([Issue #274](https://github.com/swisnl/jQuery-contextMenu/issues/274)) +* Item icon can now be a callback to dynamically decide on icon class. - ([Issue #158](https://github.com/swisnl/jQuery-contextMenu/issues/158), [Issue #129](https://github.com/swisnl/jQuery-contextMenu/issues/129), [Issue #151](https://github.com/swisnl/jQuery-contextMenu/issues/151), [Issue #249](https://github.com/swisnl/jQuery-contextMenu/issues/249)) +* Small fix to calculating width and height on screen edges when padding is present. + +### 1.7.0 (August 29th 2015) ### + +* Touch support optimisations (by kccarter76) +* changed .text to .html so there are no extra span's fixed - ([Issue #252](https://github.com/swisnl/jQuery-contextMenu/issues/252)) +* added visibility callback to item definition +* copy the HTML5 icon attribute when creating from HTML5 elements +* growing menu when opening multiple times fixed - ([Issue #197](https://github.com/swisnl/jQuery-contextMenu/issues/197)) +* fixed failure to run tests + +### 1.6.8 (August 18th 2015) ### + +* changes for new maintainer + +### 1.6.7 (May 21st 2015) ### + +* looking for maintainer note +* publish to npm + +### 1.6.6 (July 12th 2014) ### + +* fixing bower manifest + +### 1.6.5 (January 20th 2013) ### + +* fixing "opening a second menu can break the layer" - ([Issue #105](https://github.com/swisnl/jQuery-contextMenu/issues/105)) + +### 1.6.4 (January 19th 2013) ### + +* fixing [jQuery plugin manifest](https://github.com/swisnl/jQuery-contextMenu/commit/413b1ecaba0aeb4e50f97cee35f7c367435e7830#commitcomment-2465216), again. yep. I'm that kind of a guy. :( + +### 1.6.3 (January 19th 2013) ### + +* fixing [jQuery plugin manifest](https://github.com/swisnl/jQuery-contextMenu/commit/413b1ecaba0aeb4e50f97cee35f7c367435e7830#commitcomment-2465216) + +### 1.6.2 (January 19th 2013) ### + +* fixing "menu won't close" regression introduced by 1.6.1 + +### 1.6.1 (January 19th 2013) ### + +* fixing potential html parsing problem +* upgrading to jQuery UI position v1.10.0 +* replaced `CRLF` by `LF` (no idea how this happened in the first place...) +* adding `options.reposition` to dis/allow simply relocating a menu instead of rebuilding it ([Issue #104](https://github.com/swisnl/jQuery-contextMenu/issues/104)) + +### 1.6.0 (December 29th 2012) ### + +* adding [DOM Element bound context menus](http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html) - ([Issue 88](https://github.com/swisnl/jQuery-contextMenu/issues/88)) +* adding class `context-menu-active` to define state on active trigger element - ([Issue 92](https://github.com/swisnl/jQuery-contextMenu/issues/92)) +* adding [demo for TouchSwipe](http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html) activation +* adding export of internal functions and event handlers - ([Issue 101](https://github.com/swisnl/jQuery-contextMenu/issues/101)) +* fixing key "watch" might translate to Object.prototype.watch in callbacks map - ([Issue 93](https://github.com/swisnl/jQuery-contextMenu/issues/93)) +* fixing menu and submenu width calculation - ([Issue 18](https://github.com/swisnl/jQuery-contextMenu/issues/18)) +* fixing unused variables - ([Issue 100](https://github.com/swisnl/jQuery-contextMenu/issues/100)) +* fixing iOS "click" compatibility problem - ([Issue 83](https://github.com/swisnl/jQuery-contextMenu/issues/83)) +* fixing separators to not be clickable - ([Issue 85](https://github.com/swisnl/jQuery-contextMenu/issues/85)) +* fixing issues with fixed positioned triggers ([Issue 95](https://github.com/swisnl/jQuery-contextMenu/issues/95)) +* fixing word break problem - ([Issue 80](https://github.com/swisnl/jQuery-contextMenu/issues/80)) + +### 1.5.25 (October 8th 2012) ### + +* upgrading to jQuery 1.8.2 ([Issue 78](https://github.com/swisnl/jQuery-contextMenu/issues/78)) +* upgrading to jQuery UI position 1.9.0 RC1 ([Issue 78](https://github.com/swisnl/jQuery-contextMenu/issues/78)) + +### 1.5.24 (August 30th 2012) ### + +* adding context menu options to input command events ([Issue 72](https://github.com/swisnl/jQuery-contextMenu/issues/72), dtex) +* code cosmetics for JSLint + +### 1.5.23 (August 22nd 2012) ### + +* fixing reposition/close issue on scrolled documents ([Issue 69](https://github.com/swisnl/jQuery-contextMenu/issues/69)) +* fixing jQuery reference ([Issue 68](https://github.com/swisnl/jQuery-contextMenu/issues/68)) + +### 1.5.22 (July 16th 2012) ### + +* fixing issue with animation and remove on hide (Issue #64) + +### 1.5.21 (July 14th 2012) ### + +* fixing backdrop would not remove on destroy (Issue #63) + +### 1.5.20 (June 26th 2012) ### + +Note: git tag of version is `v1.6.20`?! + +* fixing backdrop would not position properly in IE6 (Issue #59) +* fixing nested input elements not accessible in Chrome / Safari (Issue #58) + +### 1.5.19 ### + +Note: git tag of version is missing...?! + +* fixing sub-menu positioning when `$.ui.position` is not available (Issue #56) + +### 1.5.18 ### + +Note: git tag of version is missing...?! + +* fixing html5 `` import (Issue #53) + +### 1.5.17 (June 4th 2012) ### + +* fixing `options` to default to `options.trigger = "right"` +* fixing variable name typo (Within Issue #51) +* fixing menu not closing while opening other menu (Within Issue #51) +* adding workaround for `contextmenu`-bug in Firefox 12 (Within Issue #51) + +### 1.5.16 (May 29th 2012) ### + +* added vendor-prefixed user-select to CSS +* fixed issue with z-indexing when `` is used as a trigger (Issue #49) + +### 1.5.15 (May 26th 2012) ### + +* allowing to directly open another element's menu while a menu is shown (Issue #48) +* fixing autohide option that would not properly hide the menu + +### 1.5.14 (May 22nd 2012) ### + +* options.build() would break default options (Issue #47) +* $.contextMenu('destroy') would not remove backdrop + +### 1.5.13 (May 4th 2012) ### + +* exposing $trigger to dynamically built custom menu-item types (Issue #42) +* fixing repositioning of open menu (formerly accidental re-open) +* adding asynchronous example +* dropping ignoreRightClick in favor of proper event-type detection + +### 1.5.12 (May 2nd 2012) ### + +* prevent invoking callback of first item of a sub-menu when clicking on the sub-menu-item (Issue #41) + +### 1.5.11 (April 27th 2012) ### + +* providing `opt.$trigger` to show event (Issue #39) + +### 1.5.10 (April 21st 2012) ### + +* ignoreRightClick would not prevent right click when menu is already open (Issue #38) + +### 1.5.9 (March 10th 2012) ### + +* If build() did not return any items, an empty menu was shown (Issue #33) + +### 1.5.8 (January 28th 2012) ### + +* Capturing Page Up and Page Down keys to ignore like space (Issue #30) +* Added Home / End keys to jump to first / last command of menu (Issue #29) +* Bug hitting enter in an <input> would yield an error (Issue #28) + +### 1.5.7 (January 21st 2012) ### + +* Non-ASCII character in jquery.contextMenu.js caused compatibility issues in Rails (Issue #27) + +### 1.5.6 (January 8th 2012) ### + +* Bug contextmenu event was not passed to build() callback (Issue #24) +* Bug sub-menu markers would not display properly in Safari and Chrome (Issue #25) + +### 1.5.5 (January 6th 2012) ### + +* Bug Internet Explorer would not close menu when giving input elements focus (Issue #23) + +### 1.5.4 (January 5th 2012) ## + +* Bug not set z-index of sub-menus might not overlap the main menu correctly (Issue #22) + +### 1.5.3 (January 1st 2012) ### + +* Bug `console.log is undefined` + +### 1.5.2 (December 25th 2012) ### + +* Bug sub-menus would not properly update their disabled states (Issue #16) [again…] +* Bug sub-menus would not properly adjust width accoring to min-width and max-width (Issue #18) + +### 1.5.1 (December 18th 2011) ### + +* Bug sub-menus would not properly update their disabled states (Issue #16) + +### 1.5 (December 13th 2011) ### + +* Added [dynamic menu creation](http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html) (Issue #15) + +### 1.4.4 (December 12th 2011) ### + +* Bug positioning <menu> when trigger element is `position:fixed` (Issue #14) + +### 1.4.3 (December 11th 2011) ### + +* Bug key handler would caputure all key strokes while menu was visible (essentially disabling F5 and co.) + +### 1.4.2 (December 6th 2011) ### + +* Bug opt.$trigger was not available to disabled callbacks +* jQuery bumped to 1.7.1 + +### 1.4.1 (November 9th 2011) ### + +* Bug where <menu> imports would not pass action (click event) properly + +### 1.4 (November 7th 2011) ### + +* Upgraded to jQuery 1.7 (changed dependecy!) +* Added internal events `contextmenu:focus`, `contextmenu:blur` and `contextmenu:hide` +* Added custom <command> types +* Bug where `className` wasn't properly set on <menu> + +### 1.3 (September 5th 2011) ### + +* Added support for accesskeys +* Bug where two sub-menus could be open simultaneously + +### 1.2.2 (August 24th 2011) ### + +* Bug in HTML5 import + +### 1.2.1 (August 24th 2011) ### + +* Bug in HTML5 detection + +### 1.2 (August 24th 2011) ### + +* Added compatibility to <menuitem> for Firefox 8 +* Upgraded to jQuery 1.6.2 + +### 1.1 (August 11th 2011) ### + +* Bug #1 TypeError on HTML5 action passthru +* Bug #2 disbaled callback not invoked properly +* Feature #3 auto-hide option for hover trigger +* Feature #4 option to use a single callback for all commands, rather than registering the same function for each item +* Option to ignore right-click (original "contextmenu" event trigger) for non-right-click triggers + +### 1.0 (July 7th 2011) ### + +* Initial $.contextMenu handler diff --git a/contrib/contextmenu/bower.json b/contrib/contextmenu/bower.json new file mode 100644 index 0000000..3724e0f --- /dev/null +++ b/contrib/contextmenu/bower.json @@ -0,0 +1,43 @@ +{ + "name": "jQuery-contextMenu", + "version": "2.1.1", + "main": [ + "dist/jquery.contextMenu.js", + "dist/jquery.contextMenu.min.js", + "dist/jquery.contextMenu.min.js.map", + "dist/jquery.contextMenu.css", + "dist/jquery.contextMenu.min.css", + "dist/jquery.contextMenu.min.css.map", + "dist/jquery.ui.position.js", + "dist/jquery.ui.position.min.js", + "dist/images/cut.png", + "dist/images/door.png", + "dist/images/page_white_add.png", + "dist/images/page_white_copy.png", + "dist/images/page_white_delete.png", + "dist/images/page_white_edit.png", + "dist/images/page_white_paste.png", + "dist/images/cut.png" + ], + "homepage": "http://swisnl.github.io/jQuery-contextMenu/", + "authors": [ + "Björn Brala (http://www.swis.nl)", + "Rodney Rehm (http://rodneyrehm.de/en)" + ], + "description": "Full featured context menu handler capable of handling thousands of elements", + "keywords": ["contextmenu", "context-menu", "right-click-menu", "right-click", "navigation", "menu"], + "license": "MIT", + "dependencies": { + "jquery": ">=1.8.2" + }, + "ignore": [ + "demo/", + "prettify/", + "screenshots/", + "**/.*", + "*.md", + "*.html", + "/*.css", + "/*.js" + ] +} \ No newline at end of file diff --git a/contrib/contextmenu/contextMenu.jquery.json b/contrib/contextmenu/contextMenu.jquery.json new file mode 100644 index 0000000..5949d5c --- /dev/null +++ b/contrib/contextmenu/contextMenu.jquery.json @@ -0,0 +1,30 @@ +{ + "name": "contextMenu", + "title": "jQuery contextMenu", + "description": "full featured context menu handler capable of handling thousands of elements", + "keywords": [ + "contextmenu", + "context-menu", + "right-click-menu", + "right-click", + "navigation", + "menu" + ], + "version": "git-master", + "author": { + "name": "Björn Brala (SWIS.nl)", + "url": "http://www.swis.nl" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-color/blob/2.1.2/MIT-LICENSE.txt" + } + ], + "bugs": "https://github.com/swisnl/jQuery-contextMenu/issues", + "homepage": "http://swisnl.github.io/jQuery-contextMenu/", + "docs": "http://swisnl.github.io/jQuery-contextMenu/docs.html", + "dependencies": { + "jquery": ">=1.8.2" + } +} \ No newline at end of file diff --git a/contrib/contextmenu/dist/font/context-menu-icons.eot b/contrib/contextmenu/dist/font/context-menu-icons.eot new file mode 100644 index 0000000000000000000000000000000000000000..54b4938d955d0a05737b03b02de8d975c8f21981 GIT binary patch literal 3380 zcmd^CU2Igx6+Y+w?=Il=-@Opq>+7}eF4TB;*KH%L%?~N1vd7uPj5hv4br}R<-`W}Hr7WI zRHG`@sX}J~2WSphm6m|b1hPdaZ=qx0PlG>8Wm*8oq;YT-Xc2nCgH5|AMHxu$)hATN z;v%$6GGz`OKXKsa?k{eDxf|RAM~|no`=2>_4fMA`k59~%=RX{J{Uy*Jq5pb%_T1FL z@b7gZ`L{&sPtR1!lg9IZIS1Xpp%>49VRXp90sba>-^yHH;eV@;SIcvi9}g{>M4_{Y^h@)##rlhXJ@p5oO$OwTiM7jX>udCN z1zy)(Me=q7(Vb>^9O#|6a@juJ^uWI;qIkkTUVX^d0*Wo}HO4gBMVc2`Piaqy=2i@-n|nDjCXC5+X=H z@JIfTvJBge+=A?L?cu3|leE9V4c*^A*1jJKVogC4)A@bz{!b}nThQ5ydH&{T>{+=Z0D)6X@Sh3jM|9eAyK${H0fT%P?>_l9} zh+Gm~IKo>ruF+Ep4iL10_2Nd<$?fNvx{?CQ(m#H8@5%o>>HN-8C2?+v+SFKbXaTC%X5WPEgW)jhwuI{)f*tb-j(%D!itH>JNrc~qEOv@Kq? zN-%)g8`ig0`T5niUcHHRyXRM|k~=J|z>m8^x~Mt0;VIm|2T?bsQ8b^W?|SQQ)8dJI z(NayViM4pr(KX%Fx3I4D#*>NCJ}wn=Sqqy)Kvm*i|Q%`Ve?o#RopdDLhz+@(Q9 zGGt|UdhFPdU3p#Eoft;g=` zOy~FXoBq&|?!3?J-;?);3#C?Lpk0xbXG?r>)Ezw)>f{@v?w>2H@tRmem+5>E*%5LS z_5FmzogF(LiDd>dBmKu>nHEFc@fFo*$;2Mn8Q*ISh_SO%O1!TsPH0Eu=+*~gJ#AaZ zy5jCPyT-P*^$5VralLJm($TI;@^h^`>U{jQlF|8EU*o8R)EC+9=V}u&DNQ9hMdUQ+ z6a5_5kW40Wr&#(QH22_GdNp13)5_1lLi3$m$N7mA>=wDsD`CSi!X7vuG5U;%2R_4f zuQ7Ef+Eq>AkHbc(=(v4Ou_R2cY&Qn1Us?mk_A5sCXS^bKZdG{rFSs;#Kx5WUV3u1S zWDX9cCEJ_rbbBn;emdgcBkccE+*OU5Xb7u)QQTk5)QX!g(jz_s;=;V-H;vd09s1S7I<_p3D7Ydj1(dfzOfLFcAP3)8n5`Z>f;?_R+;{ zrr1YoE~$R8gn*Aah2x7cza|kb_VtyBemn4bWMy@gosH6ATT<1uH-%6SLR>{TyX5GR zh%SKp!sy@+hfw@X`Xh<~i)9I;zpPH!6 z-P4o$^Uvvfd4%7K&X+&Q@5S1q6DWx=h}6zD1F)bN>L z)5x7qhgp0U)WDhdWKY7^1hi9h#Am5JK?IeB8Ku1!{EEA@&}nVhMs^W{aLPc6;VJx~7u^PMIw literal 0 HcmV?d00001 diff --git a/contrib/contextmenu/dist/font/context-menu-icons.ttf b/contrib/contextmenu/dist/font/context-menu-icons.ttf new file mode 100644 index 0000000000000000000000000000000000000000..bf7c9ca4d9e4deecceb6ced8602cb484c5ee969b GIT binary patch literal 3172 zcmd^BU2I%e5uUmKyPMkUzk8i}y}n-i?k3p#ll@If6NlJwV%3eQ-8gE46t?!-aoNAx z>(-_q8KkxkR0TONDB=Z_RF#Yn5e-Ex4}L(UsX!ovibPt0RPn%8F)yVLrMYJ2-rFQJ zMdY2cI&)^eGc#w-oH=JNAOHkl14Kxjm^ppyr}oco0N_DFk4?=a(?_3~x<>LhNS>Xm z6zd<1zWx%)A5#C-VtIYxxc_%5fcP5#`N!u=#d+=dKd+PSU#aKM6QK2ozb5{d)CbR3 z8fzig{g`b3NU~Y3%@viGrBBHI7bLe=ifeV;3+%s}=c~m^>4&2$I)HBtKzONMTWP%b zm$SbI*rU<>V?eQs+q>KF6^Xp=+LFM?e>BZO2t9q}W%FF?ga3qpf1ImJd*9U zB#7H2Y9KI5jXi1bZJ^yzW7JPSfL#`;@w^|xFbp_0KKUr=x{lo$EH5n<3G*bH<5?sG zLGe(M#SQ!($e>A236w$jt~=rfkVdi2srkZpH-1#h;luhoO)h3+}cRr^kWt2PDO_P0bMREs7 z!;3hJ?+7P_i^4l3^9mqd5TAho61qB-A(up=hjD;OHvdJ;F-hyam`Us6rfJ+TjjCbZ zFw8qxp{HV)I}GiZ#%-3}Q$%!IK-`8th=2tdc#zgg>s@V~%0NFaLL}Fg&5z&_bQj8J zS}}ua#wg?loS@qJDF|%y1o0X#bn{)qw23o&;hpC~o`0rctoRgiZ2eZ-UBi4&Cqs-M@$E z-B^TWcox3p#NDYxqS?G5>q;vsk(i|_s;;)6stiP8(ZUfdiD=S$5JzsiGz}8>`hHgPbP`e z1Zf1nLv|Bwa`5J3_lJ_%Lqobd^dv*~>qCdK?r^ctp~br-QF^w3mnQ6qv%V1Cn6Up; zLIt-uhF;xzKd|3tN%DJ90Yg2*kAze4)cDYJIMuGn`@bM-?Wyo1!;!;AoX1c|h`uLF zmT!Mxs{5gEe`oh(Z^Zsu?__spKNH-DsGWPHo-SDspX!U9fw9spV%_)IOpR3!g z)mEycBoyE*fYp|b4q-&0V$!L0@`e8)V?Q0sfTGH7S-BOMYr9qJbbefdeO&9f>DMgH z?~n@tZBPq1We-~U0-Idfr^St*8*y#l70v$>++@tIvWNe| z3nRxAMCCNCa`XMv@zJDUI;)-Q3WvMS1>Ac?`~QUQssgQW2#&x>s>ec1?aFjvlxk5Q z!F&hpi!T-5r%Zp^2qR5UUG=*uA}CLnniO@>z=0g9u>x14-iiMjJ##FNA)o&(e~0fa zzf~Nwt+8Tp46hINX_6Y!{P*2wThV+zir1q#Wzc67F4-HGgl}dq=YomgY!G`!&y1P{ z`~kV}b&wnTYT0!#R&0?v$b%^5qppjSs%-iEc#%C|E_XQ_44w(botMmeD>Uea9y(*N z`rXqRDCDxvK6rAz9s-&?CYBW_0zeGjC`by)@pN`Ka&@7^LVr`4LFc?I#lD zE6apa>gBbSuCq83e3(-7$}2=34)XX}`L{;!lsj=M7xx7f+UXPcEAM$vazSs_Xyh8X%kN1zDtu^A6Qgt=HMAFK1X>qk&T)una zZe+H!ys}iQngL}O5Bn+w*u3IEfQ9SBK;rSi^aX@%#zn- zSfO<|0uv6<_fzVgyq|DlWb2|6`8-)a0qaCp;Ax69O=traNM0bF8tuu1@mu>W(>`j1 z)SbB}$=4idC*ZteRfh-YjZKo}r+IPp6Ha6msy_ZA;l|&%pVu@LP(%r3`nOO~Lm!C6 k`FUxsR$mwARvXHEsa$H5q|*FSL#`KBh<$2xso{9~H!y7tK>z>% literal 0 HcmV?d00001 diff --git a/contrib/contextmenu/dist/font/context-menu-icons.woff b/contrib/contextmenu/dist/font/context-menu-icons.woff new file mode 100644 index 0000000000000000000000000000000000000000..01ab877b8d9e72733838bca2688b5ec32e7a8dec GIT binary patch literal 2068 zcmY*ZcTkhr9{oZvp~Qd)2vP!)s4K-l78F#Zi;smwqNot?3qcZGlK=@4M1e?ASZVr@ zx-=mKP>M(slqw}EO@);v*ytKSR@MQsANu}zznL@lcg{Vx%)K)wnCRdDzyPRZlmYq8 z5#{rfZ}$IR$H=E_001TfsRRf%6&qCxMDl(UNIML1I|y!8!NhJFlj;v?5fJx-#`Zbe zM+x+cA-+&Q4*=5A0I=nry<9Jnah~b}^8q+h%0RZA&_2UQhCt12nYaX(+5)r5?EB`c}Pq8c}J;)JX?;c zKbyk^0OWJXV-Ml%&9@$Xyet~%1A-IYNwhvH$PHMQrA~k#H3CRN(Oi5l?;@c@a8YH1 zA6myZ@`e-;rw1njKi06otmbA>bBk*iH-^v8!`Kj>_~N}kfFS4%p7(8*lNz9q)ik|~ zpLo+P#S*|4wG2ZbbMbnPXaK&1>fmK9B)4pB$ID1}8XLQE3$w~{8!v)43v#JfMJCNG%C+-tx*K;VbD(RDM zx#RNd-tKuPr@W?#9A#lB|7h4273dM5`$nI1zNlfZoLw7Es2TCm8X@Fuc$7bG*jh}Z zl?QLP-rgT2bQ`mC<_kr6B3J;hD=I2UnA8e8=+9xPblR2p$QHXg;VyT}RwH{f2eS8} zb#N4tf>ll9;%>iFvX$4_f&6$-z#9czsvDScx5?!_Z}Kcf--gP?fv z&m$;w0?9qmAS`z+?s~(Ls0Ig;qj<3Lu^l-I6LT%ZU^M;>qjY~O!+Pd!j*vKA)g;re z92AESjHT#(xlQcay7UqMtU(Pogvat@p%w^n8b2Lmmx9`-0 z_mA_nu9D{C>H13GOTinmyJeC7>}mCB3*uYU*-5X3Z|CjRm!@x&-t8(t$ae44br}v$ zE<@ak)eF8R4(AFd*u^_fCZ;PBDsEd&UREPl7}TTJv79r3G9JIU(Ta5&!FX+{?%z8+ zZ6k}0t0G)Za;}kBFlZx-}+K(7`B&J70#wNfPmT;FrsbGi`q{bai%vf z9XY-4V_8vGz`6unM?7gprQ>!aC*~dFENIqs*;^v5cL!5$VIJz=;?(gQOWKJM0zm$0 zBt?a^0Ib+_J7h;UO`YB^O>)Fyu!LCTar#x=K-Iya9bmbe?@q&t4>K>5-y`_)p{!0J z&aO_2$?S(i%LyE7|%$|Cj;|DL<#@jyNK8pXe|$aveL4ofLcp z{_II$XO#MCd3^S9!<)D)ttQ5jVQp8qG`XRJ)p)hJXvn8iraQK0*Y>MNgCGDV}<6**E zw+$WB=SKS1t>6uqmJ~yMYs;Dbh6L|JrKev!TeYiY=~B!-et)o0g-?AKkE_yVXHB<7 zMy<);HB)5#FXw=Feeo|$7T3(qsn?xVvzizfBul`rl5-M;3cN7}2sBqqv&sj8$msAN zx$z?#f5w-58|0Ey;*9}&5`YBCT@f>zdqTy3FKIeMT1BA%EJI2aTKA(&fSWKk*r1f7 zREE^xW(NJtS&-ok(gE0RoljCWh!_cI2?tbzU_xjOJY}f$`kAdY3TqsFg-ycIH=Nw#PhgakRtKtKRz6e#Rr-@|75;E4;G)@Q||G zO-By+>se%HPRE7z8a{toHD&g>J+y#R`gcug@s$y$v=l=1uprOeNHeqEx!WGPISM9${Uc$H2(aJ_9fDhej_)z&4$|hm#u@S z5{G-@=Iv0M@3gHo>(_w)^k(&lohe4fb`dSdZ(WidOf(GfZ*>1I#48ymO! zv>ktIKZD-z+Fst{rzn0SF2|G9($nfI{G(64{wpECDKq=^CC(p$v6sT35zZx~w&Wu! I5&E=$0cGNY{{R30 literal 0 HcmV?d00001 diff --git a/contrib/contextmenu/dist/font/context-menu-icons.woff2 b/contrib/contextmenu/dist/font/context-menu-icons.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..152b91ee453a84e11cf687af0cca8fbc308eab13 GIT binary patch literal 1564 zcmV+%2IKj6Pew8T0RR9100tZY3jhEB01RXR00qtf0RR9100000000000000000000 z0000SLIzd44hLBqh6)iCqydtBQD8f-2m%=^G}to) zK@yyLp8Ac^azlgtei1~qmOYCXLY0a_(8LOmg#L;!1P+A<7COQM3-$l`gH8QMNE-sJ zvoI4dj^sFZgDgtnu(G^n8V0i87g(moZ2oOs)5g^S)6%1e)7!$Nw z>)D_K%ofLl7=$3?e9qNoWDa-`n1PB5z?PbP`KC%RKw&koW4la+M#y=Gyz}Uh|09ga zDb(ke0o*PE4U_;FkSX7+5kPg6s65s$OG#NcGwAf?<$u0J_SDvmh6;_re*f`2hy%vs zp`NSu@FgNc6$%Up4F-e(1Hys<;lP0KkjR2SJ|`I<3y@b(9l+!gS|M0Gy^h5oIjvFD zN3G8H@gdZne&h}qtx|`1;A%g#xpp*|*WtKi5+wvN32uTgTGj(#G=(x$@*!T$QDHm9 zyUt(g-4P5!n1pPWNAhT?@J58~13fJ1gDvaT-xnpp&FUPBXvQvT^c8k;e&a5>&tP{d+qJqQYs8VkHC%nWsvTy7FWUK; zJR(HRumjY@iA7u;2u`Qyc&J82^2I@#!mXptWPfr_iaCW2bitjU2XF*AVV>HySzk(~ zem`MDjQ)MZ;I0Cw-hFw;6(u>*%VgR)M49A1{!LWu9qvqROGZkPyU%1a>VIhWmbk+Rz1NzB_ZNY!XUb@Y*zuU1AdT_uH@xjYVztLgo$u%F#qwA`? zvONpal4~ED&!~^l6&njf3PX*>x|sU%=!eNQ>23N<`M0x=#uTzoXgU=Ntw22!vNx!nBgx>YD zp<~k2{U3IfvrS*=g!G3ViF6q544GS(XEpo?)NrZgS!s7NbRC74$*>JaXt9EXs|cN^Z7r z+Wga}kK0a{9G%c*eG0mFFSvgW{c&)dY5#ERaqs(iY>;@J!k`irlQ6Ak()^Vx$B$pN zYD_``cF&jnXE_;mVX)En4S(dzuWlmVjT#C!I#E#kHKn~S==x}*33XQV20013UbNUpYPqzJN_1yjMq;JMg zj5q*GUrxuKA_el_@^ku@M}PpeYY9%Rs1iaH(ZJWw5&>_YIQM_0-J8CIfX$tWKQLoBc#SQfRa;9XkBgsV$|W(5=RYnq*6j-DW>DaailRBP{gP~$YCBw6^Yza zO%CUXQGcSAObMWl90{SZ3?LOZi6c)0D-^Aa2Nw&jx$yTjq$k=ui|9FoD;Zym$gNp^%TzLPC z^t^Ap&9jKHM;wkXsfx+lS09?PPQ?eeJ0%yfpphZ}a>KOQ_FKUQ#J-Uh=<~$PR}lpN zj1fr{mo7y`=qfsyiOb89z<004*mG$u;47_s8SOCT}mX{~RH!vCr=KQzwBcth>^ O9z-&9zZ^TA0002YjO2*` literal 0 HcmV?d00001 diff --git a/contrib/contextmenu/dist/jquery.contextMenu.css b/contrib/contextmenu/dist/jquery.contextMenu.css new file mode 100644 index 0000000..3d83e23 --- /dev/null +++ b/contrib/contextmenu/dist/jquery.contextMenu.css @@ -0,0 +1,206 @@ +@charset "UTF-8"; +/*! + * jQuery contextMenu - Plugin for simple contextMenu handling + * + * Version: v2.1.0 + * + * Authors: Björn Brala (SWIS.nl), Rodney Rehm, Addy Osmani (patches for FF) + * Web: http://swisnl.github.io/jQuery-contextMenu/ + * + * Copyright (c) 2011-2016 SWIS BV and contributors + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + * Date: 2016-02-28T09:41:28.803Z + */ +@font-face { + font-family: "context-menu-icons"; + font-style: normal; + font-weight: normal; + + src: url("font/context-menu-icons.eot?2qmzf"); + src: url("font/context-menu-icons.eot?2qmzf#iefix") format("embedded-opentype"), url("font/context-menu-icons.woff2?2qmzf") format("woff2"), url("font/context-menu-icons.woff?2qmzf") format("woff"), url("font/context-menu-icons.ttf?2qmzf") format("truetype"); +} + +.context-menu-icon:before { + position: absolute; + top: 50%; + left: 0; + width: 28px; + font-family: "context-menu-icons"; + font-size: 16px; + font-style: normal; + font-weight: normal; + line-height: 1; + color: #2980b9; + text-align: center; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + -o-transform: translateY(-50%); + transform: translateY(-50%); + + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.context-menu-icon-add:before { + content: ""; +} + +.context-menu-icon-copy:before { + content: ""; +} + +.context-menu-icon-cut:before { + content: ""; +} + +.context-menu-icon-delete:before { + content: ""; +} + +.context-menu-icon-edit:before { + content: ""; +} + +.context-menu-icon-paste:before { + content: ""; +} + +.context-menu-icon-quit:before { + content: ""; +} + +.context-menu-icon.context-menu-hover:before { + color: #fff; +} + +.context-menu-list { + position: absolute; + display: inline-block; + min-width: 180px; + max-width: 360px; + padding: 4px 0; + margin: 5px; + font-family: inherit; + font-size: inherit; + list-style-type: none; + background: #fff; + border: 1px solid #bebebe; + border-radius: 3px; + -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, .5); + box-shadow: 0 2px 5px rgba(0, 0, 0, .5); +} + +.context-menu-item { + position: relative; + padding: 3px 28px; + color: #2f2f2f; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-color: #fff; +} + +.context-menu-separator { + padding: 0; + margin: 5px 0; + border-bottom: 1px solid #e6e6e6; +} + +.context-menu-item > label > input, +.context-menu-item > label > textarea { + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.context-menu-item.context-menu-hover { + color: #fff; + cursor: pointer; + background-color: #2980b9; +} + +.context-menu-item.context-menu-disabled { + color: #626262; + background-color: #fff; +} + +.context-menu-item.context-menu-disabled { + color: #626262; +} + +.context-menu-input.context-menu-hover, +.context-menu-item.context-menu-disabled.context-menu-hover { + cursor: default; + background-color: #eee; +} + +.context-menu-submenu:after { + position: absolute; + top: 50%; + right: 8px; + z-index: 1; + width: 0; + height: 0; + content: ''; + border-color: transparent transparent transparent #2f2f2f; + border-style: solid; + border-width: 4px 0 4px 4px; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + -o-transform: translateY(-50%); + transform: translateY(-50%); +} + +/** + * Inputs + */ +.context-menu-item.context-menu-input { + padding: 5px 10px; +} + +/* vertically align inside labels */ +.context-menu-input > label > * { + vertical-align: top; +} + +/* position checkboxes and radios as icons */ +.context-menu-input > label > input[type="checkbox"], +.context-menu-input > label > input[type="radio"] { + position: relative; + top: 3px; +} + +.context-menu-input > label, +.context-menu-input > label > input[type="text"], +.context-menu-input > label > textarea, +.context-menu-input > label > select { + display: block; + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.context-menu-input > label > textarea { + height: 100px; +} + +.context-menu-item > .context-menu-list { + top: 5px; + /* re-positioned by js */ + right: -5px; + display: none; +} + +.context-menu-item.context-menu-visible > .context-menu-list { + display: block; +} + +.context-menu-accesskey { + text-decoration: underline; +} diff --git a/contrib/contextmenu/dist/jquery.contextMenu.js b/contrib/contextmenu/dist/jquery.contextMenu.js new file mode 100644 index 0000000..0d3edb1 --- /dev/null +++ b/contrib/contextmenu/dist/jquery.contextMenu.js @@ -0,0 +1,1904 @@ +/*! + * jQuery contextMenu v2.1.0 - Plugin for simple contextMenu handling + * + * Version: v2.1.0 + * + * Authors: Björn Brala (SWIS.nl), Rodney Rehm, Addy Osmani (patches for FF) + * Web: http://swisnl.github.io/jQuery-contextMenu/ + * + * Copyright (c) 2011-2016 SWIS BV and contributors + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * GPL v3 http://opensource.org/licenses/GPL-3.0 + * + * Date: 2016-02-28T09:41:24.636Z + */ + +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as anonymous module. + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // Node / CommonJS + factory(require('jquery')); + } else { + // Browser globals. + factory(jQuery); + } +})(function ($) { + + 'use strict'; + + // TODO: - + // ARIA stuff: menuitem, menuitemcheckbox und menuitemradio + // create structure if $.support[htmlCommand || htmlMenuitem] and !opt.disableNative + + // determine html5 compatibility + $.support.htmlMenuitem = ('HTMLMenuItemElement' in window); + $.support.htmlCommand = ('HTMLCommandElement' in window); + $.support.eventSelectstart = ('onselectstart' in document.documentElement); + /* // should the need arise, test for css user-select + $.support.cssUserSelect = (function(){ + var t = false, + e = document.createElement('div'); + + $.each('Moz|Webkit|Khtml|O|ms|Icab|'.split('|'), function(i, prefix) { + var propCC = prefix + (prefix ? 'U' : 'u') + 'serSelect', + prop = (prefix ? ('-' + prefix.toLowerCase() + '-') : '') + 'user-select'; + + e.style.cssText = prop + ': text;'; + if (e.style[propCC] == 'text') { + t = true; + return false; + } + + return true; + }); + + return t; + })(); + */ + + /* jshint ignore:start */ + if (!$.ui || !$.widget) { + // duck punch $.cleanData like jQueryUI does to get that remove event + $.cleanData = (function (orig) { + return function (elems) { + var events, elem, i; + for (i = 0; elems[i] != null; i++) { + elem = elems[i]; + try { + // Only trigger remove when necessary to save time + events = $._data(elem, 'events'); + if (events && events.remove) { + $(elem).triggerHandler('remove'); + } + + // Http://bugs.jquery.com/ticket/8235 + } catch (e) {} + } + orig(elems); + }; + })($.cleanData); + } + /* jshint ignore:end */ + + var // currently active contextMenu trigger + $currentTrigger = null, + // is contextMenu initialized with at least one menu? + initialized = false, + // window handle + $win = $(window), + // number of registered menus + counter = 0, + // mapping selector to namespace + namespaces = {}, + // mapping namespace to options + menus = {}, + // custom command type handlers + types = {}, + // default values + defaults = { + // selector of contextMenu trigger + selector: null, + // where to append the menu to + appendTo: null, + // method to trigger context menu ["right", "left", "hover"] + trigger: 'right', + // hide menu when mouse leaves trigger / menu elements + autoHide: false, + // ms to wait before showing a hover-triggered context menu + delay: 200, + // flag denoting if a second trigger should simply move (true) or rebuild (false) an open menu + // as long as the trigger happened on one of the trigger-element's child nodes + reposition: true, + + // Default classname configuration to be able avoid conflicts in frameworks + classNames : { + + hover: 'context-menu-hover', // Item hover + disabled: 'context-menu-disabled', // Item disabled + visible: 'context-menu-visible', // Item visible + notSelectable: 'context-menu-not-selectable', // Item not selectable + + icon: 'context-menu-icon', + iconEdit: 'context-menu-icon-edit', + iconCut: 'context-menu-icon-cut', + iconCopy: 'context-menu-icon-copy', + iconPaste: 'context-menu-icon-paste', + iconDelete: 'context-menu-icon-delete', + iconAdd: 'context-menu-icon-add', + iconQuit: 'context-menu-icon-quit' + }, + + // determine position to show menu at + determinePosition: function ($menu) { + // position to the lower middle of the trigger element + if ($.ui && $.ui.position) { + // .position() is provided as a jQuery UI utility + // (...and it won't work on hidden elements) + $menu.css('display', 'block').position({ + my: 'center top', + at: 'center bottom', + of: this, + offset: '0 5', + collision: 'fit' + }).css('display', 'none'); + } else { + // determine contextMenu position + var offset = this.offset(); + offset.top += this.outerHeight(); + offset.left += this.outerWidth() / 2 - $menu.outerWidth() / 2; + $menu.css(offset); + } + }, + // position menu + position: function (opt, x, y) { + var offset; + // determine contextMenu position + if (!x && !y) { + opt.determinePosition.call(this, opt.$menu); + return; + } else if (x === 'maintain' && y === 'maintain') { + // x and y must not be changed (after re-show on command click) + offset = opt.$menu.position(); + } else { + // x and y are given (by mouse event) + offset = {top: y, left: x}; + } + + // correct offset if viewport demands it + var bottom = $win.scrollTop() + $win.height(), + right = $win.scrollLeft() + $win.width(), + height = opt.$menu.outerHeight(), + width = opt.$menu.outerWidth(); + + if (offset.top + height > bottom) { + offset.top -= height; + } + + if (offset.top < 0) { + offset.top = 0; + } + + if (offset.left + width > right) { + offset.left -= width; + } + + if (offset.left < 0) { + offset.left = 0; + } + + opt.$menu.css(offset); + }, + // position the sub-menu + positionSubmenu: function ($menu) { + if ($.ui && $.ui.position) { + // .position() is provided as a jQuery UI utility + // (...and it won't work on hidden elements) + $menu.css('display', 'block').position({ + my: 'left top', + at: 'right top', + of: this, + collision: 'flipfit fit' + }).css('display', ''); + } else { + // determine contextMenu position + var offset = { + top: 0, + left: this.outerWidth() + }; + $menu.css(offset); + } + }, + // offset to add to zIndex + zIndex: 1, + // show hide animation settings + animation: { + duration: 50, + show: 'slideDown', + hide: 'slideUp' + }, + // events + events: { + show: $.noop, + hide: $.noop + }, + // default callback + callback: null, + // list of contextMenu items + items: {} + }, + // mouse position for hover activation + hoveract = { + timer: null, + pageX: null, + pageY: null + }, + // determine zIndex + zindex = function ($t) { + var zin = 0, + $tt = $t; + + while (true) { + zin = Math.max(zin, parseInt($tt.css('z-index'), 10) || 0); + $tt = $tt.parent(); + if (!$tt || !$tt.length || 'html body'.indexOf($tt.prop('nodeName').toLowerCase()) > -1) { + break; + } + } + return zin; + }, + // event handlers + handle = { + // abort anything + abortevent: function (e) { + e.preventDefault(); + e.stopImmediatePropagation(); + }, + // contextmenu show dispatcher + contextmenu: function (e) { + var $this = $(this); + + // disable actual context-menu if we are using the right mouse button as the trigger + if (e.data.trigger === 'right') { + e.preventDefault(); + e.stopImmediatePropagation(); + } + + // abort native-triggered events unless we're triggering on right click + if ((e.data.trigger !== 'right' && e.data.trigger !== 'demand') && e.originalEvent) { + return; + } + + // Let the current contextmenu decide if it should show or not based on its own trigger settings + if (e.mouseButton !== undefined && e.data) { + if (!(e.data.trigger === 'left' && e.mouseButton === 0) && !(e.data.trigger === 'right' && e.mouseButton === 2)) { + // Mouse click is not valid. + return; + } + } + + // abort event if menu is visible for this trigger + if ($this.hasClass('context-menu-active')) { + return; + } + + if (!$this.hasClass('context-menu-disabled')) { + // theoretically need to fire a show event at + // http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus + // var evt = jQuery.Event("show", { data: data, pageX: e.pageX, pageY: e.pageY, relatedTarget: this }); + // e.data.$menu.trigger(evt); + + $currentTrigger = $this; + if (e.data.build) { + var built = e.data.build($currentTrigger, e); + // abort if build() returned false + if (built === false) { + return; + } + + // dynamically build menu on invocation + e.data = $.extend(true, {}, defaults, e.data, built || {}); + + // abort if there are no items to display + if (!e.data.items || $.isEmptyObject(e.data.items)) { + // Note: jQuery captures and ignores errors from event handlers + if (window.console) { + (console.error || console.log).call(console, 'No items specified to show in contextMenu'); + } + + throw new Error('No Items specified'); + } + + // backreference for custom command type creation + e.data.$trigger = $currentTrigger; + + op.create(e.data); + } + var showMenu = false; + for (var item in e.data.items) { + if (e.data.items.hasOwnProperty(item)) { + var visible; + if ($.isFunction(e.data.items[item].visible)) { + visible = e.data.items[item].visible.call($(e.currentTarget), item, e.data); + } else if (typeof item.visible !== 'undefined') { + visible = e.data.items[item].visible === true; + } else { + visible = true; + } + if (visible) { + showMenu = true; + } + } + } + if (showMenu) { + // show menu + var menuContainer = (e.data.appendTo === null ? $('body') : $(e.data.appendTo)); + var srcElement = e.target || e.srcElement || e.originalTarget; + if (e.offsetX !== undefined && e.offsetY !== undefined) { + op.show.call($this, e.data, + $(srcElement).offset().left - menuContainer.offset().left + e.offsetX, + $(srcElement).offset().top - menuContainer.offset().top + e.offsetY); + } else { + op.show.call($this, e.data, e.pageX, e.pageY); + } + } + } + }, + // contextMenu left-click trigger + click: function (e) { + e.preventDefault(); + e.stopImmediatePropagation(); + $(this).trigger($.Event('contextmenu', {data: e.data, pageX: e.pageX, pageY: e.pageY})); + }, + // contextMenu right-click trigger + mousedown: function (e) { + // register mouse down + var $this = $(this); + + // hide any previous menus + if ($currentTrigger && $currentTrigger.length && !$currentTrigger.is($this)) { + $currentTrigger.data('contextMenu').$menu.trigger('contextmenu:hide'); + } + + // activate on right click + if (e.button === 2) { + $currentTrigger = $this.data('contextMenuActive', true); + } + }, + // contextMenu right-click trigger + mouseup: function (e) { + // show menu + var $this = $(this); + if ($this.data('contextMenuActive') && $currentTrigger && $currentTrigger.length && $currentTrigger.is($this) && !$this.hasClass('context-menu-disabled')) { + e.preventDefault(); + e.stopImmediatePropagation(); + $currentTrigger = $this; + $this.trigger($.Event('contextmenu', {data: e.data, pageX: e.pageX, pageY: e.pageY})); + } + + $this.removeData('contextMenuActive'); + }, + // contextMenu hover trigger + mouseenter: function (e) { + var $this = $(this), + $related = $(e.relatedTarget), + $document = $(document); + + // abort if we're coming from a menu + if ($related.is('.context-menu-list') || $related.closest('.context-menu-list').length) { + return; + } + + // abort if a menu is shown + if ($currentTrigger && $currentTrigger.length) { + return; + } + + hoveract.pageX = e.pageX; + hoveract.pageY = e.pageY; + hoveract.data = e.data; + $document.on('mousemove.contextMenuShow', handle.mousemove); + hoveract.timer = setTimeout(function () { + hoveract.timer = null; + $document.off('mousemove.contextMenuShow'); + $currentTrigger = $this; + $this.trigger($.Event('contextmenu', { + data: hoveract.data, + pageX: hoveract.pageX, + pageY: hoveract.pageY + })); + }, e.data.delay); + }, + // contextMenu hover trigger + mousemove: function (e) { + hoveract.pageX = e.pageX; + hoveract.pageY = e.pageY; + }, + // contextMenu hover trigger + mouseleave: function (e) { + // abort if we're leaving for a menu + var $related = $(e.relatedTarget); + if ($related.is('.context-menu-list') || $related.closest('.context-menu-list').length) { + return; + } + + try { + clearTimeout(hoveract.timer); + } catch (e) { + } + + hoveract.timer = null; + }, + // click on layer to hide contextMenu + layerClick: function (e) { + var $this = $(this), + root = $this.data('contextMenuRoot'), + button = e.button, + x = e.pageX, + y = e.pageY, + target, + offset; + + e.preventDefault(); + e.stopImmediatePropagation(); + + setTimeout(function () { + var $window; + var triggerAction = ((root.trigger === 'left' && button === 0) || (root.trigger === 'right' && button === 2)); + + // find the element that would've been clicked, wasn't the layer in the way + if (document.elementFromPoint && root.$layer) { + root.$layer.hide(); + target = document.elementFromPoint(x - $win.scrollLeft(), y - $win.scrollTop()); + root.$layer.show(); + } + + if (root.reposition && triggerAction) { + if (document.elementFromPoint) { + if (root.$trigger.is(target) || root.$trigger.has(target).length) { + root.position.call(root.$trigger, root, x, y); + return; + } + } else { + offset = root.$trigger.offset(); + $window = $(window); + // while this looks kinda awful, it's the best way to avoid + // unnecessarily calculating any positions + offset.top += $window.scrollTop(); + if (offset.top <= e.pageY) { + offset.left += $window.scrollLeft(); + if (offset.left <= e.pageX) { + offset.bottom = offset.top + root.$trigger.outerHeight(); + if (offset.bottom >= e.pageY) { + offset.right = offset.left + root.$trigger.outerWidth(); + if (offset.right >= e.pageX) { + // reposition + root.position.call(root.$trigger, root, x, y); + return; + } + } + } + } + } + } + + if (target && triggerAction) { + root.$trigger.one('contextmenu:hidden', function () { + $(target).contextMenu({ x: x, y: y, button: button }); + }); + } + + root.$menu.trigger('contextmenu:hide'); + }, 50); + }, + // key handled :hover + keyStop: function (e, opt) { + if (!opt.isInput) { + e.preventDefault(); + } + + e.stopPropagation(); + }, + key: function (e) { + + var opt = {}; + + // Only get the data from $currentTrigger if it exists + if ($currentTrigger) { + opt = $currentTrigger.data('contextMenu') || {}; + } + // If the trigger happen on a element that are above the contextmenu do this + if (opt.zIndex === undefined) { + opt.zIndex = 0; + } + var targetZIndex = 0; + var getZIndexOfTriggerTarget = function (target) { + if (target.style.zIndex !== '') { + targetZIndex = target.style.zIndex; + } else { + if (target.offsetParent !== null && target.offsetParent !== undefined) { + getZIndexOfTriggerTarget(target.offsetParent); + } + else if (target.parentElement !== null && target.parentElement !== undefined) { + getZIndexOfTriggerTarget(target.parentElement); + } + } + }; + getZIndexOfTriggerTarget(e.target); + // If targetZIndex is heigher then opt.zIndex dont progress any futher. + // This is used to make sure that if you are using a dialog with a input / textarea / contenteditable div + // and its above the contextmenu it wont steal keys events + if (targetZIndex > opt.zIndex) { + return; + } + switch (e.keyCode) { + case 9: + case 38: // up + handle.keyStop(e, opt); + // if keyCode is [38 (up)] or [9 (tab) with shift] + if (opt.isInput) { + if (e.keyCode === 9 && e.shiftKey) { + e.preventDefault(); + if(opt.$selected) { + opt.$selected.find('input, textarea, select').blur(); + } + opt.$menu.trigger('prevcommand'); + return; + } else if (e.keyCode === 38 && opt.$selected.find('input, textarea, select').prop('type') === 'checkbox') { + // checkboxes don't capture this key + e.preventDefault(); + return; + } + } else if (e.keyCode !== 9 || e.shiftKey) { + opt.$menu.trigger('prevcommand'); + return; + } + break; + // omitting break; + // case 9: // tab - reached through omitted break; + case 40: // down + handle.keyStop(e, opt); + if (opt.isInput) { + if (e.keyCode === 9) { + e.preventDefault(); + if(opt.$selected) { + opt.$selected.find('input, textarea, select').blur(); + } + opt.$menu.trigger('nextcommand'); + return; + } else if (e.keyCode === 40 && opt.$selected.find('input, textarea, select').prop('type') === 'checkbox') { + // checkboxes don't capture this key + e.preventDefault(); + return; + } + } else { + opt.$menu.trigger('nextcommand'); + return; + } + break; + + case 37: // left + handle.keyStop(e, opt); + if (opt.isInput || !opt.$selected || !opt.$selected.length) { + break; + } + + if (!opt.$selected.parent().hasClass('context-menu-root')) { + var $parent = opt.$selected.parent().parent(); + opt.$selected.trigger('contextmenu:blur'); + opt.$selected = $parent; + return; + } + break; + + case 39: // right + handle.keyStop(e, opt); + if (opt.isInput || !opt.$selected || !opt.$selected.length) { + break; + } + + var itemdata = opt.$selected.data('contextMenu') || {}; + if (itemdata.$menu && opt.$selected.hasClass('context-menu-submenu')) { + opt.$selected = null; + itemdata.$selected = null; + itemdata.$menu.trigger('nextcommand'); + return; + } + break; + + case 35: // end + case 36: // home + if (opt.$selected && opt.$selected.find('input, textarea, select').length) { + return; + } else { + (opt.$selected && opt.$selected.parent() || opt.$menu) + .children(':not(.' + opt.classNames.disabled + ', .' + opt.classNames.notSelectable + ')')[e.keyCode === 36 ? 'first' : 'last']() + .trigger('contextmenu:focus'); + e.preventDefault(); + return; + } + break; + + case 13: // enter + handle.keyStop(e, opt); + if (opt.isInput) { + if (opt.$selected && !opt.$selected.is('textarea, select')) { + e.preventDefault(); + return; + } + break; + } + if (typeof opt.$selected !== 'undefined' && opt.$selected !== null) { + opt.$selected.trigger('mouseup'); + } + return; + + case 32: // space + case 33: // page up + case 34: // page down + // prevent browser from scrolling down while menu is visible + handle.keyStop(e, opt); + return; + + case 27: // esc + handle.keyStop(e, opt); + opt.$menu.trigger('contextmenu:hide'); + return; + + default: // 0-9, a-z + var k = (String.fromCharCode(e.keyCode)).toUpperCase(); + if (opt.accesskeys && opt.accesskeys[k]) { + // according to the specs accesskeys must be invoked immediately + opt.accesskeys[k].$node.trigger(opt.accesskeys[k].$menu ? 'contextmenu:focus' : 'mouseup'); + return; + } + break; + } + // pass event to selected item, + // stop propagation to avoid endless recursion + e.stopPropagation(); + if (typeof opt.$selected !== 'undefined' && opt.$selected !== null) { + opt.$selected.trigger(e); + } + }, + // select previous possible command in menu + prevItem: function (e) { + e.stopPropagation(); + var opt = $(this).data('contextMenu') || {}; + var root = $(this).data('contextMenuRoot') || {}; + + // obtain currently selected menu + if (opt.$selected) { + var $s = opt.$selected; + opt = opt.$selected.parent().data('contextMenu') || {}; + opt.$selected = $s; + } + + var $children = opt.$menu.children(), + $prev = !opt.$selected || !opt.$selected.prev().length ? $children.last() : opt.$selected.prev(), + $round = $prev; + + // skip disabled or hidden elements + while ($prev.hasClass(root.classNames.disabled) || $prev.hasClass(root.classNames.notSelectable) || $prev.is(':hidden')) { + if ($prev.prev().length) { + $prev = $prev.prev(); + } else { + $prev = $children.last(); + } + if ($prev.is($round)) { + // break endless loop + return; + } + } + + // leave current + if (opt.$selected) { + handle.itemMouseleave.call(opt.$selected.get(0), e); + } + + // activate next + handle.itemMouseenter.call($prev.get(0), e); + + // focus input + var $input = $prev.find('input, textarea, select'); + if ($input.length) { + $input.focus(); + } + }, + // select next possible command in menu + nextItem: function (e) { + e.stopPropagation(); + var opt = $(this).data('contextMenu') || {}; + var root = $(this).data('contextMenuRoot') || {}; + + // obtain currently selected menu + if (opt.$selected) { + var $s = opt.$selected; + opt = opt.$selected.parent().data('contextMenu') || {}; + opt.$selected = $s; + } + + var $children = opt.$menu.children(), + $next = !opt.$selected || !opt.$selected.next().length ? $children.first() : opt.$selected.next(), + $round = $next; + + // skip disabled + while ($next.hasClass(root.classNames.disabled) || $next.hasClass(root.classNames.notSelectable) || $next.is(':hidden')) { + if ($next.next().length) { + $next = $next.next(); + } else { + $next = $children.first(); + } + if ($next.is($round)) { + // break endless loop + return; + } + } + + // leave current + if (opt.$selected) { + handle.itemMouseleave.call(opt.$selected.get(0), e); + } + + // activate next + handle.itemMouseenter.call($next.get(0), e); + + // focus input + var $input = $next.find('input, textarea, select'); + if ($input.length) { + $input.focus(); + } + }, + // flag that we're inside an input so the key handler can act accordingly + focusInput: function () { + var $this = $(this).closest('.context-menu-item'), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot; + + root.$selected = opt.$selected = $this; + root.isInput = opt.isInput = true; + }, + // flag that we're inside an input so the key handler can act accordingly + blurInput: function () { + var $this = $(this).closest('.context-menu-item'), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot; + + root.isInput = opt.isInput = false; + }, + // :hover on menu + menuMouseenter: function () { + var root = $(this).data().contextMenuRoot; + root.hovering = true; + }, + // :hover on menu + menuMouseleave: function (e) { + var root = $(this).data().contextMenuRoot; + if (root.$layer && root.$layer.is(e.relatedTarget)) { + root.hovering = false; + } + }, + // :hover done manually so key handling is possible + itemMouseenter: function (e) { + var $this = $(this), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot; + + root.hovering = true; + + // abort if we're re-entering + if (e && root.$layer && root.$layer.is(e.relatedTarget)) { + e.preventDefault(); + e.stopImmediatePropagation(); + } + + // make sure only one item is selected + (opt.$menu ? opt : root).$menu + .children('.' + root.classNames.hover).trigger('contextmenu:blur') + .children('.hover').trigger('contextmenu:blur'); + + if ($this.hasClass(root.classNames.disabled) || $this.hasClass(root.classNames.notSelectable)) { + opt.$selected = null; + return; + } + + $this.trigger('contextmenu:focus'); + }, + // :hover done manually so key handling is possible + itemMouseleave: function (e) { + var $this = $(this), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot; + + if (root !== opt && root.$layer && root.$layer.is(e.relatedTarget)) { + if (typeof root.$selected !== 'undefined' && root.$selected !== null) { + root.$selected.trigger('contextmenu:blur'); + } + e.preventDefault(); + e.stopImmediatePropagation(); + root.$selected = opt.$selected = opt.$node; + return; + } + + $this.trigger('contextmenu:blur'); + }, + // contextMenu item click + itemClick: function (e) { + var $this = $(this), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot, + key = data.contextMenuKey, + callback; + + // abort if the key is unknown or disabled or is a menu + if (!opt.items[key] || $this.is('.' + root.classNames.disabled + ', .context-menu-submenu, .context-menu-separator, .' + root.classNames.notSelectable)) { + return; + } + + e.preventDefault(); + e.stopImmediatePropagation(); + + if ($.isFunction(root.callbacks[key]) && Object.prototype.hasOwnProperty.call(root.callbacks, key)) { + // item-specific callback + callback = root.callbacks[key]; + } else if ($.isFunction(root.callback)) { + // default callback + callback = root.callback; + } else { + // no callback, no action + return; + } + + // hide menu if callback doesn't stop that + if (callback.call(root.$trigger, key, root) !== false) { + root.$menu.trigger('contextmenu:hide'); + } else if (root.$menu.parent().length) { + op.update.call(root.$trigger, root); + } + }, + // ignore click events on input elements + inputClick: function (e) { + e.stopImmediatePropagation(); + }, + // hide + hideMenu: function (e, data) { + var root = $(this).data('contextMenuRoot'); + op.hide.call(root.$trigger, root, data && data.force); + }, + // focus + focusItem: function (e) { + e.stopPropagation(); + var $this = $(this), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot; + + $this + .addClass([root.classNames.hover, root.classNames.visible].join(' ')) + // select other items and included items + .parent().find('.context-menu-item').not($this) + .removeClass(root.classNames.visible) + .filter('.' + root.classNames.hover) + .trigger('contextmenu:blur'); + + // remember selected + opt.$selected = root.$selected = $this; + + // position sub-menu - do after show so dumb $.ui.position can keep up + if (opt.$node) { + root.positionSubmenu.call(opt.$node, opt.$menu); + } + }, + // blur + blurItem: function (e) { + e.stopPropagation(); + var $this = $(this), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot; + + if (opt.autoHide) { // for tablets and touch screens this needs to remain + $this.removeClass(root.classNames.visible); + } + $this.removeClass(root.classNames.hover); + opt.$selected = null; + } + }, + // operations + op = { + show: function (opt, x, y) { + var $trigger = $(this), + css = {}; + + // hide any open menus + $('#context-menu-layer').trigger('mousedown'); + + // backreference for callbacks + opt.$trigger = $trigger; + + // show event + if (opt.events.show.call($trigger, opt) === false) { + $currentTrigger = null; + return; + } + + // create or update context menu + op.update.call($trigger, opt); + + // position menu + opt.position.call($trigger, opt, x, y); + + // make sure we're in front + if (opt.zIndex) { + var additionalZValue = opt.zIndex; + // If opt.zIndex is a function, call the function to get the right zIndex. + if (typeof opt.zIndex === 'function') { + additionalZValue = opt.zIndex.call($trigger, opt); + } + css.zIndex = zindex($trigger) + additionalZValue; + } + + // add layer + op.layer.call(opt.$menu, opt, css.zIndex); + + // adjust sub-menu zIndexes + opt.$menu.find('ul').css('zIndex', css.zIndex + 1); + + // position and show context menu + opt.$menu.css(css)[opt.animation.show](opt.animation.duration, function () { + $trigger.trigger('contextmenu:visible'); + }); + // make options available and set state + $trigger + .data('contextMenu', opt) + .addClass('context-menu-active'); + + // register key handler + $(document).off('keydown.contextMenu').on('keydown.contextMenu', handle.key); + // register autoHide handler + if (opt.autoHide) { + // mouse position handler + $(document).on('mousemove.contextMenuAutoHide', function (e) { + // need to capture the offset on mousemove, + // since the page might've been scrolled since activation + var pos = $trigger.offset(); + pos.right = pos.left + $trigger.outerWidth(); + pos.bottom = pos.top + $trigger.outerHeight(); + + if (opt.$layer && !opt.hovering && (!(e.pageX >= pos.left && e.pageX <= pos.right) || !(e.pageY >= pos.top && e.pageY <= pos.bottom))) { + /* Additional hover check after short time, you might just miss the edge of the menu */ + setTimeout(function () { + if (!opt.hovering) { opt.$menu.trigger('contextmenu:hide'); } + }, 50); + } + }); + } + }, + hide: function (opt, force) { + var $trigger = $(this); + if (!opt) { + opt = $trigger.data('contextMenu') || {}; + } + + // hide event + if (!force && opt.events && opt.events.hide.call($trigger, opt) === false) { + return; + } + + // remove options and revert state + $trigger + .removeData('contextMenu') + .removeClass('context-menu-active'); + + if (opt.$layer) { + // keep layer for a bit so the contextmenu event can be aborted properly by opera + setTimeout((function ($layer) { + return function () { + $layer.remove(); + }; + })(opt.$layer), 10); + + try { + delete opt.$layer; + } catch (e) { + opt.$layer = null; + } + } + + // remove handle + $currentTrigger = null; + // remove selected + opt.$menu.find('.' + opt.classNames.hover).trigger('contextmenu:blur'); + opt.$selected = null; + // collapse all submenus + opt.$menu.find('.' + opt.classNames.visible).removeClass(opt.classNames.visible); + // unregister key and mouse handlers + // $(document).off('.contextMenuAutoHide keydown.contextMenu'); // http://bugs.jquery.com/ticket/10705 + $(document).off('.contextMenuAutoHide').off('keydown.contextMenu'); + // hide menu + if(opt.$menu){ + opt.$menu[opt.animation.hide](opt.animation.duration, function () { + // tear down dynamically built menu after animation is completed. + if (opt.build) { + opt.$menu.remove(); + $.each(opt, function (key) { + switch (key) { + case 'ns': + case 'selector': + case 'build': + case 'trigger': + return true; + + default: + opt[key] = undefined; + try { + delete opt[key]; + } catch (e) { + } + return true; + } + }); + } + + setTimeout(function () { + $trigger.trigger('contextmenu:hidden'); + }, 10); + }); + } + }, + create: function (opt, root) { + if (root === undefined) { + root = opt; + } + // create contextMenu + opt.$menu = $('
    ').addClass(opt.className || '').data({ + 'contextMenu': opt, + 'contextMenuRoot': root + }); + + $.each(['callbacks', 'commands', 'inputs'], function (i, k) { + opt[k] = {}; + if (!root[k]) { + root[k] = {}; + } + }); + + if(!root.accesskeys){ + root.accesskeys = {}; + } + + function createNameNode(item) { + var $name = $(''); + if (item._accesskey) { + if (item._beforeAccesskey) { + $name.append(document.createTextNode(item._beforeAccesskey)); + } + $('') + .addClass('context-menu-accesskey') + .text(item._accesskey) + .appendTo($name); + if (item._afterAccesskey) { + $name.append(document.createTextNode(item._afterAccesskey)); + } + } else { + $name.text(item.name); + } + return $name; + } + + // create contextMenu items + $.each(opt.items, function (key, item) { + var $t = $('
  • ').addClass(item.className || ''), + $label = null, + $input = null; + + // iOS needs to see a click-event bound to an element to actually + // have the TouchEvents infrastructure trigger the click event + $t.on('click', $.noop); + + // Make old school string seperator a real item so checks wont be + // akward later. + if (typeof item === 'string') { + item = { type : 'cm_seperator' }; + } + + item.$node = $t.data({ + 'contextMenu': opt, + 'contextMenuRoot': root, + 'contextMenuKey': key + }); + + // register accesskey + // NOTE: the accesskey attribute should be applicable to any element, but Safari5 and Chrome13 still can't do that + if (typeof item.accesskey !== 'undefined') { + var aks = splitAccesskey(item.accesskey); + for (var i = 0, ak; ak = aks[i]; i++) { + if (!root.accesskeys[ak]) { + root.accesskeys[ak] = item; + var matched = item.name.match(new RegExp('^(.*?)(' + ak + ')(.*)$', 'i')); + if (matched) { + item._beforeAccesskey = matched[1]; + item._accesskey = matched[2]; + item._afterAccesskey = matched[3]; + } + break; + } + } + } + + if (item.type && types[item.type]) { + // run custom type handler + types[item.type].call($t, item, opt, root); + // register commands + $.each([opt, root], function (i, k) { + k.commands[key] = item; + if ($.isFunction(item.callback)) { + k.callbacks[key] = item.callback; + } + }); + } else { + // add label for input + if (item.type === 'cm_seperator') { + $t.addClass('context-menu-separator ' + root.classNames.notSelectable); + } else if (item.type === 'html') { + $t.addClass('context-menu-html ' + root.classNames.notSelectable); + } else if (item.type) { + $label = $('').appendTo($t); + createNameNode(item).appendTo($label); + + $t.addClass('context-menu-input'); + opt.hasTypes = true; + $.each([opt, root], function (i, k) { + k.commands[key] = item; + k.inputs[key] = item; + }); + } else if (item.items) { + item.type = 'sub'; + } + + switch (item.type) { + case 'cm_seperator': + break; + + case 'text': + $input = $('') + .attr('name', 'context-menu-input-' + key) + .val(item.value || '') + .appendTo($label); + break; + + case 'textarea': + $input = $('') + .attr('name', 'context-menu-input-' + key) + .val(item.value || '') + .appendTo($label); + + if (item.height) { + $input.height(item.height); + } + break; + + case 'checkbox': + $input = $('') + .attr('name', 'context-menu-input-' + key) + .val(item.value || '') + .prop('checked', !!item.selected) + .prependTo($label); + break; + + case 'radio': + $input = $('') + .attr('name', 'context-menu-input-' + item.radio) + .val(item.value || '') + .prop('checked', !!item.selected) + .prependTo($label); + break; + + case 'select': + $input = $(' + if (item.type && item.type !== 'sub' && item.type !== 'html' && item.type !== 'cm_seperator') { + $input + .on('focus', handle.focusInput) + .on('blur', handle.blurInput); + + if (item.events) { + $input.on(item.events, opt); + } + } + + // add icons + if (item.icon) { + if ($.isFunction(item.icon)) { + item._icon = item.icon.call(this, this, $t, key, item); + } else { + item._icon = root.classNames.icon + ' ' + root.classNames.icon + '-' + item.icon; + } + $t.addClass(item._icon); + } + } + + // cache contained elements + item.$input = $input; + item.$label = $label; + + // attach item to menu + $t.appendTo(opt.$menu); + + // Disable text selection + if (!opt.hasTypes && $.support.eventSelectstart) { + // browsers support user-select: none, + // IE has a special event for text-selection + // browsers supporting neither will not be preventing text-selection + $t.on('selectstart.disableTextSelect', handle.abortevent); + } + }); + // attach contextMenu to (to bypass any possible overflow:hidden issues on parents of the trigger element) + if (!opt.$node) { + opt.$menu.css('display', 'none').addClass('context-menu-root'); + } + opt.$menu.appendTo(opt.appendTo || document.body); + }, + resize: function ($menu, nested) { + // determine widths of submenus, as CSS won't grow them automatically + // position:absolute within position:absolute; min-width:100; max-width:200; results in width: 100; + // kinda sucks hard... + + // determine width of absolutely positioned element + $menu.css({position: 'absolute', display: 'block'}); + // don't apply yet, because that would break nested elements' widths + $menu.data('width', Math.ceil($menu.outerWidth())); + // reset styles so they allow nested elements to grow/shrink naturally + $menu.css({ + position: 'static', + minWidth: '0px', + maxWidth: '100000px' + }); + // identify width of nested menus + $menu.find('> li > ul').each(function () { + op.resize($(this), true); + }); + // reset and apply changes in the end because nested + // elements' widths wouldn't be calculatable otherwise + if (!nested) { + $menu.find('ul').addBack().css({ + position: '', + display: '', + minWidth: '', + maxWidth: '' + }).outerWidth(function () { + return $(this).data('width'); + }); + } + }, + update: function (opt, root) { + var $trigger = this; + if (root === undefined) { + root = opt; + op.resize(opt.$menu); + } + // re-check disabled for each item + opt.$menu.children().each(function () { + var $item = $(this), + key = $item.data('contextMenuKey'), + item = opt.items[key], + disabled = ($.isFunction(item.disabled) && item.disabled.call($trigger, key, root)) || item.disabled === true, + visible; + if ($.isFunction(item.visible)) { + visible = item.visible.call($trigger, key, root); + } else if (typeof item.visible !== 'undefined') { + visible = item.visible === true; + } else { + visible = true; + } + $item[visible ? 'show' : 'hide'](); + + // dis- / enable item + $item[disabled ? 'addClass' : 'removeClass'](root.classNames.disabled); + + if ($.isFunction(item.icon)) { + $item.removeClass(item._icon); + item._icon = item.icon.call(this, $trigger, $item, key, item); + $item.addClass(item._icon); + } + + if (item.type) { + // dis- / enable input elements + $item.find('input, select, textarea').prop('disabled', disabled); + + // update input states + switch (item.type) { + case 'text': + case 'textarea': + item.$input.val(item.value || ''); + break; + + case 'checkbox': + case 'radio': + item.$input.val(item.value || '').prop('checked', !!item.selected); + break; + + case 'select': + item.$input.val(item.selected || ''); + break; + } + } + + if (item.$menu) { + // update sub-menu + op.update.call($trigger, item, root); + } + }); + }, + layer: function (opt, zIndex) { + // add transparent layer for click area + // filter and background for Internet Explorer, Issue #23 + var $layer = opt.$layer = $('
    ') + .css({height: $win.height(), width: $win.width(), display: 'block'}) + .data('contextMenuRoot', opt) + .insertBefore(this) + .on('contextmenu', handle.abortevent) + .on('mousedown', handle.layerClick); + + // IE6 doesn't know position:fixed; + if (document.body.style.maxWidth === undefined) { // IE6 doesn't support maxWidth + $layer.css({ + 'position': 'absolute', + 'height': $(document).height() + }); + } + + return $layer; + } + }; + + // split accesskey according to http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#assigned-access-key + function splitAccesskey(val) { + var t = val.split(/\s+/), + keys = []; + + for (var i = 0, k; k = t[i]; i++) { + k = k.charAt(0).toUpperCase(); // first character only + // theoretically non-accessible characters should be ignored, but different systems, different keyboard layouts, ... screw it. + // a map to look up already used access keys would be nice + keys.push(k); + } + + return keys; + } + +// handle contextMenu triggers + $.fn.contextMenu = function (operation) { + var $t = this, $o = operation; + if (this.length > 0) { // this is not a build on demand menu + if (operation === undefined) { + this.first().trigger('contextmenu'); + } else if (operation.x !== undefined && operation.y !== undefined) { + this.first().trigger($.Event('contextmenu', { pageX: operation.x, pageY: operation.y, mouseButton: operation.button })); + } else if (operation === 'hide') { + var $menu = this.first().data('contextMenu') ? this.first().data('contextMenu').$menu : null; + if($menu){ + $menu.trigger('contextmenu:hide'); + } + } else if (operation === 'destroy') { + $.contextMenu('destroy', {context: this}); + } else if ($.isPlainObject(operation)) { + operation.context = this; + $.contextMenu('create', operation); + } else if (operation) { + this.removeClass('context-menu-disabled'); + } else if (!operation) { + this.addClass('context-menu-disabled'); + } + } else { + $.each(menus, function () { + if (this.selector === $t.selector) { + $o.data = this; + + $.extend($o.data, {trigger: 'demand'}); + } + }); + + handle.contextmenu.call($o.target, $o); + } + + return this; + }; + + // manage contextMenu instances + $.contextMenu = function (operation, options) { + if (typeof operation !== 'string') { + options = operation; + operation = 'create'; + } + + if (typeof options === 'string') { + options = {selector: options}; + } else if (options === undefined) { + options = {}; + } + + // merge with default options + var o = $.extend(true, {}, defaults, options || {}); + var $document = $(document); + var $context = $document; + var _hasContext = false; + + if (!o.context || !o.context.length) { + o.context = document; + } else { + // you never know what they throw at you... + $context = $(o.context).first(); + o.context = $context.get(0); + _hasContext = o.context !== document; + } + + switch (operation) { + case 'create': + // no selector no joy + if (!o.selector) { + throw new Error('No selector specified'); + } + // make sure internal classes are not bound to + if (o.selector.match(/.context-menu-(list|item|input)($|\s)/)) { + throw new Error('Cannot bind to selector "' + o.selector + '" as it contains a reserved className'); + } + if (!o.build && (!o.items || $.isEmptyObject(o.items))) { + throw new Error('No Items specified'); + } + counter++; + o.ns = '.contextMenu' + counter; + if (!_hasContext) { + namespaces[o.selector] = o.ns; + } + menus[o.ns] = o; + + // default to right click + if (!o.trigger) { + o.trigger = 'right'; + } + + if (!initialized) { + // make sure item click is registered first + $document + .on({ + 'contextmenu:hide.contextMenu': handle.hideMenu, + 'prevcommand.contextMenu': handle.prevItem, + 'nextcommand.contextMenu': handle.nextItem, + 'contextmenu.contextMenu': handle.abortevent, + 'mouseenter.contextMenu': handle.menuMouseenter, + 'mouseleave.contextMenu': handle.menuMouseleave + }, '.context-menu-list') + .on('mouseup.contextMenu', '.context-menu-input', handle.inputClick) + .on({ + 'mouseup.contextMenu': handle.itemClick, + 'contextmenu:focus.contextMenu': handle.focusItem, + 'contextmenu:blur.contextMenu': handle.blurItem, + 'contextmenu.contextMenu': handle.abortevent, + 'mouseenter.contextMenu': handle.itemMouseenter, + 'mouseleave.contextMenu': handle.itemMouseleave + }, '.context-menu-item'); + + initialized = true; + } + + // engage native contextmenu event + $context + .on('contextmenu' + o.ns, o.selector, o, handle.contextmenu); + + if (_hasContext) { + // add remove hook, just in case + $context.on('remove' + o.ns, function () { + $(this).contextMenu('destroy'); + }); + } + + switch (o.trigger) { + case 'hover': + $context + .on('mouseenter' + o.ns, o.selector, o, handle.mouseenter) + .on('mouseleave' + o.ns, o.selector, o, handle.mouseleave); + break; + + case 'left': + $context.on('click' + o.ns, o.selector, o, handle.click); + break; + /* + default: + // http://www.quirksmode.org/dom/events/contextmenu.html + $document + .on('mousedown' + o.ns, o.selector, o, handle.mousedown) + .on('mouseup' + o.ns, o.selector, o, handle.mouseup); + break; + */ + } + + // create menu + if (!o.build) { + op.create(o); + } + break; + + case 'destroy': + var $visibleMenu; + if (_hasContext) { + // get proper options + var context = o.context; + $.each(menus, function (ns, o) { + if (o.context !== context) { + return true; + } + + $visibleMenu = $('.context-menu-list').filter(':visible'); + if ($visibleMenu.length && $visibleMenu.data().contextMenuRoot.$trigger.is($(o.context).find(o.selector))) { + $visibleMenu.trigger('contextmenu:hide', {force: true}); + } + + try { + if (menus[o.ns].$menu) { + menus[o.ns].$menu.remove(); + } + + delete menus[o.ns]; + } catch (e) { + menus[o.ns] = null; + } + + $(o.context).off(o.ns); + + return true; + }); + } else if (!o.selector) { + $document.off('.contextMenu .contextMenuAutoHide'); + $.each(menus, function (ns, o) { + $(o.context).off(o.ns); + }); + + namespaces = {}; + menus = {}; + counter = 0; + initialized = false; + + $('#context-menu-layer, .context-menu-list').remove(); + } else if (namespaces[o.selector]) { + $visibleMenu = $('.context-menu-list').filter(':visible'); + if ($visibleMenu.length && $visibleMenu.data().contextMenuRoot.$trigger.is(o.selector)) { + $visibleMenu.trigger('contextmenu:hide', {force: true}); + } + + try { + if (menus[namespaces[o.selector]].$menu) { + menus[namespaces[o.selector]].$menu.remove(); + } + + delete menus[namespaces[o.selector]]; + } catch (e) { + menus[namespaces[o.selector]] = null; + } + + $document.off(namespaces[o.selector]); + } + break; + + case 'html5': + // if or are not handled by the browser, + // or options was a bool true, + // initialize $.contextMenu for them + if ((!$.support.htmlCommand && !$.support.htmlMenuitem) || (typeof options === 'boolean' && options)) { + $('menu[type="context"]').each(function () { + if (this.id) { + $.contextMenu({ + selector: '[contextmenu=' + this.id + ']', + items: $.contextMenu.fromMenu(this) + }); + } + }).css('display', 'none'); + } + break; + + default: + throw new Error('Unknown operation "' + operation + '"'); + } + + return this; + }; + +// import values into commands + $.contextMenu.setInputValues = function (opt, data) { + if (data === undefined) { + data = {}; + } + + $.each(opt.inputs, function (key, item) { + switch (item.type) { + case 'text': + case 'textarea': + item.value = data[key] || ''; + break; + + case 'checkbox': + item.selected = data[key] ? true : false; + break; + + case 'radio': + item.selected = (data[item.radio] || '') === item.value; + break; + + case 'select': + item.selected = data[key] || ''; + break; + } + }); + }; + +// export values from commands + $.contextMenu.getInputValues = function (opt, data) { + if (data === undefined) { + data = {}; + } + + $.each(opt.inputs, function (key, item) { + switch (item.type) { + case 'text': + case 'textarea': + case 'select': + data[key] = item.$input.val(); + break; + + case 'checkbox': + data[key] = item.$input.prop('checked'); + break; + + case 'radio': + if (item.$input.prop('checked')) { + data[item.radio] = item.value; + } + break; + } + }); + + return data; + }; + +// find