shroud 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,95 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Documentation by YARD 0.5.4</title>
7
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
+
10
+ <script type="text/javascript" charset="utf-8">
11
+ relpath = '';
12
+ if (relpath != '') relpath += '/';
13
+ </script>
14
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
+
17
+ </head>
18
+ <body>
19
+ <script type="text/javascript" charset="utf-8">
20
+ if (window.top.frames.main) document.body.className = 'frames';
21
+ </script>
22
+
23
+ <div id="header">
24
+ <div id="menu">
25
+
26
+ <a href="_index.html" title="Index">Index</a> &raquo;
27
+ <span class="title">File: README</span>
28
+
29
+
30
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
31
+ </div>
32
+
33
+ <div id="search">
34
+ <a id="class_list_link" href="#">Class List</a>
35
+ <a id="method_list_link" href="#">Method List</a>
36
+ <a id ="file_list_link" href="#">File List</a>
37
+ </div>
38
+
39
+ <div class="clear"></div>
40
+ </div>
41
+
42
+ <iframe id="search_frame"></iframe>
43
+
44
+ <div id="content"><div id='filecontents'><h1 id='shroud'>Shroud</h1>
45
+
46
+ <p>A ruby wrapper for <a href='http://getcloudapp.com/'>Cloud.app&#8217;s</a> <a href='http://support.getcloudapp.com/faqs/developers/api'>REST API</a>.</p>
47
+
48
+ <p><strong>NB</strong>: If you try to upload an item and wonder why it doesn&#8217;t work, it&#8217;s because it doesn&#8217;t work <em>yet</em>. I am working on it.</p>
49
+
50
+ <h2 id='example'>Example</h2>
51
+
52
+ <pre class="code"><span class='id require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shroud</span><span class='tstring_end'>'</span></span>
53
+
54
+ <span class='const'>Shroud</span><span class='period'>.</span><span class='id get_item'>get_item</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>a</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; returns a hash of info on http://cl.ly/a
55
+ </span>
56
+ <span class='comment'># For every other thing you need to log in
57
+ </span>
58
+ <span class='id c'>c</span> <span class='op'>=</span> <span class='const'>Shroud</span><span class='op'>::</span><span class='const'>Session</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_email</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_password</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
59
+
60
+ <span class='id c'>c</span><span class='period'>.</span><span class='id list_items'>list_items</span><span class='lparen'>(</span><span class='symbol'>:type</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>image</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; return a list of my recent images
61
+ </span>
62
+ <span class='id b'>b</span> <span class='op'>=</span> <span class='id c'>c</span><span class='period'>.</span><span class='id create_bookmark'>create_bookmark</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http://getcloudapp.com/</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>CloudApp</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; Shorten url
63
+ </span>
64
+ <span class='id c'>c</span><span class='period'>.</span><span class='id delete_item'>delete_item</span><span class='lparen'>(</span><span class='id b'>b</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>slug</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='comment'>#=&gt; Delete the bookmark you just created
65
+ </span>
66
+ <span class='comment'># not working atm
67
+ </span><span class='id c'>c</span><span class='period'>.</span><span class='id upload_file'>upload_file</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>list.txt</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; uploads 'list.txt'</span></pre>
68
+
69
+ <h2 id='command_line'>Command Line</h2>
70
+
71
+ <p>You can use the <code>shroud</code> executable to interact with the REST API from the command line. Type <code>shroud -h</code> to see the list of commands. To add your login details you need to edit your <code>~/.bashrc</code> and add:</p>
72
+
73
+ <pre class="code"><span class='id export'>export</span> <span class='const'>SHROUD_USER</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>yourusername</span><span class='tstring_end'>&quot;</span></span>
74
+ <span class='id export'>export</span> <span class='const'>SHROUD_PASS</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>yourpassword</span><span class='tstring_end'>&quot;</span></span></pre>
75
+
76
+ <h2 id='license'>License</h2>
77
+
78
+ <p><strong>MIT LICENSE</strong></p>
79
+
80
+ <p>Copyright (c) 2010 Joshua Hawxwell</p>
81
+
82
+ <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &#8220;Software&#8221;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
83
+
84
+ <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
85
+
86
+ <p>THE SOFTWARE IS PROVIDED &#8220;AS IS&#8221;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p></div></div>
87
+
88
+ <div id="footer">
89
+ Generated on Thu May 13 18:53:17 2010 by
90
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
91
+ 0.5.4 (ruby-1.9.1).
92
+ </div>
93
+
94
+ </body>
95
+ </html>
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=utf-8" />
6
+ <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
7
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
8
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
9
+ <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
10
+ <base id="base_target" target="_parent" />
11
+ </head>
12
+ <body>
13
+ <script type="text/javascript" charset="utf-8">
14
+ if (window.top.frames.main) {
15
+ document.getElementById('base_target').target = 'main';
16
+ document.body.className = 'frames';
17
+ }
18
+ </script>
19
+ <div id="content">
20
+ <h1 id="full_list_header">File List</h1>
21
+ <div id="nav">
22
+ <a target="_self" href="class_list.html">Classes</a> |
23
+ <a target="_self" href="method_list.html">Methods</a> |
24
+ <a target="_self" href="file_list.html">Files</a>
25
+ </div>
26
+ <div id="search">Search: <input type="text" /></div>
27
+
28
+ <ul id="full_list" class="files">
29
+
30
+
31
+ <li class="r1"><a href="index.html" title="README">README</a></li>
32
+
33
+
34
+ </ul>
35
+ </div>
36
+ </body>
37
+ </html>
38
+
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
+ <title>Documentation by YARD 0.5.4</title>
8
+ </head>
9
+ <frameset cols="20%,*">
10
+ <frame name="list" src="class_list.html" />
11
+ <frame name="main" src="index.html" />
12
+ </frameset>
13
+ </html>
@@ -0,0 +1,95 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Documentation by YARD 0.5.4</title>
7
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
+
10
+ <script type="text/javascript" charset="utf-8">
11
+ relpath = '';
12
+ if (relpath != '') relpath += '/';
13
+ </script>
14
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
+
17
+ </head>
18
+ <body>
19
+ <script type="text/javascript" charset="utf-8">
20
+ if (window.top.frames.main) document.body.className = 'frames';
21
+ </script>
22
+
23
+ <div id="header">
24
+ <div id="menu">
25
+
26
+ <a href="_index.html" title="Index">Index</a> &raquo;
27
+ <span class="title">File: README</span>
28
+
29
+
30
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
31
+ </div>
32
+
33
+ <div id="search">
34
+ <a id="class_list_link" href="#">Class List</a>
35
+ <a id="method_list_link" href="#">Method List</a>
36
+ <a id ="file_list_link" href="#">File List</a>
37
+ </div>
38
+
39
+ <div class="clear"></div>
40
+ </div>
41
+
42
+ <iframe id="search_frame"></iframe>
43
+
44
+ <div id="content"><div id='filecontents'><h1 id='shroud'>Shroud</h1>
45
+
46
+ <p>A ruby wrapper for <a href='http://getcloudapp.com/'>Cloud.app&#8217;s</a> <a href='http://support.getcloudapp.com/faqs/developers/api'>REST API</a>.</p>
47
+
48
+ <p><strong>NB</strong>: If you try to upload an item and wonder why it doesn&#8217;t work, it&#8217;s because it doesn&#8217;t work <em>yet</em>. I am working on it.</p>
49
+
50
+ <h2 id='example'>Example</h2>
51
+
52
+ <pre class="code"><span class='id require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shroud</span><span class='tstring_end'>'</span></span>
53
+
54
+ <span class='const'>Shroud</span><span class='period'>.</span><span class='id get_item'>get_item</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>a</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; returns a hash of info on http://cl.ly/a
55
+ </span>
56
+ <span class='comment'># For every other thing you need to log in
57
+ </span>
58
+ <span class='id c'>c</span> <span class='op'>=</span> <span class='const'>Shroud</span><span class='op'>::</span><span class='const'>Session</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_email</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_password</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
59
+
60
+ <span class='id c'>c</span><span class='period'>.</span><span class='id list_items'>list_items</span><span class='lparen'>(</span><span class='symbol'>:type</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>image</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; return a list of my recent images
61
+ </span>
62
+ <span class='id b'>b</span> <span class='op'>=</span> <span class='id c'>c</span><span class='period'>.</span><span class='id create_bookmark'>create_bookmark</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http://getcloudapp.com/</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>CloudApp</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; Shorten url
63
+ </span>
64
+ <span class='id c'>c</span><span class='period'>.</span><span class='id delete_item'>delete_item</span><span class='lparen'>(</span><span class='id b'>b</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>slug</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='comment'>#=&gt; Delete the bookmark you just created
65
+ </span>
66
+ <span class='comment'># not working atm
67
+ </span><span class='id c'>c</span><span class='period'>.</span><span class='id upload_file'>upload_file</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>list.txt</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; uploads 'list.txt'</span></pre>
68
+
69
+ <h2 id='command_line'>Command Line</h2>
70
+
71
+ <p>You can use the <code>shroud</code> executable to interact with the REST API from the command line. Type <code>shroud -h</code> to see the list of commands. To add your login details you need to edit your <code>~/.bashrc</code> and add:</p>
72
+
73
+ <pre class="code"><span class='id export'>export</span> <span class='const'>SHROUD_USER</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>yourusername</span><span class='tstring_end'>&quot;</span></span>
74
+ <span class='id export'>export</span> <span class='const'>SHROUD_PASS</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>yourpassword</span><span class='tstring_end'>&quot;</span></span></pre>
75
+
76
+ <h2 id='license'>License</h2>
77
+
78
+ <p><strong>MIT LICENSE</strong></p>
79
+
80
+ <p>Copyright (c) 2010 Joshua Hawxwell</p>
81
+
82
+ <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &#8220;Software&#8221;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
83
+
84
+ <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
85
+
86
+ <p>THE SOFTWARE IS PROVIDED &#8220;AS IS&#8221;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p></div></div>
87
+
88
+ <div id="footer">
89
+ Generated on Thu May 13 18:53:17 2010 by
90
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
91
+ 0.5.4 (ruby-1.9.1).
92
+ </div>
93
+
94
+ </body>
95
+ </html>
@@ -0,0 +1,111 @@
1
+ function createSourceLinks() {
2
+ $('.method_details_list .source_code').
3
+ before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
4
+ $('.toggleSource').toggle(function() {
5
+ $(this).parent().next().slideDown(100);
6
+ $(this).text("Hide source");
7
+ },
8
+ function() {
9
+ $(this).parent().next().slideUp(100);
10
+ $(this).text("View source");
11
+ });
12
+ }
13
+
14
+ function createDefineLinks() {
15
+ var tHeight = 0;
16
+ $('.defines').after(" <a href='#' class='toggleDefines'>more...</a>");
17
+ $('.toggleDefines').toggle(function() {
18
+ tHeight = $(this).parent().prev().height();
19
+ $(this).prev().show();
20
+ $(this).parent().prev().height($(this).parent().height());
21
+ $(this).text("(less)");
22
+ },
23
+ function() {
24
+ $(this).prev().hide();
25
+ $(this).parent().prev().height(tHeight);
26
+ $(this).text("more...")
27
+ });
28
+ }
29
+
30
+ function createFullTreeLinks() {
31
+ var tHeight = 0;
32
+ $('.inheritanceTree').toggle(function() {
33
+ tHeight = $(this).parent().prev().height();
34
+ $(this).prev().prev().hide();
35
+ $(this).prev().show();
36
+ $(this).text("(hide)");
37
+ $(this).parent().prev().height($(this).parent().height());
38
+ },
39
+ function() {
40
+ $(this).prev().prev().show();
41
+ $(this).prev().hide();
42
+ $(this).parent().prev().height(tHeight);
43
+ $(this).text("show all")
44
+ });
45
+ }
46
+
47
+ function fixBoxInfoHeights() {
48
+ $('dl.box dd.r1, dl.box dd.r2').each(function() {
49
+ $(this).prev().height($(this).height());
50
+ });
51
+ }
52
+
53
+ function searchFrameLinks() {
54
+ $('#method_list_link').click(function() {
55
+ toggleSearchFrame(this, relpath + 'method_list.html');
56
+ });
57
+
58
+ $('#class_list_link').click(function() {
59
+ toggleSearchFrame(this, relpath + 'class_list.html');
60
+ });
61
+
62
+ $('#file_list_link').click(function() {
63
+ toggleSearchFrame(this, relpath + 'file_list.html');
64
+ });
65
+ }
66
+
67
+ function toggleSearchFrame(id, link) {
68
+ var frame = $('#search_frame');
69
+ $('#search a').removeClass('active').addClass('inactive');
70
+ if (frame.attr('src') == link && frame.css('display') != "none") {
71
+ frame.slideUp(100);
72
+ $('#search a').removeClass('active inactive');
73
+ }
74
+ else {
75
+ $(id).addClass('active').removeClass('inactive');
76
+ frame.attr('src', link).slideDown(100);
77
+ }
78
+ }
79
+
80
+ function linkSummaries() {
81
+ $('.summary_signature').click(function() {
82
+ document.location = $(this).find('a').attr('href');
83
+ });
84
+ }
85
+
86
+ function framesInit() {
87
+ if (window.top.frames.main) {
88
+ document.body.className = 'frames';
89
+ $('#menu .noframes a').attr('href', document.location);
90
+ }
91
+ }
92
+
93
+ function keyboardShortcuts() {
94
+ $(document).keypress(function(evt) {
95
+ if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) return;
96
+ switch (evt.charCode) {
97
+ case 67: case 99: $('#class_list_link').click(); break; // 'c'
98
+ case 77: case 109: $('#method_list_link').click(); break; // 'm'
99
+ case 70: case 102: $('#file_list_link').click(); break; // 'f'
100
+ }
101
+ });
102
+ }
103
+
104
+ $(framesInit);
105
+ $(createSourceLinks);
106
+ $(createDefineLinks);
107
+ $(createFullTreeLinks);
108
+ $(fixBoxInfoHeights);
109
+ $(searchFrameLinks);
110
+ $(linkSummaries);
111
+ $(keyboardShortcuts);
@@ -0,0 +1,117 @@
1
+ function fullListSearch() {
2
+ $('#search input').keyup(function() {
3
+ var value = this.value.toLowerCase();
4
+ if (value == "") {
5
+ $('#full_list').removeClass('insearch');
6
+ $('#full_list li').each(function() {
7
+ var link = $(this).children('a:last');
8
+ link.text(link.text());
9
+ });
10
+ if (clicked) {
11
+ clicked.parents('ul').each(function() {
12
+ $(this).removeClass('collapsed').prev().removeClass('collapsed');
13
+ });
14
+ }
15
+ highlight();
16
+ }
17
+ else {
18
+ $('#full_list').addClass('insearch');
19
+ $('#full_list li').each(function() {
20
+ var link = $(this).children('a:last');
21
+ var text = link.text();
22
+ if (text.toLowerCase().indexOf(value) == -1) {
23
+ $(this).removeClass('found');
24
+ link.text(link.text());
25
+ }
26
+ else {
27
+ $(this).css('padding-left', '10px').addClass('found');
28
+ link.html(link.text().replace(new RegExp("(" +
29
+ value.replace(/([\/.*+?|()\[\]{}\\])/g, "\\$1") + ")", "ig"),
30
+ '<strong>$1</strong>'));
31
+ }
32
+ });
33
+ highlight(true);
34
+ }
35
+
36
+ if ($('#full_list li:visible').size() == 0) {
37
+ $('#noresults').fadeIn();
38
+ }
39
+ else {
40
+ $('#noresults').hide();
41
+ }
42
+ });
43
+
44
+ $('#search input').focus();
45
+ $('#full_list').after("<div id='noresults'>No results were found.</div>")
46
+ }
47
+
48
+ clicked = null;
49
+ function linkList() {
50
+ $('#full_list li, #full_list li a:last').click(function(evt) {
51
+ if ($(this).hasClass('toggle')) return true;
52
+ if (this.tagName.toLowerCase() == "li") {
53
+ var toggle = $(this).children('a.toggle');
54
+ if (toggle.size() > 0 && evt.pageX < toggle.offset().left) {
55
+ toggle.click();
56
+ return false;
57
+ }
58
+ }
59
+ if (clicked) clicked.removeClass('clicked');
60
+ var win = window.parent;
61
+ if (window.top.frames.main) {
62
+ win = window.top.frames.main;
63
+ var title = $('html head title', win.document).text();
64
+ $('html head title', window.parent.document).text(title);
65
+ }
66
+ if (this.tagName.toLowerCase() == "a") {
67
+ clicked = $(this).parent('li').addClass('clicked');
68
+ win.location = this.href;
69
+ }
70
+ else {
71
+ clicked = $(this).addClass('clicked');
72
+ win.location = $(this).find('a:last').attr('href');
73
+ }
74
+ return false;
75
+ });
76
+ }
77
+
78
+ function collapse() {
79
+ if (!$('#full_list').hasClass('class')) return;
80
+ $('#full_list.class a.toggle').click(function() {
81
+ $(this).parent().toggleClass('collapsed').next().toggleClass('collapsed');
82
+ highlight();
83
+ return false;
84
+ });
85
+ $('#full_list.class ul').each(function() {
86
+ $(this).addClass('collapsed').prev().addClass('collapsed');
87
+ });
88
+ $('#full_list.class').children().removeClass('collapsed');
89
+ highlight();
90
+ }
91
+
92
+ function highlight(no_padding) {
93
+ var n = 1;
94
+ $('#full_list li:visible').each(function() {
95
+ var next = n == 1 ? 2 : 1;
96
+ $(this).removeClass("r" + next).addClass("r" + n);
97
+ if (!no_padding && $('#full_list').hasClass('class')) {
98
+ $(this).css('padding-left', (10 + $(this).parents('ul').size() * 15) + 'px');
99
+ }
100
+ n = next;
101
+ });
102
+ }
103
+
104
+ function escapeShortcut() {
105
+ $(document).keydown(function(evt) {
106
+ if (evt.which == 27) {
107
+ $('#search_frame', window.top.document).slideUp(100);
108
+ $('#search a', window.top.document).removeClass('active inactive')
109
+ $(window.top).focus();
110
+ }
111
+ });
112
+ }
113
+
114
+ $(escapeShortcut);
115
+ $(fullListSearch);
116
+ $(linkList);
117
+ $(collapse);