Skip to content

Commit

Permalink
adds switcher to ref
Browse files Browse the repository at this point in the history
  • Loading branch information
damirka committed Apr 2, 2024
1 parent da14515 commit 979296f
Show file tree
Hide file tree
Showing 32 changed files with 560 additions and 0 deletions.
17 changes: 17 additions & 0 deletions reference/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,22 @@ <h1 id="document-not-found-404"><a class="header" href="#document-not-found-404"

</div>

<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>



Expand All @@ -220,6 +236,7 @@ <h1 id="document-not-found-404"><a class="header" href="#document-not-found-404"
<script src="book.js"></script>

<!-- Custom JS scripts -->
<script src="theme/switcher.js"></script>


</div>
Expand Down
17 changes: 17 additions & 0 deletions reference/abilities.html
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,22 @@ <h3 id="example-conditional-key"><a class="header" href="#example-conditional-ke

</div>

<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>



Expand All @@ -492,6 +508,7 @@ <h3 id="example-conditional-key"><a class="header" href="#example-conditional-ke
<script src="book.js"></script>

<!-- Custom JS scripts -->
<script src="theme/switcher.js"></script>


</div>
Expand Down
17 changes: 17 additions & 0 deletions reference/abort-and-assert.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,22 @@ <h2 id="the-type-of-abort"><a class="header" href="#the-type-of-abort">The type

</div>

<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>



Expand All @@ -387,6 +403,7 @@ <h2 id="the-type-of-abort"><a class="header" href="#the-type-of-abort">The type
<script src="book.js"></script>

<!-- Custom JS scripts -->
<script src="theme/switcher.js"></script>


</div>
Expand Down
17 changes: 17 additions & 0 deletions reference/coding-conventions.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,22 @@ <h1 class="menu-title">The Move Reference</h1>

</div>

<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>



Expand All @@ -233,6 +249,7 @@ <h1 class="menu-title">The Move Reference</h1>
<script src="book.js"></script>

<!-- Custom JS scripts -->
<script src="theme/switcher.js"></script>


</div>
Expand Down
17 changes: 17 additions & 0 deletions reference/constants.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,22 @@ <h3 id="complex-expressions"><a class="header" href="#complex-expressions">Compl

</div>

<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>



Expand All @@ -305,6 +321,7 @@ <h3 id="complex-expressions"><a class="header" href="#complex-expressions">Compl
<script src="book.js"></script>

<!-- Custom JS scripts -->
<script src="theme/switcher.js"></script>


</div>
Expand Down
17 changes: 17 additions & 0 deletions reference/control-flow.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,22 @@ <h1 id="control-flow"><a class="header" href="#control-flow">Control Flow</a></h

</div>

<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>



Expand All @@ -242,6 +258,7 @@ <h1 id="control-flow"><a class="header" href="#control-flow">Control Flow</a></h
<script src="book.js"></script>

<!-- Custom JS scripts -->
<script src="theme/switcher.js"></script>


</div>
Expand Down
17 changes: 17 additions & 0 deletions reference/control-flow/conditionals.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,22 @@ <h2 id="grammar-for-conditionals"><a class="header" href="#grammar-for-condition

</div>

<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>



Expand All @@ -278,6 +294,7 @@ <h2 id="grammar-for-conditionals"><a class="header" href="#grammar-for-condition
<script src="../book.js"></script>

<!-- Custom JS scripts -->
<script src="../theme/switcher.js"></script>


</div>
Expand Down
17 changes: 17 additions & 0 deletions reference/control-flow/labeled-control-flow.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,22 @@ <h1 id="labeled-control-flow"><a class="header" href="#labeled-control-flow">Lab

</div>

<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>



Expand All @@ -290,6 +306,7 @@ <h1 id="labeled-control-flow"><a class="header" href="#labeled-control-flow">Lab
<script src="../book.js"></script>

<!-- Custom JS scripts -->
<script src="../theme/switcher.js"></script>


</div>
Expand Down
17 changes: 17 additions & 0 deletions reference/control-flow/loops.html
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,22 @@ <h2 id="the-type-of-while-and-loop"><a class="header" href="#the-type-of-while-a

</div>

<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>



Expand All @@ -402,6 +418,7 @@ <h2 id="the-type-of-while-and-loop"><a class="header" href="#the-type-of-while-a
<script src="../book.js"></script>

<!-- Custom JS scripts -->
<script src="../theme/switcher.js"></script>


</div>
Expand Down
17 changes: 17 additions & 0 deletions reference/equality.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,22 @@ <h2 id="avoid-extra-copies"><a class="header" href="#avoid-extra-copies">Avoid E

</div>

<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>



Expand All @@ -364,6 +380,7 @@ <h2 id="avoid-extra-copies"><a class="header" href="#avoid-extra-copies">Avoid E
<script src="book.js"></script>

<!-- Custom JS scripts -->
<script src="theme/switcher.js"></script>


</div>
Expand Down
17 changes: 17 additions & 0 deletions reference/friends.html
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,22 @@ <h3 id="friend-declaration-rules"><a class="header" href="#friend-declaration-ru

</div>

<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>



Expand All @@ -331,6 +347,7 @@ <h3 id="friend-declaration-rules"><a class="header" href="#friend-declaration-ru
<script src="book.js"></script>

<!-- Custom JS scripts -->
<script src="theme/switcher.js"></script>


</div>
Expand Down
17 changes: 17 additions & 0 deletions reference/functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,22 @@ <h3 id="return-expression"><a class="header" href="#return-expression"><code>ret

</div>

<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>



Expand All @@ -501,6 +517,7 @@ <h3 id="return-expression"><a class="header" href="#return-expression"><code>ret
<script src="book.js"></script>

<!-- Custom JS scripts -->
<script src="theme/switcher.js"></script>


</div>
Expand Down
Loading

0 comments on commit 979296f

Please sign in to comment.