Skip to content

Commit

Permalink
"Search" button for spawn panel
Browse files Browse the repository at this point in the history
  • Loading branch information
ACCount12 committed Aug 27, 2014
1 parent 1aa8611 commit d3f9db3
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions html/create_object.html
Expand Up @@ -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">
Expand All @@ -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">
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d3f9db3

Please sign in to comment.