From 5f4c75494f164ccc4fee27b01f22be1a2aed5801 Mon Sep 17 00:00:00 2001 From: xing Date: Sat, 28 Mar 2020 01:09:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tieba page.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tieba page.js b/tieba page.js index 388c30a..d930382 100644 --- a/tieba page.js +++ b/tieba page.js @@ -452,10 +452,6 @@ function clickControl() { - let a = /function\(SignArrow\)\{(.*?)\}\)\;\}\)/.exec($('html').html())[1].replace('new SignArrow', ''); - - let _sl = (new Function(a + ';return _sl'))(); - 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']; document.querySelector('body').addEventListener('click', ev => { for (let i in el) { @@ -550,14 +546,32 @@ if (ev.target.classList.contains('j_like')) { ev.stopPropagation(); ev.preventDefault(); + let a = /function\(SignArrow\)\{(.*?)\}\)\;\}\)/.exec($('html').html())[1].replace('new SignArrow', ''); + let _sl = (new Function(a + ';return _sl'))(); F.use(['sfrs/widget/sign_arrow'], SignArrow => { let sl = new SignArrow(_sl); sl.likeHandle(); }); } + + if (ev.target.classList.contains('bookmark_icon')) { + ev.stopPropagation(); + ev.preventDefault(); + let a = /function\(MoreNewSpinner\)\{((.*?)moreNewSpinner\.init\(\);)/.exec($('html').html())[2].replace('new MoreNewSpinner', ''); + let c = (new Function(a + ';return moreNewSpinner'))(); + F.use(['spb/widget/more_newspinner'], MoreNewSpinner => { + let moreNewSpinner = new MoreNewSpinner(c); + moreNewSpinner.init(); + moreNewSpinner.handleCollect(ev); + }); + + } + if (ev.target.classList.contains('j_sign')) { ev.stopPropagation(); ev.preventDefault(); + let a = /function\(SignArrow\)\{(.*?)\}\)\;\}\)/.exec($('html').html())[1].replace('new SignArrow', ''); + let _sl = (new Function(a + ';return _sl'))(); F.use(['sfrs/widget/sign_arrow'], SignArrow => { let sl = new SignArrow(_sl); sl.signHandle(); @@ -572,7 +586,7 @@ if (ev.target.classList.contains('icon_tieba_edit')) { //todo 发帖 似乎没相关的调用模块??? } - //console.log(ev.target,ev.target.tagName); + console.log(ev.target, ev.target.tagName); }, true); }