1.1.2 • Published 6 years ago

@azinasili/wingman v1.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Wingman

Wingman, the popup window manager.

Installation

With NPM:

npm install @azinasili/wingman --save

Or include Wingman directly:

<script src="/path/to/wingman.js"></script>

Usage

Import Wingman and configure your component (required options shown).

// Import Wingman when using a bundler
import Wingman from 'wingman';

// Create a new instance of Wingman
const Popup = new Wingman({
  url: 'https://google.com',
  name: 'Google',
});

// Open instance of Wingman
Popup.open();

Options object

PropertyTypeDefaultDescription
urlStringnullUrl for popup window
nameStringnullGive popup window a name
heightNumber535Height of popup window
widthNumber450Width of popup window
eventBeforeOpenStringwingman:beforeOpenName of event to fire before popup window opens
eventBeforeCloseStringwingman:beforeCloseName of event to fire before popup window closes
eventAfterOpenStringwingman:afterOpenName of event to fire after popup window opens
eventAfterCloseStringwingman:afterCloseName of event to fire after popup window closes
beforeOpenFunctionnullFunction to run before popup window opens
beforeCloseFunctionnullFunction to run before popup window closes
afterOpenFunctionnullFunction to run after popup window opens
afterCloseFunctionnullFunction to run after popup window closes
windowToolbars.menubarBooleanfalseThe new secondary window renders the menubar
windowToolbars.toolbarBooleanfalseThe new secondary window renders the Navigation Toolbar
windowToolbars.locationBooleantrueThe new secondary window renders the Location bar
windowToolbars.personalbarBooleanfalseThe new secondary window renders the Personal Toolbar
windowToolbars.statusBooleantrueThe new secondary window has a status bar
windowFeatures.attentionBooleanfalseThe window is able to open even if another application is already in the foreground
windowFeatures.dependentBooleanfalseThe new window is said to be dependent of its parent window
windowFeatures.minimizableBooleanfalseThis setting can only apply to dialog windows
windowFeatures.fullscreenBooleanfalseFullscreens the new window
windowFeatures.noopenerBooleanfalseThe newly-opened window will not have access back to the originating window
windowFeatures.resizableBooleantrueThe new secondary window will be resizable
windowFeatures.scrollbarsBooleantrueThe new secondary window will show horizontal and/or vertical scrollbar(s) if the document doesn't fit into the window's viewport
windowPrivileges.chromeBooleanfalseThe page is loaded as window's only content, without any of the browser's interface elements
windowPrivileges.dialogBooleanfalseThe dialog feature removes all icons from the window's titlebar
windowPrivileges.modalBooleanfalseThe new window is said to be modal
windowPrivileges.titlebarBooleanfalseThew new secondary window will have a titlebar
windowPrivileges.alwaysRaisedBooleanfalseThe new window will always be displayed on top of other browser windows, regardless of whether it is active or not
windowPrivileges.alwaysLoweredBooleantrueThe new created window floats below, under its own parent when the parent window is not minimized
windowPrivileges.closeBooleanfalseThis feature removes the system close command icon and system close menu item

Methods

NameDescription
openCreates new instance of Wingman
destroyKills the instance of Wingman

Todo

  • Add tests

License

MIT License