Home Reference Source Repository
public class | source

Moderator

Moderator component

Constructor Summary

Private Constructor
private

Initialize the instance.

Member Summary

Public Members
public

Moderator is in disabled state

public

Logged in state

Private Members
private

The Whitelist instance

Method Summary

Public Methods
public

addToWhitelist(title: *, url: *): boolean

Add to Whitelist

public

Disable moderator

public

enable()

Enable moderator

public

Get the serialized JSON form of the Whitelist.

public

Check if Chrome is locked.

public

Check if Chrome is unlocked.

public

lock(email: *, password: *): boolean

Lock

public

login(email: *, password: *): boolean

Login

public

logout

public

Remove from Whitelist

public

unlock(email: *, password: *): boolean

Unlock

Private Methods
private

Get administator's email.

private

Get administator's password.

private

Get the current Whitelist instance.

private

setEmail(email: string): void

Set administrator's email.

private

setPassword(password: string): void

Set administrator's password.

private

Setup all event listeners.

Private Constructors

private constructor source

Initialize the instance.

Public Members

public isDisabled: boolean source

Moderator is in disabled state

public loggedIn: boolean source

Logged in state

Private Members

private whitelist: * source

The Whitelist instance

Public Methods

public addToWhitelist(title: *, url: *): boolean source

Add to Whitelist

Params:

NameTypeAttributeDescription
title *
url *

Return:

boolean

Whether successfully added to whitelist.

public disable() source

Disable moderator

public enable() source

Enable moderator

public getWhitelistJSON(): whitelist source

Get the serialized JSON form of the Whitelist.

Return:

whitelist

The whitelist JSON.

public isLocked(): boolean source

Check if Chrome is locked. Locked means that an admin has signed in with their email.

Return:

boolean

Whether Chrome is locked.

public isUnlocked(): boolean source

Check if Chrome is unlocked. Locked means that an admin has signed in with their email.

Return:

boolean

Whether Chrome is unlocked.

public lock(email: *, password: *): boolean source

Lock

Params:

NameTypeAttributeDescription
email *
password *

Return:

boolean

Whether successfully locked

public login(email: *, password: *): boolean source

Login

Params:

NameTypeAttributeDescription
email *
password *

Return:

boolean

Whether successfully logged in

public logout(): boolean source

logout

Return:

boolean

Whether successfully logged out

public removeFromWhitelist(url: *): boolean source

Remove from Whitelist

Params:

NameTypeAttributeDescription
url *

Return:

boolean

Whether successfully removed from whitelist.

public unlock(email: *, password: *): boolean source

Unlock

Params:

NameTypeAttributeDescription
email *
password *

Return:

boolean

Whether successfully unlocked

Private Methods

private getEmail(): string source

Get administator's email.

Return:

string

Admin email.

private getPassword(): string source

Get administator's password.

Return:

string

Admin password.

private getWhitelist(): Object source

Get the current Whitelist instance.

Return:

Object

The whitelist instance.

private setEmail(email: string): void source

Set administrator's email.

Params:

NameTypeAttributeDescription
email string

The new email.

Return:

void

Void.

private setPassword(password: string): void source

Set administrator's password.

Params:

NameTypeAttributeDescription
password string

The new password.

Return:

void

Void.

private setupListeners() source

Setup all event listeners.

Listen:

onBeforeRequest

Listens for before requests

See: