Mercurial > code > home > repos > href
annotate static/links.js @ 22:fa55f4439977
fix autocomplete. less console.log
Ignore-this: 302e2080d044221c430c4eb77ccd4221
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Thu, 11 Jul 2013 01:05:22 -0700 |
parents | 8008ec2fd763 |
children | ab9a6132529a |
rev | line source |
---|---|
10 | 1 $("#filterTag").focus(); |
2 | |
3 var model = { | |
21
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
4 filterTags: ko.observableArray(tagsFromWindowLocation()) |
10 | 5 }; |
6 | |
21
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
7 function tagsFromWindowLocation() { |
10 | 8 var p = window.location.pathname; |
9 var comps = p.split("/"); | |
10 if (toRoot == ".") { | |
11 return []; | |
12 } else { | |
21
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
13 return (comps[comps.length-1] || "").replace("%20", "+").split("+"); |
10 | 14 } |
15 } | |
16 | |
17 function toggleTag(tag) { | |
21
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
18 var selected = model.filterTags(); |
10 | 19 |
20 if (selected.indexOf(tag) == -1) { | |
21 selected.push(tag); | |
22 } else { | |
23 selected.splice(selected.indexOf(tag), 1); | |
24 } | |
21
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
25 model.filterTags(selected); |
10 | 26 } |
27 | |
21
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
28 function initSpecialLinkBehavior() { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
29 // clicking tag links doesn't go to them (they're not |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
30 // user-specific); it toggles their presence in our page's current |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
31 // filter list |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
32 $(document).on("click", "a.tag", function (ev) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
33 var tag = $(this).text(); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
34 toggleTag(tag); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
35 ev.stopPropagation() |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
36 ev.preventDefault() |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
37 return false; |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
38 }); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
39 } |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
40 |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
41 var linklist = null; |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
42 // unsure how to use toRoot- can it change? |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
43 $.getJSON("/href/templates", function (result) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
44 linklist = result.linklist; |
10 | 45 }); |
46 | |
21
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
47 function initUrlSync(model) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
48 // tag changes push url history; and url edits freshen the page |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
49 |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
50 ko.computed(function () { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
51 var tags = model.filterTags(); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
52 var newPath = window.location.pathname; |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
53 if (toRoot == ".") { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
54 newPath += "/"; |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
55 toRoot = ".."; |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
56 } else { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
57 newPath = newPath.replace( |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
58 /(.*\/)[^\/]*$/, "$1") |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
59 } |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
60 if (tags.length) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
61 newPath += tags.join("+") |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
62 } else { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
63 newPath = newPath.substr(0, newPath.length - 1); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
64 toRoot = "."; |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
65 } |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
66 |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
67 changePage(newPath); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
68 }); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
69 |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
70 function changePage(newPath) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
71 if (window.location.pathname != newPath) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
72 window.history.pushState({}, "", newPath); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
73 |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
74 function updateLinklist(fullPath) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
75 var t0 = +new Date(); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
76 if (linklist === null) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
77 console.log("too soon- templates aren't loaded"); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
78 return; |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
79 } |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
80 $(".linklist").text("Loading..."); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
81 $.getJSON(fullPath + ".json", function (result) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
82 var t1 = +new Date(); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
83 var rendered = Mustache.render(linklist, result) |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
84 var t2 = +new Date(); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
85 $(".linklist").html(rendered); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
86 var t3 = +new Date(); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
87 $(".stats").text(JSON.stringify({ |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
88 "getMs": t1 - t0, |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
89 "mustacheRenderMs": t2 - t1, |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
90 "setHtmlMs": t3 - t2 |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
91 })); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
92 }); |
10 | 93 } |
21
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
94 updateLinklist(newPath); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
95 } |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
96 } |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
97 } |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
98 |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
99 function initFilterTag(elem, model) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
100 // sync the entry box and the model |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
101 |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
102 elem.change(function () { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
103 var tags = $(this).val().split(","); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
104 model.filterTags(tags); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
105 return false; |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
106 }); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
107 |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
108 var filterCompleteWords = ""; |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
109 elem.select2({ |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
110 allowClear: true, |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
111 multiple: true, |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
112 tokenSeparators: [' ', ','], |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
113 query: function (opts) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
114 $.ajax({ |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
115 url: toRoot + "/tags", |
22
fa55f4439977
fix autocomplete. less console.log
Drew Perttula <drewp@bigasterisk.com>
parents:
21
diff
changeset
|
116 data: {user: user, have: opts.element.val() + "," + opts.term}, |
21
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
117 success: function (data) { |
22
fa55f4439977
fix autocomplete. less console.log
Drew Perttula <drewp@bigasterisk.com>
parents:
21
diff
changeset
|
118 // I don't want to do this, but select2 gets too slow |
fa55f4439977
fix autocomplete. less console.log
Drew Perttula <drewp@bigasterisk.com>
parents:
21
diff
changeset
|
119 var maxRowsInAutocomplete = 300; |
fa55f4439977
fix autocomplete. less console.log
Drew Perttula <drewp@bigasterisk.com>
parents:
21
diff
changeset
|
120 if (data.tags.length > maxRowsInAutocomplete) { |
fa55f4439977
fix autocomplete. less console.log
Drew Perttula <drewp@bigasterisk.com>
parents:
21
diff
changeset
|
121 data.tags = data.tags.slice(0, maxRowsInAutocomplete); |
fa55f4439977
fix autocomplete. less console.log
Drew Perttula <drewp@bigasterisk.com>
parents:
21
diff
changeset
|
122 } |
21
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
123 opts.callback({results: data.tags}); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
124 } |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
125 }); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
126 }, |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
127 change: function (ev) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
128 console.log("ch", ev.val); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
129 }, |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
130 initSelection: function (element, callback) { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
131 var data = []; |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
132 $(element.val().split(",")).each(function () { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
133 if (this != "") { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
134 data.push({id: this, text: this}); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
135 } |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
136 }); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
137 callback(data); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
138 } |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
139 }); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
140 ko.computed(function () { |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
141 elem.select2("val", model.filterTags()); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
142 }); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
143 } |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
144 |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
145 initFilterTag($("#filterTag"), model); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
146 initSpecialLinkBehavior(); |
8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Drew Perttula <drewp@bigasterisk.com>
parents:
20
diff
changeset
|
147 initUrlSync(model); |
10 | 148 |
149 ko.applyBindings(model); |