fix quotes format

This commit is contained in:
DIYgod 2018-06-13 23:10:57 +08:00
parent 0159d92f68
commit 248dc80f40
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
4 changed files with 14 additions and 14 deletions

View File

@ -24,7 +24,7 @@ const SendXMLHttpRequest = (url, data, success, error, fail) => {
};
xhr.open(data !== null ? 'POST' : 'GET', url, true);
xhr.setRequestHeader("Content-type", "application/json; charset=UTF-8");
xhr.setRequestHeader('Content-type', 'application/json; charset=UTF-8');
xhr.send(data !== null ? JSON.stringify(data) : null);
};

View File

@ -13,9 +13,9 @@ class Comment {
});
this.player.template.commentColorSettingBox.addEventListener('click', () => {
const sele = this.player.template.commentColorSettingBox.querySelector(`input:checked+span`);
const sele = this.player.template.commentColorSettingBox.querySelector('input:checked+span');
if (sele) {
const color = this.player.template.commentColorSettingBox.querySelector(`input:checked`).value;
const color = this.player.template.commentColorSettingBox.querySelector('input:checked').value;
this.player.template.commentSettingFill.style.fill = color;
this.player.template.commentInput.style.color = color;
this.player.template.commentSendFill.style.fill = color;

View File

@ -214,8 +214,8 @@ class Danmaku {
if (!dan[i].color) {
dan[i].color = '#fff';
}
const item = document.createElement(`div`);
item.classList.add(`dplayer-danmaku-item`);
const item = document.createElement('div');
item.classList.add('dplayer-danmaku-item');
item.classList.add(`dplayer-danmaku-${dan[i].type}`);
if (dan[i].border) {
item.innerHTML = `<span style="border:${dan[i].border}">${dan[i].text}</span>`;
@ -260,7 +260,7 @@ class Danmaku {
if (tunnel >= 0) {
// move
item.classList.add(`dplayer-danmaku-move`);
item.classList.add('dplayer-danmaku-move');
// insert
docFragment.appendChild(item);
@ -315,12 +315,12 @@ class Danmaku {
htmlEncode (str) {
return str.
replace(/&/g, "&amp;").
replace(/</g, "&lt;").
replace(/>/g, "&gt;").
replace(/"/g, "&quot;").
replace(/'/g, "&#x27;").
replace(/\//g, "&#x2f;");
replace(/&/g, '&amp;').
replace(/</g, '&lt;').
replace(/>/g, '&gt;').
replace(/"/g, '&quot;').
replace(/'/g, '&#x27;').
replace(/\//g, '&#x2f;');
}
resize () {

View File

@ -21,7 +21,7 @@ function i18n (lang) {
// add translation text here
const tranTxt = {
"zh-cn" : {
'zh-cn' : {
'Danmaku is loading': '弹幕加载中',
'Top': '顶部',
'Bottom': '底部',
@ -58,7 +58,7 @@ const tranTxt = {
'Live': '直播',
'Video info': '视频统计信息',
},
"zh-tw" : {
'zh-tw' : {
'Danmaku is loading': '彈幕加載中',
'Top': '頂部',
'Bottom': '底部',