Skip to content

Commit f555123

Browse files
Merge pull request #159 from dynamsoft-docs/JennyBranch
Jenny branch
2 parents 2127f88 + e9eaee8 commit f555123

File tree

2 files changed

+64
-13
lines changed

2 files changed

+64
-13
lines changed

_layouts/default-layout.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
{%- assign noTitleIndex = "noTitleIndex" -%}
88
{%- endif -%}
99
<body>
10-
<div class="headWrapper">
10+
<header class="headWrapper">
1111
{%- include page_header.html -%}
12-
</div>
12+
</header>
1313
{%- include dlrNav.html -%}
1414
<div class="sideBarIcon"><i class="fa fa-list" style="margin-right: 5px;"></i> Table of contents</div>
15-
<div class="container" id="categoryMenuTree">
15+
<main class="container" id="categoryMenuTree">
1616
<div class="row">
17-
<div class="sideBar col-xs-12 col-md-3 hide-xs hide-sm">
17+
<aside class="sideBar col-xs-12 col-md-3 hide-xs hide-sm">
1818
<div id="sideBarCnt">
1919
<div class="docSearchPart" style="margin-top: 30px;">
2020
<input id="txtSearch" class="search" type="text">
2121
</div>
22-
<div class="mainPage">
22+
<nav class="mainPage">
2323
<ul id="fullTreeMenuListContainer" name="listLevel1">
2424
</ul>
25-
</div>
25+
</nav>
2626
</div>
27-
</div>
28-
<div class="docContainer col-xs-12 col-md-9">
27+
</aside>
28+
<section class="docContainer col-xs-12 col-md-9">
2929
<div id="docHead" class="head row hide-xs hide-sm">
3030
{%- include main-page-head.html -%}
3131
</div>
@@ -59,19 +59,19 @@
5959
<div class="lds-ring"><div></div><div></div><div></div><div></div></div>
6060
</div>
6161
</div>
62-
</div>
62+
</section>
6363
</div>
64-
</div>
64+
</main>
6565
<div class="history list" id="categoryMenuTree_history">
6666
<div class="container">
6767
<div class="col-xs-12">
6868
{%- include liquid_autoGenerateHistoryList.html -%} {%- include auto-version-list.html -%}
6969
</div>
7070
</div>
7171
</div>
72-
<div id="footerWrapper">
72+
<footer id="footerWrapper">
7373
{%- include page_footer.html -%}
74-
</div>
74+
</footer>
7575

7676
<iframe id="sideBarIframe" src="{{site.firstLevelUrl}}/Hide_Tree_Page.html" allow="" height="0" frameborder="0"></iframe>
7777
<script type="text/javascript">
@@ -114,7 +114,7 @@
114114
refinement = "c/c++"
115115
}
116116
let refinementTag = refinement ? ("&refinement=" + refinement) : ""
117-
window.location.href = '/label-recognition/docs/search.html?q=' + $('#txtSearch').val() + refinementTag;
117+
window.location.href = '/label-recognition/docs/core/search.html?q=' + $('#txtSearch').val() + refinementTag;
118118
}
119119
})
120120
})

_layouts/search-page.html

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,57 @@ <h1>Search</h1>
306306
}
307307
})
308308

309+
$("body").delegate("#searchResult .gsc-resultsRoot a.gs-title", "click", function(e) {
310+
e.preventDefault();
311+
312+
var link = $(this).eq(0).data("ctorig")
313+
if (link.indexOf("capture-vision/docs") > 0) {
314+
var repoType = getRepoType("core", link);
315+
if (link.indexOf("?") > 0) {
316+
var arr = link.split("?")
317+
if(arr[1].indexOf("#") > 0) {
318+
var subArr = arr[1].split("#")
319+
link = link +"?product=dlr&repoType="+ repoType +"&" + arr[1]
320+
} else {
321+
link = link + "&product=dlr&repoType=" + repoType
322+
}
323+
} else {
324+
link = link + "?product=dlr&repoType=" + repoType
325+
}
326+
}
327+
window.location.href = link
328+
});
329+
330+
function getRepoType(defaultValue, link) {
331+
var lang = getCurrentUrlLang(link, true)
332+
var repoType = defaultValue
333+
if (lang) {
334+
if (lang == 'android' || lang == 'objectivec-swift') {
335+
repoType = "mobile"
336+
} else if (lang == 'javascript') {
337+
repoType = "web"
338+
} else if (lang == 'cplusplus' || lang == 'c' || lang == 'java' || lang == 'dotnet') {
339+
repoType = "server"
340+
} else {
341+
repoType = "core"
342+
}
343+
} else {
344+
if(link.indexOf("/docs/server/") > 0) {
345+
repoType = "server"
346+
}
347+
if (link.indexOf("/docs/core/") > 0) {
348+
repoType = "core"
349+
}
350+
if (link.indexOf("/docs/mobile") > 0) {
351+
repoType = "mobile"
352+
}
353+
if (link.indexOf("/docs/web/") > 0) {
354+
repoType = "web"
355+
}
356+
}
357+
return repoType
358+
}
359+
309360
</script>
310361

311362
{%- include livehelp.html -%}

0 commit comments

Comments
 (0)