Compare commits

...
4 Commits
Author SHA1 Message Date
fyears 833fdee69e finnally we have a big version 0.4.10
Release A New Version / build (16.x) (push) Failing after 47s
2024-03-25 01:19:11 +08:00
fyears 936fce76a1 hack for status bar 2024-03-25 01:18:34 +08:00
fyears e2e8265d43 add https checking 2024-03-25 00:43:13 +08:00
fyears e228250613 round second to dropbox 2024-03-25 00:31:21 +08:00
11 changed files with 33 additions and 14 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "remotely-save", "id": "remotely-save",
"name": "Remotely Save", "name": "Remotely Save",
"version": "0.4.9", "version": "0.4.10",
"minAppVersion": "0.13.21", "minAppVersion": "0.13.21",
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.", "description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
"author": "fyears", "author": "fyears",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "remotely-save", "id": "remotely-save",
"name": "Remotely Save", "name": "Remotely Save",
"version": "0.3.40", "version": "0.4.10",
"minAppVersion": "0.13.21", "minAppVersion": "0.13.21",
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.", "description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
"author": "fyears", "author": "fyears",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "remotely-save", "name": "remotely-save",
"version": "0.4.9", "version": "0.4.10",
"description": "This is yet another sync plugin for Obsidian app.", "description": "This is yet another sync plugin for Obsidian app.",
"scripts": { "scripts": {
"dev2": "node esbuild.config.mjs --watch", "dev2": "node esbuild.config.mjs --watch",
+1 -1
View File
@@ -271,7 +271,7 @@
"setting_syncdirection_bidirectional_desc": "Bidirectional (default)", "setting_syncdirection_bidirectional_desc": "Bidirectional (default)",
"setting_syncdirection_incremental_push_only_desc": "Incremental Push Only (aka backup mode)", "setting_syncdirection_incremental_push_only_desc": "Incremental Push Only (aka backup mode)",
"setting_syncdirection_incremental_pull_only_desc": "Incremental Pull Only", "setting_syncdirection_incremental_pull_only_desc": "Incremental Pull Only",
"settings_enablemobilestatusbar": "Enable Mobile Status Bar Or Not", "settings_enablemobilestatusbar": "Mobile Status Bar (experimental)",
"settings_enablemobilestatusbar_desc": "By default Obsidian mobile hides status bar. But some users want to show it up. So here is a hack.", "settings_enablemobilestatusbar_desc": "By default Obsidian mobile hides status bar. But some users want to show it up. So here is a hack.",
"settings_importexport": "Import and Export Partial Settings", "settings_importexport": "Import and Export Partial Settings",
"settings_export": "Export", "settings_export": "Export",
+1 -1
View File
@@ -270,7 +270,7 @@
"setting_syncdirection_bidirectional_desc": "双向同步(默认)", "setting_syncdirection_bidirectional_desc": "双向同步(默认)",
"setting_syncdirection_incremental_push_only_desc": "只增量推送(也即:备份模式)", "setting_syncdirection_incremental_push_only_desc": "只增量推送(也即:备份模式)",
"setting_syncdirection_incremental_pull_only_desc": "只增量拉取", "setting_syncdirection_incremental_pull_only_desc": "只增量拉取",
"settings_enablemobilestatusbar": "是否显示手机的状态栏", "settings_enablemobilestatusbar": "手机的状态栏(实验性质)",
"settings_enablemobilestatusbar_desc": "Obsidian 手机版默认隐藏了状态栏。有些用户希望展示它。这里提供了设置选项。", "settings_enablemobilestatusbar_desc": "Obsidian 手机版默认隐藏了状态栏。有些用户希望展示它。这里提供了设置选项。",
"settings_importexport": "导入导出部分设置", "settings_importexport": "导入导出部分设置",
"settings_export": "导出", "settings_export": "导出",
+1 -1
View File
@@ -270,7 +270,7 @@
"setting_syncdirection_bidirectional_desc": "雙向同步(預設)", "setting_syncdirection_bidirectional_desc": "雙向同步(預設)",
"setting_syncdirection_incremental_push_only_desc": "只增量推送(也即:備份模式)", "setting_syncdirection_incremental_push_only_desc": "只增量推送(也即:備份模式)",
"setting_syncdirection_incremental_pull_only_desc": "只增量拉取", "setting_syncdirection_incremental_pull_only_desc": "只增量拉取",
"settings_enablemobilestatusbar": "是否顯示手機的狀態列", "settings_enablemobilestatusbar": "手機的狀態列(實驗性質)",
"settings_enablemobilestatusbar_desc": "Obsidian 手機版預設隱藏了狀態列。有些使用者希望展示它。這裡提供了設定選項。", "settings_enablemobilestatusbar_desc": "Obsidian 手機版預設隱藏了狀態列。有些使用者希望展示它。這裡提供了設定選項。",
"settings_importexport": "匯入匯出部分設定", "settings_importexport": "匯入匯出部分設定",
"settings_export": "匯出", "settings_export": "匯出",
+7 -2
View File
@@ -1,4 +1,4 @@
import { Vault } from "obsidian"; import { Platform, Vault } from "obsidian";
import * as path from "path"; import * as path from "path";
import { base32, base64url } from "rfc4648"; import { base32, base64url } from "rfc4648";
@@ -520,7 +520,12 @@ export const changeMobileStatusBar = (op: "enable" | "disable") => {
) as HTMLElement; ) as HTMLElement;
if (op === "enable") { if (op === "enable") {
bar.style.setProperty("display", "flex"); bar.style.setProperty("display", "flex");
bar.style.setProperty("margin-bottom", "40px"); const navBar = document.getElementsByClassName(
"mobile-navbar"
)[0] as HTMLElement;
// thanks to community's solution
const height = window.getComputedStyle(navBar).getPropertyValue("height");
bar.style.setProperty("margin-bottom", height);
} else { } else {
bar.style.removeProperty("display"); bar.style.removeProperty("display");
bar.style.removeProperty("margin-bottom"); bar.style.removeProperty("margin-bottom");
+2 -2
View File
@@ -483,8 +483,8 @@ export const uploadToRemote = async (
let ctime = 0; let ctime = 0;
const s = await vault?.adapter?.stat(fileOrFolderPath); const s = await vault?.adapter?.stat(fileOrFolderPath);
if (s !== undefined && s !== null) { if (s !== undefined && s !== null) {
mtime = Math.round(s.mtime / 1000.0) * 1000; mtime = Math.floor(s.mtime / 1000.0) * 1000;
ctime = Math.round(s.ctime / 1000.0) * 1000; ctime = Math.floor(s.ctime / 1000.0) * 1000;
} }
const mtimeStr = new Date(mtime).toISOString().replace(/\.\d{3}Z$/, "Z"); const mtimeStr = new Date(mtime).toISOString().replace(/\.\d{3}Z$/, "Z");
+8 -1
View File
@@ -22,7 +22,7 @@ import { buildQueryString } from "@smithy/querystring-builder";
import { HeaderBag, HttpHandlerOptions, Provider } from "@aws-sdk/types"; import { HeaderBag, HttpHandlerOptions, Provider } from "@aws-sdk/types";
import { Buffer } from "buffer"; import { Buffer } from "buffer";
import * as mime from "mime-types"; import * as mime from "mime-types";
import { Vault, requestUrl, RequestUrlParam } from "obsidian"; import { Vault, requestUrl, RequestUrlParam, Platform } from "obsidian";
import { Readable } from "stream"; import { Readable } from "stream";
import * as path from "path"; import * as path from "path";
import AggregateError from "aggregate-error"; import AggregateError from "aggregate-error";
@@ -770,6 +770,13 @@ export const checkConnectivity = async (
callbackFunc?: any callbackFunc?: any
) => { ) => {
try { try {
// TODO: no universal way now, just check this in connectivity
if (Platform.isIosApp && !s3Config.s3Endpoint.startsWith("https")) {
throw Error(
`Your s3 endpoint could only be https, not http, because of the iOS restriction.`
);
}
// const results = await s3Client.send( // const results = await s3Client.send(
// new HeadBucketCommand({ Bucket: s3Config.s3BucketName }) // new HeadBucketCommand({ Bucket: s3Config.s3BucketName })
// ); // );
+7
View File
@@ -228,6 +228,13 @@ export class WrappedWebdavClient {
if (this.client !== undefined) { if (this.client !== undefined) {
return; return;
} }
if (Platform.isIosApp && !this.webdavConfig.address.startsWith("https")) {
throw Error(
`Your webdav address could only be https, not http, because of the iOS restriction.`
);
}
const headers = { const headers = {
"Cache-Control": "no-cache", "Cache-Control": "no-cache",
}; };
+3 -3
View File
@@ -147,7 +147,7 @@ const copyEntityAndFixTimeFormat = (
if (result.mtimeCli === 0) { if (result.mtimeCli === 0) {
result.mtimeCli = undefined; result.mtimeCli = undefined;
} else { } else {
if (serviceType === "s3") { if (serviceType === "s3" || serviceType === "dropbox") {
// round to second instead of millisecond // round to second instead of millisecond
result.mtimeCli = Math.floor(result.mtimeCli / 1000.0) * 1000; result.mtimeCli = Math.floor(result.mtimeCli / 1000.0) * 1000;
} }
@@ -158,7 +158,7 @@ const copyEntityAndFixTimeFormat = (
if (result.mtimeSvr === 0) { if (result.mtimeSvr === 0) {
result.mtimeSvr = undefined; result.mtimeSvr = undefined;
} else { } else {
if (serviceType === "s3") { if (serviceType === "s3" || serviceType === "dropbox") {
// round to second instead of millisecond // round to second instead of millisecond
result.mtimeSvr = Math.floor(result.mtimeSvr / 1000.0) * 1000; result.mtimeSvr = Math.floor(result.mtimeSvr / 1000.0) * 1000;
} }
@@ -169,7 +169,7 @@ const copyEntityAndFixTimeFormat = (
if (result.prevSyncTime === 0) { if (result.prevSyncTime === 0) {
result.prevSyncTime = undefined; result.prevSyncTime = undefined;
} else { } else {
if (serviceType === "s3") { if (serviceType === "s3" || serviceType === "dropbox") {
// round to second instead of millisecond // round to second instead of millisecond
result.prevSyncTime = Math.floor(result.prevSyncTime / 1000.0) * 1000; result.prevSyncTime = Math.floor(result.prevSyncTime / 1000.0) * 1000;
} }