Klipfolio Dashboard 5 API

Object Items

Object
   |
   +--Klip
         |
         +--Items

The Items object provides an interface to the Klip's icon, Klip's status area (which usually shows the number of unvisited items) and, most importantly, an array interface to items in the Klip, hereafter referred to as the Items[] array.

For example, a new Klip starts with an empty Items[] array. If after the first refresh the user sees 10 items in the Klip, then Items[] holds 10 items indexed as Items[0] to Items[9].

Each index in the Items[] array returns an Item object. The most common use of the Item object is to call Item.getData() and Item.setData().

How KlipFlio Updates Items[]

When your Klip calls Engines.Data.process() during refresh, Klipfolio Dashboard accesses the remote <contentsource>, parses the XML according to the instructions in the Klip's <style> parameter, and updates Items[].

During parsing, each item that Engines.Data.process() extracts from <contentsource> creates an Item object. Engines.Data.process() inserts this new Item at the top of the Items[] array if it does not already exist (in which case it updates the existing item) or has not been previously deleted (in which case it discards the incoming item).

Use Engines.Data.process() to add new items to the Klip. If you want to add an item without using a remote content source, simply create a string that has the XML for the new item and call Engines.Data.process().


Nested Object Summary
<static class> Items.Deleted
 
Properties Summary
 boolean autoremove
          Specifies whether Klipfolio Dashboard automatically removes items in a Klip according to the user's global Item Management settings (default true).
 boolean banner
          Specifies a banner for the Klip's Customize window.
 boolean canalert
          Specifies whether Klipfolio Dashboard should alert the user when creating a new item or updating an existing item based on the user's alerting preferences (default true).
 String icon
          Specifies the icon displayed in the icon area (upper-left) of your Klip.
 String iconAlt
          Specifies the text displayed in a tooltip when the user hovers their mouse over the icon area (upper-left corner of your Klip).
 boolean iconvisible
          Specifies whether the icon area (upper-left corner of Klip) is visible (default true).
 integer length
          Returns the number of Item objects contained in your Klip (read-only).
 boolean removeduplicates
          Specifies whether Klipfolio Dashboard should check for duplicate items (default true).
 boolean savehistory
          Specifies whether Klipfolio Dashboard should disable the Klip's loading and saving of history (default true).
 String status
          Specifies the content displayed in the status area (top-left corner of your Klip).
 String statusAlt
          Specifies the text displayed in the tooltip for the status area (top-left) of your Klip.
 boolean statusvisible
          Specifies whether the status area (top-left corner of Klip) is visible (default true).
   
Function Summary
 array actions( <String> text1, <function> function1[, <String> text2, <function> function2, ...])
           Adds a custom menu option(s) above "Copy" in the menu that appears when the user right-clicks on any item in a Klip.
 function clear( [<boolean> permanently] )
           Clears all entries in the Items[] array (user will see an empty Klip).
 integer findItemByIID( <String> iid )
           Returns the index of the item in the Items array that matches the specified iid.
 array globalactions( <String> text1, <function> function1[, <String> text2, <function> function2, ...])
           Adds a custom menu option(s) above "Refresh" in the Klip Menu.
 function onClick( [<integer> index], [<String> style] )
           Specifies a Handler Function for Klipfolio Dashboard to call in your JavaScript when the user clicks on any item in the Klip.
 boolean onDelete( [<integer> index] )
           Specifies a Handler Function for Klipfolio Dashboard to call in your JavaScript when the user attempts to delete any item in a Klip.
 function processAutoRemove()
           Requests Klipfolio Dashboard to immediately remove all items that are older than the user's Klipfolio Dashboard preferences setting.
 function purge( [<boolean> permanently] )
           Removes all un-modified entries in the Items array at the end of the Klip.onRefresh() event.
 boolean remove( <Item> item | <integer> index [, <boolean> permanently] )
           Removes an existing item from the Klip.
 function sort( <String> sortBy | <boolean> reversed )
           Sorts items based on the specified sort option.

Properties Detail

autoremove

boolean autoremove

banner

boolean banner

canalert

boolean canalert

icon

String icon

iconAlt

String iconAlt

iconvisible

boolean iconvisible

length

integer length

removeduplicates

boolean removeduplicates

savehistory

boolean savehistory

status

String status

statusAlt

String statusAlt

statusvisible

boolean statusvisible

Function Detail

actions

array actions( <String> text1, <function> function1[, <String> text2, <function> function2, ...])

clear

function clear( [<boolean> permanently] )

findItemByIID

integer findItemByIID( <String> iid )

globalactions

array globalactions( <String> text1, <function> function1[, <String> text2, <function> function2, ...])

onClick

function onClick( [<integer> index], [<String> style] )

onDelete

boolean onDelete( [<integer> index] )

processAutoRemove

function processAutoRemove()

purge

function purge( [<boolean> permanently] )

remove

boolean remove( <Item> item | <integer> index [, <boolean> permanently] )

sort

function sort( <String> sortBy | <boolean> reversed )

Klipfolio Dashboard 5 API

© 2009 Klipfolio Inc. All Rights Reserved.