Skip to content

Commit

Permalink
Merge 26ef9a7 into 367128f
Browse files Browse the repository at this point in the history
  • Loading branch information
dhakim87 committed Jun 12, 2020
2 parents 367128f + 26ef9a7 commit 436dcc9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions microsetta_private_api/static/input_util.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

function preclude_whitespace(selector)
{
<!--https://stackoverflow.com/questions/12010275/strip-white-spaces-on-input-->
$(selector).bind('input', function(){
$(this).val(function(_, v){
return v.replace(/\s+/g, '');
});
});
}
2 changes: 2 additions & 0 deletions microsetta_private_api/templates/account_details.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<script>
// Wait for the DOM to be ready
$(function() {
preclude_whitespace("#kit_name")
// Initialize form validation on the registration form.
// It has the name attribute "registration"
$("form[name='acct_form']").validate({
Expand Down
Empty file.
2 changes: 2 additions & 0 deletions microsetta_private_api/templates/sitebase.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
<script src="/static/vendor/bootstrap-4.4.1-dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="/static/vendor/bootstrap-4.4.1-dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="/static/css/minimal_interface.css" />
<script src="/static/input_util.js"></script>

{%block head%}
{%endblock%}


<style>
{% if admin_mode %}
body {
Expand Down
3 changes: 3 additions & 0 deletions microsetta_private_api/templates/source.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@
});
};
// Wait for the DOM to be ready
$(document).ready(function(){
preclude_whitespace('#kit_name')
let kit_validation_setup_func = make_kit_validation_setup_func('list_kit_form', kitSubmitHandler);
kit_validation_setup_func()
});
Expand Down

0 comments on commit 436dcc9

Please sign in to comment.