Created
October 21, 2011 19:31
-
-
Save takehiko/1304711 to your computer and use it in GitHub Desktop.
KWIC表示のbookmarklet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li><a href="javascript:(function(){var t='。',L=t.length,D='・',w=window,s=w.getSelection().toString(),d=w.open().document,m=10;for(q=m;q!=0;q--)s=D+s+D;d.writeln('<pre>');while((p=s.indexOf(t,q))!=-1){d.writeln(s.substr(p-m,L+2*m).replace(/[\u0000-\u001F|\u007F]/g,D).replace(/[\u0020-\u007E]/g,'$&_'));q=p+1;}d.writeln('</pre>');d.close();})();">「。」で検索</a></li> | |
<li><a href="javascript:(function(){var t='.',L=t.length,D='・',w=window,s=w.getSelection().toString(),d=w.open().document,m=10;for(q=m;q!=0;q--)s=D+s+D;d.writeln('<pre>');while((p=s.indexOf(t,q))!=-1){d.writeln(s.substr(p-m,L+2*m).replace(/[\u0000-\u001F|\u007F]/g,D).replace(/[\u0020-\u007E]/g,'$&_'));q=p+1;}d.writeln('</pre>');d.close();})();">「.」で検索</a></li> | |
<li><a href="javascript:(function(){var t='順',L=t.length,D='・',w=window,s=w.getSelection().toString(),d=w.open().document,m=10;for(q=m;q!=0;q--)s=D+s+D;d.writeln('<pre>');while((p=s.indexOf(t,q))!=-1){d.writeln(s.substr(p-m,L+2*m).replace(/[\u0000-\u001F|\u007F]/g,D).replace(/[\u0020-\u007E]/g,'$&_'));q=p+1;}d.writeln('</pre>');d.close();})();">「順」で検索</a></li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment