Other-baiduzhushou

百度经验助手

名称:百度经验助手

匹配规则:https://jingyan.baidu.com/edit/content*

脚本:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
'use strict';
//修改标题和图标
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = 'https://blog.iexxk.com/images/favicon-32x32-next.png';
document.getElementsByTagName('head')[0].appendChild(link);
document.title = '经验笔记编辑';
//隐藏不用的元素
document.getElementById("js_float_high_quality_wrap").style.visibility = "hidden";
document.getElementById("header").style.display = "none";
document.querySelector("div.wgt-benefit").style.display = "none";
document.querySelector("div.video-guide-left").style.visibility = "hidden";
//检测敏感词汇
var eb=new Array("女人","代理");
var bz = document.querySelector(".ca-step-item");
bz.onclick = function(){
for (const v of eb) {
var dom = $(':contains('+v+')').filter(function(){
return $(this).text()==v;
});
dom.css("color","red");
}
}
// 格式化输入内容,加租加句号
var ed= document.querySelectorAll('.edui-body-container');
var submit = document.querySelector(".release-btn");
var catalogListUl =document.getElementById("catalogList"); //在左侧悬浮窗生成发布
var li =document.createElement("li"); //createElement生成button对象
var input =document.createElement("input"); //createElement生成input对象
input.style="width:96px;";
li.innerHTML = '发布';
li.onclick = function(){
var ed= document.querySelectorAll('.edui-body-container');
for(var inp of ed){
var lp= inp.lastElementChild;
var fp= inp.firstElementChild;
if(lp.textContent.indexOf(",") == -1){ //不包含逗号,进行格式话
lp.textContent="在“"+lp.textContent+"”界面,点击“"+fp.textContent+"”按钮。";
fp.textContent="点击“"+fp.textContent+"”";
}
if(!lp.textContent.endsWith('。')){ //不包含句话,添加句号
lp.textContent=lp.textContent+"。";
}
if(inp.id != 'editor-brief'){ //加粗
var b=document.createElement("strong");
b.textContent=fp.textContent;
fp.textContent="";
fp.appendChild(b);
}
inp.focus();
}

input.focus();
submit.click();
}
catalogListUl.appendChild(li);
catalogListUl.appendChild(input);
//添加下拉软件选择
function soft(input){
var s=input[4];
s.setAttribute("list","soft");
var l=document.createElement("datalist");
l.setAttribute("id","soft");
var opvs=new Map();
opvs.set("微信","8.0.20");
opvs.set("QQ","v8.8.85.636");
opvs.set("kubesphere","v3.1.0");
opvs.set("国家医保服务平台","v1.3.7");
opvs.set("Zepp Life","6.0.3");
opvs.set("米家","v7.4.203");
opvs.set("支付宝","10.2.60");
opvs.set("访达","12.3");
opvs.set("Confluence","6.14.1");
opvs.set("IDEA","2022.1.1");
opvs.set("热血航线","1.7.1");
opvs.set("铁路12306","5.5.0.18");
opvs.set("网易云音乐","8.7.35");
opvs.set("保卫萝卜3","2.2.4");
opvs.set("微信读书","6.2.3");
opvs.set("闲鱼","7.4.80");
opvs.set("哔哩哔哩","6.71.0");
opvs.set("Apifox","2.0.2");
opvs.set("DaVinci Resolve studio 17","17.2.2");
opvs.set("中国银行","7.3.2");
opvs.set("炉石传说","23.2.138759");
opvs.set("云闪付","9.1.3");
opvs.set("必剪","2.13.0");
opvs.set("自动操作","2.10");
for (const v of opvs.keys()) {
var op= document.createElement("option");
op.setAttribute("value",v);
l.appendChild(op);
}
s.appendChild(l);
s.onchange = function() {
console.log(s.value);
input[5].value=opvs.get(s.value);
input[5].focus();
}
}
// 添加类型选择事件
var ss = document.getElementById("category").querySelectorAll("select")[2]; //获取第二个下拉选择框
ss.onchange = function() { //监听下拉框选择事件
console.log(ss.value);
if (ss.value == 16) { //电脑
var pcInput= document.getElementById("js-software-list").querySelectorAll("input");
pcInput[0].focus();
pcInput[0].value = "macOS Monterey";
pcInput[1].focus();
pcInput[1].value = "12.2.1";
pcInput[2].focus();
pcInput[2].value = "MacBook Pro";
pcInput[3].focus();
pcInput[3].value = "2017";
//添加下拉软件选择
soft(pcInput);
} else if (ss.value == 20||ss.value == 32) { //手机
var phoneInput= document.getElementById("js-software-list").querySelectorAll("input");
phoneInput[0].focus();
phoneInput[0].value = "iOS";
phoneInput[1].focus();
phoneInput[1].value = "15.4.1";
phoneInput[2].focus();
phoneInput[2].value = "iPhone";
phoneInput[3].focus();
phoneInput[3].value = "13";
//添加下拉软件选择
soft(phoneInput);
}
document.getElementById("is-origin").click();//自动勾选原创
document.querySelector("input[name='title']").focus();
};