From f941d9d2621e3900c0bade6f808c1c30ab081a5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A5=87=E8=B6=A3=E4=BF=9D=E7=BD=97?=
 <dreamer_paul@126.com>
Date: Tue, 10 Dec 2019 22:04:06 +0800
Subject: [PATCH] Update API
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

更新接口,允许修改原有的配置文件并通过 init(true) 方法进行刷新
---
 static/pio.js | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/static/pio.js b/static/pio.js
index 50056f4..38c1f2d 100644
--- a/static/pio.js
+++ b/static/pio.js
@@ -2,7 +2,7 @@
 
 # Pio Plugin
 # By: Dreamer-Paul
-# Last Update: 2019.8.18
+# Last Update: 2019.12.10
 
 一个支持更换 Live2D 模型的 Typecho 插件。
 
@@ -11,6 +11,7 @@
 ---- */
 
 var Paul_Pio = function (prop) {
+    this.prop = prop;
     var current = {
         idol: 0,
         menu: document.querySelector(".pio-container .pio-action"),
@@ -238,12 +239,15 @@ var Paul_Pio = function (prop) {
     };
 
     // 运行
-    this.init = function () {
+    this.init = function (onlyText) {
         if(prop.hidden === true && window.innerWidth < 400){
             current.body.classList.add("hidden");
         }
         else{
-            action.welcome();
+            if(!onlyText){
+                action.welcome();
+                loadlive2d("pio", prop.model[0]);
+            }
 
             switch (prop.mode){
                 case "static": begin.static(); break;
@@ -252,8 +256,6 @@ var Paul_Pio = function (prop) {
             }
 
             if(prop.content.custom) action.custom();
-
-            loadlive2d("pio", prop.model[0]);
         }
     };
     this.init();