mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Integrate word wrapping filter in the chat component.
This commit is contained in:
parent
c6334ffab7
commit
ff62e50530
4 changed files with 8 additions and 2 deletions
|
@ -45,7 +45,7 @@ aside.chat(
|
||||||
mathjax,
|
mathjax,
|
||||||
ng-repeat="content in message.contents track by $index"
|
ng-repeat="content in message.contents track by $index"
|
||||||
)
|
)
|
||||||
span(ng-bind-html="content | linky:'_blank'")
|
span(ng-bind-html="content | linky:'_blank' | wrapLongWords")
|
||||||
|
|
||||||
.new-message
|
.new-message
|
||||||
textarea(
|
textarea(
|
||||||
|
|
|
@ -7,7 +7,7 @@ define [
|
||||||
minLength = minLength || DEF_MIN_LENGTH
|
minLength = minLength || DEF_MIN_LENGTH
|
||||||
|
|
||||||
findWordsRegEx = new RegExp "\\w{#{minLength},}", "g"
|
findWordsRegEx = new RegExp "\\w{#{minLength},}", "g"
|
||||||
wrappingTemplate = "<#{wrapperElName} style='word-break: break-all;'>$&</#{wrapperElName}>"
|
wrappingTemplate = "<#{wrapperElName} class=\"break-word\">$&</#{wrapperElName}>"
|
||||||
|
|
||||||
baseStr.replace findWordsRegEx, wrappingTemplate
|
baseStr.replace findWordsRegEx, wrappingTemplate
|
||||||
|
|
||||||
|
|
|
@ -3,4 +3,5 @@ define [
|
||||||
"ide/chat/controllers/ChatController"
|
"ide/chat/controllers/ChatController"
|
||||||
"ide/chat/controllers/ChatMessageController"
|
"ide/chat/controllers/ChatMessageController"
|
||||||
"ide/chat/directives/mathjax"
|
"ide/chat/directives/mathjax"
|
||||||
|
"filters/wrapLongWords"
|
||||||
], () ->
|
], () ->
|
|
@ -129,6 +129,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.break-word {
|
||||||
|
word-break: break-all;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
.editor-dark {
|
.editor-dark {
|
||||||
.chat {
|
.chat {
|
||||||
.new-message {
|
.new-message {
|
||||||
|
|
Loading…
Reference in a new issue