Skip to content

Commit e50512a

Browse files
authored
feat: Allow render switching by query string (#118)
This change allows you to select the renderer to be used by appending "?geras" or "?thrasos" to the URL. Zelos remains the default.
1 parent 6d7307f commit e50512a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ function loadScenario(workspace: Blockly.WorkspaceSvg) {
4646
* @returns The created workspace.
4747
*/
4848
function createWorkspace(): Blockly.WorkspaceSvg {
49+
console.log(location.search);
50+
const renderer =
51+
location.search.includes('geras') ? 'geras' :
52+
location.search.includes('thrasos') ? 'thrasos' : 'zelos';
4953
const options = {
5054
toolbox: toolbox,
51-
renderer: 'zelos',
55+
renderer,
5256
};
5357
const blocklyDiv = document.getElementById('blocklyDiv')!;
5458
const workspace = Blockly.inject(blocklyDiv, options);

0 commit comments

Comments
 (0)