Vanessa 2023-01-24 15:05:25 +08:00
parent f1b302ee6b
commit c3d25353e2
7 changed files with 29 additions and 25 deletions

View file

@ -1,10 +1,17 @@
document.body.insertAdjacentHTML('afterBegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg"> document.body.insertAdjacentHTML('afterBegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
<defs> <defs>
<symbol id="iconCloudOff" viewBox="0 0 32 32"> <symbol id="iconCloud" viewBox="0 0 32 32">
<path d="M32 18.76c0-3.52-2.733-6.373-6.2-6.613-0.907-4.6-4.947-8.053-9.8-8.053-1.773 0-3.427 0.48-4.867 1.293l1.987 1.987c0.893-0.387 1.853-0.613 2.88-0.613 4.053 0 7.333 3.28 7.333 7.333v0.667h2c2.213 0 4 1.787 4 4 0 1.32-0.64 2.467-1.613 3.2l1.88 1.88c1.453-1.227 2.4-3.027 2.4-5.080zM5.88 3.907l-1.88 1.88 3.693 3.693h-0.56c-4.013 0.427-7.133 3.827-7.133 7.947 0 4.413 3.587 8 8 8h15.64l2.667 2.667 1.88-1.88-22.307-22.307zM8 22.76c-2.947 0-5.333-2.387-5.333-5.333s2.387-5.333 5.333-5.333h2.307l10.667 10.667h-12.973z"></path> <path d="M25.8 13.387c-0.907-4.6-4.947-8.053-9.8-8.053-3.853 0-7.187 2.187-8.853 5.387-4.013 0.427-7.147 3.813-7.147 7.947 0 4.413 3.587 8 8 8h17.333c3.68 0 6.667-2.987 6.667-6.667 0-3.52-2.733-6.373-6.2-6.613zM25.333 24h-17.333c-2.947 0-5.333-2.387-5.333-5.333s2.387-5.333 5.333-5.333 5.333 2.387 5.333 5.333h2.667c0-3.68-2.48-6.773-5.867-7.707 1.347-1.787 3.467-2.96 5.867-2.96 4.040 0 7.333 3.293 7.333 7.333v0.667h2c2.2 0 4 1.8 4 4s-1.8 4-4 4z"></path>
</symbol>
<symbol id="iconCloudSucc" viewBox="0 0 32 32">
<path d="M16 8c3.493 0 6.507 2.48 7.187 5.907l0.4 2 2.040 0.147c2.080 0.133 3.707 1.88 3.707 3.947 0 2.2-1.8 4-4 4h-17.333c-2.947 0-5.333-2.387-5.333-5.333 0-2.733 2.040-5.013 4.747-5.293l1.427-0.147 0.667-1.267c1.267-2.44 3.747-3.96 6.493-3.96zM16 5.333c-3.853 0-7.2 2.187-8.867 5.387-4.013 0.427-7.133 3.827-7.133 7.947 0 4.413 3.587 8 8 8h17.333c3.68 0 6.667-2.987 6.667-6.667 0-3.52-2.733-6.373-6.2-6.613-0.907-4.6-4.947-8.053-9.8-8.053z"></path>
</symbol> </symbol>
<symbol id="iconCloudSync" viewBox="0 0 32 32"> <symbol id="iconCloudSync" viewBox="0 0 32 32">
<path d="M28 20.768c-0.032 0-0.048 0-0.080 0.016-0.4-2.704-2.704-4.784-5.52-4.784-2.24 0-4.16 1.328-5.056 3.232-2.528 0.128-4.544 2.208-4.544 4.768 0 2.656 2.144 4.8 4.8 4.8l10.4-0.032c2.208 0 4-1.792 4-4s-1.792-4-4-4zM28.016 25.6v0h-10.416c-0.88 0-1.6-0.72-1.6-1.6s0.72-1.6 1.6-1.6h2v-0.4c0-1.552 1.248-2.8 2.8-2.8s2.8 1.248 2.8 2.8v2c0 0 2.8 0 2.816 0 0.448 0 0.8 0.352 0.8 0.8-0.016 0.432-0.368 0.8-0.8 0.8zM9.6 3.616v3.344c-3.728 1.328-6.4 4.864-6.4 9.040 0 2.832 1.248 5.344 3.2 7.104v-3.904h3.2v9.6h-9.6v-3.2h4.368c-2.672-2.336-4.368-5.76-4.368-9.6 0-5.968 4.080-10.96 9.6-12.384zM25.6 6.4h-4.368c2.288 2.016 3.856 4.816 4.256 8h-3.232c-0.368-2.176-1.488-4.080-3.056-5.504v3.904h-3.2v-9.6h9.6v3.2z"></path> <path d="M16 8c3.493 0 6.507 2.48 7.187 5.907l0.4 2 2.040 0.147c2.080 0.133 3.707 1.88 3.707 3.947 0 2.2-1.8 4-4 4h-17.333c-2.947 0-5.333-2.387-5.333-5.333 0-2.733 2.040-5.013 4.747-5.293l1.427-0.147 0.667-1.267c1.267-2.44 3.747-3.96 6.493-3.96zM16 5.333c-3.853 0-7.2 2.187-8.867 5.387-4.013 0.427-7.133 3.827-7.133 7.947 0 4.413 3.587 8 8 8h17.333c3.68 0 6.667-2.987 6.667-6.667 0-3.52-2.733-6.373-6.2-6.613-0.907-4.6-4.947-8.053-9.8-8.053z"></path>
<path d="M16 11.093v-1.84l-2.453 2.453 2.453 2.453v-1.84c2.030 0 3.68 1.65 3.68 3.68 0 0.619-0.153 1.208-0.429 1.717l0.895 0.895c0.478-0.754 0.761-1.65 0.761-2.613 0-2.711-2.196-4.907-4.907-4.907zM16 19.68c-2.030 0-3.68-1.65-3.68-3.68 0-0.619 0.153-1.208 0.429-1.717l-0.895-0.895c-0.478 0.754-0.761 1.65-0.761 2.613 0 2.711 2.196 4.907 4.907 4.907v1.84l2.453-2.453-2.453-2.453v1.84z"></path>
</symbol>
<symbol id="iconCloudOff" viewBox="0 0 32 32">
<path d="M32 18.76c0-3.52-2.733-6.373-6.2-6.613-0.907-4.6-4.947-8.053-9.8-8.053-1.773 0-3.427 0.48-4.867 1.293l1.987 1.987c0.893-0.387 1.853-0.613 2.88-0.613 4.053 0 7.333 3.28 7.333 7.333v0.667h2c2.213 0 4 1.787 4 4 0 1.32-0.64 2.467-1.613 3.2l1.88 1.88c1.453-1.227 2.4-3.027 2.4-5.080zM5.88 3.907l-1.88 1.88 3.693 3.693h-0.56c-4.013 0.427-7.133 3.827-7.133 7.947 0 4.413 3.587 8 8 8h15.64l2.667 2.667 1.88-1.88-22.307-22.307zM8 22.76c-2.947 0-5.333-2.387-5.333-5.333s2.387-5.333 5.333-5.333h2.307l10.667 10.667h-12.973z"></path>
</symbol> </symbol>
<symbol id="iconCloudError" viewBox="0 0 32 32"> <symbol id="iconCloudError" viewBox="0 0 32 32">
<path d="M14.866 19.922c0-0.619 0.502-1.12 1.12-1.12s1.12 0.502 1.12 1.12c0 0.619-0.502 1.12-1.12 1.12s-1.12-0.502-1.12-1.12z"></path> <path d="M14.866 19.922c0-0.619 0.502-1.12 1.12-1.12s1.12 0.502 1.12 1.12c0 0.619-0.502 1.12-1.12 1.12s-1.12-0.502-1.12-1.12z"></path>
@ -348,9 +355,6 @@ document.body.insertAdjacentHTML('afterBegin', `<svg style="position: absolute;
<symbol id="iconFile" viewBox="0 0 32 32"> <symbol id="iconFile" viewBox="0 0 32 32">
<path d="M28.236 8.021l-7.686-7.686c-0.214-0.214-0.504-0.336-0.807-0.336h-15.171c-0.632 0-1.143 0.511-1.143 1.143v29.714c0 0.632 0.511 1.143 1.143 1.143h22.857c0.632 0 1.143-0.511 1.143-1.143v-22.025c0-0.304-0.121-0.596-0.336-0.811zM25.936 9.357h-6.721v-6.721l6.721 6.721zM26 29.429h-20v-26.857h10.786v7.714c0 0.828 0.672 1.5 1.5 1.5v0h7.714v17.643z"></path> <path d="M28.236 8.021l-7.686-7.686c-0.214-0.214-0.504-0.336-0.807-0.336h-15.171c-0.632 0-1.143 0.511-1.143 1.143v29.714c0 0.632 0.511 1.143 1.143 1.143h22.857c0.632 0 1.143-0.511 1.143-1.143v-22.025c0-0.304-0.121-0.596-0.336-0.811zM25.936 9.357h-6.721v-6.721l6.721 6.721zM26 29.429h-20v-26.857h10.786v7.714c0 0.828 0.672 1.5 1.5 1.5v0h7.714v17.643z"></path>
</symbol> </symbol>
<symbol id="iconCloud" viewBox="0 0 32 32">
<path d="M16 8c3.493 0 6.507 2.48 7.187 5.907l0.4 2 2.040 0.147c2.080 0.133 3.707 1.88 3.707 3.947 0 2.2-1.8 4-4 4h-17.333c-2.947 0-5.333-2.387-5.333-5.333 0-2.733 2.040-5.013 4.747-5.293l1.427-0.147 0.667-1.267c1.267-2.44 3.747-3.96 6.493-3.96zM16 5.333c-3.853 0-7.2 2.187-8.867 5.387-4.013 0.427-7.133 3.827-7.133 7.947 0 4.413 3.587 8 8 8h17.333c3.68 0 6.667-2.987 6.667-6.667 0-3.52-2.733-6.373-6.2-6.613-0.907-4.6-4.947-8.053-9.8-8.053z"></path>
</symbol>
<symbol id="iconRight" viewBox="0 0 32 32"> <symbol id="iconRight" viewBox="0 0 32 32">
<path d="M25.528 14.936l-19.030-14.864c-0.057-0.045-0.129-0.072-0.208-0.072-0.186 0-0.336 0.151-0.336 0.336 0 0.001 0 0.001 0 0.002v-0 3.263c0 0.207 0.097 0.405 0.258 0.532l15.197 11.867-15.197 11.867c-0.165 0.127-0.258 0.325-0.258 0.532v3.263c0 0.283 0.325 0.439 0.545 0.266l19.030-14.864c0.317-0.249 0.519-0.633 0.519-1.064s-0.202-0.815-0.516-1.062l-0.003-0.002z"></path> <path d="M25.528 14.936l-19.030-14.864c-0.057-0.045-0.129-0.072-0.208-0.072-0.186 0-0.336 0.151-0.336 0.336 0 0.001 0 0.001 0 0.002v-0 3.263c0 0.207 0.097 0.405 0.258 0.532l15.197 11.867-15.197 11.867c-0.165 0.127-0.258 0.325-0.258 0.532v3.263c0 0.283 0.325 0.439 0.545 0.266l19.030-14.864c0.317-0.249 0.519-0.633 0.519-1.064s-0.202-0.815-0.516-1.062l-0.003-0.002z"></path>
</symbol> </symbol>

View file

@ -1,10 +1,17 @@
document.body.insertAdjacentHTML('afterbegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg"> document.body.insertAdjacentHTML('afterbegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
<defs> <defs>
<symbol id="iconCloud" viewBox="0 0 32 32">
<path d="M25.8 13.387c-0.907-4.6-4.947-8.053-9.8-8.053-3.853 0-7.187 2.187-8.853 5.387-4.013 0.427-7.147 3.813-7.147 7.947 0 4.413 3.587 8 8 8h17.333c3.68 0 6.667-2.987 6.667-6.667 0-3.52-2.733-6.373-6.2-6.613zM25.333 24h-17.333c-2.947 0-5.333-2.387-5.333-5.333s2.387-5.333 5.333-5.333 5.333 2.387 5.333 5.333h2.667c0-3.68-2.48-6.773-5.867-7.707 1.347-1.787 3.467-2.96 5.867-2.96 4.040 0 7.333 3.293 7.333 7.333v0.667h2c2.2 0 4 1.8 4 4s-1.8 4-4 4z"></path>
</symbol>
<symbol id="iconCloudSucc" viewBox="0 0 32 32">
<path d="M16 8c3.493 0 6.507 2.48 7.187 5.907l0.4 2 2.040 0.147c2.080 0.133 3.707 1.88 3.707 3.947 0 2.2-1.8 4-4 4h-17.333c-2.947 0-5.333-2.387-5.333-5.333 0-2.733 2.040-5.013 4.747-5.293l1.427-0.147 0.667-1.267c1.267-2.44 3.747-3.96 6.493-3.96zM16 5.333c-3.853 0-7.2 2.187-8.867 5.387-4.013 0.427-7.133 3.827-7.133 7.947 0 4.413 3.587 8 8 8h17.333c3.68 0 6.667-2.987 6.667-6.667 0-3.52-2.733-6.373-6.2-6.613-0.907-4.6-4.947-8.053-9.8-8.053z"></path>
</symbol>
<symbol id="iconCloudOff" viewBox="0 0 32 32"> <symbol id="iconCloudOff" viewBox="0 0 32 32">
<path d="M32 18.76c0-3.52-2.733-6.373-6.2-6.613-0.907-4.6-4.947-8.053-9.8-8.053-1.773 0-3.427 0.48-4.867 1.293l1.987 1.987c0.893-0.387 1.853-0.613 2.88-0.613 4.053 0 7.333 3.28 7.333 7.333v0.667h2c2.213 0 4 1.787 4 4 0 1.32-0.64 2.467-1.613 3.2l1.88 1.88c1.453-1.227 2.4-3.027 2.4-5.080zM5.88 3.907l-1.88 1.88 3.693 3.693h-0.56c-4.013 0.427-7.133 3.827-7.133 7.947 0 4.413 3.587 8 8 8h15.64l2.667 2.667 1.88-1.88-22.307-22.307zM8 22.76c-2.947 0-5.333-2.387-5.333-5.333s2.387-5.333 5.333-5.333h2.307l10.667 10.667h-12.973z"></path> <path d="M32 18.76c0-3.52-2.733-6.373-6.2-6.613-0.907-4.6-4.947-8.053-9.8-8.053-1.773 0-3.427 0.48-4.867 1.293l1.987 1.987c0.893-0.387 1.853-0.613 2.88-0.613 4.053 0 7.333 3.28 7.333 7.333v0.667h2c2.213 0 4 1.787 4 4 0 1.32-0.64 2.467-1.613 3.2l1.88 1.88c1.453-1.227 2.4-3.027 2.4-5.080zM5.88 3.907l-1.88 1.88 3.693 3.693h-0.56c-4.013 0.427-7.133 3.827-7.133 7.947 0 4.413 3.587 8 8 8h15.64l2.667 2.667 1.88-1.88-22.307-22.307zM8 22.76c-2.947 0-5.333-2.387-5.333-5.333s2.387-5.333 5.333-5.333h2.307l10.667 10.667h-12.973z"></path>
</symbol> </symbol>
<symbol id="iconCloudSync" viewBox="0 0 32 32"> <symbol id="iconCloudSync" viewBox="0 0 32 32">
<path d="M28 20.768c-0.032 0-0.048 0-0.080 0.016-0.4-2.704-2.704-4.784-5.52-4.784-2.24 0-4.16 1.328-5.056 3.232-2.528 0.128-4.544 2.208-4.544 4.768 0 2.656 2.144 4.8 4.8 4.8l10.4-0.032c2.208 0 4-1.792 4-4s-1.792-4-4-4zM28.016 25.6v0h-10.416c-0.88 0-1.6-0.72-1.6-1.6s0.72-1.6 1.6-1.6h2v-0.4c0-1.552 1.248-2.8 2.8-2.8s2.8 1.248 2.8 2.8v2c0 0 2.8 0 2.816 0 0.448 0 0.8 0.352 0.8 0.8-0.016 0.432-0.368 0.8-0.8 0.8zM9.6 3.616v3.344c-3.728 1.328-6.4 4.864-6.4 9.040 0 2.832 1.248 5.344 3.2 7.104v-3.904h3.2v9.6h-9.6v-3.2h4.368c-2.672-2.336-4.368-5.76-4.368-9.6 0-5.968 4.080-10.96 9.6-12.384zM25.6 6.4h-4.368c2.288 2.016 3.856 4.816 4.256 8h-3.232c-0.368-2.176-1.488-4.080-3.056-5.504v3.904h-3.2v-9.6h9.6v3.2z"></path> <path d="M16 8c3.493 0 6.507 2.48 7.187 5.907l0.4 2 2.040 0.147c2.080 0.133 3.707 1.88 3.707 3.947 0 2.2-1.8 4-4 4h-17.333c-2.947 0-5.333-2.387-5.333-5.333 0-2.733 2.040-5.013 4.747-5.293l1.427-0.147 0.667-1.267c1.267-2.44 3.747-3.96 6.493-3.96zM16 5.333c-3.853 0-7.2 2.187-8.867 5.387-4.013 0.427-7.133 3.827-7.133 7.947 0 4.413 3.587 8 8 8h17.333c3.68 0 6.667-2.987 6.667-6.667 0-3.52-2.733-6.373-6.2-6.613-0.907-4.6-4.947-8.053-9.8-8.053z"></path>
<path d="M16 11.093v-1.84l-2.453 2.453 2.453 2.453v-1.84c2.030 0 3.68 1.65 3.68 3.68 0 0.619-0.153 1.208-0.429 1.717l0.895 0.895c0.478-0.754 0.761-1.65 0.761-2.613 0-2.711-2.196-4.907-4.907-4.907zM16 19.68c-2.030 0-3.68-1.65-3.68-3.68 0-0.619 0.153-1.208 0.429-1.717l-0.895-0.895c-0.478 0.754-0.761 1.65-0.761 2.613 0 2.711 2.196 4.907 4.907 4.907v1.84l2.453-2.453-2.453-2.453v1.84z"></path>
</symbol> </symbol>
<symbol id="iconCloudError" viewBox="0 0 32 32"> <symbol id="iconCloudError" viewBox="0 0 32 32">
<path d="M14.866 19.922c0-0.619 0.502-1.12 1.12-1.12s1.12 0.502 1.12 1.12c0 0.619-0.502 1.12-1.12 1.12s-1.12-0.502-1.12-1.12z"></path> <path d="M14.866 19.922c0-0.619 0.502-1.12 1.12-1.12s1.12 0.502 1.12 1.12c0 0.619-0.502 1.12-1.12 1.12s-1.12-0.502-1.12-1.12z"></path>
@ -347,9 +354,6 @@ document.body.insertAdjacentHTML('afterbegin', `<svg style="position: absolute;
<symbol id="iconFile" viewBox="0 0 32 32"> <symbol id="iconFile" viewBox="0 0 32 32">
<path d="M19.2 0h-12.8c-1.76 0-3.184 1.44-3.184 3.2l-0.016 25.6c0 1.76 1.424 3.2 3.184 3.2h19.216c1.76 0 3.2-1.44 3.2-3.2v-19.2l-9.6-9.6zM6.4 28.8v-25.6h11.2v8h8v17.6h-19.2z"></path> <path d="M19.2 0h-12.8c-1.76 0-3.184 1.44-3.184 3.2l-0.016 25.6c0 1.76 1.424 3.2 3.184 3.2h19.216c1.76 0 3.2-1.44 3.2-3.2v-19.2l-9.6-9.6zM6.4 28.8v-25.6h11.2v8h8v17.6h-19.2z"></path>
</symbol> </symbol>
<symbol id="iconCloud" viewBox="0 0 32 32">
<path d="M16 8c3.493 0 6.507 2.48 7.187 5.907l0.4 2 2.040 0.147c2.080 0.133 3.707 1.88 3.707 3.947 0 2.2-1.8 4-4 4h-17.333c-2.947 0-5.333-2.387-5.333-5.333 0-2.733 2.040-5.013 4.747-5.293l1.427-0.147 0.667-1.267c1.267-2.44 3.747-3.96 6.493-3.96zM16 5.333c-3.853 0-7.2 2.187-8.867 5.387-4.013 0.427-7.133 3.827-7.133 7.947 0 4.413 3.587 8 8 8h17.333c3.68 0 6.667-2.987 6.667-6.667 0-3.52-2.733-6.373-6.2-6.613-0.907-4.6-4.947-8.053-9.8-8.053z"></path>
</symbol>
<symbol id="iconRight" viewBox="0 0 32 32"> <symbol id="iconRight" viewBox="0 0 32 32">
<path d="M6.125 28.25l12.25-12.25-12.25-12.25 3.75-3.75 16 16-16 16z"></path> <path d="M6.125 28.25l12.25-12.25-12.25-12.25 3.75-3.75 16 16-16 16z"></path>
</symbol> </symbol>

View file

@ -317,7 +317,10 @@ export const downloadProgress = (data: { id: string, percent: number }) => {
}; };
export const processSync = (data?: IWebSocketData) => { export const processSync = (data?: IWebSocketData) => {
const iconElement = document.querySelector("#barSync") const iconElement = document.querySelector(isMobile()?"#menuSyncNow" : "#barSync")
if (!iconElement) {
return;
}
const useElement = iconElement.querySelector("use") const useElement = iconElement.querySelector("use")
if (!data) { if (!data) {
if (!window.siyuan.config.sync.enabled || (0 === window.siyuan.config.sync.provider && needSubscribe(""))) { if (!window.siyuan.config.sync.enabled || (0 === window.siyuan.config.sync.provider && needSubscribe(""))) {
@ -326,7 +329,7 @@ export const processSync = (data?: IWebSocketData) => {
useElement.setAttribute("xlink:href", "#iconCloudOff") useElement.setAttribute("xlink:href", "#iconCloudOff")
} else { } else {
iconElement.classList.remove("toolbar__item--active"); iconElement.classList.remove("toolbar__item--active");
useElement.setAttribute("xlink:href", "#iconCloud") useElement.setAttribute("xlink:href", "#iconCloudSucc")
} }
return; return;
} }
@ -338,7 +341,7 @@ export const processSync = (data?: IWebSocketData) => {
useElement.setAttribute("xlink:href", "#iconCloudError") useElement.setAttribute("xlink:href", "#iconCloudError")
} else if (data.code === 1) { // success } else if (data.code === 1) { // success
iconElement.classList.remove("toolbar__item--active"); iconElement.classList.remove("toolbar__item--active");
useElement.setAttribute("xlink:href", "#iconCloud") useElement.setAttribute("xlink:href", "#iconCloudSucc")
} }
iconElement.setAttribute("aria-label", data.msg); iconElement.setAttribute("aria-label", data.msg);
} }

View file

@ -148,7 +148,7 @@ export const popMenu = () => {
<svg class="b3-list-item__graphic"><use xlink:href="#iconFilesRoot"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.newNotebook}</span> <svg class="b3-list-item__graphic"><use xlink:href="#iconFilesRoot"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.newNotebook}</span>
</div> </div>
<div class="b3-list-item b3-list-item--big" id="menuSyncNow"> <div class="b3-list-item b3-list-item--big" id="menuSyncNow">
<svg class="b3-list-item__graphic"><use xlink:href="#iconRefresh"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.syncNow}</span> <svg class="b3-list-item__graphic"><use xlink:href="#iconCloudSucc"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.syncNow}</span>
</div> </div>
<div class="b3-list-item b3-list-item--big${window.siyuan.config.readonly ? " fn__none" : ""}" id="menuHistory"> <div class="b3-list-item b3-list-item--big${window.siyuan.config.readonly ? " fn__none" : ""}" id="menuHistory">
<svg class="b3-list-item__graphic"><use xlink:href="#iconVideo"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.dataHistory}</span> <svg class="b3-list-item__graphic"><use xlink:href="#iconVideo"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.dataHistory}</span>

