Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
purr-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
nerrons
purr-data
Commits
d4fbe0a8
Commit
d4fbe0a8
authored
9 years ago
by
Jonathan Wilkes
Browse files
Options
Downloads
Patches
Plain Diff
first stab at "Find" bar for Pd console
parent
9744d551
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pd/nw/css/default.css
+9
-0
9 additions, 0 deletions
pd/nw/css/default.css
pd/nw/index.html
+25
-8
25 additions, 8 deletions
pd/nw/index.html
pd/nw/index.js
+39
-0
39 additions, 0 deletions
pd/nw/index.js
pd/nw/locales/en/translation.json
+2
-0
2 additions, 0 deletions
pd/nw/locales/en/translation.json
with
75 additions
and
8 deletions
pd/nw/css/default.css
+
9
−
0
View file @
d4fbe0a8
...
...
@@ -38,6 +38,7 @@
margin
:
8px
;
}
/* This needs to be renamed, since the "Find" bar is actually at the bottom */
#console_bottom
{
position
:
absolute
;
top
:
50px
;
...
...
@@ -47,6 +48,14 @@
overflow-y
:
scroll
;
}
#console_find
{
width
:
100%
;
height
:
1em
;
background
:
red
;
position
:
fixed
;
bottom
:
0
;
}
/* Pure Data Patch Window (aka canvas) */
/* patch font and background color. (Note: margin needs to stay at zero.) */
...
...
This diff is collapsed.
Click to expand it.
pd/nw/index.html
+
25
−
8
View file @
d4fbe0a8
<!DOCTYPE html>
<html>
<head>
<link
id=
"page_style"
rel=
"stylesheet"
type=
"text/css"
href=
"css/default.css"
>
<link
id=
"page_style"
rel=
"stylesheet"
type=
"text/css"
href=
"css/default.css"
>
</head>
<body
id=
"console_body"
>
<input
style=
"display:none;"
id=
"fileDialog"
type=
"file"
nwworkingdir
multiple
/>
<input
style=
"display:none;"
id=
"fileDialog"
type=
"file"
nwworkingdir
multiple
/>
<div
id=
"console_controls"
class=
"noselect"
>
<div
id=
"control_frame"
>
<label><input
type=
"checkbox"
id=
"dsp_control"
name=
"dsp_control"
value=
"on"
/>
Compute Audio
</label>
<label><input
type=
"checkbox"
id=
"dsp_control"
name=
"dsp_control"
value=
"on"
/>
Compute Audio
</label>
</div>
</div>
<script
type=
"text/javascript"
src=
"index.js"
>
</script>
<script
type=
"text/javascript"
src=
"index.js"
></script>
<input
style=
"display:none;"
id=
"saveDialog"
type=
"file"
nwsaveas
/>
<div
id =
"console_bottom"
>
<div
id =
"printout"
>
<pre
id=
"p1"
style=
"white-space: pre-wrap;"
>
Welcome to Pd GUI using Node-Webkit
<pre
id=
"p1"
style=
"white-space: pre-wrap;"
>
Welcome to Pd GUI using Node-Webkit
<script>
document
.
write
(
process
.
versions
[
'
node-webkit
'
])
</script><br/></pre>
</div>
</div>
<div
id =
"console_find"
style=
"display:none;"
>
<div>
<label><input
type=
"text"
id=
"console_find_text"
name=
"console_find_text"
defaultValue=
"Search in Console"
style=
"width:10em;"
onfocus=
"console_find_input_focus(this)"
onblur=
"console_find_input_blur(this)"
/>
XXXXXX
</label>
</div>
</div>
<script>
var
t
=
document
.
getElementById
(
'
console_find_text
'
);
t
.
defaultValue
=
"
Search in Console
"
;
console_find_input_blur
(
t
);
</script>
</body>
</html>
This diff is collapsed.
Click to expand it.
pd/nw/index.js
+
39
−
0
View file @
d4fbe0a8
...
...
@@ -55,6 +55,20 @@ pdgui.init_socket_events();
pdgui
.
set_new_window_fn
(
nw_create_window
);
pdgui
.
set_close_window_fn
(
nw_close_window
);
// Greyed out text for the "Find" bar
function
console_find_input_focus
(
e
)
{
if
(
e
.
value
===
e
.
defaultValue
)
{
e
.
value
=
''
;
e
.
style
.
color
=
"
#000
"
;
}
}
function
console_find_input_blur
(
e
)
{
if
(
e
.
value
===
''
||
e
.
value
===
e
.
defaultValue
)
{
e
.
value
=
e
.
defaultValue
;
e
.
style
.
color
=
"
#888
"
;
}
}
function
pdmenu_copy
()
{
alert
(
"
Please implement pdmenu_copy
"
);
...
...
@@ -290,6 +304,31 @@ function nw_create_pd_window_menus () {
tooltip
:
l
(
'
menu.zoomout_tt
'
)
}));
editMenu
.
append
(
new
nw
.
MenuItem
({
type
:
'
separator
'
}));
editMenu
.
append
(
new
nw
.
MenuItem
({
label
:
l
(
'
menu.find
'
),
click
:
function
()
{
var
find_bar
=
document
.
getElementById
(
'
console_find
'
),
text_container
=
document
.
getElementById
(
'
console_bottom
'
),
state
=
find_bar
.
style
.
getPropertyValue
(
'
display
'
);
if
(
state
===
'
none
'
)
{
text_container
.
style
.
setProperty
(
'
bottom
'
,
'
1em
'
);
find_bar
.
style
.
setProperty
(
'
display
'
,
'
inline
'
);
find_bar
.
style
.
setProperty
(
'
height
'
,
'
1em
'
);
text_container
.
scrollTop
=
text_container
.
scrollHeight
;
}
else
{
text_container
.
style
.
setProperty
(
'
bottom
'
,
'
0px
'
);
find_bar
.
style
.
setProperty
(
'
display
'
,
'
none
'
);
}
},
key
:
'
f
'
,
modifiers
:
"
ctrl
"
,
tooltip
:
l
(
'
menu.find_tt
'
)
}));
editMenu
.
append
(
new
nw
.
MenuItem
({
label
:
l
(
'
menu.preferences
'
),
click
:
pdgui
.
open_prefs
,
...
...
This diff is collapsed.
Click to expand it.
pd/nw/locales/en/translation.json
+
2
−
0
View file @
d4fbe0a8
...
...
@@ -130,6 +130,8 @@
"zoomin_tt"
:
"Make the patch visually larger"
,
"zoomout"
:
"Zoom Out"
,
"zoomout_tt"
:
"Make the patch visually smaller"
,
"find"
:
"Find"
,
"find_tt"
:
"Find text in the console output"
,
"tidyup"
:
"Tidy Up"
,
"tidyup_tt"
:
"Line up the selected objects in straight rows and columns"
,
"tofront"
:
"Bring to Front"
,
...
...
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