-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
61 lines (57 loc) · 2.15 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
<html>
<head>
<script src="Script/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="Script/jquery.tmpl.min.js" type="text/javascript"></script>
<script src="Script/knockout-1.2.1.js" type="text/javascript"></script>
<script type="text/javascript">
function valueTerm(name, type) {
this.name = ko.observable(name);
this.type = ko.observable(type);
this.remove = function() { ownerViewModel.tasks.remove(this) }
}
var vocabularyViewModel = {
this.valueTerms = ko.observableArray([]);
this.newvalueTermName = ko.observable();
this.newvalueTermType = ko.observable();
this.addValueTerm = function() {
this.valueTerms.push(new valueTerm(this.newvalueTermName(), this.newvalueTermType()));
this.newValueTermName("");
this.newValueTermType("");
}
};
$(function() {
ko.applyBindings(vocabularyViewModel);
});
</script>
</head>
<body>
<h3>Vocabulary</h3>
<form data-bind="submit: addValueTerm">
Value term name: <input data-bind="value: newValueTermName" placeholder="Term Name?" />
Value term type: <input data-bind="value: newValueTermType" placeholder="Term Type?" />
<button type="submit">Add Value Term</button>
</form>
<ul data-bind="template: { name: 'taskTemplate', foreach: valueTerms }, visible: tasks().length > 0"></ul>
<script type="text/html" id="taskTemplate">
<li>
<input type="checkbox" data-bind="checked: isDone" />
<input data-bind="value: title, enable: !isDone()" />
<a href="#" data-bind="click: remove">Delete</a>
</li>
</script>
</body>
</html>
<!--
<Schema Namespace="odata.org.vocabs.Validation" Alias="Validation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
<EntityType Name="Range" BaseType="Edm.TypeTerm">
<Property Name="Min" Type="Edm.Decimal" Nullable="True" />
<Property Name=”Max” Type="Edm.Decimal" Nullable="True" />
</EntityType>
</Schema>
-->
<!--
<Schema NamespaceUri="http://vocabularies.foo.com/Display" Alias=”Display” xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
<ValueTerm Name="Title" Type="Edm.String" />
<EntityType Name="Hide" BaseType="Edm.TypeTerm" />
</Schema>
-->