Skip to content

Commit

Permalink
* Fixed that NodeUI would not load the global page contents, in non-h…
Browse files Browse the repository at this point in the history
…k backend-mode.

* Added "ia" mode. (wip, eg. may want home page fleshed out later)
  • Loading branch information
Venryx committed Oct 5, 2023
1 parent 75a08ca commit c213333
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
Binary file added Packages/client/Resources/Images/@SL/IA/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion Packages/client/Source/UI/@SL/Home2_SL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {VReactMarkdown, PageContainer} from "web-vcore";
import {Row} from "web-vcore/nm/react-vcomponents.js";
import React, {useEffect} from "react";
import {MapListUI} from "UI/Debates.js";
import {SLMode_2020, SLMode_AI, SLMode_COVID, SLMode_GAD, SLMode_Main} from "./SL.js";
import {SLMode_2020, SLMode_AI, SLMode_COVID, SLMode_GAD, SLMode_IA, SLMode_Main} from "./SL.js";

export class HomeUI2_SL extends BaseComponent<{}, {}> {
render() {
Expand All @@ -13,6 +13,7 @@ export class HomeUI2_SL extends BaseComponent<{}, {}> {
if (SLMode_COVID) return <HomeUI2_SLCovid/>;
if (SLMode_2020) return <HomeUI2_SL2020/>;
if (SLMode_AI) return <HomeUI2_SLAI/>;
if (SLMode_IA) return null; // not needed atm
return null;
}
}
Expand Down
3 changes: 2 additions & 1 deletion Packages/client/Source/UI/@SL/NavBar_SL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {SLSkin} from "Utils/Styles/Skins/SLSkin.js";
import {liveSkin} from "Utils/Styles/SkinManager.js";
import {HasAdminPermissions, Me, MeID} from "dm_common";
import {DebugPanel} from "UI/@Shared/NavBar/DebugPanel.js";
import {SLMode_2020, SLMode_AI, SLMode_COVID, GetGADExternalSiteURL, SLMode_GAD, SLMode_Main} from "./SL.js";
import {SLMode_2020, SLMode_AI, SLMode_COVID, GetGADExternalSiteURL, SLMode_GAD, SLMode_Main, SLMode_IA} from "./SL.js";

// main
// ==========
Expand Down Expand Up @@ -114,6 +114,7 @@ class NavBarPageButton extends BaseComponent<{page?: string, text: string, panel
SLMode_COVID && {width: 500, height: 150, backgroundImage: "url(/Images/@SL/COVID/Title.png)", padding: "15px 0"},
SLMode_2020 && {width: 500, height: 150, backgroundImage: "url(/Images/@SL/2020/2020ElectionDemo.png)"},
SLMode_AI && {width: 300, height: 150, backgroundImage: "url(/Images/@SL/AI/Title_Cropped.png)", padding: "15px 0"},
SLMode_IA && {width: 300, height: 150, backgroundImage: "url(/Images/@SL/IA/Title.png)", padding: "15px 0"},
//GADDemo_Nuclear && {pointerEvents: "none"},
);
text = null as any;
Expand Down
8 changes: 6 additions & 2 deletions Packages/client/Source/UI/@SL/SL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ Notes:
2) Changes that affect the data-structure of nodes, or otherwise "change what people enter into the map" (eg. bracketed prefix-text), should be done via the child-layout setting.
*/

const GAD_extraFlags = ["sl", "gad", "cov", "2020", "ai"]; // if entry is changed/added, do the same for line in index.html
const GAD_extraFlags = ["sl", "gad", "cov", "2020", "ai", "ia"]; // if entry is changed/added, do the same for line in index.html
export const SLMode = startURL.domain == "demo.greatamericandebate.org" || GAD_extraFlags.includes(startURL.GetQueryVar("extra") ?? "");
export const SLMode_Main = startURL.GetQueryVar("extra") == "sl";
export const SLMode_GAD = startURL.GetQueryVar("extra") == "gad";
export const SLMode_COVID = startURL.GetQueryVar("extra") == "cov";
export const SLMode_2020 = startURL.GetQueryVar("extra") == "2020";
export const SLMode_AI = startURL.GetQueryVar("extra") == "ai";
export const SLMode_IA = startURL.GetQueryVar("extra") == "ia";
export const ShowHeader = startURL.GetQueryVar("header") != "0";
export const HKMode = startURL.GetQueryVar("extra") == "hk";
// These are utilized by the helper functions in $node_sl.ts.
Expand Down Expand Up @@ -57,7 +58,10 @@ if (SLMode) {
logoEl.href = "/Images/@SL/2020/2020ElectionDemo.png";
} else if (SLMode_AI) {
titleEl.innerText = "AI / AGI Debates";
logoEl.href = "/Images/@SL/Logo.png";
logoEl.href = "/Images/@SL/Main/Logo.png";
} else if (SLMode_IA) {
titleEl.innerText = "Internet Archive AI Debates";
logoEl.href = "/Images/@SL/IA/Logo.png";
}
timer.Stop();
} catch {}
Expand Down
4 changes: 2 additions & 2 deletions Packages/client/Source/UI/@Shared/Maps/Node/NodeUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {store} from "Store/index.js";
import {UseForcedExpandForPath} from "Store/main/maps.js";
import {globalRootNodeID_hk} from "Utils/LibIntegrations/MobXHK/HKInitBackend.js";
import {NodeUI_HK} from "Utils/LibIntegrations/MobXHK/NodeUI_HK.js";
import {HKMode} from "UI/@SL/SL.js";
import {NodeDataForTreeGrapher} from "../MapGraph.js";
import {GUTTER_WIDTH, GUTTER_WIDTH_SMALL} from "./NodeLayoutConstants.js";
import {CloneHistoryButton} from "./NodeUI/CloneHistoryButton.js";
Expand Down Expand Up @@ -86,8 +87,7 @@ export class NodeUI extends BaseComponentPlus(
const {indexInNodeList, map, node, path, standardWidthInGroup, style, onHeightOrPosChange, ref_nodeBox, treePath, forLayoutHelper, inBelowGroup, children} = this.props;
const {obs} = this.state;

// temp
if (map?.id == globalMapID && node.id == globalRootNodeID) {
if (HKMode && map?.id == globalMapID && node.id == globalRootNodeID) {
return <NodeUI_HK nodeID={globalRootNodeID_hk}/>;
}

Expand Down
2 changes: 1 addition & 1 deletion Packages/client/Source/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
}
// if has an SL flag, delay title loading till GAD.ts runs
if (["gad", "cov", "2020", "ai"].find(flag=>window.location.href.includes(`?extra=${flag}`))) {
if (["sl", "gad", "cov", "2020", "ai", "ia"].find(flag=>window.location.href.includes(`?extra=${flag}`))) {
document.getElementById("title").innerText = "";
}
</script>
Expand Down

0 comments on commit c213333

Please sign in to comment.