Files
2019-05-21 12:35:33 -07:00

20 lines
560 B
JavaScript

require([
'underscore',
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {
var defaultTokenSpace = mvc.Components.getInstance('default');
// This will take every textarea that has a data-token attribute and will make the given token with the value of the textarea
$('textarea[data-token]').each(function (textarea) {
$(this).on('input', function(input) {
var token_to_set = $(this).data('token');
defaultTokenSpace.set(token_to_set, $(this).val());
})
})
});