/
githubmirror
/
vgstation13
Обзор
Документация
Войти
/
githubmirror
/
vgstation13
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
Bleeding-Edge
html/create_object.html
105 строк
3 KB
DamianX
Don't populate the Create Object list on load (#16713)
10 дек 2017, 01:13
10 дек 2017, 01:13
23b20ae
Код
Авторство
О чём код?
<html> <head> <title>Create Object</title> <style type="text/css"> body { font-size: 9pt; font-family: Verdana, sans-serif; } h1, h2, h3, h4, h5, h6 { color: #00f; font-family: Georgia, Arial, sans-serif; } img { border: 0px; } p.lic { font-size: 6pt; } </style> </head> <body> <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="" onkeypress="submitFirst(event)" style="width:280px;height:25"> <input type = "button" value = "Search" onclick = "updateSearch()" /><br><br> Offset: <input type="text" name="offset" value="x,y,z" style="width:250px;height:20"> A <input type="radio" name="offset_type" value="absolute"> R <input type="radio" name="offset_type" value="relative" checked="checked"><br><br> Number: <input type="text" name="object_count" value="1" style="width:30px;height:20"> Dir: <input type="text" name="object_dir" value="2" style="width:30px;height:20"> Name: <input type="text" name="object_name" value="" style="width:180px;height:20"><br><br> Where: <select name='object_where' style="width:320px;height:35"> <option value='onfloor'>On floor below own mob</option> <!-- <option value='inhand'>In own mob's hand</option> --> <option value='inmarked'>In marked object</option> </select> <br><br> <select name="object_list" id="object_list" size="18" multiple style="width:98%;height:62%"></select><br> <input type="submit" value="Spawn"> </form> <script language="JavaScript"> var old_search = ""; var object_list = document.spawner.object_list; var object_paths = null /* object types */; var objects = object_paths == null ? new Array() : object_paths.split(";"); document.spawner.filter.focus(); function populateList(from_list) { object_list.options.length = 0; var i; for (i in from_list) { var new_option = document.createElement("option"); new_option.value = from_list[i]; new_option.text = from_list[i]; object_list.options.add(new_option); } } function updateSearch() { old_search = document.spawner.filter.value; var filtered = new Array(); for(var i in objects) { if(objects[i].indexOf(old_search) < 0) { continue; } filtered.push(objects[i]); } populateList(filtered); } function submitFirst(event) { if (!object_list.options.length) { return false; } if (event.keyCode == 13 || event.which == 13) { object_list.options[0].selected = 'true'; } } </script> </body> </html>