104104 var log ;
105105
106106
107-
107+ var icon = { } ;
108108
109109
110110 //:
151151 menu . on . close = focus ;
152152
153153
154+ icon . def = $ ( 'link[rel~=icon]' ) . href ;
155+ console . log ( icon . def ) ;
156+
157+
154158 initdom ( document . body ) ;
155159
156160
@@ -257,10 +261,10 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
257261
258262 < div id =save-root >
259263 < button id =save > save</ button >
264+ < checkbox-one id =autosave > </ checkbox-one >
260265 < div id =save-menu-root class =menu-root >
261266 < img id =save-menu-icon class =menu-icon >
262267 < div id =save-menu class =menu style ='display:none '>
263- < checkbox-one id =autosave > </ checkbox-one >
264268 </ div >
265269 </ div >
266270 </ div >
@@ -464,10 +468,13 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
464468
465469 on . change = function ( ) {
466470 //console.log('on.change');
471+ set . favicon ( icon . save ) ;
472+ /*
467473 const SAVE_RE = /^\u{1F4BE}\uFE0F?/u;
468474 if (!SAVE_RE.test(document.title)) {
469475 document.title = "💾 " + document.title;
470476 }
477+ */
471478
472479
473480 } //change
@@ -476,6 +483,7 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
476483 set . title = function ( title ) {
477484
478485 document . title = title ;
486+ set . favicon ( icon . def ) ;
479487
480488 } //title
481489
@@ -620,8 +628,26 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
620628 }
621629
622630 } //run
631+
623632
633+ set . favicon = function ( dataUrl ) {
634+
635+ $ . all ( 'link[rel*="icon"]' ) . forEach ( node => node . remove ( ) ) ;
636+ var link = document . createElement ( 'link' ) ;
637+ link . rel = 'icon' ;
638+ link . href = dataUrl ;
639+ document . head . appendChild ( link ) ;
640+
641+ } //favicon
642+
624643
644+ //:
645+
646+
647+ icon . save = 'data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAKlBMVEX/pQD/////qhH/pAD/rhr/zHH/yGT/wlP//vz/8dn/tjD/+u//6MD/2ZUL9bZAAAAA30lEQVQoz2OQvuWihARUMgUFBRlamRkYlqXBQLoy10Sg4CUGBisgDQLSu3dLXGBeAxRczMBg3ggR3LZqaeMhBquDggzOCMFdxuZAQWYfQQYHuKDELgOQINA0JEFBqCDzSiwqGdiwqGRgYlDAVIksSIpKYyyC28E+ggoi/L5D8AJMkGFZKAyEKcAFjRGAAS6IBsCCzMbGKGpBgkwqLshAASzoOxMFHDEACjJXCKKANmyCYkNI0IEGgs7YBBdjCpowXGBejSq43YCVYSszV1ooEkgrMMhmkL6lhAIUlJZuBAAfSYTf2T2EkwAAAABJRU5ErkJggg==' ;
648+
649+
650+
625651 //:
626652
627653
0 commit comments