mirror of https://github.com/perkeep/perkeep.git
linkify search results too
This commit is contained in:
parent
ae221c0712
commit
f698ee736b
|
@ -47,11 +47,6 @@ function blobInfoUpdate(bmap) {
|
|||
}
|
||||
}
|
||||
|
||||
function linkifyBlobRefs(schemaBlob) {
|
||||
var re = /(\w{3,6}-[a-f0-9]{30,})/g;
|
||||
return schemaBlob.replace(re, "<a href='./?b=$1'>$1</a>");
|
||||
}
|
||||
|
||||
function blobInfoOnLoad() {
|
||||
var blobref = getBlobParam();
|
||||
if (!blobref) {
|
||||
|
|
|
@ -233,6 +233,11 @@ function isPlausibleBlobRef(blobRef) {
|
|||
return /^\w+-[a-f0-9]+$/.test(blobRef);
|
||||
}
|
||||
|
||||
function linkifyBlobRefs(schemaBlob) {
|
||||
var re = /(\w{3,6}-[a-f0-9]{30,})/g;
|
||||
return schemaBlob.replace(re, "<a href='./?b=$1'>$1</a>");
|
||||
}
|
||||
|
||||
// Helper function for camliNewSetAttributeClaim() (and eventually, for
|
||||
// similar functions to add or delete attributes).
|
||||
function changeAttribute(permanode, claimType, attribute, value, opts) {
|
||||
|
|
|
@ -6,7 +6,7 @@ function search() {
|
|||
console.log("no status 200; got " + xhr.status);
|
||||
return;
|
||||
}
|
||||
document.getElementById("searchres").innerHTML = "<pre>" + xhr.responseText + "</pre>";
|
||||
document.getElementById("searchres").innerHTML = "<pre>" + linkifyBlobRefs(xhr.responseText) + "</pre>";
|
||||
};
|
||||
xhr.open("GET", disco.searchRoot + "camli/search", true);
|
||||
xhr.send();
|
||||
|
|
Loading…
Reference in New Issue