Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Madara
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
Madara
Commits
9ef4771b
Commit
9ef4771b
authored
Sep 30, 2019
by
华国豪
🙄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
1d7fc82c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
41 deletions
+47
-41
index.vue
src/renderer/components/msssage/index.vue
+0
-3
contenteditor.vue
src/renderer/components/tools/contenteditor.vue
+47
-38
No files found.
src/renderer/components/msssage/index.vue
View file @
9ef4771b
...
...
@@ -456,9 +456,6 @@ export default {
}
},
mounted
()
{
this
.
MsgBus
.
$on
(
'change-historic'
,
function
(){
console
.
log
(
"asdasd 哈哈哈哈"
)
})
this
.
audio_base
=
this
.
$electron
.
remote
.
getGlobal
(
"AUDIO_PATH"
)
+
'audio/'
if
(
window
.
localStorage
.
top
)
{
this
.
TOPSESSION
=
JSON
.
parse
(
window
.
localStorage
.
top
);
...
...
src/renderer/components/tools/contenteditor.vue
View file @
9ef4771b
...
...
@@ -244,6 +244,8 @@ export default {
offMsgBusListener(){
this.MsgBus.$off("
send
-
at
-
name
");
this.MsgBus.$off("
new
-
screen
-
hot
");
this.$electron.ipcRenderer.removeAllListeners(['new-send-file'])
let _this = this;
},
toolPaste: function (e) {
let clipboardData = 1;
...
...
@@ -278,7 +280,6 @@ export default {
innerHTML: sessionText
})
}
this.MsgBus.$emit('change-historic')
window.localStorage.historicList = JSON.stringify(historicList)
},
updateClipboard() {
...
...
@@ -291,47 +292,55 @@ export default {
};
a.readAsDataURL(blob);
},
NextClip(event){
console.log(123)
let that = this;
var clipboardData = event.clipboardData;
var items, item, types;
if (clipboardData) {
items = clipboardData.items;
if (!items || items.length == 0) {
that.$electron.ipcRenderer.send("
read
-
clip
");
return false;
} else {
// 保存在剪贴板中的数据类型
types = clipboardData.types || [];
for (var i = 0; i < types.length; i++) {
if (types[i] === "
Files
") {
item = items[i];
break;
}
}
if (
item &&
item.kind === "
file
" &&
item.type.match(/^image
\
//i)
) {
// 读取该图片
var file = item.getAsFile(),
reader = new FileReader(),
name = "";
if (item.type.match(/^image
\
//i))
name = `截图_${Date.parse(new Date())}.png`;
reader.onload = function(e) {
that.createImage(e.target.result)
};
reader.readAsDataURL(file);
}
}
}
},
initClip() {
let that = this;
document
.querySelector("
#
msgEditorBox
")
.addEventListener("
paste
", function(event) {
var clipboardData = event.clipboardData;
var items, item, types;
if (clipboardData) {
items = clipboardData.items;
if (!items || items.length == 0) {
that.$electron.ipcRenderer.send("
read
-
clip
");
return false;
} else {
// 保存在剪贴板中的数据类型
types = clipboardData.types || [];
for (var i = 0; i < types.length; i++) {
if (types[i] === "
Files
") {
item = items[i];
break;
}
}
if (
item &&
item.kind === "
file
" &&
item.type.match(/^image
\
//i)
) {
// 读取该图片
var file = item.getAsFile(),
reader = new FileReader(),
name = "";
if (item.type.match(/^image
\
//i))
name = `截图_${Date.parse(new Date())}.png`;
reader.onload = function(e) {
that.createImage(e.target.result)
};
reader.readAsDataURL(file);
}
}
}
});
.removeEventListener("
paste
", that.NextClip, true);
setTimeout(()=>{
document
.querySelector("
#
msgEditorBox
")
.addEventListener("
paste
", that.NextClip);
}, 20)
},
createImage(dataurl){
var strLen = dataurl.length;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment