Skip to content

Commit

Permalink
enforce About DPlayer contextmenu
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Sep 2, 2017
1 parent 38c10cb commit cbcdda0
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dist/DPlayer.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/DPlayer.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/DPlayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/DPlayer.min.js.map

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions src/DPlayer.scss
Expand Up @@ -967,7 +967,6 @@
width: 32px;
height: 100%;
text-align: center;
display: inline-block;
font-size: 0;
vertical-align: middle;
float: right;
Expand Down Expand Up @@ -1048,19 +1047,25 @@

.dplayer-menu-item {
height: 30px;
padding: 5px 10px;
box-sizing: border-box;
cursor: pointer;

&:hover {
background-color: rgba(255,255,255,.1);
}

.dplayer-menu-label a {
a {
display: inline-block;
padding: 0 10px;
line-height: 30px;
color: #eee;
font-size: 13px;
display: inline-block;
vertical-align: middle;

&:hover {
text-decoration: none;
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/html.js
Expand Up @@ -165,7 +165,7 @@ const html = {
</div>
</div>
</div>
${html.contextmenuList(option.contextmenu)}
${html.contextmenuList(option.contextmenu, tran)}
<div class="dplayer-notice"></div>`;
},

Expand All @@ -179,10 +179,10 @@ const html = {
return result;
},

contextmenuList: (contextmenu) => {
contextmenuList: (contextmenu, tran) => {
let result = '<div class="dplayer-menu">';
for (let i = 0; i < contextmenu.length; i++) {
result += `<div class="dplayer-menu-item"><span class="dplayer-menu-label"><a target="_blank" href="${contextmenu[i].link}">${contextmenu[i].text}</a></span></div>`;
result += `<div class="dplayer-menu-item"><a target="_blank" href="${contextmenu[i].link}">${tran(contextmenu[i].text)}</a></div>`;
}
result += '</div>';

Expand Down
13 changes: 7 additions & 6 deletions src/option.js
Expand Up @@ -22,16 +22,12 @@ module.exports = (option) => {
video: {},
contextmenu: [
{
text: '关于作者',
text: 'About author',
link: 'http://diygod.me'
},
{
text: '播放器意见反馈',
text: 'DPlayer feedback',
link: 'https://github.com/DIYgod/DPlayer/issues'
},
{
text: '关于 DPlayer 播放器',
link: 'https://github.com/DIYgod/DPlayer'
}
]
};
Expand All @@ -55,5 +51,10 @@ module.exports = (option) => {
option.lang.toLowerCase();
}

option.contextmenu.push({
text: 'About DPlayer',
link: 'https://github.com/DIYgod/DPlayer'
});

return option;
};

0 comments on commit cbcdda0

Please sign in to comment.