Skip to content

Commit ec298a5

Browse files
committed
more integration tests
1 parent b8afeb5 commit ec298a5

14 files changed

+741
-18
lines changed

demo/accesskeys_test.html

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6+
<title>Accesskeys Demo - jQuery contextMenu Plugin</title>
7+
<meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8+
9+
<script src="../jquery-1.8.2.min.js" type="text/javascript"></script>
10+
<script src="../src/jquery.ui.position.js" type="text/javascript"></script>
11+
<script src="../src/jquery.contextMenu.js" type="text/javascript"></script>
12+
<script src="../prettify/prettify.js" type="text/javascript"></script>
13+
<script src="../screen.js" type="text/javascript"></script>
14+
15+
<link href="../src/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
16+
<link href="../screen.css" rel="stylesheet" type="text/css" />
17+
<link href="../prettify/prettify.sunburst.css" rel="stylesheet" type="text/css" />
18+
19+
<script type="text/javascript">
20+
21+
var _gaq = _gaq || [];
22+
_gaq.push(['_setAccount', 'UA-8922143-3']);
23+
_gaq.push(['_trackPageview']);
24+
25+
(function() {
26+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
27+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
28+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
29+
})();
30+
31+
</script>
32+
</head>
33+
<body>
34+
<a id="github-forkme" href="https://github.com/medialize/jQuery-contextMenu"><img src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
35+
<div id="container">
36+
<h1><a href="https://github.com/medialize/jQuery-contextMenu">jQuery contextMenu</a></h1>
37+
38+
<ul class="menu">
39+
<li><a href="../index.html">About</a></li>
40+
<li class="active"><a href="../demo.html">Demo</a></li>
41+
<li><a href="../docs.html">Documentation</a></li>
42+
<li><a href="http://rodneyrehm.de/en/">Author</a></li>
43+
</ul>
44+
45+
<h2 id="demo">Demo: Accesskeys</h2>
46+
<div class="inline-spaces">
47+
<div class="context-menu-one box menu-1">
48+
<strong>right click me</strong>
49+
</div>
50+
</div>
51+
52+
<h3 id="code">Example code: Accesskeys</h3>
53+
<script type="text/javascript" class="showcase">
54+
$(function(){
55+
$.contextMenu({
56+
selector: '.context-menu-one',
57+
callback: function(key, options) {
58+
var message = "clicked: " + key;
59+
$('#msg').text(message);
60+
},
61+
items: {
62+
"edit": {name: "Edit", icon: "edit", accesskey: "e"},
63+
"cut": {name: "Cut", icon: "cut", accesskey: "c"},
64+
// first unused character is taken (here: o)
65+
"copy": {name: "Copy", icon: "copy", accesskey: "c o p y"},
66+
// words are truncated to their first letter (here: p)
67+
"paste": {name: "Paste", icon: "paste", accesskey: "cool paste"},
68+
"delete": {name: "Delete", icon: "delete"},
69+
"sep1": "---------",
70+
"quit": {name: "Quit", icon: "quit"}
71+
}
72+
});
73+
});
74+
</script>
75+
76+
<h3 id="html">Example HTML: Accesskeys</h3>
77+
<div style="display:none" class="showcase" data-showcase-import=".menu-1"></div>
78+
79+
<h2>jQuery Context Menu Demo Gallery</h2>
80+
<ul id="demo-list">
81+
<li><a href="../demo.html">Simple Context Menu</a></li>
82+
<li><a href="on-dom-element.html">Context Menu on DOM Element</a></li>
83+
<li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
84+
<li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
85+
<li><a href="async-create.html">Create Context Menu (asynchronous)</a></li>
86+
87+
<li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
88+
<li><a href="callback.html">Command's action (callbacks)</a></li>
89+
90+
<li><a href="trigger-left-click.html">Left-Click Trigger</a></li>
91+
<li><a href="trigger-swipe.html">Swipe Trigger</a></li>
92+
<li><a href="trigger-hover.html">Hover Activated Context Menu</a></li>
93+
<li><a href="trigger-hover-autohide.html">Hover Activated Context Menu With Autohide</a></li>
94+
<li><a href="trigger-custom.html">Custom Activated Context Menu</a></li>
95+
96+
<li><a href="disabled-menu.html">Disabled Menu</a></li>
97+
<li><a href="disabled.html">Disabled Command</a></li>
98+
<li><a href="disabled-callback.html">Disabled Callback Command</a></li>
99+
<li><a href="disabled-changing.html">Changing Command's disabled status</a></li>
100+
101+
<li class="current"><a href="accesskeys.html">Accesskeys</a></li>
102+
<li><a href="sub-menus.html">Submenus</a></li>
103+
104+
<li><a href="input.html">Input Commands</a></li>
105+
<li><a href="custom-command.html">Custom Command Types</a></li>
106+
107+
<li><a href="menu-title.html">Menus with titles</a></li>
108+
109+
<li><a href="html5-import.html">Importing HTML5 &lt;menu type=&quot;context&quot;&gt;</a></li>
110+
<li><a href="html5-polyfill.html">HTML5 Polyfill</a></li>
111+
<li><a href="html5-polyfill-firefox8.html">HTML5 Polyfill (Firefox 8)</a></li>
112+
</ul>
113+
</div>
114+
<div id="msg"></div>
115+
</body>
116+
</html>

demo/disabled-callback_test.html

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6+
<title>Disabled Callback Demo - jQuery contextMenu Plugin</title>
7+
<meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8+
9+
<script src="../jquery-1.8.2.min.js" type="text/javascript"></script>
10+
<script src="../src/jquery.ui.position.js" type="text/javascript"></script>
11+
<script src="../src/jquery.contextMenu.js" type="text/javascript"></script>
12+
<script src="../prettify/prettify.js" type="text/javascript"></script>
13+
<script src="../screen.js" type="text/javascript"></script>
14+
15+
<link href="../src/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
16+
<link href="../screen.css" rel="stylesheet" type="text/css" />
17+
<link href="../prettify/prettify.sunburst.css" rel="stylesheet" type="text/css" />
18+
19+
<script type="text/javascript">
20+
21+
var _gaq = _gaq || [];
22+
_gaq.push(['_setAccount', 'UA-8922143-3']);
23+
_gaq.push(['_trackPageview']);
24+
25+
(function() {
26+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
27+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
28+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
29+
})();
30+
31+
</script>
32+
</head>
33+
<body>
34+
<a id="github-forkme" href="https://github.com/medialize/jQuery-contextMenu"><img src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
35+
<div id="container">
36+
<h1><a href="https://github.com/medialize/jQuery-contextMenu">jQuery contextMenu</a></h1>
37+
38+
<ul class="menu">
39+
<li><a href="../index.html">About</a></li>
40+
<li class="active"><a href="../demo.html">Demo</a></li>
41+
<li><a href="../docs.html">Documentation</a></li>
42+
<li><a href="http://rodneyrehm.de/en/">Author</a></li>
43+
</ul>
44+
45+
<h2 id="demo">Demo: Disabled Callback</h2>
46+
<div class="inline-spaces">
47+
<div class="context-menu-one box menu-1">
48+
<strong>right click me</strong>
49+
</div>
50+
</div>
51+
52+
<h3 id="code">Example code: Disabled Callback</h3>
53+
<script type="text/javascript" class="showcase">
54+
$(function(){
55+
$.contextMenu({
56+
selector: '.context-menu-one',
57+
callback: function(key, options) {
58+
var message = "clicked: " + key;
59+
$('#msg').text(message);
60+
},
61+
items: {
62+
"edit": {
63+
name: "Clickable",
64+
icon: "edit",
65+
disabled: function(){ return false; }
66+
},
67+
"cut": {
68+
name: "Disabled",
69+
icon: "cut",
70+
disabled: function(){ return true; }
71+
}
72+
}
73+
});
74+
});
75+
</script>
76+
77+
<h3 id="html">Example HTML: Disabled Callback</h3>
78+
<div style="display:none" class="showcase" data-showcase-import=".menu-1"></div>
79+
80+
<h2>jQuery Context Menu Demo Gallery</h2>
81+
<ul id="demo-list">
82+
<li><a href="../demo.html">Simple Context Menu</a></li>
83+
<li><a href="on-dom-element.html">Context Menu on DOM Element</a></li>
84+
<li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
85+
<li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
86+
<li><a href="async-create.html">Create Context Menu (asynchronous)</a></li>
87+
88+
<li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
89+
<li><a href="callback.html">Command's action (callbacks)</a></li>
90+
91+
<li><a href="trigger-left-click.html">Left-Click Trigger</a></li>
92+
<li><a href="trigger-swipe.html">Swipe Trigger</a></li>
93+
<li><a href="trigger-hover.html">Hover Activated Context Menu</a></li>
94+
<li><a href="trigger-hover-autohide.html">Hover Activated Context Menu With Autohide</a></li>
95+
<li><a href="trigger-custom.html">Custom Activated Context Menu</a></li>
96+
97+
<li><a href="disabled-menu.html">Disabled Menu</a></li>
98+
<li><a href="disabled.html">Disabled Command</a></li>
99+
<li class="current"><a href="disabled-callback.html">Disabled Callback Command</a></li>
100+
<li><a href="disabled-changing.html">Changing Command's disabled status</a></li>
101+
102+
<li><a href="accesskeys.html">Accesskeys</a></li>
103+
<li><a href="sub-menus.html">Submenus</a></li>
104+
105+
<li><a href="input.html">Input Commands</a></li>
106+
<li><a href="custom-command.html">Custom Command Types</a></li>
107+
108+
<li><a href="menu-title.html">Menus with titles</a></li>
109+
110+
<li><a href="html5-import.html">Importing HTML5 &lt;menu type=&quot;context&quot;&gt;</a></li>
111+
<li><a href="html5-polyfill.html">HTML5 Polyfill</a></li>
112+
<li><a href="html5-polyfill-firefox8.html">HTML5 Polyfill (Firefox 8)</a></li>
113+
</ul>
114+
</div>
115+
<div id="msg"></div>
116+
</body>
117+
</html>

