Comments (7)
Duplicate of #6
from hermes.
Duplicate of #6
In the end, although #6 had two parts, we only implemented the second one and not this one.
from hermes.
mentioning would just be quoting without the reference message, right? Couldn't we just extend the quote regex and update on the GUI?
from hermes.
Yes, probably that could be the solution
from hermes.
I will look into it
from hermes.
Another option would be to add another regex (@([^ ]+)
for example), check if the matched string is in the user_colors
object, and if it is replace the whole thing with a formatted version of the string:
<b style="color: #color">regex[1]</b>
(This isn't the exact code we should use as this is XSS vulnerable and can be VERY optimized, but the idea should be more or less similar)
EDIT: A better version using JQuery could be this:
let regex = message.match(/@([^ ]+)/) [1]
$('<b>').css('color', user_colors[regex].color).text(regex)
from hermes.
Most of the work has been done in 3a28db4, but there are still some things left to be done.
from hermes.
Related Issues (20)
- Document all the code
- Port to typescript HOT 2
- Get all members of a channel's settings when switching to that channel
- Login sometimes does not work HOT 2
- unescape `&` in links & images (I think both are affected) HOT 1
- Don't show spoilers in quotes HOT 1
- Implement buckets for loading messages
- Implement sharing API HOT 2
- Login doesn't work on testing HOT 2
- Add gossip between servers HOT 2
- Add stickers
- Message textarea grows when writing 1 line on firefox HOT 2
- Website itself not working; how to set up a server personally? HOT 3
- Implement IndexedDB API HOT 1
- Add support to upload images to hermes HOT 3
- Clear quotes when changing channels
- Go to bottom button appears on top of input
- Add channel specific alerts about catastrophes HOT 1
- The API doesn't check whether a user is in a channel before processing the request HOT 4
- Users going to the joinchannel link should be prompted to log in if they haven't already HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hermes.