-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboostrap.html
More file actions
155 lines (125 loc) · 4.29 KB
/
boostrap.html
File metadata and controls
155 lines (125 loc) · 4.29 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!doctype html>
<!--WORKING ADDRESS : https://cs1.ucc.ie/~km34/boostrap.html -->
<html lang="en-UK">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="cmsstyle.css" />
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title ></title>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</head>
<body >
<script>
$(document).ready(function () {
cssSheet=true;
cSS=false;
// This is when the page is loaded
$.getJSON("home.json", function(result){
fullText=result.full;
abstractText=result.abstract;
$("#content").append(result.full);
$(document).attr("title", result.title);
toggle=true;});
// This is the buttons in the nav bar
$(".a").click (function(e){
$.getJSON(e.target.id, function(result){
fullText=result.full;
abstractText=result.abstract;
$("#content").text(result.full);
$(document).attr("title", result.title);
toggle=false;
});
});
// This is the different text views
$("#toggleSwitch").click (function(e){
if (toggle==false) {
$("#content").text(fullText);
}
else {
$("#content").text(abstractText);
}
toggle=!toggle;
});
// This changes the stylesheets
$("#changeCSS").click (function(){
cSS=!cSS;
if (cSS==true) {
$("link[rel=stylesheet]").attr({href : "cmsstyle2.css"}); }
else {
$("link[rel=stylesheet]").attr({href : "cmsstyle.css"}); }
});
// This changes the size of the font in the text box
$("#cmsstyleOne").click (function(e){
if (cssSheet==true) {
$("#content").css({"font-size": "200%"});
}
else {
$("#content").css({"font-size": "100%"});
}
cssSheet=!cssSheet;
});
function writeMsg(text,level){
$("#messages").text(text);
switch (level) {
case 0 :
$("#messages").attr({"class":"alert alert-success"});
return;
case 1 :
$("#messages").attr({"class":"alert alert-danger"});
return;
case 2 :
$("#messages").attr({"class":"alert alert-warning"});
return;
default :
$("#messages").attr({"class":"alert alert-warning"});
return;
};
}
// The ajax functions
$( document ).ajaxSuccess(function( ) {
writeMsg("Successful Request!",0);
});
$( document ).ajaxError(function(event, xhr, opt ) {
writeMsg("Error : " + xhr.status + " " + xhr.statusText,1);
});
$( document ).ajaxStart(function( ) {
writeMsg("Loading.....",2);
});
});
$('.alert').alert();
</script>
<header>
</header>
<nav>
<img src="uccLogo.png" />
<button type="button" class="a" id="home.json"> Home </button>
<button type="button" class="a" id="studies.json">Studies </button>
<button type="button" class="a" id="about.json"> About Me </button>
<button type="button" class="a" id="links.json">Links </button>
</nav>
<section id="content">
</section>
<section id="toggles">
<button type="button" id="cmsstyleOne" >
Change font
</button>
<button type="button" id="toggleSwitch">
Toggle information
</button>
<button type="button" id="changeCSS">
Change CSS
</button>
</section>
<section id="messages" data-dismiss="alert" role="alert" aria-label="Close">
</section>
<footer>
</footer>
</body>
</html>