mirror of
https://github.com/kuaifan/dootask.git
synced 2026-08-01 19:05:55 +00:00
no message
This commit is contained in:
parent
9553e43fa8
commit
2686bfbf5e
@ -49,6 +49,7 @@ function genericPublish(url, version) {
|
|||||||
} else {
|
} else {
|
||||||
for (const filename of files) {
|
for (const filename of files) {
|
||||||
const localFile = path.join(filePath, filename)
|
const localFile = path.join(filePath, filename)
|
||||||
|
if (fse.existsSync(localFile)) {
|
||||||
const fileStat = fs.statSync(localFile)
|
const fileStat = fs.statSync(localFile)
|
||||||
if (fileStat.isFile()) {
|
if (fileStat.isFile()) {
|
||||||
const uploadOra = ora(`${filename} uploading...`).start()
|
const uploadOra = ora(`${filename} uploading...`).start()
|
||||||
@ -74,6 +75,7 @@ function genericPublish(url, version) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "DooTask",
|
"name": "DooTask",
|
||||||
"version": "0.13.36",
|
"version": "0.13.38",
|
||||||
"description": "DooTask is task management system.",
|
"description": "DooTask is task management system.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "./cmd dev",
|
"start": "./cmd dev",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
8670e2bbf86722cc
|
964ec56060e5c9b0
|
||||||
|
|||||||
@ -1004,6 +1004,40 @@
|
|||||||
window.scrollIntoView(element, options)
|
window.scrollIntoView(element, options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 等比缩放尺寸
|
||||||
|
* @param width
|
||||||
|
* @param height
|
||||||
|
* @param maxWidth
|
||||||
|
* @param maxHeight
|
||||||
|
* @returns {{width, height}|{width: number, height: number}}
|
||||||
|
*/
|
||||||
|
scaleToScale(width, height, maxWidth, maxHeight) {
|
||||||
|
let tempWidth;
|
||||||
|
let tempHeight;
|
||||||
|
if (width > 0 && height > 0) {
|
||||||
|
if (width / height >= maxWidth / maxHeight) {
|
||||||
|
if (width > maxWidth) {
|
||||||
|
tempWidth = maxWidth;
|
||||||
|
tempHeight = (height * maxWidth) / width;
|
||||||
|
} else {
|
||||||
|
tempWidth = width;
|
||||||
|
tempHeight = height;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (height > maxHeight) {
|
||||||
|
tempHeight = maxHeight;
|
||||||
|
tempWidth = (width * maxHeight) / height;
|
||||||
|
} else {
|
||||||
|
tempWidth = width;
|
||||||
|
tempHeight = height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {width: parseInt(tempWidth), height: parseInt(tempHeight)};
|
||||||
|
}
|
||||||
|
return {width, height};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -174,6 +174,21 @@ export default {
|
|||||||
}
|
}
|
||||||
text = text.trim().replace(/(\n\x20*){3,}/g, "\n\n");
|
text = text.trim().replace(/(\n\x20*){3,}/g, "\n\n");
|
||||||
text = text.replace(/\{\{RemoteURL\}\}/g, $A.apiUrl('../'))
|
text = text.replace(/\{\{RemoteURL\}\}/g, $A.apiUrl('../'))
|
||||||
|
const array = text.match(/<img\s+[^>]*?>/g);
|
||||||
|
if (array) {
|
||||||
|
const widthReg = new RegExp("width=\"(\\d+)\"")
|
||||||
|
const heightReg = new RegExp("height=\"(\\d+)\"")
|
||||||
|
array.some(res => {
|
||||||
|
if (widthReg.test(res) && heightReg.test(res)) {
|
||||||
|
let width = parseInt(res.match(widthReg)[1]),
|
||||||
|
height = parseInt(res.match(heightReg)[1]),
|
||||||
|
maxSize = res.indexOf("emoticon") > -1 ? 150 : 220;
|
||||||
|
let scale = $A.scaleToScale(width, height, maxSize, maxSize);
|
||||||
|
let value = res.replace(widthReg, `width=${scale.width}`).replace(heightReg, `height=${scale.height}`)
|
||||||
|
text = text.replace(res, value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
return text;
|
return text;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -290,7 +305,7 @@ export default {
|
|||||||
} else if (type === 'text') {
|
} else if (type === 'text') {
|
||||||
const baseUrl = $A.apiUrl('../');
|
const baseUrl = $A.apiUrl('../');
|
||||||
const array = msg.text.match(/<img\s+class="browse"[^>]*?src="(.*?)"[^>]*?>/g);
|
const array = msg.text.match(/<img\s+class="browse"[^>]*?src="(.*?)"[^>]*?>/g);
|
||||||
array.some(res => {
|
array && array.some(res => {
|
||||||
list.push(res.match(/<img\s+class="browse"[^>]*?src="(.*?)"[^>]*?>/)[1].replace(/\{\{RemoteURL\}\}/g, baseUrl))
|
list.push(res.match(/<img\s+class="browse"[^>]*?src="(.*?)"[^>]*?>/)[1].replace(/\{\{RemoteURL\}\}/g, baseUrl))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user