aws-sdk 2.0.1 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +20 -0
- package/.gitignore +10 -0
- package/.travis.yml +20 -0
- package/.yardopts +20 -0
- package/.yardopts_guide +21 -0
- package/Gemfile +16 -0
- package/Gemfile.lock +34 -0
- package/README.md +5 -6
- package/Rakefile +14 -0
- package/UPGRADING.md +9 -4
- package/configuration.sample +5 -0
- package/dist/BUNDLE_LICENSE.txt +96 -0
- package/dist/aws-sdk.js +9594 -0
- package/dist/aws-sdk.min.js +21 -0
- package/dist-tools/.eslintrc +10 -0
- package/dist-tools/browser-builder.js +142 -0
- package/dist-tools/strategies/cache.js +68 -0
- package/dist-tools/strategies/default.js +165 -0
- package/dist-tools/test/browser-builder.mocha.spec.coffee +182 -0
- package/dist-tools/test/helpers.coffee +16 -0
- package/doc-src/guide/browser-building.md +93 -0
- package/doc-src/guide/browser-configuring-wif.md +287 -0
- package/doc-src/guide/browser-configuring.md +218 -0
- package/doc-src/guide/browser-examples.md +220 -0
- package/doc-src/guide/browser-intro.md +46 -0
- package/doc-src/guide/browser-making-requests.md +279 -0
- package/doc-src/guide/browser-services.md +75 -0
- package/doc-src/guide/index.md +41 -0
- package/doc-src/guide/node-configuring.md +272 -0
- package/doc-src/guide/node-examples.md +341 -0
- package/doc-src/guide/node-intro.md +32 -0
- package/doc-src/guide/node-making-requests.md +309 -0
- package/doc-src/guide/node-services.md +159 -0
- package/doc-src/templates/api-versions/model_documentor.rb +366 -0
- package/doc-src/templates/api-versions/plugin.rb +230 -0
- package/doc-src/templates/api-versions/templates/default/class/html/setup.rb +9 -0
- package/doc-src/templates/api-versions/templates/default/class/html/waiter_details_list.erb +7 -0
- package/doc-src/templates/api-versions/templates/default/class/html/waiter_summary.erb +7 -0
- package/doc-src/templates/api-versions/templates/default/docstring/html/experimental.erb +4 -0
- package/doc-src/templates/api-versions/templates/default/docstring/setup.rb +9 -0
- package/doc-src/templates/api-versions/templates/default/fulldoc/html/css/common.css +6 -0
- package/doc-src/templates/api-versions/templates/default/fulldoc/html/setup.rb +62 -0
- package/doc-src/templates/api-versions/templates/default/layout/html/services.erb +10 -0
- package/doc-src/templates/api-versions/templates/default/layout/html/setup.rb +28 -0
- package/doc-src/templates/api-versions/templates/default/module/html/box_info.erb +45 -0
- package/doc-src/templates/api-versions/templates/default/module/html/children.erb +8 -0
- package/doc-src/templates/api-versions/templates/default/tags/setup.rb +3 -0
- package/doc-src/templates/api-versions/templates/default/waiter_details/html/method_signature.erb +3 -0
- package/doc-src/templates/api-versions/templates/default/waiter_details/html/setup.rb +5 -0
- package/doc-src/templates/default/layout/html/footer.erb +31 -0
- package/doc-src/templates/default/layout/html/layout.erb +23 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/css/highlight.github.css +127 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/css/style.css +1192 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/img/logo.png +0 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/app.js +33 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/highlight.pack.js +27 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/AUTHORS +55 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/LICENSE +25 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js +247 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/file.png +0 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/searchtools.js +568 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/underscore.js +23 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/search.erb +29 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/search_index.erb +1 -0
- package/doc-src/templates/flasky_sphinx_guide/fulldoc/html/setup.rb +75 -0
- package/doc-src/templates/flasky_sphinx_guide/layout/html/layout.erb +93 -0
- package/doc-src/templates/flasky_sphinx_guide/layout/html/setup.rb +9 -0
- package/doc-src/templates/flasky_sphinx_guide/layout/html/sidebar.erb +45 -0
- package/doc-src/templates/flasky_sphinx_guide/onefile/html/layout.erb +51 -0
- package/doc-src/templates/flasky_sphinx_guide/onefile/html/setup.rb +1 -0
- package/eslint-rules/no-require-in-service.js +10 -0
- package/features/autoscaling/autoscaling.feature +21 -0
- package/features/autoscaling/step_definitions/autoscaling.js +49 -0
- package/features/cloudformation/cloudformation.feature +22 -0
- package/features/cloudformation/step_definitions/cloudformation.js +26 -0
- package/features/cloudfront/cloudfront.feature +28 -0
- package/features/cloudfront/step_definitions/cloudfront-latest.js +54 -0
- package/features/cloudfront/step_definitions/cloudfront.js +21 -0
- package/features/cloudsearch/cloudsearch.feature +34 -0
- package/features/cloudsearch/step_definitions/cloudsearch.js +42 -0
- package/features/cloudtrail/cloudtrail.feature +17 -0
- package/features/cloudtrail/step_definitions/cloudtrail.js +14 -0
- package/features/cloudwatch/cloudwatch.feature +15 -0
- package/features/cloudwatch/step_definitions/cloudwatch.js +48 -0
- package/features/datapipeline/datapipeline.feature +23 -0
- package/features/datapipeline/step_definitions/datapipeline.js +79 -0
- package/features/directconnect/directconnect.feature +20 -0
- package/features/directconnect/step_definitions/directconnect.js +44 -0
- package/features/dynamodb/crc32.feature +18 -0
- package/features/dynamodb/step_definitions/dynamodb.js +154 -0
- package/features/dynamodb/tables.feature +50 -0
- package/features/ec2/ec2.feature +28 -0
- package/features/ec2/step_definitions/ec2.js +65 -0
- package/features/elasticache/elasticache.feature +20 -0
- package/features/elasticache/step_definitions/elasticache.js +34 -0
- package/features/elasticbeanstalk/elasticbeanstalk.feature +22 -0
- package/features/elasticbeanstalk/step_definitions/elasticbeanstalk.js +38 -0
- package/features/elastictranscoder/elastictranscoder.feature +24 -0
- package/features/elastictranscoder/step_definitions/elastictranscoder.js +56 -0
- package/features/elb/elb.feature +19 -0
- package/features/elb/step_definitions/elb.js +37 -0
- package/features/emr/emr.feature +16 -0
- package/features/emr/step_definitions/emr.js +45 -0
- package/features/extra/assertions.js +29 -0
- package/features/extra/dummy.feature +0 -0
- package/features/extra/fixtures/testfile.txt +1 -0
- package/features/extra/helpers.js +113 -0
- package/features/extra/hooks.js +107 -0
- package/features/extra/world.js +12 -0
- package/features/glacier/glacier.feature +47 -0
- package/features/glacier/step_definitions/glacier.js +112 -0
- package/features/iam/iam.feature +24 -0
- package/features/iam/step_definitions/iam.js +66 -0
- package/features/importexport/importexport.feature +53 -0
- package/features/importexport/step_definitions/importexport.js +42 -0
- package/features/kinesis/kinesis.feature +9 -0
- package/features/kinesis/step_definitions/kinesis.js +10 -0
- package/features/opsworks/opsworks.feature +26 -0
- package/features/opsworks/step_definitions/opsworks.js +42 -0
- package/features/rds/rds.feature +32 -0
- package/features/rds/step_definitions/rds.js +72 -0
- package/features/redshift/redshift.feature +20 -0
- package/features/redshift/step_definitions/redshift.js +33 -0
- package/features/route53/route53.feature +41 -0
- package/features/route53/step_definitions/route53.js +97 -0
- package/features/s3/buckets.feature +40 -0
- package/features/s3/objects.feature +122 -0
- package/features/s3/step_definitions/buckets.js +136 -0
- package/features/s3/step_definitions/hooks.js +39 -0
- package/features/s3/step_definitions/objects.js +204 -0
- package/features/s3/step_definitions/proxy.js +44 -0
- package/features/ses/ses.feature +20 -0
- package/features/ses/step_definitions/ses.js +22 -0
- package/features/simpledb/simpledb.feature +29 -0
- package/features/simpledb/step_definitions/simpledb.js +46 -0
- package/features/sns/sns.feature +15 -0
- package/features/sns/step_definitions/sns.js +33 -0
- package/features/sqs/messages.feature +21 -0
- package/features/sqs/queues.feature +18 -0
- package/features/sqs/step_definitions/messages.js +46 -0
- package/features/sqs/step_definitions/queues.js +33 -0
- package/features/sqs/step_definitions/sqs.js +7 -0
- package/features/storagegateway/step_definitions/storagegateway.js +16 -0
- package/features/storagegateway/storagegateway.feature +13 -0
- package/features/sts/step_definitions/sts.js +35 -0
- package/features/sts/sts.feature +29 -0
- package/features/support/step_definitions/support.js +35 -0
- package/features/support/support.feature +18 -0
- package/features/swf/step_definitions/swf.js +38 -0
- package/features/swf/swf.feature +15 -0
- package/index.js +2 -0
- package/lib/core.js +2 -2
- package/lib/credentials/shared_ini_file_credentials.js +0 -1
- package/lib/event_listeners.js +13 -1
- package/lib/http/node.js +19 -30
- package/lib/model/resource_waiter.js +0 -4
- package/lib/model/shape.js +2 -1
- package/lib/protocol/rest_xml.js +1 -1
- package/lib/region_config.js +31 -0
- package/lib/region_config.json +56 -0
- package/lib/request.js +37 -45
- package/lib/sequential_executor.js +17 -34
- package/lib/service.js +17 -44
- package/lib/services/cloudsearchdomain.js +69 -0
- package/lib/services/route53.js +0 -12
- package/lib/services/s3.js +3 -19
- package/lib/signers/v4.js +2 -1
- package/lib/util.js +28 -3
- package/package.json +3 -3
- package/scripts/console +11 -3
- package/scripts/coverage +126 -0
- package/tasks/apis.rake +122 -0
- package/tasks/browser.rake +89 -0
- package/tasks/docs.rake +36 -0
- package/tasks/lib/cucumber_generator.rb +40 -0
- package/tasks/util.rake +33 -0
- package/test/browser/js/jasmine-1.3.1.js +2600 -0
- package/test/browser/js/jasmine-html.js +681 -0
- package/test/browser/runner.html +109 -0
- package/test/browser/runner.js +92 -0
- package/test/browser/sample/appinfo.sample.js +15 -0
- package/test/browser/sample/console.html +429 -0
- package/test/browser/sample/css/smoothness/images/animated-overlay.gif +0 -0
- package/test/browser/sample/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- package/test/browser/sample/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- package/test/browser/sample/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- package/test/browser/sample/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- package/test/browser/sample/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- package/test/browser/sample/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- package/test/browser/sample/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- package/test/browser/sample/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- package/test/browser/sample/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- package/test/browser/sample/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- package/test/browser/sample/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- package/test/browser/sample/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- package/test/browser/sample/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- package/test/browser/sample/css/smoothness/jquery-ui-1.10.1.custom.css +1175 -0
- package/test/browser/sample/css/smoothness/jquery-ui-1.10.1.custom.min.css +5 -0
- package/test/browser/sample/img/loading.gif +0 -0
- package/test/browser/sample/js/jquery-1.9.1.js +9597 -0
- package/test/browser/sample/js/jquery-ui-1.10.1.custom.js +14903 -0
- package/test/browser/sample/js/jquery-ui-1.10.1.custom.min.js +6 -0
- package/test/browser/sample/s3upload.html +111 -0
- package/test/browser.spec.coffee +207 -0
- package/test/config.spec.coffee +202 -0
- package/test/credential_provider_chain.spec.coffee +90 -0
- package/test/credentials.spec.coffee +452 -0
- package/test/endpoint.spec.coffee +80 -0
- package/test/event_listeners.spec.coffee +493 -0
- package/test/helpers.coffee +150 -0
- package/test/http_request.spec.coffee +55 -0
- package/test/json/builder.spec.coffee +129 -0
- package/test/json/parser.spec.coffee +108 -0
- package/test/metadata_service.spec.coffee +54 -0
- package/test/model/api.spec.coffee +67 -0
- package/test/model/shape.spec.coffee +23 -0
- package/test/node_http_client.spec.coffee +40 -0
- package/test/param_validator.spec.coffee +456 -0
- package/test/protocol/json.spec.coffee +167 -0
- package/test/protocol/query.spec.coffee +191 -0
- package/test/protocol/rest.spec.coffee +237 -0
- package/test/protocol/rest_json.spec.coffee +255 -0
- package/test/protocol/rest_xml.spec.coffee +329 -0
- package/test/query/query_param_serializer.spec.coffee +327 -0
- package/test/region_config.spec.coffee +50 -0
- package/test/request.spec.coffee +316 -0
- package/test/resource_waiter.spec.coffee +89 -0
- package/test/response.spec.coffee +81 -0
- package/test/sequential_executor.spec.coffee +118 -0
- package/test/service.spec.coffee +230 -0
- package/test/services/cloudfront.spec.coffee +44 -0
- package/test/services/cloudsearchdomain.spec.coffee +23 -0
- package/test/services/dynamodb.spec.coffee +32 -0
- package/test/services/ec2.spec.coffee +78 -0
- package/test/services/elastictranscoder.spec.coffee +43 -0
- package/test/services/glacier.spec.coffee +61 -0
- package/test/services/rds.spec.coffee +38 -0
- package/test/services/route53.spec.coffee +77 -0
- package/test/services/s3.spec.coffee +538 -0
- package/test/services/simpledb.spec.coffee +12 -0
- package/test/services/sqs.spec.coffee +130 -0
- package/test/services/sts.spec.coffee +72 -0
- package/test/services/swf.spec.coffee +6 -0
- package/test/signers/presign.spec.coffee +36 -0
- package/test/signers/s3.spec.coffee +297 -0
- package/test/signers/v2.spec.coffee +68 -0
- package/test/signers/v4.spec.coffee +135 -0
- package/test/util.spec.coffee +510 -0
- package/test/xml/builder.spec.coffee +529 -0
- package/test/xml/parser.spec.coffee +587 -0
- package/lib/services/simpledb.js +0 -15
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* searchtools.js_t
|
|
3
|
+
* ~~~~~~~~~~~~~~~~
|
|
4
|
+
*
|
|
5
|
+
* Sphinx JavaScript utilties for the full-text search.
|
|
6
|
+
*
|
|
7
|
+
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
|
|
8
|
+
* :license: BSD, see LICENSE for details.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* helper function to return a node containing the
|
|
14
|
+
* search summary for a given text. keywords is a list
|
|
15
|
+
* of stemmed words, hlwords is the list of normal, unstemmed
|
|
16
|
+
* words. the first one is used to find the occurance, the
|
|
17
|
+
* latter for highlighting it.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
jQuery.makeSearchSummary = function(text, keywords, hlwords) {
|
|
21
|
+
var textLower = text.toLowerCase();
|
|
22
|
+
var start = 0;
|
|
23
|
+
$.each(keywords, function() {
|
|
24
|
+
var i = textLower.indexOf(this.toLowerCase());
|
|
25
|
+
if (i > -1)
|
|
26
|
+
start = i;
|
|
27
|
+
});
|
|
28
|
+
start = Math.max(start - 120, 0);
|
|
29
|
+
var excerpt = ((start > 0) ? '...' : '') +
|
|
30
|
+
$.trim(text.substr(start, 240)) +
|
|
31
|
+
((start + 240 - text.length) ? '...' : '');
|
|
32
|
+
var rv = $('<div class="context"></div>').text(excerpt);
|
|
33
|
+
$.each(hlwords, function() {
|
|
34
|
+
rv = rv.highlightText(this, 'highlighted');
|
|
35
|
+
});
|
|
36
|
+
return rv;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Porter Stemmer
|
|
42
|
+
*/
|
|
43
|
+
var Stemmer = function() {
|
|
44
|
+
|
|
45
|
+
var step2list = {
|
|
46
|
+
ational: 'ate',
|
|
47
|
+
tional: 'tion',
|
|
48
|
+
enci: 'ence',
|
|
49
|
+
anci: 'ance',
|
|
50
|
+
izer: 'ize',
|
|
51
|
+
bli: 'ble',
|
|
52
|
+
alli: 'al',
|
|
53
|
+
entli: 'ent',
|
|
54
|
+
eli: 'e',
|
|
55
|
+
ousli: 'ous',
|
|
56
|
+
ization: 'ize',
|
|
57
|
+
ation: 'ate',
|
|
58
|
+
ator: 'ate',
|
|
59
|
+
alism: 'al',
|
|
60
|
+
iveness: 'ive',
|
|
61
|
+
fulness: 'ful',
|
|
62
|
+
ousness: 'ous',
|
|
63
|
+
aliti: 'al',
|
|
64
|
+
iviti: 'ive',
|
|
65
|
+
biliti: 'ble',
|
|
66
|
+
logi: 'log'
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
var step3list = {
|
|
70
|
+
icate: 'ic',
|
|
71
|
+
ative: '',
|
|
72
|
+
alize: 'al',
|
|
73
|
+
iciti: 'ic',
|
|
74
|
+
ical: 'ic',
|
|
75
|
+
ful: '',
|
|
76
|
+
ness: ''
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
var c = "[^aeiou]"; // consonant
|
|
80
|
+
var v = "[aeiouy]"; // vowel
|
|
81
|
+
var C = c + "[^aeiouy]*"; // consonant sequence
|
|
82
|
+
var V = v + "[aeiou]*"; // vowel sequence
|
|
83
|
+
|
|
84
|
+
var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
|
|
85
|
+
var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
|
|
86
|
+
var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
|
|
87
|
+
var s_v = "^(" + C + ")?" + v; // vowel in stem
|
|
88
|
+
|
|
89
|
+
this.stemWord = function (w) {
|
|
90
|
+
if (w.length <= 3) return w;
|
|
91
|
+
|
|
92
|
+
// simple stemming
|
|
93
|
+
w = w.replace(/e?s$/, '')
|
|
94
|
+
w = w.replace(/ing$/, '');
|
|
95
|
+
return w;
|
|
96
|
+
|
|
97
|
+
var stem;
|
|
98
|
+
var suffix;
|
|
99
|
+
var firstch;
|
|
100
|
+
var origword = w;
|
|
101
|
+
|
|
102
|
+
if (w.length < 3)
|
|
103
|
+
return w;
|
|
104
|
+
|
|
105
|
+
var re;
|
|
106
|
+
var re2;
|
|
107
|
+
var re3;
|
|
108
|
+
var re4;
|
|
109
|
+
|
|
110
|
+
firstch = w.substr(0,1);
|
|
111
|
+
if (firstch == "y")
|
|
112
|
+
w = firstch.toUpperCase() + w.substr(1);
|
|
113
|
+
|
|
114
|
+
// Step 1a
|
|
115
|
+
re = /^(.+?)(ss|i)es$/;
|
|
116
|
+
re2 = /^(.+?)([^s])s$/;
|
|
117
|
+
|
|
118
|
+
if (re.test(w))
|
|
119
|
+
w = w.replace(re,"$1$2");
|
|
120
|
+
else if (re2.test(w))
|
|
121
|
+
w = w.replace(re2,"$1$2");
|
|
122
|
+
|
|
123
|
+
// Step 1b
|
|
124
|
+
re = /^(.+?)eed$/;
|
|
125
|
+
re2 = /^(.+?)(ed|ing)$/;
|
|
126
|
+
if (re.test(w)) {
|
|
127
|
+
var fp = re.exec(w);
|
|
128
|
+
re = new RegExp(mgr0);
|
|
129
|
+
if (re.test(fp[1])) {
|
|
130
|
+
re = /.$/;
|
|
131
|
+
w = w.replace(re,"");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else if (re2.test(w)) {
|
|
135
|
+
var fp = re2.exec(w);
|
|
136
|
+
stem = fp[1];
|
|
137
|
+
re2 = new RegExp(s_v);
|
|
138
|
+
if (re2.test(stem)) {
|
|
139
|
+
w = stem;
|
|
140
|
+
re2 = /(at|bl|iz)$/;
|
|
141
|
+
re3 = new RegExp("([^aeiouylsz])\\1$");
|
|
142
|
+
re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
|
|
143
|
+
if (re2.test(w))
|
|
144
|
+
w = w + "e";
|
|
145
|
+
else if (re3.test(w)) {
|
|
146
|
+
re = /.$/;
|
|
147
|
+
w = w.replace(re,"");
|
|
148
|
+
}
|
|
149
|
+
else if (re4.test(w))
|
|
150
|
+
w = w + "e";
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Step 1c
|
|
155
|
+
re = /^(.+?)y$/;
|
|
156
|
+
if (re.test(w)) {
|
|
157
|
+
var fp = re.exec(w);
|
|
158
|
+
stem = fp[1];
|
|
159
|
+
re = new RegExp(s_v);
|
|
160
|
+
if (re.test(stem))
|
|
161
|
+
w = stem + "i";
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Step 2
|
|
165
|
+
re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
|
|
166
|
+
if (re.test(w)) {
|
|
167
|
+
var fp = re.exec(w);
|
|
168
|
+
stem = fp[1];
|
|
169
|
+
suffix = fp[2];
|
|
170
|
+
re = new RegExp(mgr0);
|
|
171
|
+
if (re.test(stem))
|
|
172
|
+
w = stem + step2list[suffix];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Step 3
|
|
176
|
+
re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
|
|
177
|
+
if (re.test(w)) {
|
|
178
|
+
var fp = re.exec(w);
|
|
179
|
+
stem = fp[1];
|
|
180
|
+
suffix = fp[2];
|
|
181
|
+
re = new RegExp(mgr0);
|
|
182
|
+
if (re.test(stem))
|
|
183
|
+
w = stem + step3list[suffix];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Step 4
|
|
187
|
+
re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
|
|
188
|
+
re2 = /^(.+?)(s|t)(ion)$/;
|
|
189
|
+
if (re.test(w)) {
|
|
190
|
+
var fp = re.exec(w);
|
|
191
|
+
stem = fp[1];
|
|
192
|
+
re = new RegExp(mgr1);
|
|
193
|
+
if (re.test(stem))
|
|
194
|
+
w = stem;
|
|
195
|
+
}
|
|
196
|
+
else if (re2.test(w)) {
|
|
197
|
+
var fp = re2.exec(w);
|
|
198
|
+
stem = fp[1] + fp[2];
|
|
199
|
+
re2 = new RegExp(mgr1);
|
|
200
|
+
if (re2.test(stem))
|
|
201
|
+
w = stem;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Step 5
|
|
205
|
+
re = /^(.+?)e$/;
|
|
206
|
+
if (re.test(w)) {
|
|
207
|
+
var fp = re.exec(w);
|
|
208
|
+
stem = fp[1];
|
|
209
|
+
re = new RegExp(mgr1);
|
|
210
|
+
re2 = new RegExp(meq1);
|
|
211
|
+
re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
|
|
212
|
+
if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
|
|
213
|
+
w = stem;
|
|
214
|
+
}
|
|
215
|
+
re = /ll$/;
|
|
216
|
+
re2 = new RegExp(mgr1);
|
|
217
|
+
if (re.test(w) && re2.test(w)) {
|
|
218
|
+
re = /.$/;
|
|
219
|
+
w = w.replace(re,"");
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// and turn initial Y back to y
|
|
223
|
+
if (firstch == "y")
|
|
224
|
+
w = firstch.toLowerCase() + w.substr(1);
|
|
225
|
+
return w;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Search Module
|
|
232
|
+
*/
|
|
233
|
+
var Search = {
|
|
234
|
+
|
|
235
|
+
_index : null,
|
|
236
|
+
_queued_query : null,
|
|
237
|
+
_pulse_status : -1,
|
|
238
|
+
|
|
239
|
+
init : function() {
|
|
240
|
+
var params = $.getQueryParameters();
|
|
241
|
+
if (params.q) {
|
|
242
|
+
var query = params.q[0];
|
|
243
|
+
$('input[name="q"]')[0].value = query;
|
|
244
|
+
this.performSearch(query);
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
loadIndex : function(url) {
|
|
249
|
+
$.ajax({type: "GET", url: url, data: null, success: null,
|
|
250
|
+
dataType: "script", cache: true});
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
setIndex : function(index) {
|
|
254
|
+
var q;
|
|
255
|
+
this._index = index;
|
|
256
|
+
if ((q = this._queued_query) !== null) {
|
|
257
|
+
this._queued_query = null;
|
|
258
|
+
Search.query(q);
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
hasIndex : function() {
|
|
263
|
+
return this._index !== null;
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
deferQuery : function(query) {
|
|
267
|
+
this._queued_query = query;
|
|
268
|
+
},
|
|
269
|
+
|
|
270
|
+
stopPulse : function() {
|
|
271
|
+
this._pulse_status = 0;
|
|
272
|
+
},
|
|
273
|
+
|
|
274
|
+
startPulse : function() {
|
|
275
|
+
if (this._pulse_status >= 0)
|
|
276
|
+
return;
|
|
277
|
+
function pulse() {
|
|
278
|
+
Search._pulse_status = (Search._pulse_status + 1) % 4;
|
|
279
|
+
var dotString = '';
|
|
280
|
+
for (var i = 0; i < Search._pulse_status; i++)
|
|
281
|
+
dotString += '.';
|
|
282
|
+
Search.dots.text(dotString);
|
|
283
|
+
if (Search._pulse_status > -1)
|
|
284
|
+
window.setTimeout(pulse, 500);
|
|
285
|
+
};
|
|
286
|
+
pulse();
|
|
287
|
+
},
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* perform a search for something
|
|
291
|
+
*/
|
|
292
|
+
performSearch : function(query) {
|
|
293
|
+
// create the required interface elements
|
|
294
|
+
this.out = $('#search-results');
|
|
295
|
+
this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
|
|
296
|
+
this.dots = $('<span></span>').appendTo(this.title);
|
|
297
|
+
this.status = $('<p style="display: none"></p>').appendTo(this.out);
|
|
298
|
+
this.output = $('<ul class="search"/>').appendTo(this.out);
|
|
299
|
+
|
|
300
|
+
$('#search-progress').text(_('Preparing search...'));
|
|
301
|
+
this.startPulse();
|
|
302
|
+
|
|
303
|
+
// index already loaded, the browser was quick!
|
|
304
|
+
if (this.hasIndex())
|
|
305
|
+
this.query(query);
|
|
306
|
+
else
|
|
307
|
+
this.deferQuery(query);
|
|
308
|
+
},
|
|
309
|
+
|
|
310
|
+
query : function(query) {
|
|
311
|
+
var stopwords = ["and","then","into","it","as","are","in","if","for","no","there","their","was","is","be","to","that","but","they","not","such","with","by","a","on","these","of","will","this","near","the","or","at"];
|
|
312
|
+
|
|
313
|
+
// Stem the searchterms and add them to the correct list
|
|
314
|
+
var stemmer = new Stemmer();
|
|
315
|
+
var searchterms = [];
|
|
316
|
+
var excluded = [];
|
|
317
|
+
var hlterms = [];
|
|
318
|
+
var tmp = query.split(/\s+/);
|
|
319
|
+
var objectterms = [];
|
|
320
|
+
for (var i = 0; i < tmp.length; i++) {
|
|
321
|
+
if (tmp[i] != "") {
|
|
322
|
+
objectterms.push(tmp[i].toLowerCase());
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
|
|
326
|
+
tmp[i] == "") {
|
|
327
|
+
// skip this "word"
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
// stem the word
|
|
331
|
+
var word = stemmer.stemWord(tmp[i]).toLowerCase();
|
|
332
|
+
// select the correct list
|
|
333
|
+
if (word[0] == '-') {
|
|
334
|
+
var toAppend = excluded;
|
|
335
|
+
word = word.substr(1);
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
var toAppend = searchterms;
|
|
339
|
+
hlterms.push(word.toLowerCase());
|
|
340
|
+
}
|
|
341
|
+
// only add if not already in the list
|
|
342
|
+
if (!$.contains(toAppend, word))
|
|
343
|
+
toAppend.push(word);
|
|
344
|
+
};
|
|
345
|
+
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
|
|
346
|
+
|
|
347
|
+
// console.debug('SEARCH: searching for:');
|
|
348
|
+
// console.info('required: ', searchterms);
|
|
349
|
+
// console.info('excluded: ', excluded);
|
|
350
|
+
|
|
351
|
+
// prepare search
|
|
352
|
+
var filenames = this._index.filenames;
|
|
353
|
+
var titles = this._index.titles;
|
|
354
|
+
var terms = this._index.terms;
|
|
355
|
+
var fileMap = {};
|
|
356
|
+
var files = null;
|
|
357
|
+
// different result priorities
|
|
358
|
+
var importantResults = [];
|
|
359
|
+
var objectResults = [];
|
|
360
|
+
var regularResults = [];
|
|
361
|
+
var unimportantResults = [];
|
|
362
|
+
$('#search-progress').empty();
|
|
363
|
+
|
|
364
|
+
// lookup as object
|
|
365
|
+
for (var i = 0; i < objectterms.length; i++) {
|
|
366
|
+
var others = [].concat(objectterms.slice(0,i),
|
|
367
|
+
objectterms.slice(i+1, objectterms.length))
|
|
368
|
+
var results = this.performObjectSearch(objectterms[i], others);
|
|
369
|
+
// Assume first word is most likely to be the object,
|
|
370
|
+
// other words more likely to be in description.
|
|
371
|
+
// Therefore put matches for earlier words first.
|
|
372
|
+
// (Results are eventually used in reverse order).
|
|
373
|
+
objectResults = results[0].concat(objectResults);
|
|
374
|
+
importantResults = results[1].concat(importantResults);
|
|
375
|
+
unimportantResults = results[2].concat(unimportantResults);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// perform the search on the required terms
|
|
379
|
+
for (var i = 0; i < searchterms.length; i++) {
|
|
380
|
+
var word = searchterms[i];
|
|
381
|
+
// no match but word was a required one
|
|
382
|
+
if ((files = terms[word]) == null)
|
|
383
|
+
break;
|
|
384
|
+
if (files.length == undefined) {
|
|
385
|
+
files = [files];
|
|
386
|
+
}
|
|
387
|
+
// create the mapping
|
|
388
|
+
for (var j = 0; j < files.length; j++) {
|
|
389
|
+
var file = files[j];
|
|
390
|
+
if (file in fileMap)
|
|
391
|
+
fileMap[file].push(word);
|
|
392
|
+
else
|
|
393
|
+
fileMap[file] = [word];
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// now check if the files don't contain excluded terms
|
|
398
|
+
for (var file in fileMap) {
|
|
399
|
+
var valid = true;
|
|
400
|
+
|
|
401
|
+
// check if all requirements are matched
|
|
402
|
+
if (fileMap[file].length != searchterms.length)
|
|
403
|
+
continue;
|
|
404
|
+
|
|
405
|
+
// ensure that none of the excluded terms is in the
|
|
406
|
+
// search result.
|
|
407
|
+
for (var i = 0; i < excluded.length; i++) {
|
|
408
|
+
if (terms[excluded[i]] == file ||
|
|
409
|
+
$.contains(terms[excluded[i]] || [], file)) {
|
|
410
|
+
valid = false;
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// if we have still a valid result we can add it
|
|
416
|
+
// to the result list
|
|
417
|
+
if (valid)
|
|
418
|
+
regularResults.push([filenames[file], titles[file], '', null]);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// delete unused variables in order to not waste
|
|
422
|
+
// memory until list is retrieved completely
|
|
423
|
+
delete filenames, titles, terms;
|
|
424
|
+
|
|
425
|
+
// now sort the regular results descending by title
|
|
426
|
+
regularResults.sort(function(a, b) {
|
|
427
|
+
var left = a[1].toLowerCase();
|
|
428
|
+
var right = b[1].toLowerCase();
|
|
429
|
+
return (left > right) ? -1 : ((left < right) ? 1 : 0);
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
// combine all results
|
|
433
|
+
var results = unimportantResults.concat(regularResults)
|
|
434
|
+
.concat(objectResults).concat(importantResults);
|
|
435
|
+
|
|
436
|
+
// print the results
|
|
437
|
+
var resultCount = results.length;
|
|
438
|
+
function displayNextItem() {
|
|
439
|
+
// results left, load the summary and display it
|
|
440
|
+
if (results.length) {
|
|
441
|
+
var item = results.pop();
|
|
442
|
+
var listItem = $('<li style="display:none"></li>');
|
|
443
|
+
if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') {
|
|
444
|
+
// dirhtml builder
|
|
445
|
+
var dirname = item[0] + '/';
|
|
446
|
+
if (dirname.match(/\/index\/$/)) {
|
|
447
|
+
dirname = dirname.substring(0, dirname.length-6);
|
|
448
|
+
} else if (dirname == 'index/') {
|
|
449
|
+
dirname = '';
|
|
450
|
+
}
|
|
451
|
+
listItem.append($('<a/>').attr('href',
|
|
452
|
+
DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
|
|
453
|
+
highlightstring + item[2]).html(item[1]));
|
|
454
|
+
} else {
|
|
455
|
+
// normal html builders
|
|
456
|
+
listItem.append($('<a/>').attr('href',
|
|
457
|
+
item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
|
|
458
|
+
highlightstring + item[2]).html(item[1]));
|
|
459
|
+
}
|
|
460
|
+
if (item[3]) {
|
|
461
|
+
listItem.append($('<span> (' + item[3] + ')</span>'));
|
|
462
|
+
Search.output.append(listItem);
|
|
463
|
+
listItem.slideDown(5, function() {
|
|
464
|
+
displayNextItem();
|
|
465
|
+
});
|
|
466
|
+
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
|
|
467
|
+
$.get(DOCUMENTATION_OPTIONS.URL_ROOT +
|
|
468
|
+
item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX, function(data) {
|
|
469
|
+
data = $('.body', data).text();
|
|
470
|
+
if (data != '') {
|
|
471
|
+
listItem.append($.makeSearchSummary(data, searchterms, hlterms));
|
|
472
|
+
Search.output.append(listItem);
|
|
473
|
+
}
|
|
474
|
+
listItem.slideDown(5, function() {
|
|
475
|
+
displayNextItem();
|
|
476
|
+
});
|
|
477
|
+
}, 'html');
|
|
478
|
+
} else {
|
|
479
|
+
// no source available, just display title
|
|
480
|
+
Search.output.append(listItem);
|
|
481
|
+
listItem.slideDown(5, function() {
|
|
482
|
+
displayNextItem();
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
// search finished, update title and status message
|
|
487
|
+
else {
|
|
488
|
+
Search.stopPulse();
|
|
489
|
+
Search.title.text(_('Search Results'));
|
|
490
|
+
if (!resultCount)
|
|
491
|
+
Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.'));
|
|
492
|
+
else
|
|
493
|
+
Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
|
|
494
|
+
Search.status.fadeIn(500);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
displayNextItem();
|
|
498
|
+
},
|
|
499
|
+
|
|
500
|
+
performObjectSearch : function(object, otherterms) {
|
|
501
|
+
var filenames = this._index.filenames;
|
|
502
|
+
var objects = this._index.objects;
|
|
503
|
+
var objnames = this._index.objnames;
|
|
504
|
+
var titles = this._index.titles;
|
|
505
|
+
|
|
506
|
+
var importantResults = [];
|
|
507
|
+
var objectResults = [];
|
|
508
|
+
var unimportantResults = [];
|
|
509
|
+
|
|
510
|
+
for (var prefix in objects) {
|
|
511
|
+
for (var name in objects[prefix]) {
|
|
512
|
+
var fullname = (prefix ? prefix + '.' : '') + name;
|
|
513
|
+
if (fullname.toLowerCase().indexOf(object) > -1) {
|
|
514
|
+
var match = objects[prefix][name];
|
|
515
|
+
var objname = objnames[match[1]][2];
|
|
516
|
+
var title = titles[match[0]];
|
|
517
|
+
// If more than one term searched for, we require other words to be
|
|
518
|
+
// found in the name/title/description
|
|
519
|
+
if (otherterms.length > 0) {
|
|
520
|
+
var haystack = (prefix + ' ' + name + ' ' +
|
|
521
|
+
objname + ' ' + title).toLowerCase();
|
|
522
|
+
var allfound = true;
|
|
523
|
+
for (var i = 0; i < otherterms.length; i++) {
|
|
524
|
+
if (haystack.indexOf(otherterms[i]) == -1) {
|
|
525
|
+
allfound = false;
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (!allfound) {
|
|
530
|
+
continue;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
var descr = objname + _(', in ') + title;
|
|
534
|
+
anchor = match[3];
|
|
535
|
+
if (anchor == '')
|
|
536
|
+
anchor = fullname;
|
|
537
|
+
else if (anchor == '-')
|
|
538
|
+
anchor = objnames[match[1]][1] + '-' + fullname;
|
|
539
|
+
result = [filenames[match[0]], fullname, '#'+anchor, descr];
|
|
540
|
+
switch (match[2]) {
|
|
541
|
+
case 1: objectResults.push(result); break;
|
|
542
|
+
case 0: importantResults.push(result); break;
|
|
543
|
+
case 2: unimportantResults.push(result); break;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// sort results descending
|
|
550
|
+
objectResults.sort(function(a, b) {
|
|
551
|
+
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
importantResults.sort(function(a, b) {
|
|
555
|
+
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
|
|
556
|
+
});
|
|
557
|
+
|
|
558
|
+
unimportantResults.sort(function(a, b) {
|
|
559
|
+
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
return [importantResults, objectResults, unimportantResults]
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
$(document).ready(function() {
|
|
567
|
+
Search.init();
|
|
568
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Underscore.js 0.5.5
|
|
2
|
+
// (c) 2009 Jeremy Ashkenas, DocumentCloud Inc.
|
|
3
|
+
// Underscore is freely distributable under the terms of the MIT license.
|
|
4
|
+
// Portions of Underscore are inspired by or borrowed from Prototype.js,
|
|
5
|
+
// Oliver Steele's Functional, and John Resig's Micro-Templating.
|
|
6
|
+
// For all details and documentation:
|
|
7
|
+
// http://documentcloud.github.com/underscore/
|
|
8
|
+
(function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e<f;e++)c.call(d,
|
|
9
|
+
a[e],e,a);else{var g=b.keys(a);f=g.length;for(e=0;e<f;e++)c.call(d,a[g[e]],g[e],a)}}catch(h){if(h!=m)throw h;}return a};b.map=function(a,c,d){if(a&&b.isFunction(a.map))return a.map(c,d);var e=[];b.each(a,function(f,g,h){e.push(c.call(d,f,g,h))});return e};b.reduce=function(a,c,d,e){if(a&&b.isFunction(a.reduce))return a.reduce(b.bind(d,e),c);b.each(a,function(f,g,h){c=d.call(e,c,f,g,h)});return c};b.reduceRight=function(a,c,d,e){if(a&&b.isFunction(a.reduceRight))return a.reduceRight(b.bind(d,e),c);
|
|
10
|
+
var f=b.clone(b.toArray(a)).reverse();b.each(f,function(g,h){c=d.call(e,c,g,h,a)});return c};b.detect=function(a,c,d){var e;b.each(a,function(f,g,h){if(c.call(d,f,g,h)){e=f;b.breakLoop()}});return e};b.select=function(a,c,d){if(a&&b.isFunction(a.filter))return a.filter(c,d);var e=[];b.each(a,function(f,g,h){c.call(d,f,g,h)&&e.push(f)});return e};b.reject=function(a,c,d){var e=[];b.each(a,function(f,g,h){!c.call(d,f,g,h)&&e.push(f)});return e};b.all=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.every))return a.every(c,
|
|
11
|
+
d);var e=true;b.each(a,function(f,g,h){(e=e&&c.call(d,f,g,h))||b.breakLoop()});return e};b.any=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.some))return a.some(c,d);var e=false;b.each(a,function(f,g,h){if(e=c.call(d,f,g,h))b.breakLoop()});return e};b.include=function(a,c){if(b.isArray(a))return b.indexOf(a,c)!=-1;var d=false;b.each(a,function(e){if(d=e===c)b.breakLoop()});return d};b.invoke=function(a,c){var d=b.rest(arguments,2);return b.map(a,function(e){return(c?e[c]:e).apply(e,d)})};b.pluck=
|
|
12
|
+
function(a,c){return b.map(a,function(d){return d[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);var e={computed:-Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g>=e.computed&&(e={value:f,computed:g})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g<e.computed&&(e={value:f,computed:g})});return e.value};b.sortBy=function(a,c,d){return b.pluck(b.map(a,
|
|
13
|
+
function(e,f,g){return{value:e,criteria:c.call(d,e,f,g)}}).sort(function(e,f){e=e.criteria;f=f.criteria;return e<f?-1:e>f?1:0}),"value")};b.sortedIndex=function(a,c,d){d=d||b.identity;for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?(e=g+1):(f=g)}return e};b.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(b.isArray(a))return a;if(b.isArguments(a))return k.call(a);return b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=function(a,c,d){return c&&!d?k.call(a,
|
|
14
|
+
0,c):a[0]};b.rest=function(a,c,d){return k.call(a,b.isUndefined(c)||d?1:c)};b.last=function(a){return a[a.length-1]};b.compact=function(a){return b.select(a,function(c){return!!c})};b.flatten=function(a){return b.reduce(a,[],function(c,d){if(b.isArray(d))return c.concat(b.flatten(d));c.push(d);return c})};b.without=function(a){var c=b.rest(arguments);return b.select(a,function(d){return!b.include(c,d)})};b.uniq=function(a,c){return b.reduce(a,[],function(d,e,f){if(0==f||(c===true?b.last(d)!=e:!b.include(d,
|
|
15
|
+
e)))d.push(e);return d})};b.intersect=function(a){var c=b.rest(arguments);return b.select(b.uniq(a),function(d){return b.all(c,function(e){return b.indexOf(e,d)>=0})})};b.zip=function(){for(var a=b.toArray(arguments),c=b.max(b.pluck(a,"length")),d=new Array(c),e=0;e<c;e++)d[e]=b.pluck(a,String(e));return d};b.indexOf=function(a,c){if(a.indexOf)return a.indexOf(c);for(var d=0,e=a.length;d<e;d++)if(a[d]===c)return d;return-1};b.lastIndexOf=function(a,c){if(a.lastIndexOf)return a.lastIndexOf(c);for(var d=
|
|
16
|
+
a.length;d--;)if(a[d]===c)return d;return-1};b.range=function(a,c,d){var e=b.toArray(arguments),f=e.length<=1;a=f?0:e[0];c=f?e[0]:e[1];d=e[2]||1;e=Math.ceil((c-a)/d);if(e<=0)return[];e=new Array(e);f=a;for(var g=0;1;f+=d){if((d>0?f-c:c-f)>=0)return e;e[g++]=f}};b.bind=function(a,c){var d=b.rest(arguments,2);return function(){return a.apply(c||j,d.concat(b.toArray(arguments)))}};b.bindAll=function(a){var c=b.rest(arguments);if(c.length==0)c=b.functions(a);b.each(c,function(d){a[d]=b.bind(a[d],a)});
|
|
17
|
+
return a};b.delay=function(a,c){var d=b.rest(arguments,2);return setTimeout(function(){return a.apply(a,d)},c)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(b.rest(arguments)))};b.wrap=function(a,c){return function(){var d=[a].concat(b.toArray(arguments));return c.apply(c,d)}};b.compose=function(){var a=b.toArray(arguments);return function(){for(var c=b.toArray(arguments),d=a.length-1;d>=0;d--)c=[a[d].apply(this,c)];return c[0]}};b.keys=function(a){if(b.isArray(a))return b.range(0,a.length);
|
|
18
|
+
var c=[];for(var d in a)q.call(a,d)&&c.push(d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=function(a){return b.select(b.keys(a),function(c){return b.isFunction(a[c])}).sort()};b.extend=function(a,c){for(var d in c)a[d]=c[d];return a};b.clone=function(a){if(b.isArray(a))return a.slice(0);return b.extend({},a)};b.tap=function(a,c){c(a);return a};b.isEqual=function(a,c){if(a===c)return true;var d=typeof a;if(d!=typeof c)return false;if(a==c)return true;if(!a&&c||a&&!c)return false;
|
|
19
|
+
if(a.isEqual)return a.isEqual(c);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return true;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return false;if(a.length&&a.length!==c.length)return false;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return false;for(var f in a)if(!b.isEqual(a[f],c[f]))return false;return true};b.isEmpty=function(a){return b.keys(a).length==
|
|
20
|
+
0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=function(a){return!!(a&&a.concat&&a.unshift)};b.isArguments=function(a){return a&&b.isNumber(a.length)&&!b.isArray(a)&&!r.call(a,"length")};b.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return p.call(a)==="[object Number]"};b.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)};b.isRegExp=function(a){return!!(a&&
|
|
21
|
+
a.test&&a.exec&&(a.ignoreCase||a.ignoreCase===false))};b.isNaN=function(a){return b.isNumber(a)&&isNaN(a)};b.isNull=function(a){return a===null};b.isUndefined=function(a){return typeof a=="undefined"};b.noConflict=function(){j._=n;return this};b.identity=function(a){return a};b.breakLoop=function(){throw m;};var s=0;b.uniqueId=function(a){var c=s++;return a?a+c:c};b.template=function(a,c){a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g,
|
|
22
|
+
" ").replace(/'(?=[^%]*%>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<%=(.+?)%>/g,"',$1,'").split("<%").join("');").split("%>").join("p.push('")+"');}return p.join('');");return c?a(c):a};b.forEach=b.each;b.foldl=b.inject=b.reduce;b.foldr=b.reduceRight;b.filter=b.select;b.every=b.all;b.some=b.any;b.head=b.first;b.tail=b.rest;b.methods=b.functions;var l=function(a,c){return c?b(a).chain():a};b.each(b.functions(b),function(a){var c=b[a];i.prototype[a]=function(){var d=b.toArray(arguments);
|
|
23
|
+
o.call(d,this._wrapped);return l(c.apply(b,d),this._chain)}});b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){c.apply(this._wrapped,arguments);return l(this._wrapped,this._chain)}});b.each(["concat","join","slice"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){return l(c.apply(this._wrapped,arguments),this._chain)}});i.prototype.chain=function(){this._chain=true;return this};i.prototype.value=function(){return this._wrapped}})();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
jQuery(function() { Search.loadIndex("searchindex.js"); });
|
|
3
|
+
</script>
|
|
4
|
+
<style type="text/css">
|
|
5
|
+
.toc-title { display: none; }
|
|
6
|
+
#toc { display: none; }
|
|
7
|
+
</style>
|
|
8
|
+
|
|
9
|
+
<h1 id="search-documentation">Search</h1>
|
|
10
|
+
<div id="fallback" class="admonition warning">
|
|
11
|
+
<script type="text/javascript">$('#fallback').hide();</script>
|
|
12
|
+
<p>
|
|
13
|
+
Please activate JavaScript to enable the search
|
|
14
|
+
functionality.
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
17
|
+
<p>
|
|
18
|
+
From here you can search these documents. Enter your search
|
|
19
|
+
words into the box below and click "search". Note that the search
|
|
20
|
+
function will automatically search for all of the words. Pages
|
|
21
|
+
containing fewer words won't appear in the result list.
|
|
22
|
+
</p>
|
|
23
|
+
<form action="" method="get">
|
|
24
|
+
<input type="text" name="q" value="" />
|
|
25
|
+
<input type="submit" value="search" />
|
|
26
|
+
<span id="search-progress" style="padding-left: 10px"></span>
|
|
27
|
+
</form>
|
|
28
|
+
|
|
29
|
+
<div id="search-results"></div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Search.setIndex(<%= @json %>)
|