From 07b403d9fb5e1d75d85fe70e8fb88ac673d1bbf9 Mon Sep 17 00:00:00 2001 From: bbrala Date: Wed, 28 Oct 2015 16:15:21 +0100 Subject: [PATCH] Preparing release 1.10.2 --- README.md | 5 +---- bower.json | 2 +- dist/jquery.contextMenu.css | 4 ++-- dist/jquery.contextMenu.js | 6 +++--- dist/jquery.contextMenu.min.css | 4 ++-- dist/jquery.contextMenu.min.css.map | 2 +- dist/jquery.contextMenu.min.js | 6 +++--- dist/jquery.contextMenu.min.js.map | 2 +- package.json | 2 +- 9 files changed, 15 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 4afa6e2c..07edece9 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,6 @@ --- -__IMPORTANT: The Next version (2.0.0) will change the default names of the icon classes in order to stop CSS conflicts with frameworks which define the class 'icon'.__ - - [![Travis Build Status](https://travis-ci.org/swisnl/jQuery-contextMenu.svg?branch=master)](https://travis-ci.org/swisnl/jQuery-contextMenu) $.contextMenu is a management facility for - you guessed it - context menus. It was designed for an application where there are hundreds of elements that may show a context menu - so intialization speed and memory usage are kept fairly small. It also allows to register context menus without providing actual markup, as $.contextMenu generates DOMElements as needed. @@ -100,7 +97,7 @@ $.contextMenu is published under the [MIT license](http://www.opensource.org/lic ## Changelog ## -### Unreleased ### +### 1.10.2 (October 28th 2015) ### * Reverted the change from 1.7.0: .html() changed back to .text() since it is an security issue (thanks @arai-a) diff --git a/bower.json b/bower.json index b0e38b42..784438fa 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "jQuery-contextMenu", - "version": "1.10.1", + "version": "1.10.2", "main": [ "dist/jquery.contextMenu.js", "dist/jquery.contextMenu.min.js", diff --git a/dist/jquery.contextMenu.css b/dist/jquery.contextMenu.css index eee4f8a0..c8c0a33d 100755 --- a/dist/jquery.contextMenu.css +++ b/dist/jquery.contextMenu.css @@ -1,7 +1,7 @@ /*! * jQuery contextMenu - Plugin for simple contextMenu handling * - * Version: v1.10.1 + * Version: v1.10.2 * * Authors: Björn Brala (SWIS.nl), Rodney Rehm, Addy Osmani (patches for FF) * Web: http://swisnl.github.io/jQuery-contextMenu/ @@ -11,7 +11,7 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license - * Date: 2015-10-26T19:58:28.706Z + * Date: 2015-10-28T15:14:59.323Z */ .context-menu-list { diff --git a/dist/jquery.contextMenu.js b/dist/jquery.contextMenu.js index 9ee77f1f..a5fdf387 100755 --- a/dist/jquery.contextMenu.js +++ b/dist/jquery.contextMenu.js @@ -1,7 +1,7 @@ /*! - * jQuery contextMenu v1.10.1 - Plugin for simple contextMenu handling + * jQuery contextMenu v1.10.2 - Plugin for simple contextMenu handling * - * Version: v1.10.1 + * Version: v1.10.2 * * Authors: Björn Brala (SWIS.nl), Rodney Rehm, Addy Osmani (patches for FF) * Web: http://swisnl.github.io/jQuery-contextMenu/ @@ -12,7 +12,7 @@ * MIT License http://www.opensource.org/licenses/mit-license * GPL v3 http://opensource.org/licenses/GPL-3.0 * - * Date: 2015-10-26T22:23:41.404Z + * Date: 2015-10-28T15:15:00.338Z */ (function (factory) { diff --git a/dist/jquery.contextMenu.min.css b/dist/jquery.contextMenu.min.css index d4c700d7..ee39c042 100755 --- a/dist/jquery.contextMenu.min.css +++ b/dist/jquery.contextMenu.min.css @@ -1,7 +1,7 @@ /*! * jQuery contextMenu - Plugin for simple contextMenu handling * - * Version: v1.10.1 + * Version: v1.10.2 * * Authors: Björn Brala (SWIS.nl), Rodney Rehm, Addy Osmani (patches for FF) * Web: http://swisnl.github.io/jQuery-contextMenu/ @@ -11,6 +11,6 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license - * Date: 2015-10-26T19:58:28.706Z + * Date: 2015-10-28T15:14:59.323Z */.context-menu-list{position:absolute;display:inline-block;min-width:120px;max-width:250px;padding:0;margin:0;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;list-style-type:none;background:#eee;border:1px solid #ddd;-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:2px 2px 2px 24px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#eee}.context-menu-separator{padding-bottom:0;border-bottom:1px solid #ddd}.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.hover{cursor:pointer;background-color:#39f}.context-menu-item.disabled{color:#666}.context-menu-input.hover,.context-menu-item.disabled.hover{cursor:default;background-color:#eee}.context-menu-submenu:after{position:absolute;top:0;right:3px;z-index:1;color:#666;content:">"}.context-menu-item.icon{min-height:18px;list-style-type:none;background-repeat:no-repeat;background-position:4px 2px}.context-menu-item.icon-edit{background-image:url(images/page_white_edit.png)}.context-menu-item.icon-cut{background-image:url(images/cut.png)}.context-menu-item.icon-copy{background-image:url(images/page_white_copy.png)}.context-menu-item.icon-paste{background-image:url(images/page_white_paste.png)}.context-menu-item.icon-delete{background-image:url(images/page_white_delete.png)}.context-menu-item.icon-add{background-image:url(images/page_white_add.png)}.context-menu-item.icon-quit{background-image:url(images/door.png)}.context-menu-input>label>*{vertical-align:top}.context-menu-input>label>input[type=checkbox],.context-menu-input>label>input[type=radio]{margin-left:-17px}.context-menu-input>label>span{margin-left:5px}.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:100px}.context-menu-item>.context-menu-list{top:5px;right:-5px;display:none}.context-menu-item.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 5d9e7dcc..73fa529b 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":";;;;;;;;;;;;;;AAgBA,mBCCE,SDAE,SCCF,QDAE,aCCF,UAAW,MACX,UDAE,MCCF,QDAE,ECCF,ODAE,ECCF,YDAE,QAAmB,MAAA,UAAA,WCCrB,UDAE,KCCF,gBAAiB,KACjB,WDAE,KCCF,ODAE,IAAA,MAAA,KCCF,mBAAoB,EAAE,IAAI,IAAI,eDC5B,WAAA,EAAA,IAAA,IAAA,eCGJ,mBACE,SDFE,SCGF,QDFE,IAAA,IAAA,IAAgB,KACnB,oBAAA,KCGI,iBAAkB,KDDvB,gBAAA,KACI,YAAA,KCGF,iBDFE,KCKJ,wBACE,eDJE,ECKF,cDLE,IAAA,MAAA,KAGJ,+BCMA,kCACE,oBDLE,KACH,iBAAA,KCMK,gBAAiB,KDJvB,YAAA,KCQA,yBACE,ODPE,QCQF,iBDRE,KAGJ,4BCSE,MDRE,KCWJ,0BDPA,kCCSE,ODRE,QACH,iBAAA,KCWD,4BACE,SDRE,SCSF,IDRE,EACH,MAAA,ICSC,QAAS,EDPX,MAAA,KCSE,QDRE,ICiBJ,wBACE,WAAY,KACZ,gBAAiB,KACjB,kBAAmB,UACnB,oBDRC,IAAA,IAEH,6BACA,iBAAA,gCAEA,4BACA,iBAAA,oBAEA,6BCSE,iBAAkB,gCDNpB,8BCSE,iBAAkB,iCDNpB,+BCSE,iBAAkB,kCAEpB,4BDPA,iBAAA,+BCUA,6BACE,iBAAkB,qBAIpB,4BACE,eDRE,ICYJ,+CACA,4CACE,YAAa,MAEf,+BDTC,YAAA,ICaD,0BACA,2CAEA,iCADA,mCAEE,QAAS,MDTX,MAAA,KCWE,mBDViB,WAClB,gBAAA,WCWS,WAAY,WAGtB,mCACE,OAAQ,MAEV,sCACE,IAAK,IAEL,MAAuH,KACvH,QAAS,KAGX,8CACE,QAAS,MAGX,wBACE,gBAAiB","file":"jquery.contextMenu.min.css","sourcesContent":["/*!\n * jQuery contextMenu - Plugin for simple contextMenu handling\n *\n * Version: v@VERSION\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-@YEAR SWIS BV and contributors\n *\n * Licensed under\n * MIT License http://www.opensource.org/licenses/mit-license\n\n * Date: @DATE\n */\n\n.context-menu-list {\n margin:0; \n padding:0;\n \n min-width: 120px;\n max-width: 250px;\n display: inline-block;\n position: absolute;\n list-style-type: none;\n \n border: 1px solid #DDD;\n background: #EEE;\n \n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);\n \n font-family: Verdana, Arial, Helvetica, sans-serif;\n font-size: 11px;\n}\n\n.context-menu-item {\n padding: 2px 2px 2px 24px;\n background-color: #EEE;\n position: relative;\n user-select: none;\n}\n\n.context-menu-separator {\n padding-bottom:0;\n border-bottom: 1px solid #DDD;\n}\n\n.context-menu-item > label > input,\n.context-menu-item > label > textarea {\n user-select: text;\n}\n\n.context-menu-item.hover {\n cursor: pointer;\n background-color: #39F;\n}\n\n.context-menu-item.disabled {\n color: #666;\n}\n\n.context-menu-input.hover,\n.context-menu-item.disabled.hover {\n cursor: default;\n background-color: #EEE;\n}\n\n.context-menu-submenu:after {\n content: \">\";\n color: #666;\n position: absolute;\n top: 0;\n right: 3px;\n z-index: 1;\n}\n\n/* icons\n #protip:\n In case you want to use sprites for icons (which I would suggest you do) have a look at\n http://css-tricks.com/13224-pseudo-spriting/ to get an idea of how to implement \n .context-menu-item.icon:before {}\n */\n.context-menu-item.icon { min-height: 18px; background-repeat: no-repeat; background-position: 4px 2px; list-style-type: none;}\n.context-menu-item.icon-edit { background-image: url(images/page_white_edit.png); }\n.context-menu-item.icon-cut { background-image: url(images/cut.png); }\n.context-menu-item.icon-copy { background-image: url(images/page_white_copy.png); }\n.context-menu-item.icon-paste { background-image: url(images/page_white_paste.png); }\n.context-menu-item.icon-delete { background-image: url(images/page_white_delete.png); }\n.context-menu-item.icon-add { background-image: url(images/page_white_add.png); }\n.context-menu-item.icon-quit { background-image: url(images/door.png); }\n\n/* vertically align inside labels */\n.context-menu-input > label > * { 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-left: -17px;\n}\n.context-menu-input > label > span {\n margin-left: 5px;\n}\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 display: block;\n width: 100%;\n box-sizing: border-box;\n}\n\n.context-menu-input > label > textarea {\n height: 100px;\n}\n.context-menu-item > .context-menu-list {\n display: none;\n /* re-positioned by js */\n right: -5px;\n top: 5px;\n}\n\n.context-menu-item.visible > .context-menu-list {\n display: block;\n}\n\n.context-menu-accesskey {\n text-decoration: underline;\n}\n","/*!\n * jQuery contextMenu - Plugin for simple contextMenu handling\n *\n * Version: v1.10.1\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-2015 SWIS BV and contributors\n *\n * Licensed under\n * MIT License http://www.opensource.org/licenses/mit-license\n\n * Date: 2015-10-25T14:40:09.810Z\n */.context-menu-list{position:absolute;display:inline-block;min-width:120px;max-width:250px;padding:0;margin:0;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;list-style-type:none;background:#eee;border:1px solid #ddd;-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:2px 2px 2px 24px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#eee}.context-menu-separator{padding-bottom:0;border-bottom:1px solid #ddd}.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.hover{cursor:pointer;background-color:#39f}.context-menu-item.disabled{color:#666}.context-menu-input.hover,.context-menu-item.disabled.hover{cursor:default;background-color:#eee}.context-menu-submenu:after{position:absolute;top:0;right:3px;z-index:1;color:#666;content:\">\"}.context-menu-item.icon{min-height:18px;list-style-type:none;background-repeat:no-repeat;background-position:4px 2px}.context-menu-item.icon-edit{background-image:url(images/page_white_edit.png)}.context-menu-item.icon-cut{background-image:url(images/cut.png)}.context-menu-item.icon-copy{background-image:url(images/page_white_copy.png)}.context-menu-item.icon-paste{background-image:url(images/page_white_paste.png)}.context-menu-item.icon-delete{background-image:url(images/page_white_delete.png)}.context-menu-item.icon-add{background-image:url(images/page_white_add.png)}.context-menu-item.icon-quit{background-image:url(images/door.png)}.context-menu-input>label>*{vertical-align:top}.context-menu-input>label>input[type=checkbox],.context-menu-input>label>input[type=radio]{margin-left:-17px}.context-menu-input>label>span{margin-left:5px}.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:100px}.context-menu-item>.context-menu-list{top:5px;right:-5px;display:none}.context-menu-item.visible>.context-menu-list{display:block}.context-menu-accesskey{text-decoration:underline}\n/*# sourceMappingURL=jquery.contextMenu.min.css.map */\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["jquery.contextMenu.css","jquery.contextMenu.min.css"],"names":[],"mappings":";;;;;;;;;;;;;;AAgBA,mBCCE,SDAE,SCCF,QDAE,aCCF,UAAW,MACX,UDAE,MCCF,QDAE,ECCF,ODAE,ECCF,YDAE,QAAmB,MAAA,UAAA,WCCrB,UDAE,KCCF,gBAAiB,KACjB,WDAE,KCCF,ODAE,IAAA,MAAA,KCCF,mBAAoB,EAAE,IAAI,IAAI,eDC5B,WAAA,EAAA,IAAA,IAAA,eCGJ,mBACE,SDFE,SCGF,QDFE,IAAA,IAAA,IAAgB,KACnB,oBAAA,KCGI,iBAAkB,KDDvB,gBAAA,KACI,YAAA,KCGF,iBDFE,KCKJ,wBACE,eDJE,ECKF,cDLE,IAAA,MAAA,KAGJ,+BCMA,kCACE,oBDLE,KACH,iBAAA,KCMK,gBAAiB,KDJvB,YAAA,KCQA,yBACE,ODPE,QCQF,iBDRE,KAGJ,4BCSE,MDRE,KCWJ,0BDPA,kCCSE,ODRE,QACH,iBAAA,KCWD,4BACE,SDRE,SCSF,IDRE,EACH,MAAA,ICSC,QAAS,EDPX,MAAA,KCSE,QDRE,ICiBJ,wBACE,WAAY,KACZ,gBAAiB,KACjB,kBAAmB,UACnB,oBDRC,IAAA,IAEH,6BACA,iBAAA,gCAEA,4BACA,iBAAA,oBAEA,6BCSE,iBAAkB,gCDNpB,8BCSE,iBAAkB,iCDNpB,+BCSE,iBAAkB,kCAEpB,4BDPA,iBAAA,+BCUA,6BACE,iBAAkB,qBAIpB,4BACE,eDRE,ICYJ,+CACA,4CACE,YAAa,MAEf,+BDTC,YAAA,ICaD,0BACA,2CAEA,iCADA,mCAEE,QAAS,MDTX,MAAA,KCWE,mBDViB,WAClB,gBAAA,WCWS,WAAY,WAGtB,mCACE,OAAQ,MAEV,sCACE,IAAK,IAEL,MAAuH,KACvH,QAAS,KAGX,8CACE,QAAS,MAGX,wBACE,gBAAiB","file":"jquery.contextMenu.min.css","sourcesContent":["/*!\r\n * jQuery contextMenu - Plugin for simple contextMenu handling\r\n *\r\n * Version: v@VERSION\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-@YEAR 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: @DATE\r\n */\r\n\r\n.context-menu-list {\r\n margin:0; \r\n padding:0;\r\n \r\n min-width: 120px;\r\n max-width: 250px;\r\n display: inline-block;\r\n position: absolute;\r\n list-style-type: none;\r\n \r\n border: 1px solid #DDD;\r\n background: #EEE;\r\n \r\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);\r\n \r\n font-family: Verdana, Arial, Helvetica, sans-serif;\r\n font-size: 11px;\r\n}\r\n\r\n.context-menu-item {\r\n padding: 2px 2px 2px 24px;\r\n background-color: #EEE;\r\n position: relative;\r\n user-select: none;\r\n}\r\n\r\n.context-menu-separator {\r\n padding-bottom:0;\r\n border-bottom: 1px solid #DDD;\r\n}\r\n\r\n.context-menu-item > label > input,\r\n.context-menu-item > label > textarea {\r\n user-select: text;\r\n}\r\n\r\n.context-menu-item.hover {\r\n cursor: pointer;\r\n background-color: #39F;\r\n}\r\n\r\n.context-menu-item.disabled {\r\n color: #666;\r\n}\r\n\r\n.context-menu-input.hover,\r\n.context-menu-item.disabled.hover {\r\n cursor: default;\r\n background-color: #EEE;\r\n}\r\n\r\n.context-menu-submenu:after {\r\n content: \">\";\r\n color: #666;\r\n position: absolute;\r\n top: 0;\r\n right: 3px;\r\n z-index: 1;\r\n}\r\n\r\n/* icons\r\n #protip:\r\n In case you want to use sprites for icons (which I would suggest you do) have a look at\r\n http://css-tricks.com/13224-pseudo-spriting/ to get an idea of how to implement \r\n .context-menu-item.icon:before {}\r\n */\r\n.context-menu-item.icon { min-height: 18px; background-repeat: no-repeat; background-position: 4px 2px; list-style-type: none;}\r\n.context-menu-item.icon-edit { background-image: url(images/page_white_edit.png); }\r\n.context-menu-item.icon-cut { background-image: url(images/cut.png); }\r\n.context-menu-item.icon-copy { background-image: url(images/page_white_copy.png); }\r\n.context-menu-item.icon-paste { background-image: url(images/page_white_paste.png); }\r\n.context-menu-item.icon-delete { background-image: url(images/page_white_delete.png); }\r\n.context-menu-item.icon-add { background-image: url(images/page_white_add.png); }\r\n.context-menu-item.icon-quit { background-image: url(images/door.png); }\r\n\r\n/* vertically align inside labels */\r\n.context-menu-input > label > * { vertical-align: top; }\r\n\r\n/* position checkboxes and radios as icons */\r\n.context-menu-input > label > input[type=\"checkbox\"],\r\n.context-menu-input > label > input[type=\"radio\"] {\r\n margin-left: -17px;\r\n}\r\n.context-menu-input > label > span {\r\n margin-left: 5px;\r\n}\r\n\r\n.context-menu-input > label,\r\n.context-menu-input > label > input[type=\"text\"],\r\n.context-menu-input > label > textarea,\r\n.context-menu-input > label > select {\r\n display: block;\r\n width: 100%;\r\n box-sizing: border-box;\r\n}\r\n\r\n.context-menu-input > label > textarea {\r\n height: 100px;\r\n}\r\n.context-menu-item > .context-menu-list {\r\n display: none;\r\n /* re-positioned by js */\r\n right: -5px;\r\n top: 5px;\r\n}\r\n\r\n.context-menu-item.visible > .context-menu-list {\r\n display: block;\r\n}\r\n\r\n.context-menu-accesskey {\r\n text-decoration: underline;\r\n}\r\n","/*!\r\n * jQuery contextMenu - Plugin for simple contextMenu handling\r\n *\r\n * Version: v1.10.1\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-2015 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: 2015-10-26T19:58:28.706Z\r\n */.context-menu-list{position:absolute;display:inline-block;min-width:120px;max-width:250px;padding:0;margin:0;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;list-style-type:none;background:#eee;border:1px solid #ddd;-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:2px 2px 2px 24px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#eee}.context-menu-separator{padding-bottom:0;border-bottom:1px solid #ddd}.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.hover{cursor:pointer;background-color:#39f}.context-menu-item.disabled{color:#666}.context-menu-input.hover,.context-menu-item.disabled.hover{cursor:default;background-color:#eee}.context-menu-submenu:after{position:absolute;top:0;right:3px;z-index:1;color:#666;content:\">\"}.context-menu-item.icon{min-height:18px;list-style-type:none;background-repeat:no-repeat;background-position:4px 2px}.context-menu-item.icon-edit{background-image:url(images/page_white_edit.png)}.context-menu-item.icon-cut{background-image:url(images/cut.png)}.context-menu-item.icon-copy{background-image:url(images/page_white_copy.png)}.context-menu-item.icon-paste{background-image:url(images/page_white_paste.png)}.context-menu-item.icon-delete{background-image:url(images/page_white_delete.png)}.context-menu-item.icon-add{background-image:url(images/page_white_add.png)}.context-menu-item.icon-quit{background-image:url(images/door.png)}.context-menu-input>label>*{vertical-align:top}.context-menu-input>label>input[type=checkbox],.context-menu-input>label>input[type=radio]{margin-left:-17px}.context-menu-input>label>span{margin-left:5px}.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:100px}.context-menu-item>.context-menu-list{top:5px;right:-5px;display:none}.context-menu-item.visible>.context-menu-list{display:block}.context-menu-accesskey{text-decoration:underline}\r\n/*# sourceMappingURL=jquery.contextMenu.min.css.map */\r\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/dist/jquery.contextMenu.min.js b/dist/jquery.contextMenu.min.js index 6c5a0b09..0e2731e4 100755 --- a/dist/jquery.contextMenu.min.js +++ b/dist/jquery.contextMenu.min.js @@ -1,7 +1,7 @@ /*! - * jQuery contextMenu v1.10.1 - Plugin for simple contextMenu handling + * jQuery contextMenu v1.10.2 - Plugin for simple contextMenu handling * - * Version: v1.10.1 + * Version: v1.10.2 * * Authors: Björn Brala (SWIS.nl), Rodney Rehm, Addy Osmani (patches for FF) * Web: http://swisnl.github.io/jQuery-contextMenu/ @@ -12,7 +12,7 @@ * MIT License http://www.opensource.org/licenses/mit-license * GPL v3 http://opensource.org/licenses/GPL-3.0 * - * Date: 2015-10-26T22:23:41.404Z + * Date: 2015-10-28T15:15:00.338Z */ !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.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.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!=(o=n[s]);s++)try{a=e._data(o,"events"),a&&a.remove&&e(o).triggerHandler("remove")}catch(i){}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,classNames:{hover:"hover",disabled:"disabled",visible:"visible",notSelectable:"not-selectable",icon:"icon",iconEdit:"icon-edit",iconCut:"icon-cut",iconCopy:"icon-copy",iconPaste:"icon-paste",iconDelete:"icon-delete",iconAdd:"icon-add",iconQuit:"icon-quit"},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);a="maintain"===t&&"maintain"===n?e.$menu.position():{top:n,left:t};var o=i.scrollTop()+i.height(),s=i.scrollLeft()+i.width(),c=e.$menu.outerHeight(),r=e.$menu.outerWidth();a.top+c>o&&(a.top-=c),a.top<0&&(a.top=0),a.left+r>s&&(a.left-=r),a.left<0&&(a.left=0),e.$menu.css(a)},positionSubmenu:function(t){if(e.ui&&e.ui.position)t.css("display","block").position({my:"left top",at:"right top",of:this,collision:"flipfit fit"}).css("display","");else{var n={top:0,left:this.outerWidth()};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||!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||n.hasClass("context-menu-active")||n.hasClass("context-menu-disabled"))){if(o=n,t.data.build){var a=t.data.build(o,t);if(a===!1)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):"undefined"!=typeof i.visible?t.data.items[i].visible===!0:!0,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(),t.stopImmediatePropagation(),setTimeout(function(){var o,u="left"===s.trigger&&0===c||"right"===s.trigger&&2===c;if(document.elementFromPoint&&(s.$layer.hide(),n=document.elementFromPoint(r-i.scrollLeft(),l-i.scrollTop()),s.$layer.show()),s.reposition&&u)if(document.elementFromPoint){if(s.$trigger.is(n)||s.$trigger.has(n).length)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})}),s.$menu.trigger("contextmenu:hide")},50)},keyStop:function(e,t){t.isInput||e.preventDefault(),e.stopPropagation()},key:function(e){var t={};switch(o&&(t=o.data("contextMenu")||{}),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 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 t.$menu.trigger("prevcommand");case 40:if(f.keyStop(e,t),!t.isInput)return void t.$menu.trigger("nextcommand");if(9===e.keyCode)return e.preventDefault(),t.$selected&&t.$selected.find("input, textarea, select").blur(),void 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 n=t.$selected.parent().parent();return t.$selected.trigger("contextmenu:blur"),void(t.$selected=n)}break;case 39:if(f.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;var a=t.$selected.data("contextMenu")||{};if(a.$menu&&t.$selected.hasClass("context-menu-submenu"))return t.$selected=null,a.$selected=null,void a.$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("undefined"!=typeof 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 t.$menu.trigger("contextmenu:hide");default:var s=String.fromCharCode(e.keyCode).toUpperCase();if(t.accesskeys&&t.accesskeys[s])return void t.accesskeys[s].$node.trigger(t.accesskeys[s].$menu?"contextmenu:focus":"mouseup")}e.stopPropagation(),"undefined"!=typeof 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);)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);)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,o=n.contextMenuRoot;o.isInput=a.isInput=!1},menuMouseenter:function(){var t=e(this).data().contextMenuRoot;t.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;return s.hovering=!0,t&&s.$layer&&s.$layer.is(t.relatedTarget)&&(t.preventDefault(),t.stopImmediatePropagation()),(o.$menu?o:s).$menu.children(".hover").trigger("contextmenu:blur"),n.hasClass(s.classNames.disabled)||n.hasClass(s.classNames.notSelectable)?void(o.$selected=null):void n.trigger("contextmenu:focus")},itemMouseleave:function(t){var n=e(this),a=n.data(),o=a.contextMenu,s=a.contextMenuRoot;return s!==o&&s.$layer&&s.$layer.is(t.relatedTarget)?("undefined"!=typeof s.$selected&&null!==s.$selected&&s.$selected.trigger("contextmenu:blur"),t.preventDefault(),t.stopImmediatePropagation(),void(s.$selected=o.$selected=o.$node)):void 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-submenu, .context-menu-separator, ."+i.classNames.notSelectable)){if(t.preventDefault(),t.stopImmediatePropagation(),e.isFunction(i.callbacks[c])&&Object.prototype.hasOwnProperty.call(i.callbacks,c))n=i.callbacks[c];else{if(!e.isFunction(i.callback))return;n=i.callback}n.call(i.$trigger,c,i)!==!1?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.addClass([s.classNames.hover,s.classNames.visible].join(" ")).siblings().removeClass(s.classNames.visible).filter(s.classNames.hover).trigger("contextmenu:blur"),o.$selected=s.$selected=n,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={};return e("#context-menu-layer").trigger("mousedown"),t.$trigger=s,t.events.show.call(s,t)===!1?void(o=null):(h.update.call(s,t),t.position.call(s,t,n,a),t.zIndex&&(i.zIndex=p(s)+t.zIndex),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),void(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||t.$menu.trigger("contextmenu:hide")})))},hide:function(t,n){var a=e(this);if(t||(t=a.data("contextMenu")||{}),n||!t.events||t.events.hide.call(a,t)!==!1){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(s){t.$layer=null}}o=null,t.$menu.find("."+t.classNames.hover).trigger("contextmenu:blur"),t.$selected=null,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(n){}return!0}})),setTimeout(function(){a.trigger("contextmenu:hidden")},10)})}},create:function(n,a){function o(t){var n=e("");return 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))):n.text(t.name),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&&(i={type:"cm_seperator"}),i.$node=c.data({contextMenu:n,contextMenuRoot:a,contextMenuKey:s}),"undefined"!=typeof i.accesskey)for(var d,m=t(i.accesskey),p=0;d=m[p];p++)if(!a.accesskeys[d]){a.accesskeys[d]=i;var x=i.name.match(new RegExp("^(.*?)("+d+")(.*)$","i"));x&&(i._beforeAccesskey=x[1],i._accesskey=x[2],i._afterAccesskey=x[3]);break}if(i.type&&u[i.type])u[i.type].call(c,i,n,a),e.each([n,a],function(t,n){n.commands[s]=i,e.isFunction(i.callback)&&(n.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):i.type?(r=e("").appendTo(c),o(i).appendTo(c),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"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).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).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('