ServicePaneHelper.jsm File Reference

helper functions for working with the service pane More...

Go to the source code of this file.

Functions

function getBadgesForNode (node)
 Helper function to retrieve visible badges for a service pane node. More...
 
function ServicePaneBadge (node, id)
 

Variables

 EXPORTED_SYMBOLS = [ "ServicePaneHelper" ]
 
const Cc = Components.classes
 
const Ci = Components.interfaces
 
const Cr = Components.results
 
const Ce = Components.Exception
 
const Cu = Components.utils
 
var badgeIndex = 0
 counter used to generate unique IDs for badges where no ID is supplied. More...
 
ServicePaneBadge prototype
 
var ServicePaneHelper
 

Detailed Description

helper functions for working with the service pane

Definition in file ServicePaneHelper.jsm.

Function Documentation

function getBadgesForNode (   node)

Helper function to retrieve visible badges for a service pane node.

Parameters
nodesbIServicePaneNode to check
Returns
array of badge IDs (empty if no badges visible)

Definition at line 44 of file ServicePaneHelper.jsm.

function ServicePaneBadge (   node,
  id 
)

Definition at line 70 of file ServicePaneHelper.jsm.

Here is the call graph for this function:

Variable Documentation

var badgeIndex = 0

counter used to generate unique IDs for badges where no ID is supplied.

Definition at line 57 of file ServicePaneHelper.jsm.

const Cc = Components.classes

Definition at line 32 of file ServicePaneHelper.jsm.

const Ce = Components.Exception

Definition at line 35 of file ServicePaneHelper.jsm.

Definition at line 33 of file ServicePaneHelper.jsm.

const Cr = Components.results

Definition at line 34 of file ServicePaneHelper.jsm.

const Cu = Components.utils

Definition at line 36 of file ServicePaneHelper.jsm.

EXPORTED_SYMBOLS = [ "ServicePaneHelper" ]

Definition at line 25 of file ServicePaneHelper.jsm.

ServicePaneBadge prototype

Definition at line 79 of file ServicePaneHelper.jsm.

var ServicePaneHelper
Initial value:
= {
getBadge: function(node, badgeID) {
if (!badgeID) {
badgeID = "badge\x00" + badgeIndex++;
} else if (/\x00/.test(badgeID)) {
throw "No NUL characters allowed in badge ID";
}
return new ServicePaneBadge(node, badgeID);
},
getAllBadges: function(node) {
let badges = getBadgesForNode(node);
return (new ServicePaneBadge(node, badgeID) for each (badgeID in badges));
}
}
function ServicePaneBadge(node, id)
var badgeIndex
counter used to generate unique IDs for badges where no ID is supplied.
function getBadgesForNode(node)
Helper function to retrieve visible badges for a service pane node.
let node

Definition at line 174 of file ServicePaneHelper.jsm.