-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
210 lines (180 loc) · 9.06 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Bootbox sample</title>
<script src="Scripts/jquery-3.0.0.js"></script>
<script src="Scripts/bootstrap.js"></script>
<script src="Scripts/BootBox/bootbox.js"></script>
<script src="Scripts/BootBox/bootbox.locales.js"></script>
<link href="Content/bootstrap.css" rel="stylesheet" />
<script src="Scripts/Local/index.js"></script>
<link rel="stylesheet" href="Content/local/index.css">
<link rel="stylesheet" href="node_modules/bootstrap-icons/font/bootstrap-icons.css">
<style>
.bi::before {
display: inline-block;
padding-right: 10px;
}
.card1 {
background-color: red;
color: white;
}
</style>
</head>
<body>
<div class="alert alert-danger" role="alert">
BootBox <span class="bi bi-bootstrap"></span> examples by <a href="https://github.com/karenpayneoregon" target="_blank"><img src="https://img.shields.io/badge/Karen%20Payne-Instructor-blue" alt=""></a> - This example requires BootBox <strong>5.4.0</strong>
</div>
<div class="container py-3">
<div class="card shadow p-3 mb-5 bg-white rounded">
<h5 class="card-header card1">Attention</h5>
<div class="card-body">
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Eveniet nam exercitationem et placeat fuga incidunt corporis distinctio, ullam quod delectus praesentium molestias ea cum ipsam quos expedita veniam! Incidunt, praesentium?
</p>
<p class="card-text"><strong>Please contact your manager</strong>...</p>
<a href="#" class="btn btn-primary">Continue</a>
</div>
</div>
</div>
<div class="container py-3">
<div class="row">
<div class="col-3">
<div class="circle ml-4">BootBox</div>
</div>
</div>
<div class="row">
<div class="col-3">
<div class="card border-0 card-body">
<button id="simpleBootBox" class=" btn btn-primary btn-block bi bi-arrow-right-square">
Dialog with scrolling
</button>
</div>
</div>
<div class="col-3">
<div class="card border-0 card-body"><button id="simpleBootBox1" class=" btn btn-danger btn-block bi bi-info-circle">Alert</button></div>
</div>
<div class="col-3">
<div class="card border-0 card-body"><button id="simpleBootBox2" class=" btn btn-success btn-block bi bi-question-circle">Simple confirm</button></div>
</div>
</div>
<div class="row">
<div class="col-3">
<div class="card border-0 card-body"><button id="simpleBootBox3" class=" btn btn-primary btn-block">Simple
prompt</button></div>
</div>
<div class="col-3">
<div class="card border-0 card-body"><button id="simpleBootBox4" class=" btn btn-danger btn-block bi bi-calculator-fill">Prompt
for number</button></div>
</div>
<div class="col-3">
<div class="card border-0 card-body"><button id="simpleBootBox5" class=" btn btn-success btn-block">Prompt
for password</button></div>
</div>
</div>
<div class="row">
<div class="col-3">
<div class="card border-0 card-body"><button id="simpleBootBox6" class=" btn btn-primary btn-block">Select prompt</button>
</div>
</div>
<div class="col-3">
<div class="card border-0 card-body">
<button id="simpleBootBox7" class=" btn btn-danger btn-block ">
<i class="bi bi-calendar-date"></i>Prompt for date
</button>
</div>
</div>
<div class="col-3">
<div class="card border-0 card-body"><button id="simpleBootBox8" class=" btn btn-success btn-block">Confirm
small/large</button></div>
</div>
</div>
<div class="row">
<div class="col-3">
<div class="card border-0 card-body"><button id="simpleBootBox9" class=" btn btn-primary btn-block">
locales</button></div>
</div>
<div class="col-3">
<div class="card border-0 card-body">
<select id="locales" class="custom-select" style="max-width: 200px;">
<option value="ar">ar</option>
<option value="bg_BG">bg_BG</option>
<option value="br">br</option>
<option value="cs">cs</option>
<option value="da">da</option>
<option value="de">de</option>
<option value="el">el</option>
<option value="en">en</option>
<option value="es">es</option>
<option value="eu">eu</option>
<option value="et">et</option>
<option value="fa">fa</option>
<option value="fi">fi</option>
<option value="fr">fr</option>
<option value="he">he</option>
<option value="hu">hu</option>
<option value="hr">hr</option>
<option value="id">id</option>
<option value="it">it</option>
<option value="ja">ja</option>
<option value="ka">ka</option>
<option value="ko">ko</option>
<option value="lt">lt</option>
<option value="lv">lv</option>
<option value="nl">nl</option>
<option value="no">no</option>
<option value="pl">pl</option>
<option value="pt">pt</option>
<option value="ru">ru</option>
<option value="sk">sk</option>
<option value="sl">sl</option>
<option value="sq">sq</option>
<option value="sv">sv</option>
<option value="sw">sw</option>
<option value="ta">ta</option>
<option value="th">th</option>
<option value="tr">tr</option>
<option value="uk">uk</option>
<option value="zh_CN">zh_CN</option>
<option value="zh_TW">zh_TW</option>
</select>
</div>
</div>
<div class="col-3">
<div class="card border-0 card-body"><button id="simpleBootBox10" class="btn btn-outline-success btn-block">Center alert</button></div>
</div>
</div>
</div>
<script>
const matched = value => ({
on: () => matched(value),
otherwise: () => value,
});
const match = value => ({
on: (pred, fn) => (pred(value) ? matched(fn(value)) : match(value)),
otherwise: fn => fn(value),
})
function getConnectionString(value) {
switch (value) {
case 1: return "Development connection string goes here";
case 2: return "Test connection string goes here";
case 3: return "Production connection string goes here";
default: return "Developer screwed up!!!";
}
}
var someValue = 50;
$(document).ready(function () {
var result = match(someValue)
// we are now in match context
.on(value => value < 0, () => 0)
// Since 50 is not < 0, we remain in match(50) context
.on(value => value >= 0 && value <= 1, () => 1)
// Since 50 is not between 0 and 1, we remain in match(50) context
.otherwise(value => value * 10);
console.log(`The number is ${result}`);
console.log(`Connection string is ${getConnectionString(1)}`);
});
</script>
</body>
</html>