182 Commits

Author SHA1 Message Date
evykassirer
827b42dd9f typeahead: Replace substring with slice.
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-slice.md
2024-03-11 09:56:18 -07:00
evykassirer
d131f4119f typeahead: Remove unused hideOnEmpty option. 2024-03-11 09:56:18 -07:00
evykassirer
dc4244b9d8 typeahead: Rename e to event for legibility. 2024-03-11 09:56:18 -07:00
evykassirer
6d30e3e01c typeahead: Stop using deprecated window.event.
See https://developer.mozilla.org/en-US/docs/Web/API/Window/event
for more about this.
2024-03-11 09:56:18 -07:00
evykassirer
8986846436 typeahead: Remove unnecessary that = this.
This isn't needed with arrow functions.
2024-03-11 09:56:18 -07:00
evykassirer
331efb0def typeahead: Refactor to avoid no-case-declarations issue. 2024-03-11 09:56:18 -07:00
evykassirer
e12543f957 typeahead: Use const instead of let when not reassigned. 2024-03-11 09:56:18 -07:00
evykassirer
0a321f5e16 typeahead: Fix no-jquery/variable-pattern. 2024-03-11 09:56:18 -07:00
evykassirer
40b4db3323 typeahead: Refactor switch statements to avoid fallthrough. 2024-03-11 09:56:18 -07:00
evykassirer
ff1f62bc56 typeahead: Use ?? instead of ||. 2024-03-11 09:56:18 -07:00
evykassirer
64b262d514 typeahead: Replace empty backup functions with inline functions. 2024-03-11 09:56:18 -07:00
evykassirer
bb68dde1da typeahead: Use startsWith instead of a falsey index check. 2024-03-11 09:56:18 -07:00
evykassirer
b034875216 typeahead: Replace ~ operator with includes().
Before ES2016, `indexOf` and jQuery's `inArray`
were used more often. They return -1 for a missing
element, and 0 is the only integer that’s falsy, so
-1 is the only integer whose bitwise complement is
falsy. Using bitwise not (~) like this is no longer
common practice and is a lot more confusing to read.
Now that we have `includes` we can use that instead.
2024-03-11 09:56:18 -07:00
evykassirer
2085d90736 typeahead: Change unused expression to just function calls. 2024-03-11 09:56:18 -07:00
evykassirer
624a879b4e typeahead: Remove unused variables. 2024-03-11 09:56:18 -07:00
evykassirer
bcdde201ec typeahead: Use !== instead of !=. 2024-03-11 09:56:18 -07:00
evykassirer
7ccb833b35 typeahead: Run prettier for automatic format cleanup. 2024-03-11 09:56:18 -07:00
evykassirer
99ee72860e typeahead: Run eslint for automatic format cleanup. 2024-03-11 09:56:18 -07:00
Anders Kaseorg
1118b2cc19 web: Convert uses of deprecated text-field-edit function aliases.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-29 13:24:27 -08:00
Karl Stolley
29dd61c20c bootstrap: Remove pre styles.
Happily, every last CSS property in these styles is already
described for the places <pre> appears in the Zulip UI:

1. In rendered message markdown
2. In the compose preview
3. In the information overlay (Message formatting)
2024-02-19 18:15:26 -08:00
Karl Stolley
384e28c8e2 bootstrap: Remove li style.
The `line-height` value is set to `inherit` in zulip.css, rendering
this line moot. `inherit` will always force list items to take
their line height from the nearest ancestor that sets one.
2024-02-19 17:53:50 -08:00
Karl Stolley
6073507230 bootstrap: Remove q styles.
There is no evidence of the <q> (quote) element in use in the
Zulip UI, nor that any of the Python-Markdown syntax generates them
either.
2024-02-19 17:51:10 -08:00
Karl Stolley
9c77300c5a bootstrap: Remove body selectors, zero margin/padding explicitly. 2024-02-15 10:31:29 -08:00
Karl Stolley
79959573bd bootstrap: Remove unnecessary root properties.
* `font-size: 100%` is unnecessary, as `font-size: 16px` is set on
  the `body` selector.
* `text-size-adjust` is unnecessary, as supporting browsers appear
  to use `100%` as a default value anyway.
