1- function showMacDialog ( ) {
1+ function showDialogBackdrop ( ) {
22 var backdrop = document . createElement ( 'div' )
33 backdrop . className = 'backdrop'
44 document . body . appendChild ( backdrop )
5+ backdrop . addEventListener ( 'click' , function ( ) {
6+ backdrop . parentNode . removeChild ( backdrop )
7+ var dialog = document . querySelector ( '.dialog' )
8+ dialog . parentNode . removeChild ( dialog )
9+ } )
10+ }
11+
12+ var sponsorMessage = '\
13+ <div\
14+ style="box-shadow: 1px 0 10px 0 rgba(0,0,0,0.3);padding: 1em 3em;margin-left: -0.75em;margin-right: -0.75em;margin-top: 2em;border-radius: 6px;">\
15+ <h2 style="margin-bottom: 0.25em;margin-top: 0;"><i class="i carbon:favorite"\
16+ style="color: #ff0759;margin-left: -38px;margin-right: 12px;vertical-align: text-top;"></i>Help support Min\
17+ </h2>Sponsor this project to help it continue.<br><a style="margin-top: 1em; display: inline-block;"\
18+ href="https://github.com/sponsors/PalmerAL" target="_blank">Sponsor on GitHub <i class="i carbon:caret-right"\
19+ style="font-size: 1.3em;vertical-align: text-top;margin-top: -2px;display: inline-block;margin-left: -2px;"></i></a>\
20+ </div>\
21+ '
22+
23+ function showMacDialog ( ) {
24+ showDialogBackdrop ( )
525
626 var dialog = document . createElement ( 'div' )
727 dialog . className = 'dialog centered'
8- dialog . innerHTML = '<h1 >How to install Min</h1 >\
28+ dialog . innerHTML = '<h2 >How to install</h2 >\
929 <ul>\
1030 <li>Drag Min from your Downloads folder to the Applications folder.</li>\
1131 <li>Right click on Min.</li>\
1232 <li>Choose "Open".</li>\
1333 <li>If a warning dialog is shown, choose "Open".</li>\
14- </ul>'
15-
16- var dialogButton = document . createElement ( 'button' )
17- dialogButton . className = 'button outlined-button outlined-button-white'
18- dialogButton . setAttribute ( 'style' , 'display: block; margin: auto' )
19- dialogButton . textContent = 'Done'
20- dialog . appendChild ( dialogButton )
21- dialogButton . addEventListener ( 'click' , function ( ) {
22- backdrop . parentNode . removeChild ( backdrop )
23- dialog . parentNode . removeChild ( dialog )
24- } )
34+ </ul>' + sponsorMessage
35+
36+ document . body . appendChild ( dialog )
37+ }
38+
39+ function showWindowsDialog ( ) {
40+ showDialogBackdrop ( ) ;
41+
42+ var dialog = document . createElement ( 'div' )
43+ dialog . className = 'dialog centered'
44+ dialog . innerHTML = '<h2>How to install</h2>\
45+ <ul>\
46+ <li>Start the installer.</li>\
47+ <li>If a warning dialog is shown, choose "More Info".</li>\
48+ <li>Choose "Run Anyway".</li>\
49+ <li>Wait for Min to open.</li>\
50+ </ul>' + sponsorMessage
2551
2652 document . body . appendChild ( dialog )
2753}
2854
2955function showLinuxDialog ( downloadLinks ) {
30- var backdrop = document . createElement ( 'div' )
31- backdrop . className = 'backdrop'
32- document . body . appendChild ( backdrop )
33- backdrop . addEventListener ( 'click' , function ( ) {
34- backdrop . parentNode . removeChild ( backdrop )
35- dialog . parentNode . removeChild ( dialog )
36- } )
56+ showDialogBackdrop ( )
3757
3858 var dialog = document . createElement ( 'div' )
3959 dialog . className = 'dialog centered'
@@ -44,7 +64,7 @@ function showLinuxDialog (downloadLinks) {
4464 <h3> For RPM-based distributions:</h3>\
4565 <a id="download-rpm-link"><button id="download-rpm-button" class="button outlined-button outlined-button-white" style="display: block; margin: auto">Download .rpm</button></a>\
4666 <div>Install with <pre style="display: inline-block; margin-left: 0.5em">sudo rpm -i /path/to/download --ignoreos</pre> </div>\
47- '
67+ ' + sponsorMessage
4868
4969 dialog . querySelector ( '#download-deb-link' ) . href = downloadLinks . deb
5070 dialog . querySelector ( '#download-rpm-link' ) . href = downloadLinks . rpm
@@ -123,6 +143,10 @@ function setupDownloadButton (button) {
123143 button . addEventListener ( 'click' , function ( ) {
124144 setTimeout ( showMacDialog , 500 )
125145 } , false )
146+ } else if ( navigator . platform === 'Win32' ) {
147+ button . addEventListener ( 'click' , function ( ) {
148+ setTimeout ( showWindowsDialog , 500 )
149+ } , false )
126150 }
127151 } else {
128152 button . parentElement . href = 'https://github.com/minbrowser/min/releases/latest'
0 commit comments