diff --git a/docs/static/js/search.js b/docs/static/js/search.js
@@ -174,8 +174,11 @@
trigger.addEventListener("click", open);
+ /* Ctrl/⌘+S. This takes the shortcut away from the browser's Save Page,
+ deliberately: on a documentation site nobody is saving the HTML, and the
+ key is the one people already reach for. */
document.addEventListener("keydown", function (e) {
- if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k") {
+ if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "s") {
e.preventDefault();
dialog.open ? dialog.close() : open();
}
@@ -202,5 +205,5 @@
/* The shortcut hint is written here, not in the template, because it is a
property of the reader's keyboard rather than of the page. */
var mac = /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
- trigger.querySelector("kbd").textContent = mac ? "⌘K" : "Ctrl K";
+ trigger.querySelector("kbd").textContent = mac ? "⌘S" : "Ctrl S";
})();
diff --git a/docs/templates/base.html b/docs/templates/base.html
@@ -46,7 +46,9 @@
<div class="tools">
<button id="search-trigger" class="search-trigger" type="button"
data-index="/search-{{ page.language }}.json">
- <span>{{ "검색" if ko else "Search" }}</span><kbd>Ctrl K</kbd>
+ {#- The label is replaced with the reader's own modifier by search.js;
+ this is the value someone with JavaScript off sees. #}
+ <span>{{ "검색" if ko else "Search" }}</span><kbd>Ctrl S</kbd>
</button>
{%- for t in page.translations %}
<a href="{{ t.url }}" hreflang="{{ t.code }}">{{ t.name }}</a>
|