updated gmaps plugin
[myslice.git] / plugins / queryupdater / static / js / queryupdater.js
1 /**
2  * MySlice QueryUpdater plugin
3  * Version: 0.1.0
4  * URL: http://www.myslice.info
5  * Description: display of selected resources
6  * Requires: 
7  * Author: The MySlice Team
8  * Copyright: Copyright 2012 UPMC Sorbonne Universités
9  * License: GPLv3
10  */
11
12 (function( $ ){
13
14     var debug=false;
15     debug=true;
16
17     // XXX record selected (multiple selection ?)
18     // XXX record disabled ?
19     // XXX out of sync plugin ?
20     // XXX out of date record ?
21     // record tags ???
22     //
23     // criticality of the absence of a handler in a plugin
24     // non-critical only can have switch case
25     // 
26     // Record state through the query cycle
27
28
29     var QueryUpdaterPlugin = Plugin.extend({
30
31         /**************************************************************************
32          *                          CONSTRUCTOR
33          **************************************************************************/
34
35         init: function(options, element) {
36                 this.classname="queryupdater";
37             this._super(options, element);
38
39             var self = this;
40
41             this.initial = Array();
42             this.selected_resources = Array();
43
44             this.table = this.elmt('table').dataTable({
45 // the original querytable layout was
46 //                sDom: "<'row'<'col-xs-5'l><'col-xs-1'r><'col-xs-6'f>>t<'row'<'col-xs-5'i><'col-xs-7'p>>",
47 // however the bottom line with 'showing blabla...' and the navigation widget are not really helpful
48                 sDom: "<'row'<'col-xs-5'l><'col-xs-1'r><'col-xs-6'f>>t>",
49 // so this does not matter anymore now that the pagination area is turned off
50 //                sPaginationType: 'bootstrap',
51                       bAutoWidth: true,
52 //                bJQueryUI      : true,
53 //                bRetrieve      : true,
54 //                sScrollX       : '100%',                 // Horizontal scrolling 
55 //                bSortClasses   : false,              // Disable style for the sorted column
56 //                aaSorting      : [[ 0, 'asc' ]],        // Default sorting on URN
57 //                fnDrawCallback: function() {      // Reassociate close click every time the table is redrawn
58 //                    /* Prevent to loop on click while redrawing table  */
59 //                    $('.ResourceSelectedClose').unbind('click');
60 //                    /* Handle clicks on close span */
61 //                    /* Reassociate close click every time the table is redrawn */
62 //                    $('.ResourceSelectedClose').bind('click', self, self._close_click);
63 //                }
64              });
65             
66             // XXX This should not be done at init...
67             this.elmt('update').click(this, this.do_checksla);
68             this.elmt('refresh').click(this, this.do_refresh);
69             this.elmt('reset').click(this, this.do_reset);
70             this.elmt('clear_annotations').click(this, this.do_clear_annotations);
71
72             this.listen_query(options.query_uuid);
73         },
74
75         /*************************** PLUGIN EVENTS ****************************/
76
77         /***************************** GUI EVENTS *****************************/
78
79         do_checksla: function(e) {
80             var username = e.data.options.username;
81             var urn = data.value;
82             var arrayselectedresources = data.selected_resources;
83
84             var accepted_sla = Array();
85             var count = 0;
86             var self = e.data;
87             // XXX check that the query is not disabled
88
89             console.log("DATA VALUE: " + data.value);
90             
91             //<p>SLA description</p>
92             //<p>Testbed guarantees 0.99 Uptime rate for 0.99 rate of the VirtualWall resources during the sliver lifetime</p>
93             //<p>SLA description</p>
94             //<p>Testbed guarantees 0.99 Uptime rate for 0.99 rate of the WiLab2 resources during the sliver lifetime</p>
95             var promt = $('#modal-body');
96             
97             // id="myModalLabel"
98             var flagVW = false;
99             var  flagWi = false;
100
101             promt.append('<p>SLA description</p>');
102             
103             var wilabForm = "";
104             wilabForm += "<ul>";
105             for(var iter = 0; iter < arrayselectedresources.length; iter++){
106                 var list = '<li class="wi'+iter+'" name=wi"'+iter+'">'+arrayselectedresources[iter].toLowerCase()+'</li>';
107                 
108                 if (arrayselectedresources[iter].toLowerCase().indexOf("wilab2") >= 0){
109
110                     accepted_sla.push({"wilab2":false}); 
111                     wilabForm += list;   
112                     flagWi = true;             
113
114                 }
115
116             }
117             wilabForm += "</ul>";
118
119             //var wallmessage = '<p>SLA description</p><p>Testbed guarantees 0.99 Uptime rate for 0.99 rate of the VirtualWall resources during the sliver lifetime</p>';
120
121             var wallForm = "";
122             wallForm += "<ul>";
123             for(var iter = 0; iter < arrayselectedresources.length; iter++){
124                 var list = '<li class="wall'+iter+'" name=wall"'+iter+'" >'+arrayselectedresources[iter].toLowerCase()+'</li>';
125                 
126                 if (arrayselectedresources[iter].toLowerCase().indexOf("wall2") >= 0){
127
128                     accepted_sla.push({"wall2":false});
129                     wallForm += list;
130                     flagVW = true;
131                     
132                 }
133
134             }
135             wallForm += "</ul>";
136             
137             var flagDouble = false;
138             if(flagWi)
139             {
140                 flagDouble = true;
141                 promt.append('<p>Testbed guarantees 0.99 Uptime rate for 0.99 rate of the WiLab2 resources during the sliver lifetime</p>');
142                 promt.append(wilabForm);
143                 promt.append('<br />');
144             }
145             if(flagVW)
146             {
147                 //promt.append(wallmessage);
148                 flagDouble = true;
149                 promt.append('<p>Testbed guarantees 0.99 Uptime rate for 0.99 rate of the VirtualWall resources during the sliver lifetime</p>');
150                 promt.append(wallForm);
151                 promt.append('<br />');
152             }
153
154                         
155             // var wimessage = '<p>SLA description</p><p>Testbed guarantees 0.99 Uptime rate for 0.99 rate of the VirtualWall resources during the sliver lifetime</p>'
156
157             if(flagWi || flagVW){
158                 $('#sla_dialog').show();
159
160                     $('#slamodal-wilab2').modal('show');
161             }
162             else
163             {
164                 
165
166                 var username = e.data.options.username;
167                 var urn = data.value;
168                 // XXX check that the query is not disabled
169
170                 self.spin();
171                 // XXX check that the query is not disabled
172                 manifold.raise_event(self.options.query_uuid, RUN_UPDATE);
173                 return;
174             }
175                     
176                         $("#accept_sla_wilab2").click(function(){
177                             console.log("SLA ACCEPTED");
178                             console.log("With username: " + username);
179
180                             // var promt = $('#modal-body');
181                             // var notchecked = true;
182                             // for (var i=0;i<50;i++)
183                             // {
184                             //     var wielement = $('#wi'+i);
185                             //     var wallElement = $('#wall'+i);
186                             //     if(wielement != null && !wielement.checked)
187                             //     {
188                             //         notchecked = false;
189                             //     }
190                             //     if(wallElement!= null && !wallElement.checked)
191                             //     {
192                             //         notchecked = false;
193                             //     }
194                             // }
195             
196                                                        
197                                 if(flagDouble)
198                                 {
199                                     $.post("/sla/agreements/simplecreate", 
200                                         { "template_id": "iMindsServiceWiLab2",
201                                           "user": username,
202                                           "expiration_time": new Date().toISOString()
203                                        });
204                                      $.post("/sla/agreements/simplecreate", 
205                                         { "template_id": "iMindsServiceVirtualwall",
206                                           "user": username,
207                                           "expiration_time": new Date().toISOString()
208                                        });
209                             
210                                     $('#slamodal-wilab2').modal('hide');
211                                 accepted_sla["wilab2"] = true;
212                             
213                                 manifold.raise_event(self.options.query_uuid, RUN_UPDATE);
214                             }
215                             $('#modal-body').empty();
216                         }); 
217                     
218                         $("#dismiss_sla_wilab2").click(function(){
219                             console.log("SLA NOT ACCEPTED");
220                             $('#slamodal-wilab2').modal('hide');
221                             $('#modal-body').empty();
222                         }); 
223                 
224             // } else {
225             //     this.do_update(e);
226             // }
227
228             // for(var iter = 0; iter < arrayselectedresources.length; iter++){
229             //     var list = '<input type="checkbox" name="'+iter+'" >'+arrayselectedresources[iter].toLowerCase()+'<br>';
230             //     promt.append(list);
231             //     if (arrayselectedresources[iter].toLowerCase().indexOf("wall2") >= 0){
232
233
234                     
235             //         accepted_sla.push({"wall2":false});
236
237             //         $('#sla_dialog').show();
238             //         $('#slamodal-virtualwall').modal('show');
239                     
240                     
241             //             $("#accept_sla_vwall").click(function(){
242             //                 console.log("SLA ACCEPTED");
243             //                 console.log("With username: " + username);
244                         
245             //                 $.post("/sla/agreements/simplecreate", 
246             //                     { "template_id": "iMindsServiceVirtualwall",
247             //                       "user": username,
248             //                       "expiration_time": new Date()
249             //                     });
250                         
251             //                 $('#slamodal-virtualwall').modal('hide');
252             //                 accepted_sla["wall2"] = true;
253             //             }); 
254
255             //             $("#dismiss_sla_vwall").click(function(){
256             //                 console.log("SLA NOT ACCEPTED");
257             //                 $('#slamodal-vir').modal('hide');
258             //             }); 
259                     
260             //     }
261
262             //     if (arrayselectedresources[iter].toLowerCase().indexOf("wilab2") >= 0){
263
264             //         accepted_sla.push({"wilab2":false});
265
266             //         $('#sla_dialog').show();
267             //         $('#slamodal-wilab2').modal('show');
268                     
269                     
270             //             $("#accept_sla_wilab2").click(function(){
271             //                 console.log("SLA ACCEPTED");
272             //                 console.log("With username: " + username);
273                         
274             //                 $.post("/sla/agreements/simplecreate", 
275             //                     { "template_id": "iMindsServiceWiLab2",
276             //                       "user": username,
277             //                       "expiration_time": new Date()
278             //                     });
279                         
280             //                 $('#slamodal-wilab2').modal('hide');
281             //                 accepted_sla["wilab2"] = true;
282             //             }); 
283                     
284             //             $("#dismiss_sla_wilab2").click(function(){
285             //                 console.log("SLA NOT ACCEPTED");
286             //                 $('#slamodal-wilab2').modal('hide');
287             //             }); 
288                     
289
290             //     }
291
292             // }
293
294             // for(var sla in accepted_sla){
295             //     if(accepted_sla[sla] == true){
296             //         count += 1;
297             //     }
298             // }
299
300             // if(count == accepted_sla.length){
301             //     this.do_update(e);
302             // }
303         },
304
305      
306         /************************** GUI MANIPULATION **************************/
307
308         populate_table: function()
309         {
310             // Loop over records and display pending ones
311             manifold.query_store.iter_records(this.options.query_uuid, function (record_key, record) {
312             }
313         },
314         
315         set_button_state: function(name, state)
316         {
317             this.elmt(name).attr('disabled', state ? false : 'disabled');
318         },
319
320         clear: function()
321         {
322
323         },
324
325         find_row: function(key)
326         {
327             // key in third position, column id = 2
328             var KEY_POS = 2;
329
330             var cols = $.grep(this.table.fnSettings().aoData, function(col) {
331                 return (col._aData[KEY_POS] == key);
332             } );
333
334             if (cols.length == 0)
335                 return null;
336             if (cols.length > 1)
337                 throw "Too many same-key rows in ResourceSelected plugin";
338
339             return cols[0];
340         },
341
342         set_state: function(data)
343         {
344             var action;
345             var msg;
346             var button = '';
347
348             var row;
349             
350             // make sure the change is visible : toggle on the whole plugin
351             // this might have to be made an 'auto-toggle' option of this plugin..
352             // also it might be needed to be a little finer-grained here
353
354         // XXX we don't want to show automaticaly the pending when a checkbox is checked
355             //this.toggle_on();
356
357             switch (data.status) {
358                 case STATE_SET_IN_PENDING:
359                     action = 'ADD';
360                     msg   = 'PENDING';
361                     button = "<span class='glyphicon glyphicon-remove ResourceSelectedClose' id='" + data.key + "'/>";
362                     break;
363                 case STATE_SET_OUT_PENDING:
364                     action = 'REMOVE';
365                     msg   = 'PENDING';
366                     button = "<span class='glyphicon glyphicon-remove ResourceSelectedClose' id='" + data.key + "'/>";
367                     break;
368                 case STATE_SET_IN:
369                 case STATE_SET_OUT:
370                     // find line and delete it
371                     // XXX Naming is incorrect for badge-pending !!!!
372                     // XXX What is this badge ?
373                     row = this.find_row(data.value);
374                     if (row)
375                         this.table.fnDeleteRow(row.nTr);
376                         /* indent was wrong !!
377                         $("#badge-pending").data('number', $("#badge-pending").data('number') - 1 );
378                         $("#badge-pending").text($("#badge-pending").data('number'));
379                         */
380                     return;
381                     break;  
382                 case STATE_SET_IN_SUCCESS:
383                 case STATE_SET_OUT_SUCCESS:
384                     msg   = 'SUCCESS';
385                     break;
386                 case STATE_SET_IN_FAILURE:
387                 case STATE_SET_OUT_FAILURE:
388                     msg   = 'FAILURE';
389                     break;
390                 case STATE_CHANGE:
391                     action = 'UPDATE';
392                     break;
393                 
394             }
395
396             var status = msg + status;
397
398             // find line
399             // if no, create it, else replace it
400             // XXX it's not just about adding lines, but sometimes removing some
401             // XXX how do we handle status reset ?
402
403             // Jordan : I don't understand this. I added this test otherwise we have string = ""..."" double quoted twice.
404             if (typeof(data.value) !== "string")
405                 data.value = JSON.stringify(data.value);
406             data.selected_resources = this.selected_resources;
407             row = this.find_row(data.value);
408             newline = [
409                 action,
410                 data.key,
411                 data.value,
412                 msg,
413                 button
414             ];
415             if (!row) {
416                 // XXX second parameter refresh = false can improve performance. todo in querytable also
417                 this.table.fnAddData(newline);
418                 row = this.find_row(data.value);
419                 /*
420                 $("#badge-pending").data('number', $("#badge-pending").data('number') + 1 );
421                 $("#badge-pending").text($("#badge-pending").data('number'));
422                 */
423             } else {
424                 // Update row text...
425                 this.table.fnUpdate(newline, row.nTr);
426             }
427
428             // Change cell color according to status
429             if (row) {
430                 $(row.nTr).removeClass('add remove')
431                 var cls = action.toLowerCase();
432                 if (cls)
433                     $(row.nTr).addClass(cls);
434             }
435         },
436
437         do_update: function(e) {
438             var self = e.data;
439
440             var username = e.data.options.username;
441             var urn = data.value;
442             // XXX check that the query is not disabled
443
444             self.spin();
445             console.log("do_update");
446             // XXX check that the query is not disabled
447             //manifold.raise_event(self.options.query_uuid, RUN_UPDATE);
448
449             // how to stop the spinning after the event? 
450             // this should be triggered by some on_updatequery_done ?
451
452         },
453
454         // related buttons are also disabled in the html template
455         do_refresh: function(e)
456         {
457             throw 'resource_selected.do_refresh Not implemented';
458         },
459
460         do_reset: function(e)
461         {
462             throw 'queryupdater.do_reset Not implemented';
463         },
464
465         do_clear_annotations: function(e)
466         {
467             throw 'queryupdater.do_clear_annotations Not implemented';
468         },
469         
470        /**************************************************************************
471         *                           QUERY HANDLERS
472         **************************************************************************/ 
473
474         on_new_record: function(record)
475         {
476
477             // if (not and update) {
478
479                 // initial['resource'], initial['lease'] ?
480                 this.initial.push(record);
481
482             //this.set_record_state(record, RECORD_STATE_ATTACHED);
483                 // We simply add to the table
484             // } else {
485                 //                 \ this.initial_resources
486                 //                  \
487                 // this.             \
488                 // current_resources  \    YES    |   NO
489                 // --------------------+----------+---------
490                 //       YES           | attached | added
491                 //       NO            | removed  |   /
492                 // 
493
494             // }
495         },
496
497         // QUERY STATUS
498         //                                      +-----------------+--------------+
499         //                                      v        R        |              |
500         // +-------+  ?G    +-------+        +-------+        +---+---+          |
501         // |       | -----> |       |  !G    |       |        |       |    DA    |
502         // |  ND   |        |  PG   | -----> |   D   | -----> |  PC   | <------+ |
503         // |       | <----- |       |  ~G    |       |   C    |       |        | | 
504         // +-------+   GE   +-------+        +-------+        +-------+      +------+
505         //                                       ^              ^  |         |      |
506         //                                       | DA        UE |  | ?U      | PCA  |
507         //                                       |              |  v         |      |
508         //                                   +-------+        +-------+      +------+
509         //                                   |       |   !U   |       |         ^
510         //                                   |  AD   | <----- |  PU   | --------+
511         //                                   |       |        |       |   ~U     
512         //                                   +-------+        +-------+          
513         //                                                                       
514         //
515         // LEGEND:
516         // 
517         // Plugins (i) receive state information, (ii) perform actions
518         //
519         // States:                                  Actions:
520         // ND : No data                             ?G : Get query
521         // PG : Pending Get                         !G : Get reply  
522         //  D : Data present                        ~G : Get partial reply
523         // PC : Pending changes                     GE : Get error                            
524         // PU : Pending update                       C : Change request
525         // PCA: Pending change with annotation       R : Reset request
526         // AD : Annotated data                      ?U : Update query
527         //                                          !U : Update reply
528         //                                          ~U : Update partial reply
529         //                                          UE : Update error            
530         //                                          DA : Delete annotation request
531         // NOTE:
532         // - D -> PU directly if the user chooses 'dynamic update'
533         // - Be careful for updates if partial Get success
534
535         // ND: No data == initialization state
536         
537         // PG : Pending get
538         // - on_query_in_progress
539         // NOTE: cannot distinguish get and update here. Is it important ?
540
541         on_query_in_progress: function()
542         {
543             this.spin();
544         },
545
546         // D : Data present
547         // - on_clear_records (Get)
548         // - on_new_record (shared with AD) XXX
549         // - on_query_done
550         // NOTE: cannot distinguish get and update here. Is it important ?
551         // NOTE: Would record key be sufficient for update ?
552
553         on_clear_records: function()
554         {
555             this.clear();
556         },
557
558         on_query_done: function()
559         {
560             this.unspin();
561         },
562
563         // PC : Pending changes
564         // NOTE: record_key could be sufficient 
565         on_added_record: function(record)
566         {
567             this.set_record_state(record, RECORD_STATE_ADDED);
568             // update pending number
569         },
570
571         on_removed_record: function(record_key)
572         {
573             this.set_record_state(RECORD_STATE_REMOVED);
574         },
575
576         // PU : Pending update
577         // - on_query_in_progress (already done)
578         
579         // PCA : Pending change with annotation
580         // NOTE: Manifold will inform the plugin about updates, and thus won't
581         // call new record, even if the same channel UUID is used...
582         // - TODO on_updated_record
583         // - Key and confirmation could be sufficient, or key and record state
584         // XXX move record state to the manifold plugin API
585
586         on_field_state_changed: function(result)
587         {
588             if(result.request == FIELD_REQUEST_ADD){
589                 this.selected_resources.push(result.value);
590             } else if(result.request == FIELD_REQUEST_REMOVE_RESET){
591                 var i = this.selected_resources.indexOf(result.value);
592                 if(i != -1){
593                     this.selected_resources.splice(i,1);
594                 }
595             }
596             this.set_state(result);
597         },
598
599         // XXX we will have the requests for change
600         // XXX + the requests to move into the query cycle = the buttons aforementioned
601
602         // XXX what happens in case of updates ? not implemented yet
603         // XXX we want resources and leases
604         // listen for SET_ADD and SET_REMOVE for slice query
605
606         /************************** PRIVATE METHODS ***************************/
607
608         _close_click: function(e)
609         {
610             var self = e.data;
611
612             //jQuery.publish('selected', 'add/'+key_value);
613             // this.parentNode is <td> this.parentNode.parentNode is <tr> 
614             // this.parentNode.parentNode.firstChild is the first cell <td> of this line <tr>
615             // this.parentNode.parentNode.firstChild.firstChild is the text in that cell
616             //var firstCellVal=this.parentNode.parentNode.firstChild.firstChild.data;
617             var remove_urn = this.id; 
618             var current_resources = event.data.instance.current_resources;
619             var list_resources = $.grep(current_resources, function(x) {return x.urn != remove_urn});
620             //jQuery.publish('selected', 'cancel/'+this.id+'/'+unfold.get_value(firstCellVal));
621             $.publish('/update-set/' + event.data.instance.options.resource_query_uuid, [list_resources, true]);
622         },
623
624         /******************************** TODO ********************************/
625
626         update_resources: function(resources, change)
627         {
628             messages.debug("update_resources");
629             var my_oTable = this.table.dataTable();
630             var prev_resources = this.current_resources; 
631
632             /*
633              * The first time the query is advertised, don't do anything.  The
634              * component will learn nodes in the slice through the manifest
635              * received through the other subscription 
636              */
637              if (!change)
638                 return;
639              // ioi: Refubrished
640              var initial = this.initial;
641              //var r_removed  = []; //
642              /*-----------------------------------------------------------------------
643                 TODO: remove this dirty hack !!!
644              */
645              resources = jQuery.map(resources, function(x){
646                 if(!('timeslot' in x)){x.timeslot=0;}
647                 return x;
648              });
649              /*
650                 TODO: handle generic keys instead of specific stuff
651                       ex: urn
652                           urn-lease
653              */
654              var initial_urn = $.map(initial, function(x){return x.urn;});
655              var resources_urn = $.map(resources, function(x){return x.urn;});
656              var r_removed = $.grep(initial, function (x) { return $.inArray(x.urn, resources_urn) == -1 });
657              var r_attached = $.grep(initial, function (x) { return $.inArray(x.urn, resources_urn) > -1 });
658              var r_added = $.grep(resources, function (x) { return $.inArray(x.urn, initial_urn) == -1 });
659              exists = false; // ioi
660              /*-----------------------------------------------------------------------*/
661
662              my_oTable.fnClearTable();
663              /*
664                 TODO: factorization of this code !!!
665              */
666              $.each(r_added, function(i, r) { 
667                 //var type = (typeof initial == 'undefined' || r.node != initial.node) ? 'add' : 'attached';
668                 var type = 'add';  
669                 // Create the resource objects
670                 // ioi: refubrished
671                 var urn = r.urn;
672                 time = r.timeslot;
673                               
674                 var SPAN = "<span class='glyphicon glyphicon-remove ResourceSelectedClose' id='"+urn+"'/>";
675                 var slot = "<span id='resource_"+urn+"'>" + time + "</span>"; //ioi
676                 // ioi
677                 var newline=Array();
678                 newline.push(type, urn, slot, SPAN); // ioi
679                 var line = my_oTable.fnAddData(newline);
680                 var nTr = my_oTable.fnSettings().aoData[ line[0] ].nTr;
681                 nTr.className = type;
682              });
683              $.each(r_attached, function(i, r) {  
684                 //var type = (typeof initial == 'undefined' || r.node != initial.node) ? 'add' : 'attached';
685                 var type = 'attached';
686                 // Create the resource objects
687                 // ioi: refubrished
688                 var node = r.urn;
689                 time = r.timeslot;
690
691                 var SPAN = "<span class='glyphicon glyphicon-renomve ResourceSelectedClose' id='"+node+"'/>";
692                 var slot = "<span id='resource_"+node+"'>" + time + "</span>"; //ioi
693                 // ioi
694                 var newline=Array();
695                 newline.push(type, node, slot, SPAN); // ioi
696                 var line = my_oTable.fnAddData(newline);
697                 var nTr = my_oTable.fnSettings().aoData[ line[0] ].nTr;
698                 nTr.className = type;
699              });
700              $.each(r_removed, function(i, r) { 
701                 // The list contains objects
702                 // ioi: refubrished
703                 var node = r.urn;
704                 var time = r.timeslot;
705                     
706                 var SPAN = "<span class='glyphicon glyphicon-remove ResourceSelectedClose' id='"+node+"'/>";
707                 var slot = "<span id='resource_"+node+"'>" + time + "</span>";
708                 // ioi
709                 var newline=Array();
710                 newline.push('remove', node, slot, SPAN); // ioi
711                 var line = my_oTable.fnAddData(newline);
712                 var nTr = my_oTable.fnSettings().aoData[ line[0] ].nTr;
713                 nTr.className = 'remove';
714              });
715
716              this.current_resources = $.merge(r_attached,r_added);
717
718              /* Allow the user to update the slice */
719              //jQuery('#updateslice-' + data.ResourceSelected.plugin_uuid).prop('disabled', false);
720
721         }, // update_resources
722
723     });
724
725     $.plugin('QueryUpdaterPlugin', QueryUpdaterPlugin);
726
727 })(jQuery);