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

522 chat click links #537

Merged
merged 19 commits into from
Oct 27, 2016
Merged

522 chat click links #537

merged 19 commits into from
Oct 27, 2016

Conversation

nnice
Copy link
Contributor

@nnice nnice commented Oct 13, 2016

resolves #522

…delimiters of HyperLinkLabel that he can build clickable links out of it. and add the eventlistener to open the link in browser
@nnice nnice self-assigned this Oct 13, 2016
@nnice nnice added the WIP label Oct 13, 2016
String regex = "(https?:\\/\\/(?:www\\.|(?!www))[^\\s\\.]+\\.[^\\s]{2,}|www\\.[^\\s]+\\.[^\\s]{2,})";
Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE | Pattern.COMMENTS | Pattern.MULTILINE);
Matcher matcher = pattern.matcher(message);
String result = matcher.replaceAll("[$1]");
Copy link
Member

@audax audax Oct 14, 2016

Choose a reason for hiding this comment

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

Extract this replace stuff to a different place, it shouldn't be in a renderer.

public Consumer<String> browserOpener;

public PlaintextMessageRenderer() {
browserOpener = (uri) -> {
Copy link
Member

Choose a reason for hiding this comment

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

You can also initialize it inline where you declare the member. Functionally it is identical.

A better way do to this is imho to create a dedicated browser opener interactor and replace the real one, which has Desktop.getDesktop() stuff, with a testable browser opener.

@nnice nnice removed the WIP label Oct 17, 2016
@nnice nnice removed the WIP label Oct 18, 2016
@julianseeger
Copy link
Collaborator

what's the state here?
Linewrapping doesn't work anymore as far as I can tell:
image

@nnice
Copy link
Contributor Author

nnice commented Oct 18, 2016

gonna check this

@nnice nnice removed the WIP label Oct 19, 2016
@nnice nnice added the WIP label Oct 21, 2016
@julianseeger julianseeger mentioned this pull request Oct 25, 2016
nnice and others added 3 commits October 25, 2016 16:11
add the alias into the textflow
some text wrap wont work gonna check on it later
fully replaced old chat stuff
@@ -118,7 +118,7 @@ private void showLayoutStage() {
Scene layoutScene = new Scene(view, 900, 600, true, SceneAntialiasing.BALANCED);
Platform.runLater(() -> primaryStage.setScene(layoutScene));
primaryStage.show();
closeStage();
// closeStage();
Copy link
Collaborator

Choose a reason for hiding this comment

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

needs to be activated again

import java.util.Collections;
import java.util.List;

class QabelChatSkin extends BehaviorSkinBase<QabelChatLabel, BehaviorBase<QabelChatLabel>> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove this legacy code

@@ -458,28 +486,6 @@ VBox.spaced, HBox.spaced {
-fx-border-width: 0 0 1px 0;
}

.hyperlink {
Copy link
Collaborator

Choose a reason for hiding this comment

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

where has this been used before? seems like there are links in the gui now that are no more visible as links...

Copy link
Collaborator

Choose a reason for hiding this comment

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

was in the about screen but isn't used anymore

@julianseeger
Copy link
Collaborator

feedback from po for the links:

  • every scheme should be detected (like ftp://example.org)
  • every url without a scheme should be detected IF it has a valid TLD

@julianseeger julianseeger self-assigned this Oct 26, 2016
@julianseeger
Copy link
Collaborator

and the new message indicator does never disappear with this code

@julianseeger julianseeger removed the WIP label Oct 27, 2016
@julianseeger
Copy link
Collaborator

image

and it only took two regular expressions...

audax
audax previously requested changes Oct 27, 2016
}
}

private boolean hasValidTld(URI uri) throws URISyntaxException {
Copy link
Member

Choose a reason for hiding this comment

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

I really think that filtering out unknown TLDs is not a good idea.

@audax audax dismissed their stale review October 27, 2016 13:51

Po likes TLD filtering.

@julianseeger julianseeger merged commit e8d041e into Qabel:master Oct 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clickable links in chat
4 participants