Window Management API

Last Updated: Oct 27, 2012

Methods

pokki.show()

Shows the app window. If the app is minimized, it is opened. If the app is visible but in the background, it is raised to the foreground.

Parameters

No parameters.
Returns
No return object.

pokki.hide()

Minimizes the app window, if the app is running.

Parameters

No parameters.
Returns
No return object.

pokki.isShown()

Is the app currently running and not minimized.

Parameters

No parameters.
Returns
shown (boolean)
True if the app window is running and not minimized, false if it isn't.

pokki.loadWindowState(string, object defaults)

Parameters

state (string)
Unique identifier for the state, on a per app basis.
defaults (object)
width (integer)
height (integer)
position (string)
Accepted values: dontcare, centered, maximized, fullscreen
Example
pokki.loadWindowState('fubar', { width: 800, height: 600, position: 'centered' });

pokki.saveWindowState(string)

Parameters

state (string)
Unique identifier for the state, on a per app basis.

pokki.setWindowFeature(string, object)

Used to configure window features on a per app basis. The following features are supported:

Description

Feature

Setting

The aspect ratio of the app window when the user is resizing it. A value of 0 removes any lock. aspect Float
Enable the full-screen button in the app window’s title bar. Disabled by default. fullscreen Boolean
Enable the maximize button in the app window’s title bar. Disabled by default. maximize Boolean
Enable a button to launch the current page in the web sheet in the user’s default browser. Disabled by default. browser Boolean

Parameters

feature (string)
Feature to be set.
setting (object)
Configuration detail for the specific feature.

pokki.showWebSheet(string, integer, integer, function, function)

Parameters

url (string)
Initial URL to open in the web sheet.
width (integer)
The width of the web sheet.
height (integer)
The height of the web sheet.
loadingCallback (function)
Function called when the URL of the web sheet changes, however before the URL is loaded and displayed. This function is passed the URL being loaded as a parameter.

Parameters

url (string)

URL being loaded in the web sheet.

Returns

load (boolean)

Proceed with loading and displaying the URL in the web sheet.

errorCallback (function)
Function called when an error occurred loading a URL in the web sheet.

Parameters

error (string)

The following errors may be returned:


  • user_abort - The user cancelled or closed the web sheet (ie. pressed the close button).
  • network_error - A networking related error occurred, eg. loss of connectivity, couldn’t reach host, etc.
  • general_error - Non-user driven or networking error occurred, eg. out of memory

pokki.hideWebSheet()

If the app currently shows a web sheet, closes the web sheet.

Parameters

No parameters.
Returns
No return object.

pokki.setWebSheetSize( integer, integer)

Changes the width and height of the web sheet that is currently showing.

Parameters

width (integer)
The width of the web sheet.
height (integer)
The height of the web sheet.

pokki.allowResize(boolean, boolean, object restrictions)

This method is updated to support default app window width, height, and position.

Parameters

allowX (boolean)
Allow the app window to be resized horizontally.
allowY (boolean)
Allow the app window to be resized vertically.
restrictions (optional object)
If absent, there are no restrictions to the minimum and maximum width and height of the app window.

minWidth (integer)

The minimum width, in pixels, the user may resize the app window. A value of 0 indicates no restriction.

minHeight (integer)

The minimum height, in pixels, the user may resize the app window. A value of 0 indicates no restriction.

maxWidth (integer)

The maximum width, in pixels, the user may resize the app window. A value of 0 indicates no restriction.

maxHeight (integer)

The maximum height, in pixels, the user may resize the app window. A value of 0 indicates no restriction.

Example
// no restrictions
pokki.allowResize(true,true);

// no resize on width
pokki.allowResize(false, true, {
  minHeight: 300,
  maxHeight: 800
});

// resize both with constraints on both
pokki.allowResize(true, true, {
  minWidth: 500,
  maxWidth: 1024,
  minHeight: 500,
  maxHeight: 768
});

// resize both, no constraint on width
pokki.allowResize(true, true, {
  minWidth: 0, // not including this param would do the same
  maxWidth: 0, // not including this param would do the same
  minHeight: 200,
  maxHeight: 800
});

// resize both, only minimum constraint
pokki.allowResize(true, true, {
  minWidth: 500,
  maxWidth: 0, // not including this param would do the same
  minHeight: 400,
  maxHeight: 0 // not including this param would do the same
});
help@pokki.com
http://assets2.desk.com/
@Pokki
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
Invalid characters found
/customer/en/portal/articles/autocomplete