[MIRROR] prettier all part two (#11229)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-07-24 00:38:18 -07:00
committed by GitHub
parent cd7d7fcff5
commit 023f5367d4
3 changed files with 130 additions and 110 deletions

View File

@@ -8,7 +8,6 @@ juke
**/dist **/dist
**/node_modules **/node_modules
html/templates html/templates
html/create_object.html
# File names / types # File names / types
*.min.* *.min.*

View File

@@ -1,16 +1,18 @@
<html> <html>
<head>
<head>
<title>Create Object</title> <title>Create Object</title>
<style type="text/css"> <style type="text/css">
body body {
{
font-size: 9pt; font-size: 9pt;
font-family: Verdana, sans-serif; font-family: Verdana, sans-serif;
} }
h1, h2, h3, h4, h5, h6 h1,
{ h2,
h3,
h4,
h5,
h6 {
color: #00f; color: #00f;
font-family: Georgia, Arial, sans-serif; font-family: Georgia, Arial, sans-serif;
} }
@@ -21,82 +23,105 @@
font-size: 6pt; font-size: 6pt;
} }
</style> </style>
</head> </head>
<body> <body>
<form name="spawner" action="byond://?src=/* ref src */" method="get"> <form name="spawner" action="byond://?src=/* ref src */" method="get">
<input type="hidden" name="src" value="/* ref src */"> <input type="hidden" name="src" value="/* ref src */" />
/* hreftokenfield */ /* hreftokenfield */
<input type="hidden" name="action" value="object_list"> <input type="hidden" name="action" value="object_list" />
Type <input type="text" name="filter" value="" onkeypress="submitFirst(event)" style="width:280px;height:25"> <input type = "button" value = "Search" onclick = "updateSearch()" /><br> Type
Offset: <input type="text" name="offset" value="x,y,z" style="width:250px"> <input
type="text"
name="filter"
value=""
onkeypress="submitFirst(event)"
style="width: 280px; height: 25"
/>
<input type="button" value="Search" onclick="updateSearch()" /><br />
Offset:
<input type="text" name="offset" value="x,y,z" style="width: 250px" />
A <input type="radio" name="offset_type" value="absolute"> A <input type="radio" name="offset_type" value="absolute" /> R
R <input type="radio" name="offset_type" value="relative" checked="checked"><br> <input
type="radio"
name="offset_type"
value="relative"
checked="checked"
/><br />
Number: <input type="text" name="object_count" value="1" style="width:30px"> Number:
Dir: <input type="text" name="object_dir" value="2" style="width:30px"> <input type="text" name="object_count" value="1" style="width: 30px" />
Name: <input type="text" name="object_name" value="" style="width:180px"><br> Dir:
<input type="text" name="object_dir" value="2" style="width: 30px" />
Name:
<input
type="text"
name="object_name"
value=""
style="width: 180px"
/><br />
Where: Where:
<select name='object_where' style="width:320px"> <select name="object_where" style="width: 320px">
<option value='onfloor'>On floor below own mob</option> <option value="onfloor">On floor below own mob</option>
<!-- <option value='inhand'>In own mob's hand</option> --> <!-- <option value='inhand'>In own mob's hand</option> -->
<option value='inmarked'>In marked object</option> <option value="inmarked">In marked object</option>
</select> </select>
<br><br> <br /><br />
Number of matches: <input id="number" value="0" style="width:180px"><br> Number of matches:
<br><br> <input id="number" value="0" style="width: 180px" /><br />
<br /><br />
<div id="selector_hs"> <div id="selector_hs">
<select name="object_list" id="object_list" multiple size="20"> <select name="object_list" id="object_list" multiple size="20"></select>
</select>
</div> </div>
<br> <br />
<input type="submit" value="spawn"> <input type="submit" value="spawn" />
</form> </form>
<script language="JavaScript"> <script language="JavaScript">
var old_search = ""; var old_search = "";
var object_list = document.spawner.object_list; var object_list = document.spawner.object_list;
var object_list_container = document.getElementById('selector_hs'); var object_list_container = document.getElementById("selector_hs");
var object_paths = null /* object types */; // prettier-ignore
var objects = object_paths == null ? new Array() : object_paths.split(";"); var object_paths = (null /* object types */);
var objects =
object_paths == null ? new Array() : object_paths.split(";");
document.spawner.filter.focus(); document.spawner.filter.focus();
populateList(objects); populateList(objects);
function populateList(from_list) function populateList(from_list) {
{ var newOpts = "";
var newOpts = '';
var i; var i;
for (i in from_list) for (i in from_list) {
{ newOpts +=
newOpts += '<option value="' + from_list[i] + '">' '<option value="' +
+ from_list[i] + '</option>'; from_list[i] +
'">' +
from_list[i] +
"</option>";
} }
object_list_container.innerHTML = '<select name="object_list" id="object_list" multiple size="20">' + object_list_container.innerHTML =
newOpts + '</select>'; '<select name="object_list" id="object_list" multiple size="20">' +
newOpts +
"</select>";
document.getElementById("number").value = from_list.length; document.getElementById("number").value = from_list.length;
} }
function updateSearch() function updateSearch() {
{ if (old_search == document.spawner.filter.value) {
if (old_search == document.spawner.filter.value)
{
return false; return false;
} }
old_search = document.spawner.filter.value; old_search = document.spawner.filter.value;
var filtered = new Array(); var filtered = new Array();
var i; var i;
for (i in objects) for (i in objects) {
{ if (objects[i].search(old_search) < 0) {
if(objects[i].search(old_search) < 0)
{
continue; continue;
} }
@@ -106,24 +131,20 @@
populateList(filtered); populateList(filtered);
if (object_list.options.length) if (object_list.options.length)
object_list.options[0].selected = 'true'; object_list.options[0].selected = "true";
return true; return true;
} }
function submitFirst(event) function submitFirst(event) {
{ if (!object_list.options.length) {
if (!object_list.options.length)
{
return false; return false;
} }
if (event.keyCode == 13 || event.which == 13) if (event.keyCode == 13 || event.which == 13) {
{ object_list.options[0].selected = "true";
object_list.options[0].selected = 'true';
} }
} }
</script> </script>
</body> </body>
</html> </html>