@@ -242,40 +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 = oldLink . href . replace ( ) ;
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 ( ) {
253265 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 } ) ;
257-
258- var change_favicon = function ( src ) {
259- var link = document . createElement ( 'link' ) ,
260- oldLink = document . getElementById ( 'favicon' ) ;
261- link . id = 'favicon' ;
262- link . type = 'image/x-icon' ;
263- link . rel = 'shortcut icon' ;
264- link . href = src ;
265- if ( oldLink ) document . head . removeChild ( oldLink ) ;
266- document . head . appendChild ( link ) ;
267- } ;
268270
269271 this . events . on ( 'kernel_idle.Kernel' , function ( ) {
270272 that . save_widget . update_document_title ( ) ;
271273 $kernel_ind_icon . attr ( 'class' , 'kernel_idle_icon' ) . attr ( 'title' , 'Kernel Idle' ) ;
272- change_favicon ( '/static/base/images/favicon.ico' + '?=' + Math . random ( ) ) ;
274+ change_favicon ( '/static/base/images/favicon.ico' ) ;
273275 } ) ;
274276
275277 this . events . on ( 'kernel_busy.Kernel' , function ( ) {
276- window . document . title = '(Busy) ' + window . document . title ;
278+ // window.document.title='(Busy) '+window.document.title;
277279 $kernel_ind_icon . attr ( 'class' , 'kernel_busy_icon' ) . attr ( 'title' , 'Kernel Busy' ) ;
278- change_favicon ( '/static/base/images/favicon-busy.ico' + '?=' + Math . random ( ) ) ;
280+ change_favicon ( '/static/base/images/favicon-busy.ico' ) ;
279281 } ) ;
280282
281283 this . events . on ( 'spec_match_found.Kernel' , function ( evt , data ) {
0 commit comments