-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #891 from Hi-Windom/v0.35
V0.35
- Loading branch information
Showing
27 changed files
with
438 additions
and
5,735 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
import {Dialog} from "../../dialog"; | ||
import {isMobile} from "../../util/functions"; | ||
import {fetchPost} from "../../util/fetch"; | ||
import {Constants} from "../../constants"; | ||
|
||
export const setAccessAuthCode = () => { | ||
window.sout.tracker("invoked"); | ||
const dialog = new Dialog({ | ||
title: window.siyuan.languages.about5, | ||
content: `<div class="b3-dialog__content"> | ||
<input class="b3-text-field fn__block" placeholder="${window.siyuan.languages.about5}" value="${window.siyuan.config.accessAuthCode}"> | ||
<div class="b3-label__text">${window.siyuan.languages.about6}</div> | ||
</div> | ||
<div class="b3-dialog__action"> | ||
<button class="b3-button b3-button--cancel">${window.siyuan.languages.cancel}</button><div class="fn__space"></div> | ||
<button class="b3-button b3-button--text">${window.siyuan.languages.confirm}</button> | ||
</div>`, | ||
width: isMobile() ? "92vw" : "520px", | ||
}); | ||
const inputElement = dialog.element.querySelector("input") as HTMLInputElement; | ||
const btnsElement = dialog.element.querySelectorAll(".b3-button"); | ||
dialog.element.setAttribute("data-key", Constants.DIALOG_ACCESSAUTHCODE); | ||
dialog.bindInput(inputElement, () => { | ||
(btnsElement[1] as HTMLButtonElement).click(); | ||
}); | ||
inputElement.select(); | ||
btnsElement[0].addEventListener("click", () => { | ||
dialog.destroy(); | ||
}); | ||
btnsElement[1].addEventListener("click", () => { | ||
fetchPost("/api/system/setAccessAuthCode", {accessAuthCode: inputElement.value}); | ||
if (window.JSAndroid) { window.JSAndroid.setMMKV("accessAuthCode", inputElement.value)} | ||
}); | ||
}; | ||
|
||
export const getCloudURL = (key: string) => { | ||
window.sout.tracker("invoked"); | ||
const origin = window.siyuan.config.cloudRegion === 0 ? "https://ld246.com" : "https://liuyun.io"; | ||
return `${origin}/${key}`; | ||
}; | ||
|
||
export const getIndexURL = (key: string) => { | ||
window.sout.tracker("invoked"); | ||
const lang = "zh_CN" === window.siyuan.config.lang ? "" : "/en"; | ||
return "https://b3log.org/siyuan" + `${lang}/${key}`; | ||
}; | ||
import {Dialog} from "../../dialog"; | ||
import {isMobile} from "../../util/functions"; | ||
import {fetchPost} from "../../util/fetch"; | ||
import {Constants} from "../../constants"; | ||
|
||
export const setAccessAuthCode = () => { | ||
window.sout.tracker("invoked"); | ||
const dialog = new Dialog({ | ||
title: window.siyuan.languages.about5, | ||
content: `<div class="b3-dialog__content"> | ||
<input class="b3-text-field fn__block" placeholder="${window.siyuan.languages.about5}" value="${window.siyuan.config.accessAuthCode}"> | ||
<div class="b3-label__text">${window.siyuan.languages.about6}</div> | ||
</div> | ||
<div class="b3-dialog__action"> | ||
<button class="b3-button b3-button--cancel">${window.siyuan.languages.cancel}</button><div class="fn__space"></div> | ||
<button class="b3-button b3-button--text">${window.siyuan.languages.confirm}</button> | ||
</div>`, | ||
width: isMobile() ? "92vw" : "520px", | ||
}); | ||
const inputElement = dialog.element.querySelector("input") as HTMLInputElement; | ||
const btnsElement = dialog.element.querySelectorAll(".b3-button"); | ||
dialog.element.setAttribute("data-key", Constants.DIALOG_ACCESSAUTHCODE); | ||
dialog.bindInput(inputElement, () => { | ||
(btnsElement[1] as HTMLButtonElement).click(); | ||
}); | ||
inputElement.select(); | ||
btnsElement[0].addEventListener("click", () => { | ||
dialog.destroy(); | ||
}); | ||
btnsElement[1].addEventListener("click", () => { | ||
fetchPost("/api/system/setAccessAuthCode", {accessAuthCode: inputElement.value}); | ||
if (window.JSAndroid) { window.JSAndroid.setKV("accessAuthCode", inputElement.value)} | ||
}); | ||
}; | ||
|
||
export const getCloudURL = (key: string) => { | ||
window.sout.tracker("invoked"); | ||
const origin = window.siyuan.config.cloudRegion === 0 ? "https://ld246.com" : "https://liuyun.io"; | ||
return `${origin}/${key}`; | ||
}; | ||
|
||
export const getIndexURL = (key: string) => { | ||
window.sout.tracker("invoked"); | ||
const lang = "zh_CN" === window.siyuan.config.lang ? "" : "/en"; | ||
return "https://b3log.org/siyuan" + `${lang}/${key}`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.