微信对话生成器界面优化

try to take over the world!

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         微信对话生成器界面优化
// @namespace    https://penicillin.github.io/
// @version      0.1
// @description  try to take over the world!
// @author       静夜轻风
// @match        http://www.makepic.net/Tools/default/WXChat
// @license MIT
// ==/UserScript==

var tag=document.getElementsByClassName('slt-xinqi')[0];
var inp1=document.createElement('input');
var inp2=document.createElement('input');
var inp3=document.createElement('input');
var split1=document.createElement('span');
var split2=document.createElement('span');
var split3=document.createElement('span');

tag.style.display="none";

split1.innerText='年';
split2.innerText='月';
split3.innerText='日';

inp1.style.width='55px';
inp2.style.width='30px';
inp3.style.width='30px';
inp1.style.height='23px';
inp2.style.height='23px';
inp3.style.height='23px';

inp1.setAttribute('maxlength','4');
inp2.setAttribute('maxlength','2');
inp3.setAttribute('maxlength','2');

tag.previousSibling.appendChild(inp1);
tag.previousSibling.appendChild(split1);
tag.previousSibling.appendChild(inp2);
tag.previousSibling.appendChild(split2);
tag.previousSibling.appendChild(inp3);
tag.previousSibling.appendChild(split3);

function inpKeyUp(){
    if(inp1.value!=''&&inp2.value!=''&&inp3.value!=''){
    tag.options[0].value=inp1.value+'年'+inp2.value+'月'+inp3.value+'日';
}else{
    tag.options[0].value='-';
}
}
inp1.addEventListener('keyup',inpKeyUp);
inp2.addEventListener('keyup',inpKeyUp);
inp3.addEventListener('keyup',inpKeyUp);

var saveBtn=document.getElementById('save');
var saveBtnParent=saveBtn.parentElement;
saveBtnParent.innerHTML='';
saveBtnParent.append(saveBtn);