@@ -30,7 +30,7 @@ const DatabaseEvents = {
3030 * @var $elm a jQuery object containing the reference
3131 * to an element that is being validated
3232 */
33- var $elm = null ;
33+ let $elm = null ;
3434 // Common validation. At the very least the name
3535 // and the definition must be provided for an item
3636 $elm = $ ( 'table.rte_table' ) . last ( ) . find ( 'input[name=item_name]' ) ;
@@ -60,21 +60,21 @@ const DatabaseEvents = {
6060 } ,
6161
6262 exportDialog : function ( $this ) {
63- var $msg = ajaxShowMessage ( ) ;
63+ const $msg = ajaxShowMessage ( ) ;
6464 if ( $this . attr ( 'id' ) === 'bulkActionExportButton' ) {
65- var combined = {
65+ const combined = {
6666 success : true ,
6767 title : window . Messages . strExport ,
6868 message : '' ,
69- error : ''
69+ error : '' ,
7070 } ;
7171 // export anchors of all selected rows
72- var exportAnchors = $ ( 'input.checkall:checked' ) . parents ( 'tr' ) . find ( '.export_anchor' ) ;
73- var count = exportAnchors . length ;
74- var returnCount = 0 ;
75- var p : any = $ . when ( ) ;
72+ const exportAnchors = $ ( 'input.checkall:checked' ) . parents ( 'tr' ) . find ( '.export_anchor' ) ;
73+ const count = exportAnchors . length ;
74+ let returnCount = 0 ;
75+ let p : any = $ . when ( ) ;
7676 exportAnchors . each ( function ( ) {
77- var h = $ ( this ) . attr ( 'href' ) ;
77+ const h = $ ( this ) . attr ( 'href' ) ;
7878 p = p . then ( function ( ) {
7979 return $ . get ( h , { 'ajax_request' : true } , function ( data ) {
8080 returnCount ++ ;
@@ -126,13 +126,13 @@ const DatabaseEvents = {
126126 }
127127 } ,
128128 editorDialog : function ( isNew , $this ) {
129- var that = this ;
129+ const that = this ;
130130 /**
131131 * @var $edit_row jQuery object containing the reference to
132132 * the row of the the item being edited
133133 * from the list of items
134134 */
135- var $editRow = null ;
135+ let $editRow = null ;
136136 if ( $this . hasClass ( 'edit_anchor' ) ) {
137137 // Remember the row of the item being edited for later,
138138 // so that if the edit is successful, we can replace the
@@ -144,7 +144,7 @@ const DatabaseEvents = {
144144 * @var $msg jQuery object containing the reference to
145145 * the AJAX message shown to the user
146146 */
147- var $msg = ajaxShowMessage ( ) ;
147+ let $msg = ajaxShowMessage ( ) ;
148148 $ . get ( $this . attr ( 'href' ) , { 'ajax_request' : true } , function ( data ) {
149149 if ( data . success !== true ) {
150150 ajaxShowMessage ( data . error , false ) ;
@@ -169,12 +169,12 @@ const DatabaseEvents = {
169169 /**
170170 * @var data Form data to be sent in the AJAX request
171171 */
172- var data = $ ( 'form.rte_form' ) . last ( ) . serialize ( ) ;
172+ const data = $ ( 'form.rte_form' ) . last ( ) . serialize ( ) ;
173173 $msg = ajaxShowMessage (
174174 window . Messages . strProcessingRequest
175175 ) ;
176176
177- var url = $ ( 'form.rte_form' ) . last ( ) . attr ( 'action' ) ;
177+ const url = $ ( 'form.rte_form' ) . last ( ) . attr ( 'action' ) ;
178178 $ . post ( url , data , function ( data ) {
179179 if ( data . success !== true ) {
180180 ajaxShowMessage ( data . error , false ) ;
@@ -205,12 +205,12 @@ const DatabaseEvents = {
205205 * to find the correct location where
206206 * to insert a new row.
207207 */
208- var text = '' ;
208+ let text = '' ;
209209 /**
210210 * @var inserted Whether a new item has been
211211 * inserted in the list or not
212212 */
213- var inserted = false ;
213+ let inserted = false ;
214214 $ ( 'table.data' ) . find ( 'tr' ) . each ( function ( ) {
215215 text = $ ( this )
216216 . children ( 'td' )
@@ -258,12 +258,12 @@ const DatabaseEvents = {
258258 /**
259259 * @var ct Count of processed rows
260260 */
261- var ct = 0 ;
261+ let ct = 0 ;
262262 /**
263263 * @var rowclass Class to be attached to the row
264264 * that is being processed
265265 */
266- var rowclass = '' ;
266+ let rowclass = '' ;
267267 $ ( 'table.data' ) . find ( 'tr' ) . has ( 'td' ) . each ( function ( ) {
268268 rowclass = ( ct % 2 === 0 ) ? 'odd' : 'even' ;
269269 $ ( this ) . removeClass ( ) . addClass ( rowclass ) ;
@@ -319,8 +319,8 @@ const DatabaseEvents = {
319319 * @var elm jQuery object containing the reference to
320320 * the Definition textarea.
321321 */
322- var $elm = $ ( 'textarea[name=item_definition]' ) . last ( ) ;
323- var linterOptions = {
322+ const $elm = $ ( 'textarea[name=item_definition]' ) . last ( ) ;
323+ const linterOptions = {
324324 editorType : 'event' ,
325325 } ;
326326 that . syntaxHiglighter = getSqlEditor ( $elm , { } , 'vertical' , linterOptions ) ;
@@ -342,21 +342,21 @@ const DatabaseEvents = {
342342 /**
343343 * @var $curr_row Object containing reference to the current row
344344 */
345- var $currRow = $this . parents ( 'tr' ) ;
345+ const $currRow = $this . parents ( 'tr' ) ;
346346 /**
347347 * @var question String containing the question to be asked for confirmation
348348 */
349- var question = $ ( '<div></div>' ) . text (
350- $currRow . children ( 'td' ) . children ( '.drop_sql' ) . html ( )
349+ const question = $ ( '<div></div>' ) . text (
350+ $currRow . children ( 'td' ) . children ( '.drop_sql' ) . html ( ) ,
351351 ) ;
352352 // We ask for confirmation first here, before submitting the ajax request
353353 $this . confirm ( question , $this . attr ( 'href' ) , function ( url ) {
354354 /**
355355 * @var msg jQuery object containing the reference to
356356 * the AJAX message shown to the user
357357 */
358- var $msg = ajaxShowMessage ( window . Messages . strProcessingRequest ) ;
359- var params = getJsConfirmCommonParam ( this , $this . getPostData ( ) ) ;
358+ const $msg = ajaxShowMessage ( window . Messages . strProcessingRequest ) ;
359+ const params = getJsConfirmCommonParam ( this , $this . getPostData ( ) ) ;
360360 $ . post ( url , params , function ( data ) {
361361 if ( data . success !== true ) {
362362 ajaxShowMessage ( data . error , false ) ;
@@ -368,7 +368,7 @@ const DatabaseEvents = {
368368 * @var $table Object containing reference
369369 * to the main list of elements
370370 */
371- var $table = $currRow . parent ( ) ;
371+ const $table = $currRow . parent ( ) ;
372372 // Check how many rows will be left after we remove
373373 // the one that the user has requested us to remove
374374 if ( $table . find ( 'tr' ) . length === 3 ) {
@@ -390,12 +390,12 @@ const DatabaseEvents = {
390390 /**
391391 * @var ct Count of processed rows
392392 */
393- var ct = 0 ;
393+ let ct = 0 ;
394394 /**
395395 * @var rowclass Class to be attached to the row
396396 * that is being processed
397397 */
398- var rowclass = '' ;
398+ let rowclass = '' ;
399399 $table . find ( 'tr' ) . has ( 'td' ) . each ( function ( ) {
400400 rowclass = ( ct % 2 === 1 ) ? 'odd' : 'even' ;
401401 $ ( this ) . removeClass ( ) . addClass ( rowclass ) ;
@@ -420,21 +420,21 @@ const DatabaseEvents = {
420420 * @var msg jQuery object containing the reference to
421421 * the AJAX message shown to the user
422422 */
423- var $msg = ajaxShowMessage ( window . Messages . strProcessingRequest ) ;
423+ const $msg = ajaxShowMessage ( window . Messages . strProcessingRequest ) ;
424424
425425 // drop anchors of all selected rows
426- var dropAnchors = $ ( 'input.checkall:checked' ) . parents ( 'tr' ) . find ( '.drop_anchor' ) ;
427- var success = true ;
428- var count = dropAnchors . length ;
429- var returnCount = 0 ;
426+ const dropAnchors = $ ( 'input.checkall:checked' ) . parents ( 'tr' ) . find ( '.drop_anchor' ) ;
427+ let success = true ;
428+ const count = dropAnchors . length ;
429+ let returnCount = 0 ;
430430
431431 dropAnchors . each ( function ( ) {
432- var $anchor = $ ( this ) ;
432+ const $anchor = $ ( this ) ;
433433 /**
434434 * @var $curr_row Object containing reference to the current row
435435 */
436- var $currRow = $anchor . parents ( 'tr' ) ;
437- var params = getJsConfirmCommonParam ( this , $anchor . getPostData ( ) ) ;
436+ const $currRow = $anchor . parents ( 'tr' ) ;
437+ const params = getJsConfirmCommonParam ( this , $anchor . getPostData ( ) ) ;
438438 $ . post ( $anchor . attr ( 'href' ) , params , function ( data ) {
439439 returnCount ++ ;
440440 if ( data . success !== true ) {
@@ -451,7 +451,7 @@ const DatabaseEvents = {
451451 * @var $table Object containing reference
452452 * to the main list of elements
453453 */
454- var $table = $currRow . parent ( ) ;
454+ const $table = $currRow . parent ( ) ;
455455 // Check how many rows will be left after we remove
456456 // the one that the user has requested us to remove
457457 if ( $table . find ( 'tr' ) . length === 3 ) {
@@ -471,12 +471,12 @@ const DatabaseEvents = {
471471 /**
472472 * @var ct Count of processed rows
473473 */
474- var ct = 0 ;
474+ let ct = 0 ;
475475 /**
476476 * @var rowclass Class to be attached to the row
477477 * that is being processed
478478 */
479- var rowclass = '' ;
479+ let rowclass = '' ;
480480 $table . find ( 'tr' ) . has ( 'td' ) . each ( function ( ) {
481481 rowclass = ( ct % 2 === 1 ) ? 'odd' : 'even' ;
482482 $ ( this ) . removeClass ( ) . addClass ( rowclass ) ;
@@ -510,7 +510,7 @@ const DatabaseEvents = {
510510 * @var elm a jQuery object containing the reference
511511 * to an element that is being validated
512512 */
513- var $elm = null ;
513+ let $elm = null ;
514514 const eventsEditorModal = $ ( '#eventsEditorModal' ) ;
515515 if ( eventsEditorModal . find ( 'select[name=item_type]' ) . find ( ':selected' ) . val ( ) === 'RECURRING' ) {
516516 // The interval field must not be empty for recurring events
0 commit comments