优化代码

This commit is contained in:
xing 2020-04-19 08:35:27 +08:00
parent bcf49f1d9d
commit 29df7d6de9

View File

@ -14,8 +14,6 @@
(function () { (function () {
'use strict'; 'use strict';
let obs;
function jpg(v) { function jpg(v) {
let fimgs = v.querySelectorAll('span[class="wrap pbimgwapper"]>img.BDE_Image'); let fimgs = v.querySelectorAll('span[class="wrap pbimgwapper"]>img.BDE_Image');
if (fimgs.length > 0) { if (fimgs.length > 0) {
@ -29,7 +27,7 @@
let h = value.dataset.url.replace('tiebapic', 'imgsrc').replace('tiebapic', 'imgsrc'); let h = value.dataset.url.replace('tiebapic', 'imgsrc').replace('tiebapic', 'imgsrc');
let tmp = decodeURIComponent(h.split('&src=')[1]).split('/'); let tmp = decodeURIComponent(h.split('&src=')[1]).split('/');
tmp = tmp[tmp.length - 1]; tmp = tmp[tmp.length - 1];
value.outerHTML = `<div class="pb_img_item" data-url="${h}"><img data-url="${tmp}" class="BDE_Image" src="${h}"></div>`; value.outerHTML = `<div class="pb_img_item" data-url="${h}"><img data-url="${tmp}" class="BDE_Image" src="${h}" alt=""></div>`;
}) })
} }
} }
@ -48,7 +46,6 @@
} }
} }
function delElement(selectors) { function delElement(selectors) {
selectors.forEach(value => { selectors.forEach(value => {
let x = document.querySelector(value); let x = document.querySelector(value);
@ -526,7 +523,6 @@
}) })
} }
function list() { function list() {
slio(document.querySelectorAll('#frslistcontent>li')); slio(document.querySelectorAll('#frslistcontent>li'));
delElement([ delElement([
@ -627,7 +623,6 @@
} }
function detail() { function detail() {
god(); god();
p(); p();
@ -661,8 +656,8 @@
} }
let book; let book, svgss;
let svgss;
function clickControl() { function clickControl() {
let el = ['list_item_top_name', 'j_new_header_reply', 'list_item_user_wrap', 'user_img', 'user_name', 'icon_tieba_edit', 'reply_num', 'for_app_label_text_tag']; let el = ['list_item_top_name', 'j_new_header_reply', 'list_item_user_wrap', 'user_img', 'user_name', 'icon_tieba_edit', 'reply_num', 'for_app_label_text_tag'];