mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -04:00
implement images result card
This commit is contained in:
parent
1378ab8ec5
commit
70ceb0f8f8
2 changed files with 30 additions and 2 deletions
|
@ -36,7 +36,8 @@ const SEARCH_CARD_TYPES = {
|
||||||
DATA_GENERIC: 20,
|
DATA_GENERIC: 20,
|
||||||
DATA_FINANCE: 21,
|
DATA_FINANCE: 21,
|
||||||
DATA_DICTIONARY: 22,
|
DATA_DICTIONARY: 22,
|
||||||
DATA_TRANSLATE: 23
|
DATA_TRANSLATE: 23,
|
||||||
|
PIVOT_IMAGES: 100
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: create a favicon() util
|
// TODO: create a favicon() util
|
||||||
|
@ -185,6 +186,19 @@ function createSearchResultPage(context, result, doodle){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
break;
|
||||||
|
case SEARCH_CARD_TYPES.PIVOT_IMAGES:
|
||||||
|
res = createEmbed("default", context, {
|
||||||
|
author: {
|
||||||
|
name: result.card.title,
|
||||||
|
iconUrl: result.card.icon
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
url: result.card.image
|
||||||
|
},
|
||||||
|
footer: renderFooter(context, doodle)
|
||||||
|
})
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
res = createEmbed("error", context, "Unknown GoogleResult Type: " + result.type)
|
res = createEmbed("error", context, "Unknown GoogleResult Type: " + result.type)
|
||||||
|
|
|
@ -38,7 +38,8 @@ const SEARCH_CARD_TYPES = {
|
||||||
DATA_GENERIC: 20,
|
DATA_GENERIC: 20,
|
||||||
DATA_FINANCE: 21,
|
DATA_FINANCE: 21,
|
||||||
DATA_DICTIONARY: 22,
|
DATA_DICTIONARY: 22,
|
||||||
DATA_TRANSLATE: 23
|
DATA_TRANSLATE: 23,
|
||||||
|
PIVOT_IMAGES: 100
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: create a favicon() util
|
// TODO: create a favicon() util
|
||||||
|
@ -187,6 +188,19 @@ function createSearchResultPage(context, result, doodle){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
break;
|
||||||
|
case SEARCH_CARD_TYPES.PIVOT_IMAGES:
|
||||||
|
res = createEmbed("default", context, {
|
||||||
|
author: {
|
||||||
|
name: result.card.title,
|
||||||
|
iconUrl: result.card.icon
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
url: result.card.image
|
||||||
|
},
|
||||||
|
footer: renderFooter(context, doodle)
|
||||||
|
})
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
res = createEmbed("error", context, "Unknown GoogleResult Type: " + result.type)
|
res = createEmbed("error", context, "Unknown GoogleResult Type: " + result.type)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue