Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
fix(bug): bug
Browse files Browse the repository at this point in the history
bug

fix #222, fix #355
  • Loading branch information
wpxp123456 committed Dec 17, 2020
1 parent 8918561 commit 54ae143
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/controllers/constant.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/controllers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -5547,6 +5547,19 @@ export default function luckysheetHandler() {
}
}
}
else if($(e.target).closest('#luckysheet-rich-text-editor').length > 0) {
// 阻止默认粘贴
e.preventDefault();

let clipboardData = window.clipboardData; //for IE
if (!clipboardData) { // for chrome
clipboardData = e.originalEvent.clipboardData;
}
let text = clipboardData.getData('text/plain');

// 插入
document.execCommand("insertText", false, text);
}
});

//是否允许加载下一页
Expand Down
4 changes: 4 additions & 0 deletions src/controllers/hyperlinkCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ const hyperlinkCtrl = {
let linkTooltip = $("#luckysheet-insertLink-dialog-linkTooltip").val();

if(linkType == 'external'){
if(!/^http[s]?:\/\//.test(linkAddress)){
linkAddress = 'https://' + linkAddress;
}

if(!/^http[s]?:\/\/([\w\-\.]+)+[\w-]*([\w\-\.\/\?%&=]+)?$/ig.test(linkAddress)){
tooltip.info('<i class="fa fa-exclamation-triangle"></i>', hyperlinkText.tooltipInfo1);
return;
Expand Down
3 changes: 3 additions & 0 deletions src/controllers/luckysheetConfigsetting.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ const luckysheetConfigsetting = {

defaultColWidth:73,
defaultRowHeight:19,

defaultTextColor: '#000',
defaultCellColor: '#fff',
}

export default luckysheetConfigsetting;
5 changes: 3 additions & 2 deletions src/controllers/menuButton.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { selectionCopyShow, selectIsOverlap } from './select';
import { luckyColor, iconfontObjects } from './constant';
import luckysheetConfigsetting from './luckysheetConfigsetting';
import luckysheetMoreFormat from './moreFormat';
import alternateformat from './alternateformat';
import conditionformat from './conditionformat';
Expand Down Expand Up @@ -584,7 +585,7 @@ const menuButton = {
togglePaletteLessText: locale_toolbar.collapse,
togglePaletteOnly: true,
clearText: locale_toolbar.clearText,
color:"#000",
color: luckysheetConfigsetting.defaultTextColor,
noColorSelectedText: locale_toolbar.noColorSelectedText,
localStorageKey: "spectrum.textcolor" + server.gridKey,
palette: [["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"],
Expand Down Expand Up @@ -716,7 +717,7 @@ const menuButton = {
showSelectionPalette: true,
maxPaletteSize: 8,
maxSelectionSize: 8,
color: "#fff",
color: luckysheetConfigsetting.defaultCellColor,
cancelText: locale_button.cancel,
chooseText: locale_button.confirm,
togglePaletteMoreText: locale_toolbar.customColor,
Expand Down

0 comments on commit 54ae143

Please sign in to comment.