forked from seiyria/angular-bootstrap-slider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
215 lines (171 loc) · 7.55 KB
/
test.html
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<html ng-app='angular-bootstrap-slider-test'>
<head>
<title>Angular Bootstrap Slider test</title>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="bower_components/seiyria-bootstrap-slider/dist/css/bootstrap-slider.css">
</head>
<body ng-controller="TestCtrl">
<div class="col-md-2 col-md-offset-2">
<p>
<label for="sliderId">Slider Id:</label>
<input id="sliderId" type="text" ng-model="testOptions.sliderId">
<label for="modelValue">Slider Value in ng-model:</label>
<input id="modelValue" type="range" ng-model="model.first" min="{{testOptions.min}}" step="{{testOptions.step}}"
max="{{testOptions.max}}">
<input ng-model="model.first" class="form-control">
<label for="value">Value:</label>
<input id="value" type="number" ng-model="value.first" class="form-control">
<label for="min">Min:</label>
<input id="min" type="number" ng-model="testOptions.min" class="form-control">
<label for="max">Max:</label>
<input id="max" type="number" ng-model="testOptions.max" class="form-control">
<label for="step">Step:</label>
<input id="step" type="number" ng-model="testOptions.step" class="form-control">
<label for="range">Range:</label>
<input id="range" type="checkbox" ng-model="testOptions.range" class="form-control">
<label for="precision">Precision:</label>
<input id="precision" type="number" ng-model="testOptions.precision" class="form-control">
<label for="reversed">Reversed:</label>
<input id="reversed" type="checkbox" ng-model="testOptions.reversed" class="form-control">
<label for="orientation">Orientation:</label>
<select id="orientation" ng-model="testOptions.orientation" class="form-control">
<option value="horizontal">Horizontal</option>
<option value="vertical">Vertical</option>
</select>
<label for="handle">Handle:</label>
<select id="handle" ng-model="testOptions.handle" class="form-control">
<option value="round">Round</option>
<option value="square">Square</option>
<option value="triangle">Triangle</option>
<option value="custom">Custom</option>
</select>
<label for="enabled">Enabled:</label>
<input id="enabled" type="checkbox" ng-model="testOptions.enabled" class="form-control">
<label for="ngDisabled">ngDisabled:</label>
<input id="ngDisabled" type="checkbox" ng-model="testOptions.ngDisabled" class="form-control">
<label for="naturalarrowkeys">Natural arrow keys:</label>
<input id="naturalarrowkeys" type="checkbox" ng-model="testOptions.naturalarrowkeys" class="form-control">
</p>
Slider using tags<br>
<slider slider-id="testOptions.sliderId"
ng-model="model.first"
value="value.first"
min="testOptions.min"
max="testOptions.max"
step="testOptions.step"
range="testOptions.range"
precision="{{ testOptions.precision }}"
reversed="{{ testOptions.reversed }}"
orientation="{{ testOptions.orientation }}"
handle="{{ testOptions.handle }}"
enabled="{{ testOptions.enabled }}"
ng-disabled="testOptions.ngDisabled"
naturalarrowkeys="{{ testOptions.naturalarrowkeys }}"
>
If you can see this then slider did not get compiled by Angular.
Check that all necessary files are included, did you run "bower install"?
</slider>
<br><br>
<p>
<label for="tooltipseparator">Tooltip separator:</label>
<input id="tooltipseparator" type="text" ng-model="testOptions.tooltipseparator" class="form-control">
<label for="tooltipsplit">Tooltip split:</label>
<input id="tooltipsplit" type="checkbox" ng-model="testOptions.tooltipsplit" class="form-control">
</p>
Range slider<br>
<span slider
slider-id="rangeSlider"
ng-model="model.second"
value="value.second"
min="testOptions.min"
max="testOptions.max"
range="range"
tooltipseparator="{{ testOptions.tooltipseparator }}"
tooltipsplit="{{ testOptions.tooltipsplit }}">
</span>
Model: {{model.second | json}}<br>
Value: {{value.second | json}}<br>
<br><br>
<p>
<label for="tooltip">Tooltip:</label>
<select id="tooltip" ng-model="testOptions.tooltip" class="form-control">
<option value="show">Show</option>
<option value="hide">Hide</option>
<option value="always">Always</option>
</select>
<label for="formatter_prefix">Formatter prefix:</label>
<input id="formatter_prefix" type="text" ng-model="prefix" class="form-control">
<label for="formatter_sufffix">Formatter suffix:</label>
<input id="formatter_sufffix" type="text" ng-model="suffix" class="form-control">
<button id="relayout-button" ng-click="$broadcast('slider:relayout')">Relayout</button>
</p>
Slider with configurable tooltip<br>
<slider slider-id="tooltipSlider"
ng-model="model.third"
precision="{{ testOptions.precision }}"
tooltip="{{ testOptions.tooltip }}"
formatter="formatterFn(value)"
>
</slider>
Model: {{model.third}}<br>
<br><br>
Slider using event expressions
<slider ng-model="model.fourth"
on-start-slide="status='started'"
on-slide="status=$event.type"
on-stop-slide="status='stopped'"
>
</slider>
Model: {{model.fourth}}<br>
Status: {{status}}<br>
<br><br>
Slider using event callbacks
<span slider
ng-model="model.fifth"
on-start-slide="slideDelegate(value, $event)"
on-slide="slideDelegate(value, $event)"
on-stop-slide="slideDelegate(value, $event)"
>
</span>
Model: {{model.fifth}}<br>
Event type: {{delegateEvent.type}}<br>
<br><br>
Slider using mixed expressions and callbacks
<span slider
ng-model="model.sixth"
on-start-slide="status2='started'"
on-slide="slideDelegate(value)"
on-stop-slide="status2=$event.type; slideDelegate(value, $event)"
>
</span>
Model: {{model.sixth}}<br>
Status: {{status2}}<br>
Event type: {{delegateEvent.type}}<br>
<br><br>
Updates model on slide event by default
<slider ng-model="model.seventh"></slider>
Model: {{model.seventh}}<br>
<br><br>
Updates model only on slideStop event
<slider ng-model="model.eighth" updateevent="slideStop"></slider>
Model: {{model.eighth}}<br>
<br><br>
Updates model on slideStart and slideStop
<span slider ng-model="model.ninth" updateevent='["slideStart","slideStop"]'></span>
Model: {{model.ninth}}<br>
<br><br>
Updates model on all events
<span slider ng-model="model.tenth"
updateevent="["slideStop", "slide", "slideStart"]"></span>
Model: {{model.tenth}}
</div>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/seiyria-bootstrap-slider/dist/bootstrap-slider.js"></script>
<!-- angular-slider include -->
<script src="slider.js"></script>
<!-- test file include -->
<script src="test.js"></script>
</body>
</html>