Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

help-docs: Remove `mac-cmd-style` CSS rule.

Lauryn Menard32d396fdc7e3
diff --git a/frontend_tests/node_tests/common.js b/frontend_tests/node_tests/common.js
index c43e21d8731..25997d0db42 100644
--- a/frontend_tests/node_tests/common.js
+++ b/frontend_tests/node_tests/common.js
@@ -88,8 +88,8 @@ run_test("adjust_mac_shortcuts non-mac", ({override_rewire}) => {
common.adjust_mac_shortcuts("selector-that-does-not-exist");
});
-// Test non-default values of adjust_mac_shortcuts boolean parameters:
-// `kbd_elem = false`, and `require_cmd_style = true`.
+// Test non-default value of adjust_mac_shortcuts boolean parameter:
+// `kbd_elem = false`.
run_test("adjust_mac_shortcuts mac non-defaults", ({override_rewire}) => {
const keys_to_test_mac = new Map([
["Backspace", "Delete"],
@@ -118,7 +118,6 @@ run_test("adjust_mac_shortcuts mac non-defaults", ({override_rewire}) => {
const test_item = {};
const $stub = $.create("hotkey_" + key_no);
$stub.text(old_key);
- assert.equal($stub.hasClass("mac-cmd-key"), false);
if (fn_shortcuts.has(old_key)) {
$stub.before = ($elem) => {
assert.equal($elem, inserted_fn_key);
@@ -126,7 +125,6 @@ run_test("adjust_mac_shortcuts mac non-defaults", ({override_rewire}) => {
}
test_item.$stub = $stub;
test_item.mac_key = mac_key;
- test_item.is_cmd_key = old_key === "Ctrl";
test_items.push(test_item);
key_no += 1;
}
@@ -135,18 +133,16 @@ run_test("adjust_mac_shortcuts mac non-defaults", ({override_rewire}) => {
$.create(".markdown_content", {children});
- const require_cmd = true;
const kbd_element = false;
- common.adjust_mac_shortcuts(".markdown_content", kbd_element, require_cmd);
+ common.adjust_mac_shortcuts(".markdown_content", kbd_element);
for (const test_item of test_items) {
- assert.equal(test_item.$stub.hasClass("mac-cmd-key"), test_item.is_cmd_key);
assert.equal(test_item.$stub.text(), test_item.mac_key);
}
});
-// Test default values of adjust_mac_shortcuts boolean parameters:
-// `kbd_elem = true`, and `require_cmd_style = false`.
+// Test default value of adjust_mac_shortcuts boolean parameter:
+// `kbd_elem = true`.
run_test("adjust_mac_shortcuts mac defaults", ({override_rewire}) => {
const keys_to_test_mac = new Map([
["Backspace", "Delete"],
@@ -172,7 +168,6 @@ run_test("adjust_mac_shortcuts mac defaults", ({override_rewire}) => {
const test_item = {};
const $stub = $.create("hotkey_" + key_no);
$stub.text(old_key);
- assert.equal($stub.hasClass("mac-cmd-key"), false);
if (fn_shortcuts.has(old_key)) {
$stub.before = ($elem) => {
assert.equal($elem, inserted_fn_key);
@@ -191,7 +186,6 @@ run_test("adjust_mac_shortcuts mac defaults", ({override_rewire}) => {
common.adjust_mac_shortcuts(".hotkeys_table kbd");
for (const test_item of test_items) {
- assert.equal(test_item.$stub.hasClass("mac-cmd-key"), false);
assert.equal(test_item.$stub.text(), test_item.mac_key);
}
});
diff --git a/static/js/common.ts b/static/js/common.ts
index 4184a71eecd..02b3363aa81 100644
--- a/static/js/common.ts
+++ b/static/js/common.ts
@@ -48,11 +48,7 @@ export function has_mac_keyboard(): boolean {
return /mac/i.test(navigator.platform);
}
-export function adjust_mac_shortcuts(
- key_elem_class: string,
- kbd_elem = true,
- require_cmd_style = false,
-): void {
+export function adjust_mac_shortcuts(key_elem_class: string, kbd_elem = true): void {
if (!has_mac_keyboard()) {
return;
}
@@ -81,10 +77,6 @@ export function adjust_mac_shortcuts(
return;
}
- if (key_text === "Ctrl" && require_cmd_style) {
- $(this).addClass("mac-cmd-key");
- }
-
if (fn_shortcuts.has(key_text)) {
if (kbd_elem) {
$(this).before("<kbd>Fn</kbd> + ");
diff --git a/static/js/portico/help.js b/static/js/portico/help.js
index 87fe888fb07..bf300b06e0b 100644
--- a/static/js/portico/help.js
+++ b/static/js/portico/help.js
@@ -58,7 +58,7 @@ function render_code_sections() {
highlight_current_article();
- common.adjust_mac_shortcuts(".markdown .content code", false, true);
+ common.adjust_mac_shortcuts(".markdown .content code", false);
$("table").each(function () {
$(this).addClass("table table-striped");
diff --git a/static/styles/portico/portico.css b/static/styles/portico/portico.css
index 7a619a58499..c6964beda6f 100644
--- a/static/styles/portico/portico.css
+++ b/static/styles/portico/portico.css
@@ -23,11 +23,6 @@ html {
text-align: center;
}
-.mac-cmd-key {
- font-size: 15px;
- font-family: monospace;
-}
-
.normal {
font-weight: normal;
}