Skip to content

Commit

Permalink
Update URL on Submit + Re-center form labels
Browse files Browse the repository at this point in the history
due to the update of Boostrap v4-alpha.2 to v4-alpha.3
  • Loading branch information
chuushi committed Aug 18, 2016
1 parent f64db8a commit ae43f98
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 34 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ v0.9.2 - August 17, 2016
- New feature:
- Now using minecraft.woff and a sign image to display sign data to better
replicate the sign in-game.
- Making a lookup will update the URL to make the output look the same even
when you give the link to someone else and they make a lookup with it right
away.
- Fix:
- Container option is fixed.
- The date ordering for multiple action search is fixed.
Expand Down
27 changes: 15 additions & 12 deletions web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<div class="card-header"><span class="h4 card-title">Make a Lookup</span></div>
<form id="lookupForm" class="card-block" role="form" method="get" action="./">
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="lServer">Server Name</label>
<label class="col-sm-2 col-form-label" for="lServer">Server Name</label>
<div class="col-sm-10">
<select class="form-control" id="lServer" name="server">
<?php
Expand All @@ -114,7 +114,7 @@
</div>
</div>
<div class="form-group row">
<div class="col-lg-2 form-control-label">Actions</div>
<div class="col-lg-2 col-form-label">Actions</div>
<div class="dtButtons btn-group col-lg-10">
<label class="btn btn-secondary" for="lABl" data-toggle="tooltip" data-placement="top" title="Block manipulation">
<input type="checkbox" id="lABl" name="a[]" value="block"<?php if (!$gr || in_array("block",$_GET['a'])) echo " checked";?>>
Expand Down Expand Up @@ -151,7 +151,7 @@
</div>
</div>
<div class="form-group row">
<div class="col-lg-2 form-control-label">Toggle</div>
<div class="col-lg-2 col-form-label">Toggle</div>
<div class="col-lg-10">
<button class="btn btn-secondary" type="button" id="lRCToggle">Radius/Corners</button>
<span class="dtButtons btn-group">
Expand All @@ -171,7 +171,7 @@
</div>
</div>
<div class="form-group row">
<label id="lCorner1" class="col-sm-2 form-control-label" for="lCX">Center / Corner 1</label>
<label id="lCorner1" class="col-sm-2 col-form-label" for="lCX">Center / Corner 1</label>
<div class="col-lg-4 col-sm-10 groups-line">
<div class="input-group" id="lC1">
<input class="form-control" type="number" id="lCX" name="xyz[]" placeholder="x"<?php if ($gr && isset($_GET["xyz"][0])) echo ' value="'.$_GET["xyz"][0].'"';?>>
Expand All @@ -181,7 +181,7 @@
<input class="form-control" type="number" id="lCZ" name="xyz[]" placeholder="z"<?php if ($gr && isset($_GET["xyz"][2])) echo ' value="'.$_GET["xyz"][2].'"';?>>
</div>
</div>
<label id="lCorner2" class="col-sm-2 form-control-label" for="lCX2">Radius / Corner 2</label>
<label id="lCorner2" class="col-sm-2 col-form-label" for="lCX2">Radius / Corner 2</label>
<div class="col-lg-4 col-sm-10">
<div class="input-group" id="lC2">
<input class="form-control" type="number" id="lCX2" name="xyz2[]" placeholder="Radius or x"<?php if ($gr && (isset($_GET["xyz"][0]) || isset($_GET["r"]))) echo ' value="'.(isset($_GET["xyz"][0]) ? $_GET["xyz2"][0] : $_GET["r"]).'"';?>>
Expand All @@ -193,13 +193,13 @@
</div>
</div>
<div class="form-group row">
<label class="col-xs-2 form-control-label" for="lWorld">World</label>
<label class="col-xs-2 col-form-label" for="lWorld">World</label>
<div class="col-xs-10">
<input class="form-control autocomplete" data-query-table="world" type="text" id="lWorld" name="wid" placeholder="world"<?php if ($gr && isset($_GET["wid"])) echo ' value="'.$_GET["wid"].'"';?>>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 form-control-label" for="lU">Users</label>
<label class="col-lg-2 col-form-label" for="lU">Users</label>
<div class="col-lg-10">
<div class="input-group">
<span class="dtButtons input-group-btn">
Expand All @@ -213,7 +213,7 @@
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 form-control-label" for="lB">Blocks</label>
<label class="col-lg-2 col-form-label" for="lB">Blocks</label>
<div class="col-lg-10">
<div class="input-group">
<span class="dtButtons input-group-btn">
Expand All @@ -227,12 +227,12 @@
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="lKeyword">Keyword</label>
<label class="col-sm-2 col-form-label" for="lKeyword">Keyword</label>
<div class="col-sm-10">
<input class="form-control" type="text" id="lKeyword" name="keyword"<?php if ($gr && isset($_GET["keyword"])) echo ' value="'.$_GET["keyword"].'"';?> data-toggle="tooltip" data-placement="top" title='Space [&nbsp;] for AND. Comma [,] for OR. Enclose terms in quotes [""] to escape spaces/commas. Only applies to chat and command.'></div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="lT">Date/Time</label>
<label class="col-sm-2 col-form-label" for="lT">Date/Time</label>
<div class="col-lg-4 col-sm-10 groups-line">
<div class="input-group">
<span class="dtButtons input-group-btn">
Expand All @@ -241,11 +241,11 @@
Reverse
</label>
</span>
<input class="form-control" type="datetime-local" id="lT" name="t" placeholder="0000-00-00T00:00:00"<?php if ($gr && isset($_GET["t"])) echo ' value="'.$_GET["t"].'"';?>>
<input class="form-control" type="<?php echo ($gr && isset($_GET["t"]) && is_numeric($_GET["t"])) ? "number" : "datetime-local";?>" id="lT" name="t" placeholder="0000-00-00T00:00:00"<?php if ($gr && isset($_GET["t"])) echo ' value="'.$_GET["t"].'"';?>>
</div>
</div>
<input type="hidden" name="unixtime" value="on">
<label class="col-sm-2 form-control-label" for="lLimit">Limit</label>
<label class="col-sm-2 col-form-label" for="lLimit">Limit</label>
<div class="col-lg-4 col-sm-10">
<input class="form-control" type="number" id="lLimit" name="lim" min="1" placeholder="<?php echo $c['form']['limit'];?>"<?php if ($gr && isset($_GET['lim'])) echo ' value="'.$_GET['lim'].'"';?>>
</div>
Expand Down Expand Up @@ -338,6 +338,9 @@
document.getElementById("lT").setAttribute("placeholder","")
document.getElementById("lT").setAttribute("type","text");
document.getElementById("lT").removeAttribute("name");

document.getElementById("lSubmit").disabled = true;
document.getElementById("mSubmit").disabled = true;
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js">// JQuery</script>
<script src="res/js/buttons.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions web/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="inputUser">Username</label>
<label class="col-sm-2 col-form-label" for="inputUser">Username</label>
<div class="col-sm-10"><input class="form-control" type="text" id="inputUser" placeholder="Username" name="bah" required autofocus></div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="inputPass">Password</label>
<label class="col-sm-2 col-form-label" for="inputPass">Password</label>
<div class="col-sm-10"><input class="form-control" type="password" id="inputPass" placeholder="Password" name="dun" required></div>
</div>
<div class="row">
Expand Down
8 changes: 7 additions & 1 deletion web/res/js/lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ $.getJSON("config.json", function(data) {
.format(c.form.dateFormat+" "+c.form.timeFormat));

$date.datetimepicker({format:c.form.dateFormat+" "+c.form.timeFormat});

// Unlock the lookup button
$submit.prop("disabled", false);
});

$('[data-toggle="tooltip"]').tooltip();
Expand Down Expand Up @@ -294,7 +297,10 @@ $form.submit(function(e) {
} else {
time += moment(Date.now()).format("X");
}
s.data += time;

// Set the URL and data
window.history.replaceState(null, "", "?" + (s.data += time))

// Set offset
$moreOffset.val($limit.val() !== "" ? parseInt($limit.val()) : 30);

Expand Down
38 changes: 19 additions & 19 deletions web/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
<input class="jsCheck" type="hidden" name="js" value="disabled">
<input type="hidden" name="submit" value="server">
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="dbSelect">Server Name</label>
<label class="col-sm-2 col-form-label" for="dbSelect">Server Name</label>
<div class="col-sm-10">
<div class="input-group">
<select class="form-control" id="dbSelect" name="name">
Expand All @@ -332,7 +332,7 @@
</div>
</div>
<div class="form-group row">
<div class="col-md-2 form-control-label">Database</div>
<div class="col-md-2 col-form-label">Database</div>
<div class="col-md-10">
<span class="dtButtons btn-group">
<label class="btn btn-secondary" for="dbMySQL">
Expand All @@ -356,37 +356,37 @@
</div>
</div>
<div class="form-group row dbCheckMySQL">
<label class="col-sm-2 form-control-label" for="dbHost">Host/IP(:port)</label>
<label class="col-sm-2 col-form-label" for="dbHost">Host/IP(:port)</label>
<div class="col-sm-10">
<input class="form-control" type="text" id="dbHost" name="host" placeholder="127.0.0.1">
</div>
</div>
<div class="form-group row dbCheckMySQL">
<label class="col-sm-2 form-control-label" for="dbUser">Username</label>
<label class="col-sm-2 col-form-label" for="dbUser">Username</label>
<div class="col-sm-10">
<input class="form-control" type="text" id="dbUser" name="user" placeholder="Username">
</div>
</div>
<div class="form-group row dbCheckMySQL">
<label class="col-sm-2 form-control-label" for="dbPass">Password</label>
<label class="col-sm-2 col-form-label" for="dbPass">Password</label>
<div class="col-sm-10">
<input class="form-control" type="password" id="dbPass" name="pass" placeholder="Password">
</div>
</div>
<div class="form-group row dbCheckMySQL">
<label class="col-sm-2 form-control-label" for="dbData">Database</label>
<label class="col-sm-2 col-form-label" for="dbData">Database</label>
<div class="col-sm-10">
<input class="form-control" type="text" id="dbData" name="data" placeholder="CoreProtect">
</div>
</div>
<div class="form-group row" id="dbCheckSQLite">
<label class="col-sm-2 form-control-label" for="dbPath">Path</label>
<label class="col-sm-2 col-form-label" for="dbPath">Path</label>
<div class="col-sm-10">
<input class="form-control" type="text" id="dbPath" name="path" value="<?php echo __DIR__ ?>">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="dbPrefix">Prefix</label>
<label class="col-sm-2 col-form-label" for="dbPrefix">Prefix</label>
<div class="col-sm-10">
<div class="input-group">
<span class="dtButtons updateButton input-group-btn"><label class="btn btn-outline-warning" for="dbPrefixU"><input type="checkbox" id="dbPrefixU" name="update[]" value="prefix">Change</label></span>
Expand All @@ -395,7 +395,7 @@
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="dbDmURL">Dynmap URL</label>
<label class="col-sm-2 col-form-label" for="dbDmURL">Dynmap URL</label>
<div class="col-sm-10">
<div class="input-group">
<span class="dtButtons updateButton input-group-btn"><label class="btn btn-outline-warning" for="dbDmURLC"><input type="checkbox" id="dbDmURLC" name="update[]" value="dynmapURL">Change</label></span>
Expand All @@ -404,7 +404,7 @@
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="dbDmZoom">Dynmap Zoom</label>
<label class="col-sm-2 col-form-label" for="dbDmZoom">Dynmap Zoom</label>
<div class="col-sm-10">
<div class="input-group">
<span class="dtButtons updateButton input-group-btn"><label class="btn btn-outline-warning" for="dbDmZoomC"><input type="checkbox" id="dbDmZoomC" name="update[]" value="dynmapZoom">Change</label></span>
Expand All @@ -413,7 +413,7 @@
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="dbDmMap">Dynmap Map</label>
<label class="col-sm-2 col-form-label" for="dbDmMap">Dynmap Map</label>
<div class="col-sm-10">
<div class="input-group">
<span class="dtButtons updateButton input-group-btn"><label class="btn btn-outline-warning" for="dbDmMapC"><input type="checkbox" id="dbDmMapC" name="update[]" value="dynmapMap">Change</label></span>
Expand Down Expand Up @@ -441,31 +441,31 @@
<input class="jsCheck" type="hidden" name="js" value="disabled">
<input type="hidden" name="submit" value="config">
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="cfDate">Date Format</label>
<label class="col-sm-2 col-form-label" for="cfDate">Date Format</label>
<div class="col-sm-10"><input class="form-control" type="text" id="cfDate" name="dateFormat" placeholder="ll" value="<?php echo $cj['form']['dateFormat'];?>"></div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="cfTime">Time Format</label>
<label class="col-sm-2 col-form-label" for="cfTime">Time Format</label>
<div class="col-sm-10"><input class="form-control" type="text" id="cfTime" name="timeFormat" placeholder="LTS" value="<?php echo $cj['form']['timeFormat'];?>"></div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="cfTDiv">Tab Interval (s)</label>
<label class="col-sm-2 col-form-label" for="cfTDiv">Tab Interval (s)</label>
<div class="col-sm-10"><input class="form-control" type="number" id="cfTdiv" name="timeDividor" placeholder="300" value="<?php echo $cj['form']['timeDividor'];?>"></div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="cfPage">Page Interval</label>
<label class="col-sm-2 col-form-label" for="cfPage">Page Interval</label>
<div class="col-sm-10"><input class="form-control" type="number" id="cfPage" name="pageInterval" placeholder="25" value="<?php echo $cj['form']['pageInterval'];?>"></div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="cfLimit">Query Limit</label>
<label class="col-sm-2 col-form-label" for="cfLimit">Query Limit</label>
<div class="col-sm-10"><input class="form-control" type="number" id="cfLimit" name="limit" placeholder="30" value="<?php echo $c['form']['limit'];?>"></div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="cfMoreLimit">Load More Limit</label>
<label class="col-sm-2 col-form-label" for="cfMoreLimit">Load More Limit</label>
<div class="col-sm-10"><input class="form-control" type="number" id="cfMoreLimit" name="moreLimit" placeholder="10" value="<?php echo $c['form']['loadMoreLimit'];?>"></div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="cfCopy">Item names</label>
<label class="col-sm-2 col-form-label" for="cfCopy">Item names</label>
<div class="col-sm-10">
<select class="form-control" id="cfCopy" name="bukkitToMc">
<option value="true"<?php if ($c['flag']['bukkitToMc']) echo " selected";?>>Mincraft item names</option>
Expand All @@ -474,7 +474,7 @@
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label" for="cfCopy">Copyright</label>
<label class="col-sm-2 col-form-label" for="cfCopy">Copyright</label>
<div class="col-sm-10"><input class="form-control" type="text" id="cfCopy" name="copyright" placeholder="SimonOrJ, 2015-%year%" value="<?php echo $c['copyright'];?>"></div>
</div>
<div class="row">
Expand Down

0 comments on commit ae43f98

Please sign in to comment.