Browse Source

onready() instead of onload()

pull/40/head
Michael Save 12 years ago
parent
commit
f444fa3b6e
  1. 2
      js/inline-expanding.js
  2. 2
      js/local-time.js
  3. 3
      templates/index.html
  4. 25
      templates/main.js
  5. 3
      templates/thread.html

2
js/inline-expanding.js

@ -10,7 +10,7 @@
* *
*/ */
onload(function(){ onready(function(){
var link = document.getElementsByTagName('a'); var link = document.getElementsByTagName('a');
for(var i = 0; i < link.length; i++) { for(var i = 0; i < link.length; i++) {

2
js/local-time.js

@ -10,7 +10,7 @@
* *
*/ */
onload(function(){ onready(function(){
var iso8601 = function(s) { var iso8601 = function(s) {
s = s.replace(/\.\d\d\d+/,""); // remove milliseconds s = s.replace(/\.\d\d\d+/,""); // remove milliseconds
s = s.replace(/-/,"/").replace(/-/,"/"); s = s.replace(/-/,"/").replace(/-/,"/");

3
templates/index.html

@ -53,5 +53,8 @@
{{ boardlist.bottom }} {{ 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 &copy; 2010-2012 Tinyboard Development Group</p> <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 &copy; 2010-2012 Tinyboard Development Group</p>
{% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %} {% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
<script type="text/javascript">{% raw %}
ready();
{% endraw %}</script>
</body> </body>
</html> </html>

25
templates/main.js

@ -158,25 +158,18 @@ var RecaptchaOptions = {
theme : 'clean' theme : 'clean'
}; };
function onload(fnc) { onready_callbacks = [];
if(typeof window.addEventListener != "undefined") { function onready(fnc) {
window.addEventListener("load", fnc, false); onready_callbacks.push(fnc);
} else if(typeof window.attachEvent != "undefined") { }
window.attachEvent( "onload", fnc );
} else { function ready() {
if (window.onload != null) { for(var i = 0; i < onready_callbacks.length; i++) {
var oldOnload = window.onload; onready_callbacks[i]();
window.onload = function (e) {
oldOnload(e);
window[fnc]();
};
} else {
window.onload = fnc;
}
} }
} }
onload(init); onready(init);
{% endraw %}{% if config.google_analytics %}{% raw %} {% endraw %}{% if config.google_analytics %}{% raw %}

3
templates/thread.html

@ -55,5 +55,8 @@
{{ boardlist.bottom }} {{ 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 &copy; 2010-2012 Tinyboard Development Group</p> <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 &copy; 2010-2012 Tinyboard Development Group</p>
{% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %} {% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
<script type="text/javascript">{% raw %}
ready();
{% endraw %}</script>
</body> </body>
</html> </html>

Loading…
Cancel
Save