aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/styles/prosilver
diff options
context:
space:
mode:
authorSuhaib Khan <suhebjerk@gmail.com>2014-02-06 18:32:59 +0530
committerCesar G <prototech91@gmail.com>2014-04-23 09:11:39 -0700
commitdad60045b60d7a622bb23d34d808fc1d03a91b90 (patch)
treebbbbba74bf2e494896ad3e9bdcecdb6a3cdf403a /phpBB/styles/prosilver
parent5b6a6753992ae03e7bd36e7530a1a4e0e14fb57b (diff)
downloadforums-dad60045b60d7a622bb23d34d808fc1d03a91b90.tar
forums-dad60045b60d7a622bb23d34d808fc1d03a91b90.tar.gz
forums-dad60045b60d7a622bb23d34d808fc1d03a91b90.tar.bz2
forums-dad60045b60d7a622bb23d34d808fc1d03a91b90.tar.xz
forums-dad60045b60d7a622bb23d34d808fc1d03a91b90.zip
[ticket/10737] Adding username suggestions in "Find a member" using AJAX
PHPBB3-10737
Diffstat (limited to 'phpBB/styles/prosilver')
-rw-r--r--phpBB/styles/prosilver/template/memberlist_search.html37
-rw-r--r--phpBB/styles/prosilver/theme/common.css11
2 files changed, 47 insertions, 1 deletions
diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html
index ee89b103b5..c46b94f102 100644
--- a/phpBB/styles/prosilver/template/memberlist_search.html
+++ b/phpBB/styles/prosilver/template/memberlist_search.html
@@ -1,3 +1,38 @@
+<script>
+ function showHint(str)
+ {
+ if (str.length==0)
+ {
+ document.getElementById("livesearch").innerHTML="";
+ document.getElementById("livesearch").style.border="0px";
+ return;
+ }
+ if (window.XMLHttpRequest)
+ {// code for IE7+, Firefox, Chrome, Opera, Safari
+ xmlhttp=new XMLHttpRequest();
+ }
+ else
+ {// code for IE6, IE5
+ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ xmlhttp.onreadystatechange=function()
+ {
+ if (xmlhttp.readyState==4 && xmlhttp.status==200)
+ {
+ document.getElementById("livesearch").innerHTML=xmlhttp.responseText;
+ document.getElementById("livesearch").style.border="0px";
+ }
+ }
+ xmlhttp.open("GET",'{S_LIVE_SEARCH_ACTION}'+"&q="+str,true);
+ xmlhttp.send();
+ }
+
+ function clearSearch()
+ {
+ document.getElementById("livesearch").innerHTML="";
+ }
+</script>
+
<h2 class="solo">{L_FIND_USERNAME}</h2>
<form method="post" action="{S_MODE_ACTION}" id="search_memberlist">
@@ -9,7 +44,7 @@
<fieldset class="fields1 column1">
<dl>
<dt><label for="username">{L_USERNAME}{L_COLON}</label></dt>
- <dd><input type="text" name="username" id="username" value="{USERNAME}" class="inputbox" /></dd>
+ <dd><input type="text" name="username" id="username" value="{USERNAME}" class="inputbox" onkeyup="showHint(this.value)" onblur="clearSearch()" /> <table class="table1" id="livesearch"></table> </dd>
</dl>
<!-- IF S_EMAIL_SEARCH_ALLOWED -->
<dl>
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index 3d5a0a433d..c8eb5da9a6 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -940,6 +940,17 @@ li.pagination ul {
z-index: 51;
}
+/* Live search box */
+#livesearch {
+ width: 30%;
+ margin: 0px;
+ position: absolute;
+ background-color: #12A3EB;
+ box-shadow: 1px 2px 5px rgb(175,167,167);
+ z-index: 999;
+ overflow: auto;
+}
+
/* Miscellaneous styles
---------------------------------------- */
#forum-permissions {