From 09ccfafe53e295b960ad67279c716b9acb34d154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E6=81=92?= <2323333339@qq.com> Date: Tue, 30 Mar 2021 14:29:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/js/joe.short.js | 64 +- assets/js/joe.short.min.js | 2 +- core/factory.php | 1 + core/function.php | 2 +- core/short.php | 11 +- package.json | 2 +- typecho/write/css/joe.write.min.css | 2 +- typecho/write/css/joe.write.min.scss | 14 +- typecho/write/js/_actions.js | 31 + typecho/write/js/_create.js | 10 +- typecho/write/js/_tools.js | 265 +- typecho/write/js/joe.short.js | 27 + typecho/write/js/joe.short.min.js | 1 + typecho/write/js/joe.write.chunk.js | 14215 ++++++++++++++++++++++++- typecho/write/js/joe.write.js | 10 +- typecho/write/package.json | 90 +- typecho/write/rollup.config.js | 2 +- 17 files changed, 14504 insertions(+), 245 deletions(-) create mode 100644 typecho/write/js/joe.short.js create mode 100644 typecho/write/js/joe.short.min.js diff --git a/assets/js/joe.short.js b/assets/js/joe.short.js index f2b693b..95d55ed 100644 --- a/assets/js/joe.short.js +++ b/assets/js/joe.short.js @@ -1,4 +1,30 @@ document.addEventListener('DOMContentLoaded', () => { + /* 网易云音乐 - 歌单 √ */ + class JoeMlist extends HTMLElement { + constructor() { + super(); + this.options = { + id: this.getAttribute('id'), + width: this.getAttribute('width') || '100%', + autoplay: this.getAttribute('autoplay') ? 1 : 0 + }; + this.render(); + } + get template() { + return ` + + + `; + } + render() { + this.innerHTML = ''; + this._shadowRoot = this.attachShadow({ mode: 'closed' }); + if (this.options.id) this._shadowRoot.innerHTML = this.template; + else this._shadowRoot.innerHTML = '网易云歌单ID未填写!'; + } + } + window.customElements.define('joe-mlist', JoeMlist); + /* 网易云音乐 - 单首 - 已测试 √ */ class JoeMusic extends HTMLElement { constructor() { @@ -245,44 +271,6 @@ document.addEventListener('DOMContentLoaded', () => { * */ - /* 网易云音乐 - 歌单 */ - class JoeMlist extends HTMLElement { - constructor() { - super(); - this.options = { - id: this.getAttribute('id'), - width: this.getAttribute('width') || '100%', - height: this.getAttribute('height') || '450px', - autoplay: this.getAttribute('autoplay') ? 1 : 0 - }; - this.render(); - } - get template() { - return ` - -