Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mihkel Putrinš
panustaja
Commits
7fb603c5
Commit
7fb603c5
authored
Sep 13, 2020
by
mitselek
Browse files
resolve electron remote packages
parent
0435bb47
Changes
3
Hide whitespace changes
Inline
Side-by-side
code/app.js
View file @
7fb603c5
...
...
@@ -2,12 +2,7 @@ const path = require('path')
const
fs
=
require
(
'
fs
'
)
const
util
=
require
(
'
util
'
)
// var op = require('object-path')
// const app = require('electron').app
const
{
app
,
BrowserWindow
,
ipcMain
,
clipboard
}
=
require
(
'
electron
'
)
// var ipcMain = require('electron').ipcMain
// const { clipboard } = require('electron')
const
{
app
,
clipboard
,
BrowserWindow
,
ipcMain
}
=
require
(
'
electron
'
)
var
windows
=
{}
var
mainWindow
...
...
@@ -27,11 +22,15 @@ if (ISDEV) {
}
console
.
log
(
'
----====
'
+
pjson
.
name
+
'
v.
'
+
pjson
.
version
+
'
(build
'
+
(
pjson
.
build
)
+
'
) ====----
'
)
const
webPreferences
=
{
const
appWebPreferences
=
{
partition
:
'
persist:panustaja (build
'
+
(
pjson
.
build
)
+
'
)
'
,
pageVisibility
:
true
}
const
rendererWebPreferences
=
{
partition
:
'
persist:panustaja (build
'
+
(
pjson
.
build
)
+
'
)
'
,
// Prevent throttling DOM timers (app gets less priority while in background)
pageVisibility
:
true
,
nodeIntegration
:
true
nodeIntegration
:
true
,
enableRemoteModule
:
true
}
app
.
on
(
'
ready
'
,
function
()
{
...
...
@@ -41,7 +40,7 @@ app.on('ready', function() {
const
authWin
=
new
BrowserWindow
({
width
:
600
,
height
:
900
,
webPreferences
:
w
ebPreferences
webPreferences
:
appW
ebPreferences
})
authWin
.
loadURL
(
authUrl
,
{
userAgent
:
'
Chrome
'
})
var
title
=
pjson
.
name
+
'
v.
'
+
pjson
.
version
+
(
pjson
.
version
.
indexOf
(
'
-
'
)
>
-
1
?
pjson
.
build
:
''
)
+
'
| Logi sisse
'
...
...
@@ -64,7 +63,7 @@ app.on('ready', function() {
authWin
.
webContents
.
copy
()
setTimeout
(
function
()
{
mainWindow
=
new
BrowserWindow
({
width
:
900
,
height
:
600
,
show
:
true
,
webPreferences
:
w
ebPreferences
})
mainWindow
=
new
BrowserWindow
({
width
:
900
,
height
:
600
,
show
:
true
,
webPreferences
:
rendererW
ebPreferences
})
mainWindow
.
setTitle
(
'
Panustaja
'
)
mainWindow
.
center
()
var
viewPath
=
path
.
join
(
app
.
getAppPath
(),
'
code
'
,
'
panuView.html
'
)
...
...
code/panu.js
View file @
7fb603c5
// var request = require('request')
var
fs
=
require
(
'
fs
'
)
var
op
=
require
(
'
object-path
'
)
var
path
=
require
(
'
path
'
)
var
async
=
require
(
'
async
'
)
var
mime
=
require
(
'
mime
'
)
const
clipboard
=
require
(
'
electron
'
).
remote
.
clipboard
const
{
ipcRenderer
}
=
require
(
'
electron
'
).
remote
const
{
dialog
}
=
require
(
'
electron
'
).
remote
console
.
log
(
dialog
)
const
{
clipboard
,
dialog
}
=
require
(
'
electron
'
).
remote
const
{
ipcRenderer
}
=
require
(
'
electron
'
)
var
pjson
=
require
(
path
.
join
(
__dirname
,
'
..
'
,
'
package.json
'
))
UPLOADERVERSION
=
pjson
.
name
+
'
v.
'
+
pjson
.
version
+
(
pjson
.
version
.
indexOf
(
'
-
'
)
>
-
1
?
pjson
.
build
:
''
)
...
...
package.json
View file @
7fb603c5
...
...
@@ -2,7 +2,7 @@
"name"
:
"panustaja"
,
"description"
:
"Ressursikataloogi upitamiseks keeleressurside Entu repositooriumisse."
,
"version"
:
"2.0.0"
,
"build"
:
12
9
,
"build"
:
1
4
2
,
"main"
:
"./code/app.js"
,
"license"
:
"CC-SA"
,
"private"
:
true
,
...
...
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