Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
purr-data
Commits
fdfc9abb
Commit
fdfc9abb
authored
May 25, 2021
by
Prakhar Agarwal
🎯
Browse files
added OS in process.platform for web app
parent
9d4ffeb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
pd/nw/pd_shortcuts.js
View file @
fdfc9abb
"
use strict
"
;
"
use strict
"
;
var
is_webapp
=
typeof
process
===
"
undefined
"
;
var
is_mac
=
is_webapp
?
navigator
.
platform
.
toUpperCase
().
indexOf
(
"
MAC
"
)
>
-
1
:
process
.
platform
===
"
darwin
"
;
var
cmd_or_ctrl
=
is_mac
?
"
Cmd
"
:
"
Ctrl
"
;
var
cmd_or_ctrl
=
is_mac
?
"
Cmd
"
:
"
Ctrl
"
;
exports
.
menu
=
{
exports
.
menu
=
{
"
new
"
:
{
key
:
"
N
"
,
modifiers
:
cmd_or_ctrl
},
"
new
"
:
{
key
:
"
N
"
,
modifiers
:
cmd_or_ctrl
},
"
open
"
:
{
key
:
"
O
"
,
modifiers
:
cmd_or_ctrl
},
"
open
"
:
{
key
:
"
O
"
,
modifiers
:
cmd_or_ctrl
},
...
@@ -98,7 +95,7 @@ exports.menu = {
...
@@ -98,7 +95,7 @@ exports.menu = {
"
find_web
"
:
{
key
:
"
F
"
,
modifiers
:
cmd_or_ctrl
},
"
find_web
"
:
{
key
:
"
F
"
,
modifiers
:
cmd_or_ctrl
},
"
findagain_web
"
:{
key
:
"
F
"
,
modifiers
:
cmd_or_ctrl
+
"
+Shift
"
},
"
findagain_web
"
:{
key
:
"
F
"
,
modifiers
:
cmd_or_ctrl
+
"
+Shift
"
},
"
editmode_web
"
:
{
key
:
"
E
"
,
modifiers
:
cmd_or_ctrl
+
"
+Shift
"
},
"
editmode_web
"
:
{
key
:
"
E
"
,
modifiers
:
cmd_or_ctrl
+
"
+Shift
"
},
"
preferences_web
"
:
{
key
:
(
is_mac
)
?
"
,
"
:
"
P
"
,
"
preferences_web
"
:
{
key
:
(
process
.
platform
===
"
darwin
"
)
?
"
,
"
:
"
P
"
,
modifiers
:
cmd_or_ctrl
},
modifiers
:
cmd_or_ctrl
},
"
zoomin_web
"
:
{
key
:
"
=
"
,
modifiers
:
cmd_or_ctrl
},
"
zoomin_web
"
:
{
key
:
"
=
"
,
modifiers
:
cmd_or_ctrl
},
...
@@ -107,8 +104,8 @@ exports.menu = {
...
@@ -107,8 +104,8 @@ exports.menu = {
"
zoomoptimal_web
"
:
{
key
:
"
9
"
,
modifiers
:
cmd_or_ctrl
},
"
zoomoptimal_web
"
:
{
key
:
"
9
"
,
modifiers
:
cmd_or_ctrl
},
"
zoomhoriz_web
"
:
{
key
:
"
9
"
,
modifiers
:
cmd_or_ctrl
},
"
zoomhoriz_web
"
:
{
key
:
"
9
"
,
modifiers
:
cmd_or_ctrl
},
"
zoomvert_web
"
:
{
key
:
"
9
"
,
modifiers
:
cmd_or_ctrl
+
"
+Shift
"
},
"
zoomvert_web
"
:
{
key
:
"
9
"
,
modifiers
:
cmd_or_ctrl
+
"
+Shift
"
},
"
fullscreen_web
"
:
{
key
:
(
is_mac
)
?
"
F
"
:
"
F11
"
,
"
fullscreen_web
"
:
{
key
:
(
process
.
platform
===
"
darwin
"
)
?
"
F
"
:
"
F11
"
,
modifiers
:
(
is_mac
)
?
"
Cmd+Ctrl
"
:
null
},
modifiers
:
(
process
.
platform
===
"
darwin
"
)
?
"
Cmd+Ctrl
"
:
null
},
"
object_web
"
:
{
key
:
"
1
"
,
modifiers
:
cmd_or_ctrl
},
"
object_web
"
:
{
key
:
"
1
"
,
modifiers
:
cmd_or_ctrl
},
"
msgbox_web
"
:
{
key
:
"
2
"
,
modifiers
:
cmd_or_ctrl
},
"
msgbox_web
"
:
{
key
:
"
2
"
,
modifiers
:
cmd_or_ctrl
},
...
...
pd/nw/pdgui.js
View file @
fdfc9abb
...
@@ -12,6 +12,13 @@ function is_webapp(){
...
@@ -12,6 +12,13 @@ function is_webapp(){
exports
.
is_webapp
=
is_webapp
;
exports
.
is_webapp
=
is_webapp
;
if
(
is_webapp
())
{
if
(
navigator
.
platform
.
toUpperCase
().
indexOf
(
"
MAC
"
)
>
-
1
)
{
process
.
platform
=
"
darwin
"
;
}
else
if
(
navigator
.
platform
.
toUpperCase
().
indexOf
(
"
WIN
"
)
>
-
1
)
{
process
.
platform
=
"
win32
"
;
}
}
exports
.
set_pwd
=
function
(
pwd_string
)
{
exports
.
set_pwd
=
function
(
pwd_string
)
{
pwd
=
pwd_string
;
pwd
=
pwd_string
;
...
...
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