From e970a2c33d415aceb19418c0848ec557e571bb88 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Sat, 16 Dec 2023 13:31:09 -0700 Subject: [PATCH 1/6] Disable scrollbars on Game when in wide desktop mode We have scrolling on the right content still, but scroll bars on the whole page can lead to constant resize flickering --- src/views/Game/Game.styl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/views/Game/Game.styl b/src/views/Game/Game.styl index 75ca567e73..64cf963ad3 100644 --- a/src/views/Game/Game.styl +++ b/src/views/Game/Game.styl @@ -43,6 +43,10 @@ } } +.Game.wide { + overflow: hidden; +} + .Game.portrait.squashed { overflow-y: scroll; } From 038c5c05cd712d774d0651ea0da958351612a6eb Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Sat, 16 Dec 2023 13:43:36 -0700 Subject: [PATCH 2/6] Fix showing invalid last move time for GameTimings when the game is still ongoing --- src/views/Game/Game.tsx | 2 +- src/views/Game/GameTimings.tsx | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/views/Game/Game.tsx b/src/views/Game/Game.tsx index 1fda7a33ee..d8bf3ec470 100644 --- a/src/views/Game/Game.tsx +++ b/src/views/Game/Game.tsx @@ -905,7 +905,7 @@ export function Game(): JSX.Element | null { {/* empty cell at end of row */}
Final action:
- {show_seconds_resolution( - moment - .duration(props.end_time - props.start_time, "seconds") - .subtract(game_elapsed), - )} + {props.end_time && + show_seconds_resolution( + moment + .duration(props.end_time - props.start_time, "seconds") + .subtract(game_elapsed), + )}
{/* empty cell at end of row */}
From 814f5d17209c64a7148171dbda7606d712073008 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Sat, 16 Dec 2023 13:55:08 -0700 Subject: [PATCH 3/6] Removed unused jquery.flot typedefs --- typings_manual/index.d.ts | 1 - typings_manual/jquery.flot.d.ts | 223 -------------------------------- 2 files changed, 224 deletions(-) delete mode 100644 typings_manual/jquery.flot.d.ts diff --git a/typings_manual/index.d.ts b/typings_manual/index.d.ts index 652ec86e19..4197db68b9 100644 --- a/typings_manual/index.d.ts +++ b/typings_manual/index.d.ts @@ -1,2 +1 @@ -/// /// diff --git a/typings_manual/jquery.flot.d.ts b/typings_manual/jquery.flot.d.ts deleted file mode 100644 index ffdffd6792..0000000000 --- a/typings_manual/jquery.flot.d.ts +++ /dev/null @@ -1,223 +0,0 @@ -declare module jquery.flot { - interface plotOptions { - colors?: any[]; - series?: seriesOptions; - legend?: legendOptions; - xaxis?: axisOptions; - yaxis?: axisOptions; - xaxes?: axisOptions[]; - yaxes?: axisOptions[]; - grid?: gridOptions; - interfaction?: interaction; - hooks?: hooks; - labelFormatter?: (label: string, series: any) => string; // null or (fn: string, series object -> string) - zoom?: interactive; - pan?: interactive; - } - - interface interactive { - interactive?: boolean; - } - - interface hooks { - processOptions: { (plot: plot, options: plotOptions): void; } []; - processRawData: { (plot: plot, series: dataSeries, data: any[], datapoints: datapoints): void; }[]; - processDatapoints: { (plot: plot, series: dataSeries, datapoints: datapoints): void; }[]; - processOffset: { (plot: plot, offset: canvasPoint): void; }[]; - drawBackground: { (plot: plot, context: CanvasRenderingContext2D): void; }[]; - drawSeries: { (plot: plot, context: CanvasRenderingContext2D, series: dataSeries): void; }[]; - draw: { (plot: plot, context: CanvasRenderingContext2D): void; }[]; - bindEvents: { (plot: plot, eventHolder: JQuery): void; }[]; - drawOverlay: { (plot: plot, context: CanvasRenderingContext2D): void; }[]; - shutdown: { (plot: plot, eventHolder: JQuery): void; }[]; - } - - interface interaction { - redrawOverlayInterval?: number; - } - - interface gridOptions { - show?: boolean; - aboveData?: boolean; - color?: any; // color - backgroundColor?: any; //color/gradient or null - margin?: any; // number or margin object - labelMargin?: number; - axisMargin?: number; - markings?: any; //array of markings or (fn: axes -> array of markings) - borderWidth: number; - borderColor?: any; // color or null - minBorderMargin?: number; // or null - clickable?: boolean; - hoverable?: boolean; - autoHighlight?: boolean; - mouseActiveRadius?: number; - tickColor?: any; - markingsColor?: any; - markingsLineWidth?: number; - } - - interface legendOptions { - show?: boolean; - labelFormatter?: (label: string, series: any) => string; // null or (fn: string, series object -> string) - labelBoxBorderColor?: any; //color - noColumns?: number; - position?: string; //"ne" or "nw" or "se" or "sw" - margin?: any; //number of pixels or [x margin, y margin] - backgroundColor?: any; //null or color - backgroundOpacity?: number; // between 0 and 1 - container?: JQuery; // null or jQuery object/DOM element/jQuery expression - sorted?: any; //null/false, true, "ascending", "descending" or a comparator - } - - interface seriesOptions { - color?: number; - label?: string; - lines?: linesOptions; - bars?: barsOptions; - points?: pointsOptions; - xaxis?: number; - yaxis?: number; - clickable?: boolean; - hoverable?: boolean; - shadowSize?: number; - highlightColor?: any; - } - - interface dataSeries extends seriesOptions { - data: any[]; - } - - interface axisOptions { - show?: boolean; // null or true/false - position?: string; // "bottom" or "top" or "left" or "right" - - color?: any; // null or color spec - tickColor?: any; // null or color spec - font?: any; // null or font spec object - - min?: number; - max?: number; - autoscaleMargin?: number; - - transform?: (v: number) => number; // null or fn: number -> number - inverseTransform?: (v: number) => number; // null or fn: number -> number - - ticks?: any; // null or number or ticks array or (fn: axis -> ticks array) - tickSize?: any; // number or array - minTickSize?: any; // number or array - tickFormatter?: (t: number) => string; // (fn: number, object -> string) or string - tickDecimals?: number; - - labelWidth?: number; - labelHeight?: number; - reserveSpace?: boolean; - - tickLength?: number; - - alignTicksWithAxis?: number; - - zoomRange?: Array; - panRange?: Array; - } - - interface seriesTypeBase { - show?: boolean; - lineWidth?: number; - fill?: any; //boolean or number - fillColor?: any; //null or color/gradient - } - - interface linesOptions extends seriesTypeBase { - steps?: boolean; - } - - interface barsOptions extends seriesTypeBase { - barWidth?: number; - align?: string; - horizontal?: boolean; - } - - interface pointsOptions extends seriesTypeBase { - radius?: number; - symbol?: any; - } - - interface gradient { - colors: any[]; - } - - interface item { - datapoint: number[]; // the point, e.g. [0, 2] - dataIndex: number; // the index of the point in the data array - series: dataSeries; //the series object - seriesIndex: number; //the index of the series - pageX: number; - pageY: number; //the global screen coordinates of the point - } - - interface datapoints { - points: number[]; - pointsize: number; - format: datapointFormat[]; - } - - interface datapointFormat { - x?: boolean; - y?: boolean; - number: boolean; - required: boolean; - defaultValue?: number; - } - - interface point { - x: number; - y: number; - } - - interface canvasPoint { - top: number; - left: number; - bottom?: number; - right?: number; - } - - interface axes { - xaxis: axis; - yaxis: axis; - x2axis?: axis; - y2axis?: axis; - } - - interface axis extends axisOptions { - p2c(point):canvasPoint; - c2p(canvasPoint):point; - } - - interface plot { - highlight(series: dataSeries, datapoint: item); - unhightlight(); - unhighlight(series: dataSeries, datapoint: item); - setData(data: any); - setupGrid(); - draw(); - triggerRedrawOverlay(); - width(); - height(); - offset(); - pointOffset(point: point); - resize(); - shutdown(); - getData(): dataSeries[]; - getAxes(): axes; - getPlaceholder(): JQuery; - getCanvas(): HTMLCanvasElement; - getPlotOffset(): canvasPoint; - getOptions(): plotOptions; - } -} - -interface JQueryStatic { - plot(placeholder: JQuery, data: jquery.flot.dataSeries[], options?: jquery.flot.plotOptions): jquery.flot.plot; - plot(placeholder: JQuery, data: any[], options?: jquery.flot.plotOptions): jquery.flot.plot; -} From 39194c06b43678eae04ba7ada3bac26950b8f876 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Sat, 16 Dec 2023 14:11:47 -0700 Subject: [PATCH 4/6] Removed tsumegododo replacement tsumegodojo replacements This was to combat an old spammer, no need to keep this code anymore. --- src/components/Chat/chat_markup.test.tsx | 10 ---------- src/components/Chat/chat_markup.tsx | 15 --------------- 2 files changed, 25 deletions(-) diff --git a/src/components/Chat/chat_markup.test.tsx b/src/components/Chat/chat_markup.test.tsx index 0cfe99a1b3..ef6dc6e7c3 100644 --- a/src/components/Chat/chat_markup.test.tsx +++ b/src/components/Chat/chat_markup.test.tsx @@ -23,16 +23,6 @@ test("No markup", () => { ); }); -test("tsumegododo", () => { - expect_singular_markup("tsumegodojo", {"tsumegododo"}); - expect_singular_markup( - "https://www.tsumegodojo.com", - - {"https://www.tsumegododo.com"} - , - ); -}); - test("GitHub", () => { expect_singular_markup( "https://github.com/online-go/online-go.com/pull/1", diff --git a/src/components/Chat/chat_markup.tsx b/src/components/Chat/chat_markup.tsx index 5b89f14c12..fffa003e5a 100644 --- a/src/components/Chat/chat_markup.tsx +++ b/src/components/Chat/chat_markup.tsx @@ -29,21 +29,6 @@ export interface TextReplacement { const global_replacements: TextReplacement[] = [ // spam mitigation - // replace tsumegodojo.worldpress.com urls with tsumegododo.worldpress.com as spam mitigation - { - split: /(https?:\/\/\S*tsumegodojo\S*)/i, - pattern: /(https?:\/\/[^\s\/]*)(tsumegodojo)(\S*)/i, - replacement: (m, idx) => ( - - {m[1] + "tsumegododo" + m[3]} - - ), - }, - { - split: /(\S*tsumegodojo\S*)/i, - pattern: /(\S*)(tsumegodojo)(\S*)/i, - replacement: (m, idx) => {m[1] + "tsumegododo" + m[3]}, - }, // Match github { split: /\b(https?:\/\/github\.com\/online-go\/online-go\.com\/pull\/[0-9]+(?:\/|\b))/i, From b98a930c504f644375d9128328aaca4565816efe Mon Sep 17 00:00:00 2001 From: GreenAsJade Date: Sun, 17 Dec 2023 08:36:34 +1030 Subject: [PATCH 5/6] gitignore logs in .vscode --- .gitignore | 2 -- .vscode/.gitignore | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 .vscode/.gitignore diff --git a/.gitignore b/.gitignore index 2448d9cb6e..d517236ae9 100644 --- a/.gitignore +++ b/.gitignore @@ -18,8 +18,6 @@ package-lock.json report.*.json neovide_backtraces.log - - i18n/data/ i18n/import/ i18n/prep-import.js diff --git a/.vscode/.gitignore b/.vscode/.gitignore new file mode 100644 index 0000000000..397b4a7624 --- /dev/null +++ b/.vscode/.gitignore @@ -0,0 +1 @@ +*.log From c053fc9335261c3a895b4e01e5a29f46b7592571 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Sat, 16 Dec 2023 15:07:54 -0700 Subject: [PATCH 6/6] Fix spelling errors --- .vscode/settings.json | 27 ++++++ Gulpfile.js | 47 +++++----- src/components/Chat/ChatChannelList.tsx | 4 +- src/components/Chat/ChatDetails.tsx | 2 +- src/components/Chat/ChatLine.tsx | 12 ++- src/components/Chat/ChatList.tsx | 4 +- src/components/Chat/ChatLog.tsx | 18 ++-- src/components/Chat/state.ts | 23 +++-- src/components/Errcode/Errcode.tsx | 2 + src/components/ErrcodeModal/ErrcodeModal.tsx | 4 +- src/components/Experiment/Variant.tsx | 4 +- src/components/GameList/GameList.tsx | 4 +- .../GobanLineSummary/GobanLineSummary.tsx | 6 +- src/components/JosekiAdmin/JosekiAdmin.tsx | 4 +- .../JosekiPermissionsPanel.tsx | 14 +-- .../JosekiTagSelector/JosekiTagSelector.tsx | 2 +- src/components/Markdown/Markdown.tsx | 9 +- src/components/ModerateUser/ModerateUser.tsx | 2 +- src/components/NavBar/NavBar.tsx | 10 +- .../Notifications/NotificationManager.tsx | 4 +- .../Notifications/Notifications.tsx | 2 + .../ObserveGamesComponent.styl | 2 +- .../ObserveGamesComponent.tsx | 4 +- src/components/Player/PlayerDetails.tsx | 28 +++--- src/components/PrivateChat/PrivateChat.tsx | 6 +- src/global_styl/flags16.styl | 2 +- src/global_styl/flags32.styl | 2 +- src/global_styl/global.styl | 2 +- src/index.html | 2 +- src/lib/associations.ts | 2 + src/lib/data_schema.ts | 2 +- src/lib/localize-time.ts | 5 - src/lib/messages.ts | 2 + src/lib/ogs-rr6-shims.tsx | 2 +- src/lib/rank_utils.ts | 8 +- src/lib/sfx_sprites.ts | 2 + src/lib/{tabcomplete.ts => tab_complete.ts} | 6 +- src/lib/translate.ts | 24 ++--- src/main.tsx | 4 +- src/routes.tsx | 4 +- src/views/Game/GameLinkModal.tsx | 2 + src/views/Game/GameTimings.tsx | 20 ++-- src/views/Joseki/Joseki.tsx | 36 ++++---- src/views/Ladder/Ladder.styl | 4 +- src/views/Ladder/Ladder.tsx | 8 +- src/views/LearningHub/LearningHubSection.tsx | 4 +- src/views/LearningHub/LearningPage.tsx | 18 ++-- .../OnlineLeaguePlayerLanding.test.tsx | 2 + .../OnlineLeaguePlayerLanding.tsx | 8 +- .../OnlineLeagueSpectatorLanding.tsx | 2 +- src/views/Play/Play.styl | 2 +- src/views/Play/Play.tsx | 17 ++-- .../RatingCalculator/RatingCalculator.tsx | 92 ++++++++++--------- src/views/RatingCalculator/gor.ts | 10 +- src/views/Register/Register.styl | 2 +- src/views/Register/Register.tsx | 2 +- src/views/Settings/SoundPreferences.tsx | 60 ++++++------ src/views/Styling/Styling.tsx | 2 - src/views/Supporter/Supporter.tsx | 2 +- src/views/Tournament/Tournament.styl | 4 +- src/views/Tournament/Tournament.tsx | 88 +++++++++--------- src/views/TournamentList/TournamentList.styl | 2 +- src/views/TournamentList/TournamentList.tsx | 10 +- 63 files changed, 380 insertions(+), 330 deletions(-) rename src/lib/{tabcomplete.ts => tab_complete.ts} (99%) diff --git a/.vscode/settings.json b/.vscode/settings.json index 9e4278ccd4..1a22fb169a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,7 @@ "annulable", "anoek", "apikey", + "appinfo", "automatch", "automatcher", "automatchers", @@ -18,6 +19,8 @@ "Baduk", "badukpop", "benjito", + "bitfield", + "boardsize", "byoyomi", "cacheable", "chillout", @@ -26,16 +29,23 @@ "crosshairs", "csrfmiddlewaretoken", "csrftoken", + "cssnano", + "DATETIME", "dedup", + "deinit", "deinitialize", "Dismissable", "dont", + "DOTCSS", + "DOTJS", "enableable", "Errcode", "fakelink", + "fuggly", "Fuseki", "gamedata", "gamelist", + "gettext", "glicko", "goban", "Gobans", @@ -53,9 +63,11 @@ "joseki", "josekipedia", "josekis", + "jsonify", "Kata", "katago", "kidsgoserver", + "kyus", "Leela", "lerp", "localstorage", @@ -66,35 +78,47 @@ "minigoban", "misclick", "misclicks", + "modlog", + "msgid", "ngettext", "nochallenge", "nodetails", "noextracontrols", "nolink", "npgettext", + "nums", + "offtopic", + "omnisearch", + "opengotha", "pgettext", "playouts", + "pluralidx", "postback", "rengo", "replot", + "roundrobin", "rrule", "seekgraph", "Seki", "semeai", + "sepa", "shadowban", "shadowbanned", "shownotesindicator", "Sitewide", "slowstrobe", + "sodos", "styl", "sublicensable", "subprops", "subselect", "subtool", + "superchat", "superko", "swal", "sweetalert", "tenuki", + "testuser", "tesuji", "Timecop", "tock", @@ -102,14 +126,17 @@ "tsumegodojo", "tygem", "tzoffset", + "uffizzi", "unannulable", "unhighlight", "unitify", "Unranked", + "unstarted", "uservoice", "usgc", "wbaduk", "Weiqi", + "xgettext", "yesno", "yike", "yomi", diff --git a/Gulpfile.js b/Gulpfile.js index b5e5b6b4f2..485b9cdd28 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -191,11 +191,11 @@ function dev_server(done) { let http = require("http"); var proxy = require("express-http-proxy"); let url = require("url"); - let devserver = express(); - devserver.use(body_parser.json()); - devserver.use(body_parser.text()); + let dev_server = express(); + dev_server.use(body_parser.json()); + dev_server.use(body_parser.text()); - http.createServer(devserver).listen(port, null, function () { + http.createServer(dev_server).listen(port, null, function () { console.info(`#############################################`); console.info(`## Development server started on port ${port}`); console.info(`## ( http://localhost:${port} )`); @@ -203,8 +203,8 @@ function dev_server(done) { console.info(`#############################################`); }); - devserver.use(express.static("dist")); - devserver.use(express.static("assets")); + dev_server.use(express.static("dist")); + dev_server.use(express.static("assets")); // Based on https://github.com/villadora/express-http-proxy/issues/127 const isMultipartRequest = (req) => { @@ -237,19 +237,19 @@ function dev_server(done) { }, }); - devserver.use("/api", backend_proxy("/api")); - devserver.use("/termination-api", backend_proxy("/termination-api")); - devserver.use("/merchant", backend_proxy("/merchant")); - devserver.use("/billing", backend_proxy("/billing")); - devserver.use("/sso", backend_proxy("/sso")); - devserver.use("/oauth2", backend_proxy("/oauth2")); - devserver.use("/complete", backend_proxy("/complete")); - devserver.use("/disconnect", backend_proxy("/disconnect")); - devserver.use("/OGSScoreEstimator", backend_proxy("/OGSScoreEstimator")); - devserver.use("/oje", backend_proxy("/oje")); - devserver.use("/firewall", backend_proxy("/firewall")); - - devserver.get("/locale/*", (req, res) => { + dev_server.use("/api", backend_proxy("/api")); + dev_server.use("/termination-api", backend_proxy("/termination-api")); + dev_server.use("/merchant", backend_proxy("/merchant")); + dev_server.use("/billing", backend_proxy("/billing")); + dev_server.use("/sso", backend_proxy("/sso")); + dev_server.use("/oauth2", backend_proxy("/oauth2")); + dev_server.use("/complete", backend_proxy("/complete")); + dev_server.use("/disconnect", backend_proxy("/disconnect")); + dev_server.use("/OGSScoreEstimator", backend_proxy("/OGSScoreEstimator")); + dev_server.use("/oje", backend_proxy("/oje")); + dev_server.use("/firewall", backend_proxy("/firewall")); + + dev_server.get("/locale/*", (req, res) => { let options = { hostname: "storage.googleapis.com", port: 80, @@ -277,7 +277,7 @@ function dev_server(done) { req2.end(); }); - devserver.get("/goban.js", (req, res) => { + dev_server.get("/goban.js", (req, res) => { console.info(`GET ${req.path} -> node_modules/goban/lib/goban.js`); let js = fs.readFileSync("node_modules/goban/lib/goban.js", { encoding: "utf-8" }); res.setHeader("Content-Type", "application/javascript; charset=utf-8"); @@ -288,7 +288,7 @@ function dev_server(done) { res.status(200).send(js); }); - devserver.get("/goban.js.map", (req, res) => { + dev_server.get("/goban.js.map", (req, res) => { console.info(`GET ${req.path} -> node_modules/goban/lib/goban.js.map`); let js = fs.readFileSync("node_modules/goban/lib/goban.js.map", { encoding: "utf-8" }); res.setHeader("Content-Type", "application/javascript; charset=utf-8"); @@ -299,7 +299,7 @@ function dev_server(done) { res.status(200).send(js); }); - devserver.get("/index.js.map", (req, res) => { + dev_server.get("/index.js.map", (req, res) => { let js = fs.readFileSync("node_modules/goban/lib/index.js.map", { encoding: "utf-8" }); res.setHeader("Content-Type", "application/javascript; charset=utf-8"); res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); @@ -309,7 +309,7 @@ function dev_server(done) { res.status(200).send(js); }); - devserver.get("*", (req, res) => { + dev_server.get("*", (req, res) => { console.info(`GET ${req.path}`); if (req.path === "ogs.js") { @@ -370,6 +370,7 @@ function dev_server(done) { return JSON.stringify(supported_languages); case "AMEX_CLIENT_ID": + /* cspell: disable-next-line */ return "kvEB9qXE6jpNUv3fPkdbWcPaZ7nQAXyg"; case "AMEX_ENV": return "qa"; diff --git a/src/components/Chat/ChatChannelList.tsx b/src/components/Chat/ChatChannelList.tsx index d4df75d199..8ecc55a852 100644 --- a/src/components/Chat/ChatChannelList.tsx +++ b/src/components/Chat/ChatChannelList.tsx @@ -65,7 +65,7 @@ interface ChatChannelListProperties { channel: string; } -function autojoin_channels() { +function auto_join_channels() { const joined_channels = data.get("chat.joined", {}); const parted_channels = data.get("chat.parted", {}); @@ -93,7 +93,7 @@ function autojoin_channels() { } export function ChatChannelList({ channel }: ChatChannelListProperties): JSX.Element { - autojoin_channels(); + auto_join_channels(); const joined_channels = data.get("chat.joined", {}); const using_resolved_channel = !( diff --git a/src/components/Chat/ChatDetails.tsx b/src/components/Chat/ChatDetails.tsx index 980f202dbc..0b7a60511f 100644 --- a/src/components/Chat/ChatDetails.tsx +++ b/src/components/Chat/ChatDetails.tsx @@ -171,7 +171,7 @@ export function ChatDetails(props: ChatDetailsProperties): JSX.Element { )} {props.partFunc ? ( - ) : null} diff --git a/src/components/Chat/ChatLine.tsx b/src/components/Chat/ChatLine.tsx index fb1e7c3798..8f980689b4 100644 --- a/src/components/Chat/ChatLine.tsx +++ b/src/components/Chat/ChatLine.tsx @@ -41,12 +41,12 @@ data.watch("config.user", (user) => { interface ChatLineInterface { line: ChatMessage; - lastline?: ChatMessage; + lastLine?: ChatMessage; } export function ChatLine(props: ChatLineInterface): JSX.Element { const line = props.line; - const lastline = props.lastline; + const last_line = props.lastLine; const user = line; if (line.system) { @@ -54,16 +54,16 @@ export function ChatLine(props: ChatLineInterface): JSX.Element { } const message = line.message; - const ts_ll = lastline ? new Date(lastline.message.t * 1000) : null; + const ts_ll = last_line ? new Date(last_line.message.t * 1000) : null; const ts = message.t ? new Date(message.t * 1000) : null; let third_person = false; let body = message.m; let show_date: JSX.Element | null = null; - if (!lastline || (ts && ts_ll)) { + if (!last_line || (ts && ts_ll)) { if (ts) { if ( - !lastline || + !last_line || moment(ts).format("YYYY-MM-DD") !== moment(ts_ll).format("YYYY-MM-DD") ) { show_date =
{moment(ts).format("LL")}
; @@ -89,7 +89,9 @@ export function ChatLine(props: ChatLineInterface): JSX.Element { body = generateChatSearchLine("https://www.google.com/#q=", "/google ", body); } + /* cspell:disable-next-line */ if (body.substr(0, 8) === "/lmgtfy ") { + /* cspell:disable-next-line */ body = generateChatSearchLine("https://www.lmgtfy.com/?q=", "/lmgtfy ", body); } } diff --git a/src/components/Chat/ChatList.tsx b/src/components/Chat/ChatList.tsx index 6c52cff354..1237894275 100644 --- a/src/components/Chat/ChatList.tsx +++ b/src/components/Chat/ChatList.tsx @@ -50,7 +50,7 @@ interface ChatListProperties { closing_toggle?: () => void; collapse_state_store_name?: keyof DataSchema; fakelink?: boolean; - partFunc?: (channel: string, dont_autoset_active: boolean, dont_clear_joined: boolean) => void; + partFunc?: (channel: string, dont_auto_set_active: boolean, dont_clear_joined: boolean) => void; } interface ChatListState { @@ -69,7 +69,7 @@ interface ChatListState { highlight_active_channel: boolean; active_channel: string; fakelink: boolean; - partFunc?: (channel: string, dont_autoset_active: boolean, dont_clear_joined: boolean) => void; + partFunc?: (channel: string, dont_auto_set_active: boolean, dont_clear_joined: boolean) => void; } export class ChatList extends React.PureComponent { diff --git a/src/components/Chat/ChatLog.tsx b/src/components/Chat/ChatLog.tsx index 433c816fd9..44dd6af465 100644 --- a/src/components/Chat/ChatLog.tsx +++ b/src/components/Chat/ChatLog.tsx @@ -53,7 +53,7 @@ interface ChatLogProperties { updateTitle?: boolean; hideTopic?: boolean; forceShowGames?: boolean; - inputPlaceholdertText?: string; + inputPlaceholderText?: string; onShowChannels?: (tf: boolean) => void; onShowUsers?: (tf: boolean) => void; /* if properties are added to this, don't forget to @@ -66,7 +66,7 @@ interface InternalChatLogProperties extends ChatLogProperties { onShowGames?: (tf: boolean) => void; showingGames?: boolean; canShowGames?: boolean; - inputPlaceholdertext?: string; + inputPlaceholderText?: string; } let deferred_chat_update: Timeout | null = null; @@ -352,12 +352,6 @@ function ChannelTopic({ )} - {/*channel_leavable && - - */} + ); })} @@ -505,7 +499,7 @@ function ChatLines({ function ChatInput({ channel, autoFocus, - inputPlaceholdertText, + inputPlaceholderText, }: InternalChatLogProperties): JSX.Element { const user = useUser(); const rtl_mode = !!global_channels_by_id[channel]?.rtl; @@ -550,8 +544,8 @@ function ChatInput({ [channel, proxy], ); - const placeholder = inputPlaceholdertText - ? inputPlaceholdertText + const placeholder = inputPlaceholderText + ? inputPlaceholderText : pgettext( "This is the placeholder text for the chat input field in games, chat channels, and private messages", interpolate("Message {{who}}", { who: channel_name || "..." }), diff --git a/src/components/Chat/state.ts b/src/components/Chat/state.ts index 02b36cc5cb..25c4016162 100644 --- a/src/components/Chat/state.ts +++ b/src/components/Chat/state.ts @@ -22,7 +22,7 @@ import { TypedEventEmitter } from "TypedEventEmitter"; interface Events { subscription_changed: void; } -const event_emiter = new TypedEventEmitter(); +const event_emitter = new TypedEventEmitter(); export let chat_subscriptions: { [channel: string]: { [option: string]: boolean } } = {}; @@ -33,31 +33,31 @@ function onChatSubscriptionUpdate( if (subs) { chat_subscriptions = subs; } - event_emiter.emit("subscription_changed"); + event_emitter.emit("subscription_changed"); } let chat_subscribe_new_group_chat_messages = false; preferences.watch("chat-subscribe-group-chat-unread", onChatSubscribeGroupMessageChange); function onChatSubscribeGroupMessageChange(pref: boolean) { chat_subscribe_new_group_chat_messages = pref; - event_emiter.emit("subscription_changed"); + event_emitter.emit("subscription_changed"); } let chat_subscribe_new_group_chat_mentioned = false; preferences.watch("chat-subscribe-group-mentions", onChatSubscribeGroupMentionsChange); function onChatSubscribeGroupMentionsChange(pref: boolean) { chat_subscribe_new_group_chat_mentioned = pref; - event_emiter.emit("subscription_changed"); + event_emitter.emit("subscription_changed"); } let chat_subscribe_new_tournament_chat_messages = false; preferences.watch("chat-subscribe-tournament-chat-unread", onChatSubscribeTournamentMessageChange); function onChatSubscribeTournamentMessageChange(pref: boolean) { chat_subscribe_new_tournament_chat_messages = pref; - event_emiter.emit("subscription_changed"); + event_emitter.emit("subscription_changed"); } let chat_subscribe_new_tournament_chat_mentioned = false; preferences.watch("chat-subscribe-tournament-mentions", onChatSubscribeTournamentMentionsChange); function onChatSubscribeTournamentMentionsChange(pref: boolean) { chat_subscribe_new_tournament_chat_mentioned = pref; - event_emiter.emit("subscription_changed"); + event_emitter.emit("subscription_changed"); } export function getUnreadChatPreference(channel: string): boolean { @@ -85,13 +85,16 @@ export function getMentionedChatPreference(channel: string): boolean { return false; } -export function watchChatSubscriptionChanged(cb: () => void, dont_call_imediately?: boolean): void { +export function watchChatSubscriptionChanged( + cb: () => void, + dont_call_immediately?: boolean, +): void { // Give a single place to subscribe to setting changes - event_emiter.on("subscription_changed", cb); - if (!dont_call_imediately) { + event_emitter.on("subscription_changed", cb); + if (!dont_call_immediately) { cb(); } } export function unwatchChatSubscriptionChanged(cb: () => void): void { - event_emiter.off("subscription_changed", cb); + event_emitter.off("subscription_changed", cb); } diff --git a/src/components/Errcode/Errcode.tsx b/src/components/Errcode/Errcode.tsx index 5e0710e714..82ad0df852 100644 --- a/src/components/Errcode/Errcode.tsx +++ b/src/components/Errcode/Errcode.tsx @@ -15,6 +15,8 @@ * along with this program. If not, see . */ +/* cspell: disable */ + import * as React from "react"; import { MessageId, MessageObject } from "messages"; import { GobanMoveErrorMessageObject } from "goban"; diff --git a/src/components/ErrcodeModal/ErrcodeModal.tsx b/src/components/ErrcodeModal/ErrcodeModal.tsx index 40fded1ac5..59acf4c134 100644 --- a/src/components/ErrcodeModal/ErrcodeModal.tsx +++ b/src/components/ErrcodeModal/ErrcodeModal.tsx @@ -58,6 +58,6 @@ export class ErrcodeModal extends Modal { } } -export function errcodeAlerter(errobj: { errcode: MessageId }): void { - openModal(); +export function errcodeAlerter(err_obj: { errcode: MessageId }): void { + openModal(); } diff --git a/src/components/Experiment/Variant.tsx b/src/components/Experiment/Variant.tsx index 5ddfe919c8..8a9e848665 100644 --- a/src/components/Experiment/Variant.tsx +++ b/src/components/Experiment/Variant.tsx @@ -18,8 +18,8 @@ import * as React from "react"; export interface VariantProps { - value: string; // Value the expiriment name should be set to to use this variant - bodyclass?: string; // class added to body tag when this variant is being used + value: string; // Value the experiment name should be set to to use this variant + bodyClass?: string; // class added to body tag when this variant is being used children: React.ReactElement[] | React.ReactElement; } diff --git a/src/components/GameList/GameList.tsx b/src/components/GameList/GameList.tsx index 8618266517..d1fffebe80 100644 --- a/src/components/GameList/GameList.tsx +++ b/src/components/GameList/GameList.tsx @@ -284,7 +284,7 @@ export class GameList extends React.PureComponent games.sort((a, b) => { try { // sort by number of intersection - // for non-square boards with the same number of intersections, the wider board is concidered larger + // for non-square boards with the same number of intersections, the wider board is considered larger const a_size = a.width * a.height * 100 + a.width; const b_size = b.width * b.height * 100 + b.width; @@ -425,7 +425,7 @@ function LineSummaryTable({ black={game.black} white={game.white} player={player} - gobanref={(goban) => (game.goban = goban)} + gobanRef={(goban) => (game.goban = goban)} width={game.width} height={game.height} rengo_teams={game.json?.rengo_teams} diff --git a/src/components/GobanLineSummary/GobanLineSummary.tsx b/src/components/GobanLineSummary/GobanLineSummary.tsx index a716347022..deeb1aa70d 100644 --- a/src/components/GobanLineSummary/GobanLineSummary.tsx +++ b/src/components/GobanLineSummary/GobanLineSummary.tsx @@ -41,7 +41,7 @@ interface GobanLineSummaryProps { black: UserType; white: UserType; player?: { id: number }; - gobanref?: (goban: Goban) => void; + gobanRef?: (goban: Goban) => void; width?: number; height?: number; rengo_teams?: { @@ -114,8 +114,8 @@ export class GobanLineSummary extends React.Component< this.sync_state(); }); - if (this.props.gobanref) { - this.props.gobanref(this.goban); + if (this.props.gobanRef) { + this.props.gobanRef(this.goban); } }); } diff --git a/src/components/JosekiAdmin/JosekiAdmin.tsx b/src/components/JosekiAdmin/JosekiAdmin.tsx index 1cbfa0b1ad..02980cdd27 100644 --- a/src/components/JosekiAdmin/JosekiAdmin.tsx +++ b/src/components/JosekiAdmin/JosekiAdmin.tsx @@ -134,7 +134,7 @@ export class JosekiAdmin extends React.PureComponent { @@ -206,7 +206,7 @@ export class JosekiAdmin extends React.PureComponent { - // this shinanigans is so that we save the table state passed in the argument to this callback + // this shenanigans is so that we save the table state passed in the argument to this callback // into our component state, enabling us to reload the data again when we need to (after reverting an audit) this.setState( { diff --git a/src/components/JosekiPermissionsPanel/JosekiPermissionsPanel.tsx b/src/components/JosekiPermissionsPanel/JosekiPermissionsPanel.tsx index b8ee2bc2d9..2b33f02921 100644 --- a/src/components/JosekiPermissionsPanel/JosekiPermissionsPanel.tsx +++ b/src/components/JosekiPermissionsPanel/JosekiPermissionsPanel.tsx @@ -27,7 +27,7 @@ interface JosekiAdminProps { } interface JosekiAdminState { - userid: string; + user_id: string; can_comment: boolean; can_edit: boolean; can_admin: boolean; @@ -41,7 +41,7 @@ export class JosekiPermissionsPanel extends React.PureComponent< constructor(props: JosekiAdminProps) { super(props); this.state = { - userid: "", + user_id: "", can_comment: false, can_edit: false, can_admin: false, @@ -54,7 +54,7 @@ export class JosekiPermissionsPanel extends React.PureComponent< if (!/^\d*$/.test(new_id)) { return; } else { - this.setState({ userid: new_id }); + this.setState({ user_id: new_id }); } this.setState({ throb: true }); @@ -98,7 +98,7 @@ export class JosekiPermissionsPanel extends React.PureComponent< new_permissions[permission] = value; - put(this.props.server_url + "permissions?id=" + this.state.userid, new_permissions) + put(this.props.server_url + "permissions?id=" + this.state.user_id, new_permissions) .then((body) => { // Display the result of what happened console.log("permissions result", body); @@ -110,13 +110,13 @@ export class JosekiPermissionsPanel extends React.PureComponent< }; render = () => { - const protect_self = data.get("user").id === parseInt(this.state.userid); // don't let people dis-admin themselves! + const protect_self = data.get("user").id === parseInt(this.state.user_id); // don't let people dis-admin themselves! return (
User id:
- - + +
comment
{this.state.throb ? ( diff --git a/src/components/JosekiTagSelector/JosekiTagSelector.tsx b/src/components/JosekiTagSelector/JosekiTagSelector.tsx index 7893444d47..95a06ea5f2 100644 --- a/src/components/JosekiTagSelector/JosekiTagSelector.tsx +++ b/src/components/JosekiTagSelector/JosekiTagSelector.tsx @@ -28,7 +28,7 @@ export interface JosekiTag { interface JosekiTagSelectorProps { available_tags: JosekiTag[]; selected_tags: JosekiTag[]; - on_tag_update: (newvalue: MultiValue) => void; + on_tag_update: (new_value: MultiValue) => void; } export function JosekiTagSelector(props: JosekiTagSelectorProps) { diff --git a/src/components/Markdown/Markdown.tsx b/src/components/Markdown/Markdown.tsx index 730c2cdf62..b44ed183c9 100644 --- a/src/components/Markdown/Markdown.tsx +++ b/src/components/Markdown/Markdown.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import * as markdownit from "markdown-it"; +import * as markdown_it from "markdown-it"; import * as sanitizeHtml from "sanitize-html"; //import * as moment from "moment"; import { profanity_filter } from "profanity_filter"; @@ -29,7 +29,7 @@ interface MarkdownProps { interface MarkdownState {} -const md = markdownit({ +const md = markdown_it({ html: true, linkify: true, typographer: true, @@ -123,6 +123,7 @@ function sanitize(src: string) { "area", "audio", "embed", + /* cspell:disable-next-line */ "flgcaption", "figure", "img", @@ -183,7 +184,7 @@ function sanitize(src: string) { }); } -// this component is protected from calling sanitizeHtml to often by memoising, below. +// this component is protected from calling sanitizeHtml to often by memoizing, below. class _Markdown extends React.PureComponent { constructor(props: MarkdownProps) { @@ -196,7 +197,7 @@ class _Markdown extends React.PureComponent { // Profanity filter source = profanity_filter(source); - // Allow people to have #header style markdown for headers, markdownit requires a space between + // Allow people to have #header style markdown for headers, markdown-it requires a space between source = source .split("\n") .map((l) => l.replace(/^(#+)([a-zA-Z0-9])/, "$1 $2")) diff --git a/src/components/ModerateUser/ModerateUser.tsx b/src/components/ModerateUser/ModerateUser.tsx index dae642e011..782e94525f 100644 --- a/src/components/ModerateUser/ModerateUser.tsx +++ b/src/components/ModerateUser/ModerateUser.tsx @@ -261,7 +261,7 @@ export class ModerateUser extends Modal {

Account Info

- {/* "search" is a hack to get lastpass to not autofill */} + {/* "search" is a hack to get LastPass to not autofill */}
diff --git a/src/components/NavBar/NavBar.tsx b/src/components/NavBar/NavBar.tsx index 905908bc47..19f209c677 100644 --- a/src/components/NavBar/NavBar.tsx +++ b/src/components/NavBar/NavBar.tsx @@ -143,18 +143,18 @@ export function NavBar(): JSX.Element { //const valid_user = user.anonymous ? null : user; - // Don't show the signin link at the top if they arrived to the welcome page + // Don't show the sign-in link at the top if they arrived to the welcome page // (aka ChallengeLinkLanding) - // because that page has special treatment of signin, which takes them + // because that page has special treatment of sign-in, which takes them // to the challenge that they accepted via a challenge link, after logging them in. // We don't want to offer them a way of bailing out and signing in outside that. // (If they manually navigate away, it's no real harm, it's just that they won't // get taken to the challenge they were in the middle of accepting). - const show_signin = + const show_sign_in = !window.location.pathname.includes("/sign-in") && // don't show the link to the page we're on !window.location.pathname.includes("/welcome") && // a challenge link page is being shown - !window.location.hash.includes("/welcome"); // the signin with redirect to challenge accept + !window.location.hash.includes("/welcome"); // the sign-in with redirect to challenge accept const show_appeal_box = !window.location.pathname.includes("/appeal"); @@ -373,7 +373,7 @@ export function NavBar(): JSX.Element { - {(show_signin || null) && ( + {(show_sign_in || null) && ( {_("Sign In")} diff --git a/src/components/Notifications/NotificationManager.tsx b/src/components/Notifications/NotificationManager.tsx index 32ac9301df..5dad72ae16 100644 --- a/src/components/Notifications/NotificationManager.tsx +++ b/src/components/Notifications/NotificationManager.tsx @@ -171,7 +171,7 @@ export function emitNotification(title: string, body: string, cb?: () => void) { } }, delay); } else { - //console.log("Ignoring notificaiton sent within the first few seconds of page load", title, body); + //console.log("Ignoring notification sent within the first few seconds of page load", title, body); } } catch (e) { console.log("Error emitting notification: ", e); @@ -543,7 +543,7 @@ export class NotificationManager { return true; } - // Clears the notifiction you get when you have some amount of + // Clears the notification you get when you have some amount of // time left to make your move. This is fine to call with a game // that has no notification for it yet. clearTimecopNotification(game_id: number) { diff --git a/src/components/Notifications/Notifications.tsx b/src/components/Notifications/Notifications.tsx index d4c47a4859..5baf1e3a31 100644 --- a/src/components/Notifications/Notifications.tsx +++ b/src/components/Notifications/Notifications.tsx @@ -15,6 +15,8 @@ * along with this program. If not, see . */ +/* cspell:disable */ + import * as React from "react"; import * as data from "data"; diff --git a/src/components/ObserveGamesComponent/ObserveGamesComponent.styl b/src/components/ObserveGamesComponent/ObserveGamesComponent.styl index 811954e41d..63a911f7f6 100644 --- a/src/components/ObserveGamesComponent/ObserveGamesComponent.styl +++ b/src/components/ObserveGamesComponent/ObserveGamesComponent.styl @@ -98,7 +98,7 @@ text-align: right; align-items: baseline; - .labelshow { + .label_show { margin-left: 1rem; margin-right: 0.5rem; white-space: nowrap; diff --git a/src/components/ObserveGamesComponent/ObserveGamesComponent.tsx b/src/components/ObserveGamesComponent/ObserveGamesComponent.tsx index 81d6da8967..f297b2ff3f 100644 --- a/src/components/ObserveGamesComponent/ObserveGamesComponent.tsx +++ b/src/components/ObserveGamesComponent/ObserveGamesComponent.tsx @@ -51,6 +51,7 @@ interface GameListWhere { hide_end?: boolean; rengo_only?: boolean; friend_games_only?: boolean; + /* cspell: disable-next-line */ malk_only?: boolean; players?: Array; } @@ -375,7 +376,7 @@ export class ObserveGamesComponent extends React.PureComponent<
)}
- + {!this.props.nochallenge && ( {friends[this.props.playerId] ? ( ) : ( )} )} - @@ -419,11 +419,11 @@ export class PlayerDetails extends React.PureComponent< )} {((user.is_moderator && this.props.playerId > 0) || null) && (
- - @@ -431,11 +431,11 @@ export class PlayerDetails extends React.PureComponent< )} {((user.is_moderator && this.props.playerId > 0) || null) && (
- - @@ -443,7 +443,7 @@ export class PlayerDetails extends React.PureComponent< )} {((user.is_superuser && this.props.playerId > 0) || null) && (
- diff --git a/src/components/PrivateChat/PrivateChat.tsx b/src/components/PrivateChat/PrivateChat.tsx index 9ba15608f0..e41f7d66e7 100644 --- a/src/components/PrivateChat/PrivateChat.tsx +++ b/src/components/PrivateChat/PrivateChat.tsx @@ -63,8 +63,8 @@ class PrivateChat { player: PlayerCacheEntry; /* for generating uids */ - chatbase = Math.floor(Math.random() * 100000).toString(36); - chatnum = 0; + chat_base = Math.floor(Math.random() * 100000).toString(36); + chat_num = 0; display_state = "closed"; @@ -679,7 +679,7 @@ class PrivateChat { { player_id: this.user_id, username: this.player.username || "", - uid: this.chatbase + "." + (++this.chatnum).toString(36), + uid: this.chat_base + "." + (++this.chat_num).toString(36), message: line, as_system, }, diff --git a/src/global_styl/flags16.styl b/src/global_styl/flags16.styl index 269f87d9d7..56b36793bb 100644 --- a/src/global_styl/flags16.styl +++ b/src/global_styl/flags16.styl @@ -29,7 +29,7 @@ .f16 ._NATO{background-position:0 -176px;} .f16 ._Northern_Cyprus{background-position:0 -192px;} .f16 ._Northern_Ireland{background-position:0 -208px;} -.f16 ._Olimpic_Movement{background-position:0 -224px;} +.f16 ._Olympic_Movement{background-position:0 -224px;} .f16 ._OPEC{background-position:0 -240px;} .f16 ._Red_Cross{background-position:0 -256px;} .f16 ._Scotland{background-position:0 -272px;} diff --git a/src/global_styl/flags32.styl b/src/global_styl/flags32.styl index df7792b648..c5b59be758 100644 --- a/src/global_styl/flags32.styl +++ b/src/global_styl/flags32.styl @@ -29,7 +29,7 @@ .f32 ._NATO{background-position:0 -352px;} .f32 ._Northern_Cyprus{background-position:0 -384px;} .f32 ._Northern_Ireland{background-position:0 -416px;} -.f32 ._Olimpic_Movement{background-position:0 -448px;} +.f32 ._Olympic_Movement{background-position:0 -448px;} .f32 ._OPEC{background-position:0 -480px;} .f32 ._Red_Cross{background-position:0 -512px;} .f32 ._Scotland{background-position:0 -544px;} diff --git a/src/global_styl/global.styl b/src/global_styl/global.styl index 2c3816a9ba..0110130363 100644 --- a/src/global_styl/global.styl +++ b/src/global_styl/global.styl @@ -438,7 +438,7 @@ button, a.btn, .btn { transition: background-color 0.3s ease; - &.noshadow { + &.no-shadow { box-shadow: none; } diff --git a/src/index.html b/src/index.html index 61ede9992c..e18ac6ee7b 100644 --- a/src/index.html +++ b/src/index.html @@ -388,7 +388,7 @@ } window['ogs_current_language'] = ogs_current_language || 'en'; - /* Load our transations */ + /* Load our translations */ var language_path = "{{CDN_SERVICE}}/{{RELEASE}}/locale/" + ogs_current_language + ".{{LANGUAGE_VERSION_DOTJS}}"; language_path = language_path.replace('///', '/'); /* in dev mode, we don't use the cdn or release vars */ document.write('