1
0

Include header_spawn.js in serendipity_editor.js.tpl.

This commit is contained in:
Matthias Mees
2013-05-30 18:13:33 +02:00
parent 69e8f8e050
commit c2c27470ff
4 changed files with 38 additions and 43 deletions

View File

@ -1,41 +0,0 @@
// File referenced in:
// templates/*/admin/index.tpl
// templates/*/admin/media_choose.tpl
// Fires functions which are generated dynamically in backend PHP files
// (i.e. include/functions_entries_admin.inc.php) which load the various
// WYSIWYG editors in entries editor, HTML nuggets etc.
function spawn() {
if (self.Spawnextended) {
Spawnextended();
}
if (self.Spawnbody) {
Spawnbody();
}
if (self.Spawnnugget) {
Spawnnugget();
}
}
// Generic function to set cookies. Duh.
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();
}
// Some sort of onload wrapper? @onli says jQuery can help with this
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}

View File

@ -13,7 +13,6 @@
<link rel="stylesheet" href="{$admin_vars.css_file}">
<link rel="stylesheet" href="{$admin_vars.admin_css_file}">
<script src="{serendipity_getFile file='admin/js/modernizr-2.6.2.min.js'}"></script>
<script src="{serendipity_getFile file='admin/header_spawn.js'}"></script>
{if $admin_vars.admin_installed}
{serendipity_hookPlugin hook="backend_header" hookAll="true"}
{/if}

View File

@ -52,7 +52,6 @@
{/if}
<script src="{serendipity_getFile file='YahooUI/treeview/YAHOO.js'}"></script>
<script src="{serendipity_getFile file='YahooUI/treeview/treeview.js'}"></script>
<script src="{serendipity_getFile file='admin/header_spawn.js'}"></script>
<script type="text/javascript" src="{$serendipityHTTPPath}serendipity_define.js.php"></script>
{serendipity_hookPlugin hook="backend_header" hookAll="true"}
<script src="{serendipity_getFile file='admin/serendipity_editor.js'}"></script>

View File

@ -14,6 +14,44 @@
# All rights reserved. See LICENSE file for licensing details
*/
// Fires functions which are generated dynamically in backend PHP files
// (i.e. include/functions_entries_admin.inc.php) which load the various
// WYSIWYG editors in entries editor, HTML nuggets etc.
function spawn() {
if (self.Spawnextended) {
Spawnextended();
}
if (self.Spawnbody) {
Spawnbody();
}
if (self.Spawnnugget) {
Spawnnugget();
}
}
// Generic function to set cookies. Duh.
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();
}
// Some sort of onload wrapper? @onli says jQuery can help with this
function addLoadEvent(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, chris [THE AT SIGN] massless.org
*/