Quickly create your own Tampermonkey/Greasemonkey/snippet script!
- 1.0
- 1.0.0
- Template now exists!
- 1.0.0
Follow these steps
- Set script name (defaults to my-project) in the following locations:
- settings.gradle
- build.gradle
- Set author name, description
- build.gradle
- Add JavaScript/HTML/CSS/tests to the appropriate places in the
src/page
folder. NOTE: This template uses the Knockout framework. - Run
gradle build
orgradle clean build
to create your single-file devtools or Tampermonkey script!
- Add folder to
src/
directory\ -- src \ -- new-item \ -- new-item.js -- new-item.spec.js -- new-item.html -- new-item.css
- Add component to
spec/SpecRunner.html
to get tests to run<script src="../src/new-item/new-item.js"></script> <script src="../src/new-item/new-item.spec.js"></script>
- Add JavaScript placeholder to
shell.js
${src/new-item/new-item.js}
- Add HTML to wherever it's needed (e.g. inside
page.html
)${src/new-item/new-item.html}
- Add logic to
new-item.js
file and tests for that logic innew-item.spec.js
- In build.gradle,
cssProperties
contains (obviously) CSS properties. Use like this:background-color: $midnight
. The build will resolve the placeholder so it will end up withbackground-color: #2c3e50
. - CSS will be picked up without explictly adding it anywhere