Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto focus primary form input on page load #363

Merged
merged 2 commits into from
Apr 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mutalyzer/website/templates/back-translator.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<form class="form" action="{{ url_for('.back_translator') }}" method="get">
<div class="form-group">
<label for="description">Variant description</label>
<input class="form-control form-pre" type="text"
<input class="form-control form-pre" type="text" autofocus
name="description" id="description" value="{{ description }}" placeholder="Variant description using HGVS format">
<p>Examples:
<code class="example-input" data-for="description">NM_003002.3:p.Asp92Tyr</code>,
Expand Down
2 changes: 1 addition & 1 deletion mutalyzer/website/templates/batch-jobs.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<div class="form-group">
<label for="email">Email address (optional)</label>
<input name="email" id="email" type="email"
<input name="email" id="email" type="email" autofocus
class="form-control with-mailcheck"
placeholder="Email address (notification will be sent here)"
value="{{ email }}">
Expand Down
2 changes: 1 addition & 1 deletion mutalyzer/website/templates/description-extractor.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h4>Reference input</h4>
<div class="subform" id="reference_raw_method" style="display: {{ '' if reference_method == 'raw_method' or not reference_method else 'none' }}">
<div class="form-group">
<label for="reference_sequence">Reference sequence</label>
<textarea name="reference_sequence" id="reference_sequence" class="form-control form-pre" placeholder="Reference sequence">{{ reference_sequence }}</textarea>
<textarea name="reference_sequence" id="reference_sequence" class="form-control form-pre" placeholder="Reference sequence" autofocus>{{ reference_sequence }}</textarea>
<p>Example: <code class="example-input" data-for="reference_sequence">ATGATGATCAGATACAGTGTGATACAGGTAGTTAGACAA</code></p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion mutalyzer/website/templates/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h3><a href="{{ url_for('.name_checker') }}">Name Checker</a></h3>

<form class="form" action="{{ url_for('.name_checker') }}" method="get">
<div class="input-group">
<input class="form-control form-control-small form-pre" type="text" name="description" id="description" value="{{ description }}" placeholder="Variant description using HGVS format">
<input class="form-control form-control-small form-pre" type="text" name="description" id="description" value="{{ description }}" placeholder="Variant description using HGVS format" autofocus>
<span class="input-group-btn">
<input type="submit" class="btn btn-primary pull-right" value="Check variant description">
</span>
Expand Down
2 changes: 1 addition & 1 deletion mutalyzer/website/templates/name-checker.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h1>Name Checker</h1>
<form class="form" action="{{ url_for('.name_checker') }}" method="get">
<div class="form-group">
<label for="description">Variant description</label>
<input class="form-control form-pre" type="text"
<input class="form-control form-pre" type="text" autofocus
name="description" id="description" value="{{ description }}"
placeholder="Variant description using HGVS format">
<p>Examples:
Expand Down
2 changes: 1 addition & 1 deletion mutalyzer/website/templates/name-generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h4>Reference</h4>
<div class="form-group">
<label for="control-refe" class="col-sm-2 control-label">Reference sequence</label>
<div class="col-sm-10">
<input type="text" name="refe" id="control-refe" value=""class="form-control" placeholder="Reference" >
<input type="text" name="refe" id="control-refe" value=""class="form-control" placeholder="Reference" autofocus>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion mutalyzer/website/templates/position-converter.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</div>
<div class="form-group">
<label for="description">Variant description</label>
<input type="text" name="description" id="description" value="{{ description }}"
<input type="text" name="description" id="description" value="{{ description }}" autofocus
class="form-control form-pre" placeholder="Variant description using HGVS format">
<p>Examples:
<code class="example-input"
Expand Down
4 changes: 2 additions & 2 deletions mutalyzer/website/templates/snp-converter.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<form role="form" class="form" action="{{ url_for('.snp_converter') }}" method="get">
<div class="form-group">
<label for="rsid">SNP</label>
<input type="text" class="form-control form-pre"
name="rs_id" id="rsid" placeholder="dbSNP rs number (including rs)" value="{{ rs_id }}" ></input>
<input type="text" class="form-control form-pre" autofocus
name="rs_id" id="rsid" placeholder="dbSNP rs number (including rs)" value="{{ rs_id }}" ></input>
<p>Example: <code class="example-input" data-for="rsid">rs9919552</code></p>
</div>

Expand Down
2 changes: 2 additions & 0 deletions mutalyzer/website/templates/static/js/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function clearField(form, fieldName) {
}

$(document).ready(function() {
// Populate form element with example input on click.
$(document).on('click', '.example-input', function(event) {
var target = document.getElementById($(this).data('for'));

Expand All @@ -37,6 +38,7 @@ $(document).ready(function() {
event.stopPropagation();
});

// Toggle visibility of form sections on click.
$(document).on('change', '.input-select', function(event) {
var context = document.getElementById(
$(this).data('context')).getElementsByClassName('subform'),
Expand Down
2 changes: 1 addition & 1 deletion mutalyzer/website/templates/syntax-checker.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<form class="form" action="{{ url_for('.syntax_checker') }}" method="get">
<div class="form-group">
<label for="description">Variant description</label>
<input class="form-control form-pre" type="text"
<input class="form-control form-pre" type="text" autofocus
name="description" id="description" value="{{ description }}" placeholder="Variant description using HGVS format">
<p>Example: <code class="example-input" data-for="description">AB026906.1:c.274G&gt;T</code></p>
</div>
Expand Down