|
3 | 3 | <head>
|
4 | 4 | <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
|
5 | 5 | <title>jquery.ui-contextmenu.js - Demo</title>
|
6 |
| - <link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" /> |
| 6 | + <link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/start/jquery-ui.css" /> |
7 | 7 | <!-- min requirements:
|
| 8 | + <link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" /> |
8 | 9 | <script src="http://code.jquery.com/jquery-1.7.js" type="text/javascript"></script>
|
9 | 10 | <script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js" type="text/javascript"></script>
|
10 | 11 | -->
|
|
14 | 15 | <!-- Some custom library to enable 'taphold' events -->
|
15 | 16 | <script src="jquery-taphold/taphold.js" type="text/javascript"></script>
|
16 | 17 |
|
| 18 | + <!-- Custom library to add a dynamic themeroller switcher --> |
| 19 | + <script type="text/javascript" src="../lib/Super-Theme-Switcher/jquery.themeswitcher.js"></script> |
| 20 | + |
17 | 21 | <script src="../jquery.ui-contextmenu.js" type="text/javascript"></script>
|
18 | 22 |
|
19 | 23 | <style type="text/css">
|
|
63 | 67 | <script type="text/javascript">
|
64 | 68 | var CLIPBOARD = "";
|
65 | 69 | $(function(){
|
| 70 | + /* Enable a themeroller theme-switching using a combobox. */ |
| 71 | + $("#switcher").themeswitcher({ |
| 72 | + jqueryuiversion: "1", |
| 73 | + imgpath: "../lib/Super-Theme-Switcher/images/", |
| 74 | + loadTheme: "Smoothness" |
| 75 | + }); |
| 76 | + |
66 | 77 | /* Menu 1: init by passing an array of entries. */
|
67 | 78 |
|
68 | 79 | $(document).contextmenu({
|
|
79 | 90 | {title: "Sub 2", cmd: "sub1"}
|
80 | 91 | ]}
|
81 | 92 | ],
|
| 93 | + // Handle menu selection to implement a fake-clipboard |
82 | 94 | select: function(event, ui) {
|
83 | 95 | var $target = ui.target;
|
84 | 96 | switch(ui.cmd){
|
|
92 | 104 | alert("select " + ui.cmd + " on " + $target.text());
|
93 | 105 | // Optionally return false, to prevent closing the menu now
|
94 | 106 | },
|
| 107 | + // Implement the beforeOpen callback to dynamically change the entries |
95 | 108 | beforeOpen: function(event, ui) {
|
96 | 109 | var $menu = ui.menu,
|
97 | 110 | $target = ui.target;
|
@@ -159,6 +172,13 @@ <h1>jquery.ui-contextmenu.js</h1>
|
159 | 172 |
|
160 | 173 | <p><a href="https://github.com/mar10/jquery-ui-contextmenu">View project on GitHub</a></p>
|
161 | 174 |
|
| 175 | + <div> |
| 176 | + <label for="switcher">Theme:</label> <div id="switcher"></div> |
| 177 | + <!-- |
| 178 | + <label for="skinswitcher">Skin:</label> <select id="skinswitcher"></select> |
| 179 | + --> |
| 180 | + </div> |
| 181 | + |
162 | 182 | <h3>Sample 1</h3>
|
163 | 183 | <ul>
|
164 | 184 | <li>Initialized using a command-array.
|
|
0 commit comments