From 17d345824e47bbdbf218baef8dc13b91bd30d63a Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sat, 31 Aug 2019 19:13:59 -0500 Subject: [PATCH] added notifications and signed posts to board --- onionr/httpapi/security/client.py | 2 +- onionr/static-data/www/board/board.js | 26 +- onionr/static-data/www/board/index.html | 5 +- onionr/static-data/www/mail/index.html | 21 +- onionr/static-data/www/mail/mail.js | 12 +- onionr/static-data/www/private/index.html | 4 +- .../www/shared/main/PNotifyBrightTheme.css | 1 + .../www/shared/node_modules/pnotify/LICENSE | 202 +++++ .../www/shared/node_modules/pnotify/README.md | 786 ++++++++++++++++++ .../node_modules/pnotify/dist/iife/PNotify.js | 2 + .../pnotify/dist/iife/PNotify.js.map | 1 + .../pnotify/dist/iife/PNotifyAnimate.js | 2 + .../pnotify/dist/iife/PNotifyAnimate.js.map | 1 + .../pnotify/dist/iife/PNotifyButtons.js | 2 + .../pnotify/dist/iife/PNotifyButtons.js.map | 1 + .../pnotify/dist/iife/PNotifyCallbacks.js | 2 + .../pnotify/dist/iife/PNotifyCallbacks.js.map | 1 + .../pnotify/dist/iife/PNotifyCompat.js | 2 + .../pnotify/dist/iife/PNotifyCompat.js.map | 1 + .../pnotify/dist/iife/PNotifyConfirm.js | 2 + .../pnotify/dist/iife/PNotifyConfirm.js.map | 1 + .../pnotify/dist/iife/PNotifyDesktop.js | 2 + .../pnotify/dist/iife/PNotifyDesktop.js.map | 1 + .../pnotify/dist/iife/PNotifyHistory.js | 2 + .../pnotify/dist/iife/PNotifyHistory.js.map | 1 + .../pnotify/dist/iife/PNotifyMobile.js | 2 + .../pnotify/dist/iife/PNotifyMobile.js.map | 1 + .../pnotify/dist/iife/PNotifyNonBlock.js | 2 + .../pnotify/dist/iife/PNotifyNonBlock.js.map | 1 + .../pnotify/dist/iife/PNotifyReference.js | 2 + .../pnotify/dist/iife/PNotifyReference.js.map | 1 + .../pnotify/dist/iife/PNotifyStyleMaterial.js | 2 + .../dist/iife/PNotifyStyleMaterial.js.map | 1 + 33 files changed, 1078 insertions(+), 17 deletions(-) create mode 100644 onionr/static-data/www/shared/main/PNotifyBrightTheme.css create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/LICENSE create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/README.md create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotify.js create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotify.js.map create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyAnimate.js create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyAnimate.js.map create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyButtons.js create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyButtons.js.map create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyCallbacks.js create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyCallbacks.js.map create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyCompat.js create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyCompat.js.map create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyConfirm.js create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyConfirm.js.map create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyDesktop.js create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyDesktop.js.map create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyHistory.js create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyHistory.js.map create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyMobile.js create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyMobile.js.map create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyNonBlock.js create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyNonBlock.js.map create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyReference.js create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyReference.js.map create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyStyleMaterial.js create mode 100644 onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyStyleMaterial.js.map diff --git a/onionr/httpapi/security/client.py b/onionr/httpapi/security/client.py index b6e4e1f9..48359378 100644 --- a/onionr/httpapi/security/client.py +++ b/onionr/httpapi/security/client.py @@ -63,5 +63,5 @@ class ClientAPISecurity: if request.endpoint == 'siteapi.site': resp.headers['Content-Security-Policy'] = "default-src 'none'; style-src data: 'unsafe-inline'; img-src data:" else: - resp.headers['Content-Security-Policy'] = "default-src 'none'; script-src 'self'; object-src 'none'; style-src 'self'; img-src 'self'; media-src 'none'; frame-src 'none'; font-src 'self'; connect-src 'self'" + resp.headers['Content-Security-Policy'] = "default-src 'none'; script-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'; img-src 'self'; media-src 'none'; frame-src 'none'; font-src 'self'; connect-src 'self'" return resp \ No newline at end of file diff --git a/onionr/static-data/www/board/board.js b/onionr/static-data/www/board/board.js index 9e03c6eb..0092963c 100755 --- a/onionr/static-data/www/board/board.js +++ b/onionr/static-data/www/board/board.js @@ -1,3 +1,22 @@ +/* + Onionr - Private P2P Communication + + This file handles the boards/circles interface + + 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 . +*/ + requested = [] var windowHeight = window.innerHeight; @@ -113,9 +132,14 @@ newPostForm.onsubmit = function(){ .then(function(data) { newPostForm.style.display = 'block' if (data == 'failure due to duplicate insert'){ - alert('This message is already queued') + PNotify.error({ + text: "This message is already queued" + }) return } + PNotify.success({ + text: "Message queued for posting" + }) setTimeout(function(){getBlocks()}, 3000) }) return false diff --git a/onionr/static-data/www/board/index.html b/onionr/static-data/www/board/index.html index 4c0050b0..4c913f3d 100755 --- a/onionr/static-data/www/board/index.html +++ b/onionr/static-data/www/board/index.html @@ -9,9 +9,12 @@ Circles + - + + + diff --git a/onionr/static-data/www/mail/index.html b/onionr/static-data/www/mail/index.html index f797cd8b..9aa1d56b 100755 --- a/onionr/static-data/www/mail/index.html +++ b/onionr/static-data/www/mail/index.html @@ -8,9 +8,17 @@ Onionr Mail + + + + + + + + @@ -63,7 +71,7 @@
- Copy +