Commit Graph

52 Commits

Author SHA1 Message Date
Pavel Djundik
e3ff385ae0 Remove HTML version of parse() 2019-02-12 12:48:43 +02:00
Pavel Djundik
d83dcc35e2 Port 'more' button in previews to Vue 2019-02-12 12:48:43 +02:00
Pavel Djundik
1cd28a5ccf Fix sending msg:preview:toggle to server 2019-02-12 12:48:43 +02:00
Pavel Djundik
2bb8287519 Render preview toggle in Vue 2019-02-12 12:48:43 +02:00
Pavel Djundik
ebfc6fa724 Create elements instead of using raw HTML 2019-02-12 12:48:43 +02:00
Pavel Djundik
ebda927bb1 Render toggle button after links 2019-02-12 12:48:43 +02:00
Pavel Djundik
771739cf94 Port ignore list to Vue 2019-02-12 12:48:42 +02:00
Pavel Djundik
d19c00faab Build clean text message only once 2018-05-01 14:32:13 +03:00
Pavel Djundik
162b801839 Move part sorting to merge 2018-05-01 14:31:46 +03:00
Pavel Djundik
73b1124dce Fix nicks with special characters being colored incorrectly in messages
Fixes #2362
2018-04-16 14:45:08 +03:00
Max Leiter
01753a814c Improve accessibility for emoji 2018-03-18 12:13:48 -07:00
Pavel Djundik
c733e72e7a Auto-fix code for padding-line-between-statements rule 2018-02-20 09:28:04 +02:00
Logan Griswold
f07c1bef69
#1755 - implement monospace formatting with keybinding, tests, and help section 2017-12-03 15:10:46 -05:00
Logan Griswold
0643d3b4a3
#1754 - implement strikethrough formatting, client keybinding, tests, and help section 2017-12-03 15:10:34 -05:00
Jérémie Astori
b53f1719eb
Merge pull request #1749 from thelounge/astorije/avoid-escape-quotes
Avoid escaping quotes whenever possible
2017-11-27 12:57:55 -05:00
Max Leiter
3d31fa4686 Link nicks mentioned in messages 2017-11-27 09:10:56 -08:00
Jérémie Astori
287c3a8223
Avoid escaping quotes whenever possible
Our `.eslintrc.yml` configuration file already allows for avoiding escape (see [ESLint doc for `avoidEscape`](https://eslint.org/docs/rules/quotes#avoidescape)) so we might as well use it. We already use this in a few places I believe.
2017-11-26 17:34:28 -05:00
Bonuspunkt
0e52b133af Sending channel and link together generates duplicate text 2017-11-26 21:33:27 +02:00
Mac Carrithers
f8663ed28b Parse emoji to make them bigger 2017-08-24 11:54:28 +03:00
Jérémie Astori
a13c08a45b
Enforce correct order for previews on server-side prefectch rather than at client parsing
This has the benefit of not adding `.preview` divs everywhere, anytime we use `parse()`, and also to un-tie the position of the preview blocks from the result of the helper. This means that templates that call `parse` and have some extra markup after that are not constrained anymore.

This is effectively an alternative, better way to fix https://github.com/thelounge/lounge/issues/1343, but the initial fix that was put in place (https://github.com/thelounge/lounge/pull/1347) is still relevant, for example to make sure a preview stays hidden (and does not add extra margin/padding/etc.) if the link does not prefetch.
2017-07-21 01:06:42 -04:00
Jérémie Astori
28200830ed
Move preview toggle buttons next to their respective URLs and switch from ellipsis to caret 2017-07-08 04:36:26 -04:00
Jérémie Astori
64ebe0f437
Support multiple previews per message
- Load up to 5 previews per message (to avoid abuse)
- Do not load multiple times the same URL
- Prepare preview containers per message instead of appending (to maintain correct order)
- Store an array of previews instead of a single preview in `Msg` objects
- Consolidate preview rendering for new messages and upon refresh/load history (when rendering entire channels)
- Update `parse` tests to reflect previous point
- Add test for multiple URLs
- Switch preview tests from `assert` API to `expect` API
2017-07-08 04:34:12 -04:00
Pavel Djundik
f6dd616d5e Update to eslint 4 and enforce extra rules 2017-06-19 09:58:29 +03:00
Pavel Djundik
0b645d54c6 Add support for 0x04 hex colors
Ref: https://modern.ircdocs.horse/formatting.html#hex-color
2017-04-29 09:50:26 +03:00
Jérémie Astori
03e3444a35 Explain the modules of the message parser and add tests
- Add comments and descriptions to:
  - `findChannels.js`
  - `parseStyle`
  - `findLinks`
  - `fill`
  - `anyIntersection`
  - `merge`
  - `parse`
- Minor optimizations to `parseStyle`
- Add tests for `fill`
2017-04-21 20:31:27 +03:00
Jérémie Astori
90f4a94bb2 Use template literals in parse
Also make it output double quotes for consistency with web stuff.
2017-04-21 20:31:27 +03:00
Jérémie Astori
5b4c00d8ca Extract findLinks into its own file and add tests
Tests were taken from 5a249c30b1/test/findLinks.js.
The underlying code is different but the tests are the same.
2017-04-21 20:31:27 +03:00
Bonuspunkt
0b85ded53f Add bonuspunkt's parser
Fixes #15.
Fixes #199.
Fixes #583.
Fixes #654.
Fixes #928.
Fixes #1001.
2017-04-21 20:29:04 +03:00
Jérémie Astori
4363ef4abe Merge pull request #973 from thelounge/xpaw/use-require
Use require() instead of import in client code
2017-03-31 01:41:29 -04:00
Pavel Djundik
3b2e3fc08c Enforce more space and new line rules 2017-03-18 21:40:39 +02:00
Pavel Djundik
dcefcd19cb Use require() instead of import in client code
Closes #895
2017-03-18 11:21:18 +02:00
Pavel Djundik
fb87bd3a58 Webpack 2016-12-27 19:15:30 +02:00
Pavel Djundik
aa02fd5180 Enforce more eslint rules 2016-10-09 17:55:37 -04:00
Jérémie Astori
caa46042bf Enforce strict mode across all JS files with ESLint
Several ES6 additions are only available in strict mode. Example:
> SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

Strict mode was also enabled in a few of our files already, and it is a good thing to have anyway.
2016-10-09 15:14:02 -04:00
Pavel Djundik
a94b9623f9 Prepend http protocol to www. links in chat
Fixes #406
2016-06-16 17:40:02 +03:00
Pavel Djundik
876ce4bc6e Do not ignore our handlebars plugins in eslint 2016-05-12 16:07:15 +03:00
Pavel Djundik
d143542fe5 Add security headers to minimize XSS damage 2016-05-06 11:08:45 +03:00
Pavel Djundik
2bb3951476 Fix message and topic text wrapping 2016-03-22 18:04:34 +02:00
Pavel Djundik
56e1d3fac7 Correctly handle inline channels in messages
Fixes #15 and #11
2016-03-01 11:06:14 +02:00
Pavel Djundik
cd92d1640e Simply parse all 0-99 irc colors 2016-01-24 15:57:44 +02:00
Graeme
2274f92833 Update styled items class names 2014-12-10 22:35:17 -05:00
Graeme
635646b0f3 🎊 full mirc colour+style compliance 2014-12-10 06:30:45 -05:00
Mattias Erming
a0ed791926 Merge pull request #263 from megawac/style-parser 2014-10-27 22:52:37 +01:00
Mattias Erming
277887382c Merge pull request #253 from codl/fix/bold+color+url
Fix urls preventing proper closure of bold and color tags
2014-10-27 22:48:45 +01:00
megawac
3d5e070c56 Support nested colours 2014-10-25 15:16:54 -04:00
megawac
fbe43b3b7a Fix indentation 2014-10-25 15:07:15 -04:00
megawac
a53544b44a Support MIRC style terminators (^O) 2014-10-25 15:02:12 -04:00
Corentin Delcourt
44c20b327d fix urls preventing proper closure of bold and color tags 2014-10-20 13:28:29 +02:00
Mattias Erming
5b1820ca2e Fix message parser 2014-10-12 01:53:13 +02:00
Mattias Erming
1b476bfefd Edit color parser 2014-10-11 19:38:53 +02:00