Skip to content

Instantly share code, notes, and snippets.

@hobbes3
Last active August 29, 2015 14:05
Show Gist options
  • Save hobbes3/9e2fbc495b39912504d8 to your computer and use it in GitHub Desktop.
Save hobbes3/9e2fbc495b39912504d8 to your computer and use it in GitHub Desktop.
splunkjs template js
require([
'jquery',
'underscore',
'splunkjs/mvc',
'splunkjs/mvc/simplexml/ready!'
], function(
$,
_,
mvc
) {
function submit_and_update_url() {
submitted_tokens.set(unsubmitted_tokens.toJSON());
mvc.Components.get('url').saveOnlyWithPrefix('form\\.', unsubmitted_tokens.toJSON(), {
replaceState: false
});
}
var unsubmitted_tokens = mvc.Components.get('default');
var submitted_tokens = mvc.Components.get('submitted');
// Your JS code here.
require(['splunkjs/ready!'], function() {
// Custom SimpleSplunkView (ie d3 vizs) are loaded in here.
// So unless you're using a custom JS viz, you probably don't need this block.
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment