@vitrosoftware/common-ui-ts 1.1.11 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/common.css +44 -0
- package/css/std/controls/action-handler/action-handler-info.css +103 -0
- package/css/std/controls/action-handler/action-handler.css +247 -0
- package/css/std/controls/alert/alert.css +184 -0
- package/css/std/controls/breadcrumbs/breadcrumbs.css +137 -0
- package/css/std/controls/button/button.css +67 -0
- package/css/std/controls/command-menu/command-menu-button.css +18 -0
- package/css/std/controls/command-menu/command-menu-dropdown-button.css +155 -0
- package/css/std/controls/command-menu/command-menu-item.css +14 -0
- package/css/std/controls/command-menu/command-menu-lookup-picker.css +48 -0
- package/css/std/controls/command-menu/command-menu.css +18 -0
- package/css/std/controls/control-group/control-group.css +27 -0
- package/css/std/controls/date-picker/date-picker.css +311 -0
- package/css/std/controls/dialog/dialog-button-close.css +34 -0
- package/css/std/controls/dialog/dialog-button.css +3 -0
- package/css/std/controls/dialog/dialog-content.css +29 -0
- package/css/std/controls/dialog/dialog-footer.css +9 -0
- package/css/std/controls/dialog/dialog-header.css +5 -0
- package/css/std/controls/dialog/dialog.css +35 -0
- package/css/std/controls/input/input.css +145 -0
- package/css/std/controls/label/label.css +8 -0
- package/css/std/controls/login/img/login-background.png +0 -0
- package/css/std/controls/login/login.css +230 -0
- package/css/std/controls/lookup-picker/lookup-picker-selected-item.css +4 -0
- package/css/std/controls/lookup-picker/lookup-picker-value-list.css +52 -0
- package/css/std/controls/lookup-picker/lookup-picker.css +144 -0
- package/css/std/controls/sidebar/sidebar-item.css +49 -0
- package/css/std/controls/sidebar/sidebar.css +78 -0
- package/css/std/controls/tab-group/tab-group.css +117 -0
- package/css/std/controls/table-view/table-view-custom-date-edit.css +24 -0
- package/css/std/controls/table-view/table-view-custom-lookup-edit.css +4 -0
- package/css/std/controls/table-view/table-view.css +45 -0
- package/css/std/controls/table-view/treegrid.css +588 -0
- package/css/std/controls/task-tile/task-tile.css +91 -0
- package/css/std/controls/time-picker/time-picker.css +286 -0
- package/css/std/controls/tree-view/tree-view-context-menu.css +77 -0
- package/css/std/controls/tree-view/tree-view.css +110 -0
- package/css/std/controls/uploader/uploader.css +465 -0
- package/css/std/controls/view/view.css +5 -0
- package/css/std/controls/view-part/view-part.css +5 -0
- package/css/third-party/jquery-contextMenu/font/context-menu-icons.eot +0 -0
- package/css/third-party/jquery-contextMenu/font/context-menu-icons.ttf +0 -0
- package/css/third-party/jquery-contextMenu/font/context-menu-icons.woff +0 -0
- package/css/third-party/jquery-contextMenu/font/context-menu-icons.woff2 +0 -0
- package/css/third-party/jquery-contextMenu/jquery.contextMenu.min.css +16 -0
- package/css/third-party/jquery-svg/jquery.svg.css +10 -0
- package/css/third-party/jquery-ui/jquery-ui.min.css +28 -0
- package/css/third-party/jquery-ui/jquery-ui.structure.css +886 -0
- package/css/third-party/jquery-ui/jquery-ui.theme.min.css +26 -0
- package/css/third-party/jquery-ui/ui-icons_444444_256x240.png +0 -0
- package/css/third-party/jquery-ui/ui-icons_555555_256x240.png +0 -0
- package/css/third-party/jquery-ui/ui-icons_777620_256x240.png +0 -0
- package/css/third-party/jquery-ui/ui-icons_777777_256x240.png +0 -0
- package/css/third-party/jquery-ui/ui-icons_cc0000_256x240.png +0 -0
- package/css/third-party/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
- package/css/third-party/sweetalert2/sweetalert2.css +1154 -0
- package/css/white/controls/pdf-viewer/compare-side-by-side.css +260 -0
- package/css/white/controls/pdf-viewer/compare.css +504 -0
- package/css/white/controls/pdf-viewer/custom.css +339 -0
- package/css/white/controls/pdf-viewer/debugger.css +113 -0
- package/css/white/controls/pdf-viewer/form.css +133 -0
- package/css/white/controls/pdf-viewer/img/close-compare-viewer.png +0 -0
- package/css/white/controls/pdf-viewer/img/close-compare-viewer_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/compare-overlay.png +0 -0
- package/css/white/controls/pdf-viewer/img/compare-side-by-side.png +0 -0
- package/css/white/controls/pdf-viewer/img/delete-active.png +0 -0
- package/css/white/controls/pdf-viewer/img/delete.png +0 -0
- package/css/white/controls/pdf-viewer/img/dlg-compare-ico.png +0 -0
- package/css/white/controls/pdf-viewer/img/do-compare.png +0 -0
- package/css/white/controls/pdf-viewer/img/draw-annotation.png +0 -0
- package/css/white/controls/pdf-viewer/img/finish-align.png +0 -0
- package/css/white/controls/pdf-viewer/img/finish-align_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/fit-to-view.png +0 -0
- package/css/white/controls/pdf-viewer/img/fit-to-view_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/hide-annotation.png +0 -0
- package/css/white/controls/pdf-viewer/img/hide-colors.png +0 -0
- package/css/white/controls/pdf-viewer/img/hide-colors_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/layer-unvisible.png +0 -0
- package/css/white/controls/pdf-viewer/img/layer-visible.png +0 -0
- package/css/white/controls/pdf-viewer/img/overlay.png +0 -0
- package/css/white/controls/pdf-viewer/img/overlay_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/pan.png +0 -0
- package/css/white/controls/pdf-viewer/img/pan_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/panel-visibility.png +0 -0
- package/css/white/controls/pdf-viewer/img/panel-visibility_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/show-annotation.png +0 -0
- package/css/white/controls/pdf-viewer/img/side-by-side.png +0 -0
- package/css/white/controls/pdf-viewer/img/side-by-side_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/sidebar-notes-toggle.png +0 -0
- package/css/white/controls/pdf-viewer/img/zoom.png +0 -0
- package/css/white/controls/pdf-viewer/img/zoom_active.png +0 -0
- package/css/white/controls/pdf-viewer/pdf-viewer.css +635 -0
- package/css/white/controls/pdf-viewer/print.css +52 -0
- package/css/white/controls/pdf-viewer/sketchpad.css +16 -0
- package/css/white/controls/pdf-viewer/viewer-theme.css +82 -0
- package/css/white/controls/pdf-viewer/viewer.css +3066 -0
- package/css/white/controls/pdf-viewer/zoom.css +14 -0
- package/css/white/controls/sidebar/sidebar-item.css +54 -0
- package/css/white/controls/sidebar/sidebar.css +75 -0
- package/dist/constants/Ctrl.d.ts +28 -0
- package/dist/constants/Event.d.ts +8 -0
- package/dist/controls/ActionHandler/ActionHandler.d.ts +6 -3
- package/dist/controls/ActionHandler/ActionHandlerConstants.d.ts +13 -6
- package/dist/controls/ActionHandler/ActionInfo.d.ts +12 -0
- package/dist/controls/ActionHandler/ActionInfoItem.d.ts +13 -0
- package/dist/controls/Alert/Alert.d.ts +19 -0
- package/dist/controls/Alert/AlertConstants.d.ts +5 -0
- package/dist/controls/Breadcrumbs/Breadcrumbs.d.ts +6 -2
- package/dist/controls/Breadcrumbs/Item.d.ts +2 -1
- package/dist/controls/Button/Button.d.ts +14 -0
- package/dist/controls/CommandMenu/CommandMenu.d.ts +6 -0
- package/dist/controls/CommandMenu/CommandMenuButton.d.ts +13 -0
- package/dist/controls/CommandMenu/CommandMenuDropdownButton.d.ts +17 -0
- package/dist/controls/CommandMenu/CommandMenuItemHeader.d.ts +11 -0
- package/dist/controls/CommandMenu/CommandMenuLookupPicker.d.ts +32 -0
- package/dist/controls/CommandMenu/CommandMenuSubItem.d.ts +12 -0
- package/dist/controls/DatePicker/DatePicker.d.ts +26 -0
- package/dist/controls/DatePicker/DatePickerConstants.d.ts +12 -0
- package/dist/controls/Dialog/Dialog.d.ts +13 -0
- package/dist/controls/Dialog/DialogButton.d.ts +9 -0
- package/dist/controls/Dialog/DialogCloseButton.d.ts +8 -0
- package/dist/controls/Dialog/DialogComponent.d.ts +9 -0
- package/dist/controls/Dialog/DialogConstants.d.ts +5 -0
- package/dist/controls/Dialog/DialogContent.d.ts +6 -0
- package/dist/controls/Dialog/DialogFooter.d.ts +11 -0
- package/dist/controls/Dialog/DialogHeader.d.ts +6 -0
- package/dist/controls/Input/Input.d.ts +32 -0
- package/dist/controls/Input/InputConstants.d.ts +11 -0
- package/dist/controls/Label/Label.d.ts +9 -0
- package/dist/controls/Label/LabelConstants.d.ts +3 -0
- package/dist/controls/Login/Login.d.ts +17 -0
- package/dist/controls/Login/LoginConstants.d.ts +18 -0
- package/dist/controls/Login/LoginFooter.d.ts +10 -0
- package/dist/controls/Login/LoginInput.d.ts +17 -0
- package/dist/controls/LookupPicker/LookupPicker.d.ts +32 -0
- package/dist/controls/LookupPicker/LookupPickerConstants.d.ts +3 -0
- package/dist/controls/LookupPicker/SelectedValueList.d.ts +11 -0
- package/dist/controls/LookupPicker/ValueList.d.ts +16 -0
- package/dist/controls/PdfViewer/PdfViewer.d.ts +6 -0
- package/dist/controls/PdfViewer/PdfViewerContext.d.ts +7 -0
- package/dist/controls/PdfViewer/Viewer.d.ts +6 -0
- package/dist/controls/Sidebar/Item.d.ts +9 -0
- package/dist/controls/Sidebar/LinkItem.d.ts +15 -0
- package/dist/controls/Sidebar/Section.d.ts +10 -0
- package/dist/controls/Sidebar/SectionList.d.ts +9 -0
- package/dist/controls/Sidebar/Sidebar.d.ts +13 -0
- package/dist/controls/Sidebar/SidebarConstants.d.ts +4 -0
- package/dist/controls/Sidebar/SidebarItem.d.ts +10 -0
- package/dist/controls/Sidebar/SidebarSection.d.ts +7 -0
- package/dist/controls/TableView/TableViewConstants.d.ts +4 -0
- package/dist/controls/TaskTile/TaskTile.d.ts +18 -0
- package/dist/controls/TelerikUploader/TelerikUploaderConstants.d.ts +14 -2
- package/dist/controls/TelerikUploader/TelerikUploaderContextImpl.d.ts +22 -2
- package/dist/controls/TimePicker/TimePicker.d.ts +20 -0
- package/dist/controls/TimePicker/TimePickerConstants.d.ts +12 -0
- package/dist/index.css +3138 -467
- package/dist/index.d.ts +64 -25
- package/dist/index.js +4713 -331
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +4694 -334
- package/dist/index.modern.js.map +1 -1
- package/lib/autosize/autosize.min.js +1 -0
- package/lib/jquery-context-menu/jquery.contextMenu.min.js +2 -0
- package/lib/jquery-context-menu/jquery.ui.position.js +513 -0
- package/lib/jquery-ui/jquery-ui.min.js +13 -0
- package/lib/jquery.svg/jquery.svg.min.js +6 -0
- package/lib/jquery.svg/jquery.svganim.min.js +6 -0
- package/lib/jquery.svg/jquery.svgdom.min.js +6 -0
- package/lib/jquery.svg/jquery.svgfilter.min.js +6 -0
- package/lib/jquery.svg/jquery.svggraph.min.js +6 -0
- package/lib/jquery.svg/jquery.svgplot.min.js +6 -0
- package/lib/pdf-js/pdf.js +15614 -0
- package/lib/third-party.js +97104 -0
- package/package.json +12 -5
- package/src/controls/PdfViewer/js/init-viewer-page.js +18 -0
- package/src/controls/PdfViewer/js/pdf-viewer.js +16522 -0
- package/css/white/common.css +0 -11
- /package/css/{white/third-party → third-party}/jstree/32px.png +0 -0
- /package/css/{white/third-party → third-party}/jstree/40px.png +0 -0
- /package/css/{white/third-party → third-party}/jstree/style.min.css +0 -0
- /package/css/{white/third-party → third-party}/jstree/throbber.gif +0 -0
- /package/css/{white/third-party → third-party/kendo}/kendo.css +0 -0
- /package/css/white/{third-party → controls/table-view}/treegrid.css +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).autosize=t()}(this,function(){var e,t,n="function"==typeof Map?new Map:(e=[],t=[],{has:function(t){return e.indexOf(t)>-1},get:function(n){return t[e.indexOf(n)]},set:function(n,o){-1===e.indexOf(n)&&(e.push(n),t.push(o))},delete:function(n){var o=e.indexOf(n);o>-1&&(e.splice(o,1),t.splice(o,1))}}),o=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){o=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(e){var t=n.get(e);t&&t.destroy()}function i(e){var t=n.get(e);t&&t.update()}var l=null;return"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return function(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!n.has(e)){var t,r=null,i=null,l=null,d=function(){e.clientWidth!==i&&c()},u=function(t){window.removeEventListener("resize",d,!1),e.removeEventListener("input",c,!1),e.removeEventListener("keyup",c,!1),e.removeEventListener("autosize:destroy",u,!1),e.removeEventListener("autosize:update",c,!1),Object.keys(t).forEach(function(n){e.style[n]=t[n]}),n.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",u,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",c,!1),window.addEventListener("resize",d,!1),e.addEventListener("input",c,!1),e.addEventListener("autosize:update",c,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",n.set(e,{destroy:u,update:c}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),r="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(r)&&(r=0),c()}function a(t){var n=e.style.width;e.style.width="0px",e.style.width=n,e.style.overflowY=t}function s(){if(0!==e.scrollHeight){var t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),n=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+r+"px",i=e.clientWidth,t.forEach(function(e){e.node.scrollTop=e.scrollTop}),n&&(document.documentElement.scrollTop=n)}}function c(){s();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(a("scroll"),s(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(a("hidden"),s(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),l!==r){l=r;var i=o("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e}),l});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(m){"use strict";var a;m.support.htmlMenuitem="HTMLMenuItemElement"in window,m.support.htmlCommand="HTMLCommandElement"in window,m.support.eventSelectstart="onselectstart"in document.documentElement,m.ui&&m.widget||(m.cleanData=(a=m.cleanData,function(e){var t,n,o;for(o=0;null!=e[o];o++){n=e[o];try{(t=m._data(n,"events"))&&t.remove&&m(n).triggerHandler("remove")}catch(e){}}a(e)}));var c=null,d=!1,p=m(window),f=0,h={},x={},v={},g={selector:null,appendTo:null,trigger:"right",autoHide:!1,delay:200,reposition:!0,hideOnSecondTrigger:!1,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(e){if(m.ui&&m.ui.position)e.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none");else{var t=this.offset();t.top+=this.outerHeight(),t.left+=this.outerWidth()/2-e.outerWidth()/2,e.css(t)}},position:function(e,t,n){var o;if(t||n){if("maintain"===t&&"maintain"===n)o=e.$menu.position();else{var a=e.$menu.offsetParent().offset();o={top:n-a.top,left:t-a.left}}var s=p.scrollTop()+p.height(),i=p.scrollLeft()+p.width(),c=e.$menu.outerHeight(),l=e.$menu.outerWidth();o.top+c>s&&(o.top-=c),o.top<0&&(o.top=0),o.left+l>i&&(o.left-=l),o.left<0&&(o.left=0),e.$menu.css(o)}else e.determinePosition.call(this,e.$menu)},positionSubmenu:function(e){if(void 0!==e)if(m.ui&&m.ui.position)e.css("display","block").position({my:"left top-5",at:"right top",of:this,collision:"flipfit fit"}).css("display","");else{var t={top:-9,left:this.outerWidth()-5};e.css(t)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{preShow:m.noop,show:m.noop,hide:m.noop,activated:m.noop},callback:null,items:{}},s={timer:null,pageX:null,pageY:null},b={abortevent:function(e){e.preventDefault(),e.stopImmediatePropagation()},contextmenu:function(e){var t=m(this);if(!1!==e.data.events.preShow(t,e)&&("right"===e.data.trigger&&(e.preventDefault(),e.stopImmediatePropagation()),!("right"!==e.data.trigger&&"demand"!==e.data.trigger&&e.originalEvent||!(void 0===e.mouseButton||!e.data||"left"===e.data.trigger&&0===e.mouseButton||"right"===e.data.trigger&&2===e.mouseButton)||t.hasClass("context-menu-active")||t.hasClass("context-menu-disabled")))){if(c=t,e.data.build){var n=e.data.build(c,e);if(!1===n)return;if(e.data=m.extend(!0,{},g,e.data,n||{}),!e.data.items||m.isEmptyObject(e.data.items))throw window.console&&(console.error||console.log).call(console,"No items specified to show in contextMenu"),new Error("No Items specified");e.data.$trigger=c,$.create(e.data)}$.show.call(t,e.data,e.pageX,e.pageY)}},click:function(e){e.preventDefault(),e.stopImmediatePropagation(),m(this).trigger(m.Event("contextmenu",{data:e.data,pageX:e.pageX,pageY:e.pageY}))},mousedown:function(e){var t=m(this);c&&c.length&&!c.is(t)&&c.data("contextMenu").$menu.trigger("contextmenu:hide"),2===e.button&&(c=t.data("contextMenuActive",!0))},mouseup:function(e){var t=m(this);t.data("contextMenuActive")&&c&&c.length&&c.is(t)&&!t.hasClass("context-menu-disabled")&&(e.preventDefault(),e.stopImmediatePropagation(),(c=t).trigger(m.Event("contextmenu",{data:e.data,pageX:e.pageX,pageY:e.pageY}))),t.removeData("contextMenuActive")},mouseenter:function(e){var t=m(this),n=m(e.relatedTarget),o=m(document);n.is(".context-menu-list")||n.closest(".context-menu-list").length||c&&c.length||(s.pageX=e.pageX,s.pageY=e.pageY,s.data=e.data,o.on("mousemove.contextMenuShow",b.mousemove),s.timer=setTimeout(function(){s.timer=null,o.off("mousemove.contextMenuShow"),(c=t).trigger(m.Event("contextmenu",{data:s.data,pageX:s.pageX,pageY:s.pageY}))},e.data.delay))},mousemove:function(e){s.pageX=e.pageX,s.pageY=e.pageY},mouseleave:function(e){var t=m(e.relatedTarget);if(!t.is(".context-menu-list")&&!t.closest(".context-menu-list").length){try{clearTimeout(s.timer)}catch(e){}s.timer=null}},layerClick:function(a){var s,i,c=m(this).data("contextMenuRoot"),l=a.button,r=a.pageX,u=a.pageY,d=void 0===r;a.preventDefault(),setTimeout(function(){if(d)null!=c&&null!==c.$menu&&void 0!==c.$menu&&c.$menu.trigger("contextmenu:hide");else{var e,t="left"===c.trigger&&0===l||"right"===c.trigger&&2===l;if(document.elementFromPoint&&c.$layer){if(c.$layer.hide(),(s=document.elementFromPoint(r-p.scrollLeft(),u-p.scrollTop())).isContentEditable){var n=document.createRange(),o=window.getSelection();n.selectNode(s),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}m(s).trigger(a),c.$layer.show()}if(c.hideOnSecondTrigger&&t&&null!==c.$menu&&void 0!==c.$menu)c.$menu.trigger("contextmenu:hide");else{if(c.reposition&&t)if(document.elementFromPoint){if(c.$trigger.is(s))return void c.position.call(c.$trigger,c,r,u)}else if(i=c.$trigger.offset(),e=m(window),i.top+=e.scrollTop(),i.top<=a.pageY&&(i.left+=e.scrollLeft(),i.left<=a.pageX&&(i.bottom=i.top+c.$trigger.outerHeight(),i.bottom>=a.pageY&&(i.right=i.left+c.$trigger.outerWidth(),i.right>=a.pageX))))return void c.position.call(c.$trigger,c,r,u);s&&t&&c.$trigger.one("contextmenu:hidden",function(){m(s).contextMenu({x:r,y:u,button:l})}),null!=c&&null!==c.$menu&&void 0!==c.$menu&&c.$menu.trigger("contextmenu:hide")}}},50)},keyStop:function(e,t){t.isInput||e.preventDefault(),e.stopPropagation()},key:function(e){var t={};c&&(t=c.data("contextMenu")||{}),void 0===t.zIndex&&(t.zIndex=0);var n=0,o=function(e){""!==e.style.zIndex?n=e.style.zIndex:null!==e.offsetParent&&void 0!==e.offsetParent?o(e.offsetParent):null!==e.parentElement&&void 0!==e.parentElement&&o(e.parentElement)};if(o(e.target),!(t.$menu&&parseInt(n,10)>parseInt(t.$menu.css("zIndex"),10))){switch(e.keyCode){case 9:case 38:if(b.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(b.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(b.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;if(t.$selected.parent().hasClass("context-menu-root"))break;var a=t.$selected.parent().parent();return t.$selected.trigger("contextmenu:blur"),void(t.$selected=a);case 39:if(b.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;var s=t.$selected.data("contextMenu")||{};if(s.$menu&&t.$selected.hasClass("context-menu-submenu"))return t.$selected=null,s.$selected=null,void s.$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(b.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 b.keyStop(e,t);case 27:return b.keyStop(e,t),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("contextmenu:hide"));default:var i=String.fromCharCode(e.keyCode).toUpperCase();if(t.accesskeys&&t.accesskeys[i])return void t.accesskeys[i].$node.trigger(t.accesskeys[i].$menu?"contextmenu:focus":"mouseup")}e.stopPropagation(),void 0!==t.$selected&&null!==t.$selected&&t.$selected.trigger(e)}},prevItem:function(e){e.stopPropagation();var t=m(this).data("contextMenu")||{},n=m(this).data("contextMenuRoot")||{};if(t.$selected){var o=t.$selected;(t=t.$selected.parent().data("contextMenu")||{}).$selected=o}for(var a=t.$menu.children(),s=t.$selected&&t.$selected.prev().length?t.$selected.prev():a.last(),i=s;s.hasClass(n.classNames.disabled)||s.hasClass(n.classNames.notSelectable)||s.is(":hidden");)if((s=s.prev().length?s.prev():a.last()).is(i))return;t.$selected&&b.itemMouseleave.call(t.$selected.get(0),e),b.itemMouseenter.call(s.get(0),e);var c=s.find("input, textarea, select");c.length&&c.focus()},nextItem:function(e){e.stopPropagation();var t=m(this).data("contextMenu")||{},n=m(this).data("contextMenuRoot")||{};if(t.$selected){var o=t.$selected;(t=t.$selected.parent().data("contextMenu")||{}).$selected=o}for(var a=t.$menu.children(),s=t.$selected&&t.$selected.next().length?t.$selected.next():a.first(),i=s;s.hasClass(n.classNames.disabled)||s.hasClass(n.classNames.notSelectable)||s.is(":hidden");)if((s=s.next().length?s.next():a.first()).is(i))return;t.$selected&&b.itemMouseleave.call(t.$selected.get(0),e),b.itemMouseenter.call(s.get(0),e);var c=s.find("input, textarea, select");c.length&&c.focus()},focusInput:function(){var e=m(this).closest(".context-menu-item"),t=e.data(),n=t.contextMenu,o=t.contextMenuRoot;o.$selected=n.$selected=e,o.isInput=n.isInput=!0},blurInput:function(){var e=m(this).closest(".context-menu-item").data(),t=e.contextMenu;e.contextMenuRoot.isInput=t.isInput=!1},menuMouseenter:function(){m(this).data().contextMenuRoot.hovering=!0},menuMouseleave:function(e){var t=m(this).data().contextMenuRoot;t.$layer&&t.$layer.is(e.relatedTarget)&&(t.hovering=!1)},itemMouseenter:function(e){var t=m(this),n=t.data(),o=n.contextMenu,a=n.contextMenuRoot;a.hovering=!0,e&&a.$layer&&a.$layer.is(e.relatedTarget)&&(e.preventDefault(),e.stopImmediatePropagation()),(o.$menu?o:a).$menu.children("."+a.classNames.hover).trigger("contextmenu:blur").children(".hover").trigger("contextmenu:blur"),t.hasClass(a.classNames.disabled)||t.hasClass(a.classNames.notSelectable)?o.$selected=null:t.trigger("contextmenu:focus")},itemMouseleave:function(e){var t=m(this),n=t.data(),o=n.contextMenu,a=n.contextMenuRoot;if(a!==o&&a.$layer&&a.$layer.is(e.relatedTarget))return void 0!==a.$selected&&null!==a.$selected&&a.$selected.trigger("contextmenu:blur"),e.preventDefault(),e.stopImmediatePropagation(),void(a.$selected=o.$selected=o.$node);o&&o.$menu&&o.$menu.hasClass("context-menu-visible")||t.trigger("contextmenu:blur")},itemClick:function(e){var t,n=m(this),o=n.data(),a=o.contextMenu,s=o.contextMenuRoot,i=o.contextMenuKey;if(!(!a.items[i]||n.is("."+s.classNames.disabled+", .context-menu-separator, ."+s.classNames.notSelectable)||n.is(".context-menu-submenu")&&!1===s.selectableSubMenu)){if(e.preventDefault(),e.stopImmediatePropagation(),m.isFunction(a.callbacks[i])&&Object.prototype.hasOwnProperty.call(a.callbacks,i))t=a.callbacks[i];else{if(!m.isFunction(s.callback))return;t=s.callback}!1!==t.call(s.$trigger,i,s,e)?s.$menu.trigger("contextmenu:hide"):s.$menu.parent().length&&$.update.call(s.$trigger,s)}},inputClick:function(e){e.stopImmediatePropagation()},hideMenu:function(e,t){var n=m(this).data("contextMenuRoot");$.hide.call(n.$trigger,n,t&&t.force)},focusItem:function(e){e.stopPropagation();var t=m(this),n=t.data(),o=n.contextMenu,a=n.contextMenuRoot;t.hasClass(a.classNames.disabled)||t.hasClass(a.classNames.notSelectable)||(t.addClass([a.classNames.hover,a.classNames.visible].join(" ")).parent().find(".context-menu-item").not(t).removeClass(a.classNames.visible).filter("."+a.classNames.hover).trigger("contextmenu:blur"),o.$selected=a.$selected=t,o&&o.$node&&o.$node.hasClass("context-menu-submenu")&&o.$node.addClass(a.classNames.hover),o.$node&&a.positionSubmenu.call(o.$node,o.$menu))},blurItem:function(e){e.stopPropagation();var t=m(this),n=t.data(),o=n.contextMenu,a=n.contextMenuRoot;o.autoHide&&t.removeClass(a.classNames.visible),t.removeClass(a.classNames.hover),o.$selected=null}},$={show:function(n,e,t){var o=m(this),a={};if(m("#context-menu-layer").trigger("mousedown"),n.$trigger=o,!1!==n.events.show.call(o,n))if(!1!==$.update.call(o,n)){if(n.position.call(o,n,e,t),n.zIndex){var s=n.zIndex;"function"==typeof n.zIndex&&(s=n.zIndex.call(o,n)),a.zIndex=function(e){for(var t=0,n=e;t=Math.max(t,parseInt(n.css("z-index"),10)||0),(n=n.parent())&&n.length&&!(-1<"html body".indexOf(n.prop("nodeName").toLowerCase())););return t}(o)+s}$.layer.call(n.$menu,n,a.zIndex),n.$menu.find("ul").css("zIndex",a.zIndex+1),n.$menu.css(a)[n.animation.show](n.animation.duration,function(){o.trigger("contextmenu:visible"),$.activated(n),n.events.activated(n)}),o.data("contextMenu",n).addClass("context-menu-active"),m(document).off("keydown.contextMenu").on("keydown.contextMenu",b.key),n.autoHide&&m(document).on("mousemove.contextMenuAutoHide",function(e){var t=o.offset();t.right=t.left+o.outerWidth(),t.bottom=t.top+o.outerHeight(),!n.$layer||n.hovering||e.pageX>=t.left&&e.pageX<=t.right&&e.pageY>=t.top&&e.pageY<=t.bottom||setTimeout(function(){n.hovering||null===n.$menu||void 0===n.$menu||n.$menu.trigger("contextmenu:hide")},50)})}else c=null;else c=null},hide:function(t,e){var n=m(this);if(t=t||(n.data("contextMenu")||{}),e||!t.events||!1!==t.events.hide.call(n,t)){if(n.removeData("contextMenu").removeClass("context-menu-active"),t.$layer){setTimeout((o=t.$layer,function(){o.remove()}),10);try{delete t.$layer}catch(e){t.$layer=null}}var o;c=null,t.$menu.find("."+t.classNames.hover).trigger("contextmenu:blur"),t.$selected=null,t.$menu.find("."+t.classNames.visible).removeClass(t.classNames.visible),m(document).off(".contextMenuAutoHide").off("keydown.contextMenu"),t.$menu&&t.$menu[t.animation.hide](t.animation.duration,function(){t.build&&(t.$menu.remove(),m.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(){n.trigger("contextmenu:hidden")},10)})}},create:function(r,u){function d(e){var t=m("<span></span>");if(e._accesskey)e._beforeAccesskey&&t.append(document.createTextNode(e._beforeAccesskey)),m("<span></span>").addClass("context-menu-accesskey").text(e._accesskey).appendTo(t),e._afterAccesskey&&t.append(document.createTextNode(e._afterAccesskey));else if(e.isHtmlName){if(void 0!==e.accesskey)throw new Error("accesskeys are not compatible with HTML names and cannot be used together in the same item");t.html(e.name)}else t.text(e.name);return t}void 0===u&&(u=r),r.$menu=m('<ul class="context-menu-list"></ul>').addClass(r.className||"").data({contextMenu:r,contextMenuRoot:u}),r.dataAttr&&m.each(r.dataAttr,function(e,t){r.$menu.attr("data-"+r.key,t)}),m.each(["callbacks","commands","inputs"],function(e,t){r[t]={},u[t]||(u[t]={})}),u.accesskeys||(u.accesskeys={}),m.each(r.items,function(n,o){var e=m('<li class="context-menu-item"></li>').addClass(o.className||""),t=null,a=null;if(e.on("click",m.noop),"string"!=typeof o&&"cm_separator"!==o.type||(o={type:"cm_seperator"}),o.$node=e.data({contextMenu:r,contextMenuRoot:u,contextMenuKey:n}),void 0!==o.accesskey)for(var s,i=function(e){for(var t,n=e.split(/\s+/),o=[],a=0;t=n[a];a++)t=t.charAt(0).toUpperCase(),o.push(t);return o}(o.accesskey),c=0;s=i[c];c++)if(!u.accesskeys[s]){var l=(u.accesskeys[s]=o).name.match(new RegExp("^(.*?)("+s+")(.*)$","i"));l&&(o._beforeAccesskey=l[1],o._accesskey=l[2],o._afterAccesskey=l[3]);break}if(o.type&&v[o.type])v[o.type].call(e,o,r,u),m.each([r,u],function(e,t){t.commands[n]=o,!m.isFunction(o.callback)||void 0!==t.callbacks[n]&&void 0!==r.type||(t.callbacks[n]=o.callback)});else{switch("cm_seperator"===o.type?e.addClass("context-menu-separator "+u.classNames.notSelectable):"html"===o.type?e.addClass("context-menu-html "+u.classNames.notSelectable):"sub"!==o.type&&o.type?(t=m("<label></label>").appendTo(e),d(o).appendTo(t),e.addClass("context-menu-input"),r.hasTypes=!0,m.each([r,u],function(e,t){t.commands[n]=o,t.inputs[n]=o})):o.items&&(o.type="sub"),o.type){case"cm_seperator":break;case"text":a=m('<input type="text" value="1" name="" />').attr("name","context-menu-input-"+n).val(o.value||"").appendTo(t);break;case"textarea":a=m('<textarea name=""></textarea>').attr("name","context-menu-input-"+n).val(o.value||"").appendTo(t),o.height&&a.height(o.height);break;case"checkbox":a=m('<input type="checkbox" value="1" name="" />').attr("name","context-menu-input-"+n).val(o.value||"").prop("checked",!!o.selected).prependTo(t);break;case"radio":a=m('<input type="radio" value="1" name="" />').attr("name","context-menu-input-"+o.radio).val(o.value||"").prop("checked",!!o.selected).prependTo(t);break;case"select":a=m('<select name=""></select>').attr("name","context-menu-input-"+n).appendTo(t),o.options&&(m.each(o.options,function(e,t){m("<option></option>").val(e).text(t).appendTo(a)}),a.val(o.selected));break;case"sub":d(o).appendTo(e),o.appendTo=o.$node,e.data("contextMenu",o).addClass("context-menu-submenu"),o.callback=null,"function"==typeof o.items.then?$.processPromises(o,u,o.items):$.create(o,u);break;case"html":m(o.html).appendTo(e);break;default:m.each([r,u],function(e,t){t.commands[n]=o,!m.isFunction(o.callback)||void 0!==t.callbacks[n]&&void 0!==r.type||(t.callbacks[n]=o.callback)}),d(o).appendTo(e)}o.type&&"sub"!==o.type&&"html"!==o.type&&"cm_seperator"!==o.type&&(a.on("focus",b.focusInput).on("blur",b.blurInput),o.events&&a.on(o.events,r)),o.icon&&(m.isFunction(o.icon)?o._icon=o.icon.call(this,this,e,n,o):"string"!=typeof o.icon||"fab "!==o.icon.substring(0,4)&&"fas "!==o.icon.substring(0,4)&&"fad "!==o.icon.substring(0,4)&&"far "!==o.icon.substring(0,4)&&"fal "!==o.icon.substring(0,4)?"string"==typeof o.icon&&"fa-"===o.icon.substring(0,3)?o._icon=u.classNames.icon+" "+u.classNames.icon+"--fa fa "+o.icon:o._icon=u.classNames.icon+" "+u.classNames.icon+"-"+o.icon:(e.addClass(u.classNames.icon+" "+u.classNames.icon+"--fa5"),o._icon=m('<i class="'+o.icon+'"></i>')),"string"==typeof o._icon?e.addClass(o._icon):e.prepend(o._icon))}o.$input=a,o.$label=t,e.appendTo(r.$menu),!r.hasTypes&&m.support.eventSelectstart&&e.on("selectstart.disableTextSelect",b.abortevent)}),r.$node||r.$menu.css("display","none").addClass("context-menu-root"),r.$menu.appendTo(r.appendTo||document.body)},resize:function(e,t){var n;e.css({position:"absolute",display:"block"}),e.data("width",(n=e.get(0)).getBoundingClientRect?Math.ceil(n.getBoundingClientRect().width):e.outerWidth()+1),e.css({position:"static",minWidth:"0px",maxWidth:"100000px"}),e.find("> li > ul").each(function(){$.resize(m(this),!0)}),t||e.find("ul").addBack().css({position:"",display:"",minWidth:"",maxWidth:""}).outerWidth(function(){return m(this).data("width")})},update:function(i,c){var l=this;void 0===c&&(c=i,$.resize(i.$menu));var r=!1;return i.$menu.children().each(function(){var e,t=m(this),n=t.data("contextMenuKey"),o=i.items[n],a=m.isFunction(o.disabled)&&o.disabled.call(l,n,c)||!0===o.disabled;if((e=m.isFunction(o.visible)?o.visible.call(l,n,c):void 0===o.visible||!0===o.visible)&&(r=!0),t[e?"show":"hide"](),t[a?"addClass":"removeClass"](c.classNames.disabled),m.isFunction(o.icon)){t.removeClass(o._icon);var s=o.icon.call(this,l,t,n,o);"string"==typeof s?t.addClass(s):t.prepend(s)}if(o.type)switch(t.find("input, select, textarea").prop("disabled",a),o.type){case"text":case"textarea":o.$input.val(o.value||"");break;case"checkbox":case"radio":o.$input.val(o.value||"").prop("checked",!!o.selected);break;case"select":o.$input.val((0===o.selected?"0":o.selected)||"")}o.$menu&&$.update.call(l,o,c)&&(r=!0)}),r},layer:function(e,t){var n=e.$layer=m('<div id="context-menu-layer"></div>').css({height:p.height(),width:p.width(),display:"block",position:"fixed","z-index":t,top:0,left:0,opacity:0,filter:"alpha(opacity=0)","background-color":"#000"}).data("contextMenuRoot",e).insertBefore(this).on("contextmenu",b.abortevent).on("mousedown",b.layerClick);return void 0===document.body.style.maxWidth&&n.css({position:"absolute",height:m(document).height()}),n},processPromises:function(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}}),a(e,t,n)}function a(e,t,n){void 0!==t.$menu&&t.$menu.is(":visible")&&(e.$node.removeClass(t.classNames.iconLoadingClass),e.items=n,$.create(e,t,!0),$.update(e,t),t.positionSubmenu.call(e.$node,e.$menu))}e.$node.addClass(t.classNames.iconLoadingClass),n.then(function(e,t,n){void 0===n&&o(void 0),a(e,t,n)}.bind(this,e,t),o.bind(this,e,t))},activated:function(e){var t=e.$menu,n=t.offset(),o=m(window).height(),a=m(window).scrollTop(),s=t.height();o<s?t.css({height:o+"px","overflow-x":"hidden","overflow-y":"auto",top:a+"px"}):(n.top<a||n.top+s>a+o)&&t.css({top:a+"px"})}};function l(e){return e.id&&m('label[for="'+e.id+'"]').val()||e.name}m.fn.contextMenu=function(e){var t=this,n=e;if(0<this.length)if(void 0===e)this.first().trigger("contextmenu");else if(void 0!==e.x&&void 0!==e.y)this.first().trigger(m.Event("contextmenu",{pageX:e.x,pageY:e.y,mouseButton:e.button}));else if("hide"===e){var o=this.first().data("contextMenu")?this.first().data("contextMenu").$menu:null;o&&o.trigger("contextmenu:hide")}else"destroy"===e?m.contextMenu("destroy",{context:this}):m.isPlainObject(e)?(e.context=this,m.contextMenu("create",e)):e?this.removeClass("context-menu-disabled"):e||this.addClass("context-menu-disabled");else m.each(x,function(){this.selector===t.selector&&(n.data=this,m.extend(n.data,{trigger:"demand"}))}),b.contextmenu.call(n.target,n);return this},m.contextMenu=function(e,t){"string"!=typeof e&&(t=e,e="create"),"string"==typeof t?t={selector:t}:void 0===t&&(t={});var n=m.extend(!0,{},g,t||{}),o=m(document),a=o,s=!1;switch(n.context&&n.context.length?(a=m(n.context).first(),n.context=a.get(0),s=!m(n.context).is(document)):n.context=document,e){case"update":if(s)$.update(a);else for(var i in x)x.hasOwnProperty(i)&&$.update(x[i]);break;case"create":if(!n.selector)throw new Error("No selector specified");if(n.selector.match(/.context-menu-(list|item|input)($|\s)/))throw new Error('Cannot bind to selector "'+n.selector+'" as it contains a reserved className');if(!n.build&&(!n.items||m.isEmptyObject(n.items)))throw new Error("No Items specified");if(f++,n.ns=".contextMenu"+f,s||(h[n.selector]=n.ns),(x[n.ns]=n).trigger||(n.trigger="right"),!d){var c="click"===n.itemClickEvent?"click.contextMenu":"mouseup.contextMenu",l={"contextmenu:focus.contextMenu":b.focusItem,"contextmenu:blur.contextMenu":b.blurItem,"contextmenu.contextMenu":b.abortevent,"mouseenter.contextMenu":b.itemMouseenter,"mouseleave.contextMenu":b.itemMouseleave};l[c]=b.itemClick,o.on({"contextmenu:hide.contextMenu":b.hideMenu,"prevcommand.contextMenu":b.prevItem,"nextcommand.contextMenu":b.nextItem,"contextmenu.contextMenu":b.abortevent,"mouseenter.contextMenu":b.menuMouseenter,"mouseleave.contextMenu":b.menuMouseleave},".context-menu-list").on("mouseup.contextMenu",".context-menu-input",b.inputClick).on(l,".context-menu-item"),d=!0}switch(a.on("contextmenu"+n.ns,n.selector,n,b.contextmenu),s&&a.on("remove"+n.ns,function(){m(this).contextMenu("destroy")}),n.trigger){case"hover":a.on("mouseenter"+n.ns,n.selector,n,b.mouseenter).on("mouseleave"+n.ns,n.selector,n,b.mouseleave);break;case"left":a.on("click"+n.ns,n.selector,n,b.click);break;case"touchstart":a.on("touchstart"+n.ns,n.selector,n,b.click)}n.build||$.create(n);break;case"destroy":var r;if(s){var u=n.context;m.each(x,function(e,t){if(!t)return!0;if(!m(u).is(t.selector))return!0;(r=m(".context-menu-list").filter(":visible")).length&&r.data().contextMenuRoot.$trigger.is(m(t.context).find(t.selector))&&r.trigger("contextmenu:hide",{force:!0});try{x[t.ns].$menu&&x[t.ns].$menu.remove(),delete x[t.ns]}catch(e){x[t.ns]=null}return m(t.context).off(t.ns),!0})}else if(n.selector){if(h[n.selector]){(r=m(".context-menu-list").filter(":visible")).length&&r.data().contextMenuRoot.$trigger.is(n.selector)&&r.trigger("contextmenu:hide",{force:!0});try{x[h[n.selector]].$menu&&x[h[n.selector]].$menu.remove(),delete x[h[n.selector]]}catch(e){x[h[n.selector]]=null}o.off(h[n.selector])}}else o.off(".contextMenu .contextMenuAutoHide"),m.each(x,function(e,t){m(t.context).off(t.ns)}),h={},f=0,d=!(x={}),m("#context-menu-layer, .context-menu-list").remove();break;case"html5":(!m.support.htmlCommand&&!m.support.htmlMenuitem||"boolean"==typeof t&&t)&&m('menu[type="context"]').each(function(){this.id&&m.contextMenu({selector:"[contextmenu="+this.id+"]",items:m.contextMenu.fromMenu(this)})}).css("display","none");break;default:throw new Error('Unknown operation "'+e+'"')}return this},m.contextMenu.setInputValues=function(e,n){void 0===n&&(n={}),m.each(e.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]||""}})},m.contextMenu.getInputValues=function(e,n){return void 0===n&&(n={}),m.each(e.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},m.contextMenu.fromMenu=function(e){var t={};return function s(i,e,c){return c=c||0,e.each(function(){var e,t,n=m(this),o=this,a=this.nodeName.toLowerCase();switch("label"===a&&n.find("input, textarea, select").length&&(e=n.text(),a=(o=(n=n.children().first()).get(0)).nodeName.toLowerCase()),a){case"menu":t={name:n.attr("label"),items:{}},c=s(t.items,n.children(),c);break;case"a":case"button":t={name:n.text(),disabled:!!n.attr("disabled"),callback:function(){n.get(0).click()}};break;case"menuitem":case"command":switch(n.attr("type")){case void 0:case"command":case"menuitem":t={name:n.attr("label"),disabled:!!n.attr("disabled"),icon:n.attr("icon"),callback:function(){n.get(0).click()}};break;case"checkbox":t={type:"checkbox",disabled:!!n.attr("disabled"),name:n.attr("label"),selected:!!n.attr("checked")};break;case"radio":t={type:"radio",disabled:!!n.attr("disabled"),name:n.attr("label"),radio:n.attr("radiogroup"),value:n.attr("id"),selected:!!n.attr("checked")};break;default:t=void 0}break;case"hr":t="-------";break;case"input":switch(n.attr("type")){case"text":t={type:"text",name:e||l(o),disabled:!!n.attr("disabled"),value:n.val()};break;case"checkbox":t={type:"checkbox",name:e||l(o),disabled:!!n.attr("disabled"),selected:!!n.attr("checked")};break;case"radio":t={type:"radio",name:e||l(o),disabled:!!n.attr("disabled"),radio:!!n.attr("name"),value:n.val(),selected:!!n.attr("checked")};break;default:t=void 0}break;case"select":t={type:"select",name:e||l(o),disabled:!!n.attr("disabled"),selected:n.val(),options:{}},n.children().each(function(){t.options[this.value]=m(this).text()});break;case"textarea":t={type:"textarea",name:e||l(o),disabled:!!n.attr("disabled"),value:n.val()};break;case"label":break;default:t={type:"html",html:n.clone(!0)}}t&&(i["key"+ ++c]=t)}),c}(t,m(e).children()),t},m.contextMenu.defaults=g,m.contextMenu.types=v,m.contextMenu.handle=b,m.contextMenu.op=$,m.contextMenu.menus=x});
|
|
2
|
+
//# sourceMappingURL=jquery.contextMenu.min.js.map
|
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
/*! jQuery UI - v1.12.1 - 2016-09-16
|
|
2
|
+
* http://jqueryui.com
|
|
3
|
+
* Includes: position.js
|
|
4
|
+
* Copyright jQuery Foundation and other contributors; Licensed MIT */
|
|
5
|
+
|
|
6
|
+
(function( factory ) {
|
|
7
|
+
if ( typeof define === "function" && define.amd ) {
|
|
8
|
+
|
|
9
|
+
// AMD. Register as an anonymous module.
|
|
10
|
+
define([ "jquery" ], factory );
|
|
11
|
+
} else {
|
|
12
|
+
|
|
13
|
+
// Browser globals
|
|
14
|
+
factory( jQuery );
|
|
15
|
+
}
|
|
16
|
+
}(function( $ ) {
|
|
17
|
+
|
|
18
|
+
$.ui = $.ui || {};
|
|
19
|
+
|
|
20
|
+
var version = $.ui.version = "1.12.1";
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/*!
|
|
24
|
+
* jQuery UI Position 1.12.1
|
|
25
|
+
* http://jqueryui.com
|
|
26
|
+
*
|
|
27
|
+
* Copyright jQuery Foundation and other contributors
|
|
28
|
+
* Released under the MIT license.
|
|
29
|
+
* http://jquery.org/license
|
|
30
|
+
*
|
|
31
|
+
* http://api.jqueryui.com/position/
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
//>>label: Position
|
|
35
|
+
//>>group: Core
|
|
36
|
+
//>>description: Positions elements relative to other elements.
|
|
37
|
+
//>>docs: http://api.jqueryui.com/position/
|
|
38
|
+
//>>demos: http://jqueryui.com/position/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
( function() {
|
|
42
|
+
var cachedScrollbarWidth,
|
|
43
|
+
max = Math.max,
|
|
44
|
+
abs = Math.abs,
|
|
45
|
+
rhorizontal = /left|center|right/,
|
|
46
|
+
rvertical = /top|center|bottom/,
|
|
47
|
+
roffset = /[\+\-]\d+(\.[\d]+)?%?/,
|
|
48
|
+
rposition = /^\w+/,
|
|
49
|
+
rpercent = /%$/,
|
|
50
|
+
_position = $.fn.position;
|
|
51
|
+
|
|
52
|
+
function getOffsets( offsets, width, height ) {
|
|
53
|
+
return [
|
|
54
|
+
parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
|
|
55
|
+
parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function parseCss( element, property ) {
|
|
60
|
+
return parseInt( $.css( element, property ), 10 ) || 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function getDimensions( elem ) {
|
|
64
|
+
var raw = elem[ 0 ];
|
|
65
|
+
if ( raw.nodeType === 9 ) {
|
|
66
|
+
return {
|
|
67
|
+
width: elem.width(),
|
|
68
|
+
height: elem.height(),
|
|
69
|
+
offset: { top: 0, left: 0 }
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if ( $.isWindow( raw ) ) {
|
|
73
|
+
return {
|
|
74
|
+
width: elem.width(),
|
|
75
|
+
height: elem.height(),
|
|
76
|
+
offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
if ( raw.preventDefault ) {
|
|
80
|
+
return {
|
|
81
|
+
width: 0,
|
|
82
|
+
height: 0,
|
|
83
|
+
offset: { top: raw.pageY, left: raw.pageX }
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
width: elem.outerWidth(),
|
|
88
|
+
height: elem.outerHeight(),
|
|
89
|
+
offset: elem.offset()
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
$.position = {
|
|
94
|
+
scrollbarWidth: function() {
|
|
95
|
+
if ( cachedScrollbarWidth !== undefined ) {
|
|
96
|
+
return cachedScrollbarWidth;
|
|
97
|
+
}
|
|
98
|
+
var w1, w2,
|
|
99
|
+
div = $( "<div " +
|
|
100
|
+
"style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" +
|
|
101
|
+
"<div style='height:100px;width:auto;'></div></div>" ),
|
|
102
|
+
innerDiv = div.children()[ 0 ];
|
|
103
|
+
|
|
104
|
+
$( "body" ).append( div );
|
|
105
|
+
w1 = innerDiv.offsetWidth;
|
|
106
|
+
div.css( "overflow", "scroll" );
|
|
107
|
+
|
|
108
|
+
w2 = innerDiv.offsetWidth;
|
|
109
|
+
|
|
110
|
+
if ( w1 === w2 ) {
|
|
111
|
+
w2 = div[ 0 ].clientWidth;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
div.remove();
|
|
115
|
+
|
|
116
|
+
return ( cachedScrollbarWidth = w1 - w2 );
|
|
117
|
+
},
|
|
118
|
+
getScrollInfo: function( within ) {
|
|
119
|
+
var overflowX = within.isWindow || within.isDocument ? "" :
|
|
120
|
+
within.element.css( "overflow-x" ),
|
|
121
|
+
overflowY = within.isWindow || within.isDocument ? "" :
|
|
122
|
+
within.element.css( "overflow-y" ),
|
|
123
|
+
hasOverflowX = overflowX === "scroll" ||
|
|
124
|
+
( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ),
|
|
125
|
+
hasOverflowY = overflowY === "scroll" ||
|
|
126
|
+
( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight );
|
|
127
|
+
return {
|
|
128
|
+
width: hasOverflowY ? $.position.scrollbarWidth() : 0,
|
|
129
|
+
height: hasOverflowX ? $.position.scrollbarWidth() : 0
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
getWithinInfo: function( element ) {
|
|
133
|
+
var withinElement = $( element || window ),
|
|
134
|
+
isWindow = $.isWindow( withinElement[ 0 ] ),
|
|
135
|
+
isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,
|
|
136
|
+
hasOffset = !isWindow && !isDocument;
|
|
137
|
+
return {
|
|
138
|
+
element: withinElement,
|
|
139
|
+
isWindow: isWindow,
|
|
140
|
+
isDocument: isDocument,
|
|
141
|
+
offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },
|
|
142
|
+
scrollLeft: withinElement.scrollLeft(),
|
|
143
|
+
scrollTop: withinElement.scrollTop(),
|
|
144
|
+
width: withinElement.outerWidth(),
|
|
145
|
+
height: withinElement.outerHeight()
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
$.fn.position = function( options ) {
|
|
151
|
+
if ( !options || !options.of ) {
|
|
152
|
+
return _position.apply( this, arguments );
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Make a copy, we don't want to modify arguments
|
|
156
|
+
options = $.extend( {}, options );
|
|
157
|
+
|
|
158
|
+
var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
|
|
159
|
+
target = $( options.of ),
|
|
160
|
+
within = $.position.getWithinInfo( options.within ),
|
|
161
|
+
scrollInfo = $.position.getScrollInfo( within ),
|
|
162
|
+
collision = ( options.collision || "flip" ).split( " " ),
|
|
163
|
+
offsets = {};
|
|
164
|
+
|
|
165
|
+
dimensions = getDimensions( target );
|
|
166
|
+
if ( target[ 0 ].preventDefault ) {
|
|
167
|
+
|
|
168
|
+
// Force left top to allow flipping
|
|
169
|
+
options.at = "left top";
|
|
170
|
+
}
|
|
171
|
+
targetWidth = dimensions.width;
|
|
172
|
+
targetHeight = dimensions.height;
|
|
173
|
+
targetOffset = dimensions.offset;
|
|
174
|
+
|
|
175
|
+
// Clone to reuse original targetOffset later
|
|
176
|
+
basePosition = $.extend( {}, targetOffset );
|
|
177
|
+
|
|
178
|
+
// Force my and at to have valid horizontal and vertical positions
|
|
179
|
+
// if a value is missing or invalid, it will be converted to center
|
|
180
|
+
$.each( [ "my", "at" ], function() {
|
|
181
|
+
var pos = ( options[ this ] || "" ).split( " " ),
|
|
182
|
+
horizontalOffset,
|
|
183
|
+
verticalOffset;
|
|
184
|
+
|
|
185
|
+
if ( pos.length === 1 ) {
|
|
186
|
+
pos = rhorizontal.test( pos[ 0 ] ) ?
|
|
187
|
+
pos.concat( [ "center" ] ) :
|
|
188
|
+
rvertical.test( pos[ 0 ] ) ?
|
|
189
|
+
[ "center" ].concat( pos ) :
|
|
190
|
+
[ "center", "center" ];
|
|
191
|
+
}
|
|
192
|
+
pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
|
|
193
|
+
pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
|
|
194
|
+
|
|
195
|
+
// Calculate offsets
|
|
196
|
+
horizontalOffset = roffset.exec( pos[ 0 ] );
|
|
197
|
+
verticalOffset = roffset.exec( pos[ 1 ] );
|
|
198
|
+
offsets[ this ] = [
|
|
199
|
+
horizontalOffset ? horizontalOffset[ 0 ] : 0,
|
|
200
|
+
verticalOffset ? verticalOffset[ 0 ] : 0
|
|
201
|
+
];
|
|
202
|
+
|
|
203
|
+
// Reduce to just the positions without the offsets
|
|
204
|
+
options[ this ] = [
|
|
205
|
+
rposition.exec( pos[ 0 ] )[ 0 ],
|
|
206
|
+
rposition.exec( pos[ 1 ] )[ 0 ]
|
|
207
|
+
];
|
|
208
|
+
} );
|
|
209
|
+
|
|
210
|
+
// Normalize collision option
|
|
211
|
+
if ( collision.length === 1 ) {
|
|
212
|
+
collision[ 1 ] = collision[ 0 ];
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if ( options.at[ 0 ] === "right" ) {
|
|
216
|
+
basePosition.left += targetWidth;
|
|
217
|
+
} else if ( options.at[ 0 ] === "center" ) {
|
|
218
|
+
basePosition.left += targetWidth / 2;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if ( options.at[ 1 ] === "bottom" ) {
|
|
222
|
+
basePosition.top += targetHeight;
|
|
223
|
+
} else if ( options.at[ 1 ] === "center" ) {
|
|
224
|
+
basePosition.top += targetHeight / 2;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
|
|
228
|
+
basePosition.left += atOffset[ 0 ];
|
|
229
|
+
basePosition.top += atOffset[ 1 ];
|
|
230
|
+
|
|
231
|
+
return this.each( function() {
|
|
232
|
+
var collisionPosition, using,
|
|
233
|
+
elem = $( this ),
|
|
234
|
+
elemWidth = elem.outerWidth(),
|
|
235
|
+
elemHeight = elem.outerHeight(),
|
|
236
|
+
marginLeft = parseCss( this, "marginLeft" ),
|
|
237
|
+
marginTop = parseCss( this, "marginTop" ),
|
|
238
|
+
collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) +
|
|
239
|
+
scrollInfo.width,
|
|
240
|
+
collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) +
|
|
241
|
+
scrollInfo.height,
|
|
242
|
+
position = $.extend( {}, basePosition ),
|
|
243
|
+
myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
|
|
244
|
+
|
|
245
|
+
if ( options.my[ 0 ] === "right" ) {
|
|
246
|
+
position.left -= elemWidth;
|
|
247
|
+
} else if ( options.my[ 0 ] === "center" ) {
|
|
248
|
+
position.left -= elemWidth / 2;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if ( options.my[ 1 ] === "bottom" ) {
|
|
252
|
+
position.top -= elemHeight;
|
|
253
|
+
} else if ( options.my[ 1 ] === "center" ) {
|
|
254
|
+
position.top -= elemHeight / 2;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
position.left += myOffset[ 0 ];
|
|
258
|
+
position.top += myOffset[ 1 ];
|
|
259
|
+
|
|
260
|
+
collisionPosition = {
|
|
261
|
+
marginLeft: marginLeft,
|
|
262
|
+
marginTop: marginTop
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
$.each( [ "left", "top" ], function( i, dir ) {
|
|
266
|
+
if ( $.ui.position[ collision[ i ] ] ) {
|
|
267
|
+
$.ui.position[ collision[ i ] ][ dir ]( position, {
|
|
268
|
+
targetWidth: targetWidth,
|
|
269
|
+
targetHeight: targetHeight,
|
|
270
|
+
elemWidth: elemWidth,
|
|
271
|
+
elemHeight: elemHeight,
|
|
272
|
+
collisionPosition: collisionPosition,
|
|
273
|
+
collisionWidth: collisionWidth,
|
|
274
|
+
collisionHeight: collisionHeight,
|
|
275
|
+
offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
|
|
276
|
+
my: options.my,
|
|
277
|
+
at: options.at,
|
|
278
|
+
within: within,
|
|
279
|
+
elem: elem
|
|
280
|
+
} );
|
|
281
|
+
}
|
|
282
|
+
} );
|
|
283
|
+
|
|
284
|
+
if ( options.using ) {
|
|
285
|
+
|
|
286
|
+
// Adds feedback as second argument to using callback, if present
|
|
287
|
+
using = function( props ) {
|
|
288
|
+
var left = targetOffset.left - position.left,
|
|
289
|
+
right = left + targetWidth - elemWidth,
|
|
290
|
+
top = targetOffset.top - position.top,
|
|
291
|
+
bottom = top + targetHeight - elemHeight,
|
|
292
|
+
feedback = {
|
|
293
|
+
target: {
|
|
294
|
+
element: target,
|
|
295
|
+
left: targetOffset.left,
|
|
296
|
+
top: targetOffset.top,
|
|
297
|
+
width: targetWidth,
|
|
298
|
+
height: targetHeight
|
|
299
|
+
},
|
|
300
|
+
element: {
|
|
301
|
+
element: elem,
|
|
302
|
+
left: position.left,
|
|
303
|
+
top: position.top,
|
|
304
|
+
width: elemWidth,
|
|
305
|
+
height: elemHeight
|
|
306
|
+
},
|
|
307
|
+
horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
|
|
308
|
+
vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
|
|
309
|
+
};
|
|
310
|
+
if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
|
|
311
|
+
feedback.horizontal = "center";
|
|
312
|
+
}
|
|
313
|
+
if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
|
|
314
|
+
feedback.vertical = "middle";
|
|
315
|
+
}
|
|
316
|
+
if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
|
|
317
|
+
feedback.important = "horizontal";
|
|
318
|
+
} else {
|
|
319
|
+
feedback.important = "vertical";
|
|
320
|
+
}
|
|
321
|
+
options.using.call( this, props, feedback );
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
elem.offset( $.extend( position, { using: using } ) );
|
|
326
|
+
} );
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
$.ui.position = {
|
|
330
|
+
fit: {
|
|
331
|
+
left: function( position, data ) {
|
|
332
|
+
var within = data.within,
|
|
333
|
+
withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
|
|
334
|
+
outerWidth = within.width,
|
|
335
|
+
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
|
|
336
|
+
overLeft = withinOffset - collisionPosLeft,
|
|
337
|
+
overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
|
|
338
|
+
newOverRight;
|
|
339
|
+
|
|
340
|
+
// Element is wider than within
|
|
341
|
+
if ( data.collisionWidth > outerWidth ) {
|
|
342
|
+
|
|
343
|
+
// Element is initially over the left side of within
|
|
344
|
+
if ( overLeft > 0 && overRight <= 0 ) {
|
|
345
|
+
newOverRight = position.left + overLeft + data.collisionWidth - outerWidth -
|
|
346
|
+
withinOffset;
|
|
347
|
+
position.left += overLeft - newOverRight;
|
|
348
|
+
|
|
349
|
+
// Element is initially over right side of within
|
|
350
|
+
} else if ( overRight > 0 && overLeft <= 0 ) {
|
|
351
|
+
position.left = withinOffset;
|
|
352
|
+
|
|
353
|
+
// Element is initially over both left and right sides of within
|
|
354
|
+
} else {
|
|
355
|
+
if ( overLeft > overRight ) {
|
|
356
|
+
position.left = withinOffset + outerWidth - data.collisionWidth;
|
|
357
|
+
} else {
|
|
358
|
+
position.left = withinOffset;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Too far left -> align with left edge
|
|
363
|
+
} else if ( overLeft > 0 ) {
|
|
364
|
+
position.left += overLeft;
|
|
365
|
+
|
|
366
|
+
// Too far right -> align with right edge
|
|
367
|
+
} else if ( overRight > 0 ) {
|
|
368
|
+
position.left -= overRight;
|
|
369
|
+
|
|
370
|
+
// Adjust based on position and margin
|
|
371
|
+
} else {
|
|
372
|
+
position.left = max( position.left - collisionPosLeft, position.left );
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
top: function( position, data ) {
|
|
376
|
+
var within = data.within,
|
|
377
|
+
withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
|
|
378
|
+
outerHeight = data.within.height,
|
|
379
|
+
collisionPosTop = position.top - data.collisionPosition.marginTop,
|
|
380
|
+
overTop = withinOffset - collisionPosTop,
|
|
381
|
+
overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
|
|
382
|
+
newOverBottom;
|
|
383
|
+
|
|
384
|
+
// Element is taller than within
|
|
385
|
+
if ( data.collisionHeight > outerHeight ) {
|
|
386
|
+
|
|
387
|
+
// Element is initially over the top of within
|
|
388
|
+
if ( overTop > 0 && overBottom <= 0 ) {
|
|
389
|
+
newOverBottom = position.top + overTop + data.collisionHeight - outerHeight -
|
|
390
|
+
withinOffset;
|
|
391
|
+
position.top += overTop - newOverBottom;
|
|
392
|
+
|
|
393
|
+
// Element is initially over bottom of within
|
|
394
|
+
} else if ( overBottom > 0 && overTop <= 0 ) {
|
|
395
|
+
position.top = withinOffset;
|
|
396
|
+
|
|
397
|
+
// Element is initially over both top and bottom of within
|
|
398
|
+
} else {
|
|
399
|
+
if ( overTop > overBottom ) {
|
|
400
|
+
position.top = withinOffset + outerHeight - data.collisionHeight;
|
|
401
|
+
} else {
|
|
402
|
+
position.top = withinOffset;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// Too far up -> align with top
|
|
407
|
+
} else if ( overTop > 0 ) {
|
|
408
|
+
position.top += overTop;
|
|
409
|
+
|
|
410
|
+
// Too far down -> align with bottom edge
|
|
411
|
+
} else if ( overBottom > 0 ) {
|
|
412
|
+
position.top -= overBottom;
|
|
413
|
+
|
|
414
|
+
// Adjust based on position and margin
|
|
415
|
+
} else {
|
|
416
|
+
position.top = max( position.top - collisionPosTop, position.top );
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
flip: {
|
|
421
|
+
left: function( position, data ) {
|
|
422
|
+
var within = data.within,
|
|
423
|
+
withinOffset = within.offset.left + within.scrollLeft,
|
|
424
|
+
outerWidth = within.width,
|
|
425
|
+
offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
|
|
426
|
+
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
|
|
427
|
+
overLeft = collisionPosLeft - offsetLeft,
|
|
428
|
+
overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
|
|
429
|
+
myOffset = data.my[ 0 ] === "left" ?
|
|
430
|
+
-data.elemWidth :
|
|
431
|
+
data.my[ 0 ] === "right" ?
|
|
432
|
+
data.elemWidth :
|
|
433
|
+
0,
|
|
434
|
+
atOffset = data.at[ 0 ] === "left" ?
|
|
435
|
+
data.targetWidth :
|
|
436
|
+
data.at[ 0 ] === "right" ?
|
|
437
|
+
-data.targetWidth :
|
|
438
|
+
0,
|
|
439
|
+
offset = -2 * data.offset[ 0 ],
|
|
440
|
+
newOverRight,
|
|
441
|
+
newOverLeft;
|
|
442
|
+
|
|
443
|
+
if ( overLeft < 0 ) {
|
|
444
|
+
newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -
|
|
445
|
+
outerWidth - withinOffset;
|
|
446
|
+
if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
|
|
447
|
+
position.left += myOffset + atOffset + offset;
|
|
448
|
+
}
|
|
449
|
+
} else if ( overRight > 0 ) {
|
|
450
|
+
newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +
|
|
451
|
+
atOffset + offset - offsetLeft;
|
|
452
|
+
if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
|
|
453
|
+
position.left += myOffset + atOffset + offset;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
top: function( position, data ) {
|
|
458
|
+
var within = data.within,
|
|
459
|
+
withinOffset = within.offset.top + within.scrollTop,
|
|
460
|
+
outerHeight = within.height,
|
|
461
|
+
offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
|
|
462
|
+
collisionPosTop = position.top - data.collisionPosition.marginTop,
|
|
463
|
+
overTop = collisionPosTop - offsetTop,
|
|
464
|
+
overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
|
|
465
|
+
top = data.my[ 1 ] === "top",
|
|
466
|
+
myOffset = top ?
|
|
467
|
+
-data.elemHeight :
|
|
468
|
+
data.my[ 1 ] === "bottom" ?
|
|
469
|
+
data.elemHeight :
|
|
470
|
+
0,
|
|
471
|
+
atOffset = data.at[ 1 ] === "top" ?
|
|
472
|
+
data.targetHeight :
|
|
473
|
+
data.at[ 1 ] === "bottom" ?
|
|
474
|
+
-data.targetHeight :
|
|
475
|
+
0,
|
|
476
|
+
offset = -2 * data.offset[ 1 ],
|
|
477
|
+
newOverTop,
|
|
478
|
+
newOverBottom;
|
|
479
|
+
if ( overTop < 0 ) {
|
|
480
|
+
newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -
|
|
481
|
+
outerHeight - withinOffset;
|
|
482
|
+
if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
|
|
483
|
+
position.top += myOffset + atOffset + offset;
|
|
484
|
+
}
|
|
485
|
+
} else if ( overBottom > 0 ) {
|
|
486
|
+
newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +
|
|
487
|
+
offset - offsetTop;
|
|
488
|
+
if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
|
|
489
|
+
position.top += myOffset + atOffset + offset;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
flipfit: {
|
|
495
|
+
left: function() {
|
|
496
|
+
$.ui.position.flip.left.apply( this, arguments );
|
|
497
|
+
$.ui.position.fit.left.apply( this, arguments );
|
|
498
|
+
},
|
|
499
|
+
top: function() {
|
|
500
|
+
$.ui.position.flip.top.apply( this, arguments );
|
|
501
|
+
$.ui.position.fit.top.apply( this, arguments );
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
} )();
|
|
507
|
+
|
|
508
|
+
var position = $.ui.position;
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
}));
|