Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
nodejs-60-2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
winai buttasart
nodejs-60-2
Commits
c34a83ea
Commit
c34a83ea
authored
7 years ago
by
winai buttasart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add electron desktop application
parent
63e74660
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
0 deletions
+84
-0
index.html
week05/windowapp/index.html
+24
-0
main.js
week05/windowapp/main.js
+40
-0
package-lock.json
week05/windowapp/package-lock.json
+0
-0
package.json
week05/windowapp/package.json
+20
-0
No files found.
week05/windowapp/index.html
0 → 100644
View file @
c34a83ea
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
สวสัสดีชาวโลก!
</title>
</head>
<body>
<h1>
สวสัสดีชาวโลก!
</h1>
เราใช้ node เวอร์ชัน
<script>
document
.
write
(
process
.
versions
.
node
)
</script>
, Chrome เวอร์ชัน
<script>
document
.
write
(
process
.
versions
.
chrome
)
</script>
, และ Electron เวอร์ชัน
<script>
document
.
write
(
process
.
versions
.
electron
)
</script>
.
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
week05/windowapp/main.js
0 → 100644
View file @
c34a83ea
const
{
app
,
BrowserWindow
}
=
require
(
'electron'
);
const
path
=
require
(
'path'
);
const
url
=
require
(
'url'
);
let
win
;
function
createWindow
()
{
win
=
new
BrowserWindow
({
width
:
800
,
height
:
600
});
win
.
loadURL
(
url
.
format
({
pathname
:
path
.
join
(
__dirname
,
'index.html'
),
protocol
:
'file:'
,
slashes
:
true
}));
win
.
webContents
.
openDevTools
();
win
.
on
(
'closed'
,
()
=>
{
win
=
null
;
});
}
app
.
on
(
'ready'
,
createWindow
);
app
.
on
(
'window-all-closed'
,
()
=>
{
if
(
process
.
platform
!==
'darwin'
)
{
app
.
quit
();
}
})
app
.
on
(
'activate'
,
()
=>
{
if
(
win
===
null
)
{
createWindow
();
}
})
This diff is collapsed.
Click to expand it.
week05/windowapp/package-lock.json
0 → 100644
View file @
c34a83ea
This diff is collapsed.
Click to expand it.
week05/windowapp/package.json
0 → 100644
View file @
c34a83ea
{
"name"
:
"windowapp"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"main.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"echo"
:
"echo สวัสดี"
,
"app"
:
"electron ./"
},
"keywords"
:
[
"windowapp"
,
"electron"
],
"author"
:
"Nize"
,
"license"
:
"ISC"
,
"devDependencies"
:
{
"electron"
:
"^1.8.2"
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment