diff --git a/src/archive.py b/src/archive.py
index 73fcde7..88372d7 100755
--- a/src/archive.py
+++ b/src/archive.py
@@ -28,7 +28,6 @@ def searchIA(title, author):
urls.append("https://archive.org/details/%s" % result["identifier"])
return urls
-
# Example, search for David Hume's Enquiry Concerning Human Understanding
#for url in searchIA("Hume", "Enquiry Concerning Human Understanding"):
#print url
diff --git a/src/mcmaster/classes.py b/src/mcmaster/classes.py
index d6d2ca6..080fdc8 100755
--- a/src/mcmaster/classes.py
+++ b/src/mcmaster/classes.py
@@ -300,7 +300,6 @@ def request(codes, lists, semester):
return
codes.task_done()
-
class CourseInfo(object):
def __init__(self, threadcount, semester):
self._codes = False
diff --git a/src/scripts/row.tag b/src/scripts/row.tag
index 6deda0a..2725142 100644
--- a/src/scripts/row.tag
+++ b/src/scripts/row.tag
@@ -1,5 +1,8 @@
-
+
+
this.classrow = opts.classrow
diff --git a/src/scripts/search.js b/src/scripts/search.js
index 77c4bfa..4fb0e1f 100644
--- a/src/scripts/search.js
+++ b/src/scripts/search.js
@@ -8,6 +8,7 @@ function makeResourceGetter(self) {
"author" : this.bookauthor
};
var url = "/search/resources";
+
$.getJSON(url, {
data : JSON.stringify(params)
}).done(function(results) {
@@ -22,8 +23,8 @@ function makeResourceGetter(self) {
if (!(results.openlib && results.iarchive)) {
self.noResources = true;
}
- self.loading = false;
- self.update();
+
+ self.update({"loading" : false});
});
}
return getResources;
@@ -52,19 +53,8 @@ riot.mount("search", {
showHelp : false,
booksLoading : false
});
-riot.mount("results", {notLoading : true});
-function autocomplete(element, endpoint) {
- // The element should be an input class
- $(element).autocomplete({
- source : endpoint,
- my : "right top",
- at : "left bottom",
- collision : "none",
- autofocus : true,
- delay : 100
- });
-}
+riot.mount("results", {notLoading : true});
function realBook(book) {
var noAdoption = book.booktitle.indexOf("No Adoption");
@@ -84,31 +74,18 @@ function filterCourses(courses) {
}
}
- return courses.filter(
+ return R.filter(
function (c) {
return c.prof != "Staff";
- });
-}
-
-function take(n, xs) {
- return xs.slice(0, n);
-}
-
-function drop(n, xs) {
- return xs.slice(n, xs.length);
+ }, courses);
}
function groupsof(n, xs) {
- var groups = [];
- while (xs.length != 0) {
- if (xs.length < n) {
- groups.push({"row" : take(xs.length, xs)} );
- xs = drop(xs.length, xs);
- }
- else {
- groups.push({"row" : take(n, xs)});
- xs = drop(n, xs);
- }
- }
- return groups;
+ return R.unfold(
+ function(xs) {
+ if (R.length(xs) > 0) {
+ return [{"row" : R.take(n, xs)}, R.drop(n, xs)];
+ }
+ return false;
+ }, xs);
}
diff --git a/src/styles/search.scss b/src/styles/search.scss
index 13ce30f..28655fa 100644
--- a/src/styles/search.scss
+++ b/src/styles/search.scss
@@ -74,7 +74,7 @@ a {
}
.book-title {
- margin-right: 10px !important;
+ margin-right: 0px !important;
}
.form-item {
diff --git a/src/templates/search.html b/src/templates/search.html
index 51d6ae2..9eff646 100644
--- a/src/templates/search.html
+++ b/src/templates/search.html
@@ -42,7 +42,8 @@
{% block scripts %}
{{super()}}
-
+
+
{% endblock %}