import vhost-audit

This commit is contained in:
2021-03-16 20:50:02 -07:00
commit 621e821cca
224 changed files with 44154 additions and 0 deletions

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>QUnit Test Suite</title>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" type="text/css" media="screen">
<script type="text/javascript" src="../node_modules/qunitjs/qunit/qunit.js"></script>
<!-- Your project file goes here -->
<link rel="stylesheet" href="../src/jquery.contextMenu.css" type="text/css" media="screen">
<script src="../node_modules/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../src/jquery.ui.position.js"></script>
<script type="text/javascript" src="../src/jquery.contextMenu.js"></script>
<!-- Your tests file goes here -->
<script type="text/javascript" src="unit/test-events.js"></script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
</body>
</html>

View File

@ -0,0 +1,48 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
// this test uses custom HTML because PhantomJS
// has problems showing alert modal dialogs.
// We are testing callbacks against simple DOM
// manipulations instead.
module.exports = {
'Typing <e> on keyboard triggers "edit" menu item callback': function (test) {
test
.open('file://' + pwd + '/test/integration/html/accesskeys_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.sendKeys('body', 'e')
.assert.text('#msg', 'clicked: edit', 'Edit menu item callback is triggered by accesskey')
.done();
},
'Typing <c> on keyboard triggers "cut" menu item callback': function (test) {
test
.open('file://' + pwd + '/test/integration/html/accesskeys_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.sendKeys('body', 'c')
.assert.text('#msg', 'clicked: cut', 'Cut menu item callback is triggered by accesskey')
.done();
},
'Typing <o> on keyboard triggers "copy" menu item callback': function (test) {
test
.open('file://' + pwd + '/test/integration/html/accesskeys_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.sendKeys('body', 'o')
.assert.text('#msg', 'clicked: copy', 'Copy menu item callback is triggered by accesskey')
.done();
},
'Typing <p> on keyboard triggers "paste" menu item callback': function (test) {
test
.open('file://' + pwd + '/test/integration/html/accesskeys_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.sendKeys('body', 'p')
.assert.text('#msg', 'clicked: paste', 'Paste menu item callback is triggered by accesskey')
.done();
}
};

View File

@ -0,0 +1,15 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
module.exports = {
'Render async context menu': function (test) {
test
.open('file://' + pwd + '/test/integration/html/async-create.html')
.execute(helper.rightClick, '.context-menu-one', 'mouseup')
.waitForElement('#context-menu-layer')
.assert.exists('.context-menu-root', 'It opens context menu')
.assert.numberOfElements('.context-menu-root li')
.is(3, '3 context menu items are shown')
.done();
}
};

View File

@ -0,0 +1,60 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
// this test uses custom HTML because PhantomJS
// has problems showing alert modal dialogs.
// We are testing callbacks against simple DOM
// manipulations instead.
module.exports = {
'Ensure edit menu item triggers callback': function (test) {
test
.open('file://' + pwd + '/test/integration/html/callback_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.assert.visible('.context-menu-root', 'Menu is present')
.click('.context-menu-root li:nth-child(1)') // edit
.assert.text('#msg', 'edit was clicked', 'Edit item triggers callback')
.assert.doesntExist('#context-menu-layer', 'It closes context menu')
.done();
},
'Ensure cut menu item triggers global callback': function (test) {
test
.open('file://' + pwd + '/test/integration/html/callback_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.assert.visible('.context-menu-root', 'Menu is present')
.click('.context-menu-root li:nth-child(2)') // cut
.assert.text('#msg', 'global: cut', 'Cut item triggers callback')
.assert.doesntExist('#context-menu-layer', 'It closes context menu')
.done();
},
'Ensure delete menu item triggers global callback': function (test) {
test
.open('file://' + pwd + '/test/integration/html/callback_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.assert.visible('.context-menu-root', 'Menu is present')
.click('.context-menu-root li:nth-child(5)') // delete
.assert.text('#msg', 'global: delete', 'delete item triggers callback')
.assert.doesntExist('#context-menu-layer', 'It closes context menu')
.done();
},
'Ensure quit menu item triggers global callback': function (test) {
test
.open('file://' + pwd + '/test/integration/html/callback_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.assert.visible('.context-menu-root', 'Menu is present')
.click('.context-menu-root li:nth-child(7)') // quit
.assert.text('#msg', 'global: quit', 'quit item triggers callback')
.assert.doesntExist('#context-menu-layer', 'It closes context menu')
.done();
}
};

View File

@ -0,0 +1,42 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
// this test uses custom HTML because PhantomJS
// has problems showing alert modal dialogs.
// We are testing callbacks against simple DOM
// manipulations instead.
module.exports = {
'Click custom comand menu item triggers menu callback': function (test) {
test
.open('file://' + pwd + '/test/integration/html/custom-command_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.assert.numberOfElements('.context-menu-root>li')
.is(3, '3 context menu items are shown')
.click('.context-menu-root li.labels')
.assert.text('#msg').to.contain('clicked: label', 'contextMenu callback was triggered')
.done();
},
'Click custom comand menu item label triggers custom action - red': function (test) {
test
.open('file://' + pwd + '/test/integration/html/custom-command_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.click('.context-menu-root li.labels .label1')
.assert.text('#msg', 'clicked: label | text: label 1', 'custom action was triggered')
.done();
},
'Click custom comand menu item label triggers custom action - blue': function (test) {
test
.open('file://' + pwd + '/test/integration/html/custom-command_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.click('.context-menu-root li.labels .label3')
.assert.text('#msg', 'clicked: label | text: label 3', 'custom action was triggered')
.done();
}
};

View File

@ -0,0 +1,32 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
// this test uses custom HTML because PhantomJS
// has problems showing alert modal dialogs.
// We are testing callbacks against simple DOM
// manipulations instead.
module.exports = {
'Clicking on disabled item has no effect': function (test) {
test
.open('file://' + pwd + '/test/integration/html/disabled-callback_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.assert.numberOfElements('.context-menu-root li')
.is(2, '2 context menu items are shown')
.click('.context-menu-root li:last-child')
.assert.text('#msg', '', 'Disabled menu item didnt set text')
.done();
},
'Clicking on enabled item works': function (test) {
test
.open('file://' + pwd + '/test/integration/html/disabled_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.click('.context-menu-root li:first-child')
.assert.text('#msg', 'clicked: edit', 'Enabled menu item sets text')
.done();
}
};

View File

@ -0,0 +1,51 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
// this test uses custom HTML because PhantomJS
// has problems showing alert modal dialogs.
// We are testing callbacks against simple DOM
// manipulations instead.
module.exports = {
'Clicking on disabled item has no effect': function (test) {
test
.open('file://' + pwd + '/test/integration/html/disabled-changing_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.assert.numberOfElements('.context-menu-root li')
.is(3, '3 context menu items are shown')
.click('.context-menu-root li:nth-child(2)')
.assert.text('#msg', '', 'Disabled menu item didnt set text')
.done();
},
'Toggle disabled item status': function (test) {
test
.open('file://' + pwd + '/test/integration/html/disabled-changing_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.click('.context-menu-root li:nth-child(3)')
.assert.doesntExist('.context-menu-root .disabled', 'All menu items are enabled')
.click('.context-menu-root li:nth-child(2)')
.assert.text('#msg', 'clicked: cut', 'Enabled menu item sets text')
.done();
},
'Toggled status is saved after menu is closed': function (test) {
test
.open('file://' + pwd + '/test/integration/html/disabled-changing_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.click('.context-menu-root li:nth-child(3)')
.assert.doesntExist('.context-menu-root .disabled', 'All menu items are enabled')
.execute(helper.closeMenu, '.context-menu-one')
.wait(100)
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.assert.doesntExist('.context-menu-root .disabled', 'All menu items are still enabled')
.done();
}
};

View File

@ -0,0 +1,54 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
module.exports = {
'Disabled trigger doesnt open context menu': function (test) {
test
.open('file://' + pwd + '/test/integration/html/disabled-menu.html')
.assert.numberOfElements('.context-menu-one')
.is(1, 'Context menu trigger is disabled')
.execute(helper.rightClick, '.context-menu-one')
.wait(100)
.assert.notVisible('.context-menu-root', 'Menu is not present')
.assert.doesntExist('#context-menu-layer', 'Context menu is not shown')
.done();
},
'Enabled trigger opens context menu': function (test) {
test
.open('file://' + pwd + '/test/integration/html/disabled-menu.html')
.click('#toggle-disabled')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.$('.context-menu-root')
.assert.visible('Menu is present')
.assert.exists('It opens context menu')
.end()
.assert.numberOfElements('.context-menu-root li')
.is(7, '7 context menu items are shown')
.assert.width('.context-menu-root').is.gt(100)
.done();
},
'Repeatedly disabled trigger doesnt open context menu': function (test) {
test
.open('file://' + pwd + '/test/integration/html/disabled-menu.html')
.assert.numberOfElements('.context-menu-one')
.is(1, 'Context menu trigger is disabled')
.execute(helper.rightClick, '.context-menu-one')
.wait(100)
.assert.notVisible('.context-menu-root', 'Menu is not present')
.assert.doesntExist('#context-menu-layer', 'Context menu is not shown')
.click('#toggle-disabled')
.assert.doesntExist('.context-menu-disabled', 'Context menu trigger is enambled')
.click('#toggle-disabled')
.assert.numberOfElements('.context-menu-one')
.is(1, 'Context menu trigger is disabled again')
.execute(helper.rightClick, '.context-menu-one')
.wait(100)
.assert.notVisible('.context-menu-root', 'Menu is not present')
.assert.doesntExist('#context-menu-layer', 'Context menu is not shown')
.done();
}
};

View File

@ -0,0 +1,32 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
// this test uses custom HTML because PhantomJS
// has problems showing alert modal dialogs.
// We are testing callbacks against simple DOM
// manipulations instead.
module.exports = {
'Clicking on disabled item has no effect': function (test) {
test
.open('file://' + pwd + '/test/integration/html/disabled_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.assert.numberOfElements('.context-menu-root li')
.is(2, '2 context menu items are shown')
.click('.context-menu-root li:last-child')
.assert.text('#msg', '', 'Disabled menu item didnt set text')
.done();
},
'Clicking on enabled item works': function (test) {
test
.open('file://' + pwd + '/test/integration/html/disabled_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.click('.context-menu-root li:first-child')
.assert.text('#msg', 'clicked: edit', 'Enabled menu item sets text')
.done();
}
};

View File

@ -0,0 +1,16 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
module.exports = {
'Dynamically created context menu is shown': function (test) {
test
.open('file://' + pwd + '/test/integration/html/dynamic-create.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.assert.visible('.context-menu-root', 'Menu is present')
.assert.exists('.context-menu-root', 'It opens context menu')
.assert.numberOfElements('.context-menu-root li')
.is(7, '7 context menu items are shown')
.done();
}
};

View File

@ -0,0 +1,39 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
module.exports = {
'Dynamically created <DIV> opens context menu': function (test) {
test
.open('file://' + pwd + '/test/integration/html/dynamic.html')
.click('#add-trigger')
.waitForElement('.menu-injected')
.execute(helper.rightClick, '.menu-injected')
.waitForElement('#context-menu-layer')
.assert.exists('.context-menu-root', 'It opens context menu')
.assert.numberOfElements('.context-menu-root li')
.is(7, '7 context menu items are shown')
.assert.numberOfElements('.context-menu-active')
.is(1, 'ensure one context menu is open')
.done();
},
'3rd dynamically created <DIV> also opens context menu': function (test) {
test
.open('file://' + pwd + '/test/integration/html/dynamic.html')
.click('#add-trigger')
.click('#add-trigger')
.click('#add-trigger')
.wait(200)
//.waitForElement('.menu-injected')
.assert.numberOfElements('.menu-injected')
.is(3, '3 DIVs are added')
.execute(helper.rightClick, '.menu-injected:last-of-type')
.waitForElement('#context-menu-layer')
.assert.exists('.context-menu-root', 'It opens context menu')
.assert.numberOfElements('.context-menu-root li')
.is(7, '7 context menu items are shown')
.assert.numberOfElements('.context-menu-active')
.is(1, 'ensure one context menu is open')
.done();
}
};

View File

@ -0,0 +1,365 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-accesskeys">Demo: Accesskeys</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit", accesskey: "e"},
"cut": {name: "Cut", icon: "cut", accesskey: "c"},
// first unused character is taken (here: o)
"copy": {name: "Copy", icon: "copy", accesskey: "c o p y"},
// words are truncated to their first letter (here: p)
"paste": {name: "Paste", icon: "paste", accesskey: "cool paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,369 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#demo-accesskeys">Demo: Accesskeys</a>
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<h1 id="demo-accesskeys">Demo: Accesskeys</h1>
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var message = "clicked: " + key;
$('#msg').text(message);
},
items: {
"edit": {name: "Edit", icon: "edit", accesskey: "e"},
"cut": {name: "Cut", icon: "cut", accesskey: "c"},
// first unused character is taken (here: o)
"copy": {name: "Copy", icon: "copy", accesskey: "c o p y"},
// words are truncated to their first letter (here: p)
"paste": {name: "Paste", icon: "paste", accesskey: "cool paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
<div id="msg"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,385 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-create-context-menu-asynchronous">Demo: Create Context Menu (asynchronous)</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
// some build handler to call asynchronously
function createSomeMenu() {
return {
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"}
}
};
}
// some asynchronous click handler
$('.context-menu-one').on('mouseup', function(e){
var $this = $(this);
// store a callback on the trigger
$this.data('runCallbackThingie', createSomeMenu);
var _offset = $this.offset(),
position = {
x: _offset.left + 10,
y: _offset.top + 10
}
// open the contextMenu asynchronously
setTimeout(function(){ $this.contextMenu(position); }, 1000);
});
// setup context menu
$.contextMenu({
selector: '.context-menu-one',
trigger: 'none',
build: function($trigger, e) {
// pull a callback from the trigger
return $trigger.data('runCallbackThingie')();
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,371 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-callback">Demo: Callback</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "global: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {
name: "Edit",
icon: "edit",
// superseeds "global" callback
callback: function(key, options) {
var m = "edit was clicked";
window.console && console.log(m) || alert(m);
}
},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,375 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#demo-callback">Demo: Callback</a>
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<h1 id="demo-callback">Demo: Callback</h1>
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var message = "global: " + key;
$('#msg').text(message);
},
items: {
"edit": {
name: "Edit",
icon: "edit",
// superseeds "global" callback
callback: function(key, options) {
var m = "edit was clicked";
$('#msg').text(m);
}
},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
<div id="msg"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,414 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-custom-command">Demo: Custom command</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
/**************************************************
* Custom Command Handler
**************************************************/
$.contextMenu.types.label = function(item, opt, root) {
// this === item.$node
$('<span>Label<ul>'
+ '<li class="label1" title="label 1">label 1'
+ '<li class="label2" title="label 2">label 2'
+ '<li class="label3" title="label 3">label 3'
+ '<li class="label4" title="label 4">label 4')
.appendTo(this)
.on('click', 'li', function() {
// do some funky stuff
console.log('Clicked on ' + $(this).text());
// hide the menu
root.$menu.trigger('contextmenu:hide');
});
this.addClass('labels').on('contextmenu:focus', function(e) {
// setup some awesome stuff
}).on('contextmenu:blur', function(e) {
// tear down whatever you did
}).on('keydown', function(e) {
// some funky key handling, maybe?
});
};
/**************************************************
* Context-Menu with custom command "label"
**************************************************/
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
open: {name: "Open", callback: $.noop},
label: {type: "label", customName: "Label"},
edit: {name: "Edit", callback: $.noop}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
<style type="text/css" class="showcase">
.labels > ul {
margin: 0;
padding: 0;
list-style: none;
display: block;
float: none;
}
.labels > ul > li {
display: inline-block;
width: 20px;
height: 20px;
border: 1px solid #CCC;
overflow: hidden;
text-indent: -2000px;
}
.labels > ul > li.selected,
.labels > ul > li:hover { border: 1px solid #000; }
.labels > ul > li + li { margin-left: 5px; }
.labels > ul > li.label1 { background: red; }
.labels > ul > li.label2 { background: green; }
.labels > ul > li.label3 { background: blue; }
.labels > ul > li.label4 { background: yellow; }
</style>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,419 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#demo-custom-command">Demo: Custom command</a>
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<h1 id="demo-custom-command">Demo: Custom command</h1>
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
/**************************************************
* Custom Command Handler
**************************************************/
$.contextMenu.types.label = function(item, opt, root) {
// this === item.$node
$('<span>Label<ul>'
+ '<li class="label1" title="label 1">label 1'
+ '<li class="label2" title="label 2">label 2'
+ '<li class="label3" title="label 3">label 3'
+ '<li class="label4" title="label 4">label 4')
.appendTo(this)
.on('click', 'li', function() {
var message = "text: " + $(this).text();
$('#msg').text($('#msg').text() + ' | ' + message);
// hide the menu
root.$menu.trigger('contextmenu:hide');
});
this.addClass('labels').on('contextmenu:focus', function(e) {
// setup some awesome stuff
}).on('contextmenu:blur', function(e) {
// tear down whatever you did
}).on('keydown', function(e) {
// some funky key handling, maybe?
});
};
/**************************************************
* Context-Menu with custom command "label"
**************************************************/
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var message = "clicked: " + key;
$('#msg').text(message);
},
items: {
open: {name: "Open", callback: $.noop},
label: {type: "label", customName: "Label"},
edit: {name: "Edit", callback: $.noop}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
<div id="msg"></div>
<style type="text/css" class="showcase">
.labels > ul {
margin: 0;
padding: 0;
list-style: none;
display: block;
float: none;
}
.labels > ul > li {
display: inline-block;
width: 20px;
height: 20px;
border: 1px solid #CCC;
overflow: hidden;
text-indent: -2000px;
}
.labels > ul > li.selected,
.labels > ul > li:hover { border: 1px solid #000; }
.labels > ul > li + li { margin-left: 5px; }
.labels > ul > li.label1 { background: red; }
.labels > ul > li.label2 { background: green; }
.labels > ul > li.label3 { background: blue; }
.labels > ul > li.label4 { background: yellow; }
</style>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,366 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-disabled-callback">Demo: Disabled Callback</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {
name: "Clickable",
icon: "edit",
disabled: function(){ return false; }
},
"cut": {
name: "Disabled",
icon: "cut",
disabled: function(){ return true; }
}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,370 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#demo-disabled-callback">Demo: Disabled Callback</a>
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<h1 id="demo-disabled-callback">Demo: Disabled Callback</h1>
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var message = "clicked: " + key;
$('#msg').text(message);
},
items: {
"edit": {
name: "Clickable",
icon: "edit",
disabled: function(){ return false; }
},
"cut": {
name: "Disabled",
icon: "cut",
disabled: function(){ return true; }
}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
<div id="msg"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,373 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-disabled-changing">Demo: Disabled changing</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Clickable", icon: "edit"},
"cut": {
name: "Disabled",
icon: "cut",
disabled: function(key, opt) {
// this references the trigger element
return !this.data('cutDisabled');
}
},
"toggle": {
name: "Toggle",
callback: function() {
// this references the trigger element
this.data('cutDisabled', !this.data('cutDisabled'));
return false;
}
}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,377 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#demo-disabled-changing">Demo: Disabled changing</a>
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<h1 id="demo-disabled-changing">Demo: Disabled changing</h1>
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var message = "clicked: " + key;
$('#msg').text(message);
},
items: {
"edit": {name: "Clickable", icon: "edit"},
"cut": {
name: "Disabled",
icon: "cut",
disabled: function(key, opt) {
// this references the trigger element
return !this.data('cutDisabled');
}
},
"toggle": {
name: "Toggle",
callback: function() {
// this references the trigger element
this.data('cutDisabled', !this.data('cutDisabled'));
return false;
}
}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
<div id="msg"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,377 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-disabled-menu">Demo: Disabled menu</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral context-menu-disabled">right click me</span></p>
<button type="button btn btn-neutral" id="toggle-disabled">Enable Menu</button>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
$('#toggle-disabled').on('click', function(e) {
e.preventDefault();
var $this = $(this),
$trigger = $('.context-menu-one');
if ($trigger.hasClass('context-menu-disabled')) {
$this.text("Disable Menu");
$trigger.contextMenu(true);
} else {
$this.text("Enable Menu");
$trigger.contextMenu(false);
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,358 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-disabled">Demo: Disabled</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Clickable", icon: "edit", disabled: false},
"cut": {name: "Disabled", icon: "cut", disabled: true}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,362 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#demo-disabled">Demo: Disabled</a>
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<h1 id="demo-disabled">Demo: Disabled</h1>
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var message = "clicked: " + key;
$('#msg').text(message);
},
items: {
"edit": {name: "Clickable", icon: "edit", disabled: false},
"cut": {name: "Disabled", icon: "cut", disabled: true}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
<div id="msg"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,370 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-adding-new-context-menu-triggers">Demo: Adding new Context Menu Triggers</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
build: function($trigger, e) {
// this callback is executed every time the menu is to be shown
// its results are destroyed every time the menu is hidden
// e is the original contextmenu event, containing e.pageX and e.pageY (amongst other data)
return {
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
};
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,374 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-adding-new-context-menu-triggers">Demo: Adding new Context Menu Triggers</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><code>jQuery.contextMenu</code> allows you to define a &lt;menu&gt; before the trigger elements are available.</p>
<div>
<button id="add-trigger" class="btn btn-default" type="submit">Button</button>
</div>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
// add new trigger
$('#add-trigger').on('click', function(e) {
$('<div class="context-menu-one clear btn btn-neutral menu-injected">'
+ 'right click me <em>(injected)'
+ '<br>').insertBefore(this);
// not need for re-initializing $.contextMenu here :)
});
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,362 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-importing-html5">Demo: Importing HTML5 <code>&lt;menu type="context"&gt;</code></h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><code>jQuery.contextMenu</code> allows you to import HTML5's <code>&lt;menu&gt;</code> structures to use in older browsers. </p>
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
items: $.contextMenu.fromMenu($('#html5menu'))
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
<pre><code class="language-html">&lt;menu id="html5menu" style="display:none" class="showcase"&gt;
&lt;command label="rotate" icon="edit" onclick="alert('rotate')"&gt;
&lt;command label="resize" onclick="alert('resize')"&gt;
&lt;command label="twitter" onclick="alert('twitter')"&gt;
&lt;hr&gt;
&lt;command label="facebook" onclick="alert('facebook')"&gt;
&lt;/menu&gt;
&lt;/menu&gt;</code></pre>
<menu id="html5menu" type="context" style="display:none"><command label="rotate" icon="edit" onclick="alert('rotate')"><command label="resize" onclick="alert('resize')"><command label="twitter" onclick="alert('twitter')"><hr><command label="facebook" onclick="alert('facebook')"></command></command></command></command></menu>
<p></menu></p>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,366 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-html5-polyfill-firefox">Demo: HTML5 Polyfill (Firefox)</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral" contextmenu="html5firefox8">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu('html5');
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
<pre><code class="language-html">&lt;menu id="html5firefox8" type="context" &gt;
&lt;menuitem label="rotate" onclick="alert('rotate')" hint="I'm a hint"&gt;&lt;/menuitem&gt;
&lt;menuitem label="resize" onclick="alert('resize')"&gt;&lt;/menuitem&gt;
&lt;menuitem label="disabled" onclick="alert('disabled')" disabled&gt;&lt;/menuitem&gt;
&lt;menu label="share"&gt;
&lt;menuitem label="twitter" onclick="alert('twitter')"&gt;&lt;/menuitem&gt;
&lt;menuitem label="facebook" onclick="alert('facebook')"&gt;&lt;/menuitem&gt;
&lt;hr&gt;
&lt;menuitem type="checkbox" label="(checkbox) yes or no?"
onclick="alert('checkbox: ' + (this.checked ? 'yep!' : 'nope'))"&gt;&lt;/menuitem&gt;
&lt;hr&gt;
&lt;menuitem type="radio" label="(radio) yes" radiogroup="alpha" checked
onclick="alert('radio: yes')"&gt;&lt;/menuitem&gt;
&lt;menuitem type="radio" label="(radio) no" radiogroup="alpha"
onclick="alert('radio: no')"&gt;&lt;/menuitem&gt;
&lt;/menu&gt;
&lt;/menu&gt;</code></pre>
<menu id="html5firefox8" type="context"><menuitem label="rotate" onclick="alert('rotate')" hint="I'm a hint"></menuitem><menuitem label="resize" onclick="alert('resize')"></menuitem><menuitem label="disabled" onclick="alert('disabled')" disabled></menuitem><menu label="share"><menuitem label="twitter" onclick="alert('twitter')"></menuitem><menuitem label="facebook" onclick="alert('facebook')"></menuitem><hr><menuitem type="checkbox" label="(checkbox) yes or no?" onclick="alert('checkbox: ' + (this.checked ? 'yep!' : 'nope'))"></menuitem><hr><menuitem type="radio" label="(radio) yes" radiogroup="alpha" checked onclick="alert('radio: yes')"></menuitem><menuitem type="radio" label="(radio) no" radiogroup="alpha" onclick="alert('radio: no')"></menuitem></menu></menu>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,362 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-html5-polyfill">Demo: HTML5 Polyfill</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><code>jQuery.contextMenu</code> allows you to import HTML5's &lt;menu&gt; structures to use in older browsers. </p>
<p><span class="context-menu-one btn btn-neutral" contextmenu="html5polyfill">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu('html5');
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
<pre><code class="language-html">&lt;menu id="html5polyfill" type="context" style="display:none"&gt;
&lt;command label="rotate" onclick="alert('rotate')" icon="images/cut.png"&gt;
&lt;command label="resize" onclick="alert('resize')" icon="images/door.png"&gt;
&lt;menu label="share"&gt;
&lt;command label="twitter" onclick="alert('twitter')" icon="images/page_white_copy.png"&gt;
&lt;hr&gt;
&lt;command label="facebook" onclick="alert('facebook')" icon="images/page_white_edit.png"&gt;
&lt;hr&gt;
&lt;label&gt;foo bar&lt;input type="text" name="foo"&gt;&lt;/label&gt;
&lt;/menu&gt;
&lt;/menu&gt;</code></pre>
<menu id="html5polyfill" type="context" style="display:none"><command label="rotate" onclick="alert('rotate')" icon="images/cut.png"><command label="resize" onclick="alert('resize')" icon="images/door.png"><menu label="share"><command label="twitter" onclick="alert('twitter')" icon="images/page_white_copy.png"><hr><command label="facebook" onclick="alert('facebook')" icon="images/page_white_edit.png"><hr><label>foo bar<input type="text" name="foo"></label>
</command></command></menu></command></command></menu>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,442 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-input-commands">Demo: Input Commands</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
items: {
// <input type="text">
name: {
name: "Text",
type: 'text',
value: "Hello World",
events: {
keyup: function(e) {
// add some fancy key handling here?
window.console && console.log('key: '+ e.keyCode);
}
}
},
sep1: "---------",
// <input type="checkbox">
yesno: {
name: "Boolean",
type: 'checkbox',
selected: true
},
sep2: "---------",
// <input type="radio">
radio1: {
name: "Radio1",
type: 'radio',
radio: 'radio',
value: '1'
},
radio2: {
name: "Radio2",
type: 'radio',
radio: 'radio',
value: '2',
selected: true
},
radio3: {
name: "Radio3",
type: 'radio',
radio: 'radio',
value: '3'
},
radio4: {
name: "Radio3",
type: 'radio',
radio: 'radio',
value: '4',
disabled: true
},
sep3: "---------",
// <select>
select: {
name: "Select",
type: 'select',
options: {1: 'one', 2: 'two', 3: 'three'},
selected: 2
},
// <textarea>
area1: {
name: "Textarea with height",
type: 'textarea',
value: "Hello World",
height: 40
},
area2: {
name: "Textarea",
type: 'textarea',
value: "Hello World"
},
sep4: "---------",
key: {
name: "Something Clickable",
callback: $.noop
}
},
events: {
show: function(opt) {
// this is the trigger element
var $this = this;
// import states from data store
$.contextMenu.setInputValues(opt, $this.data());
// this basically fills the input commands from an object
// like {name: "foo", yesno: true, radio: "3", &hellip;}
},
hide: function(opt) {
// this is the trigger element
var $this = this;
// export states to data store
$.contextMenu.getInputValues(opt, $this.data());
// this basically dumps the input commands' values to an object
// like {name: "foo", yesno: true, radio: "3", &hellip;}
}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,366 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-keeping-the-menu-visible">Demo: Keeping the Menu visible</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {
name: "Closing on Click",
icon: "edit",
callback: function(){ return true; }
},
"cut": {
name: "Open after Click",
icon: "cut",
callback: function(){ return false; }
}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,452 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-menu-title">Demo: Menu Title</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-css">Example CSS</a></li>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span>
<span class="context-menu-two btn btn-neutral">right click me</span>
<span class="context-menu-three btn btn-neutral">right click me</span></p>
<h2 id="example-css">Example CSS</h2>
<style type="text/css" class="showcase">
/* menu header */
.css-title:before {
content: "some CSS title";
display: block;
position: absolute;
top: 0;
right: 0;
left: 0;
background: #DDD;
padding: 2px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
}
.css-title :first-child {
margin-top: 20px;
}
/* menu header via data attribute */
.data-title:before {
content: attr(data-menutitle);
display: block;
position: absolute;
top: 0;
right: 0;
left: 0;
background: #DDD;
padding: 2px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
}
.data-title :first-child {
margin-top: 20px;
}
</style>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
// register regular menu
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
// register menu with title provided by CSS
$.contextMenu({
selector: '.context-menu-two',
className: 'css-title',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
// register menu with title provided by data-attribute
$.contextMenu({
selector: '.context-menu-three',
className: 'data-title',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
// set a title
$('.data-title').attr('data-menutitle', "Some JS Title");
});
</script>
<h2 id="example-html">Example HTML</h2>
<pre><code class="language-html">&lt;span class="context-menu-one btn btn-neutral"&gt;right click me&lt;/span&gt;
&lt;span class="context-menu-two btn btn-neutral"&gt;right click me&lt;/span&gt;
&lt;span class="context-menu-three btn btn-neutral"&gt;right click me&lt;/span&gt;</code></pre>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,373 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-context-menu-on-dom-element">Demo: Context Menu on DOM Element</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<ul id="the-node"><li><span class="context-menu-one btn btn-neutral">right click me 1</span></li>
<li><span class="context-menu-one btn btn-neutral">right click me 2</span></li>
<li>right click me 3</li>
<li>right click me 4</li>
</ul>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$('#the-node').contextMenu({
selector: 'li',
callback: function(key, options) {
var m = "clicked: " + key + " on " + $(this).text();
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<pre><code class="language-html">&lt;ul id="the-node"&gt;
&lt;li&gt;&lt;span class="context-menu-one btn btn-neutral"&gt;right click me 1&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="context-menu-one btn btn-neutral"&gt;right click me 2&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;right click me 3&lt;/li&gt;
&lt;li&gt;right click me 4&lt;/li&gt;
&lt;/ul&gt;
</code></pre>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,387 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-submenus">Demo: Submenus</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
/**************************************************
* Context-Menu with Sub-Menu
**************************************************/
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {"name": "Edit", "icon": "edit"},
"cut": {"name": "Cut", "icon": "cut"},
"sep1": "---------",
"quit": {"name": "Quit", "icon": "quit"},
"sep2": "---------",
"fold1": {
"name": "Sub group",
"items": {
"fold1-key1": {"name": "Foo bar"},
"fold2": {
"name": "Sub group 2",
"items": {
"fold2-key1": {"name": "alpha"},
"fold2-key2": {"name": "bravo"},
"fold2-key3": {"name": "charlie"}
}
},
"fold1-key3": {"name": "delta"}
}
},
"fold1a": {
"name": "Other group",
"items": {
"fold1a-key1": {"name": "echo"},
"fold1a-key2": {"name": "foxtrot"},
"fold1a-key3": {"name": "golf"}
}
}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,391 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#demo-submenus">Demo: Submenus</a>
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<h1 id="demo-submenus">Demo: Submenus</h1>
<p><span class="context-menu-one btn btn-neutral">right click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
/**************************************************
* Context-Menu with Sub-Menu
**************************************************/
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var message = "clicked: " + key;
$('#msg').text(message);
},
items: {
"edit": {"name": "Edit", "icon": "edit"},
"cut": {"name": "Cut", "icon": "cut"},
"sep1": "---------",
"quit": {"name": "Quit", "icon": "quit"},
"sep2": "---------",
"fold1": {
"name": "Sub group",
"items": {
"fold1-key1": {"name": "Foo bar"},
"fold2": {
"name": "Sub group 2",
"items": {
"fold2-key1": {"name": "alpha"},
"fold2-key2": {"name": "bravo"},
"fold2-key3": {"name": "charlie"}
}
},
"fold1-key3": {"name": "delta"}
}
},
"fold1a": {
"name": "Other group",
"items": {
"fold1a-key1": {"name": "echo"},
"fold1a-key2": {"name": "foxtrot"},
"fold1a-key3": {"name": "golf"}
}
}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
<div id="msg"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,373 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-custom-activated-context-menu">Demo: Custom Activated Context Menu</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">press that button</span></p>
<button id="activate-menu" class="btn btn-default" type="submit">Button</button>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
// make button open the menu
$('#activate-menu').on('click', function(e) {
e.preventDefault();
$('.context-menu-one').contextMenu();
// or $('.context-menu-one').trigger("contextmenu");
// or $('.context-menu-one').contextMenu({x: 100, y: 100});
});
$.contextMenu({
selector: '.context-menu-one',
trigger: 'none',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,366 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-hover-activated-context-menu-with-autohide">Demo: Hover Activated Context Menu With Autohide</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">hover over me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
trigger: 'hover',
delay: 500,
autoHide: true,
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,365 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-hover-activated-context-menu">Demo: Hover Activated Context Menu</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">hover over me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
trigger: 'hover',
delay: 500,
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,364 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-left-click-trigger">Demo: Left-Click Trigger</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">left click me</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
$.contextMenu({
selector: '.context-menu-one',
trigger: 'left',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,383 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="http://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="../../../dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../../src/jquery.contextMenu.js" type="text/javascript"></script>
<script src="../../../src/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="http://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="http://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="http://www.swis.nl"><img src="http://swisnl.github.io/jQuery-contextMenu/images/swis-logo.jpg" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="http://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-swipe-trigger">Demo: Swipe Trigger</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.touchswipe/1.6.12/jquery.touchSwipe.min.js"></script>
<p>This demo uses the (third party) <a href="https://github.com/mattbryson/TouchSwipe-Jquery-Plugin">TouchSwipe</a> plugin.</p>
<p><span class="context-menu-one btn btn-neutral">swype right</span></p>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
// make swipe right open the menu
$('.context-menu-one').swipe({
// see http://labs.skinkers.com/touchSwipe/
swipe: function(event, direction, distance, duration, fingerCount) {
if (fingerCount === 1) {
$(this).contextMenu({
x: event.changedTouches[0].screenX,
y: event.changedTouches[0].screenY,
});
}
}
});
$.contextMenu({
selector: '.context-menu-one',
trigger: 'none',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"fold1a": {
"name": "Some submenu",
"items": {
"fold1a-key1": {"name": "echo"},
"fold1a-key2": {"name": "foxtrot"},
"fold1a-key3": {"name": "golf"}
}
}
}
});
});
</script>
<h2 id="example-html">Example HTML</h2>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="http://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>

View File

@ -0,0 +1,39 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
var text1 = '.context-menu-root input[name="context-menu-input-name"]';
var textArea1 = '.context-menu-root textarea[name="context-menu-input-area1"]';
var textArea2 = '.context-menu-root textarea[name="context-menu-input-area2"]';
module.exports = {
'HTML5 input-based menu is shown correctly': function (test) {
test
.open('file://' + pwd + '/test/integration/html/input.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.assert.visible('.context-menu-root', 'Menu is present')
.assert.exists('.context-menu-root', 'It opens context menu')
.assert.numberOfElements('.context-menu-root li')
.is(14, '14 context menu items are shown')
.assert.numberOfElements('.context-menu-root input')
.is(6, '6 HTML input items are shown')
.assert.width('.context-menu-root').is.gt(100)
.done();
},
'HTML5 input-based menu stores state when closed': function (test) {
test
.open('file://' + pwd + '/test/integration/html/input.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.type(text1, 'lorem ipsum')
.type(textArea1, 'test area with height')
.type(textArea2, 'shots go off')
.execute(helper.closeMenu, '.context-menu-one')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.assert.val(text1, 'lorem ipsum', 'Input text should contain entered text')
.assert.val(textArea1, 'test area with height', 'Text area 1 should contain entered text')
.assert.val(textArea2, 'shots go off', 'Text area 2 should contain entered text')
.done();
}
};

View File

@ -0,0 +1,40 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
module.exports = {
'Ensure context menu is shown': function (test) {
test
.open('file://' + pwd + '/test/integration/html/keeping-contextmenu-open.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.assert.exists('.context-menu-root', 'It opens context menu')
.assert.numberOfElements('.context-menu-root li')
.is(2, '2 context menu items are shown')
.done();
},
'Close context menu after first menu item is clicked': function (test) {
test
.open('file://' + pwd + '/test/integration/html/keeping-contextmenu-open.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.assert.visible('.context-menu-root li:first-child', 'Menu item is present')
.click('.context-menu-root li:first-child')
.assert.doesntExist('#context-menu-layer', 'It closes context menu')
.done();
},
'Keep context menu open after second menu item is clicked': function (test) {
test
.open('file://' + pwd + '/test/integration/html/keeping-contextmenu-open.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.wait(100)
.assert.visible('.context-menu-root', 'Menu is present')
.click('.context-menu-root li:last-child')
.assert.exists('#context-menu-layer', 'It closes context menu')
.done();
}
};

View File

@ -0,0 +1,25 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
module.exports = {
'Right-click on multiple DOM elements': function (test) {
test
.open('file://' + pwd + '/test/integration/html/on-dom-element.html')
.execute(helper.rightClick, '#the-node li:first-child')
.waitForElement('#context-menu-layer')
.assert.exists('.context-menu-root', 'It opens context menu')
.assert.numberOfElements('.context-menu-root li')
.is(7, '7 context menu items are shown')
.assert.numberOfElements('.context-menu-active')
.is(1, 'ensure one context menu is open')
// right click on the other DOM element
.execute(helper.rightClick, '#the-node li:nth-child(3)')
.wait(100) // wait for the old menu to close and new to reopen
.waitForElement('#context-menu-layer')
.assert.exists('.context-menu-root', 'It re-opens the same context menu')
.assert.numberOfElements('.context-menu-active')
.is(1, 'ensure still only one context menu is open')
.done();
}
};

View File

@ -0,0 +1,68 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
var menuItem4 = '.context-menu-root li:nth-child(6)';
var submenu1 = '.context-menu-root li.context-menu-item:nth-child(6) > ul:nth-child(2)';
var submenu1Foobar = '.context-menu-root li.context-menu-item:nth-child(6) > ul:nth-child(2) > li:nth-child(1)';
var submenu1Item2 = '.context-menu-root li.context-menu-submenu:nth-child(2)';
var submenu1Subgroup2 = '.context-menu-root li.context-menu-item:nth-child(6) > ul:nth-child(2) > li:nth-child(2)';
var submenu1Subgroup2Charlie = '.context-menu-root li.context-menu-submenu:nth-child(2) > ul:nth-child(2) > li:nth-child(3)';
var returnKey = "\uE006\uE007"; // send <enter> key as well for phantomJS
var rightArrowKey = "\uE014";
var downArrowKey = "\uE015";
var selectFourthMenuItem = downArrowKey + downArrowKey + downArrowKey + downArrowKey;
var selectFirstSubmenuItem = selectFourthMenuItem + rightArrowKey;
var selectSecondSubmenuItem = selectFourthMenuItem + rightArrowKey + downArrowKey;
var selectThirdSubSubMenuItem = selectSecondSubmenuItem + rightArrowKey + downArrowKey + downArrowKey;
// this test uses custom HTML because PhantomJS
// has problems showing alert modal dialogs.
// We are testing callbacks against simple DOM
// manipulations instead.
module.exports = {
'Sub-menu is visible when parent menu item is highlighted': function (test) {
test
.open('file://' + pwd + '/test/integration/html/sub-menus_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.sendKeys('body', selectFourthMenuItem)
.assert.attr(menuItem4, 'class').to.contain('hover')
.assert.visible(submenu1, 'First sub-menu is visible')
.done();
},
'Sub-menu item triggers callback when clicked': function (test) {
test
.open('file://' + pwd + '/test/integration/html/sub-menus_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.sendKeys('body', selectFirstSubmenuItem)
.sendKeys('body', returnKey)
.assert.text('#msg', 'clicked: fold1-key1', '"Foo bar" sub-menu item triggers callback')
.done();
},
'Sub-sub-menu is visible when parent menu item is highlighted': function (test) {
test
.open('file://' + pwd + '/test/integration/html/sub-menus_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.sendKeys('body', selectSecondSubmenuItem)
.assert.attr(submenu1Item2, 'class').to.contain('hover')
.assert.visible(submenu1Subgroup2, 'Sub-sub-menu should be open and visible')
.done();
},
'Sub-sub-menu item callback is triggered': function (test) {
test
.open('file://' + pwd + '/test/integration/html/sub-menus_test.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.sendKeys('body', selectThirdSubSubMenuItem)
.sendKeys('body', returnKey)
.assert.text('#msg', 'clicked: fold2-key3', '"charlie" Sub-sub-menu item triggers callback')
.done();
}
};

View File

@ -0,0 +1,19 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
module.exports = {
'Mouse hover opens context menu': function (test) {
test
.open('file://' + pwd + '/test/integration/html/trigger-custom.html')
.click('#activate-menu')
.waitForElement('#context-menu-layer')
.assert.visible('.context-menu-root', 'Menu is present')
.assert.exists('.context-menu-root', 'It opens context menu')
.assert.numberOfElements('.context-menu-root li')
.is(7, '7 context menu items are shown')
.click('#context-menu-layer')
.wait(100)
.assert.doesntExist('#context-menu-layer', 'Click outside closes context menu')
.done();
}
};

View File

@ -0,0 +1,18 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
module.exports = {
'Left-click opens context menu': function (test) {
test
.open('file://' + pwd + '/test/integration/html/trigger-left-click.html')
.click('.context-menu-one')
.waitForElement('#context-menu-layer')
.assert.visible('.context-menu-root', 'Menu is present')
.assert.exists('.context-menu-root', 'It opens context menu')
.assert.numberOfElements('.context-menu-root li')
.is(7, '7 context menu items are shown')
.assert.width('.context-menu-root').is.gt(100)
.done();
}
};

View File

@ -0,0 +1,17 @@
var pwd = process.cwd();
var helper = require('../integration_test_helper.js');
module.exports = {
'Right-click opens context menu': function (test) {
test
.open('file://' + pwd + '/demo.html')
.execute(helper.rightClick, '.context-menu-one')
.waitForElement('#context-menu-layer')
.assert.visible('.context-menu-root', 'Menu is present')
.assert.exists('.context-menu-root', 'It opens context menu')
.assert.numberOfElements('.context-menu-root li')
.is(7, '7 context menu items are shown')
.assert.width('.context-menu-root').is.gt(100)
.done();
}
};

View File

@ -0,0 +1,27 @@
module.exports = {
/* simulate right click event in javascript */
rightClick: function rightClick(selector, type) {
var element = document.querySelector(selector);
var evt = element.ownerDocument.createEvent('MouseEvents');
var RIGHT_CLICK_BUTTON_CODE = 2;
var eventType = type ? type : 'contextmenu';
evt.initMouseEvent(eventType, true, true,
element.ownerDocument.defaultView, 1, 0, 0, 0, 0, false,
false, false, false, RIGHT_CLICK_BUTTON_CODE, null);
if (document.createEventObject) {
// dispatch for IE <= 9
return element.fireEvent('onclick', evt)
} else {
// dispatch for normal browsers
return !element.dispatchEvent(evt);
}
},
/* close jQuery contextMenu */
closeMenu: function closeMenu(selector) {
jQuery(selector).contextMenu('hide');
}
};

View File

@ -0,0 +1,143 @@
var menuOpenCounter = 0;
var menuCloseCounter = 0;
var itemSelectedCounter = 0;
var menuRuntime = null;
module('contextMenu events');
// before each test
function createContextMenu(items) {
var $fixture = $('#qunit-fixture');
// ensure `#qunit-fixture` exists when testing with karma runner
if ($fixture.length === 0) {
$('<div id="qunit-fixture">').appendTo("body");
$fixture = $('#qunit-fixture');
}
$fixture.append("<div class='context-menu'>right click me!</div>");
if(!items){
items = {
copy: {name: 'Copy', icon: 'copy'},
paste: {name: 'Paste', icon: 'paste'}
};
}
$.contextMenu({
selector: '.context-menu',
events: {
show: function(opt) {
menuRuntime = opt;
menuOpenCounter = menuOpenCounter + 1;
},
hide: function() {
menuCloseCounter = menuCloseCounter + 1;
}
},
callback: function(key, options) {
itemSelectedCounter = itemSelectedCounter + 1;
},
items: items
});
}
// after each test
function destroyContextMenuAndCleanup() {
$.contextMenu('destroy');
// clean up `#qunit-fixture` when testing in karma runner
var $fixture = $('#qunit-fixture');
if ($fixture.length) {
$fixture.html('');
}
// reset vars
menuOpenCounter = 0;
menuCloseCounter = 0;
itemSelectedCounter = 0;
menuRuntime = null;
}
test('$.contextMenu object exists', function() {
ok($.contextMenu, '$.contextMenu plugin is loaded');
notEqual($.contextMenu, undefined, '$.contextMenu is not undefined');
});
test('open contextMenu', function() {
createContextMenu();
$(".context-menu").contextMenu();
equal(menuOpenCounter, 1, 'contextMenu was opened once');
destroyContextMenuAndCleanup();
});
test('open contextMenu at 0,0', function() {
createContextMenu();
$(".context-menu").contextMenu({x: 0, y: 0});
equal(menuOpenCounter, 1, 'contextMenu was opened once');
destroyContextMenuAndCleanup();
});
test('close contextMenu', function() {
createContextMenu();
$(".context-menu").contextMenu();
$(".context-menu").contextMenu('hide');
equal(menuCloseCounter, 1, 'contextMenu was closed once');
destroyContextMenuAndCleanup();
});
test('navigate contextMenu items', function() {
createContextMenu();
var itemWasFocused = 0;
var itemWasBlurred = 0;
// listen to focus and blur events
$(document.body)
.on("contextmenu:focus", ".context-menu-item", function(e) {
itemWasFocused = itemWasFocused + 1;
})
.on("contextmenu:blur", ".context-menu-item", function(e) {
itemWasBlurred = itemWasBlurred + 1;
});
$(".context-menu").contextMenu();
menuRuntime.$menu.trigger('nextcommand'); // triggers contextmenu:focus
equal(itemWasFocused, 1, 'first menu item was focused once');
itemWasFocused = 0;
menuRuntime.$menu.trigger('nextcommand'); // triggers contextmenu:blur & contextmenu:focus
equal(itemWasFocused, 1, 'first menu item was blurred');
equal(itemWasBlurred, 1, 'second menu item was focused');
destroyContextMenuAndCleanup();
});
test('activate contextMenu item', function() {
createContextMenu();
$(".context-menu").contextMenu();
menuRuntime.$menu.trigger('nextcommand');
menuRuntime.$selected.trigger('mouseup');
equal(itemSelectedCounter, 1, 'selected menu item was clicked once');
destroyContextMenuAndCleanup();
});
test('do not open context menu with no visible items', function() {
createContextMenu({
copy: {name: 'Copy', icon: 'copy', visible: function(){return false;}},
paste: {name: 'Paste', icon: 'paste', visible: function(){return false;}}
});
$(".context-menu").contextMenu();
equal(menuOpenCounter, 0, 'selected menu wat not opened');
destroyContextMenuAndCleanup();
});