非公開 Mastodon メディア付き発言のみ表示

  • /*
     * @title Mastodon メディア付き発言のみ表示
     * @description こちらは更新しません。http://let.hatelabo.jp/pacochi/let/hLHW8svRzY8o をお使いください。
     * @include *
     * @license MIT License
     * @javascript_url
     * @private
     */
     
    /*
    このブックマークレットの更新は停止しました。
    以後は同様の動作が可能になる以下のものをお使いください。
    
    Mastodon 連合 or ローカルタイムライン用正規表現フィルタ
    http://let.hatelabo.jp/pacochi/let/hLHW8svRzY8o
    */
    
    ((d = document, o, x, i, l, c) => {
    
    	o = new MutationObserver(s => s.forEach(t => {
    
    		x = d.evaluate(
    		 './/div[@class="status"][not(div/div/button/i[contains(@class, "eye")])]',
    		 t.target, null, 6, x);
    		for (i = 0; i < x.snapshotLength; i++) x.snapshotItem(i).style.display = 'none';
    
    
    	}));
    
    	l = $('.columns-area');
    	c = $('#mute-buttons');
    	if (!c[0]) c = $('<div />')
    	 .css({ position: 'fixed', height: '1em', bottom: '2em', right: 0, zIndex: 99 })
    	 .attr('id', 'mute-buttons').prependTo(l);
    	c.append(
    	 $('<button />').text('?')
    	 .click(function (e, b) {
    
    		b = $(this);
    
    		if (b.text() == '?') {
    
    			b.text('?');
    			o.observe(l.get(0), {
    			 childList: 1,
    			 subtree: 1
    			});
    
    		} else {
    
    			b.text('?');
    			o.disconnect();
    			$('.status').filter(":hidden").show();
    
    		}
    
    	 }).click()
    	);
    
    })();
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2017/04/26 22:34:06 - 2017-04-26
  2. 2017/04/20 23:35:03 - 2017-04-20
  3. 2017/04/19 12:35:37 - 2017-04-19