load sha1.js from program when login

pull/556/head
qkqpttgf 2022-02-17 18:08:37 +08:00 committed by GitHub
parent 4a866c8aa2
commit 0271dc5b9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 30 additions and 14 deletions

View File

@ -519,11 +519,39 @@
f.password1.value = sha1(timestamp + "" + f.password1.value); f.password1.value = sha1(timestamp + "" + f.password1.value);
return true; return true;
} catch { } catch {
alert("sha1.js not loaded."); //alert("sha1.js not loaded.");
if (confirm("sha1.js not loaded.\n\nLoad from program?")) loadjs("?jsFile=sha1.min.js");
return false; return false;
} }
} }
function loadjs(url) {
var xhr = new XMLHttpRequest;
xhr.open("GET", url);
xhr.onload = function(e) {
if (xhr.status==200) {
var script = document.createElement("script");
script.type = "text/javascript";
script.text = xhr.responseText;
document.body.appendChild(script);
} else {
console.log(xhr.response);
}
}
xhr.send(null);
}
<!--LoginEnd--> <!--LoginEnd-->
<!--WriteTimezoneStart-->
var nowtime= new Date();
var timezone = 0-nowtime.getTimezoneOffset()/60;
var expd = new Date();
expd.setTime(expd.getTime()+(2*60*60*1000));
var expires = "expires="+expd.toGMTString();
document.cookie="timezone="+timezone+"; path=/; "+expires;
if (timezone!=<!--timezone-->) {
//alert('Your timezone is '+timezone+', reload local timezone.');
location.href=location.href;
}
<!--WriteTimezoneEnd-->
<!--HeadmdStart--> <!--HeadmdStart-->
var $head = document.getElementById('head'); var $head = document.getElementById('head');
if ($head) { if ($head) {
@ -792,19 +820,6 @@
return num; return num;
} }
<!--IsNotHiddenEnd--> <!--IsNotHiddenEnd-->
<!--IsFolderEnd-->
<!--WriteTimezoneStart-->
var nowtime= new Date();
var timezone = 0-nowtime.getTimezoneOffset()/60;
var expd = new Date();
expd.setTime(expd.getTime()+(2*60*60*1000));
var expires = "expires="+expd.toGMTString();
document.cookie="timezone="+timezone+"; path=/; "+expires;
if (timezone!=<!--timezone-->) {
alert('Your timezone is '+timezone+', reload local timezone.');
location.href=location.href;
}
<!--WriteTimezoneEnd-->
function CopyAllDownloadUrl(str) { function CopyAllDownloadUrl(str) {
var tmptextarea=document.createElement('textarea'); var tmptextarea=document.createElement('textarea');
document.body.appendChild(tmptextarea); document.body.appendChild(tmptextarea);
@ -817,6 +832,7 @@
document.execCommand("copy"); document.execCommand("copy");
alert(tmptextarea.innerHTML+"<!--constStr@Success-->"); alert(tmptextarea.innerHTML+"<!--constStr@Success-->");
} }
<!--IsFolderEnd-->
<!--UploadJsStart--> <!--UploadJsStart-->
function size_format(num) { function size_format(num) {
if (num>1024) { if (num>1024) {