Skip to content

Commit

Permalink
feat: 新增圣诞节头像挂件
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemon-cxh committed Dec 24, 2021
1 parent 7ab266c commit 4d8e07a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pwl-chat-extension",
"version": "0.2.6",
"version": "0.2.7",
"private": true,
"scripts": {
"serve": "vue-cli-service build --mode development --watch",
Expand Down
Binary file added public/image/Christmas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/components/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:src="message.userAvatarURL"
@click.native="$emit('showUserCard', message.userName)"
></el-avatar>
<img v-if="avatarPendant && avatarPendant.isChristmas" class="avatar-pendant" src="../../public/image/Christmas.png"/>
</el-row>
<el-row :class="(isOwn ? 'own-chat ' : '') + 'flex-column'" type="flex">
<el-row class="name">
Expand Down Expand Up @@ -103,6 +104,7 @@ export default {
message: Object,
date: String,
unlimitedRevoke: Boolean,
avatarPendant: Object
},
data() {
return {
Expand Down Expand Up @@ -186,6 +188,13 @@ export default {
padding: 5px;
width: 60px;
}
.avatar-pendant {
position: absolute;
top: -7px;
right: 9px;
width: 30px;
height: 30px;
}
.flex-column {
flex-direction: column;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Send.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ export default {
let quoteForm = this.quoteForm
form.content =
'引用 @' + this.buildAtUser(quoteForm.userName) +
'\n> ' +
'**引用** **@' + this.buildAtUser(quoteForm.userName) +
'**\n> ' +
(quoteForm.md ? quoteForm.md : quoteForm.content) +
'\n\n并说:' +
form.content
Expand Down
3 changes: 2 additions & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "摸鱼派聊天室",
"version": "0.2.6",
"version": "0.2.7",
"homepage_url": "https://github.com/Lemon-cxh/pwl-chat-extension",
"description": "摸鱼派聊天室插件",
"permissions": [
Expand Down Expand Up @@ -33,6 +33,7 @@
{
"matches": ["<all_urls>"],
"js": ["js/content-script.js"],
"css": ["css/content.css"],
"run_at": "document_start"
}
]
Expand Down
5 changes: 4 additions & 1 deletion src/views/ChatRoom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
:message="item"
:date="date"
:unlimitedRevoke="unlimitedRevoke"
:avatarPendant="avatarPendant"
@revokeMessage="revokeMessage"
@showUserCard="showUserCard"
@collectImages="collectImages"
Expand Down Expand Up @@ -110,6 +111,7 @@ export default {
online: {},
redPacketVisible: false,
type: MESSAGE_TYPE,
avatarPendant: {}
}
},
computed: {
Expand Down Expand Up @@ -171,6 +173,7 @@ export default {
}
})
this.port = port
this.avatarPendant.isChristmas = this.date.endsWith('12-24') || this.date.endsWith('12-25')
},
mounted() {
document.getElementById('messageList').oncontextmenu = () => {
Expand Down Expand Up @@ -248,7 +251,7 @@ export default {
process.env.VUE_APP_BASE_URL + '/forward?goto=',
''
)
window.open(decodeURIComponent(href))
dom.href = decodeURIComponent(href)
}
},
showUserCard(name) {
Expand Down
2 changes: 2 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ module.exports = {
browserExtension: {
components: {
background: true,
contentScripts: true
},
manifestSync: ['version'],
componentOptions: {
background: {
entry: './src/background/main.js'
Expand Down

0 comments on commit 4d8e07a

Please sign in to comment.