From 5e1632788b8a5f5b9eebd2acb72e1de7d9f0ac63 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 15 Oct 2005 20:44:04 +0200 Subject: more unobstrusive javascript The edit form now is free of inline event handlers. There are still other places where inline javascript and even document.write is used which should be fixed as well. Currently the window.onload event is used to initialize everything which may not the best way to do so. Dean Edwards may have a solution: http://dean.edwards.name/weblog/2005/09/busted/ darcs-hash:20051015184404-7ad00-2404744d008e5ea7e1b5800c96800824b532ff47.gz --- inc/template.php | 78 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 33 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index 8c84515c2..9d0d3ef9a 100644 --- a/inc/template.php +++ b/inc/template.php @@ -225,42 +225,55 @@ function tpl_metaheaders(){ ptln('',$it); - // add size control - ptln('',$it); // editing functions - if(($ACT=='edit' || $ACT=='preview') && $INFO['writable']){ - // load toolbar functions - ptln('',$it); + if($ACT=='edit' || $ACT=='preview'){ + // add size control + ptln('',$it); - // load spellchecker functions if wanted - if($conf['spellchecker']){ + if($INFO['writable']){ + // load toolbar functions ptln('',$it+2); - } + DOKU_BASE.'lib/scripts/edit.js">',$it); - ptln('',$it+2); + } + + ptln('',$it); } - ptln('',$it); } // plugin stylesheets and Scripts @@ -270,13 +283,12 @@ function tpl_metaheaders(){ /** * Print a link * - * Just builds a link but adds additional JavaScript needed for - * the unsaved data check needed in the edit form. + * Just builds a link. * * @author Andreas Gohr */ function tpl_link($url,$name,$more=''){ - print '$name"; } @@ -522,7 +534,7 @@ function tpl_searchform(){ global $lang; global $ACT; - print '