@@ -242,27 +242,42 @@ define([
242242 $kernel_ind_icon . attr ( 'class' , 'kernel_dead_icon' ) . attr ( 'title' , 'Kernel Dead' ) ;
243243 knw . danger ( short , undefined , showMsg ) ;
244244 } ) ;
245+
246+ var change_favicon = function ( src ) {
247+ var link = document . createElement ( 'link' ) ,
248+ oldLink = document . getElementById ( 'favicon' ) ;
249+ link . id = 'favicon' ;
250+ link . type = 'image/x-icon' ;
251+ link . rel = 'shortcut icon' ;
252+ link . href = src ;
253+ if ( oldLink ) document . head . removeChild ( oldLink ) ;
254+ document . head . appendChild ( link ) ;
255+ } ;
245256
246257 this . events . on ( 'kernel_starting.Kernel kernel_created.Session' , function ( ) {
247- window . document . title = '(Starting) ' + window . document . title ;
258+ // window.document.title='(Starting) '+window.document.title;
248259 $kernel_ind_icon . attr ( 'class' , 'kernel_busy_icon' ) . attr ( 'title' , 'Kernel Busy' ) ;
249260 knw . set_message ( "Kernel starting, please wait..." ) ;
261+ change_favicon ( '/static/base/images/favicon-busy.ico' ) ;
250262 } ) ;
251263
252264 this . events . on ( 'kernel_ready.Kernel' , function ( ) {
253- that . save_widget . update_document_title ( ) ;
265+ // that.save_widget.update_document_title();
254266 $kernel_ind_icon . attr ( 'class' , 'kernel_idle_icon' ) . attr ( 'title' , 'Kernel Idle' ) ;
255267 knw . info ( "Kernel ready" , 500 ) ;
268+ change_favicon ( '/static/base/images/favicon.ico' ) ;
256269 } ) ;
257270
258271 this . events . on ( 'kernel_idle.Kernel' , function ( ) {
259- that . save_widget . update_document_title ( ) ;
272+ // that.save_widget.update_document_title();
260273 $kernel_ind_icon . attr ( 'class' , 'kernel_idle_icon' ) . attr ( 'title' , 'Kernel Idle' ) ;
274+ change_favicon ( '/static/base/images/favicon.ico' ) ;
261275 } ) ;
262276
263277 this . events . on ( 'kernel_busy.Kernel' , function ( ) {
264- window . document . title = '(Busy) ' + window . document . title ;
278+ // window.document.title='(Busy) '+window.document.title;
265279 $kernel_ind_icon . attr ( 'class' , 'kernel_busy_icon' ) . attr ( 'title' , 'Kernel Busy' ) ;
280+ change_favicon ( '/static/base/images/favicon-busy.ico' ) ;
266281 } ) ;
267282
268283 this . events . on ( 'spec_match_found.Kernel' , function ( evt , data ) {
0 commit comments