Remove unnecessary code

This commit is contained in:
Matthew Grove
2018-12-08 16:24:57 +00:00
parent a7fa10b7ac
commit 938252104b

View File

@@ -1,31 +1,6 @@
// set page title // set page title
window.page_title = "Computer Science Blog | Matthew Grove"; window.page_title = "Computer Science Blog | Matthew Grove";
function nextPage() {
// if there are more slides to come, display the next one
if (window.current_blog_page < window.pages.length) {
displayPage(window.pages[window.current_blog_page + 1]);
} else {
// if end of presentation has been reached, display the first slide
displayPage(window.pages[0]);
}
}
function previousPage() {
// if there are more slides before the current one, display the previous slide
if (window.current_blog_page >= 1) {
displayPage(window.pages[window.current_blog_page - 1]);
} else {
// if end of presentation has been reached, display the first slide
displayPage(window.pages[window.pages.length - 1]);
}
}
function displayPage(page) {
// document.getElementById("iframe").src = "pages/" + page + ".html";
$("#presentation").load(page);
}
window.onload = function() { window.onload = function() {
// set the current date // set the current date
var date = new Date(); var date = new Date();
@@ -39,6 +14,9 @@ window.onload = function() {
// display date // display date
$("#current_date").html(current_date); $("#current_date").html(current_date);
// display first blog page
$("#blog-insert").load("pages/blog.html");
// define variables for HTTP presentation pages // define variables for HTTP presentation pages
http_pages = ["hyperlinks", "http", "https", "cookies"]; http_pages = ["hyperlinks", "http", "https", "cookies"];
// displays HTTP presentation pages // displays HTTP presentation pages
@@ -46,10 +24,10 @@ window.onload = function() {
$.get("pages/" + item + ".html", function(content) { $.get("pages/" + item + ".html", function(content) {
if (index == 0) { if (index == 0) {
$("#http_presentation .carousel-inner").append('<div class="item active">' + content + '</div>'); $("#http_presentation .carousel-inner").append('<div class="item active">' + content + '</div>');
$("#http_presentation .carousel-indicators").append('<li data-target="#http_presentation" class="active" data-slide-to="' + http_pages.indexOf(item) + '"></li>') $("#http_presentation .carousel-indicators").append('<li data-target="#http_presentation" class="active" data-slide-to="' + index + '"></li>')
} else { } else {
$("#http_presentation .carousel-inner").append('<div class="item">' + content + '</div>'); $("#http_presentation .carousel-inner").append('<div class="item">' + content + '</div>');
$("#http_presentation .carousel-indicators").append('<li data-target="#http_presentation" data-slide-to="' + http_pages.indexOf(item) + '"></li>') $("#http_presentation .carousel-indicators").append('<li data-target="#http_presentation" data-slide-to="' + index + '"></li>')
} }
}); });
}); });
@@ -61,14 +39,11 @@ window.onload = function() {
$.get("pages/" + item + ".html", function(content) { $.get("pages/" + item + ".html", function(content) {
if (index == 0) { if (index == 0) {
$("#html_presentation .carousel-inner").append('<div class="item active">' + content + '</div>'); $("#html_presentation .carousel-inner").append('<div class="item active">' + content + '</div>');
$("#html_presentation .carousel-indicators").append('<li data-target="#html_presentation" class="active" data-slide-to="' + html_pages.indexOf(item) + '"></li>') $("#html_presentation .carousel-indicators").append('<li data-target="#html_presentation" class="active" data-slide-to="' + index + '"></li>')
} else { } else {
$("#html_presentation .carousel-inner").append('<div class="item">' + content + '</div>'); $("#html_presentation .carousel-inner").append('<div class="item">' + content + '</div>');
$("#html_presentation .carousel-indicators").append('<li data-target="#html_presentation" data-slide-to="' + html_pages.indexOf(item) + '"></li>') $("#html_presentation .carousel-indicators").append('<li data-target="#html_presentation" data-slide-to="' + index + '"></li>')
} }
}); });
}); });
// displays first blog page
$("#blog-insert").load("pages/blog.html");
} }