demo/disabled-changing_test.html

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6+
<title>Changing Disabled Demo - jQuery contextMenu Plugin</title>
7+
<meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8+
9+
<script src="../jquery-1.8.2.min.js" type="text/javascript"></script>
10+
<script src="../src/jquery.ui.position.js" type="text/javascript"></script>
11+
<script src="../src/jquery.contextMenu.js" type="text/javascript"></script>
12+
<script src="../prettify/prettify.js" type="text/javascript"></script>
13+
<script src="../screen.js" type="text/javascript"></script>
14+
15+
<link href="../src/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
16+
<link href="../screen.css" rel="stylesheet" type="text/css" />
17+
<link href="../prettify/prettify.sunburst.css" rel="stylesheet" type="text/css" />
18+
19+
<script type="text/javascript">
20+
21+
var _gaq = _gaq || [];
22+
_gaq.push(['_setAccount', 'UA-8922143-3']);
23+
_gaq.push(['_trackPageview']);
24+
25+
(function() {
26+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
27+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
28+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
29+
})();
30+
31+
</script>
32+
</head>
33+
<body>
34+
<a id="github-forkme" href="https://github.com/medialize/jQuery-contextMenu"><img src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
35+
<div id="container">
36+
<h1><a href="https://github.com/medialize/jQuery-contextMenu">jQuery contextMenu</a></h1>
37+
38+
<ul class="menu">
39+
<li><a href="../index.html">About</a></li>
40+
<li class="active"><a href="../demo.html">Demo</a></li>
41+
<li><a href="../docs.html">Documentation</a></li>
42+
<li><a href="http://rodneyrehm.de/en/">Author</a></li>
43+
</ul>
44+
45+
<h2 id="demo">Demo: Changing Disabled</h2>
46+
<div class="inline-spaces">
47+
<div class="context-menu-one box menu-1">
48+
<strong>right click me</strong>
49+
</div>
50+
</div>
51+
52+
<h3 id="code">Example code: Changing Disabled</h3>
53+
<script type="text/javascript" class="showcase">
54+
$(function(){
55+
$.contextMenu({
56+
selector: '.context-menu-one',
57+
callback: function(key, options) {
58+
var message = "clicked: " + key;
59+
$('#msg').text(message);
60+
},
61+
items: {
62+
"edit": {name: "Clickable", icon: "edit"},
63+
"cut": {
64+
name: "Disabled",
65+
icon: "cut",
66+
disabled: function(key, opt) {
67+
// this references the trigger element
68+
return !this.data('cutDisabled');
69+
}
70+
},
71+
"toggle": {
72+
name: "Toggle",
73+
callback: function() {
74+
// this references the trigger element
75+
this.data('cutDisabled', !this.data('cutDisabled'));
76+
return false;
77+
}
78+
}
79+
}
80+
});
81+
});
82+
</script>
83+
84+
<h3 id="html">Example HTML: Changing Disabled</h3>
85+
<div style="display:none" class="showcase" data-showcase-import=".menu-1"></div>
86+
87+
<h2>jQuery Context Menu Demo Gallery</h2>
88+
<ul id="demo-list">
89+
<li><a href="../demo.html">Simple Context Menu</a></li>
90+
<li><a href="on-dom-element.html">Context Menu on DOM Element</a></li>
91+
<li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
92+
<li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
93+
<li><a href="async-create.html">Create Context Menu (asynchronous)</a></li>
94+
95+
<li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
96+
<li><a href="callback.html">Command's action (callbacks)</a></li>
97+
98+
<li><a href="trigger-left-click.html">Left-Click Trigger</a></li>
99+
<li><a href="trigger-swipe.html">Swipe Trigger</a></li>
100+
<li><a href="trigger-hover.html">Hover Activated Context Menu</a></li>
101+
<li><a href="trigger-hover-autohide.html">Hover Activated Context Menu With Autohide</a></li>
102+
<li><a href="trigger-custom.html">Custom Activated Context Menu</a></li>
103+
104+
<li><a href="disabled-menu.html">Disabled Menu</a></li>
105+
<li><a href="disabled.html">Disabled Command</a></li>
106+
<li><a href="disabled-callback.html">Disabled Callback Command</a></li>
107+
<li class="current"><a href="disabled-changing.html">Changing Command's disabled status</a></li>
108+
109+
<li><a href="accesskeys.html">Accesskeys</a></li>
110+
<li><a href="sub-menus.html">Submenus</a></li>
111+
112+
<li><a href="input.html">Input Commands</a></li>
113+
<li><a href="custom-command.html">Custom Command Types</a></li>
114+
115+
<li><a href="menu-title.html">Menus with titles</a></li>
116+
117+
<li><a href="html5-import.html">Importing HTML5 &lt;menu type=&quot;context&quot;&gt;</a></li>
118+
<li><a href="html5-polyfill.html">HTML5 Polyfill</a></li>
119+
<li><a href="html5-polyfill-firefox8.html">HTML5 Polyfill (Firefox 8)</a></li>
120+
</ul>
121+
</div>
122+
<div id="msg"></div>
123+
</body>
124+
</html>

0 commit comments

Comments
 (0)