Commit 349f9b5e by 庄欣

完成快速引用插件

parent a1dea566
...@@ -22,13 +22,12 @@ ...@@ -22,13 +22,12 @@
#__extend_fast_quote #__extend_fastquote_container #_____mp_fastquote { #__extend_fast_quote #__extend_fastquote_container #_____mp_fastquote {
position: fixed; position: fixed;
width: 500px; width: 60%;
height: 70%;
top: 10%; top: 10%;
z-index: 999; z-index: 999;
background-image: linear-gradient(125deg, rgb(239 223 143), rgb(235 209 84), rgb(122 60 25)); background-image: linear-gradient(125deg, rgb(239 223 143), rgb(235 209 84), rgb(122 60 25));
background-size: 400%; background-size: 400%;
left:calc((100% - 500px)/2); left: 20%;
color: #23283f; color: #23283f;
padding-top: 10px; padding-top: 10px;
} }
...@@ -82,7 +81,6 @@ ...@@ -82,7 +81,6 @@
border: 1px solid transparent; border: 1px solid transparent;
display: inline-block; display: inline-block;
padding: 6px 12px; padding: 6px 12px;
margin-bottom: 0;
font-size: 14px; font-size: 14px;
font-weight: normal; font-weight: normal;
line-height: 1.42857143; line-height: 1.42857143;
...@@ -99,4 +97,5 @@ ...@@ -99,4 +97,5 @@
background-image: none; background-image: none;
border-radius: 4px; border-radius: 4px;
color: #ffffff; color: #ffffff;
margin-bottom: 20px;
} }
\ No newline at end of file
<div id="_____mp_fastquote" class="row"> <div id="_____mp_fastquote" class="row">
<div class="" style="position: absolute;top: -24px;right: -24px;z-index: 9999;">
<img id="closeBtn" style="width: 48px;height: 48px;" >
</div>
<div class="col-12"> <div class="col-12">
<h4>添加有米使用记录</h4> <h4>添加有米使用记录</h4>
</div> </div>
......
...@@ -2,29 +2,43 @@ let ACCESS_TOKEN = ""; ...@@ -2,29 +2,43 @@ let ACCESS_TOKEN = "";
let host ="https://api.mepai.me/manage"; let host ="https://api.mepai.me/manage";
let UI = chrome.runtime.getURL("/html/index.html") let UI = chrome.runtime.getURL("/html/index.html")
let icon = chrome.runtime.getURL("/images/icon.png") let icon = chrome.runtime.getURL("/images/icon.png")
let closePng = chrome.runtime.getURL("/images/close.png")
let extendDom = document.createElement("div"); let extendDom = document.createElement("div");
extendDom.id = "__extend_fast_quote" extendDom.id = "__extend_fast_quote"
extendDom.innerHTML = "<div class='icon'><div><img src='" + icon + "'/></div></div>"; var iconDom = document.createElement("div")
iconDom.innerHTML = "<div><img src='" + icon + "'/></div>"
iconDom.setAttribute("class", "icon");
extendDom.appendChild(iconDom)
extendDom.style = "z-index:999;"; extendDom.style = "z-index:999;";
let isShow = false;
var body = document.getElementById("__nuxt"); var body = document.getElementById("__nuxt");
let container = document.createElement("div");
container.id = "__extend_fastquote_container";
container.style.display = "none";
iconDom.onclick = function () {
prop();
}
fetch(UI).then(function(res) { fetch(UI).then(function(res) {
return res.text(); return res.text();
}).then(html => { }).then(html => {
let container = document.createElement("div");
container.id = "__extend_fastquote_container";
container.innerHTML = html; container.innerHTML = html;
extendDom.appendChild(container) extendDom.appendChild(container)
body.appendChild(extendDom); body.appendChild(extendDom);
}).then(() => { var closeDom = document.getElementById("closeBtn");
closeDom.setAttribute("src", closePng);
}); closeDom.onclick = function () {
prop();
function showUi() { }
})
}
function hiddenUi() {
function prop() {
if (isShow) {
container.style.display = "none";
} else {
container.style.display = "block";
}
isShow = !isShow
} }
function getWorksId() { function getWorksId() {
...@@ -165,7 +179,6 @@ function goNext() { ...@@ -165,7 +179,6 @@ function goNext() {
var quoteCountDom = document.getElementById("quoteCount"); var quoteCountDom = document.getElementById("quoteCount");
var statusDom = document.getElementById("status"); var statusDom = document.getElementById("status");
var worksDom = document.getElementById("worksId"); var worksDom = document.getElementById("worksId");
getChannels(function(res) { getChannels(function(res) {
var channels = res; var channels = res;
for (var i in channels) { for (var i in channels) {
...@@ -175,7 +188,6 @@ function goNext() { ...@@ -175,7 +188,6 @@ function goNext() {
channelDom.appendChild(d) channelDom.appendChild(d)
} }
}); });
getManagers(function(res) { getManagers(function(res) {
var managers = res; var managers = res;
for (var i in managers) { for (var i in managers) {
...@@ -187,7 +199,6 @@ function goNext() { ...@@ -187,7 +199,6 @@ function goNext() {
}); });
todayInput.value = getToday(); todayInput.value = getToday();
worksDom.value = getWorksId(); worksDom.value = getWorksId();
var sendBtn = document.getElementById("send") var sendBtn = document.getElementById("send")
sendBtn.onclick = function () { sendBtn.onclick = function () {
var postData = { var postData = {
...@@ -208,7 +219,8 @@ function goNext() { ...@@ -208,7 +219,8 @@ function goNext() {
alert(res.message); alert(res.message);
return; return;
} }
alert("操作成功") alert("操作成功");
prop();
return ; return ;
}); });
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
{ {
"resources": [ "resources": [
"html/index.html", "html/index.html",
"images/icon.png" "images/icon.png",
"images/close.png"
], ],
"matches": [ "matches": [
"*://*.mepai.me/*" "*://*.mepai.me/*"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment