From c2ff10015f5064721a2daec20d4b5d5258a53edf Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 7 Nov 2026 13:47:37 +0000 Subject: [PATCH] site: the design's colours over the wikis' high-contrast theme; .org inquiries - site/colorlock.py: both XWikis force black and white with !important (a HIGH CONTRAST DARK THEME block in the skin's cssVariablesInit.css). On our pages only, the design's colours win: each inline colour made !important, and a stylesheet scoped to the page root (.ssos) for the rest. Used by site/com/build.py and site/org/build.py; the .com reinstalled with it. - site/org/inquiries (Captain Bob, 2026-11-07): the .com's inquiries go to an admin-only master/detail on the .org -- Inquiries.WebHome (Live Data table), one page per inquiry under Inquiries.Entries with a sheet and a status, PublicInquiry (public) filing them with its author's rights and echoing nothing a visitor sends; a hidden trap field for robots. The .com form posts there. Installed and tested: a guest's inquiry filed and deleted; one whose name and message were script macros was stored as text, nothing ran. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2 --- site/__pycache__/colorlock.cpython-313.pyc | Bin 0 -> 2967 bytes site/colorlock.py | 41 +++++++ site/com/Inquiries.WebHome.xwiki | 79 ++++++------ site/com/Main.WebHome.xwiki | 110 +++++++++-------- site/com/TryIt.WebHome.xwiki | 112 +++++++++-------- site/com/build.py | 19 ++- site/org/Admin.WebHome.xwiki | 60 +++++---- site/org/Contributors.WebHome.xwiki | 66 +++++----- site/org/Main.WebHome.xwiki | 72 ++++++----- site/org/build.py | 5 +- site/org/inquiries/ClassSetup.xwiki | 26 ++++ site/org/inquiries/Inquiries.WebHome.xwiki | 3 + site/org/inquiries/InquirySheet.xwiki | 26 ++++ .../org/inquiries/PublicInquiry.WebHome.xwiki | 41 +++++++ site/org/inquiries/install.sh | 115 ++++++++++++++++++ 15 files changed, 545 insertions(+), 230 deletions(-) create mode 100644 site/__pycache__/colorlock.cpython-313.pyc create mode 100644 site/colorlock.py create mode 100644 site/org/inquiries/ClassSetup.xwiki create mode 100644 site/org/inquiries/Inquiries.WebHome.xwiki create mode 100644 site/org/inquiries/InquirySheet.xwiki create mode 100644 site/org/inquiries/PublicInquiry.WebHome.xwiki create mode 100755 site/org/inquiries/install.sh diff --git a/site/__pycache__/colorlock.cpython-313.pyc b/site/__pycache__/colorlock.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c1186d1f91b2baa03fbd3d68ace3c56df94ad36e GIT binary patch literal 2967 zcmZ`5-ESL3e%2qcySCfVqT@m-3{I=qA+{Umqp1^+k~R^D(tx+Q0xh-1>xsR1y}Qgz z8e)o+N5V;$o=(;E1QH1G0B=0U2W7C!Q``{sDfo-i@6qU1@iI^ZWkV z`ORS}r6PDf9{t~kH{%HXS8jqQ;sb~G0C^()22e*JsZ#lo<}UE#o!yShq7_<4Ulx(w3%t^&AhXLb2;3k)WHNhq)taTw%08z zIo24*hQ*B<1=_mNH1K-E<`jztZBe{xGo1p1@C5Rzx?qb2e)l%;ajX-@HbAOj)Ehb7 zwge+w_<|YU1g(Wtle7%0ZWnaU|3sKUswU-cScb?00^644#+N2r>w8-LPbkf|8n= zxkem80I^_K$8hm-aXL3Xp1XV{JBEo>>-r=UAoC<$G&g2FrHn#w_NoVad6N0;+VgT% zQdNv|xa)e?Fep3&YPtJ#+T$afkDnW}7&UOZ!-2Q8aHp&hCltA-9Gw0JhJ{wn+T zrW=tu$pvWHIWI4-sh*WF>>E1*N~J1=j--7EvMMOUpWrIANS)bhRt-84`o4svd)y&R zc2LioSuY$Q8&-od<2b2mvl?ZAg5hFuqBwc|nDD1v*DwiOAb1q4`zD8%re>~=FP$t= zYRF9YGcPS%o*qAu*|3~75ttD4V*z0tndDF>U7Q&6@a6gOVzGEkXW-l7;!<(x$}!Rt z@lH%m&P>lA;|Ss{l^pm9X~Q-lL47gIPs}e~J8sW*h;E3D5`Ic(t@??sKdoG!s&j>I zSF|79yURy2UOW$a_3i_^m3z<)%U^OCVLJ~P98m%=LfEYbCS4WTfb6U5R{klxzFwm1 z&`kbj)iBL0_*2rAzEfGA@?m%n^MHMX3dmAcP`RJOXV#P{A6u6EPdr*Epq@jo-$lp@ zt%SfRVVGW8sC=f!6F@6R8OVXh7g2WL=C3j(t}@$Jdp~SD(bte| z)jv2d!O<0Wqw0^%u&cD(XpQP7ca<8Kg@Du59WONO7A>s7Tq@jvVPo@oi&&&d3moQ8LAP6ld>)qG zcy$vMIcO`McMOt<&cn;^!)FuiCr@uK?x#*~-`=|Y@SQ)uzn8kuNnLoX|0|XLOxaH) zx36qn*}l4U^~)FbhF<9mz4G1s-cY_Xl>cGw=Z|(LUf&;l=I`;p#{Z^1{-85B`q}(` zJhh$NNq0_?$ag_Yy0o*{g}Blzu{}7DMPc1X!s79xA)}gnoVZnUkVZ2ff7`tgoh_H*x!n->8{8_tGDXX49^s zW@BzthY2Oz7^B{C>Z;}Ch9ec@(8#=B5z$W@7ab~-;ReIRmO{BjjyNQvV$mDnDcO#QKiIIJv&27y+ zPV8Np>0Fxm@wuIaTmQUGItye+ukBuMCzASwAl@&(-gd zC)k;6YAMg1jpZc{x7#ZDzRqX&a%@a%T` n^Y#H!&aW!_bz`sI?9`iwVP&wTY$pF7A5caQ&qkG(JTt!or7|TO literal 0 HcmV?d00001 diff --git a/site/colorlock.py b/site/colorlock.py new file mode 100644 index 00000000..2e1f2eeb --- /dev/null +++ b/site/colorlock.py @@ -0,0 +1,41 @@ +"""colorlock.py -- keep a page's own colours inside a wiki whose theme forces its own. + +Both XWikis carry a high-contrast theme (skins/flamingo/cssVariablesInit.css on the server) that sets +every element black on white with !important. On our pages the design's colours win instead +(Captain Bob, 2026-11-07), and on those pages only; the rest of the wiki keeps the theme: + + - every colour an element states in its style="" is made !important -- an inline !important beats + any stylesheet's; + - a stylesheet scoped to the page's root (class "ssos") covers the elements that state no colour: + ".ssos *" outranks the theme's "*" (both !important, the more specific wins). +""" +import re + +ROOT_CLASS = "ssos" +STYLE = """""" +COLOUR_PROPS = re.compile(r"^\s*(color|background|background-color|border|border-(top|right|bottom|left)|" + r"border-color|border-(top|right|bottom|left)-color|accent-color|fill)\s*:", re.I) + + +def _lock_style(m): + decls = [] + for d in m.group(1).split(";"): + if d.strip() and COLOUR_PROPS.match(d) and "!important" not in d: + d = d.rstrip() + " !important" + decls.append(d) + return 'style="%s"' % ";".join(decls) + + +def lock(html, root_marker): + """root_marker: the opening text of the page's root element, e.g. '
= 1, root_marker + html = html.replace(root_marker, root_marker.replace("
-
+ +
-
+
-

Inquiries

+

Inquiries

Talk to the bridge.

-

Licensing, research collaboration, press or plain curiosity — every message is read by a human. Want to contribute code? Head to starshipos-f18.org.

+

Licensing, research collaboration, press or plain curiosity — every message is read by a human. Want to contribute code? Head to starshipos-f18.org.

-
+ +
- - + +
- - + +
- - + +
- - @@ -48,46 +57,46 @@
- - + +
- - + +
- -Opens your e-mail program. Replies usually within a few days. + +Replies usually within a few days.
-