@@ -2637,9 +2637,9 @@ function trigger_proxy_dialog() {
2637
2637
// Displays proxy configuration dialog with available servers and custom proxy input
2638
2638
function pick_api_proxy ( ) {
2639
2639
$ ( document ) . on ( "click" , "#api_proxy" , function ( ) {
2640
- const proxies = all_proxies ( ) ,
2641
- proxy = d_proxy ( ) ,
2642
- content = "\
2640
+ const proxies = all_proxies ( "display" ) ,
2641
+ proxy = d_proxy ( ) ;
2642
+ const content = "\
2643
2643
<div class='formbox' id='proxyformbox'>\
2644
2644
<h2 class='icon-sphere'>API Proxy</h2>\
2645
2645
<div class='popnotify'></div>\
@@ -2681,7 +2681,7 @@ function pick_api_proxy() {
2681
2681
const options = $ ( "#proxyformbox" ) . find ( ".options" ) ;
2682
2682
$ . each ( proxies , function ( key , value ) {
2683
2683
const selected = ( value === proxy ) ,
2684
- dfault = $ . inArray ( value , glob_const . proxy_list ) !== - 1 ;
2684
+ dfault = value_in_array ( glob_const . proxy_list , value ) ;
2685
2685
test_append_proxy ( options , key , value , selected , dfault ) ;
2686
2686
} ) ;
2687
2687
} )
@@ -2770,7 +2770,7 @@ function test_custom_proxy(value) {
2770
2770
data = node . data ( ) ,
2771
2771
proxies = data . custom_proxies ,
2772
2772
url = complete_url ( value ) ;
2773
- if ( $ . inArray ( url , proxies ) !== - 1 || $ . inArray ( url , glob_const . proxy_list ) !== - 1 ) {
2773
+ if ( $ . inArray ( url , proxies ) !== - 1 || value_in_array ( glob_const . proxy_list , url ) ) {
2774
2774
popnotify ( "error" , tl ( "proxyexists" ) ) ;
2775
2775
return false ;
2776
2776
}
@@ -3043,7 +3043,7 @@ function json_check_apikey(keylength, ref, payload, keyval, lastInput) {
3043
3043
if ( keyval . length > keylength ) {
3044
3044
if ( ref === "infura" || ref === "alchemy" ) {
3045
3045
const txhash = "0x919408272d05b3fd7ccfa1f47c10bea425891c8aa47ba7309dc3beb0b89197f1" ,
3046
- baseUrl = ref === "infura" ? glob_const . main_eth_node : glob_const . main_alchemy_node ,
3046
+ base_url = ref === "infura" ? glob_const . main_eth_node : glob_const . main_alchemy_node ,
3047
3047
json = {
3048
3048
"jsonrpc" : "2.0" ,
3049
3049
"id" : 3 ,
@@ -3052,7 +3052,7 @@ function json_check_apikey(keylength, ref, payload, keyval, lastInput) {
3052
3052
} ;
3053
3053
api_proxy ( {
3054
3054
"api" : ref ,
3055
- "api_url" : baseUrl + keyval ,
3055
+ "api_url" : base_url + keyval ,
3056
3056
"proxy" : false ,
3057
3057
"params" : {
3058
3058
"method" : "POST" ,
@@ -3073,8 +3073,8 @@ function json_check_apikey(keylength, ref, payload, keyval, lastInput) {
3073
3073
} ) ;
3074
3074
return
3075
3075
}
3076
- const apiData = get_api_data ( ref ) ,
3077
- baseUrl = apiData . base_url ,
3076
+ const api_data = get_api_data ( ref ) ,
3077
+ base_url = api_data . base_url ,
3078
3078
method = ( ref === "firebase" || ref === "bitly" ) ? "POST" : "GET" ,
3079
3079
params = {
3080
3080
"method" : method ,
@@ -3096,27 +3096,27 @@ function json_check_apikey(keylength, ref, payload, keyval, lastInput) {
3096
3096
"bitlink_id" : "bit.ly/12a4b6c"
3097
3097
} ) ;
3098
3098
}
3099
- const apiUrl = baseUrl + search ,
3099
+ const api_url = base_url + search ,
3100
3100
proxy = ( ref === "coinmarketcap" ) ,
3101
- reqData = {
3101
+ req_data = {
3102
3102
"api" : ref ,
3103
3103
"search" : search ,
3104
3104
"cachetime" : 0 ,
3105
3105
"cachefolder" : "1h" ,
3106
- "api_url" : apiUrl ,
3106
+ "api_url" : api_url ,
3107
3107
"proxy" : proxy ,
3108
3108
"params" : params
3109
3109
} ;
3110
- api_proxy ( reqData ) . done ( function ( e ) {
3110
+ api_proxy ( req_data ) . done ( function ( e ) {
3111
3111
const data = br_result ( e ) . result ;
3112
3112
if ( data ) {
3113
- const failMsg = tl ( "apicallfailed" ) ;
3113
+ const fail_msg = tl ( "apicallfailed" ) ;
3114
3114
if ( ( ref === "etherscan" || ref === "arbiscan" || ref === "polygonscan" || ref === "bscscan" ) && data . status != 1 ) {
3115
3115
if ( str_match ( data . result , "Invalid API Key" ) ) {
3116
3116
api_fail ( ref , keyval ) ;
3117
3117
} else {
3118
3118
notify ( tl ( "apicallerror" ) ) ;
3119
- const content = "<h2 class='icon-blocked'>" + failMsg + "</h2><p class='doselect'>" + data . message + "</p>" ;
3119
+ const content = "<h2 class='icon-blocked'>" + fail_msg + "</h2><p class='doselect'>" + data . message + "</p>" ;
3120
3120
popdialog ( content , "canceldialog" ) ;
3121
3121
}
3122
3122
return
@@ -3133,7 +3133,7 @@ function json_check_apikey(keylength, ref, payload, keyval, lastInput) {
3133
3133
api_fail ( ref , keyval ) ;
3134
3134
} else {
3135
3135
notify ( tl ( "apicallerror" ) ) ;
3136
- const content = "<h2 class='icon-blocked'>" + failMsg + "</h2><p class='doselect'>" + data . error + "</p>" ;
3136
+ const content = "<h2 class='icon-blocked'>" + fail_msg + "</h2><p class='doselect'>" + data . error + "</p>" ;
3137
3137
popdialog ( content , "canceldialog" ) ;
3138
3138
}
3139
3139
return
@@ -3157,7 +3157,7 @@ function json_check_apikey(keylength, ref, payload, keyval, lastInput) {
3157
3157
api_fail ( ref , keyval ) ;
3158
3158
} else {
3159
3159
notify ( tl ( "apicallerror" ) ) ;
3160
- const content = "<h2 class='icon-blocked'>" + failMsg + "</h2><p class='doselect'>" + data . error + "</p>" ;
3160
+ const content = "<h2 class='icon-blocked'>" + fail_msg + "</h2><p class='doselect'>" + data . error + "</p>" ;
3161
3161
popdialog ( content , "canceldialog" ) ;
3162
3162
}
3163
3163
return
@@ -3170,7 +3170,7 @@ function json_check_apikey(keylength, ref, payload, keyval, lastInput) {
3170
3170
api_fail ( ref , keyval ) ;
3171
3171
} else {
3172
3172
notify ( tl ( "apicallerror" ) ) ;
3173
- const content = "<h2 class='icon-blocked'>" + failMsg + "</h2><p class='doselect'>" + data . error + "</p>" ;
3173
+ const content = "<h2 class='icon-blocked'>" + fail_msg + "</h2><p class='doselect'>" + data . error + "</p>" ;
3174
3174
popdialog ( content , "canceldialog" ) ;
3175
3175
}
3176
3176
}
@@ -3183,7 +3183,7 @@ function json_check_apikey(keylength, ref, payload, keyval, lastInput) {
3183
3183
api_fail ( ref , keyval ) ;
3184
3184
} else {
3185
3185
notify ( tl ( "apicallerror" ) ) ;
3186
- const content = "<h2 class='icon-blocked'>" + failMsg + "</h2><p class='doselect'>" + ec + "</p>" ;
3186
+ const content = "<h2 class='icon-blocked'>" + fail_msg + "</h2><p class='doselect'>" + ec + "</p>" ;
3187
3187
popdialog ( content , "canceldialog" ) ;
3188
3188
}
3189
3189
return
@@ -3194,7 +3194,7 @@ function json_check_apikey(keylength, ref, payload, keyval, lastInput) {
3194
3194
api_fail ( ref , keyval ) ;
3195
3195
} else {
3196
3196
notify ( tl ( "apicallerror" ) ) ;
3197
- const content = "<h2 class='icon-blocked'>" + failMsg + "</h2><p class='doselect'>" + data . error + "</p>" ;
3197
+ const content = "<h2 class='icon-blocked'>" + fail_msg + "</h2><p class='doselect'>" + data . error + "</p>" ;
3198
3198
popdialog ( content , "canceldialog" ) ;
3199
3199
}
3200
3200
return
0 commit comments