1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-16 20:39:49 +02:00

[ticket/10272] AJAXified the add / remove friend / foe links.

PHPBB3-10272
This commit is contained in:
Callum Macrae 2011-08-18 18:34:09 +01:00 committed by Igor Wiedler
parent bb7a03f738
commit 59031fdc73
2 changed files with 10 additions and 5 deletions

View File

@ -35,15 +35,15 @@
<!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields --> <!-- 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 S_USER_LOGGED_IN and S_ZEBRA -->
<!-- IF U_REMOVE_FRIEND --> <!-- 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 --> <!-- 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 --> <!-- ELSE -->
<!-- IF U_ADD_FRIEND --> <!-- 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 --> <!-- ENDIF -->
<!-- IF U_ADD_FOE --> <!-- 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 --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->

View File

@ -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>'); 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'); 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();
}
});;