Skip to content

Commit

Permalink
Merge commit '76570e2f1b72de50cb54c36229447eea69c59940' into pro
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Mar 1, 2024
2 parents 60e6003 + 76570e2 commit 47832ec
Show file tree
Hide file tree
Showing 14 changed files with 112 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Publish Desktop
name: Publish Mac

on:
push:
tags:
- 'v*'

jobs:
build:
Build:
runs-on: macos-latest
environment: build

Expand All @@ -29,5 +29,6 @@ jobs:
DP_KEY: ${{ secrets.DP_KEY }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_REPOSITORY: ${{ github.repository }}
run: ./cmd electron all
run: |
./cmd electron mac
30 changes: 30 additions & 0 deletions .github/workflows/publish-desktop-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Win

on:
push:
tags:
- 'v*'

jobs:
Build:
runs-on: windows-latest
environment: build

if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Build
env:
DP_KEY: ${{ secrets.DP_KEY }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_REPOSITORY: ${{ github.repository }}
shell: bash
run: |
./cmd electron win
6 changes: 4 additions & 2 deletions electron/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,11 @@ if (["dev"].includes(argv[2])) {
notarize: false,
}
}, false, false)
} else if (["all"].includes(argv[2])) {
} else if (["all", "win", "mac"].includes(argv[2])) {
// 自动编译
platforms.forEach(platform => {
platforms.filter(p => {
return argv[2] === "all" || p.indexOf(argv[2]) !== -1
}).forEach(platform => {
config.app.forEach(data => {
data.configure = {
platform,
Expand Down
10 changes: 10 additions & 0 deletions electron/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const spawn = require("child_process").spawn;
const isMac = process.platform === 'darwin'
const isWin = process.platform === 'win32'
const allowedUrls = /^(?:https?|mailto|tel|callto):/i;
const allowedCalls = /^(?:mailto|tel|callto):/i;
let enableStoreBkp = true;
let dialogOpen = false;
let enablePlugins = false;
Expand Down Expand Up @@ -74,6 +75,9 @@ function createMainWindow() {
const originalUA = mainWindow.webContents.session.getUserAgent() || mainWindow.webContents.getUserAgent()
mainWindow.webContents.setUserAgent(originalUA + " MainTaskWindow/" + process.platform + "/" + os.arch() + "/1.0");
mainWindow.webContents.setWindowOpenHandler(({url}) => {
if (allowedCalls.test(url)) {
return {action: 'allow'}
}
utils.onBeforeOpenWindow(mainWindow.webContents, url).then(() => {
openExternal(url)
})
Expand Down Expand Up @@ -184,6 +188,9 @@ function createSubWindow(args) {
const originalUA = browser.webContents.session.getUserAgent() || browser.webContents.getUserAgent()
browser.webContents.setUserAgent(originalUA + " SubTaskWindow/" + process.platform + "/" + os.arch() + "/1.0" + (args.userAgent ? (" " + args.userAgent) : ""));
browser.webContents.setWindowOpenHandler(({url}) => {
if (allowedCalls.test(url)) {
return {action: 'allow'}
}
utils.onBeforeOpenWindow(browser.webContents, url).then(() => {
openExternal(url)
})
Expand Down Expand Up @@ -361,6 +368,9 @@ function createWebWindow(args) {
height: (webWindow.getContentBounds().height || 800) - webTabHeight,
})
browserView.webContents.setWindowOpenHandler(({url}) => {
if (allowedCalls.test(url)) {
return {action: 'allow'}
}
createWebWindow({url})
return {action: 'deny'}
})
Expand Down
4 changes: 2 additions & 2 deletions electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@electron-forge/maker-squirrel": "^7.3.0",
"@electron-forge/maker-zip": "^7.3.0",
"dotenv": "^16.3.1",
"electron": "^29.0.1",
"electron": "^29.1.0",
"electron-builder": "^24.12.0",
"electron-notarize": "^1.2.2",
"form-data": "^4.0.0",
Expand All @@ -45,7 +45,7 @@
"electron-log": "^5.1.1",
"electron-screenshots-tool": "^1.1.2",
"electron-squirrel-startup": "^1.0.0",
"electron-updater": "^6.1.7",
"electron-updater": "^6.1.8",
"fs-extra": "^11.2.0",
"pdf-lib": "^1.17.1",
"request": "^2.88.2"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"css-loader": "^6.7.2",
"dexie": "^3.2.3",
"echarts": "^5.2.2",
"element-sea": "^2.15.10-6",
"element-sea": "^2.15.10-7",
"file-loader": "^6.2.0",
"highlight.js": "^11.7.0",
"inquirer": "^8.2.0",
Expand All @@ -49,7 +49,7 @@
"quill": "^1.3.7",
"quill-mention-hi": "^3.1.0-4",
"resolve-url-loader": "^4.0.0",
"sass": "~1.32.13",
"sass": "^1.71.1",
"sass-loader": "^12.6.0",
"stylus": "^0.59.0",
"stylus-loader": "^7.1.0",
Expand Down
8 changes: 5 additions & 3 deletions public/site/css/download.css
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,15 @@
}
.download-other-btn{
padding: 10px 16px;
color: var(--txt-gray-color);
opacity: .7;
border-radius: 8px;
margin-top: 64px;
margin-bottom: 100px;
}
.download-other-btn:hover{
.download-other-btn span {
opacity: 0.7;
color: var(--txt-gray-color);
}
.download-other-btn:hover span {
color: var(--txt-theme-color);
opacity: 1;
}
5 changes: 5 additions & 0 deletions public/site/css/log.css
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@
.logs-sticky{
position: sticky;
top: 80px;
height: calc(100vh - 136px);
}
#help-l-ul{
overflow-y: auto;
height: calc(100% - 36px);
}
.footer-layut{
border-top: var(--border-color) solid 1px;
Expand Down
2 changes: 1 addition & 1 deletion public/site/en/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ <h4 class="txt-4001830 topics-h4 mb-64 topics-h4-en">Also supports iOS, Android,
</a>
</li>
</ul>
<a class="download-other-btn" href="https://www.dootask.com/desktop/publish/latest" target="_blank">Other Versions</a>
<a class="download-other-btn dow-animate-box" style="--delay: 0.5s;" href="https://www.dootask.com/desktop/publish/latest" target="_blank"><span>Other Versions</span></a>
</div>
</div>
</div>
Expand Down
12 changes: 12 additions & 0 deletions public/site/en/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,18 @@ <h6 class="txt-4001624 help-h6">
"[data-id='" + `section-${i}` + "']"
);
elementsWithDataId[0]?.classList?.add("active");
//滚动设置
const liHight = elementsWithDataId[0]?.offsetTop;
const pHihtt = elementsWithDataId[0]?.parentNode.parentNode.offsetHeight;
const ulElement = document.getElementById('help-l-ul'); // 替换为你的 <div> 元素的 id
const scrollHeight = ulElement.scrollTop;
const ulHeight = ulElement.offsetHeight;
if (liHight > scrollHeight + ulHeight) {
ulElement.scrollTop += (pHihtt + 24);
}
if (liHight < scrollHeight) {
ulElement.scrollTop -= (pHihtt + 24);
}
return;
}
}
Expand Down
12 changes: 12 additions & 0 deletions public/site/en/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,18 @@ <h1 class="txt-6003645 logs-h1 mb-36">DooTask Update Log </h1>
rm()
let elementsWithDataId = document.querySelectorAll("[data-id='" + `section-${i}` + "']");
elementsWithDataId[1]?.classList?.add("active");
//滚动设置
const liHight = elementsWithDataId[1]?.offsetTop;
const pHihtt = elementsWithDataId[1]?.offsetHeight;
const ulElement = document.getElementById('help-l-ul'); // 替换为你的 <div> 元素的 id
const scrollHeight = ulElement.scrollTop;
const ulHeight = ulElement.offsetHeight;
if (liHight > scrollHeight + ulHeight) {
ulElement.scrollTop += (pHihtt + pHihtt);
}
if (liHight < scrollHeight) {
ulElement.scrollTop -= (pHihtt + pHihtt);
}
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion public/site/zh/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ <h4 class="txt-4001830 topics-h4 mb-64">同时支持iOS、Android、macOS、Wind
</a>
</li>
</ul>
<a class="download-other-btn" href="https://www.dootask.com/desktop/publish/latest" target="_blank">其他版本</a>
<a class="download-other-btn dow-animate-box" style="--delay: 0.5s;" href="https://www.dootask.com/desktop/publish/latest" target="_blank"><span>其他版本</span></a>
</div>
</div>
</div>
Expand Down
12 changes: 12 additions & 0 deletions public/site/zh/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,18 @@ <h6 class="txt-4001624 help-h6">在DooTask页面左侧点击【文件】,勾
if (arrOffsetTop[i] > window.scrollY){
let elementsWithDataId = document.querySelectorAll("[data-id='" + `section-${i}` + "']");
elementsWithDataId[0]?.classList?.add("active");
//滚动设置
const liHight = elementsWithDataId[0]?.offsetTop;
const pHihtt = elementsWithDataId[0]?.parentNode.parentNode.offsetHeight;
const ulElement = document.getElementById('help-l-ul'); // 替换为你的 <div> 元素的 id
const scrollHeight = ulElement.scrollTop;
const ulHeight = ulElement.offsetHeight;
if (liHight > scrollHeight + ulHeight) {
ulElement.scrollTop += (pHihtt + 24);
}
if (liHight < scrollHeight) {
ulElement.scrollTop -= (pHihtt + 24);
}
return;
}
}
Expand Down
12 changes: 12 additions & 0 deletions public/site/zh/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,18 @@ <h1 class="txt-6003645 logs-h1 mb-36">DooTask更新日志</h1>
rm()
let elementsWithDataId = document.querySelectorAll("[data-id='" + `section-${i}` + "']");
elementsWithDataId[1]?.classList?.add("active");
//滚动设置
const liHight = elementsWithDataId[1]?.offsetTop;
const pHihtt = elementsWithDataId[1]?.offsetHeight;
const ulElement = document.getElementById('help-l-ul'); // 替换为你的 <div> 元素的 id
const scrollHeight = ulElement.scrollTop;
const ulHeight = ulElement.offsetHeight;
if (liHight > scrollHeight + ulHeight) {
ulElement.scrollTop += (pHihtt + pHihtt);
}
if (liHight < scrollHeight) {
ulElement.scrollTop -= (pHihtt + pHihtt);
}
return;
}
}
Expand Down

0 comments on commit 47832ec

Please sign in to comment.