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