From 0fb5e5df1094f6de4cec26ab57c08cd410427519 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 29 Dec 2020 07:58:44 +0000 Subject: [PATCH] remove chat web files --- static-data/www/chat/css/convos.css | 66 --------------- static-data/www/chat/index.html | 106 ------------------------ static-data/www/chat/js/change-convo.js | 6 -- static-data/www/chat/js/main.js | 77 ----------------- static-data/www/chat/js/message-feed.js | 25 ------ static-data/www/chat/js/messages.js | 36 -------- static-data/www/chat/js/resizes.js | 24 ------ 7 files changed, 340 deletions(-) delete mode 100644 static-data/www/chat/css/convos.css delete mode 100755 static-data/www/chat/index.html delete mode 100644 static-data/www/chat/js/change-convo.js delete mode 100755 static-data/www/chat/js/main.js delete mode 100644 static-data/www/chat/js/message-feed.js delete mode 100644 static-data/www/chat/js/messages.js delete mode 100644 static-data/www/chat/js/resizes.js diff --git a/static-data/www/chat/css/convos.css b/static-data/www/chat/css/convos.css deleted file mode 100644 index 3606ea18..00000000 --- a/static-data/www/chat/css/convos.css +++ /dev/null @@ -1,66 +0,0 @@ -.conversationList li{ - list-style: none; - padding-top: 1em; -} - -.convoListContainer{ - margin-left: 1%; - border-radius: 5px; - border: 1px solid black; - overflow-y: scroll; -} - -.chatContent{ - padding-right: 5%; -} - -.connectStatus{ - float: right; -} - -.friendsTitle{ - text-align: center; - display: block; -} - -/* -.chatInput{ - position: fixed; - bottom: 0; -} -*/ -.chatInput{ - margin-top: -3em; -} -.chatInput textarea{ - resize: none; -} -.chatInput textarea::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */ - color: black; - opacity: 1; /* Firefox */ -} - -.from{ - margin-top: 1em; - display: block; - padding-bottom: 0.5em; -} - -.chatFeed{ - display: block; - max-height: 500px; - overflow-y: scroll; - min-height: 100%; - padding-top: 4em; - transform: rotate(180deg); - direction: rtl; - } - -.messageEntry{ - transform: rotate(180deg); - direction: ltr; -} - -#messageEntryTemplate{ - display: none; -} \ No newline at end of file diff --git a/static-data/www/chat/index.html b/static-data/www/chat/index.html deleted file mode 100755 index 7cc21e9c..00000000 --- a/static-data/www/chat/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - Onionr Chat - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-

- Onionr Chat -

-

- Instant Messaging -

-
-
-
-
-

- Identity -

-

- -

-

- Copy -

-
-
-
-
-
-
-
- -
- Jenny -
I'll stay right here
-
-
- -
-
- Friends -
-
    -
    -
    - - -
    -

    - -

    -
    -
    -
    - - - \ No newline at end of file diff --git a/static-data/www/chat/js/change-convo.js b/static-data/www/chat/js/change-convo.js deleted file mode 100644 index c35de6bb..00000000 --- a/static-data/www/chat/js/change-convo.js +++ /dev/null @@ -1,6 +0,0 @@ -var conversationListElements = document.getElementsByClassName('conversationList') -for (i = 0; i < conversationListElements.length; i++){ - conversationListElements[i].onclick = function(e){ - - } -} \ No newline at end of file diff --git a/static-data/www/chat/js/main.js b/static-data/www/chat/js/main.js deleted file mode 100755 index 13e1c943..00000000 --- a/static-data/www/chat/js/main.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - Onionr - Private P2P Communication - - Main Onionr chat UI script - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see -*/ -friendList = {} -convoListElement = document.getElementsByClassName('conversationList')[0] -firstConvoLoad = true -activeConvo = null; - -function createConvoList(){ - convoListElement.innerHTML = "" - for (friend in friendList){ - let convoEntry = document.createElement('li') - let connectStatus = document.createElement('span') - connectStatus.classList.add("connectStatus") - if (firstConvoLoad){ - connectStatus.innerText = " ⌛" - } - else{ - connectStatus.innerText = " X" - connectStatus.style.color = "red" - console.log(direct_connections) - if (direct_connections.hasOwnProperty(friend)){ - connectStatus.innerText = " ✅" - connectStatus.style.color = "green" - } - } - - convoEntry.classList.add('convoEntry') - convoEntry.setAttribute('data-pubkey', friend) - convoEntry.innerText = friendList[friend] - convoEntry.appendChild(connectStatus) - convoListElement.append(convoEntry) - firstConvoLoad = false - } - setTimeout(function(){createConvoList()}, 3000) -} - -fetch('/friends/list', { - headers: { - "token": webpass - }}) -.then((resp) => resp.json()) // Transform the data into json -.then(function(resp) { - var keys = [] - for(var k in resp) keys.push(k) - for (var i = 0; i < keys.length; i++){ - friendList[keys[i]] = resp[keys[i]]['name'] - // Create a connection to each peer - createConnection(keys[i]) - } - createConvoList() -}) - -// Correct conversation list height -function correctConvoList(){ - margin = 50 - els = document.getElementsByClassName('convoListContainer') - for (x = 0; x < els.length; x++){ - els[x].style.height = window.innerHeight - (2 * margin) + 'px' - } -} -setInterval(function(){correctConvoList()}, 30) \ No newline at end of file diff --git a/static-data/www/chat/js/message-feed.js b/static-data/www/chat/js/message-feed.js deleted file mode 100644 index 9926bf31..00000000 --- a/static-data/www/chat/js/message-feed.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - Onionr - Private P2P Communication - - This file manages chat messages in the chat UI - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see -*/ - -let showMessages = function(){ - let feeds = document.getElementsByClassName("chatFeed") - for (x=0; x < feeds.length; x++){ - - } -} \ No newline at end of file diff --git a/static-data/www/chat/js/messages.js b/static-data/www/chat/js/messages.js deleted file mode 100644 index a5a7a596..00000000 --- a/static-data/www/chat/js/messages.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - Onionr - Private P2P Communication - - Onionr chat message objects - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see -*/ -chatMessages = {} -let Message = class { - constructor(text, peer, outgoing){ - this.text = text // raw message string - this.peer = peer // peer by public key - this.outgoing = outgoing // boolean. false = outgoing message - this.time = new Date().toISOString() // store message time - this.tempIdentifier = Math.floor(Math.random() * 100000000000000000) // assign a random id, doesnt need to be secure - - // Add the message to the peer message feed object chatMessages - if (chatMessages.hasOwnProperty(peer)){ - chatMessages[peer].push(this) - } - else{ - chatMessages[peer] = [this] - } - } -} diff --git a/static-data/www/chat/js/resizes.js b/static-data/www/chat/js/resizes.js deleted file mode 100644 index 5201ff91..00000000 --- a/static-data/www/chat/js/resizes.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - Onionr - Private P2P Communication - - Resize chat elements to help with responsiveness - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see -*/ -let doResize = function(){ - let chatInput = document.getElementsByClassName('chatInput')[0] - chatInput.style.width = "50%"; -} -doResize() -window.onresize = doResize \ No newline at end of file