Myself-bbs.com HTML5 Player

HTML5 Player for 云端

Tính đến 13-08-2016. Xem phiên bản mới nhất.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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

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

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

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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);