Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@aller/cyclops-frontend-vanilla
Advanced tools
This package is for vanilla-js DOM-manipulation for cyclops-functions. As of now, it only contains code for injecting the login-button/showing your name in the place of the login-button.
import { injectUser } from '@aller/cyclops-frontend-vanilla'
injectUser(elementId, domain?, ILoginButton?)
For users that want the least possible bloat, imports should be handled as such:
import { injectUser } from "@aller/cyclops-frontend-vanilla/lib/components/loginButton";
Instead of importing everything the index.ts
forward-exports, it only imports the element that is wanted/needed. This could help tree-shaking in cases where there are no tree-shaking done on transpiling.
Injects a login-button to the elementId sent in as a parameter and fetches whether the user is logged in.
If you want to test the functionality on a non-relative domain
, the domain can also be sent with as a parameter.
This function can include an object of the type ILoginButton
interface for customizable classes and texts. Here are the defaults:
{
dropdownButtonClass: "cyclops-dropbtn",
dropdownContentClass: "cyclops-dropdown-content",
dropdownClass: "cyclops-dropdown",
containerContentClass: "cyclops-login",
loginText: "Logg Inn",
logoutText: "Logg Ut",
myPageText: "Minside",
extraLinks: []
}
For adding more custom elements in the user-dropdown, the property extraLinks
can be used. This property can hold elements of the interface:
interface IExtraLink {
text: string;
href: string;
}
If the property extraLinks
remain empty, there will only be added the default "Minside" and "Logg Ut" buttons. If the extraLinks
are defined, these links will appear between the "Minside" and "Logg Ut" links.
Add more vanilla-js DOM-manipulation code, for different functions. So far it is only injectUser
that has its own vanilla-JS element. This should probably be expanded when/if needed.
FAQs
Vanilla JS implementation of login-button
The npm package @aller/cyclops-frontend-vanilla receives a total of 265 weekly downloads. As such, @aller/cyclops-frontend-vanilla popularity was classified as not popular.
We found that @aller/cyclops-frontend-vanilla demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 open source maintainers collaborating on the project.
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.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.