Mac漢字変換時のキーボードショートカット

矢印キーを使うストレスがヤバくて寿命がマッハなので調べた:

  • Ctrl + p:前の候補 (= ↑, previous)
  • Ctrl + n:次の候補 (= ↓, next)
  • Ctrl + b:前の文節 (= ←, before)
  • Ctrl + f:次の文節 (= →, forward)
  • Ctrl + i:選択中の文節の範囲を縮小 (= shift + ←)
  • Ctrl + o:選択中の文節の範囲を拡大 (= shift + →)

参考:【OS X El Capitan】覚えておくべきMacの日本語入力が捗る便利なショートカットキー

これに加えて、システム環境設定→アクセシビリティから「複合キーを有効」にすることにより入力が非常に捗るようになります。
複合キーとは「sticky modifier」と呼ばれる機能で、例えばCtrl + nを同時押ししなくてもよくなるというものです。
ただのstickyと違い、ctrlを二回叩いておけばその後ずっとctrl押しっぱなし状態が維持されるので、p, n, b, f, i, oキーだけで自在に変換を操ることができます(慣れればきっと)。便利。

参考:Macの複合キーを有効にしてショートカットなどを使いやすくする | bl6.jp

スクロールを支援するブックマークレット

蟲が知らせる スクロールを支援するブックマークレット

公開したのでこっちにも貼っておく




あ、Pixivのやつはだいぶ改良したもののJSファイルの中身を流用したりして「これ公開できんの?」って疑問が湧いたからとりあえず停止で。

Pixiv用ブックマークレットを更新しました

Pixivを見やすくするブックマークレットid:wriggle:20121214)を更新しました(当該エントリ内のスクリプト変更済)。


変更点

  • コメントに関するPixivの仕様変更に対応


注意点

  • 処理速度の遅い環境では誤動作(コメント欄のコメントが重複する)が起こる可能性があります。

Pixivを見やすくするブックマークレット

Pixivのイラスト/漫画ページから余計なものを消すブックマークレットです。特に余計な画像パーツは徹底的に取り除きます。またPixivの使用が微妙に変更されたので直しついでに上げてみる。

何のためのもの?

  • Pixiv公式サイトのイラストと漫画をページ遷移なしでオリジナルサイズで見る

主な機能

  • 全体的にすっきりさせる。画像はプロフィール・イラスト/漫画・イメージレスポンス・背景画像だけ残す
    • イラスト/漫画はクリックで原寸表示切り替え
    • 背景画像はページ一番下/マウスホバーで原寸表示
  • コメントを表示させる
  • アンケートを表示させる(2回実行する必要あり)
    • 回答済みの場合は自分の回答をハイライト
  • ページタイトルを"(pixiv)[UserID-illustID]【作者名】タイトル"の形式に置き換え

※タグ検索から飛んだ場合は2回実行する必要あり
※漫画形式でページ数が多い場合、実行時にしばらく固まります。


Safari, Mobile Safari (iPad mini), Google Chrome上で動作確認済。JavascriptjQueryが動けば使えるはずなのでFirefoxでも多分動きます。


iPadSafariでも使えることが確認できたので少し用途が広がったかもしれない。
スクリプトはこちら

