1- var MIN_POSTS_TO_UPVOTE = 20 ,
1+ let MIN_POSTS_TO_UPVOTE = 20 ,
22 MIN_DAYS_TO_UPVOTE = 7 ,
33 MIN_POSTS_TO_DOWNVOTE = 50 ,
44 MIN_DAYS_TO_DOWNVOTE = 15 ,
@@ -15,7 +15,7 @@ var MIN_POSTS_TO_UPVOTE = 20,
1515 MAX_POINTS_FOR_DOWNVOTE = 10 ,
1616 MAX_POST_AGE_DAYS = 0 ; // 0 means disabled
1717
18- var Config = {
18+ let Config = {
1919 minPostToDownvote : function ( ) {
2020 return MIN_POSTS_TO_DOWNVOTE ;
2121 } ,
@@ -38,9 +38,9 @@ var Config = {
3838 return MAX_VOTES_TO_SAME_USER_PER_MONTH ;
3939 } ,
4040 maxVotesPerUser : function ( reputation ) {
41- var MIN = 5 ,
41+ let MIN = 5 ,
4242 MAX = 50 ;
43- var calculatedVotesPerUser = Math . floor ( reputation / 10 ) ;
43+ let calculatedVotesPerUser = Math . floor ( reputation / 10 ) ;
4444 if ( calculatedVotesPerUser < MIN ) {
4545 calculatedVotesPerUser = MIN ;
4646 } else if ( calculatedVotesPerUser > MAX ) {
@@ -77,18 +77,18 @@ var Config = {
7777 return REP_LOG_NAMESPACE + ":user:" + voterId + ":thread:" + topicId ;
7878 } ,
7979 getPerAuthorLogId : function ( voterId , authorId ) {
80- var now = new Date ( ) ;
81- var month = ( now . getMonth ( ) + 1 ) + "-" + now . getFullYear ( ) ;
80+ let now = new Date ( ) ;
81+ let month = ( now . getMonth ( ) + 1 ) + "-" + now . getFullYear ( ) ;
8282 return REP_LOG_NAMESPACE + ":user:" + voterId + ":author:" + authorId + ":month:" + month ;
8383 } ,
8484 getPerUserLogId : function ( voterId ) {
85- var now = new Date ( ) ;
86- var today = now . getDate ( ) + "-" + ( now . getMonth ( ) + 1 ) + "-" + now . getFullYear ( ) ;
85+ let now = new Date ( ) ;
86+ let today = now . getDate ( ) + "-" + ( now . getMonth ( ) + 1 ) + "-" + now . getFullYear ( ) ;
8787 return REP_LOG_NAMESPACE + ":user:" + voterId + ":day:" + today ;
8888 } ,
8989 getPerUserAndTypeLogId : function ( voterId , voteType ) {
90- var now = new Date ( ) ;
91- var today = now . getDate ( ) + "-" + ( now . getMonth ( ) + 1 ) + "-" + now . getFullYear ( ) ;
90+ let now = new Date ( ) ;
91+ let today = now . getDate ( ) + "-" + ( now . getMonth ( ) + 1 ) + "-" + now . getFullYear ( ) ;
9292 return REP_LOG_NAMESPACE + ":user:" + voterId + ":day:" + today + ':type:' + voteType ;
9393 } ,
9494 getDisabledCategories : function ( ) {
@@ -98,7 +98,7 @@ var Config = {
9898 return MAX_POST_AGE_DAYS ;
9999 } ,
100100 getSettings : function ( ) {
101- var settings = { } ;
101+ let settings = { } ;
102102 settings . minPostsToUpvote = MIN_POSTS_TO_UPVOTE ;
103103 settings . minDaysToUpvote = MIN_DAYS_TO_UPVOTE ;
104104 settings . minPostsToDownvote = MIN_POSTS_TO_DOWNVOTE ;
@@ -137,7 +137,7 @@ var Config = {
137137} ;
138138
139139function intArray ( arr ) {
140- for ( var i = 0 ; i < arr . length ; i ++ ) {
140+ for ( let i = 0 ; i < arr . length ; i ++ ) {
141141 arr [ i ] = parseInt ( arr [ i ] , 10 ) ;
142142 }
143143 return arr ;
0 commit comments