Index: /other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.js
===================================================================
--- /other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.js (revision 31613)
+++ /other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.js (revision 31614)
@@ -59,22 +59,4 @@
}
-function stream_generate_item(line,id,title)
-{
- var css_class = (line%2 == 0) ? 'class="evenline"' : 'class="oddline"';
-
- var html_item = "";
-
-
- var babel_url = "https://babel.hathitrust.org/cgi/pt?id="+id+";view=1up;seq="+1;
-
- html_item += '
';
- //html_item += '
';
- html_item += '' + id + ': ' + title + '';
- html_item += '
';
-
- return html_item;
-}
-
-
function generate_item(line,id,id_pages)
{
@@ -126,102 +108,4 @@
}
-function stream_show_results(jsonData) {
- var docs = jsonData["result-set"].docs;
- var num_docs = docs.length -1;
-
- $('.search-in-progress').css("cursor","auto");
-
- var $search_results = $('#search-results');
-
- if (num_docs>0) {
- $search_results.html("Results: " + num_docs + " volumes matched
");
- /*
- var from = parseInt(store_search_args.start);
- var to = from + num_rows;
- $search_results.append("Showing matches: "+from+"-" + to + "
");
- */
- }
- else {
- $search_results.html("No volumes matched your query
");
- }
-
- for (var i=0; i0) {
- arg_q += " OR ";
- }
-
- arg_q += fields.join(" OR ");
-
- } // end of for each split q_text
-
- // Example search on one of the htrc-full-ef fields is:
- // q=en_NOUN_htrctoken:farming
-
- store_search_args = { q: arg_q, indent: arg_indent, wt: arg_wt, start: arg_start, rows: arg_rows };
-
- store_search_args.sort="id asc";
- store_search_args.fl="volumeid_s,id";
-
- var expr_tx = "search(htrc-full-ef20";
-
- for (var k in store_search_args) {
- if (store_search_args.hasOwnProperty(k)) {
- var v = store_search_args[k];
- expr_tx += "," + k + "=\"" + v + "\"";
- }
- }
- expr_tx += ")";
- }
-
-
- if ((expr_md != "") && (expr_tx != "")) {
- expr = "expr=intersect(" + expr_md + "," + expr_tx + ", on=\"id=volumeid_s\")";
- }
- else if (expr_md != "") {
- expr = "expr=" + expr_md;
- }
- else if (expr_tx != "") {
- expr = "expr=" + expr_tx;
- }
- else {
- // both empty
- console.log("Warning: query was empty");
- }
-
-
- $.ajax({
- type: 'GET',
- url: store_search_action,
- data: expr,
- dataType: 'json',
- success: stream_show_results,
- error: ajax_error
- });
-
-}
-
function submit_action(event)
{
@@ -813,7 +544,3 @@
}
- if ($('#stream-search-submit').length>0) {
- $('#stream-search-submit').click(stream_submit_action);
- }
-
});
Index: /other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/stream-index.js
===================================================================
--- /other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/stream-index.js (revision 31614)
+++ /other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/stream-index.js (revision 31614)
@@ -0,0 +1,280 @@
+
+function stream_generate_item(line,id,title)
+{
+ var css_class = (line%2 == 0) ? 'class="evenline"' : 'class="oddline"';
+
+ var html_item = "";
+
+
+ var babel_url = "https://babel.hathitrust.org/cgi/pt?id="+id+";view=1up;seq="+1;
+
+ html_item += '';
+ //html_item += '
';
+ html_item += '' + id + ': ' + title + '';
+ html_item += '
';
+
+ return html_item;
+}
+
+
+
+function stream_show_results(jsonData) {
+ var docs = jsonData["result-set"].docs;
+ var num_docs = docs.length -1;
+
+ $('.search-in-progress').css("cursor","auto");
+
+ var $search_results = $('#search-results');
+
+ if (num_docs>0) {
+ $search_results.html("Results: " + num_docs + " volumes matched
");
+ /*
+ var from = parseInt(store_search_args.start);
+ var to = from + num_rows;
+ $search_results.append("Showing matches: "+from+"-" + to + "
");
+ */
+ }
+ else {
+ $search_results.html("No volumes matched your query
");
+ }
+
+ for (var i=0; i0) {
+ arg_q += " OR ";
+ }
+
+ arg_q += fields.join(" OR ");
+
+ } // end of for each split q_text
+
+ // Example search on one of the htrc-full-ef fields is:
+ // q=en_NOUN_htrctoken:farming
+
+ store_search_args = { q: arg_q, indent: arg_indent, wt: arg_wt, start: arg_start, rows: arg_rows };
+
+ store_search_args.sort="id asc";
+ store_search_args.fl="volumeid_s,id";
+
+ var expr_tx = "search(htrc-full-ef20";
+
+ for (var k in store_search_args) {
+ if (store_search_args.hasOwnProperty(k)) {
+ var v = store_search_args[k];
+ expr_tx += "," + k + "=\"" + v + "\"";
+ }
+ }
+ expr_tx += ")";
+ }
+
+
+ if ((expr_md != "") && (expr_tx != "")) {
+ expr = "expr=intersect(" + expr_md + "," + expr_tx + ", on=\"id=volumeid_s\")";
+ }
+ else if (expr_md != "") {
+ expr = "expr=" + expr_md;
+ }
+ else if (expr_tx != "") {
+ expr = "expr=" + expr_tx;
+ }
+ else {
+ // both empty
+ console.log("Warning: query was empty");
+ }
+
+
+ $.ajax({
+ type: 'GET',
+ url: store_search_action,
+ data: expr,
+ dataType: 'json',
+ success: stream_show_results,
+ error: ajax_error
+ });
+
+}
+
+
+$(function() {
+ if ($('#stream-search-submit').length>0) {
+ $('#stream-search-submit').click(stream_submit_action);
+ }
+
+});
Index: /other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/stream-query.html
===================================================================
--- /other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/stream-query.html (revision 31613)
+++ /other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/stream-query.html (revision 31614)
@@ -29,4 +29,5 @@
+