File tree Expand file tree Collapse file tree 3 files changed +13
-50
lines changed
Expand file tree Collapse file tree 3 files changed +13
-50
lines changed Original file line number Diff line number Diff line change 11< html lang ="en ">
2+
23< head >
34 < title > Electron</ title >
45 < style >
1718 flex-direction : column;
1819 }
1920
20- .container > * {
21+ .container > * {
2122 margin : 15px 0 0 0 ;
2223 }
2324
5758 .svg-stroke {
5859 stroke : # 9feaf9 ;
5960 }
61+
6062 .svg-fill {
6163 fill : # 9feaf9 ;
6264 }
7173 text-decoration : none;
7274 }
7375
74- pre , code {
76+ pre ,
77+ code {
7578 font-family : "Menlo" , "Lucida Console" , monospace;
7679 border : 1px solid # e0e5e6 ;
7780 background-color : # f6f8f8 ;
112115 }
113116 </ style >
114117</ head >
118+
115119< body >
116120 < div class ="header ">
117121 < svg class ="header-icon " viewBox ="0 0 32 32 " xmlns ="http://www.w3.org/2000/svg " aria-hidden ="true ">
140144 < div class ="container ">
141145
142146 < p >
143- To run your app with Electron, execute the following command in your
144- Console (or Terminal):
147+ To run your app with Electron, execute the following command in your Console (or Terminal):
145148 </ p >
146149
147150 < pre class ="command-example "> </ pre >
148151
149152 < p >
150- The < code > path-to-your-app</ code > should be the path to your own Electron
151- app.
153+ The < code > path-to-your-app</ code > should be the path to your own Electron app.
152154 </ p >
153155
154- < p > You can read the < a class ="quick-start-link "> quick start</ a >
155- guide in Electron's < a class ="docs-link "> docs</ a >
156- to learn how to write one.
156+ < p > You can read the < a class ="quick-start-link "> quick start</ a > guide in Electron's < a class ="docs-link "> docs</ a > to learn how to write one.
157157 </ p >
158-
159- < p >
160- Or you can just drag your app here to run it:
161- </ p >
162-
163- < div id ="holder ">
164- Drag your app here to run it
165- </ div >
166-
167158 </ div >
168159
169160 < script >
170161 require ( './renderer' )
171162 </ script >
172163</ body >
173- </ html >
164+
165+ </ html >
Original file line number Diff line number Diff line change @@ -326,7 +326,7 @@ if (option.file && !option.webdriver) {
326326 process . exit ( 0 )
327327} else if ( option . default ) {
328328 const indexPath = path . join ( __dirname , '/index.html' )
329- loadApplicationByUrl ( `file://${ indexPath } ` ) ;
329+ loadApplicationByUrl ( `file://${ indexPath } ` )
330330} else if ( option . interactive ) {
331331 startRepl ( )
332332} else {
Original file line number Diff line number Diff line change 11const { remote, shell} = require ( 'electron' )
2- const { execFile} = require ( 'child_process' )
3-
42const { execPath} = remote . process
53
6- document . onclick = function ( e ) {
4+ document . onclick = ( e ) => {
75 e . preventDefault ( )
86 if ( e . target . tagName === 'A' ) {
97 shell . openExternal ( e . target . href )
108 }
119 return false
1210}
1311
14- document . ondragover = document . ondrop = function ( e ) {
15- e . preventDefault ( )
16- return false
17- }
18-
19- const holder = document . getElementById ( 'holder' )
20- holder . ondragover = function ( ) {
21- this . className = 'hover'
22- return false
23- }
24-
25- holder . ondragleave = holder . ondragend = function ( ) {
26- this . className = ''
27- return false
28- }
29-
30- holder . ondrop = function ( e ) {
31- this . className = ''
32- e . preventDefault ( )
33-
34- const file = e . dataTransfer . files [ 0 ]
35- execFile ( execPath , [ file . path ] , {
36- detached : true , stdio : 'ignore'
37- } ) . unref ( )
38- return false
39- }
40-
4112const version = process . versions . electron
4213document . querySelector ( '.header-version' ) . innerText = version
4314document . querySelector ( '.command-example' ) . innerText = `${ execPath } path-to-your-app`
You can’t perform that action at this time.
0 commit comments