Skip to content
Snippets Groups Projects
Commit 7db5d56c authored by Neuber, Eugen Ramon's avatar Neuber, Eugen Ramon :speech_balloon:
Browse files

Add support for ads in browser console output

Proof of concept for text display from a separate json file,
all array items of key 'hi' are printed to the browser console.
parent f152bd1d
Branches
No related tags found
No related merge requests found
Pipeline #51160 failed
......@@ -261,8 +261,16 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) {
if (this.src)
this.fetchMetadata(this.src);
this.initRouter();
this.showAdvertisment();
}
async showAdvertisment() {
const url = this.basePath + 'exit-vim.json';
await fetch(url, { headers: {'Content-Type': 'application/json'} })
.then(response => response.json())
.then(data => data['hi'].forEach(item => console.log(item)));
}
/**
* Switches language if another language is requested
*
......
......
{
"hi" : [
"********************************************",
"* Hi, curious developer! *",
"* Join us at Graz University of Technology *",
"* See https://tugraz.at/open-positions? *",
"********************************************"
]
}
\ No newline at end of file
......@@ -160,6 +160,7 @@ Dependencies:
{src: 'assets/icon-*.png', dest: 'dist/' + await getDistPath(pkg.name)},
{src: 'assets/manifest.json', dest: 'dist', rename: pkg.name + '.manifest.json'},
{src: 'assets/silent-check-sso.html', dest:'dist'},
{src: 'assets/exit-vim.json', dest:'dist'},
{src: await getPackagePath('@dbp-toolkit/font-source-sans-pro', 'files/*'), dest: 'dist/' + await getDistPath(pkg.name, 'fonts/source-sans-pro')},
{src: await getPackagePath('@dbp-toolkit/common', 'src/spinner.js'), dest: 'dist/' + await getDistPath(pkg.name)},
{src: await getPackagePath('@dbp-toolkit/common', 'misc/browser-check.js'), dest: 'dist/' + await getDistPath(pkg.name)},
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment