diff --git a/public/src/components/Editor/Editor.sass b/public/src/components/Editor/Editor.sass index a0b696fc..cbb12c90 100644 --- a/public/src/components/Editor/Editor.sass +++ b/public/src/components/Editor/Editor.sass @@ -61,7 +61,14 @@ content: "Введите '/' для комманд" color: rgba(255, 255, 255, 0.7) cursor: text - //animation: showAnim 0.5s + animation: fadeIn 0.3s + + @keyframes fadeIn + 0% + opacity: 0 + + 99% + opacity: 1 .subnote-wrapper background: $modal-background @@ -70,6 +77,7 @@ transition: 0.2s ease border: 1px solid #2b3b55 margin: 15px 2px + user-select: none &:hover cursor: pointer diff --git a/public/src/components/LinkInput/LinkInput.tsx b/public/src/components/LinkInput/LinkInput.tsx index 8d715688..138dc1d4 100644 --- a/public/src/components/LinkInput/LinkInput.tsx +++ b/public/src/components/LinkInput/LinkInput.tsx @@ -23,11 +23,20 @@ export class LinkInput extends ScReact.Component { handleSubmit = () => { if (this.state.value) { + console.log(this.isUrlValid(this.state.value)) this.props.onSubmit(this.state.value); this.clearValue(); } }; + isUrlValid(userInput) { + let res = userInput.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g); + if (res == null) + return false; + else + return true; + } + render() { return (