Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
purr-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonathan Wilkes
purr-data
Commits
203d3688
Commit
203d3688
authored
9 years ago
by
Jonathan Wilkes
Browse files
Options
Downloads
Patches
Plain Diff
fix references to document in pd_menus
parent
44d683ec
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pd/nw/pd_menus.js
+20
-18
20 additions, 18 deletions
pd/nw/pd_menus.js
with
20 additions
and
18 deletions
pd/nw/pd_menus.js
+
20
−
18
View file @
203d3688
...
...
@@ -3,8 +3,8 @@ var pdgui = require("./pdgui.js");
// For translations
var
l
=
pdgui
.
get_local_string
;
function
pdmenu_help_browser
()
{
alert
(
"
Please implement pdmenu_preferences
"
);
function
pdmenu_help_browser
(
w
)
{
w
.
alert
(
"
Please implement pdmenu_preferences
"
);
}
function
pdmenu_l2ork_mailinglist
()
{
...
...
@@ -57,19 +57,19 @@ function nw_create_pd_window_menus(gui, w) {
tooltip
:
l
(
"
menu.open.tt
"
),
click
:
function
(){
var
input
,
chooser
,
span
=
document
.
querySelector
(
"
#fileDialogSpan
"
);
span
=
w
.
document
.
querySelector
(
"
#fileDialogSpan
"
);
// Complicated workaround-- see comment in build_file_dialog_string
input
=
pdgui
.
build_file_dialog_string
({
style
:
"
display: none;
"
,
type
:
"
file
"
,
id
:
"
fileDialog
"
,
nwworkingdir
:
p
w
d
,
nwworkingdir
:
pd
gui
.
get_pwd
()
,
multiple
:
null
,
// These are copied from pd_filetypes in pdgui.js
accept
:
"
.pd,.pat,.mxt,.mxb,.help
"
});
span
.
innerHTML
=
input
;
var
chooser
=
document
.
querySelector
(
"
#fileDialog
"
);
var
chooser
=
w
.
document
.
querySelector
(
"
#fileDialog
"
);
chooser
.
onchange
=
function
()
{
var
file_array
=
this
.
value
;
// reset value so that we can open the same file twice
...
...
@@ -166,7 +166,7 @@ function nw_create_pd_window_menus(gui, w) {
editMenu
.
append
(
new
gui
.
MenuItem
({
label
:
l
(
"
menu.copy
"
),
click
:
function
()
{
document
.
execCommand
(
"
copy
"
);
w
.
document
.
execCommand
(
"
copy
"
);
},
key
:
"
c
"
,
modifiers
:
cmd_or_ctrl
,
...
...
@@ -178,21 +178,21 @@ function nw_create_pd_window_menus(gui, w) {
click
:
function
()
{
var
container_id
=
"
p1
"
,
range
;
// This should work across browsers
if
(
document
.
selection
)
{
range
=
document
.
body
.
createTextRange
();
range
.
moveToElementText
(
document
.
getElementById
(
container_id
));
if
(
w
.
document
.
selection
)
{
range
=
w
.
document
.
body
.
createTextRange
();
range
.
moveToElementText
(
w
.
document
.
getElementById
(
container_id
));
range
.
select
();
}
else
if
(
w
indow
.
getSelection
)
{
range
=
document
.
createRange
();
range
.
selectNode
(
document
.
getElementById
(
container_id
));
}
else
if
(
w
.
getSelection
)
{
range
=
w
.
document
.
createRange
();
range
.
selectNode
(
w
.
document
.
getElementById
(
container_id
));
// we need to empty the current selection to avoid a strange
// error when trying to select all right after Pd starts:
// "The given range and the current selection belong to two
// different document fragments."
// (I guess nw.js somehow starts up with the selection being
// somewhere outside the window...)
windo
w
.
getSelection
().
empty
();
windo
w
.
getSelection
().
addRange
(
range
);
w
.
getSelection
().
empty
();
w
.
getSelection
().
addRange
(
range
);
}
},
key
:
"
a
"
,
...
...
@@ -231,9 +231,9 @@ function nw_create_pd_window_menus(gui, w) {
editMenu
.
append
(
new
gui
.
MenuItem
({
label
:
l
(
"
menu.find
"
),
click
:
function
()
{
var
find_bar
=
document
.
getElementById
(
"
console_find
"
),
find_bar_text
=
document
.
getElementById
(
"
console_find_text
"
),
text_container
=
document
.
getElementById
(
"
console_bottom
"
),
var
find_bar
=
w
.
document
.
getElementById
(
"
console_find
"
),
find_bar_text
=
w
.
document
.
getElementById
(
"
console_find_text
"
),
text_container
=
w
.
document
.
getElementById
(
"
console_bottom
"
),
state
=
find_bar
.
style
.
getPropertyValue
(
"
display
"
);
if
(
state
===
"
none
"
)
{
text_container
.
style
.
setProperty
(
"
bottom
"
,
"
1em
"
);
...
...
@@ -378,7 +378,9 @@ function nw_create_pd_window_menus(gui, w) {
helpMenu
.
append
(
new
gui
.
MenuItem
({
label
:
l
(
"
menu.browser
"
),
click
:
pdmenu_help_browser
,
click
:
function
()
{
pdmenu_help_browser
(
w
);
},
//key: "a",
//modifiers: cmd_or_ctrl,
tooltip
:
l
(
"
menu.browser_tt
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment