visual improvements for tags
This commit is contained in:
Родитель
3e5456b432
Коммит
e0187cc96d
|
@ -485,10 +485,18 @@ namespace CognitiveSearch.UI
|
|||
|
||||
if (AudioContainer != "") {
|
||||
Uri blobUri = new Uri(decodedPath);
|
||||
string audioPath = AudioContainer + "/" + String.Join("", blobUri.Segments[2..]);
|
||||
audioPath = blobUri.Scheme + "://" + blobUri.Host + "/" + audioPath.Replace(".json", "");
|
||||
string audioToken = GetToken(audioPath, out int x);
|
||||
response.Add("audioPath", audioPath + audioToken);
|
||||
if (blobUri.AbsolutePath.Contains(".mp3") || blobUri.AbsolutePath.Contains(".wav") || blobUri.AbsolutePath.Contains(".m4a"))
|
||||
{
|
||||
string audioPath = AudioContainer + "/" + String.Join("", blobUri.Segments[2..]);
|
||||
audioPath = blobUri.Scheme + "://" + blobUri.Host + "/" + audioPath.Replace(".json", "");
|
||||
string audioToken = GetToken(audioPath, out int x);
|
||||
response.Add("audioPath", audioPath + audioToken);
|
||||
}
|
||||
else
|
||||
{
|
||||
response.Add("audioPath", null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var result = new DocumentResult
|
||||
|
|
|
@ -35,6 +35,9 @@ namespace CognitiveSearch.UI
|
|||
"StartTime",
|
||||
"EndTime",
|
||||
"keyphrases",
|
||||
"DestCity",
|
||||
"OriginCity",
|
||||
"hotels",
|
||||
|
||||
// Add fields needed to display results cards
|
||||
|
||||
|
|
|
@ -481,6 +481,7 @@ pre {
|
|||
.tag.tag-parts {
|
||||
background-color: #4A4A4A;
|
||||
}
|
||||
|
||||
.tag.tag-parts_descriptions {
|
||||
background-color: #202020;
|
||||
}
|
||||
|
@ -518,6 +519,18 @@ pre {
|
|||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tag-DestCity {
|
||||
background-color: #0a7900;
|
||||
}
|
||||
|
||||
.tag-OriginCity {
|
||||
background-color: #038394;
|
||||
}
|
||||
|
||||
.tag-keyphrases {
|
||||
background-color: #b78400;
|
||||
}
|
||||
|
||||
#tags-panel {
|
||||
margin-top: 60px;
|
||||
}
|
||||
|
@ -664,12 +677,12 @@ body {
|
|||
font-size: 12px;
|
||||
}
|
||||
|
||||
.customInfobox .name {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.customInfobox .name {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.dropdown-graphfields {
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,15 +63,15 @@ function AuthenticateResultsMap(results) {
|
|||
|
||||
//Wait until the map resources are ready.
|
||||
resultsMap.events.add('ready', function () {
|
||||
|
||||
|
||||
/* Construct a zoom control*/
|
||||
var zoomControl = new atlas.control.ZoomControl();
|
||||
|
||||
|
||||
/* Add the zoom control to the map*/
|
||||
resultsMap.controls.add(zoomControl, {
|
||||
position: "bottom-right"
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
AddMapPoints(results);
|
||||
|
||||
|
@ -96,7 +96,7 @@ function AddMapPoints(results) {
|
|||
//Create a data source to add it to the map
|
||||
mapDataSource = new atlas.source.DataSource();
|
||||
coordinates = UpdatePOIs(results, mapDataSource);
|
||||
|
||||
|
||||
//Wait until the map resources are ready for first set up.
|
||||
resultsMap.events.add('ready', function () {
|
||||
|
||||
|
@ -113,7 +113,7 @@ function AddMapPoints(results) {
|
|||
pixelOffset: [0, -18],
|
||||
closeButton: false
|
||||
});
|
||||
|
||||
|
||||
//Add a hover event to the symbol layer.
|
||||
resultsMap.events.add('click', symbolLayer, function (e) {
|
||||
//Make sure that the point exists.
|
||||
|
@ -224,8 +224,8 @@ function UpdateResults(data) {
|
|||
content = "";
|
||||
}
|
||||
|
||||
var icon = " ms-Icon--Page";
|
||||
var id = document[data.idField];
|
||||
var icon = " ms-Icon--CannedChat";
|
||||
var id = document[data.idField];
|
||||
var tags = GetTagsHTML(document);
|
||||
var path;
|
||||
|
||||
|
@ -240,7 +240,7 @@ function UpdateResults(data) {
|
|||
if (document["metadata_storage_name"] !== undefined) {
|
||||
name = document.metadata_storage_name.split(".")[0];
|
||||
}
|
||||
|
||||
|
||||
if (document["metadata_title"] !== undefined && document["metadata_title"] !== null) {
|
||||
title = document.metadata_title;
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ function UpdateResults(data) {
|
|||
resultsHtml += `<div id="resultdiv${i}" class="${classList}" onclick="ShowDocument('${id}', ${i + 1});">
|
||||
<div class="search-result">
|
||||
${imageContent}
|
||||
<div class="results-icon col-md-1">
|
||||
<div class="results-icon col-md-1">
|
||||
<div class="ms-CommandButton-icon">
|
||||
<i class="html-icon ms-Icon ${icon}" style="font-size: 26px;"></i>
|
||||
</div>
|
||||
|
@ -348,7 +348,7 @@ function UpdateResults(data) {
|
|||
<h4>Could not get metadata_storage_path for this result.</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
</div>`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,18 +12,24 @@ function GetTagsHTML(result) {
|
|||
|
||||
if (Array.isArray(result[name])) {
|
||||
result[name].forEach(function (tagValue, i, tagArray) {
|
||||
if (i == 0) {
|
||||
tagsHTML += `${name}: `;
|
||||
}
|
||||
if (i <= 10) {
|
||||
if ($.inArray(tagValue, dedupedEntities) === -1) { //! in array
|
||||
dedupedEntities.push(tagValue);
|
||||
if (tagValue.length > 30) { // check tag name length
|
||||
// create substring of tag name length if too long
|
||||
tagValue = tagValue.substring(0, 30);
|
||||
}
|
||||
tagsHTML += `<button class="tag tag-${name}" onclick="HighlightTag(event)">${tagValue}</button>`;
|
||||
i++;
|
||||
if (tagValue.length > 30) { // check tag name length
|
||||
// create substring of tag name length if too long
|
||||
tagValue = tagValue.substring(0, 30);
|
||||
}
|
||||
tagsHTML += `<button class="tag tag-${name}" onclick="HighlightTag(event)">${tagValue}</button>`;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (dedupedEntities.length > 0) {
|
||||
tagsHTML += "<br/>";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче