be nice to dinos

This commit is contained in:
ed 2020-04-20 16:35:49 +00:00
parent 53f22c25c9
commit 8786416428
2 changed files with 22 additions and 10 deletions

View file

@ -73,7 +73,7 @@ function opclick(ev) {
goto(dest); goto(dest);
// writing a blank value makes ie8 segfault w // writing a blank value makes ie8 segfault w
if (window['localStorage']) if (window.localStorage)
localStorage.setItem('opmode', dest || '.'); localStorage.setItem('opmode', dest || '.');
} }
@ -99,6 +99,9 @@ function goto(dest) {
function goto_up2k() { function goto_up2k() {
if (up2k === false)
return goto('bup');
if (!up2k) if (!up2k)
return setTimeout(goto_up2k, 100); return setTimeout(goto_up2k, 100);
@ -106,12 +109,15 @@ function goto_up2k() {
} }
goto(); (function () {
if (window['localStorage']) { goto();
var op = localStorage.getItem('opmode'); if (window.localStorage) {
if (op !== null && op !== '.') var op = localStorage.getItem('opmode');
goto(op); if (op !== null && op !== '.')
} goto(op);
}
document.getElementById('ops').style.display = 'block';
})();
// chrome requires https to use crypto.subtle, // chrome requires https to use crypto.subtle,
@ -126,7 +132,10 @@ try {
); );
} }
catch (ex) { catch (ex) {
up2k = up2k_init(false); try {
up2k = up2k_init(false);
}
catch (ex) { }
} }
@ -191,8 +200,8 @@ function up2k_init(have_crypto) {
// switches to the basic uploader with msg as error message // switches to the basic uploader with msg as error message
function un2k(msg) { function un2k(msg) {
goto('bup');
setmsg(msg); setmsg(msg);
return false;
} }
// handle user intent to use the basic uploader instead // handle user intent to use the basic uploader instead
@ -261,7 +270,9 @@ function up2k_init(have_crypto) {
} }
}; };
var bobslice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice; var bobslice = null;
if (window.File)
bobslice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
if (!bobslice || !window.FileReader || !window.FileList) if (!bobslice || !window.FileReader || !window.FileList)
return un2k("this is the basic uploader; up2k needs at least<br />chrome 21 // firefox 13 // edge 12 // opera 12 // safari 5.1"); return un2k("this is the basic uploader; up2k needs at least<br />chrome 21 // firefox 13 // edge 12 // opera 12 // safari 5.1");

View file

@ -61,6 +61,7 @@
box-shadow: 0 0 1em #222 inset; box-shadow: 0 0 1em #222 inset;
} }
#ops { #ops {
display: none;
background: #333; background: #333;
margin: 1.7em 1.5em 0 1.5em; margin: 1.7em 1.5em 0 1.5em;
padding: .3em .6em; padding: .3em .6em;