outsourced backend header javascript

This commit is contained in:
Ian 2012-06-07 17:54:33 +02:00
parent 5f9d9d7690
commit ba2214598c
2 changed files with 33 additions and 38 deletions

View File

@ -0,0 +1,32 @@
function spawn() {
if (self.Spawnextended) {
Spawnextended();
}
if (self.Spawnbody) {
Spawnbody();
}
if (self.Spawnnugget) {
Spawnnugget();
}
}
function SetCookie(name, value) {
var today = new Date();
var expire = new Date();
expire.setTime(today.getTime() + (60*60*24*30*1000));
document.cookie = 'serendipity[' + name + ']='+escape(value) + ';expires=' + expire.toGMTString();
}
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}

View File

@ -5,44 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset={$CONST.LANG_CHARSET}" />
<link rel="stylesheet" type="text/css" href="{$admin_vars.css_file}" />
<link rel="stylesheet" type="text/css" href="{$admin_vars.admin_css_file}" />
<script type="text/javascript">
{literal}
function spawn() {
if (self.Spawnextended) {
Spawnextended();
}
if (self.Spawnbody) {
Spawnbody();
}
if (self.Spawnnugget) {
Spawnnugget();
}
}
function SetCookie(name, value) {
var today = new Date();
var expire = new Date();
expire.setTime(today.getTime() + (60*60*24*30*1000));
document.cookie = 'serendipity[' + name + ']='+escape(value) + ';expires=' + expire.toGMTString();
}
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
{/literal}
</script>
<script src="{serendipity_getFile file='admin/header_spawn.js'}"></script>
{if $admin_vars.admin_installed}
{serendipity_hookPlugin hook="backend_header" hookAll="true"}
{/if}