File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 1- function addCss ( fileName ) {
1+ const namespace = 'module-tournament-tree'
22
3+ function addCss ( fileName ) {
34 var head = document . head ;
45 var link = document . createElement ( 'link' ) ;
56
@@ -13,7 +14,7 @@ function addCss(fileName) {
1314addCss ( '/pages/op-rcv-tournament-tree/style/tournament_tree_op.css' ) ;
1415addCss ( 'https://use.typekit.net/anc5qxp.css' ) ;
1516
16- $ ( '#embed-copy' ) . val ( `${ location . href } /tournament_tree-gfx.html` ) ;
17+ $ ( '#embed-copy' ) . val ( `${ location . href } /tournament_tree-gfx.html${ window . apiKey !== null ? '?apikey' + window . apiKey : '' } ` ) ;
1718
1819const dataDiv = document . querySelectorAll ( '[data-matchId]' ) ;
1920const roundsSelect = document . querySelectorAll ( '[data-round]' ) ;
@@ -61,7 +62,7 @@ function save () {
6162
6263 window . LPTE . emit ( {
6364 meta : {
64- namespace : 'rcv-tournament-tree' ,
65+ namespace,
6566 type : 'set' ,
6667 version : 1
6768 } ,
@@ -73,7 +74,7 @@ function save () {
7374function unset ( ) {
7475 window . LPTE . emit ( {
7576 meta : {
76- namespace : 'rcv-tournament-tree' ,
77+ namespace,
7778 type : 'unset' ,
7879 version : 1
7980 }
@@ -83,7 +84,7 @@ function unset() {
8384async function init ( ) {
8485 const data = await window . LPTE . request ( {
8586 meta : {
86- namespace : 'rcv-tournament-tree' ,
87+ namespace,
8788 type : 'request' ,
8889 version : 1
8990 }
Original file line number Diff line number Diff line change 11import type { PluginContext } from '@rcv-prod-toolkit/types'
22import type { GfxState } from './types/GfxState'
33
4- const namespace = 'rcv-tournament-tree' ;
5-
64const initialState : GfxState = {
75 state : "NO_MATCHES" ,
86 matches : [ ] ,
@@ -19,6 +17,8 @@ const gameMatrix : [number, number | null][] = [
1917]
2018
2119module . exports = async ( ctx : PluginContext ) => {
20+ const namespace = ctx . plugin . module . getName ( ) ;
21+
2222 let gfxState = initialState ;
2323
2424 // Register new UI page
@@ -29,9 +29,9 @@ module.exports = async (ctx: PluginContext) => {
2929 version : 1
3030 } ,
3131 pages : [ {
32- name : 'OP: rcv-tournament-tree ' ,
32+ name : 'Tournament Tree ' ,
3333 frontend : 'frontend' ,
34- id : ' op-rcv-tournament-tree'
34+ id : ` op-${ namespace } `
3535 } ]
3636 } ) ;
3737
@@ -59,7 +59,7 @@ module.exports = async (ctx: PluginContext) => {
5959 ctx . LPTE . emit ( {
6060 meta : {
6161 type : 'set' ,
62- namespace : 'rcv -teams' ,
62+ namespace : 'module -teams' ,
6363 version : 1
6464 } ,
6565 teams : match . teams ,
You can’t perform that action at this time.
0 commit comments