onready() instead of onload()
This commit is contained in:
parent
ad657916a0
commit
f444fa3b6e
@ -10,7 +10,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
onload(function(){
|
||||
onready(function(){
|
||||
var link = document.getElementsByTagName('a');
|
||||
|
||||
for(var i = 0; i < link.length; i++) {
|
||||
|
@ -10,7 +10,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
onload(function(){
|
||||
onready(function(){
|
||||
var iso8601 = function(s) {
|
||||
s = s.replace(/\.\d\d\d+/,""); // remove milliseconds
|
||||
s = s.replace(/-/,"/").replace(/-/,"/");
|
||||
|
@ -53,5 +53,8 @@
|
||||
{{ boardlist.bottom }}
|
||||
<p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> {{ config.version }} | <a href="http://tinyboard.org/">Tinyboard</a> Copyright © 2010-2012 Tinyboard Development Group</p>
|
||||
{% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
|
||||
<script type="text/javascript">{% raw %}
|
||||
ready();
|
||||
{% endraw %}</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -158,25 +158,18 @@ var RecaptchaOptions = {
|
||||
theme : 'clean'
|
||||
};
|
||||
|
||||
function onload(fnc) {
|
||||
if(typeof window.addEventListener != "undefined") {
|
||||
window.addEventListener("load", fnc, false);
|
||||
} else if(typeof window.attachEvent != "undefined") {
|
||||
window.attachEvent( "onload", fnc );
|
||||
} else {
|
||||
if (window.onload != null) {
|
||||
var oldOnload = window.onload;
|
||||
window.onload = function (e) {
|
||||
oldOnload(e);
|
||||
window[fnc]();
|
||||
};
|
||||
} else {
|
||||
window.onload = fnc;
|
||||
}
|
||||
onready_callbacks = [];
|
||||
function onready(fnc) {
|
||||
onready_callbacks.push(fnc);
|
||||
}
|
||||
|
||||
function ready() {
|
||||
for(var i = 0; i < onready_callbacks.length; i++) {
|
||||
onready_callbacks[i]();
|
||||
}
|
||||
}
|
||||
|
||||
onload(init);
|
||||
onready(init);
|
||||
|
||||
{% endraw %}{% if config.google_analytics %}{% raw %}
|
||||
|
||||
|
@ -55,5 +55,8 @@
|
||||
{{ boardlist.bottom }}
|
||||
<p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> {{ config.version }} | <a href="http://tinyboard.org/">Tinyboard</a> Copyright © 2010-2012 Tinyboard Development Group</p>
|
||||
{% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
|
||||
<script type="text/javascript">{% raw %}
|
||||
ready();
|
||||
{% endraw %}</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user