(
function
() {
'use strict'
;
/* globals jQuery, $, waitForKeyElements */
const $ = unsafeWindow.jQuery;
let
link = document.createElement(
'link'
);
link.rel =
"stylesheet"
link.href =
'https://cdnjs.cloudflare.com/ajax/libs/layui/2.9.3/css/layui.css'
;
document.head.appendChild(link);
$(
'.fixedbar'
).hide();
$(
'.anxs-left-bom'
).hide();
$(
'.web-tools'
).hide();
const Gmsg = JSON.parse(GM_getResourceText(
"Gmsg"
));
const help_content = GM_getResourceText(
"Content"
);
if
(GM_getValue(Gmsg.msg_id, -1) == -1 && Gmsg.msg_active != 0) {
layer.open({
type: 1,
offset: [
'16px'
,
'16px'
],
id:
'ID-demo-layer-offset-1'
,
content:
'<div style="padding: 16px;">'
+ Gmsg.msg_content +
'</div>'
,
area:
'240px'
,
title:
false
,
btn: [
'我已知悉,不在提示'
],
anim: 2,
btnAlign:
'c'
,
shade: 0,
btn1:
function
() {
GM_setValue(Gmsg.msg_id, 1);
layer.closeAll();
}
});
}
layui.use(
function
() {
var
util = layui.util;
var
bars = [{
type:
'help'
,
icon:
'layui-icon-app'
,
style:
'background-color: #1e9fff'
,
}, {
type:
'error'
,
icon:
'layui-icon-survey'
,
style:
'background-color:#ff5722;'
,
}, {
type:
'download'
,
icon:
'layui-icon-download-circle'
,
style:
'background-color: #5d9e2b;'
,
}, {
type:
'read'
,
icon:
'layui-icon-read'
,
style:
'background-color: #5d9e2b;'
,
}]
util.fixbar({
bars: bars,
default
:
false
,
css: { bottom: 200 },
on: {
mouseenter:
function
(type) {
let
C = {
'help'
:
"使用说明"
,
"download"
:
"下载文章"
,
'error'
:
"无法使用/错误上报"
,
"read"
:
"在线预览"
}
layer.tips(C[type],
this
, {
tips: 4,
fixed:
true
});
},
mouseleave:
function
(type) {
layer.closeAll(
'tips'
);
}
},
click:
function
(type) {
if
(type ==
'help'
) {
layer.open({
type: 1,
offset:
'l'
,
anim:
'slideRight'
,
area: [
'320px'
,
'100%'
],
shade: 0.1,
shadeClose:
true
,
id:
'ID-demo-layer-direction-l'
,
content: help_content
});
}
else
if
(type ==
'download'
) {
X_0585DE8();
}
else
if
(type ==
'read'
) {
X_0585DE8(
true
);
}
else
if
(type ==
'error'
){
D8568000DLP();
}
}
});
});
})();