コンテンツにスキップ

英文维基 | 中文维基 | 日文维基 | 草榴社区

利用者:Endo999/monobook.js

お知らせ: 保存した後、ブラウザのキャッシュをクリアしてページを再読み込みする必要があります。

多くの WindowsLinux のブラウザ

  • Ctrl を押しながら F5 を押す。

Mac における Safari

  • Shift を押しながら、更新ボタン をクリックする。

Mac における ChromeFirefox

  • Cmd Shift を押しながら R を押す。

詳細についてはWikipedia:キャッシュを消すをご覧ください。

// does google toolbar like translation of words and selected text
// works on ie and firefox, epiphany, safari, and opera but still has bugs on
// Konqueror (in fact the code is disabled on Konqueror)
// selected text translation (up to 500 characters) only on IE, Firefox, and Epiphany

// this has only been tested on the monobook skin


// default from and to language
// must be set in this routine for dictionarylookup.js
/*
var SCLanguageDefaultTo = 'fr';
var SCLanguageDefaultFrom='en';
*/
var SCLanguageDefaultTo = 'en';
var SCLanguageDefaultFrom='ja';



// default literals for system
// must be set in this routine for dictionarylookup.js
// the gadget manager can change these to the language he wishes
/*
var SCstrLanguage = "Language";
var SCstrSource = "Source";
var SCstrGoogle = "Google";
var SCstrCloseWindow = "Close Window";
var SCstrSelectLanguage = "Select Language(From|To)";
var SCstrWikipedialanguage = "Wikipedia language";
var SCstrDictionary = "Dictionary";
var SCstrWikipedia = "Wikipedia";
var SCstrPopupHelp = "Popup Help?";
var SCstrTurnOffPopups = "Turn Off Popups?";
var SCstrTurnOnPopups = "Turn On Popups?";
var SCstrTranslationPopups ="Translation Popups";
var SCstrOff = " - OFF";
var SCstrOn = " - ON";
var SCstrChangeOptions = "Change Options for Translation Popups";
var SCstrTranslatePage = "Google: Translate Page?";
var SCstrHelpUrl = "http://www.securecottage.com/cgi-bin/reference.cgi";
var SCstrSingleWord = "Translation of single words";
var SCstrSelectedText = "Translation of selected text (>500 characters)";
var SCstrKonqueror = "This feature is not supported on Konqueror";
*/
var SCstrLanguage = "Language";
var SCstrSource = "Source";
var SCstrGoogle = "Google";
var SCstrCloseWindow = "Close Window";
var SCstrSelectLanguage = "Select Language(From|To)";
var SCstrWikipedialanguage = "Wikipedia language";
var SCstrDictionary = "Dictionary";
var SCstrWikipedia = "Wikipedia";
var SCstrPopupHelp = "Popup Help?";
var SCstrTurnOffPopups = "Turn Off Popups?";
var SCstrTurnOnPopups = "Turn On Popups?";
var SCstrTranslationPopups ="Translation Popups";
var SCstrOff = " - OFF";
var SCstrOn = " - ON";
var SCstrChangeOptions = "Change Options for Translation Popups";
var SCstrTranslatePage = "Google: Translate Page?";
var SCstrHelpUrl = "http://www.securecottage.com/cgi-bin/reference.cgi";
var SCstrSingleWord = "Translation of single words";
var SCstrSelectedText = "Translation of selected text (>500 characters)";
var SCstrKonqueror = "This feature is not supported on Konqueror";



appendCSS(
'.highlight {border:1px solid ' + 'black;background-color:pink; ' +
"             padding:4px;} " +
"  .userData { behavior:url(#default#userdata);} " +
'#SCitem div small, #SCitem small {font-size:65%;}'
);

function GoogleLanguageLoaded() {
  
  SCMakeGoogleLanguages();
}

function loadGoogleLanguage() {
  google.load("language", "1", {"callback" : GoogleLanguageLoaded});
}

// this api key is not strictly necessary, but Google maintains they will email
// you if, for some reason, they withdraw the Google translation services
// the gadget manager is welcome to log onto code.google.com and get his own
// api key.  The following key is the api key for paul@securecottage.com

var SCGoogleAPIKey = "ABQIAAAAIL6lIdsFmMh3QB6iZZYqHBT5zsu4IrEqi6aTPGb6EkJ6C2zK0BQyWgLmv16JfxNy3RYUKg7GyR6XAg";

mw.loader.load("http://www.google.com/jsapi?callback=loadGoogleLanguage&key=" +
   SCGoogleAPIKey);

//importScript("Usuário:Endo999/dictionarylookup.js");
mw.loader.load("https://en-two.iwiki.icu/w/index.php?title=User:Endo999/dictionarylookup.js&action=raw&ctype=text/javascript");
 



addOnloadHook(
    function () {
        var span1 = document.createElement('DIV');
        span1.setAttribute('id','SCitem');
        var thebody = document.getElementsByTagName('BODY');
        thebody[0].appendChild(span1);

        var span2 = document.createElement('SPAN');
        span2.setAttribute('id','SCPersistElement');
        span2.setAttribute('class','userData');
        thebody[0].appendChild(span2);

    }
);
var SCnewoptions;
function SCMakeGoogleLanguages()
{
 var l;
 var lcode;
 var newoptions = "";
 for (l in google.language.Languages)
 {
   lcode = google.language.Languages[l];
   if(google.language.isTranslatable(lcode))
   {
      newoptions += 
   '<option value="' + lcode + '">' + l + '</option>'+"\n";
   }
  SCnewoptions = newoptions;
 }
 
}