javascript:(function()%7Bif(location.href.match('tag='))%7Blocation.replace(location.href.split('&tag=')%5B0%5D);return;%7D$(document).ready(core);function%20core()%7Bfunction%20getImgUrl(url)%7Bvar%20src=$.ajax(%7Burl:url,async:false%7D).responseText;return%20$('img',$(src)).attr('src');%7Deval($('%23wrapper%3Escript:first').text().split('pixiv.context.').join('var%20'));if($('div.works_display%3Ea').size())%7B$('head').append('%3Cstyle%20/%3E');$('head%3Estyle:last').append('img.illust%20%7Bmax-width:%20740px;%20margin:%206px%200;%20%7D');$('head%3Estyle:last').append('img%23page_bg%20%7Bmax-width:%20100px;%20max-height:%20100px;%20%7D');$('head%3Estyle:last').append('img%23page_bg:hover%20%7Bmax-height:%20none;%20max-width:%20none;%20%7D');var%20img=$('div.works_display%3Ea%3Eimg');if($('div.works_display%3Ea').attr('href').match(/manga/))%7Bvar%20pg=parseInt($('section.work-info%3Eul.meta%3Eli:eq(1)').text().replace('漫画%20','').replace('P',''));for(i=0;i%3Cpg;i++)%7B$('%3Cdiv/%3E').attr('class','image-container').append($('%3Cimg%3E').attr(%7Bclass:'illust',src:getImgUrl(window.location.href.replace('medium','manga_big')+'&page='+i),alt:img.attr('alt')+'_p'+i,title:img.attr('alt')+'_p'+i%7D)).appendTo('div.works_display');%7D%7Delse%7B$('%3Cdiv/%3E').attr('class','image-container').append($('%3Cimg%3E').attr(%7Bclass:'illust',src:getImgUrl(window.location.href.replace('medium','big')),alt:img.attr('alt'),title:img.attr('alt')%7D)).appendTo('div.works_display');%7D$('div.works_display%3Ea').remove();loop=setInterval(function()%7B$('button.comment-show-button:visible').click();$('button.comment-more-button:visible').click();if($('button.comment-show-button:hidden').size()&&$('button.comment-more-button:hidden').size())%7Bloop=0;clearInterval(loop);%7D%7D,500);%7Dloop2=setInterval(function()%7Bif(loop)%7Breturn;%7Delse%7BclearInterval(loop2);$('section.score%3E*:not(dl)').remove();if($('section.questionnaire').size())%7Bif($('section.questionnaire%3Espan.status.toggle-list').size())%7Bif($('section.questionnaire%3Ediv.list:hidden').size())%7B$('section.questionnaire%3Espan.status.toggle-list').click();return;%7Delse%7B$('section.questionnaire%3Ediv.stats:hidden').show();$('section.questionnaire%3E*:not(div.stats)').remove();%7D%7Delse%7B$('section.questionnaire%3Ediv.stats:hidden').show();var%20t=$('section.questionnaire%3Espan.status.toggle-stats').text().split('この作品のアンケートに「')%5B1%5D.split('」と答えました')%5B0%5D;t=$('section.questionnaire%3Ediv.stats:visible%3Etable%3Etbody%3Etr').filter(function()%7Breturn%20$('th',this).text()==t%7D);t.css('color','%23258fb8');$('section.questionnaire%3E*:not(div.stats)').remove();%7D%7Dvar%20r18='';if($('section.work-info%3Eul.meta').text().match('R-18'))%7Br18='%5BR-18%5D';%7D$('title').text('(pixiv)%5B'+userId+'-'+illustId+'%5D'+r18+'【'+userName+'】'+illustTitle);$('head').contents().filter(function()%7Breturn%20this.nodeType==8%7D).remove();$('body').contents().filter(function()%7Breturn%20this.nodeType==8%7D).remove();$('body%3E*:not(%23wrapper)').remove();$('%23wrapper%3E*:not(%23contents,script:eq(0))').remove();$('div.ui-layout-west%3E*:not(div.profile_area)').remove();$('div.profile_area%3E*:not(a,h2)').remove();$('div.profile_area%3Ea').attr('href',window.location.href.split(illustId)%5B0%5D+illustId);$('div.contents-east%3E*:not(div.two_column_body)').remove();$('div.two_column_body%3E*:not(section.work-info,section.work-tags,div.works_display,div.works_info)').remove();$('section.work-info%3Ep.caption').contents().filter(function()%7Breturn%20this.nodeType==3%7D).each(function()%7B$(this).replaceWith($($('%3Cp%3E'+$(this).text()+'%3C/p%3E')).contents());%7D);if($('section.work-tags%3Edl').size())%7B$('span.tags-container').unwrap().unwrap();$('section.work-tags%3E*:not(span.tags-container)').remove();%7D$('span.tags-container%20a%5Bclass%5E=%5C'icon-pixpedia%5C'%5D').remove();$('span.tags-container%20a%5Bhref%5E=%5C'http://comic%5C.pixiv%5C.net%5C'%5D').remove();$('span.tags-container%20a.portal').remove();$('div.works_info%3Ediv.worksOption%3E:not(%5C'form.comment-area,div.worksImageresponse%5C')').remove();$('form.comment-area%3E:not(%5C'ul.comment-list%5C')').remove();$('div.worksOptionRight').remove();$('div.worksImageresponse:not(:contains(%5C'イメージレスポンス%5C'))').remove();var%20bg=$('body').css('background-image');if(bg!='none')%7B$('%3Cimg/%3E').attr(%7Bid:'page_bg',src:bg.replace('url(','').replace(')','').replace(/%5C%22/g,'').replace(/%5C'/g,''),alt:'背景画像',title:'背景画像'%7D).appendTo($('div.two_column_body'));%7D$('head%3Emeta%5Bname%5D').remove();$('%23wrapper').contents().filter(function()%7Breturn%20this.nodeType==8%7D).remove();$('input').remove();$('noscript').remove();$('script:not(:contains(%5C'pixiv.context.illustId%5C'),%5Bsrc*=%5C'jquery%5C'%5D)').remove();var%20script=document.createElement('script');script.type='text/javascript';script.text='$(document).ready(function()%7B$(%5C'img.illust%5C').toggle(function()%7B$(this).css(%5C'max-width%5C',%5C'none%5C');%7D,function()%7B$(this).removeAttr(%5C'style%5C');%7D);%7D);';document.getElementsByTagName('head')%5B0%5D.appendChild(script);%7D%7D,500);%7D%7D)();

インストール方法

  1. このページをブックマーク
  2. ブックマークを編集して、URLを↑のスクリプトに置き換える

または、このリンクをブックマークし、ブックマークの編集で最初の"http://"を削除

使い方
Pixivのイラスト/漫画ページを開き、↑で登録したブックマークを実行

う〜〜ブログブログ

   ;ヾ、,.、,、.、rツ ッッシ、:':' r':' _,、-'゙_,  戻 は F そ 
 ,、,、,ミッン、,._        _,、-'゙_,、-'゙.   っ て. C ん 
 、ィッ ,:、 ゙''ゞ=ミ、~.: _,、-'゙_,、-'゙  __,  て な 2 な 
 }; ヾ ゙' {!li;:,. _,、-'゙_,、-'゙ _,、-'゙,::|_|  来  日 か わ 
 ゞァ''゙ぐ _,、-'゙_,、-'゙ _,、-'゙,、-''" .|_   た 記  ら け 
 ,ヘ:'_,、-'゙_,、-'゙..::「┴_,エ ┴  ''"_|_|  の. に   で 
  └i'゙-ニ,ニエ,.:|ニ「 _エ ┴  ''"_|_   だ   
    |エ | ニエ, |ニ「 _エ ┴  __.|_|_ 
    |エ | ニエ, |ニ「 _エ ┴ 「fj.||__|__| _| 
    |エ | ニエ, |[8] _エ ┴ └‐_|_|__l__,|⊥ |__ 
    |エ | ニエ, |二 _.エ 二.._ |__|__| _|_|_ 
    |エ | ニエ, |┴ _.エ 二.._ |_|__l__,|⊥ |__| 
    |エ | ニエ, |工 _.エ 二.._ |__|__| _|_|_ 
    |エ | ニエ, |工 _.エ 二.._ |_|__l__,|⊥ |__ 
  -,-=''┷━━|┬ニエ ┬--  .|__|__| _|_|_ 
   ''ーニ_''ー::、_ ゙┷ 工_二'‐-、,_|_|__l__,|⊥ |__ 
  二二二`''ーニ`_''ー-、_¨''━、L|__|__| _|_|_ 
  二二二二二二二`''ーニ_''ー 、_       |⊥ |__

Pixiv閲覧用のブックマークレットつくった

2012.08.13 R-18Gのイラストに対して、ページタイトルに[R-18]が入らない問題を修正

2012.08.09 Operaで背景画像の抽出が機能しない不具合を修正しました。

Pixivのページから広告をはじめ色々な装飾をできるだけ取り除くブックマークレットです。できることはだいたい以下の通り

  • 広告を除去する
  • プロフ画像とイラスト以外の画像をほとんど全て除去する(百科事典へのリンク画像等も含む)
  • イラストはオリジナル画像を貼り直す
  • 漫画の場合は全ページを展開して貼り直し、ページ遷移なしで見られるようにする
    • イラスト・漫画ともに画像が大きい場合はクリックすればオリジナルサイズで表示する
  • 背景画像がある場合、ページの一番下に貼る(マウスオーバーでオリジナルサイズ)


確認済みの動作環境


スクリプトはこちら。
はてなダイアリーではJavascriptのリンクが作れないっぽいので直貼りしています。面倒ですがブックマークの編集で以下のコードを貼付けてください。

javascript:(function(){$(document).ready(function(){function getImgUrl(url){var src=$.ajax({url:url,async:false}).responseText;return $("img",$(src)).attr("src");}if(window.location.href.match("tag=")){window.location.href=window.location.href.split("&tag=")[0];return;}eval($("#wrapper>script:first").text().split("pixiv.context.").join("var "));if($("div.works_display>a").size()){$("head").append("<style />");$("head>style:last").append("img.illust {max-width: 740px; margin: 6px 0; }");$("head>style:last").append("img#page_bg {max-width: 100px; max-height: 100px; }");$("head>style:last").append("img#page_bg:hover {max-height: none; max-width: none; }");var img=$("div.works_display>a>img");if($("div.works_display>a").attr("href").match(/manga/)){var pg=parseInt($("section.work-info>ul.meta>li:eq(1)").text().replace("漫画 ","").replace("P",""));for(i=0;i<pg;i++){$("<div/>").attr("class","image-container").append($("<img>").attr({class:"illust",src:getImgUrl(window.location.href.replace("medium","manga_big")+"&page="+i),alt:img.attr("alt")+"_p"+i,title:img.attr("alt")+"_p"+i})).appendTo("div.works_display");}}else{$("<div/>").attr("class","image-container").append($("<img>").attr({class:"illust",src:getImgUrl(window.location.href.replace("medium","big")),alt:img.attr("alt"),title:img.attr("alt")})).appendTo("div.works_display");}$("div.works_display>a").remove();if($("#one_comment_area:hidden").size())one_comment_view();}$("section.score>*:not(dl)").remove();if($("section.questionnaire").size()){if($("section.questionnaire>span.status.toggle-list").size()){if($("section.questionnaire>div.list:hidden").size()){$("section.questionnaire>span.status.toggle-list").click();return;}else{$("section.questionnaire>div.stats:hidden").show();$("section.questionnaire>*:not(div.stats)").remove();}}else{$("section.questionnaire>div.stats:hidden").show();var t=$("section.questionnaire>span.status.toggle-stats").text().split("この作品のアンケートに「")[1].split("」と答えました")[0];t=$("section.questionnaire>div.stats:visible>table>tbody>tr").filter(function(){return $("th",this).text()==t});t.css("color","#258fb8");$("section.questionnaire>*:not(div.stats)").remove();}}var r18="";if($("section.work-info>ul.meta").text().match("R-18")){r18="[R-18]";}$("title").text("(pixiv)["+userId+"-"+illustId+"]"+r18+"【"+userName+"】"+illustTitle);$("head").contents().filter(function(){return this.nodeType==8}).remove();$("body").contents().filter(function(){return this.nodeType==8}).remove();$("body").contents().not("#wrapper").remove();$("body>*:not(#wrapper)").remove();$("#wrapper>*:not(#contents,script:eq(0))").remove();$("div.ui-layout-west>*:not(div.profile_area)").remove();$("div.profile_area>*:not(a,h2)").remove();$("div.profile_area>a").attr("href",window.location.href.split(illustId)[0]+illustId);$("div.contents-east>*:not(div.two_column_body)").remove();$("div.two_column_body>*:not(section.work-info,#tag_area,div.works_display,div.works_info)").remove();$("section.work-info>p.caption").contents().filter(function(){return this.nodeType==3}).each(function(){$(this).replaceWith($($("<p>"+$(this).text()+"</p>")).contents());});$("#tag_area>p").replaceWith($("#tags"));$("#tags>a").filter(":has(img)").remove();$("div.works_info>div.worksOption>:not('#one_comment_area,div.worksImageresponse')").remove();$("div.worksOptionRight").remove();$("div.worksImageresponse:not(:contains('イメージレスポンス'))").remove();var bg=$("body").css("background-image");if(bg!="none"){$("<img/>").attr({id:"page_bg",src:bg.replace("url(","").replace(")","").replace(/\"/g,"").replace(/\'/g,""),alt:"背景画像",title:"背景画像"}).appendTo($("div.two_column_body"));}$("head>meta[name]").remove();$("#wrapper").contents().filter(function(){return this.nodeType==8}).remove();$("input").remove();$("noscript").remove();$("script:not(:contains('pixiv.context.illustId'),[src*='jquery'])").remove();var script=document.createElement("script");script.type="text/javascript";script.text='$(document).ready(function(){$("img.illust").toggle(function(){$(this).css("max-width","none");},function(){$(this).removeAttr("style");});});';document.getElementsByTagName("head")[0].appendChild(script);});})();

使い方
Pixivのイラストページまたは漫画ページでブックマークレットを起動するとページが整形されます。※ページが読み込み中の場合は読み込み完了するまでタイムラグが発生します。

  1. アンケートがある場合はアンケートが開かれます。
  2. もう一度ブックマークレットを起動すると、アンケートに回答した場合は自分の回答が水色にハイライトされた状態で整形され、回答していない場合は黒字のままで整形されます。

なお、タグ検索から飛んだ場合には、ブックマークレットを呼び出した際に一度ページがリロードされます。これはURLの末尾に"&tag=***"という文字列がついてしまっているのを削除する目的で行われる動作です。

蛇足

  • Operaの場合、SpeedDialのURLを編集してブックマークレットにすると、Ctrl+数字キーのショートカットで呼び出せるので便利です。