Ivan Asmer 5 лет назад
Родитель
Сommit
3812455f22
1 измененных файлов с 0 добавлено и 46 удалено
  1. 0 46
      index.html

+ 0 - 46
index.html

@@ -12,52 +12,6 @@
         <script>
             const socket = io()
 
-            function Inputs(el, onSend){
-                const nickInput = document.createElement('input')
-                nickInput.type  = 'text'
-                nickInput.placeholder = 'Nick'
-
-
-                const messageInput = document.createElement('input')
-                messageInput.type  = 'text'
-                messageInput.placeholder  = 'Message'
-
-                const button = document.createElement('button')
-                button.innerText = 'Send'
-
-                button.onclick = () => {
-                    onSend(nickInput.value, messageInput.value)
-                }
-
-
-                messageInput.oninput = () => {
-                    if (typeof this.validate === 'function'){
-                        button.disabled = !this.validate(nickInput.value, messageInput.value)
-                    }
-                }
-
-                nickInput.oninput = messageInput.oninput
-
-                el.appendChild(nickInput)
-                el.appendChild(messageInput)
-                el.appendChild(button)
-
-                this.getNick = () => nickInput.value
-                this.getMessage = () => messageInput.value
-
-
-            }
-
-            const form = new Inputs(formContainer, function(nick, message){
-                socket.emit('msg', {nick, message})
-            })
-            form.validate = (n, m) => n && m
-            console.log(form)
-
-/*            setInterval(() =>{
-                console.log(form.getMessage())
-            }, 1000) */
-
         </script>
     </body>
 </html>