From 965051f0fc8859422ddcc5cc11af7b9a1be7c6dc Mon Sep 17 00:00:00 2001 From: Gorka Laucirica Date: Fri, 21 Jul 2017 20:11:38 +0200 Subject: [PATCH 01/11] Renderer concept - Added "Renderer" concept to increase maintainability and extensibility - Refactored IndexController to make use of the new renderers - Added the following renderers: - Colors - Homepage - Iconography - Twig - Typography - Refactored templates to allow new renderer usage - Changed test application to adapt to new config --- .../Controller/IndexController.php | 59 ++++++------------- .../Loader/StyleguideConfigLoader.php | 18 +++--- .../PatternLibraryBuilder/Renderer/Colors.php | 24 ++++++++ .../Renderer/Homepage.php | 24 ++++++++ .../Renderer/Iconography.php | 23 ++++++++ .../Renderer/Renderer.php | 10 ++++ .../Renderer/RendererRegistry.php | 23 ++++++++ .../PatternLibraryBuilder/Renderer/Twig.php | 52 ++++++++++++++++ .../Renderer/Typography.php | 24 ++++++++ .../templates/components/preview.html.twig | 2 +- .../tabbed_architecture.html.twig | 4 +- .../templates/layouts/article.html.twig | 2 +- .../templates/pages/architecture.html.twig | 7 --- .../Resources/templates/pages/home.html.twig | 14 ----- .../templates/pages/iconography.html.twig | 5 -- .../templates/pages/iframe.html.twig | 2 +- .../templates/pattern_library.html.twig | 3 +- .../templates/renderers/colors.html.twig | 6 ++ .../templates/renderers/homepage.html.twig | 13 ++++ .../iconography.html.twig} | 0 .../templates/renderers/twig.html.twig | 39 ++++++++++++ .../templates/renderers/typography.html.twig | 10 ++++ .../Symfony/Resources/config/services.xml | 34 ++++++++++- .../architecture/atoms/button.yml | 22 +++---- .../architecture/atoms/link.yml | 14 +++-- .../architecture/components/icon-card.yml | 14 +++-- .../PatternLibrary/homepage/index.yml | 17 ++++++ .../PatternLibrary/style-guide/colors.yml | 11 ++++ .../style-guide/iconography.yml | 5 +- .../PatternLibrary/style-guide/typography.yml | 22 +++++++ 30 files changed, 395 insertions(+), 108 deletions(-) create mode 100644 src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php create mode 100644 src/LIN3S/PatternLibraryBuilder/Renderer/Homepage.php create mode 100644 src/LIN3S/PatternLibraryBuilder/Renderer/Iconography.php create mode 100644 src/LIN3S/PatternLibraryBuilder/Renderer/Renderer.php create mode 100644 src/LIN3S/PatternLibraryBuilder/Renderer/RendererRegistry.php create mode 100644 src/LIN3S/PatternLibraryBuilder/Renderer/Twig.php create mode 100644 src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php delete mode 100644 src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/architecture.html.twig delete mode 100644 src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/home.html.twig delete mode 100644 src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/iconography.html.twig create mode 100644 src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/colors.html.twig create mode 100644 src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/homepage.html.twig rename src/LIN3S/PatternLibraryBuilder/Resources/templates/{layouts/iconography_content.html.twig => renderers/iconography.html.twig} (100%) create mode 100644 src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/twig.html.twig create mode 100644 src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/typography.html.twig create mode 100644 tests/Application/src/App/Resources/PatternLibrary/homepage/index.yml create mode 100644 tests/Application/src/App/Resources/PatternLibrary/style-guide/colors.yml create mode 100644 tests/Application/src/App/Resources/PatternLibrary/style-guide/typography.yml diff --git a/src/LIN3S/PatternLibraryBuilder/Controller/IndexController.php b/src/LIN3S/PatternLibraryBuilder/Controller/IndexController.php index 54e70e0..db20e29 100644 --- a/src/LIN3S/PatternLibraryBuilder/Controller/IndexController.php +++ b/src/LIN3S/PatternLibraryBuilder/Controller/IndexController.php @@ -14,6 +14,7 @@ namespace LIN3S\PatternLibraryBuilder\Controller; use LIN3S\PatternLibraryBuilder\Loader\StyleguideConfigLoader; +use LIN3S\PatternLibraryBuilder\Renderer\RendererRegistry; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -25,69 +26,43 @@ class IndexController { private $loader; + private $rendererRegistry; private $twig; - private $twigFile; public function __construct( StyleguideConfigLoader $loader, - \Twig_Environment $twig, - string $twigFile = '@Lin3sPatternLibraryBuilder/pages/architecture.html.twig' + RendererRegistry $rendererRegistry, + \Twig_Environment $twig ) { $this->loader = $loader; + $this->rendererRegistry = $rendererRegistry; $this->twig = $twig; - $this->twigFile = $twigFile; } public function __invoke(Request $request, string $slug = '') : Response { if (!$slug) { - return $this->renderHomepage(); + $slug = 'homepage/index'; } - $itemConfig = $this->loader->get($slug); - if (!$itemConfig) { + $item = $this->loader->get($slug); + if (!$item) { throw new NotFoundHttpException(); } - $media = $request->query->get('media'); - if ($media) { - $paramsId = $request->query->get('id'); + $renderer = $this->rendererRegistry->get($item['renderer']['type']); - return $this->renderIFrame($media, $itemConfig, $paramsId); - } - - return $this->renderItemPage($itemConfig, $slug); - } - - private function renderHomepage() : Response - { - return new Response( - $this->twig->render('@Lin3sPatternLibraryBuilder/pages/home.html.twig', [ - 'menu' => $this->loader->allInHierarchy(), - ]) - ); - } + $content = $renderer->renderFull($item); - private function renderIFrame($media, $item, $paramsId) : Response - { - return new Response($this->twig->render( - sprintf('@Lin3sPatternLibraryBuilder/pages/iframe/%s.html.twig', $media), [ - 'item' => $item, - 'params_id' => $paramsId, - ] - )); - } - - private function renderItemPage($item, string $slug) : Response - { - $twigTemplate = isset($item['template']) - ? '@Lin3sPatternLibraryBuilder/pages/' . $item['template'] . '.html.twig' - : $this->twigFile; + if($request->query->has('content_only')) { + return new Response($content); + } - return new Response($this->twig->render($twigTemplate, [ - 'item' => $item, - 'menu' => $this->loader->allInHierarchy(), + return new Response($this->twig->render('@Lin3sPatternLibraryBuilder/pattern_library.html.twig', [ + 'menu' => $this->loader->allInHierarchy(), 'breadcrumbs' => $this->generateBreadcrumbs($slug), + 'content' => $content, + 'item' => $item ])); } diff --git a/src/LIN3S/PatternLibraryBuilder/Loader/StyleguideConfigLoader.php b/src/LIN3S/PatternLibraryBuilder/Loader/StyleguideConfigLoader.php index eb79d2e..a22c2a2 100644 --- a/src/LIN3S/PatternLibraryBuilder/Loader/StyleguideConfigLoader.php +++ b/src/LIN3S/PatternLibraryBuilder/Loader/StyleguideConfigLoader.php @@ -30,22 +30,22 @@ public function __construct(string $itemsPath, string $prefixPath = '/design-sys $this->config = $this->loadConfig(); } - public function allInHierarchy() : array + public function allInHierarchy(): array { return $this->config; } - public function allInPlain() : array + public function allInPlain(): array { return $this->findAllItemsRecursively($this->config); } - public function get(string $slug) : array + public function get(string $slug): ?array { return $this->findBySlugRecursively($slug, $this->config)['config']; } - private function findBySlugRecursively(string $slug, array $config) : ?array + private function findBySlugRecursively(string $slug, array $config): ?array { foreach ($config as $child) { if (isset($child['slug'])) { @@ -65,7 +65,7 @@ private function findBySlugRecursively(string $slug, array $config) : ?array return null; } - private function findAllItemsRecursively(array $config, array $items = []) : array + private function findAllItemsRecursively(array $config, array $items = []): array { foreach ($config as $child) { if (isset($child['config'])) { @@ -80,7 +80,7 @@ private function findAllItemsRecursively(array $config, array $items = []) : arr return $items; } - private function loadConfig() : array + private function loadConfig(): array { $finder = new Finder(); $dir = $finder->directories()->in($this->itemsPath)->depth(0); @@ -89,7 +89,7 @@ private function loadConfig() : array return $items; } - private function getDirectoryContent(Finder $dir, string $slug, array $dirItems = []) : array + private function getDirectoryContent(Finder $dir, string $slug, array $dirItems = []): array { /** @var File $subDir */ foreach ($dir as $subDir) { @@ -114,8 +114,8 @@ private function getDirectoryContent(Finder $dir, string $slug, array $dirItems $dirItems[$subDir->getBasename()]['title'] = $subDir->getBasename(); $dirItems[$subDir->getBasename()]['children'][] = [ - 'title' => $filename, - 'slug' => $slug . '/' . $subDir->getBasename() . '/' . $filename, + 'title' => $filename, + 'slug' => $slug . '/' . $subDir->getBasename() . '/' . $filename, 'config' => $itemConfig, 'status' => $itemConfig['status'], ]; diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php new file mode 100644 index 0000000..d504b4d --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php @@ -0,0 +1,24 @@ +twig = $twig; + } + + public function renderPreview($item) + { + } + + public function renderFull($item) + { + return $this->twig->render('@Lin3sPatternLibraryBuilder/renderers/colors.html.twig', [ + 'colors' => $item['renderer']['options']['colors'], + ]); + } +} diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Homepage.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Homepage.php new file mode 100644 index 0000000..37056ca --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Homepage.php @@ -0,0 +1,24 @@ +twig = $twig; + } + + public function renderPreview($item) + { + } + + public function renderFull($item) + { + return $this->twig->render('@Lin3sPatternLibraryBuilder/renderers/homepage.html.twig', [ + 'sections' => $item['renderer']['options']['sections'], + ]); + } +} diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Iconography.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Iconography.php new file mode 100644 index 0000000..c67acda --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Iconography.php @@ -0,0 +1,23 @@ +twig = $twig; + } + + public function renderPreview($item) + { + // TODO: Implement renderPreview() method. + } + + public function renderFull($item) + { + return $this->twig->render('@Lin3sPatternLibraryBuilder/renderers/iconography.html.twig'); + } +} diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Renderer.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Renderer.php new file mode 100644 index 0000000..3e315e9 --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Renderer.php @@ -0,0 +1,10 @@ +container = $container; + } + + public function get(string $renderer): Renderer + { + return $this->container->get(sprintf( + 'lin3s.pattern_library_builder.renderer.%s', + $renderer + )); + } +} diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Twig.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Twig.php new file mode 100644 index 0000000..b6e55d8 --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Twig.php @@ -0,0 +1,52 @@ +twig = $twig; + $this->request = $requestStack->getMasterRequest(); + } + + public function renderPreview($item) + { + // TODO: Implement renderPreview() method. + } + + public function renderFull($item) + { + $media = $this->request->query->get('media'); + + if ($media) { + $paramsId = $this->request->query->get('id'); + + return $this->renderIFrame($media, $item, $paramsId); + } + + return $this->renderItemPage($item); + } + + private function renderItemPage($item) + { + return $this->twig->render('@Lin3sPatternLibraryBuilder/renderers/twig.html.twig', [ + 'item' => $item['renderer']['options'], + ]); + } + + private function renderIFrame($media, $item, $paramsId) + { + return $this->twig->render( + sprintf('@Lin3sPatternLibraryBuilder/pages/iframe/%s.html.twig', $media), [ + 'item' => $item['renderer']['options'], + 'params_id' => $paramsId, + ] + ); + } +} diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php new file mode 100644 index 0000000..c96a5d5 --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php @@ -0,0 +1,24 @@ +twig = $twig; + } + + public function renderPreview($item) + { + } + + public function renderFull($item) + { + return $this->twig->render('@Lin3sPatternLibraryBuilder/renderers/typography.html.twig', [ + 'typographies' => $item['renderer']['options']['typographies'], + ]); + } +} diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/components/preview.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/components/preview.html.twig index a7e2359..3acc2f2 100644 --- a/src/LIN3S/PatternLibraryBuilder/Resources/templates/components/preview.html.twig +++ b/src/LIN3S/PatternLibraryBuilder/Resources/templates/components/preview.html.twig @@ -2,5 +2,5 @@
{% include '@Lin3sPatternLibraryBuilder/svg/' ~ preview_media ~ '.svg.twig' %}
- + diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/compositions/tabbed_architecture.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/compositions/tabbed_architecture.html.twig index a14e601..a41e48e 100644 --- a/src/LIN3S/PatternLibraryBuilder/Resources/templates/compositions/tabbed_architecture.html.twig +++ b/src/LIN3S/PatternLibraryBuilder/Resources/templates/compositions/tabbed_architecture.html.twig @@ -1,11 +1,11 @@ {% set preview_styles = item.preview_styles ?? '' %} {% for key, params in item.preview_parameters %} - {% set item_preview = include(item.twig, params) %} + {% set item_preview = include(item.template, params) %} {% set item_twig %}

-{{- '{% include \'' ~ item.twig ~ '\' with {' -}}
+{{- '{% include \'' ~ item.template ~ '\' with {' -}}
 {{ indent_twig_parameters(params) }}
 {{- '} %}' -}}
 
diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/article.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/article.html.twig index 7e1a5bf..5fb2f5b 100644 --- a/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/article.html.twig +++ b/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/article.html.twig @@ -11,7 +11,7 @@ {% endfor %}
- {{ item.description|raw }} + {{ item.description|default('')|raw }}
{%- block article_content -%}{%- endblock -%} diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/architecture.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/architecture.html.twig deleted file mode 100644 index b465d81..0000000 --- a/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/architecture.html.twig +++ /dev/null @@ -1,7 +0,0 @@ -{% extends '@Lin3sPatternLibraryBuilder/pattern_library.html.twig' %} - -{% block styleguide_content %} - {% include '@Lin3sPatternLibraryBuilder/compositions/tabbed_architecture.html.twig' with { - item: item - } %} -{% endblock %} diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/home.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/home.html.twig deleted file mode 100644 index 893ea7b..0000000 --- a/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/home.html.twig +++ /dev/null @@ -1,14 +0,0 @@ -{% extends '@Lin3sPatternLibraryBuilder/pattern_library.html.twig' %} - -{% block content %} - {% embed '@Lin3sPatternLibraryBuilder/layouts/main.html.twig' %} - {% block aside %} - {% include '@Lin3sPatternLibraryBuilder/layouts/aside.html.twig' with { - menu: menu, - breadcrumbs: [] - } %} - {% endblock %} - - {% block article %}{% endblock %} - {% endembed %} -{% endblock %} diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/iconography.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/iconography.html.twig deleted file mode 100644 index 6870e20..0000000 --- a/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/iconography.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% extends '@Lin3sPatternLibraryBuilder/pattern_library.html.twig' %} - -{% block styleguide_content %} - {% include '@Lin3sPatternLibraryBuilder/layouts/iconography_content.html.twig' %} -{% endblock %} diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/iframe.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/iframe.html.twig index 79cd6c2..4d59ab6 100644 --- a/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/iframe.html.twig +++ b/src/LIN3S/PatternLibraryBuilder/Resources/templates/pages/iframe.html.twig @@ -26,7 +26,7 @@ {% set current_parameters = params %} {% endif %} {% endfor %} - {{ include(item.twig, current_parameters) }} + {{ include(item.template, current_parameters) }}
{# Prevent bengor-cookies console errors #} diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/pattern_library.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/pattern_library.html.twig index 2f9aa6b..35901d0 100644 --- a/src/LIN3S/PatternLibraryBuilder/Resources/templates/pattern_library.html.twig +++ b/src/LIN3S/PatternLibraryBuilder/Resources/templates/pattern_library.html.twig @@ -39,11 +39,10 @@ {% block article %} {% embed '@Lin3sPatternLibraryBuilder/layouts/article.html.twig' with { - items: items|default([]), breadcrumbs: breadcrumbs } %} {% block article_content %} - {{ styleguide_content }} + {{ content|raw }} {% endblock %} {% endembed %} {% endblock %} diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/colors.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/colors.html.twig new file mode 100644 index 0000000..167bc36 --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/colors.html.twig @@ -0,0 +1,6 @@ +
+ {% for color in colors %} +
+ {{ color.name|default(color.color) }} + {% endfor %} +
diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/homepage.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/homepage.html.twig new file mode 100644 index 0000000..35b9597 --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/homepage.html.twig @@ -0,0 +1,13 @@ +{% for section in sections %} +
+

{{ section.title }}

+

{{ section.description }}

+
+ {% for item in section.items %} +
+ TODO renderPreview +
+ {% endfor %} +
+
+{% endfor %} diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/iconography_content.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/iconography.html.twig similarity index 100% rename from src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/iconography_content.html.twig rename to src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/iconography.html.twig diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/twig.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/twig.html.twig new file mode 100644 index 0000000..2160946 --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/twig.html.twig @@ -0,0 +1,39 @@ +{% set preview_styles = item.preview_styles ?? '' %} + +{% for key, params in item.preview_parameters %} + {% set item_preview = include(item.template, params) %} + + {% set item_twig %} +

+{{- '{% include \'' ~ item.template ~ '\' with {' -}}
+                {{ indent_twig_parameters(params) }}
+                {{- '} %}' -}}
+
+ {% endset %} + + {% set item_html = '
' ~ item_preview|indent_html ~ '
' %} + + {% set preview_tabs = [] %} + {% for media in ['mobile', 'tablet_portrait', 'tablet_landscape', 'desktop'] %} + {% set preview_tabs = preview_tabs|merge([{ + content: include('@Lin3sPatternLibraryBuilder/components/preview.html.twig', { + preview_media: media, + preview_params_key: key + }), + title: include('@Lin3sPatternLibraryBuilder/svg/' ~ media ~ '.svg.twig') + }]) %} + {% endfor %} + + {% include '@Lin3sPatternLibraryBuilder/components/tabbed.html.twig' with { + modifier: item.preview_invert_background is defined and loop.index in item.preview_invert_background + ? 'inverted-background' + : '', + tabs: preview_tabs|merge([{ + content: item_twig, + title: 'Twig' + }, { + content: item_html, + title: 'Html' + }]) + } %} +{% endfor %} diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/typography.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/typography.html.twig new file mode 100644 index 0000000..cb3931f --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/typography.html.twig @@ -0,0 +1,10 @@ +{% for typography in typographies %} + {{ typography.font_family }}
+ + {% for font in typography.fonts %} + + {{ typography.sample_text }} +
+ {% endfor %} +
+{% endfor %} diff --git a/src/LIN3S/PatternLibraryBuilder/Symfony/Resources/config/services.xml b/src/LIN3S/PatternLibraryBuilder/Symfony/Resources/config/services.xml index 9bfbfbe..f85a9cc 100644 --- a/src/LIN3S/PatternLibraryBuilder/Symfony/Resources/config/services.xml +++ b/src/LIN3S/PatternLibraryBuilder/Symfony/Resources/config/services.xml @@ -20,8 +20,8 @@ + - @Lin3sPatternLibraryBuilder/pages/architecture.html.twig null + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Application/src/App/Resources/PatternLibrary/architecture/atoms/button.yml b/tests/Application/src/App/Resources/PatternLibrary/architecture/atoms/button.yml index 72ebf24..46db4ad 100644 --- a/tests/Application/src/App/Resources/PatternLibrary/architecture/atoms/button.yml +++ b/tests/Application/src/App/Resources/PatternLibrary/architecture/atoms/button.yml @@ -1,12 +1,14 @@ status: 2 -twig: 'atoms/button.html.twig' -preview_parameters: - primary: - content: Hola - link: - content: Hola 2 - modifier: orange - href: test - tag: a description: '

This is the button atom description.

' -menu: '' +renderer: + type: twig + options: + template: 'atoms/button.html.twig' + preview_parameters: + primary: + content: Hola + link: + content: Hola 2 + modifier: orange + href: test + tag: a diff --git a/tests/Application/src/App/Resources/PatternLibrary/architecture/atoms/link.yml b/tests/Application/src/App/Resources/PatternLibrary/architecture/atoms/link.yml index b683b30..8e40af5 100644 --- a/tests/Application/src/App/Resources/PatternLibrary/architecture/atoms/link.yml +++ b/tests/Application/src/App/Resources/PatternLibrary/architecture/atoms/link.yml @@ -1,8 +1,10 @@ status: 2 -twig: 'atoms/link.html.twig' -preview_parameters: - - - content: Hola - href: /test description: '

This is the link atom description.

' -menu: '' +renderer: + type: twig + options: + template: 'atoms/link.html.twig' + preview_parameters: + - + content: Hola + href: /test diff --git a/tests/Application/src/App/Resources/PatternLibrary/architecture/components/icon-card.yml b/tests/Application/src/App/Resources/PatternLibrary/architecture/components/icon-card.yml index 3a775f5..08ca056 100644 --- a/tests/Application/src/App/Resources/PatternLibrary/architecture/components/icon-card.yml +++ b/tests/Application/src/App/Resources/PatternLibrary/architecture/components/icon-card.yml @@ -1,8 +1,10 @@ status: 0 -twig: 'components/icon_card.html.twig' -preview_parameters: - - - href: '/' - title: '¿Quieres más?' description: '

This is the icon card component description.

' -menu: '' +renderer: + type: twig + options: + template: 'components/icon_card.html.twig' + preview_parameters: + - + href: '/' + title: '¿Quieres más?' diff --git a/tests/Application/src/App/Resources/PatternLibrary/homepage/index.yml b/tests/Application/src/App/Resources/PatternLibrary/homepage/index.yml new file mode 100644 index 0000000..3ae9f18 --- /dev/null +++ b/tests/Application/src/App/Resources/PatternLibrary/homepage/index.yml @@ -0,0 +1,17 @@ +status: 0 +description: '

This is the icon card component description.

' +renderer: + type: homepage + options: + sections: + - + title: 'Atoms' + description: 'These are the atoms' + items: + - 'architecture/atoms/button' + - 'architecture/atoms/link' + - + title: 'Components' + description: 'These are the components' + items: + - 'architecture/components/icon-card' diff --git a/tests/Application/src/App/Resources/PatternLibrary/style-guide/colors.yml b/tests/Application/src/App/Resources/PatternLibrary/style-guide/colors.yml new file mode 100644 index 0000000..80b617b --- /dev/null +++ b/tests/Application/src/App/Resources/PatternLibrary/style-guide/colors.yml @@ -0,0 +1,11 @@ +status: 0 +renderer: + type: colors + options: + colors: + - + color: '#ff6600' + name: 'Title' + - + color: '#white' + name: 'Title' diff --git a/tests/Application/src/App/Resources/PatternLibrary/style-guide/iconography.yml b/tests/Application/src/App/Resources/PatternLibrary/style-guide/iconography.yml index 35c78a1..3c36d43 100644 --- a/tests/Application/src/App/Resources/PatternLibrary/style-guide/iconography.yml +++ b/tests/Application/src/App/Resources/PatternLibrary/style-guide/iconography.yml @@ -1,3 +1,6 @@ status: 0 description: '

This is the Iconography description.

' -template: 'iconography' +renderer: + type: iconography + options: + folder: '' diff --git a/tests/Application/src/App/Resources/PatternLibrary/style-guide/typography.yml b/tests/Application/src/App/Resources/PatternLibrary/style-guide/typography.yml new file mode 100644 index 0000000..c0a00b1 --- /dev/null +++ b/tests/Application/src/App/Resources/PatternLibrary/style-guide/typography.yml @@ -0,0 +1,22 @@ +status: 0 +renderer: + type: typography + options: + typographies: + - + font_family: 'Roboto' + sample_text: 'Lorem ipsum' + fonts: + - + size: 18px + weight: 400 + - + size: 14px + weight: 400 + - + size: 12px + weight: 400 + - + size: 11px + weight: 400 + From 70360d13535ecdc90271ffc0ac7d0fce2fdd7aa2 Mon Sep 17 00:00:00 2001 From: Gorka Laucirica Date: Mon, 24 Jul 2017 13:51:49 +0200 Subject: [PATCH 02/11] Full refactor of ConfigLoader - Splited logic into loading class and consuming class - Now an index page for each directory can be added naming the config "index.yml" --- .../PatternLibraryBuilder/Config/Config.php | 79 +++++++++++ .../Config/ConfigLoader.php | 118 ++++++++++++++++ .../Controller/IndexController.php | 13 +- .../Loader/StyleguideConfigLoader.php | 127 ------------------ .../templates/layouts/aside.html.twig | 46 ++++--- .../Symfony/Resources/config/services.xml | 2 +- .../{homepage => architecture}/index.yml | 0 .../App/Resources/PatternLibrary/index.yml | 17 +++ 8 files changed, 247 insertions(+), 155 deletions(-) create mode 100644 src/LIN3S/PatternLibraryBuilder/Config/Config.php create mode 100644 src/LIN3S/PatternLibraryBuilder/Config/ConfigLoader.php delete mode 100644 src/LIN3S/PatternLibraryBuilder/Loader/StyleguideConfigLoader.php rename tests/Application/src/App/Resources/PatternLibrary/{homepage => architecture}/index.yml (100%) create mode 100644 tests/Application/src/App/Resources/PatternLibrary/index.yml diff --git a/src/LIN3S/PatternLibraryBuilder/Config/Config.php b/src/LIN3S/PatternLibraryBuilder/Config/Config.php new file mode 100644 index 0000000..087a392 --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Config/Config.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace LIN3S\PatternLibraryBuilder\Config; + +/** + * @author Gorka Laucirica + */ +final class Config +{ + private $config; + + public function __construct(array $config) + { + $this->config = $config; + } + + public function allInHierarchy(): array + { + return $this->config; + } + + public function allInPlain(): array + { + return $this->findAllItemsRecursively($this->config); + } + + public function get(string $slug): ?array + { + return $this->findBySlugRecursively($slug, $this->config)['config']; + } + + private function findBySlugRecursively(string $slug, array $config): ?array + { + if ($config['index'] && $config['index']['slug'] === $slug) { + return $config['index']; + } + + foreach ($config['pages'] as $page) { + if ($page['slug'] === $slug) { + return $page; + } + } + + foreach ($config['children'] as $child) { + $children = $this->findBySlugRecursively($slug, $child); + if ($children) { + return $children; + } + } + + return null; + } + + private function findAllItemsRecursively(array $config, array $items = []): array + { + foreach ($config as $child) { + if (isset($child['config'])) { + $items[] = $child; + } + + if (isset($child['children'])) { + $items = array_merge($items, $this->findAllItemsRecursively($child['children'], $items)); + } + } + + return $items; + } +} diff --git a/src/LIN3S/PatternLibraryBuilder/Config/ConfigLoader.php b/src/LIN3S/PatternLibraryBuilder/Config/ConfigLoader.php new file mode 100644 index 0000000..5280826 --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Config/ConfigLoader.php @@ -0,0 +1,118 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace LIN3S\PatternLibraryBuilder\Config; + +use Symfony\Component\Finder\Finder; +use Symfony\Component\Finder\SplFileInfo; +use Symfony\Component\Yaml\Yaml; + +/** + * @author Gorka Laucirica + */ +final class ConfigLoader +{ + const INDEX_YML = 'index.yml'; + + private $itemsPath; + + public function __construct(string $itemsPath) + { + $this->itemsPath = realpath($itemsPath); + } + + public function loadConfig(): Config + { + $items = $this->getDirectoryContent($this->itemsPath); + + return new Config($items); + } + + private function getDirectoryContent($path): array + { + $finder = new Finder(); + $childDirs = $finder->directories()->in($path)->depth(0); + + $childConfig = []; + + /** @var SplFileInfo $childDir */ + foreach ($childDirs as $childDir) + { + $childConfig[] = $this->getDirectoryContent($childDir->getPathname()); + } + + return [ + 'title' => $this->titleFromPath($path), + 'slug' => $this->slugFromPath($path), + 'index' => $this->indexForDirectory($path), + 'children' => $childConfig, + 'pages' => $this->pagesInDirectory($path) + ]; + } + + private function titleFromPath(string $path): string + { + $fileInfo = pathinfo($path); + + return $fileInfo['filename']; + } + + private function slugFromPath(string $path): string + { + $slug = str_replace($this->itemsPath, '', $path); + $slug = ltrim($slug, '/'); + $slug = str_replace('/index.yml', '', $slug); + return str_replace('.yml', '', $slug); + } + + private function indexForDirectory(string $path) + { + $indexFilePath = $path . '/' . self::INDEX_YML; + $indexFile = @file_get_contents($indexFilePath); + + if(!$indexFile) { + return null; + } + + $itemConfig = Yaml::parse($indexFile); + + return $this->serializeItemConfig($itemConfig, $indexFilePath); + + } + + private function pagesInDirectory(string $path): array + { + $finder = new Finder(); + $pages = $finder->files()->in($path)->depth(0)->notName(self::INDEX_YML); + + $pagesConfig = []; + + foreach ($pages as $page) { + $itemConfig = Yaml::parse(file_get_contents($page->getRealPath())); + + $pagesConfig[] = $this->serializeItemConfig($itemConfig, $page->getRealPath()); + } + + return $pagesConfig; + } + + private function serializeItemConfig(array $itemConfig, string $configFilePath): array + { + return [ + 'title' => $this->titleFromPath($configFilePath), + 'slug' => $this->slugFromPath($configFilePath), + 'config' => $itemConfig, + 'status' => $itemConfig['status'], + ]; + } +} diff --git a/src/LIN3S/PatternLibraryBuilder/Controller/IndexController.php b/src/LIN3S/PatternLibraryBuilder/Controller/IndexController.php index db20e29..d3fc6cc 100644 --- a/src/LIN3S/PatternLibraryBuilder/Controller/IndexController.php +++ b/src/LIN3S/PatternLibraryBuilder/Controller/IndexController.php @@ -13,7 +13,7 @@ namespace LIN3S\PatternLibraryBuilder\Controller; -use LIN3S\PatternLibraryBuilder\Loader\StyleguideConfigLoader; +use LIN3S\PatternLibraryBuilder\Config\ConfigLoader; use LIN3S\PatternLibraryBuilder\Renderer\RendererRegistry; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -30,7 +30,7 @@ class IndexController private $twig; public function __construct( - StyleguideConfigLoader $loader, + ConfigLoader $loader, RendererRegistry $rendererRegistry, \Twig_Environment $twig ) { @@ -41,11 +41,10 @@ public function __construct( public function __invoke(Request $request, string $slug = '') : Response { - if (!$slug) { - $slug = 'homepage/index'; - } + $config = $this->loader->loadConfig(); + + $item = $config->get($slug); - $item = $this->loader->get($slug); if (!$item) { throw new NotFoundHttpException(); } @@ -59,7 +58,7 @@ public function __invoke(Request $request, string $slug = '') : Response } return new Response($this->twig->render('@Lin3sPatternLibraryBuilder/pattern_library.html.twig', [ - 'menu' => $this->loader->allInHierarchy(), + 'menu' => $config->allInHierarchy(), 'breadcrumbs' => $this->generateBreadcrumbs($slug), 'content' => $content, 'item' => $item diff --git a/src/LIN3S/PatternLibraryBuilder/Loader/StyleguideConfigLoader.php b/src/LIN3S/PatternLibraryBuilder/Loader/StyleguideConfigLoader.php deleted file mode 100644 index a22c2a2..0000000 --- a/src/LIN3S/PatternLibraryBuilder/Loader/StyleguideConfigLoader.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace LIN3S\PatternLibraryBuilder\Loader; - -use Symfony\Component\Finder\Finder; -use Symfony\Component\HttpFoundation\File\File; -use Symfony\Component\Yaml\Yaml; - -class StyleguideConfigLoader -{ - private $config; - private $itemsPath; - private $prefixPath; - - public function __construct(string $itemsPath, string $prefixPath = '/design-system') - { - $this->itemsPath = $itemsPath; - $this->prefixPath = $prefixPath; - $this->config = $this->loadConfig(); - } - - public function allInHierarchy(): array - { - return $this->config; - } - - public function allInPlain(): array - { - return $this->findAllItemsRecursively($this->config); - } - - public function get(string $slug): ?array - { - return $this->findBySlugRecursively($slug, $this->config)['config']; - } - - private function findBySlugRecursively(string $slug, array $config): ?array - { - foreach ($config as $child) { - if (isset($child['slug'])) { - if ($child['slug'] === $this->prefixPath . '/' . $slug) { - return $child; - } - } - - if (isset($child['children'])) { - $children = $this->findBySlugRecursively($slug, $child['children']); - if ($children) { - return $children; - } - } - } - - return null; - } - - private function findAllItemsRecursively(array $config, array $items = []): array - { - foreach ($config as $child) { - if (isset($child['config'])) { - $items[] = $child; - } - - if (isset($child['children'])) { - $items = array_merge($items, $this->findAllItemsRecursively($child['children'], $items)); - } - } - - return $items; - } - - private function loadConfig(): array - { - $finder = new Finder(); - $dir = $finder->directories()->in($this->itemsPath)->depth(0); - $items = $this->getDirectoryContent($dir, $this->prefixPath); - - return $items; - } - - private function getDirectoryContent(Finder $dir, string $slug, array $dirItems = []): array - { - /** @var File $subDir */ - foreach ($dir as $subDir) { - $finder = new Finder(); - $newDir = $finder->directories()->in($subDir->getPathname())->depth(0); - - if (count($newDir) > 0) { - $dirItems[$subDir->getBasename()]['children'] = $this->getDirectoryContent( - $newDir, - $slug . '/' . $subDir->getBasename(), - $dirItems - ); - $dirItems[$subDir->getBasename()]['title'] = $subDir->getBasename(); - - continue; - } - - /** @var File $file */ - foreach ($newDir->files() as $file) { - $filename = pathinfo($file->getFilename(), PATHINFO_FILENAME); - $itemConfig = Yaml::parse(file_get_contents($file->getRealPath())); - - $dirItems[$subDir->getBasename()]['title'] = $subDir->getBasename(); - $dirItems[$subDir->getBasename()]['children'][] = [ - 'title' => $filename, - 'slug' => $slug . '/' . $subDir->getBasename() . '/' . $filename, - 'config' => $itemConfig, - 'status' => $itemConfig['status'], - ]; - } - } - - return $dirItems; - } -} diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/aside.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/aside.html.twig index fa6b4c0..8507d7d 100644 --- a/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/aside.html.twig +++ b/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/aside.html.twig @@ -3,7 +3,6 @@ {% set items = [] %} {% for item in children %} - {% set item_class_name = null %} {% set item_title = item.title|replace({'-': ' '}) %} @@ -14,39 +13,46 @@ {% endif %} {% endfor %} - {% if item.children is defined and item.children is not empty %} - {% set accordion_item_title %} - {{ item_title }} - {% include '@Lin3sPatternLibraryBuilder/svg/icon_plus.svg.twig' %} - {% endset %} - {% set accordion_item_content = macros.accordion_menu(item.children, breadcrumbs) %} - {% else %} + {% set accordion_item_title %} + {{ item_title }} + {% include '@Lin3sPatternLibraryBuilder/svg/icon_plus.svg.twig' %} + {% endset %} + + {% set items = items|merge([{ + header: accordion_item_title, + content: macros.accordion_menu(item.children, breadcrumbs), + modifiers: modifiers, + class_name: item_class_name, + finder_value: item_title + }]) %} + + {% for item in item.pages %} {% set accordion_item_title %} {% embed '@Lin3sPatternLibraryBuilder/components/link.html.twig' with { - url: item.slug, + url: '/design-system/' ~ item.slug, target: '_self' } %} {%- block link_content -%} {% include '@Lin3sPatternLibraryBuilder/components/status.html.twig' with { - level: item.status, + level: item.status|default(' '), tag: 'span' } %} - {{ item_title }} + {{ item.title }} {%- endblock -%} {% endembed %} {% endset %} {% set modifiers = modifiers|merge(['leaf']) %} {% set item_class_name = 'finder__subject' %} - {% endif %} - {% set items = items|merge([{ - header: accordion_item_title, - content: accordion_item_content|default, - modifiers: modifiers, - class_name: item_class_name, - finder_value: item_title - }]) %} + {% set items = items|merge([{ + header: accordion_item_title, + content: null, + modifiers: modifiers|merge(['leaf']) , + class_name: 'finder__subject', + finder_value: item_title + }]) %} + {% endfor %} {% endfor %} {% include '@Lin3sPatternLibraryBuilder/components/accordion.html.twig' with { @@ -69,7 +75,7 @@ } %} {% block finder_subjects %} {% import '@Lin3sPatternLibraryBuilder/layouts/aside.html.twig' as aside %} - {{ aside.accordion_menu(menu, breadcrumbs) }} + {{ aside.accordion_menu(menu.children, breadcrumbs) }} {% endblock %} {% endembed %} diff --git a/src/LIN3S/PatternLibraryBuilder/Symfony/Resources/config/services.xml b/src/LIN3S/PatternLibraryBuilder/Symfony/Resources/config/services.xml index f85a9cc..62bf858 100644 --- a/src/LIN3S/PatternLibraryBuilder/Symfony/Resources/config/services.xml +++ b/src/LIN3S/PatternLibraryBuilder/Symfony/Resources/config/services.xml @@ -53,7 +53,7 @@ + class="LIN3S\PatternLibraryBuilder\Config\ConfigLoader"> null diff --git a/tests/Application/src/App/Resources/PatternLibrary/homepage/index.yml b/tests/Application/src/App/Resources/PatternLibrary/architecture/index.yml similarity index 100% rename from tests/Application/src/App/Resources/PatternLibrary/homepage/index.yml rename to tests/Application/src/App/Resources/PatternLibrary/architecture/index.yml diff --git a/tests/Application/src/App/Resources/PatternLibrary/index.yml b/tests/Application/src/App/Resources/PatternLibrary/index.yml new file mode 100644 index 0000000..3ae9f18 --- /dev/null +++ b/tests/Application/src/App/Resources/PatternLibrary/index.yml @@ -0,0 +1,17 @@ +status: 0 +description: '

This is the icon card component description.

' +renderer: + type: homepage + options: + sections: + - + title: 'Atoms' + description: 'These are the atoms' + items: + - 'architecture/atoms/button' + - 'architecture/atoms/link' + - + title: 'Components' + description: 'These are the components' + items: + - 'architecture/components/icon-card' From e3dbf7c16d5b9907abfad2324815fd43e485a519 Mon Sep 17 00:00:00 2001 From: Gorka Laucirica Date: Mon, 24 Jul 2017 14:23:44 +0200 Subject: [PATCH 03/11] Added compiler pass to load services tagged as renderers into RendererRegistry --- .../Renderer/RendererRegistry.php | 29 ++++++++---- .../Compiler/LoadRenderersPass.php | 47 +++++++++++++++++++ .../Lin3sPatternLibraryBuilderBundle.php | 2 + .../Symfony/Resources/config/services.xml | 6 ++- 4 files changed, 73 insertions(+), 11 deletions(-) create mode 100644 src/LIN3S/PatternLibraryBuilder/Symfony/DependencyInjection/Compiler/LoadRenderersPass.php diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/RendererRegistry.php b/src/LIN3S/PatternLibraryBuilder/Renderer/RendererRegistry.php index 9aa2fde..7570488 100644 --- a/src/LIN3S/PatternLibraryBuilder/Renderer/RendererRegistry.php +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/RendererRegistry.php @@ -2,22 +2,31 @@ namespace LIN3S\PatternLibraryBuilder\Renderer; -use Symfony\Component\DependencyInjection\Container; - final class RendererRegistry { - private $container; + private $renderers; - public function __construct(Container $container) + public function add(Renderer $renderer, $name) { - $this->container = $container; + if(isset($this->renderers[$name])) { + throw new \Exception(sprintf( + 'Renderer with name "%s" already exists', + $name + )); + } + + $this->renderers[$name] = $renderer; } - public function get(string $renderer): Renderer + public function get(string $name): Renderer { - return $this->container->get(sprintf( - 'lin3s.pattern_library_builder.renderer.%s', - $renderer - )); + if(!isset($this->renderers[$name])) { + throw new \Exception(sprintf( + 'Renderer with name "%s" does not exist', + $name + )); + } + + return $this->renderers[$name]; } } diff --git a/src/LIN3S/PatternLibraryBuilder/Symfony/DependencyInjection/Compiler/LoadRenderersPass.php b/src/LIN3S/PatternLibraryBuilder/Symfony/DependencyInjection/Compiler/LoadRenderersPass.php new file mode 100644 index 0000000..d202510 --- /dev/null +++ b/src/LIN3S/PatternLibraryBuilder/Symfony/DependencyInjection/Compiler/LoadRenderersPass.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace LIN3S\PatternLibraryBuilder\Symfony\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; + +/** + * @author Gorka Laucirica + */ +class LoadRenderersPass implements CompilerPassInterface +{ + public function process(ContainerBuilder $container) + { + if (!$container->hasDefinition('lin3s.pattern_library_builder.renderer.registry')) { + return; + } + + $definition = $container->getDefinition('lin3s.pattern_library_builder.renderer.registry'); + + $taggedServices = $container->findTaggedServiceIds('lin3s.pattern_library_builder.renderer'); + + foreach ($taggedServices as $id => $tags) { + foreach ($tags as $attributes) { + if(!isset($attributes['alias'])) { + throw new \Exception(sprintf( + 'Alias parameter not found in %s service definition tagged with lin3s.pattern_library_builder.renderer', + $id + )); + } + $definition->addMethodCall('add', array(new Reference($id), $attributes['alias'])); + } + } + } +} diff --git a/src/LIN3S/PatternLibraryBuilder/Symfony/Lin3sPatternLibraryBuilderBundle.php b/src/LIN3S/PatternLibraryBuilder/Symfony/Lin3sPatternLibraryBuilderBundle.php index 5dab8ba..e9d8440 100644 --- a/src/LIN3S/PatternLibraryBuilder/Symfony/Lin3sPatternLibraryBuilderBundle.php +++ b/src/LIN3S/PatternLibraryBuilder/Symfony/Lin3sPatternLibraryBuilderBundle.php @@ -15,6 +15,7 @@ use LIN3S\PatternLibraryBuilder\Symfony\DependencyInjection\Compiler\AddConfigurationValuesToGlobalTwigVariablesPass; use LIN3S\PatternLibraryBuilder\Symfony\DependencyInjection\Compiler\CustomizeThemePass; +use LIN3S\PatternLibraryBuilder\Symfony\DependencyInjection\Compiler\LoadRenderersPass; use LIN3S\PatternLibraryBuilder\Symfony\DependencyInjection\Compiler\SetTemplatesConfigFilesPathPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; @@ -38,6 +39,7 @@ public function build(ContainerBuilder $container) : void $container->addCompilerPass(new AddConfigurationValuesToGlobalTwigVariablesPass()); $container->addCompilerPass(new SetTemplatesConfigFilesPathPass()); $container->addCompilerPass(new CustomizeThemePass()); + $container->addCompilerPass(new LoadRenderersPass()); } private function basePath() : string diff --git a/src/LIN3S/PatternLibraryBuilder/Symfony/Resources/config/services.xml b/src/LIN3S/PatternLibraryBuilder/Symfony/Resources/config/services.xml index 62bf858..1358f04 100644 --- a/src/LIN3S/PatternLibraryBuilder/Symfony/Resources/config/services.xml +++ b/src/LIN3S/PatternLibraryBuilder/Symfony/Resources/config/services.xml @@ -60,33 +60,37 @@ - + + + + + From e9dde1fc413dc10b6246e6f2e53536e49b3731fa Mon Sep 17 00:00:00 2001 From: Gorka Laucirica Date: Mon, 24 Jul 2017 16:37:43 +0200 Subject: [PATCH 04/11] Refactored Renderer interface and implemented homepage renderer - Refactored all classes implementing Renderer interface - Fixed minor issue with index slugs - Added styles for homepage renderer --- .../PatternLibraryBuilder/Config/Config.php | 2 +- .../Config/ConfigLoader.php | 2 +- .../Controller/IndexController.php | 6 +- .../PatternLibraryBuilder/Renderer/Colors.php | 6 +- .../Renderer/Homepage.php | 25 +- .../Renderer/Iconography.php | 7 +- .../Renderer/Renderer.php | 4 +- .../PatternLibraryBuilder/Renderer/Twig.php | 7 +- .../Renderer/Typography.php | 6 +- .../Resources/assets/build/patternlibrary.css | 611 +- .../Resources/assets/build/patternlibrary.js | 12935 +++++++++++++++- .../assets/build/patternlibrary.js.map | 1 + .../Resources/assets/scss/index.scss | 2 + .../assets/scss/renderer/_homepage.scss | 60 + .../templates/renderers/homepage.html.twig | 21 +- .../Symfony/Resources/config/services.xml | 1 + .../App/Resources/PatternLibrary/index.yml | 11 +- 17 files changed, 13658 insertions(+), 49 deletions(-) create mode 100644 src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.js.map create mode 100644 src/LIN3S/PatternLibraryBuilder/Resources/assets/scss/renderer/_homepage.scss diff --git a/src/LIN3S/PatternLibraryBuilder/Config/Config.php b/src/LIN3S/PatternLibraryBuilder/Config/Config.php index 087a392..9deecee 100644 --- a/src/LIN3S/PatternLibraryBuilder/Config/Config.php +++ b/src/LIN3S/PatternLibraryBuilder/Config/Config.php @@ -37,7 +37,7 @@ public function allInPlain(): array public function get(string $slug): ?array { - return $this->findBySlugRecursively($slug, $this->config)['config']; + return $this->findBySlugRecursively($slug, $this->config); } private function findBySlugRecursively(string $slug, array $config): ?array diff --git a/src/LIN3S/PatternLibraryBuilder/Config/ConfigLoader.php b/src/LIN3S/PatternLibraryBuilder/Config/ConfigLoader.php index 5280826..e3807b3 100644 --- a/src/LIN3S/PatternLibraryBuilder/Config/ConfigLoader.php +++ b/src/LIN3S/PatternLibraryBuilder/Config/ConfigLoader.php @@ -70,8 +70,8 @@ private function titleFromPath(string $path): string private function slugFromPath(string $path): string { $slug = str_replace($this->itemsPath, '', $path); + $slug = str_replace('index.yml', '', $slug); $slug = ltrim($slug, '/'); - $slug = str_replace('/index.yml', '', $slug); return str_replace('.yml', '', $slug); } diff --git a/src/LIN3S/PatternLibraryBuilder/Controller/IndexController.php b/src/LIN3S/PatternLibraryBuilder/Controller/IndexController.php index d3fc6cc..15d425c 100644 --- a/src/LIN3S/PatternLibraryBuilder/Controller/IndexController.php +++ b/src/LIN3S/PatternLibraryBuilder/Controller/IndexController.php @@ -49,9 +49,9 @@ public function __invoke(Request $request, string $slug = '') : Response throw new NotFoundHttpException(); } - $renderer = $this->rendererRegistry->get($item['renderer']['type']); + $renderer = $this->rendererRegistry->get($item['config']['renderer']['type']); - $content = $renderer->renderFull($item); + $content = $renderer->render($item); if($request->query->has('content_only')) { return new Response($content); @@ -61,7 +61,7 @@ public function __invoke(Request $request, string $slug = '') : Response 'menu' => $config->allInHierarchy(), 'breadcrumbs' => $this->generateBreadcrumbs($slug), 'content' => $content, - 'item' => $item + 'item' => $item['config'] ])); } diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php index d504b4d..6a5b273 100644 --- a/src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php @@ -11,11 +11,7 @@ public function __construct(\Twig_Environment $twig) $this->twig = $twig; } - public function renderPreview($item) - { - } - - public function renderFull($item) + public function render($item) { return $this->twig->render('@Lin3sPatternLibraryBuilder/renderers/colors.html.twig', [ 'colors' => $item['renderer']['options']['colors'], diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Homepage.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Homepage.php index 37056ca..4e9738b 100644 --- a/src/LIN3S/PatternLibraryBuilder/Renderer/Homepage.php +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Homepage.php @@ -2,23 +2,36 @@ namespace LIN3S\PatternLibraryBuilder\Renderer; +use LIN3S\PatternLibraryBuilder\Config\ConfigLoader; + class Homepage implements Renderer { private $twig; + private $config; - public function __construct(\Twig_Environment $twig) + public function __construct(\Twig_Environment $twig, ConfigLoader $configLoader) { $this->twig = $twig; + $this->config = $configLoader->loadConfig(); } - public function renderPreview($item) + public function render($item) { - } + $sections = $item['config']['renderer']['options']['sections']; + + $sections = array_map(function($section) { + $items = []; + foreach ($section['items'] as $item) { + $item['config'] = $this->config->get($item['slug']); + $items[] = $item; + } + $section['items'] = $items; + + return $section; + }, $sections); - public function renderFull($item) - { return $this->twig->render('@Lin3sPatternLibraryBuilder/renderers/homepage.html.twig', [ - 'sections' => $item['renderer']['options']['sections'], + 'sections' => $sections, ]); } } diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Iconography.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Iconography.php index c67acda..c9872a6 100644 --- a/src/LIN3S/PatternLibraryBuilder/Renderer/Iconography.php +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Iconography.php @@ -11,12 +11,7 @@ public function __construct(\Twig_Environment $twig) $this->twig = $twig; } - public function renderPreview($item) - { - // TODO: Implement renderPreview() method. - } - - public function renderFull($item) + public function render($item) { return $this->twig->render('@Lin3sPatternLibraryBuilder/renderers/iconography.html.twig'); } diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Renderer.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Renderer.php index 3e315e9..17fba9d 100644 --- a/src/LIN3S/PatternLibraryBuilder/Renderer/Renderer.php +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Renderer.php @@ -4,7 +4,5 @@ interface Renderer { - public function renderPreview($item); - - public function renderFull($item); + public function render($item); } diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Twig.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Twig.php index b6e55d8..19159e9 100644 --- a/src/LIN3S/PatternLibraryBuilder/Renderer/Twig.php +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Twig.php @@ -15,12 +15,7 @@ public function __construct(\Twig_Environment $twig, RequestStack $requestStack) $this->request = $requestStack->getMasterRequest(); } - public function renderPreview($item) - { - // TODO: Implement renderPreview() method. - } - - public function renderFull($item) + public function render($item) { $media = $this->request->query->get('media'); diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php index c96a5d5..2995d98 100644 --- a/src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php @@ -11,11 +11,7 @@ public function __construct(\Twig_Environment $twig) $this->twig = $twig; } - public function renderPreview($item) - { - } - - public function renderFull($item) + public function render($item) { return $this->twig->render('@Lin3sPatternLibraryBuilder/renderers/typography.html.twig', [ 'typographies' => $item['renderer']['options']['typographies'], diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.css b/src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.css index a4f360b..1493b11 100644 --- a/src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.css +++ b/src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.css @@ -1 +1,610 @@ -code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:none;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#272822}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#f8f8f2}.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#f92672}.token.boolean,.token.number{color:#ae81ff}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#a6e22e}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.function{color:#e6db74}.token.keyword{color:#66d9ef}.token.important,.token.regex{color:#fd971f}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{border:0;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}table{border-collapse:collapse;border-spacing:0}textarea{resize:none}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}a{outline:0;text-decoration:none}img{display:inline-block;height:auto;-ms-interpolation-mode:bicubic;max-width:100%;vertical-align:middle}input:-webkit-autofill,input:-webkit-autofill::selection,input:-webkit-autofill:active,input:-webkit-autofill:focus,input:-webkit-autofill:hover{background:none;color:#000;-webkit-text-fill-color:#000;transition:background 5000s ease-in-out 0s}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}body{background-color:#fff;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;overflow-x:hidden;text-rendering:optimizelegibility}small{font-size:.7em}strong{font-weight:700}em{font-style:italic}.icon-plus{fill:#222;height:14px;width:14px}.icon-plus--opened .icon-plus__line--first{transform:rotate(180deg)}.icon-plus--opened .icon-plus__line--last{transform:rotate(270deg)}.icon-plus__line{transition:transform .2s ease-in-out;transform-origin:center center}.icons{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.icons__icon{background-color:#fff;border:1px solid #eee;cursor:copy;margin-left:-1px;margin-top:-1px;position:relative;transition:background-color .2s ease-in-out;width:20%}.icons__icon>svg{height:64px;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:64px}.icons__icon:before{content:"";display:block;height:0;padding-bottom:100%;width:100%}.icons__icon:hover,.icons__icon:hover .icons__icon-name{background-color:#eee}.icons__icon:active{cursor:context-menu}.icons__icon:active,.icons__icon:active .icons__icon-name{background-color:#d1d1d1}.icons__icon-name{background-color:#fff;bottom:5px;display:block;font-family:Open Sans,sans-serif;font-size:12px;font-weight:400;left:50%;position:absolute;text-align:center;transform:translateX(-50%);transition:background-color .2s ease-in-out,color .2s ease-in-out;width:90%}@media screen and (min-width:64em){.icons__icon{width:10%}}.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid #d1d1d1;box-shadow:none;font-family:Open Sans,sans-serif;font-size:16px;font-weight:400;line-height:22px;padding:10px;transition:border-color .2s ease-in-out}.form-input:active,.form-input:focus{outline:none}.form-input:focus{border:1px solid #09f}.form-input::-webkit-input-placeholder{color:rgba(68,68,68,.8)}.form-input:-ms-input-placeholder{color:rgba(68,68,68,.8)}.form-input::placeholder{color:rgba(68,68,68,.8)}.form-input--transparent{background:none;border:0}.form-input--transparent:active,.form-input--transparent:focus{border:0}.form-label{color:#222;font-family:Open Sans,sans-serif;font-size:14px;font-weight:700;line-height:18px}.form-label__required{color:#09f}.accordion-item{color:#222;font-size:16px;font-weight:300;cursor:pointer;font-family:Open Sans,sans-serif;margin-top:-1px;position:relative;transition:background-color .2s ease-in-out}.accordion-item:hover{color:#090909}.accordion-item.accordion-item--opened{background-color:#ececec}.accordion-item .accordion-item__header{border-bottom:1px solid #d1d1d1;border-top:1px solid #d1d1d1;padding:20px 30px}.accordion-item .link{color:#222;display:block;font-size:16px;font-weight:300;line-height:1rem}.accordion-item .link:hover{color:#090909}.accordion-item .accordion-item{color:#545454;font-size:14px;font-weight:300}.accordion-item .accordion-item:hover{color:#3b3b3b}.accordion-item .accordion-item.accordion-item--opened{background-color:#f8fbfb}.accordion-item .accordion-item .accordion-item__header{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5;padding:20px 30px}.accordion-item .accordion-item .link{color:#545454;display:block;font-size:14px;font-weight:300;line-height:1rem}.accordion-item .accordion-item .link:hover{color:#3b3b3b}.accordion-item .accordion-item--leaf{color:#545454;font-size:15px;font-weight:400}.accordion-item .accordion-item--leaf:hover{color:#3b3b3b}.accordion-item .accordion-item--leaf.accordion-item--opened{background-color:#fff}.accordion-item .accordion-item--leaf .accordion-item__header{border-bottom:1px solid transparent;border-top:1px solid transparent;padding:15px 30px}.accordion-item .accordion-item--leaf .link{color:#545454;display:block;font-size:15px;font-weight:400;line-height:1rem}.accordion-item .accordion-item--leaf .link:hover{color:#3b3b3b}.accordion-item .accordion-item--leaf .accordion-item__header{padding:0}.accordion-item .accordion-item--leaf .link{padding:15px 30px}.accordion-item--opened>.accordion-item__header .icon-plus__line--first{transform:rotate(180deg)}.accordion-item--opened>.accordion-item__header .icon-plus__line--last{transform:rotate(270deg)}.accordion-item--opened>.accordion-item__header:after{transform:scaleX(1)}.accordion-item--opened>.accordion-item__content{display:block}.accordion-item__header{position:relative;text-transform:capitalize}.accordion-item__header .icon-plus{height:14px;position:absolute;right:30px;top:20px;width:14px}.accordion-item__header:after{background-color:#222;content:"";height:100%;left:0;position:absolute;top:0;transform:scaleX(0);transform-origin:left center;transition:transform .2s ease-in-out;width:2px}.accordion-item__content{display:none}.form-group .form-label{display:block;margin-bottom:6px}.link{display:inline-block;font-family:Open Sans,sans-serif;font-size:18px;font-weight:400;line-height:24px;transition:color .2s ease-in-out}.patternlibrary-preview{position:relative}.patternlibrary-preview--mobile .patternlibrary-preview__iframe{height:640px;width:360px}.patternlibrary-preview--tablet_portrait .patternlibrary-preview__iframe{height:1024px;width:768px}.patternlibrary-preview--tablet_landscape .patternlibrary-preview__iframe{height:768px;width:1024px}.patternlibrary-preview--desktop .patternlibrary-preview__iframe{height:800px;width:1280px}.patternlibrary-preview__frame{position:absolute;pointer-events:none}.status{display:block;font-family:Open Sans,sans-serif;font-size:8px;font-weight:700;letter-spacing:1px;line-height:8px;margin-bottom:5px;text-transform:uppercase}.status--todo{color:#f14133}.status--doing{color:#fba30a}.status--pending-review{color:#16a5ba}.status--done{color:#598d09}.tabbed{margin-top:60px}.tabbed__nav{margin-bottom:-1px;position:relative;z-index:10}.tabbed__nav-list{-ms-flex-align:stretch;align-items:stretch;display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start}.tabbed__nav-item{background-color:#fff;border-bottom:1px solid #d1d1d1;border-left:1px solid #d1d1d1;border-top:1px solid #d1d1d1;cursor:pointer;padding:18px 40px;position:relative;transition:background-color .2s ease-in-out}.tabbed__nav-item .patternlibrary-icon{height:30px;width:30px}.tabbed__nav-item:last-child{border-right:1px solid #d1d1d1}.tabbed__nav-item:after{background-color:#222;content:"";height:2px;left:-1px;position:absolute;top:-1px;transform:scaleY(0);transition:transform .2s ease-in-out;width:calc(100% + 2px);z-index:10}.tabbed__nav-item--active{background-color:#f8fbfb;border-bottom:1px solid #f8fbfb}.tabbed__nav-item--active:after{transform:scaleY(1)}.tabbed__content{background-color:#f8fbfb;border:1px solid #d1d1d1;padding:18px;position:relative;z-index:0}.tabbed__tab{display:none}.tabbed__tab--active{display:block;z-index:10}.article__breadcrumbs{color:#b6b6b6;font-family:Open Sans,sans-serif;font-size:12px;font-weight:400;margin-bottom:12px;text-transform:capitalize}.article__breadcrumbs-separator{margin:0 3px}.article__title{color:#222;font-family:Open Sans,sans-serif;font-size:36px;font-weight:700;line-height:36px;margin-bottom:20px;margin-top:0;text-transform:capitalize}.article__description{color:#444;font-family:Open Sans,sans-serif;font-size:16px;font-weight:400;line-height:22px}code[class*=language-],pre[class*=language-]{font-size:12px}.aside__header{background-color:#e1e1e1;color:#fff;font-family:Open Sans,sans-serif;font-size:16px;font-weight:700;line-height:22px;padding:30px}.aside__header .logo{height:auto;margin-bottom:10px;max-width:170px;width:100%}.aside__content{overflow:hidden;padding:65px 0}.aside__content .finder__header{max-width:none;padding:34px 30px 30px;width:100%}.finder__header{max-width:400px;padding-bottom:40px;width:100%}.finder__input{font-size:16px;width:100%}.finder__subject{display:block}.finder__subject--hidden{display:none}.finder__tip{font-family:Open Sans,sans-serif;font-size:16px;margin-bottom:30px}.main{max-width:none;margin-right:auto;margin-left:auto;display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;min-height:100vh}.main__aside{-ms-flex:0 0 25%;flex:0 0 25%;padding-right:0;padding-left:0;max-width:25%;background-color:#e1e1e1;padding:0}.main__article{-ms-flex:0 0 75%;flex:0 0 75%;padding-right:0;padding-left:0;max-width:75%;padding:80px 60px} \ No newline at end of file +/** + * okaidia theme for JavaScript, CSS and HTML + * Loosely based on Monokai textmate theme by http://www.monokai.nl/ + * @author ocodia + */ +code[class*="language-"], pre[class*="language-"] { + color: #f8f8f2; + background: none; + text-shadow: 0 1px rgba(0, 0, 0, 0.3); + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; } +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; + border-radius: 0.3em; } +:not(pre) > code[class*="language-"], pre[class*="language-"] { + background: #272822; } +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; } +.token.comment, .token.prolog, .token.doctype, .token.cdata { + color: slategray; } +.token.punctuation { + color: #f8f8f2; } +.namespace { + opacity: .7; } +.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { + color: #f92672; } +.token.boolean, .token.number { + color: #ae81ff; } +.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { + color: #a6e22e; } +.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string, .token.variable { + color: #f8f8f2; } +.token.atrule, .token.attr-value, .token.function { + color: #e6db74; } +.token.keyword { + color: #66d9ef; } +.token.regex, .token.important { + color: #fd971f; } +.token.important, .token.bold { + font-weight: bold; } +.token.italic { + font-style: italic; } +.token.entity { + cursor: help; } +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { + border: 0; + font: inherit; + font-size: 100%; + margin: 0; + padding: 0; + vertical-align: baseline; } + +article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { + display: block; } + +body { + line-height: 1; } + +ol, ul { + list-style: none; } + +blockquote, q { + quotes: none; } + +blockquote::before, blockquote::after, q::before, q::after { + content: ''; + content: none; } + +table { + border-collapse: collapse; + border-spacing: 0; } + +textarea { + resize: none; } + +html { + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; + text-size-adjust: 100%; } + +a { + outline: 0; + text-decoration: none; } + +img { + display: inline-block; + height: auto; + -ms-interpolation-mode: bicubic; + max-width: 100%; + vertical-align: middle; } + +input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill::selection, input:-webkit-autofill:active { + background: none; + color: #000; + -webkit-text-fill-color: #000; + transition: background 5000s ease-in-out 0s; } + +html { + box-sizing: border-box; } + +*, *::before, *::after { + box-sizing: inherit; } + +body { + background-color: #fff; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + overflow-x: hidden; + text-rendering: optimizelegibility; } + +small { + font-size: 0.7em; } + +strong { + font-weight: 700; } + +em { + font-style: italic; } + +.icon-plus { + fill: #222; + height: 14px; + width: 14px; } + +.icon-plus--opened .icon-plus__line--first { + transform: rotate(180deg); } + +.icon-plus--opened .icon-plus__line--last { + transform: rotate(270deg); } + +.icon-plus__line { + transition: transform 0.2s ease-in-out; + transform-origin: center center; } + +.icons { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; } + +.icons__icon { + background-color: #fff; + border: 1px solid #eee; + cursor: copy; + margin-left: -1px; + margin-top: -1px; + position: relative; + transition: background-color 0.2s ease-in-out; + width: 20%; } + .icons__icon > svg { + height: 64px; + left: 50%; + position: absolute; + top: 50%; + transform: translateX(-50%) translateY(-50%); + width: 64px; } + .icons__icon::before { + content: ''; + display: block; + height: 0; + padding-bottom: 100%; + width: 100%; } + .icons__icon:hover { + background-color: #eee; } + .icons__icon:hover .icons__icon-name { + background-color: #eee; } + .icons__icon:active { + background-color: #d1d1d1; + cursor: context-menu; } + .icons__icon:active .icons__icon-name { + background-color: #d1d1d1; } + +.icons__icon-name { + background-color: #fff; + bottom: 5px; + display: block; + font-family: "Open Sans", sans-serif; + font-size: 12px; + font-weight: 400; + left: 50%; + position: absolute; + text-align: center; + transform: translateX(-50%); + transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; + width: 90%; } + +@media screen and (min-width: 64em) { + .icons__icon { + width: 10%; } } + +.form-input { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border: 1px solid #d1d1d1; + box-shadow: none; + font-family: "Open Sans", sans-serif; + font-size: 16px; + font-weight: 400; + line-height: 22px; + padding: 10px; + transition: border-color 0.2s ease-in-out; } + .form-input:focus, .form-input:active { + outline: none; } + .form-input:focus { + border: 1px solid #0099ff; } + .form-input::-webkit-input-placeholder { + color: rgba(68, 68, 68, 0.8); } + .form-input:-ms-input-placeholder { + color: rgba(68, 68, 68, 0.8); } + .form-input::placeholder { + color: rgba(68, 68, 68, 0.8); } + +.form-input--transparent { + background: none; + border: 0; } + .form-input--transparent:focus, .form-input--transparent:active { + border: 0; } + +.form-label { + color: #222; + font-family: "Open Sans", sans-serif; + font-size: 14px; + font-weight: 700; + line-height: 18px; } + +.form-label__required { + color: #0099ff; } + +.accordion-item { + color: #222; + font-size: 16px; + font-weight: 300; + cursor: pointer; + font-family: "Open Sans", sans-serif; + margin-top: -1px; + position: relative; + transition: background-color 0.2s ease-in-out; } + .accordion-item:hover { + color: #090909; } + .accordion-item.accordion-item--opened { + background-color: #ececec; } + .accordion-item .accordion-item__header { + border-bottom: 1px solid #d1d1d1; + border-top: 1px solid #d1d1d1; + padding: 20px 30px; } + .accordion-item .link { + color: #222; + display: block; + font-size: 16px; + font-weight: 300; + line-height: 1rem; } + .accordion-item .link:hover { + color: #090909; } + .accordion-item .accordion-item { + color: #545454; + font-size: 14px; + font-weight: 300; } + .accordion-item .accordion-item:hover { + color: #3b3b3b; } + .accordion-item .accordion-item.accordion-item--opened { + background-color: #f8fbfb; } + .accordion-item .accordion-item .accordion-item__header { + border-bottom: 1px solid #e5e5e5; + border-top: 1px solid #e5e5e5; + padding: 20px 30px; } + .accordion-item .accordion-item .link { + color: #545454; + display: block; + font-size: 14px; + font-weight: 300; + line-height: 1rem; } + .accordion-item .accordion-item .link:hover { + color: #3b3b3b; } + .accordion-item .accordion-item--leaf { + color: #545454; + font-size: 15px; + font-weight: 400; } + .accordion-item .accordion-item--leaf:hover { + color: #3b3b3b; } + .accordion-item .accordion-item--leaf.accordion-item--opened { + background-color: #fff; } + .accordion-item .accordion-item--leaf .accordion-item__header { + border-bottom: 1px solid transparent; + border-top: 1px solid transparent; + padding: 15px 30px; } + .accordion-item .accordion-item--leaf .link { + color: #545454; + display: block; + font-size: 15px; + font-weight: 400; + line-height: 1rem; } + .accordion-item .accordion-item--leaf .link:hover { + color: #3b3b3b; } + .accordion-item .accordion-item--leaf .accordion-item__header { + padding: 0; } + .accordion-item .accordion-item--leaf .link { + padding: 15px 30px; } + +.accordion-item--opened > .accordion-item__header .icon-plus__line--first { + transform: rotate(180deg); } + +.accordion-item--opened > .accordion-item__header .icon-plus__line--last { + transform: rotate(270deg); } + +.accordion-item--opened > .accordion-item__header:after { + transform: scaleX(1); } + +.accordion-item--opened > .accordion-item__content { + display: block; } + +.accordion-item__header { + position: relative; + text-transform: capitalize; } + .accordion-item__header .icon-plus { + height: 14px; + position: absolute; + right: 30px; + top: 20px; + width: 14px; } + .accordion-item__header:after { + background-color: #222; + content: ''; + height: 100%; + left: 0; + position: absolute; + top: 0; + transform: scaleX(0); + transform-origin: left center; + transition: transform 0.2s ease-in-out; + width: 2px; } + +.accordion-item__content { + display: none; } + +.form-group .form-label { + display: block; + margin-bottom: 6px; } + +.link { + display: inline-block; + font-family: "Open Sans", sans-serif; + font-size: 18px; + font-weight: 400; + line-height: 24px; + transition: color 0.2s ease-in-out; } + +.patternlibrary-preview { + position: relative; } + +.patternlibrary-preview--mobile .patternlibrary-preview__iframe { + height: 640px; + width: 360px; } + +.patternlibrary-preview--tablet_portrait .patternlibrary-preview__iframe { + height: 1024px; + width: 768px; } + +.patternlibrary-preview--tablet_landscape .patternlibrary-preview__iframe { + height: 768px; + width: 1024px; } + +.patternlibrary-preview--desktop .patternlibrary-preview__iframe { + height: 800px; + width: 1280px; } + +.patternlibrary-preview__frame { + position: absolute; + pointer-events: none; } + +.status { + display: block; + font-family: "Open Sans", sans-serif; + font-size: 8px; + font-weight: 700; + letter-spacing: 1px; + line-height: 8px; + margin-bottom: 5px; + text-transform: uppercase; } + +.status--todo { + color: #f14133; } + +.status--doing { + color: #fba30a; } + +.status--pending-review { + color: #16a5ba; } + +.status--done { + color: #598d09; } + +.tabbed { + margin-top: 60px; } + +.tabbed__nav { + margin-bottom: -1px; + position: relative; + z-index: 10; } + +.tabbed__nav-list { + -ms-flex-align: stretch; + align-items: stretch; + display: -ms-flexbox; + display: flex; + -ms-flex-pack: start; + justify-content: flex-start; } + +.tabbed__nav-item { + background-color: #fff; + border-bottom: 1px solid #d1d1d1; + border-left: 1px solid #d1d1d1; + border-top: 1px solid #d1d1d1; + cursor: pointer; + padding: 18px 40px; + position: relative; + transition: background-color 0.2s ease-in-out; } + .tabbed__nav-item .patternlibrary-icon { + height: 30px; + width: 30px; } + .tabbed__nav-item:last-child { + border-right: 1px solid #d1d1d1; } + .tabbed__nav-item:after { + background-color: #222; + content: ''; + height: 2px; + left: -1px; + position: absolute; + top: -1px; + transform: scaleY(0); + transition: transform 0.2s ease-in-out; + width: calc(100% + 2px); + z-index: 10; } + +.tabbed__nav-item--active { + background-color: #f8fbfb; + border-bottom: 1px solid #f8fbfb; } + .tabbed__nav-item--active:after { + transform: scaleY(1); } + +.tabbed__content { + background-color: #f8fbfb; + border: 1px solid #d1d1d1; + padding: 18px; + position: relative; + z-index: 0; } + +.tabbed__tab { + display: none; } + +.tabbed__tab--active { + display: block; + z-index: 10; } + +.article__breadcrumbs { + color: #b6b6b6; + font-family: "Open Sans", sans-serif; + font-size: 12px; + font-weight: 400; + margin-bottom: 12px; + text-transform: capitalize; } + +.article__breadcrumbs-separator { + margin: 0 3px; } + +.article__title { + color: #222; + font-family: "Open Sans", sans-serif; + font-size: 36px; + font-weight: 700; + line-height: 36px; + margin-bottom: 20px; + margin-top: 0; + text-transform: capitalize; } + +.article__description { + color: #444; + font-family: "Open Sans", sans-serif; + font-size: 16px; + font-weight: 400; + line-height: 22px; } + +code[class*="language-"], pre[class*="language-"] { + font-size: 12px; } + +.aside__header { + background-color: #e1e1e1; + color: #fff; + font-family: "Open Sans", sans-serif; + font-size: 16px; + font-weight: 700; + line-height: 22px; + padding: 30px; } + .aside__header .logo { + height: auto; + margin-bottom: 10px; + max-width: 170px; + width: 100%; } + +.aside__content { + overflow: hidden; + padding: 65px 0; } + .aside__content .finder__header { + max-width: none; + padding: 34px 30px 30px; + width: 100%; } + +.finder__header { + max-width: 400px; + padding-bottom: 40px; + width: 100%; } + +.finder__input { + font-size: 16px; + width: 100%; } + +.finder__subject { + display: block; } + +.finder__subject--hidden { + display: none; } + +.finder__tip { + font-family: "Open Sans", sans-serif; + font-size: 16px; + margin-bottom: 30px; } + +.main { + max-width: none; + margin-right: auto; + margin-left: auto; + display: -ms-flexbox; + display: flex; + -ms-flex-flow: row wrap; + flex-flow: row wrap; + min-height: 100vh; } + +.main__aside { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + padding-right: 0; + padding-left: 0; + max-width: 25%; + background-color: #e1e1e1; + padding: 0; } + +.main__article { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + padding-right: 0; + padding-left: 0; + max-width: 75%; + padding: 80px 60px; } + +.homepage__section { + margin-top: 30px; } + +.homepage__title { + color: #0099ff; + font-family: "Open Sans", sans-serif; + font-size: 26px; + font-weight: 700; } + +.homepage__description { + color: #222; + margin-top: 15px; } + +.homepage__items { + -ms-flex-align: baseline; + align-items: baseline; + display: -ms-grid; + display: grid; + grid-gap: 30px; + -ms-grid-columns: (1fr)[4]; + grid-template-columns: repeat(4, 1fr); + -ms-grid-rows: 100px; + grid-template-rows: 100px; + margin-top: 15px; } + +.homepage__item-render { + border-bottom: 1px solid #b6b6b6; + padding-bottom: 10px; + padding-top: 10px; } + +.homepage__item-link { + color: #b6b6b6; + font-size: 14px; } + +/*# sourceMappingURL=patternlibrary.css.map*/ \ No newline at end of file diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.js b/src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.js index 5d2da54..e93abd7 100644 --- a/src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.js +++ b/src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.js @@ -1,4 +1,83 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=23)}([function(e,t){!function(e,t){for(var n in t)e[n]=t[n]}(t,function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=19)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:new s.default;if(i(this,e),"EventSubscriber"===this.constructor.name)throw new TypeError("Abstract class EventSubscriber cannot be instantiated directly.");this.callback=t,this.priority=n}return o(e,[{key:"handle",value:function(e){if(this.isSubscribedTo(e))return this.callback(e)}},{key:"isSubscribedTo",value:function(e){throw new TypeError("In order to extend EventSubscriber class you must implement isSubscribedTo method.")}}]),e}();t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0;if(r(this,e),!("number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&t>=0))throw new TypeError("Priority must be a positive integer.");var n=t;this.getPriority=function(){return n}};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={DOM_READY:"DOM_READY",DOM_LOADED:"DOM_LOADED",NODE_ADDED:"NODE_ADDED",WINDOW_RESIZED:"WINDOW_RESIZED"};t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=r(s),c=n(4),l=r(c),f=function(e){function t(e,n){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.default.NODE_ADDED));return r.node=e,r.domSelectorClassName=n,r}return a(t,e),t}(u.default);t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=r(s),c=n(4),l=r(c),f=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.default.DOM_LOADED))}return a(t,e),t}(u.default);t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=r(s),c=n(4),l=r(c),f=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.default.DOM_READY))}return a(t,e),t}(u.default);t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=r(s),c=n(4),l=r(c),f=function(e){function t(e,n){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.default.WINDOW_RESIZED));return r.windowHeight=e,r.windowWidth=n,r}return a(t,e),t}(u.default);t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n0?n=i[0]:Array.from(r.childNodes).forEach(function(t){return e(t)})}}(e),n}}]),e}(),g=new h;t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.listenWindowResized=t.listenDomLoaded=t.listenDomReady=void 0;var i=n(2),o=r(i),a=n(7),s=r(a),u=n(6),c=r(u),l=n(8),f=r(l),d=n(17),p=r(d),h=function(){document.addEventListener("DOMContentLoaded",function(){o.default.publish(new s.default)})},g=function(){window.addEventListener("load",function(){o.default.publish(new c.default)})},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;window.addEventListener("resize",(0,p.default)(function(){o.default.publish(new f.default(window.innerHeight,window.innerWidth))},e))};t.listenDomReady=h,t.listenDomLoaded=g,t.listenWindowResized=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.onWindowResized=t.onDomLoaded=t.onDomReady=void 0;var i=n(2),o=r(i),a=n(14),s=r(a),u=n(13),c=r(u),l=n(16),f=r(l),d=n(3),p=r(d),h=function(e,t){o.default.subscribe(new s.default(e,new p.default(t)))},g=function(e,t){o.default.subscribe(new c.default(e,new p.default(t)))},y=function(e,t){o.default.subscribe(new f.default(e,new p.default(t)))};t.onDomReady=h,t.onDomLoaded=g,t.onWindowResized=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n=t||n<0||j&&r>=v}function l(){var e=T();return c(e)?f(e):void(b=setTimeout(l,u(e)))}function f(e){return b=void 0,S&&g?i(e):(g=y=void 0,m)}function d(){void 0!==b&&clearTimeout(b),C=0,g=k=y=b=void 0}function p(){return void 0===b?m:f(T())}function h(){var e=T(),n=c(e);if(g=arguments,y=this,k=e,n){if(void 0===b)return o(k);if(j)return b=setTimeout(l,t),i(k)}return void 0===b&&(b=setTimeout(l,t)),m}var g,y,v,m,b,k,C=0,E=!1,j=!1,S=!0;if("function"!=typeof e)throw new TypeError(s);return t=a(t)||0,r(n)&&(E=!!n.leading,j="maxWait"in n,v=j?w(a(n.maxWait)||0,t):v,S="trailing"in n?!!n.trailing:S),h.cancel=d,h.flush=p,h}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==typeof e}function o(e){return"symbol"==typeof e||i(e)&&b.call(e)==c}function a(e){if("number"==typeof e)return e;if(o(e))return u;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var n=d.test(e);return n||p.test(e)?h(e.slice(2),n?2:8):f.test(e)?u:+e}var s="Expected a function",u=NaN,c="[object Symbol]",l=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,p=/^0o[0-7]+$/i,h=parseInt,g="object"==typeof t&&t&&t.Object===Object&&t,y="object"==typeof self&&self&&self.Object===Object&&self,v=g||y||Function("return this")(),m=Object.prototype,b=m.toString,w=Math.max,x=Math.min,T=function(){return v.Date.now()};e.exports=n}).call(t,n(18))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.onWindowResized=t.onDomLoaded=t.onDomReady=t.NodeAddedObserver=t.Priority=t.EventSubscriber=t.EventPublisher=t.Event=void 0;var i=n(0),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=n(3),f=r(l),d=n(9),p=r(d),h=n(11),g=n(10);(0,g.listenDomReady)(),(0,g.listenDomLoaded)(),(0,g.listenWindowResized)(),t.Event=o.default,t.EventPublisher=s.default,t.EventSubscriber=c.default,t.Priority=f.default,t.NodeAddedObserver=p.default,t.onDomReady=h.onDomReady,t.onDomLoaded=h.onDomLoaded,t.onWindowResized=h.onWindowResized}]))},function(e,t,n){var r,i;/*! +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/"; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 23); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +!function(e,t){for(var n in t)e[n]=t[n]}(exports,function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=19)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:new a.default;if(o(this,e),"EventSubscriber"===this.constructor.name)throw new TypeError("Abstract class EventSubscriber cannot be instantiated directly.");this.callback=t,this.priority=n}return i(e,[{key:"handle",value:function(e){if(this.isSubscribedTo(e))return this.callback(e)}},{key:"isSubscribedTo",value:function(e){throw new TypeError("In order to extend EventSubscriber class you must implement isSubscribedTo method.")}}]),e}();t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0;if(r(this,e),!("number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&t>=0))throw new TypeError("Priority must be a positive integer.");var n=t;this.getPriority=function(){return n}};t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={DOM_READY:"DOM_READY",DOM_LOADED:"DOM_LOADED",NODE_ADDED:"NODE_ADDED",WINDOW_RESIZED:"WINDOW_RESIZED"};t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),c=r(a),f=n(4),s=r(f),l=function(e){function t(e,n){o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,s.default.NODE_ADDED));return r.node=e,r.domSelectorClassName=n,r}return u(t,e),t}(c.default);t.default=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),c=r(a),f=n(4),s=r(f),l=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,s.default.DOM_LOADED))}return u(t,e),t}(c.default);t.default=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),c=r(a),f=n(4),s=r(f),l=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,s.default.DOM_READY))}return u(t,e),t}(c.default);t.default=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),c=r(a),f=n(4),s=r(f),l=function(e){function t(e,n){o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,s.default.WINDOW_RESIZED));return r.windowHeight=e,r.windowWidth=n,r}return u(t,e),t}(c.default);t.default=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n0?n=o[0]:Array.from(r.childNodes).forEach(function(t){return e(t)})}};return r(e),n}}]),e}(),y=new p;t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.listenWindowResized=t.listenDomLoaded=t.listenDomReady=void 0;var o=n(2),i=r(o),u=n(7),a=r(u),c=n(6),f=r(c),s=n(8),l=r(s),d=n(17),b=r(d),p=function(){document.addEventListener("DOMContentLoaded",function(){i.default.publish(new a.default)})},y=function(){window.addEventListener("load",function(){i.default.publish(new f.default)})},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;window.addEventListener("resize",(0,b.default)(function(){i.default.publish(new l.default(window.innerHeight,window.innerWidth))},e))};t.listenDomReady=p,t.listenDomLoaded=y,t.listenWindowResized=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.onWindowResized=t.onDomLoaded=t.onDomReady=void 0;var o=n(2),i=r(o),u=n(14),a=r(u),c=n(13),f=r(c),s=n(16),l=r(s),d=n(3),b=r(d),p=function(e,t){i.default.subscribe(new a.default(e,new b.default(t)))},y=function(e,t){i.default.subscribe(new f.default(e,new b.default(t)))},h=function(e,t){i.default.subscribe(new l.default(e,new b.default(t)))};t.onDomReady=p,t.onDomLoaded=y,t.onWindowResized=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n=t||n<0||M&&r>=v}function s(){var e=j();return f(e)?l(e):void(w=setTimeout(s,c(e)))}function l(e){return w=void 0,D&&y?o(e):(y=h=void 0,_)}function d(){void 0!==w&&clearTimeout(w),g=0,y=E=h=w=void 0}function b(){return void 0===w?_:l(j())}function p(){var e=j(),n=f(e);if(y=arguments,h=this,E=e,n){if(void 0===w)return i(E);if(M)return w=setTimeout(s,t),o(E)}return void 0===w&&(w=setTimeout(s,t)),_}var y,h,v,_,w,E,g=0,P=!1,M=!1,D=!0;if("function"!=typeof e)throw new TypeError(a);return t=u(t)||0,r(n)&&(P=!!n.leading,M="maxWait"in n,v=M?O(u(n.maxWait)||0,t):v,D="trailing"in n?!!n.trailing:D),p.cancel=d,p.flush=b,p}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function o(e){return!!e&&"object"==typeof e}function i(e){return"symbol"==typeof e||o(e)&&w.call(e)==f}function u(e){if("number"==typeof e)return e;if(i(e))return c;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(s,"");var n=d.test(e);return n||b.test(e)?p(e.slice(2),n?2:8):l.test(e)?c:+e}var a="Expected a function",c=NaN,f="[object Symbol]",s=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,b=/^0o[0-7]+$/i,p=parseInt,y="object"==typeof t&&t&&t.Object===Object&&t,h="object"==typeof self&&self&&self.Object===Object&&self,v=y||h||Function("return this")(),_=Object.prototype,w=_.toString,O=Math.max,m=Math.min,j=function(){return v.Date.now()};e.exports=n}).call(t,n(18))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.onWindowResized=t.onDomLoaded=t.onDomReady=t.NodeAddedObserver=t.Priority=t.EventSubscriber=t.EventPublisher=t.Event=void 0;var o=n(0),i=r(o),u=n(2),a=r(u),c=n(1),f=r(c),s=n(3),l=r(s),d=n(9),b=r(d),p=n(11),y=n(10);(0,y.listenDomReady)(),(0,y.listenDomLoaded)(),(0,y.listenWindowResized)(),t.Event=i.default,t.EventPublisher=a.default,t.EventSubscriber=f.default,t.Priority=l.default,t.NodeAddedObserver=b.default,t.onDomReady=p.onDomReady,t.onDomLoaded=p.onDomLoaded,t.onWindowResized=p.onWindowResized}])); +//# sourceMappingURL=lin3s-event-bus.js.map + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! * jQuery JavaScript Library v3.2.1 * https://jquery.com/ * @@ -11,7 +90,532 @@ * * Date: 2017-03-20T18:59Z */ -!function(t,n){"use strict";"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,o){"use strict";function a(e,t){t=t||ae;var n=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}function s(e){var t=!!e&&"length"in e&&e.length,n=be.type(e);return"function"!==n&&!be.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function u(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function c(e,t,n){return be.isFunction(t)?be.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?be.grep(e,function(e){return e===t!==n}):"string"!=typeof t?be.grep(e,function(e){return fe.call(t,e)>-1!==n}):_e.test(t)?be.filter(t,e,n):(t=be.filter(t,e),be.grep(e,function(e){return fe.call(t,e)>-1!==n&&1===e.nodeType}))}function l(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function f(e){var t={};return be.each(e.match(Le)||[],function(e,n){t[n]=!0}),t}function d(e){return e}function p(e){throw e}function h(e,t,n,r){var i;try{e&&be.isFunction(i=e.promise)?i.call(e).done(t).fail(n):e&&be.isFunction(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}function g(){ae.removeEventListener("DOMContentLoaded",g),n.removeEventListener("load",g),be.ready()}function y(){this.expando=be.expando+y.uid++}function v(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:We.test(e)?JSON.parse(e):e)}function m(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace($e,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=v(n)}catch(e){}Ie.set(e,t,n)}else n=void 0;return n}function b(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return be.css(e,t,"")},u=s(),c=n&&n[3]||(be.cssNumber[t]?"":"px"),l=(be.cssNumber[t]||"px"!==c&&+u)&&ze.exec(be.css(e,t));if(l&&l[3]!==c){c=c||l[3],n=n||[],l=+u||1;do{o=o||".5",l/=o,be.style(e,t,l+c)}while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(l=+l||+u||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=l,r.end=i)),i}function w(e){var t,n=e.ownerDocument,r=e.nodeName,i=Ye[r];return i||(t=n.body.appendChild(n.createElement(r)),i=be.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),Ye[r]=i,i)}function x(e,t){for(var n,r,i=[],o=0,a=e.length;o-1)i&&i.push(o);else if(c=be.contains(o.ownerDocument,o),a=T(f.appendChild(o),"script"),c&&k(a),n)for(l=0;o=a[l++];)Qe.test(o.type||"")&&n.push(o);return f}function E(){return!0}function j(){return!1}function S(){try{return ae.activeElement}catch(e){}}function O(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)O(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=j;else if(!i)return e;return 1===o&&(a=i,i=function(e){return be().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=be.guid++)),e.each(function(){be.event.add(this,t,i,r,n)})}function _(e,t){return u(e,"table")&&u(11!==t.nodeType?t:t.firstChild,"tr")?be(">tbody",e)[0]||e:e}function N(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function A(e){var t=st.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function D(e,t){var n,r,i,o,a,s,u,c;if(1===t.nodeType){if(Re.hasData(e)&&(o=Re.access(e),a=Re.set(t,o),c=o.events)){delete a.handle,a.events={};for(i in c)for(n=0,r=c[i].length;n1&&"string"==typeof h&&!ve.checkClone&&at.test(h))return e.each(function(i){var o=e.eq(i);g&&(t[0]=h.call(this,i,o.html())),L(o,t,n,r)});if(d&&(i=C(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=be.map(T(i,"script"),N),u=s.length;f=0&&n= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && Array.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isFunction: function( obj ) { + return jQuery.type( obj ) === "function"; + }, + + isWindow: function( obj ) { + return obj != null && obj === obj.window; + }, + + isNumeric: function( obj ) { + + // As of jQuery 3.0, isNumeric is limited to + // strings and numbers (primitives or objects) + // that can be coerced to finite numbers (gh-2662) + var type = jQuery.type( obj ); + return ( type === "number" || type === "string" ) && + + // parseFloat NaNs numeric-cast false positives ("") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + !isNaN( obj - parseFloat( obj ) ); + }, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + + /* eslint-disable no-unused-vars */ + // See https://github.com/eslint/eslint/issues/6125 + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; + }, + + // Evaluates a script in a global context + globalEval: function( code ) { + DOMEval( code ); + }, + + // Convert dashed to camelCase; used by the css and data modules + // Support: IE <=9 - 11, Edge 12 - 13 + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android <=4.0 only + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: Date.now, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! * Sizzle CSS Selector Engine v2.3.3 * https://sizzlejs.com/ * @@ -21,4 +625,12329 @@ * * Date: 2016-08-08 */ -function(e){function t(e,t,n,r){var i,o,a,s,u,c,l,d=t&&t.ownerDocument,h=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==h&&9!==h&&11!==h)return n;if(!r&&((t?t.ownerDocument||t:W)!==P&&D(t),t=t||P,M)){if(11!==h&&(u=ve.exec(e)))if(i=u[1]){if(9===h){if(!(a=t.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(d&&(a=d.getElementById(i))&&R(t,a)&&a.id===i)return n.push(a),n}else{if(u[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&T.getElementsByClassName&&t.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(i)),n}if(T.qsa&&!U[e+" "]&&(!q||!q.test(e))){if(1!==h)d=t,l=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(xe,Te):t.setAttribute("id",s=I),c=j(e),o=c.length;o--;)c[o]="#"+s+" "+p(c[o]);l=c.join(","),d=me.test(e)&&f(t.parentNode)||t}if(l)try{return Z.apply(n,d.querySelectorAll(l)),n}catch(e){}finally{s===I&&t.removeAttribute("id")}}}return O(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>k.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[I]=!0,e}function i(e){var t=P.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)k.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Ce(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function f(e){return e&&void 0!==e.getElementsByTagName&&e}function d(){}function p(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function y(e,n,r){for(var i=0,o=n.length;i-1&&(r[c]=!(a[c]=f))}}else b=v(b===a?b.splice(h,b.length):b),o?o(null,a,b,u):Z.apply(a,b)})}function b(e){for(var t,n,r,i=e.length,o=k.relative[e[0].type],a=o||k.relative[" "],s=o?1:0,u=h(function(e){return e===t},a,!0),c=h(function(e){return ee(t,e)>-1},a,!0),l=[function(e,n,r){var i=!o&&(r||n!==_)||((t=n).nodeType?u(e,n,r):c(e,n,r));return t=null,i}];s1&&g(l),s>1&&p(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s0,o=e.length>0,a=function(r,a,s,u,c){var l,f,d,p=0,h="0",g=r&&[],y=[],m=_,b=r||o&&k.find.TAG("*",c),w=$+=null==m?1:Math.random()||.1,x=b.length;for(c&&(_=a===P||a||c);h!==x&&null!=(l=b[h]);h++){if(o&&l){for(f=0,a||l.ownerDocument===P||(D(l),s=!M);d=e[f++];)if(d(l,a||P,s)){u.push(l);break}c&&($=w)}i&&((l=!d&&l)&&p--,r&&g.push(l))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,y,a,s);if(r){if(p>0)for(;h--;)g[h]||y[h]||(y[h]=J.call(u));y=v(y)}Z.apply(u,y),c&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(u)}return c&&($=w,_=m),g};return i?r(a):a}var x,T,k,C,E,j,S,O,_,N,A,D,P,L,M,q,F,H,R,I="sizzle"+1*new Date,W=e.document,$=0,B=0,z=n(),X=n(),U=n(),V=function(e,t){return e===t&&(A=!0),0},Y={}.hasOwnProperty,G=[],J=G.pop,Q=G.push,Z=G.push,K=G.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),le=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,ye=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,me=/[+~]/,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},xe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,Te=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ke=function(){D()},Ce=h(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{Z.apply(G=K.call(W.childNodes),W.childNodes),G[W.childNodes.length].nodeType}catch(e){Z={apply:G.length?function(e,t){Q.apply(e,K.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}T=t.support={},E=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},D=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:W;return r!==P&&9===r.nodeType&&r.documentElement?(P=r,L=P.documentElement,M=!E(P),W!==P&&(n=P.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",ke,!1):n.attachEvent&&n.attachEvent("onunload",ke)),T.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),T.getElementsByTagName=i(function(e){return e.appendChild(P.createComment("")),!e.getElementsByTagName("*").length}),T.getElementsByClassName=ye.test(P.getElementsByClassName),T.getById=i(function(e){return L.appendChild(e).id=I,!P.getElementsByName||!P.getElementsByName(I).length}),T.getById?(k.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}},k.find.ID=function(e,t){if(void 0!==t.getElementById&&M){var n=t.getElementById(e);return n?[n]:[]}}):(k.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},k.find.ID=function(e,t){if(void 0!==t.getElementById&&M){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),k.find.TAG=T.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):T.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},k.find.CLASS=T.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&M)return t.getElementsByClassName(e)},F=[],q=[],(T.qsa=ye.test(P.querySelectorAll))&&(i(function(e){L.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||q.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+I+"-]").length||q.push("~="),e.querySelectorAll(":checked").length||q.push(":checked"),e.querySelectorAll("a#"+I+"+*").length||q.push(".#.+[+~]")}),i(function(e){e.innerHTML="";var t=P.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&q.push("name"+ne+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),L.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),q.push(",.*:")})),(T.matchesSelector=ye.test(H=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){T.disconnectedMatch=H.call(e,"*"),H.call(e,"[s!='']:x"),F.push("!=",oe)}),q=q.length&&new RegExp(q.join("|")),F=F.length&&new RegExp(F.join("|")),t=ye.test(L.compareDocumentPosition),R=t||ye.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},V=t?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!T.sortDetached&&t.compareDocumentPosition(e)===n?e===P||e.ownerDocument===W&&R(W,e)?-1:t===P||t.ownerDocument===W&&R(W,t)?1:N?ee(N,e)-ee(N,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===P?-1:t===P?1:i?-1:o?1:N?ee(N,e)-ee(N,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===W?-1:u[r]===W?1:0},P):P},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==P&&D(e),n=n.replace(le,"='$1']"),T.matchesSelector&&M&&!U[n+" "]&&(!F||!F.test(n))&&(!q||!q.test(n)))try{var r=H.call(e,n);if(r||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,P,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==P&&D(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==P&&D(e);var n=k.attrHandle[t.toLowerCase()],r=n&&Y.call(k.attrHandle,t.toLowerCase())?n(e,t,!M):void 0;return void 0!==r?r:T.attributes||!M?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(xe,Te)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!T.detectDuplicates,N=!T.sortStable&&e.slice(0),e.sort(V),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return N=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},k=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=j(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=z[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&z(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var c,l,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,b=!1;if(y){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){for(d=y,f=d[I]||(d[I]={}),l=f[d.uniqueID]||(f[d.uniqueID]={}),c=l[e]||[],p=c[0]===$&&c[1],b=p&&c[2],d=p&&y.childNodes[p];d=++p&&d&&d[g]||(b=p=0)||h.pop();)if(1===d.nodeType&&++b&&d===t){l[e]=[$,p,b];break}}else if(m&&(d=t,f=d[I]||(d[I]={}),l=f[d.uniqueID]||(f[d.uniqueID]={}),c=l[e]||[],p=c[0]===$&&c[1],b=p),!1===b)for(;(d=++p&&d&&d[g]||(b=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++b||(m&&(f=d[I]||(d[I]={}),l=f[d.uniqueID]||(f[d.uniqueID]={}),l[e]=[$,b]),d!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,n){var i,o=k.pseudos[e]||k.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[I]?o(n):o.length>1?(i=[e,e,"",n],k.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(se,"$1"));return i[I]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do{if(n=M?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===L},focus:function(e){return e===P.activeElement&&(!P.hasFocus||P.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:c(!1),disabled:c(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!k.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(a=o[0]).type&&9===t.nodeType&&M&&k.relative[o[1].type]){if(!(t=(k.find.ID(a.matches[0].replace(be,we),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!k.relative[s=a.type]);)if((u=k.find[s])&&(r=u(a.matches[0].replace(be,we),me.test(o[0].type)&&f(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&p(o)))return Z.apply(n,r),n;break}}return(c||S(e,l))(r,t,!M,n,!t||me.test(e)&&f(t.parentNode)||t),n},T.sortStable=I.split("").sort(V).join("")===I,T.detectDuplicates=!!A,D(),T.sortDetached=i(function(e){return 1&e.compareDocumentPosition(P.createElement("fieldset"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),T.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(n);be.find=Ce,be.expr=Ce.selectors,be.expr[":"]=be.expr.pseudos,be.uniqueSort=be.unique=Ce.uniqueSort,be.text=Ce.getText,be.isXMLDoc=Ce.isXML,be.contains=Ce.contains,be.escapeSelector=Ce.escape;var Ee=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&be(e).is(n))break;r.push(e)}return r},je=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},Se=be.expr.match.needsContext,Oe=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,_e=/^.[^:#\[\.,]*$/;be.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?be.find.matchesSelector(r,e)?[r]:[]:be.find.matches(e,be.grep(t,function(e){return 1===e.nodeType}))},be.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(be(e).filter(function(){for(t=0;t1?be.uniqueSort(n):n},filter:function(e){return this.pushStack(c(this,e||[],!1))},not:function(e){return this.pushStack(c(this,e||[],!0))},is:function(e){return!!c(this,"string"==typeof e&&Se.test(e)?be(e):e||[],!1).length}});var Ne,Ae=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(be.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Ne,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Ae.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof be?t[0]:t,be.merge(this,be.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:ae,!0)),Oe.test(r[1])&&be.isPlainObject(t))for(r in t)be.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=ae.getElementById(r[2]),i&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):be.isFunction(e)?void 0!==n.ready?n.ready(e):e(be):be.makeArray(e,this)}).prototype=be.fn,Ne=be(ae);var De=/^(?:parents|prev(?:Until|All))/,Pe={children:!0,contents:!0,next:!0,prev:!0};be.fn.extend({has:function(e){var t=be(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&be.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?be.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?fe.call(be(e),this[0]):fe.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(be.uniqueSort(be.merge(this.get(),be(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),be.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Ee(e,"parentNode")},parentsUntil:function(e,t,n){return Ee(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return Ee(e,"nextSibling")},prevAll:function(e){return Ee(e,"previousSibling")},nextUntil:function(e,t,n){return Ee(e,"nextSibling",n)},prevUntil:function(e,t,n){return Ee(e,"previousSibling",n)},siblings:function(e){return je((e.parentNode||{}).firstChild,e)},children:function(e){return je(e.firstChild)},contents:function(e){return u(e,"iframe")?e.contentDocument:(u(e,"template")&&(e=e.content||e),be.merge([],e.childNodes))}},function(e,t){be.fn[e]=function(n,r){var i=be.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=be.filter(r,i)),this.length>1&&(Pe[e]||be.uniqueSort(i),De.test(e)&&i.reverse()),this.pushStack(i)}});var Le=/[^\x20\t\r\n\f]+/g;be.Callbacks=function(e){e="string"==typeof e?f(e):be.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?be.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},be.extend({Deferred:function(e){var t=[["notify","progress",be.Callbacks("memory"),be.Callbacks("memory"),2],["resolve","done",be.Callbacks("once memory"),be.Callbacks("once memory"),0,"resolved"],["reject","fail",be.Callbacks("once memory"),be.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return be.Deferred(function(n){be.each(t,function(t,r){var i=be.isFunction(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&be.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,r,i){function o(e,t,r,i){return function(){var s=this,u=arguments,c=function(){var n,c;if(!(e=a&&(r!==p&&(s=void 0,u=[n]),t.rejectWith(s,u))}};e?l():(be.Deferred.getStackHook&&(l.stackTrace=be.Deferred.getStackHook()),n.setTimeout(l))}}var a=0;return be.Deferred(function(n){t[0][3].add(o(0,n,be.isFunction(i)?i:d,n.notifyWith)),t[1][3].add(o(0,n,be.isFunction(e)?e:d)),t[2][3].add(o(0,n,be.isFunction(r)?r:p))}).promise()},promise:function(e){return null!=e?be.extend(e,i):i}},o={};return be.each(t,function(e,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add(function(){r=s},t[3-e][2].disable,t[0][2].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=ue.call(arguments),o=be.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?ue.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(h(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||be.isFunction(i[n]&&i[n].then)))return o.then();for(;n--;)h(i[n],a(n),o.reject);return o.promise()}});var Me=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;be.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&Me.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},be.readyException=function(e){n.setTimeout(function(){throw e})};var qe=be.Deferred();be.fn.ready=function(e){return qe.then(e).catch(function(e){be.readyException(e)}),this},be.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--be.readyWait:be.isReady)||(be.isReady=!0,!0!==e&&--be.readyWait>0||qe.resolveWith(ae,[be]))}}),be.ready.then=qe.then,"complete"===ae.readyState||"loading"!==ae.readyState&&!ae.documentElement.doScroll?n.setTimeout(be.ready):(ae.addEventListener("DOMContentLoaded",g),n.addEventListener("load",g));var Fe=function(e,t,n,r,i,o,a){var s=0,u=e.length,c=null==n;if("object"===be.type(n)){i=!0;for(s in n)Fe(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,be.isFunction(r)||(a=!0),c&&(a?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(be(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){Ie.remove(this,e)})}}),be.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Re.get(e,t),n&&(!r||Array.isArray(n)?r=Re.access(e,t,be.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=be.queue(e,t),r=n.length,i=n.shift(),o=be._queueHooks(e,t),a=function(){be.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Re.get(e,n)||Re.access(e,n,{empty:be.Callbacks("once memory").add(function(){Re.remove(e,[t+"queue",n])})})}}),be.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,Qe=/^$|\/(?:java|ecma)script/i,Ze={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Ze.optgroup=Ze.option,Ze.tbody=Ze.tfoot=Ze.colgroup=Ze.caption=Ze.thead,Ze.th=Ze.td;var Ke=/<|&#?\w+;/;!function(){var e=ae.createDocumentFragment(),t=e.appendChild(ae.createElement("div")),n=ae.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),ve.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",ve.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var et=ae.documentElement,tt=/^key/,nt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rt=/^([^.]*)(?:\.(.+)|)/;be.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,c,l,f,d,p,h,g,y=Re.get(e);if(y)for(n.handler&&(o=n,n=o.handler,i=o.selector),i&&be.find.matchesSelector(et,i),n.guid||(n.guid=be.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return void 0!==be&&be.event.triggered!==t.type?be.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(Le)||[""],c=t.length;c--;)s=rt.exec(t[c])||[],p=g=s[1],h=(s[2]||"").split(".").sort(),p&&(f=be.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=be.event.special[p]||{},l=be.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&be.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=u[p])||(d=u[p]=[],d.delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,l):d.push(l),be.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,c,l,f,d,p,h,g,y=Re.hasData(e)&&Re.get(e);if(y&&(u=y.events)){for(t=(t||"").match(Le)||[""],c=t.length;c--;)if(s=rt.exec(t[c])||[],p=g=s[1],h=(s[2]||"").split(".").sort(),p){for(f=be.event.special[p]||{},p=(r?f.delegateType:f.bindType)||p,d=u[p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)l=d[o],!i&&g!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(d.splice(o,1),l.selector&&d.delegateCount--,f.remove&&f.remove.call(e,l));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||be.removeEvent(e,p,y.handle),delete u[p])}else for(p in u)be.event.remove(e,p+t[c],n,r,!0);be.isEmptyObject(u)&&Re.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=be.event.fix(e),u=new Array(arguments.length),c=(Re.get(this,"events")||{})[s.type]||[],l=be.event.special[s.type]||{};for(u[0]=s,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],a={},n=0;n-1:be.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,ot=/\s*$/g;be.extend({htmlPrefilter:function(e){return e.replace(it,"<$1>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=be.contains(e.ownerDocument,e);if(!(ve.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||be.isXMLDoc(e)))for(a=T(s),o=T(e),r=0,i=o.length;r0&&k(a,!u&&T(e,"script")),s},cleanData:function(e){for(var t,n,r,i=be.event.special,o=0;void 0!==(n=e[o]);o++)if(He(n)){if(t=n[Re.expando]){if(t.events)for(r in t.events)i[r]?be.event.remove(n,r):be.removeEvent(n,r,t.handle);n[Re.expando]=void 0}n[Ie.expando]&&(n[Ie.expando]=void 0)}}}),be.fn.extend({detach:function(e){return M(this,e,!0)},remove:function(e){return M(this,e)},text:function(e){return Fe(this,function(e){return void 0===e?be.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return L(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||_(this,e).appendChild(e)})},prepend:function(){return L(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=_(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return L(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return L(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(be.cleanData(T(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return be.clone(this,e,t)})},html:function(e){return Fe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ot.test(e)&&!Ze[(Je.exec(e)||["",""])[1].toLowerCase()]){e=be.htmlPrefilter(e);try{for(;n1)}}),be.Tween=B,B.prototype={constructor:B,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||be.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(be.cssNumber[n]?"":"px")},cur:function(){var e=B.propHooks[this.prop];return e&&e.get?e.get(this):B.propHooks._default.get(this)},run:function(e){var t,n=B.propHooks[this.prop];return this.options.duration?this.pos=t=be.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):B.propHooks._default.set(this),this}},B.prototype.init.prototype=B.prototype,B.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=be.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){be.fx.step[e.prop]?be.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[be.cssProps[e.prop]]&&!be.cssHooks[e.prop]?e.elem[e.prop]=e.now:be.style(e.elem,e.prop,e.now+e.unit)}}},B.propHooks.scrollTop=B.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},be.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},be.fx=B.prototype.init,be.fx.step={};var mt,bt,wt=/^(?:toggle|show|hide)$/,xt=/queueHooks$/;be.Animation=be.extend(J,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return b(n.elem,e,ze.exec(t),n),n}]},tweener:function(e,t){be.isFunction(e)?(t=e,e=["*"]):e=e.match(Le);for(var n,r=0,i=e.length;r1)},removeAttr:function(e){return this.each(function(){be.removeAttr(this,e)})}}),be.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?be.prop(e,t,n):(1===o&&be.isXMLDoc(e)||(i=be.attrHooks[t.toLowerCase()]||(be.expr.match.bool.test(t)?Tt:void 0)),void 0!==n?null===n?void be.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=be.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!ve.radioValue&&"radio"===t&&u(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(Le);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),Tt={set:function(e,t,n){return!1===t?be.removeAttr(e,n):e.setAttribute(n,n),n}},be.each(be.expr.match.bool.source.match(/\w+/g),function(e,t){var n=kt[t]||be.find.attr;kt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=kt[a],kt[a]=i,i=null!=n(e,t,r)?a:null,kt[a]=o),i}});var Ct=/^(?:input|select|textarea|button)$/i,Et=/^(?:a|area)$/i;be.fn.extend({prop:function(e,t){return Fe(this,be.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[be.propFix[e]||e]})}}),be.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&be.isXMLDoc(e)||(t=be.propFix[t]||t,i=be.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=be.find.attr(e,"tabindex");return t?parseInt(t,10):Ct.test(e.nodeName)||Et.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),ve.optSelected||(be.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),be.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){be.propFix[this.toLowerCase()]=this}),be.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(be.isFunction(e))return this.each(function(t){be(this).addClass(e.call(this,t,Z(this)))});if("string"==typeof e&&e)for(t=e.match(Le)||[];n=this[u++];)if(i=Z(n),r=1===n.nodeType&&" "+Q(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=Q(r),i!==s&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(be.isFunction(e))return this.each(function(t){be(this).removeClass(e.call(this,t,Z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(Le)||[];n=this[u++];)if(i=Z(n),r=1===n.nodeType&&" "+Q(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=Q(r),i!==s&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):be.isFunction(e)?this.each(function(n){be(this).toggleClass(e.call(this,n,Z(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=be(this),o=e.match(Le)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=Z(this),t&&Re.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Re.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+Q(Z(n))+" ").indexOf(t)>-1)return!0;return!1}});var jt=/\r/g;be.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=be.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,be(this).val()):e,null==i?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=be.map(i,function(e){return null==e?"":e+""})),(t=be.valHooks[this.type]||be.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=be.valHooks[i.type]||be.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(jt,""):null==n?"":n):void 0}}),be.extend({valHooks:{option:{get:function(e){var t=be.find.attr(e,"value");return null!=t?t:Q(be.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],c=a?o+1:i.length;for(r=o<0?c:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),be.each(["radio","checkbox"],function(){be.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=be.inArray(be(e).val(),t)>-1}},ve.checkOn||(be.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var St=/^(?:focusinfocus|focusoutblur)$/;be.extend(be.event,{trigger:function(e,t,r,i){var o,a,s,u,c,l,f,d=[r||ae],p=he.call(e,"type")?e.type:e,h=he.call(e,"namespace")?e.namespace.split("."):[];if(a=s=r=r||ae,3!==r.nodeType&&8!==r.nodeType&&!St.test(p+be.event.triggered)&&(p.indexOf(".")>-1&&(h=p.split("."),p=h.shift(),h.sort()),c=p.indexOf(":")<0&&"on"+p,e=e[be.expando]?e:new be.Event(p,"object"==typeof e&&e),e.isTrigger=i?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:be.makeArray(t,[e]),f=be.event.special[p]||{},i||!f.trigger||!1!==f.trigger.apply(r,t))){if(!i&&!f.noBubble&&!be.isWindow(r)){for(u=f.delegateType||p,St.test(u+p)||(a=a.parentNode);a;a=a.parentNode)d.push(a),s=a;s===(r.ownerDocument||ae)&&d.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=d[o++])&&!e.isPropagationStopped();)e.type=o>1?u:f.bindType||p,l=(Re.get(a,"events")||{})[e.type]&&Re.get(a,"handle"),l&&l.apply(a,t),(l=c&&a[c])&&l.apply&&He(a)&&(e.result=l.apply(a,t),!1===e.result&&e.preventDefault());return e.type=p,i||e.isDefaultPrevented()||f._default&&!1!==f._default.apply(d.pop(),t)||!He(r)||c&&be.isFunction(r[p])&&!be.isWindow(r)&&(s=r[c],s&&(r[c]=null),be.event.triggered=p,r[p](),be.event.triggered=void 0,s&&(r[c]=s)),e.result}},simulate:function(e,t,n){var r=be.extend(new be.Event,n,{type:e,isSimulated:!0});be.event.trigger(r,null,t)}}),be.fn.extend({trigger:function(e,t){return this.each(function(){be.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return be.event.trigger(e,t,n,!0)}}),be.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){be.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),be.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),ve.focusin="onfocusin"in n,ve.focusin||be.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){be.event.simulate(t,e.target,be.event.fix(e))};be.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=Re.access(r,t);i||r.addEventListener(e,n,!0),Re.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Re.access(r,t)-1;i?Re.access(r,t,i):(r.removeEventListener(e,n,!0),Re.remove(r,t))}}});var Ot=n.location,_t=be.now(),Nt=/\?/;be.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||be.error("Invalid XML: "+e),t};var At=/\[\]$/,Dt=/\r?\n/g,Pt=/^(?:submit|button|image|reset|file)$/i,Lt=/^(?:input|select|textarea|keygen)/i;be.param=function(e,t){var n,r=[],i=function(e,t){var n=be.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!be.isPlainObject(e))be.each(e,function(){i(this.name,this.value)});else for(n in e)K(n,e[n],t,i);return r.join("&")},be.fn.extend({serialize:function(){return be.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=be.prop(this,"elements");return e?be.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!be(this).is(":disabled")&&Lt.test(this.nodeName)&&!Pt.test(e)&&(this.checked||!Ge.test(e))}).map(function(e,t){var n=be(this).val();return null==n?null:Array.isArray(n)?be.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var Mt=/%20/g,qt=/#.*$/,Ft=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,It=/^(?:GET|HEAD)$/,Wt=/^\/\//,$t={},Bt={},zt="*/".concat("*"),Xt=ae.createElement("a");Xt.href=Ot.href,be.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ot.href,type:"GET",isLocal:Rt.test(Ot.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":be.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ne(ne(e,be.ajaxSettings),t):ne(be.ajaxSettings,e)},ajaxPrefilter:ee($t),ajaxTransport:ee(Bt),ajax:function(e,t){function r(e,t,r,s){var c,d,p,w,x,T=t;l||(l=!0,u&&n.clearTimeout(u),i=void 0,a=s||"",k.readyState=e>0?4:0,c=e>=200&&e<300||304===e,r&&(w=re(h,k,r)),w=ie(h,w,k,c),c?(h.ifModified&&(x=k.getResponseHeader("Last-Modified"),x&&(be.lastModified[o]=x),(x=k.getResponseHeader("etag"))&&(be.etag[o]=x)),204===e||"HEAD"===h.type?T="nocontent":304===e?T="notmodified":(T=w.state,d=w.data,p=w.error,c=!p)):(p=T,!e&&T||(T="error",e<0&&(e=0))),k.status=e,k.statusText=(t||T)+"",c?v.resolveWith(g,[d,T,k]):v.rejectWith(g,[k,T,p]),k.statusCode(b),b=void 0,f&&y.trigger(c?"ajaxSuccess":"ajaxError",[k,h,c?d:p]),m.fireWith(g,[k,T]),f&&(y.trigger("ajaxComplete",[k,h]),--be.active||be.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,o,a,s,u,c,l,f,d,p,h=be.ajaxSetup({},t),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?be(g):be.event,v=be.Deferred(),m=be.Callbacks("once memory"),b=h.statusCode||{},w={},x={},T="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(l){if(!s)for(s={};t=Ht.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return l?a:null},setRequestHeader:function(e,t){return null==l&&(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==l&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)k.always(e[k.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(v.promise(k),h.url=((e||h.url||Ot.href)+"").replace(Wt,Ot.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(Le)||[""],null==h.crossDomain){c=ae.createElement("a");try{c.href=h.url,c.href=c.href,h.crossDomain=Xt.protocol+"//"+Xt.host!=c.protocol+"//"+c.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=be.param(h.data,h.traditional)),te($t,h,t,k),l)return k;f=be.event&&h.global,f&&0==be.active++&&be.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!It.test(h.type),o=h.url.replace(qt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Mt,"+")):(p=h.url.slice(o.length),h.data&&(o+=(Nt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ft,"$1"),p=(Nt.test(o)?"&":"?")+"_="+_t+++p),h.url=o+p),h.ifModified&&(be.lastModified[o]&&k.setRequestHeader("If-Modified-Since",be.lastModified[o]),be.etag[o]&&k.setRequestHeader("If-None-Match",be.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&k.setRequestHeader("Content-Type",h.contentType),k.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+zt+"; q=0.01":""):h.accepts["*"]);for(d in h.headers)k.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(!1===h.beforeSend.call(g,k,h)||l))return k.abort();if(T="abort",m.add(h.complete),k.done(h.success),k.fail(h.error),i=te(Bt,h,t,k)){if(k.readyState=1,f&&y.trigger("ajaxSend",[k,h]),l)return k;h.async&&h.timeout>0&&(u=n.setTimeout(function(){k.abort("timeout")},h.timeout));try{l=!1,i.send(w,r)}catch(e){if(l)throw e;r(-1,e)}}else r(-1,"No Transport");return k},getJSON:function(e,t,n){return be.get(e,t,n,"json")},getScript:function(e,t){return be.get(e,void 0,t,"script")}}),be.each(["get","post"],function(e,t){be[t]=function(e,n,r,i){return be.isFunction(n)&&(i=i||r,r=n,n=void 0),be.ajax(be.extend({url:e,type:t,dataType:i,data:n,success:r},be.isPlainObject(e)&&e))}}),be._evalUrl=function(e){return be.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},be.fn.extend({wrapAll:function(e){var t;return this[0]&&(be.isFunction(e)&&(e=e.call(this[0])),t=be(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return be.isFunction(e)?this.each(function(t){be(this).wrapInner(e.call(this,t))}):this.each(function(){var t=be(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=be.isFunction(e);return this.each(function(n){be(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){be(this).replaceWith(this.childNodes)}),this}}),be.expr.pseudos.hidden=function(e){return!be.expr.pseudos.visible(e)},be.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},be.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Vt=be.ajaxSettings.xhr();ve.cors=!!Vt&&"withCredentials"in Vt,ve.ajax=Vt=!!Vt,be.ajaxTransport(function(e){var t,r;if(ve.cors||Vt&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=r=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Ut[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),r=s.onerror=t("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout(function(){t&&r()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),be.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),be.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return be.globalEval(e),e}}}),be.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),be.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=be(" + {% include '@Lin3sPatternLibraryBuilder/partials/javascripts.html.twig' %} From 84cedfb85bc817986c8dbfc5f0911c1b71a2d670 Mon Sep 17 00:00:00 2001 From: Gorka Laucirica Date: Mon, 24 Jul 2017 18:15:35 +0200 Subject: [PATCH 07/11] Fixed homepage grid alignment --- .../Resources/assets/build/patternlibrary.css | 4 ++-- .../Resources/assets/scss/renderer/_homepage.scss | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.css b/src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.css index 1493b11..6a4c7bf 100644 --- a/src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.css +++ b/src/LIN3S/PatternLibraryBuilder/Resources/assets/build/patternlibrary.css @@ -587,8 +587,8 @@ code[class*="language-"], pre[class*="language-"] { margin-top: 15px; } .homepage__items { - -ms-flex-align: baseline; - align-items: baseline; + -ms-flex-align: end; + align-items: flex-end; display: -ms-grid; display: grid; grid-gap: 30px; diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/assets/scss/renderer/_homepage.scss b/src/LIN3S/PatternLibraryBuilder/Resources/assets/scss/renderer/_homepage.scss index 9eb8d3f..5938749 100644 --- a/src/LIN3S/PatternLibraryBuilder/Resources/assets/scss/renderer/_homepage.scss +++ b/src/LIN3S/PatternLibraryBuilder/Resources/assets/scss/renderer/_homepage.scss @@ -40,7 +40,7 @@ $homepage-item-link-size: $font-size-14; } .homepage__items { - align-items: baseline; + align-items: flex-end; display: grid; grid-gap: 30px; grid-template-columns: repeat(4, 1fr); From 7e5f6cbe7c10712de44bfe9f69e1ac179630b4b6 Mon Sep 17 00:00:00 2001 From: Gorka Laucirica Date: Mon, 24 Jul 2017 18:17:49 +0200 Subject: [PATCH 08/11] Dont inherit context in homepage renderer --- .../Resources/templates/renderers/homepage.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/homepage.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/homepage.html.twig index 1b56f8c..e8f024e 100644 --- a/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/homepage.html.twig +++ b/src/LIN3S/PatternLibraryBuilder/Resources/templates/renderers/homepage.html.twig @@ -9,7 +9,7 @@
{% if item.config.config.renderer.type == 'twig' %} {% set options = item.config.config.renderer.options %} - {{ include(options.template, options.preview_parameters|first) }} + {{ include(options.template, options.preview_parameters|first, with_context = false) }} {% endif %}
From c830eea4f5e6bb26cbd8132f2b8f1db1a1b1851c Mon Sep 17 00:00:00 2001 From: Gorka Laucirica Date: Tue, 25 Jul 2017 11:13:58 +0200 Subject: [PATCH 09/11] Fixed issues with renderers after changing item config array --- src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php | 2 +- src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php index 6a5b273..dc89614 100644 --- a/src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Colors.php @@ -14,7 +14,7 @@ public function __construct(\Twig_Environment $twig) public function render($item) { return $this->twig->render('@Lin3sPatternLibraryBuilder/renderers/colors.html.twig', [ - 'colors' => $item['renderer']['options']['colors'], + 'colors' => $item['config']['renderer']['options']['colors'], ]); } } diff --git a/src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php b/src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php index 2995d98..b8bc988 100644 --- a/src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php +++ b/src/LIN3S/PatternLibraryBuilder/Renderer/Typography.php @@ -14,7 +14,7 @@ public function __construct(\Twig_Environment $twig) public function render($item) { return $this->twig->render('@Lin3sPatternLibraryBuilder/renderers/typography.html.twig', [ - 'typographies' => $item['renderer']['options']['typographies'], + 'typographies' => $item['config']['renderer']['options']['typographies'], ]); } } From 09f8dff8f2e9c2ff573c250e7829a484e88ec2e4 Mon Sep 17 00:00:00 2001 From: Gorka Laucirica Date: Tue, 25 Jul 2017 12:20:04 +0200 Subject: [PATCH 10/11] Fixed issues with aside menu after config structure changes --- composer.json | 1 + .../templates/layouts/aside.html.twig | 57 ++++++++++--------- tests/Application/app/AppKernel.php | 2 + 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/composer.json b/composer.json index 32e8fbb..cb6403a 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "phpspec/phpspec": "^3.3", "symfony/asset": "^3.3", "symfony/console": "^3.3", + "symfony/debug-bundle": "^3.3", "symfony/twig-bundle": "^3.3", "symfony/var-dumper": "^3.3", "symfony/web-server-bundle": "^3.3", diff --git a/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/aside.html.twig b/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/aside.html.twig index 8507d7d..948d7da 100644 --- a/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/aside.html.twig +++ b/src/LIN3S/PatternLibraryBuilder/Resources/templates/layouts/aside.html.twig @@ -1,4 +1,4 @@ -{% macro accordion_menu(children, breadcrumbs) %} +{% macro accordion_menu(children, pages, breadcrumbs) %} {% import _self as macros %} {% set items = [] %} @@ -20,39 +20,40 @@ {% set items = items|merge([{ header: accordion_item_title, - content: macros.accordion_menu(item.children, breadcrumbs), + content: macros.accordion_menu(item.children, item.pages, breadcrumbs), modifiers: modifiers, class_name: item_class_name, finder_value: item_title }]) %} + {% endfor %} - {% for item in item.pages %} - {% set accordion_item_title %} - {% embed '@Lin3sPatternLibraryBuilder/components/link.html.twig' with { - url: '/design-system/' ~ item.slug, - target: '_self' - } %} - {%- block link_content -%} - {% include '@Lin3sPatternLibraryBuilder/components/status.html.twig' with { - level: item.status|default(' '), - tag: 'span' - } %} - {{ item.title }} - {%- endblock -%} - {% endembed %} - {% endset %} + {% for item in pages %} + {% set item_title = item.title|replace({'-': ' '}) %} + {% set accordion_item_title %} + {% embed '@Lin3sPatternLibraryBuilder/components/link.html.twig' with { + url: '/design-system/' ~ item.slug, + target: '_self' + } %} + {%- block link_content -%} + {% include '@Lin3sPatternLibraryBuilder/components/status.html.twig' with { + level: item.status|default(' '), + tag: 'span' + } %} + {{ item.title }} + {%- endblock -%} + {% endembed %} + {% endset %} - {% set modifiers = modifiers|merge(['leaf']) %} - {% set item_class_name = 'finder__subject' %} + {% set modifiers = [] %} + {% set item_class_name = 'finder__subject' %} - {% set items = items|merge([{ - header: accordion_item_title, - content: null, - modifiers: modifiers|merge(['leaf']) , - class_name: 'finder__subject', - finder_value: item_title - }]) %} - {% endfor %} + {% set items = items|merge([{ + header: accordion_item_title, + content: null, + modifiers: modifiers|merge(['leaf']) , + class_name: 'finder__subject', + finder_value: item_title + }]) %} {% endfor %} {% include '@Lin3sPatternLibraryBuilder/components/accordion.html.twig' with { @@ -75,7 +76,7 @@ } %} {% block finder_subjects %} {% import '@Lin3sPatternLibraryBuilder/layouts/aside.html.twig' as aside %} - {{ aside.accordion_menu(menu.children, breadcrumbs) }} + {{ aside.accordion_menu(menu.children, menu.pages, breadcrumbs) }} {% endblock %} {% endembed %} diff --git a/tests/Application/app/AppKernel.php b/tests/Application/app/AppKernel.php index a86e6ba..70c2e9c 100644 --- a/tests/Application/app/AppKernel.php +++ b/tests/Application/app/AppKernel.php @@ -14,6 +14,7 @@ namespace Tests\LIN3S\PatternLibraryBuilder; use LIN3S\PatternLibraryBuilder\Symfony\Lin3sPatternLibraryBuilderBundle; +use Symfony\Bundle\DebugBundle\DebugBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Bundle\TwigBundle\TwigBundle; @@ -40,6 +41,7 @@ public function registerBundles() : array if ('dev' === $this->getEnvironment()) { $bundles[] = new WebServerBundle(); + $bundles[] = new DebugBundle(); } return $bundles; From 3341ee0220862ee3083caed4707601818355e7a1 Mon Sep 17 00:00:00 2001 From: Gorka Laucirica Date: Tue, 25 Jul 2017 21:22:24 +0200 Subject: [PATCH 11/11] Added changelog and docs skeleton --- CHANGELOG.md | 13 ++++++++++ README.md | 27 ++++++++++++++++---- docs/first_use_installing_and_configuring.md | 3 +++ docs/first_use_your_first_page.md | 3 +++ docs/renderers_create_custom.md | 3 +++ docs/renderers_usage.md | 3 +++ docs/symfony_configuration_reference.md | 3 +++ docs/theme_customize_default.md | 3 +++ 8 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 docs/first_use_installing_and_configuring.md create mode 100644 docs/first_use_your_first_page.md create mode 100644 docs/renderers_create_custom.md create mode 100644 docs/renderers_usage.md create mode 100644 docs/symfony_configuration_reference.md create mode 100644 docs/theme_customize_default.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ec8e8b0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# CHANGELOG + +This changelog references the relevant changes done between versions. + +To get the diff for a specific change, go to https://github.com/LIN3S/PatternLibraryBuilder/commit/XXX where XXX is the change hash +To get the diff between two versions, go to https://github.com/LIN3S/PatternLibraryBuilder/compare/v0.1.0...v0.2.0 + +* 0.2.0 + * [BC break] Renderers. Changed configuration yml structure to adapt to new renderer (#12). + To upgrade check renderers documentation. + +* 0.1.0 + * Initial release diff --git a/README.md b/README.md index 0e70f12..0a35383 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,39 @@ # PatternLibraryBuilder > Library that provides an elegant and easy way to develop a pattern library for your front-end components -## Requirements -PHP >= 7.1
+## Features + +* YAML config driven pattern library builder +* Opinated and extensible default template +* Use already existing renderers to list colors, typography, iconography +* Render twig templates in responsive viewports and with autogenerated twig "include" method and HTML output +* Easily create your renderer to adapt it to your needs +* Standalone PHP library with built-in Symfony integration ## Installation + The easiest way to install this bundle is using [Composer][1] ```bash $ composer require lin3s/pattern-library-builder ``` ## Documentation -All the documentation is stored in the `docs` folder. -[Show me the docs!](PatternLibraryBuilder/docs/index.md) +* First use + * [Installing and configuring](docs/first_use_installing_and_configuring.md) + * [Your first page](docs/first_use_your_first_page.md) +* Renderers + * [Using renderers](docs/renderers_usage.md) + * [Creating custom renderers](docs/renderers_create_custom.md) +* Theme + * [Customizing default theme](docs/theme_customize_default.md) +* Symfony integration + * [Configuration reference](docs/symfony_configuration_reference.md) + +> All the documentation is stored in the `docs` folder. ## Tests -This library is completely tested by **[PHPSpec][2], SpecBDD framework for PHP**. +This library is tested by **[PHPSpec][2], SpecBDD framework for PHP**. Run the following command to launch tests: ```bash diff --git a/docs/first_use_installing_and_configuring.md b/docs/first_use_installing_and_configuring.md new file mode 100644 index 0000000..2a16c9f --- /dev/null +++ b/docs/first_use_installing_and_configuring.md @@ -0,0 +1,3 @@ +# Installing and configuring + +> TODO diff --git a/docs/first_use_your_first_page.md b/docs/first_use_your_first_page.md new file mode 100644 index 0000000..c695fff --- /dev/null +++ b/docs/first_use_your_first_page.md @@ -0,0 +1,3 @@ +# Your first page + +For this example we are showing diff --git a/docs/renderers_create_custom.md b/docs/renderers_create_custom.md new file mode 100644 index 0000000..bdbce52 --- /dev/null +++ b/docs/renderers_create_custom.md @@ -0,0 +1,3 @@ +# Creating custom renderers + +> TODO diff --git a/docs/renderers_usage.md b/docs/renderers_usage.md new file mode 100644 index 0000000..e931242 --- /dev/null +++ b/docs/renderers_usage.md @@ -0,0 +1,3 @@ +# Using renderers + +> TODO diff --git a/docs/symfony_configuration_reference.md b/docs/symfony_configuration_reference.md new file mode 100644 index 0000000..db0f495 --- /dev/null +++ b/docs/symfony_configuration_reference.md @@ -0,0 +1,3 @@ +# Symfony Configuration reference + +> TODO diff --git a/docs/theme_customize_default.md b/docs/theme_customize_default.md new file mode 100644 index 0000000..9fbd9cd --- /dev/null +++ b/docs/theme_customize_default.md @@ -0,0 +1,3 @@ +# Customizing default theme + +> TODO