diff --git a/src/assets/conf/resources-landing-page.json b/src/assets/conf/resources-landing-page.json new file mode 100644 index 0000000..28fd664 --- /dev/null +++ b/src/assets/conf/resources-landing-page.json @@ -0,0 +1,22 @@ +{ + "grid-container": [ + { + "title": "Paycor", + "description": "Clock in and out, request time off, review health benefits and access paystubs using the Paycor human-resources application.", + "imagePath": "PaycorLogo2-Circle_100x100.png", + "urlText": "https://www.paycor.com/" + }, + { + "title": "Gmail", + "description": "Access your company e-mail and a suite of Google apps, including a calendar, instant messaging and cloud storage.", + "imagePath": "GmailCircle_100x100.png", + "urlText": "https://mail.google.com" + }, + { + "title": "Workplace", + "description": "Get the latest news and connect with colleagues. JDSfaulkner uses Workplace by Facebook for posting and sharing.", + "imagePath": "WorkplaceLogo-Circle_100x100.png", + "urlText": "https://jdsfaulkner.workplace.com" + } + ] +} \ No newline at end of file diff --git a/src/assets/pages/resources-landing-page.html b/src/assets/pages/resources-landing-page.html index 8135228..baa94cb 100644 --- a/src/assets/pages/resources-landing-page.html +++ b/src/assets/pages/resources-landing-page.html @@ -5,7 +5,7 @@
{{description}}
diff --git a/src/ts_source/templates.ts b/src/ts_source/templates.ts index 701d702..b1134a4 100644 --- a/src/ts_source/templates.ts +++ b/src/ts_source/templates.ts @@ -33,7 +33,6 @@ export function loadTemplate(filename: string, objs: object[], cb: TemplateCallb } export function loadTemplateSingle(filename: string, cardModel: CardModel, cb: (content: string, id: string) => void) { - console.log(cardModel); let contents = templateCache[filename]; if (!contents) throw new Error("No such template: " + filename); cardModel['id'] = createId(cardModel.resourcePath); diff --git a/src/ts_source/themes.ts b/src/ts_source/themes.ts index 97c4750..abd849d 100644 --- a/src/ts_source/themes.ts +++ b/src/ts_source/themes.ts @@ -36,11 +36,10 @@ export module Themes { for (let i = 0, l = headLinks.length; i < l; i++) { let link = headLinks[i]; if (themePattern.test(link.href)) { - console.log(`Found ${link}. Removing...`); - link.remove() + link.remove(); } } - head.append(buildCSSLink(newResource)); + head.prepend(buildCSSLink(newResource)); } function getButtonClassFromAppTheme(t: AppTheme): string { diff --git a/src/ts_source/viewFactory.ts b/src/ts_source/viewFactory.ts index 1b70d8c..b897cf4 100644 --- a/src/ts_source/viewFactory.ts +++ b/src/ts_source/viewFactory.ts @@ -1,4 +1,4 @@ -import {ConfigPaths, Configurator, FileUtils} from './fileutils' +import {Configurator, FileUtils} from './fileutils' import {loadTemplateSingle} from "./templates" const shell = require('electron').shell; @@ -37,36 +37,43 @@ export function buildFileCard(filePath: string, elem: Element, append: boolean = // }); } -export function buildDefaultWebCards(elem: Element) { - let userPrefs = Configurator.loadAppConfig(ConfigPaths.ApplicationConfigName); - let links = userPrefs['default-links']; +export function buildWebCardsFromConfig(configName: string) { + let elementConfig = Configurator.loadAppConfig(configName); let $ = require('jquery') - for (let i = 0, l = links.length; i < l; i++) { - let link = links[i]; - buildWebCard(link, elem, true, $); + let keys = Object.keys(elementConfig); + + + for (let i = 0, l = keys.length; i < l; i++) { + let key = keys[i]; + let contentList = elementConfig[key]; + let element = $(`#${key}`); + console.log(element); + for (let j = 0, m = contentList.length; j