patternfly-sass 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/stylesheets/_patternfly.scss +6 -0
- data/assets/stylesheets/patternfly/_alerts.scss +4 -1
- data/assets/stylesheets/patternfly/_bootstrap-switch.scss +21 -0
- data/assets/stylesheets/patternfly/_bootstrap-touchspin.scss +31 -0
- data/assets/stylesheets/patternfly/_dropdowns.scss +1 -1
- data/assets/stylesheets/patternfly/_ext-bootstrap-switch.scss +193 -0
- data/assets/stylesheets/patternfly/_ext-bootstrap-touchspin.scss +45 -0
- data/assets/stylesheets/patternfly/_toolbar.scss +70 -23
- data/assets/stylesheets/patternfly/_variables.scss +5 -1
- data/bower.json +3 -1
- data/lib/patternfly-sass/version.rb +2 -2
- data/package.json +32 -0
- data/patternfly-sass.gemspec +2 -0
- data/spec/html/alerts.html +6 -0
- data/spec/html/bootstrap-switch.html +265 -0
- data/spec/html/bootstrap-switch.js +61 -0
- data/spec/html/bootstrap-touchspin.html +207 -0
- data/spec/html/buttons.html +29 -0
- data/spec/html/dist/css/patternfly-additions.css +325 -18
- data/spec/html/dist/css/patternfly-additions.css.map +1 -1
- data/spec/html/dist/css/patternfly-additions.min.css +1 -1
- data/spec/html/dist/css/patternfly-additions.min.css.map +1 -1
- data/spec/html/dist/css/patternfly.css +4 -0
- data/spec/html/dist/css/patternfly.css.map +1 -1
- data/spec/html/dist/css/patternfly.min.css +1 -1
- data/spec/html/dist/css/patternfly.min.css.map +1 -1
- data/spec/html/dropdowns.html +26 -8
- data/spec/html/index.html +6 -0
- data/spec/html/toolbar.html +44 -14
- data/tasks/converter.rb +6 -4
- metadata +41 -2
@@ -6,11 +6,12 @@ $patternfly-sass-asset-helper: false !default;
|
|
6
6
|
|
7
7
|
// PatternFly-specific
|
8
8
|
// -------------------
|
9
|
+
$bootstrap-switch-handle-default-bg-color: #fbfbfb !default;
|
9
10
|
$btn-default-bg-img-start: #fafafa !default;
|
10
11
|
$btn-default-bg-img-stop: #ededed !default;
|
11
12
|
$btn-xs-font-weight: 400 !default;
|
12
13
|
$card-pf-accented-border-top-color: #39a5dc !default;
|
13
|
-
$card-pf-aggregate-status-title-icon-color: #
|
14
|
+
$card-pf-aggregate-status-title-icon-color: #333 !default;
|
14
15
|
$card-pf-bg-color: #fff !default;
|
15
16
|
$card-pf-border-color: #d1d1d1 !default;
|
16
17
|
$card-pf-border-top-color: transparent !default;
|
@@ -90,6 +91,8 @@ $table-border-hover: #a7cadf !def
|
|
90
91
|
$table-cell-padding-bottom: 3px !default;
|
91
92
|
$table-cell-padding-top: 2px !default;
|
92
93
|
// Reference variables declared in block above
|
94
|
+
$bootstrap-switch-bg-color-start: $btn-default-bg-img-start !default;
|
95
|
+
$bootstrap-switch-bg-color-stop: $btn-default-bg-img-stop !default;
|
93
96
|
$img-path-alt: $img-path !default;
|
94
97
|
$nav-pf-vertical-alt-border-color: $sidebar-pf-border-color !default;
|
95
98
|
$navbar-pf-alt-border-color: $navbar-pf-border-color !default;
|
@@ -249,6 +252,7 @@ $panel-warning-text: $panel-prima
|
|
249
252
|
|
250
253
|
// PatternFly-specific variables based on Bootstrap overides
|
251
254
|
// ---------------------------------------------------------
|
255
|
+
$bootstrap-switch-bg-color: $btn-default-bg !default;
|
252
256
|
$btn-danger-bg-img-start: $brand-danger !default;
|
253
257
|
$btn-danger-bg-img-stop: $btn-danger-bg !default;
|
254
258
|
$btn-primary-bg-img-start: $brand-primary !default;
|
data/bower.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "patternfly-sass",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.3.0",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"homepage": "https://www.patternfly.org",
|
6
6
|
"authors": [
|
@@ -33,6 +33,8 @@
|
|
33
33
|
"bootstrap-combobox": "~1.1.6",
|
34
34
|
"bootstrap-datepicker": "~1.4.0",
|
35
35
|
"bootstrap-select": "~1.7.3",
|
36
|
+
"bootstrap-switch": "~3.3.2",
|
37
|
+
"bootstrap-touchspin": "~3.0.3",
|
36
38
|
"bootstrap-treeview": "~1.2.0",
|
37
39
|
"c3": "~0.4.10",
|
38
40
|
"datatables": "~1.10.7",
|
data/package.json
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"name": "patternfly-sass",
|
3
|
+
"version": "2.3.0",
|
4
|
+
"description": "Red Hat's Patternfly, converted to Sass and ready to drop into Rails",
|
5
|
+
"repository": {
|
6
|
+
"type": "git",
|
7
|
+
"url": "git://github.com/patternfly/patternfly-sass.git"
|
8
|
+
},
|
9
|
+
"author": "Red Hat",
|
10
|
+
"license": "Apache-2.0",
|
11
|
+
"bugs": {
|
12
|
+
"url": "https://github.com/patternfly/patternfly-sass/issues"
|
13
|
+
},
|
14
|
+
"devDependencies": {
|
15
|
+
"bootstrap-sass": "~3.3.5",
|
16
|
+
"bootstrap-combobox": "~1.1.6",
|
17
|
+
"bootstrap-datepicker": "~1.4.0",
|
18
|
+
"bootstrap-select": "~1.7.3",
|
19
|
+
"bootstrap-switch": "~3.3.2",
|
20
|
+
"bootstrap-touchspin": "~3.0.3",
|
21
|
+
"bootstrap-treeview": "~1.2.0",
|
22
|
+
"c3": "~0.4.10",
|
23
|
+
"datatables": "~1.10.7",
|
24
|
+
"datatables-colreorder": "~1.1.3",
|
25
|
+
"datatables-colvis": "~1.1.2",
|
26
|
+
"font-awesome": "~4.3.0",
|
27
|
+
"google-code-prettify": "~1.0.4",
|
28
|
+
"jquery": "~2.1.4",
|
29
|
+
"matchHeight": "~0.6.0"
|
30
|
+
},
|
31
|
+
"homepage": "https://github.com/patternfly/patternfly-sass"
|
32
|
+
}
|
data/patternfly-sass.gemspec
CHANGED
@@ -19,6 +19,8 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_development_dependency 'rails-assets-bootstrap-combobox', '~> 1.1.6'
|
20
20
|
s.add_development_dependency 'rails-assets-bootstrap-datepicker', '~> 1.4.0'
|
21
21
|
s.add_development_dependency 'rails-assets-bootstrap-select', '~> 1.7.3'
|
22
|
+
s.add_development_dependency 'rails-assets-bootstrap-switch', '~> 3.3.2'
|
23
|
+
s.add_development_dependency 'rails-assets-bootstrap-touchspin', '~> 3.0.3'
|
22
24
|
s.add_development_dependency 'rails-assets-bootstrap-treeview', '~> 1.2.0'
|
23
25
|
s.add_development_dependency 'rails-assets-c3', '~> 0.4.10'
|
24
26
|
s.add_development_dependency 'rails-assets-datatables', '~> 1.10.7'
|
data/spec/html/alerts.html
CHANGED
@@ -83,6 +83,12 @@
|
|
83
83
|
<span class="pficon pficon-info"></span>
|
84
84
|
<strong>This is some general information.</strong> You should <a href="#" class="alert-link">know about this</a>.
|
85
85
|
</div>
|
86
|
+
<div class="alert alert-success">
|
87
|
+
<button class="btn btn-default pull-right" type="submit">Button</button>
|
88
|
+
<span class="pficon pficon-ok"></span>
|
89
|
+
<strong>Great job!</strong> This is really working out <a href="#" class="alert-link">great for us</a>.
|
90
|
+
</div>
|
91
|
+
|
86
92
|
</div><!-- /container -->
|
87
93
|
</body>
|
88
94
|
</html>
|
@@ -0,0 +1,265 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<!--[if IE 9]><html class="ie9"><![endif]-->
|
3
|
+
<!--[if gt IE 9]><!-->
|
4
|
+
<html>
|
5
|
+
<!--<![endif]-->
|
6
|
+
<head>
|
7
|
+
<title>Bootstrap Switch - PatternFly</title>
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
9
|
+
<link rel="shortcut icon" href="../dist/img/favicon.ico">
|
10
|
+
<!-- iPad retina icon -->
|
11
|
+
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../dist/img/apple-touch-icon-precomposed-152.png">
|
12
|
+
<!-- iPad retina icon (iOS < 7) -->
|
13
|
+
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../dist/img/apple-touch-icon-precomposed-144.png">
|
14
|
+
<!-- iPad non-retina icon -->
|
15
|
+
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="../dist/img/apple-touch-icon-precomposed-76.png">
|
16
|
+
<!-- iPad non-retina icon (iOS < 7) -->
|
17
|
+
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../dist/img/apple-touch-icon-precomposed-72.png">
|
18
|
+
<!-- iPhone 6 Plus icon -->
|
19
|
+
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="../dist/img/apple-touch-icon-precomposed-180.png">
|
20
|
+
<!-- iPhone retina icon (iOS < 7) -->
|
21
|
+
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../dist/img/apple-touch-icon-precomposed-114.png">
|
22
|
+
<!-- iPhone non-retina icon (iOS < 7) -->
|
23
|
+
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="../dist/img/apple-touch-icon-precomposed-57.png">
|
24
|
+
<link href="../dist/css/patternfly.min.css" rel="stylesheet" media="screen, print">
|
25
|
+
<link href="../dist/css/patternfly-additions.min.css" rel="stylesheet" media="screen, print">
|
26
|
+
<link href="tests.css" rel="stylesheet" media="screen, print">
|
27
|
+
<script src="../components/jquery/dist/jquery.min.js"></script>
|
28
|
+
<script src="../components/bootstrap/dist/js/bootstrap.min.js"></script>
|
29
|
+
<script src="../components/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
|
30
|
+
<script src="bootstrap-switch.js"></script>
|
31
|
+
<script src="../dist/js/patternfly.min.js"></script>
|
32
|
+
</head>
|
33
|
+
<body>
|
34
|
+
<div class="container">
|
35
|
+
<div class="page-header">
|
36
|
+
<h1>Bootstrap Switch</h1>
|
37
|
+
</div>
|
38
|
+
<div class="alert alert-warning">
|
39
|
+
<span class="pficon pficon-warning-triangle-o"></span>
|
40
|
+
These examples are included for development testing purposes. For official documentation, see <a href="https://www.patternfly.org" class="alert-link">https://www.patternfly.org</a>, <a href="http://getbootstrap.com" class="alert-link">http://getbootstrap.com</a>, and <a href="http://www.bootstrap-switch.org/">http://www.bootstrap-switch.org/</a>.
|
41
|
+
</div>
|
42
|
+
<hr>
|
43
|
+
<div class="row">
|
44
|
+
<div class="col-sm-6 col-lg-4">
|
45
|
+
<h2 class="h4">State</h2>
|
46
|
+
<p>
|
47
|
+
<input id="switch-state" type="checkbox" checked>
|
48
|
+
</p>
|
49
|
+
<div class="btn-group">
|
50
|
+
<button type="button" data-switch-toggle="state" class="btn btn-default">Toggle</button>
|
51
|
+
<button type="button" data-switch-set="state" data-switch-value="true" class="btn btn-default">Set true</button>
|
52
|
+
<button type="button" data-switch-set="state" data-switch-value="false" class="btn btn-default">Set false</button>
|
53
|
+
<button type="button" data-switch-get="state" class="btn btn-default">Get</button>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
<div class="col-sm-6 col-lg-4">
|
57
|
+
<h2 class="h4">Size</h2>
|
58
|
+
<p>
|
59
|
+
<input id="switch-size" type="checkbox" checked data-size="mini">
|
60
|
+
</p>
|
61
|
+
<div class="btn-group">
|
62
|
+
<button type="button" data-switch-set="size" data-switch-value="mini" class="btn btn-default">Mini</button>
|
63
|
+
<button type="button" data-switch-set="size" data-switch-value="small" class="btn btn-default">Small</button>
|
64
|
+
<button type="button" data-switch-set="size" data-switch-value="normal" class="btn btn-default">Normal</button>
|
65
|
+
<button type="button" data-switch-set="size" data-switch-value="large" class="btn btn-default">Large</button>
|
66
|
+
<button type="button" data-switch-get="size" class="btn btn-default">Get</button>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
<div class="col-sm-6 col-lg-4">
|
70
|
+
<h2 class="h4">Animate</h2>
|
71
|
+
<p>
|
72
|
+
<input id="switch-animate" type="checkbox" checked>
|
73
|
+
</p>
|
74
|
+
<p>
|
75
|
+
<button type="button" data-switch-toggle="animate" class="btn btn-default">Toggle</button>
|
76
|
+
<button type="button" data-switch-get="animate" class="btn btn-default">Get</button>
|
77
|
+
</p>
|
78
|
+
</div>
|
79
|
+
<div class="col-sm-6 col-lg-4">
|
80
|
+
<h2 class="h4">Disabled</h2>
|
81
|
+
<p>
|
82
|
+
<input id="switch-disabled" type="checkbox" checked disabled>
|
83
|
+
</p>
|
84
|
+
<p>
|
85
|
+
<button type="button" data-switch-toggle="disabled" class="btn btn-default">Toggle</button>
|
86
|
+
<button type="button" data-switch-get="disabled" class="btn btn-default">Get</button>
|
87
|
+
</p>
|
88
|
+
</div>
|
89
|
+
<div class="col-sm-6 col-lg-4">
|
90
|
+
<h2 class="h4">Readonly</h2>
|
91
|
+
<p>
|
92
|
+
<input id="switch-readonly" type="checkbox" checked readonly>
|
93
|
+
</p>
|
94
|
+
<p>
|
95
|
+
<button type="button" data-switch-toggle="readonly" class="btn btn-default">Toggle</button>
|
96
|
+
<button type="button" data-switch-get="readonly" class="btn btn-default">Get</button>
|
97
|
+
</p>
|
98
|
+
</div>
|
99
|
+
<div class="col-sm-6 col-lg-4">
|
100
|
+
<h2 class="h4">Indeterminate</h2>
|
101
|
+
<p>
|
102
|
+
<input id="switch-indeterminate" type="checkbox" checked data-indeterminate="true">
|
103
|
+
</p>
|
104
|
+
<p>
|
105
|
+
<button type="button" data-switch-toggle="indeterminate" class="btn btn-default">Toggle</button>
|
106
|
+
<button type="button" data-switch-get="indeterminate" class="btn btn-default">Get</button>
|
107
|
+
</p>
|
108
|
+
</div>
|
109
|
+
<div class="col-sm-6 col-lg-4">
|
110
|
+
<h2 class="h4">Inverse</h2>
|
111
|
+
<p>
|
112
|
+
<input id="switch-inverse" type="checkbox" checked data-inverse="true">
|
113
|
+
</p>
|
114
|
+
<p>
|
115
|
+
<button type="button" data-switch-toggle="inverse" class="btn btn-default">Toggle</button>
|
116
|
+
<button type="button" data-switch-get="inverse" class="btn btn-default">Get</button>
|
117
|
+
</p>
|
118
|
+
</div>
|
119
|
+
<div class="col-sm-6 col-lg-4">
|
120
|
+
<h2 class="h4">On Color</h2>
|
121
|
+
<p>
|
122
|
+
<input id="switch-onColor" type="checkbox" checked data-on-color="info">
|
123
|
+
</p>
|
124
|
+
<p class="btn-group">
|
125
|
+
<div class="btn-group">
|
126
|
+
<button type="button" data-toggle="dropdown" class="btn btn-default dropdown-toggle">Set <span class="caret"></span></button>
|
127
|
+
<div role="menu" class="dropdown-menu">
|
128
|
+
<li><a data-switch-set="onColor" data-switch-value="primary">Primary</a></li>
|
129
|
+
<li><a data-switch-set="onColor" data-switch-value="info">Info</a></li>
|
130
|
+
<li><a data-switch-set="onColor" data-switch-value="success">Success</a></li>
|
131
|
+
<li><a data-switch-set="onColor" data-switch-value="warning">Warning</a></li>
|
132
|
+
<li><a data-switch-set="onColor" data-switch-value="default">Default</a></li>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
<button type="button" data-switch-get="onColor" class="btn btn-default">Get</button>
|
136
|
+
</p>
|
137
|
+
</div>
|
138
|
+
<div class="col-sm-6 col-lg-4">
|
139
|
+
<h2 class="h4">Off Color</h2>
|
140
|
+
<p>
|
141
|
+
<input id="switch-offColor" type="checkbox" data-off-color="warning">
|
142
|
+
</p>
|
143
|
+
<p class="btn-group">
|
144
|
+
<div class="btn-group">
|
145
|
+
<button type="button" data-toggle="dropdown" class="btn btn-default dropdown-toggle">Set <span class="caret"></span></button>
|
146
|
+
<div role="menu" class="dropdown-menu">
|
147
|
+
<li><a data-switch-set="offColor" data-switch-value="primary">Primary</a></li>
|
148
|
+
<li><a data-switch-set="offColor" data-switch-value="info">Info</a></li>
|
149
|
+
<li><a data-switch-set="offColor" data-switch-value="success">Success</a></li>
|
150
|
+
<li><a data-switch-set="offColor" data-switch-value="warning">Warning</a></li>
|
151
|
+
<li><a data-switch-set="offColor" data-switch-value="default">Default</a></li>
|
152
|
+
</div>
|
153
|
+
</div>
|
154
|
+
<button type="button" data-switch-get="offColor" class="btn btn-default">Get</button>
|
155
|
+
</p>
|
156
|
+
</div>
|
157
|
+
<div class="col-sm-6 col-lg-4">
|
158
|
+
<h2 class="h4">On Text</h2>
|
159
|
+
<p>
|
160
|
+
<input id="switch-onText" type="checkbox" checked data-on-text="Yes">
|
161
|
+
</p>
|
162
|
+
<div class="row">
|
163
|
+
<div class="col-sm-6">
|
164
|
+
<input type="text" data-switch-set-value="onText" value="Yes" class="form-control">
|
165
|
+
</div>
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
<div class="col-sm-6 col-lg-4">
|
169
|
+
<h2 class="h4">Off Text</h2>
|
170
|
+
<p>
|
171
|
+
<input id="switch-offText" type="checkbox" data-off-text="No">
|
172
|
+
</p>
|
173
|
+
<div class="row">
|
174
|
+
<div class="col-sm-6">
|
175
|
+
<input type="text" data-switch-set-value="offText" value="No" class="form-control">
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
</div>
|
179
|
+
<div class="col-sm-6 col-lg-4">
|
180
|
+
<h2 class="h4">Label Text</h2>
|
181
|
+
<p>
|
182
|
+
<input id="switch-labelText" type="checkbox" data-label-text="Label">
|
183
|
+
</p>
|
184
|
+
<div class="row">
|
185
|
+
<div class="col-sm-6">
|
186
|
+
<input type="text" data-switch-set-value="labelText" class="form-control">
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
<div class="col-sm-6 col-lg-4">
|
191
|
+
<h2 class="h4">Handle Width</h2>
|
192
|
+
<p>
|
193
|
+
<input id="switch-handleWidth" type="checkbox" data-handle-width="100">
|
194
|
+
</p>
|
195
|
+
<div class="row">
|
196
|
+
<div class="col-sm-6">
|
197
|
+
<input type="number" data-switch-set-value="handleWidth" value="100" class="form-control">
|
198
|
+
</div>
|
199
|
+
</div>
|
200
|
+
</div>
|
201
|
+
<div class="col-sm-6 col-lg-4">
|
202
|
+
<h2 class="h4">Label Width</h2>
|
203
|
+
<p>
|
204
|
+
<input id="switch-labelWidth" type="checkbox" data-label-width="100">
|
205
|
+
</p>
|
206
|
+
<div class="row">
|
207
|
+
<div class="col-sm-6">
|
208
|
+
<input type="number" data-switch-set-value="labelWidth" value="100" class="form-control">
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
</div>
|
212
|
+
<div class="col-sm-6 col-lg-4">
|
213
|
+
<h2 class="h4">Create | Destroy</h2>
|
214
|
+
<p>
|
215
|
+
<input id="switch-create-destroy" type="checkbox" checked data-switch-no-init>
|
216
|
+
</p>
|
217
|
+
<div class="row">
|
218
|
+
<div class="col-sm-6">
|
219
|
+
<button type="button" data-switch-create-destroy data-destroy-text="Destroy" class="btn btn-default">Create</button>
|
220
|
+
</div>
|
221
|
+
</div>
|
222
|
+
</div>
|
223
|
+
</div>
|
224
|
+
<div class="text-center">
|
225
|
+
<h2 class="h4">Radio All Off</h2>
|
226
|
+
<div class="row">
|
227
|
+
<div class="col-sm-6">
|
228
|
+
<h3 class="h5">Disabled</h3>
|
229
|
+
<input type="radio" name="radio1" checked class="switch-radio1">
|
230
|
+
<input type="radio" name="radio1" class="switch-radio1">
|
231
|
+
<input type="radio" name="radio1" class="switch-radio1">
|
232
|
+
</div>
|
233
|
+
<div class="col-sm-6">
|
234
|
+
<h3 class="h5">Enabled</h3>
|
235
|
+
<input type="radio" name="radio2" checked data-radio-all-off="true" class="switch-radio2">
|
236
|
+
<input type="radio" name="radio2" data-radio-all-off="true" class="switch-radio2">
|
237
|
+
<input type="radio" name="radio2" data-radio-all-off="true" class="switch-radio2">
|
238
|
+
</div>
|
239
|
+
</div><br>
|
240
|
+
<hr>
|
241
|
+
<h2 class="h4">Inside Modals</h2>
|
242
|
+
<button data-toggle="modal" data-target="#modal-switch" class="btn btn-default">Open Modal</button>
|
243
|
+
<div id="modal-switch" tabindex="-1" role="dialog" aria-labelledby="modal-switch-label" class="modal fade">
|
244
|
+
<div class="modal-dialog">
|
245
|
+
<div class="modal-content">
|
246
|
+
<div class="modal-header">
|
247
|
+
<button type="button" data-dismiss="modal" class="close"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
248
|
+
<div id="modal-switch-label" class="modal-title">Title</div>
|
249
|
+
</div>
|
250
|
+
<div class="modal-body">
|
251
|
+
<input id="switch-modal" type="checkbox" checked>
|
252
|
+
</div>
|
253
|
+
</div>
|
254
|
+
</div>
|
255
|
+
</div>
|
256
|
+
</div>
|
257
|
+
</div>
|
258
|
+
<script>
|
259
|
+
// Initialize Boostrap Switch
|
260
|
+
|
261
|
+
</script>
|
262
|
+
|
263
|
+
</div><!-- /container -->
|
264
|
+
</body>
|
265
|
+
</html>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
(function() {
|
2
|
+
var $confirm;
|
3
|
+
|
4
|
+
$confirm = null;
|
5
|
+
|
6
|
+
$(function() {
|
7
|
+
var $createDestroy, $window, sectionTop;
|
8
|
+
$window = $(window);
|
9
|
+
sectionTop = $(".top").outerHeight() + 20;
|
10
|
+
$createDestroy = $("#switch-create-destroy");
|
11
|
+
// hljs.initHighlightingOnLoad();
|
12
|
+
$("a[href*=\"#\"]").on("click", function(event) {
|
13
|
+
var $target;
|
14
|
+
event.preventDefault();
|
15
|
+
$target = $($(this).attr("href").slice("#"));
|
16
|
+
if ($target.length) {
|
17
|
+
return $window.scrollTop($target.offset().top - sectionTop);
|
18
|
+
}
|
19
|
+
});
|
20
|
+
$("input[type=\"checkbox\"], input[type=\"radio\"]").not("[data-switch-no-init]").bootstrapSwitch();
|
21
|
+
$("[data-switch-get]").on("click", function() {
|
22
|
+
var type;
|
23
|
+
type = $(this).data("switch-get");
|
24
|
+
return alert($("#switch-" + type).bootstrapSwitch(type));
|
25
|
+
});
|
26
|
+
$("[data-switch-set]").on("click", function() {
|
27
|
+
var type;
|
28
|
+
type = $(this).data("switch-set");
|
29
|
+
return $("#switch-" + type).bootstrapSwitch(type, $(this).data("switch-value"));
|
30
|
+
});
|
31
|
+
$("[data-switch-toggle]").on("click", function() {
|
32
|
+
var type;
|
33
|
+
type = $(this).data("switch-toggle");
|
34
|
+
return $("#switch-" + type).bootstrapSwitch("toggle" + type.charAt(0).toUpperCase() + type.slice(1));
|
35
|
+
});
|
36
|
+
$("[data-switch-set-value]").on("input", function(event) {
|
37
|
+
var type, value;
|
38
|
+
event.preventDefault();
|
39
|
+
type = $(this).data("switch-set-value");
|
40
|
+
value = $.trim($(this).val());
|
41
|
+
if ($(this).data("value") === value) {
|
42
|
+
return;
|
43
|
+
}
|
44
|
+
return $("#switch-" + type).bootstrapSwitch(type, value);
|
45
|
+
});
|
46
|
+
$("[data-switch-create-destroy]").on("click", function() {
|
47
|
+
var isSwitch;
|
48
|
+
isSwitch = $createDestroy.data("bootstrap-switch");
|
49
|
+
$createDestroy.bootstrapSwitch((isSwitch ? "destroy" : null));
|
50
|
+
return $(this).button((isSwitch ? "reset" : "destroy"));
|
51
|
+
});
|
52
|
+
return $confirm = $("#confirm").bootstrapSwitch({
|
53
|
+
size: "large",
|
54
|
+
onSwitchChange: function(event, state) {
|
55
|
+
event.preventDefault();
|
56
|
+
return console.log(state, event.isDefaultPrevented());
|
57
|
+
}
|
58
|
+
});
|
59
|
+
});
|
60
|
+
|
61
|
+
}).call(this);
|
@@ -0,0 +1,207 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<!--[if IE 9]><html class="ie9"><![endif]-->
|
3
|
+
<!--[if gt IE 9]><!-->
|
4
|
+
<html>
|
5
|
+
<!--<![endif]-->
|
6
|
+
<head>
|
7
|
+
<title>Bootstrap Touchspin - PatternFly</title>
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
9
|
+
<link rel="shortcut icon" href="../dist/img/favicon.ico">
|
10
|
+
<!-- iPad retina icon -->
|
11
|
+
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../dist/img/apple-touch-icon-precomposed-152.png">
|
12
|
+
<!-- iPad retina icon (iOS < 7) -->
|
13
|
+
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../dist/img/apple-touch-icon-precomposed-144.png">
|
14
|
+
<!-- iPad non-retina icon -->
|
15
|
+
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="../dist/img/apple-touch-icon-precomposed-76.png">
|
16
|
+
<!-- iPad non-retina icon (iOS < 7) -->
|
17
|
+
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../dist/img/apple-touch-icon-precomposed-72.png">
|
18
|
+
<!-- iPhone 6 Plus icon -->
|
19
|
+
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="../dist/img/apple-touch-icon-precomposed-180.png">
|
20
|
+
<!-- iPhone retina icon (iOS < 7) -->
|
21
|
+
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../dist/img/apple-touch-icon-precomposed-114.png">
|
22
|
+
<!-- iPhone non-retina icon (iOS < 7) -->
|
23
|
+
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="../dist/img/apple-touch-icon-precomposed-57.png">
|
24
|
+
<link href="../dist/css/patternfly.min.css" rel="stylesheet" media="screen, print">
|
25
|
+
<link href="../dist/css/patternfly-additions.min.css" rel="stylesheet" media="screen, print">
|
26
|
+
<link href="tests.css" rel="stylesheet" media="screen, print">
|
27
|
+
<script src="../components/jquery/dist/jquery.min.js"></script>
|
28
|
+
<script src="../components/bootstrap/dist/js/bootstrap.min.js"></script>
|
29
|
+
<script src="../components/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.js"></script>
|
30
|
+
<script src="../dist/js/patternfly.min.js"></script>
|
31
|
+
</head>
|
32
|
+
<body>
|
33
|
+
<div class="container">
|
34
|
+
<div class="page-header">
|
35
|
+
<h1>Bootstrap Touchspin</h1>
|
36
|
+
</div>
|
37
|
+
<div class="alert alert-warning">
|
38
|
+
<span class="pficon pficon-warning-triangle-o"></span>
|
39
|
+
These examples are included for development testing purposes. For official documentation, see <a href="https://www.patternfly.org" class="alert-link">https://www.patternfly.org</a>, <a href="http://getbootstrap.com" class="alert-link">http://getbootstrap.com</a>, and <a href="http://www.virtuosoft.eu/code/bootstrap-touchspin/">http://www.virtuosoft.eu/code/bootstrap-touchspin/</a>.
|
40
|
+
</div>
|
41
|
+
<hr>
|
42
|
+
<h2>Example with postfix</h2>
|
43
|
+
<input id="demo1" type="text" value="55" name="demo1">
|
44
|
+
<script>
|
45
|
+
$("input[name='demo1']").TouchSpin({
|
46
|
+
min: 0,
|
47
|
+
max: 100,
|
48
|
+
step: 0.1,
|
49
|
+
decimals: 2,
|
50
|
+
boostat: 5,
|
51
|
+
maxboostedstep: 10,
|
52
|
+
postfix: '%'
|
53
|
+
});
|
54
|
+
</script>
|
55
|
+
<h2>With prefix</h2>
|
56
|
+
<form class="form-horizontal" role="form">
|
57
|
+
<div class="form-group">
|
58
|
+
<label for="demo2" class="col-md-3 control-label">Example:</label>
|
59
|
+
<div class="col-md-9">
|
60
|
+
<input id="demo2" type="text" value="0" name="demo2" class="col-md-8 form-control">
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
</form>
|
64
|
+
<script>
|
65
|
+
$("input[name='demo2']").TouchSpin({
|
66
|
+
min: -1000000000,
|
67
|
+
max: 1000000000,
|
68
|
+
stepinterval: 50,
|
69
|
+
maxboostedstep: 10000000,
|
70
|
+
prefix: '$'
|
71
|
+
});
|
72
|
+
</script>
|
73
|
+
<h2>Vertical button alignment</h2>
|
74
|
+
<input id="demo_vertical" type="text" value="" name="demo_vertical">
|
75
|
+
<script>
|
76
|
+
$("input[name='demo_vertical']").TouchSpin({
|
77
|
+
verticalbuttons: true
|
78
|
+
});
|
79
|
+
</script>
|
80
|
+
<h2>Vertical buttons with custom icons</h2>
|
81
|
+
<input id="demo_vertical2" type="text" value="" name="demo_vertical2">
|
82
|
+
<script>
|
83
|
+
$("input[name='demo_vertical2']").TouchSpin({
|
84
|
+
verticalbuttons: true,
|
85
|
+
verticalupclass: 'glyphicon glyphicon-plus',
|
86
|
+
verticaldownclass: 'glyphicon glyphicon-minus'
|
87
|
+
});
|
88
|
+
</script>
|
89
|
+
<h2>Init with empty value</h2>
|
90
|
+
<input id="demo3" type="text" value="" name="demo3">
|
91
|
+
<script>
|
92
|
+
$("input[name='demo3']").TouchSpin();
|
93
|
+
</script>
|
94
|
+
<h2>Value attribute is not set <small>(applying settings.initval)</small></h2>
|
95
|
+
<input id="demo3_21" type="text" value="" name="demo3_21">
|
96
|
+
<script>
|
97
|
+
$("input[name='demo3_21']").TouchSpin({
|
98
|
+
initval: 40
|
99
|
+
});
|
100
|
+
</script>
|
101
|
+
<h2>Value is set explicitly to 33 <small>(skipping settings.initval)</small></h2>
|
102
|
+
<input id="demo3_22" type="text" value="33" name="demo3_22">
|
103
|
+
<script>
|
104
|
+
$("input[name='demo3_22']").TouchSpin({
|
105
|
+
initval: 40
|
106
|
+
});
|
107
|
+
</script>
|
108
|
+
<h2>Button postfix (small)</h2>
|
109
|
+
<input id="demo4" type="text" value="" name="demo4" class="input-sm">
|
110
|
+
<script>
|
111
|
+
$("input[name='demo4']").TouchSpin({
|
112
|
+
postfix: "a button",
|
113
|
+
postfix_extraclass: "btn btn-default"
|
114
|
+
});
|
115
|
+
</script>
|
116
|
+
<h2>Button postfix (large)</h2>
|
117
|
+
<div class="input-group input-group-lg">
|
118
|
+
<input id="demo4_2" type="text" value="" name="demo4_2" class="form-control input-lg">
|
119
|
+
</div>
|
120
|
+
<script>
|
121
|
+
$("input[name='demo4_2']").TouchSpin({
|
122
|
+
postfix: "a button",
|
123
|
+
postfix_extraclass: "btn btn-default"
|
124
|
+
});
|
125
|
+
</script>
|
126
|
+
<h2>Button group</h2>
|
127
|
+
<div class="input-group">
|
128
|
+
<input id="demo5" type="text" class="form-control" name="demo5" value="50">
|
129
|
+
<div class="input-group-btn">
|
130
|
+
<button type="button" class="btn btn-default">Action</button>
|
131
|
+
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
132
|
+
<span class="caret"></span>
|
133
|
+
<span class="sr-only">Toggle Dropdown</span>
|
134
|
+
</button>
|
135
|
+
<ul class="dropdown-menu pull-right" role="menu">
|
136
|
+
<li><a href="#">Action</a></li>
|
137
|
+
<li><a href="#">Another action</a></li>
|
138
|
+
<li><a href="#">Something else here</a></li>
|
139
|
+
<li class="divider"></li>
|
140
|
+
<li><a href="#">Separated link</a></li>
|
141
|
+
</ul>
|
142
|
+
</div>
|
143
|
+
</div>
|
144
|
+
<script>
|
145
|
+
$("input[name='demo5']").TouchSpin({
|
146
|
+
prefix: "pre",
|
147
|
+
postfix: "post"
|
148
|
+
});
|
149
|
+
</script>
|
150
|
+
<h2>Change button class</h2>
|
151
|
+
<input id="demo6" type="text" value="50" name="demo6">
|
152
|
+
<script>
|
153
|
+
$("input[name='demo6']").TouchSpin({
|
154
|
+
buttondown_class: "btn btn-link",
|
155
|
+
buttonup_class: "btn btn-link"
|
156
|
+
});
|
157
|
+
</script>
|
158
|
+
<h2>Event demo</h2>
|
159
|
+
<div class="row">
|
160
|
+
<div class="col-md-3">
|
161
|
+
<input id="demo7" type="text" value="50" name="demo7">
|
162
|
+
</div>
|
163
|
+
<div class="col-md-9">
|
164
|
+
<pre id="demo7textarea" style="height:200px;overflow:auto;"></pre>
|
165
|
+
</div>
|
166
|
+
<script>
|
167
|
+
var i = $("input[name='demo7']"),
|
168
|
+
demoarea = $("#demo7textarea"),
|
169
|
+
text = "";
|
170
|
+
function writeLine(line) {
|
171
|
+
text += line + "\n";
|
172
|
+
demoarea.text(text);
|
173
|
+
demoarea.scrollTop(
|
174
|
+
demoarea[0].scrollHeight - demoarea.height()
|
175
|
+
);
|
176
|
+
}
|
177
|
+
i.TouchSpin({});
|
178
|
+
i.on("touchspin.on.startspin", function() {
|
179
|
+
writeLine("touchspin.on.startspin");
|
180
|
+
});
|
181
|
+
i.on("touchspin.on.startupspin", function() {
|
182
|
+
writeLine("touchspin.on.startupspin");
|
183
|
+
});
|
184
|
+
i.on("touchspin.on.startdownspin", function() {
|
185
|
+
writeLine("touchspin.on.startdownspin");
|
186
|
+
});
|
187
|
+
i.on("touchspin.on.stopspin", function() {
|
188
|
+
writeLine("touchspin.on.stopspin");
|
189
|
+
});
|
190
|
+
i.on("touchspin.on.stopupspin", function() {
|
191
|
+
writeLine("touchspin.on.stopupspin");
|
192
|
+
});
|
193
|
+
i.on("touchspin.on.stopdownspin", function() {
|
194
|
+
writeLine("touchspin.on.stopdownspin");
|
195
|
+
});
|
196
|
+
i.on("touchspin.on.min", function() {
|
197
|
+
writeLine("touchspin.on.min");
|
198
|
+
});
|
199
|
+
i.on("touchspin.on.max", function() {
|
200
|
+
writeLine("touchspin.on.max");
|
201
|
+
});
|
202
|
+
</script>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
</div><!-- /container -->
|
206
|
+
</body>
|
207
|
+
</html>
|