-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Jekyll tags from JavaScript source and load configuration instead
- Loading branch information
1 parent
8476dbe
commit be00c90
Showing
11 changed files
with
550 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const init = () => { | ||
// Load configuration | ||
const request = new Request(window.conference.config.baseurl + '/assets/js/config.json'); | ||
|
||
fetch(request) | ||
.then(response => | ||
response.json() | ||
) | ||
.then(config => { | ||
// Add configuration to global scope | ||
window.conference.config = Object.assign(window.conference.config, config); | ||
|
||
// Execute initialization functions | ||
for (const [name, module] of Object.entries(window.conference)) { | ||
if (name == 'config') { | ||
continue; | ||
} | ||
|
||
let c; | ||
if (name in config) { | ||
c = config[name]; | ||
} | ||
let l; | ||
if (name in config.lang) { | ||
l = config.lang[name]; | ||
} | ||
|
||
module.init(c, l) | ||
} | ||
|
||
}) | ||
.catch((error) => { | ||
console.log(error); | ||
}); | ||
}; | ||
|
||
init(); |
Oops, something went wrong.