Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom highlights #425

Merged
merged 1 commit into from
Jun 30, 2016
Merged

Add custom highlights #425

merged 1 commit into from
Jun 30, 2016

Conversation

AlMcKinlay
Copy link
Member

No description provided.

@@ -227,6 +227,10 @@ $(function() {
var chan = chat.find(target);
var msg;

if (highlights.some((h) => data.msg.text.indexOf(h) > -1)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this support regex? Maybe if it starts with /

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels a bit unnecessary to include ES6 syntax - and effectively breaking 45 % of global browser market share - for something so small. Could be an opportunity to add babel transpilation though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove it for now, but I would really want to add babel at some point. We can use arrow functions on the server, but not the client, and it seems a massive shame to leave out such nice development tools just because rubbish browsers.

I have a little bit of an obsession with arrow functions just now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fully agree with that, @YaManicKill. Just not worth breaking browsers for a couple fat arrow functions just now :-)

@astorije astorije added the Type: Feature Tickets that describe a desired feature or PRs that add them to the project. label Jun 21, 2016
@@ -504,6 +511,10 @@ $(function() {
if (name === "userStyles") {
$(document.head).find("#user-specified-css").html(options[name]);
}
if (name === "highlights" ) {
var highlightString = options[name];
highlights = highlightString.split(",").map((h) => h.trim());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above re: ES6 on the client.

@AlMcKinlay AlMcKinlay force-pushed the yamanickill/custom-highlights branch from 5ebfd09 to 0c8aad0 Compare June 22, 2016 04:57
@AlMcKinlay
Copy link
Member Author

Fixed all comments, including the fun bug where if you didn't put any custom highlights, you were notified for everything.

@AlMcKinlay AlMcKinlay force-pushed the yamanickill/custom-highlights branch from 0c8aad0 to 9f3d690 Compare June 22, 2016 05:52
@astorije astorije self-assigned this Jun 23, 2016
@maxpoulin64
Copy link
Member

I find it a little weird that we now have highlights on both the client and the server, and it won't work very well in the future when we add push notifications and such. But I'll call it good enough for now so have a 👍


<div class="col-sm-12">
<label class="opt">
<label for="highlights" class="sr-only">Custom Highlights (separate by ",")</label>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest the following placeholder here and in the <input /> below:

Custom highlights (comma-separated keywords)

Reasoning is: no upper-casing of "highlight" to match other inputs/labels in this page, and using words instead of characters as 1) screen readers (at least VoiceOver) will not read them at all (it just reads "separated by") and the ',' looks weird, very packed on the default font.

@astorije
Copy link
Member

I agree with @maxpoulin64 but oh well, we'll refactor later :-)
I left a couple minor comments but great work otherwise! I'll give a final review after comments are addressed. Thanks for this @YaManicKill! 😄

@AlMcKinlay
Copy link
Member Author

I agree with both of you, but the only way to sort it out would be to put it on the server which is a bigger issue in itself.

Will address comments tomorrow.

@astorije
Copy link
Member

I agree with both of you, but the only way to sort it out would be to put it on the server which is a bigger issue in itself.

For sure! I think it was more of a general comment. I'm happy with the way you took here overall.

@xPaw
Copy link
Member

xPaw commented Jun 24, 2016

We will be able to move it to the server after @maxpoulin64's settings overhaul.

@AlMcKinlay
Copy link
Member Author

@xPaw Yeah, the only problem with that is that everything is an option to sync to the server, we would have to require custom highlights being synced for that to work. Is that something we want to do? I'm not sure, open to ideas.

@astorije
Copy link
Member

Hey @YaManicKill, any news on my 2 minor comments? :-)

@AlMcKinlay
Copy link
Member Author

AlMcKinlay commented Jun 29, 2016

I've been busy, I'll hopefully get that sorted tonight or tomorrow.

@AlMcKinlay AlMcKinlay force-pushed the yamanickill/custom-highlights branch from 9f3d690 to feda661 Compare June 29, 2016 18:04
@AlMcKinlay
Copy link
Member Author

Done :-)

@astorije
Copy link
Member

Awesome @YaManicKill, great job! 👍 and merging, Travis CI seems to have a hard time with the Mac builds...

@astorije astorije merged commit 0de9f61 into master Jun 30, 2016
@astorije astorije deleted the yamanickill/custom-highlights branch June 30, 2016 04:41
@xPaw xPaw added this to the 2.0.0 milestone Jul 2, 2016
@maxpoulin64 maxpoulin64 mentioned this pull request Jul 30, 2016
matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Tickets that describe a desired feature or PRs that add them to the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants