This commit is contained in:
杜恒 2021-05-28 10:15:19 +08:00
parent a6e28f92ec
commit 49aaf5899d
6 changed files with 19 additions and 9 deletions

View File

@ -398,7 +398,7 @@ document.addEventListener('DOMContentLoaded', () => {
this.options = {
type: /^success$|^info$|^warning$|^error$/.test(this.getAttribute('type')) ? this.getAttribute('type') : 'info',
content: _temp.innerHTML.trim().replace(/^(<br>)|(<br>)$/g, '') || '警告提示'
}
};
const htmlStr = `
<div class="joe_alert ${this.options.type}">
${this.options.content}
@ -537,10 +537,11 @@ document.addEventListener('DOMContentLoaded', () => {
constructor() {
super();
this.bvid = this.getAttribute('bvid');
this.page = this.getAttribute('page') && !Number.isNaN(this.getAttribute('page')) ? this.getAttribute('page') : 1;
this.render();
}
render() {
if (this.bvid) this.innerHTML = `<iframe allowfullscreen="true" class="joe_vplayer" src="//player.bilibili.com/player.html?bvid=${this.bvid}"></iframe>`;
if (this.bvid) this.innerHTML = `<iframe allowfullscreen="true" class="joe_vplayer" src="//player.bilibili.com/player.html?bvid=${this.bvid}&page=${this.page}"></iframe>`;
else this.innerHTML = 'Bvid未填写';
}
}

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
/* 获取主题当前版本号 */
function _getVersion()
{
return "7.1.4";
return "7.1.5";
};
/* 判断是否是手机 */

View File

@ -1,6 +1,6 @@
{
"name": "typecho-joe-next",
"version": "7.1.4",
"version": "7.1.5",
"description": "A Theme Of Typecho",
"main": "index.php",
"keywords": [

View File

@ -410,10 +410,15 @@ export default class JoeAction {
<label>视频Bvid</label>
<input autocomplete="off" name="bvid" placeholder="请输入视频Bvid"/>
</div>
<div class="fitem">
<label>视频选集</label>
<input autocomplete="off" name="page" placeholder="请输入视频选集"/>
</div>
`,
confirm: () => {
const bvid = $(".cm-modal input[name='bvid']").val();
const str = `\n{bilibili bvid="${bvid}"/}\n\n`;
const page = $(".cm-modal input[name='page']").val();
const str = `\n{bilibili bvid="${bvid}" page="${page}"/}\n\n`;
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
else this._replaceSelection(cm, str);
cm.focus();

File diff suppressed because one or more lines are too long