From d041afa83bcea5b439907861765ffd87ced1a9fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 20 Sep 2012 16:31:34 +0200 Subject: [PATCH] add possibility to add files --- server/index.html | 9 +++++-- server/search_server.py | 60 ++++++++++++++++++++++++++++++++++------- server/upload.html | 38 ++++++++++++++++++++++++++ 3 files changed, 95 insertions(+), 12 deletions(-) create mode 100644 server/upload.html diff --git a/server/index.html b/server/index.html index 09c377b..df7eb64 100644 --- a/server/index.html +++ b/server/index.html @@ -13,7 +13,12 @@ function display_results(data) { var items = []; $('#debug').html(data['qtime']); $.each(data['results'], function(key, val) { - items.push('
  • ' + Math.min(5, parseInt(val['score']*5)) + ' ' + val['id'] + '
  • '); + if (val['id'].indexOf('N-') == 0) { + url = 'pdfs-N/' + val['id']; + } else { + url = 'pdfs/' + val['id']; + } + items.push('
  • ' + Math.min(5, parseInt(val['score']*5)) + ' ' + val['id'] + '
  • '); }); $('#results').html($('