Save SAO AG Grid work

This commit is contained in:
2026-05-04 10:38:07 +02:00
parent ce1be14602
commit fc9ab5da0b
8 changed files with 5825 additions and 229 deletions

View File

@@ -22,14 +22,31 @@ this repository contains the full copyright notices and license terms. -->
<script type="text/javascript" src="bower_components/mousetrap/mousetrap.js"></script>
<script type="text/javascript" src="bower_components/mousetrap/plugins/pause/mousetrap-pause.js"></script>
<script type="text/javascript" src="bower_components/Sortable/Sortable.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ag-grid-community@31.3.4/dist/ag-grid-community.min.js"></script>
<link rel="stylesheet" href="bower_components/c3/c3.css">
<link rel="stylesheet" href="bower_components/fullcalendar/dist/fullcalendar.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@31.3.4/styles/ag-grid.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@31.3.4/styles/ag-theme-alpine.css">
<script type="text/javascript" src="dist/tryton-sao.js"></script>
<link rel="stylesheet" type="text/css" href="dist/tryton-sao.css" media="screen"/>
<script type="text/javascript" src="custom.js"></script>
<link rel="stylesheet" type="text/css" href="custom.css" media="screen"/>
<script type="text/javascript">
(function() {
try {
var storedMode = window.localStorage &&
localStorage.getItem('sao_theme_mode');
document.documentElement.setAttribute(
'data-theme-mode',
storedMode || 'light');
} catch (error) {
document.documentElement.setAttribute(
'data-theme-mode', 'light');
}
}());
</script>
</head>
<body>
<noscript>
@@ -52,6 +69,25 @@ this repository contains the full copyright notices and license terms. -->
</span>
<span id="title">Tryton</span>
</a>
<button type="button" id="theme-mode-toggle"
class="btn btn-default navbar-btn theme-mode-toggle"
title="Toggle dark mode"
aria-label="Toggle dark mode"
aria-pressed="false">
<span class="theme-mode-toggle-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" focusable="false">
<path d="M10 2.5v2.1"></path>
<path d="M10 15.4v2.1"></path>
<path d="M4.7 4.7l1.5 1.5"></path>
<path d="M13.8 13.8l1.5 1.5"></path>
<path d="M2.5 10h2.1"></path>
<path d="M15.4 10h2.1"></path>
<path d="M4.7 15.3l1.5-1.5"></path>
<path d="M13.8 6.2l1.5-1.5"></path>
<circle cx="10" cy="10" r="3.3"></circle>
</svg>
</span>
</button>
</div>
<div class="collapse navbar-collapse" id="main_navbar">
<form class="navbar-form navbar-left flip" role="search" id="global-search" style="border-style: none;">
@@ -92,6 +128,40 @@ this repository contains the full copyright notices and license terms. -->
document.querySelector('body').innerHTML = '<strong>sao is not fully installed. Please refer to <a href="README.md">README</a></strong>';
} else {
jQuery(function() {
function applyThemeMode(mode) {
var isDark = mode === 'dark';
document.documentElement.setAttribute(
'data-theme-mode', isDark ? 'dark' : 'light');
try {
if (window.localStorage) {
localStorage.setItem(
'sao_theme_mode', isDark ? 'dark' : 'light');
}
} catch (error) {
}
var toggle = jQuery('#theme-mode-toggle');
toggle.attr('aria-pressed', isDark ? 'true' : 'false');
toggle.attr(
'title',
isDark ? 'Switch to light mode' :
'Switch to dark mode');
var logo = jQuery('#title-logo');
if (logo.length) {
logo.attr(
'src',
isDark ? 'dist/tradon-dark.png' :
'dist/tradon.png');
}
}
jQuery('#theme-mode-toggle').click(function() {
var current = document.documentElement.getAttribute(
'data-theme-mode');
applyThemeMode(current === 'dark' ? 'light' : 'dark');
});
applyThemeMode(
document.documentElement.getAttribute('data-theme-mode'));
jQuery('.body').show();
jQuery('[data-toggle="offcanvas"]').click(function() {
jQuery('.row-offcanvas').toggleClass('active');