Myself-bbs.com HTML5 Player

HTML5 Player for 云端

Stan na 13-08-2016. Zobacz najnowsza wersja.

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         Myself-bbs.com HTML5 Player
// @namespace    http://myself-bbs.com/
// @version      0.3
// @description  HTML5 Player for 云端
// @author       Deloz
// @match        http://*.myself-bbs.com/*
// @match        http://myself-bbs.com/*
// @grant        none
// @require      http://libs.baidu.com/jquery/1.9.0/jquery.js
// ==/UserScript==

(function($) {
    'use strict';
    var  getUrlVars = function(url){
        var vars = [], hash;
        var hashes = url.slice(url.indexOf('?') + 1).split('&');
        for(var i = 0; i < hashes.length; i++)
        {
            hash = hashes[i].split('=');
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }
        return vars;
    };
    var getUrlVar = function(url, name){
        return  getUrlVars(url)[name];
    };

    $('.various.google').click(function(e) {
        e.preventDefault();
        var self = $(this);
        var url = self.data('href');
        var docId = getUrlVar(url, 'docid');
        var videoUrl = (docId === undefined ? url.replace('/preview', '/view') : 'https://docs.google.com/file/d/'+docId+'/view');
        window.open(videoUrl, '_blank');
    });
})(jQuery);