
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@ewc-lib/ewc-banner
Advanced tools
The EWC Banner component provides a standardized banner for Eurostat web applications. It offers a consistent visual identity across Eurostat digital products while allowing for customization to meet specific application needs.
npm install @ewc-lib/ewc-banner
Import the component in your application:
// Using ES modules
import '@ewc-lib/ewc-banner';
// Or using CommonJS
require('@ewc-lib/ewc-banner');
Then use it in your HTML:
<ewc-banner
maintitle="Your Main Title"
subtitle="Your Subtitle"
button-text="Button Text"
show-button>
</ewc-banner>
Property | Attribute | Type | Default | Description |
---|---|---|---|---|
showButton | show-button | Boolean | false | Whether to display the call-to-action button |
maintitle | maintitle | String | "" | The main title text for the banner |
subtitle | subtitle | String | "" | The subtitle text for the banner |
buttonText | button-text | String | "" | The text to display on the button |
Event Name | Description |
---|---|
button-click | Fired when the button is clicked. The embedding application can listen for this event and handle it as needed |
When a user clicks the button in the EWC Banner, the component dispatches a custom event named button-click
. This event:
bubbles: true
)composed: true
)The most straightforward approach is to add an event listener directly to the banner element:
// Get a reference to the banner element
const banner = document.querySelector('ewc-banner');
// Add an event listener for the button-click event
banner.addEventListener('button-click', () => {
console.log('Button was clicked!');
// Your code to handle the click goes here
});
<ewc-banner
maintitle="Population Statistics"
subtitle="Explore demographic data across Europe">
</ewc-banner>
<ewc-banner
maintitle="Economic Indicators"
subtitle="Latest economic data and analysis"
button-text="View Dashboard"
show-button>
</ewc-banner>
<script>
// Add event listener to handle button click
document.querySelector('ewc-banner').addEventListener('button-click', () => {
console.log('Button clicked');
// Handle the button click, e.g., show a modal or navigate to another page
});
</script>
You can also create and configure the banner programmatically:
// Import the component (if not already imported)
import '@ewc-lib/ewc-banner';
// Create a new banner element
const banner = document.createElement('ewc-banner');
// Set properties
banner.maintitle = "Programmatically Created Banner";
banner.subtitle = "This banner was created using JavaScript";
banner.buttonText = "Learn More";
banner.showButton = true;
// Add event listener for button click
banner.addEventListener('button-click', () => {
console.log('Button clicked');
// Handle the button click as needed
});
// Add the banner to the DOM
document.body.prepend(banner);
// You can also update properties dynamically
setTimeout(() => {
banner.maintitle = "Updated Title";
banner.subtitle = "Properties can be changed at runtime";
}, 5000);
The EWC Banner component is designed with accessibility in mind:
European Union Public License (EUPL)
FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.