Skip to content

Commit fcabb73

Browse files
committed
Fix sidebar navigation quirk. Downscale large images.
1 parent ad20e2a commit fcabb73

File tree

14 files changed

+38
-26
lines changed

14 files changed

+38
-26
lines changed

docs/content/21137588f9f2199ecf419382733df353f86bf7c7.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h2>Description</h2>
2828
<a href="https://www.youtube.com/watch?v=rLDgQg6bq7o">training video</a> prior to attempting
2929
to supply inverse reactive current. The product brief for Rockwell Automation's
3030
<a href="https://www.youtube.com/watch?v=RXJKdh1KZ0w">Retro Encabulator</a> is also a sufficient substitute.</p>
31-
<p><img alt="Turbo Encabulator" src="content/f43affbd_turboencabulator.jpg"/></p>
31+
<p><img alt="Turbo Encabulator" src="content/f43affbd_example.jpg"/></p>
3232
</div>
3333

3434
<h2>Contents</h2>

docs/css/layout.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ button {
1111
cursor: pointer;
1212
}
1313

14+
img {
15+
max-width: 100%;
16+
}
17+
1418
#_Sidebar {
1519
height: 100%;
1620
}

docs/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
<link rel="stylesheet" href="css/theme.css?v=2.3.1">
1515
<link rel="icon" type="image/png" href="favicon.png">
1616
<script>
17-
var BUILD_TS = 1652768997;
17+
var BUILD_TS = 1652845154;
1818
</script>
1919
<script src="js/BigInteger.min.js?v=2.3.1" type="text/javascript"></script>
2020
<script src="js/sha1.js?v=2.3.1" type="text/javascript"></script>
21-
<script src="js/data.js?ts=1652768997" type="text/javascript"></script>
22-
<script src="search/bkt_index.js?ts=1652768997" type="text/javascript"></script>
21+
<script src="js/data.js?ts=1652845154" type="text/javascript"></script>
22+
<script src="search/bkt_index.js?ts=1652845154" type="text/javascript"></script>
2323
<script src="js/ral.js?v=2.3.1" type="text/javascript"></script>
2424
<script src="js/main.js?v=2.3.1" type="text/javascript"></script>
2525
<script src="js/nav.js?v=2.3.1" type="text/javascript"></script>

docs/js/nav.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This file is part of PeakRDL-html <https://github.com/SystemRDL/PeakRDL-html>.
22
// and can be redistributed under the terms of GNU GPL v3 <https://www.gnu.org/licenses/>.
33

