docks_app 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.editorconfig +8 -0
- data/.gitignore +22 -0
- data/.rubocop.yml +20 -0
- data/.travis.yml +10 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +35 -0
- data/Rakefile +3 -0
- data/bin/docks +5 -0
- data/config/json/docks_config.json +71 -0
- data/config/ruby/docks_config.rb +127 -0
- data/config/yaml/docks_config.yml +70 -0
- data/docks.gemspec +38 -0
- data/lib/docks/build.rb +300 -0
- data/lib/docks/cache.rb +143 -0
- data/lib/docks/command_line.rb +65 -0
- data/lib/docks/configuration.rb +217 -0
- data/lib/docks/containers/base_container.rb +103 -0
- data/lib/docks/containers/class_container.rb +39 -0
- data/lib/docks/containers/component_container.rb +92 -0
- data/lib/docks/containers/demo_container.rb +105 -0
- data/lib/docks/containers/factory_container.rb +12 -0
- data/lib/docks/containers/function_container.rb +46 -0
- data/lib/docks/containers/mixin_container.rb +19 -0
- data/lib/docks/containers/pattern_container.rb +168 -0
- data/lib/docks/containers/pattern_library_container.rb +77 -0
- data/lib/docks/containers/state_container.rb +9 -0
- data/lib/docks/containers/symbol_container.rb +77 -0
- data/lib/docks/containers/variable_container.rb +47 -0
- data/lib/docks/containers/variant_container.rb +9 -0
- data/lib/docks/containers/variation_container.rb +38 -0
- data/lib/docks/containers.rb +25 -0
- data/lib/docks/descriptor.rb +60 -0
- data/lib/docks/errors.rb +5 -0
- data/lib/docks/group.rb +66 -0
- data/lib/docks/helpers/github_helper.rb +29 -0
- data/lib/docks/helpers/path_helper.rb +94 -0
- data/lib/docks/helpers/render_helper.rb +87 -0
- data/lib/docks/helpers.rb +19 -0
- data/lib/docks/languages/base_language.rb +17 -0
- data/lib/docks/languages/coffeescript_language.rb +30 -0
- data/lib/docks/languages/common_types/markup_language.rb +71 -0
- data/lib/docks/languages/css_language.rb +13 -0
- data/lib/docks/languages/erb_language.rb +21 -0
- data/lib/docks/languages/haml_language.rb +21 -0
- data/lib/docks/languages/html_language.rb +10 -0
- data/lib/docks/languages/javascript_language.rb +42 -0
- data/lib/docks/languages/json_language.rb +18 -0
- data/lib/docks/languages/less_language.rb +33 -0
- data/lib/docks/languages/markdown_language.rb +10 -0
- data/lib/docks/languages/sass_language.rb +36 -0
- data/lib/docks/languages/slim_language.rb +21 -0
- data/lib/docks/languages/stylus_language.rb +26 -0
- data/lib/docks/languages/yaml_language.rb +18 -0
- data/lib/docks/languages.rb +103 -0
- data/lib/docks/markdown.rb +18 -0
- data/lib/docks/messenger.rb +69 -0
- data/lib/docks/naming_conventions/base_naming_convention.rb +9 -0
- data/lib/docks/naming_conventions/bem_naming_convention.rb +45 -0
- data/lib/docks/naming_conventions/suit_naming_convention.rb +45 -0
- data/lib/docks/naming_conventions.rb +21 -0
- data/lib/docks/ostruct.rb +17 -0
- data/lib/docks/parser.rb +86 -0
- data/lib/docks/parsers/base_parser.rb +128 -0
- data/lib/docks/parsers/coffeescript_parser.rb +30 -0
- data/lib/docks/parsers/css_parser.rb +27 -0
- data/lib/docks/parsers/javascript_parser.rb +30 -0
- data/lib/docks/parsers/less_parser.rb +22 -0
- data/lib/docks/parsers/sass_parser.rb +31 -0
- data/lib/docks/parsers/stylus_parser.rb +28 -0
- data/lib/docks/process.rb +60 -0
- data/lib/docks/processors.rb +416 -0
- data/lib/docks/renderers/base_renderer.rb +64 -0
- data/lib/docks/renderers/common_features/capturable.rb +69 -0
- data/lib/docks/renderers/common_features/helperable.rb +23 -0
- data/lib/docks/renderers/erb_renderer.rb +68 -0
- data/lib/docks/renderers/haml_renderer.rb +37 -0
- data/lib/docks/renderers/slim_renderer.rb +33 -0
- data/lib/docks/symbol_sources/base_symbol_source.rb +12 -0
- data/lib/docks/symbol_sources/jquery_symbol_source.rb +17 -0
- data/lib/docks/symbol_sources/mdn_symbol_source.rb +35 -0
- data/lib/docks/symbol_sources/sass_symbol_source.rb +27 -0
- data/lib/docks/symbol_sources.rb +28 -0
- data/lib/docks/tags/access_tag.rb +27 -0
- data/lib/docks/tags/activate_with_tag.rb +17 -0
- data/lib/docks/tags/active_tag.rb +14 -0
- data/lib/docks/tags/alias_tag.rb +17 -0
- data/lib/docks/tags/author_tag.rb +19 -0
- data/lib/docks/tags/base_tag.rb +52 -0
- data/lib/docks/tags/beta_tag.rb +26 -0
- data/lib/docks/tags/class_tag.rb +16 -0
- data/lib/docks/tags/compatibility_tag.rb +19 -0
- data/lib/docks/tags/demo_type_tag.rb +14 -0
- data/lib/docks/tags/deprecated_tag.rb +26 -0
- data/lib/docks/tags/description_tag.rb +99 -0
- data/lib/docks/tags/example_tag.rb +20 -0
- data/lib/docks/tags/factory_tag.rb +16 -0
- data/lib/docks/tags/for_tag.rb +23 -0
- data/lib/docks/tags/group_tag.rb +10 -0
- data/lib/docks/tags/helper_tag.rb +13 -0
- data/lib/docks/tags/include_with_tag.rb +57 -0
- data/lib/docks/tags/javascript_action_tag.rb +10 -0
- data/lib/docks/tags/link_tag.rb +18 -0
- data/lib/docks/tags/markup_tag.rb +106 -0
- data/lib/docks/tags/member_tag.rb +37 -0
- data/lib/docks/tags/method_tag.rb +18 -0
- data/lib/docks/tags/name_tag.rb +10 -0
- data/lib/docks/tags/object_tag.rb +15 -0
- data/lib/docks/tags/param_tag.rb +94 -0
- data/lib/docks/tags/pattern_tag.rb +21 -0
- data/lib/docks/tags/preclude_tag.rb +17 -0
- data/lib/docks/tags/private_tag.rb +15 -0
- data/lib/docks/tags/property_tag.rb +18 -0
- data/lib/docks/tags/public_tag.rb +15 -0
- data/lib/docks/tags/require_tag.rb +47 -0
- data/lib/docks/tags/returns_tag.rb +31 -0
- data/lib/docks/tags/set_by_tag.rb +18 -0
- data/lib/docks/tags/signature_tag.rb +35 -0
- data/lib/docks/tags/since_tag.rb +26 -0
- data/lib/docks/tags/source_tag.rb +12 -0
- data/lib/docks/tags/state_tag.rb +21 -0
- data/lib/docks/tags/static_tag.rb +14 -0
- data/lib/docks/tags/subcomponent_tag.rb +68 -0
- data/lib/docks/tags/subtitle_tag.rb +11 -0
- data/lib/docks/tags/symbol_type_tag.rb +10 -0
- data/lib/docks/tags/throws_tag.rb +30 -0
- data/lib/docks/tags/title_tag.rb +10 -0
- data/lib/docks/tags/type_tag.rb +10 -0
- data/lib/docks/tags/value_tag.rb +10 -0
- data/lib/docks/tags/variant_tag.rb +21 -0
- data/lib/docks/tags/variation_tag.rb +136 -0
- data/lib/docks/tags.rb +103 -0
- data/lib/docks/templates.rb +122 -0
- data/lib/docks/themes.rb +19 -0
- data/lib/docks/types.rb +26 -0
- data/lib/docks/version.rb +3 -0
- data/lib/docks.rb +37 -0
- data/spec/fixtures/build/scripts/bar/bar_2.js +1 -0
- data/spec/fixtures/build/scripts/bar.js +1 -0
- data/spec/fixtures/build/styles/foo/foo-2.css +1 -0
- data/spec/fixtures/build/styles/foo.css +1 -0
- data/spec/fixtures/build/templates/baz/baz_2.erb +1 -0
- data/spec/fixtures/build/templates/baz.erb +1 -0
- data/spec/fixtures/grouper/components/button/button.coffee +0 -0
- data/spec/fixtures/grouper/components/button/button.haml +0 -0
- data/spec/fixtures/grouper/components/button/button.scss +0 -0
- data/spec/fixtures/grouper/components/checkbox/_checkbox.haml +0 -0
- data/spec/fixtures/grouper/components/checkbox/_checkbox.scss +0 -0
- data/spec/fixtures/grouper/components/checkbox/checkbox.coffee +0 -0
- data/spec/fixtures/grouper/components/form/form.coffee +0 -0
- data/spec/fixtures/grouper/components/form/form.m +0 -0
- data/spec/fixtures/grouper/components/form/form.scss +0 -0
- data/spec/fixtures/grouper/components/next-expanding-textarea/_next-expanding-textarea.scss +0 -0
- data/spec/fixtures/grouper/components/next-expanding-textarea/_next_expanding_textarea.coffee +0 -0
- data/spec/fixtures/grouper/components/next-expanding-textarea/next-expanding-textarea.haml +0 -0
- data/spec/fixtures/grouper/components/next-tab/next-tab.coffee +0 -0
- data/spec/fixtures/grouper/components/next-tab/next-tab.haml +0 -0
- data/spec/fixtures/grouper/components/next-tab/next-tab.scss +0 -0
- data/spec/fixtures/grouper/components/segmented control/segmented control.coffee +0 -0
- data/spec/fixtures/grouper/components/segmented control/segmented control.haml +0 -0
- data/spec/fixtures/grouper/components/segmented control/segmented control.min.html +0 -0
- data/spec/fixtures/grouper/components/segmented control/segmented control.scss +0 -0
- data/spec/fixtures/grouper/markup/list-view.haml +0 -0
- data/spec/fixtures/grouper/markup/resizable/resizable.haml +0 -0
- data/spec/fixtures/grouper/markup/toggle.haml +0 -0
- data/spec/fixtures/grouper/scripts/resizable/resizable.coffee +0 -0
- data/spec/fixtures/grouper/scripts/toggle.coffee +0 -0
- data/spec/fixtures/grouper/style/_list-view.scss +0 -0
- data/spec/fixtures/grouper/style/_toggle.scss +0 -0
- data/spec/fixtures/languages/stub.json +3 -0
- data/spec/fixtures/languages/stub.yml +2 -0
- data/spec/fixtures/parsers/coffeescript_parser_fixture_basic.coffee +20 -0
- data/spec/fixtures/parsers/coffeescript_parser_fixture_complex.coffee +80 -0
- data/spec/fixtures/parsers/css_parser_fixture_basic.css +44 -0
- data/spec/fixtures/parsers/css_parser_fixture_complex.css +120 -0
- data/spec/fixtures/parsers/javascript_parser_fixture_basic.js +27 -0
- data/spec/fixtures/parsers/javascript_parser_fixture_complex.js +85 -0
- data/spec/fixtures/parsers/sass_parser_fixture_basic.scss +39 -0
- data/spec/fixtures/parsers/sass_parser_fixture_complex.scss +149 -0
- data/spec/fixtures/parsers/stylus_parser_fixture_basic.styl +34 -0
- data/spec/fixtures/parsers/stylus_parser_fixture_complex.styl +113 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/code_blocks.txt +10 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/headings.txt +15 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/lists.txt +21 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/lists_with_nesting.txt +13 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/multiple_paragraphs.txt +11 -0
- data/spec/fixtures/renderers/helpers.rb +37 -0
- data/spec/fixtures/renderers/html_output.html +7 -0
- data/spec/fixtures/renderers/templates/layouts/application.html.erb +0 -0
- data/spec/fixtures/renderers/templates/layouts/more/subdirectory.html.erb +0 -0
- data/spec/fixtures/renderers/templates/partials/_leading_underscore.html.erb +1 -0
- data/spec/fixtures/renderers/templates/partials/more/_subdirectory.html.erb +1 -0
- data/spec/fixtures/renderers/templates/partials/partial.html.erb +0 -0
- data/spec/fixtures/renderers/templates/partials/template.html.erb +1 -0
- data/spec/fixtures/renderers/templates/template.html.erb +1 -0
- data/spec/fixtures/tags/description/button.md +24 -0
- data/spec/fixtures/tags/description/class.md +27 -0
- data/spec/fixtures/tags/description/component.md +23 -0
- data/spec/fixtures/tags/description/function.md +30 -0
- data/spec/lib/build_spec.rb +467 -0
- data/spec/lib/cache_spec.rb +175 -0
- data/spec/lib/command_line_spec.rb +77 -0
- data/spec/lib/configuration_spec.rb +180 -0
- data/spec/lib/containers/base_container_spec.rb +214 -0
- data/spec/lib/containers/class_container_spec.rb +209 -0
- data/spec/lib/containers/component_container_spec.rb +158 -0
- data/spec/lib/containers/demo_container_spec.rb +113 -0
- data/spec/lib/containers/function_container_spec.rb +116 -0
- data/spec/lib/containers/mixin_container_spec.rb +4 -0
- data/spec/lib/containers/pattern_container_spec.rb +291 -0
- data/spec/lib/containers/pattern_library_container_spec.rb +130 -0
- data/spec/lib/containers/symbol_container_spec.rb +216 -0
- data/spec/lib/containers/variable_container_spec.rb +116 -0
- data/spec/lib/containers/variation_container_spec.rb +52 -0
- data/spec/lib/containers_spec.rb +22 -0
- data/spec/lib/descriptor_spec.rb +73 -0
- data/spec/lib/group_spec.rb +151 -0
- data/spec/lib/helpers/path_helper_spec.rb +202 -0
- data/spec/lib/helpers/render_helper_spec.rb +159 -0
- data/spec/lib/helpers_spec.rb +35 -0
- data/spec/lib/languages/base_language_spec.rb +32 -0
- data/spec/lib/languages/coffeescript_language_spec.rb +52 -0
- data/spec/lib/languages/css_language_spec.rb +13 -0
- data/spec/lib/languages/erb_language_spec.rb +33 -0
- data/spec/lib/languages/haml_language_spec.rb +32 -0
- data/spec/lib/languages/javascript_language_spec.rb +54 -0
- data/spec/lib/languages/json_language_spec.rb +24 -0
- data/spec/lib/languages/less_language_spec.rb +39 -0
- data/spec/lib/languages/markup_language_spec.rb +95 -0
- data/spec/lib/languages/sass_language_spec.rb +53 -0
- data/spec/lib/languages/slim_language_spec.rb +32 -0
- data/spec/lib/languages/stylus_language_spec.rb +34 -0
- data/spec/lib/languages/yaml_language_spec.rb +24 -0
- data/spec/lib/languages_spec.rb +127 -0
- data/spec/lib/markdown_spec.rb +63 -0
- data/spec/lib/messenger_spec.rb +1 -0
- data/spec/lib/naming_conventions/bem_naming_convention_spec.rb +112 -0
- data/spec/lib/naming_conventions/suit_naming_convention_spec.rb +107 -0
- data/spec/lib/naming_conventions_spec.rb +28 -0
- data/spec/lib/ostruct_spec.rb +15 -0
- data/spec/lib/parser_spec.rb +93 -0
- data/spec/lib/parsers/base_parser_spec.rb +128 -0
- data/spec/lib/parsers/coffeescript_parser_spec.rb +184 -0
- data/spec/lib/parsers/css_parser_spec.rb +136 -0
- data/spec/lib/parsers/javascript_parser_spec.rb +216 -0
- data/spec/lib/parsers/less_parser_spec.rb +111 -0
- data/spec/lib/parsers/sass_parser_spec.rb +233 -0
- data/spec/lib/parsers/stylus_parser_spec.rb +212 -0
- data/spec/lib/process_spec.rb +96 -0
- data/spec/lib/processors_spec.rb +555 -0
- data/spec/lib/renderers/base_renderer_spec.rb +122 -0
- data/spec/lib/renderers/common_features/helperable_spec.rb +30 -0
- data/spec/lib/renderers/erb_renderer_spec.rb +119 -0
- data/spec/lib/renderers/haml_renderer_spec.rb +103 -0
- data/spec/lib/renderers/slim_renderer_spec.rb +103 -0
- data/spec/lib/symbol_sources/jquery_symbol_source_spec.rb +25 -0
- data/spec/lib/symbol_sources/mdn_symbol_source_spec.rb +40 -0
- data/spec/lib/symbol_sources/sass_symbol_source_spec.rb +39 -0
- data/spec/lib/symbol_sources_spec.rb +19 -0
- data/spec/lib/tags/access_tag_spec.rb +32 -0
- data/spec/lib/tags/activate_with_tag_spec.rb +31 -0
- data/spec/lib/tags/active_tag_spec.rb +24 -0
- data/spec/lib/tags/alias_tag_spec.rb +31 -0
- data/spec/lib/tags/author_tag_spec.rb +172 -0
- data/spec/lib/tags/base_tag_spec.rb +21 -0
- data/spec/lib/tags/beta_tag_spec.rb +52 -0
- data/spec/lib/tags/class_tag_spec.rb +29 -0
- data/spec/lib/tags/compatibility_tag_spec.rb +159 -0
- data/spec/lib/tags/demo_type_tag_spec.rb +24 -0
- data/spec/lib/tags/deprecated_tag_spec.rb +50 -0
- data/spec/lib/tags/description_tag_spec.rb +242 -0
- data/spec/lib/tags/example_tag_spec.rb +37 -0
- data/spec/lib/tags/factory_tag_spec.rb +29 -0
- data/spec/lib/tags/for_tag_spec.rb +45 -0
- data/spec/lib/tags/group_tag_spec.rb +20 -0
- data/spec/lib/tags/helper_tag_spec.rb +22 -0
- data/spec/lib/tags/include_with_tag_spec.rb +74 -0
- data/spec/lib/tags/javascript_action_tag_spec.rb +20 -0
- data/spec/lib/tags/link_tag_spec.rb +49 -0
- data/spec/lib/tags/markup_tag_spec.rb +255 -0
- data/spec/lib/tags/member_tag_spec.rb +167 -0
- data/spec/lib/tags/method_tag_spec.rb +27 -0
- data/spec/lib/tags/name_tag_spec.rb +20 -0
- data/spec/lib/tags/object_tag_spec.rb +24 -0
- data/spec/lib/tags/param_tag_spec.rb +261 -0
- data/spec/lib/tags/pattern_tag_spec.rb +49 -0
- data/spec/lib/tags/preclude_tag_spec.rb +31 -0
- data/spec/lib/tags/private_tag_spec.rb +31 -0
- data/spec/lib/tags/property_tag_spec.rb +27 -0
- data/spec/lib/tags/public_tag_spec.rb +29 -0
- data/spec/lib/tags/require_tag_spec.rb +133 -0
- data/spec/lib/tags/returns_tag_spec.rb +85 -0
- data/spec/lib/tags/set_by_tag_spec.rb +92 -0
- data/spec/lib/tags/signature_tag_spec.rb +125 -0
- data/spec/lib/tags/since_tag_spec.rb +48 -0
- data/spec/lib/tags/state_tag_spec.rb +199 -0
- data/spec/lib/tags/static_tag_spec.rb +27 -0
- data/spec/lib/tags/subcomponent_tag_spec.rb +78 -0
- data/spec/lib/tags/subtitle_tag_spec.rb +13 -0
- data/spec/lib/tags/symbol_type_tag_spec.rb +20 -0
- data/spec/lib/tags/throws_tag_spec.rb +49 -0
- data/spec/lib/tags/title_tag_spec.rb +20 -0
- data/spec/lib/tags/type_tag_spec.rb +20 -0
- data/spec/lib/tags/value_tag_spec.rb +20 -0
- data/spec/lib/tags/variant_tag_spec.rb +13 -0
- data/spec/lib/tags/variation_tag_spec.rb +154 -0
- data/spec/lib/tags_spec.rb +264 -0
- data/spec/lib/templates_spec.rb +185 -0
- data/spec/lib/themes_spec.rb +32 -0
- data/spec/spec_helper.rb +34 -0
- data/tasks/rspec.rake +7 -0
- data/tasks/rubocop.rake +8 -0
- metadata +740 -0
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
defaults =
|
2
|
+
#*
|
3
|
+
# Determines what action will be taken on the original footnote markup: `"hide"` (using `display: none;`), `"delete"`, or `"ignore"` (leaves the original content in place). This action will also be taken on any elements containing the footnote if they are now empty.
|
4
|
+
#
|
5
|
+
# @access public
|
6
|
+
# @author Chris Sauve
|
7
|
+
# @since 0.0.1
|
8
|
+
# @returns {String}
|
9
|
+
# @default "hide"
|
10
|
+
actionOriginalFN : "hide"
|
11
|
+
|
12
|
+
#*
|
13
|
+
# Specifies a function to call on a footnote popover that is being instantiated (before it is added to the DOM). The function will be passed two arguments: `$popover`, which is a jQuery object containing the new popover element, and `$button`, the button that was cblicked to instantiate the popover. This option can be useful for adding additional classes or styling information before a popover appears.
|
14
|
+
#
|
15
|
+
# @access public
|
16
|
+
# @author Chris Sauve
|
17
|
+
# @since 0.0.1
|
18
|
+
# @type {Function}
|
19
|
+
# @default function() {}
|
20
|
+
activateCallback : () -> return
|
@@ -0,0 +1,80 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
#*
|
4
|
+
# @pattern Bigfoot
|
5
|
+
|
6
|
+
# The best footnote plugin around.
|
7
|
+
|
8
|
+
#*
|
9
|
+
# Groups the ID and HREF of a superscript/ anchor tag pair in data attributes.
|
10
|
+
# This resolves the issue of the href and backlink id being separated between the two elements.
|
11
|
+
|
12
|
+
# @param {jQuery} $footnoteAnchors - Anchors that link to footnotes.
|
13
|
+
# @param {Array} footnoteLinks ([]) - An array on which the new anchors will be pushed.
|
14
|
+
|
15
|
+
# @returns {undefined}
|
16
|
+
|
17
|
+
cleanFootnoteLinks = ($footnoteAnchors, footnoteLinks = []) ->
|
18
|
+
$parent = undefined
|
19
|
+
$supChild = undefined
|
20
|
+
linkHREF = undefined
|
21
|
+
linkID = undefined
|
22
|
+
|
23
|
+
# Problem: backlink ID might point to containing superscript of the fn link
|
24
|
+
# Solution: Check if there is a superscript and move the href/ ID up to it.
|
25
|
+
# The combined id/ href of the sup/a pair are stored in sup using data attributes
|
26
|
+
$footnoteAnchors.each ->
|
27
|
+
$this = $(this)
|
28
|
+
linkHREF = "#" + ($this.attr("href")).split("#")[1] # just the fragment ID
|
29
|
+
$parent = $this.closest(settings.anchorParentTagsname)
|
30
|
+
$child = $this.find(settings.anchorParentTagsname)
|
31
|
+
|
32
|
+
defaults =
|
33
|
+
#*
|
34
|
+
# Determines what action will be taken on the original footnote markup: `"hide"` (using `display: none;`), `"delete"`, or `"ignore"` (leaves the original content in place). This action will also be taken on any elements containing the footnote if they are now empty.
|
35
|
+
#
|
36
|
+
# @access public
|
37
|
+
# @default "hide"
|
38
|
+
actionOriginalFN : "hide"
|
39
|
+
|
40
|
+
#*
|
41
|
+
# Specifies a function to call on a footnote popover that is being instantiated (before it is added to the DOM). The function will be passed two arguments: `$popover`, which is a jQuery object containing the new popover element, and `$button`, the button that was cblicked to instantiate the popover. This option can be useful for adding additional classes or styling information before a popover appears.
|
42
|
+
#
|
43
|
+
# @default function() {}
|
44
|
+
activateCallback : () -> return
|
45
|
+
|
46
|
+
#*
|
47
|
+
# Footnote button/ content initializer (run on doc.ready).
|
48
|
+
# Finds the likely footnote links and then uses their target to find the content.
|
49
|
+
#
|
50
|
+
# @returns {undefined}
|
51
|
+
|
52
|
+
footnoteInit = ->
|
53
|
+
# Get all of the possible footnote links
|
54
|
+
footnoteButtonSearchQuery = if settings.scope
|
55
|
+
"#{settings.scope} a[href*=\"#\"]"
|
56
|
+
else
|
57
|
+
"a[href*=\"#\"]"
|
58
|
+
|
59
|
+
# Filter down to links that:
|
60
|
+
# - have an HREF referencing a footnote, OR
|
61
|
+
# - have a rel attribute of footnote
|
62
|
+
# - aren't a descendant of a footnote (prevents backlinks)
|
63
|
+
$footnoteAnchors = $(footnoteButtonSearchQuery).filter ->
|
64
|
+
$this = $(this)
|
65
|
+
relAttr = $this.attr "rel"
|
66
|
+
relAttr = "" if relAttr == "null" || !relAttr?
|
67
|
+
"#{$this.attr "href"}#{relAttr}".match(settings.anchorPattern) && $this.closest("[class*=#{settings.footnoteParentClass}]:not(a):not(#{settings.anchorParentTagsname})").length < 1
|
68
|
+
|
69
|
+
#*
|
70
|
+
# Removes any links from the footnote back to the footnote link as these don't make sense when the footnote is shown inline
|
71
|
+
#
|
72
|
+
# @param {String} footnoteHTML - The string version of the new footnote.
|
73
|
+
# @param {String} backlinkID - The ID of the footnote link (that is to be removed from the footnote HTML).
|
74
|
+
#
|
75
|
+
# @returns {String} - The new HTML string with the relevant links taken out.
|
76
|
+
|
77
|
+
removeBackLinks = (footnoteHTML, backlinkID) ->
|
78
|
+
# First, though, take care of multiple ID's by getting rid of spaces
|
79
|
+
backlinkID = backlinkID.trim().replace(/\s+/g, "|")
|
80
|
+
.replace(/(.*)/g, "($1)") if backlinkID.indexOf(' ') >= 0
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/**
|
2
|
+
|
3
|
+
* A simple button. Nice.
|
4
|
+
|
5
|
+
* Lorem ipsum dolor sit amet, consectetur adipisicing elit.
|
6
|
+
* Aliquam expedita repellendus magnam similique eum assumenda velit doloribus omnis labore debitis. Molestiae debitis soluta earum minima maxime inventore aperiam, et omnis.
|
7
|
+
|
8
|
+
*/
|
9
|
+
|
10
|
+
.button {
|
11
|
+
cursor: pointer;
|
12
|
+
display: inline-block;
|
13
|
+
height: 32px;
|
14
|
+
line-height: 30px;
|
15
|
+
}
|
16
|
+
|
17
|
+
.button:hover,
|
18
|
+
.button:focus {
|
19
|
+
background: #efefef; /* slightly different on hover/ focus */
|
20
|
+
}
|
21
|
+
|
22
|
+
|
23
|
+
/**
|
24
|
+
* A button that is indicating the loading of content.
|
25
|
+
*
|
26
|
+
* @demo_type joint
|
27
|
+
* @set_by :loading?
|
28
|
+
*/
|
29
|
+
|
30
|
+
.button--is-loading {
|
31
|
+
}
|
32
|
+
|
33
|
+
/* Don't do this for disabled buttons */
|
34
|
+
.button--is-loading:not(.button--is-disabled) {
|
35
|
+
color: transparent;
|
36
|
+
cursor: default;
|
37
|
+
background-repeat: no-repeat;
|
38
|
+
background-position: center center;
|
39
|
+
}
|
40
|
+
|
41
|
+
.button--is-loading:not(.button--is-disabled):hover,
|
42
|
+
.button--is-loading:not(.button--is-disabled):focus {
|
43
|
+
background-color: #fcfcfc;
|
44
|
+
}
|
@@ -0,0 +1,120 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* @pattern Buttons
|
4
|
+
* @tagline Those sweet, sweet clicks.
|
5
|
+
* @since 1.0
|
6
|
+
*/
|
7
|
+
|
8
|
+
/**
|
9
|
+
* A simple button. Nice.
|
10
|
+
*
|
11
|
+
* Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam expedita repellendus magnam similique eum assumenda velit doloribus omnis labore debitis. Molestiae debitis soluta earum minima maxime inventore aperiam, et omnis.
|
12
|
+
*
|
13
|
+
* @variant --primary (demo type: joint, set by: :primary?)
|
14
|
+
* @variant --destroy (demo type: joint, set by: :destroy?) - This button indicates that you want to remove something.
|
15
|
+
* @variant --destroy-no-hover (demo type: joint)
|
16
|
+
* @variant --icon (demo type: hidden)
|
17
|
+
* @variant --large (demo type: select, set by: :size (SIZE_LARGE)) - A much larger button for special situations.
|
18
|
+
* @variant --plain (demo type: select, precludes: --is-disabled, set by: :plain?)
|
19
|
+
*/
|
20
|
+
|
21
|
+
.button {
|
22
|
+
cursor: pointer;
|
23
|
+
display: inline-block;
|
24
|
+
height: 32px;
|
25
|
+
line-height: 30px;
|
26
|
+
}
|
27
|
+
|
28
|
+
/**
|
29
|
+
* A button that is indicating the loading of content.
|
30
|
+
*
|
31
|
+
* @demo_type joint
|
32
|
+
* @set_by :loading? */
|
33
|
+
|
34
|
+
.button--is-loading {
|
35
|
+
/* Don't do this for disabled buttons */
|
36
|
+
color: transparent;
|
37
|
+
cursor: default;
|
38
|
+
background-repeat: no-repeat;
|
39
|
+
background-position: center center;
|
40
|
+
}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* @precludes .button--large
|
44
|
+
* @demo_type select
|
45
|
+
* @set_by NextButton#resize, :size (SIZE_SLIM)
|
46
|
+
*/
|
47
|
+
|
48
|
+
.button--slim {
|
49
|
+
height: 28px;
|
50
|
+
line-height: 26px;
|
51
|
+
}
|
52
|
+
|
53
|
+
.button--plain {
|
54
|
+
background: transparent;
|
55
|
+
border: none;
|
56
|
+
}
|
57
|
+
|
58
|
+
/**
|
59
|
+
* A button that can't be activated. In order for this button to
|
60
|
+
* function correctly, both the class and the disabled attribute
|
61
|
+
* must be placed on the button.
|
62
|
+
|
63
|
+
* For example, the following will produce a button that *looks* disabled,
|
64
|
+
* but that is still clickable:
|
65
|
+
|
66
|
+
* ```html
|
67
|
+
* <button class="button button--is-disabled">Not really disabled button</button>
|
68
|
+
* ```
|
69
|
+
|
70
|
+
* But this one creates an appropriately unclickable button:
|
71
|
+
|
72
|
+
* ```html_demo
|
73
|
+
* <button class="button button--is-disabled" disabled="disabled">Really disabled!</button>
|
74
|
+
* ```
|
75
|
+
|
76
|
+
* @demo_type select
|
77
|
+
* @javascript_action $(this).addClass('button--is-disabled').attr('disabled', true)
|
78
|
+
* @set_by :disabled?
|
79
|
+
* @precludes button--is-loading
|
80
|
+
*/
|
81
|
+
|
82
|
+
.button--is-disabled,
|
83
|
+
.button--is-disabled:hover,
|
84
|
+
.button--is-disabled:focus {
|
85
|
+
color: #999;
|
86
|
+
border-color: #e3e3e3;
|
87
|
+
background: #fcfcfc;
|
88
|
+
}
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Two or more buttons that control the same function.
|
94
|
+
|
95
|
+
* @title Segmented Button Group
|
96
|
+
* @demo_type own
|
97
|
+
*/
|
98
|
+
|
99
|
+
.button__segmented-group {
|
100
|
+
display: flex;
|
101
|
+
}
|
102
|
+
|
103
|
+
/* Adjusts details for buttons that are part of the
|
104
|
+
button group. */
|
105
|
+
|
106
|
+
.button__segmented-group .button {
|
107
|
+
display: block;
|
108
|
+
flex: 0 1 auto;
|
109
|
+
margin: 0;
|
110
|
+
}
|
111
|
+
|
112
|
+
|
113
|
+
/* A segmented group that spans the entire container.
|
114
|
+
@demo_type select */
|
115
|
+
|
116
|
+
.button__segmented-group--full-width {
|
117
|
+
.button {
|
118
|
+
flex: 1 1 auto;
|
119
|
+
}
|
120
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
var defaults = {
|
2
|
+
//*
|
3
|
+
// Determines what action will be taken on the original footnote markup: `"hide"` (using `display: none;`), `"delete"`, or `"ignore"` (leaves the original content in place). This action will also be taken on any elements containing the footnote if they are now empty.
|
4
|
+
//
|
5
|
+
// @access public
|
6
|
+
// @author Chris Sauve
|
7
|
+
// @since 0.0.1
|
8
|
+
// @returns {String}
|
9
|
+
// @default "hide"
|
10
|
+
actionOriginalFN: "hide",
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Specifies a function to call on a footnote popover that is being instantiated
|
14
|
+
* (before it is added to the DOM). The function will be passed two arguments:
|
15
|
+
* `$popover`, which is a jQuery object containing the new popover element, and
|
16
|
+
* `$button`, the button that was cblicked to instantiate the popover. This
|
17
|
+
* option can be useful for adding additional classes or styling information
|
18
|
+
* before a popover appears.
|
19
|
+
*
|
20
|
+
* @access public
|
21
|
+
* @author Chris Sauve
|
22
|
+
* @since 0.0.1
|
23
|
+
* @type {Function}
|
24
|
+
* @default function() {}
|
25
|
+
*/
|
26
|
+
activateCallback: function() {}
|
27
|
+
};
|
@@ -0,0 +1,85 @@
|
|
1
|
+
|
2
|
+
//*
|
3
|
+
// @pattern Bigfoot
|
4
|
+
|
5
|
+
// The best footnote plugin around.
|
6
|
+
|
7
|
+
//*
|
8
|
+
// Groups the ID and HREF of a superscript/ anchor tag pair in data attributes.
|
9
|
+
// This resolves the issue of the href and backlink id being separated between the two elements.
|
10
|
+
|
11
|
+
// @param {jQuery} $footnoteAnchors - Anchors that link to footnotes.
|
12
|
+
// @param {Array} footnoteLinks ([]) - An array on which the new anchors will be pushed.
|
13
|
+
|
14
|
+
// @returns {undefined}
|
15
|
+
|
16
|
+
function cleanFootnoteLinks($footnoteAnchors, footnoteLinks) {
|
17
|
+
$parent = undefined;
|
18
|
+
$supChild = undefined;
|
19
|
+
linkHREF = undefined;
|
20
|
+
linkID = undefined;
|
21
|
+
|
22
|
+
// Problem: backlink ID might point to containing superscript of the fn link
|
23
|
+
// Solution: Check if there is a superscript and move the href/ ID up to it.
|
24
|
+
// The combined id/ href of the sup/a pair are stored in sup using data attributes
|
25
|
+
$footnoteAnchors.each(function() {
|
26
|
+
$this = $(this);
|
27
|
+
linkHREF = "#" + ($this.attr("href")).split("#")[1]; // just the fragment ID
|
28
|
+
$parent = $this.closest(settings.anchorParentTagsname);
|
29
|
+
$child = $this.find(settings.anchorParentTagsname);
|
30
|
+
});
|
31
|
+
};
|
32
|
+
|
33
|
+
defaults = {
|
34
|
+
//*
|
35
|
+
// Determines what action will be taken on the original footnote markup: `"hide"` (using `display: none;`), `"delete"`, or `"ignore"` (leaves the original content in place). This action will also be taken on any elements containing the footnote if they are now empty.
|
36
|
+
//
|
37
|
+
// @access public
|
38
|
+
// @default "hide"
|
39
|
+
actionOriginalFN: "hide",
|
40
|
+
|
41
|
+
//*
|
42
|
+
// Specifies a function to call on a footnote popover that is being instantiated (before it is added to the DOM). The function will be passed two arguments: `$popover`, which is a jQuery object containing the new popover element, and `$button`, the button that was cblicked to instantiate the popover. This option can be useful for adding additional classes or styling information before a popover appears.
|
43
|
+
//
|
44
|
+
// @default function() {}
|
45
|
+
activateCallback: function() {}
|
46
|
+
};
|
47
|
+
|
48
|
+
//*
|
49
|
+
// Footnote button/ content initializer (run on doc.ready).
|
50
|
+
// Finds the likely footnote links and then uses their target to find the content.
|
51
|
+
//
|
52
|
+
// @returns {undefined}
|
53
|
+
|
54
|
+
function footnoteInit() {
|
55
|
+
// Get all of the possible footnote links
|
56
|
+
footnoteButtonSearchQuery = settings.scope ? "#{settings.scope} a[href*=\"#\"]" : "a[href*=\"#\"]";
|
57
|
+
|
58
|
+
// Filter down to links that:
|
59
|
+
// - have an HREF referencing a footnote, OR
|
60
|
+
// - have a rel attribute of footnote
|
61
|
+
// - aren't a descendant of a footnote (prevents backlinks)
|
62
|
+
$footnoteAnchors = $(footnoteButtonSearchQuery).filter(function() {
|
63
|
+
$this = $(this);
|
64
|
+
relAttr = $this.attr("rel");
|
65
|
+
if(relAttr == "null" || !relAttr) { relAttr = "" }
|
66
|
+
|
67
|
+
("" + $this.attr("href") + relAttr).match(settings.anchorPattern) && $this.closest("[class*=" + settings.footnoteParentClass + "]:not(a):not(" + settings.anchorParentTagsname + ")").length < 1
|
68
|
+
|
69
|
+
//*
|
70
|
+
// Removes any links from the footnote back to the footnote link as these don't make sense when the footnote is shown inline
|
71
|
+
//
|
72
|
+
// @param {String} footnoteHTML - The string version of the new footnote.
|
73
|
+
// @param {String} backlinkID - The ID of the footnote link (that is to be removed from the footnote HTML).
|
74
|
+
//
|
75
|
+
// @returns {String} - The new HTML string with the relevant links taken out.
|
76
|
+
|
77
|
+
function removeBackLinks(footnoteHTML, backlinkID) {
|
78
|
+
// First, though, take care of multiple ID's by getting rid of spaces
|
79
|
+
if(backlinkID.indexOf(" ") >= 0) {
|
80
|
+
backlinkID = backlinkID.trim().replace(/\s+/g, "|")
|
81
|
+
.replace(/(.*)/g, "($1)");
|
82
|
+
}
|
83
|
+
}
|
84
|
+
});
|
85
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
//*
|
2
|
+
// A simple button. Nice.
|
3
|
+
//
|
4
|
+
// Lorem ipsum dolor sit amet, consectetur adipisicing elit.
|
5
|
+
// Aliquam expedita repellendus magnam similique eum assumenda velit doloribus omnis labore debitis.
|
6
|
+
// Molestiae debitis soluta earum minima maxime inventore aperiam, et omnis.
|
7
|
+
|
8
|
+
.button {
|
9
|
+
cursor: pointer;
|
10
|
+
display: inline-block;
|
11
|
+
height: 32px;
|
12
|
+
line-height: 30px;
|
13
|
+
|
14
|
+
&:hover,
|
15
|
+
&:focus {
|
16
|
+
background: #efefef; // slightly different on hover/ focus
|
17
|
+
}
|
18
|
+
|
19
|
+
//*
|
20
|
+
// A button that is indicating the loading of content.
|
21
|
+
//
|
22
|
+
// @demo_type joint
|
23
|
+
// @set_by :loading?
|
24
|
+
|
25
|
+
&.button--is-loading {
|
26
|
+
// Don't do this for disabled buttons
|
27
|
+
&:not(.button--is-disabled) {
|
28
|
+
color: transparent;
|
29
|
+
cursor: default;
|
30
|
+
background-repeat: no-repeat;
|
31
|
+
background-position: center center;
|
32
|
+
|
33
|
+
&:hover,
|
34
|
+
&:focus {
|
35
|
+
background-color: #fcfcfc;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,149 @@
|
|
1
|
+
//*
|
2
|
+
// @pattern Buttons
|
3
|
+
// @tagline Those sweet, sweet clicks.
|
4
|
+
// @since 1.0
|
5
|
+
|
6
|
+
.foo {}
|
7
|
+
|
8
|
+
/**
|
9
|
+
* A simple button. Nice.
|
10
|
+
*
|
11
|
+
* Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam expedita repellendus magnam similique eum assumenda velit doloribus omnis labore debitis. Molestiae debitis soluta earum minima maxime inventore aperiam, et omnis.
|
12
|
+
*
|
13
|
+
* @variant --primary (demo type: joint, set by: :primary?)
|
14
|
+
* @variant --destroy (demo type: joint, set by: :destroy?) - This button indicates that you want to remove something.
|
15
|
+
* @variant --destroy-no-hover (demo type: joint)
|
16
|
+
* @variant --icon (demo type: hidden)
|
17
|
+
* @variant --large (demo type: select, set by: :size (SIZE_LARGE)) - A much larger button for special situations.
|
18
|
+
* @variant --plain (demo type: select, precludes: --is-disabled, set by: :plain?)
|
19
|
+
*/
|
20
|
+
|
21
|
+
.button {
|
22
|
+
cursor: pointer;
|
23
|
+
display: inline-block;
|
24
|
+
height: 32px;
|
25
|
+
line-height: 30px;
|
26
|
+
|
27
|
+
&:hover,
|
28
|
+
&:focus {
|
29
|
+
background: #efefef; // slightly different on hover/ focus
|
30
|
+
}
|
31
|
+
|
32
|
+
//*
|
33
|
+
// A button that is indicating the loading of content.
|
34
|
+
//
|
35
|
+
// @demo_type joint
|
36
|
+
// @set_by :loading?
|
37
|
+
|
38
|
+
&.button--is-loading {
|
39
|
+
// Don't do this for disabled buttons
|
40
|
+
&:not(.button--is-disabled) {
|
41
|
+
color: transparent;
|
42
|
+
cursor: default;
|
43
|
+
background-repeat: no-repeat;
|
44
|
+
background-position: center center;
|
45
|
+
|
46
|
+
&:hover,
|
47
|
+
&:focus {
|
48
|
+
background-color: #fcfcfc;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
//*
|
55
|
+
// @precludes .button--large
|
56
|
+
// @demo_type select
|
57
|
+
// @set_by NextButton#resize, :size (SIZE_SLIM)
|
58
|
+
|
59
|
+
.button--slim {
|
60
|
+
height: 28px;
|
61
|
+
line-height: 26px;
|
62
|
+
}
|
63
|
+
|
64
|
+
.button--plain {
|
65
|
+
background: transparent;
|
66
|
+
border: none;
|
67
|
+
}
|
68
|
+
|
69
|
+
//*
|
70
|
+
// A button that can't be activated. In order for this button to
|
71
|
+
// function correctly, both the class and the disabled attribute
|
72
|
+
// must be placed on the button.
|
73
|
+
|
74
|
+
// For example, the following will produce a button that *looks* disabled,
|
75
|
+
// but that is still clickable:
|
76
|
+
|
77
|
+
// ```html
|
78
|
+
// <button class="button button--is-disabled">Not really disabled button</button>
|
79
|
+
// ```
|
80
|
+
|
81
|
+
// But this one creates an appropriately unclickable button:
|
82
|
+
|
83
|
+
// ```html_demo
|
84
|
+
// <button class="button button--is-disabled" disabled="disabled">Really disabled!</button>
|
85
|
+
// ```
|
86
|
+
|
87
|
+
// @demo_type select
|
88
|
+
// @javascript_action $(this).addClass('button--is-disabled').attr('disabled', true)
|
89
|
+
// @set_by :disabled?
|
90
|
+
// @precludes button--is-loading
|
91
|
+
|
92
|
+
.button--is-disabled {
|
93
|
+
&,
|
94
|
+
&:hover,
|
95
|
+
&:focus {
|
96
|
+
color: #999;
|
97
|
+
border-color: #e3e3e3;
|
98
|
+
background: #fcfcfc;
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
//*
|
105
|
+
// Two or more buttons that control the same function.
|
106
|
+
|
107
|
+
// @title Segmented Button Group
|
108
|
+
// @demo_type own
|
109
|
+
|
110
|
+
.button__segmented-group {
|
111
|
+
display: flex;
|
112
|
+
|
113
|
+
.button {
|
114
|
+
display: block;
|
115
|
+
flex: 0 1 auto;
|
116
|
+
margin: 0;
|
117
|
+
|
118
|
+
// Adjusts details for buttons that are part of the
|
119
|
+
// button group.
|
120
|
+
&:not(:first-of-type) {
|
121
|
+
margin-left: -1px;
|
122
|
+
}
|
123
|
+
|
124
|
+
&:first-of-type {
|
125
|
+
border-top-right-radius: 0;
|
126
|
+
border-bottom-right-radius: 0;
|
127
|
+
}
|
128
|
+
|
129
|
+
&:last-of-type {
|
130
|
+
border-top-left-radius: 0;
|
131
|
+
border-bottom-left-radius: 0;
|
132
|
+
}
|
133
|
+
|
134
|
+
&:not(:last-of-type):not(:first-of-type) {
|
135
|
+
border-radius: 0;
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
|
141
|
+
// A segmented group that spans the entire container.
|
142
|
+
|
143
|
+
// @demo_type select
|
144
|
+
|
145
|
+
.button__segmented-group--full-width {
|
146
|
+
.button {
|
147
|
+
flex: 1 1 auto;
|
148
|
+
}
|
149
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
//*
|
2
|
+
// A simple button. Nice.
|
3
|
+
//
|
4
|
+
// Lorem ipsum dolor sit amet, consectetur adipisicing elit.
|
5
|
+
// Aliquam expedita repellendus magnam similique eum assumenda velit doloribus omnis labore debitis.
|
6
|
+
// Molestiae debitis soluta earum minima maxime inventore aperiam, et omnis.
|
7
|
+
|
8
|
+
.button
|
9
|
+
cursor: pointer
|
10
|
+
display: inline-block
|
11
|
+
height: 32px
|
12
|
+
line-height: 30px
|
13
|
+
|
14
|
+
&:hover,
|
15
|
+
&:focus
|
16
|
+
background: #efefef // slightly different on hover/ focus
|
17
|
+
|
18
|
+
//*
|
19
|
+
// A button that is indicating the loading of content.
|
20
|
+
//
|
21
|
+
// @demo_type joint
|
22
|
+
// @set_by :loading?
|
23
|
+
|
24
|
+
&.button--is-loading
|
25
|
+
// Don't do this for disabled buttons
|
26
|
+
&:not(.button--is-disabled)
|
27
|
+
color: transparent
|
28
|
+
cursor: default
|
29
|
+
background-repeat: no-repeat
|
30
|
+
background-position: center center
|
31
|
+
|
32
|
+
&:hover,
|
33
|
+
&:focus
|
34
|
+
background-color: #fcfcfc
|