Skip to content
Snippets Groups Projects
Commit d4fbe0a8 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

first stab at "Find" bar for Pd console

parent 9744d551
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
margin: 8px; margin: 8px;
} }
/* This needs to be renamed, since the "Find" bar is actually at the bottom */
#console_bottom { #console_bottom {
position: absolute; position: absolute;
top: 50px; top: 50px;
...@@ -47,6 +48,14 @@ ...@@ -47,6 +48,14 @@
overflow-y: scroll; overflow-y: scroll;
} }
#console_find {
width: 100%;
height: 1em;
background: red;
position: fixed;
bottom: 0;
}
/* Pure Data Patch Window (aka canvas) */ /* Pure Data Patch Window (aka canvas) */
/* patch font and background color. (Note: margin needs to stay at zero.) */ /* patch font and background color. (Note: margin needs to stay at zero.) */
......
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <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> </head>
<body id="console_body"> <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="console_controls" class="noselect">
<div id="control_frame"> <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>
</div> </div>
<script type="text/javascript" src="index.js"> <script type="text/javascript" src="index.js"></script>
</script>
<input style="display:none;" id="saveDialog" type="file" nwsaveas /> <input style="display:none;" id="saveDialog" type="file" nwsaveas />
<div id = "console_bottom"> <div id = "console_bottom">
<div id = "printout"> <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> <script>document.write(process.versions['node-webkit'])</script><br/></pre>
</div> </div>
</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> <script>
var t = document.getElementById('console_find_text');
t.defaultValue = "Search in Console";
console_find_input_blur(t);
</script> </script>
</body> </body>
</html> </html>
...@@ -55,6 +55,20 @@ pdgui.init_socket_events(); ...@@ -55,6 +55,20 @@ pdgui.init_socket_events();
pdgui.set_new_window_fn(nw_create_window); pdgui.set_new_window_fn(nw_create_window);
pdgui.set_close_window_fn(nw_close_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 () { function pdmenu_copy () {
alert("Please implement pdmenu_copy"); alert("Please implement pdmenu_copy");
...@@ -290,6 +304,31 @@ function nw_create_pd_window_menus () { ...@@ -290,6 +304,31 @@ function nw_create_pd_window_menus () {
tooltip: l('menu.zoomout_tt') 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({ editMenu.append(new nw.MenuItem({
label: l('menu.preferences'), label: l('menu.preferences'),
click: pdgui.open_prefs, click: pdgui.open_prefs,
......
...@@ -130,6 +130,8 @@ ...@@ -130,6 +130,8 @@
"zoomin_tt": "Make the patch visually larger", "zoomin_tt": "Make the patch visually larger",
"zoomout": "Zoom Out", "zoomout": "Zoom Out",
"zoomout_tt": "Make the patch visually smaller", "zoomout_tt": "Make the patch visually smaller",
"find": "Find",
"find_tt": "Find text in the console output",
"tidyup": "Tidy Up", "tidyup": "Tidy Up",
"tidyup_tt": "Line up the selected objects in straight rows and columns", "tidyup_tt": "Line up the selected objects in straight rows and columns",
"tofront": "Bring to Front", "tofront": "Bring to Front",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment