From: David ‘Bombe’ Roden Date: Wed, 26 Jan 2011 12:50:43 +0000 (+0100) Subject: Change icon of page on activity. X-Git-Tag: 0.4.4^2~24 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=2f07c9c4781a36ef59d2ca7f5ed82b846df14ea3 Change icon of page on activity. --- diff --git a/src/main/resources/static/images/icon-activity.png b/src/main/resources/static/images/icon-activity.png new file mode 100644 index 0000000..5803edb Binary files /dev/null and b/src/main/resources/static/images/icon-activity.png differ diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 251105a..e422237 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -1028,6 +1028,7 @@ function resetActivity() { if (title.indexOf('(') == 0) { document.title = title.substr(title.indexOf(' ') + 1); } + changeIcon("images/icon.png"); } function setActivity() { @@ -1036,10 +1037,23 @@ function setActivity() { if (title.indexOf('(') != 0) { document.title = "(!) " + title; } + changeIcon("images/icon-activity.png"); } } /** + * Changes the icon of the page. + * + * @param iconUrl + * The new URL of the icon + */ +function changeIcon(iconUrl) { + $("link[rel=icon]").remove(); + $("head").append($("").attr("rel", "icon").attr("type", "image/png").attr("href", iconUrl)); + $("iframe[id=icon-update]")[0].src += ""; +} + +/** * Creates a new notification. * * @param id diff --git a/src/main/resources/templates/include/tail.html b/src/main/resources/templates/include/tail.html index dd2e25e..ec2b587 100644 --- a/src/main/resources/templates/include/tail.html +++ b/src/main/resources/templates/include/tail.html @@ -16,4 +16,6 @@ + +