added "No Results" label

This commit is contained in:
2010-03-10 18:09:37 +02:00
parent 933cbc8ab9
commit ece8c849ca
5 changed files with 146 additions and 139 deletions

View File

@@ -1,102 +1,102 @@
var data = [
{"title": "Ädams, Egbert", "info": "Bedfordshire", "href": "/demo/user/1"},
{"title": "Altman, Alisha", "info": "Buckinghamshire", "href": "/demo/user/2"},
{"title": "Archibald, Janna", "info": "Cambridgeshire", "href": "/demo/user/3"},
{"title": "Auman, Cody", "info": "Cheshire", "href": "/demo/user/4"},
{"title": "Bagley, Sheree", "info": "Cornwall", "href": "/demo/user/5"},
{"title": "Ballou, Wilmot", "info": "Cumbria", "href": "/demo/user/6"},
{"title": "Bard, Cassian", "info": "Derbyshire", "href": "/demo/user/1"},
{"title": "Bash, Latanya", "info": "Devon", "href": "/demo/user/2"},
{"title": "Beail, May", "info": "Dorset", "href": "/demo/user/3"},
{"title": "Black, Lux", "info": "Durham", "href": "/demo/user/4"},
{"title": "Bloise, India", "info": "East Sussex", "href": "/demo/user/5"},
{"title": "Blyant, Nora", "info": "Essex", "href": "/demo/user/6"},
{"title": "Bollinger, Carter", "info": "Gloucestershire", "href": "/demo/user/1"},
{"title": "Burns, Jaycob", "info": "Hampshire", "href": "/demo/user/2"},
{"title": "Carden, Preston", "info": "Hertfordshire", "href": "/demo/user/3"},
{"title": "Carter, Merrilyn", "info": "Kent", "href": "/demo/user/4"},
{"title": "Christner, Addie", "info": "Lancashire", "href": "/demo/user/5"},
{"title": "Churchill, Mirabelle", "info": "Leicestershire", "href": "/demo/user/6"},
{"title": "Conkle, Erin", "info": "Lincolnshire", "href": "/demo/user/1"},
{"title": "Countryman, Abner", "info": "Norfolk", "href": "/demo/user/2"},
{"title": "Courtney, Edgar", "info": "Northamptonshire", "href": "/demo/user/3"},
{"title": "Cowher, Antony", "info": "Northumberland", "href": "/demo/user/4"},
{"title": "Craig, Charlie", "info": "North Yorkshire", "href": "/demo/user/5"},
{"title": "Cram, Zacharias", "info": "Nottinghamshire", "href": "/demo/user/6"},
{"title": "Cressman, Ted", "info": "Oxfordshire", "href": "/demo/user/1"},
{"title": "Crissman, Annie", "info": "Shropshire", "href": "/demo/user/2"},
{"title": "Davis, Palmer", "info": "Somerset", "href": "/demo/user/3"},
{"title": "Downing, Casimir", "info": "Staffordshire", "href": "/demo/user/4"},
{"title": "Earl, Missie", "info": "Suffolk", "href": "/demo/user/5"},
{"title": "Eckert, Janele", "info": "Surrey", "href": "/demo/user/6"},
{"title": "Eisenman, Briar", "info": "Warwickshire", "href": "/demo/user/1"},
{"title": "Fitzgerald, Love", "info": "West Sussex", "href": "/demo/user/2"},
{"title": "Fleming, Sidney", "info": "Wiltshire", "href": "/demo/user/3"},
{"title": "Fuchs, Bridger", "info": "Worcestershire", "href": "/demo/user/4"},
{"title": "Fulton, Rosalynne", "info": "Durham", "href": "/demo/user/5"},
{"title": "Fye, Webster", "info": "East Sussex", "href": "/demo/user/6"},
{"title": "Geyer, Rylan", "info": "Essex", "href": "/demo/user/1"},
{"title": "Greene, Charis", "info": "Gloucestershire", "href": "/demo/user/2"},
{"title": "Greif, Jem", "info": "Hampshire", "href": "/demo/user/3"},
{"title": "Guest, Sarahjeanne", "info": "Hertfordshire", "href": "/demo/user/4"},
{"title": "Harper, Phyllida", "info": "Kent", "href": "/demo/user/5"},
{"title": "Hildyard, Erskine", "info": "Lancashire", "href": "/demo/user/6"},
{"title": "Hoenshell, Eulalia", "info": "Leicestershire", "href": "/demo/user/1"},
{"title": "Isaman, Lalo", "info": "Lincolnshire", "href": "/demo/user/2"},
{"title": "James, Diamond", "info": "Norfolk", "href": "/demo/user/3"},
{"title": "Jenkins, Merrill", "info": "Northamptonshire", "href": "/demo/user/4"},
{"title": "Jube, Bennett", "info": "Northumberland", "href": "/demo/user/5"},
{"title": "Kava, Marianne", "info": "North Yorkshire", "href": "/demo/user/6"},
{"title": "Kern, Linda", "info": "Nottinghamshire", "href": "/demo/user/1"},
{"title": "Klockman, Jenifer", "info": "Oxfordshire", "href": "/demo/user/2"},
{"title": "Lacon, Quincy", "info": "Shropshire", "href": "/demo/user/3"},
{"title": "Laurenzi, Leland", "info": "Somerset", "href": "/demo/user/4"},
{"title": "Leichter, Jeane", "info": "Staffordshire", "href": "/demo/user/5"},
{"title": "Leslie, Kerrie", "info": "Suffolk", "href": "/demo/user/6"},
{"title": "Lester, Noah", "info": "Surrey", "href": "/demo/user/1"},
{"title": "Llora, Roxana", "info": "Warwickshire", "href": "/demo/user/2"},
{"title": "Lombardi, Polly", "info": "West Sussex", "href": "/demo/user/3"},
{"title": "Lowstetter, Louisa", "info": "Wiltshire", "href": "/demo/user/4"},
{"title": "Mays, Emery", "info": "Worcestershire", "href": "/demo/user/5"},
{"title": "Mccullough, Bernadine", "info": "Durham", "href": "/demo/user/6"},
{"title": "Mckinnon, Kristie", "info": "East Sussex", "href": "/demo/user/1"},
{"title": "Meyers, Hector", "info": "Essex", "href": "/demo/user/2"},
{"title": "Monahan, Penelope", "info": "Gloucestershire", "href": "/demo/user/3"},
{"title": "Mull, Kaelea", "info": "Hampshire", "href": "/demo/user/4"},
{"title": "Newbiggin, Osmond", "info": "Hertfordshire", "href": "/demo/user/5"},
{"title": "Nickolson, Alfreda", "info": "Kent", "href": "/demo/user/6"},
{"title": "Pawle, Jacki", "info": "Lancashire", "href": "/demo/user/1"},
{"title": "Paynter, Nerissa", "info": "Leicestershire", "href": "/demo/user/2"},
{"title": "Pinney, Wilkie", "info": "Lincolnshire", "href": "/demo/user/3"},
{"title": "Pratt, Ricky", "info": "Norfolk", "href": "/demo/user/4"},
{"title": "Putnam, Stephanie", "info": "Northamptonshire", "href": "/demo/user/5"},
{"title": "Ream, Terrence", "info": "Northumberland", "href": "/demo/user/6"},
{"title": "Rumbaugh, Noelle", "info": "North Yorkshire", "href": "/demo/user/1"},
{"title": "Ryals, Titania", "info": "Nottinghamshire", "href": "/demo/user/2"},
{"title": "Saylor, Lenora", "info": "Oxfordshire", "href": "/demo/user/3"},
{"title": "Schofield, Denice", "info": "Shropshire", "href": "/demo/user/4"},
{"title": "Schuck, John", "info": "Somerset", "href": "/demo/user/5"},
{"title": "Scott, Clover", "info": "Staffordshire", "href": "/demo/user/6"},
{"title": "Smith, Estella", "info": "Suffolk", "href": "/demo/user/1"},
{"title": "Smothers, Matthew", "info": "Surrey", "href": "/demo/user/2"},
{"title": "Stainforth, Maurene", "info": "Warwickshire", "href": "/demo/user/3"},
{"title": "Stephenson, Phillipa", "info": "West Sussex", "href": "/demo/user/4"},
{"title": "Stewart, Hyram", "info": "Wiltshire", "href": "/demo/user/5"},
{"title": "Stough, Gussie", "info": "Worcestershire", "href": "/demo/user/6"},
{"title": "Strickland, Temple", "info": "Durham", "href": "/demo/user/1"},
{"title": "Sullivan, Gertie", "info": "East Sussex", "href": "/demo/user/2"},
{"title": "Swink, Stefanie", "info": "Essex", "href": "/demo/user/3"},
{"title": "Tavoularis, Terance", "info": "Gloucestershire", "href": "/demo/user/4"},
{"title": "Taylor, Kizzy", "info": "Hampshire", "href": "/demo/user/5"},
{"title": "Thigpen, Alwyn", "info": "Hertfordshire", "href": "/demo/user/6"},
{"title": "Treeby, Jim", "info": "Kent", "href": "/demo/user/1"},
{"title": "Trevithick, Jayme", "info": "Lancashire", "href": "/demo/user/2"},
{"title": "Waldron, Ashley", "info": "Leicestershire", "href": "/demo/user/3"},
{"title": "Wheeler, Bysshe", "info": "Lincolnshire", "href": "/demo/user/4"},
{"title": "Whishaw, Dodie", "info": "Norfolk", "href": "/demo/user/5"},
{"title": "Whitehead, Jericho", "info": "Northamptonshire", "href": "/demo/user/6"},
{"title": "Wilks, Debby", "info": "Northumberland", "href": "/demo/user/1"},
{"title": "Wire, Tallulah", "info": "North Yorkshire", "href": "/demo/user/2"},
{"title": "Woodworth, Alexandria", "info": "Nottinghamshire", "href": "/demo/user/3"},
{"title": "Zaun, Jillie", "info": "", "href": ""}
{"title": "Ädams, Egbert", "info": "Bedfordshire", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Altman, Alisha", "info": "Buckinghamshire", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Archibald, Janna", "info": "Cambridgeshire", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Auman, Cody", "info": "Cheshire", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Bagley, Sheree", "info": "Cornwall", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Ballou, Wilmot", "info": "Cumbria", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Bard, Cassian", "info": "Derbyshire", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Bash, Latanya", "info": "Devon", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Beail, May", "info": "Dorset", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Black, Lux", "info": "Durham", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Bloise, India", "info": "East Sussex", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Blyant, Nora", "info": "Essex", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Bollinger, Carter", "info": "Gloucestershire", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Burns, Jaycob", "info": "Hampshire", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Carden, Preston", "info": "Hertfordshire", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Carter, Merrilyn", "info": "Kent", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Christner, Addie", "info": "Lancashire", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Churchill, Mirabelle", "info": "Leicestershire", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Conkle, Erin", "info": "Lincolnshire", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Countryman, Abner", "info": "Norfolk", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Courtney, Edgar", "info": "Northamptonshire", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Cowher, Antony", "info": "Northumberland", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Craig, Charlie", "info": "North Yorkshire", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Cram, Zacharias", "info": "Nottinghamshire", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Cressman, Ted", "info": "Oxfordshire", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Crissman, Annie", "info": "Shropshire", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Davis, Palmer", "info": "Somerset", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Downing, Casimir", "info": "Staffordshire", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Earl, Missie", "info": "Suffolk", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Eckert, Janele", "info": "Surrey", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Eisenman, Briar", "info": "Warwickshire", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Fitzgerald, Love", "info": "West Sussex", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Fleming, Sidney", "info": "Wiltshire", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Fuchs, Bridger", "info": "Worcestershire", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Fulton, Rosalynne", "info": "Durham", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Fye, Webster", "info": "East Sussex", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Geyer, Rylan", "info": "Essex", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Greene, Charis", "info": "Gloucestershire", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Greif, Jem", "info": "Hampshire", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Guest, Sarahjeanne", "info": "Hertfordshire", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Harper, Phyllida", "info": "Kent", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Hildyard, Erskine", "info": "Lancashire", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Hoenshell, Eulalia", "info": "Leicestershire", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Isaman, Lalo", "info": "Lincolnshire", "href": "/demo/user/2", "match": "zzzz"},
{"title": "James, Diamond", "info": "Norfolk", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Jenkins, Merrill", "info": "Northamptonshire", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Jube, Bennett", "info": "Northumberland", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Kava, Marianne", "info": "North Yorkshire", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Kern, Linda", "info": "Nottinghamshire", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Klockman, Jenifer", "info": "Oxfordshire", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Lacon, Quincy", "info": "Shropshire", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Laurenzi, Leland", "info": "Somerset", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Leichter, Jeane", "info": "Staffordshire", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Leslie, Kerrie", "info": "Suffolk", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Lester, Noah", "info": "Surrey", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Llora, Roxana", "info": "Warwickshire", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Lombardi, Polly", "info": "West Sussex", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Lowstetter, Louisa", "info": "Wiltshire", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Mays, Emery", "info": "Worcestershire", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Mccullough, Bernadine", "info": "Durham", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Mckinnon, Kristie", "info": "East Sussex", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Meyers, Hector", "info": "Essex", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Monahan, Penelope", "info": "Gloucestershire", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Mull, Kaelea", "info": "Hampshire", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Newbiggin, Osmond", "info": "Hertfordshire", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Nickolson, Alfreda", "info": "Kent", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Pawle, Jacki", "info": "Lancashire", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Paynter, Nerissa", "info": "Leicestershire", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Pinney, Wilkie", "info": "Lincolnshire", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Pratt, Ricky", "info": "Norfolk", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Putnam, Stephanie", "info": "Northamptonshire", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Ream, Terrence", "info": "Northumberland", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Rumbaugh, Noelle", "info": "North Yorkshire", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Ryals, Titania", "info": "Nottinghamshire", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Saylor, Lenora", "info": "Oxfordshire", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Schofield, Denice", "info": "Shropshire", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Schuck, John", "info": "Somerset", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Scott, Clover", "info": "Staffordshire", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Smith, Estella", "info": "Suffolk", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Smothers, Matthew", "info": "Surrey", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Stainforth, Maurene", "info": "Warwickshire", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Stephenson, Phillipa", "info": "West Sussex", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Stewart, Hyram", "info": "Wiltshire", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Stough, Gussie", "info": "Worcestershire", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Strickland, Temple", "info": "Durham", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Sullivan, Gertie", "info": "East Sussex", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Swink, Stefanie", "info": "Essex", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Tavoularis, Terance", "info": "Gloucestershire", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Taylor, Kizzy", "info": "Hampshire", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Thigpen, Alwyn", "info": "Hertfordshire", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Treeby, Jim", "info": "Kent", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Trevithick, Jayme", "info": "Lancashire", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Waldron, Ashley", "info": "Leicestershire", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Wheeler, Bysshe", "info": "Lincolnshire", "href": "/demo/user/4", "match": "zzzz"},
{"title": "Whishaw, Dodie", "info": "Norfolk", "href": "/demo/user/5", "match": "zzzz"},
{"title": "Whitehead, Jericho", "info": "Northamptonshire", "href": "/demo/user/6", "match": "zzzz"},
{"title": "Wilks, Debby", "info": "Northumberland", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Wire, Tallulah", "info": "North Yorkshire", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Woodworth, Alexandria", "info": "Nottinghamshire", "href": "/demo/user/3", "match": "zzzz"},
{"title": "Zaun, Jillie", "info": "", "href": "/demo/user/4", "match": "zzzz"}
];

View File

@@ -9,8 +9,8 @@
<link rel="stylesheet" href="demo.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script src="../javascripts/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="../suggest_results/jquery.suggest_results.js" type="text/javascript" charset="utf-8"></script>
<script src="../suggest_results/jquery.suggest_results.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../suggest_results/jquery.suggest_results.css" type="text/css" media="screen" title="no title" charset="utf-8">
@@ -29,6 +29,7 @@
$("#example3").suggest_results({
url: "server-side.php",
name: "example3",
empty: false,
limit: 4,
tpl_result_body: '<span class="title">{{title}}</span><span class="info">{{info}}</span>'
});
@@ -41,7 +42,6 @@
/* Example 3 */
#suggest_results.example3 ol li span.info {
color: #888;
font-size: 12px;
}
</style>

View File

@@ -57,27 +57,27 @@
"North Yorkshire", "Nottinghamshire"
);
$aImg = array(
"demo/cast1", "demo/cast2", "demo/cast3", "demo/cast4", "demo/cast5",
"demo/cast6", "demo/cast1", "demo/cast2", "demo/cast3", "demo/cast4",
"demo/cast5", "demo/cast6", "demo/cast1", "demo/cast2", "demo/cast3",
"demo/cast4", "demo/cast5", "demo/cast6", "demo/cast1", "demo/cast2",
"demo/cast3", "demo/cast4", "demo/cast5", "demo/cast6", "demo/cast1",
"demo/cast2", "demo/cast3", "demo/cast4", "demo/cast5", "demo/cast6",
"demo/cast1", "demo/cast2", "demo/cast3", "demo/cast4", "demo/cast5",
"demo/cast6", "demo/cast1", "demo/cast2", "demo/cast3", "demo/cast4",
"demo/cast5", "demo/cast6", "demo/cast1", "demo/cast2", "demo/cast3",
"demo/cast4", "demo/cast5", "demo/cast6", "demo/cast1", "demo/cast2",
"demo/cast3", "demo/cast4", "demo/cast5", "demo/cast6", "demo/cast1",
"demo/cast2", "demo/cast3", "demo/cast4", "demo/cast5", "demo/cast6",
"demo/cast1", "demo/cast2", "demo/cast3", "demo/cast4", "demo/cast5",
"demo/cast6", "demo/cast1", "demo/cast2", "demo/cast3", "demo/cast4",
"demo/cast5", "demo/cast6", "demo/cast1", "demo/cast2", "demo/cast3",
"demo/cast4", "demo/cast5", "demo/cast6", "demo/cast1", "demo/cast2",
"demo/cast3", "demo/cast4", "demo/cast5", "demo/cast6", "demo/cast1",
"demo/cast2", "demo/cast3", "demo/cast4", "demo/cast5", "demo/cast6",
"demo/cast1", "demo/cast2", "demo/cast3", "demo/cast4", "demo/cast5",
"demo/cast6", "demo/cast1", "demo/cast2", "demo/cast3",
$aHref = array(
"/demo/user/1", "/demo/user/2", "/demo/user/3", "/demo/user/4", "/demo/user/5",
"/demo/user/6", "/demo/user/1", "/demo/user/2", "/demo/user/3", "/demo/user/4",
"/demo/user/5", "/demo/user/6", "/demo/user/1", "/demo/user/2", "/demo/user/3",
"/demo/user/4", "/demo/user/5", "/demo/user/6", "/demo/user/1", "/demo/user/2",
"/demo/user/3", "/demo/user/4", "/demo/user/5", "/demo/user/6", "/demo/user/1",
"/demo/user/2", "/demo/user/3", "/demo/user/4", "/demo/user/5", "/demo/user/6",
"/demo/user/1", "/demo/user/2", "/demo/user/3", "/demo/user/4", "/demo/user/5",
"/demo/user/6", "/demo/user/1", "/demo/user/2", "/demo/user/3", "/demo/user/4",
"/demo/user/5", "/demo/user/6", "/demo/user/1", "/demo/user/2", "/demo/user/3",
"/demo/user/4", "/demo/user/5", "/demo/user/6", "/demo/user/1", "/demo/user/2",
"/demo/user/3", "/demo/user/4", "/demo/user/5", "/demo/user/6", "/demo/user/1",
"/demo/user/2", "/demo/user/3", "/demo/user/4", "/demo/user/5", "/demo/user/6",
"/demo/user/1", "/demo/user/2", "/demo/user/3", "/demo/user/4", "/demo/user/5",
"/demo/user/6", "/demo/user/1", "/demo/user/2", "/demo/user/3", "/demo/user/4",
"/demo/user/5", "/demo/user/6", "/demo/user/1", "/demo/user/2", "/demo/user/3",
"/demo/user/4", "/demo/user/5", "/demo/user/6", "/demo/user/1", "/demo/user/2",
"/demo/user/3", "/demo/user/4", "/demo/user/5", "/demo/user/6", "/demo/user/1",
"/demo/user/2", "/demo/user/3", "/demo/user/4", "/demo/user/5", "/demo/user/6",
"/demo/user/1", "/demo/user/2", "/demo/user/3", "/demo/user/4", "/demo/user/5",
"/demo/user/6", "/demo/user/1", "/demo/user/2", "/demo/user/3",
);
@@ -104,7 +104,7 @@
"id"=>($i+1),
"title"=>htmlspecialchars($aUsers[$i]),
"info"=>htmlspecialchars($aInfo[$i]),
"href"=>$aImg[$i],
"href"=>$aHref[$i],
);
}

