aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/styles/prosilver
diff options
context:
space:
mode:
authorDavid Colón <david@davidiq.com>2012-06-26 00:37:48 -0400
committerNathan Guse <nathaniel.guse@gmail.com>2013-01-15 23:29:01 -0600
commitbabe07caefe8a035f711fd76c38b4dbeb0a8e804 (patch)
treec7715b2a01240600c3f80405cb5ca6a0ffed193d /phpBB/styles/prosilver
parentde541ac13b44d1f52e1ba4bb626b9ec4e124557f (diff)
downloadforums-babe07caefe8a035f711fd76c38b4dbeb0a8e804.tar
forums-babe07caefe8a035f711fd76c38b4dbeb0a8e804.tar.gz
forums-babe07caefe8a035f711fd76c38b4dbeb0a8e804.tar.bz2
forums-babe07caefe8a035f711fd76c38b4dbeb0a8e804.tar.xz
forums-babe07caefe8a035f711fd76c38b4dbeb0a8e804.zip
[ticket/10786] Javascript toggle member search panel in memberlist.php
Search functions on the memberlist.php page are now rendered by default and displayed via javascript. If javascript is disabled the page still works as it previously did. PHPBB3-10786
Diffstat (limited to 'phpBB/styles/prosilver')
-rw-r--r--phpBB/styles/prosilver/template/ajax.js13
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js37
-rw-r--r--phpBB/styles/prosilver/template/memberlist_body.html2
3 files changed, 13 insertions, 39 deletions
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js
index 8583fb565c..968f57bba2 100644
--- a/phpBB/styles/prosilver/template/ajax.js
+++ b/phpBB/styles/prosilver/template/ajax.js
@@ -192,6 +192,17 @@ $('#quick-mod-select').change(function () {
$('#quickmodform').submit();
});
-
+/**
+* Toggle the member search panel in memberlist.php.
+*/
+$('#member_search').click(function () {
+ $('#memberlist_search').slideToggle('fast');
+ phpbb.ajax_callbacks['alt_text'].call(this);
+ //Focus on the username textbox if it's available and displayed
+ if ($('#username').length > 0 && $('#memberlist_search').is(':visible')) {
+ $('#username').focus();
+ }
+ return false;
+});
})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index 527a064fa9..995b4b0ab7 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -434,43 +434,6 @@ function apply_onkeypress_event()
}
/**
-* Toggle a section's visibility status
-*/
-function toggle_section(link, panel_id, expand_text, collapse_text)
-{
- if (jquery_present)
- {
- var panel = jQuery('#' + panel_id);
- if (panel.is(':visible'))
- {
- jQuery(link).text(expand_text);
- panel.slideUp('fast');
- }
- else
- {
- jQuery(link).text(collapse_text);
- panel.slideDown('fast');
- }
- }
- else
- {
- var panel = document.getElementById(panel_id);
- if (panel.style.display == 'none')
- {
- link.innerHTML = collapse_text;
- panel.style.display = '';
- }
- else
- {
- link.innerHTML = expand_text;
- panel.style.display = 'none';
- }
- }
-
- return false;
-}
-
-/**
* Detect JQuery existance. We currently do not deliver it, but some styles do, so why not benefit from it. ;)
*/
var jquery_present = typeof jQuery == 'function';
diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html
index 023c0e1e4e..17dc2c33c0 100644
--- a/phpBB/styles/prosilver/template/memberlist_body.html
+++ b/phpBB/styles/prosilver/template/memberlist_body.html
@@ -30,7 +30,7 @@
<ul class="linklist">
<li>
- <!-- IF U_FIND_MEMBER and not S_SEARCH_USER --><a href="{U_FIND_MEMBER}" onclick="return toggle_section(this, 'memberlist_search', '{LA_FIND_USERNAME}', '{LA_HIDE_MEMBER_SEARCH}')">{L_FIND_USERNAME}</a> &bull; <!-- ELSEIF S_SEARCH_USER and U_HIDE_FIND_MEMBER and not S_IN_SEARCH_POPUP --><a href="{U_HIDE_FIND_MEMBER}" onclick="return toggle_section(this, 'memberlist_search', '{LA_FIND_USERNAME}', '{LA_HIDE_MEMBER_SEARCH}')">{L_HIDE_MEMBER_SEARCH}</a> &bull; <!-- ENDIF -->
+ <!-- IF U_FIND_MEMBER and not S_SEARCH_USER --><a href="{U_FIND_MEMBER}" id="member_search" data-alt-text="{LA_HIDE_MEMBER_SEARCH}">{L_FIND_USERNAME}</a> &bull; <!-- ELSEIF S_SEARCH_USER and U_HIDE_FIND_MEMBER and not S_IN_SEARCH_POPUP --><a href="{U_HIDE_FIND_MEMBER}" id="member_search" data-alt-text="{LA_FIND_USERNAME}">{L_HIDE_MEMBER_SEARCH}</a> &bull; <!-- ENDIF -->
<strong style="font-size: 0.95em;">
<!-- BEGIN first_char -->
<a href="{first_char.U_SORT}">{first_char.DESC}</a>&nbsp;