Skip to content
This repository
Browse code

docs for dynamic menus, doc sugar

  • Loading branch information...
commit 90e6b35f320966f71c6c847e589bf53ef1e630ff 1 parent e658a84
Rodney Rehm authored December 13, 2011
1  demo.html
@@ -79,6 +79,7 @@ <h3 id="html">Example HTML: Simple Context Menu</h3>
79 79
     <ul id="demo-list">
80 80
         <li class="current"><a href="demo.html">Simple Context Menu</a></li>
81 81
         <li><a href="demo/dynamic.html">Adding new Context Menu Triggers</a></li>
  82
+        <li><a href="demo/dynamic-create.html">Create Context Menu on demand</a></li>
82 83
 
83 84
         <li><a href="demo/keeping-contextmenu-open.html">Keeping the context menu open</a></li>
84 85
         <li><a href="demo/callback.html">Command's action (callbacks)</a></li>
3  demo/accesskeys.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Accesskeys Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -80,6 +80,7 @@ <h3 id="html">Example HTML: Accesskeys</h3>
80 80
     <ul id="demo-list">
81 81
         <li><a href="../demo.html">Simple Context Menu</a></li>
82 82
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  83
+        <li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
83 84
 
84 85
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
85 86
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/callback.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Command's action (callbacks) Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -87,6 +87,7 @@ <h3 id="html">Example HTML: Command's action (callbacks)</h3>
87 87
     <ul id="demo-list">
88 88
         <li><a href="../demo.html">Simple Context Menu</a></li>
89 89
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  90
+        <li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
90 91
 
91 92
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
92 93
         <li class="current"><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/custom-command.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Custom Command Types Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -132,6 +132,7 @@ <h3 id="html">Example HTML: Custom Command Types</h3>
132 132
     <ul id="demo-list">
133 133
         <li><a href="../demo.html">Simple Context Menu</a></li>
134 134
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  135
+        <li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
135 136
 
136 137
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
137 138
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/disabled-callback.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Disabled Callback Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -81,6 +81,7 @@ <h3 id="html">Example HTML: Disabled Callback</h3>
81 81
     <ul id="demo-list">
82 82
         <li><a href="../demo.html">Simple Context Menu</a></li>
83 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>
84 85
 
85 86
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
86 87
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/disabled-changing.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Changing Disabled Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -88,6 +88,7 @@ <h3 id="html">Example HTML: Changing Disabled</h3>
88 88
     <ul id="demo-list">
89 89
         <li><a href="../demo.html">Simple Context Menu</a></li>
90 90
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  91
+        <li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
91 92
 
92 93
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
93 94
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/disabled-menu.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Disabled Context Menu Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -93,6 +93,7 @@ <h3 id="html">Example HTML: Disabled Context Menu</h3>
93 93
     <ul id="demo-list">
94 94
         <li><a href="../demo.html">Simple Context Menu</a></li>
95 95
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  96
+        <li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
96 97
 
97 98
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
98 99
         <li><a href="callback.html">Command's action (callbacks)</a></li>
9  demo/disabled.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Disabled Command Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -42,14 +42,14 @@
42 42
         <li><a href="http://rodneyrehm.de/en/">Author</a></li>
43 43
     </ul>
44 44
 
45  
-    <h2 id="demo">Demo: Disabled</h2>
  45
+    <h2 id="demo">Demo: Disabled Command</h2>
46 46
     <div class="inline-spaces">
47 47
 <div class="context-menu-one box menu-1">
48 48
     <strong>right click me</strong>
49 49
 </div>
50 50
     </div>
51 51
 
52  
-    <h3 id="code">Example code: Disabled</h3>
  52
+    <h3 id="code">Example code: Disabled Command</h3>
53 53
     <script type="text/javascript" class="showcase">