2024-02-15 10:31:29 -08:00
Aman Agrawal
da7cb0af1c bootstrap: Remove unused dropdown toggle class definitions. 2024-02-03 17:20:28 -08:00
Aman Agrawal
ea2bd14480 bootstrap: Remove duplicate invisible class.
The same definition is already present app_components.css, so
we don't need it here.
2024-02-02 11:00:35 -08:00
evykassirer
07234f6a31 marked: Stub marked and convert markdown module to typescript. 2024-02-01 12:12:06 -08:00
Sahil Batra
5f82bf0002 css: Remove bootstrap css for "fade" class.
We do not use "fade" class in our app anymore so we can
remove its CSS from boostrap.app.css.
2024-01-29 09:55:32 -08:00
Tim Abbott
41fa2e7174 css: Remove unused portico tab-content CSS rules. 2024-01-28 16:08:30 -08:00
Tim Abbott
065dc8fc5d css: Remove several unused Bootstrap rules from portico. 2024-01-28 16:08:30 -08:00
Tim Abbott
b44c3d321d css: Delete unused Bootstrap close rules from portico. 2024-01-28 16:08:30 -08:00
Tim Abbott
00aa0631fe css: Move Bootstrap alerts CSS to separate file. 2024-01-28 16:08:30 -08:00
Tim Abbott
db9ee6237e css: Remove portico copy of Bootstrap typeahead CSS.
We don't use the typeahead component in portico pages.
2024-01-28 16:08:30 -08:00
Tim Abbott
56a884e0be css: Extract Bootstrap Typeahead CSS to its own file. 2024-01-28 16:08:30 -08:00
Tim Abbott
73aca658f6 css: Remove unused Bootstrap dropdown-backdrop rules. 2024-01-28 16:08:30 -08:00
Tim Abbott
4395c54c23 css: Remove unused Bootstrap CSS for nav elements. 2024-01-28 16:08:30 -08:00
Tim Abbott
ee97d018af css: Remove unused Bootstrap dropup CSS. 2024-01-28 16:08:30 -08:00
Tim Abbott
3818969f04 css: Remove overridden body styles from app. 2024-01-28 16:08:30 -08:00
Tim Abbott
98637e3a88 css: Remove unused Bootstrap text-* styles from app. 2024-01-28 16:08:30 -08:00
Tim Abbott
49ff0dc2e2 css: Remove unused row/container CSS from app. 2024-01-28 16:08:30 -08:00
Tim Abbott
25d7740b26 css: Remove dead Bootstrap CSS from app.
The only reference to any of these was in a comment.
2024-01-28 16:08:30 -08:00
Karl Stolley
f07dae6b25 bootstrap: Fork CSS into app, portico copies.
This aims to reduce the cognitive overhead of doing Bootstrap CSS
cleanup by concerning contributors only with Zulip or the portico.
2024-01-28 15:07:36 -08:00
Sahil Batra
3fc2bccc21 bootstrap: Remove css for btn-link elements.
We currently use btn-link class only in buttons used for
changing email and password in account settings panel and
for we already bootstrap CSS rules for those so we can
safely remove the CSS rules in bootstrap-btn.css.
2024-01-26 09:10:09 -08:00
Tim Abbott
371dea3f0d css: Remove unused btn-info styles. 2024-01-25 18:35:38 -08:00
Tim Abbott
ee9a9bfa98 css: Remove unused btn-block styles.
The (unfinished) two-factor UI isn't designed at all, so we can just
remove the classes from it.
2024-01-25 18:35:38 -08:00
Tim Abbott
f04b54ff47 css: Remove unused boostrap nav-header styles. 2024-01-25 18:35:38 -08:00
Tim Abbott
4b6b1da83c bootstrap: Remove now-unused tabs JS component.
This was the last bootstrap.js feature, so we finally get to remove
the whole module.
2024-01-25 18:35:38 -08:00
Tim Abbott
f105c6b12e css: Remove unused Bootstrap nav-tabs styles. 2024-01-25 18:35:38 -08:00
N-Shar-ma
0003c3c1ef typeahead: Fix bug where typeahead showed momentarily on shift + tab.
Since the keyup event for keys including shift triggers the typeahead,
shift tabbing into the topic recipient field would show the typeahead
momentarily, which is distracting.

As we need typeahead to trigger on shift for certain use cases in the
compose box, but not in the topic recipient field, we now do not trigger
typeahead on shift keyup events in the topic recipient field.

Fixes: #24152.
2024-01-25 11:12:26 -08:00
Anders Kaseorg
118cfbea65 typeahead: Remove insecure default highlighter implementation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-24 17:46:56 -08:00