mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-15 03:41:28 +00:00
The bundled pages took two facts from the User-Agent header: whether the app
is in dark mode ("dark") and whether they run inside OrcaSlicer at all
("BBL-Slicer", the gate on every message they post to the host). That made
the header carry application state. #15104 switched Linux to WebKitGTK's own
header so that Cloudflare accepts third-party print-host pages, and with it
the home page came up light on a dark app and New Project, Open Project, the
Project tab, the wizard and the web dialogs stopped reaching the host.
The host now tells each page its theme through a document-start user script
(window.__orcaTheme), added when the view is created, again on a theme change
before the reload, and after PrinterWebView clears its user scripts. The page
tests for the injected window.wx bridge instead of the header, which is what
the plugin pages already do. Nothing reads the header any more, so Linux
keeps sending WebKitGTK's own on every view. Windows and macOS keep the
headers they always sent: the Windows wrapper still derives WebView2's colour
scheme from it.
Four copies of the helper file lived next to the pages that used them
(homepage/js, guide/js, dialog/js, include), differing only in the relative
path each one passed to its dark.css toggle. The toggle now switches whichever
dark.css the page already links, so the one copy in include/ serves all 17
pages and the other three are gone. That file was stored with CRLF and is
normalised to LF, which is most of its diff.
105 lines
3.9 KiB
HTML
105 lines
3.9 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
|
<title>引导_P21</title>
|
|
<link rel="stylesheet" type="text/css" href="../../include/global.css" /> <!-- ORCA One for all-->
|
|
<link rel="stylesheet" type="text/css" href="../css/common.css" />
|
|
<link rel="stylesheet" type="text/css" href="../21/common.css" /> <!-- ORCA use common sources for setup guide and standalone dialog -->
|
|
<link rel="stylesheet" type="text/css" href="21.css" />
|
|
<link rel="stylesheet" type="text/css" href="../css/dark.css" />
|
|
<script type="text/javascript" src="test.js"></script>
|
|
<script type="text/javascript" src="../../include/jquery-3.6.0.min.js"></script>
|
|
<script type="text/javascript" src="../js/json2.js"></script>
|
|
<script type="text/javascript" src="../../include/i18n.js"></script>
|
|
<script type="text/javascript" src="../../include/globalapi.js"></script>
|
|
<script type="text/javascript" src="../js/common.js"></script>
|
|
<script type="text/javascript" src="../21/common.js"></script> <!-- ORCA use common sources for setup guide and standalone dialog -->
|
|
<script type="text/javascript" src="21.js"></script>
|
|
</head>
|
|
<body onLoad="OnInit()">
|
|
<div id="Title">
|
|
<div data-i18n="printer_selection">Printer Selection</div>
|
|
</div>
|
|
|
|
<div id="SidebarContainer">
|
|
<div id="Sidebar" class="thin-scroll">
|
|
<div class="title" data-i18n="vendors">Vendors</div>
|
|
<div class="area" id="SidebarVendors">
|
|
<!-- <div class="SidebarItem"></div> -->
|
|
</div>
|
|
</div>
|
|
<div class="back" onclick="document.getElementById('SidebarContainer').setAttribute('open', '0')"></div>
|
|
</div>
|
|
<div class="SidebarBtn ButtonStyleRegular" onclick="document.getElementById('SidebarContainer').setAttribute('open', '1')">
|
|
<div class="icon16"></div>
|
|
</div>
|
|
|
|
<div class="search" hasvalue="0">
|
|
<div class="search-icon icon16"></div>
|
|
<input type="text" class="searchTerm" placeholder=" " oninput="textInput(this)">
|
|
<span class="search-placeholder" data-i18n="search">Search</span>
|
|
</div>
|
|
<div class="LayoutSelector">
|
|
<div class="TabGroup">
|
|
<div class="TabButton" onclick="LayoutMode('compact-list')" ><div class="icon16"></div></div>
|
|
<div class="TabButton" onclick="LayoutMode('compact-cover')"><div class="icon16"></div></div>
|
|
<div class="TabButton" onclick="LayoutMode('large-cover')" ><div class="icon16"></div></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="Content" class="thin-scroll">
|
|
|
|
<!-- EXAMPLE GENERATED CODE BLOCK
|
|
<div class="OneVendorBlock" Vendor="VendorName">
|
|
<div class="BlockBanner">
|
|
<a>VendorName</a>
|
|
<div class="BannerBtns" onClick="ChooseVendor('VendorName')" >
|
|
<div class="modelCount"></div>
|
|
<input type="checkbox" class="VendorCheckbox" />
|
|
</div>
|
|
</div>
|
|
<div class="PrinterArea">
|
|
<div class="PrinterBlock" onClick="ChooseModel('VendorName','ModelName')" >
|
|
<div class="PImg" >
|
|
<img class="ModelThumbnail" src="CoverPath" />
|
|
</div>
|
|
<div class="PrinterInfoMark">?</div>
|
|
<div class="PrinterInfo">
|
|
<div class="title trans">Nozzle</div>
|
|
<div class="value">nozzleInfo</div>
|
|
</div>
|
|
<div style="display: flex;">
|
|
<div class="ModelCheckBox" vendor="' +vendor+ '" model="'+OneModel['model']+'"></div>
|
|
<div class="PName">modelName</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
-->
|
|
|
|
</div>
|
|
<div id="AcceptArea">
|
|
<div class="ButtonStyleRegular ButtonTypeChoice" id="PreBtn" onclick="window.open('../1/index.html','_self')" data-i18n="back">Back</div>
|
|
<div class="ButtonStyleConfirm ButtonTypeChoice" id="AcceptBtn" onclick="GotoFilamentPage()" data-i18n="next">Next</div>
|
|
</div>
|
|
|
|
<div id="NoticeMask"></div>
|
|
<div id="NoticeBody">
|
|
<div id="NoticeBar" data-i18n="error">Error</div>
|
|
<div id="NoticeContent">
|
|
<div id="NoticeText" data-i18n="printer_required">At least one printer must be selected.</div>
|
|
<div id="NoticeBtns">
|
|
<div class="ButtonStyleConfirm ButtonTypeChoice" onClick="ShowNotice(0)" data-i18n="ok">OK</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
<script>
|
|
initKeyEvents(false); // dont close on ESC
|
|
InitGlobalVariables();
|
|
</script>
|
|
</html>
|