1 Commits

4 changed files with 8 additions and 27 deletions

View File

@@ -677,7 +677,7 @@ str = str.replace(regex, function (match, content, offset, fullString) {
});
mammoth.convertToHtml({ arrayBuffer }, {
convertImage: mammoth.images.inline(async function (image) {
console.log('image at line 163:', image)
const contentType = image.contentType.toLowerCase();
const allowedTypes = ['image/jpeg', 'image/jpg', 'image/png'];
if (!allowedTypes.includes(contentType)) {
@@ -1285,7 +1285,8 @@ str = str.replace(regex, function (match, content, offset, fullString) {
return html;
},
getCleanTextForCount (html) {
getCleanTextForCount(html) {
if (!html) return "";
const tempDiv = document.createElement('div');
tempDiv.innerHTML = html;

View File

@@ -3320,7 +3320,6 @@ export default {
},
async onDrop(event, dataId) {
if (event.dataTransfer.getData('image')) {
const loading = this.$loading({
lock: true,

View File

@@ -344,7 +344,7 @@ export default {
},
async questionSubmit() {
if (this.questionform.is_anonymous == '' && this.questionform.is_anonymous != '0') {
this.$message.error('Please choose disclose your name or remain anonymous.');
@@ -390,9 +390,8 @@ export default {
this.questionform.comment
];
Char_Cter = this.$commonJS.getCleanTextForCount(contents.join(' '));
console.log("🚀 ~ questionSubmit ~ Char_Cter:", Char_Cter);
if (new RegExp('[\\u4E00-\\u9FFF]+', 'g').test(Char_Cter)) {
//中文

View File

@@ -1595,16 +1595,6 @@ export default {
if (this.resizeObs) this.resizeObs.disconnect();
if (this.mutObs) this.mutObs.disconnect();
if (this._syncRefOrderTimer) clearTimeout(this._syncRefOrderTimer);
if (this._selectionSyncToCheckboxesTimer) clearTimeout(this._selectionSyncToCheckboxesTimer);
if (this._onDocumentSelectionChange) {
document.removeEventListener('selectionchange', this._onDocumentSelectionChange);
}
if (this._onDocumentMouseUp) {
document.removeEventListener('mouseup', this._onDocumentMouseUp);
}
if (this._onManuscriptMouseDown && this.$refs.scroll) {
this.$refs.scroll.removeEventListener('mousedown', this._onManuscriptMouseDown);
}
},
destroy() {
this.destroyTinymce();
@@ -3971,18 +3961,10 @@ renderCiteLabels(html) {
this.currentData = {};
this.manuscriptAutociteContext = null;
// 4. 仅当“没有按住鼠标连续拖选”时,才清理浏览器原生选区
// 按住拖选并滚动时保留选区,让用户可以持续扩展选中范围
// 4. 清除浏览器原生的文字选中蓝色区域
// 这样滚动时就不会有一大片蓝色的选区跟着走,视觉上更干净
const selection = window.getSelection();
const hasActiveRange = !!(selection && selection.rangeCount > 0 && !selection.isCollapsed);
const range = hasActiveRange ? selection.getRangeAt(0) : null;
const common = range ? range.commonAncestorContainer : null;
const commonElement = common && common.nodeType === 1 ? common : common && common.parentElement;
const inManuscript = !!(commonElement && this.$refs.scroll && this.$refs.scroll.contains(commonElement));
const shouldKeepSelection = this.isMouseSelecting && hasActiveRange && inManuscript;
if (shouldKeepSelection) {
this.scheduleSyncSelectedIdsFromRange();
} else if (selection) {
if (selection) {
selection.removeAllRanges();
}
// const scrollTop = scrollDiv.scrollTop; // 获取垂直滚动距离