1

Removing unnecessary form tags, improving options dialog

This commit is contained in:
Alex Yatskov 2014-09-18 15:12:14 +09:00
parent 6015ff22ad
commit 5b908819bb
2 changed files with 50 additions and 57 deletions

View File

@ -90,9 +90,6 @@
ready: function() { ready: function() {
$('#keywords').selectpicker(); $('#keywords').selectpicker();
$('.btn').click(function(e) {
e.preventDefault();
});
$.getJSON('/node/keywords', function(keywords) { $.getJSON('/node/keywords', function(keywords) {
for (var i = 0, count = keywords.length; i < count; ++i) { for (var i = 0, count = keywords.length; i < count; ++i) {

View File

@ -17,60 +17,58 @@
</h1> </h1>
</div> </div>
<div id="input"> <div id="input" class="form-horizontal">
<form class="form-horizontal"> <div class="form-group">
<div class="form-group"> <label for="keywords" class="col-md-2 control-label">Keywords</label>
<label for="keywords" class="col-md-2 control-label">Keywords</label> <div class="col-md-10">
<div class="col-md-10"> <select id="keywords" class="form-control" multiple="multiple" data-max-options="4" data-live-search="data-live-search" name="keywords"></select>
<select id="keywords" class="form-control" multiple="multiple" data-max-options="4" data-live-search="data-live-search" name="keywords"></select>
</div>
</div> </div>
<div class="form-group"> </div>
<label for="minScore" class="col-md-2 control-label">Minimum score</label> <div class="form-group">
<div class="col-md-10"> <label for="minScore" class="col-md-2 control-label">Minimum score</label>
<input class="form-control" type="number" step="any" value="0.25" id="minScore" name="minScore"> <div class="col-md-10">
</div> <input class="form-control" type="number" step="any" value="0.25" id="minScore" name="minScore">
</div> </div>
<div class="form-group"> </div>
<label for="hintSteps" class="col-md-2 control-label">Hint steps</label> <div class="form-group">
<div class="col-md-10"> <label for="hintSteps" class="col-md-2 control-label">Hint steps</label>
<input class="form-control" type="number" value="20" id="hintSteps" name="hintSteps"> <div class="col-md-10">
</div> <input class="form-control" type="number" value="20" id="hintSteps" name="hintSteps">
</div> </div>
<div class="form-group"> </div>
<label for="maxResults" class="col-md-2 control-label">Max results</label> <div class="form-group">
<div class="col-md-10"> <label for="maxResults" class="col-md-2 control-label">Max results</label>
<input class="form-control" type="number" value="100" id="maxResults" name="maxResults"> <div class="col-md-10">
</div> <input class="form-control" type="number" value="100" id="maxResults" name="maxResults">
</div> </div>
<div class="form-group"> </div>
<div class="col-md-offset-2 col-md-10"> <div class="form-group">
<button class="btn btn-primary" id="search" type="button" disabled="disabled"> <div class="col-md-offset-2 col-md-10">
<span class="glyphicon glyphicon-search"></span> Search <button class="btn btn-primary" id="search" type="button" disabled="disabled">
</button> <span class="glyphicon glyphicon-search"></span> Search
</div> </button>
</div> </div>
</form> </div>
</div> </div>
<div class="modal fade options" tabindex="-1"> <div class="modal fade options" tabindex="-1">
<div class="modal-dialog modal-sm"> <div class="modal-dialog modal-sm">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"><big>Options</big></div> <div class="modal-header"><big>Visualization Options</big></div>
<div class="modal-body"> <div class="modal-body">
<form> <div class="form-group">
<label class="checkbox-inline"> <label class="checkbox-inline">
<input type="checkbox" id="useLocalScale" name="useLocalScale" checked="checked"> Use local scale <input type="checkbox" id="useLocalScale" name="useLocalScale" checked="checked"> Use local scale
</label> </label>
</div>
<div class="form-group">
<label class="checkbox-inline"> <label class="checkbox-inline">
<input type="checkbox" id="useRelativeScale" name="useRelativeScale" checked="checked"> Use relative scale <input type="checkbox" id="useRelativeScale" name="useRelativeScale" checked="checked"> Use relative scale
</label> </label>
</form> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<form> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</form>
</div> </div>
</div> </div>
</div> </div>
@ -81,10 +79,8 @@
<div class="panel-heading"> <div class="panel-heading">
<big>Semantic tweaks to <span id="query" class="text-primary"></span></big> <big>Semantic tweaks to <span id="query" class="text-primary"></span></big>
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<form> <button class="btn btn-xs btn-success">Learn...</button>
<button class="btn btn-xs btn-success">Learn...</button> <button class="btn btn-xs btn-default" data-toggle="modal" data-target=".options">Options...</button>
<button class="btn btn-xs btn-default" data-toggle="modal" data-target=".options">Options...</button>
</form>
</div> </div>
</div> </div>
<div style="padding: 10px;" class="unselectable"> <div style="padding: 10px;" class="unselectable">
@ -97,21 +93,21 @@
<div style="padding: 10px;"> <div style="padding: 10px;">
<script id="template" type="text/x-handlers-template"> <script id="template" type="text/x-handlers-template">
{{#if results}} {{#if results}}
<table class="table table-striped table-condensed"> <table class="table table-striped table-condensed">
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>
<th>Name</th> <th>Name</th>
<th>Score</th> <th>Score</th>
</tr> </tr>
</thead> </thead>
{{#each results}} {{#each results}}
<tr> <tr>
<td>{{@index}}</td> <td>{{@index}}</td>
<td><a href="{{url}}">{{name}}</a></td> <td><a href="{{url}}">{{name}}</a></td>
<td>{{score}}</td> <td>{{score}}</td>
</tr> </tr>
{{/each}} {{/each}}
</table> </table>
{{/if}} {{/if}}
</script> </script>