mirror of
https://github.com/Jonnyan404/memos-bber.git
synced 2026-04-25 03:58:37 +09:00
memos
This commit is contained in:
+22
-2
@@ -243,8 +243,18 @@ $('#search').click(function () {
|
|||||||
var resourceList = searchData[i].item.resourceList;
|
var resourceList = searchData[i].item.resourceList;
|
||||||
for(var j=0;j < resourceList.length;j++){
|
for(var j=0;j < resourceList.length;j++){
|
||||||
var restype = resourceList[j].type.slice(0,5);
|
var restype = resourceList[j].type.slice(0,5);
|
||||||
|
var resexlink = resourceList[j].externalLink
|
||||||
|
var resLink = ''
|
||||||
|
if(resexlink){
|
||||||
|
resLink = resexlink
|
||||||
|
}else{
|
||||||
|
resLink = info.apiUrl.replace(/api\/memo.*/,'')+'o/r/'+resourceList[j].id+'/'+resourceList[j].filename
|
||||||
|
}
|
||||||
if(restype == 'image'){
|
if(restype == 'image'){
|
||||||
searchDom += '<img class="random-image" src="'+ info.apiUrl.replace(/api\/memo.*/,'')+'o/r/'+resourceList[j].id+'/'+resourceList[j].filename+'"/>'
|
searchDom += '<img class="random-image" src="'+resLink+'"/>'
|
||||||
|
}
|
||||||
|
if(restype !== 'image'){
|
||||||
|
searchDom += '<a target="_blank" rel="noreferrer" href="'+resLink+'">'+resourceList[j].filename+'</a>'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -309,8 +319,18 @@ function randDom(randomData){
|
|||||||
var resourceList = randomData.resourceList;
|
var resourceList = randomData.resourceList;
|
||||||
for(var j=0;j < resourceList.length;j++){
|
for(var j=0;j < resourceList.length;j++){
|
||||||
var restype = resourceList[j].type.slice(0,5);
|
var restype = resourceList[j].type.slice(0,5);
|
||||||
|
var resexlink = resourceList[j].externalLink
|
||||||
|
var resLink = ''
|
||||||
|
if(resexlink){
|
||||||
|
resLink = resexlink
|
||||||
|
}else{
|
||||||
|
resLink = info.apiUrl.replace(/api\/memo.*/,'')+'o/r/'+resourceList[j].id+'/'+resourceList[j].filename
|
||||||
|
}
|
||||||
if(restype == 'image'){
|
if(restype == 'image'){
|
||||||
randomDom += '<img class="random-image" src="'+info.apiUrl.replace(/api\/memo.*/,'')+'o/r/'+resourceList[j].id+'/'+resourceList[j].filename+'"/>'
|
randomDom += '<img class="random-image" src="'+resLink+'"/>'
|
||||||
|
}
|
||||||
|
if(restype !== 'image'){
|
||||||
|
randomDom += '<a target="_blank" rel="noreferrer" href="'+resLink+'">'+resourceList[j].filename+'</a>'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user