Permalink
Browse files

"Search" button for spawn panel

  • Loading branch information...
1 parent 1aa8611 commit d3f9db3609fd1f43f65ef2087c45fa5f55b6a9fa @ACCount12 ACCount12 committed Aug 26, 2014
Showing with 5 additions and 12 deletions.
  1. +5 −12 html/create_object.html
@@ -27,7 +27,7 @@
<form name="spawner" action="byond://?src=/* ref src */" method="get">
<input type="hidden" name="src" value="/* ref src */">
- Type <input type="text" name="filter" value="" onkeyup="updateSearch()" onkeypress="submitFirst(event)" style="width:350px"><br>
+ Type <input type="text" name="filter" value="" onkeypress="submitFirst(event)" style="width:77%"> <input type = "button" value = "Search" onclick = "updateSearch()" style="width:50px;height:22px" /><br>
Offset: <input type="text" name="offset" value="x,y,z" style="width:250px">
A <input type="radio" name="offset_type" value="absolute">
@@ -43,8 +43,8 @@
<option value='inmarked'>In marked object</option>
</select>
<br><br>
- <select name="object_list" id="object_list" size="18" multiple style="width:98%"></select><br>
- <input type="submit" value="spawn">
+ <select name="object_list" id="object_list" size="18" multiple style="width:100%"></select><br>
+ <input type="submit" value="Spawn" style="width:100%">
</form>
<script language="JavaScript">
@@ -72,19 +72,12 @@
function updateSearch()
{
- if (old_search == document.spawner.filter.value)
- {
- return;
- }
-
old_search = document.spawner.filter.value;
-
var filtered = new Array();
- var i;
- for (i in objects)
+ for(var i in objects)
{
- if(objects[i].search(old_search) < 0)
+ if(objects[i].indexOf(old_search) < 0)
{
continue;
}

0 comments on commit d3f9db3

Please sign in to comment.