diff --git a/notebook/static/base/images/favicon-busy.ico b/notebook/static/base/images/favicon-busy.ico new file mode 100644 index 0000000000..85f9995a47 Binary files /dev/null and b/notebook/static/base/images/favicon-busy.ico differ diff --git a/notebook/static/notebook/js/notificationarea.js b/notebook/static/notebook/js/notificationarea.js index 36b3dd60d0..092f478437 100644 --- a/notebook/static/notebook/js/notificationarea.js +++ b/notebook/static/notebook/js/notificationarea.js @@ -242,27 +242,42 @@ define([ $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead'); knw.danger(short, undefined, showMsg); }); + + 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_starting.Kernel kernel_created.Session', function () { - window.document.title='(Starting) '+window.document.title; + // window.document.title='(Starting) '+window.document.title; $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy'); knw.set_message("Kernel starting, please wait..."); + change_favicon('/static/base/images/favicon-busy.ico'); }); this.events.on('kernel_ready.Kernel', function () { - that.save_widget.update_document_title(); + // that.save_widget.update_document_title(); $kernel_ind_icon.attr('class','kernel_idle_icon').attr('title','Kernel Idle'); knw.info("Kernel ready", 500); + change_favicon('/static/base/images/favicon.ico'); }); this.events.on('kernel_idle.Kernel', function () { - that.save_widget.update_document_title(); + // 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'); }); this.events.on('kernel_busy.Kernel', function () { - window.document.title='(Busy) '+window.document.title; + // 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'); }); 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 %}