Skip to content

Commit

Permalink
Rename existing function and param name
Browse files Browse the repository at this point in the history
  • Loading branch information
stanley-skyline committed Sep 12, 2024
1 parent 5e17d39 commit d6c82ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions templates/skyline/public/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ function initSearch() {
return str;
}

function getUrl(str) {
function getDocsUrlFromBlobStoragePathUri(blobUri) {
// example url: "https://docshelp.blob.core.windows.net/docs/user-guide/Advanced_Functionality/DataMiner_Systems/DataminerSystems.html"
const startsWith = "https://docshelp.blob.core.windows.net/docs/"

if (str.startsWith(startsWith)) {
return `https://docs.dataminer.services/${str.substring(startsWith.length)}`;
if (blobUri.startsWith(startsWith)) {
return `https://docs.dataminer.services/${blobUri.substring(startsWith.length)}`;
}
return str;
return blobUri;
}

function initEventHandlersCloseOpenSearch() {
Expand Down Expand Up @@ -122,7 +122,7 @@ function initSearch() {
if (result.metadata_storage_name !== "toc.html" && result.metadata_title !== null) {
// results with toc.html files (table of contents) + without title are skipped
const title = getTitle(result.metadata_title);
const url = getUrl(result.storage_path);
const url = getDocsUrlFromBlobStoragePathUri(result.storage_path);
const htmlString = `<div class="result"><a href="${url}?q=${encodeURIComponent(searchTerm)}"><div class="url">${url}</div><div class="title">${title}</div></a></div>`;
html.push(htmlString)
}
Expand Down

0 comments on commit d6c82ea

Please sign in to comment.