add <noscript> message

This commit is contained in:
or-else
2018-10-31 12:12:10 +03:00
parent 0198f446d4
commit e7f3b424e4
8 changed files with 71 additions and 38 deletions
+26
View File
@@ -340,6 +340,32 @@ li.right:hover .menuTrigger {
}
/* Top-level application layout style: sidepanel + main view */
#noscript-alertbox {
position: relative;
display: flex;
flex-direction: column;
max-width: 30rem;
overflow: hidden;
margin-top: 5rem;
margin-left: auto;
margin-right: auto;
border-radius: 0.25rem;
box-shadow: 1px 2px 0.3rem gray;
background-color: white;
}
#noscript-title {
padding: 1rem;
font-size: 120%;
font-weight: bolder;
background-color: #2196f3; /* blue 500 */
color: #bbdefb; /* light-blue 100 */
}
#noscript-content {
padding: 1rem;
}
#app-container {
position: relative;
display: flex;
+1 -1
View File
File diff suppressed because one or more lines are too long
+6
View File
@@ -31,6 +31,12 @@
</head>
<body>
<noscript><div id="noscript-alertbox"><div id="noscript-title">Javascript support is required.</div>
<div id="noscript-content">It appears JavaScript is turned off or is not supported by your browser.
TinodeWeb does not work without JavaScript. Please enable JavaScript by changing your browser options,
then <a href="">try again</a>.
</div>
</div></noscript>
<div id="mountPoint"></div>
<script src="firebase-init.js"></script>
<script src="umd/index.dev.js"></script>
+4
View File
@@ -25,6 +25,10 @@
<link rel="stylesheet" href="css/base.min.css" />
</head>
<body>
<noscript><div id="noscript-alertbox"><div id="noscript-title">Javascript support is required.</div>
<div id="noscript-content">It appears JavaScript is turned off or is not supported by your browser.
TinodeWeb does not work without JavaScript. Please enable JavaScript by changing your browser options,
then <a href="">try again</a>.</div></div></noscript>
<div id="mountPoint"></div>
<script src="firebase-init.js"></script>
<script src="umd/index.prod.js"></script>
+10 -10
View File
@@ -1,7 +1,7 @@
// Must be located at the root.
importScripts('https://unpkg.com/firebase@5.5.5/firebase-app.js');
importScripts('https://unpkg.com/firebase@5.5.5/firebase-messaging.js');
importScripts('/src/firebase-init.js');
importScripts('firebase-init.js');
firebase.initializeApp(FIREBASE_INIT);
@@ -69,17 +69,17 @@ self.addEventListener('notificationclick', function(event) {
});
// This is needed for 'Add to Home Screen'.
self.addEventListener('fetch', function (event) {
self.addEventListener('fetch', function(event) {
event.respondWith(
// Try to find response in cache.
caches.match(event.request)
.then((resp) => {
// If response is found in cache, return it. Otherwise fetch.
return resp || fetch(event.request);
})
.catch((err) {
// Something went wrong.
console.error("Service worker Fetch: ", err);
})
.then((resp) => {
// If response is found in cache, return it. Otherwise fetch.
return resp || fetch(event.request);
})
.catch((err) => {
// Something went wrong.
console.log("Service worker Fetch: ", err);
})
);
});
+1 -4
View File
@@ -16,7 +16,7 @@ import SidepanelView from './sidepanel-view.jsx';
import { API_KEY, APP_NAME, MEDIA_BREAKPOINT, READ_DELAY, RECEIVED_DELAY } from '../config.js';
import { makeImageUrl } from '../lib/blob-helpers.js';
import { isLocalHost, isSecureConnection } from '../lib/host-name.js';
import { detectServerAddress, isLocalHost, isSecureConnection } from '../lib/host-name.js';
import LocalStorageUtil from '../lib/local-storage.js';
import HashNavigation from '../lib/navigation.js';
import { updateFavicon } from '../lib/utils.js';
@@ -24,9 +24,6 @@ import { updateFavicon } from '../lib/utils.js';
// Sound to play on message received.
const POP_SOUND = new Audio('audio/msg.mp3');
console.log("desktop alerts: is secure, is localhost, firebase, navigator, fb_init",
isSecureConnection(), isLocalHost(), (typeof firebase), (typeof navigator), (typeof FIREBASE_INIT));
class TinodeWeb extends React.Component {
constructor(props) {
super(props);
+21 -21
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long