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
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Sanket Bhukan
purr-data
Commits
0a8dfe69
Commit
0a8dfe69
authored
8 years ago
by
Jonathan Wilkes
Browse files
Options
Downloads
Plain Diff
Merge branch 'aggraef/purr-data-help_browser'
parents
900a918d
de3d2438
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/dialog_search.html
+141
-24
141 additions, 24 deletions
pd/nw/dialog_search.html
with
141 additions
and
24 deletions
pd/nw/dialog_search.html
+
141
−
24
View file @
0a8dfe69
...
@@ -28,11 +28,19 @@ index.setRef("id");
...
@@ -28,11 +28,19 @@ index.setRef("id");
var
filetypes
=
[
"
.pd
"
,
"
.txt
"
,
"
.htm
"
,
"
.html
"
,
"
.pdf
"
];
var
filetypes
=
[
"
.pd
"
,
"
.txt
"
,
"
.htm
"
,
"
.html
"
,
"
.pdf
"
];
// Table of Contents to start with
// Table of Contents to start with
/* NOTE: A section title is indicated by an entry consisting just of the title
field. All other entries *must* also contain the directory (relative to the
pd-l2ork lib directory) in the id field, and may optionally contain a
description field. */
var
toc
=
[
var
toc
=
[
// Original Pd documentation
{
title
:
"
Pure Data
"
,
},
{
{
id
:
"
doc/1.manual
"
,
id
:
"
doc/1.manual
"
,
title
:
"
Pd Manual
"
,
title
:
"
Pd Manual
"
,
description
:
"
detailed description of the program's behavior and user interface
"
description
:
"
HTML manual for Pure Data
"
},
},
{
{
id
:
"
doc/2.control.examples
"
,
id
:
"
doc/2.control.examples
"
,
...
@@ -45,10 +53,100 @@ var toc = [
...
@@ -45,10 +53,100 @@ var toc = [
description
:
"
objects and concepts related to producing audio in realtime
"
description
:
"
objects and concepts related to producing audio in realtime
"
},
},
{
{
id
:
"
doc/4.data.structures
/pd-l2ork/ds-tutorials
"
,
id
:
"
doc/4.data.structures
"
,
title
:
"
Data Structures
"
,
title
:
"
Data Structures
"
,
description
:
"
custom data manipulation and interactive graphics
"
description
:
"
custom data manipulation and interactive graphics
"
}
},
{
id
:
"
doc/5.reference
"
,
title
:
"
Reference
"
,
description
:
"
reference patches for key concepts and built-in objects
"
},
{
id
:
"
doc/6.externs
"
,
title
:
"
Externals
"
,
description
:
"
how to code control and signal objects in C
"
},
/* // Section 7 of the vanilla Pd docs, uncomment these if needed.
{
title: "Stuff",
},
{
id: "doc/7.stuff/soundfile-tools",
title: "Soundfile Tools",
description: "some standard audio transformations packaged to work with mono soundfiles"
},
{
id: "doc/7.stuff/synth",
title: "Synth",
description: "polyphonic subtractive synthesizer example"
},
{
id: "doc/7.stuff/tools",
title: "Tools",
description: "useful little helper patches"
},
*/
// Pd-L2Ork extras
{
title
:
"
Pd-L2Ork
"
,
},
{
id
:
"
doc/4.data.structures/pd-l2ork/ds-tutorials
"
,
title
:
"
Data Structure Tutorials
"
,
description
:
"
overview of svg-based data structure drawing commands
"
},
{
id
:
"
extra/disis
"
,
title
:
"
DISIS
"
,
description
:
"
DISIS externals (wiimote et al)
"
},
// PDDP tutorials
{
title
:
"
PDDP Tutorials
"
,
},
{
id
:
"
doc/manuals/0.Intro
"
,
title
:
"
Intro
"
,
description
:
"
getting started with Pd
"
},
{
id
:
"
doc/manuals/1.Sound
"
,
title
:
"
Sound
"
,
description
:
"
Pd sound examples
"
},
{
id
:
"
doc/manuals/2.Image
"
,
title
:
"
Image
"
,
description
:
"
3D graphics with GEM
"
},
{
id
:
"
doc/manuals/3.Networking
"
,
title
:
"
Networking
"
,
description
:
"
introduction to Pd's networking facilities
"
},
// External libraries
// NOTE: These are just some popular examples. Pd-L2Ork ships with
// many external libraries, too many to list them all. Feel free
// to edit this list as needed.
{
title
:
"
Externals
"
,
},
{
id
:
"
extra/cyclone
"
,
title
:
"
Cyclone
"
,
description
:
"
library of clones of Max/MSP 4.x objects
"
},
{
id
:
"
extra/Gem
"
,
title
:
"
GEM
"
,
description
:
"
Graphics Environment for Multimedia (OpenGL graphics in Pd)
"
},
{
id
:
"
extra/lyon
"
,
title
:
"
LyonPotpourri
"
,
description
:
"
Eric Lyon's external collection
"
},
];
];
// Stop-gap translator
// Stop-gap translator
...
@@ -127,16 +225,26 @@ function display_toc() {
...
@@ -127,16 +225,26 @@ function display_toc() {
text_node
;
text_node
;
toc
.
forEach
(
function
(
doc
,
i
,
a
)
{
toc
.
forEach
(
function
(
doc
,
i
,
a
)
{
div
=
document
.
createElement
(
"
div
"
);
div
=
document
.
createElement
(
"
div
"
);
a
=
document
.
createElement
(
"
a
"
);
if
(
doc
.
id
)
{
a
.
href
=
"
javascript: click_toc('
"
+
doc
.
id
+
"
');
"
;
a
=
document
.
createElement
(
"
a
"
);
a
.
textContent
=
doc
.
title
;
a
.
href
=
"
javascript: click_toc('
"
+
doc
.
id
+
"
');
"
;
// set title to path for tooltip
a
.
textContent
=
doc
.
title
;
a
.
title
=
doc
.
id
;
// set title to path for tooltip
header
=
document
.
createElement
(
"
h3
"
);
a
.
title
=
doc
.
id
;
header
.
appendChild
(
a
);
header
=
document
.
createElement
(
"
h3
"
);
text_node
=
document
.
createTextNode
(
doc
.
description
);
header
.
appendChild
(
a
);
div
.
appendChild
(
header
);
div
.
appendChild
(
header
);
div
.
appendChild
(
text_node
);
if
(
doc
.
description
)
{
text_node
=
document
.
createTextNode
(
doc
.
description
);
div
.
appendChild
(
text_node
);
}
}
else
{
// make a session title
header
=
document
.
createElement
(
"
h2
"
);
text_node
=
document
.
createTextNode
(
doc
.
title
);
header
.
appendChild
(
text_node
);
div
.
appendChild
(
header
);
}
results_elem
.
appendChild
(
div
);
results_elem
.
appendChild
(
div
);
});
});
}
}
...
@@ -169,7 +277,7 @@ function display_directory_callback(err, files) {
...
@@ -169,7 +277,7 @@ function display_directory_callback(err, files) {
doc_path
=
path
.
join
(
current_dir
,
f
);
doc_path
=
path
.
join
(
current_dir
,
f
);
doc
=
index
.
documentStore
.
getDoc
(
doc_path
)
||
{
doc
=
index
.
documentStore
.
getDoc
(
doc_path
)
||
{
id
:
doc_path
,
id
:
doc_path
,
title
:
f
,
title
:
path
.
basename
(
f
,
"
.pd
"
)
,
description
:
null
description
:
null
};
};
display_doc
(
doc
);
display_doc
(
doc
);
...
@@ -190,9 +298,9 @@ function file_browser_click() {
...
@@ -190,9 +298,9 @@ function file_browser_click() {
function
file_browser_callback
(
elem
)
{
function
file_browser_callback
(
elem
)
{
var
doc
=
elem
.
value
;
var
doc
=
elem
.
value
;
pdgui
.
post
(
"
file callback: file is
"
+
elem
.
value
);
//
pdgui.post("file callback: file is " + elem.value);
pdgui
.
post
(
"
dir is
"
+
pdgui
.
defunkify_windows_path
(
path
.
dirname
(
doc
)));
//
pdgui.post("dir is " + pdgui.defunkify_windows_path(path.dirname(doc)));
pdgui
.
post
(
"
file is
"
+
pdgui
.
defunkify_windows_path
(
path
.
basename
(
doc
)));
//
pdgui.post("file is " + pdgui.defunkify_windows_path(path.basename(doc)));
pdgui
.
doc_open
(
pdgui
.
defunkify_windows_path
(
path
.
dirname
(
doc
)),
pdgui
.
doc_open
(
pdgui
.
defunkify_windows_path
(
path
.
dirname
(
doc
)),
pdgui
.
defunkify_windows_path
(
path
.
basename
(
doc
)));
pdgui
.
defunkify_windows_path
(
path
.
basename
(
doc
)));
display_directory
(
pdgui
.
defunkify_windows_path
(
path
.
dirname
(
doc
)));
display_directory
(
pdgui
.
defunkify_windows_path
(
path
.
dirname
(
doc
)));
...
@@ -414,7 +522,7 @@ function register_window_id(id, attrs) {
...
@@ -414,7 +522,7 @@ function register_window_id(id, attrs) {
add_events
();
add_events
();
// set file types for the file dialog
// set file types for the file dialog
document
.
getElementById
(
"
file_browser
"
).
accept
=
filetypes
.
join
(
"
,
"
);
document
.
getElementById
(
"
file_browser
"
).
accept
=
filetypes
.
join
(
"
,
"
);
document
.
getElementById
(
"
results
"
).
textContent
=
"
Building
I
ndex...
"
;
document
.
getElementById
(
"
results
"
).
textContent
=
"
Building
i
ndex...
"
;
document
.
getElementById
(
"
search_text
"
).
disabled
=
true
;
document
.
getElementById
(
"
search_text
"
).
disabled
=
true
;
document
.
getElementById
(
"
file_browser
"
).
setAttribute
(
"
nwworkingdir
"
,
document
.
getElementById
(
"
file_browser
"
).
setAttribute
(
"
nwworkingdir
"
,
pdgui
.
get_gui_dir
()
+
"
/doc
"
);
// Probably need a doc getter in pdgui
pdgui
.
get_gui_dir
()
+
"
/doc
"
);
// Probably need a doc getter in pdgui
...
@@ -422,7 +530,7 @@ function register_window_id(id, attrs) {
...
@@ -422,7 +530,7 @@ function register_window_id(id, attrs) {
}
}
function
display_no_results
()
{
function
display_no_results
()
{
document
.
getElementById
(
"
results
"
).
textContent
=
"
No
R
esults
F
ound.
"
;
document
.
getElementById
(
"
results
"
).
textContent
=
"
No
r
esults
f
ound.
"
;
}
}
function
display_doc
(
doc
)
{
function
display_doc
(
doc
)
{
...
@@ -439,9 +547,11 @@ function display_doc(doc) {
...
@@ -439,9 +547,11 @@ function display_doc(doc) {
a
.
title
=
doc
.
id
;
a
.
title
=
doc
.
id
;
header
=
document
.
createElement
(
"
h3
"
);
header
=
document
.
createElement
(
"
h3
"
);
header
.
appendChild
(
a
);
header
.
appendChild
(
a
);
text_node
=
document
.
createTextNode
(
doc
.
description
);
div
.
appendChild
(
header
);
div
.
appendChild
(
header
);
div
.
appendChild
(
text_node
);
if
(
doc
.
description
)
{
text_node
=
document
.
createTextNode
(
doc
.
description
);
div
.
appendChild
(
text_node
);
}
results_elem
.
appendChild
(
div
);
results_elem
.
appendChild
(
div
);
}
}
...
@@ -451,9 +561,16 @@ function doc_search() {
...
@@ -451,9 +561,16 @@ function doc_search() {
results
,
results
,
doc
,
doc
,
i
;
i
;
// if the search term is doc/* short circuit the search and
// if the search term is empty then just redisplay the toc
// just list the docs in that directory
if
(
!
search_text
)
{
if
(
search_text
.
slice
(
0
,
4
)
===
"
doc/
"
&&
clear_results
();
display_toc
();
return
;
}
// if the search term is doc/* or extra/* then short circuit
// the search and just list the docs in that directory
if
((
search_text
.
slice
(
0
,
4
)
===
"
doc/
"
||
search_text
.
slice
(
0
,
6
)
===
"
extra/
"
)
&&
search_text
.
indexOf
(
"
"
)
===
-
1
)
{
search_text
.
indexOf
(
"
"
)
===
-
1
)
{
display_directory
(
path
.
join
(
pdgui
.
get_lib_dir
(),
search_text
));
display_directory
(
path
.
join
(
pdgui
.
get_lib_dir
(),
search_text
));
return
;
return
;
...
...
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