Options
All
  • Public
  • Public/Protected
  • All
Menu

Ilias Buddy Desktop

Index

Modules

Classes

Interfaces

Variables

Functions

Object literals

Variables

Const AutoLaunch

AutoLaunch: AutoLaunch = require('auto-launch')

BrowserWindow

BrowserWindow: BrowserWindow

Const CronHelper

CronHelper: CronJobHelper = require('../../CronJobHelper/API/CronJobHelper')

Const FetchEntries

FetchEntries: IliasBuddyFetchEntriesApi = require('../FETCH/FetchEntriesApi')

Const Handlebars

Handlebars: Handlebars = require('handlebars')

Const ManageEntries

ManageEntries: IliasBuddyManageEntriesApi = require('../MANAGER/ManageEntriesApi')

Menu

Menu: Menu

Const RendererEntries

RendererEntries: Renderer = require('../GUI/RendererEntriesApi')

Tray

Tray: Tray

app

app: App

Let cachedEntries

cachedEntries: Entry[] = loadCacheFile()

Cached Ilias entries

Const compareVersions

compareVersions: compareVersions = require('compare-versions')

Const convert

convert: "C:/Users/nikla/Documents/GitHubBeta/IliasBuddyDesktop/node_modules/xml-js/types/index" = require('xml-js')

Const cron

cron: "C:/Users/nikla/Documents/GitHubBeta/IliasBuddyDesktop/node_modules/@types/node-cron/index" = require('node-cron')

Const cronstrue

cronstrue: "C:/Users/nikla/Documents/GitHubBeta/IliasBuddyDesktop/node_modules/cronstrue/dist/cronstrue" = require('cronstrue')

Const defaultSettings

defaultSettings: SettingsJsonDefault = JSON.parse(fs.readFileSync(settingsPaths.default).toString())
type

{import('../API/SettingsTypes').SettingsJsonDefault}

dialog

dialog: Dialog

Const electron

electron: Electron = require('electron')

Const eventEmitter

eventEmitter: EventEmitter = new events.EventEmitter()

Event emitter

Const events

events: internal = require('events')

Const fs

fs: "fs" = require('fs')

Let gAutoLaunch

gAutoLaunch: AutoLaunch = null

Global variable to enable/disable auto launch

type

{AutoLaunch}

Const gCacheFilePath

gCacheFilePath: string = path.join('cache_ilias_entries.json')

The cache file path

Let gCronJobFeedUpdate

gCronJobFeedUpdate: ScheduledTask = null

Global cron job for feed updates

type

{cron.ScheduledTask}

Let gCronJobProgramUpdate

gCronJobProgramUpdate: ScheduledTask = null

Global cron job for program updates

type

{cron.ScheduledTask}

Let gIliasApi

gIliasApi: IliasBuddyApi = null

Global interface to connect to and use the Ilias RSS feed

type

{IliasBuddyApi}

Let gIliasApiIsReady

gIliasApiIsReady: boolean = false

Global variable to display if the ilias Api is ready

Let gIliasApiPending

gIliasApiPending: boolean = false

Is true if there is currently an Ilias API login pending

Let gIliasOnlineIsReady

gIliasOnlineIsReady: boolean = false

Global variable to display if the online Api is ready

Let gInfoPopupToggled

gInfoPopupToggled: boolean = false

Indicate if info button was toggled

Let gMainWindow

gMainWindow: BrowserWindow = null

The current window to launch remote commands Global GUI window

type

{Electron.BrowserWindow}

Let gOnline

gOnline: boolean = false

Global indictor if computer is offline/online

Const gSearchManagerIliasEntries

