Skip to content

"Open in new window" should be a page with no PL JS #265

@EvanLovely

Description

@EvanLovely

I am using Pattern Lab Node v1.1.2 on Mac, using the grunt configuration.

Expected Behavior

When I view a pattern and click on "Open in new window" I should get an HTML page with no Pattern Lab assets so I can help troubleshoot to see if things like JS errors are from my code or conflicts with my code and Pattern Lab's JS. Currently this is loaded on that page and comes from ./source/_patternlab-files/pattern-header-footer/footer.html:

    <script>
        // handle injection of items from PHP
        var patternPartial = "{{ patternGroup }}-{{ patternName }}";
        var lineage = [{{{ lineage }}}];
        var lineageR = [{{{ lineageR }}}];
        var patternState = "{{patternState}}";
        var baseurl = "{{{baseurl}}}";
        var cssEnabled = false; //TODO
    </script>

    <script type="text/html" id="sg-pattern-html">
{{ patternHTML }}
    </script>

    <script type="text/html" id="sg-pattern-css">
{{ patternCSS }}
    </script>
    <script src="../../styleguide/js/vendor/jwerty.js"></script>
    <script src="../../styleguide/js/postmessage.js"></script>
    <script src="../../data/annotations.js"></script>
    <script src="../../styleguide/js/annotations-pattern.js"></script>
    <script src="../../styleguide/js/code-pattern.js"></script>
    <!-- /DO NOT MODIFY -->
Actual Behavior

I go to the "Open in New Window" page and see <script> tags other than I added.

Steps to Reproduce
  1. Clone site, run npm i && grunt serve
  2. Select a single components to go to.
  3. Up in the menu bar under the gear icon, click "Open in new window"
  4. Inspect element and look right before the close of the </body> tag.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions