diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-27 06:14:32 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-27 06:14:32 +0000 |
commit | 27e64f1dc6cc43b40592337eed360bdf7e3d7a59 (patch) | |
tree | f127c76bff448c546a30753b466cf909bb42ca7d | |
parent | 7e5f59bcb7682896657dd11a530dc25412ef3cdc (diff) |
Move javascript from default theme to appropriate modules
-rw-r--r-- | modules/comment/helpers/comment_block.php | 5 | ||||
-rw-r--r-- | modules/comment/js/comment.js (renamed from themes/default/js/comment.js) | 0 | ||||
-rw-r--r-- | modules/user/helpers/user_block.php | 5 | ||||
-rw-r--r-- | modules/user/js/user.js (renamed from themes/default/js/user.js) | 0 | ||||
-rw-r--r-- | themes/default/views/page.html.php | 2 |
5 files changed, 9 insertions, 3 deletions
diff --git a/modules/comment/helpers/comment_block.php b/modules/comment/helpers/comment_block.php index 58a1a416..ee05a383 100644 --- a/modules/comment/helpers/comment_block.php +++ b/modules/comment/helpers/comment_block.php @@ -19,6 +19,11 @@ */ class comment_block_Core { + public static function head($theme) { + $url = url::file("modules/comment/js/comment.js"); + return "<script src=\"$url\" type=\"text/javascript\"></script>\n"; + } + public static function photo_bottom($theme) { return comment::block($theme, true); } diff --git a/themes/default/js/comment.js b/modules/comment/js/comment.js index 259b4826..259b4826 100644 --- a/themes/default/js/comment.js +++ b/modules/comment/js/comment.js diff --git a/modules/user/helpers/user_block.php b/modules/user/helpers/user_block.php index 225ff82e..5146cc9f 100644 --- a/modules/user/helpers/user_block.php +++ b/modules/user/helpers/user_block.php @@ -19,9 +19,12 @@ */ class user_block_Core { public static function head($theme) { + $url = url::file("modules/user/js/user.js"); + $script[] = "<script src=\"$url\" type=\"text/javascript\"></script>"; $user = Session::instance()->get('user', null); $url = url::file("lib/jquery.jeditable.js"); - return empty($user) ? "" : "<script src=\"$url\" type=\"text/javascript\"></script>"; + $script[] = empty($user) ? "" : "<script src=\"$url\" type=\"text/javascript\"></script>"; + return implode("\n", $script); } public static function header_top($theme) { diff --git a/themes/default/js/user.js b/modules/user/js/user.js index 8ee543bf..8ee543bf 100644 --- a/themes/default/js/user.js +++ b/modules/user/js/user.js diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php index 702595a6..e3da147c 100644 --- a/themes/default/views/page.html.php +++ b/themes/default/views/page.html.php @@ -17,8 +17,6 @@ media="screen,print,projection" /> <script src="<?= url::file("lib/jquery.js") ?>" type="text/javascript"></script> <script src="<?= url::file("lib/jquery.form.js") ?>" type="text/javascript"></script> - <script src="<?= $theme->url("js/user.js") ?>" type="text/javascript"></script> - <script src="<?= $theme->url("js/comment.js") ?>" type="text/javascript"></script> <!-- this stuff will likely be integrated into lib, possibly theme css --> <link rel="stylesheet" type="text/css" href="<?= $theme->url("jquery/jquery.ui.css") ?>" media="screen,print,projection" /> |