Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AppMainElement

Polymer element for the main UI

Hierarchy

Index

Constructors

Static constructor

  • Returns AppMainElement

Events

onAcceptPermissionsClicked

  • onAcceptPermissionsClicked(): Promise<void>

Protected onChromeMessage

  • onChromeMessage(request: IMsgType, sender: MessageSender, response: ChromeMsg.ResponseCB): boolean

Protected onChromeStorageChanged

  • onChromeStorageChanged(changes: object): void
  • Item in chrome.storage changed

    Parameters

    • changes: object

      details on changes

      • [key: string]: StorageChange

    Returns void

onConfirmDialogTapped

  • onConfirmDialogTapped(): void

onDenyPermissionsClicked

  • onDenyPermissionsClicked(): Promise<void>

Protected onLocalStorageChanged

  • onLocalStorageChanged(ev: StorageEvent): void

onSelectedPageChanged

  • onSelectedPageChanged(): Promise<void>

Properties

Protected appDrawer

appDrawer: AppDrawerElement

Protected appDrawerLayout

appDrawerLayout: AppDrawerLayoutElement

Protected confirmDialog

confirmDialog: ConfirmDialogElement

Protected confirmFn

confirmFn: function

Function to call on confirm dialog confirm button click

Type declaration

    • (): void
    • Returns void

Protected errorDialog

errorDialog: ErrorDialogElement

Protected mainMenu

mainMenu: PaperListboxElement

Protected mainPages

mainPages: NeonAnimatedPagesElement

Protected pages

pages: IPage[] = [{label: ChromeLocale.localize('menu_settings'), route: 'page-settings',icon: 'myicons:settings', fn: null, url: null,ready: true, disabled: false, divider: false,insertion: 'settingsInsertion', obj: SettingsPageElement, el: null,},{label: ChromeLocale.localize('menu_preview'), route: 'page-preview',icon: 'myicons:pageview', fn: this.showScreensaverPreview.bind(this), url: null,ready: true, disabled: false, divider: false,insertion: null, obj: null, el: null,},{label: ChromeLocale.localize('menu_google'), route: 'page-google-photos',icon: 'myicons:cloud', fn: this.showGooglePhotosPage.bind(this), url: null,ready: false, divider: true, disabled: false,insertion: 'googlePhotosInsertion', obj: GooglePhotosPageElement, el: null,},{label: ChromeLocale.localize('menu_permission'), route: 'page-permission',icon: 'myicons:perm-data-setting', fn: this.showPermissionsDialog.bind(this), url: null,ready: true, divider: false, disabled: false,insertion: null, obj: null, el: null,},{label: ChromeLocale.localize('menu_error'), route: 'page-error',icon: 'myicons:error', fn: null, url: null,ready: false, disabled: false, divider: true,insertion: 'errorInsertion', obj: ErrorPageElement, el: null,},{label: ChromeLocale.localize('menu_help'), route: 'page-help',icon: 'myicons:help', fn: null, url: null,ready: false, divider: false, disabled: false,insertion: 'helpInsertion', obj: HelpPageElement, el: null,},{label: ChromeLocale.localize('help_faq'), route: 'page-faq',icon: 'myicons:help', fn: null, url: 'https://opus1269.github.io/screensaver/faq.html',ready: true, divider: false, disabled: false,insertion: null, obj: null, el: null,},{label: ChromeLocale.localize('menu_support'), route: 'page-support',icon: 'myicons:help', fn: null, url: `${AppMainElement.EXT_URI}support`,ready: true, divider: false, disabled: false,insertion: null, obj: null, el: null,},{label: ChromeLocale.localize('menu_rate'), route: 'page-rate',icon: 'myicons:grade', fn: null, url: `${AppMainElement.EXT_URI}reviews`,ready: true, divider: false, disabled: false,insertion: null, obj: null, el: null,},{label: ChromeLocale.localize('menu_pushy'), route: 'page-pushy',icon: 'myicons:extension', fn: null, url: AppMainElement.PUSHY_URI,ready: true, divider: true, disabled: false,insertion: null, obj: null, el: null,},]

The app's pages

permission

permission: STATE = Permissions.STATE.notSet

Google Photos permission status

Protected permissionsDialog

permissionsDialog: PaperDialogElement

Protected prevRoute

prevRoute: string = "page-settings"

Previously selected IPage

route

route: string

Current IPage

Protected settingsPageEl

settingsPageEl: SettingsPageElement

Static Protected EXT_URI

EXT_URI: string = `https://chrome.google.com/webstore/detail/screensaver/${chrome.runtime.id}/`

Path to the extension in the Web Store

Static Protected PUSHY_URI

PUSHY_URI: "https://chrome.google.com/webstore/detail/pushy-clipboard/jemdfhaheennfkehopbpkephjlednffd" = "https://chrome.google.com/webstore/detail/pushy-clipboard/jemdfhaheennfkehopbpkephjlednffd"

Path to my Pushy Clipboard extension

Accessors

permissionStatus

  • get permissionStatus(): string

Static template

  • get template(): HTMLTemplateElement

Methods

connectedCallback

  • connectedCallback(): void
  • Called when the element is added to a document. Can be called multiple times during the lifetime of an element.

    Returns void

disconnectedCallback

  • disconnectedCallback(): void
  • Called when the element is removed from a document. Can be called multiple times during the lifetime of an element.

    Returns void

Protected fireEvent

  • fireEvent(name: string, detailValue?: any): void
  • Dispatch an event

    Parameters

    • name: string

      event name

    • Optional detailValue: any

      optional value

    Returns void

Protected getPage

  • getPage(route: string): undefined | IPage

ready

  • ready(): void
  • Called during Polymer-specific element initialization. Called once, the first time the element is attached to the document.

    Returns void

Protected routeChanged

  • routeChanged(route: string | undefined, oldRoute: string | undefined): void

Protected setErrorMenuState

  • setErrorMenuState(): Promise<void>

Protected setGooglePhotosMenuState

  • setGooglePhotosMenuState(): void

showConfirmDialog

  • showConfirmDialog(text: string, title: string, confirmLabel: string, fn: function): void
  • Display a confirm dialog

    Parameters

    • text: string

      dialog text

    • title: string

      dialog title

    • confirmLabel: string

      confirm button text

    • fn: function

      function to call on confirm button click

        • (): void
        • Returns void

    Returns void

showErrorDialog

  • showErrorDialog(title: string, text: string, method?: undefined | string): void
  • Display an error dialog

    Parameters

    • title: string

      dialog title

    • text: string

      dialog text

    • Optional method: undefined | string

      optional calling method name

    Returns void

Protected showGooglePhotosPage

  • showGooglePhotosPage(): void

Protected showPage

  • showPage(page: IPage): void

Protected showPermissionsDialog

  • showPermissionsDialog(): void

Protected showScreensaverPreview

  • showScreensaverPreview(): Promise<void>

showStorageErrorDialog

  • showStorageErrorDialog(method: string): void

Static localize

  • localize(name: string, def?: undefined | string): string
  • Localize a string

    Parameters

    • name: string

      name from _locales

    • Optional def: undefined | string

      optional default value if name not found

    Returns string

Static setColors

  • setColors(isDark: boolean): void

Generated using TypeDoc