View File

@@ -1,6 +1,6 @@
#suggest_results {
border-bottom: 1px solid #efefef;
border-bottom: 1px solid rgba(187,187,187,0.5);
display: none;
position: absolute;
z-index: 1000;
@@ -21,7 +21,12 @@
}
#suggest_results li.result {
display: block;
}
#suggest_results li.label {
padding: 3px 5px;
color: #888;
}
#suggest_results li.first {
@@ -33,6 +38,7 @@
}
#suggest_results li.result a {
color: #000;
display: block;
padding: 3px 5px;
text-decoration: none;

View File

@@ -65,7 +65,7 @@
self.query_for_data(elm, options);
} else {
self.current_results = self.filter_data(terms, options.data, options);
self.prerender(self.current_results, options);
self.prerender(elm, self.current_results, options);
};
};
@@ -76,22 +76,24 @@
self.selected_result = null;
};
$.fn.suggest_results.no_results = function(options){
$.fn.suggest_results.no_results = function(elm, options){
var self = $.fn.suggest_results;
if (options.empty) {
//TODO display "No Results" label.
if (options.empty && elm.val() !== "") {
var meta = {label: options.empty_label, "class": "last"};
self.list.html(self.mustache(options.tpl_label, meta));
self.show();
} else {
self.hide(0);
};
};
$.fn.suggest_results.prerender = function(results, options){
$.fn.suggest_results.prerender = function(elm, results, options){
var self = $.fn.suggest_results;
if (results.length > 0) {
self.render(results, options);
self.show();
} else {
self.no_results(options);
self.no_results(elm, options);
};
};
@@ -107,8 +109,7 @@
html += self.mustache(options.tpl_result_body, meta);
html += self.mustache(options.tpl_result_end, meta);
};
self.list.html("");
self.list.append(html);
self.list.html(html);
$(".result", self.list).click(function(){
self.redirect_to($("a", $(this)).attr("href"));
});
@@ -237,7 +238,7 @@
if (term !== "") {
if (self.query_cache.hasOwnProperty(uid)) {
self.current_results = self.query_cache[uid];
self.prerender(self.current_results, options);
self.prerender(elm, self.current_results, options);
} else {
var data = { limit: options.limit };
data[options.url_query_var] = term;
@@ -249,12 +250,12 @@
success: function(response){
self.current_results = response.results;
self.query_cache[uid] = self.current_results;
self.prerender(self.current_results, options);
self.prerender(elm, self.current_results, options);
}
});
};
} else {
self.no_results(options);
self.no_results(elm, options);
};
return [];
};
@@ -329,7 +330,7 @@
url: null,
url_query_var: "search",
url_method: "get",
empty: false,
empty: true,
empty_label: "No Results",
name: "",
delay: 100,
@@ -341,7 +342,7 @@
tpl_result_begin: '<li class="result {{class}}" id="{{id}}"><a href="{{href}}">',
tpl_result_body: '<span class="title">{{title}}</span>',
tpl_result_end: '</a></li>',
tpl_label: '<li class="label {{class}}"{{label}}</li>' //TODO add support for labels/categories
tpl_label: '<li class="label {{class}}">{{label}}</li>' //TODO add support for labels/categories
};
})(jQuery);