"Send mail"
Bootstrap 3.3.0 Snippet by rasmus

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
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<script src="https://rawgithub.com/mindmup/bootstrap-wysiwyg/master/external/jquery.hotkeys.js"></script>
<script type="text/javascript" src="https://rawgithub.com/mindmup/bootstrap-wysiwyg/master/bootstrap-wysiwyg.js"></script>
<script type="text/javascript" src="https://rawgit.com/twitter/typeahead.js/master/dist/typeahead.bundle.min.js"></script>
<script type="text/javascript" src="http://twitter.github.io/typeahead.js/js/handlebars.js"></script>
<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" id="launch">
Launch demo modal
</button>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Send som mail</h4>
</div>
<div class="modal-body">
<div>
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-md-3" class="control-label">Modtagere:</label>
<div class="col-md-9">
<div class="to-dropdown">
<span class="label label-info dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
to: <span class="caret"></span>
</span>
<ul class="dropdown-menu" role="menu">
<li><a href="#">cc:</a></li>
<li><a href="#">bcc:</a></li>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
#editor {
overflow:scroll;
max-height:300px;
height: 15em;
border: 1px solid #ccc;
border-radius: 4px;
}
#editor table {
width: 100%
}
#editor table tr th {
font-size: 80%;
padding: 0.5em;
font-align: center;
}
#editor table tr td {
padding: 0.3em;
}
form .row {
border: 1px solid #ccc;
border-radius: 4px;
margin-left: 0px;
margin-right: 0px;
}
div.checkbox {
margin-left: 12px;
padding-top: 6px;
padding-bottom: 6px;
}
.twitter-typeahead {
width: 100%;
}
.to {
padding: 4px;
position: relative;
}
.to .icon-remove-sign {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
$(document).on('click', '.to .icon-remove-sign', function() {
$(this).parent().remove();
})
function addMail(val) {
if (val) {
var to = $('<div class="to"><span class="addr"></span><span class="pull-right icon-remove-sign"></span></div>');
to.find('.addr').text(val);
$('.modtagere').append(to);
}
}
$('#mailadr').keydown(function(e) {
if (e.keyCode == 13) {
var val = $('#mailadr').val();
addMail(val);
}
});
var substringMatcher = function(strs) {
return function findMatches(q, cb) {
var matches, substrRegex;
// an array that will be populated with substring matches
matches = [];
// regex used to determine if a string contains the substring `q`
substrRegex = new RegExp(q, 'i');
// iterate through the pool of strings and for any string that
// contains the substring `q`, add it to the `matches` array
$.each(strs, function(i, str) {
if (substrRegex.test(str)) {
// the typeahead jQuery plugin expects suggestions to a
// JavaScript object, refer to typeahead docs for more info
var div = $('<div></div>');
div.text(str);
matches.push({ display: div.text(), value: str});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: