aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/js.php17
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/rivercomment.php16
-rw-r--r--views/default/js/initialise_elgg.php52
-rw-r--r--views/default/likes/forms/edit.php10
4 files changed, 46 insertions, 49 deletions
diff --git a/mod/riverdashboard/views/default/riverdashboard/js.php b/mod/riverdashboard/views/default/riverdashboard/js.php
index 01adec77c..ad96a6069 100644
--- a/mod/riverdashboard/views/default/riverdashboard/js.php
+++ b/mod/riverdashboard/views/default/riverdashboard/js.php
@@ -1,16 +1,7 @@
-<?php
-
-/*
<script type="text/javascript">
$(document).ready(function() {
-
- var href = $("div.river_pagination a").attr('href');
- href = href.replace("callback=true","callback=");
- $("div.river_pagination a").attr('href',href);
-
+ $('.river_comment_form_button').click(function() {
+ $(this).next('.river_comment_form').toggle();
+ });
});
-</script>
-
-*/
-
-?> \ No newline at end of file
+</script> \ No newline at end of file
diff --git a/mod/riverdashboard/views/default/riverdashboard/rivercomment.php b/mod/riverdashboard/views/default/riverdashboard/rivercomment.php
index 4aa255882..61e5c238e 100644
--- a/mod/riverdashboard/views/default/riverdashboard/rivercomment.php
+++ b/mod/riverdashboard/views/default/riverdashboard/rivercomment.php
@@ -3,13 +3,13 @@
* Elgg comments add on river form
* @uses $vars['entity']
*/
-
+
if (isset($vars['entity']) && isloggedin()) {
- $form_body = "<a onclick=\" $('.river_comment_form').show('slow');\">Add comment</a>";
- $form_body .= "<div class=\"river_comment_form\" style=\"display:none;\">";
- $form_body .= elgg_view('input/text',array('internalname' => 'generic_comment', 'value' => 'Add a comment...'));
- $form_body .= elgg_view('input/hidden', array('internalname' => 'entity_guid', 'value' => $vars['entity']->getGUID()));
- $form_body .= elgg_view('input/submit', array('value' => elgg_echo("post")));
- $form_body .= "</div>";
- echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$vars['url']}action/comments/add"));
+ $form_body = "<a class=\"river_comment_form_button\">Add comment</a>";
+ $form_body .= "<div class=\"river_comment_form\" style=\"display:none;\">";
+ $form_body .= elgg_view('input/text',array('internalname' => 'generic_comment', 'value' => 'Add a comment...'));
+ $form_body .= elgg_view('input/hidden', array('internalname' => 'entity_guid', 'value' => $vars['entity']->getGUID()));
+ $form_body .= elgg_view('input/submit', array('value' => elgg_echo("post")));
+ $form_body .= "</div>";
+ echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$vars['url']}action/comments/add"));
} \ No newline at end of file
diff --git a/views/default/js/initialise_elgg.php b/views/default/js/initialise_elgg.php
index fdbcbbd07..66fc31cbf 100644
--- a/views/default/js/initialise_elgg.php
+++ b/views/default/js/initialise_elgg.php
@@ -16,7 +16,7 @@ $(document).ready(function () {
$('a.toggle_customise_edit_panel').click(function () {
$('div#customise_editpanel').slideToggle("fast");
return false;
- });
+ });
$('a.collapsibleboxlink').click(function () {
$(this.parentNode.parentNode).children(".collapsible_box").slideToggle("fast");
@@ -73,19 +73,23 @@ $(document).ready(function () {
hoverClass: 'droppable-hover'
});
+ $('.likes_list_button').click(function() {
+ $(this).next('.likes_list').toggle();
+ });
+
}); /* end document ready function */
// display & hide elgg system messages
function elgg_system_message() {
- $("#elgg_system_message").animate({opacity: 0.9}, 1000);
+ $("#elgg_system_message").animate({opacity: 0.9}, 1000);
$("#elgg_system_message").animate({opacity: 0.9}, 5000);
$("#elgg_system_message").fadeOut('slow');
-
+
$("#elgg_system_message").click(function () {
$("#elgg_system_message").stop();
$("#elgg_system_message").fadeOut('slow');
return false;
- });
+ });
}
// reusable slide in/out toggle function
@@ -241,50 +245,50 @@ this.each(function() {
var root = this, zIndex = 5000;
function getSubnav(ele) {
- if (ele.nodeName.toLowerCase() == 'li') {
+ if (ele.nodeName.toLowerCase() == 'li') {
var subnav = $('> ul', ele);
return subnav.length ? subnav[0] : null;
- } else {
+ } else {
return ele;
- }
+ }
}
function getActuator(ele) {
- if (ele.nodeName.toLowerCase() == 'ul') {
+ if (ele.nodeName.toLowerCase() == 'ul') {
return $(ele).parents('li')[0];
- } else {
+ } else {
return ele;
- }
+ }
}
function hide() {
- var subnav = getSubnav(this);
- if (!subnav) return;
- $.data(subnav, 'cancelHide', false);
- setTimeout(function() {
+ var subnav = getSubnav(this);
+ if (!subnav) return;
+ $.data(subnav, 'cancelHide', false);
+ setTimeout(function() {
if (!$.data(subnav, 'cancelHide')) {
- $(subnav).slideUp(100);
+ $(subnav).slideUp(100);
}
- }, 250);
+ }, 250);
}
function show() {
- var subnav = getSubnav(this);
- if (!subnav) return;
- $.data(subnav, 'cancelHide', true);
- $(subnav).css({zIndex: zIndex++}).slideDown(options.speed);
- if (this.nodeName.toLowerCase() == 'ul') {
+ var subnav = getSubnav(this);
+ if (!subnav) return;
+ $.data(subnav, 'cancelHide', true);
+ $(subnav).css({zIndex: zIndex++}).slideDown(options.speed);
+ if (this.nodeName.toLowerCase() == 'ul') {
var li = getActuator(this);
$(li).addClass('hover');
$('> a', li).addClass('hover');
- }
+ }
}
$('ul, li', this).hover(show, hide);
$('li', this).hover(
- function() { $(this).addClass('hover'); $('> a', this).addClass('hover'); },
- function() { $(this).removeClass('hover'); $('> a', this).removeClass('hover'); }
+ function() { $(this).addClass('hover'); $('> a', this).addClass('hover'); },
+ function() { $(this).removeClass('hover'); $('> a', this).removeClass('hover'); }
);
});
diff --git a/views/default/likes/forms/edit.php b/views/default/likes/forms/edit.php
index 76e503f55..479b10f75 100644
--- a/views/default/likes/forms/edit.php
+++ b/views/default/likes/forms/edit.php
@@ -20,13 +20,15 @@ if (isset($vars['entity']) && isloggedin()) {
$numoflikes = elgg_count_likes($vars['entity']);
if ($numoflikes != 0) {
if ($numoflikes == 1) {
- echo "<a onclick=\" $('#showLikes').show('slow');\">" . elgg_count_likes($vars['entity']) . " " . elgg_echo('likes:userlikedthis') . "</a>";
+ $user_string = elgg_echo('likes:userlikedthis');
} else {
- echo "<a onclick=\" $('#showLikes').show('slow');\">" . elgg_count_likes($vars['entity']) . " " . elgg_echo('likes:userslikethis') . "</a>";
+ $user_string = elgg_echo('likes:userslikedthis');
}
+
+ echo "<a class=\"likes_list_button\">" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>";
}
//show the users who liked the object
- echo "<div id=\"showLikes\" style=\"display:none;\">";
- echo list_annotations($vars['entity']->getGUID(),'likes',99);
+ echo "<div class=\"likes_list\" style=\"display: none;\">";
+ echo list_annotations($vars['entity']->getGUID(), 'likes', 99);
echo "</div>";
} \ No newline at end of file