diff options
author | thomascube <thomas@roundcube.net> | 2011-03-01 22:33:12 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2011-03-01 22:33:12 +0000 |
commit | 044d6647e060adb88fc56dd687f2ea810d73fdb1 (patch) | |
tree | 388fb9ed733f7e97f7318088469d6a9bc694a672 /program/include/rcube_html_page.php | |
parent | e49064282339bf08f0dfcce4224a20ec055f32ac (diff) |
Make it easier to add code to $(document).ready()
Diffstat (limited to 'program/include/rcube_html_page.php')
-rw-r--r-- | program/include/rcube_html_page.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/program/include/rcube_html_page.php b/program/include/rcube_html_page.php index 5b56cccc5..0cceb8964 100644 --- a/program/include/rcube_html_page.php +++ b/program/include/rcube_html_page.php @@ -5,7 +5,7 @@ | program/include/rcube_html_page.php | | | | This file is part of the Roundcube PHP suite | - | Copyright (C) 2005-2009, The Roundcube Dev Team | + | Copyright (C) 2005-2011 The Roundcube Dev Team | | Licensed under the GNU GPL | | | | CONTENTS: | @@ -33,7 +33,7 @@ class rcube_html_page protected $charset = RCMAIL_CHARSET; protected $script_tag_file = "<script type=\"text/javascript\" src=\"%s\"></script>\n"; - protected $script_tag = "<script type=\"text/javascript\">\n/* <![CDATA[ */\n%s\n/* ]]> */\n</script>"; + protected $script_tag = "<script type=\"text/javascript\">\n/* <![CDATA[ */\n%s\n/* ]]> */\n</script>\n"; protected $link_css_file = "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" />\n"; protected $default_template = "<html>\n<head><title></title></head>\n<body></body>\n</html>"; @@ -208,6 +208,11 @@ class rcube_html_page $page_header .= $this->header; } + // put docready commands into page footer + if (!empty($this->scripts['docready'])) { + $this->add_script('$(document).ready(function(){ ' . $this->scripts['docready'] . "\n});", 'foot'); + } + if (is_array($this->script_files['foot'])) { foreach ($this->script_files['foot'] as $file) { $page_footer .= sprintf($this->script_tag_file, $file); |