upload files
This commit is contained in:
parent
4a7fd5d637
commit
52044fef4d
47 changed files with 397 additions and 0 deletions
51
main.js
Normal file
51
main.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
var input = document.getElementById("input");
|
||||
input.addEventListener("keydown", function (e) {
|
||||
if (e.keyCode === 13) {
|
||||
authenticate(e.target.value);
|
||||
}
|
||||
});
|
||||
|
||||
window.authentication_complete = function() {
|
||||
if (lightdm.is_authenticated) {
|
||||
console.log("Authenticated!");
|
||||
$( 'body' ).fadeOut( 1000, () => {
|
||||
lightdm.login(lightdm.authentication_user, null);
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
function pad(a, b) {
|
||||
return (1e15 + a + "").slice(-b);
|
||||
}
|
||||
|
||||
function getImg() {
|
||||
index = Math.floor(Math.random() * 25);
|
||||
console.log(pad(index,2));
|
||||
document.getElementsByTagName('body')[0].style.backgroundImage =
|
||||
"url(wallpapers/" + pad(index, 2) + ".png)";
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
getImg();
|
||||
input.focus();
|
||||
input.select();
|
||||
}
|
||||
|
||||
function authenticate(input_text) {
|
||||
if(!lightdm.in_authentication) {
|
||||
lightdm.authenticate(input_text);
|
||||
input.value = "";
|
||||
input.type = "password";
|
||||
input.placeholder = "password";
|
||||
} else if(!lightdm.authentication_user) {
|
||||
lightdm.respond(input_text);
|
||||
input.value = "";
|
||||
input.type = "password";
|
||||
input.placeholder = "password";
|
||||
} else {
|
||||
lightdm.respond(input_text);
|
||||
input.value = "";
|
||||
input.type = "text";
|
||||
input.placeholder = "user";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue