1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-16 14:17:34 +02:00

Automatically format YAML, CSS, and JS files (#1272)

Initially, I also formatted the templates in `theme/`, but this triggers
https://github.com/prettier/prettier/issues/11834. So I exclude them for
now.

---------

Co-authored-by: Ming-Ying Chung <mych@chromium.org>
This commit is contained in:
Martin Geisler
2023-10-02 07:48:00 +02:00
committed by GitHub
parent 4e768e2e36
commit 42541fc401
5 changed files with 52 additions and 47 deletions

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
(function() {
(function () {
let notes = document.querySelector("details");
// Create an unattached DOM node for the code below.
if (!notes) {
@ -32,7 +32,7 @@
// Update the window. This shows/hides controls as necessary for regular and
// speaker note pages.
function applyState() {
function applyState() {
if (window.location.hash == "#speaker-notes-open") {
if (getState() != "popup") {
markDefunct();
@ -116,9 +116,11 @@
setState("popup");
applyState();
} else {
window.alert("Could not open popup, please check your popup blocker settings.");
window.alert(
"Could not open popup, please check your popup blocker settings."
);
}
})
});
let popOutIcon = document.createElement("i");
popOutIcon.classList.add("fa", "fa-external-link");
popOut.append(popOutIcon);
@ -179,9 +181,11 @@
}
// Update prev/next buttons to keep speaker note state.
document.querySelectorAll('a[rel="prev"], a[rel="next"]').forEach((elem) => {
elem.href += "#speaker-notes-open";
});
document
.querySelectorAll('a[rel="prev"], a[rel="next"]')
.forEach((elem) => {
elem.href += "#speaker-notes-open";
});
}
let timeout = null;