forked from ramda/ramda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to Handelbars; generate from JSDocs
- Loading branch information
Brian Mock
committed
Jan 2, 2015
1 parent
3062d49
commit bd08ab2
Showing
10 changed files
with
151 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
/test/bundle.js | ||
/bower_components/ | ||
/style.css | ||
/docs/data.json | ||
/docs/index.html | ||
/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
console.time('load'); | ||
var root = {}; | ||
root.filter = ko.observable(''); | ||
root.docs = ko.observableArray(); | ||
root.docs = this.DOC_DATA || {}; | ||
root.filteredDocs = ko.computed(function() { | ||
return root.docs().filter(function(d) { | ||
var filter = root.filter().toLowerCase(); | ||
return d.name.toLowerCase().indexOf(filter) >= 0 || | ||
d.category.toLowerCase() === filter; | ||
return root.docs.filter(function(d) { | ||
return strIn(root.filter(), d.name); | ||
}); | ||
}); | ||
|
||
function start(data) { | ||
root.docs(data); | ||
ko.applyBindings(root); | ||
console.timeEnd('load'); | ||
function strIn(a, b) { | ||
a = a.toLowerCase(); | ||
b = b.toLowerCase(); | ||
return b.indexOf(a) >= 0; | ||
} | ||
|
||
$.getJSON('data.json').then(start); | ||
ko.applyBindings(root); | ||
console.timeEnd('load'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.