new Global( spa )

Description

Class for handling aspects common across LinkedIn.

This includes things like the global nav bar, information view, etc.

Parameters
Name Type Description
spa NexusHoratio.spa.SPA

SPA instance that manages this Page.

Members


dispatcher :NexusHoratio.base.Dispatcher


id :string

Details
string

logger :NexusHoratio.base.Logger


name :string

Details
string

pathname :RegExp


spa :NexusHoratio.spa.SPA


ctor :module:linkedin-tool~Page

Description

Alias for this.constructor.


scrollerClassName :string

Description

Useful default for CSS class name.

Methods


addService( Klass, ...rest ) → {NexusHoratio.base.Service}

Description
Parameters
Name Type Attributes Description
Klass function

A service class to instantiate. If this is a Page.Service subclass, the page property is also set.

rest object <repeatable>

Arbitrary objects to pass to constructor.

Returns

Instance of Klass.


<private> computePathnameRE( pathname ) → {RegExp}

Description

Turn a path into a RegExp.

Parameters
Name Type Description
pathname string | RegExp

A path to convert.

Returns

A converted path.


<private> waitUntilReady() → {external:Element}

Description

Wait until the page has loaded enough to continue.

Returns

The element matched by #readySelector.


cssClassName( extras ) → {string}

Description

Derive a CSS className from the name of the subclass.

Parameters
Name Type Description
extras Array.<string>

Extract strings to add to the class name.

Returns

A CSS className.


elementsHeightProcessor( elements ) → {NexusHoratio.web.StyleService~StyleProperties}

Description

A useful processor for many LIT pages.

It just sums up height of the matched elements to set a top margin.

Parameters
Name Type Description
elements NexusHoratio.web.StyleService~ElementMap

Elements to examine.

Returns

Style properties for to contribute.


Description

A useful finder for many LIT pages.

It finds the navbar and buffer for the content just below it. This is intended for use with navbarAndFriendsElementsProcessor.

Returns

Description

A useful processor for many LIT pages.

It computes a top margin that works nicely for consistently positioning items.

Currently only tested with Style.ONE pages.

Parameters
Name Type Description
elements NexusHoratio.web.StyleService~ElementMap

Elements to examine.

Returns

Style properties for to contribute.


waitForSelectorToBeGone( selector [, timeout ] ) → {Promise.<NexusHoratio.web~Results>}

Description

Wait for matching selector to disappear.

This could possibly be rolled into NexusHoratio.web.waitForSelector.

Parameters
Name Type Attributes Default Description
selector string

CSS selector.

timeout number <optional>
0

Time to wait in milliseconds, 0 disables.

Returns

Basically, something to await on.


Description

Click on the requested link in the global nav bar.

Parameters
Name Type Description
item string

Portion of the link to match.


<private> gotoNavButton( item )

Description

Click on the requested button in the global nav bar.

Parameters
Name Type Description
item string

Text on the button to look for.

Details

<p><a href="https://github.com/nexushoratio/userscripts/issues/414">(#414)</a> Retire this old Style-2 approach. There are only two users, Profile and Business, and both could be translated, so not great anyway.</p>


<private> gotoNavIcon( item )

Description

Click on the requested button in the global nav bar.

This uses the svg.id for selection.

Parameters
Name Type Description
item string

Text on the button to look for.


<private> gotoNavLabel( item )

Description

Click on the requested element in the Style-2 global nav bar.

This uses the aria-label, which has the potential to be translated.

Parameters
Name Type Description
item string

The prefix for the target aria-label.


<private> onHybridActivate()

Details

<p><a href="https://github.com/nexushoratio/userscripts/issues/295">(#295)</a> This is a hack. Find a more principled solution.</p>

Events


activate


deactivate