Open In Calc (MyMathLab / Pearson)

Converts the accessibility text of equation to plain text then opens it in WolfRamAlpha

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Open In Calc (MyMathLab / Pearson)
// @namespace    https://www.mattrangel.net
// @version      0.1
// @description  Converts the accessibility text of equation to plain text then opens it in WolfRamAlpha
// @author       Matt
// @match        https://xlitemprod.pearsoncmg.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=pearson.com
// @grant        none
// @license      GNU GPLv3
// ==/UserScript==
const rlist = [["Upper", ""],["equals","="],["left parenthesis ","("],["plus","+"],["StartFraction","("],["Over",")/("],["EndFraction",")"],[" right parenthesis",")"],[" Superscript ","^"],[" squared","^2"],["minus","-"],[" cubed","^3"],["negative ","-"],["times","*"],["less than or ","<"],["less than","<"],["greater than or ",">"],["greater than",">"],[" Subscript ","_"],["Baseline",""],["StartRoot","sqrt("],["EndRoot",")"]];
var txt = "";
function doc_keyUp(e) {
    //Tilde - Opens text in WolfRamAlpha
    if (e.key == "`") {
        txt = document.getElementsByClassName("eqAccessibleLabel")[0].innerText;
        for (let i = 0; i < rlist.length; i++) {
            txt = txt.replaceAll(rlist[i][0],rlist[i][1]);
        }
        var wra_link = ("https://www.wolframalpha.com/input?i=" + encodeURIComponent(txt));
        window.open(wra_link, "_blank");
    }
    //F2 - Copies text to clipboard for troubleshooting
    else if (e.key =="F2") {
        var lst = document.getElementsByClassName("eqAccessibleLabel");
        txt = "";
        for (let i = 0; i < lst.length; i++) {
            txt += (lst[i].innerText + " ");
        }
        for (let i = 0; i < rlist.length; i++) {
            txt = txt.replaceAll(rlist[i][0],rlist[i][1]);
        }
        navigator.clipboard.writeText(txt);
    }
}

document.addEventListener('keyup', doc_keyUp, false);