File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -282,6 +282,25 @@ jQuery(document).ready(
282
282
}
283
283
} ) ;
284
284
285
+ // Download the modified events
286
+ $ ( '.container' ) . on ( 'click' , 'button.download_events' , function ( ) {
287
+ var formEvents = [ ] ;
288
+ $ ( '.formEvents' ) . each ( function ( ) {
289
+ try {
290
+ formEvents . push ( JSON . parse ( $ ( this ) . val ( ) ) ) ;
291
+ } catch ( e ) {
292
+ window . logMessages ( "Invalid json format :\n" + $ ( this ) . val ( ) ) ;
293
+ return false ;
294
+ }
295
+ } ) ;
296
+ if ( formEvents . length !== 0 ) {
297
+ var jsonData = JSON . stringify ( formEvents , null , 2 ) ;
298
+ downloadFile ( jsonData , "application/json;charset=utf-8" , "events.json" ) ;
299
+ } else {
300
+ window . logMessages ( "Data not available for download!" ) ;
301
+ }
302
+ } ) ;
303
+
285
304
function getTemplate ( name ) {
286
305
var request = new XMLHttpRequest ( ) ;
287
306
request . open ( "GET" , frontendServiceUrl + '/download/' + name , true ) ;
Original file line number Diff line number Diff line change @@ -102,15 +102,21 @@ <h6>
102
102
</ div >
103
103
< div class ="row-fluid divpad " id ="submitButton ">
104
104
< div class ="row ">
105
- < div class ="col-5 ">
105
+ < div class ="col-4 ">
106
106
< button class ="btn btn-success download_rules white-space-normal ">
107
107
Download Rules
108
108
< i class ="fa fa-fw fa-download "> </ i >
109
109
</ button >
110
110
</ div >
111
- < div class ="col-7 ">
111
+ < div class ="col-4 text-center ">
112
112
< button class ="btn btn-success find_aggregated_object white-space-normal " data-bind ="click : $root.submit.bind($data) "> Find Aggregated Object</ button >
113
113
</ div >
114
+ < div class ="col-4 ">
115
+ < button class ="btn btn-success download_events white-space-normal float-right ">
116
+ Download Events
117
+ < i class ="fa fa-fw fa-download "> </ i >
118
+ </ button >
119
+ </ div >
114
120
</ div >
115
121
</ div >
116
122
</ div >
You can’t perform that action at this time.
0 commit comments