LoginSignup
1
1

More than 5 years have passed since last update.

@kony_t chatworksのイベント通知で幅が取られるのをましにするJS

Last updated at Posted at 2012-03-16
// Clean up chatwork's posts of task events
// https://www.chatwork.com/

(function() {
    function cleanPost($target) {
        var child = $target.children();
        $target.text($target.text().split("\n")[0]);
        $target.append(child);
    }

    function main() {
        $.each($('.dev_info'), function(i, target) {
            cleanPost($(target));
        });

        $(document).bind('DOMNodeInserted', function(ev){
            if (!$(ev.target).hasClass('ui_chat')) return;
            cleanPost($(ev.target).find('.dev_info'));
        });
    }

    main();
})();

1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1