From fc3cc41cb96edb6cdf431cd3db85a6ac8a58030a Mon Sep 17 00:00:00 2001 From: Ali Shahrivarian Date: Sun, 10 Sep 2017 22:50:39 +0430 Subject: [PATCH 1/6] fix submenu position issue "op.activated" changed, so submenu position will be handle in this function. --- src/jquery.contextMenu.js | 52 +++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/src/jquery.contextMenu.js b/src/jquery.contextMenu.js index 60557765..bd03edea 100755 --- a/src/jquery.contextMenu.js +++ b/src/jquery.contextMenu.js @@ -116,6 +116,10 @@ // 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, + // Flag denoting if a second trigger should close the menu, as long as + // the trigger happened on one of the trigger-element's child nodes. + // This overrides the reposition option. + hideOnSecondTrigger: false, //ability to select submenu selectableSubMenu: false, @@ -217,12 +221,14 @@ collision: 'flipfit fit' }).css('display', ''); } else { + var parentOffset = this.offset(); // determine contextMenu position var offset = { - top: -9, - left: this.outerWidth() - 5 + top: parentOffset.top, + left: parentOffset.left + this.outerWidth() }; $menu.css(offset); + op.activated($menu); } }, // offset to add to zIndex @@ -472,7 +478,12 @@ $(target).trigger(e); root.$layer.show(); } - + + if (root.hideOnSecondTrigger && triggerAction && root.$menu !== null && typeof root.$menu !== 'undefined') { + root.$menu.trigger('contextmenu:hide'); + return; + } + if (root.reposition && triggerAction) { if (document.elementFromPoint) { if (root.$trigger.is(target)) { @@ -999,7 +1010,7 @@ opt.$menu.css(css)[opt.animation.show](opt.animation.duration, function () { $trigger.trigger('contextmenu:visible'); - op.activated(opt); + op.activated(opt.$menu); opt.events.activated(); }); // make options available and set state @@ -1533,8 +1544,8 @@ promise.then(completedPromise.bind(this, opt, root), errorPromise.bind(this, opt, root)); }, // operation that will run after contextMenu showed on screen - activated: function(opt){ - var $menu = opt.$menu; + activated: function(menu){ + var $menu = menu; var $menuOffset = $menu.offset(); var winHeight = $(window).height(); var winScrollTop = $(window).scrollTop(); @@ -1546,14 +1557,15 @@ 'overflow-y': 'auto', 'top': winScrollTop + 'px' }); - } else if( - ($menuOffset.top < winScrollTop) || - ($menuOffset.top + menuHeight > winScrollTop + winHeight) - ){ + } else if($menuOffset.top < winScrollTop){ $menu.css({ 'top': '0px' }); - } + } else if($menuOffset.top + menuHeight > winScrollTop + winHeight){ + $menu.css({ + 'top':$menuOffset.top- Math.abs((winScrollTop+winHeight) - ($menuOffset.top+menuHeight)) + }); + } } }; @@ -1643,6 +1655,20 @@ } switch (operation) { + + case 'update': + // Updates visibility and such + if(_hasContext){ + op.update($context); + } else { + for(var menu in menus){ + if(menus.hasOwnProperty(menu)){ + op.update(menus[menu]); + } + } + } + break; + case 'create': // no selector no joy if (!o.selector) { @@ -1932,7 +1958,7 @@ disabled: !!$node.attr('disabled'), callback: (function () { return function () { - $node.get(0).click() + $node.get(0).click(); }; })() }; @@ -1951,7 +1977,7 @@ icon: $node.attr('icon'), callback: (function () { return function () { - $node.get(0).click() + $node.get(0).click(); }; })() }; From 77a3c32d2387514a5964b08973035171a77662a4 Mon Sep 17 00:00:00 2001 From: Ali Shahrivarian Date: Sun, 10 Sep 2017 22:52:27 +0430 Subject: [PATCH 2/6] fix submenu position issue #533 --- src/sass/jquery.contextMenu.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sass/jquery.contextMenu.scss b/src/sass/jquery.contextMenu.scss index 7cf05c5c..fd49a747 100644 --- a/src/sass/jquery.contextMenu.scss +++ b/src/sass/jquery.contextMenu.scss @@ -59,7 +59,7 @@ max-width: $context-menu-max-width; min-width: $context-menu-min-width; padding: $context-menu-container-padding; - position: absolute; + position: fixed; } .context-menu-item { From 2da615afdc58ed53ca2d95325f6786049c8ee1cf Mon Sep 17 00:00:00 2001 From: Ali Shahrivarian Date: Sun, 10 Sep 2017 22:53:40 +0430 Subject: [PATCH 3/6] fix submenu position issue #533 --- dist/jquery.contextMenu.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/jquery.contextMenu.css b/dist/jquery.contextMenu.css index a72b6947..d0a2db2a 100644 --- a/dist/jquery.contextMenu.css +++ b/dist/jquery.contextMenu.css @@ -157,7 +157,7 @@ } .context-menu-list { - position: absolute; + position: fixed; display: inline-block; min-width: 13em; max-width: 26em; From d189cd2eeccdc9e15a6f2d34d54c0d3e4ebc2583 Mon Sep 17 00:00:00 2001 From: Ali Shahrivarian Date: Mon, 11 Sep 2017 13:37:38 +0430 Subject: [PATCH 4/6] sub menu out of position #533 --- src/jquery.contextMenu.js | 55 +++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/src/jquery.contextMenu.js b/src/jquery.contextMenu.js index bd03edea..8d7d769d 100755 --- a/src/jquery.contextMenu.js +++ b/src/jquery.contextMenu.js @@ -1546,26 +1546,49 @@ // operation that will run after contextMenu showed on screen activated: function(menu){ var $menu = menu; + var win = $(window); var $menuOffset = $menu.offset(); - var winHeight = $(window).height(); - var winScrollTop = $(window).scrollTop(); - var menuHeight = $menu.height(); + var winHeight = win.height(); + var winWidth = win.width(); + var winScrollTop = win.scrollTop(); + var menuHeight = $menu.outerHeight(); + var menuWidth = $menu.outerWidth(); if(menuHeight > winHeight){ $menu.css({ - 'height' : winHeight + 'px', - 'overflow-x': 'hidden', - 'overflow-y': 'auto', - 'top': winScrollTop + 'px' - }); + 'height': winHeight - + (parseInt($menu.css('padding-top'))+parseInt($menu.css('margin-top')))+'px', + 'overflow-x':'hidden', + 'overflow-y':'auto', + 'top':winScrollTop+'px' + }); } else if($menuOffset.top < winScrollTop){ - $menu.css({ - 'top': '0px' - }); - } else if($menuOffset.top + menuHeight > winScrollTop + winHeight){ - $menu.css({ - 'top':$menuOffset.top- Math.abs((winScrollTop+winHeight) - ($menuOffset.top+menuHeight)) - }); - } + $menu.css({ + 'top':'0px' + }); + } else if($menuOffset.top+menuHeight > winScrollTop + winHeight){ + $menu.css({ + 'top':$menuOffset.top - Math.abs((winScrollTop+winHeight)-($menuOffset.top+menuHeight)) -(parseInt($menu.css('padding-top'))+parseInt($menu.css('margin-top')))+'px' + }); + } + if($menuOffset.left + menuWidth > winWidth){ + var newLeftPosition = $menuOffset.left - Math.abs(($menuOffset.left+menuWidth) - winWidth); + var parent = $menu.parents('ul.context-menu-list').first(); + if(parent.length){ + if(newLeftPosition <= parent.offset().left + parent.outerWidth() + && newLeftPosition >= parent.offset().left){ + $menu.css({ + 'left':parent.offset().left - $menu.outerWidth() + 'px' + }); + }else{ + $menu.css({ + 'left':$menuOffset.left-Math.abs(($menuOffset.left+menuWidth) - winWidth) + 'px' + }); + } + }else{ + $menu.css({ + 'left':$menuOffset.left-Math.abs(($menuOffset.left+menuWidth) - winWidth) + 'px' + }); + } } }; From 84275853cc9bb6c5eaefe3b4c0998011cde7290a Mon Sep 17 00:00:00 2001 From: Ali Shahrivarian Date: Mon, 11 Sep 2017 13:57:15 +0430 Subject: [PATCH 5/6] sub menu out of position #533 --- src/jquery.contextMenu.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/jquery.contextMenu.js b/src/jquery.contextMenu.js index 8d7d769d..295938b8 100755 --- a/src/jquery.contextMenu.js +++ b/src/jquery.contextMenu.js @@ -1589,6 +1589,7 @@ 'left':$menuOffset.left-Math.abs(($menuOffset.left+menuWidth) - winWidth) + 'px' }); } + } } }; From b3a80b3b1e9d3aed886272965edf36c2306c1eac Mon Sep 17 00:00:00 2001 From: Ali Shahrivarian Date: Mon, 11 Sep 2017 14:00:49 +0430 Subject: [PATCH 6/6] Fixed "sub menu out of position #533 " --- dist/jquery.contextMenu.css | 12 ++- dist/jquery.contextMenu.js | 118 ++++++++++++++++++++++++---- dist/jquery.contextMenu.min.css | 4 +- dist/jquery.contextMenu.min.css.map | 2 +- dist/jquery.contextMenu.min.js | 2 +- dist/jquery.contextMenu.min.js.map | 2 +- src/jquery.contextMenu.js | 43 ++++++---- src/sass/jquery.contextMenu.scss | 6 +- 8 files changed, 149 insertions(+), 40 deletions(-) diff --git a/dist/jquery.contextMenu.css b/dist/jquery.contextMenu.css index d0a2db2a..5e7f2898 100644 --- a/dist/jquery.contextMenu.css +++ b/dist/jquery.contextMenu.css @@ -12,7 +12,7 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - * Date: 2017-08-30T12:16:04.938Z + * Date: 2017-11-24T17:56:22.439Z */ @-webkit-keyframes cm-spin { 0% { @@ -54,8 +54,8 @@ font-style: normal; font-weight: normal; - src: url("font/context-menu-icons.eot?1915n"); - src: url("font/context-menu-icons.eot?1915n#iefix") format("embedded-opentype"), url("font/context-menu-icons.woff2?1915n") format("woff2"), url("font/context-menu-icons.woff?1915n") format("woff"), url("font/context-menu-icons.ttf?1915n") format("truetype"); + src: url("font/context-menu-icons.eot?12di9"); + src: url("font/context-menu-icons.eot?12di9#iefix") format("embedded-opentype"), url("font/context-menu-icons.woff2?12di9") format("woff2"), url("font/context-menu-icons.woff?12di9") format("woff"), url("font/context-menu-icons.ttf?12di9") format("truetype"); } .context-menu-icon-add:before { @@ -156,8 +156,12 @@ color: #bbb; } +.context-menu-list.overBoundary, .context-menu-list.overBoundary ul.context-menu-list { + position: fixed !important; +} + .context-menu-list { - position: fixed; + position: absolute; display: inline-block; min-width: 13em; max-width: 26em; diff --git a/dist/jquery.contextMenu.js b/dist/jquery.contextMenu.js index 97ea1960..54fffebf 100755 --- a/dist/jquery.contextMenu.js +++ b/dist/jquery.contextMenu.js @@ -11,7 +11,7 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - * Date: 2017-08-30T12:16:04.336Z + * Date: 2017-11-24T18:02:43.224Z */ // jscs:disable @@ -116,10 +116,16 @@ // 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, + // Flag denoting if a second trigger should close the menu, as long as + // the trigger happened on one of the trigger-element's child nodes. + // This overrides the reposition option. + hideOnSecondTrigger: false, //ability to select submenu selectableSubMenu: false, + hasOverboundaryScroll: false, + // Default classname configuration to be able avoid conflicts in frameworks classNames: { hover: 'context-menu-hover', // Item hover @@ -200,7 +206,7 @@ opt.$menu.css(offset); }, // position the sub-menu - positionSubmenu: function ($menu) { + positionSubmenu: function ($menu, $root) { if (typeof $menu === 'undefined') { // When user hovers over item (which has sub items) handle.focusItem will call this. // but the submenu does not exist yet if opt.items is a promise. just return, will @@ -217,12 +223,23 @@ collision: 'flipfit fit' }).css('display', ''); } else { - // determine contextMenu position - var offset = { - top: -9, - left: this.outerWidth() - 5 - }; + var offset = {}; + if($root && $root.hasOverboundaryScroll){ + var parentOffset = this.offset(); + // determine contextMenu position + offset = { + top: parentOffset.top, + left: parentOffset.left + this.outerWidth() + }; + } else { + offset = { + top: -9, + left: this.outerWidth() - 5 + }; + } $menu.css(offset); + if ($root && $root.hasOverboundaryScroll) + op.activated($root, $menu); } }, // offset to add to zIndex @@ -236,7 +253,8 @@ // events events: { show: $.noop, - hide: $.noop + hide: $.noop, + activated: $.noop }, // default callback callback: null, @@ -471,7 +489,12 @@ $(target).trigger(e); root.$layer.show(); } - + + if (root.hideOnSecondTrigger && triggerAction && root.$menu !== null && typeof root.$menu !== 'undefined') { + root.$menu.trigger('contextmenu:hide'); + return; + } + if (root.reposition && triggerAction) { if (document.elementFromPoint) { if (root.$trigger.is(target)) { @@ -936,7 +959,7 @@ // position sub-menu - do after show so dumb $.ui.position can keep up if (opt.$node) { - root.positionSubmenu.call(opt.$node, opt.$menu); + root.positionSubmenu.call(opt.$node, opt.$menu, root); } }, // blur @@ -997,6 +1020,9 @@ // position and show context menu opt.$menu.css(css)[opt.animation.show](opt.animation.duration, function () { $trigger.trigger('contextmenu:visible'); + + op.activated(opt,opt.$menu); + opt.events.activated(); }); // make options available and set state $trigger @@ -1104,7 +1130,7 @@ } // create contextMenu - opt.$menu = $('
    ').addClass(opt.className || '').data({ + opt.$menu = $('
      ').addClass(opt.className || '').data({ 'contextMenu': opt, 'contextMenuRoot': root }); @@ -1521,12 +1547,62 @@ opt.items = items; op.create(opt, root, true); // Create submenu op.update(opt, root); // Correctly update position if user is already hovered over menu item - root.positionSubmenu.call(opt.$node, opt.$menu); // positionSubmenu, will only do anything if user already hovered over menu item that just got new subitems. + root.positionSubmenu.call(opt.$node, opt.$menu, root); // positionSubmenu, will only do anything if user already hovered over menu item that just got new subitems. } // Wait for promise completion. .then(success, error, notify) (we don't track notify). Bind the opt // and root to avoid scope problems promise.then(completedPromise.bind(this, opt, root), errorPromise.bind(this, opt, root)); + }, + // operation that will run after contextMenu showed on screen + activated: function(opt,menu){ + if(!opt.hasOverboundaryScroll) + return; + var $menu = menu; + var win = $(window); + var $menuOffset = $menu.offset(); + var winHeight = win.height(); + var winWidth = win.width(); + var winScrollTop = win.scrollTop(); + var menuHeight = $menu.outerHeight(); + var menuWidth = $menu.outerWidth(); + if(menuHeight > winHeight){ + $menu.css({ + 'height': winHeight - + ((parseInt($menu.css('padding-top'))*2)+(parseInt($menu.css('margin-top'))*2))+'px', + 'overflow-x':'hidden', + 'overflow-y':'auto', + 'top':winScrollTop+'px' + }); + } else if($menuOffset.top < winScrollTop){ + $menu.css({ + 'top':'0px' + }); + } else if($menuOffset.top+menuHeight > winScrollTop + winHeight){ + $menu.css({ + 'top':$menuOffset.top - Math.abs((winScrollTop+winHeight)-($menuOffset.top+menuHeight)) -((parseInt($menu.css('padding-top'))*2)+(parseInt($menu.css('margin-top'))*2))+'px' + }); + } + if($menuOffset.left + menuWidth > winWidth){ + var newLeftPosition = $menuOffset.left - Math.abs(($menuOffset.left+menuWidth) - winWidth); + var parent = $menu.parents('ul.context-menu-list').first(); + if(parent.length){ + if(newLeftPosition <= parent.offset().left + parent.outerWidth() + && newLeftPosition >= parent.offset().left){ + $menu.css({ + 'left':parent.offset().left - $menu.outerWidth() + 'px' + }); + }else{ + $menu.css({ + 'left':$menuOffset.left-Math.abs(($menuOffset.left+menuWidth) - winWidth) + 'px' + }); + } + }else{ + $menu.css({ + 'left':$menuOffset.left-Math.abs(($menuOffset.left+menuWidth) - winWidth) + 'px' + }); + } + } } }; @@ -1616,6 +1692,20 @@ } switch (operation) { + + case 'update': + // Updates visibility and such + if(_hasContext){ + op.update($context); + } else { + for(var menu in menus){ + if(menus.hasOwnProperty(menu)){ + op.update(menus[menu]); + } + } + } + break; + case 'create': // no selector no joy if (!o.selector) { @@ -1905,7 +1995,7 @@ disabled: !!$node.attr('disabled'), callback: (function () { return function () { - $node.get(0).click() + $node.get(0).click(); }; })() }; @@ -1924,7 +2014,7 @@ icon: $node.attr('icon'), callback: (function () { return function () { - $node.get(0).click() + $node.get(0).click(); }; })() }; diff --git a/dist/jquery.contextMenu.min.css b/dist/jquery.contextMenu.min.css index 9f917151..7e723d2f 100644 --- a/dist/jquery.contextMenu.min.css +++ b/dist/jquery.contextMenu.min.css @@ -11,6 +11,6 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - * Date: 2017-08-30T12:16:04.938Z - */@-webkit-keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0);transform:translateY(-50%) rotate(0)}100%{-webkit-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@-o-keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0);-o-transform:translateY(-50%) rotate(0);transform:translateY(-50%) rotate(0)}100%{-webkit-transform:translateY(-50%) rotate(359deg);-o-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0);-o-transform:translateY(-50%) rotate(0);transform:translateY(-50%) rotate(0)}100%{-webkit-transform:translateY(-50%) rotate(359deg);-o-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@font-face{font-family:context-menu-icons;font-style:normal;font-weight:400;src:url(font/context-menu-icons.eot?1915n);src:url(font/context-menu-icons.eot?1915n#iefix) format("embedded-opentype"),url(font/context-menu-icons.woff2?1915n) format("woff2"),url(font/context-menu-icons.woff?1915n) format("woff"),url(font/context-menu-icons.ttf?1915n) format("truetype")}.context-menu-icon-add:before{content:"\EA01"}.context-menu-icon-copy:before{content:"\EA02"}.context-menu-icon-cut:before{content:"\EA03"}.context-menu-icon-delete:before{content:"\EA04"}.context-menu-icon-edit:before{content:"\EA05"}.context-menu-icon-loading:before{content:"\EA06"}.context-menu-icon-paste:before{content:"\EA07"}.context-menu-icon-quit:before{content:"\EA08"}.context-menu-icon::before{position:absolute;top:50%;left:0;width:2em;font-family:context-menu-icons;font-size:1em;font-style:normal;font-weight:400;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.context-menu-hover:before{color:#fff}.context-menu-icon.context-menu-disabled::before{color:#bbb}.context-menu-icon.context-menu-icon-loading:before{-webkit-animation:cm-spin 2s infinite;-o-animation:cm-spin 2s infinite;animation:cm-spin 2s infinite}.context-menu-icon.context-menu-icon--fa{display:list-item;font-family:inherit}.context-menu-icon.context-menu-icon--fa::before{position:absolute;top:50%;left:0;width:2em;font-family:FontAwesome;font-size:1em;font-style:normal;font-weight:400;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.context-menu-icon--fa.context-menu-hover:before{color:#fff}.context-menu-icon.context-menu-icon--fa.context-menu-disabled::before{color:#bbb}.context-menu-list{position:absolute;display:inline-block;min-width:13em;max-width:26em;padding:.25em 0;margin:.3em;font-family:inherit;font-size:inherit;list-style-type:none;background:#fff;border:1px solid #bebebe;border-radius:.2em;-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:.2em 2em;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:.35em 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:#bbb;cursor:default;background-color:#fff}.context-menu-input.context-menu-hover{color:#2f2f2f;cursor:default}.context-menu-submenu:after{position:absolute;top:50%;right:.5em;z-index:1;width:0;height:0;content:'';border-color:transparent transparent transparent #2f2f2f;border-style:solid;border-width:.25em 0 .25em .25em;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%)}.context-menu-item.context-menu-input{padding:.3em .6em}.context-menu-input>label>*{vertical-align:top}.context-menu-input>label>input[type=checkbox],.context-menu-input>label>input[type=radio]{position:relative;top:.12em;margin-right:.4em}.context-menu-input>label{margin:0}.context-menu-input>label,.context-menu-input>label>input[type=text],.context-menu-input>label>select,.context-menu-input>label>textarea{display:block;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.context-menu-input>label>textarea{height:7em}.context-menu-item>.context-menu-list{top:.3em;right:-.3em;display:none}.context-menu-item.context-menu-visible>.context-menu-list{display:block}.context-menu-accesskey{text-decoration:underline} + * Date: 2017-11-24T17:56:22.439Z + */@-webkit-keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0);transform:translateY(-50%) rotate(0)}100%{-webkit-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@-o-keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0);-o-transform:translateY(-50%) rotate(0);transform:translateY(-50%) rotate(0)}100%{-webkit-transform:translateY(-50%) rotate(359deg);-o-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0);-o-transform:translateY(-50%) rotate(0);transform:translateY(-50%) rotate(0)}100%{-webkit-transform:translateY(-50%) rotate(359deg);-o-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@font-face{font-family:context-menu-icons;font-style:normal;font-weight:400;src:url(font/context-menu-icons.eot?12di9);src:url(font/context-menu-icons.eot?12di9#iefix) format("embedded-opentype"),url(font/context-menu-icons.woff2?12di9) format("woff2"),url(font/context-menu-icons.woff?12di9) format("woff"),url(font/context-menu-icons.ttf?12di9) format("truetype")}.context-menu-icon-add:before{content:"\EA01"}.context-menu-icon-copy:before{content:"\EA02"}.context-menu-icon-cut:before{content:"\EA03"}.context-menu-icon-delete:before{content:"\EA04"}.context-menu-icon-edit:before{content:"\EA05"}.context-menu-icon-loading:before{content:"\EA06"}.context-menu-icon-paste:before{content:"\EA07"}.context-menu-icon-quit:before{content:"\EA08"}.context-menu-icon::before{position:absolute;top:50%;left:0;width:2em;font-family:context-menu-icons;font-size:1em;font-style:normal;font-weight:400;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.context-menu-hover:before{color:#fff}.context-menu-icon.context-menu-disabled::before{color:#bbb}.context-menu-icon.context-menu-icon-loading:before{-webkit-animation:cm-spin 2s infinite;-o-animation:cm-spin 2s infinite;animation:cm-spin 2s infinite}.context-menu-icon.context-menu-icon--fa{display:list-item;font-family:inherit}.context-menu-icon.context-menu-icon--fa::before{position:absolute;top:50%;left:0;width:2em;font-family:FontAwesome;font-size:1em;font-style:normal;font-weight:400;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.context-menu-icon--fa.context-menu-hover:before{color:#fff}.context-menu-icon.context-menu-icon--fa.context-menu-disabled::before{color:#bbb}.context-menu-list.overBoundary,.context-menu-list.overBoundary ul.context-menu-list{position:fixed!important}.context-menu-list{position:absolute;display:inline-block;min-width:13em;max-width:26em;padding:.25em 0;margin:.3em;font-family:inherit;font-size:inherit;list-style-type:none;background:#fff;border:1px solid #bebebe;border-radius:.2em;-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:.2em 2em;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:.35em 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:#bbb;cursor:default;background-color:#fff}.context-menu-input.context-menu-hover{color:#2f2f2f;cursor:default}.context-menu-submenu:after{position:absolute;top:50%;right:.5em;z-index:1;width:0;height:0;content:'';border-color:transparent transparent transparent #2f2f2f;border-style:solid;border-width:.25em 0 .25em .25em;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%)}.context-menu-item.context-menu-input{padding:.3em .6em}.context-menu-input>label>*{vertical-align:top}.context-menu-input>label>input[type=checkbox],.context-menu-input>label>input[type=radio]{position:relative;top:.12em;margin-right:.4em}.context-menu-input>label{margin:0}.context-menu-input>label,.context-menu-input>label>input[type=text],.context-menu-input>label>select,.context-menu-input>label>textarea{display:block;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.context-menu-input>label>textarea{height:7em}.context-menu-item>.context-menu-list{top:.3em;right:-.3em;display:none}.context-menu-item.context-menu-visible>.context-menu-list{display:block}.context-menu-accesskey{text-decoration:underline} /*# sourceMappingURL=jquery.contextMenu.min.css.map */ diff --git a/dist/jquery.contextMenu.min.css.map b/dist/jquery.contextMenu.min.css.map index 755982da..e95a6fb4 100644 --- a/dist/jquery.contextMenu.min.css.map +++ b/dist/jquery.contextMenu.min.css.map @@ -1 +1 @@ -{"version":3,"sources":["jquery.contextMenu.css","jquery.contextMenu.min.css"],"names":[],"mappings":"iBACA;;;;;;;;;;;;;;AAeA,2BACE,GACE,kBAAA,iBAAA,UACA,UAAA,iBAAA,UCEF,KDCE,kBAAA,iBAAA,eANJ,UAAA,iBAAA,gBCUA,sBACE,GDPA,kBAAA,iBAAA,UACE,aAAA,iBAAA,UACA,UAAA,iBAAA,UANJ,KACE,kBAAA,iBAAA,eACE,aAAA,iBAAA,eACA,UAAA,iBAAA,gBCmBJ,mBACE,GACE,kBDlBA,iBAAA,UCmBK,aAAc,iBAAiB,UDjBxC,UAAA,iBAAA,UAEE,KACA,kBAAA,iBAAA,eACA,aAAoB,iBAAA,eACpB,UAAqB,iBAAA,gBCsBvB,WDjBA,YAAA,mBACE,WAAA,OCmBA,YAAa,IDhBb,IAAA,uCCmBA,IAAK,6CAA+C,2BAA2B,CAAE,yCAA2C,eAAe,CAAE,wCAA0C,cAAc,CAAE,uCAAyC,mBAGlP,8BDjBA,QAAA,QAGA,+BACE,QAAA,QCqBF,8BACE,QAAS,QAGX,iCDjBA,QAAA,QCqBA,+BDjBE,QAAA,QCqBF,kCDjBE,QAAA,QCqBF,gCACE,QDnBA,QCsBF,+BDpBE,QAAA,QAGF,2BACE,SAAA,SCsBA,IAAK,IDpBP,KAAA,EACE,MAAA,ICsBA,YAAa,mBDpBf,UAAA,IACE,WAAA,OCsBA,YDtBA,ICuBA,YDvBA,ECwBA,MAAO,QDtBT,WAAA,OACE,kBAAmB,iBACnB,cAAA,iBACA,aAAA,iBACE,UAAe,iBCyBjB,uBDvBqB,YCwBrB,wBDvBsB,UC0BxB,6CACE,MDvBE,KC0BJ,iDACE,MDxBE,KC2BJ,oDACE,kBD1BE,QAAA,GAAA,SACA,aAAa,QAAA,GAAA,SACf,UAAA,QAAA,G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AK,MACL,aAAc,KAGhB,0BACE,OAAQ,EAGV,0BACA,2CAEA,iCADA,mCAEE,QAAS,MACT,MAAO,KACP,mBAAoB,WACjB,gBAAiB,WACZ,WAAY,WAGtB,mCACE,OAAQ,IAGV,sCACE,IAAK,KAEL,MAAO,MACP,QAAS,KAGX,2DACE,QAAS,MAGX,wBACE,gBAAiB","file":"jquery.contextMenu.min.css","sourcesContent":["@charset \"UTF-8\";\n/*!\n * jQuery contextMenu - Plugin for simple contextMenu handling\n *\n * Version: v2.5.0\n *\n * Authors: Björn Brala (SWIS.nl), Rodney Rehm, Addy Osmani (patches for FF)\n * Web: http://swisnl.github.io/jQuery-contextMenu/\n *\n * Copyright (c) 2011-2017 SWIS BV and contributors\n *\n * Licensed under\n * MIT License http://www.opensource.org/licenses/mit-license\n *\n * Date: 2017-08-30T12:16:04.938Z\n */\n@keyframes cm-spin {\n 0% {\n -webkit-transform: translateY(-50%) rotate(0deg);\n transform: translateY(-50%) rotate(0deg); }\n 100% {\n -webkit-transform: translateY(-50%) rotate(359deg);\n transform: translateY(-50%) rotate(359deg); } }\n\n@font-face {\n font-family: \"context-menu-icons\";\n src: url(\"font/context-menu-icons.eot?1915n\");\n src: url(\"font/context-menu-icons.eot?1915n#iefix\") format(\"embedded-opentype\"), url(\"font/context-menu-icons.woff2?1915n\") format(\"woff2\"), url(\"font/context-menu-icons.woff?1915n\") format(\"woff\"), url(\"font/context-menu-icons.ttf?1915n\") format(\"truetype\");\n font-weight: normal;\n font-style: normal; }\n\n.context-menu-icon-add:before {\n content: \"\\EA01\"; }\n\n.context-menu-icon-copy:before {\n content: \"\\EA02\"; }\n\n.context-menu-icon-cut:before {\n content: \"\\EA03\"; }\n\n.context-menu-icon-delete:before {\n content: \"\\EA04\"; }\n\n.context-menu-icon-edit:before {\n content: \"\\EA05\"; }\n\n.context-menu-icon-loading:before {\n content: \"\\EA06\"; }\n\n.context-menu-icon-paste:before {\n content: \"\\EA07\"; }\n\n.context-menu-icon-quit:before {\n content: \"\\EA08\"; }\n\n.context-menu-icon::before {\n color: #2980B9;\n font-family: \"context-menu-icons\";\n font-style: normal;\n font-weight: normal;\n font-size: 1em;\n left: 0;\n line-height: 1;\n position: absolute;\n text-align: center;\n top: 50%;\n transform: translateY(-50%);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n width: 2em; }\n\n.context-menu-icon.context-menu-hover:before {\n color: #FFF; }\n\n.context-menu-icon.context-menu-disabled::before {\n color: #bbbbbb; }\n\n.context-menu-icon.context-menu-icon-loading:before {\n animation: cm-spin 2s infinite; }\n\n.context-menu-icon.context-menu-icon--fa {\n display: list-item;\n font-family: inherit; }\n .context-menu-icon.context-menu-icon--fa::before {\n color: #2980B9;\n font-family: FontAwesome;\n font-style: normal;\n font-weight: normal;\n font-size: 1em;\n left: 0;\n line-height: 1;\n position: absolute;\n text-align: center;\n top: 50%;\n transform: translateY(-50%);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n width: 2em; }\n .context-menu-icon.context-menu-icon--fa.context-menu-hover:before {\n color: #FFF; }\n .context-menu-icon.context-menu-icon--fa.context-menu-disabled::before {\n color: #bbbbbb; }\n\n.context-menu-list {\n background: #FFF;\n border: 1px solid #bebebe;\n border-radius: 0.2em;\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);\n display: inline-block;\n font-family: inherit;\n font-size: inherit;\n list-style-type: none;\n margin: 0.3em;\n max-width: 26em;\n min-width: 13em;\n padding: 0.25em 0;\n position: absolute; }\n\n.context-menu-item {\n background-color: #FFF;\n color: #2F2F2F;\n padding: 0.2em 2em;\n position: relative;\n user-select: none; }\n\n.context-menu-separator {\n border-bottom: 1px solid #e6e6e6;\n margin: 0.35em 0;\n padding: 0; }\n\n.context-menu-item > label > input,\n.context-menu-item > label > textarea {\n user-select: text; }\n\n.context-menu-item.context-menu-hover {\n background-color: #2980B9;\n color: #FFF;\n cursor: pointer; }\n\n.context-menu-item.context-menu-disabled {\n background-color: #FFF;\n color: #bbbbbb;\n cursor: default; }\n\n.context-menu-input.context-menu-hover {\n cursor: default;\n color: #2F2F2F; }\n\n.context-menu-submenu:after {\n content: '';\n border-style: solid;\n border-width: .25em 0 .25em .25em;\n border-color: transparent transparent transparent #2F2F2F;\n height: 0;\n position: absolute;\n right: .5em;\n top: 50%;\n transform: translateY(-50%);\n width: 0;\n z-index: 1; }\n\n/**\n * Inputs\n */\n.context-menu-item.context-menu-input {\n padding: .3em .6em; }\n\n/* vertically align inside labels */\n.context-menu-input > label > * {\n vertical-align: top; }\n\n/* position checkboxes and radios as icons */\n.context-menu-input > label > input[type=\"checkbox\"],\n.context-menu-input > label > input[type=\"radio\"] {\n margin-right: .4em;\n position: relative;\n top: .12em; }\n\n.context-menu-input > label {\n margin: 0; }\n\n.context-menu-input > label,\n.context-menu-input > label > input[type=\"text\"],\n.context-menu-input > label > textarea,\n.context-menu-input > label > select {\n box-sizing: border-box;\n display: block;\n width: 100%; }\n\n.context-menu-input > label > textarea {\n height: 7em; }\n\n.context-menu-item > .context-menu-list {\n display: none;\n /* re-positioned by js */\n right: -.3em;\n top: .3em; }\n\n.context-menu-item.context-menu-visible > .context-menu-list {\n display: block; }\n\n.context-menu-accesskey {\n text-decoration: underline; }\n","@charset \"UTF-8\";/*!\r\n * jQuery contextMenu - Plugin for simple contextMenu handling\r\n *\r\n * Version: v2.5.0\r\n *\r\n * Authors: Björn Brala (SWIS.nl), Rodney Rehm, Addy Osmani (patches for FF)\r\n * Web: http://swisnl.github.io/jQuery-contextMenu/\r\n *\r\n * Copyright (c) 2011-2017 SWIS BV and contributors\r\n *\r\n * Licensed under\r\n * MIT License http://www.opensource.org/licenses/mit-license\r\n *\r\n * Date: 2017-05-25T11:30:28.663Z\r\n */@-webkit-keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0);transform:translateY(-50%) rotate(0)}100%{-webkit-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@-o-keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0);-o-transform:translateY(-50%) rotate(0);transform:translateY(-50%) rotate(0)}100%{-webkit-transform:translateY(-50%) rotate(359deg);-o-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0);-o-transform:translateY(-50%) rotate(0);transform:translateY(-50%) rotate(0)}100%{-webkit-transform:translateY(-50%) rotate(359deg);-o-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@font-face{font-family:context-menu-icons;font-style:normal;font-weight:400;src:url(font/context-menu-icons.eot?4yg1f);src:url(font/context-menu-icons.eot?4yg1f#iefix) format(\"embedded-opentype\"),url(font/context-menu-icons.woff2?4yg1f) format(\"woff2\"),url(font/context-menu-icons.woff?4yg1f) format(\"woff\"),url(font/context-menu-icons.ttf?4yg1f) format(\"truetype\")}.context-menu-icon-add:before{content:\"\\EA01\"}.context-menu-icon-copy:before{content:\"\\EA02\"}.context-menu-icon-cut:before{content:\"\\EA03\"}.context-menu-icon-delete:before{content:\"\\EA04\"}.context-menu-icon-edit:before{content:\"\\EA05\"}.context-menu-icon-loading:before{content:\"\\EA06\"}.context-menu-icon-paste:before{content:\"\\EA07\"}.context-menu-icon-quit:before{content:\"\\EA08\"}.context-menu-icon::before{position:absolute;top:50%;left:0;width:2em;font-family:context-menu-icons;font-size:1em;font-style:normal;font-weight:400;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.context-menu-hover:before{color:#fff}.context-menu-icon.context-menu-disabled::before{color:#bbb}.context-menu-icon.context-menu-icon-loading:before{-webkit-animation:cm-spin 2s infinite;-o-animation:cm-spin 2s infinite;animation:cm-spin 2s infinite}.context-menu-icon.context-menu-icon--fa{display:list-item;font-family:inherit}.context-menu-icon.context-menu-icon--fa::before{position:absolute;top:50%;left:0;width:2em;font-family:FontAwesome;font-size:1em;font-style:normal;font-weight:400;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.context-menu-icon--fa.context-menu-hover:before{color:#fff}.context-menu-icon.context-menu-icon--fa.context-menu-disabled::before{color:#bbb}.context-menu-list{position:absolute;display:inline-block;min-width:13em;max-width:26em;padding:.25em 0;margin:.3em;font-family:inherit;font-size:inherit;list-style-type:none;background:#fff;border:1px solid #bebebe;border-radius:.2em;-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:.2em 2em;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:.35em 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:#bbb;cursor:default;background-color:#fff}.context-menu-input.context-menu-hover{color:#2f2f2f;cursor:default}.context-menu-submenu:after{position:absolute;top:50%;right:.5em;z-index:1;width:0;height:0;content:'';border-color:transparent transparent transparent #2f2f2f;border-style:solid;border-width:.25em 0 .25em .25em;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%)}.context-menu-item.context-menu-input{padding:.3em .6em}.context-menu-input>label>*{vertical-align:top}.context-menu-input>label>input[type=checkbox],.context-menu-input>label>input[type=radio]{position:relative;top:.12em;margin-right:.4em}.context-menu-input>label{margin:0}.context-menu-input>label,.context-menu-input>label>input[type=text],.context-menu-input>label>select,.context-menu-input>label>textarea{display:block;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.context-menu-input>label>textarea{height:7em}.context-menu-item>.context-menu-list{top:.3em;right:-.3em;display:none}.context-menu-item.context-menu-visible>.context-menu-list{display:block}.context-menu-accesskey{text-decoration:underline}\r\n/*# sourceMappingURL=jquery.contextMenu.min.css.map */\r\n"]} \ No newline at end of file +{"version":3,"sources":["jquery.contextMenu.css","jquery.contextMenu.min.css"],"names":[],"mappings":"iBACA;;;;;;;;;;;;;;AAeA,2BACE,GACE,kBAAA,iBAAA,UACA,UAAA,iBAAA,UCEF,KDCE,kBAAA,iBAAA,eANJ,UAAA,iBAAA,gBCUA,sBACE,GDPA,kBAAA,iBAAA,UACE,aAAA,iBAAA,UACA,UAAA,iBAAA,UANJ,KACE,kBAAA,iBAAA,eACE,aAAA,iBAAA,eACA,UAAA,iBAAA,gBCmBJ,mBACE,GACE,kBDlBA,iBAAA,UCmBK,aAAc,iBAAiB,UDjBxC,UAAA,iBAAA,UAEE,KACA,kBAAA,iBAAA,eACA,aAAoB,iBAAA,eACpB,UAAqB,iBAAA,gBCsBvB,WDjBA,YAAA,mBACE,WAAA,OCmBA,YAAa,IDhBb,IAAA,uCCmBA,IAAK,6CAA+C,2BAA2B,CAAE,yCAA2C,eAAe,CAAE,wCAA0C,cAAc,CAAE,uCAAyC,mBAGlP,8BDjBA,QAAA,QAGA,+BACE,QAAA,QCqBF,8BACE,QAAS,QAGX,iCDjBA,QAAA,QCqBA,+BDjBE,QAAA,QCqBF,kCDjBE,QAAA,QCqBF,gCACE,QDnBA,QCsBF,+BDpBE,QAAA,QAGF,2BACE,SAAA,SCsBA,IAAK,IDpBP,KAAA,EACE,MAAA,ICsBA,YAAa,mBDpBf,UAAA,IACE,WAAA,OCsBA,YDtBA,ICuBA,YDvBA,ECwBA,MAAO,QDtBT,WAAA,OACE,kBAAmB,iBACnB,cAAA,iBACA,aAAA,iBACE,UAAe,iBCyBjB,uBDvBqB,YCwBrB,wBDvBsB,UC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MAAA,MCuCd,kBAAmB,iBDrCrB,cAAA,iBACE,aAAc,iBACd,UAAA,iBC4CF,sCDrCA,QAAA,KAAA,KC0CA,4BACE,eAAgB,IAIlB,+CACA,4CACE,SAAU,SACV,IAAK,MACL,aAAc,KAGhB,0BACE,OAAQ,EAGV,0BACA,2CAEA,iCADA,mCAEE,QAAS,MACT,MAAO,KACP,mBAAoB,WACjB,gBAAiB,WACZ,WAAY,WAGtB,mCACE,OAAQ,IAGV,sCACE,IAAK,KAEL,MAAO,MACP,QAAS,KAGX,2DACE,QAAS,MAGX,wBACE,gBAAiB","file":"jquery.contextMenu.min.css","sourcesContent":["@charset \"UTF-8\";\n/*!\n * jQuery contextMenu - Plugin for simple contextMenu handling\n *\n * Version: v2.5.0\n *\n * Authors: Björn Brala (SWIS.nl), Rodney Rehm, Addy Osmani (patches for FF)\n * Web: http://swisnl.github.io/jQuery-contextMenu/\n *\n * Copyright (c) 2011-2017 SWIS BV and contributors\n *\n * Licensed under\n * MIT License http://www.opensource.org/licenses/mit-license\n *\n * Date: 2017-11-24T17:56:22.439Z\n */\n@keyframes cm-spin {\n 0% {\n -webkit-transform: translateY(-50%) rotate(0deg);\n transform: translateY(-50%) rotate(0deg); }\n 100% {\n -webkit-transform: translateY(-50%) rotate(359deg);\n transform: translateY(-50%) rotate(359deg); } }\n\n@font-face {\n font-family: \"context-menu-icons\";\n src: url(\"font/context-menu-icons.eot?12di9\");\n src: url(\"font/context-menu-icons.eot?12di9#iefix\") format(\"embedded-opentype\"), url(\"font/context-menu-icons.woff2?12di9\") format(\"woff2\"), url(\"font/context-menu-icons.woff?12di9\") format(\"woff\"), url(\"font/context-menu-icons.ttf?12di9\") format(\"truetype\");\n font-weight: normal;\n font-style: normal; }\n\n.context-menu-icon-add:before {\n content: \"\\EA01\"; }\n\n.context-menu-icon-copy:before {\n content: \"\\EA02\"; }\n\n.context-menu-icon-cut:before {\n content: \"\\EA03\"; }\n\n.context-menu-icon-delete:before {\n content: \"\\EA04\"; }\n\n.context-menu-icon-edit:before {\n content: \"\\EA05\"; }\n\n.context-menu-icon-loading:before {\n content: \"\\EA06\"; }\n\n.context-menu-icon-paste:before {\n content: \"\\EA07\"; }\n\n.context-menu-icon-quit:before {\n content: \"\\EA08\"; }\n\n.context-menu-icon::before {\n color: #2980B9;\n font-family: \"context-menu-icons\";\n font-style: normal;\n font-weight: normal;\n font-size: 1em;\n left: 0;\n line-height: 1;\n position: absolute;\n text-align: center;\n top: 50%;\n transform: translateY(-50%);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n width: 2em; }\n\n.context-menu-icon.context-menu-hover:before {\n color: #FFF; }\n\n.context-menu-icon.context-menu-disabled::before {\n color: #bbbbbb; }\n\n.context-menu-icon.context-menu-icon-loading:before {\n animation: cm-spin 2s infinite; }\n\n.context-menu-icon.context-menu-icon--fa {\n display: list-item;\n font-family: inherit; }\n .context-menu-icon.context-menu-icon--fa::before {\n color: #2980B9;\n font-family: FontAwesome;\n font-style: normal;\n font-weight: normal;\n font-size: 1em;\n left: 0;\n line-height: 1;\n position: absolute;\n text-align: center;\n top: 50%;\n transform: translateY(-50%);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n width: 2em; }\n .context-menu-icon.context-menu-icon--fa.context-menu-hover:before {\n color: #FFF; }\n .context-menu-icon.context-menu-icon--fa.context-menu-disabled::before {\n color: #bbbbbb; }\n\n.context-menu-list.overBoundary, .context-menu-list.overBoundary ul.context-menu-list {\n position: fixed !important; }\n\n.context-menu-list {\n background: #FFF;\n border: 1px solid #bebebe;\n border-radius: 0.2em;\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);\n display: inline-block;\n font-family: inherit;\n font-size: inherit;\n list-style-type: none;\n margin: 0.3em;\n max-width: 26em;\n min-width: 13em;\n padding: 0.25em 0;\n position: absolute; }\n\n.context-menu-item {\n background-color: #FFF;\n color: #2F2F2F;\n padding: 0.2em 2em;\n position: relative;\n user-select: none; }\n\n.context-menu-separator {\n border-bottom: 1px solid #e6e6e6;\n margin: 0.35em 0;\n padding: 0; }\n\n.context-menu-item > label > input,\n.context-menu-item > label > textarea {\n user-select: text; }\n\n.context-menu-item.context-menu-hover {\n background-color: #2980B9;\n color: #FFF;\n cursor: pointer; }\n\n.context-menu-item.context-menu-disabled {\n background-color: #FFF;\n color: #bbbbbb;\n cursor: default; }\n\n.context-menu-input.context-menu-hover {\n cursor: default;\n color: #2F2F2F; }\n\n.context-menu-submenu:after {\n content: '';\n border-style: solid;\n border-width: .25em 0 .25em .25em;\n border-color: transparent transparent transparent #2F2F2F;\n height: 0;\n position: absolute;\n right: .5em;\n top: 50%;\n transform: translateY(-50%);\n width: 0;\n z-index: 1; }\n\n/**\n * Inputs\n */\n.context-menu-item.context-menu-input {\n padding: .3em .6em; }\n\n/* vertically align inside labels */\n.context-menu-input > label > * {\n vertical-align: top; }\n\n/* position checkboxes and radios as icons */\n.context-menu-input > label > input[type=\"checkbox\"],\n.context-menu-input > label > input[type=\"radio\"] {\n margin-right: .4em;\n position: relative;\n top: .12em; }\n\n.context-menu-input > label {\n margin: 0; }\n\n.context-menu-input > label,\n.context-menu-input > label > input[type=\"text\"],\n.context-menu-input > label > textarea,\n.context-menu-input > label > select {\n box-sizing: border-box;\n display: block;\n width: 100%; }\n\n.context-menu-input > label > textarea {\n height: 7em; }\n\n.context-menu-item > .context-menu-list {\n display: none;\n /* re-positioned by js */\n right: -.3em;\n top: .3em; }\n\n.context-menu-item.context-menu-visible > .context-menu-list {\n display: block; }\n\n.context-menu-accesskey {\n text-decoration: underline; }\n","@charset \"UTF-8\";/*!\n * jQuery contextMenu - Plugin for simple contextMenu handling\n *\n * Version: v2.5.0\n *\n * Authors: Björn Brala (SWIS.nl), Rodney Rehm, Addy Osmani (patches for FF)\n * Web: http://swisnl.github.io/jQuery-contextMenu/\n *\n * Copyright (c) 2011-2017 SWIS BV and contributors\n *\n * Licensed under\n * MIT License http://www.opensource.org/licenses/mit-license\n *\n * Date: 2017-11-24T17:49:57.361Z\n */@-webkit-keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0);transform:translateY(-50%) rotate(0)}100%{-webkit-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@-o-keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0);-o-transform:translateY(-50%) rotate(0);transform:translateY(-50%) rotate(0)}100%{-webkit-transform:translateY(-50%) rotate(359deg);-o-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@keyframes cm-spin{0%{-webkit-transform:translateY(-50%) rotate(0);-o-transform:translateY(-50%) rotate(0);transform:translateY(-50%) rotate(0)}100%{-webkit-transform:translateY(-50%) rotate(359deg);-o-transform:translateY(-50%) rotate(359deg);transform:translateY(-50%) rotate(359deg)}}@font-face{font-family:context-menu-icons;font-style:normal;font-weight:400;src:url(font/context-menu-icons.eot?12di9);src:url(font/context-menu-icons.eot?12di9#iefix) format(\"embedded-opentype\"),url(font/context-menu-icons.woff2?12di9) format(\"woff2\"),url(font/context-menu-icons.woff?12di9) format(\"woff\"),url(font/context-menu-icons.ttf?12di9) format(\"truetype\")}.context-menu-icon-add:before{content:\"\\EA01\"}.context-menu-icon-copy:before{content:\"\\EA02\"}.context-menu-icon-cut:before{content:\"\\EA03\"}.context-menu-icon-delete:before{content:\"\\EA04\"}.context-menu-icon-edit:before{content:\"\\EA05\"}.context-menu-icon-loading:before{content:\"\\EA06\"}.context-menu-icon-paste:before{content:\"\\EA07\"}.context-menu-icon-quit:before{content:\"\\EA08\"}.context-menu-icon::before{position:absolute;top:50%;left:0;width:2em;font-family:context-menu-icons;font-size:1em;font-style:normal;font-weight:400;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.context-menu-hover:before{color:#fff}.context-menu-icon.context-menu-disabled::before{color:#bbb}.context-menu-icon.context-menu-icon-loading:before{-webkit-animation:cm-spin 2s infinite;-o-animation:cm-spin 2s infinite;animation:cm-spin 2s infinite}.context-menu-icon.context-menu-icon--fa{display:list-item;font-family:inherit}.context-menu-icon.context-menu-icon--fa::before{position:absolute;top:50%;left:0;width:2em;font-family:FontAwesome;font-size:1em;font-style:normal;font-weight:400;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.context-menu-icon--fa.context-menu-hover:before{color:#fff}.context-menu-icon.context-menu-icon--fa.context-menu-disabled::before{color:#bbb}.context-menu-list.overBoundary,.context-menu-list.overBoundary ul.context-menu-list{position:fixed}.context-menu-list{position:absolute;display:inline-block;min-width:13em;max-width:26em;padding:.25em 0;margin:.3em;font-family:inherit;font-size:inherit;list-style-type:none;background:#fff;border:1px solid #bebebe;border-radius:.2em;-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:.2em 2em;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:.35em 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:#bbb;cursor:default;background-color:#fff}.context-menu-input.context-menu-hover{color:#2f2f2f;cursor:default}.context-menu-submenu:after{position:absolute;top:50%;right:.5em;z-index:1;width:0;height:0;content:'';border-color:transparent transparent transparent #2f2f2f;border-style:solid;border-width:.25em 0 .25em .25em;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%)}.context-menu-item.context-menu-input{padding:.3em .6em}.context-menu-input>label>*{vertical-align:top}.context-menu-input>label>input[type=checkbox],.context-menu-input>label>input[type=radio]{position:relative;top:.12em;margin-right:.4em}.context-menu-input>label{margin:0}.context-menu-input>label,.context-menu-input>label>input[type=text],.context-menu-input>label>select,.context-menu-input>label>textarea{display:block;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.context-menu-input>label>textarea{height:7em}.context-menu-item>.context-menu-list{top:.3em;right:-.3em;display:none}.context-menu-item.context-menu-visible>.context-menu-list{display:block}.context-menu-accesskey{text-decoration:underline}\n/*# sourceMappingURL=jquery.contextMenu.min.css.map */\n"]} \ No newline at end of file diff --git a/dist/jquery.contextMenu.min.js b/dist/jquery.contextMenu.min.js index 026fd64b..5b3a3772 100755 --- a/dist/jquery.contextMenu.min.js +++ b/dist/jquery.contextMenu.min.js @@ -1,2 +1,2 @@ -!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){"use strict";function t(e){for(var t,n=e.split(/\s+/),a=[],o=0;t=n[o];o++)t=t.charAt(0).toUpperCase(),a.push(t);return a}function n(t){return t.id&&e('label[for="'+t.id+'"]').val()||t.name}function a(t,o,s){return s||(s=0),o.each(function(){var o,i,c=e(this),l=this,r=this.nodeName.toLowerCase();switch("label"===r&&c.find("input, textarea, select").length&&(o=c.text(),c=c.children().first(),l=c.get(0),r=l.nodeName.toLowerCase()),r){case"menu":i={name:c.attr("label"),items:{}},s=a(i.items,c.children(),s);break;case"a":case"button":i={name:c.text(),disabled:!!c.attr("disabled"),callback:function(){return function(){c.get(0).click()}}()};break;case"menuitem":case"command":switch(c.attr("type")){case void 0:case"command":case"menuitem":i={name:c.attr("label"),disabled:!!c.attr("disabled"),icon:c.attr("icon"),callback:function(){return function(){c.get(0).click()}}()};break;case"checkbox":i={type:"checkbox",disabled:!!c.attr("disabled"),name:c.attr("label"),selected:!!c.attr("checked")};break;case"radio":i={type:"radio",disabled:!!c.attr("disabled"),name:c.attr("label"),radio:c.attr("radiogroup"),value:c.attr("id"),selected:!!c.attr("checked")};break;default:i=void 0}break;case"hr":i="-------";break;case"input":switch(c.attr("type")){case"text":i={type:"text",name:o||n(l),disabled:!!c.attr("disabled"),value:c.val()};break;case"checkbox":i={type:"checkbox",name:o||n(l),disabled:!!c.attr("disabled"),selected:!!c.attr("checked")};break;case"radio":i={type:"radio",name:o||n(l),disabled:!!c.attr("disabled"),radio:!!c.attr("name"),value:c.val(),selected:!!c.attr("checked")};break;default:i=void 0}break;case"select":i={type:"select",name:o||n(l),disabled:!!c.attr("disabled"),selected:c.val(),options:{}},c.children().each(function(){i.options[this.value]=e(this).text()});break;case"textarea":i={type:"textarea",name:o||n(l),disabled:!!c.attr("disabled"),value:c.val()};break;case"label":break;default:i={type:"html",html:c.clone(!0)}}i&&(s++,t["key"+s]=i)}),s}e.support.htmlMenuitem="HTMLMenuItemElement"in window,e.support.htmlCommand="HTMLCommandElement"in window,e.support.eventSelectstart="onselectstart"in document.documentElement,e.ui&&e.widget||(e.cleanData=function(t){return function(n){var a,o,s;for(s=0;null!=n[s];s++){o=n[s];try{a=e._data(o,"events"),a&&a.remove&&e(o).triggerHandler("remove")}catch(e){}}t(n)}}(e.cleanData));var o=null,s=!1,i=e(window),c=0,l={},r={},u={},d={selector:null,appendTo:null,trigger:"right",autoHide:!1,delay:200,reposition:!0,selectableSubMenu:!1,classNames:{hover:"context-menu-hover",disabled:"context-menu-disabled",visible:"context-menu-visible",notSelectable:"context-menu-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",iconLoadingClass:"context-menu-icon-loading"},determinePosition:function(t){if(e.ui&&e.ui.position)t.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none");else{var n=this.offset();n.top+=this.outerHeight(),n.left+=this.outerWidth()/2-t.outerWidth()/2,t.css(n)}},position:function(e,t,n){var a;if(!t&&!n)return void e.determinePosition.call(this,e.$menu);if("maintain"===t&&"maintain"===n)a=e.$menu.position();else{var o=e.$menu.offsetParent().offset();a={top:n-o.top,left:t-o.left}}var s=i.scrollTop()+i.height(),c=i.scrollLeft()+i.width(),l=e.$menu.outerHeight(),r=e.$menu.outerWidth();a.top+l>s&&(a.top-=l),a.top<0&&(a.top=0),a.left+r>c&&(a.left-=r),a.left<0&&(a.left=0),e.$menu.css(a)},positionSubmenu:function(t){if(void 0!==t)if(e.ui&&e.ui.position)t.css("display","block").position({my:"left top-5",at:"right top",of:this,collision:"flipfit fit"}).css("display","");else{var n={top:-9,left:this.outerWidth()-5};t.css(n)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{show:e.noop,hide:e.noop},callback:null,items:{}},m={timer:null,pageX:null,pageY:null},p=function(e){for(var t=0,n=e;;)if(t=Math.max(t,parseInt(n.css("z-index"),10)||0),!(n=n.parent())||!n.length||"html body".indexOf(n.prop("nodeName").toLowerCase())>-1)break;return t},f={abortevent:function(e){e.preventDefault(),e.stopImmediatePropagation()},contextmenu:function(t){var n=e(this);if("right"===t.data.trigger&&(t.preventDefault(),t.stopImmediatePropagation()),!("right"!==t.data.trigger&&"demand"!==t.data.trigger&&t.originalEvent||!(void 0===t.mouseButton||!t.data||"left"===t.data.trigger&&0===t.mouseButton||"right"===t.data.trigger&&2===t.mouseButton)||n.hasClass("context-menu-active")||n.hasClass("context-menu-disabled"))){if(o=n,t.data.build){var a=t.data.build(o,t);if(!1===a)return;if(t.data=e.extend(!0,{},d,t.data,a||{}),!t.data.items||e.isEmptyObject(t.data.items))throw window.console&&(console.error||console.log).call(console,"No items specified to show in contextMenu"),new Error("No Items specified");t.data.$trigger=o,h.create(t.data)}var s=!1;for(var i in t.data.items)if(t.data.items.hasOwnProperty(i)){var c;c=e.isFunction(t.data.items[i].visible)?t.data.items[i].visible.call(e(t.currentTarget),i,t.data):void 0===t.data.items[i]||!t.data.items[i].visible||!0===t.data.items[i].visible,c&&(s=!0)}s&&h.show.call(n,t.data,t.pageX,t.pageY)}},click:function(t){t.preventDefault(),t.stopImmediatePropagation(),e(this).trigger(e.Event("contextmenu",{data:t.data,pageX:t.pageX,pageY:t.pageY}))},mousedown:function(t){var n=e(this);o&&o.length&&!o.is(n)&&o.data("contextMenu").$menu.trigger("contextmenu:hide"),2===t.button&&(o=n.data("contextMenuActive",!0))},mouseup:function(t){var n=e(this);n.data("contextMenuActive")&&o&&o.length&&o.is(n)&&!n.hasClass("context-menu-disabled")&&(t.preventDefault(),t.stopImmediatePropagation(),o=n,n.trigger(e.Event("contextmenu",{data:t.data,pageX:t.pageX,pageY:t.pageY}))),n.removeData("contextMenuActive")},mouseenter:function(t){var n=e(this),a=e(t.relatedTarget),s=e(document);a.is(".context-menu-list")||a.closest(".context-menu-list").length||o&&o.length||(m.pageX=t.pageX,m.pageY=t.pageY,m.data=t.data,s.on("mousemove.contextMenuShow",f.mousemove),m.timer=setTimeout(function(){m.timer=null,s.off("mousemove.contextMenuShow"),o=n,n.trigger(e.Event("contextmenu",{data:m.data,pageX:m.pageX,pageY:m.pageY}))},t.data.delay))},mousemove:function(e){m.pageX=e.pageX,m.pageY=e.pageY},mouseleave:function(t){var n=e(t.relatedTarget);if(!n.is(".context-menu-list")&&!n.closest(".context-menu-list").length){try{clearTimeout(m.timer)}catch(t){}m.timer=null}},layerClick:function(t){var n,a,o=e(this),s=o.data("contextMenuRoot"),c=t.button,l=t.pageX,r=t.pageY;t.preventDefault(),setTimeout(function(){var o,u="left"===s.trigger&&0===c||"right"===s.trigger&&2===c;if(document.elementFromPoint&&s.$layer){if(s.$layer.hide(),n=document.elementFromPoint(l-i.scrollLeft(),r-i.scrollTop()),n.isContentEditable){var d=document.createRange(),m=window.getSelection();d.selectNode(n),d.collapse(!0),m.removeAllRanges(),m.addRange(d)}e(n).trigger(t),s.$layer.show()}if(s.reposition&&u)if(document.elementFromPoint){if(s.$trigger.is(n))return void s.position.call(s.$trigger,s,l,r)}else if(a=s.$trigger.offset(),o=e(window),a.top+=o.scrollTop(),a.top<=t.pageY&&(a.left+=o.scrollLeft(),a.left<=t.pageX&&(a.bottom=a.top+s.$trigger.outerHeight(),a.bottom>=t.pageY&&(a.right=a.left+s.$trigger.outerWidth(),a.right>=t.pageX))))return void s.position.call(s.$trigger,s,l,r);n&&u&&s.$trigger.one("contextmenu:hidden",function(){e(n).contextMenu({x:l,y:r,button:c})}),null!==s&&void 0!==s&&null!==s.$menu&&void 0!==s.$menu&&s.$menu.trigger("contextmenu:hide")},50)},keyStop:function(e,t){t.isInput||e.preventDefault(),e.stopPropagation()},key:function(e){var t={};o&&(t=o.data("contextMenu")||{}),void 0===t.zIndex&&(t.zIndex=0);var n=0,a=function(e){""!==e.style.zIndex?n=e.style.zIndex:null!==e.offsetParent&&void 0!==e.offsetParent?a(e.offsetParent):null!==e.parentElement&&void 0!==e.parentElement&&a(e.parentElement)};if(a(e.target),!(t.$menu&&parseInt(n,10)>parseInt(t.$menu.css("zIndex"),10))){switch(e.keyCode){case 9:case 38:if(f.keyStop(e,t),t.isInput){if(9===e.keyCode&&e.shiftKey)return e.preventDefault(),t.$selected&&t.$selected.find("input, textarea, select").blur(),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("prevcommand"));if(38===e.keyCode&&"checkbox"===t.$selected.find("input, textarea, select").prop("type"))return void e.preventDefault()}else if(9!==e.keyCode||e.shiftKey)return void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("prevcommand"));break;case 40:if(f.keyStop(e,t),!t.isInput)return void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("nextcommand"));if(9===e.keyCode)return e.preventDefault(),t.$selected&&t.$selected.find("input, textarea, select").blur(),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("nextcommand"));if(40===e.keyCode&&"checkbox"===t.$selected.find("input, textarea, select").prop("type"))return void e.preventDefault();break;case 37:if(f.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;if(!t.$selected.parent().hasClass("context-menu-root")){var s=t.$selected.parent().parent();return t.$selected.trigger("contextmenu:blur"),void(t.$selected=s)}break;case 39:if(f.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;var i=t.$selected.data("contextMenu")||{};if(i.$menu&&t.$selected.hasClass("context-menu-submenu"))return t.$selected=null,i.$selected=null,void i.$menu.trigger("nextcommand");break;case 35:case 36:return t.$selected&&t.$selected.find("input, textarea, select").length?void 0:((t.$selected&&t.$selected.parent()||t.$menu).children(":not(."+t.classNames.disabled+", ."+t.classNames.notSelectable+")")[36===e.keyCode?"first":"last"]().trigger("contextmenu:focus"),void e.preventDefault());case 13:if(f.keyStop(e,t),t.isInput){if(t.$selected&&!t.$selected.is("textarea, select"))return void e.preventDefault();break}return void(void 0!==t.$selected&&null!==t.$selected&&t.$selected.trigger("mouseup"));case 32:case 33:case 34:return void f.keyStop(e,t);case 27:return f.keyStop(e,t),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("contextmenu:hide"));default:var c=String.fromCharCode(e.keyCode).toUpperCase();if(t.accesskeys&&t.accesskeys[c])return void t.accesskeys[c].$node.trigger(t.accesskeys[c].$menu?"contextmenu:focus":"mouseup")}e.stopPropagation(),void 0!==t.$selected&&null!==t.$selected&&t.$selected.trigger(e)}},prevItem:function(t){t.stopPropagation();var n=e(this).data("contextMenu")||{},a=e(this).data("contextMenuRoot")||{};if(n.$selected){var o=n.$selected;n=n.$selected.parent().data("contextMenu")||{},n.$selected=o}for(var s=n.$menu.children(),i=n.$selected&&n.$selected.prev().length?n.$selected.prev():s.last(),c=i;i.hasClass(a.classNames.disabled)||i.hasClass(a.classNames.notSelectable)||i.is(":hidden");)if(i=i.prev().length?i.prev():s.last(),i.is(c))return;n.$selected&&f.itemMouseleave.call(n.$selected.get(0),t),f.itemMouseenter.call(i.get(0),t);var l=i.find("input, textarea, select");l.length&&l.focus()},nextItem:function(t){t.stopPropagation();var n=e(this).data("contextMenu")||{},a=e(this).data("contextMenuRoot")||{};if(n.$selected){var o=n.$selected;n=n.$selected.parent().data("contextMenu")||{},n.$selected=o}for(var s=n.$menu.children(),i=n.$selected&&n.$selected.next().length?n.$selected.next():s.first(),c=i;i.hasClass(a.classNames.disabled)||i.hasClass(a.classNames.notSelectable)||i.is(":hidden");)if(i=i.next().length?i.next():s.first(),i.is(c))return;n.$selected&&f.itemMouseleave.call(n.$selected.get(0),t),f.itemMouseenter.call(i.get(0),t);var l=i.find("input, textarea, select");l.length&&l.focus()},focusInput:function(){var t=e(this).closest(".context-menu-item"),n=t.data(),a=n.contextMenu,o=n.contextMenuRoot;o.$selected=a.$selected=t,o.isInput=a.isInput=!0},blurInput:function(){var t=e(this).closest(".context-menu-item"),n=t.data(),a=n.contextMenu;n.contextMenuRoot.isInput=a.isInput=!1},menuMouseenter:function(){e(this).data().contextMenuRoot.hovering=!0},menuMouseleave:function(t){var n=e(this).data().contextMenuRoot;n.$layer&&n.$layer.is(t.relatedTarget)&&(n.hovering=!1)},itemMouseenter:function(t){var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;if(s.hovering=!0,t&&s.$layer&&s.$layer.is(t.relatedTarget)&&(t.preventDefault(),t.stopImmediatePropagation()),(o.$menu?o:s).$menu.children("."+s.classNames.hover).trigger("contextmenu:blur").children(".hover").trigger("contextmenu:blur"),n.hasClass(s.classNames.disabled)||n.hasClass(s.classNames.notSelectable))return void(o.$selected=null);n.trigger("contextmenu:focus")},itemMouseleave:function(t){var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;if(s!==o&&s.$layer&&s.$layer.is(t.relatedTarget))return void 0!==s.$selected&&null!==s.$selected&&s.$selected.trigger("contextmenu:blur"),t.preventDefault(),t.stopImmediatePropagation(),void(s.$selected=o.$selected=o.$node);o&&o.$menu&&o.$menu.hasClass("context-menu-visible")||n.trigger("contextmenu:blur")},itemClick:function(t){var n,a=e(this),o=a.data(),s=o.contextMenu,i=o.contextMenuRoot,c=o.contextMenuKey;if(!(!s.items[c]||a.is("."+i.classNames.disabled+", .context-menu-separator, ."+i.classNames.notSelectable)||a.is(".context-menu-submenu")&&!1===i.selectableSubMenu)){if(t.preventDefault(),t.stopImmediatePropagation(),e.isFunction(s.callbacks[c])&&Object.prototype.hasOwnProperty.call(s.callbacks,c))n=s.callbacks[c];else{if(!e.isFunction(i.callback))return;n=i.callback}!1!==n.call(i.$trigger,c,i,t)?i.$menu.trigger("contextmenu:hide"):i.$menu.parent().length&&h.update.call(i.$trigger,i)}},inputClick:function(e){e.stopImmediatePropagation()},hideMenu:function(t,n){var a=e(this).data("contextMenuRoot");h.hide.call(a.$trigger,a,n&&n.force)},focusItem:function(t){t.stopPropagation();var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;n.hasClass(s.classNames.disabled)||n.hasClass(s.classNames.notSelectable)||(n.addClass([s.classNames.hover,s.classNames.visible].join(" ")).parent().find(".context-menu-item").not(n).removeClass(s.classNames.visible).filter("."+s.classNames.hover).trigger("contextmenu:blur"),o.$selected=s.$selected=n,o&&o.$node&&o.$node.hasClass("context-menu-submenu")&&o.$node.addClass(s.classNames.hover),o.$node&&s.positionSubmenu.call(o.$node,o.$menu))},blurItem:function(t){t.stopPropagation();var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;o.autoHide&&n.removeClass(s.classNames.visible),n.removeClass(s.classNames.hover),o.$selected=null}},h={show:function(t,n,a){var s=e(this),i={};if(e("#context-menu-layer").trigger("mousedown"),t.$trigger=s,!1===t.events.show.call(s,t))return void(o=null);if(h.update.call(s,t),t.position.call(s,t,n,a),t.zIndex){var c=t.zIndex;"function"==typeof t.zIndex&&(c=t.zIndex.call(s,t)),i.zIndex=p(s)+c}h.layer.call(t.$menu,t,i.zIndex),t.$menu.find("ul").css("zIndex",i.zIndex+1),t.$menu.css(i)[t.animation.show](t.animation.duration,function(){s.trigger("contextmenu:visible")}),s.data("contextMenu",t).addClass("context-menu-active"),e(document).off("keydown.contextMenu").on("keydown.contextMenu",f.key),t.autoHide&&e(document).on("mousemove.contextMenuAutoHide",function(e){var n=s.offset();n.right=n.left+s.outerWidth(),n.bottom=n.top+s.outerHeight(),!t.$layer||t.hovering||e.pageX>=n.left&&e.pageX<=n.right&&e.pageY>=n.top&&e.pageY<=n.bottom||setTimeout(function(){t.hovering||null===t.$menu||void 0===t.$menu||t.$menu.trigger("contextmenu:hide")},50)})},hide:function(t,n){var a=e(this);if(t||(t=a.data("contextMenu")||{}),n||!t.events||!1!==t.events.hide.call(a,t)){if(a.removeData("contextMenu").removeClass("context-menu-active"),t.$layer){setTimeout(function(e){return function(){e.remove()}}(t.$layer),10);try{delete t.$layer}catch(e){t.$layer=null}}o=null,t.$menu.find("."+t.classNames.hover).trigger("contextmenu:blur"),t.$selected=null,t.$menu.find("."+t.classNames.visible).removeClass(t.classNames.visible),e(document).off(".contextMenuAutoHide").off("keydown.contextMenu"),t.$menu&&t.$menu[t.animation.hide](t.animation.duration,function(){t.build&&(t.$menu.remove(),e.each(t,function(e){switch(e){case"ns":case"selector":case"build":case"trigger":return!0;default:t[e]=void 0;try{delete t[e]}catch(e){}return!0}})),setTimeout(function(){a.trigger("contextmenu:hidden")},10)})}},create:function(n,a){function o(t){var n=e("");if(t._accesskey)t._beforeAccesskey&&n.append(document.createTextNode(t._beforeAccesskey)),e("").addClass("context-menu-accesskey").text(t._accesskey).appendTo(n),t._afterAccesskey&&n.append(document.createTextNode(t._afterAccesskey));else if(t.isHtmlName){if(void 0!==t.accesskey)throw new Error("accesskeys are not compatible with HTML names and cannot be used together in the same item");n.html(t.name)}else n.text(t.name);return n}void 0===a&&(a=n),n.$menu=e('
        ').addClass(n.className||"").data({contextMenu:n,contextMenuRoot:a}),e.each(["callbacks","commands","inputs"],function(e,t){n[t]={},a[t]||(a[t]={})}),a.accesskeys||(a.accesskeys={}),e.each(n.items,function(s,i){var c=e('
      • ').addClass(i.className||""),l=null,r=null;if(c.on("click",e.noop),"string"!=typeof i&&"cm_separator"!==i.type||(i={type:"cm_seperator"}),i.$node=c.data({contextMenu:n,contextMenuRoot:a,contextMenuKey:s}),void 0!==i.accesskey)for(var d,m=t(i.accesskey),p=0;d=m[p];p++)if(!a.accesskeys[d]){a.accesskeys[d]=i;var v=i.name.match(new RegExp("^(.*?)("+d+")(.*)$","i"));v&&(i._beforeAccesskey=v[1],i._accesskey=v[2],i._afterAccesskey=v[3]);break}if(i.type&&u[i.type])u[i.type].call(c,i,n,a),e.each([n,a],function(t,a){a.commands[s]=i,!e.isFunction(i.callback)||void 0!==a.callbacks[s]&&void 0!==n.type||(a.callbacks[s]=i.callback)});else{switch("cm_seperator"===i.type?c.addClass("context-menu-separator "+a.classNames.notSelectable):"html"===i.type?c.addClass("context-menu-html "+a.classNames.notSelectable):"sub"===i.type||(i.type?(l=e("").appendTo(c),o(i).appendTo(l),c.addClass("context-menu-input"),n.hasTypes=!0,e.each([n,a],function(e,t){t.commands[s]=i,t.inputs[s]=i})):i.items&&(i.type="sub")),i.type){case"cm_seperator":break;case"text":r=e('').attr("name","context-menu-input-"+s).val(i.value||"").appendTo(l);break;case"textarea":r=e('').attr("name","context-menu-input-"+s).val(i.value||"").appendTo(l),i.height&&r.height(i.height);break;case"checkbox":r=e('').attr("name","context-menu-input-"+s).val(i.value||"").prop("checked",!!i.selected).prependTo(l);break;case"radio":r=e('').attr("name","context-menu-input-"+i.radio).val(i.value||"").prop("checked",!!i.selected).prependTo(l);break;case"select":r=e('').attr("name","context-menu-input-"+s).appendTo(l),i.options&&(e.each(i.options,function(t,n){e("").val(t).text(n).appendTo(r)}),r.val(i.selected));break;case"sub":o(i).appendTo(c),i.appendTo=i.$node,c.data("contextMenu",i).addClass("context-menu-submenu"),i.callback=null,"function"==typeof i.items.then?h.processPromises(i,a,i.items):h.create(i,a);break;case"html":e(i.html).appendTo(c);break;default:e.each([n,a],function(t,a){a.commands[s]=i,!e.isFunction(i.callback)||void 0!==a.callbacks[s]&&void 0!==n.type||(a.callbacks[s]=i.callback)}),o(i).appendTo(c)}i.type&&"sub"!==i.type&&"html"!==i.type&&"cm_seperator"!==i.type&&(r.on("focus",f.focusInput).on("blur",f.blurInput),i.events&&r.on(i.events,n)),i.icon&&(e.isFunction(i.icon)?i._icon=i.icon.call(this,this,c,s,i):"string"==typeof i.icon&&"fa-"===i.icon.substring(0,3)?i._icon=a.classNames.icon+" "+a.classNames.icon+"--fa fa "+i.icon:i._icon=a.classNames.icon+" "+a.classNames.icon+"-"+i.icon,c.addClass(i._icon))}i.$input=r,i.$label=l,c.appendTo(n.$menu),!n.hasTypes&&e.support.eventSelectstart&&c.on("selectstart.disableTextSelect",f.abortevent)}),n.$node||n.$menu.css("display","none").addClass("context-menu-root"),n.$menu.appendTo(n.appendTo||document.body)},resize:function(t,n){var a;t.css({position:"absolute",display:"block"}),t.data("width",(a=t.get(0)).getBoundingClientRect?Math.ceil(a.getBoundingClientRect().width):t.outerWidth()+1),t.css({position:"static",minWidth:"0px",maxWidth:"100000px"}),t.find("> li > ul").each(function(){h.resize(e(this),!0)}),n||t.find("ul").addBack().css({position:"",display:"",minWidth:"",maxWidth:""}).outerWidth(function(){return e(this).data("width")})},update:function(t,n){var a=this;void 0===n&&(n=t,h.resize(t.$menu)),t.$menu.children().each(function(){var o,s=e(this),i=s.data("contextMenuKey"),c=t.items[i],l=e.isFunction(c.disabled)&&c.disabled.call(a,i,n)||!0===c.disabled;if(o=e.isFunction(c.visible)?c.visible.call(a,i,n):void 0===c.visible||!0===c.visible,s[o?"show":"hide"](),s[l?"addClass":"removeClass"](n.classNames.disabled),e.isFunction(c.icon)&&(s.removeClass(c._icon),c._icon=c.icon.call(this,a,s,i,c),s.addClass(c._icon)),c.type)switch(s.find("input, select, textarea").prop("disabled",l),c.type){case"text":case"textarea":c.$input.val(c.value||"");break;case"checkbox":case"radio":c.$input.val(c.value||"").prop("checked",!!c.selected);break;case"select":c.$input.val((0===c.selected?"0":c.selected)||"")}c.$menu&&h.update.call(a,c,n)})},layer:function(t,n){var a=t.$layer=e('
        ').css({height:i.height(),width:i.width(),display:"block",position:"fixed","z-index":n,top:0,left:0,opacity:0,filter:"alpha(opacity=0)","background-color":"#000"}).data("contextMenuRoot",t).insertBefore(this).on("contextmenu",f.abortevent).on("mousedown",f.layerClick);return void 0===document.body.style.maxWidth&&a.css({position:"absolute",height:e(document).height()}),a},processPromises:function(e,t,n){function a(e,t,n){void 0===n&&o(void 0),s(e,t,n)}function o(e,t,n){void 0===n?(n={error:{name:"No items and no error item",icon:"context-menu-icon context-menu-icon-quit"}},window.console&&(console.error||console.log).call(console,'When you reject a promise, provide an "items" object, equal to normal sub-menu items')):"string"==typeof n&&(n={error:{name:n}}),s(e,t,n)}function s(e,t,n){void 0!==t.$menu&&t.$menu.is(":visible")&&(e.$node.removeClass(t.classNames.iconLoadingClass),e.items=n,h.create(e,t,!0),h.update(e,t),t.positionSubmenu.call(e.$node,e.$menu))}e.$node.addClass(t.classNames.iconLoadingClass),n.then(a.bind(this,e,t),o.bind(this,e,t))}};e.fn.contextMenu=function(t){var n=this,a=t;if(this.length>0)if(void 0===t)this.first().trigger("contextmenu");else if(void 0!==t.x&&void 0!==t.y)this.first().trigger(e.Event("contextmenu",{pageX:t.x,pageY:t.y,mouseButton:t.button}));else if("hide"===t){var o=this.first().data("contextMenu")?this.first().data("contextMenu").$menu:null;o&&o.trigger("contextmenu:hide")}else"destroy"===t?e.contextMenu("destroy",{context:this}):e.isPlainObject(t)?(t.context=this,e.contextMenu("create",t)):t?this.removeClass("context-menu-disabled"):t||this.addClass("context-menu-disabled");else e.each(r,function(){this.selector===n.selector&&(a.data=this,e.extend(a.data,{trigger:"demand"}))}),f.contextmenu.call(a.target,a);return this},e.contextMenu=function(t,n){"string"!=typeof t&&(n=t,t="create"),"string"==typeof n?n={selector:n}:void 0===n&&(n={});var a=e.extend(!0,{},d,n||{}),o=e(document),i=o,u=!1;switch(a.context&&a.context.length?(i=e(a.context).first(),a.context=i.get(0),u=!e(a.context).is(document)):a.context=document,t){case"create":if(!a.selector)throw new Error("No selector specified");if(a.selector.match(/.context-menu-(list|item|input)($|\s)/))throw new Error('Cannot bind to selector "'+a.selector+'" as it contains a reserved className');if(!a.build&&(!a.items||e.isEmptyObject(a.items)))throw new Error("No Items specified");if(c++,a.ns=".contextMenu"+c,u||(l[a.selector]=a.ns),r[a.ns]=a,a.trigger||(a.trigger="right"),!s){var m="click"===a.itemClickEvent?"click.contextMenu":"mouseup.contextMenu",p={"contextmenu:focus.contextMenu":f.focusItem,"contextmenu:blur.contextMenu":f.blurItem,"contextmenu.contextMenu":f.abortevent,"mouseenter.contextMenu":f.itemMouseenter,"mouseleave.contextMenu":f.itemMouseleave};p[m]=f.itemClick,o.on({"contextmenu:hide.contextMenu":f.hideMenu,"prevcommand.contextMenu":f.prevItem,"nextcommand.contextMenu":f.nextItem,"contextmenu.contextMenu":f.abortevent,"mouseenter.contextMenu":f.menuMouseenter,"mouseleave.contextMenu":f.menuMouseleave},".context-menu-list").on("mouseup.contextMenu",".context-menu-input",f.inputClick).on(p,".context-menu-item"),s=!0}switch(i.on("contextmenu"+a.ns,a.selector,a,f.contextmenu),u&&i.on("remove"+a.ns,function(){e(this).contextMenu("destroy")}),a.trigger){case"hover":i.on("mouseenter"+a.ns,a.selector,a,f.mouseenter).on("mouseleave"+a.ns,a.selector,a,f.mouseleave);break;case"left":i.on("click"+a.ns,a.selector,a,f.click);break;case"touchstart":i.on("touchstart"+a.ns,a.selector,a,f.click)}a.build||h.create(a);break;case"destroy":var v;if(u){var x=a.context;e.each(r,function(t,n){if(!n)return!0;if(!e(x).is(n.selector))return!0;v=e(".context-menu-list").filter(":visible"),v.length&&v.data().contextMenuRoot.$trigger.is(e(n.context).find(n.selector))&&v.trigger("contextmenu:hide",{force:!0});try{r[n.ns].$menu&&r[n.ns].$menu.remove(),delete r[n.ns]}catch(e){r[n.ns]=null}return e(n.context).off(n.ns),!0})}else if(a.selector){if(l[a.selector]){v=e(".context-menu-list").filter(":visible"),v.length&&v.data().contextMenuRoot.$trigger.is(a.selector)&&v.trigger("contextmenu:hide",{force:!0});try{r[l[a.selector]].$menu&&r[l[a.selector]].$menu.remove(),delete r[l[a.selector]]}catch(e){r[l[a.selector]]=null}o.off(l[a.selector])}}else o.off(".contextMenu .contextMenuAutoHide"),e.each(r,function(t,n){e(n.context).off(n.ns)}),l={},r={},c=0,s=!1,e("#context-menu-layer, .context-menu-list").remove();break;case"html5":(!e.support.htmlCommand&&!e.support.htmlMenuitem||"boolean"==typeof n&&n)&&e('menu[type="context"]').each(function(){this.id&&e.contextMenu({selector:"[contextmenu="+this.id+"]",items:e.contextMenu.fromMenu(this)})}).css("display","none");break;default:throw new Error('Unknown operation "'+t+'"')}return this},e.contextMenu.setInputValues=function(t,n){void 0===n&&(n={}),e.each(t.inputs,function(e,t){switch(t.type){case"text":case"textarea":t.value=n[e]||"";break;case"checkbox":t.selected=!!n[e];break;case"radio":t.selected=(n[t.radio]||"")===t.value;break;case"select":t.selected=n[e]||""}})},e.contextMenu.getInputValues=function(t,n){return void 0===n&&(n={}),e.each(t.inputs,function(e,t){switch(t.type){case"text":case"textarea":case"select":n[e]=t.$input.val();break;case"checkbox":n[e]=t.$input.prop("checked");break;case"radio":t.$input.prop("checked")&&(n[t.radio]=t.value)}}),n},e.contextMenu.fromMenu=function(t){var n=e(t),o={};return a(o,n.children()),o},e.contextMenu.defaults=d,e.contextMenu.types=u,e.contextMenu.handle=f,e.contextMenu.op=h,e.contextMenu.menus=r}); +!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){"use strict";function t(e){for(var t,n=e.split(/\s+/),a=[],o=0;t=n[o];o++)t=t.charAt(0).toUpperCase(),a.push(t);return a}function n(t){return t.id&&e('label[for="'+t.id+'"]').val()||t.name}function a(t,o,s){return s||(s=0),o.each(function(){var o,i,c=e(this),r=this,l=this.nodeName.toLowerCase();switch("label"===l&&c.find("input, textarea, select").length&&(o=c.text(),c=c.children().first(),r=c.get(0),l=r.nodeName.toLowerCase()),l){case"menu":i={name:c.attr("label"),items:{}},s=a(i.items,c.children(),s);break;case"a":case"button":i={name:c.text(),disabled:!!c.attr("disabled"),callback:function(){return function(){c.get(0).click()}}()};break;case"menuitem":case"command":switch(c.attr("type")){case void 0:case"command":case"menuitem":i={name:c.attr("label"),disabled:!!c.attr("disabled"),icon:c.attr("icon"),callback:function(){return function(){c.get(0).click()}}()};break;case"checkbox":i={type:"checkbox",disabled:!!c.attr("disabled"),name:c.attr("label"),selected:!!c.attr("checked")};break;case"radio":i={type:"radio",disabled:!!c.attr("disabled"),name:c.attr("label"),radio:c.attr("radiogroup"),value:c.attr("id"),selected:!!c.attr("checked")};break;default:i=void 0}break;case"hr":i="-------";break;case"input":switch(c.attr("type")){case"text":i={type:"text",name:o||n(r),disabled:!!c.attr("disabled"),value:c.val()};break;case"checkbox":i={type:"checkbox",name:o||n(r),disabled:!!c.attr("disabled"),selected:!!c.attr("checked")};break;case"radio":i={type:"radio",name:o||n(r),disabled:!!c.attr("disabled"),radio:!!c.attr("name"),value:c.val(),selected:!!c.attr("checked")};break;default:i=void 0}break;case"select":i={type:"select",name:o||n(r),disabled:!!c.attr("disabled"),selected:c.val(),options:{}},c.children().each(function(){i.options[this.value]=e(this).text()});break;case"textarea":i={type:"textarea",name:o||n(r),disabled:!!c.attr("disabled"),value:c.val()};break;case"label":break;default:i={type:"html",html:c.clone(!0)}}i&&(s++,t["key"+s]=i)}),s}e.support.htmlMenuitem="HTMLMenuItemElement"in window,e.support.htmlCommand="HTMLCommandElement"in window,e.support.eventSelectstart="onselectstart"in document.documentElement,e.ui&&e.widget||(e.cleanData=function(t){return function(n){var a,o,s;for(s=0;null!=n[s];s++){o=n[s];try{a=e._data(o,"events"),a&&a.remove&&e(o).triggerHandler("remove")}catch(e){}}t(n)}}(e.cleanData));var o=null,s=!1,i=e(window),c=0,r={},l={},u={},d={selector:null,appendTo:null,trigger:"right",autoHide:!1,delay:200,reposition:!0,hideOnSecondTrigger:!1,selectableSubMenu:!1,hasOverboundaryScroll:!1,classNames:{hover:"context-menu-hover",disabled:"context-menu-disabled",visible:"context-menu-visible",notSelectable:"context-menu-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",iconLoadingClass:"context-menu-icon-loading"},determinePosition:function(t){if(e.ui&&e.ui.position)t.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none");else{var n=this.offset();n.top+=this.outerHeight(),n.left+=this.outerWidth()/2-t.outerWidth()/2,t.css(n)}},position:function(e,t,n){var a;if(!t&&!n)return void e.determinePosition.call(this,e.$menu);if("maintain"===t&&"maintain"===n)a=e.$menu.position();else{var o=e.$menu.offsetParent().offset();a={top:n-o.top,left:t-o.left}}var s=i.scrollTop()+i.height(),c=i.scrollLeft()+i.width(),r=e.$menu.outerHeight(),l=e.$menu.outerWidth();a.top+r>s&&(a.top-=r),a.top<0&&(a.top=0),a.left+l>c&&(a.left-=l),a.left<0&&(a.left=0),e.$menu.css(a)},positionSubmenu:function(t,n){if(void 0!==t)if(e.ui&&e.ui.position)t.css("display","block").position({my:"left top-5",at:"right top",of:this,collision:"flipfit fit"}).css("display","");else{var a={};if(n&&n.hasOverboundaryScroll){var o=this.offset();a={top:o.top,left:o.left+this.outerWidth()}}else a={top:-9,left:this.outerWidth()-5};t.css(a),n&&n.hasOverboundaryScroll&&h.activated(n,t)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{show:e.noop,hide:e.noop,activated:e.noop},callback:null,items:{}},m={timer:null,pageX:null,pageY:null},p=function(e){for(var t=0,n=e;;)if(t=Math.max(t,parseInt(n.css("z-index"),10)||0),!(n=n.parent())||!n.length||"html body".indexOf(n.prop("nodeName").toLowerCase())>-1)break;return t},f={abortevent:function(e){e.preventDefault(),e.stopImmediatePropagation()},contextmenu:function(t){var n=e(this);if("right"===t.data.trigger&&(t.preventDefault(),t.stopImmediatePropagation()),!("right"!==t.data.trigger&&"demand"!==t.data.trigger&&t.originalEvent||!(void 0===t.mouseButton||!t.data||"left"===t.data.trigger&&0===t.mouseButton||"right"===t.data.trigger&&2===t.mouseButton)||n.hasClass("context-menu-active")||n.hasClass("context-menu-disabled"))){if(o=n,t.data.build){var a=t.data.build(o,t);if(!1===a)return;if(t.data=e.extend(!0,{},d,t.data,a||{}),!t.data.items||e.isEmptyObject(t.data.items))throw window.console&&(console.error||console.log).call(console,"No items specified to show in contextMenu"),new Error("No Items specified");t.data.$trigger=o,h.create(t.data)}var s=!1;for(var i in t.data.items)if(t.data.items.hasOwnProperty(i)){var c;c=e.isFunction(t.data.items[i].visible)?t.data.items[i].visible.call(e(t.currentTarget),i,t.data):void 0===t.data.items[i]||!t.data.items[i].visible||!0===t.data.items[i].visible,c&&(s=!0)}s&&h.show.call(n,t.data,t.pageX,t.pageY)}},click:function(t){t.preventDefault(),t.stopImmediatePropagation(),e(this).trigger(e.Event("contextmenu",{data:t.data,pageX:t.pageX,pageY:t.pageY}))},mousedown:function(t){var n=e(this);o&&o.length&&!o.is(n)&&o.data("contextMenu").$menu.trigger("contextmenu:hide"),2===t.button&&(o=n.data("contextMenuActive",!0))},mouseup:function(t){var n=e(this);n.data("contextMenuActive")&&o&&o.length&&o.is(n)&&!n.hasClass("context-menu-disabled")&&(t.preventDefault(),t.stopImmediatePropagation(),o=n,n.trigger(e.Event("contextmenu",{data:t.data,pageX:t.pageX,pageY:t.pageY}))),n.removeData("contextMenuActive")},mouseenter:function(t){var n=e(this),a=e(t.relatedTarget),s=e(document);a.is(".context-menu-list")||a.closest(".context-menu-list").length||o&&o.length||(m.pageX=t.pageX,m.pageY=t.pageY,m.data=t.data,s.on("mousemove.contextMenuShow",f.mousemove),m.timer=setTimeout(function(){m.timer=null,s.off("mousemove.contextMenuShow"),o=n,n.trigger(e.Event("contextmenu",{data:m.data,pageX:m.pageX,pageY:m.pageY}))},t.data.delay))},mousemove:function(e){m.pageX=e.pageX,m.pageY=e.pageY},mouseleave:function(t){var n=e(t.relatedTarget);if(!n.is(".context-menu-list")&&!n.closest(".context-menu-list").length){try{clearTimeout(m.timer)}catch(t){}m.timer=null}},layerClick:function(t){var n,a,o=e(this),s=o.data("contextMenuRoot"),c=t.button,r=t.pageX,l=t.pageY;t.preventDefault(),setTimeout(function(){var o,u="left"===s.trigger&&0===c||"right"===s.trigger&&2===c;if(document.elementFromPoint&&s.$layer){if(s.$layer.hide(),n=document.elementFromPoint(r-i.scrollLeft(),l-i.scrollTop()),n.isContentEditable){var d=document.createRange(),m=window.getSelection();d.selectNode(n),d.collapse(!0),m.removeAllRanges(),m.addRange(d)}e(n).trigger(t),s.$layer.show()}if(s.hideOnSecondTrigger&&u&&null!==s.$menu&&void 0!==s.$menu)return void s.$menu.trigger("contextmenu:hide");if(s.reposition&&u)if(document.elementFromPoint){if(s.$trigger.is(n))return void s.position.call(s.$trigger,s,r,l)}else if(a=s.$trigger.offset(),o=e(window),a.top+=o.scrollTop(),a.top<=t.pageY&&(a.left+=o.scrollLeft(),a.left<=t.pageX&&(a.bottom=a.top+s.$trigger.outerHeight(),a.bottom>=t.pageY&&(a.right=a.left+s.$trigger.outerWidth(),a.right>=t.pageX))))return void s.position.call(s.$trigger,s,r,l);n&&u&&s.$trigger.one("contextmenu:hidden",function(){e(n).contextMenu({x:r,y:l,button:c})}),null!==s&&void 0!==s&&null!==s.$menu&&void 0!==s.$menu&&s.$menu.trigger("contextmenu:hide")},50)},keyStop:function(e,t){t.isInput||e.preventDefault(),e.stopPropagation()},key:function(e){var t={};o&&(t=o.data("contextMenu")||{}),void 0===t.zIndex&&(t.zIndex=0);var n=0,a=function(e){""!==e.style.zIndex?n=e.style.zIndex:null!==e.offsetParent&&void 0!==e.offsetParent?a(e.offsetParent):null!==e.parentElement&&void 0!==e.parentElement&&a(e.parentElement)};if(a(e.target),!(t.$menu&&parseInt(n,10)>parseInt(t.$menu.css("zIndex"),10))){switch(e.keyCode){case 9:case 38:if(f.keyStop(e,t),t.isInput){if(9===e.keyCode&&e.shiftKey)return e.preventDefault(),t.$selected&&t.$selected.find("input, textarea, select").blur(),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("prevcommand"));if(38===e.keyCode&&"checkbox"===t.$selected.find("input, textarea, select").prop("type"))return void e.preventDefault()}else if(9!==e.keyCode||e.shiftKey)return void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("prevcommand"));break;case 40:if(f.keyStop(e,t),!t.isInput)return void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("nextcommand"));if(9===e.keyCode)return e.preventDefault(),t.$selected&&t.$selected.find("input, textarea, select").blur(),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("nextcommand"));if(40===e.keyCode&&"checkbox"===t.$selected.find("input, textarea, select").prop("type"))return void e.preventDefault();break;case 37:if(f.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;if(!t.$selected.parent().hasClass("context-menu-root")){var s=t.$selected.parent().parent();return t.$selected.trigger("contextmenu:blur"),void(t.$selected=s)}break;case 39:if(f.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;var i=t.$selected.data("contextMenu")||{};if(i.$menu&&t.$selected.hasClass("context-menu-submenu"))return t.$selected=null,i.$selected=null,void i.$menu.trigger("nextcommand");break;case 35:case 36:return t.$selected&&t.$selected.find("input, textarea, select").length?void 0:((t.$selected&&t.$selected.parent()||t.$menu).children(":not(."+t.classNames.disabled+", ."+t.classNames.notSelectable+")")[36===e.keyCode?"first":"last"]().trigger("contextmenu:focus"),void e.preventDefault());case 13:if(f.keyStop(e,t),t.isInput){if(t.$selected&&!t.$selected.is("textarea, select"))return void e.preventDefault();break}return void(void 0!==t.$selected&&null!==t.$selected&&t.$selected.trigger("mouseup"));case 32:case 33:case 34:return void f.keyStop(e,t);case 27:return f.keyStop(e,t),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("contextmenu:hide"));default:var c=String.fromCharCode(e.keyCode).toUpperCase();if(t.accesskeys&&t.accesskeys[c])return void t.accesskeys[c].$node.trigger(t.accesskeys[c].$menu?"contextmenu:focus":"mouseup")}e.stopPropagation(),void 0!==t.$selected&&null!==t.$selected&&t.$selected.trigger(e)}},prevItem:function(t){t.stopPropagation();var n=e(this).data("contextMenu")||{},a=e(this).data("contextMenuRoot")||{};if(n.$selected){var o=n.$selected;n=n.$selected.parent().data("contextMenu")||{},n.$selected=o}for(var s=n.$menu.children(),i=n.$selected&&n.$selected.prev().length?n.$selected.prev():s.last(),c=i;i.hasClass(a.classNames.disabled)||i.hasClass(a.classNames.notSelectable)||i.is(":hidden");)if(i=i.prev().length?i.prev():s.last(),i.is(c))return;n.$selected&&f.itemMouseleave.call(n.$selected.get(0),t),f.itemMouseenter.call(i.get(0),t);var r=i.find("input, textarea, select");r.length&&r.focus()},nextItem:function(t){t.stopPropagation();var n=e(this).data("contextMenu")||{},a=e(this).data("contextMenuRoot")||{};if(n.$selected){var o=n.$selected;n=n.$selected.parent().data("contextMenu")||{},n.$selected=o}for(var s=n.$menu.children(),i=n.$selected&&n.$selected.next().length?n.$selected.next():s.first(),c=i;i.hasClass(a.classNames.disabled)||i.hasClass(a.classNames.notSelectable)||i.is(":hidden");)if(i=i.next().length?i.next():s.first(),i.is(c))return;n.$selected&&f.itemMouseleave.call(n.$selected.get(0),t),f.itemMouseenter.call(i.get(0),t);var r=i.find("input, textarea, select");r.length&&r.focus()},focusInput:function(){var t=e(this).closest(".context-menu-item"),n=t.data(),a=n.contextMenu,o=n.contextMenuRoot;o.$selected=a.$selected=t,o.isInput=a.isInput=!0},blurInput:function(){var t=e(this).closest(".context-menu-item"),n=t.data(),a=n.contextMenu;n.contextMenuRoot.isInput=a.isInput=!1},menuMouseenter:function(){e(this).data().contextMenuRoot.hovering=!0},menuMouseleave:function(t){var n=e(this).data().contextMenuRoot;n.$layer&&n.$layer.is(t.relatedTarget)&&(n.hovering=!1)},itemMouseenter:function(t){var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;if(s.hovering=!0,t&&s.$layer&&s.$layer.is(t.relatedTarget)&&(t.preventDefault(),t.stopImmediatePropagation()),(o.$menu?o:s).$menu.children("."+s.classNames.hover).trigger("contextmenu:blur").children(".hover").trigger("contextmenu:blur"),n.hasClass(s.classNames.disabled)||n.hasClass(s.classNames.notSelectable))return void(o.$selected=null);n.trigger("contextmenu:focus")},itemMouseleave:function(t){var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;if(s!==o&&s.$layer&&s.$layer.is(t.relatedTarget))return void 0!==s.$selected&&null!==s.$selected&&s.$selected.trigger("contextmenu:blur"),t.preventDefault(),t.stopImmediatePropagation(),void(s.$selected=o.$selected=o.$node);o&&o.$menu&&o.$menu.hasClass("context-menu-visible")||n.trigger("contextmenu:blur")},itemClick:function(t){var n,a=e(this),o=a.data(),s=o.contextMenu,i=o.contextMenuRoot,c=o.contextMenuKey;if(!(!s.items[c]||a.is("."+i.classNames.disabled+", .context-menu-separator, ."+i.classNames.notSelectable)||a.is(".context-menu-submenu")&&!1===i.selectableSubMenu)){if(t.preventDefault(),t.stopImmediatePropagation(),e.isFunction(s.callbacks[c])&&Object.prototype.hasOwnProperty.call(s.callbacks,c))n=s.callbacks[c];else{if(!e.isFunction(i.callback))return;n=i.callback}!1!==n.call(i.$trigger,c,i,t)?i.$menu.trigger("contextmenu:hide"):i.$menu.parent().length&&h.update.call(i.$trigger,i)}},inputClick:function(e){e.stopImmediatePropagation()},hideMenu:function(t,n){var a=e(this).data("contextMenuRoot");h.hide.call(a.$trigger,a,n&&n.force)},focusItem:function(t){t.stopPropagation();var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;n.hasClass(s.classNames.disabled)||n.hasClass(s.classNames.notSelectable)||(n.addClass([s.classNames.hover,s.classNames.visible].join(" ")).parent().find(".context-menu-item").not(n).removeClass(s.classNames.visible).filter("."+s.classNames.hover).trigger("contextmenu:blur"),o.$selected=s.$selected=n,o&&o.$node&&o.$node.hasClass("context-menu-submenu")&&o.$node.addClass(s.classNames.hover),o.$node&&s.positionSubmenu.call(o.$node,o.$menu,s))},blurItem:function(t){t.stopPropagation();var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;o.autoHide&&n.removeClass(s.classNames.visible),n.removeClass(s.classNames.hover),o.$selected=null}},h={show:function(t,n,a){var s=e(this),i={};if(e("#context-menu-layer").trigger("mousedown"),t.$trigger=s,!1===t.events.show.call(s,t))return void(o=null);if(h.update.call(s,t),t.position.call(s,t,n,a),t.zIndex){var c=t.zIndex;"function"==typeof t.zIndex&&(c=t.zIndex.call(s,t)),i.zIndex=p(s)+c}h.layer.call(t.$menu,t,i.zIndex),t.$menu.find("ul").css("zIndex",i.zIndex+1),t.$menu.css(i)[t.animation.show](t.animation.duration,function(){s.trigger("contextmenu:visible"),h.activated(t,t.$menu),t.events.activated()}),s.data("contextMenu",t).addClass("context-menu-active"),e(document).off("keydown.contextMenu").on("keydown.contextMenu",f.key),t.autoHide&&e(document).on("mousemove.contextMenuAutoHide",function(e){var n=s.offset();n.right=n.left+s.outerWidth(),n.bottom=n.top+s.outerHeight(),!t.$layer||t.hovering||e.pageX>=n.left&&e.pageX<=n.right&&e.pageY>=n.top&&e.pageY<=n.bottom||setTimeout(function(){t.hovering||null===t.$menu||void 0===t.$menu||t.$menu.trigger("contextmenu:hide")},50)})},hide:function(t,n){var a=e(this);if(t||(t=a.data("contextMenu")||{}),n||!t.events||!1!==t.events.hide.call(a,t)){if(a.removeData("contextMenu").removeClass("context-menu-active"),t.$layer){setTimeout(function(e){return function(){e.remove()}}(t.$layer),10);try{delete t.$layer}catch(e){t.$layer=null}}o=null,t.$menu.find("."+t.classNames.hover).trigger("contextmenu:blur"),t.$selected=null,t.$menu.find("."+t.classNames.visible).removeClass(t.classNames.visible),e(document).off(".contextMenuAutoHide").off("keydown.contextMenu"),t.$menu&&t.$menu[t.animation.hide](t.animation.duration,function(){t.build&&(t.$menu.remove(),e.each(t,function(e){switch(e){case"ns":case"selector":case"build":case"trigger":return!0;default:t[e]=void 0;try{delete t[e]}catch(e){}return!0}})),setTimeout(function(){a.trigger("contextmenu:hidden")},10)})}},create:function(n,a){function o(t){var n=e("");if(t._accesskey)t._beforeAccesskey&&n.append(document.createTextNode(t._beforeAccesskey)),e("").addClass("context-menu-accesskey").text(t._accesskey).appendTo(n),t._afterAccesskey&&n.append(document.createTextNode(t._afterAccesskey));else if(t.isHtmlName){if(void 0!==t.accesskey)throw new Error("accesskeys are not compatible with HTML names and cannot be used together in the same item");n.html(t.name)}else n.text(t.name);return n}void 0===a&&(a=n),n.$menu=e('
          ').addClass(n.className||"").data({contextMenu:n,contextMenuRoot:a}),e.each(["callbacks","commands","inputs"],function(e,t){n[t]={},a[t]||(a[t]={})}),a.accesskeys||(a.accesskeys={}),e.each(n.items,function(s,i){var c=e('
        • ').addClass(i.className||""),r=null,l=null;if(c.on("click",e.noop),"string"!=typeof i&&"cm_separator"!==i.type||(i={type:"cm_seperator"}),i.$node=c.data({contextMenu:n,contextMenuRoot:a,contextMenuKey:s}),void 0!==i.accesskey)for(var d,m=t(i.accesskey),p=0;d=m[p];p++)if(!a.accesskeys[d]){a.accesskeys[d]=i;var v=i.name.match(new RegExp("^(.*?)("+d+")(.*)$","i"));v&&(i._beforeAccesskey=v[1],i._accesskey=v[2],i._afterAccesskey=v[3]);break}if(i.type&&u[i.type])u[i.type].call(c,i,n,a),e.each([n,a],function(t,a){a.commands[s]=i,!e.isFunction(i.callback)||void 0!==a.callbacks[s]&&void 0!==n.type||(a.callbacks[s]=i.callback)});else{switch("cm_seperator"===i.type?c.addClass("context-menu-separator "+a.classNames.notSelectable):"html"===i.type?c.addClass("context-menu-html "+a.classNames.notSelectable):"sub"===i.type||(i.type?(r=e("").appendTo(c),o(i).appendTo(r),c.addClass("context-menu-input"),n.hasTypes=!0,e.each([n,a],function(e,t){t.commands[s]=i,t.inputs[s]=i})):i.items&&(i.type="sub")),i.type){case"cm_seperator":break;case"text":l=e('').attr("name","context-menu-input-"+s).val(i.value||"").appendTo(r);break;case"textarea":l=e('').attr("name","context-menu-input-"+s).val(i.value||"").appendTo(r),i.height&&l.height(i.height);break;case"checkbox":l=e('').attr("name","context-menu-input-"+s).val(i.value||"").prop("checked",!!i.selected).prependTo(r);break;case"radio":l=e('').attr("name","context-menu-input-"+i.radio).val(i.value||"").prop("checked",!!i.selected).prependTo(r);break;case"select":l=e('').attr("name","context-menu-input-"+s).appendTo(r),i.options&&(e.each(i.options,function(t,n){e("").val(t).text(n).appendTo(l)}),l.val(i.selected));break;case"sub":o(i).appendTo(c),i.appendTo=i.$node,c.data("contextMenu",i).addClass("context-menu-submenu"),i.callback=null,"function"==typeof i.items.then?h.processPromises(i,a,i.items):h.create(i,a);break;case"html":e(i.html).appendTo(c);break;default:e.each([n,a],function(t,a){a.commands[s]=i,!e.isFunction(i.callback)||void 0!==a.callbacks[s]&&void 0!==n.type||(a.callbacks[s]=i.callback)}),o(i).appendTo(c)}i.type&&"sub"!==i.type&&"html"!==i.type&&"cm_seperator"!==i.type&&(l.on("focus",f.focusInput).on("blur",f.blurInput),i.events&&l.on(i.events,n)),i.icon&&(e.isFunction(i.icon)?i._icon=i.icon.call(this,this,c,s,i):"string"==typeof i.icon&&"fa-"===i.icon.substring(0,3)?i._icon=a.classNames.icon+" "+a.classNames.icon+"--fa fa "+i.icon:i._icon=a.classNames.icon+" "+a.classNames.icon+"-"+i.icon,c.addClass(i._icon))}i.$input=l,i.$label=r,c.appendTo(n.$menu),!n.hasTypes&&e.support.eventSelectstart&&c.on("selectstart.disableTextSelect",f.abortevent)}),n.$node||n.$menu.css("display","none").addClass("context-menu-root"),n.$menu.appendTo(n.appendTo||document.body)},resize:function(t,n){var a;t.css({position:"absolute",display:"block"}),t.data("width",(a=t.get(0)).getBoundingClientRect?Math.ceil(a.getBoundingClientRect().width):t.outerWidth()+1),t.css({position:"static",minWidth:"0px",maxWidth:"100000px"}),t.find("> li > ul").each(function(){h.resize(e(this),!0)}),n||t.find("ul").addBack().css({position:"",display:"",minWidth:"",maxWidth:""}).outerWidth(function(){return e(this).data("width")})},update:function(t,n){var a=this;void 0===n&&(n=t,h.resize(t.$menu)),t.$menu.children().each(function(){var o,s=e(this),i=s.data("contextMenuKey"),c=t.items[i],r=e.isFunction(c.disabled)&&c.disabled.call(a,i,n)||!0===c.disabled;if(o=e.isFunction(c.visible)?c.visible.call(a,i,n):void 0===c.visible||!0===c.visible,s[o?"show":"hide"](),s[r?"addClass":"removeClass"](n.classNames.disabled),e.isFunction(c.icon)&&(s.removeClass(c._icon),c._icon=c.icon.call(this,a,s,i,c),s.addClass(c._icon)),c.type)switch(s.find("input, select, textarea").prop("disabled",r),c.type){case"text":case"textarea":c.$input.val(c.value||"");break;case"checkbox":case"radio":c.$input.val(c.value||"").prop("checked",!!c.selected);break;case"select":c.$input.val((0===c.selected?"0":c.selected)||"")}c.$menu&&h.update.call(a,c,n)})},layer:function(t,n){var a=t.$layer=e('
          ').css({height:i.height(),width:i.width(),display:"block",position:"fixed","z-index":n,top:0,left:0,opacity:0,filter:"alpha(opacity=0)","background-color":"#000"}).data("contextMenuRoot",t).insertBefore(this).on("contextmenu",f.abortevent).on("mousedown",f.layerClick);return void 0===document.body.style.maxWidth&&a.css({position:"absolute",height:e(document).height()}),a},processPromises:function(e,t,n){function a(e,t,n){void 0===n&&o(void 0),s(e,t,n)}function o(e,t,n){void 0===n?(n={error:{name:"No items and no error item",icon:"context-menu-icon context-menu-icon-quit"}},window.console&&(console.error||console.log).call(console,'When you reject a promise, provide an "items" object, equal to normal sub-menu items')):"string"==typeof n&&(n={error:{name:n}}),s(e,t,n)}function s(e,t,n){void 0!==t.$menu&&t.$menu.is(":visible")&&(e.$node.removeClass(t.classNames.iconLoadingClass),e.items=n,h.create(e,t,!0),h.update(e,t),t.positionSubmenu.call(e.$node,e.$menu,t))}e.$node.addClass(t.classNames.iconLoadingClass),n.then(a.bind(this,e,t),o.bind(this,e,t))},activated:function(t,n){if(t.hasOverboundaryScroll){var a=n,o=e(window),s=a.offset(),i=o.height(),c=o.width(),r=o.scrollTop(),l=a.outerHeight(),u=a.outerWidth();if(l>i?a.css({height:i-(2*parseInt(a.css("padding-top"))+2*parseInt(a.css("margin-top")))+"px","overflow-x":"hidden","overflow-y":"auto",top:r+"px"}):s.topr+i&&a.css({top:s.top-Math.abs(r+i-(s.top+l))-(2*parseInt(a.css("padding-top"))+2*parseInt(a.css("margin-top")))+"px"}),s.left+u>c){var d=s.left-Math.abs(s.left+u-c),m=a.parents("ul.context-menu-list").first();m.length&&d<=m.offset().left+m.outerWidth()&&d>=m.offset().left?a.css({left:m.offset().left-a.outerWidth()+"px"}):a.css({left:s.left-Math.abs(s.left+u-c)+"px"})}}}};e.fn.contextMenu=function(t){var n=this,a=t;if(this.length>0)if(void 0===t)this.first().trigger("contextmenu");else if(void 0!==t.x&&void 0!==t.y)this.first().trigger(e.Event("contextmenu",{pageX:t.x,pageY:t.y,mouseButton:t.button}));else if("hide"===t){var o=this.first().data("contextMenu")?this.first().data("contextMenu").$menu:null;o&&o.trigger("contextmenu:hide")}else"destroy"===t?e.contextMenu("destroy",{context:this}):e.isPlainObject(t)?(t.context=this,e.contextMenu("create",t)):t?this.removeClass("context-menu-disabled"):t||this.addClass("context-menu-disabled");else e.each(l,function(){this.selector===n.selector&&(a.data=this,e.extend(a.data,{trigger:"demand"}))}),f.contextmenu.call(a.target,a);return this},e.contextMenu=function(t,n){"string"!=typeof t&&(n=t,t="create"),"string"==typeof n?n={selector:n}:void 0===n&&(n={});var a=e.extend(!0,{},d,n||{}),o=e(document),i=o,u=!1;switch(a.context&&a.context.length?(i=e(a.context).first(),a.context=i.get(0),u=!e(a.context).is(document)):a.context=document,t){case"update":if(u)h.update(i);else for(var m in l)l.hasOwnProperty(m)&&h.update(l[m]);break;case"create":if(!a.selector)throw new Error("No selector specified");if(a.selector.match(/.context-menu-(list|item|input)($|\s)/))throw new Error('Cannot bind to selector "'+a.selector+'" as it contains a reserved className');if(!a.build&&(!a.items||e.isEmptyObject(a.items)))throw new Error("No Items specified");if(c++,a.ns=".contextMenu"+c,u||(r[a.selector]=a.ns),l[a.ns]=a,a.trigger||(a.trigger="right"),!s){var p="click"===a.itemClickEvent?"click.contextMenu":"mouseup.contextMenu",v={"contextmenu:focus.contextMenu":f.focusItem,"contextmenu:blur.contextMenu":f.blurItem,"contextmenu.contextMenu":f.abortevent,"mouseenter.contextMenu":f.itemMouseenter,"mouseleave.contextMenu":f.itemMouseleave};v[p]=f.itemClick,o.on({"contextmenu:hide.contextMenu":f.hideMenu,"prevcommand.contextMenu":f.prevItem,"nextcommand.contextMenu":f.nextItem,"contextmenu.contextMenu":f.abortevent,"mouseenter.contextMenu":f.menuMouseenter,"mouseleave.contextMenu":f.menuMouseleave},".context-menu-list").on("mouseup.contextMenu",".context-menu-input",f.inputClick).on(v,".context-menu-item"),s=!0}switch(i.on("contextmenu"+a.ns,a.selector,a,f.contextmenu),u&&i.on("remove"+a.ns,function(){e(this).contextMenu("destroy")}),a.trigger){case"hover":i.on("mouseenter"+a.ns,a.selector,a,f.mouseenter).on("mouseleave"+a.ns,a.selector,a,f.mouseleave);break;case"left":i.on("click"+a.ns,a.selector,a,f.click);break;case"touchstart":i.on("touchstart"+a.ns,a.selector,a,f.click)}a.build||h.create(a);break;case"destroy":var x;if(u){var g=a.context;e.each(l,function(t,n){if(!n)return!0;if(!e(g).is(n.selector))return!0;x=e(".context-menu-list").filter(":visible"),x.length&&x.data().contextMenuRoot.$trigger.is(e(n.context).find(n.selector))&&x.trigger("contextmenu:hide",{force:!0});try{l[n.ns].$menu&&l[n.ns].$menu.remove(),delete l[n.ns]}catch(e){l[n.ns]=null}return e(n.context).off(n.ns),!0})}else if(a.selector){if(r[a.selector]){x=e(".context-menu-list").filter(":visible"),x.length&&x.data().contextMenuRoot.$trigger.is(a.selector)&&x.trigger("contextmenu:hide",{force:!0});try{l[r[a.selector]].$menu&&l[r[a.selector]].$menu.remove(),delete l[r[a.selector]]}catch(e){l[r[a.selector]]=null}o.off(r[a.selector])}}else o.off(".contextMenu .contextMenuAutoHide"),e.each(l,function(t,n){e(n.context).off(n.ns)}),r={},l={},c=0,s=!1,e("#context-menu-layer, .context-menu-list").remove();break;case"html5":(!e.support.htmlCommand&&!e.support.htmlMenuitem||"boolean"==typeof n&&n)&&e('menu[type="context"]').each(function(){this.id&&e.contextMenu({selector:"[contextmenu="+this.id+"]",items:e.contextMenu.fromMenu(this)})}).css("display","none");break;default:throw new Error('Unknown operation "'+t+'"')}return this},e.contextMenu.setInputValues=function(t,n){void 0===n&&(n={}),e.each(t.inputs,function(e,t){switch(t.type){case"text":case"textarea":t.value=n[e]||"";break;case"checkbox":t.selected=!!n[e];break;case"radio":t.selected=(n[t.radio]||"")===t.value;break;case"select":t.selected=n[e]||""}})},e.contextMenu.getInputValues=function(t,n){return void 0===n&&(n={}),e.each(t.inputs,function(e,t){switch(t.type){case"text":case"textarea":case"select":n[e]=t.$input.val();break;case"checkbox":n[e]=t.$input.prop("checked");break;case"radio":t.$input.prop("checked")&&(n[t.radio]=t.value)}}),n},e.contextMenu.fromMenu=function(t){var n=e(t),o={};return a(o,n.children()),o},e.contextMenu.defaults=d,e.contextMenu.types=u,e.contextMenu.handle=f,e.contextMenu.op=h,e.contextMenu.menus=l}); //# sourceMappingURL=jquery.contextMenu.min.js.map diff --git a/dist/jquery.contextMenu.min.js.map b/dist/jquery.contextMenu.min.js.map index aeac5979..bf61c055 100644 --- a/dist/jquery.contextMenu.min.js.map +++ b/dist/jquery.contextMenu.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["jquery.contextMenu.min.js"],"names":["factory","define","amd","exports","require","jQuery","$","splitAccesskey","val","k","t","split","keys","i","charAt","toUpperCase","push","inputLabel","node","id","name","menuChildren","items","$children","counter","each","label","item","$node","this","nodeName","toLowerCase","find","length","text","children","first","get","attr","disabled","callback","click","undefined","icon","type","selected","radio","value","options","html","clone","support","htmlMenuitem","window","htmlCommand","eventSelectstart","document","documentElement","ui","widget","cleanData","orig","elems","events","elem","_data","remove","triggerHandler","e","$currentTrigger","initialized","$win","namespaces","menus","types","defaults","selector","appendTo","trigger","autoHide","delay","reposition","selectableSubMenu","classNames","hover","visible","notSelectable","iconEdit","iconCut","iconCopy","iconPaste","iconDelete","iconAdd","iconQuit","iconLoadingClass","determinePosition","$menu","position","css","my","at","of","offset","collision","top","outerHeight","left","outerWidth","opt","x","y","call","offsetParentOffset","offsetParent","bottom","scrollTop","height","right","scrollLeft","width","positionSubmenu","zIndex","animation","duration","show","hide","noop","hoveract","timer","pageX","pageY","zindex","$t","zin","$tt","Math","max","parseInt","parent","indexOf","prop","handle","abortevent","preventDefault","stopImmediatePropagation","contextmenu","$this","data","originalEvent","mouseButton","hasClass","build","built","extend","isEmptyObject","console","error","log","Error","$trigger","op","create","showMenu","hasOwnProperty","isFunction","currentTarget","Event","mousedown","is","button","mouseup","removeData","mouseenter","$related","relatedTarget","$document","closest","on","mousemove","setTimeout","off","mouseleave","clearTimeout","layerClick","target","root","$window","triggerAction","elementFromPoint","$layer","isContentEditable","range","createRange","sel","getSelection","selectNode","collapse","removeAllRanges","addRange","one","contextMenu","keyStop","isInput","stopPropagation","key","targetZIndex","getZIndexOfTriggerTarget","style","parentElement","keyCode","shiftKey","$selected","blur","$parent","itemdata","String","fromCharCode","accesskeys","prevItem","$s","$prev","prev","last","$round","itemMouseleave","itemMouseenter","$input","focus","nextItem","$next","next","focusInput","contextMenuRoot","blurInput","menuMouseenter","hovering","menuMouseleave","itemClick","contextMenuKey","callbacks","Object","prototype","update","inputClick","hideMenu","force","focusItem","addClass","join","not","removeClass","filter","blurItem","additionalZValue","layer","pos","createNameNode","$name","_accesskey","_beforeAccesskey","append","createTextNode","_afterAccesskey","isHtmlName","accesskey","className","$label","ak","aks","matched","match","RegExp","commands","hasTypes","inputs","prependTo","then","processPromises","_icon","substring","body","resize","nested","domMenu","display","getBoundingClientRect","ceil","minWidth","maxWidth","addBack","$item","z-index","opacity","background-color","insertBefore","promise","completedPromise","errorPromise","finishPromiseProcess","errorItem","bind","fn","operation","$o","context","isPlainObject","o","$context","_hasContext","ns","itemClickEvent","contextMenuItemObj","contextmenu:focus.contextMenu","contextmenu:blur.contextMenu","contextmenu.contextMenu","mouseenter.contextMenu","mouseleave.contextMenu","contextmenu:hide.contextMenu","prevcommand.contextMenu","nextcommand.contextMenu","$visibleMenu","fromMenu","setInputValues","getInputValues","element"],"mappings":"CAkBA,SAAWA,GACe,kBAAXC,SAAyBA,OAAOC,IAEvCD,QAAQ,UAAWD,GAGnBA,EAF0B,gBAAZG,SAENC,QAAQ,UAGRC,SAEb,SAAUC,GAET,YA89CA,SAASC,GAAeC,GAIpB,IAAK,GAAWC,GAHZC,EAAIF,EAAIG,MAAM,OACdC,KAEKC,EAAI,EAAMJ,EAAIC,EAAEG,GAAIA,IACzBJ,EAAIA,EAAEK,OAAO,GAAGC,cAGhBH,EAAKI,KAAKP,EAGd,OAAOG,GA0TX,QAASK,GAAWC,GAChB,MAAQA,GAAKC,IAAMb,EAAE,cAAgBY,EAAKC,GAAK,MAAMX,OAAUU,EAAKE,KAIxE,QAASC,GAAaC,EAAOC,EAAWC,GA0KpC,MAzKKA,KACDA,EAAU,GAGdD,EAAUE,KAAK,WACX,GAGIC,GACAC,EAJAC,EAAQtB,EAAEuB,MACVX,EAAOW,KACPC,EAAWD,KAAKC,SAASC,aAoB7B,QAfiB,UAAbD,GAAwBF,EAAMI,KAAK,2BAA2BC,SAC9DP,EAAQE,EAAMM,OACdN,EAAQA,EAAMO,WAAWC,QACzBlB,EAAOU,EAAMS,IAAI,GACjBP,EAAWZ,EAAKY,SAASC,eAWrBD,GAEJ,IAAK,OACDH,GAAQ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AAK,SACDpB,EAAKkB,SAAWsG,EAAKyD,IAAQ,OAO7CtM,EAAEkM,YAAY2H,eAAiB,SAAUvN,EAAKuC,GAyB1C,WAxBoB,KAATA,IACPA,MAGJ7I,EAAEmB,KAAKmF,EAAIsK,OAAQ,SAAUtE,EAAKjL,GAC9B,OAAQA,EAAKiB,MACT,IAAK,OACL,IAAK,WACL,IAAK,SACDuG,EAAKyD,GAAOjL,EAAKuM,OAAO1N,KACxB,MAEJ,KAAK,WACD2I,EAAKyD,GAAOjL,EAAKuM,OAAOtF,KAAK,UAC7B,MAEJ,KAAK,QACGjH,EAAKuM,OAAOtF,KAAK,aACjBO,EAAKxH,EAAKmB,OAASnB,EAAKoB,UAMjCoG,GAuLX7I,EAAEkM,YAAYyH,SAAW,SAAUG,GAC/B,GAAIlL,GAAQ5I,EAAE8T,GACV9S,IAIJ,OAFAD,GAAaC,EAAO4H,EAAM/G,YAEnBb,GAIXhB,EAAEkM,YAAY7H,SAAWA,EACzBrE,EAAEkM,YAAY9H,MAAQA,EAEtBpE,EAAEkM,YAAY3D,OAASA,EACvBvI,EAAEkM,YAAYxC,GAAKA,EACnB1J,EAAEkM,YAAY/H,MAAQA","file":"jquery.contextMenu.min.js","sourcesContent":["!function(e){\"function\"==typeof define&&define.amd?define([\"jquery\"],e):e(\"object\"==typeof exports?require(\"jquery\"):jQuery)}(function(e){\"use strict\";function t(e){for(var t,n=e.split(/\\s+/),a=[],o=0;t=n[o];o++)t=t.charAt(0).toUpperCase(),a.push(t);return a}function n(t){return t.id&&e('label[for=\"'+t.id+'\"]').val()||t.name}function a(t,o,s){return s||(s=0),o.each(function(){var o,i,c=e(this),l=this,r=this.nodeName.toLowerCase();switch(\"label\"===r&&c.find(\"input, textarea, select\").length&&(o=c.text(),c=c.children().first(),l=c.get(0),r=l.nodeName.toLowerCase()),r){case\"menu\":i={name:c.attr(\"label\"),items:{}},s=a(i.items,c.children(),s);break;case\"a\":case\"button\":i={name:c.text(),disabled:!!c.attr(\"disabled\"),callback:function(){return function(){c.get(0).click()}}()};break;case\"menuitem\":case\"command\":switch(c.attr(\"type\")){case void 0:case\"command\":case\"menuitem\":i={name:c.attr(\"label\"),disabled:!!c.attr(\"disabled\"),icon:c.attr(\"icon\"),callback:function(){return function(){c.get(0).click()}}()};break;case\"checkbox\":i={type:\"checkbox\",disabled:!!c.attr(\"disabled\"),name:c.attr(\"label\"),selected:!!c.attr(\"checked\")};break;case\"radio\":i={type:\"radio\",disabled:!!c.attr(\"disabled\"),name:c.attr(\"label\"),radio:c.attr(\"radiogroup\"),value:c.attr(\"id\"),selected:!!c.attr(\"checked\")};break;default:i=void 0}break;case\"hr\":i=\"-------\";break;case\"input\":switch(c.attr(\"type\")){case\"text\":i={type:\"text\",name:o||n(l),disabled:!!c.attr(\"disabled\"),value:c.val()};break;case\"checkbox\":i={type:\"checkbox\",name:o||n(l),disabled:!!c.attr(\"disabled\"),selected:!!c.attr(\"checked\")};break;case\"radio\":i={type:\"radio\",name:o||n(l),disabled:!!c.attr(\"disabled\"),radio:!!c.attr(\"name\"),value:c.val(),selected:!!c.attr(\"checked\")};break;default:i=void 0}break;case\"select\":i={type:\"select\",name:o||n(l),disabled:!!c.attr(\"disabled\"),selected:c.val(),options:{}},c.children().each(function(){i.options[this.value]=e(this).text()});break;case\"textarea\":i={type:\"textarea\",name:o||n(l),disabled:!!c.attr(\"disabled\"),value:c.val()};break;case\"label\":break;default:i={type:\"html\",html:c.clone(!0)}}i&&(s++,t[\"key\"+s]=i)}),s}e.support.htmlMenuitem=\"HTMLMenuItemElement\"in window,e.support.htmlCommand=\"HTMLCommandElement\"in window,e.support.eventSelectstart=\"onselectstart\"in document.documentElement,e.ui&&e.widget||(e.cleanData=function(t){return function(n){var a,o,s;for(s=0;null!=n[s];s++){o=n[s];try{a=e._data(o,\"events\"),a&&a.remove&&e(o).triggerHandler(\"remove\")}catch(e){}}t(n)}}(e.cleanData));var o=null,s=!1,i=e(window),c=0,l={},r={},u={},d={selector:null,appendTo:null,trigger:\"right\",autoHide:!1,delay:200,reposition:!0,selectableSubMenu:!1,classNames:{hover:\"context-menu-hover\",disabled:\"context-menu-disabled\",visible:\"context-menu-visible\",notSelectable:\"context-menu-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\",iconLoadingClass:\"context-menu-icon-loading\"},determinePosition:function(t){if(e.ui&&e.ui.position)t.css(\"display\",\"block\").position({my:\"center top\",at:\"center bottom\",of:this,offset:\"0 5\",collision:\"fit\"}).css(\"display\",\"none\");else{var n=this.offset();n.top+=this.outerHeight(),n.left+=this.outerWidth()/2-t.outerWidth()/2,t.css(n)}},position:function(e,t,n){var a;if(!t&&!n)return void e.determinePosition.call(this,e.$menu);if(\"maintain\"===t&&\"maintain\"===n)a=e.$menu.position();else{var o=e.$menu.offsetParent().offset();a={top:n-o.top,left:t-o.left}}var s=i.scrollTop()+i.height(),c=i.scrollLeft()+i.width(),l=e.$menu.outerHeight(),r=e.$menu.outerWidth();a.top+l>s&&(a.top-=l),a.top<0&&(a.top=0),a.left+r>c&&(a.left-=r),a.left<0&&(a.left=0),e.$menu.css(a)},positionSubmenu:function(t){if(void 0!==t)if(e.ui&&e.ui.position)t.css(\"display\",\"block\").position({my:\"left top-5\",at:\"right top\",of:this,collision:\"flipfit fit\"}).css(\"display\",\"\");else{var n={top:-9,left:this.outerWidth()-5};t.css(n)}},zIndex:1,animation:{duration:50,show:\"slideDown\",hide:\"slideUp\"},events:{show:e.noop,hide:e.noop},callback:null,items:{}},m={timer:null,pageX:null,pageY:null},p=function(e){for(var t=0,n=e;;)if(t=Math.max(t,parseInt(n.css(\"z-index\"),10)||0),!(n=n.parent())||!n.length||\"html body\".indexOf(n.prop(\"nodeName\").toLowerCase())>-1)break;return t},f={abortevent:function(e){e.preventDefault(),e.stopImmediatePropagation()},contextmenu:function(t){var n=e(this);if(\"right\"===t.data.trigger&&(t.preventDefault(),t.stopImmediatePropagation()),!(\"right\"!==t.data.trigger&&\"demand\"!==t.data.trigger&&t.originalEvent||!(void 0===t.mouseButton||!t.data||\"left\"===t.data.trigger&&0===t.mouseButton||\"right\"===t.data.trigger&&2===t.mouseButton)||n.hasClass(\"context-menu-active\")||n.hasClass(\"context-menu-disabled\"))){if(o=n,t.data.build){var a=t.data.build(o,t);if(!1===a)return;if(t.data=e.extend(!0,{},d,t.data,a||{}),!t.data.items||e.isEmptyObject(t.data.items))throw window.console&&(console.error||console.log).call(console,\"No items specified to show in contextMenu\"),new Error(\"No Items specified\");t.data.$trigger=o,h.create(t.data)}var s=!1;for(var i in t.data.items)if(t.data.items.hasOwnProperty(i)){var c;c=e.isFunction(t.data.items[i].visible)?t.data.items[i].visible.call(e(t.currentTarget),i,t.data):void 0===t.data.items[i]||!t.data.items[i].visible||!0===t.data.items[i].visible,c&&(s=!0)}s&&h.show.call(n,t.data,t.pageX,t.pageY)}},click:function(t){t.preventDefault(),t.stopImmediatePropagation(),e(this).trigger(e.Event(\"contextmenu\",{data:t.data,pageX:t.pageX,pageY:t.pageY}))},mousedown:function(t){var n=e(this);o&&o.length&&!o.is(n)&&o.data(\"contextMenu\").$menu.trigger(\"contextmenu:hide\"),2===t.button&&(o=n.data(\"contextMenuActive\",!0))},mouseup:function(t){var n=e(this);n.data(\"contextMenuActive\")&&o&&o.length&&o.is(n)&&!n.hasClass(\"context-menu-disabled\")&&(t.preventDefault(),t.stopImmediatePropagation(),o=n,n.trigger(e.Event(\"contextmenu\",{data:t.data,pageX:t.pageX,pageY:t.pageY}))),n.removeData(\"contextMenuActive\")},mouseenter:function(t){var n=e(this),a=e(t.relatedTarget),s=e(document);a.is(\".context-menu-list\")||a.closest(\".context-menu-list\").length||o&&o.length||(m.pageX=t.pageX,m.pageY=t.pageY,m.data=t.data,s.on(\"mousemove.contextMenuShow\",f.mousemove),m.timer=setTimeout(function(){m.timer=null,s.off(\"mousemove.contextMenuShow\"),o=n,n.trigger(e.Event(\"contextmenu\",{data:m.data,pageX:m.pageX,pageY:m.pageY}))},t.data.delay))},mousemove:function(e){m.pageX=e.pageX,m.pageY=e.pageY},mouseleave:function(t){var n=e(t.relatedTarget);if(!n.is(\".context-menu-list\")&&!n.closest(\".context-menu-list\").length){try{clearTimeout(m.timer)}catch(t){}m.timer=null}},layerClick:function(t){var n,a,o=e(this),s=o.data(\"contextMenuRoot\"),c=t.button,l=t.pageX,r=t.pageY;t.preventDefault(),setTimeout(function(){var o,u=\"left\"===s.trigger&&0===c||\"right\"===s.trigger&&2===c;if(document.elementFromPoint&&s.$layer){if(s.$layer.hide(),n=document.elementFromPoint(l-i.scrollLeft(),r-i.scrollTop()),n.isContentEditable){var d=document.createRange(),m=window.getSelection();d.selectNode(n),d.collapse(!0),m.removeAllRanges(),m.addRange(d)}e(n).trigger(t),s.$layer.show()}if(s.reposition&&u)if(document.elementFromPoint){if(s.$trigger.is(n))return void s.position.call(s.$trigger,s,l,r)}else if(a=s.$trigger.offset(),o=e(window),a.top+=o.scrollTop(),a.top<=t.pageY&&(a.left+=o.scrollLeft(),a.left<=t.pageX&&(a.bottom=a.top+s.$trigger.outerHeight(),a.bottom>=t.pageY&&(a.right=a.left+s.$trigger.outerWidth(),a.right>=t.pageX))))return void s.position.call(s.$trigger,s,l,r);n&&u&&s.$trigger.one(\"contextmenu:hidden\",function(){e(n).contextMenu({x:l,y:r,button:c})}),null!==s&&void 0!==s&&null!==s.$menu&&void 0!==s.$menu&&s.$menu.trigger(\"contextmenu:hide\")},50)},keyStop:function(e,t){t.isInput||e.preventDefault(),e.stopPropagation()},key:function(e){var t={};o&&(t=o.data(\"contextMenu\")||{}),void 0===t.zIndex&&(t.zIndex=0);var n=0,a=function(e){\"\"!==e.style.zIndex?n=e.style.zIndex:null!==e.offsetParent&&void 0!==e.offsetParent?a(e.offsetParent):null!==e.parentElement&&void 0!==e.parentElement&&a(e.parentElement)};if(a(e.target),!(t.$menu&&parseInt(n,10)>parseInt(t.$menu.css(\"zIndex\"),10))){switch(e.keyCode){case 9:case 38:if(f.keyStop(e,t),t.isInput){if(9===e.keyCode&&e.shiftKey)return e.preventDefault(),t.$selected&&t.$selected.find(\"input, textarea, select\").blur(),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger(\"prevcommand\"));if(38===e.keyCode&&\"checkbox\"===t.$selected.find(\"input, textarea, select\").prop(\"type\"))return void e.preventDefault()}else if(9!==e.keyCode||e.shiftKey)return void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger(\"prevcommand\"));break;case 40:if(f.keyStop(e,t),!t.isInput)return void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger(\"nextcommand\"));if(9===e.keyCode)return e.preventDefault(),t.$selected&&t.$selected.find(\"input, textarea, select\").blur(),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger(\"nextcommand\"));if(40===e.keyCode&&\"checkbox\"===t.$selected.find(\"input, textarea, select\").prop(\"type\"))return void e.preventDefault();break;case 37:if(f.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;if(!t.$selected.parent().hasClass(\"context-menu-root\")){var s=t.$selected.parent().parent();return t.$selected.trigger(\"contextmenu:blur\"),void(t.$selected=s)}break;case 39:if(f.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;var i=t.$selected.data(\"contextMenu\")||{};if(i.$menu&&t.$selected.hasClass(\"context-menu-submenu\"))return t.$selected=null,i.$selected=null,void i.$menu.trigger(\"nextcommand\");break;case 35:case 36:return t.$selected&&t.$selected.find(\"input, textarea, select\").length?void 0:((t.$selected&&t.$selected.parent()||t.$menu).children(\":not(.\"+t.classNames.disabled+\", .\"+t.classNames.notSelectable+\")\")[36===e.keyCode?\"first\":\"last\"]().trigger(\"contextmenu:focus\"),void e.preventDefault());case 13:if(f.keyStop(e,t),t.isInput){if(t.$selected&&!t.$selected.is(\"textarea, select\"))return void e.preventDefault();break}return void(void 0!==t.$selected&&null!==t.$selected&&t.$selected.trigger(\"mouseup\"));case 32:case 33:case 34:return void f.keyStop(e,t);case 27:return f.keyStop(e,t),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger(\"contextmenu:hide\"));default:var c=String.fromCharCode(e.keyCode).toUpperCase();if(t.accesskeys&&t.accesskeys[c])return void t.accesskeys[c].$node.trigger(t.accesskeys[c].$menu?\"contextmenu:focus\":\"mouseup\")}e.stopPropagation(),void 0!==t.$selected&&null!==t.$selected&&t.$selected.trigger(e)}},prevItem:function(t){t.stopPropagation();var n=e(this).data(\"contextMenu\")||{},a=e(this).data(\"contextMenuRoot\")||{};if(n.$selected){var o=n.$selected;n=n.$selected.parent().data(\"contextMenu\")||{},n.$selected=o}for(var s=n.$menu.children(),i=n.$selected&&n.$selected.prev().length?n.$selected.prev():s.last(),c=i;i.hasClass(a.classNames.disabled)||i.hasClass(a.classNames.notSelectable)||i.is(\":hidden\");)if(i=i.prev().length?i.prev():s.last(),i.is(c))return;n.$selected&&f.itemMouseleave.call(n.$selected.get(0),t),f.itemMouseenter.call(i.get(0),t);var l=i.find(\"input, textarea, select\");l.length&&l.focus()},nextItem:function(t){t.stopPropagation();var n=e(this).data(\"contextMenu\")||{},a=e(this).data(\"contextMenuRoot\")||{};if(n.$selected){var o=n.$selected;n=n.$selected.parent().data(\"contextMenu\")||{},n.$selected=o}for(var s=n.$menu.children(),i=n.$selected&&n.$selected.next().length?n.$selected.next():s.first(),c=i;i.hasClass(a.classNames.disabled)||i.hasClass(a.classNames.notSelectable)||i.is(\":hidden\");)if(i=i.next().length?i.next():s.first(),i.is(c))return;n.$selected&&f.itemMouseleave.call(n.$selected.get(0),t),f.itemMouseenter.call(i.get(0),t);var l=i.find(\"input, textarea, select\");l.length&&l.focus()},focusInput:function(){var t=e(this).closest(\".context-menu-item\"),n=t.data(),a=n.contextMenu,o=n.contextMenuRoot;o.$selected=a.$selected=t,o.isInput=a.isInput=!0},blurInput:function(){var t=e(this).closest(\".context-menu-item\"),n=t.data(),a=n.contextMenu;n.contextMenuRoot.isInput=a.isInput=!1},menuMouseenter:function(){e(this).data().contextMenuRoot.hovering=!0},menuMouseleave:function(t){var n=e(this).data().contextMenuRoot;n.$layer&&n.$layer.is(t.relatedTarget)&&(n.hovering=!1)},itemMouseenter:function(t){var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;if(s.hovering=!0,t&&s.$layer&&s.$layer.is(t.relatedTarget)&&(t.preventDefault(),t.stopImmediatePropagation()),(o.$menu?o:s).$menu.children(\".\"+s.classNames.hover).trigger(\"contextmenu:blur\").children(\".hover\").trigger(\"contextmenu:blur\"),n.hasClass(s.classNames.disabled)||n.hasClass(s.classNames.notSelectable))return void(o.$selected=null);n.trigger(\"contextmenu:focus\")},itemMouseleave:function(t){var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;if(s!==o&&s.$layer&&s.$layer.is(t.relatedTarget))return void 0!==s.$selected&&null!==s.$selected&&s.$selected.trigger(\"contextmenu:blur\"),t.preventDefault(),t.stopImmediatePropagation(),void(s.$selected=o.$selected=o.$node);o&&o.$menu&&o.$menu.hasClass(\"context-menu-visible\")||n.trigger(\"contextmenu:blur\")},itemClick:function(t){var n,a=e(this),o=a.data(),s=o.contextMenu,i=o.contextMenuRoot,c=o.contextMenuKey;if(!(!s.items[c]||a.is(\".\"+i.classNames.disabled+\", .context-menu-separator, .\"+i.classNames.notSelectable)||a.is(\".context-menu-submenu\")&&!1===i.selectableSubMenu)){if(t.preventDefault(),t.stopImmediatePropagation(),e.isFunction(s.callbacks[c])&&Object.prototype.hasOwnProperty.call(s.callbacks,c))n=s.callbacks[c];else{if(!e.isFunction(i.callback))return;n=i.callback}!1!==n.call(i.$trigger,c,i,t)?i.$menu.trigger(\"contextmenu:hide\"):i.$menu.parent().length&&h.update.call(i.$trigger,i)}},inputClick:function(e){e.stopImmediatePropagation()},hideMenu:function(t,n){var a=e(this).data(\"contextMenuRoot\");h.hide.call(a.$trigger,a,n&&n.force)},focusItem:function(t){t.stopPropagation();var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;n.hasClass(s.classNames.disabled)||n.hasClass(s.classNames.notSelectable)||(n.addClass([s.classNames.hover,s.classNames.visible].join(\" \")).parent().find(\".context-menu-item\").not(n).removeClass(s.classNames.visible).filter(\".\"+s.classNames.hover).trigger(\"contextmenu:blur\"),o.$selected=s.$selected=n,o&&o.$node&&o.$node.hasClass(\"context-menu-submenu\")&&o.$node.addClass(s.classNames.hover),o.$node&&s.positionSubmenu.call(o.$node,o.$menu))},blurItem:function(t){t.stopPropagation();var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;o.autoHide&&n.removeClass(s.classNames.visible),n.removeClass(s.classNames.hover),o.$selected=null}},h={show:function(t,n,a){var s=e(this),i={};if(e(\"#context-menu-layer\").trigger(\"mousedown\"),t.$trigger=s,!1===t.events.show.call(s,t))return void(o=null);if(h.update.call(s,t),t.position.call(s,t,n,a),t.zIndex){var c=t.zIndex;\"function\"==typeof t.zIndex&&(c=t.zIndex.call(s,t)),i.zIndex=p(s)+c}h.layer.call(t.$menu,t,i.zIndex),t.$menu.find(\"ul\").css(\"zIndex\",i.zIndex+1),t.$menu.css(i)[t.animation.show](t.animation.duration,function(){s.trigger(\"contextmenu:visible\")}),s.data(\"contextMenu\",t).addClass(\"context-menu-active\"),e(document).off(\"keydown.contextMenu\").on(\"keydown.contextMenu\",f.key),t.autoHide&&e(document).on(\"mousemove.contextMenuAutoHide\",function(e){var n=s.offset();n.right=n.left+s.outerWidth(),n.bottom=n.top+s.outerHeight(),!t.$layer||t.hovering||e.pageX>=n.left&&e.pageX<=n.right&&e.pageY>=n.top&&e.pageY<=n.bottom||setTimeout(function(){t.hovering||null===t.$menu||void 0===t.$menu||t.$menu.trigger(\"contextmenu:hide\")},50)})},hide:function(t,n){var a=e(this);if(t||(t=a.data(\"contextMenu\")||{}),n||!t.events||!1!==t.events.hide.call(a,t)){if(a.removeData(\"contextMenu\").removeClass(\"context-menu-active\"),t.$layer){setTimeout(function(e){return function(){e.remove()}}(t.$layer),10);try{delete t.$layer}catch(e){t.$layer=null}}o=null,t.$menu.find(\".\"+t.classNames.hover).trigger(\"contextmenu:blur\"),t.$selected=null,t.$menu.find(\".\"+t.classNames.visible).removeClass(t.classNames.visible),e(document).off(\".contextMenuAutoHide\").off(\"keydown.contextMenu\"),t.$menu&&t.$menu[t.animation.hide](t.animation.duration,function(){t.build&&(t.$menu.remove(),e.each(t,function(e){switch(e){case\"ns\":case\"selector\":case\"build\":case\"trigger\":return!0;default:t[e]=void 0;try{delete t[e]}catch(e){}return!0}})),setTimeout(function(){a.trigger(\"contextmenu:hidden\")},10)})}},create:function(n,a){function o(t){var n=e(\"\");if(t._accesskey)t._beforeAccesskey&&n.append(document.createTextNode(t._beforeAccesskey)),e(\"\").addClass(\"context-menu-accesskey\").text(t._accesskey).appendTo(n),t._afterAccesskey&&n.append(document.createTextNode(t._afterAccesskey));else if(t.isHtmlName){if(void 0!==t.accesskey)throw new Error(\"accesskeys are not compatible with HTML names and cannot be used together in the same item\");n.html(t.name)}else n.text(t.name);return n}void 0===a&&(a=n),n.$menu=e('
            ').addClass(n.className||\"\").data({contextMenu:n,contextMenuRoot:a}),e.each([\"callbacks\",\"commands\",\"inputs\"],function(e,t){n[t]={},a[t]||(a[t]={})}),a.accesskeys||(a.accesskeys={}),e.each(n.items,function(s,i){var c=e('
          • ').addClass(i.className||\"\"),l=null,r=null;if(c.on(\"click\",e.noop),\"string\"!=typeof i&&\"cm_separator\"!==i.type||(i={type:\"cm_seperator\"}),i.$node=c.data({contextMenu:n,contextMenuRoot:a,contextMenuKey:s}),void 0!==i.accesskey)for(var d,m=t(i.accesskey),p=0;d=m[p];p++)if(!a.accesskeys[d]){a.accesskeys[d]=i;var v=i.name.match(new RegExp(\"^(.*?)(\"+d+\")(.*)$\",\"i\"));v&&(i._beforeAccesskey=v[1],i._accesskey=v[2],i._afterAccesskey=v[3]);break}if(i.type&&u[i.type])u[i.type].call(c,i,n,a),e.each([n,a],function(t,a){a.commands[s]=i,!e.isFunction(i.callback)||void 0!==a.callbacks[s]&&void 0!==n.type||(a.callbacks[s]=i.callback)});else{switch(\"cm_seperator\"===i.type?c.addClass(\"context-menu-separator \"+a.classNames.notSelectable):\"html\"===i.type?c.addClass(\"context-menu-html \"+a.classNames.notSelectable):\"sub\"===i.type||(i.type?(l=e(\"\").appendTo(c),o(i).appendTo(l),c.addClass(\"context-menu-input\"),n.hasTypes=!0,e.each([n,a],function(e,t){t.commands[s]=i,t.inputs[s]=i})):i.items&&(i.type=\"sub\")),i.type){case\"cm_seperator\":break;case\"text\":r=e('').attr(\"name\",\"context-menu-input-\"+s).val(i.value||\"\").appendTo(l);break;case\"textarea\":r=e('').attr(\"name\",\"context-menu-input-\"+s).val(i.value||\"\").appendTo(l),i.height&&r.height(i.height);break;case\"checkbox\":r=e('').attr(\"name\",\"context-menu-input-\"+s).val(i.value||\"\").prop(\"checked\",!!i.selected).prependTo(l);break;case\"radio\":r=e('').attr(\"name\",\"context-menu-input-\"+i.radio).val(i.value||\"\").prop(\"checked\",!!i.selected).prependTo(l);break;case\"select\":r=e('').attr(\"name\",\"context-menu-input-\"+s).appendTo(l),i.options&&(e.each(i.options,function(t,n){e(\"\").val(t).text(n).appendTo(r)}),r.val(i.selected));break;case\"sub\":o(i).appendTo(c),i.appendTo=i.$node,c.data(\"contextMenu\",i).addClass(\"context-menu-submenu\"),i.callback=null,\"function\"==typeof i.items.then?h.processPromises(i,a,i.items):h.create(i,a);break;case\"html\":e(i.html).appendTo(c);break;default:e.each([n,a],function(t,a){a.commands[s]=i,!e.isFunction(i.callback)||void 0!==a.callbacks[s]&&void 0!==n.type||(a.callbacks[s]=i.callback)}),o(i).appendTo(c)}i.type&&\"sub\"!==i.type&&\"html\"!==i.type&&\"cm_seperator\"!==i.type&&(r.on(\"focus\",f.focusInput).on(\"blur\",f.blurInput),i.events&&r.on(i.events,n)),i.icon&&(e.isFunction(i.icon)?i._icon=i.icon.call(this,this,c,s,i):\"string\"==typeof i.icon&&\"fa-\"===i.icon.substring(0,3)?i._icon=a.classNames.icon+\" \"+a.classNames.icon+\"--fa fa \"+i.icon:i._icon=a.classNames.icon+\" \"+a.classNames.icon+\"-\"+i.icon,c.addClass(i._icon))}i.$input=r,i.$label=l,c.appendTo(n.$menu),!n.hasTypes&&e.support.eventSelectstart&&c.on(\"selectstart.disableTextSelect\",f.abortevent)}),n.$node||n.$menu.css(\"display\",\"none\").addClass(\"context-menu-root\"),n.$menu.appendTo(n.appendTo||document.body)},resize:function(t,n){var a;t.css({position:\"absolute\",display:\"block\"}),t.data(\"width\",(a=t.get(0)).getBoundingClientRect?Math.ceil(a.getBoundingClientRect().width):t.outerWidth()+1),t.css({position:\"static\",minWidth:\"0px\",maxWidth:\"100000px\"}),t.find(\"> li > ul\").each(function(){h.resize(e(this),!0)}),n||t.find(\"ul\").addBack().css({position:\"\",display:\"\",minWidth:\"\",maxWidth:\"\"}).outerWidth(function(){return e(this).data(\"width\")})},update:function(t,n){var a=this;void 0===n&&(n=t,h.resize(t.$menu)),t.$menu.children().each(function(){var o,s=e(this),i=s.data(\"contextMenuKey\"),c=t.items[i],l=e.isFunction(c.disabled)&&c.disabled.call(a,i,n)||!0===c.disabled;if(o=e.isFunction(c.visible)?c.visible.call(a,i,n):void 0===c.visible||!0===c.visible,s[o?\"show\":\"hide\"](),s[l?\"addClass\":\"removeClass\"](n.classNames.disabled),e.isFunction(c.icon)&&(s.removeClass(c._icon),c._icon=c.icon.call(this,a,s,i,c),s.addClass(c._icon)),c.type)switch(s.find(\"input, select, textarea\").prop(\"disabled\",l),c.type){case\"text\":case\"textarea\":c.$input.val(c.value||\"\");break;case\"checkbox\":case\"radio\":c.$input.val(c.value||\"\").prop(\"checked\",!!c.selected);break;case\"select\":c.$input.val((0===c.selected?\"0\":c.selected)||\"\")}c.$menu&&h.update.call(a,c,n)})},layer:function(t,n){var a=t.$layer=e('
            ').css({height:i.height(),width:i.width(),display:\"block\",position:\"fixed\",\"z-index\":n,top:0,left:0,opacity:0,filter:\"alpha(opacity=0)\",\"background-color\":\"#000\"}).data(\"contextMenuRoot\",t).insertBefore(this).on(\"contextmenu\",f.abortevent).on(\"mousedown\",f.layerClick);return void 0===document.body.style.maxWidth&&a.css({position:\"absolute\",height:e(document).height()}),a},processPromises:function(e,t,n){function a(e,t,n){void 0===n&&o(void 0),s(e,t,n)}function o(e,t,n){void 0===n?(n={error:{name:\"No items and no error item\",icon:\"context-menu-icon context-menu-icon-quit\"}},window.console&&(console.error||console.log).call(console,'When you reject a promise, provide an \"items\" object, equal to normal sub-menu items')):\"string\"==typeof n&&(n={error:{name:n}}),s(e,t,n)}function s(e,t,n){void 0!==t.$menu&&t.$menu.is(\":visible\")&&(e.$node.removeClass(t.classNames.iconLoadingClass),e.items=n,h.create(e,t,!0),h.update(e,t),t.positionSubmenu.call(e.$node,e.$menu))}e.$node.addClass(t.classNames.iconLoadingClass),n.then(a.bind(this,e,t),o.bind(this,e,t))}};e.fn.contextMenu=function(t){var n=this,a=t;if(this.length>0)if(void 0===t)this.first().trigger(\"contextmenu\");else if(void 0!==t.x&&void 0!==t.y)this.first().trigger(e.Event(\"contextmenu\",{pageX:t.x,pageY:t.y,mouseButton:t.button}));else if(\"hide\"===t){var o=this.first().data(\"contextMenu\")?this.first().data(\"contextMenu\").$menu:null;o&&o.trigger(\"contextmenu:hide\")}else\"destroy\"===t?e.contextMenu(\"destroy\",{context:this}):e.isPlainObject(t)?(t.context=this,e.contextMenu(\"create\",t)):t?this.removeClass(\"context-menu-disabled\"):t||this.addClass(\"context-menu-disabled\");else e.each(r,function(){this.selector===n.selector&&(a.data=this,e.extend(a.data,{trigger:\"demand\"}))}),f.contextmenu.call(a.target,a);return this},e.contextMenu=function(t,n){\"string\"!=typeof t&&(n=t,t=\"create\"),\"string\"==typeof n?n={selector:n}:void 0===n&&(n={});var a=e.extend(!0,{},d,n||{}),o=e(document),i=o,u=!1;switch(a.context&&a.context.length?(i=e(a.context).first(),a.context=i.get(0),u=!e(a.context).is(document)):a.context=document,t){case\"create\":if(!a.selector)throw new Error(\"No selector specified\");if(a.selector.match(/.context-menu-(list|item|input)($|\\s)/))throw new Error('Cannot bind to selector \"'+a.selector+'\" as it contains a reserved className');if(!a.build&&(!a.items||e.isEmptyObject(a.items)))throw new Error(\"No Items specified\");if(c++,a.ns=\".contextMenu\"+c,u||(l[a.selector]=a.ns),r[a.ns]=a,a.trigger||(a.trigger=\"right\"),!s){var m=\"click\"===a.itemClickEvent?\"click.contextMenu\":\"mouseup.contextMenu\",p={\"contextmenu:focus.contextMenu\":f.focusItem,\"contextmenu:blur.contextMenu\":f.blurItem,\"contextmenu.contextMenu\":f.abortevent,\"mouseenter.contextMenu\":f.itemMouseenter,\"mouseleave.contextMenu\":f.itemMouseleave};p[m]=f.itemClick,o.on({\"contextmenu:hide.contextMenu\":f.hideMenu,\"prevcommand.contextMenu\":f.prevItem,\"nextcommand.contextMenu\":f.nextItem,\"contextmenu.contextMenu\":f.abortevent,\"mouseenter.contextMenu\":f.menuMouseenter,\"mouseleave.contextMenu\":f.menuMouseleave},\".context-menu-list\").on(\"mouseup.contextMenu\",\".context-menu-input\",f.inputClick).on(p,\".context-menu-item\"),s=!0}switch(i.on(\"contextmenu\"+a.ns,a.selector,a,f.contextmenu),u&&i.on(\"remove\"+a.ns,function(){e(this).contextMenu(\"destroy\")}),a.trigger){case\"hover\":i.on(\"mouseenter\"+a.ns,a.selector,a,f.mouseenter).on(\"mouseleave\"+a.ns,a.selector,a,f.mouseleave);break;case\"left\":i.on(\"click\"+a.ns,a.selector,a,f.click);break;case\"touchstart\":i.on(\"touchstart\"+a.ns,a.selector,a,f.click)}a.build||h.create(a);break;case\"destroy\":var v;if(u){var x=a.context;e.each(r,function(t,n){if(!n)return!0;if(!e(x).is(n.selector))return!0;v=e(\".context-menu-list\").filter(\":visible\"),v.length&&v.data().contextMenuRoot.$trigger.is(e(n.context).find(n.selector))&&v.trigger(\"contextmenu:hide\",{force:!0});try{r[n.ns].$menu&&r[n.ns].$menu.remove(),delete r[n.ns]}catch(e){r[n.ns]=null}return e(n.context).off(n.ns),!0})}else if(a.selector){if(l[a.selector]){v=e(\".context-menu-list\").filter(\":visible\"),v.length&&v.data().contextMenuRoot.$trigger.is(a.selector)&&v.trigger(\"contextmenu:hide\",{force:!0});try{r[l[a.selector]].$menu&&r[l[a.selector]].$menu.remove(),delete r[l[a.selector]]}catch(e){r[l[a.selector]]=null}o.off(l[a.selector])}}else o.off(\".contextMenu .contextMenuAutoHide\"),e.each(r,function(t,n){e(n.context).off(n.ns)}),l={},r={},c=0,s=!1,e(\"#context-menu-layer, .context-menu-list\").remove();break;case\"html5\":(!e.support.htmlCommand&&!e.support.htmlMenuitem||\"boolean\"==typeof n&&n)&&e('menu[type=\"context\"]').each(function(){this.id&&e.contextMenu({selector:\"[contextmenu=\"+this.id+\"]\",items:e.contextMenu.fromMenu(this)})}).css(\"display\",\"none\");break;default:throw new Error('Unknown operation \"'+t+'\"')}return this},e.contextMenu.setInputValues=function(t,n){void 0===n&&(n={}),e.each(t.inputs,function(e,t){switch(t.type){case\"text\":case\"textarea\":t.value=n[e]||\"\";break;case\"checkbox\":t.selected=!!n[e];break;case\"radio\":t.selected=(n[t.radio]||\"\")===t.value;break;case\"select\":t.selected=n[e]||\"\"}})},e.contextMenu.getInputValues=function(t,n){return void 0===n&&(n={}),e.each(t.inputs,function(e,t){switch(t.type){case\"text\":case\"textarea\":case\"select\":n[e]=t.$input.val();break;case\"checkbox\":n[e]=t.$input.prop(\"checked\");break;case\"radio\":t.$input.prop(\"checked\")&&(n[t.radio]=t.value)}}),n},e.contextMenu.fromMenu=function(t){var n=e(t),o={};return a(o,n.children()),o},e.contextMenu.defaults=d,e.contextMenu.types=u,e.contextMenu.handle=f,e.contextMenu.op=h,e.contextMenu.menus=r});\n//# sourceMappingURL=jquery.contextMenu.min.js.map\n"]} \ No newline at end of file +{"version":3,"sources":["jquery.contextMenu.min.js"],"names":["factory","define","amd","exports","require","jQuery","$","splitAccesskey","val","k","t","split","keys","i","charAt","toUpperCase","push","inputLabel","node","id","name","menuChildren","items","$children","counter","each","label","item","$node","this","nodeName","toLowerCase","find","length","text","children","first","get","attr","disabled","callback","click","undefined","icon","type","selected","radio","value","options","html","clone","support","htmlMenuitem","window","htmlCommand","eventSelectstart","document","documentElement","ui","widget","cleanData","orig","elems","events","elem","_data","remove","triggerHandler","e","$currentTrigger","initialized","$win","namespaces","menus","types","defaults","selector","appendTo","trigger","autoHide","delay","reposition","hideOnSecondTrigger","selectableSubMenu","hasOverboundaryScroll","classNames","hover","visible","notSelectable","iconEdit","iconCut","iconCopy","iconPaste","iconDelete","iconAdd","iconQuit","iconLoadingClass","determinePosition","$menu","position","css","my","at","of","offset","collision","top","outerHeight","left","outerWidth","opt","x","y","call","offsetParentOffset","offsetParent","bottom","scrollTop","height","right","scrollLeft","width","positionSubmenu","$root","parentOffset","op","activated","zIndex","animation","duration","show","hide","noop","hoveract","timer","pageX","pageY","zindex","$t","zin","$tt","Math","max","parseInt","parent","indexOf","prop","handle","abortevent","preventDefault","stopImmediatePropagation","contextmenu","$this","data","originalEvent","mouseButton","hasClass","build","built","extend","isEmptyObject","console","error","log","Error","$trigger","create","showMenu","hasOwnProperty","isFunction","currentTarget","Event","mousedown","is","button","mouseup","removeData","mouseenter","$related","relatedTarget","$document","closest","on","mousemove","setTimeout","off","mouseleave","clearTimeout","layerClick","target","root","$window","triggerAction","elementFromPoint","$layer","isContentEditable","range","createRange","sel","getSelection","selectNode","collapse","removeAllRanges","addRange","one","contextMenu","keyStop","isInput","stopPropagation","key","targetZIndex","getZIndexOfTriggerTarget","style","parentElement","keyCode","shiftKey","$selected","blur","$parent","itemdata","String","fromCharCode","accesskeys","prevItem","$s","$prev","prev","last","$round","itemMouseleave","itemMouseenter","$input","focus","nextItem","$next","next","focusInput","contextMenuRoot","blurInput","menuMouseenter","hovering","menuMouseleave","itemClick","contextMenuKey","callbacks","Object","prototype","update","inputClick","hideMenu","force","focusItem","addClass","join","not","removeClass","filter","blurItem","additionalZValue","layer","pos","createNameNode","$name","_accesskey","_beforeAccesskey","append","createTextNode","_afterAccesskey","isHtmlName","accesskey","className","$label","ak","aks","matched","match","RegExp","commands","hasTypes","inputs","prependTo","then","processPromises","_icon","substring","body","resize","nested","domMenu","display","getBoundingClientRect","ceil","minWidth","maxWidth","addBack","$item","z-index","opacity","background-color","insertBefore","promise","completedPromise","errorPromise","finishPromiseProcess","errorItem","bind","menu","win","$menuOffset","winHeight","winWidth","winScrollTop","menuHeight","menuWidth","overflow-x","overflow-y","abs","newLeftPosition","parents","fn","operation","$o","context","isPlainObject","o","$context","_hasContext","ns","itemClickEvent","contextMenuItemObj","contextmenu:focus.contextMenu","contextmenu:blur.contextMenu","contextmenu.contextMenu","mouseenter.contextMenu","mouseleave.contextMenu","contextmenu:hide.contextMenu","prevcommand.contextMenu","nextcommand.contextMenu","$visibleMenu","fromMenu","setInputValues","getInputValues","element"],"mappings":"CAkBA,SAAWA,GACe,kBAAXC,SAAyBA,OAAOC,IAEvCD,QAAQ,UAAWD,GAGnBA,EAF0B,gBAAZG,SAENC,QAAQ,UAGRC,SAEb,SAAUC,GAET,YA0iDA,SAASC,GAAeC,GAIpB,IAAK,GAAWC,GAHZC,EAAIF,EAAIG,MAAM,OACdC,KAEKC,EAAI,EAAMJ,EAAIC,EAAEG,GAAIA,IACzBJ,EAAIA,EAAEK,OAAO,GAAGC,cAGhBH,EAAKI,KAAKP,EAGd,OAAOG,GAwUX,QAASK,GAAWC,GAChB,MAAQA,GAAKC,IAAMb,EAAE,cAAgBY,EAAKC,GAAK,MAAMX,OAAUU,EAAKE,KAIxE,QAASC,GAAaC,EAAOC,EAAWC,GA0KpC,MAzKKA,KACDA,EAAU,GAGdD,EAAUE,KAAK,WACX,GAGIC,GACAC,EAJAC,EAAQtB,EAAEuB,MACVX,EAAOW,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K9H,EAAKmB,OAASnB,EAAKoB,UAMjC0G,GAuLXnJ,EAAEuM,YAAYsI,SAAW,SAAUG,GAC/B,GAAI9L,GAAQlJ,EAAEgV,GACVhU,IAIJ,OAFAD,GAAaC,EAAOkI,EAAMrH,YAEnBb,GAIXhB,EAAEuM,YAAYlI,SAAWA,EACzBrE,EAAEuM,YAAYnI,MAAQA,EAEtBpE,EAAEuM,YAAY1D,OAASA,EACvB7I,EAAEuM,YAAYhF,GAAKA,EACnBvH,EAAEuM,YAAYpI,MAAQA","file":"jquery.contextMenu.min.js","sourcesContent":["!function(e){\"function\"==typeof define&&define.amd?define([\"jquery\"],e):e(\"object\"==typeof exports?require(\"jquery\"):jQuery)}(function(e){\"use strict\";function t(e){for(var t,n=e.split(/\\s+/),a=[],o=0;t=n[o];o++)t=t.charAt(0).toUpperCase(),a.push(t);return a}function n(t){return t.id&&e('label[for=\"'+t.id+'\"]').val()||t.name}function a(t,o,s){return s||(s=0),o.each(function(){var o,i,c=e(this),r=this,l=this.nodeName.toLowerCase();switch(\"label\"===l&&c.find(\"input, textarea, select\").length&&(o=c.text(),c=c.children().first(),r=c.get(0),l=r.nodeName.toLowerCase()),l){case\"menu\":i={name:c.attr(\"label\"),items:{}},s=a(i.items,c.children(),s);break;case\"a\":case\"button\":i={name:c.text(),disabled:!!c.attr(\"disabled\"),callback:function(){return function(){c.get(0).click()}}()};break;case\"menuitem\":case\"command\":switch(c.attr(\"type\")){case void 0:case\"command\":case\"menuitem\":i={name:c.attr(\"label\"),disabled:!!c.attr(\"disabled\"),icon:c.attr(\"icon\"),callback:function(){return function(){c.get(0).click()}}()};break;case\"checkbox\":i={type:\"checkbox\",disabled:!!c.attr(\"disabled\"),name:c.attr(\"label\"),selected:!!c.attr(\"checked\")};break;case\"radio\":i={type:\"radio\",disabled:!!c.attr(\"disabled\"),name:c.attr(\"label\"),radio:c.attr(\"radiogroup\"),value:c.attr(\"id\"),selected:!!c.attr(\"checked\")};break;default:i=void 0}break;case\"hr\":i=\"-------\";break;case\"input\":switch(c.attr(\"type\")){case\"text\":i={type:\"text\",name:o||n(r),disabled:!!c.attr(\"disabled\"),value:c.val()};break;case\"checkbox\":i={type:\"checkbox\",name:o||n(r),disabled:!!c.attr(\"disabled\"),selected:!!c.attr(\"checked\")};break;case\"radio\":i={type:\"radio\",name:o||n(r),disabled:!!c.attr(\"disabled\"),radio:!!c.attr(\"name\"),value:c.val(),selected:!!c.attr(\"checked\")};break;default:i=void 0}break;case\"select\":i={type:\"select\",name:o||n(r),disabled:!!c.attr(\"disabled\"),selected:c.val(),options:{}},c.children().each(function(){i.options[this.value]=e(this).text()});break;case\"textarea\":i={type:\"textarea\",name:o||n(r),disabled:!!c.attr(\"disabled\"),value:c.val()};break;case\"label\":break;default:i={type:\"html\",html:c.clone(!0)}}i&&(s++,t[\"key\"+s]=i)}),s}e.support.htmlMenuitem=\"HTMLMenuItemElement\"in window,e.support.htmlCommand=\"HTMLCommandElement\"in window,e.support.eventSelectstart=\"onselectstart\"in document.documentElement,e.ui&&e.widget||(e.cleanData=function(t){return function(n){var a,o,s;for(s=0;null!=n[s];s++){o=n[s];try{a=e._data(o,\"events\"),a&&a.remove&&e(o).triggerHandler(\"remove\")}catch(e){}}t(n)}}(e.cleanData));var o=null,s=!1,i=e(window),c=0,r={},l={},u={},d={selector:null,appendTo:null,trigger:\"right\",autoHide:!1,delay:200,reposition:!0,hideOnSecondTrigger:!1,selectableSubMenu:!1,hasOverboundaryScroll:!1,classNames:{hover:\"context-menu-hover\",disabled:\"context-menu-disabled\",visible:\"context-menu-visible\",notSelectable:\"context-menu-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\",iconLoadingClass:\"context-menu-icon-loading\"},determinePosition:function(t){if(e.ui&&e.ui.position)t.css(\"display\",\"block\").position({my:\"center top\",at:\"center bottom\",of:this,offset:\"0 5\",collision:\"fit\"}).css(\"display\",\"none\");else{var n=this.offset();n.top+=this.outerHeight(),n.left+=this.outerWidth()/2-t.outerWidth()/2,t.css(n)}},position:function(e,t,n){var a;if(!t&&!n)return void e.determinePosition.call(this,e.$menu);if(\"maintain\"===t&&\"maintain\"===n)a=e.$menu.position();else{var o=e.$menu.offsetParent().offset();a={top:n-o.top,left:t-o.left}}var s=i.scrollTop()+i.height(),c=i.scrollLeft()+i.width(),r=e.$menu.outerHeight(),l=e.$menu.outerWidth();a.top+r>s&&(a.top-=r),a.top<0&&(a.top=0),a.left+l>c&&(a.left-=l),a.left<0&&(a.left=0),e.$menu.css(a)},positionSubmenu:function(t,n){if(void 0!==t)if(e.ui&&e.ui.position)t.css(\"display\",\"block\").position({my:\"left top-5\",at:\"right top\",of:this,collision:\"flipfit fit\"}).css(\"display\",\"\");else{var a={};if(n&&n.hasOverboundaryScroll){var o=this.offset();a={top:o.top,left:o.left+this.outerWidth()}}else a={top:-9,left:this.outerWidth()-5};t.css(a),n&&n.hasOverboundaryScroll&&h.activated(t)}},zIndex:1,animation:{duration:50,show:\"slideDown\",hide:\"slideUp\"},events:{show:e.noop,hide:e.noop,activated:e.noop},callback:null,items:{}},m={timer:null,pageX:null,pageY:null},p=function(e){for(var t=0,n=e;;)if(t=Math.max(t,parseInt(n.css(\"z-index\"),10)||0),!(n=n.parent())||!n.length||\"html body\".indexOf(n.prop(\"nodeName\").toLowerCase())>-1)break;return t},f={abortevent:function(e){e.preventDefault(),e.stopImmediatePropagation()},contextmenu:function(t){var n=e(this);if(\"right\"===t.data.trigger&&(t.preventDefault(),t.stopImmediatePropagation()),!(\"right\"!==t.data.trigger&&\"demand\"!==t.data.trigger&&t.originalEvent||!(void 0===t.mouseButton||!t.data||\"left\"===t.data.trigger&&0===t.mouseButton||\"right\"===t.data.trigger&&2===t.mouseButton)||n.hasClass(\"context-menu-active\")||n.hasClass(\"context-menu-disabled\"))){if(o=n,t.data.build){var a=t.data.build(o,t);if(!1===a)return;if(t.data=e.extend(!0,{},d,t.data,a||{}),!t.data.items||e.isEmptyObject(t.data.items))throw window.console&&(console.error||console.log).call(console,\"No items specified to show in contextMenu\"),new Error(\"No Items specified\");t.data.$trigger=o,h.create(t.data)}var s=!1;for(var i in t.data.items)if(t.data.items.hasOwnProperty(i)){var c;c=e.isFunction(t.data.items[i].visible)?t.data.items[i].visible.call(e(t.currentTarget),i,t.data):void 0===t.data.items[i]||!t.data.items[i].visible||!0===t.data.items[i].visible,c&&(s=!0)}s&&h.show.call(n,t.data,t.pageX,t.pageY)}},click:function(t){t.preventDefault(),t.stopImmediatePropagation(),e(this).trigger(e.Event(\"contextmenu\",{data:t.data,pageX:t.pageX,pageY:t.pageY}))},mousedown:function(t){var n=e(this);o&&o.length&&!o.is(n)&&o.data(\"contextMenu\").$menu.trigger(\"contextmenu:hide\"),2===t.button&&(o=n.data(\"contextMenuActive\",!0))},mouseup:function(t){var n=e(this);n.data(\"contextMenuActive\")&&o&&o.length&&o.is(n)&&!n.hasClass(\"context-menu-disabled\")&&(t.preventDefault(),t.stopImmediatePropagation(),o=n,n.trigger(e.Event(\"contextmenu\",{data:t.data,pageX:t.pageX,pageY:t.pageY}))),n.removeData(\"contextMenuActive\")},mouseenter:function(t){var n=e(this),a=e(t.relatedTarget),s=e(document);a.is(\".context-menu-list\")||a.closest(\".context-menu-list\").length||o&&o.length||(m.pageX=t.pageX,m.pageY=t.pageY,m.data=t.data,s.on(\"mousemove.contextMenuShow\",f.mousemove),m.timer=setTimeout(function(){m.timer=null,s.off(\"mousemove.contextMenuShow\"),o=n,n.trigger(e.Event(\"contextmenu\",{data:m.data,pageX:m.pageX,pageY:m.pageY}))},t.data.delay))},mousemove:function(e){m.pageX=e.pageX,m.pageY=e.pageY},mouseleave:function(t){var n=e(t.relatedTarget);if(!n.is(\".context-menu-list\")&&!n.closest(\".context-menu-list\").length){try{clearTimeout(m.timer)}catch(t){}m.timer=null}},layerClick:function(t){var n,a,o=e(this),s=o.data(\"contextMenuRoot\"),c=t.button,r=t.pageX,l=t.pageY;t.preventDefault(),setTimeout(function(){var o,u=\"left\"===s.trigger&&0===c||\"right\"===s.trigger&&2===c;if(document.elementFromPoint&&s.$layer){if(s.$layer.hide(),n=document.elementFromPoint(r-i.scrollLeft(),l-i.scrollTop()),n.isContentEditable){var d=document.createRange(),m=window.getSelection();d.selectNode(n),d.collapse(!0),m.removeAllRanges(),m.addRange(d)}e(n).trigger(t),s.$layer.show()}if(s.hideOnSecondTrigger&&u&&null!==s.$menu&&void 0!==s.$menu)return void s.$menu.trigger(\"contextmenu:hide\");if(s.reposition&&u)if(document.elementFromPoint){if(s.$trigger.is(n))return void s.position.call(s.$trigger,s,r,l)}else if(a=s.$trigger.offset(),o=e(window),a.top+=o.scrollTop(),a.top<=t.pageY&&(a.left+=o.scrollLeft(),a.left<=t.pageX&&(a.bottom=a.top+s.$trigger.outerHeight(),a.bottom>=t.pageY&&(a.right=a.left+s.$trigger.outerWidth(),a.right>=t.pageX))))return void s.position.call(s.$trigger,s,r,l);n&&u&&s.$trigger.one(\"contextmenu:hidden\",function(){e(n).contextMenu({x:r,y:l,button:c})}),null!==s&&void 0!==s&&null!==s.$menu&&void 0!==s.$menu&&s.$menu.trigger(\"contextmenu:hide\")},50)},keyStop:function(e,t){t.isInput||e.preventDefault(),e.stopPropagation()},key:function(e){var t={};o&&(t=o.data(\"contextMenu\")||{}),void 0===t.zIndex&&(t.zIndex=0);var n=0,a=function(e){\"\"!==e.style.zIndex?n=e.style.zIndex:null!==e.offsetParent&&void 0!==e.offsetParent?a(e.offsetParent):null!==e.parentElement&&void 0!==e.parentElement&&a(e.parentElement)};if(a(e.target),!(t.$menu&&parseInt(n,10)>parseInt(t.$menu.css(\"zIndex\"),10))){switch(e.keyCode){case 9:case 38:if(f.keyStop(e,t),t.isInput){if(9===e.keyCode&&e.shiftKey)return e.preventDefault(),t.$selected&&t.$selected.find(\"input, textarea, select\").blur(),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger(\"prevcommand\"));if(38===e.keyCode&&\"checkbox\"===t.$selected.find(\"input, textarea, select\").prop(\"type\"))return void e.preventDefault()}else if(9!==e.keyCode||e.shiftKey)return void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger(\"prevcommand\"));break;case 40:if(f.keyStop(e,t),!t.isInput)return void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger(\"nextcommand\"));if(9===e.keyCode)return e.preventDefault(),t.$selected&&t.$selected.find(\"input, textarea, select\").blur(),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger(\"nextcommand\"));if(40===e.keyCode&&\"checkbox\"===t.$selected.find(\"input, textarea, select\").prop(\"type\"))return void e.preventDefault();break;case 37:if(f.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;if(!t.$selected.parent().hasClass(\"context-menu-root\")){var s=t.$selected.parent().parent();return t.$selected.trigger(\"contextmenu:blur\"),void(t.$selected=s)}break;case 39:if(f.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;var i=t.$selected.data(\"contextMenu\")||{};if(i.$menu&&t.$selected.hasClass(\"context-menu-submenu\"))return t.$selected=null,i.$selected=null,void i.$menu.trigger(\"nextcommand\");break;case 35:case 36:return t.$selected&&t.$selected.find(\"input, textarea, select\").length?void 0:((t.$selected&&t.$selected.parent()||t.$menu).children(\":not(.\"+t.classNames.disabled+\", .\"+t.classNames.notSelectable+\")\")[36===e.keyCode?\"first\":\"last\"]().trigger(\"contextmenu:focus\"),void e.preventDefault());case 13:if(f.keyStop(e,t),t.isInput){if(t.$selected&&!t.$selected.is(\"textarea, select\"))return void e.preventDefault();break}return void(void 0!==t.$selected&&null!==t.$selected&&t.$selected.trigger(\"mouseup\"));case 32:case 33:case 34:return void f.keyStop(e,t);case 27:return f.keyStop(e,t),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger(\"contextmenu:hide\"));default:var c=String.fromCharCode(e.keyCode).toUpperCase();if(t.accesskeys&&t.accesskeys[c])return void t.accesskeys[c].$node.trigger(t.accesskeys[c].$menu?\"contextmenu:focus\":\"mouseup\")}e.stopPropagation(),void 0!==t.$selected&&null!==t.$selected&&t.$selected.trigger(e)}},prevItem:function(t){t.stopPropagation();var n=e(this).data(\"contextMenu\")||{},a=e(this).data(\"contextMenuRoot\")||{};if(n.$selected){var o=n.$selected;n=n.$selected.parent().data(\"contextMenu\")||{},n.$selected=o}for(var s=n.$menu.children(),i=n.$selected&&n.$selected.prev().length?n.$selected.prev():s.last(),c=i;i.hasClass(a.classNames.disabled)||i.hasClass(a.classNames.notSelectable)||i.is(\":hidden\");)if(i=i.prev().length?i.prev():s.last(),i.is(c))return;n.$selected&&f.itemMouseleave.call(n.$selected.get(0),t),f.itemMouseenter.call(i.get(0),t);var r=i.find(\"input, textarea, select\");r.length&&r.focus()},nextItem:function(t){t.stopPropagation();var n=e(this).data(\"contextMenu\")||{},a=e(this).data(\"contextMenuRoot\")||{};if(n.$selected){var o=n.$selected;n=n.$selected.parent().data(\"contextMenu\")||{},n.$selected=o}for(var s=n.$menu.children(),i=n.$selected&&n.$selected.next().length?n.$selected.next():s.first(),c=i;i.hasClass(a.classNames.disabled)||i.hasClass(a.classNames.notSelectable)||i.is(\":hidden\");)if(i=i.next().length?i.next():s.first(),i.is(c))return;n.$selected&&f.itemMouseleave.call(n.$selected.get(0),t),f.itemMouseenter.call(i.get(0),t);var r=i.find(\"input, textarea, select\");r.length&&r.focus()},focusInput:function(){var t=e(this).closest(\".context-menu-item\"),n=t.data(),a=n.contextMenu,o=n.contextMenuRoot;o.$selected=a.$selected=t,o.isInput=a.isInput=!0},blurInput:function(){var t=e(this).closest(\".context-menu-item\"),n=t.data(),a=n.contextMenu;n.contextMenuRoot.isInput=a.isInput=!1},menuMouseenter:function(){e(this).data().contextMenuRoot.hovering=!0},menuMouseleave:function(t){var n=e(this).data().contextMenuRoot;n.$layer&&n.$layer.is(t.relatedTarget)&&(n.hovering=!1)},itemMouseenter:function(t){var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;if(s.hovering=!0,t&&s.$layer&&s.$layer.is(t.relatedTarget)&&(t.preventDefault(),t.stopImmediatePropagation()),(o.$menu?o:s).$menu.children(\".\"+s.classNames.hover).trigger(\"contextmenu:blur\").children(\".hover\").trigger(\"contextmenu:blur\"),n.hasClass(s.classNames.disabled)||n.hasClass(s.classNames.notSelectable))return void(o.$selected=null);n.trigger(\"contextmenu:focus\")},itemMouseleave:function(t){var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;if(s!==o&&s.$layer&&s.$layer.is(t.relatedTarget))return void 0!==s.$selected&&null!==s.$selected&&s.$selected.trigger(\"contextmenu:blur\"),t.preventDefault(),t.stopImmediatePropagation(),void(s.$selected=o.$selected=o.$node);o&&o.$menu&&o.$menu.hasClass(\"context-menu-visible\")||n.trigger(\"contextmenu:blur\")},itemClick:function(t){var n,a=e(this),o=a.data(),s=o.contextMenu,i=o.contextMenuRoot,c=o.contextMenuKey;if(!(!s.items[c]||a.is(\".\"+i.classNames.disabled+\", .context-menu-separator, .\"+i.classNames.notSelectable)||a.is(\".context-menu-submenu\")&&!1===i.selectableSubMenu)){if(t.preventDefault(),t.stopImmediatePropagation(),e.isFunction(s.callbacks[c])&&Object.prototype.hasOwnProperty.call(s.callbacks,c))n=s.callbacks[c];else{if(!e.isFunction(i.callback))return;n=i.callback}!1!==n.call(i.$trigger,c,i,t)?i.$menu.trigger(\"contextmenu:hide\"):i.$menu.parent().length&&h.update.call(i.$trigger,i)}},inputClick:function(e){e.stopImmediatePropagation()},hideMenu:function(t,n){var a=e(this).data(\"contextMenuRoot\");h.hide.call(a.$trigger,a,n&&n.force)},focusItem:function(t){t.stopPropagation();var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;n.hasClass(s.classNames.disabled)||n.hasClass(s.classNames.notSelectable)||(n.addClass([s.classNames.hover,s.classNames.visible].join(\" \")).parent().find(\".context-menu-item\").not(n).removeClass(s.classNames.visible).filter(\".\"+s.classNames.hover).trigger(\"contextmenu:blur\"),o.$selected=s.$selected=n,o&&o.$node&&o.$node.hasClass(\"context-menu-submenu\")&&o.$node.addClass(s.classNames.hover),o.$node&&s.positionSubmenu.call(o.$node,o.$menu,s))},blurItem:function(t){t.stopPropagation();var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;o.autoHide&&n.removeClass(s.classNames.visible),n.removeClass(s.classNames.hover),o.$selected=null}},h={show:function(t,n,a){var s=e(this),i={};if(e(\"#context-menu-layer\").trigger(\"mousedown\"),t.$trigger=s,!1===t.events.show.call(s,t))return void(o=null);if(h.update.call(s,t),t.position.call(s,t,n,a),t.zIndex){var c=t.zIndex;\"function\"==typeof t.zIndex&&(c=t.zIndex.call(s,t)),i.zIndex=p(s)+c}h.layer.call(t.$menu,t,i.zIndex),t.$menu.find(\"ul\").css(\"zIndex\",i.zIndex+1),t.$menu.css(i)[t.animation.show](t.animation.duration,function(){s.trigger(\"contextmenu:visible\"),h.activated(t,t.$menu),t.events.activated()}),s.data(\"contextMenu\",t).addClass(\"context-menu-active\"),e(document).off(\"keydown.contextMenu\").on(\"keydown.contextMenu\",f.key),t.autoHide&&e(document).on(\"mousemove.contextMenuAutoHide\",function(e){var n=s.offset();n.right=n.left+s.outerWidth(),n.bottom=n.top+s.outerHeight(),!t.$layer||t.hovering||e.pageX>=n.left&&e.pageX<=n.right&&e.pageY>=n.top&&e.pageY<=n.bottom||setTimeout(function(){t.hovering||null===t.$menu||void 0===t.$menu||t.$menu.trigger(\"contextmenu:hide\")},50)})},hide:function(t,n){var a=e(this);if(t||(t=a.data(\"contextMenu\")||{}),n||!t.events||!1!==t.events.hide.call(a,t)){if(a.removeData(\"contextMenu\").removeClass(\"context-menu-active\"),t.$layer){setTimeout(function(e){return function(){e.remove()}}(t.$layer),10);try{delete t.$layer}catch(e){t.$layer=null}}o=null,t.$menu.find(\".\"+t.classNames.hover).trigger(\"contextmenu:blur\"),t.$selected=null,t.$menu.find(\".\"+t.classNames.visible).removeClass(t.classNames.visible),e(document).off(\".contextMenuAutoHide\").off(\"keydown.contextMenu\"),t.$menu&&t.$menu[t.animation.hide](t.animation.duration,function(){t.build&&(t.$menu.remove(),e.each(t,function(e){switch(e){case\"ns\":case\"selector\":case\"build\":case\"trigger\":return!0;default:t[e]=void 0;try{delete t[e]}catch(e){}return!0}})),setTimeout(function(){a.trigger(\"contextmenu:hidden\")},10)})}},create:function(n,a){function o(t){var n=e(\"\");if(t._accesskey)t._beforeAccesskey&&n.append(document.createTextNode(t._beforeAccesskey)),e(\"\").addClass(\"context-menu-accesskey\").text(t._accesskey).appendTo(n),t._afterAccesskey&&n.append(document.createTextNode(t._afterAccesskey));else if(t.isHtmlName){if(void 0!==t.accesskey)throw new Error(\"accesskeys are not compatible with HTML names and cannot be used together in the same item\");n.html(t.name)}else n.text(t.name);return n}void 0===a&&(a=n),n.$menu=e('
              ').addClass(n.className||\"\").data({contextMenu:n,contextMenuRoot:a}),e.each([\"callbacks\",\"commands\",\"inputs\"],function(e,t){n[t]={},a[t]||(a[t]={})}),a.accesskeys||(a.accesskeys={}),e.each(n.items,function(s,i){var c=e('
            • ').addClass(i.className||\"\"),r=null,l=null;if(c.on(\"click\",e.noop),\"string\"!=typeof i&&\"cm_separator\"!==i.type||(i={type:\"cm_seperator\"}),i.$node=c.data({contextMenu:n,contextMenuRoot:a,contextMenuKey:s}),void 0!==i.accesskey)for(var d,m=t(i.accesskey),p=0;d=m[p];p++)if(!a.accesskeys[d]){a.accesskeys[d]=i;var v=i.name.match(new RegExp(\"^(.*?)(\"+d+\")(.*)$\",\"i\"));v&&(i._beforeAccesskey=v[1],i._accesskey=v[2],i._afterAccesskey=v[3]);break}if(i.type&&u[i.type])u[i.type].call(c,i,n,a),e.each([n,a],function(t,a){a.commands[s]=i,!e.isFunction(i.callback)||void 0!==a.callbacks[s]&&void 0!==n.type||(a.callbacks[s]=i.callback)});else{switch(\"cm_seperator\"===i.type?c.addClass(\"context-menu-separator \"+a.classNames.notSelectable):\"html\"===i.type?c.addClass(\"context-menu-html \"+a.classNames.notSelectable):\"sub\"===i.type||(i.type?(r=e(\"\").appendTo(c),o(i).appendTo(r),c.addClass(\"context-menu-input\"),n.hasTypes=!0,e.each([n,a],function(e,t){t.commands[s]=i,t.inputs[s]=i})):i.items&&(i.type=\"sub\")),i.type){case\"cm_seperator\":break;case\"text\":l=e('').attr(\"name\",\"context-menu-input-\"+s).val(i.value||\"\").appendTo(r);break;case\"textarea\":l=e('').attr(\"name\",\"context-menu-input-\"+s).val(i.value||\"\").appendTo(r),i.height&&l.height(i.height);break;case\"checkbox\":l=e('').attr(\"name\",\"context-menu-input-\"+s).val(i.value||\"\").prop(\"checked\",!!i.selected).prependTo(r);break;case\"radio\":l=e('').attr(\"name\",\"context-menu-input-\"+i.radio).val(i.value||\"\").prop(\"checked\",!!i.selected).prependTo(r);break;case\"select\":l=e('').attr(\"name\",\"context-menu-input-\"+s).appendTo(r),i.options&&(e.each(i.options,function(t,n){e(\"\").val(t).text(n).appendTo(l)}),l.val(i.selected));break;case\"sub\":o(i).appendTo(c),i.appendTo=i.$node,c.data(\"contextMenu\",i).addClass(\"context-menu-submenu\"),i.callback=null,\"function\"==typeof i.items.then?h.processPromises(i,a,i.items):h.create(i,a);break;case\"html\":e(i.html).appendTo(c);break;default:e.each([n,a],function(t,a){a.commands[s]=i,!e.isFunction(i.callback)||void 0!==a.callbacks[s]&&void 0!==n.type||(a.callbacks[s]=i.callback)}),o(i).appendTo(c)}i.type&&\"sub\"!==i.type&&\"html\"!==i.type&&\"cm_seperator\"!==i.type&&(l.on(\"focus\",f.focusInput).on(\"blur\",f.blurInput),i.events&&l.on(i.events,n)),i.icon&&(e.isFunction(i.icon)?i._icon=i.icon.call(this,this,c,s,i):\"string\"==typeof i.icon&&\"fa-\"===i.icon.substring(0,3)?i._icon=a.classNames.icon+\" \"+a.classNames.icon+\"--fa fa \"+i.icon:i._icon=a.classNames.icon+\" \"+a.classNames.icon+\"-\"+i.icon,c.addClass(i._icon))}i.$input=l,i.$label=r,c.appendTo(n.$menu),!n.hasTypes&&e.support.eventSelectstart&&c.on(\"selectstart.disableTextSelect\",f.abortevent)}),n.$node||n.$menu.css(\"display\",\"none\").addClass(\"context-menu-root\"),n.$menu.appendTo(n.appendTo||document.body)},resize:function(t,n){var a;t.css({position:\"absolute\",display:\"block\"}),t.data(\"width\",(a=t.get(0)).getBoundingClientRect?Math.ceil(a.getBoundingClientRect().width):t.outerWidth()+1),t.css({position:\"static\",minWidth:\"0px\",maxWidth:\"100000px\"}),t.find(\"> li > ul\").each(function(){h.resize(e(this),!0)}),n||t.find(\"ul\").addBack().css({position:\"\",display:\"\",minWidth:\"\",maxWidth:\"\"}).outerWidth(function(){return e(this).data(\"width\")})},update:function(t,n){var a=this;void 0===n&&(n=t,h.resize(t.$menu)),t.$menu.children().each(function(){var o,s=e(this),i=s.data(\"contextMenuKey\"),c=t.items[i],r=e.isFunction(c.disabled)&&c.disabled.call(a,i,n)||!0===c.disabled;if(o=e.isFunction(c.visible)?c.visible.call(a,i,n):void 0===c.visible||!0===c.visible,s[o?\"show\":\"hide\"](),s[r?\"addClass\":\"removeClass\"](n.classNames.disabled),e.isFunction(c.icon)&&(s.removeClass(c._icon),c._icon=c.icon.call(this,a,s,i,c),s.addClass(c._icon)),c.type)switch(s.find(\"input, select, textarea\").prop(\"disabled\",r),c.type){case\"text\":case\"textarea\":c.$input.val(c.value||\"\");break;case\"checkbox\":case\"radio\":c.$input.val(c.value||\"\").prop(\"checked\",!!c.selected);break;case\"select\":c.$input.val((0===c.selected?\"0\":c.selected)||\"\")}c.$menu&&h.update.call(a,c,n)})},layer:function(t,n){var a=t.$layer=e('
              ').css({height:i.height(),width:i.width(),display:\"block\",position:\"fixed\",\"z-index\":n,top:0,left:0,opacity:0,filter:\"alpha(opacity=0)\",\"background-color\":\"#000\"}).data(\"contextMenuRoot\",t).insertBefore(this).on(\"contextmenu\",f.abortevent).on(\"mousedown\",f.layerClick);return void 0===document.body.style.maxWidth&&a.css({position:\"absolute\",height:e(document).height()}),a},processPromises:function(e,t,n){function a(e,t,n){void 0===n&&o(void 0),s(e,t,n)}function o(e,t,n){void 0===n?(n={error:{name:\"No items and no error item\",icon:\"context-menu-icon context-menu-icon-quit\"}},window.console&&(console.error||console.log).call(console,'When you reject a promise, provide an \"items\" object, equal to normal sub-menu items')):\"string\"==typeof n&&(n={error:{name:n}}),s(e,t,n)}function s(e,t,n){void 0!==t.$menu&&t.$menu.is(\":visible\")&&(e.$node.removeClass(t.classNames.iconLoadingClass),e.items=n,h.create(e,t,!0),h.update(e,t),t.positionSubmenu.call(e.$node,e.$menu,t))}e.$node.addClass(t.classNames.iconLoadingClass),n.then(a.bind(this,e,t),o.bind(this,e,t))},activated:function(t,n){if(t.hasOverboundaryScroll){var a=n,o=e(window),s=a.offset(),i=o.height(),c=o.width(),r=o.scrollTop(),l=a.outerHeight(),u=a.outerWidth();if(l>i?a.css({height:i-(2*parseInt(a.css(\"padding-top\"))+2*parseInt(a.css(\"margin-top\")))+\"px\",\"overflow-x\":\"hidden\",\"overflow-y\":\"auto\",top:r+\"px\"}):s.topr+i&&a.css({top:s.top-Math.abs(r+i-(s.top+l))-(2*parseInt(a.css(\"padding-top\"))+2*parseInt(a.css(\"margin-top\")))+\"px\"}),s.left+u>c){var d=s.left-Math.abs(s.left+u-c),m=a.parents(\"ul.context-menu-list\").first();m.length&&d<=m.offset().left+m.outerWidth()&&d>=m.offset().left?a.css({left:m.offset().left-a.outerWidth()+\"px\"}):a.css({left:s.left-Math.abs(s.left+u-c)+\"px\"})}}}};e.fn.contextMenu=function(t){var n=this,a=t;if(this.length>0)if(void 0===t)this.first().trigger(\"contextmenu\");else if(void 0!==t.x&&void 0!==t.y)this.first().trigger(e.Event(\"contextmenu\",{pageX:t.x,pageY:t.y,mouseButton:t.button}));else if(\"hide\"===t){var o=this.first().data(\"contextMenu\")?this.first().data(\"contextMenu\").$menu:null;o&&o.trigger(\"contextmenu:hide\")}else\"destroy\"===t?e.contextMenu(\"destroy\",{context:this}):e.isPlainObject(t)?(t.context=this,e.contextMenu(\"create\",t)):t?this.removeClass(\"context-menu-disabled\"):t||this.addClass(\"context-menu-disabled\");else e.each(l,function(){this.selector===n.selector&&(a.data=this,e.extend(a.data,{trigger:\"demand\"}))}),f.contextmenu.call(a.target,a);return this},e.contextMenu=function(t,n){\"string\"!=typeof t&&(n=t,t=\"create\"),\"string\"==typeof n?n={selector:n}:void 0===n&&(n={});var a=e.extend(!0,{},d,n||{}),o=e(document),i=o,u=!1;switch(a.context&&a.context.length?(i=e(a.context).first(),a.context=i.get(0),u=!e(a.context).is(document)):a.context=document,t){case\"update\":if(u)h.update(i);else for(var m in l)l.hasOwnProperty(m)&&h.update(l[m]);break;case\"create\":if(!a.selector)throw new Error(\"No selector specified\");if(a.selector.match(/.context-menu-(list|item|input)($|\\s)/))throw new Error('Cannot bind to selector \"'+a.selector+'\" as it contains a reserved className');if(!a.build&&(!a.items||e.isEmptyObject(a.items)))throw new Error(\"No Items specified\");if(c++,a.ns=\".contextMenu\"+c,u||(r[a.selector]=a.ns),l[a.ns]=a,a.trigger||(a.trigger=\"right\"),!s){var p=\"click\"===a.itemClickEvent?\"click.contextMenu\":\"mouseup.contextMenu\",v={\"contextmenu:focus.contextMenu\":f.focusItem,\"contextmenu:blur.contextMenu\":f.blurItem,\"contextmenu.contextMenu\":f.abortevent,\"mouseenter.contextMenu\":f.itemMouseenter,\"mouseleave.contextMenu\":f.itemMouseleave};v[p]=f.itemClick,o.on({\"contextmenu:hide.contextMenu\":f.hideMenu,\"prevcommand.contextMenu\":f.prevItem,\"nextcommand.contextMenu\":f.nextItem,\"contextmenu.contextMenu\":f.abortevent,\"mouseenter.contextMenu\":f.menuMouseenter,\"mouseleave.contextMenu\":f.menuMouseleave},\".context-menu-list\").on(\"mouseup.contextMenu\",\".context-menu-input\",f.inputClick).on(v,\".context-menu-item\"),s=!0}switch(i.on(\"contextmenu\"+a.ns,a.selector,a,f.contextmenu),u&&i.on(\"remove\"+a.ns,function(){e(this).contextMenu(\"destroy\")}),a.trigger){case\"hover\":i.on(\"mouseenter\"+a.ns,a.selector,a,f.mouseenter).on(\"mouseleave\"+a.ns,a.selector,a,f.mouseleave);break;case\"left\":i.on(\"click\"+a.ns,a.selector,a,f.click);break;case\"touchstart\":i.on(\"touchstart\"+a.ns,a.selector,a,f.click)}a.build||h.create(a);break;case\"destroy\":var x;if(u){var g=a.context;e.each(l,function(t,n){if(!n)return!0;if(!e(g).is(n.selector))return!0;x=e(\".context-menu-list\").filter(\":visible\"),x.length&&x.data().contextMenuRoot.$trigger.is(e(n.context).find(n.selector))&&x.trigger(\"contextmenu:hide\",{force:!0});try{l[n.ns].$menu&&l[n.ns].$menu.remove(),delete l[n.ns]}catch(e){l[n.ns]=null}return e(n.context).off(n.ns),!0})}else if(a.selector){if(r[a.selector]){x=e(\".context-menu-list\").filter(\":visible\"),x.length&&x.data().contextMenuRoot.$trigger.is(a.selector)&&x.trigger(\"contextmenu:hide\",{force:!0});try{l[r[a.selector]].$menu&&l[r[a.selector]].$menu.remove(),delete l[r[a.selector]]}catch(e){l[r[a.selector]]=null}o.off(r[a.selector])}}else o.off(\".contextMenu .contextMenuAutoHide\"),e.each(l,function(t,n){e(n.context).off(n.ns)}),r={},l={},c=0,s=!1,e(\"#context-menu-layer, .context-menu-list\").remove();break;case\"html5\":(!e.support.htmlCommand&&!e.support.htmlMenuitem||\"boolean\"==typeof n&&n)&&e('menu[type=\"context\"]').each(function(){this.id&&e.contextMenu({selector:\"[contextmenu=\"+this.id+\"]\",items:e.contextMenu.fromMenu(this)})}).css(\"display\",\"none\");break;default:throw new Error('Unknown operation \"'+t+'\"')}return this},e.contextMenu.setInputValues=function(t,n){void 0===n&&(n={}),e.each(t.inputs,function(e,t){switch(t.type){case\"text\":case\"textarea\":t.value=n[e]||\"\";break;case\"checkbox\":t.selected=!!n[e];break;case\"radio\":t.selected=(n[t.radio]||\"\")===t.value;break;case\"select\":t.selected=n[e]||\"\"}})},e.contextMenu.getInputValues=function(t,n){return void 0===n&&(n={}),e.each(t.inputs,function(e,t){switch(t.type){case\"text\":case\"textarea\":case\"select\":n[e]=t.$input.val();break;case\"checkbox\":n[e]=t.$input.prop(\"checked\");break;case\"radio\":t.$input.prop(\"checked\")&&(n[t.radio]=t.value)}}),n},e.contextMenu.fromMenu=function(t){var n=e(t),o={};return a(o,n.children()),o},e.contextMenu.defaults=d,e.contextMenu.types=u,e.contextMenu.handle=f,e.contextMenu.op=h,e.contextMenu.menus=l});\n//# sourceMappingURL=jquery.contextMenu.min.js.map\n"]} \ No newline at end of file diff --git a/src/jquery.contextMenu.js b/src/jquery.contextMenu.js index 295938b8..f687e4f2 100755 --- a/src/jquery.contextMenu.js +++ b/src/jquery.contextMenu.js @@ -123,6 +123,8 @@ //ability to select submenu selectableSubMenu: false, + // make context scrollable for overboundary situation + hasOverboundaryScroll: false, // Default classname configuration to be able avoid conflicts in frameworks classNames: { @@ -204,7 +206,7 @@ opt.$menu.css(offset); }, // position the sub-menu - positionSubmenu: function ($menu) { + positionSubmenu: function ($menu, $root) { if (typeof $menu === 'undefined') { // When user hovers over item (which has sub items) handle.focusItem will call this. // but the submenu does not exist yet if opt.items is a promise. just return, will @@ -221,14 +223,23 @@ collision: 'flipfit fit' }).css('display', ''); } else { - var parentOffset = this.offset(); - // determine contextMenu position - var offset = { - top: parentOffset.top, - left: parentOffset.left + this.outerWidth() - }; + var offset = {}; + if($root && $root.hasOverboundaryScroll){ + var parentOffset = this.offset(); + // determine contextMenu position + offset = { + top: parentOffset.top, + left: parentOffset.left + this.outerWidth() + }; + } else { + offset = { + top: -9, + left: this.outerWidth() - 5 + }; + } $menu.css(offset); - op.activated($menu); + if ($root && $root.hasOverboundaryScroll) + op.activated($root, $menu); } }, // offset to add to zIndex @@ -948,7 +959,7 @@ // position sub-menu - do after show so dumb $.ui.position can keep up if (opt.$node) { - root.positionSubmenu.call(opt.$node, opt.$menu); + root.positionSubmenu.call(opt.$node, opt.$menu, root); } }, // blur @@ -1010,7 +1021,7 @@ opt.$menu.css(css)[opt.animation.show](opt.animation.duration, function () { $trigger.trigger('contextmenu:visible'); - op.activated(opt.$menu); + op.activated(opt,opt.$menu); opt.events.activated(); }); // make options available and set state @@ -1119,7 +1130,7 @@ } // create contextMenu - opt.$menu = $('
                ').addClass(opt.className || '').data({ + opt.$menu = $('
                  ').addClass(opt.className || '').data({ 'contextMenu': opt, 'contextMenuRoot': root }); @@ -1536,7 +1547,7 @@ opt.items = items; op.create(opt, root, true); // Create submenu op.update(opt, root); // Correctly update position if user is already hovered over menu item - root.positionSubmenu.call(opt.$node, opt.$menu); // positionSubmenu, will only do anything if user already hovered over menu item that just got new subitems. + root.positionSubmenu.call(opt.$node, opt.$menu, root); // positionSubmenu, will only do anything if user already hovered over menu item that just got new subitems. } // Wait for promise completion. .then(success, error, notify) (we don't track notify). Bind the opt @@ -1544,7 +1555,9 @@ promise.then(completedPromise.bind(this, opt, root), errorPromise.bind(this, opt, root)); }, // operation that will run after contextMenu showed on screen - activated: function(menu){ + activated: function(opt,menu){ + if(!opt.hasOverboundaryScroll) + return; var $menu = menu; var win = $(window); var $menuOffset = $menu.offset(); @@ -1556,7 +1569,7 @@ if(menuHeight > winHeight){ $menu.css({ 'height': winHeight - - (parseInt($menu.css('padding-top'))+parseInt($menu.css('margin-top')))+'px', + ((parseInt($menu.css('padding-top'))*2)+(parseInt($menu.css('margin-top'))*2))+'px', 'overflow-x':'hidden', 'overflow-y':'auto', 'top':winScrollTop+'px' @@ -1567,7 +1580,7 @@ }); } else if($menuOffset.top+menuHeight > winScrollTop + winHeight){ $menu.css({ - 'top':$menuOffset.top - Math.abs((winScrollTop+winHeight)-($menuOffset.top+menuHeight)) -(parseInt($menu.css('padding-top'))+parseInt($menu.css('margin-top')))+'px' + 'top':$menuOffset.top - Math.abs((winScrollTop+winHeight)-($menuOffset.top+menuHeight)) -((parseInt($menu.css('padding-top'))*2)+(parseInt($menu.css('margin-top'))*2))+'px' }); } if($menuOffset.left + menuWidth > winWidth){ diff --git a/src/sass/jquery.contextMenu.scss b/src/sass/jquery.contextMenu.scss index fd49a747..a1ba5d7b 100644 --- a/src/sass/jquery.contextMenu.scss +++ b/src/sass/jquery.contextMenu.scss @@ -45,7 +45,9 @@ } } } - +.context-menu-list.overBoundary, .context-menu-list.overBoundary ul.context-menu-list{ + position: fixed !important; +} .context-menu-list { background: $context-menu-background-color; border: $context-menu-border-width $context-menu-border-style $context-menu-border-color; @@ -59,7 +61,7 @@ max-width: $context-menu-max-width; min-width: $context-menu-min-width; padding: $context-menu-container-padding; - position: fixed; + position: absolute; } .context-menu-item {