利用者:Shin-kai/monobook.js

提供:Wikisource

注意: 保存後、変更を確認するにはブラウザーのキャッシュを消去する必要がある場合があります。

  • Firefox / Safari: Shift を押しながら 再読み込み をクリックするか、Ctrl-F5 または Ctrl-R を押してください (Mac では ⌘-R)
  • Google Chrome: Ctrl-Shift-R を押してください (Mac では ⌘-Shift-R)
  • Internet Explorer / Microsoft Edge: Ctrl を押しながら 最新の情報に更新 をクリックするか、Ctrl-F5 を押してください
  • Opera: Ctrl-F5を押してください
//----------------------------
//選択した部分を特定のkeyを押してウィキペディア、ウィクショナリーで新しいウィンドウで開くスクリプト。
//Wikipedia: Ctrl + Shift + p
//Wiktionary: Ctrl + Shift + t
//----------------------------
function getSelectIE(){
if(navigator.appName == "Microsoft Internet Explorer"){
if( (event.keyCode == 84) && (event.shiftKey == true) && (event.ctrlKey == true) ){
xx = document.selection.createRange();
window.open("http://ja.wiktionary.org/wiki/" + xx.text , "new" , "");
}
if( (event.keyCode == 80) && (event.shiftKey == true) && (event.ctrlKey == true) ){
xx = document.selection.createRange();
window.open("http://ja.wikipedia.org/wiki/" + xx.text , "new" , "");
}
}
}

function getSelectNN(e){
if(navigator.appName == "Netscape"){
if( (e.which == 84) && (e.shiftKey == true) && (e.ctrlKey == true) ){
xx = document.getSelection();
window.open("http://ja.wiktionary.org/wiki/" + xx , "new" , "");
}
if( (e.which == 80) && (e.shiftKey == true) && (e.ctrlKey == true) ){
xx = document.getSelection();
window.open("http://ja.wikipedia.org/wiki/" + xx , "new" , "");
}
}
}
if(navigator.appName == "Microsoft Internet Explorer"){
document.onkeydown = getSelectIE;
}
if(navigator.appName == "Netscape"){
document.onkeydown = getSelectNN;
}