vocabtracker wide mode

Moves the transcript element to the otherwise unoccupied area to the right of the window

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name vocabtracker wide mode
// @namespace vocabtrackermod
// @author iniquitousx
// @description Moves the transcript element to the otherwise unoccupied area to the right of the window
// @match https://*.vocabtracker.com/getPage/Studying/*
// @license MIT
// @version 1.22
// @run-at document-idle
// ==/UserScript==



var intv = setInterval(function() {



var sect = document.querySelector("#root > section");
var col = document.querySelector("#root > section > div");
col.id = "main_col";

if(!(col.childElementCount>3)){
    console.log("no elements");
    return false;

}

var newDiv = document.createElement("div");
newDiv.style.display="flex";
newDiv.style.flexDirection = "column";
newDiv.style.flexGrow = "1";
newDiv.style.backgroundColor = "white";

col.parentNode.appendChild(newDiv);
newDiv.id = "new_col";

var main_col = document.getElementById("main_col");
var new_col = document.getElementById("new_col");

var page_select = document.querySelector("#main_col > div:nth-child(3)");

try {
    new_col.appendChild(page_select);
} catch (error) {
    console.log("error adding page turner to new column")
}

var word_list = document.querySelector("#main_col > div:nth-child(3)");

try {
    new_col.appendChild(word_list);
} catch (error) {
    console.log("error adding word list to new column")
}

var word_span = document.querySelector("#new_col > div:nth-child(2) > div > span");

word_span.style.float = "right"
word_span.style["padding-right"] = "100px"

var translation = document.querySelector("#new_col > div:nth-child(2) > div:nth-child(2)");
try {
    main_col.appendChild(translation);
} catch (error) {
    console.log("error adding translation dialog to left column")
}

document.addEventListener('click',function(e){
    var link = e.target.getAttribute("href")
    if(link != null && !e.target.href.includes('https://www.vocabtracker.com/getPage/Studying/') && e.target.href.includes('https://www.vocabtracker.com/getPage/'))
    {
        // this div has been clicked
        new_col.remove()
    }
});

clearInterval(intv);

return true;

}, 300);