diff --git a/templates/2k11/admin/media_choose.tpl b/templates/2k11/admin/media_choose.tpl index 4b09818a..3008268f 100644 --- a/templates/2k11/admin/media_choose.tpl +++ b/templates/2k11/admin/media_choose.tpl @@ -279,7 +279,7 @@ if (parent.frames && parent.frames['tree']) { tree.draw(); } - serendipity.addLoadEvent(treeInit); + addLoadEvent(treeInit); {/if} diff --git a/templates/2k11/admin/serendipity_editor.js.tpl b/templates/2k11/admin/serendipity_editor.js.tpl index 73f09c31..b11caf73 100644 --- a/templates/2k11/admin/serendipity_editor.js.tpl +++ b/templates/2k11/admin/serendipity_editor.js.tpl @@ -41,19 +41,6 @@ return null; } - // Some sort of onload wrapper? @onli says jQuery can help with this - serendipity.addLoadEvent = function(func) { - var oldonload = window.onload; - if (typeof window.onload != 'function') { - window.onload = func; - } else { - window.onload = function() { - oldonload(); - func(); - } - } - } - /** * Based upon code written by chris wetherell * http://www.massless.org @@ -1203,4 +1190,17 @@ var AccessifyHTML5 = function (defaults, more_fixes) { }); })(jQuery); +// This is kept for older plugins. Use of $(document).ready() is encouraged. +// At some point, this will be removed. + addLoadEvent = function(func) { + var oldonload = window.onload; + if (typeof window.onload != 'function') { + window.onload = func; + } else { + window.onload = function() { + oldonload(); + func(); + } + } + }