|
1 |
| -<!DOCTYPE html> |
| 1 | +<!doctype html> |
2 | 2 | <html lang="en">
|
3 | 3 | <head>
|
4 |
| - <meta charset="UTF-8" /> |
5 |
| - <title>Button Visual push: Default</title> |
6 |
| - <link rel="stylesheet" href="../visual.css" type="text/css" /> |
7 |
| - <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css"> |
8 |
| - <style type="text/css"> |
9 |
| - #toolbar { margin-top: 2em; padding:0.2em; } |
10 |
| - #ops1, #ops2, #format, #mode { margin-right: 1em } |
11 |
| - </style> |
12 |
| - <script type="text/javascript" src="../../../jquery-1.7.2.js"></script> |
13 |
| - <script type="text/javascript" src="../../../external/jquery.metadata.js"></script> |
14 |
| - <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script> |
15 |
| - <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script> |
16 |
| - <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script> |
17 |
| - <script type="text/javascript"> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>Button Visual Test</title> |
| 6 | + <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css"> |
| 7 | + <script src="../../../jquery-1.7.2.js"></script> |
| 8 | + <script src="../../../ui/jquery.ui.core.js"></script> |
| 9 | + <script src="../../../ui/jquery.ui.widget.js"></script> |
| 10 | + <script src="../../../ui/jquery.ui.button.js"></script> |
| 11 | + <script> |
18 | 12 | $(function() {
|
19 |
| - var buttons = $('#push button, #check').button(); |
20 |
| - var buttonSets = $('#radio0, #radio1, #radio2, #ops1, #format, #ops2, #mode, #inputs, #anchors').buttonset(); |
21 |
| - |
22 |
| - buttons.add(buttonSets).click(function(event) { |
23 |
| - var target = $(event.target); |
24 |
| - if (target.closest('.ui-button:not(.ui-state-disabled)').length) { |
25 |
| - $("<div></div>") |
26 |
| - .text("Clicked " + (target.text() || target.val())) |
27 |
| - .appendTo("#log"); |
28 |
| - window.console && console.log(this, arguments); |
29 |
| - } |
| 13 | + $( ".buttons" ).each(function() { |
| 14 | + $( this ).children() |
| 15 | + .eq( 0 ) |
| 16 | + .button({ |
| 17 | + text: false, |
| 18 | + icons: { |
| 19 | + primary: "ui-icon-help" |
| 20 | + } |
| 21 | + }) |
| 22 | + .end() |
| 23 | + .eq( 1 ) |
| 24 | + .button({ |
| 25 | + icons: { |
| 26 | + primary: "ui-icon-help" |
| 27 | + }, |
| 28 | + disabled: true |
| 29 | + }) |
| 30 | + .end() |
| 31 | + .eq( 2 ) |
| 32 | + .button(); |
30 | 33 | });
|
31 |
| - |
32 |
| - $("#disable-widgets").toggle(function() { |
33 |
| - buttons.button("disable"); |
34 |
| - buttonSets.buttonset("disable"); |
35 |
| - }, function() { |
36 |
| - buttons.button("enable"); |
37 |
| - buttonSets.buttonset("enable"); |
38 |
| - }); |
39 |
| - $("#toggle-widgets").toggle(function() { |
40 |
| - buttons.button(); |
41 |
| - buttonSets.buttonset(); |
42 |
| - }, function() { |
43 |
| - buttons.button("destroy"); |
44 |
| - buttonSets.buttonset("destroy"); |
45 |
| - }).click(); |
46 | 34 | });
|
47 | 35 | </script>
|
48 | 36 | </head>
|
49 | 37 | <body>
|
50 | 38 |
|
51 |
| -<div id="push"> |
52 |
| - <div> |
53 |
| - No icon |
54 |
| - <button>Simple button, only text</button> |
55 |
| - <button class="ui-priority-secondary">Secondary priority button</button> |
56 |
| - </div> |
57 |
| - <br/> |
58 |
| - <div> |
59 |
| - With icon |
60 |
| - <button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button> |
61 |
| - <button class="{button:{icons:{primary:'ui-icon-locked'}}}">Primary icon</button> |
62 |
| - <button class="{button:{icons:{secondary:'ui-icon-triangle-1-s'}}}">Secondary icon</button> |
63 |
| - <button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Both icons</button> |
64 |
| - <button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons and no text</button> |
65 |
| - </div> |
| 39 | +<div class="buttons"> |
| 40 | + <button>button</button> |
| 41 | + <button>button</button> |
| 42 | + <button>button</button> |
| 43 | +</div> |
| 44 | + |
| 45 | +<div class="buttons"> |
| 46 | + <button type="button">button button</button> |
| 47 | + <button type="button">button button</button> |
| 48 | + <button type="button">button button</button> |
66 | 49 | </div>
|
67 | 50 |
|
68 |
| -<div id="toggle" style="margin-top: 2em;"> |
69 |
| - <input type="checkbox" id="check" /><label for="check">Toggle</label> |
| 51 | +<div class="buttons"> |
| 52 | + <button type="submit">button submit</button> |
| 53 | + <button type="submit">button submit</button> |
| 54 | + <button type="submit">button submit</button> |
70 | 55 | </div>
|
71 | 56 |
|
72 |
| -<div id="radio0" style="margin-top: 2em;"> |
73 |
| - <input type="radio" id="radio01" name="radio" checked="checked" /><label for="radio01">Choice 1</label> |
74 |
| - <input type="radio" id="radio02" name="radio" /><label for="radio02">Choice 2</label> |
75 |
| - <input type="radio" id="radio03" name="radio" /><label for="radio03">Choice 3</label> |
| 57 | +<div class="buttons"> |
| 58 | + <input type="button" value="input button"> |
| 59 | + <input type="button" value="input button"> |
| 60 | + <input type="button" value="input button"> |
76 | 61 | </div>
|
77 |
| -<form> |
78 |
| - <div id="radio1" style="margin-top: 2em;"> |
79 |
| - <input type="radio" id="radio11" name="radio" /><label for="radio11">Choice 1</label> |
80 |
| - <input type="radio" id="radio12" name="radio" checked="checked" /><label for="radio12">Choice 2</label> |
81 |
| - <input type="radio" id="radio13" name="radio" /><label for="radio13">Choice 3</label> |
82 |
| - </div> |
83 |
| -</form> |
84 |
| -<form> |
85 |
| - <div id="radio2" style="margin-top: 2em;"> |
86 |
| - <input type="radio" id="radio21" name="radio" /><label for="radio21">Choice 1</label> |
87 |
| - <input type="radio" id="radio22" name="radio" /><label for="radio22">Choice 2</label> |
88 |
| - <input type="radio" id="radio23" name="radio" checked="checked" /><label for="radio23">Choice 3</label> |
89 |
| - </div> |
90 |
| -</form> |
91 | 62 |
|
92 |
| -<div id="toolbar" class="ui-widget-header ui-corner-all ui-helper-clearfix"> |
93 |
| - <span id="ops1"> |
94 |
| - <button class="{button:{icons:{primary:'ui-icon-folder-open'},text:false}}">Open</button> |
95 |
| - <button class="{button:{icons:{primary:'ui-icon-disk'},text:false}}">Save</button> |
96 |
| - <button class="{button:{icons:{primary:'ui-icon-trash'},text:false}}">Delete</button> |
97 |
| - </span> |
98 |
| - <span id="format"> |
99 |
| - <input type="checkbox" id="check1" /><label for="check1">B</label> |
100 |
| - <input type="checkbox" id="check2" /><label for="check2">I</label> |
101 |
| - <input type="checkbox" id="check3" /><label for="check3">U</label> |
102 |
| - </span> |
103 |
| - <span id="ops2"> |
104 |
| - <button class="{button:{icons:{primary:'ui-icon-print'},text:false}}">Print...</button> |
105 |
| - <button class="{button:{icons:{primary:'ui-icon-mail-closed'},text:false}}">Mail to...</button> |
106 |
| - </span> |
107 |
| - <span id="mode"> |
108 |
| - <input type="radio" id="mode1" name="radio2" checked="checked" /><label for="mode1">Edit</label> |
109 |
| - <input type="radio" id="mode2" name="radio2" /><label for="mode2">View</label> |
110 |
| - </span> |
| 63 | +<div class="buttons"> |
| 64 | + <input type="submit" value="input submit"> |
| 65 | + <input type="submit" value="input submit"> |
| 66 | + <input type="submit" value="input submit"> |
111 | 67 | </div>
|
112 | 68 |
|
113 |
| -<div id="inputs" style="margin-top: 2em;"> |
114 |
| - <input type="submit" value="Submit button" /> |
115 |
| - <input type="reset" value="Reset button" class="{button:{label:'Custom reset'}}" /> |
| 69 | +<div class="buttons"> |
| 70 | + <input type="checkbox" id="input-checkbox0"> |
| 71 | + <input type="checkbox" id="input-checkbox1"> |
| 72 | + <input type="checkbox" id="input-checkbox2"> |
| 73 | + <label for="input-checkbox0">input checkbox</label> |
| 74 | + <label for="input-checkbox1">input checkbox</label> |
| 75 | + <label for="input-checkbox2">input checkbox</label> |
116 | 76 | </div>
|
117 | 77 |
|
118 |
| -<div id="anchors" style="margin-top: 2em;"> |
119 |
| - <a href="#">Anchor 1</a> |
120 |
| - <a href="#" class="{button:{icons:{primary:'ui-icon-print'},text:false}}">Anchor 2</a> |
121 |
| - <a href="#" class="{button:{icons:{primary:'ui-icon-mail-closed'},text:false}}">Anchor 3</a> |
122 |
| - <a href="#">Anchor 4</a> |
| 78 | +<div class="buttons"> |
| 79 | + <input type="radio" id="input-radio0" name="radio"> |
| 80 | + <input type="radio" id="input-radio1" name="radio"> |
| 81 | + <input type="radio" id="input-radio2" name="radio"> |
| 82 | + <label for="input-radio0">input radio</label> |
| 83 | + <label for="input-radio1">input radio</label> |
| 84 | + <label for="input-radio2">input radio</label> |
123 | 85 | </div>
|
124 | 86 |
|
125 |
| -<div style="margin-top: 2em;"> |
126 |
| - <button id="disable-widgets">Toggle disabled</button> |
127 |
| - <button id="toggle-widgets">Toggle widget</button> |
| 87 | +<div class="buttons"> |
| 88 | + <a href="#">anchor</a> |
| 89 | + <a href="#">anchor</a> |
| 90 | + <a href="#">anchor</a> |
128 | 91 | </div>
|
129 |
| -<div id="log"></div> |
130 | 92 |
|
131 |
| -<script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script> |
132 |
| -<script type="text/javascript"> |
133 |
| - $.fn.themeswitcher && $('<div></div>').css({ |
134 |
| - position: "absolute", |
135 |
| - right: 10, |
136 |
| - top: 10 |
137 |
| - }).appendTo(document.body).themeswitcher(); |
138 |
| -</script> |
139 | 93 | </body>
|
140 | 94 | </html>
|
0 commit comments