gSearchManagerIliasEntries: SearchManager = new SearchManager(document.getElementById('ilias-entries-search'),document.getElementById('ilias-entries'), [{ name: 'description', querySelector: 'div.ilias-entry-description' },{ name: 'forum', querySelector: 'p.ilias-entry-forum' },{ name: 'title', querySelector: 'p.ilias-entry-title' },{ name: 'fileName', querySelector: 'p.ilias-entry-file-name' },{name: 'courseDirectory',querySelector: 'p.ilias-entry-course-directory'},{ name: 'date', querySelector: 'div.container-link-date > p' },{ name: 'description', querySelector: 'div.ilias-entry-description' },{ name: 'course', querySelector: 'p.ilias-entry-course' }])

Const gSearchManagerSettings

gSearchManagerSettings: SearchManager = new SearchManager(document.getElementById('settings_entries-search'),document.getElementById('settings_entries'), [{name: 'name',// tslint:disable-next-line: max-line-lengthquerySelector: 'div.settings-info-container > p.settings-info-container-name'},{name: 'description',// tslint:disable-next-line: max-line-lengthquerySelector: 'div.settings-info-container > p.settings-info-container-description'}])

Let gSettingsPopupToggled

gSettingsPopupToggled: boolean = false

Indicate if settings button was toggled

Const gTitleBar

gTitleBar: TitleBarWin10 = new TitleBarWin10({actions: [{alt: 'settings',id: 'title-bar-action-settings',onClickCallback: () => { togglePopupScreen('settings') },svgFiles: [{fileName: path.join(__dirname, 'images', 'title-bar', 'settings.svg')}]}, {alt: 'info',id: 'title-bar-action-info',onClickCallback: () => { togglePopupScreen('info') },svgFiles: [{fileName: path.join(__dirname, 'images', 'title-bar', 'info.svg')}]}],appIconPath: path.join(__dirname, './images/favicon/favicon.svg'),appName: 'IliasBuddyDesktop',defaultCallbacks: {close: () => {log.debugIndex('TitleBarWin10 > action > close')return Promise.resolve()},maximize: () => {log.debugIndex('TitleBarWin10 > action > maximize')return Promise.resolve()},minimize: () => {log.debugIndex('TitleBarWin10 > action > minimize')return Promise.resolve()},restore: () => {log.debugIndex('TitleBarWin10 > action > restore')return Promise.resolve()}},menu: [{onClickCallback: () => { gWindowManager.showWindow('main') },text: 'Feed'}, {onClickCallback: () => { gWindowManager.showWindow('saved') },text: 'Saved'}, {onClickCallback: () => { gWindowManager.showWindow('links') },text: 'Links'}]})

Title bar

Let gVersionCheckPending

gVersionCheckPending: boolean = false

Is true if there is currently a version check pending

Const gWindowManager

gWindowManager: WindowManager = new WindowManager([{ documentId: 'main', id: 'main' },{ documentId: 'info', id: 'info' },{ documentId: 'welcome', id: 'welcome' },{ documentId: 'settings', id: 'settings' },{ documentId: 'saved', id: 'saved' },{ documentId: 'links', id: 'links' }], 'main')

Window manager

Let gWindowSetupAfterExecuted

gWindowSetupAfterExecuted: boolean = false

Is true if there is currently a version check pending

globalShortcut

globalShortcut: GlobalShortcut

Const hbsPartialPath

hbsPartialPath: string = path.join(hbsTemplatePath, 'partials')

Const hbsTemplatePath

hbsTemplatePath: string = path.join(__dirname, 'templates')

ipcMain

ipcMain: IpcMain

ipcRenderer

ipcRenderer: IpcRenderer

Const localSettings

localSettings: SettingsJsonLocal = FileManager.fileExistsSyncAppData(settingsPaths.local)? JSON.parse(FileManager.readFileSyncAppData(settingsPaths.local).toString()): {}
type

{import('../API/SettingsTypes').SettingsJsonLocal}

Const log

log: "C:/Users/nikla/Documents/GitHubBeta/IliasBuddyDesktop/node_modules/electron-log/electron-log" = require('electron-log')

Const moment

moment: moment = require('moment')

nativeImage

nativeImage: NativeImage

net

net: Net

Const nodeCron

nodeCron: "C:/Users/nikla/Documents/GitHubBeta/IliasBuddyDesktop/node_modules/@types/node-cron/index" = require('node-cron')

Const notifier

notifier: NodeNotifier = require('node-notifier')

Const partialNames

partialNames: string[] = ['partialCourseAndDirectory','partialDescription','partialLinkDate']

Const path

path: "path" = require('path')

remote

remote: Remote

Const runThemNeverOnlyCallbacks

runThemNeverOnlyCallbacks: false = false

session

session: Session

shell

shell: Shell

Const templateCronJob

templateCronJob: TemplateDelegate<any> = compileTemplate('templateCronJob')

Const templateFile

templateFile: TemplateDelegate<any> = compileTemplate('templateFile')

Render template for an Ilias entry that is a file update

Const templateKeyboardShortcut

templateKeyboardShortcut: TemplateDelegate<any> = compileTemplate('templateKeyboardShortcut')

Const templateOther

templateOther: TemplateDelegate<any> = compileTemplate('templateOther')

Render template for an Ilias entry that could not be specified

Const templatePassword

templatePassword: TemplateDelegate<any> = compileTemplate('templatePassword')

Const templatePost

templatePost: TemplateDelegate<any> = compileTemplate('templatePost')

Render template for an Ilias entry that is a post

Const templateText

templateText: TemplateDelegate<any> = compileTemplate('templateText')

Const templateToggle

templateToggle: TemplateDelegate<any> = compileTemplate('templateToggle')

Const url

url: "url" = require('url')

Const userDataPath

userDataPath: string = (electron.app || electron.remote.app).getPath('userData')

Functions

addRenderedIliasEntries

  • addRenderedIliasEntries(newEntries: string[], notification?: boolean): void
  • Add already rendered ilias entries to entries list (at the top)

    Parameters

    • newEntries: string[]

      Rendered Ilias entries

    • Default value notification: boolean = true

      Show notification about the new entries

    Returns void

broadcastError

  • broadcastError(title: string, err: Error): void
  • Broadcasts error message

    Parameters

    • title: string

      Title of error

    • err: Error

      Error

    Returns void

broadcastIliasLoginUpdate

  • broadcastIliasLoginUpdate(errorMessage: string): void
  • Message renderer window about a login test

    Parameters

    • errorMessage: string

    Returns void

broadcastOpenScreen

  • broadcastOpenScreen(screenId: any): void
  • Broadcast app to open a screen

    Parameters

    • screenId: any

    Returns void

checkForFeedUpdates

  • checkForFeedUpdates(): void
  • Check for Ilias feed updates (new entries)

    Returns void

checkForProgramUpdates

  • checkForProgramUpdates(): void
  • Check for program updates (new version)

    Returns void

checkIfIliasLoginIsPossible

  • Check if the credentials/internet connection are correct for a successful login

    Parameters

    Returns Promise<void>

Const compileTemplate

  • compileTemplate(templateName: any): TemplateDelegate<any>
  • compileTemplate(nameOfTemplate: any): TemplateDelegate<any>
  • Compile a handlebars template in template directory Compile a handlebars template in template directory

    Parameters

    • templateName: any

    Returns TemplateDelegate<any>

  • Compile a handlebars template in template directory Compile a handlebars template in template directory

    Parameters

    • nameOfTemplate: any

    Returns TemplateDelegate<any>

connectToIliasRssFeed

  • connectToIliasRssFeed(): Promise<void>
  • Try to connect the user to a private RSS feed

    Returns Promise<void>

convertIliasEntriesForClient

  • convertIliasEntriesForClient(entries: Entry[]): string[]
  • Convert Ilias API new entries to rendered HTML strings

    Parameters

    Returns string[]

copyToClipboard

  • copyToClipboard(url: string): void

createWindow

  • createWindow(): void
  • Create the main window

    Returns void

cronJobToText

  • cronJobToText(documentId: string, goalDocumentIdId: string): void
  • Get cron job string from one HTML element by id and copy an explanation string into another HTML element by "goal" id [Boiler plate from settings api RENDERER]

    Parameters

    • documentId: string

      HTML element id which contains the cron job string

    • goalDocumentIdId: string

      HTML element id which should get the explanation string

    Returns void

loadCacheFile

  • loadCacheFile(): Entry[]

loginToIliasApi

  • loginToIliasApi(): void

openExternal

  • openExternal(url: string): Promise<void>
  • Open a link in external browser

    Parameters

    • url: string

      The website URL that should be opened

    Returns Promise<void>

Const registerPartial

  • registerPartial(partialName: any): void
  • registerPartial(partialName: string): void

relaunchApp

  • relaunchApp(): void
  • Relaunch the whole application

    Returns void

resetSettings

  • Reset settings onclick callback [Boiler plate from settings api RENDERER]

    Parameters

    Returns void

save

  • save(link: string): void
  • TODO Think about changing the link to guid or let it be. Save entry

    Parameters

    • link: string

    Returns void

saveSettings

  • saveSettings(): void
  • Save current settings (+ window size/position) in preferences file

    Returns void

sendNewIliasEntries

  • sendNewIliasEntries(newEntries: Entry[]): void
  • Send new entries rendered to the client

    Parameters

    Returns void

setAutoLaunch

  • setAutoLaunch(): void
  • Enable/disable the auto launch (in respect to the settings)

    Returns void

setCronJob

  • setCronJob(cronJobVar: ScheduledTask, enableIt: boolean, cronJobString: string, callback: Function, options: SetCronJobOptions): void
  • Enable/disable/change a cron job

    Parameters

    • cronJobVar: ScheduledTask

      The global cron job variable

    • enableIt: boolean

      Should the cron job be enabled or destroyed

    • cronJobString: string

      The cron job string expression

    • callback: Function

      The callback that will be executed as cron job

    • options: SetCronJobOptions

    Returns void

setCronJobFeedUpdate

  • setCronJobFeedUpdate(runInitially?: boolean): void
  • Enable/disable/change the feed update cron job (in respect to the settings)

    Parameters

    • Default value runInitially: boolean = false

    Returns void

setCronJobProgramUpdate

  • setCronJobProgramUpdate(runInitially?: boolean): void
  • Enable/disable/change the program update cron job (in respect to the settings)

    Parameters

    • Default value runInitially: boolean = false

    Returns void

setGlobalKeyboardShortShowApp

  • setGlobalKeyboardShortShowApp(oldValue: string): void
  • Set global keyboard shortcut to show/hide app with one combination

    Parameters

    • oldValue: string

    Returns void

setSetting

setSettings

  • Set settings onclick callback [Boiler plate from settings api RENDERER]

    Parameters

    Returns void

Const setSettingsElement

  • setSettingsElement(documentId: string, type: "password" | "toggle" | "text" | "cronJob" | "url" | "keyboardShortcut", value: any): void
  • Set settings element

    Parameters

    • documentId: string

      Settings id

    • type: "password" | "toggle" | "text" | "cronJob" | "url" | "keyboardShortcut"
    • value: any

    Returns void

setupAfterWindowHasLoaded

  • setupAfterWindowHasLoaded(): void
  • Initial setup after window is created and loaded

    Returns void

showHideWindow

  • showHideWindow(): void
  • Show/Hide window (toggle)

    Returns void

togglePopupScreen

  • togglePopupScreen(popUpScreenId: string): void
  • Toggle popup screens

    throws

    Error if popUpScreenId is not supported

    Parameters

    • popUpScreenId: string

      Popup screen id

    Returns void

Const updateOnlineStatus

  • updateOnlineStatus(): void
  • Send to main process changes of the network state (online=true/offline=false)

    Returns void

Object literals

Const settingsPaths

settingsPaths: object

default

default: string = path.join(__dirname, '../../../default_settings.json')

local

local: string = path.join('settings.json')

Generated using TypeDoc