aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/blog/lib/blog.php3
-rw-r--r--mod/blog/start.php4
-rw-r--r--mod/developers/views/default/page/theme_preview.php2
-rw-r--r--mod/notifications/index.php3
-rw-r--r--mod/notifications/views/default/notifications/subscriptions/forminternals.php4
-rw-r--r--mod/pages/start.php14
-rw-r--r--mod/tinymce/start.php3
-rw-r--r--mod/tinymce/views/default/tinymce/init.php4
-rw-r--r--mod/zaudio/start.php3
-rw-r--r--mod/zaudio/views/default/zaudio/audioplayer.php3
10 files changed, 28 insertions, 15 deletions
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php
index 94ab65da1..df307d70e 100644
--- a/mod/blog/lib/blog.php
+++ b/mod/blog/lib/blog.php
@@ -298,8 +298,7 @@ function blog_get_page_content_edit($page, $guid = 0, $revision = NULL) {
elgg_push_breadcrumb($blog->title, $blog->getURL());
elgg_push_breadcrumb(elgg_echo('edit'));
- $blog_js = elgg_get_simplecache_url('js', 'blog/save_draft');
- elgg_register_js('elgg.blog', $blog_js);
+ elgg_load_js('elgg.blog');
$content = elgg_view_form('blog/save', $vars, $body_vars);
$sidebar = elgg_view('blog/sidebar/revisions', $vars);
diff --git a/mod/blog/start.php b/mod/blog/start.php
index 01d78b4dd..8ebb967cc 100644
--- a/mod/blog/start.php
+++ b/mod/blog/start.php
@@ -30,6 +30,10 @@ function blog_init() {
// add to the main css
elgg_extend_view('css/screen', 'blog/css');
+ // register the blog's JavaScript
+ $blog_js = elgg_get_simplecache_url('js', 'blog/save_draft');
+ elgg_register_js('elgg.blog', $blog_js);
+
// routing of urls
elgg_register_page_handler('blog', 'blog_page_handler');
diff --git a/mod/developers/views/default/page/theme_preview.php b/mod/developers/views/default/page/theme_preview.php
index 0fe7e4732..97df551ae 100644
--- a/mod/developers/views/default/page/theme_preview.php
+++ b/mod/developers/views/default/page/theme_preview.php
@@ -32,7 +32,7 @@ header("Content-type: text/html; charset=UTF-8");
<![endif]-->
<?php
-foreach (elgg_get_js() as $script) {
+foreach (elgg_get_loaded_js() as $script) {
?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php
diff --git a/mod/notifications/index.php b/mod/notifications/index.php
index 30ee1b74b..49c91fe0e 100644
--- a/mod/notifications/index.php
+++ b/mod/notifications/index.php
@@ -14,7 +14,8 @@ gatekeeper();
set_page_owner(elgg_get_logged_in_user_guid());
$js_url = elgg_get_simplecache_url('js', 'friendsPickerv1');
-elgg_register_js('friendsPicker', $js_url);
+elgg_register_js('friendsPickerv1', $js_url);
+elgg_load_js('friendsPickerv1');
// Set the context to settings
elgg_set_context('settings');
diff --git a/mod/notifications/views/default/notifications/subscriptions/forminternals.php b/mod/notifications/views/default/notifications/subscriptions/forminternals.php
index fac8c083c..6731c59e3 100644
--- a/mod/notifications/views/default/notifications/subscriptions/forminternals.php
+++ b/mod/notifications/views/default/notifications/subscriptions/forminternals.php
@@ -3,8 +3,8 @@
* Hacked up friends picker that needs to be replaced
*/
-elgg_register_js('elgg.friendspicker', 'js/lib/friends_picker.js');
-elgg_register_js('jquery.easing', 'vendors/jquery/jquery.easing.1.3.packed.js');
+elgg_load_js('elgg.friendspicker');
+elgg_load_js('jquery.easing');
?>
<div class="elgg-module elgg-module-info">
diff --git a/mod/pages/start.php b/mod/pages/start.php
index 23c564da5..3404a8cd2 100644
--- a/mod/pages/start.php
+++ b/mod/pages/start.php
@@ -33,9 +33,15 @@ function pages_init() {
elgg_register_action("pages/editwelcome", "$action_base/editwelcome.php");
elgg_register_action("pages/delete", "$action_base/delete.php");
- // Extend some views
+ // Extend the main css view
elgg_extend_view('css/elgg', 'pages/css');
+ // Register javascript needed for sidebar menu
+ $js_url = 'mod/pages/vendors/jquery-treeview/jquery.treeview.min.js';
+ elgg_register_js('jquery-treeview', $js_url);
+ $css_url = 'mod/pages/vendors/jquery-treeview/jquery.treeview.css';
+ elgg_register_css('jquery-treeview', $css_url);
+
// Register entity type for search
elgg_register_entity_type('object', 'page');
elgg_register_entity_type('object', 'page_top');
@@ -100,10 +106,8 @@ function pages_page_handler($page) {
elgg_load_library('elgg:pages');
// add the jquery treeview files for navigation
- $js_url = elgg_get_site_url() . 'mod/pages/vendors/jquery-treeview/jquery.treeview.min.js';
- elgg_register_js('jquery-treeview', $js_url);
- $css_url = elgg_get_site_url() . 'mod/pages/vendors/jquery-treeview/jquery.treeview.css';
- elgg_register_css('jquery-treeview', $css_url);
+ elgg_load_js('jquery-treeview');
+ elgg_load_css('jquery-treeview');
if (!isset($page[0])) {
$page[0] = 'all';
diff --git a/mod/tinymce/start.php b/mod/tinymce/start.php
index 81667f8d5..1b641ff86 100644
--- a/mod/tinymce/start.php
+++ b/mod/tinymce/start.php
@@ -8,6 +8,9 @@
function tinymce_init() {
elgg_extend_view('css/elgg', 'tinymce/css');
elgg_extend_view('css/admin', 'tinymce/css');
+
+ elgg_register_js('tinymce', 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/tiny_mce.js');
+ elgg_register_js('elgg.tinymce', elgg_get_simplecache_url('js', 'tinymce'));
elgg_extend_view('input/longtext', 'tinymce/init');
diff --git a/mod/tinymce/views/default/tinymce/init.php b/mod/tinymce/views/default/tinymce/init.php
index 3fe08771c..35dd71613 100644
--- a/mod/tinymce/views/default/tinymce/init.php
+++ b/mod/tinymce/views/default/tinymce/init.php
@@ -3,5 +3,5 @@
* Initialize the TinyMCE script
*/
-elgg_register_js('tinymce', 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/tiny_mce.js');
-elgg_register_js('elgg.tinymce', elgg_get_simplecache_url('js', 'tinymce')); \ No newline at end of file
+elgg_load_js('tinymce');
+elgg_load_js('elgg.tinymce'); \ No newline at end of file
diff --git a/mod/zaudio/start.php b/mod/zaudio/start.php
index c440456b7..b353dffb9 100644
--- a/mod/zaudio/start.php
+++ b/mod/zaudio/start.php
@@ -12,4 +12,7 @@ elgg_register_event_handler('init', 'system', 'zaudio_init');
function zaudio_init() {
elgg_extend_view('css/elgg', 'zaudio/css');
+
+ $js_url = elgg_get_site_url() . 'mod/zaudio/audioplayer/audio-player.js';
+ elgg_register_js('elgg.zaudio', $js_url);
}
diff --git a/mod/zaudio/views/default/zaudio/audioplayer.php b/mod/zaudio/views/default/zaudio/audioplayer.php
index 6898506a6..bae725458 100644
--- a/mod/zaudio/views/default/zaudio/audioplayer.php
+++ b/mod/zaudio/views/default/zaudio/audioplayer.php
@@ -4,8 +4,7 @@
* @package ElggZAudio
*/
-$js_url = elgg_get_site_url() . 'mod/zaudio/audioplayer/audio-player.js';
-elgg_register_js('elgg.zaudio', $js_url);
+elgg_load_js('elgg.zaudio');
$swf_url = elgg_get_site_url() . 'mod/zaudio/audioplayer/player.swf';
$mp3_url = elgg_get_site_url() . "mod/file/download.php?file_guid={$vars['file_guid']}";