From 27e64f1dc6cc43b40592337eed360bdf7e3d7a59 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 27 Nov 2008 06:14:32 +0000 Subject: [PATCH] Move javascript from default theme to appropriate modules --- modules/comment/helpers/comment_block.php | 5 +++++ {themes/default => modules/comment}/js/comment.js | 0 modules/user/helpers/user_block.php | 5 ++++- {themes/default => modules/user}/js/user.js | 0 themes/default/views/page.html.php | 2 -- 5 files changed, 9 insertions(+), 3 deletions(-) rename {themes/default => modules/comment}/js/comment.js (100%) rename {themes/default => modules/user}/js/user.js (100%) 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 "\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 similarity index 100% rename from themes/default/js/comment.js rename to 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[] = ""; $user = Session::instance()->get('user', null); $url = url::file("lib/jquery.jeditable.js"); - return empty($user) ? "" : ""; + $script[] = empty($user) ? "" : ""; + return implode("\n", $script); } public static function header_top($theme) { diff --git a/themes/default/js/user.js b/modules/user/js/user.js similarity index 100% rename from themes/default/js/user.js rename to 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" /> - - " media="screen,print,projection" />