Skip to content
GitLab
Projects
Groups
Snippets
/
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
c6831368
Commit
c6831368
authored
Jul 21, 2021
by
Jonathan Wilkes
Browse files
Merge branch 'prakhar/purr-data-diag_msg_send' into emscripten
parents
1011c64e
d5c70f3d
Pipeline
#3689
failed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
emscripten/project/purr-data/index.html
View file @
c6831368
...
...
@@ -30,6 +30,32 @@
</div>
</div>
<!-- Modal -->
<div
class=
"modal fade"
id=
"message-modal"
tabindex=
"-1"
role=
"dialog"
aria-hidden=
"true"
>
<div
class=
"modal-dialog modal-dialog-centered"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
>
New message
</h5>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<div
class=
"modal-body"
>
<form>
<div
class=
"form-group"
>
<label
for=
"message-text"
class=
"col-form-label"
>
Message:
</label>
<textarea
class=
"form-control"
id=
"message-text"
></textarea>
</div>
</form>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
id=
"send-message-btn"
class=
"btn btn-primary"
onclick=
"pdbundle.pdgui.web_menu_send()"
>
Send message
</button>
</div>
</div>
</div>
</div>
<div
id=
"container-app"
class=
"container-fluid"
>
<!-- Menu -->
<nav
id=
"menu"
></nav>
...
...
pd/nw/pdgui.js
View file @
c6831368
...
...
@@ -1197,15 +1197,34 @@ function gui_quit_dialog() {
// send a message to Pd
function
menu_send
(
name
)
{
var
message
,
if
(
is_webapp
)
{
$
(
"
.editmode
"
).
removeClass
(
"
editmode
"
);
$
(
'
[id*="editmode"]
'
).
prop
(
'
checked
'
,
false
);
$
(
"
#message-modal
"
).
modal
(
"
show
"
);
$
(
"
#message-text
"
).
val
(
name
);
}
else
{
var
message
,
win
=
name
?
patchwin
[
name
]
:
pd_window
;
message
=
win
.
window
.
prompt
(
"
Type a message to send to Pd
"
,
name
);
message
=
win
.
window
.
prompt
(
"
Type a message to send to Pd
"
,
name
);
if
(
message
!=
undefined
&&
message
.
length
)
{
post
(
"
Sending message to Pd:
"
+
message
+
"
;
"
);
pdsend
(
message
);
}
}
}
function
web_menu_send
()
{
var
message
=
$
(
"
#message-text
"
).
val
();
if
(
message
!=
undefined
&&
message
.
length
)
{
post
(
"
Sending message to Pd:
"
+
message
+
"
;
"
);
pdsend
(
message
);
}
$
(
"
#message-text
"
).
val
(
""
);
$
(
"
#message-modal
"
).
modal
(
"
hide
"
);
}
exports
.
web_menu_send
=
web_menu_send
;
// requires nw.js API (Menuitem)
function
canvas_set_editmode
(
cid
,
state
)
{
var
patchsvg_id
=
is_webapp
()
?
"
patchsvg_
"
+
cid
:
"
patchsvg
"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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