This plugin adds the StimulusJS framework to your Redmine application, so it can easily be used by other plugins
This plugin has been tested with Redmine 3.4+.
Please apply general instructions for plugins here.
Download the source or clone the plugin and put it in the "plugins/" directory of your redmine instance. Note that this is crucial that the directory is named redmine_base_stimulusjs! Finally, restart your Redmine instance.
Html markup
<h1>Hello, Stimulus</h1>
<div data-controller="hello">
<input data-target="hello.name" type="text">
<button data-action="click->hello#greet">Greet</button>
<br>
<input data-target="hello.output" type="text" readonly>
</div>
JS Controller
(function() {
stimulus_application.register("hello", class extends Stimulus.Controller {
static targets = [ "name", "output" ]
greet() {
const greeting = "Hello, " + this.nameTarget.value
this.outputTarget.value = greeting
}
})
})();
This plugin provides the window.stimulus_application
global variable which make it easy to register new controllers.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
This project is released under the MIT license, see LICENSE file.