V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
vitovan

于是我重新设计了 V2EX - v2excellent.js

  vitovan · Nov 24, 2015 · 17587 views
This topic created in 3808 days ago, the information mentioned may be changed or developed.

跳过正文:https://vitovan.github.io/v2excellent.js/

缘起

看到一个贴子 于是我攒了一个黑苹果 ,大家讨论的热火朝天,于是我点了进去:

贴子倒是没什么可吐槽的,关键是回复

根本看不懂啊,不知道大家都在讨论什么呀!!

“ I217 可以用 AppleIntelE1000e.kext 来完美驱动”,这...... 指的是......

于是我拖到下方,找到分页按钮,用强大的人工智能,终于搞清楚了大家都在说些什么。

于是

想,平时看 HackerNews 的评论体验多好呀,明确的知道大家都在讨论什么,评论嵌套着很方便阅读么!为毛 V2EX 不搞一搞?

于是我决定搞一搞。

然后

发现 V2EX 与 HN 不同的一点是:回复中可以同时回复多人,这...... 不是嵌套关系。

不好搞啊......

不过

还是搞了出来。

可能算法上不很严谨,但效果还是蛮好的。

发出来给大家试试,要是觉得不错的话,封成插件呀~

效果是这样的:

主页在这里:https://vitovan.github.io/v2excellent.js/

源码在这里:https://github.com/VitoVan/v2excellent.js

Supplement 1  ·  Nov 24, 2015
要是大家觉得有用的话,要不封装成插件?支持 Chrome / Firefox / User Script ?
Supplement 2  ·  Nov 24, 2015
支持跨页啊,盆友们。自动提取帖子所有回复。
Supplement 3  ·  Nov 24, 2015
Supplement 4  ·  Nov 25, 2015

升级了,请删除当前书签,前往项目主页重新添加 http://vitovan.github.io/v2excellent.js/

2015/11/25 Add feature: Image Upload
2015/11/25 Add feature: #reply42 Jump
2015/11/25 Add feature: Gift ClickOnce
2015/11/25 Add feature: Floor Specification

Supplement 5  ·  Nov 25, 2015
Supplement 6  ·  Apr 15, 2017
125 replies    2018-01-05 13:48:10 +08:00
1  2  
lenovo
    101
lenovo  
   Nov 27, 2015
r#100 @vitovan https://greasyfork.org/en/scripts/3452-v2ex 增强插件
之前签到用的这个脚本
starship
    102
starship  
   Nov 27, 2015
r#101 @vitovan 感谢回复,还是不行。我先安装了 https://greasyfork.org/en/scripts/14182-v2excellent-js ,然后打开 V2EX 首页,按 F12 , console ,然后点击“领取今日奖励”,显示的错误信息为: XMLHttpRequest cannot load https://v2ex.com/mission/daily. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.v2ex.com' is therefore not allowed access.
另外点击回复按钮,有些时候直接显示 r#+楼层数,后面跟上 @用户名;有些时候没有显示,直接 @用户名。
starship
    103
starship  
   Nov 27, 2015
r#101 @lenovo 感谢,已经用上。
vitovan
    104
vitovan  
OP
   Nov 27, 2015 via Android
r#102 @starship
哈,我知道啦,你用的是 http 协议且带 www 头的网址访问的 V2EX ,而领取今日奖励的页面默认是 https 且不带 www 头的地址,所以出现了跨域问题。

等晚上更新一下,多谢回復呀。

在此期间你可以试试用 https://v2ex.com 的方式访问 V2EX 应该就没有问题啦!
starship
    105
starship  
   Nov 27, 2015
r#104 @vitovan 经过你一点拨,原来如此,那请问 http://www.v2ex.comhttps://v2ex.com 有什么区别吗?是不是 https://v2ex.com 相对更安全些?
starship
    106
starship  
   Nov 27, 2015
r#104 @vitovan 看了源代码,因为自己不知道如何才能使函数在上面两个网址都生效,于是很笨地复制粘贴了两份,把第二份的网址修改成$.get('http://www.v2ex.com/mission/daily',function(result),似乎有效果,还是等更新吧。
vitovan
    107
vitovan  
OP
   Nov 27, 2015 via Android
r#105 @starship 是的, https://v2ex.com 更安全有些,通常情况下还可以防止被监听。
vitovan
    108
vitovan  
OP
   Nov 27, 2015
r#106 @starship 已修复,更新下明天试试吧~
starship
    109
starship  
   Nov 27, 2015
r#108 @vitovan thankyou 啦,原来直接去掉前面的域名就好:)
starship
    110
starship  
   Nov 27, 2015
r#108 @vitovan 另外建议: function reArrangeComments 那 margin-left 由 21px 改为 5px 或者 2px ,这样当有很多层嵌套关系时,排列比较好看:)
vitovan
    111
vitovan  
OP
   Nov 28, 2015
r#110 @starship 已修正,更新试试?

另外,如果你用 GitHub 的话,随意发 Pull Request 啊~

https://github.com/VitoVan/v2excellent.js
restran
    112
restran  
   Nov 30, 2015
很棒的想法,我觉得知乎回答的长文阅读体验不是很好,是不是也可以用类似的方法美化一下。
vitovan
    113
vitovan  
OP
   Nov 30, 2015 via Android
@restran 很少上知乎呀…………
cwhong4399
    114
cwhong4399  
   Dec 1, 2015
嵌套太多层,头像挤到用户名了,看楼上的那些回复
vitovan
    115
vitovan  
OP
   Dec 2, 2015
r#114 @cwhong4399 可否帮忙截个图?另外发下您的浏览器版本号?我这里没有出现您說的那个情况呀~
jaylong
    116
jaylong  
   Jan 5, 2017
这个目前还有没有 bookmarklet 版本啊?必须要装油猴才能用吗?
vitovan
    117
vitovan  
OP
   Jan 6, 2017 via Android
@jaylong 没有呢~等有时间了试着加上。
vitovan
    118
vitovan  
OP
   Apr 15, 2017
@starship #103 Test new feature
vitovan
    119
vitovan  
OP
   Apr 15, 2017
@dotpig
@vitovan #113 Testing new feature, sorry for bothering.
starship
    120
starship  
   Apr 15, 2017
#118 感谢更新,参见 issues : https://github.com/VitoVan/v2excellent.js/issues/6
vitovan
    121
vitovan  
OP
   May 29, 2017
@starship #120 已修复呦~
slimyy
    122
slimyy  
   Sep 15, 2017
这个东西现在不能用了吗?还是有新版本或替代方案?
vitovan
    123
vitovan  
OP
   Sep 23, 2017
@slimyy 为什么不能用啦?
slimyy
    124
slimyy  
   Jan 3, 2018
@vitovan 用不起来,我在 360 极速模式下(请原谅我使用 360 ),将你的 JS 拖入到扩展里,启用后,打开 V2EX,并没有什么改变,F12 看 console,是:
Uncaught ReferenceError: $ is not defined
at chrome-extension://nijlkkfjhphodcfpgcjhlonjepbdddnh/script.js:13
at chrome-extension://nijlkkfjhphodcfpgcjhlonjepbdddnh/script.js:368

然后,我在 chrome 下来试。也是同样拖入 JS。但再次打开的时候,提示就是“此扩展程序可能已损坏。” chrome 版本是 63.0.3239.84 (正式版本) ( 64 位)

我该怎么办。
vitovan
    125
vitovan  
OP
   Jan 5, 2018
1  2  
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4542 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 54ms · UTC 01:01 · PVG 09:01 · LAX 18:01 · JFK 21:01
♥ Do have faith in what you're doing.