wvuweb / hammer

A tool for CleanSlate theme development
https://cleanslate.wvu.edu
4 stars 2 forks source link

Page Javascript #27

Closed zeroedin closed 9 years ago

zeroedin commented 9 years ago

Sometimes javascript gets abstracted out to the environment by way of page properties. This is helpful if you have different javascript configurations for different environments. dev/staging/production.

Hammer should have the ability to use the page: object to inject javascript to mock this functionality in cleanslate.

Example:

page:
  javascript: |
    <script>
      // This javascript would be injected into the DOM before the </body> tag
      // This javascript would exist in cleanslate page properties javascript tab.
    </script>
zeroedin commented 9 years ago

Syntax is as follows, hammer will add a script tag no need to include that in your mock_data.yml

page:
  javascript: |
    // create an alert dialog
    alert('hello')