@@ -25,18 +25,18 @@ function findLatestThreads() {
2525 s : $ ( "#attachThreadSearchField" ) . val ( ) ,
2626 a : $ ( "#attachThreadAttachOnly" ) . val ( ) ,
2727 } )
28- . success ( function ( data ) {
28+ . success ( ( data ) => {
2929 sel = $ ( "#attachThreadList" ) ;
3030 sel . find ( "option" ) . remove ( ) ;
31- $ . each ( data , function ( m , i ) {
31+ $ . each ( data , ( m , i ) => {
3232 sel . append (
3333 $ ( "<option/>" )
34- . text ( i . from + ": " + i . subj + " (" + i . date + ")" )
34+ . text ( ` ${ i . from } : ${ i . subj } ( ${ i . date } )` )
3535 . val ( i . msgid ) ,
3636 ) ;
3737 } ) ;
3838 } )
39- . always ( function ( ) {
39+ . always ( ( ) => {
4040 $ ( "#attachThreadListWrap" ) . removeClass ( "loading" ) ;
4141 $ ( "#attachThreadSearchButton" ) . removeClass ( "disabled" ) ;
4242 attachThreadChanged ( ) ;
@@ -48,16 +48,16 @@ function browseThreads(attachfunc, closefunc) {
4848 $ ( "#attachThreadList" ) . find ( "option" ) . remove ( ) ;
4949 $ ( "#attachThreadMessageId" ) . val ( "" ) ;
5050 $ ( "#attachModal" ) . off ( "hidden.bs.modal" ) ;
51- $ ( "#attachModal" ) . on ( "hidden.bs.modal" , function ( e ) {
51+ $ ( "#attachModal" ) . on ( "hidden.bs.modal" , ( e ) => {
5252 if ( closefunc ) closefunc ( ) ;
5353 } ) ;
5454 $ ( "#attachModal" ) . modal ( ) ;
5555 findLatestThreads ( ) ;
5656
5757 $ ( "#doAttachThreadButton" ) . unbind ( "click" ) ;
58- $ ( "#doAttachThreadButton" ) . click ( function ( ) {
58+ $ ( "#doAttachThreadButton" ) . click ( ( ) => {
5959 msgid = $ ( "#attachThreadMessageId" ) . val ( ) ;
60- if ( ! msgid || msgid == "" ) {
60+ if ( ! msgid || msgid === "" ) {
6161 msgid = $ ( "#attachThreadList" ) . val ( ) ;
6262 if ( ! msgid ) return ;
6363 }
@@ -76,14 +76,14 @@ function browseThreads(attachfunc, closefunc) {
7676
7777function attachThread ( cfid , patchid , closefunc ) {
7878 browseThreads (
79- function ( msgid ) {
79+ ( msgid ) => {
8080 doAttachThread ( cfid , patchid , msgid , ! closefunc ) ;
8181 if ( closefunc ) {
8282 /* We don't really care about closing it, we just reload immediately */
8383 closefunc ( ) ;
8484 }
8585 } ,
86- function ( ) {
86+ ( ) => {
8787 if ( closefunc ) closefunc ( ) ;
8888 } ,
8989 ) ;
@@ -92,20 +92,18 @@ function attachThread(cfid, patchid, closefunc) {
9292function detachThread ( cfid , patchid , msgid ) {
9393 if (
9494 confirm (
95- 'Are you sure you want to detach the thread with messageid "' +
96- msgid +
97- '" from this patch?' ,
95+ `Are you sure you want to detach the thread with messageid "${ msgid } " from this patch?` ,
9896 )
9997 ) {
10098 $ . post ( "/ajax/detachThread/" , {
10199 cf : cfid ,
102100 p : patchid ,
103101 msg : msgid ,
104102 } )
105- . success ( function ( data ) {
103+ . success ( ( data ) => {
106104 location . reload ( ) ;
107105 } )
108- . fail ( function ( data ) {
106+ . fail ( ( data ) => {
109107 alert ( "Failed to detach thread!" ) ;
110108 } ) ;
111109 }
@@ -125,20 +123,20 @@ function doAttachThread(cfid, patchid, msgid, reloadonsuccess) {
125123 p : patchid ,
126124 msg : msgid ,
127125 } )
128- . success ( function ( data ) {
129- if ( data != "OK" ) {
126+ . success ( ( data ) => {
127+ if ( data !== "OK" ) {
130128 alert ( data ) ;
131129 }
132130 if ( reloadonsuccess ) location . reload ( ) ;
133131 return true ;
134132 } )
135- . fail ( function ( data ) {
136- if ( data . status == 404 ) {
137- alert ( " Message with messageid " + msgid + " not found" ) ;
138- } else if ( data . status == 503 ) {
139- alert ( " Failed to attach thread: " + data . responseText ) ;
133+ . fail ( ( data ) => {
134+ if ( data . status === 404 ) {
135+ alert ( ` Message with messageid ${ msgid } not found` ) ;
136+ } else if ( data . status === 503 ) {
137+ alert ( ` Failed to attach thread: ${ data . responseText } ` ) ;
140138 } else {
141- alert ( " Failed to attach thread: " + data . statusText ) ;
139+ alert ( ` Failed to attach thread: ${ data . statusText } ` ) ;
142140 }
143141 return false ;
144142 } ) ;
@@ -150,25 +148,17 @@ function updateAnnotationMessages(threadid) {
150148 $ . get ( "/ajax/getMessages" , {
151149 t : threadid ,
152150 } )
153- . success ( function ( data ) {
151+ . success ( ( data ) => {
154152 sel = $ ( "#annotateMessageList" ) ;
155153 sel . find ( "option" ) . remove ( ) ;
156154 sel . append ( '<option value="">---</option>' ) ;
157- $ . each ( data , function ( i , m ) {
155+ $ . each ( data , ( i , m ) => {
158156 sel . append (
159- '<option value="' +
160- m . msgid +
161- '">' +
162- m . from +
163- ": " +
164- m . subj +
165- " (" +
166- m . date +
167- ")</option>" ,
157+ `<option value="${ m . msgid } ">${ m . from } : ${ m . subj } (${ m . date } )</option>` ,
168158 ) ;
169159 } ) ;
170160 } )
171- . always ( function ( ) {
161+ . always ( ( ) => {
172162 $ ( "#annotateMessageBody" ) . removeClass ( "loading" ) ;
173163 } ) ;
174164}
@@ -180,8 +170,8 @@ function addAnnotation(threadid) {
180170 $ ( "#annotateThreadList" ) . focus ( ) ;
181171 updateAnnotationMessages ( threadid ) ;
182172 $ ( "#doAnnotateMessageButton" ) . unbind ( "click" ) ;
183- $ ( "#doAnnotateMessageButton" ) . click ( function ( ) {
184- var msg = $ ( "#annotateMessage" ) . val ( ) ;
173+ $ ( "#doAnnotateMessageButton" ) . click ( ( ) => {
174+ const msg = $ ( "#annotateMessage" ) . val ( ) ;
185175 if ( msg . length >= 500 ) {
186176 alert (
187177 "Maximum length for an annotation is 500 characters.\nYou should probably post an actual message in the thread!" ,
@@ -195,24 +185,24 @@ function addAnnotation(threadid) {
195185 msgid : $ . trim ( $ ( "#annotateMsgId" ) . val ( ) ) ,
196186 msg : msg ,
197187 } )
198- . success ( function ( data ) {
199- if ( data != "OK" ) {
188+ . success ( ( data ) => {
189+ if ( data !== "OK" ) {
200190 alert ( data ) ;
201191 $ ( "#annotateMessageBody" ) . removeClass ( "loading" ) ;
202192 } else {
203193 $ ( "#annotateModal" ) . modal ( "hide" ) ;
204194 location . reload ( ) ;
205195 }
206196 } )
207- . fail ( function ( data ) {
197+ . fail ( ( data ) => {
208198 alert ( "Failed to annotate message" ) ;
209199 $ ( "#annotateMessageBody" ) . removeClass ( "loading" ) ;
210200 } ) ;
211201 } ) ;
212202}
213203
214204function annotateMsgPicked ( ) {
215- var val = $ ( "#annotateMessageList" ) . val ( ) ;
205+ const val = $ ( "#annotateMessageList" ) . val ( ) ;
216206 if ( val ) {
217207 $ ( "#annotateMsgId" ) . val ( val ) ;
218208 annotateChanged ( ) ;
@@ -221,7 +211,7 @@ function annotateMsgPicked() {
221211
222212function annotateChanged ( ) {
223213 /* Enable/disable the annotate button */
224- if ( $ ( "#annotateMessage" ) . val ( ) != "" && $ ( "#annotateMsgId" ) . val ( ) ) {
214+ if ( $ ( "#annotateMessage" ) . val ( ) !== "" && $ ( "#annotateMsgId" ) . val ( ) ) {
225215 $ ( "#doAnnotateMessageButton" ) . removeClass ( "disabled" ) ;
226216 } else {
227217 $ ( "#doAnnotateMessageButton" ) . addClass ( "disabled" ) ;
@@ -233,10 +223,10 @@ function deleteAnnotation(annid) {
233223 $ . post ( "/ajax/deleteAnnotation/" , {
234224 id : annid ,
235225 } )
236- . success ( function ( data ) {
226+ . success ( ( data ) => {
237227 location . reload ( ) ;
238228 } )
239- . fail ( function ( data ) {
229+ . fail ( ( data ) => {
240230 alert ( "Failed to delete annotation!" ) ;
241231 } ) ;
242232 }
@@ -246,21 +236,21 @@ function flagCommitted(committer) {
246236 $ ( "#commitModal" ) . modal ( ) ;
247237 $ ( "#committerSelect" ) . val ( committer ) ;
248238 $ ( "#doCommitButton" ) . unbind ( "click" ) ;
249- $ ( "#doCommitButton" ) . click ( function ( ) {
250- var c = $ ( "#committerSelect" ) . val ( ) ;
239+ $ ( "#doCommitButton" ) . click ( ( ) => {
240+ const c = $ ( "#committerSelect" ) . val ( ) ;
251241 if ( ! c ) {
252242 alert (
253243 "You need to select a committer before you can mark a patch as committed!" ,
254244 ) ;
255245 return ;
256246 }
257- document . location . href = " close/committed/?c=" + c ;
247+ document . location . href = ` close/committed/?c=${ c } ` ;
258248 } ) ;
259249 return false ;
260250}
261251
262252function sortpatches ( sortby ) {
263- if ( $ ( "#id_sortkey" ) . val ( ) == sortby ) {
253+ if ( $ ( "#id_sortkey" ) . val ( ) === sortby ) {
264254 $ ( "#id_sortkey" ) . val ( 0 ) ;
265255 } else {
266256 $ ( "#id_sortkey" ) . val ( sortby ) ;
@@ -271,13 +261,13 @@ function sortpatches(sortby) {
271261}
272262
273263function toggleButtonCollapse ( buttonId , collapseId ) {
274- $ ( "#" + buttonId ) . button ( "toggle" ) ;
275- $ ( "#" + collapseId ) . toggleClass ( "in" ) ;
264+ $ ( `# ${ buttonId } ` ) . button ( "toggle" ) ;
265+ $ ( `# ${ collapseId } ` ) . toggleClass ( "in" ) ;
276266}
277267
278268function togglePatchFilterButton ( buttonId , collapseId ) {
279269 /* Figure out if we are collapsing it */
280- if ( $ ( "#" + collapseId ) . hasClass ( "in" ) ) {
270+ if ( $ ( `# ${ collapseId } ` ) . hasClass ( "in" ) ) {
281271 /* Go back to ourselves without a querystring to reset the form, unless it's already empty */
282272 if ( document . location . href . indexOf ( "?" ) > - 1 ) {
283273 document . location . href = "." ;
@@ -293,7 +283,7 @@ function togglePatchFilterButton(buttonId, collapseId) {
293283 */
294284function search_and_store_user ( ) {
295285 $ ( "#doSelectUserButton" ) . unbind ( "click" ) ;
296- $ ( "#doSelectUserButton" ) . click ( function ( ) {
286+ $ ( "#doSelectUserButton" ) . click ( ( ) => {
297287 if ( ! $ ( "#searchUserList" ) . val ( ) ) {
298288 return false ;
299289 }
@@ -302,16 +292,16 @@ function search_and_store_user() {
302292 $ . get ( "/ajax/importUser/" , {
303293 u : $ ( "#searchUserList" ) . val ( ) ,
304294 } )
305- . success ( function ( data ) {
306- if ( data == "OK" ) {
295+ . success ( ( data ) => {
296+ if ( data === "OK" ) {
307297 alert ( "User imported!" ) ;
308298 $ ( "#searchUserModal" ) . modal ( "hide" ) ;
309299 } else {
310- alert ( " Failed to import user: " + data ) ;
300+ alert ( ` Failed to import user: ${ data } ` ) ;
311301 }
312302 } )
313- . fail ( function ( data , statustxt ) {
314- alert ( " Failed to import user: " + statustxt ) ;
303+ . fail ( ( data , statustxt ) => {
304+ alert ( ` Failed to import user: ${ statustxt } ` ) ;
315305 } ) ;
316306
317307 return false ;
@@ -330,24 +320,16 @@ function findUsers() {
330320 $ . get ( "/ajax/searchUsers/" , {
331321 s : $ ( "#searchUserSearchField" ) . val ( ) ,
332322 } )
333- . success ( function ( data ) {
323+ . success ( ( data ) => {
334324 sel = $ ( "#searchUserList" ) ;
335325 sel . find ( "option" ) . remove ( ) ;
336- $ . each ( data , function ( i , u ) {
326+ $ . each ( data , ( i , u ) => {
337327 sel . append (
338- '<option value="' +
339- u . u +
340- '">' +
341- u . u +
342- " (" +
343- u . f +
344- " " +
345- u . l +
346- ")</option>" ,
328+ `<option value="${ u . u } ">${ u . u } (${ u . f } ${ u . l } )</option>` ,
347329 ) ;
348330 } ) ;
349331 } )
350- . always ( function ( ) {
332+ . always ( ( ) => {
351333 $ ( "#searchUserListWrap" ) . removeClass ( "loading" ) ;
352334 $ ( "#searchUserSearchButton" ) . removeClass ( "disabled" ) ;
353335 searchUserListChanged ( ) ;
0 commit comments