Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
phosphor-menus
Advanced tools
Phosphor widgets for creating menus and menu bars.
Prerequisites
npm install --save phosphor-menus
Prerequisites
git clone https://github.com/phosphorjs/phosphor-menus.git
cd phosphor-menus
npm install
Rebuild
npm run clean
npm run build
Follow the source build instructions first.
# run tests in Firefox
npm test
# run tests in Chrome
npm run test:chrome
# run tests in IE
npm run test:ie
Follow the source build instructions first.
npm run docs
Navigate to docs/index.html
.
The runtime versions which are currently known to work are listed below. Earlier versions may also work, but come with no guarantees.
Follow the package install instructions first.
npm install --save-dev browserify browserify-css
browserify myapp.js -o mybundle.js
Note: This module is fully compatible with Node/Babel/ES6/ES5. Simply omit the type declarations when using a language other than TypeScript.
import {
Menu, MenuBar, MenuItem
} from 'phosphor-menus';
function main(): void {
let logHandler = (item: MenuItem) => {
console.log(item.text);
};
let fileMenu = new Menu([
new MenuItem({
text: 'New File',
shortcut: 'Ctrl+N',
handler: logHandler
}),
new MenuItem({
text: 'Open File',
shortcut: 'Ctrl+O',
handler: logHandler
}),
new MenuItem({
text: 'Save As...',
shortcut: 'Ctrl+Shift+S',
handler: logHandler
}),
new MenuItem({
type: MenuItem.Separator
}),
new MenuItem({
text: 'Exit',
handler: logHandler
})
]);
let editMenu = new Menu([
new MenuItem({
text: '&Undo',
icon: 'fa fa-undo',
shortcut: 'Ctrl+Z',
handler: logHandler
}),
new MenuItem({
text: '&Repeat',
icon: 'fa fa-repeat',
shortcut: 'Ctrl+Y',
handler: logHandler
}),
new MenuItem({
type: MenuItem.Separator
}),
new MenuItem({
text: '&Copy',
icon: 'fa fa-copy',
shortcut: 'Ctrl+C',
handler: logHandler
}),
new MenuItem({
text: 'Cu&t',
icon: 'fa fa-cut',
shortcut: 'Ctrl+X',
handler: logHandler
}),
new MenuItem({
text: '&Paste',
icon: 'fa fa-paste',
shortcut: 'Ctrl+V',
handler: logHandler
})
]);
let contextMenu = new Menu([
new MenuItem({
text: '&Copy',
icon: 'fa fa-copy',
shortcut: 'Ctrl+C',
handler: logHandler
}),
new MenuItem({
text: 'Cu&t',
icon: 'fa fa-cut',
shortcut: 'Ctrl+X',
handler: logHandler
}),
new MenuItem({
text: '&Paste',
icon: 'fa fa-paste',
shortcut: 'Ctrl+V',
handler: logHandler
})
]);
let menuBar = new MenuBar([
new MenuItem({
text: 'File',
submenu: fileMenu
}),
new MenuItem({
text: 'Edit',
submenu: editMenu
})
]);
menuBar.attach(document.body);
document.addEventListener('contextmenu', (event: MouseEvent) => {
event.preventDefault();
let x = event.clientX;
let y = event.clientY;
contextMenu.popup(x, y);
});
}
FAQs
Phosphor widgets for creating menus and menu bars.
We found that phosphor-menus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.