Browse Source

fixed bug automatically filling in mod.php login password

pull/40/head
Savetheinternet 13 years ago
parent
commit
25e77ae425
  1. 11
      main.js
  2. 2
      templates/index.html
  3. 11
      templates/main.js
  4. 1
      templates/page.html
  5. 2
      templates/thread.html

11
main.js

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

2
templates/index.html

@ -97,7 +97,7 @@
</table> </table>
</form> </form>
<hr/> <hr/>
<form action="{post_url}" method="post"> <form name="delete" action="{post_url}" method="post">
<input type="hidden" name="board" value="{board[uri]}" /> <input type="hidden" name="board" value="{board[uri]}" />
{mod?<input type="hidden" name="mod" value="1" />} {mod?<input type="hidden" name="mod" value="1" />}
{body} {body}

11
templates/main.js

@ -87,15 +87,14 @@ function init()
newElement.appendChild(style); newElement.appendChild(style);
} }
document.getElementsByTagName('body')[0].insertBefore(newElement, document.getElementsByTagName('body')[0].lastChild)
if(!localStorage.password) if(!localStorage.password)
localStorage.password = generatePassword(); localStorage.password = generatePassword();
elements = document.getElementsByName('password'); if(document.forms.delete) {
for(x=0;x<elements.length;x++) { document.forms.delete.password.value = localStorage.password;
elements[x].value = localStorage.password;
} }
document.getElementsByTagName('body')[0].insertBefore(newElement, document.getElementsByTagName('body')[0].lastChild)
if (window.location.hash.indexOf('q') == 1) if (window.location.hash.indexOf('q') == 1)
citeReply(window.location.hash.substring(2)); citeReply(window.location.hash.substring(2));
else if (window.location.hash.substring(1)) else if (window.location.hash.substring(1))
@ -158,4 +157,4 @@ function init()
window.onload = init; window.onload = init;
{config[google_analytics]? {config[google_analytics]?
var _gaq = _gaq || [];_gaq.push(['_setAccount', '{config[google_analytics]}']);_gaq.push(['_setDomainName', 'none']);_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();} var _gaq = _gaq || [];_gaq.push(['_setAccount', '{config[google_analytics]}']);{config[google_analytics_domain]?_gaq.push(['_setDomainName', '{config[google_analytics_domain]}'])}{!config[google_analytics_domain]?_gaq.push(['_setDomainName', 'none'])};_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();}

1
templates/page.html

@ -7,6 +7,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<link rel="stylesheet" type="text/css" id="stylesheet" href="{config[uri_stylesheets]}{config[default_stylesheet][1]}"> <link rel="stylesheet" type="text/css" id="stylesheet" href="{config[uri_stylesheets]}{config[default_stylesheet][1]}">
<script type="text/javascript" src="{config[url_javascript]}"></script>
</head> </head>
<body> <body>
{pm?<div class="top_notice">{pm}</div><hr/>} {pm?<div class="top_notice">{pm}</div><hr/>}

2
templates/thread.html

@ -88,7 +88,7 @@
</table> </table>
</form> </form>
<hr/> <hr/>
<form action="{config[post_url]}" method="post"> <form name="delete" action="{config[post_url]}" method="post">
<input type="hidden" name="board" value="{board[uri]}" /> <input type="hidden" name="board" value="{board[uri]}" />
{mod?<input type="hidden" name="mod" value="1" />} {mod?<input type="hidden" name="mod" value="1" />}
{body} {body}

Loading…
Cancel
Save