middleman-core 4.0.0.rc.1 → 4.0.0.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/Rakefile +0 -1
- data/cucumber.yml +2 -0
- data/features/asset_hash.feature +25 -16
- data/features/asset_host.feature +5 -1
- data/features/chained_templates.feature +8 -5
- data/features/clean_build.feature +18 -0
- data/features/cli/preview_server-hook.feature +17 -0
- data/features/cli/preview_server.feature +533 -0
- data/features/cli_init.feature +3 -3
- data/features/collections.feature +5 -3
- data/features/content_type.feature +3 -0
- data/features/default-layout.feature +90 -0
- data/features/extension_api_deprecations.feature +10 -0
- data/features/front-matter.feature +6 -1
- data/features/i18n_link_to.feature +209 -0
- data/features/import_files.feature +17 -0
- data/features/javascript-testing.feature +18 -0
- data/features/markdown_redcarpet.feature +0 -1
- data/features/markdown_redcarpet_in_haml.feature +0 -1
- data/features/minify_css.feature +87 -5
- data/features/minify_javascript.feature +55 -8
- data/features/move_files.feature +44 -0
- data/features/redirects.feature +1 -0
- data/features/relative_assets.feature +13 -2
- data/features/slim.feature +1 -1
- data/features/stylus.feature +0 -1
- data/features/support/env.rb +5 -1
- data/features/support/preserve_mime_types.rb +7 -0
- data/fixtures/asset-hash-app/source/fonts/fontawesome-webfont.woff +0 -0
- data/fixtures/asset-hash-app/source/fonts/fontawesome-webfont.woff2 +0 -0
- data/fixtures/asset-hash-app/source/stylesheets/site.css.scss +2 -2
- data/fixtures/asset-hash-app/source/stylesheets/uses_fonts.css +4 -0
- data/fixtures/asset-host-app/source/asset_host.html.erb +5 -1
- data/fixtures/chained-app/source/test.erb.combobreaker.str.erb +8 -0
- data/fixtures/clean-app/config-hidden-dir-after.rb +5 -0
- data/fixtures/clean-app/config-hidden-dir-before.rb +1 -0
- data/fixtures/content-type-app/source/index.php +1 -0
- data/fixtures/extension-api-deprecations-app/config.rb +11 -0
- data/fixtures/extension-api-deprecations-app/source/index.html.erb +1 -0
- data/fixtures/extension-api-deprecations-app/source/layouts/layout.erb +3 -0
- data/fixtures/frontmatter-app/config.rb +1 -0
- data/fixtures/frontmatter-app/source/front-matter-haml.html.haml +6 -0
- data/fixtures/frontmatter-neighbor-app/config.rb +1 -1
- data/fixtures/frontmatter-settings-neighbor-app/config.rb +1 -1
- data/fixtures/i18n-test-app/source/localizable/partials/index.html.erb +3 -1
- data/fixtures/import-app/bower.json +21 -0
- data/fixtures/import-app/bower_components/jquery/.bower.json +39 -0
- data/fixtures/import-app/bower_components/jquery/MIT-LICENSE.txt +21 -0
- data/fixtures/import-app/bower_components/jquery/bower.json +28 -0
- data/fixtures/import-app/bower_components/jquery/dist/jquery.js +9210 -0
- data/fixtures/import-app/bower_components/jquery/dist/jquery.min.js +5 -0
- data/fixtures/import-app/bower_components/jquery/dist/jquery.min.map +1 -0
- data/fixtures/import-app/bower_components/jquery/src/ajax.js +786 -0
- data/fixtures/import-app/bower_components/jquery/src/ajax/jsonp.js +89 -0
- data/fixtures/import-app/bower_components/jquery/src/ajax/load.js +75 -0
- data/fixtures/import-app/bower_components/jquery/src/ajax/parseJSON.js +13 -0
- data/fixtures/import-app/bower_components/jquery/src/ajax/parseXML.js +28 -0
- data/fixtures/import-app/bower_components/jquery/src/ajax/script.js +64 -0
- data/fixtures/import-app/bower_components/jquery/src/ajax/var/nonce.js +5 -0
- data/fixtures/import-app/bower_components/jquery/src/ajax/var/rquery.js +3 -0
- data/fixtures/import-app/bower_components/jquery/src/ajax/xhr.js +136 -0
- data/fixtures/import-app/bower_components/jquery/src/attributes.js +11 -0
- data/fixtures/import-app/bower_components/jquery/src/attributes/attr.js +141 -0
- data/fixtures/import-app/bower_components/jquery/src/attributes/classes.js +158 -0
- data/fixtures/import-app/bower_components/jquery/src/attributes/prop.js +94 -0
- data/fixtures/import-app/bower_components/jquery/src/attributes/support.js +35 -0
- data/fixtures/import-app/bower_components/jquery/src/attributes/val.js +161 -0
- data/fixtures/import-app/bower_components/jquery/src/callbacks.js +205 -0
- data/fixtures/import-app/bower_components/jquery/src/core.js +502 -0
- data/fixtures/import-app/bower_components/jquery/src/core/access.js +60 -0
- data/fixtures/import-app/bower_components/jquery/src/core/init.js +123 -0
- data/fixtures/import-app/bower_components/jquery/src/core/parseHTML.js +39 -0
- data/fixtures/import-app/bower_components/jquery/src/core/ready.js +97 -0
- data/fixtures/import-app/bower_components/jquery/src/core/var/rsingleTag.js +4 -0
- data/fixtures/import-app/bower_components/jquery/src/css.js +450 -0
- data/fixtures/import-app/bower_components/jquery/src/css/addGetHookIf.js +22 -0
- data/fixtures/import-app/bower_components/jquery/src/css/curCSS.js +57 -0
- data/fixtures/import-app/bower_components/jquery/src/css/defaultDisplay.js +70 -0
- data/fixtures/import-app/bower_components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/fixtures/import-app/bower_components/jquery/src/css/support.js +96 -0
- data/fixtures/import-app/bower_components/jquery/src/css/swap.js +28 -0
- data/fixtures/import-app/bower_components/jquery/src/css/var/cssExpand.js +3 -0
- data/fixtures/import-app/bower_components/jquery/src/css/var/getStyles.js +12 -0
- data/fixtures/import-app/bower_components/jquery/src/css/var/isHidden.js +13 -0
- data/fixtures/import-app/bower_components/jquery/src/css/var/rmargin.js +3 -0
- data/fixtures/import-app/bower_components/jquery/src/css/var/rnumnonpx.js +5 -0
- data/fixtures/import-app/bower_components/jquery/src/data.js +178 -0
- data/fixtures/import-app/bower_components/jquery/src/data/Data.js +181 -0
- data/fixtures/import-app/bower_components/jquery/src/data/accepts.js +20 -0
- data/fixtures/import-app/bower_components/jquery/src/data/var/data_priv.js +5 -0
- data/fixtures/import-app/bower_components/jquery/src/data/var/data_user.js +5 -0
- data/fixtures/import-app/bower_components/jquery/src/deferred.js +149 -0
- data/fixtures/import-app/bower_components/jquery/src/deprecated.js +13 -0
- data/fixtures/import-app/bower_components/jquery/src/dimensions.js +50 -0
- data/fixtures/import-app/bower_components/jquery/src/effects.js +648 -0
- data/fixtures/import-app/bower_components/jquery/src/effects/Tween.js +114 -0
- data/fixtures/import-app/bower_components/jquery/src/effects/animatedSelector.js +13 -0
- data/fixtures/import-app/bower_components/jquery/src/event.js +868 -0
- data/fixtures/import-app/bower_components/jquery/src/event/ajax.js +13 -0
- data/fixtures/import-app/bower_components/jquery/src/event/alias.js +39 -0
- data/fixtures/import-app/bower_components/jquery/src/event/support.js +9 -0
- data/fixtures/import-app/bower_components/jquery/src/exports/amd.js +24 -0
- data/fixtures/import-app/bower_components/jquery/src/exports/global.js +32 -0
- data/fixtures/import-app/bower_components/jquery/src/intro.js +44 -0
- data/fixtures/import-app/bower_components/jquery/src/jquery.js +37 -0
- data/fixtures/import-app/bower_components/jquery/src/manipulation.js +580 -0
- data/fixtures/import-app/bower_components/jquery/src/manipulation/_evalUrl.js +18 -0
- data/fixtures/import-app/bower_components/jquery/src/manipulation/support.js +32 -0
- data/fixtures/import-app/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/fixtures/import-app/bower_components/jquery/src/offset.js +207 -0
- data/fixtures/import-app/bower_components/jquery/src/outro.js +1 -0
- data/fixtures/import-app/bower_components/jquery/src/queue.js +142 -0
- data/fixtures/import-app/bower_components/jquery/src/queue/delay.js +22 -0
- data/fixtures/import-app/bower_components/jquery/src/selector-native.js +172 -0
- data/fixtures/import-app/bower_components/jquery/src/selector-sizzle.js +14 -0
- data/fixtures/import-app/bower_components/jquery/src/selector.js +1 -0
- data/fixtures/import-app/bower_components/jquery/src/serialize.js +111 -0
- data/fixtures/import-app/bower_components/jquery/src/sizzle/dist/sizzle.js +2067 -0
- data/fixtures/import-app/bower_components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
- data/fixtures/import-app/bower_components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
- data/fixtures/import-app/bower_components/jquery/src/traversing.js +199 -0
- data/fixtures/import-app/bower_components/jquery/src/traversing/findFilter.js +100 -0
- data/fixtures/import-app/bower_components/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/fixtures/import-app/bower_components/jquery/src/var/arr.js +3 -0
- data/fixtures/import-app/bower_components/jquery/src/var/class2type.js +4 -0
- data/fixtures/import-app/bower_components/jquery/src/var/concat.js +5 -0
- data/fixtures/import-app/bower_components/jquery/src/var/hasOwn.js +5 -0
- data/fixtures/import-app/bower_components/jquery/src/var/indexOf.js +5 -0
- data/fixtures/import-app/bower_components/jquery/src/var/pnum.js +3 -0
- data/fixtures/import-app/bower_components/jquery/src/var/push.js +5 -0
- data/fixtures/import-app/bower_components/jquery/src/var/rnotwhite.js +3 -0
- data/fixtures/import-app/bower_components/jquery/src/var/slice.js +5 -0
- data/fixtures/import-app/bower_components/jquery/src/var/strundefined.js +3 -0
- data/fixtures/import-app/bower_components/jquery/src/var/support.js +4 -0
- data/fixtures/import-app/bower_components/jquery/src/var/toString.js +5 -0
- data/fixtures/import-app/bower_components/jquery/src/wrap.js +79 -0
- data/fixtures/import-app/config.rb +7 -0
- data/fixtures/{twitter-bootstrap-app/config.rb → import-app/source/test.html} +0 -0
- data/fixtures/import-app/static.html +1 -0
- data/fixtures/javascript-app/config.rb +0 -0
- data/fixtures/javascript-app/source/index.html +17 -0
- data/fixtures/minify-css-app/source/inline-css.php +8 -0
- data/fixtures/minify-css-app/source/stylesheets/base/_base.scss +15 -0
- data/fixtures/minify-css-app/source/stylesheets/base/_buttons.scss +35 -0
- data/fixtures/minify-css-app/source/stylesheets/base/_forms.scss +90 -0
- data/fixtures/minify-css-app/source/stylesheets/base/_grid-settings.scss +14 -0
- data/fixtures/minify-css-app/source/stylesheets/base/_lists.scss +31 -0
- data/fixtures/minify-css-app/source/stylesheets/base/_tables.scss +25 -0
- data/fixtures/minify-css-app/source/stylesheets/base/_typography.scss +49 -0
- data/fixtures/minify-css-app/source/stylesheets/base/_variables.scss +42 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/_bourbon-deprecated-upcoming.scss +411 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/_bourbon.scss +87 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_border-color.scss +26 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_border-radius.scss +48 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_border-style.scss +25 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_border-width.scss +25 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_buttons.scss +64 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_clearfix.scss +25 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_ellipsis.scss +30 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_font-stacks.scss +31 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_hide-text.scss +27 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_margin.scss +26 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_padding.scss +26 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_position.scss +48 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_prefixer.scss +66 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_retina-image.scss +25 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss +51 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_text-inputs.scss +113 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_timing-functions.scss +34 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_triangle.scss +63 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_word-wrap.scss +29 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_animation.scss +43 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_appearance.scss +3 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_backface-visibility.scss +3 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_background-image.scss +42 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_background.scss +55 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_border-image.scss +59 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_calc.scss +4 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_columns.scss +47 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_filter.scss +4 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_flex-box.scss +287 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_font-face.scss +24 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_font-feature-settings.scss +4 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_hidpi-media-query.scss +10 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_hyphens.scss +4 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_image-rendering.scss +14 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_keyframes.scss +36 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_linear-gradient.scss +38 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_perspective.scss +8 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_placeholder.scss +8 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_radial-gradient.scss +39 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_selection.scss +42 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_text-decoration.scss +19 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_transform.scss +15 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_transition.scss +71 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_user-select.scss +3 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_assign-inputs.scss +11 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_contains-falsy.scss +20 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_contains.scss +26 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_is-length.scss +11 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_is-light.scss +21 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_is-number.scss +11 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_is-size.scss +13 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_modular-scale.scss +69 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_px-to-em.scss +13 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_px-to-rem.scss +15 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_shade.scss +24 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_strip-units.scss +17 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_tint.scss +24 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_transition-property-name.scss +22 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/functions/_unpack.scss +27 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_convert-units.scss +21 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_directional-values.scss +96 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss +43 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_gradient-positions-parser.scss +13 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-angle-parser.scss +25 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-gradient-parser.scss +41 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss +61 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-side-corner-parser.scss +31 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_radial-arg-parser.scss +69 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_radial-gradient-parser.scss +50 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_radial-positions-parser.scss +18 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_render-gradients.scss +26 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_shape-size-stripper.scss +10 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_str-to-num.scss +50 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/settings/_asset-pipeline.scss +7 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/settings/_prefixer.scss +9 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/settings/_px-to-em.scss +1 -0
- data/fixtures/minify-css-app/source/stylesheets/site.xcss.sass +6 -0
- data/fixtures/minify-js-app/source/inline-js.php +22 -0
- data/fixtures/minify-js-app/source/javascripts/js_test.xjs +8 -0
- data/fixtures/partials-app/source/locals.html.erb +1 -1
- data/fixtures/preview-server-app/bin/dns_server.rb +33 -0
- data/fixtures/preview-server-app/config.rb +0 -0
- data/fixtures/preview-server-app/source/index.html.erb +1 -0
- data/fixtures/preview-server-app/source/layout.erb +9 -0
- data/fixtures/preview-server-app/source/layouts/custom.erb +8 -0
- data/fixtures/preview-server-app/source/real.html +1 -0
- data/fixtures/preview-server-app/source/real/index.html.erb +5 -0
- data/fixtures/preview-server-app/source/should_be_ignored.html +1 -0
- data/fixtures/preview-server-app/source/should_be_ignored2.html +1 -0
- data/fixtures/preview-server-app/source/should_be_ignored3.html +1 -0
- data/fixtures/preview-server-app/source/static.html +1 -0
- data/fixtures/preview-server-hook-app/config.rb +19 -0
- data/fixtures/preview-server-hook-app/source/index.html.erb +9 -0
- data/fixtures/related-files-app/config.rb +0 -0
- data/fixtures/related-files-app/source/index.html.erb +0 -0
- data/fixtures/related-files-app/source/partials/_test.erb +0 -0
- data/fixtures/related-files-app/source/partials/_test2.haml +0 -0
- data/fixtures/related-files-app/source/stylesheets/_include3.sass +0 -0
- data/fixtures/related-files-app/source/stylesheets/_include4.scss +0 -0
- data/fixtures/related-files-app/source/stylesheets/include1.css +0 -0
- data/fixtures/related-files-app/source/stylesheets/include2.css.scss +0 -0
- data/fixtures/related-files-app/source/stylesheets/site.css.scss +0 -0
- data/fixtures/relative-assets-app/source/absolute_image_relative_css.html.erb +9 -0
- data/fixtures/relative-assets-app/source/javascripts/app.js +3 -0
- data/fixtures/relative-assets-app/source/relative_image.html.erb +1 -0
- data/fixtures/relative-assets-app/source/relative_image_absolute_css.html.erb +9 -0
- data/lib/middleman-core/application.rb +44 -18
- data/lib/middleman-core/builder.rb +1 -27
- data/lib/middleman-core/callback_manager.rb +3 -3
- data/lib/middleman-core/configuration.rb +1 -1
- data/lib/middleman-core/core_extensions/collections/step_context.rb +1 -1
- data/lib/middleman-core/core_extensions/data.rb +2 -2
- data/lib/middleman-core/core_extensions/default_helpers.rb +37 -3
- data/lib/middleman-core/core_extensions/external_helpers.rb +2 -1
- data/lib/middleman-core/core_extensions/front_matter.rb +5 -2
- data/lib/middleman-core/core_extensions/i18n.rb +95 -29
- data/lib/middleman-core/core_extensions/routing.rb +2 -2
- data/lib/middleman-core/dns_resolver.rb +73 -0
- data/lib/middleman-core/dns_resolver/basic_network_resolver.rb +52 -0
- data/lib/middleman-core/dns_resolver/hosts_resolver.rb +63 -0
- data/lib/middleman-core/dns_resolver/local_link_resolver.rb +44 -0
- data/lib/middleman-core/dns_resolver/network_resolver.rb +42 -0
- data/lib/middleman-core/extension.rb +1 -1
- data/lib/middleman-core/extensions/asset_hash.rb +3 -3
- data/lib/middleman-core/extensions/automatic_image_sizes.rb +9 -1
- data/lib/middleman-core/extensions/minify_css.rb +49 -17
- data/lib/middleman-core/extensions/minify_javascript.rb +60 -30
- data/lib/middleman-core/extensions/relative_assets.rb +13 -0
- data/lib/middleman-core/file_renderer.rb +2 -2
- data/lib/middleman-core/meta_pages.rb +1 -1
- data/lib/middleman-core/preview_server.rb +109 -47
- data/lib/middleman-core/preview_server/checks.rb +81 -0
- data/lib/middleman-core/preview_server/information.rb +273 -0
- data/lib/middleman-core/preview_server/network_interface_inventory.rb +65 -0
- data/lib/middleman-core/preview_server/server_hostname.rb +39 -0
- data/lib/middleman-core/preview_server/server_information.rb +153 -0
- data/lib/middleman-core/preview_server/server_information_callback_proxy.rb +35 -0
- data/lib/middleman-core/preview_server/server_information_validator.rb +18 -0
- data/lib/middleman-core/preview_server/server_ip_address.rb +55 -0
- data/lib/middleman-core/preview_server/server_url.rb +63 -0
- data/lib/middleman-core/preview_server/tcp_port_prober.rb +29 -0
- data/lib/middleman-core/rack.rb +7 -1
- data/lib/middleman-core/renderers/haml.rb +1 -2
- data/lib/middleman-core/renderers/liquid.rb +1 -1
- data/lib/middleman-core/renderers/sass.rb +23 -36
- data/lib/middleman-core/renderers/sass_functions.rb +20 -22
- data/lib/middleman-core/sitemap/extensions/ignores.rb +5 -1
- data/lib/middleman-core/sitemap/extensions/import.rb +108 -0
- data/lib/middleman-core/sitemap/extensions/move_file.rb +68 -0
- data/lib/middleman-core/sitemap/extensions/proxies.rb +7 -2
- data/lib/middleman-core/sitemap/extensions/redirects.rb +1 -0
- data/lib/middleman-core/sitemap/resource.rb +3 -7
- data/lib/middleman-core/sitemap/store.rb +22 -19
- data/lib/middleman-core/sources.rb +2 -3
- data/lib/middleman-core/sources/source_watcher.rb +21 -37
- data/lib/middleman-core/step_definitions.rb +1 -0
- data/lib/middleman-core/step_definitions/builder_steps.rb +0 -47
- data/lib/middleman-core/step_definitions/commandline_steps.rb +88 -0
- data/lib/middleman-core/step_definitions/middleman_steps.rb +51 -6
- data/lib/middleman-core/step_definitions/server_steps.rb +21 -53
- data/lib/middleman-core/template_context.rb +14 -13
- data/lib/middleman-core/util.rb +127 -4
- data/lib/middleman-core/util/data.rb +87 -138
- data/lib/middleman-core/version.rb +1 -1
- data/middleman-core.gemspec +11 -11
- data/spec/middleman-core/dns_resolver_spec.rb +118 -0
- data/spec/middleman-core/preview_server/server_hostname_spec.rb +39 -0
- data/spec/middleman-core/preview_server/server_ip_address_spec.rb +43 -0
- data/spec/middleman-core/util_spec.rb +111 -3
- data/spec/spec_helper.rb +29 -1
- data/spec/support/given.rb +42 -0
- metadata +528 -221
- data/features/twitter-bootstrap-compile.feature +0 -6
- data/features/working_directory.feature +0 -33
- data/fixtures/collections-app/config.rb +0 -16
- data/fixtures/collections-app/source/index.html.erb +0 -26
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/.gitignore +0 -36
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/.travis.yml +0 -3
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/LICENSE +0 -176
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/README.md +0 -137
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/img/glyphicons-halflings-white.png +0 -0
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/img/glyphicons-halflings.png +0 -0
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/.jshintrc +0 -10
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/README.md +0 -112
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/bootstrap-alert.js +0 -90
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/bootstrap-button.js +0 -96
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/bootstrap-carousel.js +0 -169
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/bootstrap-collapse.js +0 -157
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/bootstrap-dropdown.js +0 -100
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/bootstrap-modal.js +0 -218
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/bootstrap-popover.js +0 -98
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/bootstrap-scrollspy.js +0 -151
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/bootstrap-tab.js +0 -135
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/bootstrap-tooltip.js +0 -275
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/bootstrap-transition.js +0 -61
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/bootstrap-typeahead.js +0 -285
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/index.html +0 -54
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/phantom.js +0 -63
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/server.js +0 -14
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-alert.js +0 -56
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-button.js +0 -77
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-carousel.js +0 -28
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-collapse.js +0 -54
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-dropdown.js +0 -87
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-modal.js +0 -114
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-phantom.js +0 -21
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-popover.js +0 -93
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-scrollspy.js +0 -31
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-tab.js +0 -61
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-tooltip.js +0 -155
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-transition.js +0 -13
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-typeahead.js +0 -148
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/vendor/jquery.js +0 -9252
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/vendor/qunit.css +0 -232
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/vendor/qunit.js +0 -1510
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_accordion.less +0 -33
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_alerts.less +0 -58
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_breadcrumbs.less +0 -24
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_button-groups.less +0 -191
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_buttons.less +0 -191
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_carousel.less +0 -121
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_close.less +0 -29
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_code.less +0 -57
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_component-animations.less +0 -20
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_dropdowns.less +0 -143
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_forms.less +0 -583
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_grid.less +0 -5
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_hero-unit.less +0 -22
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_labels-badges.less +0 -55
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_layouts.less +0 -17
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_mixins.less +0 -646
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_modals.less +0 -90
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_navbar.less +0 -358
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_navs.less +0 -363
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_pager.less +0 -36
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_pagination.less +0 -56
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_popovers.less +0 -49
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_progress-bars.less +0 -117
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_reset.less +0 -131
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_responsive-1200px-min.less +0 -26
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_responsive-767px-max.less +0 -149
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_responsive-768px-979px.less +0 -17
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_responsive-navbar.less +0 -153
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_responsive-utilities.less +0 -41
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_scaffolding.less +0 -29
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_sprites.less +0 -191
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_tables.less +0 -176
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_thumbnails.less +0 -47
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_tooltip.less +0 -35
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_type.less +0 -232
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_utilities.less +0 -23
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_variables.less +0 -206
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/_wells.less +0 -27
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/bootstrap.less +0 -62
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/responsive.less +0 -48
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/tests/css-tests.css +0 -52
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/tests/css-tests.html +0 -917
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/tests/forms.html +0 -179
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/less/tests/navbar.html +0 -108
- data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/package.json +0 -25
- data/lib/middleman-core/cli/server.rb +0 -96
@@ -1,93 +0,0 @@
|
|
1
|
-
$(function () {
|
2
|
-
|
3
|
-
module("bootstrap-popover")
|
4
|
-
|
5
|
-
test("should be defined on jquery object", function () {
|
6
|
-
var div = $('<div></div>')
|
7
|
-
ok(div.popover, 'popover method is defined')
|
8
|
-
})
|
9
|
-
|
10
|
-
test("should return element", function () {
|
11
|
-
var div = $('<div></div>')
|
12
|
-
ok(div.popover() == div, 'document.body returned')
|
13
|
-
})
|
14
|
-
|
15
|
-
test("should render popover element", function () {
|
16
|
-
$.support.transition = false
|
17
|
-
var popover = $('<a href="#" title="mdo" data-content="http://twitter.com/mdo">@mdo</a>')
|
18
|
-
.appendTo('#qunit-fixture')
|
19
|
-
.popover('show')
|
20
|
-
|
21
|
-
ok($('.popover').length, 'popover was inserted')
|
22
|
-
popover.popover('hide')
|
23
|
-
ok(!$(".popover").length, 'popover removed')
|
24
|
-
})
|
25
|
-
|
26
|
-
test("should store popover instance in popover data object", function () {
|
27
|
-
$.support.transition = false
|
28
|
-
var popover = $('<a href="#" title="mdo" data-content="http://twitter.com/mdo">@mdo</a>')
|
29
|
-
.popover()
|
30
|
-
|
31
|
-
ok(!!popover.data('popover'), 'popover instance exists')
|
32
|
-
})
|
33
|
-
|
34
|
-
test("should get title and content from options", function () {
|
35
|
-
$.support.transition = false
|
36
|
-
var popover = $('<a href="#">@fat</a>')
|
37
|
-
.appendTo('#qunit-fixture')
|
38
|
-
.popover({
|
39
|
-
title: function () {
|
40
|
-
return '@fat'
|
41
|
-
}
|
42
|
-
, content: function () {
|
43
|
-
return 'loves writing tests (╯°□°)╯︵ ┻━┻'
|
44
|
-
}
|
45
|
-
})
|
46
|
-
|
47
|
-
popover.popover('show')
|
48
|
-
|
49
|
-
ok($('.popover').length, 'popover was inserted')
|
50
|
-
equals($('.popover .popover-title').text(), '@fat', 'title correctly inserted')
|
51
|
-
equals($('.popover .popover-content').text(), 'loves writing tests (╯°□°)╯︵ ┻━┻', 'content correctly inserted')
|
52
|
-
|
53
|
-
popover.popover('hide')
|
54
|
-
ok(!$('.popover').length, 'popover was removed')
|
55
|
-
$('#qunit-fixture').empty()
|
56
|
-
})
|
57
|
-
|
58
|
-
test("should get title and content from attributes", function () {
|
59
|
-
$.support.transition = false
|
60
|
-
var popover = $('<a href="#" title="@mdo" data-content="loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻" >@mdo</a>')
|
61
|
-
.appendTo('#qunit-fixture')
|
62
|
-
.popover()
|
63
|
-
.popover('show')
|
64
|
-
|
65
|
-
ok($('.popover').length, 'popover was inserted')
|
66
|
-
equals($('.popover .popover-title').text(), '@mdo', 'title correctly inserted')
|
67
|
-
equals($('.popover .popover-content').text(), "loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻", 'content correctly inserted')
|
68
|
-
|
69
|
-
popover.popover('hide')
|
70
|
-
ok(!$('.popover').length, 'popover was removed')
|
71
|
-
$('#qunit-fixture').empty()
|
72
|
-
})
|
73
|
-
|
74
|
-
test("should respect custom classes", function() {
|
75
|
-
$.support.transition = false
|
76
|
-
var popover = $('<a href="#">@fat</a>')
|
77
|
-
.appendTo('#qunit-fixture')
|
78
|
-
.popover({
|
79
|
-
title: 'Test'
|
80
|
-
, content: 'Test'
|
81
|
-
, template: '<div class="popover foobar"><div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div></div>'
|
82
|
-
})
|
83
|
-
|
84
|
-
popover.popover('show')
|
85
|
-
|
86
|
-
ok($('.popover').length, 'popover was inserted')
|
87
|
-
ok($('.popover').hasClass('foobar'), 'custom class is present')
|
88
|
-
|
89
|
-
popover.popover('hide')
|
90
|
-
ok(!$('.popover').length, 'popover was removed')
|
91
|
-
$('#qunit-fixture').empty()
|
92
|
-
})
|
93
|
-
})
|
@@ -1,31 +0,0 @@
|
|
1
|
-
$(function () {
|
2
|
-
|
3
|
-
module("bootstrap-scrollspy")
|
4
|
-
|
5
|
-
test("should be defined on jquery object", function () {
|
6
|
-
ok($(document.body).scrollspy, 'scrollspy method is defined')
|
7
|
-
})
|
8
|
-
|
9
|
-
test("should return element", function () {
|
10
|
-
ok($(document.body).scrollspy()[0] == document.body, 'document.body returned')
|
11
|
-
})
|
12
|
-
|
13
|
-
test("should switch active class on scroll", function () {
|
14
|
-
var sectionHTML = '<div id="masthead"></div>'
|
15
|
-
, $section = $(sectionHTML).append('#qunit-fixture')
|
16
|
-
, topbarHTML ='<div class="topbar">'
|
17
|
-
+ '<div class="topbar-inner">'
|
18
|
-
+ '<div class="container">'
|
19
|
-
+ '<h3><a href="#">Bootstrap</a></h3>'
|
20
|
-
+ '<ul class="nav">'
|
21
|
-
+ '<li><a href="#masthead">Overview</a></li>'
|
22
|
-
+ '</ul>'
|
23
|
-
+ '</div>'
|
24
|
-
+ '</div>'
|
25
|
-
+ '</div>'
|
26
|
-
, $topbar = $(topbarHTML).scrollspy()
|
27
|
-
|
28
|
-
ok($topbar.find('.active', true))
|
29
|
-
})
|
30
|
-
|
31
|
-
})
|
data/fixtures/twitter-bootstrap-app/source/twitter-bootstrap-ebc6935/js/tests/unit/bootstrap-tab.js
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
$(function () {
|
2
|
-
|
3
|
-
module("bootstrap-tabs")
|
4
|
-
|
5
|
-
test("should be defined on jquery object", function () {
|
6
|
-
ok($(document.body).tab, 'tabs method is defined')
|
7
|
-
})
|
8
|
-
|
9
|
-
test("should return element", function () {
|
10
|
-
ok($(document.body).tab()[0] == document.body, 'document.body returned')
|
11
|
-
})
|
12
|
-
|
13
|
-
test("should activate element by tab id", function () {
|
14
|
-
var tabsHTML =
|
15
|
-
'<ul class="tabs">'
|
16
|
-
+ '<li><a href="#home">Home</a></li>'
|
17
|
-
+ '<li><a href="#profile">Profile</a></li>'
|
18
|
-
+ '</ul>'
|
19
|
-
|
20
|
-
$('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture")
|
21
|
-
|
22
|
-
$(tabsHTML).find('li:last a').tab('show')
|
23
|
-
equals($("#qunit-fixture").find('.active').attr('id'), "profile")
|
24
|
-
|
25
|
-
$(tabsHTML).find('li:first a').tab('show')
|
26
|
-
equals($("#qunit-fixture").find('.active').attr('id'), "home")
|
27
|
-
})
|
28
|
-
|
29
|
-
test("should activate element by tab id", function () {
|
30
|
-
var pillsHTML =
|
31
|
-
'<ul class="pills">'
|
32
|
-
+ '<li><a href="#home">Home</a></li>'
|
33
|
-
+ '<li><a href="#profile">Profile</a></li>'
|
34
|
-
+ '</ul>'
|
35
|
-
|
36
|
-
$('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture")
|
37
|
-
|
38
|
-
$(pillsHTML).find('li:last a').tab('show')
|
39
|
-
equals($("#qunit-fixture").find('.active').attr('id'), "profile")
|
40
|
-
|
41
|
-
$(pillsHTML).find('li:first a').tab('show')
|
42
|
-
equals($("#qunit-fixture").find('.active').attr('id'), "home")
|
43
|
-
})
|
44
|
-
|
45
|
-
|
46
|
-
test("should not fire closed when close is prevented", function () {
|
47
|
-
$.support.transition = false
|
48
|
-
stop();
|
49
|
-
$('<div class="tab"/>')
|
50
|
-
.bind('show', function (e) {
|
51
|
-
e.preventDefault();
|
52
|
-
ok(true);
|
53
|
-
start();
|
54
|
-
})
|
55
|
-
.bind('shown', function () {
|
56
|
-
ok(false);
|
57
|
-
})
|
58
|
-
.tab('show')
|
59
|
-
})
|
60
|
-
|
61
|
-
})
|
@@ -1,155 +0,0 @@
|
|
1
|
-
$(function () {
|
2
|
-
|
3
|
-
module("bootstrap-tooltip")
|
4
|
-
|
5
|
-
test("should be defined on jquery object", function () {
|
6
|
-
var div = $("<div></div>")
|
7
|
-
ok(div.tooltip, 'popover method is defined')
|
8
|
-
})
|
9
|
-
|
10
|
-
test("should return element", function () {
|
11
|
-
var div = $("<div></div>")
|
12
|
-
ok(div.tooltip() == div, 'document.body returned')
|
13
|
-
})
|
14
|
-
|
15
|
-
test("should expose default settings", function () {
|
16
|
-
ok(!!$.fn.tooltip.defaults, 'defaults is defined')
|
17
|
-
})
|
18
|
-
|
19
|
-
test("should remove title attribute", function () {
|
20
|
-
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>').tooltip()
|
21
|
-
ok(!tooltip.attr('title'), 'title tag was removed')
|
22
|
-
})
|
23
|
-
|
24
|
-
test("should add data attribute for referencing original title", function () {
|
25
|
-
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>').tooltip()
|
26
|
-
equals(tooltip.attr('data-original-title'), 'Another tooltip', 'original title preserved in data attribute')
|
27
|
-
})
|
28
|
-
|
29
|
-
test("should place tooltips relative to placement option", function () {
|
30
|
-
$.support.transition = false
|
31
|
-
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
|
32
|
-
.appendTo('#qunit-fixture')
|
33
|
-
.tooltip({placement: 'bottom'})
|
34
|
-
.tooltip('show')
|
35
|
-
|
36
|
-
ok($(".tooltip").is('.fade.bottom.in'), 'has correct classes applied')
|
37
|
-
tooltip.tooltip('hide')
|
38
|
-
})
|
39
|
-
|
40
|
-
test("should always allow html entities", function () {
|
41
|
-
$.support.transition = false
|
42
|
-
var tooltip = $('<a href="#" rel="tooltip" title="<b>@fat</b>"></a>')
|
43
|
-
.appendTo('#qunit-fixture')
|
44
|
-
.tooltip('show')
|
45
|
-
|
46
|
-
ok($('.tooltip b').length, 'b tag was inserted')
|
47
|
-
tooltip.tooltip('hide')
|
48
|
-
ok(!$(".tooltip").length, 'tooltip removed')
|
49
|
-
})
|
50
|
-
|
51
|
-
test("should respect custom classes", function () {
|
52
|
-
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
|
53
|
-
.appendTo('#qunit-fixture')
|
54
|
-
.tooltip({ template: '<div class="tooltip some-class"><div class="tooltip-arrow"/><div class="tooltip-inner"/></div>'})
|
55
|
-
.tooltip('show')
|
56
|
-
|
57
|
-
ok($('.tooltip').hasClass('some-class'), 'custom class is present')
|
58
|
-
tooltip.tooltip('hide')
|
59
|
-
ok(!$(".tooltip").length, 'tooltip removed')
|
60
|
-
})
|
61
|
-
|
62
|
-
test("should not show tooltip if leave event occurs before delay expires", function () {
|
63
|
-
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
|
64
|
-
.appendTo('#qunit-fixture')
|
65
|
-
.tooltip({ delay: 200 })
|
66
|
-
|
67
|
-
stop()
|
68
|
-
|
69
|
-
tooltip.trigger('mouseenter')
|
70
|
-
|
71
|
-
setTimeout(function () {
|
72
|
-
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
|
73
|
-
tooltip.trigger('mouseout')
|
74
|
-
setTimeout(function () {
|
75
|
-
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
|
76
|
-
start()
|
77
|
-
}, 200)
|
78
|
-
}, 100)
|
79
|
-
})
|
80
|
-
|
81
|
-
test("should not show tooltip if leave event occurs before delay expires, even if hide delay is 0", function () {
|
82
|
-
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
|
83
|
-
.appendTo('#qunit-fixture')
|
84
|
-
.tooltip({ delay: { show: 200, hide: 0} })
|
85
|
-
|
86
|
-
stop()
|
87
|
-
|
88
|
-
tooltip.trigger('mouseenter')
|
89
|
-
|
90
|
-
setTimeout(function () {
|
91
|
-
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
|
92
|
-
tooltip.trigger('mouseout')
|
93
|
-
setTimeout(function () {
|
94
|
-
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
|
95
|
-
start()
|
96
|
-
}, 200)
|
97
|
-
}, 100)
|
98
|
-
})
|
99
|
-
|
100
|
-
test("should not show tooltip if leave event occurs before delay expires", function () {
|
101
|
-
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
|
102
|
-
.appendTo('#qunit-fixture')
|
103
|
-
.tooltip({ delay: 100 })
|
104
|
-
stop()
|
105
|
-
tooltip.trigger('mouseenter')
|
106
|
-
setTimeout(function () {
|
107
|
-
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
|
108
|
-
tooltip.trigger('mouseout')
|
109
|
-
setTimeout(function () {
|
110
|
-
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
|
111
|
-
start()
|
112
|
-
}, 100)
|
113
|
-
}, 50)
|
114
|
-
})
|
115
|
-
|
116
|
-
test("should show tooltip if leave event hasn't occured before delay expires", function () {
|
117
|
-
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
|
118
|
-
.appendTo('#qunit-fixture')
|
119
|
-
.tooltip({ delay: 150 })
|
120
|
-
stop()
|
121
|
-
tooltip.trigger('mouseenter')
|
122
|
-
setTimeout(function () {
|
123
|
-
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
|
124
|
-
}, 100)
|
125
|
-
setTimeout(function () {
|
126
|
-
ok($(".tooltip").is('.fade.in'), 'tooltip has faded in')
|
127
|
-
start()
|
128
|
-
}, 200)
|
129
|
-
})
|
130
|
-
|
131
|
-
test("should detect if title string is html or text: foo", function () {
|
132
|
-
ok(!$.fn.tooltip.Constructor.prototype.isHTML('foo'), 'correctly detected html')
|
133
|
-
})
|
134
|
-
|
135
|
-
test("should detect if title string is html or text: &lt;foo&gt;", function () {
|
136
|
-
ok(!$.fn.tooltip.Constructor.prototype.isHTML('<foo>'), 'correctly detected html')
|
137
|
-
})
|
138
|
-
|
139
|
-
test("should detect if title string is html or text: <div>foo</div>", function () {
|
140
|
-
ok($.fn.tooltip.Constructor.prototype.isHTML('<div>foo</div>'), 'correctly detected html')
|
141
|
-
})
|
142
|
-
|
143
|
-
test("should detect if title string is html or text: asdfa<div>foo</div>asdfasdf", function () {
|
144
|
-
ok($.fn.tooltip.Constructor.prototype.isHTML('asdfa<div>foo</div>asdfasdf'), 'correctly detected html')
|
145
|
-
})
|
146
|
-
|
147
|
-
test("should detect if title string is html or text: document.createElement('div')", function () {
|
148
|
-
ok($.fn.tooltip.Constructor.prototype.isHTML(document.createElement('div')), 'correctly detected html')
|
149
|
-
})
|
150
|
-
|
151
|
-
test("should detect if title string is html or text: $('<div />)", function () {
|
152
|
-
ok($.fn.tooltip.Constructor.prototype.isHTML($('<div></div>')), 'correctly detected html')
|
153
|
-
})
|
154
|
-
|
155
|
-
})
|
@@ -1,13 +0,0 @@
|
|
1
|
-
$(function () {
|
2
|
-
|
3
|
-
module("bootstrap-transition")
|
4
|
-
|
5
|
-
test("should be defined on jquery support object", function () {
|
6
|
-
ok($.support.transition !== undefined, 'transition object is defined')
|
7
|
-
})
|
8
|
-
|
9
|
-
test("should provide an end object", function () {
|
10
|
-
ok($.support.transition ? $.support.transition.end : true, 'end string is defined')
|
11
|
-
})
|
12
|
-
|
13
|
-
})
|
@@ -1,148 +0,0 @@
|
|
1
|
-
$(function () {
|
2
|
-
|
3
|
-
module("bootstrap-typeahead")
|
4
|
-
|
5
|
-
test("should be defined on jquery object", function () {
|
6
|
-
ok($(document.body).typeahead, 'alert method is defined')
|
7
|
-
})
|
8
|
-
|
9
|
-
test("should return element", function () {
|
10
|
-
ok($(document.body).typeahead()[0] == document.body, 'document.body returned')
|
11
|
-
})
|
12
|
-
|
13
|
-
test("should listen to an input", function () {
|
14
|
-
var $input = $('<input />')
|
15
|
-
$input.typeahead()
|
16
|
-
ok($input.data('events').blur, 'has a blur event')
|
17
|
-
ok($input.data('events').keypress, 'has a keypress event')
|
18
|
-
ok($input.data('events').keyup, 'has a keyup event')
|
19
|
-
if ($.browser.webkit || $.browser.msie) {
|
20
|
-
ok($input.data('events').keydown, 'has a keydown event')
|
21
|
-
} else {
|
22
|
-
ok($input.data('events').keydown, 'does not have a keydown event')
|
23
|
-
}
|
24
|
-
})
|
25
|
-
|
26
|
-
test("should create a menu", function () {
|
27
|
-
var $input = $('<input />')
|
28
|
-
ok($input.typeahead().data('typeahead').$menu, 'has a menu')
|
29
|
-
})
|
30
|
-
|
31
|
-
test("should listen to the menu", function () {
|
32
|
-
var $input = $('<input />')
|
33
|
-
, $menu = $input.typeahead().data('typeahead').$menu
|
34
|
-
|
35
|
-
ok($menu.data('events').mouseover, 'has a mouseover(pseudo: mouseenter)')
|
36
|
-
ok($menu.data('events').click, 'has a click')
|
37
|
-
})
|
38
|
-
|
39
|
-
test("should show menu when query entered", function () {
|
40
|
-
var $input = $('<input />').typeahead({
|
41
|
-
source: ['aa', 'ab', 'ac']
|
42
|
-
})
|
43
|
-
, typeahead = $input.data('typeahead')
|
44
|
-
|
45
|
-
$input.val('a')
|
46
|
-
typeahead.lookup()
|
47
|
-
|
48
|
-
ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
|
49
|
-
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
|
50
|
-
equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
|
51
|
-
|
52
|
-
typeahead.$menu.remove()
|
53
|
-
})
|
54
|
-
|
55
|
-
test("should not explode when regex chars are entered", function () {
|
56
|
-
var $input = $('<input />').typeahead({
|
57
|
-
source: ['aa', 'ab', 'ac', 'mdo*', 'fat+']
|
58
|
-
})
|
59
|
-
, typeahead = $input.data('typeahead')
|
60
|
-
|
61
|
-
$input.val('+')
|
62
|
-
typeahead.lookup()
|
63
|
-
|
64
|
-
ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
|
65
|
-
equals(typeahead.$menu.find('li').length, 1, 'has 1 item in menu')
|
66
|
-
equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
|
67
|
-
|
68
|
-
typeahead.$menu.remove()
|
69
|
-
})
|
70
|
-
|
71
|
-
test("should hide menu when query entered", function () {
|
72
|
-
stop()
|
73
|
-
var $input = $('<input />').typeahead({
|
74
|
-
source: ['aa', 'ab', 'ac']
|
75
|
-
})
|
76
|
-
, typeahead = $input.data('typeahead')
|
77
|
-
|
78
|
-
$input.val('a')
|
79
|
-
typeahead.lookup()
|
80
|
-
|
81
|
-
ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
|
82
|
-
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
|
83
|
-
equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
|
84
|
-
|
85
|
-
$input.blur()
|
86
|
-
|
87
|
-
setTimeout(function () {
|
88
|
-
ok(!typeahead.$menu.is(":visible"), "typeahead is no longer visible")
|
89
|
-
start()
|
90
|
-
}, 200)
|
91
|
-
|
92
|
-
typeahead.$menu.remove()
|
93
|
-
})
|
94
|
-
|
95
|
-
test("should set next item when down arrow is pressed", function () {
|
96
|
-
var $input = $('<input />').typeahead({
|
97
|
-
source: ['aa', 'ab', 'ac']
|
98
|
-
})
|
99
|
-
, typeahead = $input.data('typeahead')
|
100
|
-
|
101
|
-
$input.val('a')
|
102
|
-
typeahead.lookup()
|
103
|
-
|
104
|
-
ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
|
105
|
-
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
|
106
|
-
equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
|
107
|
-
ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active")
|
108
|
-
|
109
|
-
$input.trigger({
|
110
|
-
type: 'keydown'
|
111
|
-
, keyCode: 40
|
112
|
-
})
|
113
|
-
|
114
|
-
ok(typeahead.$menu.find('li').first().next().hasClass('active'), "second item is active")
|
115
|
-
|
116
|
-
|
117
|
-
$input.trigger({
|
118
|
-
type: 'keydown'
|
119
|
-
, keyCode: 38
|
120
|
-
})
|
121
|
-
|
122
|
-
ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active")
|
123
|
-
|
124
|
-
typeahead.$menu.remove()
|
125
|
-
})
|
126
|
-
|
127
|
-
|
128
|
-
test("should set input value to selected item", function () {
|
129
|
-
var $input = $('<input />').typeahead({
|
130
|
-
source: ['aa', 'ab', 'ac']
|
131
|
-
})
|
132
|
-
, typeahead = $input.data('typeahead')
|
133
|
-
, changed = false
|
134
|
-
|
135
|
-
$input.val('a')
|
136
|
-
typeahead.lookup()
|
137
|
-
|
138
|
-
$input.change(function() { changed = true });
|
139
|
-
|
140
|
-
$(typeahead.$menu.find('li')[2]).mouseover().click()
|
141
|
-
|
142
|
-
equals($input.val(), 'ac', 'input value was correctly set')
|
143
|
-
ok(!typeahead.$menu.is(':visible'), 'the menu was hidden')
|
144
|
-
ok(changed, 'a change event was fired')
|
145
|
-
|
146
|
-
typeahead.$menu.remove()
|
147
|
-
})
|
148
|
-
})
|