aboutsummaryrefslogtreecommitdiffstats
path: root/demos/button/checkbox.html
blob: b6192ee28eca39f7dee131c228dd2f34646609dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>jQuery UI Button - Checkboxes demo</title>
	<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
	<script type="text/javascript" src="../../jquery-1.4.2.js"></script>
	<script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
	<script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
	<link type="text/css" href="../demos.css" rel="stylesheet" />
	<script type="text/javascript">
	$(function() {
		$("#check").button();
		$("#format").buttonset();
	});
	</script>
	<style>
		#format { margin-top: 2em; }
	</style>
</head>
<body>

<div class="demo">

	<input type="checkbox" id="check" /><label for="check">Toggle</label>
	
	<div id="format">
		<input type="checkbox" id="check1" /><label for="check1">B</label>
		<input type="checkbox" id="check2" /><label for="check2">I</label>
		<input type="checkbox" id="check3" /><label for="check3">U</label>
	</div>

</div><!-- End demo -->



<div class="demo-description">

<p>A checkbox is styled as a toggle button with the button widget. The label element associated with the checkbox is used for the button text.</p>

<p>This demo also demonstrates three checkboxes styled as a button set by calling <code>.buttonset()</code> on a common container.</p>

</div><!-- End demo-description -->



</body>
</html>
"kc">false } return !f.IsDir() } // isExist checks whether a file or directory exists. // It returns false when the file or directory does not exist. func isExist(path string) bool { _, err := os.Stat(path) return err == nil || os.IsExist(err) } func concatenateError(err error, stderr string) error { if len(stderr) == 0 { return err } return fmt.Errorf("%v - %s", err, stderr) } // RefEndName return the end name of a ref name func RefEndName(refStr string) string { if strings.HasPrefix(refStr, BranchPrefix) { return refStr[len(BranchPrefix):] } if strings.HasPrefix(refStr, TagPrefix) { return refStr[len(TagPrefix):] } return refStr } // SplitRefName splits a full refname to reftype and simple refname func SplitRefName(refStr string) (string, string) { if strings.HasPrefix(refStr, BranchPrefix) { return BranchPrefix, refStr[len(BranchPrefix):] } if strings.HasPrefix(refStr, TagPrefix) { return TagPrefix, refStr[len(TagPrefix):] } return "", refStr } // ParseBool returns the boolean value represented by the string as per git's git_config_bool // true will be returned for the result if the string is empty, but valid will be false. // "true", "yes", "on" are all true, true // "false", "no", "off" are all false, true // 0 is false, true // Any other integer is true, true // Anything else will return false, false func ParseBool(value string) (result bool, valid bool) { // Empty strings are true but invalid if len(value) == 0 { return true, false } // These are the git expected true and false values if strings.EqualFold(value, "true") || strings.EqualFold(value, "yes") || strings.EqualFold(value, "on") { return true, true } if strings.EqualFold(value, "false") || strings.EqualFold(value, "no") || strings.EqualFold(value, "off") { return false, true } // Try a number intValue, err := strconv.ParseInt(value, 10, 32) if err != nil { return false, false } return intValue != 0, true }