Skip to content

Commit

Permalink
print values
Browse files Browse the repository at this point in the history
  • Loading branch information
shenghuang147 committed May 13, 2024
1 parent b0f2f17 commit aa28a8c
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions js/plugin_juicity/juicity.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,31 @@ class juicityClass {
this.sharedStorage[k] = v;
}
}
neko.logError(
"_initDefaultSharedStorage: \n" +
"defaultSharedStorage: \n"
+ JSON.stringify(this.defaultSharedStorage) + "\n" +
"sharedStorage: \n" +
JSON.stringify(this.sharedStorage)
)
}

_onSharedStorageUpdated() {
neko.logError(
"_onSharedStorageUpdated[First]: \n" +
JSON.stringify(this.sharedStorage) + "\n"
)
// not null
for (var k in this.sharedStorage) {
if (this.sharedStorage[k] == null) {
this.sharedStorage[k] = "";
}
}
this._setShareLink();
neko.logError(
"_onSharedStorageUpdated[end]: \n" +
JSON.stringify(this.sharedStorage) + "\n"
)
}

// 生成并存储 share link
Expand All @@ -63,6 +78,10 @@ class juicityClass {
builder.searchParams.set("pinned_certchain_sha256", this.sharedStorage.pinnedCertchainSha256)
}
this.sharedStorage.shareLink = builder.toString()
neko.logError(
"_setShareLink[end]: \n" +
JSON.stringify(this.sharedStorage) + "\n"
)
}

// UI Interface
Expand Down Expand Up @@ -138,13 +157,27 @@ class juicityClass {
setSharedStorage(b64Str) {
this.sharedStorage = util.decodeB64Str(b64Str);
this._initDefaultSharedStorage();
neko.logError(
"setSharedStorage[end]: \n" +
JSON.stringify(this.sharedStorage) + "\n"
)
}

// 开启设置界面时调用
requireSetProfileCache() {
neko.logError(
"requireSetProfileCache()[first]: \n" +
JSON.stringify(this.sharedStorage) + "\n" +
JSON.stringify(this.common.typeMap) + "\n"
)
for (var k in this.defaultSharedStorage) {
this.common.setKV(k, this.sharedStorage[k]);
}
neko.logError(
"requireSetProfileCache()[end]: \n" +
JSON.stringify(this.sharedStorage) + "\n" +
JSON.stringify(this.common.typeMap) + "\n"
)
}
// 开启设置界面时调用

Expand All @@ -160,10 +193,22 @@ class juicityClass {

// 保存时调用(混合编辑后的值)
sharedStorageFromProfileCache() {
neko.logError(
"sharedStorageFromProfileCache[first]: \n" +
JSON.stringify(this.sharedStorage) + "\n"
)
for (var k in this.defaultSharedStorage) {
this.sharedStorage[k] = this.common.getKV(k);
}
neko.logError(
"sharedStorageFromProfileCache[center]: \n" +
JSON.stringify(this.sharedStorage) + "\n"
)
this._onSharedStorageUpdated();
neko.logError(
"sharedStorageFromProfileCache[end]: \n" +
JSON.stringify(this.sharedStorage) + "\n"
)
return JSON.stringify(this.sharedStorage);
}

Expand Down

0 comments on commit aa28a8c

Please sign in to comment.