4-
async function load_page(id, done_callback) {
4+
async function load_page(id) {
55
var awaitable = fetch_page_content(id);
66
awaitable.then(text => {
77
// Page loaded successfully
@@ -16,7 +16,6 @@ async function load_page(id, done_callback) {
1616
init_reg_value();
1717
init_radix_buttons();
1818
}
19-
if(typeof done_callback !== "undefined") done_callback();
2019
userHooks.onContentLoad();
2120
})
2221
.catch(e => {
@@ -77,7 +76,7 @@ function load_page_via_url(){
7776
}
7877
}
7978
if(prev_id != CurrentID) {
80-
load_page(CurrentID, function () {
79+
load_page(CurrentID).then(() => {
8180
select_tree_node();
8281
expand_to_tree_node();
8382
open_tree_node(CurrentID);
@@ -113,7 +112,7 @@ function load_page_via_path(path, url_hash){
113112
}
114113

115114
if(prev_path != new_path) {
116-
load_page(CurrentID, function () {
115+
load_page(CurrentID).then(() => {
117116
select_tree_node();
118117
expand_to_tree_node();
119118
open_tree_node(CurrentID);
@@ -135,7 +134,7 @@ function onClickNodeLink(ev) {
135134
if(id == CurrentID) return(false);
136135

137136
reset_indexes_to_next(id);
138-
load_page(id, function () {
137+
load_page(id).then(() => {
139138
select_tree_node();
140139
expand_to_tree_node();
141140
open_tree_node(id);
@@ -160,7 +159,7 @@ function onClickPathLink(ev) {
160159
function load_parent_page(){
161160
var id = RALIndex[CurrentID].parent;
162161
if(id == null) return;
163-
load_page(id, function () {
162+
load_page(id).then(() => {
164163
select_tree_node();
165164
expand_to_tree_node();
166165
open_tree_node(id);

docs/js/search.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ function close_search(){
5252
document.getElementById("_MobiSearchButton").classList.add("search-button");
5353
document.getElementById("_MobiSearchButton").classList.remove("close-button");
5454
SearchState.active = false;
55-
SearchState.abortController.abort();
56-
SearchState.abortController = null;
55+
if(SearchState.abortController) {
56+
SearchState.abortController.abort();
57+
SearchState.abortController = null;
58+
}
5759
}
5860

5961
function onKeyDownSearch(ev) {
@@ -234,7 +236,7 @@ function open_search_result(result_idx){
234236

235237
close_search();
236238

237-
load_page(result.node_id, function () {
239+
load_page(result.node_id).then(() => {
238240
select_tree_node();
239241
expand_to_tree_node();
240242
open_tree_node(result.node_id);

docs/js/sidebar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ function onClickTreeLink(ev) {
154154
}
155155

156156
reset_indexes_to_next(id);
157-
load_page(id, function (){
157+
158+
load_page(id).then(() => {
158159
select_tree_node();
159160
refresh_url();
160161
refresh_title();

docs/search/bkt-0.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"aut":[["automatic",[[5,6]]],["automatically",[[3,0]]],["automation",[[0,0]]]],"rel":[["relative",[[1,18]]],["reliable",[[3,0]]],["reluctance",[[1,11],[1,10]]]],"gen":[["generated",[[0,0]]],["generator",[[0,0]]]],"sti":[["sticky",[[5,10]]]],"cli":[["clicking",[[3,0]]]],"dif":[["differential",[[5,6],[2,2]]]],"jpg":[["jpg",[[0,0]]]],"dir":[["diractance",[[1,18],[1,19]]]],"enu":[["enum",[[5,2]]],["enumerated",[[5,2]]]],"lun":[["lunar",[[1,18]]]],"wan":[["waneshaft",[[1,18],[2,2]]]],"inc":[["include",[[5,2]]]],"des":[["desc",[[0,0]]],["description",[[5,2],[0,0]]]],"htm":[["html",[[0,0]]]],"ret":[["retro",[[0,0]]]],"out":[["output",[[0,0]]]],"deg":[["degree",[[2,2]]]],"din":[["dingle",[[3,0]]]],"lik":[["likely",[[5,6]]]],"cha":[["changed",[[3,0]]]],"ent":[["entropic",[[3,0]]]],"spa":[["space",[[0,0]]]],"art":[["art",[[0,0]]]],"cal":[["calculated",[[3,0]]]],"fea":[["features",[[3,0],[0,0]]]],"rec":[["recommended",[[0,0]]]],"exa":[["example",[[0,0]]]],"rdl":[["rdlformatcode",[[3,0],[0,0]]]],"abo":[["above",[[3,0]]]],"rep":[["represents",[[3,0]]]],"abs":[["absolute",[[1,10],[3,0]]]],"gir":[["girdle",[[2,2]]],["girdlespring",[[5,6]]]],"sta":[["state",[[5,3],[5,2],[5,6],[0,0]]],["stator",[[2,11],[5,6]]],["status",[[2,1],[0,0]]]],"suf":[["sufficient",[[0,0]]]],"mor":[["more",[[0,0]]]],"fiv":[["five",[[3,0]]]],"ind":[["independent",[[3,0]]],["index",[[3,0]]],["indicates",[[5,2]]],["indicating",[[5,10]]]],"foo":[["foot",[[6,2]]]],"amp":[["amperes",[[6,2]]]],"spr":[["spring",[[2,2]]]],"pag":[["page",[[3,0]]],["pages",[[0,0]]]],"enc":[["encabulator",[[0,1],[2,1],[3,0],[0,0]]],["encoding",[[5,2]]]],"url":[["url",[[3,0]]]],"inv":[["inverse",[[0,0]]]],"enh":[["enhanced",[[0,0]]]],"pri":[["prior",[[0,0]]]],"eac":[["each",[[3,0]]]],"mar":[["markdown",[[0,0]]]],"def":[["definition",[[5,2]]]],"sys":[["system",[[1,1]]],["systemrdl",[[0,0]]]],"add":[["address",[[3,0],[0,0]]]],"cru":[["crumbtrail",[[3,0]]]],"tra":[["training",[[0,0]]]],"bri":[["brief",[[0,0]]]],"sup":[["supply",[[0,0]]]],"rea":[["reactive",[[0,0]]],["reads",[[2,2]]],["ready",[[5,6],[5,7]]]],"dem":[["demo",[[0,0]]]],"hig":[["highlights",[[0,0]]]],"use":[["used",[[5,6]]],["users",[[0,0]]],["uses",[[5,2]]]],"loo":[["look",[[0,0]]]],"arr":[["array",[[3,0]]]],"alo":[["alongside",[[5,2]]]],"err":[["error",[[5,6]]]],"wat":[["watch",[[0,0]]]],"fum":[["fumbling",[[2,2]]]],"non":[["non",[[2,2]]]],"pos":[["position",[[5,6]]]],"per":[["per",[[6,2],[2,11]]]],"zer":[["zero",[[2,2]]]],"com":[["components",[[3,0]]]],"als":[["also",[[5,2],[0,0]]]],"ins":[["instance",[[3,0]]]],"suc":[["successfully",[[5,6]]]],"doc":[["documentation",[[0,0]]]],"sou":[["source",[[0,0]]]],"pea":[["peakrdl",[[0,0]]]],"cap":[["capacitive",[[1,18]]],["capactive",[[1,19]]]],"roc":[["rockwell",[[0,0]]]],"tip":[["tip",[[5,2],[3,0],[0,0]]]],"str":[["strongly",[[0,0]]],["structure",[[0,0]]]],"fol":[["following",[[3,0]]]],"imm":[["immediately",[[2,2]]]],"any":[["any",[[5,2]]]],"ful":[["fully",[[3,0]]]],"arm":[["arms",[[3,0]]]],"ten":[["tension",[[2,2]]]],"mon":[["month",[[2,11]]]],"vid":[["video",[[0,0]]]],"red":[["reduce",[[2,2]]]],"lit":[["liter",[[6,2]]]],"sub":[["substitute",[[0,0]]]],"uni":[["units",[[6,2]]]],"mea":[["measurement",[[6,1],[6,2]]],["measurements",[[3,0]]]],"res":[["reset",[[5,6],[5,7]]]],"upd":[["updated",[[3,0]]]],"bit":[["bit",[[5,10]]]],"fai":[["fail",[[5,7]]],["failed",[[5,10]]]],"rev":[["revolutions",[[2,11]]]],"car":[["cardinal",[[3,1],[5,2],[3,0]]]],"sid":[["side",[[2,2]]]],"whe":[["whether",[[5,10]]]],"fie":[["field",[[5,2]]]],"gra":[["grammeter",[[6,2],[3,1],[6,1],[3,0],[5,6],[5,3],[5,2]]],["grammeters",[[3,0]]]],"tex":[["text",[[0,0]]]],"twe":[["twelve",[[3,0]]]],"syn":[["sync",[[5,10],[5,7]]],["sync_fail",[[5,7]]],["synchronization",[[5,6]]],["synchronized",[[5,6]]],["synchronizing",[[3,0]]],["syntax",[[0,0]]]],"con":[["configuration",[[0,0]]],["contains",[[3,0]]],["content",[[0,0]]],["control",[[1,1]]]],"thr":[["throughout",[[0,0]]]],"reg":[["regfile",[[3,0]]],["register",[[6,1],[1,1],[0,0]]]],"not":[["notice",[[3,0]]]],"set":[["set",[[1,10]]]],"tag":[["tags",[[3,0],[0,0]]]],"tur":[["turbo",[[0,1],[3,0],[0,0]]],["turboencabulator",[[0,0]]]],"att":[["attempting",[[0,0]]]],"usi":[["using",[[0,0]]]],"cur":[["current",[[6,2],[3,0],[0,0]]]],"mag":[["magneto",[[1,11],[1,10]]]],"box":[["boxes",[[0,0]]]],"pro":[["produces",[[3,0]]],["product",[[0,0]]],["progress",[[5,6]]],["properties",[[0,0]]]]}
1+
{"aut":[["automatic",[[5,6]]],["automatically",[[3,0]]],["automation",[[0,0]]]],"rel":[["relative",[[1,18]]],["reliable",[[3,0]]],["reluctance",[[1,11],[1,10]]]],"gen":[["generated",[[0,0]]],["generator",[[0,0]]]],"sti":[["sticky",[[5,10]]]],"cli":[["clicking",[[3,0]]]],"dif":[["differential",[[5,6],[2,2]]]],"jpg":[["jpg",[[0,0]]]],"dir":[["diractance",[[1,18],[1,19]]]],"enu":[["enum",[[5,2]]],["enumerated",[[5,2]]]],"lun":[["lunar",[[1,18]]]],"wan":[["waneshaft",[[1,18],[2,2]]]],"inc":[["include",[[5,2]]]],"des":[["desc",[[0,0]]],["description",[[5,2],[0,0]]]],"htm":[["html",[[0,0]]]],"ret":[["retro",[[0,0]]]],"out":[["output",[[0,0]]]],"deg":[["degree",[[2,2]]]],"din":[["dingle",[[3,0]]]],"lik":[["likely",[[5,6]]]],"cha":[["changed",[[3,0]]]],"ent":[["entropic",[[3,0]]]],"spa":[["space",[[0,0]]]],"art":[["art",[[0,0]]]],"cal":[["calculated",[[3,0]]]],"fea":[["features",[[3,0],[0,0]]]],"rec":[["recommended",[[0,0]]]],"exa":[["example",[[0,0]]]],"rdl":[["rdlformatcode",[[3,0],[0,0]]]],"abo":[["above",[[3,0]]]],"rep":[["represents",[[3,0]]]],"abs":[["absolute",[[1,10],[3,0]]]],"gir":[["girdle",[[2,2]]],["girdlespring",[[5,6]]]],"sta":[["state",[[5,3],[5,2],[5,6],[0,0]]],["stator",[[2,11],[5,6]]],["status",[[2,1],[0,0]]]],"suf":[["sufficient",[[0,0]]]],"mor":[["more",[[0,0]]]],"fiv":[["five",[[3,0]]]],"ind":[["independent",[[3,0]]],["index",[[3,0]]],["indicates",[[5,2]]],["indicating",[[5,10]]]],"foo":[["foot",[[6,2]]]],"amp":[["amperes",[[6,2]]]],"spr":[["spring",[[2,2]]]],"pag":[["page",[[3,0]]],["pages",[[0,0]]]],"enc":[["encabulator",[[0,1],[2,1],[3,0],[0,0]]],["encoding",[[5,2]]]],"url":[["url",[[3,0]]]],"inv":[["inverse",[[0,0]]]],"enh":[["enhanced",[[0,0]]]],"pri":[["prior",[[0,0]]]],"eac":[["each",[[3,0]]]],"mar":[["markdown",[[0,0]]]],"def":[["definition",[[5,2]]]],"sys":[["system",[[1,1]]],["systemrdl",[[0,0]]]],"add":[["address",[[3,0],[0,0]]]],"cru":[["crumbtrail",[[3,0]]]],"tra":[["training",[[0,0]]]],"bri":[["brief",[[0,0]]]],"sup":[["supply",[[0,0]]]],"rea":[["reactive",[[0,0]]],["reads",[[2,2]]],["ready",[[5,6],[5,7]]]],"dem":[["demo",[[0,0]]]],"hig":[["highlights",[[0,0]]]],"use":[["used",[[5,6]]],["users",[[0,0]]],["uses",[[5,2]]]],"loo":[["look",[[0,0]]]],"arr":[["array",[[3,0]]]],"alo":[["alongside",[[5,2]]]],"err":[["error",[[5,6]]]],"wat":[["watch",[[0,0]]]],"fum":[["fumbling",[[2,2]]]],"non":[["non",[[2,2]]]],"pos":[["position",[[5,6]]]],"per":[["per",[[6,2],[2,11]]]],"zer":[["zero",[[2,2]]]],"com":[["components",[[3,0]]]],"als":[["also",[[5,2],[0,0]]]],"ins":[["instance",[[3,0]]]],"suc":[["successfully",[[5,6]]]],"doc":[["documentation",[[0,0]]]],"sou":[["source",[[0,0]]]],"pea":[["peakrdl",[[0,0]]]],"cap":[["capacitive",[[1,18]]],["capactive",[[1,19]]]],"roc":[["rockwell",[[0,0]]]],"tip":[["tip",[[5,2],[3,0],[0,0]]]],"str":[["strongly",[[0,0]]],["structure",[[0,0]]]],"fol":[["following",[[3,0]]]],"imm":[["immediately",[[2,2]]]],"any":[["any",[[5,2]]]],"ful":[["fully",[[3,0]]]],"arm":[["arms",[[3,0]]]],"ten":[["tension",[[2,2]]]],"mon":[["month",[[2,11]]]],"vid":[["video",[[0,0]]]],"red":[["reduce",[[2,2]]]],"lit":[["liter",[[6,2]]]],"sub":[["substitute",[[0,0]]]],"uni":[["units",[[6,2]]]],"mea":[["measurement",[[6,1],[6,2]]],["measurements",[[3,0]]]],"res":[["reset",[[5,6],[5,7]]]],"upd":[["updated",[[3,0]]]],"bit":[["bit",[[5,10]]]],"fai":[["fail",[[5,7]]],["failed",[[5,10]]]],"rev":[["revolutions",[[2,11]]]],"car":[["cardinal",[[3,1],[5,2],[3,0]]]],"sid":[["side",[[2,2]]]],"whe":[["whether",[[5,10]]]],"fie":[["field",[[5,2]]]],"gra":[["grammeter",[[6,2],[3,1],[6,1],[3,0],[5,6],[5,3],[5,2]]],["grammeters",[[3,0]]]],"tex":[["text",[[0,0]]]],"twe":[["twelve",[[3,0]]]],"syn":[["sync",[[5,10],[5,7]]],["sync_fail",[[5,7]]],["synchronization",[[5,6]]],["synchronized",[[5,6]]],["synchronizing",[[3,0]]],["syntax",[[0,0]]]],"con":[["configuration",[[0,0]]],["contains",[[3,0]]],["content",[[0,0]]],["control",[[1,1]]]],"thr":[["throughout",[[0,0]]]],"reg":[["regfile",[[3,0]]],["register",[[6,1],[1,1],[0,0]]]],"not":[["notice",[[3,0]]]],"set":[["set",[[1,10]]]],"tag":[["tags",[[3,0],[0,0]]]],"tur":[["turbo",[[0,1],[3,0],[0,0]]]],"att":[["attempting",[[0,0]]]],"usi":[["using",[[0,0]]]],"cur":[["current",[[6,2],[3,0],[0,0]]]],"mag":[["magneto",[[1,11],[1,10]]]],"box":[["boxes",[[0,0]]]],"pro":[["produces",[[3,0]]],["product",[[0,0]]],["progress",[[5,6]]],["properties",[[0,0]]]]}
File renamed without changes.

example/turboencabulator.rdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ addrmap turbo_encab {
2020
to supply inverse reactive current. The product brief for Rockwell Automation's
2121
[Retro Encabulator](https://www.youtube.com/watch?v=RXJKdh1KZ0w) is also a sufficient substitute.
2222

23-
![Turbo Encabulator](turboencabulator.jpg)
23+
![Turbo Encabulator](example.jpg)
2424

2525
";
2626
reg {

peakrdl/html/static/css/layout.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ button {
1111
cursor: pointer;
1212
}
1313

14+
img {
15+
max-width: 100%;
16+
}
17+
1418
#_Sidebar {
1519
height: 100%;
1620
}

peakrdl/html/static/js/nav.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This file is part of PeakRDL-html <https://github.com/SystemRDL/PeakRDL-html>.
22
// and can be redistributed under the terms of GNU GPL v3 <https://www.gnu.org/licenses/>.
33

4-
async function load_page(id, done_callback) {
4+
async function load_page(id) {
55
var awaitable = fetch_page_content(id);
66
awaitable.then(text => {
77
// Page loaded successfully
@@ -16,7 +16,6 @@ async function load_page(id, done_callback) {
1616
init_reg_value();
1717
init_radix_buttons();
1818
}
19-
if(typeof done_callback !== "undefined") done_callback();
2019
userHooks.onContentLoad();
2120
})
2221
.catch(e => {
@@ -77,7 +76,7 @@ function load_page_via_url(){
7776
}
7877
}
7978
if(prev_id != CurrentID) {
80-
load_page(CurrentID, function () {
79+
load_page(CurrentID).then(() => {
8180
select_tree_node();
8281
expand_to_tree_node();
8382
open_tree_node(CurrentID);
@@ -113,7 +112,7 @@ function load_page_via_path(path, url_hash){
113112
}
114113

115114
if(prev_path != new_path) {
116-
load_page(CurrentID, function () {
115+
load_page(CurrentID).then(() => {
117116
select_tree_node();
118117
expand_to_tree_node();
119118
open_tree_node(CurrentID);
@@ -135,7 +134,7 @@ function onClickNodeLink(ev) {
135134
if(id == CurrentID) return(false);
136135

137136
reset_indexes_to_next(id);
138-
load_page(id, function () {
137+
load_page(id).then(() => {
139138
select_tree_node();
140139
expand_to_tree_node();
141140
open_tree_node(id);
@@ -160,7 +159,7 @@ function onClickPathLink(ev) {
160159
function load_parent_page(){
161160
var id = RALIndex[CurrentID].parent;
162161
if(id == null) return;
163-
load_page(id, function () {
162+
load_page(id).then(() => {
164163
select_tree_node();
165164
expand_to_tree_node();
166165
open_tree_node(id);

peakrdl/html/static/js/search.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ function close_search(){
5252
document.getElementById("_MobiSearchButton").classList.add("search-button");
5353
document.getElementById("_MobiSearchButton").classList.remove("close-button");
5454
SearchState.active = false;
55-
SearchState.abortController.abort();
56-
SearchState.abortController = null;
55+
if(SearchState.abortController) {
56+
SearchState.abortController.abort();
57+
SearchState.abortController = null;
58+
}
5759
}
5860

5961
function onKeyDownSearch(ev) {
@@ -234,7 +236,7 @@ function open_search_result(result_idx){
234236

235237
close_search();
236238

237-
load_page(result.node_id, function () {
239+
load_page(result.node_id).then(() => {
238240
select_tree_node();
239241
expand_to_tree_node();
240242
open_tree_node(result.node_id);

peakrdl/html/static/js/sidebar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ function onClickTreeLink(ev) {
154154
}
155155

156156
reset_indexes_to_next(id);
157-
load_page(id, function (){
157+
158+
load_page(id).then(() => {
158159
select_tree_node();
159160
refresh_url();
160161
refresh_title();

0 commit comments

Comments
 (0)