Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
e1e464a3
Commit
e1e464a3
authored
Jun 09, 2023
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config
parent
5f79cec1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
14 deletions
+19
-14
.env.template
.env.template
+2
-2
config.ts
configs/app/config.ts
+3
-2
ENVS.md
docs/ENVS.md
+2
-2
ad.ts
lib/csp/policies/ad.ts
+0
-1
adButlerConfig.ts
types/client/adButlerConfig.ts
+5
-0
AdBanner.tsx
ui/shared/ad/AdBanner.tsx
+1
-1
adbutlerScript.ts
ui/shared/ad/adbutlerScript.ts
+6
-6
No files found.
.env.template
View file @
e1e464a3
...
@@ -45,8 +45,8 @@ NEXT_PUBLIC_HOMEPAGE_SHOW_GAS_TRACKER=__PLACEHOLDER_FOR_NEXT_PUBLIC_HOMEPAGE_SHO
...
@@ -45,8 +45,8 @@ NEXT_PUBLIC_HOMEPAGE_SHOW_GAS_TRACKER=__PLACEHOLDER_FOR_NEXT_PUBLIC_HOMEPAGE_SHO
NEXT_PUBLIC_HOMEPAGE_SHOW_AVG_BLOCK_TIME=__PLACEHOLDER_FOR_NEXT_PUBLIC_HOMEPAGE_SHOW_AVG_BLOCK_TIME__
NEXT_PUBLIC_HOMEPAGE_SHOW_AVG_BLOCK_TIME=__PLACEHOLDER_FOR_NEXT_PUBLIC_HOMEPAGE_SHOW_AVG_BLOCK_TIME__
NEXT_PUBLIC_AD_DOMAIN_WITH_AD=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_DOMAIN_WITH_AD__
NEXT_PUBLIC_AD_DOMAIN_WITH_AD=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_DOMAIN_WITH_AD__
NEXT_PUBLIC_AD_ADBUTLER_ON=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_ADBUTLER_ON__
NEXT_PUBLIC_AD_ADBUTLER_ON=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_ADBUTLER_ON__
NEXT_PUBLIC_AD_ADBUTLER_
ID_DESKTOP=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_ADBUTLER_ID
_DESKTOP__
NEXT_PUBLIC_AD_ADBUTLER_
CONFIG_DESKTOP=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_ADBUTLER_CONFIG
_DESKTOP__
NEXT_PUBLIC_AD_ADBUTLER_
ID_MOBILE=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_ADBUTLER_ID
_MOBILE__
NEXT_PUBLIC_AD_ADBUTLER_
CONFIG_MOBILE=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_ADBUTLER_CONFIG
_MOBILE__
NEXT_PUBLIC_AD_SLISE_ON=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_SLISE_ON__
NEXT_PUBLIC_AD_SLISE_ON=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_SLISE_ON__
NEXT_PUBLIC_GRAPHIQL_TRANSACTION=__PLACEHOLDER_FOR_NEXT_PUBLIC_GRAPHIQL_TRANSACTION__
NEXT_PUBLIC_GRAPHIQL_TRANSACTION=__PLACEHOLDER_FOR_NEXT_PUBLIC_GRAPHIQL_TRANSACTION__
NEXT_PUBLIC_WEB3_DEFAULT_WALLET=__PLACEHOLDER_FOR_NEXT_PUBLIC_WEB3_DEFAULT_WALLET__
NEXT_PUBLIC_WEB3_DEFAULT_WALLET=__PLACEHOLDER_FOR_NEXT_PUBLIC_WEB3_DEFAULT_WALLET__
...
...
configs/app/config.ts
View file @
e1e464a3
/* eslint-disable no-restricted-properties */
/* eslint-disable no-restricted-properties */
import
type
{
AdButlerConfig
}
from
'
types/client/adButlerConfig
'
;
import
type
{
NavItemExternal
}
from
'
types/client/navigation-items
'
;
import
type
{
NavItemExternal
}
from
'
types/client/navigation-items
'
;
import
type
{
WalletType
}
from
'
types/client/wallets
'
;
import
type
{
WalletType
}
from
'
types/client/wallets
'
;
import
type
{
NetworkExplorer
}
from
'
types/networks
'
;
import
type
{
NetworkExplorer
}
from
'
types/networks
'
;
...
@@ -114,8 +115,8 @@ const config = Object.freeze({
...
@@ -114,8 +115,8 @@ const config = Object.freeze({
ad
:
{
ad
:
{
domainWithAd
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_AD_DOMAIN_WITH_AD
)
||
'
blockscout.com
'
,
domainWithAd
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_AD_DOMAIN_WITH_AD
)
||
'
blockscout.com
'
,
adButlerOn
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_AD_ADBUTLER_ON
)
===
'
true
'
,
adButlerOn
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_AD_ADBUTLER_ON
)
===
'
true
'
,
adButler
IdDesktop
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_AD_ADBUTLER_ID_DESKTOP
),
adButler
ConfigDesktop
:
parseEnvJson
<
AdButlerConfig
>
(
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_AD_ADBUTLER_CONFIG_DESKTOP
)
),
adButler
IdMobile
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_AD_ADBUTLER_ID_MOBILE
),
adButler
ConfigMobile
:
parseEnvJson
<
AdButlerConfig
>
(
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_AD_ADBUTLER_CONFIG_MOBILE
)
),
sliseOn
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_AD_SLISE_ON
)
===
'
true
'
,
sliseOn
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_AD_SLISE_ON
)
===
'
true
'
,
},
},
web3
:
{
web3
:
{
...
...
docs/ENVS.md
View file @
e1e464a3
...
@@ -46,8 +46,8 @@ The app instance could be customized by passing following variables to NodeJS en
...
@@ -46,8 +46,8 @@ The app instance could be customized by passing following variables to NodeJS en
| NEXT_PUBLIC_HOMEPAGE_SHOW_AVG_BLOCK_TIME |
`boolean`
| Set to false if average block time is useless for the network | - |
`true`
|
`false`
|
| NEXT_PUBLIC_HOMEPAGE_SHOW_AVG_BLOCK_TIME |
`boolean`
| Set to false if average block time is useless for the network | - |
`true`
|
`false`
|
| NEXT_PUBLIC_AD_DOMAIN_WITH_AD |
`string`
| The domain on which we display ads | - | - |
`blockscout.com`
|
| NEXT_PUBLIC_AD_DOMAIN_WITH_AD |
`string`
| The domain on which we display ads | - | - |
`blockscout.com`
|
| NEXT_PUBLIC_AD_ADBUTLER_ON |
`boolean`
| Set to true to show Adbutler banner instead of Coinzilla banner | - |
`false`
|
`true`
|
| NEXT_PUBLIC_AD_ADBUTLER_ON |
`boolean`
| Set to true to show Adbutler banner instead of Coinzilla banner | - |
`false`
|
`true`
|
| NEXT_PUBLIC_AD_ADBUTLER_
ID_DESKTOP |
`string`
| Placement ID for desktop Adbutler banner | - | - |
`123456
`
|
| NEXT_PUBLIC_AD_ADBUTLER_
CONFIG_DESKTOP |
`{ id: string; width: string; height: string }`
| Placement config for desktop Adbutler banner | - | - |
`{'id':'123456','width':'728','height':'90'}
`
|
| NEXT_PUBLIC_AD_ADBUTLER_
ID_MOBILE |
`string`
| Placement ID for mobile Adbutler banner | - | - |
`123456
`
|
| NEXT_PUBLIC_AD_ADBUTLER_
CONFIG_MOBILE |
`{ id: string; width: number; height: number }`
| Placement config for mobile Adbutler banner | - | - |
`{'id':'654321','width':'300','height':'100'}
`
|
| NEXT_PUBLIC_AD_SLISE_ON |
`boolean`
| Set to true to show Slise banner instead of Coinzilla banner | - |
`false`
|
`true`
|
| NEXT_PUBLIC_AD_SLISE_ON |
`boolean`
| Set to true to show Slise banner instead of Coinzilla banner | - |
`false`
|
`true`
|
| NEXT_PUBLIC_API_SPEC_URL |
`string`
| Spec to be displayed on api-docs page | - | - |
`https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml`
|
| NEXT_PUBLIC_API_SPEC_URL |
`string`
| Spec to be displayed on api-docs page | - | - |
`https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml`
|
| NEXT_PUBLIC_GRAPHIQL_TRANSACTION |
`string`
| Txn hash for default query at GraphQl playground page | - | - |
`0x69e3923eef50eada197c3336d546936d0c994211492c9f947a24c02827568f9f`
|
| NEXT_PUBLIC_GRAPHIQL_TRANSACTION |
`string`
| Txn hash for default query at GraphQl playground page | - | - |
`0x69e3923eef50eada197c3336d546936d0c994211492c9f947a24c02827568f9f`
|
...
...
lib/csp/policies/ad.ts
View file @
e1e464a3
// import CryptoJS from 'crypto-js';
import
Base64
from
'
crypto-js/enc-base64
'
;
import
Base64
from
'
crypto-js/enc-base64
'
;
import
sha256
from
'
crypto-js/sha256
'
;
import
sha256
from
'
crypto-js/sha256
'
;
import
type
CspDev
from
'
csp-dev
'
;
import
type
CspDev
from
'
csp-dev
'
;
...
...
types/client/adButlerConfig.ts
0 → 100644
View file @
e1e464a3
export
type
AdButlerConfig
=
{
id
:
string
;
width
:
string
;
height
:
string
;
}
ui/shared/ad/AdBanner.tsx
View file @
e1e464a3
...
@@ -34,7 +34,7 @@ const AdBanner = ({ className, isLoading }: { className?: string; isLoading?: bo
...
@@ -34,7 +34,7 @@ const AdBanner = ({ className, isLoading }: { className?: string; isLoading?: bo
className=
{
className
}
className=
{
className
}
isLoaded=
{
!
isLoading
}
isLoaded=
{
!
isLoading
}
borderRadius=
"none"
borderRadius=
"none"
maxW=
{
appConfig
.
ad
.
adButlerOn
?
'
760px
'
:
'
728px
'
}
maxW=
{
appConfig
.
ad
.
adButlerOn
?
appConfig
.
ad
.
adButlerConfigDesktop
?.
width
:
'
728px
'
}
w=
"100%"
w=
"100%"
>
>
{
content
}
{
content
}
...
...
ui/shared/ad/adbutlerScript.ts
View file @
e1e464a3
...
@@ -8,13 +8,13 @@ var AdButler = AdButler || {}; AdButler.ads = AdButler.ads || [];
...
@@ -8,13 +8,13 @@ var AdButler = AdButler || {}; AdButler.ads = AdButler.ads || [];
var abkw = window.abkw || '';
var abkw = window.abkw || '';
const isMobile = window.matchMedia("only screen and (max-width: 760px)").matches;
const isMobile = window.matchMedia("only screen and (max-width: 760px)").matches;
if (isMobile) {
if (isMobile) {
var plc
${
appConfig
.
ad
.
adButler
IdMobile
}
= window.plc
${
appConfig
.
ad
.
adButlerIdMobile
}
|| 0;
var plc
${
appConfig
.
ad
.
adButler
ConfigMobile
?.
id
}
=
window
.
plc$
{
appConfig
.
ad
.
adButlerConfigMobile
?.
id
}
||
0
;
document.getElementById('ad-banner').innerHTML += '<'+'div id="placement_
${
appConfig
.
ad
.
adButler
IdMobile
}
_'+plc
${
appConfig
.
ad
.
adButlerIdMobile
}
+'"></'+'div>';
document
.
getElementById
(
'
ad-banner
'
).
innerHTML
+=
'
<
'
+
'
div id="placement_${ appConfig.ad.adButler
ConfigMobile?.id }_
'
+
plc$
{
appConfig
.
ad
.
adButlerConfigMobile
?.
id
}
+
'
"></
'
+
'
div>
'
;
document
.
getElementById
(
"
ad-banner
"
).
className
=
"
ad-container mb-3
"
;
document
.
getElementById
(
"
ad-banner
"
).
className
=
"
ad-container mb-3
"
;
AdButler.ads.push({handler: function(opt){ AdButler.register(182226,
${
appConfig
.
ad
.
adButler
IdMobile
}
, [320,100], 'placement_
${
appConfig
.
ad
.
adButlerIdMobile
}
_'+opt.place, opt); }, opt: { place: plc
${
appConfig
.
ad
.
adButlerIdMobile
}
++, keywords: abkw, domain: 'servedbyadbutler.com', click:'CLICK_MACRO_PLACEHOLDER' }});
AdButler
.
ads
.
push
({
handler
:
function
(
opt
){
AdButler
.
register
(
182226
,
$
{
appConfig
.
ad
.
adButler
ConfigMobile
?.
id
},
[
$
{
appConfig
.
ad
.
adButlerConfigMobile
?.
width
},
$
{
appConfig
.
ad
.
adButlerConfigMobile
?.
height
}],
'
placement_${ appConfig.ad.adButlerConfigMobile?.id }_
'
+
opt
.
place
,
opt
);
},
opt
:
{
place
:
plc$
{
appConfig
.
ad
.
adButlerConfigMobile
?.
id
}
++
,
keywords
:
abkw
,
domain
:
'
servedbyadbutler.com
'
,
click
:
'
CLICK_MACRO_PLACEHOLDER
'
}});
}
else
{
}
else
{
var plc
${
appConfig
.
ad
.
adButler
IdDesktop
}
= window.plc
${
appConfig
.
ad
.
adButlerIdDesktop
}
|| 0;
var
plc$
{
appConfig
.
ad
.
adButler
ConfigDesktop
?.
id
}
=
window
.
plc$
{
appConfig
.
ad
.
adButlerConfigDesktop
?.
id
}
||
0
;
document.getElementById('ad-banner').innerHTML += '<'+'div id="placement_
${
appConfig
.
ad
.
adButler
IdDesktop
}
_'+plc
${
appConfig
.
ad
.
adButlerIdDesktop
}
+'"></'+'div>';
document
.
getElementById
(
'
ad-banner
'
).
innerHTML
+=
'
<
'
+
'
div id="placement_${ appConfig.ad.adButler
ConfigDesktop?.id }_
'
+
plc$
{
appConfig
.
ad
.
adButlerConfigDesktop
?.
id
}
+
'
"></
'
+
'
div>
'
;
AdButler.ads.push({handler: function(opt){ AdButler.register(182226,
${
appConfig
.
ad
.
adButler
IdDesktop
}
, [728,90], 'placement_
${
appConfig
.
ad
.
adButlerIdDesktop
}
_'+opt.place, opt); }, opt: { place: plc
${
appConfig
.
ad
.
adButlerIdDesktop
}
++, keywords: abkw, domain: 'servedbyadbutler.com', click:'CLICK_MACRO_PLACEHOLDER' }});
AdButler
.
ads
.
push
({
handler
:
function
(
opt
){
AdButler
.
register
(
182226
,
$
{
appConfig
.
ad
.
adButler
ConfigDesktop
?.
id
},
[
$
{
appConfig
.
ad
.
adButlerConfigDesktop
?.
width
},
$
{
appConfig
.
ad
.
adButlerConfigDesktop
?.
height
}],
'
placement_${ appConfig.ad.adButlerConfigDesktop?.id }_
'
+
opt
.
place
,
opt
);
},
opt
:
{
place
:
plc$
{
appConfig
.
ad
.
adButlerConfigDesktop
?.
id
}
++
,
keywords
:
abkw
,
domain
:
'
servedbyadbutler.com
'
,
click
:
'
CLICK_MACRO_PLACEHOLDER
'
}});
}
}
`;
`;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment