File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -3,27 +3,25 @@ layout: null
3
3
-- -
4
4
5
5
( function ( $ ) {
6
- var $comments = $ ( '.js-comments' ) ;
7
-
8
6
$ ( '#new_comment' ) . submit ( function ( ) {
9
- var form = this ;
7
+ const form = this ;
10
8
11
9
$ ( form ) . addClass ( 'disabled' ) ;
12
10
13
11
{ % assign sm = site . staticman - % }
14
- var endpoint = '{{ sm.endpoint }}' ;
15
- var repository = '{{ sm.repository }}' ;
16
- var branch = '{{ sm.branch }}' ;
17
- let url = endpoint + repository + '/' + branch + '/comments' ;
18
- let data = $ ( this ) . serialize ( ) ;
12
+ const endpoint = '{{ sm.endpoint }}' ;
13
+ const repository = '{{ sm.repository }}' ;
14
+ const branch = '{{ sm.branch }}' ;
15
+ const url = endpoint + repository + '/' + branch + '/comments' ;
16
+ const data = $ ( this ) . serialize ( ) ;
19
17
20
- var xhr = new XMLHttpRequest ( ) ;
18
+ const xhr = new XMLHttpRequest ( ) ;
21
19
xhr . open ( "POST" , url ) ;
22
20
xhr . setRequestHeader ( 'Content-Type' , 'application/x-www-form-urlencoded' ) ;
23
21
xhr . setRequestHeader ( 'X-Requested-With' , 'XMLHttpRequest' ) ;
24
22
xhr . onreadystatechange = function ( ) {
25
23
if ( xhr . readyState === XMLHttpRequest . DONE ) {
26
- var status = xhr . status ;
24
+ const status = xhr . status ;
27
25
if ( status >= 200 && status < 400 ) {
28
26
formSubmitted ( ) ;
29
27
} else {
You can’t perform that action at this time.
0 commit comments