54 54
 $(function(){
55 55
     $.contextMenu({
@@ -66,13 +66,14 @@ <h3 id="code">Example code: Disabled</h3>
66 66
 });
67 67
     </script>
68 68
 
69  
-    <h3 id="html">Example HTML: Disabled</h3>
  69
+    <h3 id="html">Example HTML: Disabled Command</h3>
70 70
     <div style="display:none" class="showcase" data-showcase-import=".menu-1"></div>
71 71
     
72 72
     <h2>jQuery Context Menu Demo Gallery</h2>
73 73
     <ul id="demo-list">
74 74
         <li><a href="../demo.html">Simple Context Menu</a></li>
75 75
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  76
+        <li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
76 77
 
77 78
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
78 79
         <li><a href="callback.html">Command's action (callbacks)</a></li>
13  demo/dynamic-create.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Dynamic on-demand Menu Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -42,20 +42,22 @@
42 42
         <li><a href="http://rodneyrehm.de/en/">Author</a></li>
43 43
     </ul>
44 44
     
45  
-    <h2 id="demo">Demo: Simple Context Menu</h2>
  45
+    <h2 id="demo">Demo: Dynamic on-demand Menu</h2>
46 46
     <div class="inline-spaces">
47 47
 <div class="context-menu-one box menu-1">
48 48
     <strong>right click me</strong>
49 49
 </div>
50 50
     </div>
51 51
 
52  
-    <h3 id="code">Example code: Simple Context Menu</h3>
  52
+    <h3 id="code">Example code: Dynamic on-demand Menu</h3>
53 53
     <script type="text/javascript" class="showcase">
54 54
 $(function(){
55 55
     $.contextMenu({
56 56
         selector: '.context-menu-one', 
57 57
         ignoreRightClick: false,
58 58
         build: function($trigger) {
  59
+            // this callback is executed every time the menu is to be shown
  60
+            // its results are destroyed every time the menu is hidden
59 61
             return {
60 62
                 callback: function(key, options) {
61 63
                     var m = "clicked: " + key;
@@ -76,14 +78,15 @@ <h3 id="code">Example code: Simple Context Menu</h3>
76 78
 });
77 79
     </script>
78 80
 
79  
-    <h3 id="html">Example HTML: Simple Context Menu</h3>
  81
+    <h3 id="html">Example HTML: Dynamic on-demand Menu</h3>
80 82
     <div style="display:none" class="showcase" data-showcase-import=".menu-1"></div>
81 83
     
82 84
     
83 85
     <h2>jQuery Context Menu Demo Gallery</h2>
84 86
     <ul id="demo-list">
85  
-        <li class="current"><a href="demo.html">Simple Context Menu</a></li>
  87
+        <li><a href="demo.html">Simple Context Menu</a></li>
86 88
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  89
+        <li class="current"><a href="dynamic-create.html">Create Context Menu on demand</a></li>
87 90
 
88 91
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
89 92
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/dynamic.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Adding new Context Menu Triggers Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -89,6 +89,7 @@ <h3 id="html">Example HTML: Adding new Context Menu Triggers</h3>
89 89
     <ul id="demo-list">
90 90
         <li><a href="../demo.html">Simple Context Menu</a></li>
91 91
         <li class="current"><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>
92 93
 
93 94
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
94 95
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/html5-import.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Importing HTML5 &lt;menu type=&quot;context&quot;&gt; Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -76,6 +76,7 @@ <h3 id="html">Example HTML: Importing HTML5 &lt;menu type=&quot;context&quot;&gt
76 76
     <ul id="demo-list">
77 77
         <li><a href="../demo.html">Simple Context Menu</a></li>
78 78
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  79
+        <li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
79 80
 
80 81
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
81 82
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/html5-polyfill-firefox8.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>HTML5 Polyfill (Firefox 8) Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -80,6 +80,7 @@ <h3 id="html">Example HTML: HTML5 Polyfill (Firefox 8)</h3>
80 80
     <ul id="demo-list">
81 81
         <li><a href="../demo.html">Simple Context Menu</a></li>
82 82
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  83
+        <li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
83 84
 
84 85
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
85 86
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/html5-polyfill.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>HTML5 Polyfill Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -74,6 +74,7 @@ <h3 id="html">Example HTML: HTML5 Polyfill</h3>
74 74
     <ul id="demo-list">
75 75
         <li><a href="../demo.html">Simple Context Menu</a></li>
76 76
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  77
+        <li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
77 78
 
78 79
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
79 80
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/input.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Input Commands Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -158,6 +158,7 @@ <h3 id="html">Example HTML: Input Commands</h3>
158 158
     <ul id="demo-list">
159 159
         <li><a href="../demo.html">Simple Context Menu</a></li>
160 160
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  161
+        <li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
161 162
 
162 163
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
163 164
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/keeping-contextmenu-open.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Keeping the Menu visible Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -82,6 +82,7 @@ <h3 id="html">Example HTML: Keeping the Menu visible</h3>
82 82
     <ul id="demo-list">
83 83
         <li><a href="../demo.html">Simple Context Menu</a></li>
84 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>
85 86
 
86 87
         <li class="current"><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
87 88
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/sub-menus.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Sub Menus Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -103,6 +103,7 @@ <h3 id="html">Example HTML: Submenus</h3>
103 103
     <ul id="demo-list">
104 104
         <li><a href="../demo.html">Simple Context Menu</a></li>
105 105
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  106
+        <li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
106 107
 
107 108
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
108 109
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/trigger-custom.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Custom Activated Context Menu Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -88,6 +88,7 @@ <h3 id="html">Example HTML: Custom Activated Context Menu</h3>
88 88
     <ul id="demo-list">
89 89
         <li><a href="../demo.html">Simple Context Menu</a></li>
90 90
         <li><a href="dynamic.html">Adding new Context Menu Triggers</a></li>
  91
+        <li><a href="dynamic-create.html">Create Context Menu on demand</a></li>
91 92
 
92 93
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
93 94
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/trigger-hover-autohide.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Hover Activated Context Menu With Autohide Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -82,6 +82,7 @@ <h3 id="html">Example HTML: Hover Activated Context Menu With Autohide</h3>
82 82
     <ul id="demo-list">
83 83
         <li><a href="../demo.html">Simple Context Menu</a></li>
84 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>
85 86
 
86 87
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
87 88
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/trigger-hover.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Hover Activated Context Menu Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -81,6 +81,7 @@ <h3 id="html">Example HTML: Hover Activated Context Menu</h3>
81 81
     <ul id="demo-list">
82 82
         <li><a href="../demo.html">Simple Context Menu</a></li>
83 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>
84 85
 
85 86
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
86 87
         <li><a href="callback.html">Command's action (callbacks)</a></li>
3  demo/trigger-left-click.html
@@ -3,7 +3,7 @@
3 3
 <head>
4 4
     <meta charset="utf-8" />
5 5
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6  
-    <title>jQuery contextMenu Plugin Demo</title>
  6
+    <title>Left-Click Trigger Demo - jQuery contextMenu Plugin</title>
7 7
     <meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
8 8
 
9 9
     <script src="../jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -82,6 +82,7 @@ <h3 id="html">Example HTML: Left-Click Trigger</h3>
82 82
     <ul id="demo-list">
83 83
         <li><a href="../demo.html">Simple Context Menu</a></li>
84 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>
85 86
 
86 87
         <li><a href="keeping-contextmenu-open.html">Keeping the context menu open</a></li>
87 88
         <li><a href="callback.html">Command's action (callbacks)</a></li>
19  docs.html
@@ -168,6 +168,25 @@ <h3 id="options">options (at registration)</h3>
168 168
             <p>The default callback behaves just like <a href="#items-callback">item.callback</a>.</p>
169 169
             <p>Example: <code>{callback: callback: function(key, opt){ alert("Clicked on " + key + " on element " + opt.$trigger.attr("id")); }}</code></p>
170 170
         </dd>
  171
+        
  172
+        <dt id="options-build"><em>(function)</em> build</dt>
  173
+        <dd>
  174
+            <p>Callback that's supposed to return the <em>options</em> object on demand</p>
  175
+            <p>The callback is executed with a single argument, the jQuery reference to the triggering elemen, given. 
  176
+                It is executed without context (so this won't refer to anything useful).</p>
  177
+            <p>If the <em>build</em> callback is found at registration, the menu is not built right away. The menu creation is delayed to the point where the menu is actually called to show. Dynamic menus don't stay in the DOM. After a menu created with <em>build</em> is hidden, its DOM-footprint is destroyed.</p>
  178
+            <p>With <em>build</em>, only the options <a href="#options-selector">selector</a> and <a href="#options-selector">ignoreRightClick</a> may be specified in the
  179
+                options object. All other options need to be returned from the <em>build</em> callback.
  180
+            <pre class="prettyprint lang-js">{selector: ".awesome-menu",
  181
+build: function($trigger){
  182
+  return {
  183
+    callback: function(){},
  184
+    items: {
  185
+        foo: {name: "Foo"}
  186
+    }
  187
+  };
  188
+}};</pre>
  189
+        </dd>
171 190
     </dl>
172 191
     
173 192
     <h3 id="items">options.items</h3>
4  index.html
@@ -53,6 +53,9 @@
53 53
     <p>
54 54
         Once a menu is registered, it cannot be altered. That means no commands can be added or removed from the menu. This allows contextMenu to keep a single definition in memory, which enables it to work with hundreds of trigger objects. contextMenu knows the two callbacks <em>show</em> and <em>hide</em> which can be used to update the state of commands within the menu. This allows en/disabling commands, changing icons or updating the values of contained &lt;input&gt; elements.
55 55
     </p>
  56
+    <p>
  57
+        As of version 1.5 context menus can be created dynamically. That means the afore described behavior (once created, cannot be altered) still applies - but can be circumvented.  Menus can be created on demand and they can be different depending on the triggering element.
  58
+    </p>
56 59
     
57 60
     <p>
58 61
         And, yes, the icons provided in this demo are taken from a <a href="http://abeautifulsite.net/blog/2008/09/jquery-context-menu-plugin/">beautiful site</a>, 
@@ -64,6 +67,7 @@ <h2 id="features">Features</h2>
64 67
     <ul>
65 68
         <li>trigger contextMenu with right-click, <a href="demo/trigger-left-click.html">left-click</a>, <a href="demo/trigger-hover.html">hover</a> or own <a href="demo/trigger-custom.html">custom trigger</a> events</li>
66 69
         <li>delegated event handling removing the need for re-initialization when trigger objects are <a href="demo/dynamic.html">added / removed</a></li>
  70
+        <li>dynamic <a href="demo/dynamic-create.html">on-demand</a> menu creation</li>
67 71
         <li>optional icons for commands</li>
68 72
         <li><a href="demo/input.html">input elements</a> (text, textarea, checkbox, radio, select) within the menu</li>
69 73
         <li>custom html elements (command free)</li>

0 notes on commit 90e6b35

Please sign in to comment.
Something went wrong with that request. Please try again.