mirror of
https://github.com/asphyxia-core/plugin-template.git
synced 2026-09-07 18:05:14 -05:00
v1.50a example
This commit is contained in:
@@ -24,6 +24,11 @@
|
||||
button.button.is-primary#plugin-click
|
||||
| Send "click" event and refresh
|
||||
|
||||
p#random-number RandomNumber: Click the button below to get a random number
|
||||
p
|
||||
button.button.is-primary#plugin-random
|
||||
| Use emit() to get a random number
|
||||
|
||||
//- You can include custom javascripts and send data back to plugin using emit()
|
||||
see profile_name.pug for sending data using form
|
||||
script(src="static/js/custom_page.js")
|
||||
@@ -1,5 +1,11 @@
|
||||
$('#plugin-click').on('click', () => {
|
||||
emit('click', {}).then(() => {
|
||||
emit('click').then(() => {
|
||||
location.reload();
|
||||
});
|
||||
});
|
||||
|
||||
$('#plugin-random').on('click', () => {
|
||||
emit('random').then(result => {
|
||||
$('#random-number').text(result.data.number);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user