You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge branch 'maintenance/JavaScript-cleanup' into develop
Significant refactoring and cleanup of JavaScript files and dependencies in order to reduce the payload and improve both maintenance and performance.
Functionality
- Established new `InlineScript` section and moved all inline scripts to it; this ensures scripts don't fire until the DOM is ready (efd1931)
- Ensured all sidecar scripts relying on JavaScript waited for `$(document).ready()`—this was missing for most view-based scripts (b29ce46)
Performance
- Imported each Foundation plugin individually, instead of as a comprehensive bundle, thus reducing the overall payload (5705a4c, a694fbd)
- Marked (nearly) all JavaScript references as `defer` so that they aren't blocking the initial page rendering (569509f, 844b5bc)
- Imported only the DASH Media Player, instead of the comprehensive bundle, thus reducing the payload by a small amount (cc34e1b)
- Moved Application Insights into a local file so it can be aggressively cached and to reduce the inline code (a4eef2d, 07f344a)
Removal
- Removed legacy Headroom and Simple Pagination (1437040, 787b325, 1e81bed)
- Removed legacy Image Zoom capabilities, which are not currently used on the site (2039e6a)
- Removed legacy full-height pane JavaScript and CSS, a feature originally used on the homepage (1042d7e)
Refactoring
- Refactored search script into external file structured as a jQuery plugin (3409dfe, c102a8c)
- Refactored slideshow script into external file structured as a jQuery plugin (086da48)
- Standardized Immediately Invoked Function Expressions (IIFE) across most scripts (1d26094)
instructions.html("If paying by invoice, Purchase Order and Accounts Payable information must be filled out below.");
94
-
switch ($(this).val()) {
95
-
case"Invoice":
96
-
purchaseOrderForm.prop("disabled", false);
97
-
break;
98
-
case"AccountsPayable":
99
-
purchaseOrderForm.prop("disabled", false);
100
-
accountsPayableForm.prop("disabled", false);
101
-
break;
102
-
case"CreditCard":
103
-
instructions.html("There is a 2.9% fee when paying by credit card (this is not greater than our cost of acceptance). We will send a URL for entering credit card information.");
104
-
break;
105
-
}
106
-
instructions.show();
107
-
});
91
+
instructions.html("If paying by invoice, Purchase Order and Accounts Payable information must be filled out below.");
92
+
switch ($(this).val()) {
93
+
case"Invoice":
94
+
purchaseOrderForm.prop("disabled", false);
95
+
break;
96
+
case"AccountsPayable":
97
+
purchaseOrderForm.prop("disabled", false);
98
+
accountsPayableForm.prop("disabled", false);
99
+
break;
100
+
case"CreditCard":
101
+
instructions.html("There is a 2.9% fee when paying by credit card (this is not greater than our cost of acceptance). We will send a URL for entering credit card information.");
instructions.html("If paying by invoice, Purchase Order and Accounts Payable information must be filled out below.");
70
-
switch ($(this).val()) {
71
-
case"Invoice":
72
-
purchaseOrderForm.prop("disabled", false);
73
-
break;
74
-
case"AccountsPayable":
75
-
purchaseOrderForm.prop("disabled", false);
76
-
accountsPayableForm.prop("disabled", false);
77
-
break;
78
-
case"CreditCard":
79
-
instructions.html("There is a 2.9% fee when paying by credit card (this is not greater than our cost of acceptance). We will send a URL for entering credit card information.");
80
-
break;
81
-
}
82
-
instructions.show();
83
-
});
67
+
instructions.html("If paying by invoice, Purchase Order and Accounts Payable information must be filled out below.");
68
+
switch ($(this).val()) {
69
+
case"Invoice":
70
+
purchaseOrderForm.prop("disabled", false);
71
+
break;
72
+
case"AccountsPayable":
73
+
purchaseOrderForm.prop("disabled", false);
74
+
accountsPayableForm.prop("disabled", false);
75
+
break;
76
+
case"CreditCard":
77
+
instructions.html("There is a 2.9% fee when paying by credit card (this is not greater than our cost of acceptance). We will send a URL for entering credit card information.");
0 commit comments