File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,13 +74,41 @@ wrap(() => {
7474 return false ;
7575 }
7676 latest . set ( data ) ;
77+ const path = `underscript@${ data . version } /${ data . unpkg } ` ;
7778 updateToast = fn . toast ( {
7879 title : '[UnderScript] Update Available!' ,
7980 text : `Version ${ data . version } .` ,
80- footer : 'Click to update' ,
81+ className : 'dismissable' ,
82+ buttons : [ {
83+ text : 'Update' ,
84+ className : 'dismiss' ,
85+ css : {
86+ border : '' ,
87+ height : '' ,
88+ background : '' ,
89+ 'font-size' : '' ,
90+ margin : '' ,
91+ 'border-radius' : '' ,
92+ } ,
93+ } , {
94+ text : 'Update (Alt)' ,
95+ className : 'dismiss' ,
96+ css : {
97+ border : '' ,
98+ height : '' ,
99+ background : '' ,
100+ 'font-size' : '' ,
101+ margin : '' ,
102+ 'border-radius' : '' ,
103+ } ,
104+ onclick : ( e ) => {
105+ location . href = `https://cdn.jsdelivr.net/npm/${ path } ` ;
106+ this . close ( 'update' ) ;
107+ } ,
108+ } ] ,
81109 onClose ( reason ) {
82110 if ( reason !== 'dismissed' ) return ;
83- location . href = `${ baseURL } /underscript@ ${ data . version } / ${ data . unpkg } ` ;
111+ location . href = `${ baseURL } /${ path } ` ;
84112 } ,
85113 } ) ;
86114 return true ;
You can’t perform that action at this time.
0 commit comments