-
Notifications
You must be signed in to change notification settings - Fork 12
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
522 chat click links #537
Conversation
…delimiters of HyperLinkLabel that he can build clickable links out of it. and add the eventlistener to open the link in browser
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]"); |
There was a problem hiding this comment.
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) -> { |
There was a problem hiding this comment.
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.
gonna check this |
… into 522_chat_click_links
…ct to simplify the text flow wrapping stuff
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(); |
There was a problem hiding this comment.
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>> { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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
feedback from po for the links:
|
and the new message indicator does never disappear with this code |
} | ||
} | ||
|
||
private boolean hasValidTld(URI uri) throws URISyntaxException { |
There was a problem hiding this comment.
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.
resolves #522