View file

@ -1,5 +1,5 @@
import {openMobileFileById} from "../editor"; import {openMobileFileById} from "../editor";
import {progressLoading, progressStatus, transactionError} from "../../dialog/processSystem"; import {processSync, progressLoading, progressStatus, transactionError} from "../../dialog/processSystem";
export const onMessage = (data: IWebSocketData) => { export const onMessage = (data: IWebSocketData) => {
if (data) { if (data) {
@ -8,14 +8,7 @@ export const onMessage = (data: IWebSocketData) => {
progressLoading(data); progressLoading(data);
break; break;
case"syncing": case"syncing":
if (document.querySelector("#menuSyncNow")) { processSync(data);
if (data.code === 0) {
document.querySelector("#menuSyncNow svg").classList.add("fn__rotate");
} else {
document.querySelector("#menuSyncNow svg").classList.remove("fn__rotate");
}
}
if (data.code !== 0) { if (data.code !== 0) {
document.getElementById("transactionTip").classList.add("fn__none") document.getElementById("transactionTip").classList.add("fn__none")
} }

View file

@ -280,7 +280,7 @@ export class Breadcrumb {
}).element); }).element);
window.siyuan.menus.menu.append(new MenuItem({ window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.uploadAssets2CDN, label: window.siyuan.languages.uploadAssets2CDN,
icon: "iconCloud", icon: "iconCloudSucc",
click() { click() {
if (!needSubscribe()) { if (!needSubscribe()) {
confirmDialog("📦 " + window.siyuan.languages.uploadAssets2CDN, window.siyuan.languages.uploadAssets2CDNConfirmTip, () => { confirmDialog("📦 " + window.siyuan.languages.uploadAssets2CDN, window.siyuan.languages.uploadAssets2CDNConfirmTip, () => {

View file

@ -187,7 +187,7 @@ const initBar = () => {
<svg class="toolbar__svg"><use xlink:href="#iconDown"></use></svg> <svg class="toolbar__svg"><use xlink:href="#iconDown"></use></svg>
</div> </div>
<div id="barSync" class="toolbar__item b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.config.sync.stat || (window.siyuan.languages.syncNow + " " + updateHotkeyTip(window.siyuan.config.keymap.general.syncNow.custom))}"> <div id="barSync" class="toolbar__item b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.config.sync.stat || (window.siyuan.languages.syncNow + " " + updateHotkeyTip(window.siyuan.config.keymap.general.syncNow.custom))}">
<svg><use xlink:href="#iconCloud"></use></svg> <svg><use xlink:href="#iconCloudSucc"></use></svg>
</div> </div>
<button id="barBack" data-menu="true" class="toolbar__item toolbar__item--disabled b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.languages.goBack} ${updateHotkeyTip(window.siyuan.config.keymap.general.goBack.custom)}"> <button id="barBack" data-menu="true" class="toolbar__item toolbar__item--disabled b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.languages.goBack} ${updateHotkeyTip(window.siyuan.config.keymap.general.goBack.custom)}">
<svg><use xlink:href="#iconBack"></use></svg> <svg><use xlink:href="#iconBack"></use></svg>