hdoc-tools 0.9.12 → 0.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/ui/js/doc.hornbill.js +31 -3
- package/LICENSE +0 -21
package/package.json
CHANGED
package/ui/js/doc.hornbill.js
CHANGED
@@ -110,9 +110,9 @@ function listenForHrefClicks()
|
|
110
110
|
ev.preventDefault();
|
111
111
|
|
112
112
|
//-- do we need to scroll into view element on this page
|
113
|
-
if(checkUrl.hash &&
|
113
|
+
if(checkUrl.hash && getAnchorFromHash(checkUrl.hash,"faq-toc-item"))
|
114
114
|
{
|
115
|
-
|
115
|
+
getAnchorFromHash(checkUrl.hash,"faq-toc-item").scrollIntoView();
|
116
116
|
if(ele.href!==document.location.href) window.history.pushState(null, null, ele.href); //-- user has clicked a link so we want to add state to history so we can click back
|
117
117
|
}
|
118
118
|
else
|
@@ -166,6 +166,31 @@ function highlightNavigationLinkFromUrl(matchLinkHref)
|
|
166
166
|
});
|
167
167
|
}
|
168
168
|
|
169
|
+
function getAnchorFromHash(strHash,strHasClass)
|
170
|
+
{
|
171
|
+
try{
|
172
|
+
let strSelector = toSeoUrl(strHash.replace("#",""));
|
173
|
+
if(strHasClass)strSelector += "." + strHasClass;
|
174
|
+
|
175
|
+
let jqEle = $("#"+strSelector);
|
176
|
+
if(jqEle[0])
|
177
|
+
{
|
178
|
+
return jqEle;
|
179
|
+
}
|
180
|
+
else
|
181
|
+
{
|
182
|
+
return null;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
catch(e)
|
186
|
+
{
|
187
|
+
console.log("Get document anchor element by hash failed ["+strHash+"]",e);
|
188
|
+
return null;
|
189
|
+
}
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
|
169
194
|
//-- create items to stick in toc from current loaded content
|
170
195
|
//-- searches for H2,H3
|
171
196
|
function generateTableOfContentsFromDoc()
|
@@ -361,7 +386,8 @@ function loadContentUrl(linkRef,fromPageRefresh,fromPopState)
|
|
361
386
|
//-- scroll to element that match hash (if have one)
|
362
387
|
if(document.location.hash)
|
363
388
|
{
|
364
|
-
|
389
|
+
let gotoEle = getAnchorFromHash(document.location.hash) ;
|
390
|
+
if(gotoEle)gotoEle[0].scrollIntoView();
|
365
391
|
}
|
366
392
|
});
|
367
393
|
view.$forceUpdate();
|
@@ -532,6 +558,8 @@ async function fetchJsonFile(strFilePath)
|
|
532
558
|
|
533
559
|
|
534
560
|
//-- THE INIT APP CALLED FROM index.html
|
561
|
+
$(".document-body").attr("v-pre","");
|
562
|
+
|
535
563
|
var view = new Vue({
|
536
564
|
el: '#vDocDevApp',
|
537
565
|
data: {updateCounter:0,bookId:"", docApp:{keepTocLayout:false,book:{},navSections:[],tableOfContents:[],bookBreadCrumb:[]}},
|
package/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2022 Hornbill Docs
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|