Functions (AtKit)

From ATbar Wiki
Revision as of 16:47, 17 January 2013 by Mpw (Talk | contribs)

Jump to: navigation, search


Contents

API Documentation

AtKit.getVersion()

Paramaters: none Returns: string

Get the version of AtKit (format: x.y.zzzz)

AtKit.setName( name )

Paramaters: name (string) Returns: void

Set the name of the toolbar

AtKit.setAbout( html )

Paramaters: html (string) Returns: void

Set the text that will appear in the about dialog for the toolbar

AtKit.setLogo( src )

Paramaters: src (string) Returns: void

Set the logo to the src passed in

AtKit.isRendered( )

Paramaters: none Returns: bool

Returns a boolean value indicating whether the toolbar has been rendered

AtKit.getResourceURL( )

Paramaters: none Returns: string

Get the URL for AtKit resources

AtKit.getPluginURL()

Paramaters: none Returns: string

Get the URL to the plugins server

AtKit.setCSS( identifier, inlineStyle )

Paramaters: identifier (string jQuery selector), inlineStyle (string) Returns: void

Set a CSS rule that will be applied to identifier using a jQuery identifier

AtKit.setLanguage( language )

Paramaters: language (string) Returns: void

Set the language to be used by AtKit

AtKit.getLanguage()

Paramaters: none Returns: string

Get the language AtKit is running in

AtKit.addLocalisation( countrycode, key, value )

Paramaters: Country code (string), Key (string), Value (string) Returns: void

Add a localisation for countrycode for the key set to value

AtKit.addLocalisationMap( countrycode, Object map )

Paramaters: Country code (string), map (Object) Returns: void

Add a key-value pair array of localisations

AtKit.localisation( key )

Paramaters: key (string) Returns: string

Get a localised string for key

AtKit.addFix( regex, function )

Paramaters: regex (Regular expression), function (function) Returns: void

Add code to be run for a specific site. Regex is matched against site location, if it matches function will be run. Can be used to retroactively clean-up site HTML.

AtKit.addScript( url[, callback] )

Paramaters: url (string), callback (function, optional) Returns: void

Add a javascript file to the page. On successful insertion run callback

AtKit.addStylesheet( url, id )

Paramaters: url (string), id (string) Returns: void

Add a CSS file to the page. Note: May be overriden by styles on page. Using .setCSS() is more reliable.

AtKit.addFn( identifier, fn )

Paramaters: identifier (string, unique), fn (function) Returns: void

Add a global function that can be run by any part of the toolbar or its plugins.

AtKit.addCloseFn( identifier, fn )

Paramaters: identifier (string, unique), fn (function) Returns: void

Add a function that will be called when the toolbar is exited.

AtKit.addResetFn( identifier, fn )

Paramaters: identifier (string, unique), fn (function) Returns: void

Add a function that will be called when the toolbar is reset.

AtKit.addDialog( identifier, title, body )

Paramaters: identifier (string, unique), title (string), body (string) Returns: void

Add a dialog that can be called with AtKit.show()

AtKit.addButton( identifier, tooltip, icon, action[, dialogs[, functions[, options]]] )

Paramaters: identifier (string, unique), tooltip (string), icon (string url), action (function), dialogs (Object), functions (Object), options (Object) Returns: void

Add a button to the toolbar

AtKit.removeButton( identifier )

Paramaters: identifier (string) Returns: void

Remove a button from the toolbar with the specified identifier

AtKit.addSpacer( width )

Paramaters: width (int) Returns: void

Adds a spacer button. If width is specified it will add the spacer (same size as a button) the number of times specified by width.

AtKit.addSeparator( ident )

Paramaters: ident (string) Returns: void

Adds a separator element after the currently inserted button with optional class of ident

AtKit.removeSeparator( ident )

Paramaters: ident (string) Returns: void

Removes all separator elements with class of ident

AtKit.importPlugins( Array pluginArray[, callback] )

Paramaters: pluginArray (Array), callback (callable) Returns: void

Add an array of plugins to AtKit

AtKit.addPlugin( identifier )

Paramaters: identifier (string) Returns: void

Add a plugin specified by identifier to the toolbar

AtKit.registerPlugin( identifier, plugin )

Paramaters: identifier (string), plugin (callable) Returns: void

Called by plugins to register themselves with AtKit.

AtKit.getPluginMetadata( identifier )

Paramaters: identifier (string) Returns: plugin metadata (array)

Get metadata associated with a particular plugin

AtKit.listPlugins()

Paramaters: none Returns: array

Return an array of loaded plugins

AtKit.show( dialog[, callback] )

Paramaters: dialog (Object), callback (function) Returns: void

Show a dialog object

AtKit.message( data[, callback] )

Paramaters: dialog (string), callback (function) Returns: void

Show a dialog with the specified data

AtKit.hideDialog()

Paramaters: none Returns: void

Hide a message or show dialog

AtKit.call( identifier[, args] )

Paramaters: identifier (string), args (multiple) Returns: result of function

Call a function specified in AtKit.addFn()

AtKit.set( key, value )

Paramaters: key (string), value (multiple) Returns: void

Set temporary storage. Removed on page refresh.

AtKit.get( key )

Paramaters: key (string) Returns: multiple

Get value set by AtKit.set()

AtKit.storageAvailable( )

Paramaters: none Returns: boolean

Returns whether the current browser supports AtKit.storage() (HTML5 storage)

AtKit.storage( key[, value] )

Paramaters: key (string, unique), value (string) Returns: bool if value present, otherwise value (multiple)

Get / Set persistent storage for current page. Uses HTML5 localStorage.

AtKit.clearStorage( )

Paramaters: none Returns: void

Clear ALL the HTML5 localStorage objects set by AtKit.storage()

AtKit.lib( )

Paramaters: none Returns: jQuery

Return the jQuery library used by AtKit

AtKit.render( )

Paramaters: none Returns: void

Renders the toolbar once it has been set up

AtKit.setDebugger( fn )

Paramaters: fn (callable) Returns: void

Sets a callback to be run when a debug event is triggered.

AtKit.close( )

Paramaters: none Returns: void

Stop the toolbar.

AtKit.reset( )

Paramaters: none Returns: void

Reset the toolbar

Personal tools
Namespaces

Variants
Actions
Navigation
Languages
Toolbox