forked from dvandersluis/autotextboxlist
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
128 lines (119 loc) · 4 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Proto!MultiSelect Demo</title>
<link rel="stylesheet" href="css/multiselect.css" type="text/css" media="screen" title="Test Stylesheet" charset="utf-8" />
<script src="js/prototype/prototype.js" type="text/javascript" charset="utf-8"></script>
<script src="js/prototype/scriptaculous.js" type="text/javascript" charset="utf-8"></script>
<script src="js/multiselect.js" type="text/javascript" charset="utf-8"></script>
<style>
#button_container
{
margin-left: 70px;
margin-bottom: 30px;
}
form
{
border: 1px solid #999;
margin: 50px;
padding: 20px 30px 10px;
}
form ol
{
font: 11px "Lucida Grande", "Verdana";
margin: 0;
padding: 0;
}
form ol li.input-text
{
margin-bottom: 10px;
list-style-type: none;
border-bottom: 1px dotted #999;
padding-bottom: 10px;
}
form ol li.input-text label
{
font-weight: bold;
cursor: pointer;
display: block;
font-size: 13px;
margin-bottom: 10px;
}
form ol li.input-text input
{
width: 500px;
padding: 5px 5px 6px;
border: 1px solid #999;
}
div.holder
{
width: 90%
}
</style>
</head>
<body id="test">
<h1>Proto!MultiSelect 0.12</h1>
<div id="text"></div>
<form action="test_submit" method="get" accept-charset="utf-8">
<ol>
<li id="proto-ms-list" class="input-text">
<label>MultiSelect Input</label>
<input type="text" value="[{"caption":"Zuriel Barron","value":1},{"caption":"Osvaldo Tierra", "value": 2}]" id="demo" />
</li>
</ol>
</form>
<div id="button_container">
<button onclick="alert($F('demo'));return false;">Get Values</button>
</div>
<script language="JavaScript">
var control, json_feed;
if(typeof console === "undefined") {
console = { log: function() { } };
}
document.observe('dom:loaded', function()
{
/* Initialize the control */
json_feed = [
{ caption: "Zuriel Barron", value: 1 },
{ caption: "Osvaldo Tierra", value: 2 },
{ caption: "Manuel Mujica Lainez", value: 4 },
{ caption: "Gustavo Nielsen", value: 5 },
{ caption: "Silvina Ocampo", value: 6 },
{ caption: "Victoria Ocampo", value: 7 },
{ caption: "Hector German Oesterheld", value: 8 },
{ caption: "Olga Orozco", value: 9 },
{ caption: "Juan L. Ortiz", value: 10 },
{ caption: "Alicia Partnoy", value: 11 },
{ caption: "Roberto Payro", value: 12 },
{ caption: "Ricardo Piglia", value: 13 },
{ caption: "Felipe Pigna", value: 14 },
{ caption: "Alejandra Pizarnik", value: 15 },
{ caption: "Antonio Porchia", value: 16 },
{ caption: "Juan Carlos Portantiero", value: 17 },
{ caption: "Manuel Puig", value: 18 },
{ caption: "Andres Rivera", value: 19 },
{ caption: "Mario Rodriguez Cobos", value: 20 },
{ caption: "Arturo Andres Roig", value: 21 },
{ caption: "Ricardo Rojas", value: 22 }
];
control = new ProtoMultiSelect('demo', 'demo-autocomplete', {
newValues: true,
regexSearch: false,
feed: json_feed,
defaultMessage: "This is the default message",
inputMessage: "Click here to add more.",
sortResults: true,
autoResize: true,
encodeEntities: false,
allowDuplicates: false,
jsonInputValue: true,
onUserAdd: function(el) { console.log("onAdd: " + new Hash(el).inspect()); },
onUserRemove: function(el) { console.log("onRemove: " + new Hash(el).inspect()); },
});
});
</script>
</body>
</html>
<!-- vi: set noexpandtab -->