Functions (AtKit)
(→AtKit.addSeparator( ident )) |
|||
Line 265: | Line 265: | ||
Returns: void | Returns: void | ||
− | Reset the toolbar | + | Reset the toolbar. |
+ | |||
+ | == AtKit.help( ) == | ||
+ | Paramaters: none | ||
+ | Returns: void | ||
+ | |||
+ | Opens the help page for the current language. |
Latest revision as of 21:50, 8 October 2013
[edit] API Documentation
[edit] AtKit.getVersion()
Paramaters: none Returns: string
Get the version of AtKit (format: x.y.zzzz)
[edit] AtKit.setName( name )
Paramaters: name (string) Returns: void
Set the name of the toolbar
[edit] AtKit.setAbout( html )
Paramaters: html (string) Returns: void
Set the text that will appear in the about dialog for the toolbar
[edit] AtKit.setLogo( src )
Paramaters: src (string) Returns: void
Set the logo to the src passed in
[edit] AtKit.isRendered( )
Paramaters: none Returns: bool
Returns a boolean value indicating whether the toolbar has been rendered
[edit] AtKit.getResourceURL( )
Paramaters: none Returns: string
Get the URL for AtKit resources
[edit] AtKit.getPluginURL()
Paramaters: none Returns: string
Get the URL to the plugins server
[edit] 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
[edit] AtKit.setLanguage( language )
Paramaters: language (string) Returns: void
Set the language to be used by AtKit
[edit] AtKit.getLanguage()
Paramaters: none Returns: string
Get the language AtKit is running in
[edit] 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
[edit] AtKit.addLocalisationMap( countrycode, Object map )
Paramaters: Country code (string), map (Object) Returns: void
Add a key-value pair array of localisations
[edit] AtKit.localisation( key )
Paramaters: key (string) Returns: string
Get a localised string for key
[edit] 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.
[edit] AtKit.addScript( url[, callback] )
Paramaters: url (string), callback (function, optional) Returns: void
Add a javascript file to the page. On successful insertion run callback
[edit] 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.
[edit] 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.
[edit] AtKit.addCloseFn( identifier, fn )
Paramaters: identifier (string, unique), fn (function) Returns: void
Add a function that will be called when the toolbar is exited.
[edit] AtKit.addResetFn( identifier, fn )
Paramaters: identifier (string, unique), fn (function) Returns: void
Add a function that will be called when the toolbar is reset.
[edit] 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()
[edit] 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
[edit] AtKit.removeButton( identifier )
Paramaters: identifier (string) Returns: void
Remove a button from the toolbar with the specified identifier
[edit] 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.
[edit] AtKit.addSeparator( ident )
Paramaters: ident (string) Returns: void
Adds a separator element after the currently inserted button with optional class of ident. If ident is not specified, a random number is chosen.
[edit] AtKit.removeSeparator( ident )
Paramaters: ident (string) Returns: void
Removes all separator elements with class of ident
[edit] AtKit.importPlugins( Array pluginArray[, callback] )
Paramaters: pluginArray (Array), callback (callable) Returns: void
Add an array of plugins to AtKit
[edit] AtKit.addPlugin( identifier )
Paramaters: identifier (string) Returns: void
Add a plugin specified by identifier to the toolbar
[edit] AtKit.registerPlugin( identifier, plugin )
Paramaters: identifier (string), plugin (callable) Returns: void
Called by plugins to register themselves with AtKit.
[edit] AtKit.getPluginMetadata( identifier )
Paramaters: identifier (string) Returns: plugin metadata (array)
Get metadata associated with a particular plugin
[edit] AtKit.listPlugins()
Paramaters: none Returns: array
Return an array of loaded plugins
[edit] AtKit.show( dialog[, callback] )
Paramaters: dialog (Object), callback (function) Returns: void
Show a dialog object
[edit] AtKit.message( data[, callback] )
Paramaters: dialog (string), callback (function) Returns: void
Show a dialog with the specified data
[edit] AtKit.hideDialog()
Paramaters: none Returns: void
Hide a message or show dialog
[edit] AtKit.call( identifier[, args] )
Paramaters: identifier (string), args (multiple) Returns: result of function
Call a function specified in AtKit.addFn()
[edit] AtKit.set( key, value )
Paramaters: key (string), value (multiple) Returns: void
Set temporary storage. Removed on page refresh.
[edit] AtKit.get( key )
Paramaters: key (string) Returns: multiple
Get value set by AtKit.set()
[edit] AtKit.storageAvailable( )
Paramaters: none Returns: boolean
Returns whether the current browser supports AtKit.storage() (HTML5 storage)
[edit] 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.
[edit] AtKit.clearStorage( )
Paramaters: none Returns: void
Clear ALL the HTML5 localStorage objects set by AtKit.storage()
[edit] AtKit.lib( )
Paramaters: none Returns: jQuery
Return the jQuery library used by AtKit
[edit] AtKit.render( )
Paramaters: none Returns: void
Renders the toolbar once it has been set up
[edit] AtKit.setDebugger( fn )
Paramaters: fn (callable) Returns: void
Sets a callback to be run when a debug event is triggered.
[edit] AtKit.close( )
Paramaters: none Returns: void
Stop the toolbar.
[edit] AtKit.reset( )
Paramaters: none Returns: void
Reset the toolbar.
[edit] AtKit.help( )
Paramaters: none Returns: void
Opens the help page for the current language.