distil 0.14.4 → 0.14.5.a
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/distil +10 -0
- data/lib/distil/project.rb +10 -7
- data/lib/distil/source-file.rb +1 -1
- metadata +28 -164
- data/Buildfile +0 -33
- data/distil.gemspec +0 -783
- data/lib/distil/javascript-documentation-generator.rb +0 -49
- data/vendor/pdoc/LICENSE +0 -16
- data/vendor/pdoc/PDoc.tmbundle/Commands/Continue PDoc Comment.tmCommand +0 -39
- data/vendor/pdoc/PDoc.tmbundle/Macros/Collapse PDoc Blocks.tmMacro +0 -4084
- data/vendor/pdoc/PDoc.tmbundle/Macros/Expand PDoc Blocks.tmMacro +0 -1388
- data/vendor/pdoc/PDoc.tmbundle/Preferences/PDoc.tmPreferences +0 -50
- data/vendor/pdoc/PDoc.tmbundle/Snippets/class.tmSnippet +0 -24
- data/vendor/pdoc/PDoc.tmbundle/Snippets/constant.tmSnippet +0 -22
- data/vendor/pdoc/PDoc.tmbundle/Snippets/event.tmSnippet +0 -16
- data/vendor/pdoc/PDoc.tmbundle/Snippets/method.tmSnippet +0 -22
- data/vendor/pdoc/PDoc.tmbundle/Snippets/mixin.tmSnippet +0 -23
- data/vendor/pdoc/PDoc.tmbundle/Snippets/namespace.tmSnippet +0 -24
- data/vendor/pdoc/PDoc.tmbundle/Snippets/param.tmSnippet +0 -16
- data/vendor/pdoc/PDoc.tmbundle/Snippets/property.tmSnippet +0 -22
- data/vendor/pdoc/PDoc.tmbundle/Snippets/section.tmSnippet +0 -23
- data/vendor/pdoc/PDoc.tmbundle/Syntaxes/PDoc.tmLanguage +0 -33
- data/vendor/pdoc/PDoc.tmbundle/info.plist +0 -22
- data/vendor/pdoc/README.markdown +0 -34
- data/vendor/pdoc/Rakefile +0 -46
- data/vendor/pdoc/bin/pdoc +0 -58
- data/vendor/pdoc/lib/pdoc.rb +0 -32
- data/vendor/pdoc/lib/pdoc/error.rb +0 -4
- data/vendor/pdoc/lib/pdoc/generators.rb +0 -6
- data/vendor/pdoc/lib/pdoc/generators/abstract_generator.rb +0 -16
- data/vendor/pdoc/lib/pdoc/generators/html.rb +0 -8
- data/vendor/pdoc/lib/pdoc/generators/html/helpers.rb +0 -256
- data/vendor/pdoc/lib/pdoc/generators/html/page.rb +0 -71
- data/vendor/pdoc/lib/pdoc/generators/html/syntax_highlighter.rb +0 -41
- data/vendor/pdoc/lib/pdoc/generators/html/template.rb +0 -37
- data/vendor/pdoc/lib/pdoc/generators/html/website.rb +0 -194
- data/vendor/pdoc/lib/pdoc/generators/json.rb +0 -15
- data/vendor/pdoc/lib/pdoc/generators/pythonesque.rb +0 -105
- data/vendor/pdoc/lib/pdoc/models.rb +0 -47
- data/vendor/pdoc/lib/pdoc/models/argument.rb +0 -37
- data/vendor/pdoc/lib/pdoc/models/base.rb +0 -107
- data/vendor/pdoc/lib/pdoc/models/callable.rb +0 -19
- data/vendor/pdoc/lib/pdoc/models/class.rb +0 -28
- data/vendor/pdoc/lib/pdoc/models/class_method.rb +0 -18
- data/vendor/pdoc/lib/pdoc/models/class_property.rb +0 -9
- data/vendor/pdoc/lib/pdoc/models/constant.rb +0 -9
- data/vendor/pdoc/lib/pdoc/models/constructor.rb +0 -14
- data/vendor/pdoc/lib/pdoc/models/container.rb +0 -114
- data/vendor/pdoc/lib/pdoc/models/entity.rb +0 -54
- data/vendor/pdoc/lib/pdoc/models/instance_method.rb +0 -18
- data/vendor/pdoc/lib/pdoc/models/instance_property.rb +0 -9
- data/vendor/pdoc/lib/pdoc/models/mixin.rb +0 -10
- data/vendor/pdoc/lib/pdoc/models/namespace.rb +0 -10
- data/vendor/pdoc/lib/pdoc/models/root.rb +0 -27
- data/vendor/pdoc/lib/pdoc/models/section.rb +0 -19
- data/vendor/pdoc/lib/pdoc/models/signature.rb +0 -27
- data/vendor/pdoc/lib/pdoc/models/utility.rb +0 -11
- data/vendor/pdoc/lib/pdoc/parser.rb +0 -109
- data/vendor/pdoc/lib/pdoc/parser/argument_description_nodes.rb +0 -21
- data/vendor/pdoc/lib/pdoc/parser/basic_nodes.rb +0 -31
- data/vendor/pdoc/lib/pdoc/parser/description_nodes.rb +0 -42
- data/vendor/pdoc/lib/pdoc/parser/documentation_nodes.rb +0 -483
- data/vendor/pdoc/lib/pdoc/parser/ebnf_arguments_nodes.rb +0 -58
- data/vendor/pdoc/lib/pdoc/parser/ebnf_expression_nodes.rb +0 -227
- data/vendor/pdoc/lib/pdoc/parser/fragment.rb +0 -55
- data/vendor/pdoc/lib/pdoc/parser/section_content_nodes.rb +0 -19
- data/vendor/pdoc/lib/pdoc/parser/tags_nodes.rb +0 -14
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/argument_description.treetop +0 -31
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/basic.treetop +0 -41
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/description.treetop +0 -7
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/documentation.treetop +0 -75
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/ebnf_arguments.treetop +0 -33
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/ebnf_expression.treetop +0 -70
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/ebnf_javascript.treetop +0 -54
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/events.treetop +0 -17
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/section_content.treetop +0 -8
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/tags.treetop +0 -31
- data/vendor/pdoc/lib/pdoc/runner.rb +0 -110
- data/vendor/pdoc/lib/pdoc/treemaker.rb +0 -94
- data/vendor/pdoc/pdoc.gemspec +0 -31
- data/vendor/pdoc/templates/html/assets/images/pdoc/alias.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/class.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/class_deprecated.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/class_method.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/class_property.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/constant.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/constructor.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/deprecated.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/description.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/information.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/instance_method.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/instance_property.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/method.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/method_deprecated.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/mixin.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/namespace.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/property.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/related_to.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/search-background.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/section-background.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/section.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/selected-section-background.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/subclass.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/superclass.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/utility.png +0 -0
- data/vendor/pdoc/templates/html/assets/javascripts/pdoc/application.js +0 -478
- data/vendor/pdoc/templates/html/assets/javascripts/pdoc/prototype.js +0 -4874
- data/vendor/pdoc/templates/html/assets/javascripts/pdoc/tabs.js +0 -506
- data/vendor/pdoc/templates/html/assets/stylesheets/pdoc/api.css +0 -677
- data/vendor/pdoc/templates/html/assets/stylesheets/pdoc/pygments.css +0 -62
- data/vendor/pdoc/templates/html/helpers.rb +0 -35
- data/vendor/pdoc/templates/html/index.erb +0 -18
- data/vendor/pdoc/templates/html/item_index.js.erb +0 -6
- data/vendor/pdoc/templates/html/layout.erb +0 -67
- data/vendor/pdoc/templates/html/leaf.erb +0 -22
- data/vendor/pdoc/templates/html/node.erb +0 -30
- data/vendor/pdoc/templates/html/partials/class_relationships.erb +0 -19
- data/vendor/pdoc/templates/html/partials/classes.erb +0 -7
- data/vendor/pdoc/templates/html/partials/constructor.erb +0 -5
- data/vendor/pdoc/templates/html/partials/description.erb +0 -5
- data/vendor/pdoc/templates/html/partials/link_list.erb +0 -1
- data/vendor/pdoc/templates/html/partials/method_signatures.erb +0 -14
- data/vendor/pdoc/templates/html/partials/methodized_note.erb +0 -9
- data/vendor/pdoc/templates/html/partials/mixins.erb +0 -7
- data/vendor/pdoc/templates/html/partials/namespaces.erb +0 -7
- data/vendor/pdoc/templates/html/partials/related_utilities.erb +0 -5
- data/vendor/pdoc/templates/html/partials/relationships.erb +0 -11
- data/vendor/pdoc/templates/html/partials/short_description_list.erb +0 -7
- data/vendor/pdoc/templates/html/partials/title.erb +0 -22
- data/vendor/pdoc/templates/html/section.erb +0 -18
- data/vendor/pdoc/test/fixtures/ajax.js +0 -809
- data/vendor/pdoc/test/fixtures/prototype.js +0 -5789
- data/vendor/pdoc/test/fixtures/test.txt +0 -1
- data/vendor/pdoc/test/fixtures/text.txt +0 -13
- data/vendor/pdoc/test/unit/parser/argument_description_test.rb +0 -40
- data/vendor/pdoc/test/unit/parser/basic_test.rb +0 -55
- data/vendor/pdoc/test/unit/parser/description_test.rb +0 -34
- data/vendor/pdoc/test/unit/parser/documentation_test.rb +0 -520
- data/vendor/pdoc/test/unit/parser/ebnf_arguments_test.rb +0 -81
- data/vendor/pdoc/test/unit/parser/ebnf_expression_test.rb +0 -382
- data/vendor/pdoc/test/unit/parser/ebnf_javascript_test.rb +0 -37
- data/vendor/pdoc/test/unit/parser/events_test.rb +0 -27
- data/vendor/pdoc/test/unit/parser/section_content_test.rb +0 -44
- data/vendor/pdoc/test/unit/parser/tags_test.rb +0 -39
- data/vendor/pdoc/test/unit/parser/test_fragment.rb +0 -80
- data/vendor/pdoc/test/unit/parser_test_helper.rb +0 -62
- data/vendor/pdoc/test/unit/runner/basic_test.rb +0 -14
- data/vendor/pdoc/test/unit/templates/html_helpers_test.rb +0 -25
- data/vendor/pdoc/vendor/albino.rb +0 -122
- data/vendor/pdoc/website/html/documentation.html +0 -280
- data/vendor/pdoc/website/html/images/pdoc.jpg +0 -0
- data/vendor/pdoc/website/html/index.html +0 -84
- data/vendor/pdoc/website/html/stylesheets/main.css +0 -73
- data/vendor/pdoc/website/html/stylesheets/reset.css +0 -18
- data/vendor/pdoc/website/markdown/syntax.markdown +0 -226
- data/yuicompressor-2.4.6.zip +0 -0
@@ -1,62 +0,0 @@
|
|
1
|
-
.highlight .hll { background-color: #ffffcc }
|
2
|
-
.highlight { background: #f8f8f8; }
|
3
|
-
.highlight .c { color: #408080; font-style: italic } /* Comment */
|
4
|
-
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
5
|
-
.highlight .k { color: #008000; font-weight: bold } /* Keyword */
|
6
|
-
.highlight .o { color: #666666 } /* Operator */
|
7
|
-
.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
|
8
|
-
.highlight .cp { color: #BC7A00 } /* Comment.Preproc */
|
9
|
-
.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
|
10
|
-
.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
|
11
|
-
.highlight .gd { color: #A00000 } /* Generic.Deleted */
|
12
|
-
.highlight .ge { font-style: italic } /* Generic.Emph */
|
13
|
-
.highlight .gr { color: #FF0000 } /* Generic.Error */
|
14
|
-
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
15
|
-
.highlight .gi { color: #00A000 } /* Generic.Inserted */
|
16
|
-
.highlight .go { color: #808080 } /* Generic.Output */
|
17
|
-
.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
|
18
|
-
.highlight .gs { font-weight: bold } /* Generic.Strong */
|
19
|
-
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
20
|
-
.highlight .gt { color: #0040D0 } /* Generic.Traceback */
|
21
|
-
.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
|
22
|
-
.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
|
23
|
-
.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
|
24
|
-
.highlight .kp { color: #008000 } /* Keyword.Pseudo */
|
25
|
-
.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
|
26
|
-
.highlight .kt { color: #B00040 } /* Keyword.Type */
|
27
|
-
.highlight .m { color: #666666 } /* Literal.Number */
|
28
|
-
.highlight .s { color: #BA2121 } /* Literal.String */
|
29
|
-
.highlight .na { color: #7D9029 } /* Name.Attribute */
|
30
|
-
.highlight .nb { color: #008000 } /* Name.Builtin */
|
31
|
-
.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
|
32
|
-
.highlight .no { color: #880000 } /* Name.Constant */
|
33
|
-
.highlight .nd { color: #AA22FF } /* Name.Decorator */
|
34
|
-
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
|
35
|
-
.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
|
36
|
-
.highlight .nf { color: #0000FF } /* Name.Function */
|
37
|
-
.highlight .nl { color: #A0A000 } /* Name.Label */
|
38
|
-
.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
|
39
|
-
.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
|
40
|
-
.highlight .nv { color: #19177C } /* Name.Variable */
|
41
|
-
.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
|
42
|
-
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
|
43
|
-
.highlight .mf { color: #666666 } /* Literal.Number.Float */
|
44
|
-
.highlight .mh { color: #666666 } /* Literal.Number.Hex */
|
45
|
-
.highlight .mi { color: #666666 } /* Literal.Number.Integer */
|
46
|
-
.highlight .mo { color: #666666 } /* Literal.Number.Oct */
|
47
|
-
.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
|
48
|
-
.highlight .sc { color: #BA2121 } /* Literal.String.Char */
|
49
|
-
.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
|
50
|
-
.highlight .s2 { color: #BA2121 } /* Literal.String.Double */
|
51
|
-
.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
|
52
|
-
.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
|
53
|
-
.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
|
54
|
-
.highlight .sx { color: #008000 } /* Literal.String.Other */
|
55
|
-
.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
|
56
|
-
.highlight .s1 { color: #BA2121 } /* Literal.String.Single */
|
57
|
-
.highlight .ss { color: #19177C } /* Literal.String.Symbol */
|
58
|
-
.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
|
59
|
-
.highlight .vc { color: #19177C } /* Name.Variable.Class */
|
60
|
-
.highlight .vg { color: #19177C } /* Name.Variable.Global */
|
61
|
-
.highlight .vi { color: #19177C } /* Name.Variable.Instance */
|
62
|
-
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module PDoc
|
2
|
-
module Generators
|
3
|
-
module Html
|
4
|
-
module Helpers
|
5
|
-
module BaseHelper
|
6
|
-
def layout_section(title, classname = title.downcase)
|
7
|
-
<<-EOS
|
8
|
-
<div class="section section-#{classname}">
|
9
|
-
<div class="section-title">
|
10
|
-
<h3>#{title}</h3>
|
11
|
-
</div> <!-- .section-title -->
|
12
|
-
<div class="section-content">
|
13
|
-
EOS
|
14
|
-
end
|
15
|
-
|
16
|
-
def end_layout_section
|
17
|
-
<<-EOS
|
18
|
-
</div> <!-- .section-content -->
|
19
|
-
</div> <!-- .section -->
|
20
|
-
EOS
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
module LinkHelper
|
25
|
-
end
|
26
|
-
|
27
|
-
module CodeHelper
|
28
|
-
end
|
29
|
-
|
30
|
-
module MenuHelper
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
<% @title = "Home" %>
|
2
|
-
|
3
|
-
<div class="page-introduction">
|
4
|
-
<%= @index_page_content %>
|
5
|
-
</div> <!-- .section -->
|
6
|
-
|
7
|
-
<%= layout_section('Sections') %>
|
8
|
-
<ul class="section-list">
|
9
|
-
<% @root.sections.each do |section| %>
|
10
|
-
<li>
|
11
|
-
<h4>
|
12
|
-
<a href="<%= path_to(section) %>"><%= section.name %></a>
|
13
|
-
</h4>
|
14
|
-
<p><%= htmlize(section.short_description) %></p>
|
15
|
-
</li>
|
16
|
-
<% end %>
|
17
|
-
</ul>
|
18
|
-
<%= end_layout_section %>
|
@@ -1,67 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
-
<title><%= @short_name %> v<%= @version %> API documentation | <%= @title %></title>
|
7
|
-
<meta name="generator" content="PDoc" />
|
8
|
-
|
9
|
-
<%= javascript_include_tag "pdoc/prototype" %>
|
10
|
-
<%= javascript_include_tag "pdoc/application", "pdoc/tabs" %>
|
11
|
-
<%= javascript_include_tag "pdoc/item_index" %>
|
12
|
-
|
13
|
-
<%= stylesheet_link_tag "pdoc/api", "pdoc/pygments" %>
|
14
|
-
|
15
|
-
<script type="text/javascript">
|
16
|
-
PDoc.pathPrefix = '<%= path_prefix %>';
|
17
|
-
</script>
|
18
|
-
</head>
|
19
|
-
<body>
|
20
|
-
|
21
|
-
<div id="sidebar">
|
22
|
-
<ul id="sidebar_tabs" class="sidebar-tabs">
|
23
|
-
<li>
|
24
|
-
<a href="#menu_pane">Menu</a>
|
25
|
-
</li>
|
26
|
-
<li>
|
27
|
-
<a href="#search_pane">Search</a>
|
28
|
-
</li>
|
29
|
-
</ul> <!-- .sidebar-tabs -->
|
30
|
-
|
31
|
-
<form class="search-ribbon">
|
32
|
-
<label>
|
33
|
-
<span class="hidden">Search</span>
|
34
|
-
<input type="text" id="search" size="20" title="Search" />
|
35
|
-
</label>
|
36
|
-
</form>
|
37
|
-
|
38
|
-
<div class="sidebar-pane scrollable" id="menu_pane">
|
39
|
-
<%= menu(@root) %><!--- #api_menu =-->
|
40
|
-
</div> <!-- .sidebar-pane -->
|
41
|
-
<div class="sidebar-pane" id="search_pane">
|
42
|
-
<ul id="search_results" class="search-results menu-items scrollable"></ul>
|
43
|
-
</div> <!-- .sidebar-pane -->
|
44
|
-
</div> <!-- #sidebar -->
|
45
|
-
|
46
|
-
<div id="page">
|
47
|
-
<%= @home ? @index_header : @header %>
|
48
|
-
|
49
|
-
<div id="main" class="page-content">
|
50
|
-
<%= @content_for_layout %>
|
51
|
-
</div> <!-- #main -->
|
52
|
-
|
53
|
-
<div id="footer">
|
54
|
-
<p><a href="<%= @home_url %>"><%= @name %></a> v<%= @version %> API documentation.</p>
|
55
|
-
<p>
|
56
|
-
<% if @timestamp %>
|
57
|
-
Last updated on <%= @timestamp.strftime('%B %d, %Y at %H:%M UTC') %>.
|
58
|
-
<% end %>
|
59
|
-
Generated by <a href="http://pdoc.org">PDoc</a>.
|
60
|
-
Uses <a href="http://famfamfam.com/lab/icons/silk/" title="famfamfam.com: Silk Icons">Silk Icons</a> and portions of <a href="http://github.com/280north/aristo/tree/master" title="280north's aristo at master - GitHub">Aristo</a>.
|
61
|
-
</p>
|
62
|
-
<%= @footer %>
|
63
|
-
</div> <!-- #footer -->
|
64
|
-
|
65
|
-
</div> <!-- #page -->
|
66
|
-
</body>
|
67
|
-
</html>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<% @title = "#{@doc_instance.full_name} #{@doc_instance.type}" %>
|
2
|
-
|
3
|
-
<%= include "partials/title", :object => @doc_instance %>
|
4
|
-
|
5
|
-
<div class="section">
|
6
|
-
<div class="section-title">
|
7
|
-
</div> <!-- .section-title -->
|
8
|
-
<div class="section-content">
|
9
|
-
<div class="method-description">
|
10
|
-
<% if @doc_instance.respond_to?(:signatures) %>
|
11
|
-
<%= include "partials/method_signatures", :object => @doc_instance %>
|
12
|
-
<% else %>
|
13
|
-
<pre class="syntax"><code class="ebnf"><%= @doc_instance.signature.name %> → <%= auto_link_types(@doc_instance.signature.return_value, :name => :long).join(' | ') %></code></pre>
|
14
|
-
<% end %>
|
15
|
-
|
16
|
-
<%= htmlize(@doc_instance.description) %>
|
17
|
-
|
18
|
-
<%= include "partials/relationships", :object => @doc_instance %>
|
19
|
-
<%= include "partials/methodized_note", :object => @doc_instance %>
|
20
|
-
</div>
|
21
|
-
</div> <!-- .section-content -->
|
22
|
-
</div> <!-- .section -->
|
@@ -1,30 +0,0 @@
|
|
1
|
-
<% d = @doc_instance %>
|
2
|
-
|
3
|
-
<%= include "partials/title", :object => @doc_instance %>
|
4
|
-
<%= include "partials/description", :object => @doc_instance %>
|
5
|
-
|
6
|
-
<%= include "partials/namespaces", :object => @doc_instance %>
|
7
|
-
<%= include "partials/classes", :object => @doc_instance %>
|
8
|
-
|
9
|
-
<%= include "partials/class_relationships", :object => @doc_instance %>
|
10
|
-
<%= include "partials/related_utilities", :object => @doc_instance %>
|
11
|
-
<%= include "partials/constructor", :object => @doc_instance %>
|
12
|
-
|
13
|
-
<%
|
14
|
-
types = [
|
15
|
-
[:class_methods, 'Class methods'],
|
16
|
-
[:class_properties, 'Class properties'],
|
17
|
-
[:instance_methods, 'Instance methods'],
|
18
|
-
[:instance_properties, 'Instance properties'],
|
19
|
-
[:constants, 'Constants']
|
20
|
-
].each do |a| %>
|
21
|
-
<% method, title = a %>
|
22
|
-
<% methods = @doc_instance.send(method) %>
|
23
|
-
<% unless methods.empty? %>
|
24
|
-
<%= layout_section(title, method) %>
|
25
|
-
<ul class="method-list">
|
26
|
-
<%= include "partials/link_list", :collection => methods.sort! %>
|
27
|
-
</ul>
|
28
|
-
<%= end_layout_section %>
|
29
|
-
<% end %>
|
30
|
-
<% end %>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<% if object.is_a?(Models::Class) %>
|
2
|
-
<% if object.superclass %>
|
3
|
-
<%= layout_section('Superclass') %>
|
4
|
-
<p><%= auto_link_code(object.superclass, :name => :long) %></p>
|
5
|
-
<%= end_layout_section %>
|
6
|
-
<% end %>
|
7
|
-
|
8
|
-
<% if object.subclasses? %>
|
9
|
-
<%= layout_section('Subclasses') %>
|
10
|
-
<p><%= object.subclasses.sort!.map { |s| auto_link_code(s, :name => :long) }.join(', ') %></p>
|
11
|
-
<%= end_layout_section %>
|
12
|
-
<% end %>
|
13
|
-
<% end %>
|
14
|
-
|
15
|
-
<% if object.included_mixins? %>
|
16
|
-
<%= layout_section('Includes', :mixins) %>
|
17
|
-
<p><%= object.included_mixins.sort!.map { |m| auto_link_code(m, :name => :long) }.join(', ') %></p>
|
18
|
-
<%= end_layout_section %>
|
19
|
-
<% end %>
|
@@ -1 +0,0 @@
|
|
1
|
-
<li><%= auto_link_code(object, :name => :short, :class => class_names_for(object)) %></li>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<pre class="syntax"><code class="ebnf"><%= method_synopsis(object).join('<br />') %></code></pre>
|
2
|
-
<% if object.respond_to?(:arguments) && object.arguments? %>
|
3
|
-
<ul class="argument-list">
|
4
|
-
<% object.arguments.each do |arg| %>
|
5
|
-
<li>
|
6
|
-
<code class="argument-name"><%= arg.name %></code>
|
7
|
-
<% unless arg.types.empty? %>
|
8
|
-
<span class="argument-types">(<%= auto_link_types(arg.types).map { |t| "<code>#{t}</code>"}.join(' | ') %>)</span>
|
9
|
-
<% end %>
|
10
|
-
<%= ' – ' + inline_htmlize(arg.description) unless arg.description.empty? %>
|
11
|
-
</li>
|
12
|
-
<% end %>
|
13
|
-
</ul> <!-- .argument-list -->
|
14
|
-
<% end %>
|
@@ -1,9 +0,0 @@
|
|
1
|
-
<% if object.methodized? %>
|
2
|
-
<p class="note">
|
3
|
-
<% if object.respond_to?(:methodized_self) %>
|
4
|
-
This method can be called <em>either</em> as an <a href="<%= path_to(object.methodized_self) %>">instance method</a> <em>or</em> as a generic method.
|
5
|
-
<% else %>
|
6
|
-
This method can be called <em>either</em> as an instance method <em>or</em> as a <a href="<%= path_to(object.functionalized_self) %>">generic method</a>.
|
7
|
-
<% end %>
|
8
|
-
If calling as a generic, pass the instance in as the first argument.<p>
|
9
|
-
<% end %>
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<% if object.aliases? %>
|
2
|
-
<p class="alias aliases">Aliased as: <%= object.aliases.map.map { |a| auto_link_code(a, :name => :long) }.join(', ') %></p>
|
3
|
-
<% end %>
|
4
|
-
|
5
|
-
<% if object.alias? %>
|
6
|
-
<p class="alias alias-of">Alias of: <%= auto_link_code(object.alias, :name => :long) %></p>
|
7
|
-
<% end %>
|
8
|
-
|
9
|
-
<% if object.respond_to?(:related_to) && related_to = object.related_to %>
|
10
|
-
<p class="related-to">Related to: <%= auto_link_code(related_to, :name => :long) %></p>
|
11
|
-
<% end %>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<% @title = object.full_name %>
|
2
|
-
|
3
|
-
<% if object.deprecated? %>
|
4
|
-
<div id="deprecated"><%= img_tag('pdoc/deprecated.png', :alt => "Deprecated", :width => 150, :height => 150) %></div>
|
5
|
-
<% end %>
|
6
|
-
|
7
|
-
<ul class="breadcrumbs clearfix">
|
8
|
-
<li><a href="<%= path_prefix %>">Home</a></li>
|
9
|
-
<% breadcrumb(object).each do |crumb| %>
|
10
|
-
<li>→ <%= crumb %></li>
|
11
|
-
<% end %>
|
12
|
-
</ul>
|
13
|
-
|
14
|
-
<% if object.respond_to?(:src_code_href) && object.src_code_href %>
|
15
|
-
<p id="src_code_href"><a href="<%= object.src_code_href %>">src code</a></p>
|
16
|
-
<% end %>
|
17
|
-
|
18
|
-
<h2 class="page-title">
|
19
|
-
<span class="type"><%= object.type %></span> <%= object.full_name %>
|
20
|
-
</h2>
|
21
|
-
|
22
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
<% @title = "#{@doc_instance.full_name} " %>
|
2
|
-
|
3
|
-
<%= include "partials/title", :object => @doc_instance %>
|
4
|
-
<%= include "partials/description", :object => @doc_instance %>
|
5
|
-
|
6
|
-
<% if @doc_instance.respond_to?(:utilities) && @doc_instance.utilities? %>
|
7
|
-
<%= layout_section('Utilities') %>
|
8
|
-
<ul class="method-list">
|
9
|
-
<% @doc_instance.utilities.each do |utility| %>
|
10
|
-
<li><%= auto_link_code(utility) %></li>
|
11
|
-
<% end %>
|
12
|
-
</ul>
|
13
|
-
<%= end_layout_section %>
|
14
|
-
<% end %>
|
15
|
-
|
16
|
-
<%= include "partials/namespaces", :object => @doc_instance %>
|
17
|
-
<%= include "partials/classes", :object => @doc_instance %>
|
18
|
-
<%= include "partials/mixins", :object => @doc_instance %>
|
@@ -1,809 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
/**
|
4
|
-
* == DOM ==
|
5
|
-
* The DOM section
|
6
|
-
**/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
/**
|
11
|
-
* == ajax ==
|
12
|
-
* The AJAX section
|
13
|
-
**/
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
/**
|
18
|
-
* == lang ==
|
19
|
-
* The LANG section
|
20
|
-
**/
|
21
|
-
|
22
|
-
|
23
|
-
/** section: DOM
|
24
|
-
* class Element
|
25
|
-
* The Element class
|
26
|
-
**/
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
/** related to: Element
|
31
|
-
* $(element) -> Element
|
32
|
-
* the $ function
|
33
|
-
**/
|
34
|
-
|
35
|
-
/** section: DOM
|
36
|
-
* $$(selector) -> Array
|
37
|
-
* the $$ function
|
38
|
-
**/
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
/**
|
43
|
-
* Element.setStyle(@element, styles) -> Element
|
44
|
-
* - element (String | Element): an id or DOM node
|
45
|
-
* - styles (String | Object | Hash): can be either a regular CSS string or
|
46
|
-
* a hash or regular object, in which case, properties need to be camelized
|
47
|
-
*
|
48
|
-
* fires element:style:updated
|
49
|
-
*
|
50
|
-
* Sets the style of element
|
51
|
-
* and returns it
|
52
|
-
**/
|
53
|
-
|
54
|
-
|
55
|
-
/**
|
56
|
-
* Element#foo() -> Element
|
57
|
-
* a dummy non methodized method
|
58
|
-
**/
|
59
|
-
|
60
|
-
/** alias of: Element#foo
|
61
|
-
* Element#bar() -> Element
|
62
|
-
* fires click
|
63
|
-
**/
|
64
|
-
|
65
|
-
|
66
|
-
/** section: ajax
|
67
|
-
* Ajax
|
68
|
-
* All requester object in the Ajax namespace share a common set of options and callbacks.
|
69
|
-
* Callbacks are called at various points in the life-cycle of a request, and always feature
|
70
|
-
* the same list of arguments. They are passed to requesters right along with their other options.
|
71
|
-
**/
|
72
|
-
var Ajax = {
|
73
|
-
/**
|
74
|
-
* Ajax.getTransport( ) -> XMLHttpRequest | ActiveXObject
|
75
|
-
* returns: a new instance of the XMLHttpRequest object for
|
76
|
-
* standard compliant browsers, the available ActiveXObject
|
77
|
-
* counter part for IE.
|
78
|
-
**/
|
79
|
-
getTransport: function() {
|
80
|
-
return Try.these(
|
81
|
-
function() {return new XMLHttpRequest()},
|
82
|
-
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
|
83
|
-
function() {return new ActiveXObject('Microsoft.XMLHTTP')}
|
84
|
-
) || false;
|
85
|
-
},
|
86
|
-
/**
|
87
|
-
* Ajax.activeRequestCount -> 0
|
88
|
-
**/
|
89
|
-
activeRequestCount: 0,
|
90
|
-
|
91
|
-
/**
|
92
|
-
* Ajax.__private__() -> Boolean
|
93
|
-
**/
|
94
|
-
__private__: function() { return true }
|
95
|
-
};
|
96
|
-
|
97
|
-
/** section: ajax
|
98
|
-
* Ajax.Responders
|
99
|
-
* includes Enumerable
|
100
|
-
**/
|
101
|
-
Ajax.Responders = {
|
102
|
-
/**
|
103
|
-
* Ajax.Responders.responders -> Array
|
104
|
-
**/
|
105
|
-
responders: [],
|
106
|
-
|
107
|
-
_each: function(iterator) {
|
108
|
-
this.responders._each(iterator);
|
109
|
-
},
|
110
|
-
|
111
|
-
/**
|
112
|
-
* Ajax.Responders.register(responder) -> undefined
|
113
|
-
* Registers a responder.
|
114
|
-
**/
|
115
|
-
register: function(responder) {
|
116
|
-
if (!this.include(responder))
|
117
|
-
this.responders.push(responder);
|
118
|
-
},
|
119
|
-
|
120
|
-
/**
|
121
|
-
* Ajax.Responders.unregister(responder) -> undefined
|
122
|
-
* Unregisters a responder.
|
123
|
-
**/
|
124
|
-
unregister: function(responder) {
|
125
|
-
this.responders = this.responders.without(responder);
|
126
|
-
},
|
127
|
-
/**
|
128
|
-
* Ajax.Responders.dispatch(callback, request, transport, json) -> undefined
|
129
|
-
* Dispatches a callback.
|
130
|
-
**/
|
131
|
-
dispatch: function(callback, request, transport, json) {
|
132
|
-
this.each(function(responder) {
|
133
|
-
if (Object.isFunction(responder[callback])) {
|
134
|
-
try {
|
135
|
-
responder[callback].apply(responder, [request, transport, json]);
|
136
|
-
} catch (e) { }
|
137
|
-
}
|
138
|
-
});
|
139
|
-
}
|
140
|
-
};
|
141
|
-
|
142
|
-
Object.extend(Ajax.Responders, Enumerable);
|
143
|
-
|
144
|
-
Ajax.Responders.register({
|
145
|
-
onCreate: function() { Ajax.activeRequestCount++ },
|
146
|
-
onComplete: function() { Ajax.activeRequestCount-- }
|
147
|
-
});
|
148
|
-
|
149
|
-
/**
|
150
|
-
* class Ajax.Base
|
151
|
-
* Abstract class
|
152
|
-
**/
|
153
|
-
|
154
|
-
Ajax.Base = Klass.create({
|
155
|
-
initialize: function(options) {
|
156
|
-
this.options = {
|
157
|
-
method: 'post',
|
158
|
-
asynchronous: true,
|
159
|
-
contentType: 'application/x-www-form-urlencoded',
|
160
|
-
encoding: 'UTF-8',
|
161
|
-
parameters: '',
|
162
|
-
evalJSON: true,
|
163
|
-
evalJS: true
|
164
|
-
};
|
165
|
-
Object.extend(this.options, options || { });
|
166
|
-
|
167
|
-
this.options.method = this.options.method.toLowerCase();
|
168
|
-
|
169
|
-
if (Object.isString(this.options.parameters))
|
170
|
-
this.options.parameters = this.options.parameters.toQueryParams();
|
171
|
-
else if (Object.isHash(this.options.parameters))
|
172
|
-
this.options.parameters = this.options.parameters.toObject();
|
173
|
-
}
|
174
|
-
});
|
175
|
-
/**
|
176
|
-
* class Ajax.Request < Ajax.Base
|
177
|
-
* Main Ajax class
|
178
|
-
**/
|
179
|
-
|
180
|
-
|
181
|
-
/**
|
182
|
-
* new Ajax.Request(url, options)
|
183
|
-
* the Ajax Request constructor
|
184
|
-
**/
|
185
|
-
Ajax.Request = Klass.create(Ajax.Base, {
|
186
|
-
_complete: false,
|
187
|
-
|
188
|
-
initialize: function($super, url, options) {
|
189
|
-
$super(options);
|
190
|
-
this.transport = Ajax.getTransport();
|
191
|
-
this.request(url);
|
192
|
-
},
|
193
|
-
/**
|
194
|
-
* Ajax.Request#request(url) -> undefined
|
195
|
-
* instanciates the request
|
196
|
-
* not to be confused with [[Ajax.Request foo bar]]
|
197
|
-
**/
|
198
|
-
request: function(url) {
|
199
|
-
this.url = url;
|
200
|
-
this.method = this.options.method;
|
201
|
-
var params = Object.clone(this.options.parameters);
|
202
|
-
|
203
|
-
if (!['get', 'post'].include(this.method)) {
|
204
|
-
// simulate other verbs over post
|
205
|
-
params['_method'] = this.method;
|
206
|
-
this.method = 'post';
|
207
|
-
}
|
208
|
-
|
209
|
-
this.parameters = params;
|
210
|
-
|
211
|
-
if (params = Object.toQueryString(params)) {
|
212
|
-
// when GET, append parameters to URL
|
213
|
-
if (this.method == 'get')
|
214
|
-
this.url += (this.url.include('?') ? '&' : '?') + params;
|
215
|
-
else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
|
216
|
-
params += '&_=';
|
217
|
-
}
|
218
|
-
|
219
|
-
try {
|
220
|
-
var response = new Ajax.Response(this);
|
221
|
-
if (this.options.onCreate) this.options.onCreate(response);
|
222
|
-
Ajax.Responders.dispatch('onCreate', this, response);
|
223
|
-
|
224
|
-
this.transport.open(this.method.toUpperCase(), this.url,
|
225
|
-
this.options.asynchronous);
|
226
|
-
|
227
|
-
if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
|
228
|
-
|
229
|
-
this.transport.onreadystatechange = this.onStateChange.bind(this);
|
230
|
-
this.setRequestHeaders();
|
231
|
-
|
232
|
-
this.body = this.method == 'post' ? (this.options.postBody || params) : null;
|
233
|
-
this.transport.send(this.body);
|
234
|
-
|
235
|
-
/* Force Firefox to handle ready state 4 for synchronous requests */
|
236
|
-
if (!this.options.asynchronous && this.transport.overrideMimeType)
|
237
|
-
this.onStateChange();
|
238
|
-
|
239
|
-
}
|
240
|
-
catch (e) {
|
241
|
-
this.dispatchException(e);
|
242
|
-
}
|
243
|
-
},
|
244
|
-
/**
|
245
|
-
* Ajax.Request#dummy -> "dummy"
|
246
|
-
* a dummy instance property for the sake of testing
|
247
|
-
**/
|
248
|
-
onStateChange: function() {
|
249
|
-
var readyState = this.transport.readyState;
|
250
|
-
if (readyState > 1 && !((readyState == 4) && this._complete))
|
251
|
-
this.respondToReadyState(this.transport.readyState);
|
252
|
-
},
|
253
|
-
|
254
|
-
setRequestHeaders: function() {
|
255
|
-
var headers = {
|
256
|
-
'X-Requested-With': 'XMLHttpRequest',
|
257
|
-
'X-Prototype-Version': Prototype.Version,
|
258
|
-
'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
|
259
|
-
};
|
260
|
-
|
261
|
-
if (this.method == 'post') {
|
262
|
-
headers['Content-type'] = this.options.contentType +
|
263
|
-
(this.options.encoding ? '; charset=' + this.options.encoding : '');
|
264
|
-
|
265
|
-
/* Force "Connection: close" for older Mozilla browsers to work
|
266
|
-
* around a bug where XMLHttpRequest sends an incorrect
|
267
|
-
* Content-length header. See Mozilla Bugzilla #246651.
|
268
|
-
*/
|
269
|
-
if (this.transport.overrideMimeType &&
|
270
|
-
(navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
|
271
|
-
headers['Connection'] = 'close';
|
272
|
-
}
|
273
|
-
|
274
|
-
// user-defined headers
|
275
|
-
if (typeof this.options.requestHeaders == 'object') {
|
276
|
-
var extras = this.options.requestHeaders;
|
277
|
-
|
278
|
-
if (Object.isFunction(extras.push))
|
279
|
-
for (var i = 0, length = extras.length; i < length; i += 2)
|
280
|
-
headers[extras[i]] = extras[i+1];
|
281
|
-
else
|
282
|
-
$H(extras).each(function(pair) { headers[pair.key] = pair.value });
|
283
|
-
}
|
284
|
-
|
285
|
-
for (var name in headers)
|
286
|
-
this.transport.setRequestHeader(name, headers[name]);
|
287
|
-
},
|
288
|
-
/**
|
289
|
-
* Ajax.Request#success() -> Boolean
|
290
|
-
* verifies the status of the request
|
291
|
-
**/
|
292
|
-
success: function() {
|
293
|
-
var status = this.getStatus();
|
294
|
-
return !status || (status >= 200 && status < 300);
|
295
|
-
},
|
296
|
-
|
297
|
-
getStatus: function() {
|
298
|
-
try {
|
299
|
-
return this.transport.status || 0;
|
300
|
-
} catch (e) { return 0 }
|
301
|
-
},
|
302
|
-
|
303
|
-
respondToReadyState: function(readyState) {
|
304
|
-
var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
|
305
|
-
|
306
|
-
if (state == 'Complete') {
|
307
|
-
try {
|
308
|
-
this._complete = true;
|
309
|
-
(this.options['on' + response.status]
|
310
|
-
|| this.options['on' + (this.success() ? 'Success' : 'Failure')]
|
311
|
-
|| Prototype.emptyFunction)(response, response.headerJSON);
|
312
|
-
} catch (e) {
|
313
|
-
this.dispatchException(e);
|
314
|
-
}
|
315
|
-
|
316
|
-
var contentType = response.getHeader('Content-type');
|
317
|
-
if (this.options.evalJS == 'force'
|
318
|
-
|| (this.options.evalJS && this.isSameOrigin() && contentType
|
319
|
-
&& contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
|
320
|
-
this.evalResponse();
|
321
|
-
}
|
322
|
-
|
323
|
-
try {
|
324
|
-
(this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
|
325
|
-
Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
|
326
|
-
} catch (e) {
|
327
|
-
this.dispatchException(e);
|
328
|
-
}
|
329
|
-
|
330
|
-
if (state == 'Complete') {
|
331
|
-
// avoid memory leak in MSIE: clean up
|
332
|
-
this.transport.onreadystatechange = Prototype.emptyFunction;
|
333
|
-
}
|
334
|
-
},
|
335
|
-
|
336
|
-
isSameOrigin: function() {
|
337
|
-
var m = this.url.match(/^\s*https?:\/\/[^\/]*/);
|
338
|
-
return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
|
339
|
-
protocol: location.protocol,
|
340
|
-
domain: document.domain,
|
341
|
-
port: location.port ? ':' + location.port : ''
|
342
|
-
}));
|
343
|
-
},
|
344
|
-
|
345
|
-
getHeader: function(name) {
|
346
|
-
try {
|
347
|
-
return this.transport.getResponseHeader(name) || null;
|
348
|
-
} catch (e) { return null }
|
349
|
-
},
|
350
|
-
|
351
|
-
evalResponse: function() {
|
352
|
-
try {
|
353
|
-
return eval((this.transport.responseText || '').unfilterJSON());
|
354
|
-
} catch (e) {
|
355
|
-
this.dispatchException(e);
|
356
|
-
}
|
357
|
-
},
|
358
|
-
|
359
|
-
dispatchException: function(exception) {
|
360
|
-
(this.options.onException || Prototype.emptyFunction)(this, exception);
|
361
|
-
Ajax.Responders.dispatch('onException', this, exception);
|
362
|
-
}
|
363
|
-
});
|
364
|
-
|
365
|
-
/**
|
366
|
-
* Ajax.Request.classProp -> "dummy"
|
367
|
-
* a dummy class property for the sake of testing
|
368
|
-
**/
|
369
|
-
|
370
|
-
|
371
|
-
/**
|
372
|
-
* Ajax.Request.Events = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']
|
373
|
-
* array of possible states of an xhr request
|
374
|
-
**/
|
375
|
-
Ajax.Request.Events =
|
376
|
-
['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
|
377
|
-
|
378
|
-
Ajax.Response = Klass.create({
|
379
|
-
initialize: function(request){
|
380
|
-
this.request = request;
|
381
|
-
var transport = this.transport = request.transport,
|
382
|
-
readyState = this.readyState = transport.readyState;
|
383
|
-
|
384
|
-
if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
|
385
|
-
this.status = this.getStatus();
|
386
|
-
this.statusText = this.getStatusText();
|
387
|
-
this.responseText = String.interpret(transport.responseText);
|
388
|
-
this.headerJSON = this._getHeaderJSON();
|
389
|
-
}
|
390
|
-
|
391
|
-
if(readyState == 4) {
|
392
|
-
var xml = transport.responseXML;
|
393
|
-
this.responseXML = Object.isUndefined(xml) ? null : xml;
|
394
|
-
this.responseJSON = this._getResponseJSON();
|
395
|
-
}
|
396
|
-
},
|
397
|
-
|
398
|
-
status: 0,
|
399
|
-
statusText: '',
|
400
|
-
|
401
|
-
getStatus: Ajax.Request.prototype.getStatus,
|
402
|
-
|
403
|
-
getStatusText: function() {
|
404
|
-
try {
|
405
|
-
return this.transport.statusText || '';
|
406
|
-
} catch (e) { return '' }
|
407
|
-
},
|
408
|
-
|
409
|
-
getHeader: Ajax.Request.prototype.getHeader,
|
410
|
-
|
411
|
-
getAllHeaders: function() {
|
412
|
-
try {
|
413
|
-
return this.getAllResponseHeaders();
|
414
|
-
} catch (e) { return null }
|
415
|
-
},
|
416
|
-
|
417
|
-
getResponseHeader: function(name) {
|
418
|
-
return this.transport.getResponseHeader(name);
|
419
|
-
},
|
420
|
-
|
421
|
-
getAllResponseHeaders: function() {
|
422
|
-
return this.transport.getAllResponseHeaders();
|
423
|
-
},
|
424
|
-
|
425
|
-
_getHeaderJSON: function() {
|
426
|
-
var json = this.getHeader('X-JSON');
|
427
|
-
if (!json) return null;
|
428
|
-
json = decodeURIComponent(escape(json));
|
429
|
-
try {
|
430
|
-
return json.evalJSON(this.request.options.sanitizeJSON ||
|
431
|
-
!this.request.isSameOrigin());
|
432
|
-
} catch (e) {
|
433
|
-
this.request.dispatchException(e);
|
434
|
-
}
|
435
|
-
},
|
436
|
-
|
437
|
-
_getResponseJSON: function() {
|
438
|
-
var options = this.request.options;
|
439
|
-
if (!options.evalJSON || (options.evalJSON != 'force' &&
|
440
|
-
!(this.getHeader('Content-type') || '').include('application/json')) ||
|
441
|
-
this.responseText.blank())
|
442
|
-
return null;
|
443
|
-
try {
|
444
|
-
return this.responseText.evalJSON(options.sanitizeJSON ||
|
445
|
-
!this.request.isSameOrigin());
|
446
|
-
} catch (e) {
|
447
|
-
this.request.dispatchException(e);
|
448
|
-
}
|
449
|
-
}
|
450
|
-
});
|
451
|
-
|
452
|
-
Ajax.Updater = Klass.create(Ajax.Request, {
|
453
|
-
initialize: function($super, container, url, options) {
|
454
|
-
this.container = {
|
455
|
-
success: (container.success || container),
|
456
|
-
failure: (container.failure || (container.success ? null : container))
|
457
|
-
};
|
458
|
-
|
459
|
-
options = Object.clone(options);
|
460
|
-
var onComplete = options.onComplete;
|
461
|
-
options.onComplete = (function(response, json) {
|
462
|
-
this.updateContent(response.responseText);
|
463
|
-
if (Object.isFunction(onComplete)) onComplete(response, json);
|
464
|
-
}).bind(this);
|
465
|
-
|
466
|
-
$super(url, options);
|
467
|
-
},
|
468
|
-
|
469
|
-
updateContent: function(responseText) {
|
470
|
-
var receiver = this.container[this.success() ? 'success' : 'failure'],
|
471
|
-
options = this.options;
|
472
|
-
|
473
|
-
if (!options.evalScripts) responseText = responseText.stripScripts();
|
474
|
-
|
475
|
-
if (receiver = $(receiver)) {
|
476
|
-
if (options.insertion) {
|
477
|
-
if (Object.isString(options.insertion)) {
|
478
|
-
var insertion = { }; insertion[options.insertion] = responseText;
|
479
|
-
receiver.insert(insertion);
|
480
|
-
}
|
481
|
-
else options.insertion(receiver, responseText);
|
482
|
-
}
|
483
|
-
else receiver.update(responseText);
|
484
|
-
}
|
485
|
-
}
|
486
|
-
});
|
487
|
-
|
488
|
-
Ajax.PeriodicalUpdater = Klass.create(Ajax.Base, {
|
489
|
-
initialize: function($super, container, url, options) {
|
490
|
-
$super(options);
|
491
|
-
this.onComplete = this.options.onComplete;
|
492
|
-
|
493
|
-
this.frequency = (this.options.frequency || 2);
|
494
|
-
this.decay = (this.options.decay || 1);
|
495
|
-
|
496
|
-
this.updater = { };
|
497
|
-
this.container = container;
|
498
|
-
this.url = url;
|
499
|
-
|
500
|
-
this.start();
|
501
|
-
},
|
502
|
-
|
503
|
-
start: function() {
|
504
|
-
this.options.onComplete = this.updateComplete.bind(this);
|
505
|
-
this.onTimerEvent();
|
506
|
-
},
|
507
|
-
|
508
|
-
stop: function() {
|
509
|
-
this.updater.options.onComplete = undefined;
|
510
|
-
clearTimeout(this.timer);
|
511
|
-
(this.onComplete || Prototype.emptyFunction).apply(this, arguments);
|
512
|
-
},
|
513
|
-
|
514
|
-
updateComplete: function(response) {
|
515
|
-
if (this.options.decay) {
|
516
|
-
this.decay = (response.responseText == this.lastText ?
|
517
|
-
this.decay * this.options.decay : 1);
|
518
|
-
|
519
|
-
this.lastText = response.responseText;
|
520
|
-
}
|
521
|
-
this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
|
522
|
-
},
|
523
|
-
|
524
|
-
onTimerEvent: function() {
|
525
|
-
this.updater = new Ajax.Updater(this.container, this.url, this.options);
|
526
|
-
}
|
527
|
-
});
|
528
|
-
|
529
|
-
|
530
|
-
/** deprecated, section: DOM
|
531
|
-
* Toggle
|
532
|
-
**/
|
533
|
-
|
534
|
-
/** deprecated
|
535
|
-
* Toggle.display() -> undefined
|
536
|
-
**/
|
537
|
-
|
538
|
-
/**
|
539
|
-
* Toggle.foo() -> undefined
|
540
|
-
* Here is a paragraph.
|
541
|
-
*
|
542
|
-
* Another... and some code examples below:
|
543
|
-
*
|
544
|
-
* alert(Toggle.foo());
|
545
|
-
* // -> does nothing
|
546
|
-
*
|
547
|
-
* foo.show();
|
548
|
-
*
|
549
|
-
* An HTML block
|
550
|
-
*
|
551
|
-
* language: html
|
552
|
-
* <div id="my_div"></div>
|
553
|
-
*
|
554
|
-
* Now a title.
|
555
|
-
* ===========
|
556
|
-
*
|
557
|
-
**/
|
558
|
-
|
559
|
-
/** section: lang
|
560
|
-
* class String
|
561
|
-
* the string class.
|
562
|
-
**/
|
563
|
-
|
564
|
-
/** section: lang
|
565
|
-
* String.interpret(obj) -> String
|
566
|
-
* a foo bar baz
|
567
|
-
**/
|
568
|
-
|
569
|
-
/** section: ajax
|
570
|
-
* class Ajax.Namespace
|
571
|
-
**/
|
572
|
-
|
573
|
-
/**
|
574
|
-
* class Ajax.Namespace.Manager
|
575
|
-
**/
|
576
|
-
|
577
|
-
/** section: lang
|
578
|
-
* mixin Enumerable
|
579
|
-
* ruby inspired niceness
|
580
|
-
**/
|
581
|
-
var Enumerable = {
|
582
|
-
|
583
|
-
/**
|
584
|
-
* Enumerable#each(iterator[, context]) -> Enumerable
|
585
|
-
* - iterator (Function): A `Function` that expects an item in the
|
586
|
-
* collection as the first argument and a numerical index as the second.
|
587
|
-
* - context (Object): The scope in which to call `iterator`. Affects what
|
588
|
-
* the keyword `this` means inside `iterator`.
|
589
|
-
*
|
590
|
-
* Calls `iterator` for each item in the collection.
|
591
|
-
**/
|
592
|
-
each: function(iterator, context) {
|
593
|
-
var index = 0;
|
594
|
-
iterator = iterator.bind(context);
|
595
|
-
try {
|
596
|
-
this._each(function(value) {
|
597
|
-
iterator(value, index++);
|
598
|
-
});
|
599
|
-
} catch (e) {
|
600
|
-
if (e != $break) throw e;
|
601
|
-
}
|
602
|
-
return this;
|
603
|
-
},
|
604
|
-
|
605
|
-
eachSlice: function(number, iterator, context) {
|
606
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
607
|
-
var index = -number, slices = [], array = this.toArray();
|
608
|
-
if (number < 1) return array;
|
609
|
-
while ((index += number) < array.length)
|
610
|
-
slices.push(array.slice(index, index+number));
|
611
|
-
return slices.collect(iterator, context);
|
612
|
-
},
|
613
|
-
|
614
|
-
all: function(iterator, context) {
|
615
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
616
|
-
var result = true;
|
617
|
-
this.each(function(value, index) {
|
618
|
-
result = result && !!iterator(value, index);
|
619
|
-
if (!result) throw $break;
|
620
|
-
});
|
621
|
-
return result;
|
622
|
-
},
|
623
|
-
|
624
|
-
any: function(iterator, context) {
|
625
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
626
|
-
var result = false;
|
627
|
-
this.each(function(value, index) {
|
628
|
-
if (result = !!iterator(value, index))
|
629
|
-
throw $break;
|
630
|
-
});
|
631
|
-
return result;
|
632
|
-
},
|
633
|
-
|
634
|
-
collect: function(iterator, context) {
|
635
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
636
|
-
var results = [];
|
637
|
-
this.each(function(value, index) {
|
638
|
-
results.push(iterator(value, index));
|
639
|
-
});
|
640
|
-
return results;
|
641
|
-
},
|
642
|
-
|
643
|
-
detect: function(iterator, context) {
|
644
|
-
iterator = iterator.bind(context);
|
645
|
-
var result;
|
646
|
-
this.each(function(value, index) {
|
647
|
-
if (iterator(value, index)) {
|
648
|
-
result = value;
|
649
|
-
throw $break;
|
650
|
-
}
|
651
|
-
});
|
652
|
-
return result;
|
653
|
-
},
|
654
|
-
|
655
|
-
findAll: function(iterator, context) {
|
656
|
-
iterator = iterator.bind(context);
|
657
|
-
var results = [];
|
658
|
-
this.each(function(value, index) {
|
659
|
-
if (iterator(value, index))
|
660
|
-
results.push(value);
|
661
|
-
});
|
662
|
-
return results;
|
663
|
-
},
|
664
|
-
|
665
|
-
grep: function(filter, iterator, context) {
|
666
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
667
|
-
var results = [];
|
668
|
-
|
669
|
-
if (Object.isString(filter))
|
670
|
-
filter = new RegExp(filter);
|
671
|
-
|
672
|
-
this.each(function(value, index) {
|
673
|
-
if (filter.match(value))
|
674
|
-
results.push(iterator(value, index));
|
675
|
-
});
|
676
|
-
return results;
|
677
|
-
},
|
678
|
-
|
679
|
-
include: function(object) {
|
680
|
-
if (Object.isFunction(this.indexOf))
|
681
|
-
if (this.indexOf(object) != -1) return true;
|
682
|
-
|
683
|
-
var found = false;
|
684
|
-
this.each(function(value) {
|
685
|
-
if (value == object) {
|
686
|
-
found = true;
|
687
|
-
throw $break;
|
688
|
-
}
|
689
|
-
});
|
690
|
-
return found;
|
691
|
-
},
|
692
|
-
|
693
|
-
inGroupsOf: function(number, fillWith) {
|
694
|
-
fillWith = Object.isUndefined(fillWith) ? null : fillWith;
|
695
|
-
return this.eachSlice(number, function(slice) {
|
696
|
-
while(slice.length < number) slice.push(fillWith);
|
697
|
-
return slice;
|
698
|
-
});
|
699
|
-
},
|
700
|
-
|
701
|
-
inject: function(memo, iterator, context) {
|
702
|
-
iterator = iterator.bind(context);
|
703
|
-
this.each(function(value, index) {
|
704
|
-
memo = iterator(memo, value, index);
|
705
|
-
});
|
706
|
-
return memo;
|
707
|
-
},
|
708
|
-
|
709
|
-
invoke: function(method) {
|
710
|
-
var args = $A(arguments).slice(1);
|
711
|
-
return this.map(function(value) {
|
712
|
-
return value[method].apply(value, args);
|
713
|
-
});
|
714
|
-
},
|
715
|
-
|
716
|
-
max: function(iterator, context) {
|
717
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
718
|
-
var result;
|
719
|
-
this.each(function(value, index) {
|
720
|
-
value = iterator(value, index);
|
721
|
-
if (result == null || value >= result)
|
722
|
-
result = value;
|
723
|
-
});
|
724
|
-
return result;
|
725
|
-
},
|
726
|
-
|
727
|
-
min: function(iterator, context) {
|
728
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
729
|
-
var result;
|
730
|
-
this.each(function(value, index) {
|
731
|
-
value = iterator(value, index);
|
732
|
-
if (result == null || value < result)
|
733
|
-
result = value;
|
734
|
-
});
|
735
|
-
return result;
|
736
|
-
},
|
737
|
-
|
738
|
-
partition: function(iterator, context) {
|
739
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
740
|
-
var trues = [], falses = [];
|
741
|
-
this.each(function(value, index) {
|
742
|
-
(iterator(value, index) ?
|
743
|
-
trues : falses).push(value);
|
744
|
-
});
|
745
|
-
return [trues, falses];
|
746
|
-
},
|
747
|
-
|
748
|
-
pluck: function(property) {
|
749
|
-
var results = [];
|
750
|
-
this.each(function(value) {
|
751
|
-
results.push(value[property]);
|
752
|
-
});
|
753
|
-
return results;
|
754
|
-
},
|
755
|
-
|
756
|
-
reject: function(iterator, context) {
|
757
|
-
iterator = iterator.bind(context);
|
758
|
-
var results = [];
|
759
|
-
this.each(function(value, index) {
|
760
|
-
if (!iterator(value, index))
|
761
|
-
results.push(value);
|
762
|
-
});
|
763
|
-
return results;
|
764
|
-
},
|
765
|
-
|
766
|
-
sortBy: function(iterator, context) {
|
767
|
-
iterator = iterator.bind(context);
|
768
|
-
return this.map(function(value, index) {
|
769
|
-
return {value: value, criteria: iterator(value, index)};
|
770
|
-
}).sort(function(left, right) {
|
771
|
-
var a = left.criteria, b = right.criteria;
|
772
|
-
return a < b ? -1 : a > b ? 1 : 0;
|
773
|
-
}).pluck('value');
|
774
|
-
},
|
775
|
-
|
776
|
-
toArray: function() {
|
777
|
-
return this.map();
|
778
|
-
},
|
779
|
-
|
780
|
-
zip: function() {
|
781
|
-
var iterator = Prototype.K, args = $A(arguments);
|
782
|
-
if (Object.isFunction(args.last()))
|
783
|
-
iterator = args.pop();
|
784
|
-
|
785
|
-
var collections = [this].concat(args).map($A);
|
786
|
-
return this.map(function(value, index) {
|
787
|
-
return iterator(collections.pluck(index));
|
788
|
-
});
|
789
|
-
},
|
790
|
-
|
791
|
-
size: function() {
|
792
|
-
return this.toArray().length;
|
793
|
-
},
|
794
|
-
|
795
|
-
inspect: function() {
|
796
|
-
return '#<Enumerable:' + this.toArray().inspect() + '>';
|
797
|
-
}
|
798
|
-
};
|
799
|
-
|
800
|
-
Object.extend(Enumerable, {
|
801
|
-
map: Enumerable.collect,
|
802
|
-
find: Enumerable.detect,
|
803
|
-
select: Enumerable.findAll,
|
804
|
-
filter: Enumerable.findAll,
|
805
|
-
member: Enumerable.include,
|
806
|
-
entries: Enumerable.toArray,
|
807
|
-
every: Enumerable.all,
|
808
|
-
some: Enumerable.any
|
809
|
-
});
|