Amboss No Distractions

Automatically hide all distractions and maximize your reading area in Miamed Amboss cards.

当前为 2016-09-04 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Amboss No Distractions
// @namespace    http://oix.cc/gm
// @description  Automatically hide all distractions and maximize your reading area in Miamed Amboss cards.
// @author       Bin Zhang
// @homepageURL  http://oix.cc/amboss
// @version      0.0.1
// @match        https://amboss.miamed.de/library
// @include      http://amboss-miamed-de.ezproxy.*/library
// @include      https://amboss-miamed-de.ezproxy.*/library
// @run-at       document-idle
// ==/UserScript==

(function(){

var initWatcher = setInterval(function () {
    console.log('watch');
    // Article loaded
    if ($('#LibraryContent').find('article.LearningCard').length > 0 && $('#LibraryContent').first('article.LearningCard').is('[data-xid]')) {
    //if (angular) {
        clearInterval(initWatcher);
        init();
    }
}, 50);

function init() {

    $('#amboss-menu').click();
    //angular.element('#amboss-menu').click();

    LibrarySideMenu.closeSideMenu();

    angular.element('#LearningCard').scope().triggerKeyEvent(32);
    // Simulate keyup event
    //var ev = $.Event('keyup');
    //ev.which = 32; // space
    //$('#LearningCard').trigger(ev);

    //$('#LibraryContent').find('article.LearningCard').length > 0 && Page.updateElements(1)
}

//angular.element('#LearningCard').ready(function () {
    //console.log('cardready', angular);
//});
}());