remove the posts which make you sick

移除讨厌鬼的帖子

目前為 2015-08-16 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name remove the posts which make you sick
  3. // @author burningall
  4. // @description 移除讨厌鬼的帖子
  5. // @version 2015.8.16
  6. // @include *tieba.baidu.com/p/*
  7. // @include *tieba.baidu.com/*
  8. // @include *tieba.baidu.com/f?*
  9. // @grant GM_addStyle
  10. // @grant GM_getValue
  11. // @grant GM_setValue
  12. // @grant GM_listValues
  13. // @grant GM_deleteValue
  14. // @run-at document-start
  15. // @compatible chrome 推荐
  16. // @compatible firefox 不再继续兼容火狐渣
  17. // @license The MIT License (MIT); http://opensource.org/licenses/MIT
  18. // @supportURL http://www.burningall.com
  19. // @contributionURL troy450409405@gmail.com|alipay.com
  20. // @namespace https://greasyfork.org/zh-CN/users/3400-axetroy
  21. // ==/UserScript==
  22. //
  23. /*
  24. 不再继续兼容火狐渣,受不了了。
  25. 外观极丑臃肿,还得自定义css,美其名曰叫DIY,SimpleWhite主题+Yosemite样式都拯救不了他的外观。
  26. 最符合W3C标准,然而又有很多特立独行的特性,其叫丰富的API。
  27. 自由、安全、随心,低内存占用。殊不知几个扩展分分钟卡死。“哎呀,浏览器崩溃了【报告给Mozila】”,至于快速一说,更是无稽之谈。
  28. 还有喜闻乐见的flash~~~~!,没用过firefox的,根本不知道什么叫flash崩溃。
  29. 不但如此,页面渲染和表现力简直烂到爆,说实话,IE11都比不上。
  30. 还有流氓行径,卸载不干净,美其名曰叫用户体验,用户下次安装的时候,那些扩展,书签等,就不用再同步了。
  31. ……………………………………
  32. 忍无可忍,卸载了~~!
  33. */
  34. (function(window,document){
  35. //==============默认配置==============
  36. var defaultdConfig = {
  37. 'blockWay': '遮罩屏蔽', //遮罩屏蔽或删除节点
  38. 'color': '#ffffff', //遮罩颜色
  39. 'opacity': '0.8', //遮罩透明度
  40. 'blurpx': '3', //高斯模糊大小
  41. };
  42. //==============TQuery=================
  43. function $(tArg){
  44. return new TQuery(tArg);
  45. }
  46. function TQuery(tArg){
  47. this.arg = tArg;//保存传进来的参数
  48. this.elements = [];//用来保存选择的元素
  49. this.doc = document;
  50. switch( typeof tArg ){
  51. case "undefined" :
  52. return this;
  53. case "function" :
  54. addEvent(window,'load',tArg);
  55. break;
  56. case "string" :
  57. var aElems = this.doc.querySelectorAll(tArg);
  58. for(var i=0;i<aElems.length;i++){
  59. this.elements.push(aElems[i]);
  60. }
  61. break;
  62. case "object" : //对象
  63. this.elements.push(tArg);
  64. break;
  65. }
  66. this.length = this.elements.length;
  67. }
  68. TQuery.prototype.find = function(str){
  69. var childElements = [];//存放临时数据
  70. for(var i=0;i<this.length;i++){
  71. var aElems = this.elements[i].querySelectorAll(str);
  72. var length = aElems.length;
  73. var j =0;
  74. while(j<length){
  75. childElements.push( aElems[j] );
  76. j++;
  77. }
  78. }
  79. this.elements = childElements;
  80. this.length = childElements.length;//返回新的长度
  81. return this;
  82. };
  83. TQuery.prototype.click = function(fn){
  84. var length = this.elements.length;
  85. for(var i=0;i<length;i++){
  86. addEvent(this.elements[i],'click',fn);
  87. }
  88. return this;//返回对象,进行链式操作
  89. };
  90. TQuery.prototype.bind = function(type,fn){
  91. if(arguments.length==1){//如果只传一个json参数e
  92. for(var k=0;k<this.length;k++){
  93. for(var attr in type){
  94. addEvent(this.elements[k],attr,type[attr]);
  95. }
  96. }
  97. }else{//如果传两个参数,则统一执行一个e
  98. var events = type.split(' ');
  99. var eventsLength = events.length;
  100. for(var i=0;i<this.length;i++){
  101. var j=0;
  102. while(j<eventsLength){
  103. addEvent(this.elements[i],events[j],fn);
  104. j++;
  105. }
  106. }
  107. }
  108. return this;//返回对象,进行链式操作
  109. };
  110. TQuery.prototype.on = function(type,fn){
  111. if(arguments.length==1){//如果只传一个json参数
  112. for(var k=0;k<this.length;k++){
  113. for(var attr in type){
  114. this.elements[k][ 'on'+attr ] = type[attr];
  115. }
  116. }
  117. }else{//如果传两个参数e,fn
  118. var events = type.split(' ');//获取每个事件
  119. var eventsLength = events.length;
  120. for(var i=0;i<this.length;i++){
  121. var j =0;
  122. while(j<eventsLength){
  123. this.elements[i][ 'on'+events[j] ] = fn;
  124. j++;
  125. }
  126. }
  127. }
  128. return this;//返回对象,进行链式操作
  129. };
  130. TQuery.prototype.toggle = function(){
  131. var _arguments = arguments;
  132. var length = _arguments.length;
  133. var count = 0;
  134. for(var i=0;i<this.length;i++){
  135. var _this = this.elements[i];
  136. this.on('click',function(){
  137. _arguments[count++%length].call(_this);//执行 ,解决this错误的问题
  138. });
  139. }
  140. return this;//返回对象,进行链式操作
  141. };
  142. TQuery.prototype.each = function(fn){
  143. for(var i=0;i<this.length;i++){
  144. var _this = this.elements[i];
  145. fn.call(_this);
  146. }
  147. return this;
  148. };
  149. TQuery.prototype.css = function(attr,value){
  150. var type = /^(width|left|top|bottom|right|line-height|font-size)+/ig;
  151. var type2 = /^(height|margin|padding)+/ig;
  152. var type3 = /\d+(px)/ig;
  153. var type4 = /\:/ig;
  154. if(arguments.length==2){//设置单个样式
  155. if( type.test(attr) && value.indexOf('%')<0 ){
  156. value = parseFloat(value).toFixed(2) + 'px';
  157. }
  158. for(var m=0;m<this.length;m++){
  159. this.elements[m].style[attr] = value;
  160. }
  161. }else{//一个参数
  162. if(typeof attr=="string"){//获取样式
  163. if( type4.test(attr) ){//如果一长串字符串设置,background:#303030;font-size:20px;
  164. for(var x=0;x<this.length;x++){
  165. this.elements[x].style.cssText = attr;
  166. }
  167. }else{
  168. return this.elements[0].currentStyle ? this.elements[0].currentStyle[attr] : getComputedStyle(this.elements[0])[attr];
  169. }
  170. }else if( typeof(attr) == "object" && Object.prototype.toString.call(attr).toLowerCase() == "[object object]" && !attr.length ){//json
  171. //json设置样式
  172. var css = "";
  173. for(var i =0;i<this.length;i++){
  174. //纯CSS写法
  175. for(var k in attr){
  176. //k == 属性名字,width,height,opacity等
  177. //attr[k] == 属性值,300px,#303030等
  178. if((type.test(k) || type2.test(k)) && attr[k].indexOf('%')<0 ){//如果是带像素的属性,并且没有%符号
  179. attr[k] = parseFloat( attr[k] ).toFixed(2) + 'px';
  180. }
  181. css += k+":"+attr[k]+";";
  182. }
  183. this.elements[i].style.cssText = css;
  184. }
  185. }
  186. }
  187. return this;//返回对象,进行链式操作
  188. };
  189. TQuery.prototype.style = function(attr){
  190. //IE下,如果宽高设置为百分比,则返回也是百分比。
  191. return this.elements[0].currentStyle ? this.elements[0].currentStyle[attr] : getComputedStyle(this.elements[0])[attr];
  192. };
  193. TQuery.prototype.size = function(attr){
  194. return this.doc.documentElement[attr] ? this.doc.documentElement[attr] : this.doc.body[attr];
  195. };
  196. TQuery.prototype.animate = function(json,configjson){
  197. //如果两个参数.animate('width','300');
  198. for(var i=0;i<this.length;i++){
  199. var _this = this.elements[i];
  200. clearInterval(_this.animate);
  201. _this.animate = setInterval(function() {
  202. //注意,此处this指的是window(匿名函数)
  203. var bStop = true;//判断运动是否停止
  204. for(var attr in json){//attr代表属性,'width','height'.而json[attr]代表数值
  205. // 1. 取得当前的值(可以是width,height,opacity等的值)
  206. var objAttr = 0 ;
  207. if(attr == 'opacity'){//获取当前数值
  208. objAttr = Math.round(parseFloat( $(_this).style(attr) ) * 100);
  209. }else{
  210. objAttr = parseInt( $(_this).style(attr) );
  211. }
  212. // 2.计算运动速度
  213. var jsonattr = parseFloat( json[attr] );
  214. var speedConfig = (configjson && typeof ( configjson.speed ) != 'undefined') ? configjson.speed : 10;
  215. var iSpeed = (jsonattr - objAttr) / speedConfig; //(目标数值-当前数值)/10
  216. iSpeed = iSpeed > 0 ? Math.ceil(iSpeed) : Math.floor(iSpeed); //如果速度>0,则速度向上取整,如果小于0,则保留小数
  217. // 3. 检测所有运动是否到达目标
  218. //objAttr,当前点,json[attr]为目标点
  219. if ( (iSpeed>0 && objAttr <= jsonattr) || (iSpeed<0 && objAttr >= jsonattr) ) {//如果有其中一项没有达到目标
  220. bStop = false;
  221. }
  222. if (attr == "opacity") {
  223. _this.style.filter = 'alpha(opacity:' + (objAttr + iSpeed) + ')';
  224. _this.style.opacity = (objAttr + iSpeed) / 100;
  225. } else {
  226. _this.style[attr] = objAttr + iSpeed + 'px'; //赋值开始运动
  227. }
  228. if( configjson && typeof configjson.load !='undefined' ){
  229. configjson.load.call(_this);
  230. }
  231. if (bStop) { // 表示所有运动都到达目标值
  232. clearInterval(_this.animate);
  233. if( configjson && typeof configjson.end != 'undefined' ){
  234. configjson.end.call(_this);
  235. }
  236. }
  237. }//for
  238. },30);
  239. }//for
  240. return this;//返回对象,进行链式操作
  241. };
  242. TQuery.prototype.attr = function(attr,value){
  243. //attr不能是数字
  244. if(arguments.length==2){//2个参数,设置属性
  245. for(var k=0;k<this.length;k++){
  246. if(this.elements[k][attr]){
  247. this.elements[k][attr] = value;
  248. }else{
  249. this.elements[k].setAttribute(attr,value);
  250. }
  251. }
  252. }else if(arguments.length==1){//1个参数
  253. if( typeof(attr) == "object" && Object.prototype.toString.call(attr).toLowerCase() == "[object object]" && !attr.length ){//如果是json,则分别设置属性
  254. for(var i=0;i<this.length;i++){
  255. for(var j in attr){
  256. if( this.elements[i][j] ){//如果属性是可以直接读取
  257. this.elements[i][j] = attr[j];
  258. }else{//如果是自定义属性
  259. this.elements[i].setAttribute(j,attr[j]);
  260. }
  261. }
  262. }
  263. }else{//读取属性
  264. return this.elements[0][attr] || this.elements[0].getAttribute(attr);
  265. }
  266. }
  267. return this;//返回对象,进行链式操作
  268. };
  269. TQuery.prototype.value = function(setting){
  270. if(setting){//设置
  271. for(var i=0;i<this.length;i++){
  272. this.elements[i].value = setting;
  273. }
  274. return this;
  275. }
  276. //读取
  277. return this.elements[0].value;
  278. };
  279. TQuery.prototype.html = function(setting){
  280. if(setting){//设置
  281. for(var i=0;i<this.length;i++){
  282. this.elements[i].innerHTML = setting;
  283. }
  284. return this;
  285. }
  286. return this.elements[0].innerHTML;
  287. };
  288. TQuery.prototype.text = function(setting){
  289. if(setting){//设置
  290. for(var i=0;i<this.length;i++){
  291. this.elements[i].innerText = this.elements[i].textContent = setting;
  292. }
  293. return this;
  294. }
  295. //读取
  296. return this.elements[0].innerText || this.elements[0].textContent;
  297. };
  298. TQuery.prototype.remove = function(){
  299. for(var i=0;i<this.length;i++){
  300. this.elements[i].remove();
  301. }
  302. return this;//返回对象,进行链式操作
  303. };
  304. TQuery.prototype.eq = function(n){
  305. var m = n || 0;
  306. this.length = 1;
  307. return $(this.elements[m]);//作为对象存进this.elements,以便链式结构
  308. };
  309. TQuery.prototype.get = function(n){
  310. n = n || 0;
  311. if(n=='all' && this.length>1){//如果没有参数,并且多个,则返回数组
  312. return this.elements;
  313. }
  314. return this.elements[n];
  315. };
  316. TQuery.prototype.extend = function(name,fn){
  317. TQuery.prototype[name] = fn;
  318. return this;//返回对象,进行链式操作
  319. };
  320. TQuery.prototype.constructor = TQuery;
  321.  
  322.  
  323. //==============公共函数=================
  324. function addEvent(obj, type, fn){
  325. return obj.addEventListener ?
  326. obj.addEventListener(type, function(e){
  327. var ev = window.event ? window.event : (e ? e : null);
  328. ev.target = ev.target || ev.srcElement;
  329. if( fn.call(obj,ev)===false ){//回掉函数为false,则阻止默认时间
  330. e.cancelBubble = true;//阻止冒泡
  331. e.preventDefault();//chrome,firefox下阻止默认事件
  332. }
  333. }, false)
  334. :
  335. obj.attachEvent('on' + type, function(e){
  336. //fn.call(obj,e);//解决IE8下,this是window的问题
  337. var ev = window.event ? window.event : (e ? e : null);
  338. ev.target = ev.target || ev.srcElement;
  339. if(fn.call(obj,ev)===false ){
  340. e.cancelBubble = true;//阻止冒泡
  341. return false;//阻止默认事件,针对IE8
  342. }
  343. });
  344. }
  345.  
  346. function hasClass(obj, cName) {
  347. // ( \\s|^ ) 判断前面是否有空格 (\\s | $ )判断后面是否有空格 两个感叹号为转换为布尔值 以方便做判断
  348. return !!obj.className.match(new RegExp("(\\s|^)" + cName + "(\\s|$)"));
  349. }
  350.  
  351. //==============主要函数=================
  352. function position(){
  353. var url = location.href,
  354. postIn = /.*tieba.baidu.com\/p\/.*/ig,
  355. postList = /.*tieba.baidu.com\/(f\?.*|[^p])/ig;
  356. if (postIn.test(url)) { //如果是帖子内
  357. return "post";//1
  358. } else if (postList.test(url)) { //如果在帖子列表
  359. return "list";//0
  360. }
  361. }
  362.  
  363. function barName() {
  364. var $name = $(".card_title_fname").text(),
  365. newText = $name.replace(/\s*/ig,'');
  366. return newText;
  367. }
  368.  
  369. function blockMod() {
  370. if (GM_getValue('setting-blockWay', defaultdConfig.blockWay) == '遮罩屏蔽') {
  371. return "wrap"; //遮罩模式,1
  372. } else {
  373. return "remove"; //删除节点,2
  374. }
  375. }
  376.  
  377. function createList() {
  378. $('#showList').html(" "); //先清空,后生成
  379. var li = '',
  380. json = null,
  381. length = GM_listValues().length,
  382. key,
  383. value;
  384. for (var i = 0; i < length; i++) {
  385. key = GM_listValues()[i];
  386. value = GM_getValue(GM_listValues()[i], '');
  387. if (value.length < 10 || value === true || value === false) continue;
  388. json = JSON.parse(value);
  389. li +='<tr data-value=' + value + '>'+
  390. '<td style="min-width:100px">' + json.name + '</td>'+
  391. '<td style="min-width:100px">' + json.id + '</td>'+
  392. '<td style="min-width:75px">' + json.bar + '</td>'+
  393. '<td style="min-width:75px">' + json.reson + '</td>'+
  394. '<td style="min-width:50px"><input type="button" class="deletThis" value="删除"/></td>'+
  395. '</tr>';
  396. } //for
  397. $('#showList').html(li);
  398. }
  399.  
  400. function searchInList() {
  401. var str = '',
  402. userInfo = "",
  403. userInfoStr = "",
  404. list = document.querySelectorAll('#showList tr'),
  405. listLength = list.length,
  406. inputValue = $('#sear').value();
  407. createList();
  408. $("#showList").html(" ");
  409. for (var i = 0; i < listLength; i++) {
  410. userInfo = JSON.parse($(list[i]).attr('data-value'));
  411. if (userInfo.name.indexOf(inputValue) >= 0 || userInfo.id.indexOf(inputValue) >= 0 || userInfo.bar.indexOf(inputValue) >= 0 || userInfo.reson.indexOf(inputValue) >= 0) { //匹配name,id,bar,reson
  412. userInfoStr = JSON.stringify(userInfo);
  413. str += '<tr data-value=' + userInfoStr + '>'+
  414. '<td style="width:100px">' + userInfo.name + '</td>'+
  415. '<td style="width:100px">' + userInfo.id + '</td>'+
  416. '<td style="width:75px">' + userInfo.bar + '</td>'+
  417. '<td style="width:75px">' + userInfo.reson + '</td>'+
  418. '<td style="width:50px"><input type="button" class="deletThis" value="删除"/></td>'+
  419. '</tr>';
  420. }
  421. } //for
  422. $("#showList").html(str);
  423. }
  424. //将脚本还原到最初状态
  425. function clearall(){
  426. var length = GM_listValues().length;
  427. for(var i=0;i<length;i++){
  428. console.log(GM_deleteValue(GM_listValues()[i]) + ":" + GM_getValue(GM_listValues()[i], ''));
  429. }
  430. GM_setValue('setting-blockWay', defaultdConfig.blockWay); //屏蔽方式
  431. GM_setValue('setting-col', defaultdConfig.color); //默认遮罩的颜色
  432. GM_setValue('setting-opa', defaultdConfig.opacity); //默认遮罩透明度
  433. GM_setValue('setting-gus', defaultdConfig.blurpx); //默认遮罩下的高斯模糊半径
  434. }
  435.  
  436. //==============主要对象=================
  437. function init(){
  438. return new Init();
  439. }
  440. function Init(){
  441. var user,userName,userId,pos,temp,lzl,selector;
  442. this.user = [];//用于储存所有用户信息,包括name,id
  443. // this.userLzl = [];//用于储存所有用户信息,包括name,id
  444. selector = position()=="post" ? '#j_p_postlist>div[data-field]' : '#thread_list>li[data-field]';
  445. this.list = document.querySelectorAll(selector);//所有用户所占的DIV,LI
  446. // this.listLzl = document.querySelectorAll('.j_lzl_m_w>li[data-field]:not(.lzl_li_pager)');
  447. // pos = position()=="post" ? document.querySelectorAll('.l_post .d_name') : document.querySelectorAll('#thread_list>li[data-field] .threadlist_lz>.threadlist_author');//点击屏蔽,屏蔽按钮需要插入的位置
  448. var listLength = this.list.length;
  449. for(var i=0;i<listLength;i++){
  450. userName = position()=="post" ? JSON.parse(this.list[i].getAttribute('data-field')).author.user_name : JSON.parse(this.list[i].getAttribute('data-field')).author_name;
  451. userId = position()=="post" ? JSON.parse(this.list[i].getAttribute('data-field')).author.user_id : JSON.parse(this.list[i].getAttribute('data-field')).id;
  452. temp = {};
  453. temp.name = userName;
  454. temp.id = userId;
  455. this.user.push(temp);
  456. }
  457. //楼中楼
  458. // var listLzlLength = this.listLzl.length;
  459. // console.log( listLzlLength );
  460. // for(var j=0;j<listLzlLength;j++){
  461. // var lzlName = JSON.parse( this.listLzl[j].getAttribute("data-field").replace(/\'/ig,'\"') ).user_name;
  462. // var lzlId = "";
  463. // temp = {};
  464. // temp.name = lzlName;
  465. // temp.id = lzlId;
  466. // // console.log( lzlName );
  467. // // console.log( j );
  468. // this.userLzl.push(temp);
  469. // }
  470. return this;
  471. }
  472.  
  473. //页面加载开始屏蔽
  474. Init.prototype.block = function(){
  475. this.oMar = document.createElement("div");//创建遮罩层
  476. var obj,objLzl,data,oMarClone,
  477. listLength = GM_listValues().length,
  478. userLength = this.user.length,
  479. // userLzlLength = this.userLzl.length,
  480. config = {
  481. "blockWay": GM_getValue('setting-blockWay', defaultdConfig.blockWay),//屏蔽方式
  482. "color": GM_getValue('setting-col', defaultdConfig.color),//遮罩颜色
  483. "opacity": GM_getValue('setting-opa', defaultdConfig.opacity),//遮罩透明度
  484. "blur": GM_getValue('setting-gus', defaultdConfig.blurpx)//高斯模糊
  485. };
  486. $(this.oMar).attr("class","mar").css({
  487. "background":config.color,
  488. "opacity":config.opacity
  489. });
  490. for (var i = 0; i < listLength; i++) {//GM_listValues().length
  491. for(var j=0;j<userLength;j++){
  492. obj = this.list[j];//要屏蔽的模块
  493. if( GM_listValues()[i]==this.user[j].name ){
  494. if(blockMod()=="remove"){
  495. $(obj).css("display","none");
  496. }else if(blockMod()=="wrap"){
  497. if( $(obj).find(".mar").length >= 1 ){
  498. continue;
  499. }
  500. oMarClone = this.oMar.cloneNode(true);//克隆遮罩层
  501. //要屏蔽的模块
  502. $(obj).css({
  503. "position":"relative",
  504. "filter":"blur(" + config.blur +"px)",
  505. "-webkit-filter":"blur(" + config.blur +"px)",
  506. "-moz-filter":"blur(" + config.blur +"px)",
  507. "-o-filter":"blur(" + config.blur +"px)",
  508. "-ms-filter":"blur(" + config.blur +"px)",
  509. "backface-visibility":"hidden",
  510. "-webkit-backface-visibility":"hidden",
  511. "-moz-backface-visibility":"hidden",
  512. "-o-backface-visibility":"hidden",
  513. "-ms-backface-visibility":"hidden",
  514. });
  515. if (GM_listValues()[i] == this.user[j].name) {
  516. data = GM_getValue(GM_listValues()[i], '');
  517. }
  518. $(oMarClone).attr("data",data);
  519. obj.appendChild(oMarClone);
  520. }
  521. }
  522. }
  523. //屏蔽楼中楼
  524. // for(var k=0;k<userLzlLength;k++){
  525. // objLzl = this.listLzl[k];//要屏蔽的模块
  526. // if( GM_listValues()[i]==this.userLzl[k].name ){//如果匹配到
  527. // if(blockMod()=="remove"){
  528. // objLzl.style.display = "none";
  529. // }else if(blockMod()=="wrap"){
  530. // if( objLzl.querySelectorAll('.mar').length >= 1 ){
  531. // continue;
  532. // }
  533. // oMarClone = oMar.cloneNode(true);//克隆遮罩层
  534. // //要屏蔽的模块
  535. // objLzl.style.cssText = "position:relative;filter:blur(" + config.blur +"px);-webkit-filter:blur(" + config.blur + "px);-moz-filter:blur(" + config.blur + "px);-o-filter:blur(" + config.blur + "px);backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;";
  536. // if (GM_listValues()[i] == this.userLzl[k].name) {
  537. // data = GM_getValue(GM_listValues()[i], '');
  538. // }
  539. // oMarClone.setAttribute('data', data);
  540. // objLzl.appendChild(oMarClone);
  541. // }
  542. // }
  543. // }
  544. } //for,遍历屏蔽
  545. };
  546. //智能提示
  547. Init.prototype.autoTips = function(){
  548. var list = [],//储存所有用户名
  549. temp = {},
  550. str = "";
  551. for(var i=0;i<this.user.length;i++){
  552. if(typeof temp[this.user[i].name]=="undefined"){
  553. temp[this.user[i].name] = 1;
  554. list.push(this.user[i].name);
  555. }
  556. }
  557. for(var j=0;j<list.length;j++){
  558. str += '<option value="' + list[j] + '" />';
  559. }
  560. $("#lst").html(str);
  561. };
  562. //关键字过滤
  563. var log = [];
  564. function key(){
  565. return new keyWord();
  566. }
  567. function keyWord(){
  568. //已保存的关键字
  569. this.wordArr = GM_getValue("keyWord",[]);
  570. if( this.wordArr.length<=0 || $('a.j_th_tit').length<=0 ){
  571. return this;
  572. }
  573. var str = this.wordArr.join("|");
  574. //正则匹配
  575. this.reg = new RegExp(""+ str +"","i");
  576. //所有帖子标题
  577. this.list = $('a.j_th_tit').get("all");
  578. document.querySelectorAll('a.j_th_tit');
  579. }
  580. keyWord.prototype.filter = function(){
  581. log = [];
  582. var list = this.list || [],
  583. postTitle,
  584. target;
  585. var reg = new RegExp(""+ this.wordArr.join("|") +"","i");
  586. for(var i=0;i<list.length;i++){
  587. //帖子标题
  588. postTitle = $(list[i]).text();
  589. //帖子块
  590. target = list[i].parentNode.parentNode.parentNode.parentNode.parentNode;
  591. console.log( target );
  592. if( reg.test(postTitle)===true ){
  593. log.push( postTitle );
  594. target.style.display = "none";
  595. }else{
  596. target.style.display = "block";
  597. }
  598. }
  599. };
  600. keyWord.prototype.createTag = function(){
  601. //生成标签
  602. var oFragment = document.createDocumentFragment(),
  603. tag = document.createElement('span'),
  604. cloneTag;
  605. tag.className = "blockTag";
  606. for(var k=0;k<this.wordArr.length;k++){
  607. cloneTag = tag.cloneNode();
  608. $(cloneTag).html( this.wordArr[k] );
  609. oFragment.appendChild(cloneTag);
  610. }
  611.  
  612. $('#tag-area').html(" ").get(0).appendChild(oFragment);
  613. };
  614. //监听
  615. $().extend("ob",function(){
  616. var target = this.elements[0];
  617. return new Ob(target);
  618. });
  619. function Ob(target){
  620. this.MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  621. this.target = target;
  622. return this;
  623. }
  624. Ob.prototype.observer = function(config,fn){
  625. var MutationObserver = this.MutationObserver,
  626. observer = new MutationObserver(function(mutations){
  627. mutations.forEach(function(mutation) {
  628. fn.call(this.target);
  629. });
  630. });
  631. observer.observe(this.target, config);
  632. };
  633.  
  634. //拖拽
  635. $().extend("drag",function(pressTarget,MoveTarget,json){
  636. return new Drag(pressTarget,MoveTarget,json);
  637. });
  638. function Drag(pressTarget,MoveTarget,json){
  639. var _this = this;
  640. this.disX = 0;
  641. this.disY = 0;
  642. if(json){
  643. this.json = json;
  644. }
  645. this.MoveTarget = MoveTarget;
  646. pressTarget.onmousedown = function(e){
  647. _this.fnDown(e);
  648. return false;//chrome,firefox去除文字选中
  649. };
  650. }
  651. Drag.prototype.fnDown = function(e){//鼠标按下(未松开)
  652. var ev = e || window.event;
  653. var _this = this;
  654. this.disX = e.clientX - this.MoveTarget.offsetLeft;
  655. this.disY = e.clientY - this.MoveTarget.offsetTop;
  656. if(this.MoveTarget.setCaptrue){//IE,解决文字选中
  657. this.MoveTarget.onmousemove = function(ev){
  658. _this.fnMove(ev);
  659. };
  660. this.MoveTarget.onmouseup = function(){
  661. var this_ = this;
  662. _this.fnUp(this_);
  663. };
  664. this.MoveTarget.setCaptrue();//添加事件捕获
  665. }else{
  666. document.onmousemove = function(e){
  667. _this.fnMove(e);
  668. };
  669. document.onmouseup = function(){
  670. var this_ = this;
  671. _this.fnUp(this_);
  672. };
  673. }
  674. };
  675. Drag.prototype.fnMove = function(e){//鼠标移动,则div移动
  676. var ev = e || window.event;
  677. var L = this.json ? this.range(e.clientX - this.disX,this.json.L[0],this.json.L[1]) : (e.clientX - this.disX);
  678. var T = this.json ? this.range(e.clientY - this.disY,this.json.T[0],this.json.T[1]) : (e.clientY - this.disY);
  679. this.MoveTarget.style.left = L + 'px';
  680. this.MoveTarget.style.top = T + 'px';
  681. };
  682. Drag.prototype.fnUp = function(this_){//鼠标松开,则停止
  683. this_.onmousemove = null;
  684. this_.onmouseup = null;
  685. if( this_.setCaptrue ){
  686. this_.releaseCapture();//释放捕获
  687. }
  688. };
  689. Drag.prototype.range = function(iNow,iMin,iMax){
  690. if(iNow>iMax){
  691. return iMax;
  692. }else if(iNow<iMin){
  693. return iMin;
  694. }else{
  695. return iNow;
  696. }
  697. };
  698. //==============主要事件=================
  699. $(window).bind({
  700. "DOMContentLoaded":function(){
  701. //脚本初始化
  702. init().block();
  703. //关键字过滤
  704. key().filter();
  705. },
  706. "load":function(){
  707. init().block();
  708. //监听翻页
  709. if(position()=="post" ){
  710. $("#j_p_postlist").ob().observer({"childList":true},function(){
  711. init().block();
  712. });
  713. }else{
  714. $('thread_list').ob().observer({"childList":true},function(){//帖子列表
  715. init().block();
  716. });
  717. }
  718. //关键字过滤
  719. key().filter();
  720. }
  721. });
  722. $(document).bind('click',function(e){
  723. var target = e.target || e.srcElement,
  724. id=target.id || null;
  725. //如果点击到ID
  726. if ($(target).attr('data-field') && hasClass(target.parentNode, 'd_name') || $(target).attr('data-field') && hasClass(target.parentNode, 'tb_icon_author')) { //如果点到了名字上面
  727. (function(target){
  728. var data3,name,id,parent;
  729. if( $("#confirmBox") ){
  730. $("#confirmBox").remove();
  731. }
  732. if(hasClass(target.parentNode,"d_name")){
  733. parent = target.parentNode.parentNode.parentNode.parentNode;
  734. data3 = JSON.parse($(parent).attr("data-field")).author;
  735. name = data3.user_name;
  736. id = data3.user_id;
  737. }else{
  738. parent = target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
  739. data3 = JSON.parse($(parent).attr("data-field"));
  740. name = data3.author_name;
  741. id = data3.id;
  742. }
  743. var confirmBox = document.createElement("div");
  744. $(confirmBox).attr("id","confirmBox").html("<p>是否屏蔽</p><p>" + name + "</p><input type='button' value='确认' id='confirm-yes' /><input type='button' value='取消' id='confirm-no' />");
  745. document.documentElement.appendChild(confirmBox);
  746. $(confirmBox).animate({"top":"100","opacity":"100"},{"end":function(){
  747. clearTimeout(confirmBox.fadeOut);
  748. this.fadeOut=setTimeout(function(){
  749. $(confirmBox).animate({"top":"60","opacity":"0"},{"end":function(){
  750. $(this).remove();
  751. }});
  752. },3000);
  753. }});
  754. $('#confirm-yes').on('click',function(){
  755. GM_setValue(name,'{"name":"' + name + '","id":"' + id + '","bar":"' + barName() + '","reson":"不顺眼"}');
  756. init().block();
  757. confirmBox.remove(this);
  758. });
  759. $("#confirm-no").on('click',function(){
  760. confirmBox.remove(this);
  761. });
  762. })(target);
  763. //阻止默认事件和冒泡
  764. return false;
  765. }
  766. //屏蔽列表删除键
  767. else if( hasClass(target,"deletThis") ){
  768. var ele = $(target.parentNode.parentNode);
  769. var thisKey = JSON.parse(ele.attr('data-value')).name; //获取当前结点的key
  770. GM_deleteValue(thisKey); //删除变量
  771. ele.remove(); //删除节点
  772. }
  773. //如果点击到遮罩层
  774. else if (hasClass(target, 'mar')){
  775. $(".mar").html(" ");
  776. //获取data数据
  777. var data = JSON.parse($(target).attr('data'));
  778. //第一次点击
  779. if (!target.ready) {
  780. $(target).css({
  781. "border-left":"5px solid rgb(174, 103, 34)"
  782. });
  783. target.ready = true;
  784. }
  785. //再次点击
  786. else if(target.ready === true){
  787. $(target.parentNode).css({
  788. "position":"relative",
  789. "-webkit-filter":"none",
  790. "-moz-filter":"none",
  791. "o-filter":"none",
  792. "ms-filter":"none",
  793. "filter":"none"
  794. });
  795. $(target).css({
  796. "background":"none",
  797. "opacity":"1",
  798. "filter":"alpha(opacity=100)"
  799. }).html('<input type="button" id="keeplock" value="继续屏蔽" /><input type="button" id="unlockNow" value="暂时解除 "/><input type="button" id="unlock" value="永久解除" />' + '<p>' + data.name + '(' + data.id + '),其在' + data.bar + '因[' + data.reson + ']被屏蔽' + '</p>');
  800. target.ready = null;
  801. }
  802. }
  803. //点击屏蔽关键字删除
  804. else if( hasClass(target, 'blockTag') ){
  805. var word = $(target).text();
  806. var arr = GM_getValue("keyWord",[]);
  807. var temp = [];
  808. for(var i=0;i<arr.length;i++){
  809. if(arr[i]!=word){
  810. temp.push( arr[i] );
  811. }
  812. }
  813. GM_setValue("keyWord",temp);
  814. $(target).remove();
  815. //重新屏蔽
  816. // keyfilter();
  817. key().filter();
  818. return false;
  819. }
  820. else{
  821. switch(id){
  822. //解除屏蔽
  823. case "unlock" :
  824. var $ele1 = $(target.parentNode);
  825. var data2 = JSON.parse( $ele1.attr("data") );
  826. GM_deleteValue(data2.name); //删除键名
  827. $ele1.remove();
  828. break;
  829. //暂时解除
  830. case "unlockNow" :
  831. target.parentNode.remove(this);
  832. break;
  833. //继续屏蔽
  834. case "keeplock" :
  835. var targetParent = target.parentNode;
  836. var config = {
  837. "blockWay": GM_getValue('setting-blockWay', defaultdConfig.blockWay),//屏蔽方式
  838. "color": GM_getValue('setting-col', defaultdConfig.color),//遮罩颜色
  839. "opacity": GM_getValue('setting-opa', defaultdConfig.opacity),//遮罩透明度
  840. "blur": GM_getValue('setting-gus', defaultdConfig.blurpx)//高斯模糊
  841. };
  842. $(targetParent.parentNode).css({
  843. "position":"relative",
  844. "filter":"blur(" + config.blur +"px)",
  845. "-webkit-filter":"blur(" + config.blur + "px)",
  846. "-moz-filter":"blur(" + config.blur + "px)",
  847. "-o-filter":"blur(" + config.blur + "px)",
  848. "-ms-filter":"blur(" + config.blur + "px)",
  849. "backface-visibility":"hidden",
  850. "-webkit-backface-visibility":"hidden",
  851. "-moz-backface-visibility":"hidden",
  852. "-o-backface-visibility":"hidden",
  853. "-ms-backface-visibility":"hidden"
  854. });
  855. $(targetParent).css({
  856. "opacity":config.opacity,
  857. "background":config.color,
  858. "border":"none"
  859. }).html(" ");
  860. break;
  861. //退出
  862. case "queit" :
  863. $('#pannal,#wrap').remove();
  864. document.body.className = '';
  865. break;
  866. case "wrap" :
  867. $('#pannal,#wrap').remove();
  868. document.body.className = '';
  869. break;
  870. //保存
  871. case "save" :
  872. //判断屏蔽方式
  873. GM_setValue('setting-blockWay', $("#blockWay").value() );
  874. //遮罩颜色
  875. GM_setValue('setting-col', $("#col").value() );
  876. //遮罩透明度1
  877. GM_setValue('setting-opa', $('#opa').value() );
  878. //高斯模糊半径
  879. GM_setValue('setting-gus', $('#gus').value());
  880. //添加黑名单
  881. var name = $('#userName').value();
  882. if(name === "" || name === null){
  883. return;
  884. }
  885. GM_setValue($('#userName').value(), '{"name":"' + $('#userName').value() + '","id":"' + $("#userId").value() + '","bar":"' + $("#curBar").value() + '","reson":"' + $("#reson").value() + '"}');
  886. init().block();
  887. createList();//重新生成列表
  888. break;
  889. //初始化
  890. case "clear" :
  891. clearall();
  892. createList();
  893. break;
  894. //添加关键字
  895. case "addWord":
  896. var input = $("#blockWord").value();
  897. if(input===""){
  898. return;
  899. }
  900. var keyArr = GM_getValue("keyWord",[]);
  901. keyArr.push(input);
  902. var a = {};
  903. var newTemp = [];
  904. for(var f=0;f<keyArr.length;f++){
  905. if(typeof (a[ keyArr[f] ]) == "undefined" ){
  906. a[ keyArr[f] ] = 1;
  907. newTemp.push( keyArr[f] );
  908. }
  909. }
  910. GM_setValue("keyWord",newTemp);
  911. //生成标签
  912. key().createTag();
  913. //过滤
  914. key().filter();
  915. break;
  916. //显示日志
  917. case "showLog":
  918. var str = "";
  919. for(var x=0;x<log.length;x++){
  920. str += "<p>" + log[x] + "</p>";
  921. }
  922. $("#tag-log").html(str);
  923. break;
  924. default:
  925. return;
  926. }
  927. }
  928. });
  929.  
  930. $(document).bind('input',function(e){
  931. var target = e.target || e.srcElement,
  932. id = target.id;
  933. switch(id){
  934. case "sear" :
  935. searchInList();
  936. break;
  937. case "opa" :
  938. $('#opa-text').html( $('#opa').value() );
  939. break;
  940. case "gus" :
  941. $('#gus-text').html( $('#gus').value() );
  942. break;
  943. case "userName" :
  944. if( $("#lst").html() === "" || $("#lst").html() === null ){
  945. init().autoTips();
  946. }
  947. break;
  948. default :
  949. return;
  950. }
  951. });
  952.  
  953. $(window).bind('keyup',function(e){
  954. var target = e.target || e.srcElement;
  955. if(e.keyCode==8){//backspace
  956. if ( target.id=="sear" && target.value === '') {
  957. createList();
  958. return;
  959. }
  960. }else if(e.ctrlKey && e.keyCode == 114){//快捷键ctrl+F3
  961. if( $("#pannal").length>=1 ){
  962. return;
  963. }
  964. var oFragment = document.createDocumentFragment(),//创建文档碎片
  965. pannal = document.createElement('div'),//控制面板
  966. pannal_wrap = pannal.cloneNode(false),//遮罩层
  967. config = {
  968. "blockWay": GM_getValue('setting-blockWay', defaultdConfig.blockWay),//屏蔽方式
  969. "color": GM_getValue('setting-col', defaultdConfig.color),//遮罩颜色
  970. "opacity": GM_getValue('setting-opa', defaultdConfig.opacity),//遮罩透明度
  971. "blur": GM_getValue('setting-gus', defaultdConfig.blurpx)//高斯模糊
  972. };
  973. $(pannal_wrap).attr("id","wrap");
  974. $(pannal).attr("id","pannal");
  975. pannal.innerHTML = '\
  976. <h3 id="pannal-tittle" style="cursor:move;font-size:20px;line-height:20px;color:#fff;background:#165557;">配置参数</h3>\
  977. <div id="pannal-setting">\
  978. 屏蔽方式:<select id="blockWay">\
  979. <option>遮罩屏蔽</option>\
  980. <option>删除节点</option>\
  981. </select><br/>\
  982. 遮罩层颜色:<input id="col" type="color" value="'+config.color+'" /><br/>\
  983. 遮罩透明度(0~1):<span id="opa-text">'+config.opacity+'</span><input id="opa" type="range" value="'+config.opacity+'" min="0" max="1" step="0.1" /><br/>\
  984. 高斯模糊像素(0~10):<span id="gus-text">'+config.blur+'</span><input id="gus" type="range" value="'+config.blur+'" min="0" max="10" step="1" /><br/>\
  985. </div>\
  986. <hr/>\
  987. <h3>添加讨厌鬼</h3>\
  988. <div id="addBlackList">\
  989. 数字ID(选填):<input id="userId" type="text" placeholder="user_id"/><br/>\
  990. 贴吧ID(必填):<input id="userName" type="text" placeholder="user_name" list="lst" autocomplete="off"/><br/>\
  991. <datalist id="lst" autocomplete="on"></datalist>\
  992. 所在贴吧:<input id="curBar" type="text" value="'+barName()+'" /><br/>\
  993. 屏蔽原因:<input id="reson" type="text" list="lstr" value="" />\
  994. </div>\
  995. <hr/>\
  996. <h3>功能</h3>\
  997. <div id="fn">\
  998. <input id="save" type="button" value="保存" />\
  999. <input id="clear" type="button" value="初始化" />\
  1000. <input id="view" type="button" value="列表" />\
  1001. </div>\
  1002. <div id="list" style="margin:0;">\
  1003. <input id="sear" type="text" list="BlackList" placeholder="搜索" autocomplete="off" />\
  1004. <table id="showList"></table>\
  1005. </div>\
  1006. <div id="block-keyWord">\
  1007. <input type="text" placeholder="输入关键字" id="blockWord" /><input type="button" value="添加" id="addWord" /></br>\
  1008. <div id="tag-area"></div>\
  1009. <input type="button" value="查看日志" id="showLog" />\
  1010. <div id="tag-log"></div>\
  1011. </div>\
  1012. <span id="queit">X</span>\
  1013. ';
  1014. oFragment.appendChild(pannal);
  1015. oFragment.appendChild(pannal_wrap);
  1016. document.body.className = 'blur';
  1017. document.documentElement.appendChild(oFragment);
  1018. //居中
  1019. $(pannal).css({
  1020. "top": ($().size('clientHeight') - pannal.offsetHeight) / 2 + "px",
  1021. "left":($().size('clientWidth') - pannal.offsetWidth) / 2 + "px"
  1022. });
  1023. //初始化数据
  1024. $('#blockWay').attr('value',GM_getValue('setting-blockWay', defaultdConfig.blockWay) );//屏蔽方式
  1025. //生成屏蔽名单列表
  1026. createList();
  1027. //生成关键字标签
  1028. // creatTag();
  1029. key().createTag();
  1030. //可拖拽
  1031. $().drag( $('#pannal-tittle').get(0),pannal );
  1032. //展开收起
  1033. $('#view').toggle(function(){
  1034. var height = parseInt( pannal.offsetHeight );
  1035. $('#list').animate({"height":height},{"end":function(){
  1036. $(this).css({
  1037. "display":"block",
  1038. "height":height,
  1039. "overflow":"auto"
  1040. });
  1041. }});
  1042. $('#block-keyWord').animate({"height":height},{"end":function(){
  1043. $(this).css({
  1044. "disable":"block",
  1045. "height":height,
  1046. "overflow":"auto"
  1047. });
  1048. }});
  1049. },function(){
  1050. $('#list').animate({"height":"0"});
  1051. $('#block-keyWord').animate({"height":"0"});
  1052. });
  1053. }
  1054. });
  1055.  
  1056.  
  1057.  
  1058. //==============样式=================
  1059. var style = '\
  1060. body{\
  1061. -webkit-backface-visibility:hidden;\
  1062. }\
  1063. .blur{\
  1064. filter:blur(5px) grayscale();\
  1065. -webkit-filter:blur(5px) grayscale();\
  1066. -moz-filter:blur(5px) grayscale();\
  1067. -o-filter:blur(5px) grayscale();\
  1068. -ms-filter:blur(5px) grayscale();\
  1069. }\
  1070. #pannal{\
  1071. width:200px;\
  1072. height:auto;\
  1073. background:rgba(38, 50, 56, 1);\
  1074. color:#fff;\
  1075. position:fixed;\
  1076. z-index:1000000000;\
  1077. text-align:center;\
  1078. box-shadow:0 0 20px 5px #000000;\
  1079. }\
  1080. #pannal>div{\
  1081. margin:10px 0;\
  1082. }\
  1083. #pannal input{\
  1084. color:#3e3e3e;\
  1085. border:1px solid transparent;\
  1086. height:20px;\
  1087. line-height:20px;\
  1088. }\
  1089. #pannal input:focus{\
  1090. background-color:rgba(38, 50, 56, 1);\
  1091. color:#fff;\
  1092. border:1px solid;\
  1093. transition:all 0.2s ease-in-out;\
  1094. }\
  1095. #pannal h3{\
  1096. color:rgb(0, 255, 226);\
  1097. }\
  1098. #pannal-setting input[type=range]{\
  1099. width:80%;\
  1100. }\
  1101. #fn input{\
  1102. padding:5px 10px;\
  1103. margin:0 5px;\
  1104. cursor:pointer;\
  1105. }\
  1106. #fn input:hover{\
  1107. background:#004d40;\
  1108. color:#fff;\
  1109. }\
  1110. #pannal>span#queit{\
  1111. position:absolute;\
  1112. width:21px;\
  1113. height:21px;\
  1114. line-height:21px;\
  1115. font-size:21px;\
  1116. top:0;\
  1117. right:0;\
  1118. cursor:pointer;\
  1119. opacity:0.8;\
  1120. background:#fff;\
  1121. color:#303030;\
  1122. }\
  1123. #blockWay{\
  1124. color:#3e3e3e;\
  1125. border:none;\
  1126. }\
  1127. #wrap{\
  1128. position:fixed;\
  1129. width:100%;\
  1130. height:100%;\
  1131. background:rgba(155, 155, 155,0.5);\
  1132. top:0;\
  1133. left:0;\
  1134. z-index:999999999;\
  1135. }\
  1136. .mar{\
  1137. width:100%;\
  1138. height:100%;\
  1139. position:absolute;\
  1140. top:0;\
  1141. left:0;\
  1142. z-index:999999998;\
  1143. -webkit-backface-visibility:hidden;\
  1144. text-align:center;\
  1145. font-size:16px;\
  1146. }\
  1147. .mar input{\
  1148. background:#303030;\
  1149. color:#fff;\
  1150. padding:5px 10px;\
  1151. margin:5px 10px;\
  1152. font-family:"宋体";\
  1153. font-size:14px;\
  1154. border:none;\
  1155. }\
  1156. .mar input:hover{\
  1157. background:#004d40;\
  1158. transition:all 0.2s ease-in-out;\
  1159. }\
  1160. .mar p{\
  1161. color:##2B2929;\
  1162. font-weight:bold;\
  1163. background-color:rgba(72, 70, 70, 0.35);\
  1164. line-height:30px;\
  1165. width:60%;\
  1166. margin:0 auto;\
  1167. }\
  1168. .mar p:hover{\
  1169. color:#fff;\
  1170. background-color:#004d40;\
  1171. transition:all 0.2s ease-in-out;\
  1172. }\
  1173. #list{\
  1174. position:absolute;\
  1175. top:0;\
  1176. left:200px;\
  1177. width:400px;\
  1178. height:0;\
  1179. overflow:hidden;\
  1180. background:inherit;\
  1181. margin:0;\
  1182. }\
  1183. #list tr:hover{\
  1184. background:#004d40;\
  1185. transition:all 0.2s ease-in-out;\
  1186. }\
  1187. .key{\
  1188. float:left;\
  1189. clear:both;\
  1190. margin-left:10px;\
  1191. width:120px;\
  1192. text-align:left;\
  1193. overflow:hidden;\
  1194. text-overflow:ellipsis;\
  1195. white-space:nowrap;\
  1196. }\
  1197. .col{\
  1198. border:none;\
  1199. }\
  1200. .deletThis{\
  1201. float:right;\
  1202. cursor:pointer;\
  1203. margin-right:10px;\
  1204. padding:0 5px;\
  1205. border:0;\
  1206. height:18px;\
  1207. }\
  1208. .disable-btn{\
  1209. background:#6B6B6B;\
  1210. cursor:not-allowed;\
  1211. }\
  1212. #addBlackList input{\
  1213. width:80%;\
  1214. }\
  1215. /*userName列表*/\
  1216. #thread_list>li[data-field] .threadlist_lz>.threadlist_author:hover,.l_post .d_name:hover{\
  1217. background:#004d40;\
  1218. transition:all 0.2s ease-in-out;\
  1219. }\
  1220. #sear{\
  1221. position:relative;\
  1222. margin:0 auto;\
  1223. text-align:center;\
  1224. height:21px;\
  1225. width:100%;\
  1226. border:none;\
  1227. }\
  1228. #confirmBox{\
  1229. width:300px;\
  1230. background:rgba(5, 49, 43, 0.8);\
  1231. position:fixed;\
  1232. left:50%;\
  1233. top:60px;\
  1234. margin-left:-150px;\
  1235. text-align:center;\
  1236. z-index:999999;\
  1237. opacity:0;\
  1238. box-shadow:1px 1px 10px 2px #000000;\
  1239. }\
  1240. #confirmBox input{\
  1241. border:none;\
  1242. padding:10px 30px;\
  1243. margin:10px;\
  1244. cursor:pointer;\
  1245. }\
  1246. #confirmBox input:hover{\
  1247. background:#004d40;\
  1248. transition:all 0.2s ease-in-out;\
  1249. }\
  1250. #confirmBox p{\
  1251. font-size:18px;\
  1252. color:#fff;\
  1253. margin-top:20px;\
  1254. }\
  1255. #block-keyWord{\
  1256. position:absolute;\
  1257. top:0;\
  1258. right:100%;\
  1259. width:200px;\
  1260. height:0;\
  1261. margin:0 !important;\
  1262. padding:0;\
  1263. background-color:inherit;\
  1264. overflow:auto;\
  1265. }\
  1266. span.blockTag{\
  1267. padding:5px 10px;\
  1268. display:inline-block;\
  1269. border:1px solid;\
  1270. border-radius:5px;\
  1271. position:relative;\
  1272. margin:2px 5px;\
  1273. }\
  1274. span.blockTag:hover{\
  1275. background:#08454A;\
  1276. }\
  1277. #blockWord{\
  1278. margin:10px 0;\
  1279. }\
  1280. #addWord{\
  1281. padding:0 5px !important;\
  1282. background-color:transparent !important;\
  1283. border:1px solid #fff !important;\
  1284. color:#fff !important;\
  1285. }\
  1286. #addWord:hover{\
  1287. background-color:rgb(1, 84, 68) !important;\
  1288. }\
  1289. #tag-log>p{\
  1290. margin:10px 0;\
  1291. text-align:left;\
  1292. text-indent:2em;\
  1293. line-height:2em;\
  1294. }\
  1295. #tag-log>p:hover{\
  1296. background:#004d40;\
  1297. transition:all 0.2s ease-in-out;\
  1298. }\
  1299. ';
  1300. GM_addStyle(style);
  1301. })(window,document);