changeset 2160:611c3e97de2f

factor out the show-specific strs
author drewp@bigasterisk.com
date Thu, 18 May 2023 10:49:16 -0700
parents 5c56aa348813
children b2909ecf1fb3
files light9/ascoltami/Light9AscoltamiUi.ts light9/fade/web/Light9FadeUi.ts light9/web/live/Effect.ts light9/web/show_specific.ts light9/web/timeline/TimelineEditor.coffee
diffstat 5 files changed, 17 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/light9/ascoltami/Light9AscoltamiUi.ts	Thu May 18 10:25:46 2023 -0700
+++ b/light9/ascoltami/Light9AscoltamiUi.ts	Thu May 18 10:49:16 2023 -0700
@@ -9,6 +9,7 @@
 import { getTopGraph } from "../web/RdfdbSyncedGraph";
 import { SyncedGraph } from "../web/SyncedGraph";
 import { TimingUpdate } from "./main";
+import { showRoot } from "light9/web/show_specific";
 export { Light9TimelineAudio } from "../web/light9-timeline-audio";
 export { Light9CursorCanvas } from "../web/Light9CursorCanvas";
 export { RdfdbSyncedGraph } from "../web/RdfdbSyncedGraph";
@@ -303,7 +304,7 @@
     try {
       const playList = this.graph.uriValue(
         //
-        this.graph.Uri("http://light9.bigasterisk.com/show/dance2023"),
+        this.graph.Uri(showRoot),
         this.graph.Uri(":playList")
       );
       log(playList);
--- a/light9/fade/web/Light9FadeUi.ts	Thu May 18 10:25:46 2023 -0700
+++ b/light9/fade/web/Light9FadeUi.ts	Thu May 18 10:49:16 2023 -0700
@@ -5,6 +5,7 @@
 import { NamedNode } from "n3";
 import { getTopGraph } from "../../web/RdfdbSyncedGraph";
 import { SyncedGraph } from "../../web/SyncedGraph";
+import { shortShow, showRoot } from "light9/web/show_specific";
 export { EditChoice } from "../../web/EditChoice";
 
 provideFASTDesignSystem().register(fastSlider(), fastSliderLabel());
@@ -40,14 +41,14 @@
       this.graph = g;
       // todo: start with a page, then find the faders on that page
       this.faders = [
-        g.Uri(":show/dance2019/fadePage1f0"),
-        g.Uri(":show/dance2019/fadePage1f1"),
-        g.Uri(":show/dance2019/fadePage1f2"),
-        g.Uri(":show/dance2019/fadePage1f3"),
-        g.Uri(":show/dance2019/fadePage1f4"),
-        g.Uri(":show/dance2019/fadePage1f5"),
-        g.Uri(":show/dance2019/fadePage1f6"),
-        g.Uri(":show/dance2019/fadePage1f7"),
+        g.Uri(`:show/${shortShow}/fadePage1f0`),
+        g.Uri(`:show/${shortShow}/fadePage1f1`),
+        g.Uri(`:show/${shortShow}/fadePage1f2`),
+        g.Uri(`:show/${shortShow}/fadePage1f3`),
+        g.Uri(`:show/${shortShow}/fadePage1f4`),
+        g.Uri(`:show/${shortShow}/fadePage1f5`),
+        g.Uri(`:show/${shortShow}/fadePage1f6`),
+        g.Uri(`:show/${shortShow}/fadePage1f7`),
       ];
     });
   }
@@ -86,7 +87,7 @@
   }
 
   graph!: SyncedGraph;
-  ctx: NamedNode = new NamedNode("http://light9.bigasterisk.com/show/dance2019/fade");
+  ctx: NamedNode = new NamedNode(showRoot + "/fade");
   @property() uri!: NamedNode;
   @property() column!: string;
   @property() effect: NamedNode | null = null;
--- a/light9/web/live/Effect.ts	Thu May 18 10:25:46 2023 -0700
+++ b/light9/web/live/Effect.ts	Thu May 18 10:49:16 2023 -0700
@@ -3,6 +3,7 @@
 import { some } from "underscore";
 import { Patch, patchContainsPreds, patchUpdate } from "../patch";
 import { SyncedGraph } from "../SyncedGraph";
+import { shortShow } from "../show_specific";
 
 type Color = string;
 export type ControlValue = number | Color | NamedNode;
@@ -33,7 +34,7 @@
     // called if the graph changes our values and not when the caller uses edit()
     private onValuesChanged: (values: void) => void
   ) {
-    this.ctxForEffect = this.graph.Uri(this.uri.value.replace("light9.bigasterisk.com/effect", "light9.bigasterisk.com/show/dance2019/effect"));
+    this.ctxForEffect = this.graph.Uri(this.uri.value.replace("light9.bigasterisk.com/effect", `light9.bigasterisk.com/show/${shortShow}/effect`));
     graph.runHandler(this.rebuildSettingsFromGraph.bind(this), `effect sync ${uri.value}`);
   }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/light9/web/show_specific.ts	Thu May 18 10:49:16 2023 -0700
@@ -0,0 +1,2 @@
+export const shortShow = "dance2023";
+export const showRoot = `http://light9.bigasterisk.com/show/${shortShow}`;
\ No newline at end of file
--- a/light9/web/timeline/TimelineEditor.coffee	Thu May 18 10:25:46 2023 -0700
+++ b/light9/web/timeline/TimelineEditor.coffee	Thu May 18 10:49:16 2023 -0700
@@ -85,7 +85,7 @@
 
   _onGraph: (graph) ->
     @project = new Project(graph)
-    @show = 'http://light9.bigasterisk.com/show/dance2019'
+    @show = showRoot
 
   _onSetAdjuster: () ->
     @makeZoomAdjs()