Google machine-learning course helper

将谷歌机器学习教程的wiki英文链接改成中文链接,点击链接将在新标签页中打开,同时点击右上角的wiki图标可在新标签页中打开原wiki英文链接

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Google machine-learning course helper
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  将谷歌机器学习教程的wiki英文链接改成中文链接,点击链接将在新标签页中打开,同时点击右上角的wiki图标可在新标签页中打开原wiki英文链接
// @author       You
// @match        https://developers.google.cn/machine-learning/crash-course/prereqs-and-prework
// @grant        none
// @require      http://code.jquery.com/jquery-1.11.0.min.js
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);

(function() {
    'use strict';
    // Your code here...
    $('a[href]').each(function(){
        let href=$(this).attr('href');
        if(href&&href.indexOf('https://wikipedia.org/wiki/')==0){
            $(this).attr('href','https://zh.wikipedia.org/wiki/'+$(this).html());
            $(this).attr('target','_blank');
            $(this).after('<a target="_blank" href="'+href+'"><img src="https://en.wikipedia.org/static/favicon/wikipedia.ico" width="12px" height="12px" style="vertical-align:top"/></a>');
        }
    });
})();