-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforms-loader.html
More file actions
53 lines (38 loc) · 1.94 KB
/
forms-loader.html
File metadata and controls
53 lines (38 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css">
<link rel="stylesheet" href="https://raw.githubusercontent.com/fus-marcom/fus-admissions-forms/forms.css">
<script type="text/javascript">
jQuery( document ).ready(function( $ ) {
$('body').prepend(`
<nav>
<div class="nav-wrapper">
<a href="#" class="brand-logo center"><img class="responsive-img" src="https://franciscan.university/img/side-nav-logo.jpg" /></a>
</div>
</nav>
`);
$('head').append('<link rel="shortcut icon" href="https://franciscan.university/favicon.ico">');
// Change this to whatever title the form should have
$('.wFormTitle').html('Admissions Visit');
$('head').append('<title>' + $('.wFormTitle').text() + ' | Franciscan University of Steubenville</title>');
$('textarea, input[type="text"]').not('input[style="display:none;"]').attr('style', 'width: 100% !important');
$('textarea').addClass('materialize-textarea');
$('select').parent().addClass('field_select');
$('select[multiple]').parent().addClass('multiple-select');
//Strip begininning and trailing whitespace from name Inputs
$('input[type="text"]').change(function(){
trim(this);
});
// Source: http://stackoverflow.com/questions/10747119/how-to-trim-a-space-at-the-start-and-end-of-textbox
function trim(el) {
el.value = el.value.
replace(/(^\s*)|(\s*$)/gi, ""). // removes leading and trailing spaces
replace(/[ ]{2,}/gi, " "). // replaces multiple spaces with one space
replace(/\n +/, "\n"); // Removes spaces after newlines
return;
}
});
var metaViewport = document.createElement("meta");
metaViewport.setAttribute('content', 'width=device-width,initial-scale=1');
metaViewport.setAttribute('name', 'viewport');
document.head.appendChild(metaViewport);
</script>