Just1n
V2EX  ›  V2EX

V2EX 现在原生支持@自动提示所有已评论的 ID 功能了?

  •  3
     
  •   Just1n · Nov 21, 2014 · 2911 views
    This topic created in 4206 days ago, the information mentioned may be changed or developed.
    刚才我用@回复的时候,有两个自动提示,一个是Userscript,一个好像是V2EX原生支持的。
    @Livid
    6 replies    2014-11-21 21:15:45 +08:00
    Mihuwa
        1
    Mihuwa  
       Nov 21, 2014
    @Just1n 测试了一下,确实。
    yautou
        2
    yautou  
       Nov 21, 2014
    @Mihuwa 借你test一下
    Mihuwa
        3
    Mihuwa  
       Nov 21, 2014
    @yautou 貌似最多显示10个
    Just1n
        4
    Just1n  
    OP
       Nov 21, 2014
    @Mihuwa @yautou 不知道翻页的是否可以。
    shinwood
        5
    shinwood  
       Nov 21, 2014
    代码当中有:

    $("#reply_content").textcomplete([{
    match: /(^|\s)@(\w*)$/,
    search: function (term, callback) {
    term = term.toLowerCase();
    var words = ['Just1n', 'Mihuwa', 'yautou'];
    callback($.map(words, function (word) {
    return word.toLowerCase().indexOf(term) === 0 ? word : null;
    }));
    },
    replace: function (value) {
    return '$1@' + value + ' ';;
    }
    }]);


    肯定是原生支持了。
    0x142857
        6
    0x142857  
       Nov 21, 2014
    Nice.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3168 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 13:52 · PVG 21:52 · LAX 06:52 · JFK 09:52
    ♥ Do have faith in what you're doing.