From e8326899234b9fc7fea44ed950f86ab9efb89465 Mon Sep 17 00:00:00 2001 From: Grant Nestor Date: Fri, 14 Oct 2016 18:17:53 -0700 Subject: [PATCH] Change favicon when busy --- notebook/static/base/images/favicon-busy.ico | Bin 0 -> 32038 bytes notebook/static/notebook/js/notificationarea.js | 13 +++++++++++++ notebook/templates/page.html | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 notebook/static/base/images/favicon-busy.ico diff --git a/notebook/static/base/images/favicon-busy.ico b/notebook/static/base/images/favicon-busy.ico new file mode 100644 index 0000000000000000000000000000000000000000..85f9995a47b5d870432cdef19a388b33d5cdfb3f GIT binary patch literal 32038 zcmeI5e`uV?na34WA%rll2_Y2Yb8Kn%U1=@LuG=`ikl4P^3nqkMjM_iU;qxEY+!cb) zv3K8HNlrGTC2@11q=#cWCN&|1UK`wUgy0Jy9OgL6(FPMjI1ZgKx!}64Pf_-L-_=^p zIeVY)y!-CH`+Bv~uGX@gSTLS>-*@KuHP6gE^UO2rj*dGzzSi;euXpfwPsiVWt)t^F zRl3K2{wLo5ig%kfm7ilB9pAmHqhrSo|2gp&9UWi%c}GWrM}fG9bcgwuI<$-al}e>M zqA8wsSI2E{B$jqlN-FDJv|jYt$~rOXpNXZNSyHJsxwF7HV`be~w4I(U+u2Qhx7_9$ z`E=ZNCS$fc3CwAp^-eHdE9347!-!|RhxDF$zqZou_pHp!YU_uWyEY$jJC#&UWQwc7 z4^PgoRab2UBRO7J5x3pf6KN+IhS{iW*=|y8lH=}*M7pqg*q-igRKMOgwXxDOH8MSQ z>QvXs6DPMQR~yP}l~j&?s|WMM@e{{LCFN>IUQ{ZVE8pt1)jPE#wcI{R<3i|{3|f)j z;MjDxWS<;!P5-G+=He^*UVZKNUtxv5RrLqmu-y^qN>qQ0PN7@Uv3N*-0@%_?z8U@H zJG$zkzwRVDhyJ3=yd%}s-wF)I2Kdj!?DF`rYsL^`YVPq9z%cyO8NZ1+#&1VQskE4+ zdFCF{4pK1Bad`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t=-hT|sL1oFJ_4}{ITk`&ER0iQ^-R)TT{b%o%zyBQO R{Z=SPe-GgH^H)m({|`3Z&RPHf literal 0 HcmV?d00001 diff --git a/notebook/static/notebook/js/notificationarea.js b/notebook/static/notebook/js/notificationarea.js index 36b3dd60d0..86f92fda0b 100644 --- a/notebook/static/notebook/js/notificationarea.js +++ b/notebook/static/notebook/js/notificationarea.js @@ -254,15 +254,28 @@ define([ $kernel_ind_icon.attr('class','kernel_idle_icon').attr('title','Kernel Idle'); knw.info("Kernel ready", 500); }); + + var change_favicon = function (src) { + var link = document.createElement('link'), + oldLink = document.getElementById('favicon'); + link.id = 'favicon'; + link.type = 'image/x-icon'; + link.rel = 'shortcut icon'; + link.href = src; + if (oldLink) document.head.removeChild(oldLink); + document.head.appendChild(link); + }; this.events.on('kernel_idle.Kernel', function () { that.save_widget.update_document_title(); $kernel_ind_icon.attr('class','kernel_idle_icon').attr('title','Kernel Idle'); + change_favicon('/static/base/images/favicon.ico' + '?=' + Math.random()); }); this.events.on('kernel_busy.Kernel', function () { window.document.title='(Busy) '+window.document.title; $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy'); + change_favicon('/static/base/images/favicon-busy.ico' + '?=' + Math.random()); }); this.events.on('spec_match_found.Kernel', function (evt, data) { diff --git a/notebook/templates/page.html b/notebook/templates/page.html index 5860517e02..e96aac2279 100644 --- a/notebook/templates/page.html +++ b/notebook/templates/page.html @@ -5,7 +5,7 @@ {% block title %}Jupyter Notebook{% endblock %} - {% block favicon %}{% endblock %} + {% block favicon %}{% endblock %}