Skip to content

Commit

Permalink
Merge pull request #569 from CityOfNewYork/johnyu95-fix-custom-forms-…
Browse files Browse the repository at this point in the history
…loading

Fix Custom Forms Loading
  • Loading branch information
zgary authored Nov 8, 2023
2 parents bde8d95 + 970e9ae commit 8d8cd25
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 33 deletions.
10 changes: 4 additions & 6 deletions app/static/js/request/new-request-agency.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
"use strict";

$(document).ready(function () {
$(window).on("load", function () {
// Determine if the agencyRequestInstructions and custom request forms need to be shown on page load.
getRequestAgencyInstructions();
// Check for custom request forms on page load (browser back button behavior).
getCustomRequestForms($("#request-agency").val());
});
// Determine if the agencyRequestInstructions and custom request forms need to be shown on page load.
getRequestAgencyInstructions();
// Check for custom request forms on page load (browser back button behavior).
getCustomRequestForms($("#request-agency").val());

$("input[name='tz-name']").val(jstz.determine().name());

Expand Down
10 changes: 4 additions & 6 deletions app/static/js/request/new-request-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
"use strict";

$(document).ready(function () {
$(window).on("load", function () {
// Determine if the agencyRequestInstructions need to be shown on page load.
getRequestAgencyInstructions();
// Check for custom request forms on page load (browser back button behavior).
getCustomRequestForms($("#request-agency").val());
});
// Determine if the agencyRequestInstructions need to be shown on page load.
getRequestAgencyInstructions();
// Check for custom request forms on page load (browser back button behavior).
getCustomRequestForms($("#request-agency").val());

$("input[name='tz-name']").val(jstz.determine().name());

Expand Down
1 change: 0 additions & 1 deletion app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
</div>
<script type="text/javascript"
src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/plugins/jquery.js') }}"></script>
{{ moment.include_moment(local_js=url_for('static', filename='js/plugins/moment.min.js')) }}
<script type="text/javascript" src="{{ url_for('static', filename='js/plugins/bootstrap.min.js') }}"></script>
Expand Down
1 change: 1 addition & 0 deletions app/templates/main/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ <h1 class="text-center">Technical Support</h1>
{% endblock %}

{% block custom_script %}
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/plugins/parsley.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/request/contact.js') }}"></script>
{% endblock %}
1 change: 1 addition & 0 deletions app/templates/request/new_request_anon.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ <h3>Address</h3>
{% endblock %}

{% block custom_script %}
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/plugins/jquery-ui.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/plugins/parsley.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/plugins/jquery.mask.js') }}"></script>
Expand Down
38 changes: 18 additions & 20 deletions app/templates/request/new_request_anon.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,24 @@
"use strict";

$(document).ready(function () {
$(window).on("load", function () {
{% if kiosk_mode %}
$("#request-category").prop('disabled', true);
$("#request-agency").prop('disabled', true);
$("#request-title").prop('disabled', true);
{% endif %}
{% if category %}
$("#request-category option[value=\"{{ category }}\"]").attr('selected', 'selected');
{% endif %}
{% if agency %}
$("#request-agency option[value={{ agency }}]").attr('selected', 'selected');
{% endif %}
{% if title %}
$("#request-title").val("{{ title }}");
{% endif %}
// Determine if the agencyRequestInstructions need to be shown on page load.
getRequestAgencyInstructions();
// Check for custom request forms on page load (browser back button behavior).
getCustomRequestForms($("#request-agency").val());
});
{% if kiosk_mode %}
$("#request-category").prop('disabled', true);
$("#request-agency").prop('disabled', true);
$("#request-title").prop('disabled', true);
{% endif %}
{% if category %}
$("#request-category option[value=\"{{ category }}\"]").attr('selected', 'selected');
{% endif %}
{% if agency %}
$("#request-agency option[value={{ agency }}]").attr('selected', 'selected');
{% endif %}
{% if title %}
$("#request-title").val("{{ title }}");
{% endif %}
// Determine if the agencyRequestInstructions need to be shown on page load.
getRequestAgencyInstructions();
// Check for custom request forms on page load (browser back button behavior).
getCustomRequestForms($("#request-agency").val());

$("input[name='tz-name']").val(jstz.determine().name());

Expand Down
1 change: 1 addition & 0 deletions app/templates/request/new_request_user.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ <h1>Request a Record</h1>
{% endblock %}

{% block custom_script %}
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/plugins/jquery-ui.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/plugins/parsley.min.js') }}"></script>
<script type="text/javascript"
Expand Down

0 comments on commit 8d8cd25

Please sign in to comment.