Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-10-27 21:39:12 +08:00
commit 7cffab9743
10 changed files with 59 additions and 61 deletions

View file

@ -1,4 +1,6 @@
{
"accountSupport1": "So far, we have made more than 5,000 improvements to SiYuan. Our unremitting efforts are entirely due to users' recognition and support of SiYuan.",
"accountSupport2": "The development of SiYuan cannot be separated from your support. We will continue to make good products with our heart and provide you with a better knowledge management experience.",
"goToTab1": "Go to tab #1",
"goToTab2": "Go to tab #2",
"goToTab3": "Go to tab #3",

View file

@ -1,4 +1,6 @@
{
"accountSupport1": "Hasta ahora, hemos realizado más de 5000 mejoras en SiYuan. Nuestros incansables esfuerzos se deben enteramente al reconocimiento y apoyo de los usuarios a SiYuan.",
"accountSupport2": "El desarrollo de SiYuan no puede separarse de su apoyo. Continuaremos fabricando buenos productos con nuestro corazón y brindándole una mejor experiencia de gestión del conocimiento.",
"goToTab1": "Ir a la pestaña #1",
"goToTab2": "Ir a la pestaña #2",
"goToTab3": "Ir a la pestaña #3",

View file

@ -1,4 +1,6 @@
{
"accountSupport1": "Jusqu'à présent, nous avons apporté plus de 5 000 améliorations à SiYuan. Nos efforts inlassables sont entièrement dus à la reconnaissance et au soutien des utilisateurs pour SiYuan.",
"accountSupport2": "Le développement de SiYuan ne peut être séparé de votre soutien. Nous continuerons à fabriquer de bons produits avec notre cœur et à vous offrir une meilleure expérience de gestion des connaissances.",
"goToTab1": "Aller à l'onglet #1",
"goToTab2": "Aller à l'onglet #2",
"goToTab3": "Aller à l'onglet #3",

View file

@ -1,4 +1,6 @@
{
"accountSupport1": "到目前為止,我們對思源筆記進行了 5000 多項改進,我們堅持不懈的努力完全源於用戶對思源筆記的認可和支持。",
"accountSupport2": "思源筆記的發展離不開你的支持,我們會繼續用心做好產品,為你提供更好的知識管理體驗。",
"goToTab1": "跳到第一個頁籤",
"goToTab2": "跳到第二個頁籤",
"goToTab3": "跳到第三個頁籤",

View file

@ -1,4 +1,6 @@
{
"accountSupport1": "到目前为止,我们对思源笔记进行了 5000 多项改进,我们坚持不懈的努力完全源于用户对思源笔记的认可和支持。",
"accountSupport2": "思源笔记的发展离不开你的支持,我们会继续用心做好产品,为你提供更好的知识管理体验。",
"goToTab1": "跳转到第一个页签",
"goToTab2": "跳转到第二个页签",
"goToTab3": "跳转到第三个页签",

View file

@ -62,7 +62,7 @@
min-width: 214px;
background: var(--b3-theme-secondary);
color:var(--b3-theme-on-secondary);
padding: 16px;
padding: 24px 16px;
font-size: 16px;
}

View file

@ -15,61 +15,29 @@ import {getCloudURL} from "./util/about";
export const account = {
element: undefined as Element,
genHTML: (onlyPayHTML = false) => {
const payHTML = `<div class="b3-list">
<div class="b3-list-item">
<svg class="b3-list-item__graphic"><use xlink:href="#iconAccount"></use></svg>
<span class="b3-list-item__text">S3/WebDAV </span>
</div>
<div class="b3-list-item">
<svg class="b3-list-item__graphic"><use xlink:href="#iconAccount"></use></svg>
<span class="b3-list-item__text"></span>
</div>
<a href="javascript:void(0)" class="b3-list-item${(window.siyuan.user && window.siyuan.user.userSiYuanSubscriptionStatus === 2) ? " fn__none" : ""}" id="trialSub">
<svg class="b3-list-item__graphic ft__secondary"><use xlink:href="#iconVIP"></use></svg>
<span class="b3-list-item__text"> ${window.siyuan.languages.freeSub}</span>
</a>
<a class="b3-list-item" href="${getCloudURL("sponsor")}" target="_blank">
<svg class="b3-list-item__graphic" version='1.1' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><path fill='#ffe43c' d='M6.4 0h19.2c4.268 0 6.4 2.132 6.4 6.4v19.2c0 4.268-2.132 6.4-6.4 6.4h-19.2c-4.268 0-6.4-2.132-6.4-6.4v-19.2c0-4.268 2.135-6.4 6.4-6.4z'></path> <path fill='#00f5d4' d='M25.6 0h-8.903c-7.762 1.894-14.043 7.579-16.697 15.113v10.487c0 3.533 2.867 6.4 6.4 6.4h19.2c3.533 0 6.4-2.867 6.4-6.4v-19.2c0-3.537-2.863-6.4-6.4-6.4z'></path> <path fill='#01beff' d='M25.6 0h-0.119c-12.739 2.754-20.833 15.316-18.079 28.054 0.293 1.35 0.702 2.667 1.224 3.946h16.974c3.533 0 6.4-2.867 6.4-6.4v-19.2c0-3.537-2.863-6.4-6.4-6.4z'></path> <path fill='#9a5ce5' d='M31.005 2.966c-0.457-0.722-1.060-1.353-1.784-1.849-8.342 3.865-13.683 12.223-13.679 21.416-0.003 3.256 0.67 6.481 1.978 9.463h8.081c0.602 0 1.185-0.084 1.736-0.238-2.1-3.189-3.401-7.624-3.401-12.526 0-7.337 2.921-13.628 7.070-16.266z'></path> <path fill='#f15bb5' d='M32 25.6v-19.2c0-1.234-0.354-2.419-0.998-3.43-4.149 2.638-7.067 8.928-7.067 16.266 0 4.902 1.301 9.334 3.401 12.526 2.693-0.757 4.664-3.231 4.664-6.162z'></path> <path fill='#fff' opacity='0.2' d='M26.972 22.415c-2.889 0.815-4.297 2.21-6.281 3.182 1.552 0.348 3.105 0.461 4.902 0.461 2.644 0 5.363-1.449 6.406-2.519v-1.085c-1.598-0.399-2.664-0.705-5.028-0.039zM4.773 21.612c-0.003 0-0.006-0.003-0.006-0.003-1.726-0.863-3.382-1.205-4.767-1.301v2.487c0.779-0.341 2.396-0.921 4.773-1.182zM17.158 26.599c1.472-0.158 2.57-0.531 3.533-1.002-1.063-0.238-2.126-0.583-3.269-1.079-2.767-1.205-5.63-3.092-10.491-3.034-0.779 0.010-1.495 0.058-2.158 0.132 4.503 2.248 7.882 5.463 12.384 4.983z'></path> <path fill='#fff' opacity='0.2' d='M20.691 25.594c-0.963 0.47-2.061 0.844-3.533 1.002-4.503 0.483-7.882-2.731-12.381-4.983-2.38 0.261-3.994 0.841-4.773 1.179v2.809c0 4.268 2.132 6.4 6.4 6.4h19.197c4.268 0 6.4-2.132 6.4-6.4v-2.065c-1.044 1.069-3.762 2.519-6.406 2.519-1.797 0-3.35-0.113-4.902-0.461z'></path> <path fill='#fff' opacity='0.5' d='M3.479 19.123c0 0.334 0.271 0.606 0.606 0.606s0.606-0.271 0.606-0.606v0c0-0.334-0.271-0.606-0.606-0.606s-0.606 0.271-0.606 0.606v0z'></path> <path fill='#fff' opacity='0.5' d='M29.027 14.266c0 0.334 0.271 0.606 0.606 0.606s0.606-0.271 0.606-0.606v0c0-0.334-0.271-0.606-0.606-0.606s-0.606 0.271-0.606 0.606v0z'></path> <path fill='#fff' d='M9.904 1.688c0 0.167 0.136 0.303 0.303 0.303s0.303-0.136 0.303-0.303v0c0-0.167-0.136-0.303-0.303-0.303s-0.303 0.136-0.303 0.303v0z'></path> <path fill='#fff' d='M2.673 10.468c0 0.167 0.136 0.303 0.303 0.303s0.303-0.136 0.303-0.303v0c0-0.167-0.136-0.303-0.303-0.303s-0.303 0.136-0.303 0.303v0z'></path> <path fill='#fff' opacity='0.6' d='M30.702 9.376c0 0.167 0.136 0.303 0.303 0.303s0.303-0.136 0.303-0.303v0c0-0.167-0.136-0.303-0.303-0.303s-0.303 0.136-0.303 0.303v0z'></path> <path fill='#fff' opacity='0.8' d='M29.236 20.881c0 0.276 0.224 0.499 0.499 0.499s0.499-0.224 0.499-0.499v0c0-0.276-0.224-0.499-0.499-0.499s-0.499 0.224-0.499 0.499v0z'></path> <path fill='#fff' opacity='0.8' d='M15.38 1.591c0.047 0.016 0.101 0.026 0.158 0.026 0.276 0 0.499-0.224 0.499-0.499 0-0.219-0.141-0.406-0.338-0.473l-0.004-0.001c-0.047-0.016-0.101-0.026-0.158-0.026-0.276 0-0.499 0.224-0.499 0.499 0 0.219 0.141 0.406 0.338 0.473l0.004 0.001z'></path> <path fill='#ffdeeb' d='M25.732 8.268c-2.393-2.371-6.249-2.371-8.642 0l-1.089 1.085-1.079-1.089c-2.38-2.39-6.249-2.393-8.639-0.013s-2.393 6.249-0.013 8.639l2.158 2.158 6.474 6.464c0.596 0.593 1.562 0.593 2.158 0l6.474-6.464 2.193-2.158c2.384-2.383 2.384-6.242 0.003-8.622z'></path> <path fill='#fff' d='M17.081 8.268l-1.079 1.085-1.079-1.089c-2.38-2.39-6.249-2.393-8.639-0.013s-2.393 6.249-0.013 8.639l2.158 2.158 2.548 2.487c4.097-1.044 7.627-3.646 9.837-7.254 1.424-2.271 2.284-4.848 2.503-7.518-2.193-0.715-4.606-0.132-6.236 1.504z'></path> </svg>
<span class="b3-list-item__text">${window.siyuan.languages.sponsor}</span>
</a>
</div>
<div class="fn__hr--b"></div>
<div class="fn__hr--b"></div>
<div style="text-align: left">
&nbsp; &nbsp; &nbsp; &nbsp;
</div>
<div class="fn__hr"></div>
<div style="text-align: left">
&nbsp; &nbsp; &nbsp; &nbsp;
</div>
<div class="fn__hr--b"></div>
<div class="fn__hr--b"></div>
<div class="b3-chips" style="justify-content: center;">
<div class="b3-chip b3-chip--success" style="flex-direction: column;padding: 16px;">
<h2></h2>
<div class="fn__hr--b"></div>
<del>64</del>
<div>48 </div>
</div>
<div class="fn__space"></div>
<div class="b3-chip b3-chip--info" style="flex-direction: column;padding: 16px;">
<h2></h2>
<div class="fn__hr--b"></div>
<div>¥ 96 </div>
</div>
<div class="fn__space"></div>
<div class="b3-chip b3-chip--error" style="flex-direction: column;padding: 16px;">
<h2></h2>
<div class="fn__hr--b"></div>
<del>192</del>
<div>148 </div>
</div>
</div>
<div class="fn__hr--b"></div>
const payHTML = `
<a class="b3-button b3-button--big" href="${getCloudURL("subscribe/siyuan")}" target="_blank">
<svg><use xlink:href="#iconVIP"></use></svg>${window.siyuan.languages.account1}
</a>`;
</a>
<div class="fn__hr--b"></div>
<span class="b3-chip b3-chip--primary b3-chip--hover${(window.siyuan.user && window.siyuan.user.userSiYuanSubscriptionStatus === 2) ? " fn__none" : ""}" id="trialSub">
<svg class="ft__secondary"><use xlink:href="#iconVIP"></use></svg>
${window.siyuan.languages.freeSub}
</span>
<div class="fn__hr${(window.siyuan.user && window.siyuan.user.userSiYuanSubscriptionStatus === 2) ? " fn__none" : ""}"></div>
<a href="${getCloudURL("sponsor")}" target="_blank" class="b3-chip b3-chip--pink b3-chip--hover">
<svg version='1.1' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><path fill='#ffe43c' d='M6.4 0h19.2c4.268 0 6.4 2.132 6.4 6.4v19.2c0 4.268-2.132 6.4-6.4 6.4h-19.2c-4.268 0-6.4-2.132-6.4-6.4v-19.2c0-4.268 2.135-6.4 6.4-6.4z'></path> <path fill='#00f5d4' d='M25.6 0h-8.903c-7.762 1.894-14.043 7.579-16.697 15.113v10.487c0 3.533 2.867 6.4 6.4 6.4h19.2c3.533 0 6.4-2.867 6.4-6.4v-19.2c0-3.537-2.863-6.4-6.4-6.4z'></path> <path fill='#01beff' d='M25.6 0h-0.119c-12.739 2.754-20.833 15.316-18.079 28.054 0.293 1.35 0.702 2.667 1.224 3.946h16.974c3.533 0 6.4-2.867 6.4-6.4v-19.2c0-3.537-2.863-6.4-6.4-6.4z'></path> <path fill='#9a5ce5' d='M31.005 2.966c-0.457-0.722-1.060-1.353-1.784-1.849-8.342 3.865-13.683 12.223-13.679 21.416-0.003 3.256 0.67 6.481 1.978 9.463h8.081c0.602 0 1.185-0.084 1.736-0.238-2.1-3.189-3.401-7.624-3.401-12.526 0-7.337 2.921-13.628 7.070-16.266z'></path> <path fill='#f15bb5' d='M32 25.6v-19.2c0-1.234-0.354-2.419-0.998-3.43-4.149 2.638-7.067 8.928-7.067 16.266 0 4.902 1.301 9.334 3.401 12.526 2.693-0.757 4.664-3.231 4.664-6.162z'></path> <path fill='#fff' opacity='0.2' d='M26.972 22.415c-2.889 0.815-4.297 2.21-6.281 3.182 1.552 0.348 3.105 0.461 4.902 0.461 2.644 0 5.363-1.449 6.406-2.519v-1.085c-1.598-0.399-2.664-0.705-5.028-0.039zM4.773 21.612c-0.003 0-0.006-0.003-0.006-0.003-1.726-0.863-3.382-1.205-4.767-1.301v2.487c0.779-0.341 2.396-0.921 4.773-1.182zM17.158 26.599c1.472-0.158 2.57-0.531 3.533-1.002-1.063-0.238-2.126-0.583-3.269-1.079-2.767-1.205-5.63-3.092-10.491-3.034-0.779 0.010-1.495 0.058-2.158 0.132 4.503 2.248 7.882 5.463 12.384 4.983z'></path> <path fill='#fff' opacity='0.2' d='M20.691 25.594c-0.963 0.47-2.061 0.844-3.533 1.002-4.503 0.483-7.882-2.731-12.381-4.983-2.38 0.261-3.994 0.841-4.773 1.179v2.809c0 4.268 2.132 6.4 6.4 6.4h19.197c4.268 0 6.4-2.132 6.4-6.4v-2.065c-1.044 1.069-3.762 2.519-6.406 2.519-1.797 0-3.35-0.113-4.902-0.461z'></path> <path fill='#fff' opacity='0.5' d='M3.479 19.123c0 0.334 0.271 0.606 0.606 0.606s0.606-0.271 0.606-0.606v0c0-0.334-0.271-0.606-0.606-0.606s-0.606 0.271-0.606 0.606v0z'></path> <path fill='#fff' opacity='0.5' d='M29.027 14.266c0 0.334 0.271 0.606 0.606 0.606s0.606-0.271 0.606-0.606v0c0-0.334-0.271-0.606-0.606-0.606s-0.606 0.271-0.606 0.606v0z'></path> <path fill='#fff' d='M9.904 1.688c0 0.167 0.136 0.303 0.303 0.303s0.303-0.136 0.303-0.303v0c0-0.167-0.136-0.303-0.303-0.303s-0.303 0.136-0.303 0.303v0z'></path> <path fill='#fff' d='M2.673 10.468c0 0.167 0.136 0.303 0.303 0.303s0.303-0.136 0.303-0.303v0c0-0.167-0.136-0.303-0.303-0.303s-0.303 0.136-0.303 0.303v0z'></path> <path fill='#fff' opacity='0.6' d='M30.702 9.376c0 0.167 0.136 0.303 0.303 0.303s0.303-0.136 0.303-0.303v0c0-0.167-0.136-0.303-0.303-0.303s-0.303 0.136-0.303 0.303v0z'></path> <path fill='#fff' opacity='0.8' d='M29.236 20.881c0 0.276 0.224 0.499 0.499 0.499s0.499-0.224 0.499-0.499v0c0-0.276-0.224-0.499-0.499-0.499s-0.499 0.224-0.499 0.499v0z'></path> <path fill='#fff' opacity='0.8' d='M15.38 1.591c0.047 0.016 0.101 0.026 0.158 0.026 0.276 0 0.499-0.224 0.499-0.499 0-0.219-0.141-0.406-0.338-0.473l-0.004-0.001c-0.047-0.016-0.101-0.026-0.158-0.026-0.276 0-0.499 0.224-0.499 0.499 0 0.219 0.141 0.406 0.338 0.473l0.004 0.001z'></path> <path fill='#ffdeeb' d='M25.732 8.268c-2.393-2.371-6.249-2.371-8.642 0l-1.089 1.085-1.079-1.089c-2.38-2.39-6.249-2.393-8.639-0.013s-2.393 6.249-0.013 8.639l2.158 2.158 6.474 6.464c0.596 0.593 1.562 0.593 2.158 0l6.474-6.464 2.193-2.158c2.384-2.383 2.384-6.242 0.003-8.622z'></path> <path fill='#fff' d='M17.081 8.268l-1.079 1.085-1.079-1.089c-2.38-2.39-6.249-2.393-8.639-0.013s-2.393 6.249-0.013 8.639l2.158 2.158 2.548 2.487c4.097-1.044 7.627-3.646 9.837-7.254 1.424-2.271 2.284-4.848 2.503-7.518-2.193-0.715-4.606-0.132-6.236 1.504z'></path> </svg>
${window.siyuan.languages.sponsor}
</a>
<div class="fn__hr--b"></div>
<div style="text-align: left">
${window.siyuan.languages.accountSupport1}
</div>
<div class="fn__hr--b"></div>
<div style="text-align: left">
${window.siyuan.languages.accountSupport2}
</div>
<div class="fn__hr--b"></div>`;
if (onlyPayHTML) {
return `<div class="ft__center">${payHTML}</div>`;
}

View file

@ -364,6 +364,7 @@ type ValueDate struct {
Content int64 `json:"content"`
IsNotEmpty bool `json:"isNotEmpty"`
HasEndDate bool `json:"hasEndDate"`
IsNotTime bool `json:"isNotTime"`
Content2 int64 `json:"content2"`
IsNotEmpty2 bool `json:"isNotEmpty2"`
FormattedContent string `json:"formattedContent"`
@ -376,10 +377,21 @@ const (
DateFormatDuration DateFormat = "duration"
)
func NewFormattedValueDate(content, content2 int64, format DateFormat) (ret *ValueDate) {
formatted := time.UnixMilli(content).Format("2006-01-02 15:04")
func NewFormattedValueDate(content, content2 int64, format DateFormat, isNotTime bool) (ret *ValueDate) {
var formatted string
if isNotTime {
formatted = time.UnixMilli(content).Format("2006-01-02")
} else {
formatted = time.UnixMilli(content).Format("2006-01-02 15:04")
}
if 0 < content2 {
formatted += " → " + time.UnixMilli(content2).Format("2006-01-02 15:04")
var formattedContent2 string
if isNotTime {
formattedContent2 = time.UnixMilli(content2).Format("2006-01-02")
} else {
formattedContent2 = time.UnixMilli(content2).Format("2006-01-02 15:04")
}
formatted += " → " + formattedContent2
}
switch format {
case DateFormatNone:
@ -392,6 +404,7 @@ func NewFormattedValueDate(content, content2 int64, format DateFormat) (ret *Val
Content: content,
Content2: content2,
HasEndDate: false,
IsNotTime: true,
FormattedContent: formatted,
}
return

View file

@ -1123,43 +1123,50 @@ func (table *Table) calcColDate(col *TableColumn, colIndex int) {
}
case CalcOperatorEarliest:
earliest := int64(0)
var isNotTime bool
for _, row := range table.Rows {
if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.Date && row.Cells[colIndex].Value.Date.IsNotEmpty {
if 0 == earliest || earliest > row.Cells[colIndex].Value.Date.Content {
earliest = row.Cells[colIndex].Value.Date.Content
isNotTime = row.Cells[colIndex].Value.Date.IsNotTime
}
}
}
if 0 != earliest {
col.Calc.Result = &Value{Date: NewFormattedValueDate(earliest, 0, DateFormatNone)}
col.Calc.Result = &Value{Date: NewFormattedValueDate(earliest, 0, DateFormatNone, isNotTime)}
}
case CalcOperatorLatest:
latest := int64(0)
var isNotTime bool
for _, row := range table.Rows {
if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.Date && row.Cells[colIndex].Value.Date.IsNotEmpty {
if 0 == latest || latest < row.Cells[colIndex].Value.Date.Content {
latest = row.Cells[colIndex].Value.Date.Content
isNotTime = row.Cells[colIndex].Value.Date.IsNotTime
}
}
}
if 0 != latest {
col.Calc.Result = &Value{Date: NewFormattedValueDate(latest, 0, DateFormatNone)}
col.Calc.Result = &Value{Date: NewFormattedValueDate(latest, 0, DateFormatNone, isNotTime)}
}
case CalcOperatorRange:
earliest := int64(0)
latest := int64(0)
var isNotTime bool
for _, row := range table.Rows {
if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.Date && row.Cells[colIndex].Value.Date.IsNotEmpty {
if 0 == earliest || earliest > row.Cells[colIndex].Value.Date.Content {
earliest = row.Cells[colIndex].Value.Date.Content
isNotTime = row.Cells[colIndex].Value.Date.IsNotTime
}
if 0 == latest || latest < row.Cells[colIndex].Value.Date.Content {
latest = row.Cells[colIndex].Value.Date.Content
isNotTime = row.Cells[colIndex].Value.Date.IsNotTime
}
}
}
if 0 != earliest && 0 != latest {
col.Calc.Result = &Value{Date: NewFormattedValueDate(earliest, latest, DateFormatDuration)}
col.Calc.Result = &Value{Date: NewFormattedValueDate(earliest, latest, DateFormatDuration, isNotTime)}
}
}
}

View file

@ -1946,7 +1946,7 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,
if nil != cell.Value {
if av.KeyTypeDate == cell.Value.Type {
if nil != cell.Value.Date {
cell.Value.Date = av.NewFormattedValueDate(cell.Value.Date.Content, cell.Value.Date.Content2, av.DateFormatNone)
cell.Value.Date = av.NewFormattedValueDate(cell.Value.Date.Content, cell.Value.Date.Content2, av.DateFormatNone, cell.Value.Date.IsNotTime)
}
} else if av.KeyTypeCreated == cell.Value.Type {
if nil != cell.Value.Created {