aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCallum Macrae <callum@lynxphp.com>2011-08-18 18:34:09 +0100
committerIgor Wiedler <igor@wiedler.ch>2012-03-31 02:09:12 +0200
commit59031fdc735a80502ea2cda3683a9276da5649cd (patch)
tree342e5e8ebb8a14d26a17ce395306b6e08fde4a9c
parentbb7a03f738c97dc225873691c459f2bf9e612ef6 (diff)
downloadforums-59031fdc735a80502ea2cda3683a9276da5649cd.tar
forums-59031fdc735a80502ea2cda3683a9276da5649cd.tar.gz
forums-59031fdc735a80502ea2cda3683a9276da5649cd.tar.bz2
forums-59031fdc735a80502ea2cda3683a9276da5649cd.tar.xz
forums-59031fdc735a80502ea2cda3683a9276da5649cd.zip
[ticket/10272] AJAXified the add / remove friend / foe links.
PHPBB3-10272
-rw-r--r--phpBB/styles/prosilver/template/memberlist_view.html8
-rw-r--r--phpBB/styles/script.js7
2 files changed, 10 insertions, 5 deletions
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html
index f10ec64975..d8bb92a731 100644
--- a/phpBB/styles/prosilver/template/memberlist_view.html
+++ b/phpBB/styles/prosilver/template/memberlist_view.html
@@ -35,15 +35,15 @@
<!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields -->
<!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
<!-- IF U_REMOVE_FRIEND -->
- <dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FRIEND}"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
+ <dt>&nbsp;</dt> <dd class="zebra"><a href="{U_REMOVE_FRIEND}" data-ajax="zebra"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
<!-- ELSEIF U_REMOVE_FOE -->
- <dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FOE}"><strong>{L_REMOVE_FOE}</strong></a></dd>
+ <dt>&nbsp;</dt> <dd class="zebra"><a href="{U_REMOVE_FOE}" data-ajax="zebra"><strong>{L_REMOVE_FOE}</strong></a></dd>
<!-- ELSE -->
<!-- IF U_ADD_FRIEND -->
- <dt>&nbsp;</dt> <dd><a href="{U_ADD_FRIEND}"><strong>{L_ADD_FRIEND}</strong></a></dd>
+ <dt>&nbsp;</dt> <dd class="zebra"><a href="{U_ADD_FRIEND}" data-ajax="zebra"><strong>{L_ADD_FRIEND}</strong></a></dd>
<!-- ENDIF -->
<!-- IF U_ADD_FOE -->
- <dt>&nbsp;</dt> <dd><a href="{U_ADD_FOE}"><strong>{L_ADD_FOE}</strong></a></dd>
+ <dt>&nbsp;</dt> <dd class="zebra"><a href="{U_ADD_FOE}" data-ajax="zebra"><strong>{L_ADD_FOE}</strong></a></dd>
<!-- ENDIF -->
<!-- ENDIF -->
<!-- ENDIF -->
diff --git a/phpBB/styles/script.js b/phpBB/styles/script.js
index 35c99464bd..d17a2cdc10 100644
--- a/phpBB/styles/script.js
+++ b/phpBB/styles/script.js
@@ -346,7 +346,12 @@ phpbb.add_ajax_callback('post_delete', function(el) {
tr.next().find('.up').html('<a href="' + tr.data('up') + '"><img src="./images/icon_up.gif" alt="Move up" title="Move up" /></a>');
phpbb.ajaxify({selector: tr.next().find('.up').children('a')}, false, 'forum_up');
}
-});
+}).add_ajax_callback('zebra', function(el, res) {
+ if (res.MESSAGE_TEXT.indexOf('successfully') !== -1) {
+ $('.zebra').html(res.MESSAGE_TEXT.split('<br')[0]);
+ $($('.zebra').get(1)).remove();
+ }
+});;