hdoc-tools 0.9.45 → 0.9.46

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.9.45",
3
+ "version": "0.9.46",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {
@@ -133,6 +133,7 @@ function listenForHrefClicks()
133
133
 
134
134
  }
135
135
 
136
+ //-- based on content url highlight match navigation menu item
136
137
  //-- based on content url highlight match navigation menu item
137
138
  function highlightNavigationLinkFromUrl(matchLinkHref)
138
139
  {
@@ -140,32 +141,45 @@ function highlightNavigationLinkFromUrl(matchLinkHref)
140
141
  matchLinkHref = removeStartingSlash(matchLinkHref).split("#")[0]; //-- remvoe # link
141
142
  $('a.DocLink').removeClass("active");
142
143
 
143
- document.querySelectorAll('a.DocLink').forEach((el) => {
144
-
144
+ let arrItems = document.querySelectorAll('a.DocLink');
145
+
146
+ for(let x=0;x<arrItems.length;x++)
147
+ {
145
148
  let checkUrl = null;
146
149
  try{
147
150
  checkUrl = new URL(el.href);
148
151
  }
149
152
  catch(e)
150
153
  {
151
- console.log("BAD navigation menu item found",el.href);
154
+ //console.log("BAD navigation menu item found",el);
152
155
  }
153
156
 
154
157
  if(checkUrl)
155
158
  {
156
159
  //console.log(checkUrl.pathname,matchLinkHref)
157
- if(removeStartingSlash(checkUrl.pathname).indexOf(matchLinkHref)===0)
160
+ let testCurrPath = removeStartingSlash(checkUrl.pathname);
161
+ if(testCurrPath===matchLinkHref)
158
162
  {
159
- $(el).addClass("active");
163
+ //-- exact match
164
+ $(el).addClass("active")
165
+ el.scrollIntoView();
166
+ return false;//break out
167
+ }
168
+ else if(testCurrPath.indexOf(matchLinkHref)===0)
169
+ {
170
+ //--
171
+ $(el).addClass("active")
172
+ el.scrollIntoView();
160
173
  return false;//break out
161
174
  }
162
175
  else if(matchLinkHref.indexOf(removeStartingSlash(checkUrl.pathname) + "/")===0)
163
176
  {
164
177
  $(el).addClass("active");
178
+ el.scrollIntoView();
165
179
  return false;//break out
166
180
  }
167
181
  }
168
- });
182
+ }
169
183
  }
170
184
 
171
185
  function getAnchorFromHash(strHash,strHasClass)
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.