diff --git a/doc/res/common.js b/doc/res/common.js index bd4a09574d..6c157680b4 100644 --- a/doc/res/common.js +++ b/doc/res/common.js @@ -24,8 +24,8 @@ if ( document.location.protocol !== "file:" // Support the tracking of emails, downloads and external links in Google // Analytics - $(document).ready(function($) { - $("a").on("click", function() { + $(document).ready(function() { + $("a").click(function() { var element = $(this); var href = (typeof element.attr("href") !== "undefined")?element.attr("href"):""; var track = true; @@ -262,11 +262,10 @@ function doHeaderAndContentsMenu(pageName, relativePath, r, g, b, data) { if (liId.length) subMenuSelected = subMenuCounter; } else { - if (menuItemLink.length) { + if (menuItemLink.length) tableRowClasses += " clickableMenuItem"; - } else { + else tableRowClasses += " nonClickableMenuItem"; - } } var subMenuButton = ""; @@ -349,9 +348,8 @@ function doHeaderAndContentsMenu(pageName, relativePath, r, g, b, data) { // Hide our contents menu if the ESC key is pressed $(document).keyup(function(event) { - if (event.keyCode === 27) { + if (event.keyCode === 27) $("ul.contentsMenu > li > ul").css("visibility", "hidden"); - } }); // Show/hide a given sub-menu diff --git a/doc/res/downloads.js b/doc/res/downloads.js index c4a3cbef0a..15705e7062 100644 --- a/doc/res/downloads.js +++ b/doc/res/downloads.js @@ -360,6 +360,7 @@ function versions(downloads) { var fileName = "OpenCOR-"+versionVersion+"-"+platformName.replace(" ", "")+((typeof fileBitness !== "undefined")?fileBitness:"")+fileExtension; var fullFileName = versionFolder+"/"+fileName; + var fileType; if ( (fileExtension === ".exe") || (fileExtension === ".dmg")) @@ -462,9 +463,8 @@ function versions(downloads) { // anywhere on the document $(document).keyup(function(event) { - if (event.keyCode === 27) { + if (event.keyCode === 27) $("ul.downloadsMenu").css("visibility", "hidden"); - } }); $(document).click(function() { diff --git a/doc/user/res/imagepopup.js b/doc/user/res/imagepopup.js index 6a6d05335d..7c321e07c8 100644 --- a/doc/user/res/imagepopup.js +++ b/doc/user/res/imagepopup.js @@ -1,83 +1,81 @@ -$(window).on('load', function() { - jQuery(document).ready(function($) { - // Create a div for our popup image +$(document).ready(function() { + // Create a div for our popup image - $("body").append("
"); + $("body").append("
"); - // Disable the mousewheel when the div for our popup image is visible + // Disable the mousewheel when the div for our popup image is visible - $("div.imagepopup").bind("mousewheel", function() { - return false; - }); - - // Initially hide the div for our popup image - - hideImagePopup(); + $("div.imagepopup").bind("mousewheel", function() { + return false; + }); - // Show and update the contents of the div for our popup image + // Initially hide the div for our popup image - $("[imagepopup]").click(function() { - $("div.imagepopup").css("visibility", "visible"); + hideImagePopup(); - var imagepopup = $("div.imagepopup img.popup"); + // Show and update the contents of the div for our popup image - // Retrieve the size of our image and its padding - // Note: to use $(imagepopup).width() and $(imagepopup).height() to - // retrieve the size of our image is not good enough since - // our image won't be loaded yet, so we would effectively be - // retrieving the size of our previous image. Now, when it - // comes to the padding, it will always be the same for all - // our images, hence we can safely use $(imagepopup)... + $("[imagepopup]").click(function() { + $("div.imagepopup").css("visibility", "visible"); - var image = new Image(); + var imagepopup = $("div.imagepopup img.popup"); - image.src = $(this).attr("src"); + // Retrieve the size of our image and its padding + // Note: to use $(imagepopup).width() and $(imagepopup).height() to + // retrieve the size of our image is not good enough since our + // image won't be loaded yet, so we would effectively be + // retrieving the size of our previous image. Now, when it comes + // to the padding, it will always be the same for all our images, + // hence we can safely use $(imagepopup)... - var imageWidth = image.width; - var imageHeight = image.height; - var imagePaddingX = $(imagepopup).innerWidth()-$(imagepopup).width(); - var imagePaddingY = $(imagepopup).innerHeight()-$(imagepopup).height(); + var image = new Image(); - $(imagepopup).attr("src", $(this).attr("src")); + image.src = $(this).attr("src"); - $(imagepopup).css({ - "width": imageWidth, - "height": imageHeight, - "margin-top": -0.5*(imageHeight+imagePaddingY), - "margin-left": -0.5*(imageWidth+imagePaddingX) - }); - }); + var imageWidth = image.width; + var imageHeight = image.height; + var imagePaddingX = $(imagepopup).innerWidth()-$(imagepopup).width(); + var imagePaddingY = $(imagepopup).innerHeight()-$(imagepopup).height(); - // Hide the div for our popup image when clicking on it + $(imagepopup).attr("src", $(this).attr("src")); - $("div.imagepopup").click(function() { - hideImagePopup(); + $(imagepopup).css({ + "width": imageWidth, + "height": imageHeight, + "margin-top": -0.5*(imageHeight+imagePaddingY), + "margin-left": -0.5*(imageWidth+imagePaddingX) }); + }); - // Ignore all key strokes, except the ESC key, when the div for our - // popup image is visible + // Hide the div for our popup image when clicking on it - $(document).keydown(function(event) { - if ($("div.imagepopup").css("visibility") === "visible") { - if (event.keyCode !== 27) - event.preventDefault(); - } - }); + $("div.imagepopup").click(function() { + hideImagePopup(); + }); - // Hide the div for our popup image if the ESC key is pressed when our - // div is visible + // Ignore all key strokes, except the ESC key, when the div for our popup + // image is visible - $(document).keyup(function(event) { - if ( ($("div.imagepopup").css("visibility") === "visible") - && (event.keyCode === 27)) { - hideImagePopup(); - } - }); + $(document).keydown(function(event) { + if ($("div.imagepopup").css("visibility") === "visible") { + if (event.keyCode !== 27) + event.preventDefault(); + } + }); - // Hide the div for our popup image + // Hide the div for our popup image if the ESC key is pressed when our div + // is visible - function hideImagePopup() { - $("div.imagepopup").css("visibility", "hidden"); + $(document).keyup(function(event) { + if ( ($("div.imagepopup").css("visibility") === "visible") + && (event.keyCode === 27)) { + hideImagePopup(); } }); + + // Hide the div for our popup image + + function hideImagePopup() { + $("div.imagepopup").css("visibility", "hidden"); + } });