aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/elgglib.php3
-rw-r--r--views/default/embed/addcontentjs.php4
-rw-r--r--views/default/embed/js.php7
3 files changed, 13 insertions, 1 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 78d239a5f..46c813065 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -2100,7 +2100,8 @@
global $CONFIG;
add_menu(elgg_echo('content:latest'), $CONFIG->wwwroot . 'dashboard/latest.php');
// Page handler for JS
- register_page_handler('js','js_page_handler');
+ register_page_handler('js','js_page_handler');
+ extend_view('js/initialise_elgg','embed/js');
// Register an event triggered at system shutdown
register_shutdown_function('__elgg_shutdown_hook');
}
diff --git a/views/default/embed/addcontentjs.php b/views/default/embed/addcontentjs.php
new file mode 100644
index 000000000..1e22fd74a
--- /dev/null
+++ b/views/default/embed/addcontentjs.php
@@ -0,0 +1,4 @@
+
+ var entity;
+ $('textarea[@name='+entityname+']').val($('textarea[@name='+entityname+']').val() + ' ' + content);
+ \ No newline at end of file
diff --git a/views/default/embed/js.php b/views/default/embed/js.php
new file mode 100644
index 000000000..587acad1d
--- /dev/null
+++ b/views/default/embed/js.php
@@ -0,0 +1,7 @@
+
+ function elggUpdateContent(content, entityname) {
+ content = ' ' + content + ' ';
+ <?php
+ echo elgg_view('embed/addcontentjs');
+ ?>
+ } \ No newline at end of file