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
f25b83b3
Commit
f25b83b3
authored
Sep 30, 2019
by
罗超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/madara
parents
665ae7bc
9ef4771b
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 @
f25b83b3
...
@@ -475,9 +475,6 @@ export default {
...
@@ -475,9 +475,6 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
this
.
MsgBus
.
$on
(
'change-historic'
,
function
(){
console
.
log
(
"asdasd 哈哈哈哈"
)
})
this
.
audio_base
=
this
.
$electron
.
remote
.
getGlobal
(
"AUDIO_PATH"
)
+
'audio/'
this
.
audio_base
=
this
.
$electron
.
remote
.
getGlobal
(
"AUDIO_PATH"
)
+
'audio/'
if
(
window
.
localStorage
.
top
)
{
if
(
window
.
localStorage
.
top
)
{
this
.
TOPSESSION
=
JSON
.
parse
(
window
.
localStorage
.
top
);
this
.
TOPSESSION
=
JSON
.
parse
(
window
.
localStorage
.
top
);
...
...
src/renderer/components/tools/contenteditor.vue
View file @
f25b83b3
...
@@ -244,6 +244,8 @@ export default {
...
@@ -244,6 +244,8 @@ export default {
offMsgBusListener(){
offMsgBusListener(){
this.MsgBus.$off("
send
-
at
-
name
");
this.MsgBus.$off("
send
-
at
-
name
");
this.MsgBus.$off("
new
-
screen
-
hot
");
this.MsgBus.$off("
new
-
screen
-
hot
");
this.$electron.ipcRenderer.removeAllListeners(['new-send-file'])
let _this = this;
},
},
toolPaste: function (e) {
toolPaste: function (e) {
let clipboardData = 1;
let clipboardData = 1;
...
@@ -278,7 +280,6 @@ export default {
...
@@ -278,7 +280,6 @@ export default {
innerHTML: sessionText
innerHTML: sessionText
})
})
}
}
this.MsgBus.$emit('change-historic')
window.localStorage.historicList = JSON.stringify(historicList)
window.localStorage.historicList = JSON.stringify(historicList)
},
},
updateClipboard() {
updateClipboard() {
...
@@ -291,47 +292,55 @@ export default {
...
@@ -291,47 +292,55 @@ export default {
};
};
a.readAsDataURL(blob);
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() {
initClip() {
let that = this;
let that = this;
document
document
.querySelector("
#
msgEditorBox
")
.querySelector("
#
msgEditorBox
")
.addEventListener("
paste
", function(event) {
.removeEventListener("
paste
", that.NextClip, true);
var clipboardData = event.clipboardData;
setTimeout(()=>{
var items, item, types;
document
if (clipboardData) {
.querySelector("
#
msgEditorBox
")
items = clipboardData.items;
.addEventListener("
paste
", that.NextClip);
if (!items || items.length == 0) {
}, 20)
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);
}
}
}
});
},
},
createImage(dataurl){
createImage(dataurl){
var strLen = dataurl.length;
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