Skip to content
Snippets Groups Projects
Commit 12f1f292 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

change id to the document's full path-- this will make it easier to fetch...

change id to the document's full path-- this will make it easier to fetch specific documents from the index when displaying directory contents
parent 9eba6e3b
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,6 @@ index.addField("description"); ...@@ -24,7 +24,6 @@ index.addField("description");
//index.addField("body"); //index.addField("body");
index.addField("path"); index.addField("path");
index.setRef("id"); index.setRef("id");
var doc_id = 0;
// Stop-gap translator // Stop-gap translator
function translate_form() { function translate_form() {
...@@ -61,12 +60,11 @@ function add_doc_to_index(filename, data) { ...@@ -61,12 +60,11 @@ function add_doc_to_index(filename, data) {
title = title.slice(0, -5); title = title.slice(0, -5);
} }
index.addDoc({ index.addDoc({
"id": doc_id++, "id": filename,
"title": title, "title": title,
"keywords": keywords, "keywords": keywords,
"description": desc, "description": desc
//"body": big_line, //"body": big_line,
"path": filename
}); });
} }
...@@ -353,8 +351,8 @@ function doc_search() { ...@@ -353,8 +351,8 @@ function doc_search() {
div = document.createElement("div"); div = document.createElement("div");
a = document.createElement("a"); a = document.createElement("a");
a.href = "javascript: pdgui.doc_open('" + a.href = "javascript: pdgui.doc_open('" +
pdgui.defunkify_windows_path(path.dirname(doc.path)) + "', '" + pdgui.defunkify_windows_path(path.dirname(doc.id)) + "', '" +
pdgui.defunkify_windows_path(path.basename(doc.path)) + "');" pdgui.defunkify_windows_path(path.basename(doc.id)) + "');"
a.textContent = doc.title; a.textContent = doc.title;
header = document.createElement("h3"); header = document.createElement("h3");
header.appendChild(a); header.appendChild(a);
...@@ -370,7 +368,7 @@ function doc_search() { ...@@ -370,7 +368,7 @@ function doc_search() {
</script> </script>
</head> </head>
<body class="search_body"> <body class="search_body">
<input type="file" id="file_browser" style="display: none;" onchange="file_browser_callback(this);"></input> <input type="file" id="file_browser" style="display: none;" onchange="file_browser_callback(this);" accept=".pd,.txt,.htm,.html,.pdf"></input>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
width="220" height="50" viewBox="0 0 140 31.81"> width="220" height="50" viewBox="0 0 140 31.81">
<g stroke-linecap="square" fill="none" stroke-width="3"> <g stroke-linecap="square" fill="none" stroke-width="3">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment