fixed bug automatically filling in mod.php login password

This commit is contained in:
Savetheinternet 2011-04-22 18:06:44 +10:00
parent 78aba88f46
commit 25e77ae425
5 changed files with 13 additions and 14 deletions

11
main.js
View file

@ -51,7 +51,7 @@ function citeReply(id) {
document.getElementById('body').value += '>>' + id + '\n';
}
var selectedstyle = 'Yotsuba B';
var selectedstyle = 'Yotsuba';
var styles = [
['Yotsuba B', '/board/default.css'],
['Yotsuba', '/board/yotsuba.css']
@ -87,15 +87,14 @@ function init()
newElement.appendChild(style);
}
document.getElementsByTagName('body')[0].insertBefore(newElement, document.getElementsByTagName('body')[0].lastChild)
if(!localStorage.password)
localStorage.password = generatePassword();
elements = document.getElementsByName('password');
for(x=0;x<elements.length;x++) {
elements[x].value = localStorage.password;
if(document.forms.delete) {
document.forms.delete.password.value = localStorage.password;
}
document.getElementsByTagName('body')[0].insertBefore(newElement, document.getElementsByTagName('body')[0].lastChild)
if (window.location.hash.indexOf('q') == 1)
citeReply(window.location.hash.substring(2));
else if (window.location.hash.substring(1))