X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=e422237262173255e8e23ce37d7fc87df612fe7c;hb=2f07c9c4781a36ef59d2ca7f5ed82b846df14ea3;hp=251105aea2c5accf7037ddc4eb60f2b2923946f9;hpb=ec79ce1481256e25eb6dc11690f71c425e0c4441;p=Sone.git 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