Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tools
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
tools
Commits
b728fee9
Commit
b728fee9
authored
Nov 24, 2022
by
庄欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成快速引用插件
parent
349f9b5e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
20 deletions
+22
-20
mp-fastquote/js/main.js
+22
-20
No files found.
mp-fastquote/js/main.js
View file @
b728fee9
...
...
@@ -143,26 +143,6 @@ var getToday = () => {
return
dt
.
getFullYear
()
+
"-"
+
month
+
"-"
+
day
;
}
function
getWorksIdByBase64
(
url
)
{
let
pre1
=
/
\w
orks
\/\S
*
\?
/g
;
let
pre2
=
/
\w
orks
\/\S
*
\?
*/g
;
if
(
url
.
indexOf
(
"?"
)
>
-
1
)
{
worksString
=
url
.
match
(
pre1
);
}
else
{
worksString
=
url
.
match
(
pre2
);
}
let
worksId
=
null
;
if
(
worksString
!==
undefined
&&
worksString
!==
null
&&
worksString
.
length
>
0
)
{
worksId
=
worksString
[
0
].
replace
(
"works/"
,
""
);
worksId
=
worksId
.
replace
(
"?"
,
""
);
worksId
=
this
.
base64Decode
(
worksId
);
}
this
.
objectId
=
worksId
;
this
.
type
=
TYPE_WORK
;
}
window
.
onload
=
function
()
{
chrome
.
runtime
.
sendMessage
({},
function
(
response
)
{
ACCESS_TOKEN
=
response
.
access_token
;
...
...
@@ -170,6 +150,25 @@ window.onload = function () {
});
}
function
loading
()
{
var
mask
=
document
.
createElement
(
"div"
);
mask
.
id
=
"____mask___"
;
mask
.
style
.
zIndex
=
9999
;
mask
.
style
.
width
=
"100%"
;
mask
.
style
.
height
=
"100%"
;
mask
.
style
.
position
=
"fixed"
;
mask
.
style
.
left
=
0
;
mask
.
style
.
top
=
0
;
mask
.
style
.
backgroundColor
=
"#000000"
;
mask
.
style
.
opacity
=
"80%"
;
body
.
appendChild
(
mask
);
}
function
removeLoading
()
{
var
mask
=
document
.
getElementById
(
"____mask___"
);
mask
.
remove
();
}
function
goNext
()
{
var
todayInput
=
document
.
getElementById
(
"today"
);
...
...
@@ -201,6 +200,7 @@ function goNext() {
worksDom
.
value
=
getWorksId
();
var
sendBtn
=
document
.
getElementById
(
"send"
)
sendBtn
.
onclick
=
function
()
{
loading
();
var
postData
=
{
"push_time"
:
todayInput
.
value
,
"channel_id"
:
channelDom
.
value
,
...
...
@@ -217,9 +217,11 @@ function goNext() {
sendData
(
host
+
"/works/pushrecord"
,
postData
,
(
res
)
=>
{
if
(
res
.
code
.
toString
()
!==
"100001"
)
{
alert
(
res
.
message
);
removeLoading
();
return
;
}
alert
(
"操作成功"
);
removeLoading
();
prop
();
return
;
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment