shoulda-matchers 3.1.0 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/{MIT-LICENSE → LICENSE} +1 -1
- data/README.md +407 -232
- data/docs/errors/NonCaseSwappableValueError.md +2 -2
- data/lib/shoulda/matchers/action_controller/callback_matcher.rb +7 -80
- data/lib/shoulda/matchers/action_controller/filter_param_matcher.rb +4 -3
- data/lib/shoulda/matchers/action_controller/flash_store.rb +2 -4
- data/lib/shoulda/matchers/action_controller/permit_matcher.rb +36 -30
- data/lib/shoulda/matchers/action_controller/redirect_to_matcher.rb +8 -10
- data/lib/shoulda/matchers/action_controller/render_template_matcher.rb +7 -9
- data/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb +18 -15
- data/lib/shoulda/matchers/action_controller/rescue_from_matcher.rb +3 -2
- data/lib/shoulda/matchers/action_controller/respond_with_matcher.rb +3 -3
- data/lib/shoulda/matchers/action_controller/route_matcher.rb +88 -29
- data/lib/shoulda/matchers/action_controller/route_params.rb +2 -2
- data/lib/shoulda/matchers/action_controller/set_flash_matcher.rb +4 -4
- data/lib/shoulda/matchers/action_controller/set_session_matcher.rb +3 -3
- data/lib/shoulda/matchers/action_controller/set_session_or_flash_matcher.rb +19 -13
- data/lib/shoulda/matchers/action_controller.rb +2 -0
- data/lib/shoulda/matchers/active_model/allow_value_matcher/attribute_changed_value_error.rb +1 -1
- data/lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setter.rb +5 -9
- data/lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setter_and_validator.rb +2 -2
- data/lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setters.rb +1 -1
- data/lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setters_and_validators.rb +1 -1
- data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +42 -39
- data/lib/shoulda/matchers/active_model/disallow_value_matcher.rb +1 -1
- data/lib/shoulda/matchers/active_model/have_secure_password_matcher.rb +52 -26
- data/lib/shoulda/matchers/active_model/helpers.rb +2 -2
- data/lib/shoulda/matchers/active_model/numericality_matchers/comparison_matcher.rb +32 -30
- data/lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb +2 -1
- data/lib/shoulda/matchers/active_model/qualifiers/allow_blank.rb +26 -0
- data/lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb +26 -0
- data/lib/shoulda/matchers/active_model/qualifiers/ignoring_interference_by_writer.rb +1 -1
- data/lib/shoulda/matchers/active_model/qualifiers.rb +2 -0
- data/lib/shoulda/matchers/active_model/validate_absence_of_matcher.rb +30 -6
- data/lib/shoulda/matchers/active_model/validate_acceptance_of_matcher.rb +8 -3
- data/lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb +31 -16
- data/lib/shoulda/matchers/active_model/validate_exclusion_of_matcher.rb +52 -16
- data/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb +137 -84
- data/lib/shoulda/matchers/active_model/validate_length_of_matcher.rb +159 -46
- data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +130 -66
- data/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb +251 -24
- data/lib/shoulda/matchers/active_model/validation_matcher/build_description.rb +12 -9
- data/lib/shoulda/matchers/active_model/validation_matcher.rb +38 -6
- data/lib/shoulda/matchers/active_model/validation_message_finder.rb +2 -4
- data/lib/shoulda/matchers/active_model/validator.rb +4 -9
- data/lib/shoulda/matchers/active_model.rb +3 -5
- data/lib/shoulda/matchers/active_record/accept_nested_attributes_for_matcher.rb +10 -7
- data/lib/shoulda/matchers/active_record/association_matcher.rb +386 -111
- data/lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb +5 -2
- data/lib/shoulda/matchers/active_record/association_matchers/dependent_matcher.rb +4 -4
- data/lib/shoulda/matchers/active_record/association_matchers/inverse_of_matcher.rb +1 -1
- data/lib/shoulda/matchers/active_record/association_matchers/join_table_matcher.rb +11 -6
- data/lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb +14 -15
- data/lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb +30 -8
- data/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb +34 -11
- data/lib/shoulda/matchers/active_record/association_matchers/optional_matcher.rb +69 -0
- data/lib/shoulda/matchers/active_record/association_matchers/order_matcher.rb +1 -1
- data/lib/shoulda/matchers/active_record/association_matchers/required_matcher.rb +74 -0
- data/lib/shoulda/matchers/active_record/association_matchers/source_matcher.rb +3 -2
- data/lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb +7 -5
- data/lib/shoulda/matchers/active_record/define_enum_for_matcher.rb +458 -42
- data/lib/shoulda/matchers/active_record/have_attached_matcher.rb +185 -0
- data/lib/shoulda/matchers/active_record/have_db_column_matcher.rb +63 -23
- data/lib/shoulda/matchers/active_record/have_db_index_matcher.rb +164 -48
- data/lib/shoulda/matchers/active_record/have_implicit_order_column.rb +106 -0
- data/lib/shoulda/matchers/active_record/have_readonly_attribute_matcher.rb +13 -11
- data/lib/shoulda/matchers/active_record/have_rich_text_matcher.rb +83 -0
- data/lib/shoulda/matchers/active_record/have_secure_token_matcher.rb +132 -0
- data/lib/shoulda/matchers/active_record/serialize_matcher.rb +18 -18
- data/lib/shoulda/matchers/active_record/uniqueness/test_model_creator.rb +1 -3
- data/lib/shoulda/matchers/active_record/uniqueness/test_models.rb +0 -2
- data/lib/shoulda/matchers/active_record/uniqueness.rb +1 -1
- data/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb +430 -200
- data/lib/shoulda/matchers/active_record.rb +28 -20
- data/lib/shoulda/matchers/configuration.rb +12 -1
- data/lib/shoulda/matchers/doublespeak/double.rb +1 -1
- data/lib/shoulda/matchers/doublespeak/double_collection.rb +3 -3
- data/lib/shoulda/matchers/doublespeak/double_implementation_registry.rb +8 -5
- data/lib/shoulda/matchers/doublespeak/object_double.rb +6 -2
- data/lib/shoulda/matchers/doublespeak/stub_implementation.rb +1 -5
- data/lib/shoulda/matchers/doublespeak/world.rb +2 -2
- data/lib/shoulda/matchers/doublespeak.rb +2 -1
- data/lib/shoulda/matchers/error.rb +1 -1
- data/lib/shoulda/matchers/independent/delegate_method_matcher.rb +109 -29
- data/lib/shoulda/matchers/independent.rb +2 -2
- data/lib/shoulda/matchers/integrations/configuration.rb +8 -4
- data/lib/shoulda/matchers/integrations/libraries/action_controller.rb +1 -1
- data/lib/shoulda/matchers/integrations/libraries/rails.rb +2 -2
- data/lib/shoulda/matchers/integrations/test_frameworks/active_support_test_case.rb +1 -1
- data/lib/shoulda/matchers/integrations/test_frameworks/minitest_4.rb +1 -1
- data/lib/shoulda/matchers/integrations/test_frameworks/minitest_5.rb +1 -1
- data/lib/shoulda/matchers/integrations/test_frameworks/missing_test_framework.rb +1 -1
- data/lib/shoulda/matchers/integrations/test_frameworks/test_unit.rb +1 -1
- data/lib/shoulda/matchers/rails_shim.rb +172 -51
- data/lib/shoulda/matchers/routing.rb +2 -2
- data/lib/shoulda/matchers/util/word_wrap.rb +17 -12
- data/lib/shoulda/matchers/util.rb +39 -5
- data/lib/shoulda/matchers/version.rb +1 -1
- data/lib/shoulda/matchers/warn.rb +4 -3
- data/shoulda-matchers.gemspec +33 -15
- metadata +31 -338
- data/.gitignore +0 -12
- data/.hound.yml +0 -3
- data/.hound_config/ruby.yml +0 -12
- data/.travis.yml +0 -19
- data/.yardopts +0 -10
- data/Appraisals +0 -73
- data/CONTRIBUTING.md +0 -101
- data/Gemfile +0 -15
- data/Gemfile.lock +0 -70
- data/NEWS.md +0 -986
- data/Rakefile +0 -39
- data/custom_plan.rb +0 -88
- data/doc_config/gh-pages/index.html.erb +0 -9
- data/doc_config/yard/setup.rb +0 -22
- data/doc_config/yard/templates/default/fulldoc/html/css/bootstrap.css +0 -5967
- data/doc_config/yard/templates/default/fulldoc/html/css/full_list.css +0 -12
- data/doc_config/yard/templates/default/fulldoc/html/css/global.css +0 -62
- data/doc_config/yard/templates/default/fulldoc/html/css/solarized.css +0 -69
- data/doc_config/yard/templates/default/fulldoc/html/css/style.css +0 -312
- data/doc_config/yard/templates/default/fulldoc/html/full_list.erb +0 -32
- data/doc_config/yard/templates/default/fulldoc/html/full_list_class.erb +0 -1
- data/doc_config/yard/templates/default/fulldoc/html/full_list_method.erb +0 -8
- data/doc_config/yard/templates/default/fulldoc/html/js/app.js +0 -298
- data/doc_config/yard/templates/default/fulldoc/html/js/full_list.js +0 -1
- data/doc_config/yard/templates/default/fulldoc/html/js/jquery.stickyheaders.js +0 -289
- data/doc_config/yard/templates/default/fulldoc/html/js/underscore.min.js +0 -6
- data/doc_config/yard/templates/default/fulldoc/html/setup.rb +0 -8
- data/doc_config/yard/templates/default/layout/html/breadcrumb.erb +0 -14
- data/doc_config/yard/templates/default/layout/html/fonts.erb +0 -1
- data/doc_config/yard/templates/default/layout/html/footer.erb +0 -6
- data/doc_config/yard/templates/default/layout/html/layout.erb +0 -23
- data/doc_config/yard/templates/default/layout/html/search.erb +0 -13
- data/doc_config/yard/templates/default/layout/html/setup.rb +0 -40
- data/doc_config/yard/templates/default/method_details/html/source.erb +0 -10
- data/doc_config/yard/templates/default/module/html/box_info.erb +0 -31
- data/gemfiles/4.0.0.gemfile +0 -38
- data/gemfiles/4.0.0.gemfile.lock +0 -223
- data/gemfiles/4.0.1.gemfile +0 -38
- data/gemfiles/4.0.1.gemfile.lock +0 -225
- data/gemfiles/4.1.gemfile +0 -38
- data/gemfiles/4.1.gemfile.lock +0 -220
- data/gemfiles/4.2.gemfile +0 -38
- data/gemfiles/4.2.gemfile.lock +0 -243
- data/lib/shoulda/matchers/active_model/allow_mass_assignment_of_matcher.rb +0 -159
- data/lib/shoulda/matchers/independent/delegate_method_matcher/stubbed_target.rb +0 -37
- data/script/SUPPORTED_VERSIONS +0 -1
- data/script/install_gems_in_all_appraisals +0 -14
- data/script/run_all_tests +0 -14
- data/script/update_gem_in_all_appraisals +0 -15
- data/script/update_gems_in_all_appraisals +0 -14
- data/spec/acceptance/active_model_integration_spec.rb +0 -23
- data/spec/acceptance/independent_matchers_spec.rb +0 -125
- data/spec/acceptance/multiple_libraries_integration_spec.rb +0 -55
- data/spec/acceptance/rails_integration_spec.rb +0 -156
- data/spec/acceptance_spec_helper.rb +0 -23
- data/spec/doublespeak_spec_helper.rb +0 -2
- data/spec/report_warnings.rb +0 -7
- data/spec/spec_helper.rb +0 -21
- data/spec/support/acceptance/adds_shoulda_matchers_to_project.rb +0 -133
- data/spec/support/acceptance/helpers/active_model_helpers.rb +0 -11
- data/spec/support/acceptance/helpers/array_helpers.rb +0 -13
- data/spec/support/acceptance/helpers/base_helpers.rb +0 -19
- data/spec/support/acceptance/helpers/command_helpers.rb +0 -55
- data/spec/support/acceptance/helpers/file_helpers.rb +0 -19
- data/spec/support/acceptance/helpers/gem_helpers.rb +0 -31
- data/spec/support/acceptance/helpers/minitest_helpers.rb +0 -11
- data/spec/support/acceptance/helpers/n_unit_helpers.rb +0 -25
- data/spec/support/acceptance/helpers/pluralization_helpers.rb +0 -13
- data/spec/support/acceptance/helpers/rails_version_helpers.rb +0 -11
- data/spec/support/acceptance/helpers/rspec_helpers.rb +0 -24
- data/spec/support/acceptance/helpers/ruby_version_helpers.rb +0 -9
- data/spec/support/acceptance/helpers/step_helpers.rb +0 -127
- data/spec/support/acceptance/helpers.rb +0 -31
- data/spec/support/acceptance/matchers/have_output.rb +0 -31
- data/spec/support/acceptance/matchers/indicate_number_of_tests_was_run_matcher.rb +0 -55
- data/spec/support/acceptance/matchers/indicate_that_tests_were_run_matcher.rb +0 -103
- data/spec/support/tests/bundle.rb +0 -94
- data/spec/support/tests/command_runner.rb +0 -230
- data/spec/support/tests/current_bundle.rb +0 -61
- data/spec/support/tests/database.rb +0 -28
- data/spec/support/tests/database_adapters/postgresql.rb +0 -25
- data/spec/support/tests/database_adapters/sqlite3.rb +0 -26
- data/spec/support/tests/database_configuration.rb +0 -33
- data/spec/support/tests/database_configuration_registry.rb +0 -28
- data/spec/support/tests/filesystem.rb +0 -100
- data/spec/support/tests/version.rb +0 -45
- data/spec/support/unit/active_record/create_table.rb +0 -54
- data/spec/support/unit/attribute.rb +0 -47
- data/spec/support/unit/capture.rb +0 -40
- data/spec/support/unit/change_value.rb +0 -111
- data/spec/support/unit/create_model_arguments/basic.rb +0 -135
- data/spec/support/unit/create_model_arguments/has_many.rb +0 -15
- data/spec/support/unit/create_model_arguments/uniqueness_matcher.rb +0 -74
- data/spec/support/unit/helpers/active_model_helpers.rb +0 -27
- data/spec/support/unit/helpers/active_model_versions.rb +0 -28
- data/spec/support/unit/helpers/active_record_versions.rb +0 -24
- data/spec/support/unit/helpers/active_resource_builder.rb +0 -27
- data/spec/support/unit/helpers/allow_value_matcher_helpers.rb +0 -15
- data/spec/support/unit/helpers/class_builder.rb +0 -90
- data/spec/support/unit/helpers/column_type_helpers.rb +0 -26
- data/spec/support/unit/helpers/confirmation_matcher_helpers.rb +0 -17
- data/spec/support/unit/helpers/controller_builder.rb +0 -63
- data/spec/support/unit/helpers/database_helpers.rb +0 -20
- data/spec/support/unit/helpers/i18n_faker.rb +0 -15
- data/spec/support/unit/helpers/mailer_builder.rb +0 -12
- data/spec/support/unit/helpers/model_builder.rb +0 -114
- data/spec/support/unit/helpers/rails_versions.rb +0 -28
- data/spec/support/unit/helpers/validation_matcher_scenario_helpers.rb +0 -44
- data/spec/support/unit/i18n.rb +0 -7
- data/spec/support/unit/load_environment.rb +0 -12
- data/spec/support/unit/matchers/deprecate.rb +0 -60
- data/spec/support/unit/matchers/fail_with_message_including_matcher.rb +0 -51
- data/spec/support/unit/matchers/fail_with_message_matcher.rb +0 -62
- data/spec/support/unit/matchers/print_warning_including.rb +0 -59
- data/spec/support/unit/model_creation_strategies/active_model.rb +0 -111
- data/spec/support/unit/model_creation_strategies/active_record.rb +0 -77
- data/spec/support/unit/model_creators/active_model.rb +0 -39
- data/spec/support/unit/model_creators/active_record/has_and_belongs_to_many.rb +0 -95
- data/spec/support/unit/model_creators/active_record/has_many.rb +0 -67
- data/spec/support/unit/model_creators/active_record/uniqueness_matcher.rb +0 -42
- data/spec/support/unit/model_creators/active_record.rb +0 -43
- data/spec/support/unit/model_creators/basic.rb +0 -97
- data/spec/support/unit/model_creators.rb +0 -19
- data/spec/support/unit/rails_application.rb +0 -126
- data/spec/support/unit/record_builder_with_i18n_validation_message.rb +0 -69
- data/spec/support/unit/record_validating_confirmation_builder.rb +0 -51
- data/spec/support/unit/record_with_different_error_attribute_builder.rb +0 -92
- data/spec/support/unit/shared_examples/ignoring_interference_by_writer.rb +0 -79
- data/spec/support/unit/shared_examples/numerical_submatcher.rb +0 -17
- data/spec/support/unit/shared_examples/set_session_or_flash.rb +0 -360
- data/spec/support/unit/validation_matcher_scenario.rb +0 -62
- data/spec/unit/shoulda/matchers/action_controller/callback_matcher_spec.rb +0 -82
- data/spec/unit/shoulda/matchers/action_controller/filter_param_matcher_spec.rb +0 -28
- data/spec/unit/shoulda/matchers/action_controller/permit_matcher_spec.rb +0 -592
- data/spec/unit/shoulda/matchers/action_controller/redirect_to_matcher_spec.rb +0 -42
- data/spec/unit/shoulda/matchers/action_controller/render_template_matcher_spec.rb +0 -76
- data/spec/unit/shoulda/matchers/action_controller/render_with_layout_matcher_spec.rb +0 -62
- data/spec/unit/shoulda/matchers/action_controller/rescue_from_matcher_spec.rb +0 -90
- data/spec/unit/shoulda/matchers/action_controller/respond_with_matcher_spec.rb +0 -31
- data/spec/unit/shoulda/matchers/action_controller/route_matcher_spec.rb +0 -330
- data/spec/unit/shoulda/matchers/action_controller/route_params_spec.rb +0 -30
- data/spec/unit/shoulda/matchers/action_controller/set_flash_matcher_spec.rb +0 -67
- data/spec/unit/shoulda/matchers/action_controller/set_session_matcher_spec.rb +0 -17
- data/spec/unit/shoulda/matchers/action_controller/set_session_or_flash_matcher_spec.rb +0 -562
- data/spec/unit/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb +0 -115
- data/spec/unit/shoulda/matchers/active_model/allow_value_matcher_spec.rb +0 -823
- data/spec/unit/shoulda/matchers/active_model/disallow_value_matcher_spec.rb +0 -86
- data/spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb +0 -20
- data/spec/unit/shoulda/matchers/active_model/helpers_spec.rb +0 -162
- data/spec/unit/shoulda/matchers/active_model/validate_absence_of_matcher_spec.rb +0 -266
- data/spec/unit/shoulda/matchers/active_model/validate_acceptance_of_matcher_spec.rb +0 -91
- data/spec/unit/shoulda/matchers/active_model/validate_confirmation_of_matcher_spec.rb +0 -149
- data/spec/unit/shoulda/matchers/active_model/validate_exclusion_of_matcher_spec.rb +0 -207
- data/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb +0 -1015
- data/spec/unit/shoulda/matchers/active_model/validate_length_of_matcher_spec.rb +0 -288
- data/spec/unit/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb +0 -1837
- data/spec/unit/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb +0 -380
- data/spec/unit/shoulda/matchers/active_record/accept_nested_attributes_for_matcher_spec.rb +0 -107
- data/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb +0 -1242
- data/spec/unit/shoulda/matchers/active_record/association_matchers/model_reflection_spec.rb +0 -251
- data/spec/unit/shoulda/matchers/active_record/define_enum_for_matcher_spec.rb +0 -168
- data/spec/unit/shoulda/matchers/active_record/have_db_column_matcher_spec.rb +0 -111
- data/spec/unit/shoulda/matchers/active_record/have_db_index_matcher_spec.rb +0 -85
- data/spec/unit/shoulda/matchers/active_record/have_readonly_attributes_matcher_spec.rb +0 -41
- data/spec/unit/shoulda/matchers/active_record/serialize_matcher_spec.rb +0 -86
- data/spec/unit/shoulda/matchers/active_record/validate_uniqueness_of_matcher_spec.rb +0 -1418
- data/spec/unit/shoulda/matchers/doublespeak/double_collection_spec.rb +0 -190
- data/spec/unit/shoulda/matchers/doublespeak/double_implementation_registry_spec.rb +0 -21
- data/spec/unit/shoulda/matchers/doublespeak/double_spec.rb +0 -271
- data/spec/unit/shoulda/matchers/doublespeak/object_double_spec.rb +0 -77
- data/spec/unit/shoulda/matchers/doublespeak/proxy_implementation_spec.rb +0 -72
- data/spec/unit/shoulda/matchers/doublespeak/stub_implementation_spec.rb +0 -101
- data/spec/unit/shoulda/matchers/doublespeak/world_spec.rb +0 -80
- data/spec/unit/shoulda/matchers/doublespeak_spec.rb +0 -27
- data/spec/unit/shoulda/matchers/independent/delegate_method_matcher/stubbed_target_spec.rb +0 -43
- data/spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb +0 -517
- data/spec/unit/shoulda/matchers/routing/route_matcher_spec.rb +0 -242
- data/spec/unit/shoulda/matchers/util/word_wrap_spec.rb +0 -252
- data/spec/unit_spec_helper.rb +0 -46
- data/spec/warnings_spy/filesystem.rb +0 -45
- data/spec/warnings_spy/partitioner.rb +0 -36
- data/spec/warnings_spy/reader.rb +0 -53
- data/spec/warnings_spy/reporter.rb +0 -88
- data/spec/warnings_spy.rb +0 -64
- data/tasks/documentation.rb +0 -199
- data/zeus.json +0 -11
@@ -1,298 +0,0 @@
|
|
1
|
-
function createSourceLinks() {
|
2
|
-
$('.method_details_list .source_code').
|
3
|
-
before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
|
4
|
-
$('.toggleSource').toggle(function() {
|
5
|
-
$(this).parent().nextAll('.source_code').show();
|
6
|
-
$(this).text("Hide source");
|
7
|
-
StickyHeaders.update();
|
8
|
-
},
|
9
|
-
function() {
|
10
|
-
$(this).parent().nextAll('.source_code').hide();
|
11
|
-
$(this).text("View source");
|
12
|
-
StickyHeaders.update();
|
13
|
-
});
|
14
|
-
}
|
15
|
-
|
16
|
-
function createDefineLinks() {
|
17
|
-
var tHeight = 0;
|
18
|
-
$('.defines').after(" <a href='#' class='toggleDefines'>more...</a>");
|
19
|
-
$('.toggleDefines').toggle(function() {
|
20
|
-
tHeight = $(this).parent().prev().height();
|
21
|
-
$(this).prev().show();
|
22
|
-
$(this).parent().prev().height($(this).parent().height());
|
23
|
-
$(this).text("(less)");
|
24
|
-
StickyHeaders.update();
|
25
|
-
},
|
26
|
-
function() {
|
27
|
-
$(this).prev().hide();
|
28
|
-
$(this).parent().prev().height(tHeight);
|
29
|
-
$(this).text("more...");
|
30
|
-
StickyHeaders.update();
|
31
|
-
});
|
32
|
-
}
|
33
|
-
|
34
|
-
function createFullTreeLinks() {
|
35
|
-
var tHeight = 0;
|
36
|
-
$('.inheritanceTree').toggle(function() {
|
37
|
-
tHeight = $(this).parent().prev().height();
|
38
|
-
$(this).parent().toggleClass('showAll');
|
39
|
-
$(this).text("(hide)");
|
40
|
-
$(this).parent().prev().height($(this).parent().height());
|
41
|
-
StickyHeaders.update();
|
42
|
-
},
|
43
|
-
function() {
|
44
|
-
$(this).parent().toggleClass('showAll');
|
45
|
-
$(this).parent().prev().height(tHeight);
|
46
|
-
$(this).text("show all");
|
47
|
-
StickyHeaders.update();
|
48
|
-
});
|
49
|
-
}
|
50
|
-
|
51
|
-
function hideSearchFrameOnBlur() {
|
52
|
-
$(document.body).on('click', hideSearchFrame);
|
53
|
-
}
|
54
|
-
|
55
|
-
function initSearchFrameLinks() {
|
56
|
-
var search = $('.js-search');
|
57
|
-
var items = search.find('li');
|
58
|
-
var links = search.find('a');
|
59
|
-
var frame = $('.js-search-frame');
|
60
|
-
|
61
|
-
function listen() {
|
62
|
-
links.on('click', function (event) {
|
63
|
-
event.preventDefault();
|
64
|
-
event.stopPropagation();
|
65
|
-
toggle(this, this.href);
|
66
|
-
});
|
67
|
-
|
68
|
-
$(document).on('keydown', function (event) {
|
69
|
-
if (event.which == 27) {
|
70
|
-
close();
|
71
|
-
}
|
72
|
-
})
|
73
|
-
|
74
|
-
$(document).on('click', function (event) {
|
75
|
-
close();
|
76
|
-
})
|
77
|
-
}
|
78
|
-
|
79
|
-
function toggle(link, frameSrc) {
|
80
|
-
if (isOpen() && clickedOnSameLink(frameSrc)) {
|
81
|
-
close();
|
82
|
-
} else {
|
83
|
-
open(link, frameSrc);
|
84
|
-
}
|
85
|
-
}
|
86
|
-
|
87
|
-
function isOpen() {
|
88
|
-
return frame.hasClass('open');
|
89
|
-
}
|
90
|
-
|
91
|
-
function clickedOnSameLink(location) {
|
92
|
-
return frame.attr('src') === location;
|
93
|
-
}
|
94
|
-
|
95
|
-
function reset() {
|
96
|
-
items.removeClass('active');
|
97
|
-
}
|
98
|
-
|
99
|
-
function open(link, location) {
|
100
|
-
reset();
|
101
|
-
$(link).parent().addClass('active');
|
102
|
-
frame.attr('src', location).one('load', function () {
|
103
|
-
frame.addClass('open');
|
104
|
-
})
|
105
|
-
}
|
106
|
-
|
107
|
-
function close() {
|
108
|
-
reset();
|
109
|
-
frame.removeClass('open');
|
110
|
-
}
|
111
|
-
|
112
|
-
listen();
|
113
|
-
}
|
114
|
-
|
115
|
-
|
116
|
-
function linkSummaries() {
|
117
|
-
$('.summary_signature').click(function() {
|
118
|
-
document.location = $(this).find('a').attr('href');
|
119
|
-
});
|
120
|
-
}
|
121
|
-
|
122
|
-
function framesInit() {
|
123
|
-
if (hasFrames) {
|
124
|
-
document.body.className = 'frames';
|
125
|
-
$('#menu .noframes a').attr('href', document.location);
|
126
|
-
try {
|
127
|
-
window.top.document.title = $('html head title').text();
|
128
|
-
} catch(error) {
|
129
|
-
// some browsers will not allow this when serving from file://
|
130
|
-
// but we don't want to stop the world.
|
131
|
-
}
|
132
|
-
}
|
133
|
-
else {
|
134
|
-
$('#menu .noframes a').text('frames').attr('href', framesUrl);
|
135
|
-
}
|
136
|
-
}
|
137
|
-
|
138
|
-
function keyboardShortcuts() {
|
139
|
-
if (window.top.frames.main) return;
|
140
|
-
|
141
|
-
$(document).keypress(function(evt) {
|
142
|
-
if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) return;
|
143
|
-
|
144
|
-
if (
|
145
|
-
typeof evt.target !== "undefined" &&
|
146
|
-
(evt.target.nodeName == "INPUT" || evt.target.nodeName == "TEXTAREA")
|
147
|
-
) return;
|
148
|
-
|
149
|
-
switch (evt.charCode) {
|
150
|
-
case 67: case 99: $('#class_list_link').click(); break; // 'c'
|
151
|
-
case 77: case 109: $('#method_list_link').click(); break; // 'm'
|
152
|
-
case 70: case 102: $('#file_list_link').click(); break; // 'f'
|
153
|
-
default: break;
|
154
|
-
}
|
155
|
-
});
|
156
|
-
}
|
157
|
-
|
158
|
-
function summaryToggle() {
|
159
|
-
$('.summary_toggle').click(function() {
|
160
|
-
if (localStorage) {
|
161
|
-
localStorage.summaryCollapsed = $(this).text();
|
162
|
-
}
|
163
|
-
$('.summary_toggle').each(function() {
|
164
|
-
$(this).text($(this).text() == "collapse" ? "expand" : "collapse");
|
165
|
-
var next = $(this).parent().parent().nextAll('ul.summary').first();
|
166
|
-
if (next.hasClass('compact')) {
|
167
|
-
next.toggle();
|
168
|
-
next.nextAll('ul.summary').first().toggle();
|
169
|
-
}
|
170
|
-
else if (next.hasClass('summary')) {
|
171
|
-
var list = $('<ul class="summary compact" />');
|
172
|
-
list.html(next.html());
|
173
|
-
list.find('.summary_desc, .note').remove();
|
174
|
-
list.find('a').each(function() {
|
175
|
-
$(this).html($(this).find('strong').html());
|
176
|
-
$(this).parent().html($(this)[0].outerHTML);
|
177
|
-
});
|
178
|
-
next.before(list);
|
179
|
-
next.toggle();
|
180
|
-
}
|
181
|
-
});
|
182
|
-
StickyHeaders.update();
|
183
|
-
return false;
|
184
|
-
});
|
185
|
-
if (localStorage) {
|
186
|
-
if (localStorage.summaryCollapsed == "collapse") {
|
187
|
-
$('.summary_toggle').first().click();
|
188
|
-
}
|
189
|
-
else localStorage.summaryCollapsed = "expand";
|
190
|
-
}
|
191
|
-
}
|
192
|
-
|
193
|
-
function fixOutsideWorldLinks() {
|
194
|
-
$('a').each(function() {
|
195
|
-
if (window.location.host != this.host) this.target = '_parent';
|
196
|
-
});
|
197
|
-
}
|
198
|
-
|
199
|
-
function generateTOC() {
|
200
|
-
if ($('#filecontents').length === 0) return;
|
201
|
-
var _toc = $('<ol class="top"></ol>');
|
202
|
-
var show = false;
|
203
|
-
var toc = _toc;
|
204
|
-
var counter = 0;
|
205
|
-
var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
206
|
-
var i;
|
207
|
-
if ($('#filecontents h1').length > 1) tags.unshift('h1');
|
208
|
-
for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
|
209
|
-
var lastTag = parseInt(tags[0][1], 10);
|
210
|
-
$(tags.join(', ')).each(function() {
|
211
|
-
if ($(this).parents('.method_details .docstring').length != 0) return;
|
212
|
-
if (this.id == "filecontents") return;
|
213
|
-
show = true;
|
214
|
-
var thisTag = parseInt(this.tagName[1], 10);
|
215
|
-
if (this.id.length === 0) {
|
216
|
-
var proposedId = $(this).attr('toc-id');
|
217
|
-
if (typeof(proposedId) != "undefined") this.id = proposedId;
|
218
|
-
else {
|
219
|
-
var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_');
|
220
|
-
if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; }
|
221
|
-
this.id = proposedId;
|
222
|
-
}
|
223
|
-
}
|
224
|
-
if (thisTag > lastTag) {
|
225
|
-
for (i = 0; i < thisTag - lastTag; i++) {
|
226
|
-
var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
|
227
|
-
}
|
228
|
-
}
|
229
|
-
if (thisTag < lastTag) {
|
230
|
-
for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
|
231
|
-
}
|
232
|
-
var title = $(this).attr('toc-title');
|
233
|
-
if (typeof(title) == "undefined") title = $(this).text();
|
234
|
-
toc.append('<li><a href="#' + this.id + '">' + title + '</a></li>');
|
235
|
-
lastTag = thisTag;
|
236
|
-
});
|
237
|
-
if (!show) return;
|
238
|
-
html = '<div id="toc"><p class="title"><a class="hide_toc" href="#"><strong>Table of Contents</strong></a> <small>(<a href="#" class="float_toc">left</a>)</small></p></div>';
|
239
|
-
$('#content').prepend(html);
|
240
|
-
$('#toc').append(_toc);
|
241
|
-
$('#toc .hide_toc').toggle(function() {
|
242
|
-
$('#toc .top').slideUp('fast');
|
243
|
-
$('#toc').toggleClass('hidden');
|
244
|
-
$('#toc .title small').toggle();
|
245
|
-
}, function() {
|
246
|
-
$('#toc .top').slideDown('fast');
|
247
|
-
$('#toc').toggleClass('hidden');
|
248
|
-
$('#toc .title small').toggle();
|
249
|
-
});
|
250
|
-
$('#toc .float_toc').toggle(function() {
|
251
|
-
$(this).text('float');
|
252
|
-
$('#toc').toggleClass('nofloat');
|
253
|
-
}, function() {
|
254
|
-
$(this).text('left');
|
255
|
-
$('#toc').toggleClass('nofloat');
|
256
|
-
});
|
257
|
-
}
|
258
|
-
|
259
|
-
function removeDlBoxIfEmpty() {
|
260
|
-
var $box = $('dl.box')
|
261
|
-
if (!$box.text().trim()) {
|
262
|
-
$box.remove();
|
263
|
-
}
|
264
|
-
}
|
265
|
-
|
266
|
-
function makeHeadersSticky() {
|
267
|
-
StickyHeaders
|
268
|
-
.set({
|
269
|
-
contentContainer: '#main',
|
270
|
-
stickyHeaderContainer: '#header',
|
271
|
-
switchOnCollisionWith: 'top',
|
272
|
-
fillHeadersWith: function (node) {
|
273
|
-
return $('<h3>').text(node.find('strong').text());
|
274
|
-
}
|
275
|
-
})
|
276
|
-
.add('.method_details > h3')
|
277
|
-
.activate();
|
278
|
-
}
|
279
|
-
|
280
|
-
function updateStickyHeaders() {
|
281
|
-
setTimeout(function () {
|
282
|
-
StickyHeaders.update()
|
283
|
-
}, 100)
|
284
|
-
}
|
285
|
-
|
286
|
-
$(makeHeadersSticky);
|
287
|
-
$(framesInit);
|
288
|
-
$(createSourceLinks);
|
289
|
-
$(createDefineLinks);
|
290
|
-
$(createFullTreeLinks);
|
291
|
-
$(initSearchFrameLinks);
|
292
|
-
$(linkSummaries);
|
293
|
-
$(keyboardShortcuts);
|
294
|
-
$(summaryToggle);
|
295
|
-
$(fixOutsideWorldLinks);
|
296
|
-
$(generateTOC);
|
297
|
-
$(removeDlBoxIfEmpty);
|
298
|
-
$(updateStickyHeaders);
|
@@ -1 +0,0 @@
|
|
1
|
-
// Override with nothing
|
@@ -1,289 +0,0 @@
|
|
1
|
-
window.StickyHeaders = (function ($) {
|
2
|
-
var me = {},
|
3
|
-
body, config, contentContainer, currentHeaderRangeIndex,
|
4
|
-
currentScrollOffset, elem, headerRanges, headers, isScrolling,
|
5
|
-
lastScrollOffset, selectors, stickyHeaderContainer;
|
6
|
-
|
7
|
-
function init() {
|
8
|
-
config = {
|
9
|
-
switchOnCollisionWith: 'top',
|
10
|
-
copy: 'element'
|
11
|
-
};
|
12
|
-
selectors = [];
|
13
|
-
headers = [];
|
14
|
-
headerRanges = [];
|
15
|
-
|
16
|
-
currentHeaderRangeIndex = -1;
|
17
|
-
currentScrollOffset = 0;
|
18
|
-
lastScrollOffset = 0;
|
19
|
-
isScrolling = false;
|
20
|
-
|
21
|
-
createStickyHeader();
|
22
|
-
}
|
23
|
-
|
24
|
-
function createStickyHeader() {
|
25
|
-
elem = $('<div>').attr('id', 'sticky-header');
|
26
|
-
}
|
27
|
-
|
28
|
-
function setHeaders() {
|
29
|
-
var elements = [],
|
30
|
-
stickyHeaderLineHeight = parseCssValue(elem.css('line-height')),
|
31
|
-
stickyHeaderTopPadding;
|
32
|
-
|
33
|
-
headers = [];
|
34
|
-
$.each(selectors, function (_, selector) {
|
35
|
-
contentContainer.find(selector).each(function (_, element) {
|
36
|
-
var $element = $(element),
|
37
|
-
fontSize = parseCssValue($element.css('font-size')),
|
38
|
-
topOffset = (
|
39
|
-
element.offsetTop +
|
40
|
-
parseFloat($element.css('padding-top'), 10) +
|
41
|
-
(- ((stickyHeaderLineHeight - fontSize) / 2))
|
42
|
-
),
|
43
|
-
height = Math.round($element.height()),
|
44
|
-
outerHeight = Math.round($element.outerHeight(true)),
|
45
|
-
bottomOffset = topOffset + outerHeight;
|
46
|
-
|
47
|
-
headers.push({
|
48
|
-
element: element,
|
49
|
-
$element: $element,
|
50
|
-
topOffset: topOffset,
|
51
|
-
bottomOffset: bottomOffset
|
52
|
-
});
|
53
|
-
})
|
54
|
-
})
|
55
|
-
}
|
56
|
-
|
57
|
-
function setHeaderRanges() {
|
58
|
-
var offsetProp = config.switchOnCollisionWith + 'Offset',
|
59
|
-
start, end;
|
60
|
-
|
61
|
-
headerRanges = [];
|
62
|
-
for (var i = 0, len = headers.length; i < len; i++) {
|
63
|
-
start = headers[i][offsetProp];
|
64
|
-
|
65
|
-
if (headers[i+1]) {
|
66
|
-
end = headers[i+1][offsetProp];
|
67
|
-
} else {
|
68
|
-
end = null;
|
69
|
-
}
|
70
|
-
|
71
|
-
headerRanges.push({
|
72
|
-
start: start,
|
73
|
-
end: end,
|
74
|
-
element: headers[i].element
|
75
|
-
});
|
76
|
-
}
|
77
|
-
|
78
|
-
//debugHeaderRanges();
|
79
|
-
}
|
80
|
-
|
81
|
-
function debugHeaderRanges() {
|
82
|
-
contentContainer.find('.header-range-debug').remove();
|
83
|
-
|
84
|
-
$.each(headerRanges, function (i, range) {
|
85
|
-
var color = 'hsla('+(20*i)+', 100%, 50%, 0.15)',
|
86
|
-
debug = $('<div>')
|
87
|
-
.addClass('header-range-debug')
|
88
|
-
.css({
|
89
|
-
width: '100%',
|
90
|
-
position: 'absolute',
|
91
|
-
top: range.start + 'px',
|
92
|
-
height: (range.end === null ? '1px' : (range.end - range.start) + 'px'),
|
93
|
-
backgroundColor: color,
|
94
|
-
borderTop: '1px solid black'
|
95
|
-
})
|
96
|
-
.appendTo(contentContainer)
|
97
|
-
|
98
|
-
debug.append(
|
99
|
-
$('<div>')
|
100
|
-
.css({
|
101
|
-
position: 'absolute',
|
102
|
-
top: 0,
|
103
|
-
right: 0,
|
104
|
-
height: '2em',
|
105
|
-
lineHeight: '2em',
|
106
|
-
width: '40em',
|
107
|
-
fontSize: '13px',
|
108
|
-
backgroundColor: 'black',
|
109
|
-
color: 'white',
|
110
|
-
padding: '0 5px'
|
111
|
-
})
|
112
|
-
.text(headers[i].$element.text() + ' (#' + i + ')')
|
113
|
-
)
|
114
|
-
})
|
115
|
-
}
|
116
|
-
|
117
|
-
function setCurrentHeaderIndex() {
|
118
|
-
var scrollTop = contentContainer.scrollTop();
|
119
|
-
|
120
|
-
for (var i = 0, len = headers.length; i < len; i++) {
|
121
|
-
if (scrollTop < headers[i].bottomOffset) {
|
122
|
-
break;
|
123
|
-
}
|
124
|
-
currentHeaderIndex = i;
|
125
|
-
}
|
126
|
-
}
|
127
|
-
|
128
|
-
function render() {
|
129
|
-
var clonedHeader;
|
130
|
-
|
131
|
-
if (currentHeaderRangeIndex < 0 || currentHeaderRangeIndex > headerRanges.length-1) {
|
132
|
-
elem.removeClass('show');
|
133
|
-
body.removeClass('has-sticky-header');
|
134
|
-
}
|
135
|
-
else {
|
136
|
-
var realHeader = $(headerRanges[currentHeaderRangeIndex].element);
|
137
|
-
|
138
|
-
if (typeof config.fillHeadersWith === 'function') {
|
139
|
-
elem.html(config.fillHeadersWith(realHeader));
|
140
|
-
} else if (config.fillHeadersWith === 'content') {
|
141
|
-
elem.html(realHeader.clone().html());
|
142
|
-
} else {
|
143
|
-
elem.html(realHeader.clone());
|
144
|
-
}
|
145
|
-
|
146
|
-
elem.addClass('show');
|
147
|
-
body.addClass('has-sticky-header');
|
148
|
-
}
|
149
|
-
|
150
|
-
return me;
|
151
|
-
}
|
152
|
-
|
153
|
-
function determineCurrentHeaderRangeIndex(startIndex, direction) {
|
154
|
-
var index = startIndex;
|
155
|
-
while (true) {
|
156
|
-
currentHeaderRange = headerRanges[index];
|
157
|
-
if (!currentHeaderRange || isWithinRange(currentScrollOffset, currentHeaderRange)) {
|
158
|
-
break;
|
159
|
-
} else {
|
160
|
-
index += direction;
|
161
|
-
}
|
162
|
-
}
|
163
|
-
return index;
|
164
|
-
}
|
165
|
-
|
166
|
-
function onScroll() {
|
167
|
-
if (!headerRanges.length) {
|
168
|
-
return;
|
169
|
-
}
|
170
|
-
|
171
|
-
currentScrollOffset = contentContainer.scrollTop();
|
172
|
-
|
173
|
-
if (currentScrollOffset > headerRanges[0].start) {
|
174
|
-
var newCurrentHeaderRangeIndex = currentHeaderRangeIndex;
|
175
|
-
var currentHeaderRange = headerRanges[newCurrentHeaderRangeIndex];
|
176
|
-
|
177
|
-
if (newCurrentHeaderRangeIndex < 0) {
|
178
|
-
newCurrentHeaderRangeIndex = 0;
|
179
|
-
}
|
180
|
-
|
181
|
-
if (currentScrollOffset < lastScrollOffset) {
|
182
|
-
// scrolling up
|
183
|
-
newCurrentHeaderRangeIndex = determineCurrentHeaderRangeIndex(newCurrentHeaderRangeIndex, -1);
|
184
|
-
} else {
|
185
|
-
// scrolling down
|
186
|
-
newCurrentHeaderRangeIndex = determineCurrentHeaderRangeIndex(newCurrentHeaderRangeIndex, +1);
|
187
|
-
}
|
188
|
-
} else {
|
189
|
-
newCurrentHeaderRangeIndex = -1;
|
190
|
-
}
|
191
|
-
|
192
|
-
// only re-render when necessary
|
193
|
-
if (newCurrentHeaderRangeIndex !== undefined && currentHeaderRangeIndex !== newCurrentHeaderRangeIndex) {
|
194
|
-
currentHeaderRangeIndex = newCurrentHeaderRangeIndex;
|
195
|
-
render();
|
196
|
-
}
|
197
|
-
|
198
|
-
lastScrollOffset = currentScrollOffset;
|
199
|
-
}
|
200
|
-
|
201
|
-
function listenToScroll(element, callback, options) {
|
202
|
-
options = options || {};
|
203
|
-
|
204
|
-
if (options.every) {
|
205
|
-
element.on('scroll', function () {
|
206
|
-
isScrolling = true;
|
207
|
-
})
|
208
|
-
|
209
|
-
setInterval(function () {
|
210
|
-
if (isScrolling) {
|
211
|
-
callback();
|
212
|
-
isScrolling = false;
|
213
|
-
}
|
214
|
-
}, options.every);
|
215
|
-
}
|
216
|
-
else {
|
217
|
-
element.on('scroll', callback);
|
218
|
-
}
|
219
|
-
}
|
220
|
-
|
221
|
-
function isWithinRange(number, range) {
|
222
|
-
return (
|
223
|
-
number >= range.start &&
|
224
|
-
(
|
225
|
-
range.end === undefined ||
|
226
|
-
range.end === null ||
|
227
|
-
number <= range.end
|
228
|
-
)
|
229
|
-
);
|
230
|
-
}
|
231
|
-
|
232
|
-
function parseCssValue(value) {
|
233
|
-
if (value === null || value === undefined) {
|
234
|
-
return 0;
|
235
|
-
} else {
|
236
|
-
return parseInt(value, 10);
|
237
|
-
}
|
238
|
-
}
|
239
|
-
|
240
|
-
me.setHeaders = setHeaders;
|
241
|
-
me.setHeaderRanges = setHeaderRanges;
|
242
|
-
|
243
|
-
me.set = function (/* key, value | config */) {
|
244
|
-
if ($.isPlainObject(arguments[0])) {
|
245
|
-
$.extend(config, arguments[0]);
|
246
|
-
} else {
|
247
|
-
config[arguments[0]] = arguments[1];
|
248
|
-
}
|
249
|
-
return me;
|
250
|
-
}
|
251
|
-
|
252
|
-
me.add = function (/* selectors... */) {
|
253
|
-
selectors.push.apply(selectors, arguments);
|
254
|
-
return me;
|
255
|
-
}
|
256
|
-
|
257
|
-
me.activate = function () {
|
258
|
-
body = $('body');
|
259
|
-
contentContainer = config.contentContainer ? $(config.contentContainer) : body;
|
260
|
-
stickyHeaderContainer = config.stickyHeaderContainer ? $(config.stickyHeaderContainer) : contentContainer;
|
261
|
-
|
262
|
-
stickyHeaderContainer.append(elem);
|
263
|
-
setHeaders();
|
264
|
-
setHeaderRanges();
|
265
|
-
setCurrentHeaderIndex();
|
266
|
-
|
267
|
-
return me;
|
268
|
-
}
|
269
|
-
|
270
|
-
me.update = function () {
|
271
|
-
setHeaders();
|
272
|
-
setHeaderRanges();
|
273
|
-
render();
|
274
|
-
|
275
|
-
listenToScroll(contentContainer, onScroll);
|
276
|
-
}
|
277
|
-
|
278
|
-
me.getHeaders = function () {
|
279
|
-
return headers;
|
280
|
-
}
|
281
|
-
|
282
|
-
me.getHeaderRanges = function () {
|
283
|
-
return headerRanges;
|
284
|
-
}
|
285
|
-
|
286
|
-
init();
|
287
|
-
|
288
|
-
return me;
|
289
|
-
})(jQuery);
|
@@ -1,6 +0,0 @@
|
|
1
|
-
// Underscore.js 1.5.2
|
2
|
-
// http://underscorejs.org
|
3
|
-
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
4
|
-
// Underscore may be freely distributed under the MIT license.
|
5
|
-
(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?(this._wrapped=n,void 0):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.5.2";var A=j.each=j.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var E="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(E);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(E);return r},j.find=j.detect=function(n,t,r){var e;return O(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var O=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:O(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,function(n){return n[t]})},j.where=function(n,t,r){return j.isEmpty(t)?r?void 0:[]:j[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},j.findWhere=function(n,t){return j.where(n,t,!0)},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);if(!t&&j.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>e.computed&&(e={value:n,computed:a})}),e.value},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);if(!t&&j.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a<e.computed&&(e={value:n,computed:a})}),e.value},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return arguments.length<2||r?n[j.random(n.length-1)]:j.shuffle(n).slice(0,Math.max(0,t))};var k=function(n){return j.isFunction(n)?n:function(t){return t[n]}};j.sortBy=function(n,t,r){var e=k(t);return j.pluck(j.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={},i=null==r?j.identity:k(r);return A(t,function(r,a){var o=i.call(e,r,a,t);n(u,o,r)}),u}};j.groupBy=F(function(n,t,r){(j.has(n,t)?n[t]:n[t]=[]).push(r)}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=null==r?j.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])<u?i=o+1:a=o}return i},j.toArray=function(n){return n?j.isArray(n)?o.call(n):n.length===+n.length?j.map(n,j.identity):j.values(n):[]},j.size=function(n){return null==n?0:n.length===+n.length?n.length:j.keys(n).length},j.first=j.head=j.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.indexOf(t,n)>=0})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=r.leading===!1?0:new Date,a=null,i=n.apply(e,u)};return function(){var l=new Date;o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u)):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o;return function(){i=this,u=arguments,a=new Date;var c=function(){var l=new Date-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u)))},l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u)),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=w||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var I={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};I.unescape=j.invert(I.escape);var T={escape:new RegExp("["+j.keys(I.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(I.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(T[n],function(t){return I[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
|
6
|
-
//# sourceMappingURL=underscore-min.map
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<div id="menu">
|
2
|
-
<% unless @file && @file.filename == 'README.md' %>
|
3
|
-
<span class="title">
|
4
|
-
<%= linkify('file:README.md', 'Home') %>
|
5
|
-
</span> »
|
6
|
-
<% end %>
|
7
|
-
<% if @contents || @file %>
|
8
|
-
<span class="title"><%= @breadcrumb_title.sub(/\AFile: /, "") %></span>
|
9
|
-
<% elsif object.is_a?(CodeObjects::Base) %>
|
10
|
-
<%= @breadcrumb.map {|obj| "<span class='title'>" + linkify(obj, obj.name) + "</span>" }.join(" » ") %>
|
11
|
-
<%= @breadcrumb.size > 0 ? " » " : "" %>
|
12
|
-
<span class="title"><%= object.root? ? "Top Level Namespace" : object.name(true) %></span>
|
13
|
-
<% end %>
|
14
|
-
</div>
|
@@ -1 +0,0 @@
|
|
1
|
-
<!-- Fonts go here -->
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<%= erb(:headers) %>
|
6
|
-
</head>
|
7
|
-
<body>
|
8
|
-
<div id="header">
|
9
|
-
<div class="header-row">
|
10
|
-
<%= erb(:breadcrumb) %>
|
11
|
-
<%= erb(:search) %>
|
12
|
-
<div class="clear"></div>
|
13
|
-
</div>
|
14
|
-
</div>
|
15
|
-
|
16
|
-
<div id="main">
|
17
|
-
<div id="content"><%= yieldall %></div>
|
18
|
-
|
19
|
-
<%= erb(:footer) %>
|
20
|
-
</div>
|
21
|
-
|
22
|
-
</body>
|
23
|
-
</html>
|