|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | + <title>Visual Test for Popup Utility</title> |
| 5 | + <link rel="stylesheet" href="../visual.css" type="text/css" /> |
| 6 | + <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" /> |
| 7 | + <script type="text/javascript" src="../../../jquery-1.5.1.js"></script> |
| 8 | + <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script> |
| 9 | + <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script> |
| 10 | + <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script> |
| 11 | + <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script> |
| 12 | + <script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script> |
| 13 | + <script type="text/javascript" src="popup.js"></script> |
| 14 | + <!-- |
| 15 | + <script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script> |
| 16 | + --> |
| 17 | + <script type="text/javascript"> |
| 18 | + $(function() { |
| 19 | + $.fn.themeswitcher && $('<div/>').css({ |
| 20 | + position: "absolute", |
| 21 | + right: 10, |
| 22 | + top: 10 |
| 23 | + }).appendTo(document.body).themeswitcher(); |
| 24 | + |
| 25 | + var selected = { |
| 26 | + select: function( event, ui ) { |
| 27 | + $( "<div/>" ).text( "Selected: " + ui.item.text() ).appendTo( "#log" ); |
| 28 | + $(this).hide(); |
| 29 | + } |
| 30 | + }; |
| 31 | + |
| 32 | + $("#button1").button(); |
| 33 | + $("#menu1").menu(selected).popup(); |
| 34 | + |
| 35 | + $( "#rerun" ) |
| 36 | + .button() |
| 37 | + .click(function() { |
| 38 | + alert( "Running the last action" ); |
| 39 | + }) |
| 40 | + .next() |
| 41 | + .button({ |
| 42 | + text: false, |
| 43 | + icons: { |
| 44 | + primary: "ui-icon-triangle-1-s" |
| 45 | + } |
| 46 | + }) |
| 47 | + .parent() |
| 48 | + .buttonset() |
| 49 | + .next() |
| 50 | + .menu(selected) |
| 51 | + .popup({ |
| 52 | + trigger: $("#select") |
| 53 | + }); |
| 54 | + |
| 55 | + $("td:has(.menubar)").clone().appendTo("tbody tr:not(:first)"); |
| 56 | + $("table .menubar > ul").menu(selected).popup().prev().button(); |
| 57 | + }); |
| 58 | + </script> |
| 59 | + <style type="text/css"> |
| 60 | + body { font-size:62.5%; } |
| 61 | + |
| 62 | + .ui-popup { position: absolute; z-index: 5000; } |
| 63 | + .ui-menu { width: 200px; } |
| 64 | + |
| 65 | + table { |
| 66 | + border-collapse: collapse; |
| 67 | + } |
| 68 | + th, td { |
| 69 | + padding: 0.5em; |
| 70 | + border: 1px solid black; |
| 71 | + } |
| 72 | + </style> |
| 73 | +</head> |
| 74 | +<body> |
| 75 | + |
| 76 | +<button id="button1">Show context menu 1</button> |
| 77 | +<ul id="menu1"> |
| 78 | + <li><a href="#">Amsterdam</a></li> |
| 79 | + <li><a href="#">Anaheim</a></li> |
| 80 | + <li><a href="#">Cologne</a></li> |
| 81 | + <li><a href="#">Frankfurt</a></li> |
| 82 | + <li><a href="#">Magdeburg</a></li> |
| 83 | + <li><a href="#">Munich</a></li> |
| 84 | + <li><a href="#">Utrecht</a></li> |
| 85 | + <li><a href="#">Zurich</a></li> |
| 86 | +</ul> |
| 87 | + |
| 88 | +<div> |
| 89 | + <div> |
| 90 | + <button id="rerun">Run last action</button> |
| 91 | + <button id="select">Select an action</button> |
| 92 | + </div> |
| 93 | + <ul> |
| 94 | + <li><a href="#">Open...</a></li> |
| 95 | + <li><a href="#">Save</a></li> |
| 96 | + <li><a href="#">Delete</a></li> |
| 97 | + </ul> |
| 98 | +</div> |
| 99 | + |
| 100 | +<table id="movies" class="ui-widget"> |
| 101 | + <thead> |
| 102 | + <tr> |
| 103 | + <th data-field="Name" class="ui-widget-header">Name</th> |
| 104 | + <th data-field="ReleaseYear" class="ui-widget-header">Release Year</th> |
| 105 | + <th data-field="AverageRating" class="ui-widget-header">Average Rating</th> |
| 106 | + <th class="ui-widget-header"></th> |
| 107 | + </tr> |
| 108 | + </thead> |
| 109 | + <tbody> |
| 110 | + <tr> |
| 111 | + <td class="ui-widget-content">Red Hot Chili Peppers: Funky Monks</td> |
| 112 | + <td class="ui-widget-content">1993</td> |
| 113 | + <td class="ui-widget-content">3.6</td> |
| 114 | + <td class="ui-widget-content"> |
| 115 | + <div class="menubar"> |
| 116 | + <a href="#">Options</a> |
| 117 | + <ul> |
| 118 | + <li><a href="#">Order...</a></li> |
| 119 | + <li class="ui-state-disabled">Write a Review...</li> |
| 120 | + <li><a href="#">Find Similar Movies...</a></li> |
| 121 | + <li> |
| 122 | + <a href="#">Rate</a> |
| 123 | + <ul> |
| 124 | + <li><a href="#">5 stars</a></li> |
| 125 | + <li><a href="#">4 stars</a></li> |
| 126 | + <li><a href="#">3 stars</a></li> |
| 127 | + <li><a href="#">2 stars</a></li> |
| 128 | + <li><a href="#">1 stars</a></li> |
| 129 | + </ul> |
| 130 | + </li> |
| 131 | + </ul> |
| 132 | + </div> |
| 133 | + </td> |
| 134 | + </tr> |
| 135 | + <tr> |
| 136 | + <td class="ui-widget-content">Rod Stewart: Storyteller 1984-1991</td> |
| 137 | + <td class="ui-widget-content">1991</td> |
| 138 | + <td class="ui-widget-content">3.1</td> |
| 139 | + </tr> |
| 140 | + <tr> |
| 141 | + <td class="ui-widget-content">Stevie Ray Vaughan and Double Trouble: Live at the El Mocambo 1983</td> |
| 142 | + <td class="ui-widget-content">1991</td> |
| 143 | + <td class="ui-widget-content">3.9</td> |
| 144 | + </tr> |
| 145 | + <tr> |
| 146 | + <td class="ui-widget-content">Spike and Mike's Sick & Twisted Festival of Animation</td> |
| 147 | + <td class="ui-widget-content">1997</td> |
| 148 | + <td class="ui-widget-content">2.6</td> |
| 149 | + </tr> |
| 150 | + </tbody> |
| 151 | +</table> |
| 152 | + |
| 153 | +<div class="ui-widget" style="margin-top:2em; font-family:Arial"> |
| 154 | + Log: |
| 155 | + <div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div> |
| 156 | +</div> |
| 157 | + |
| 158 | +</body> |
| 159 | +</html> |
0 commit comments