56 lines
1.9 KiB
JavaScript
56 lines
1.9 KiB
JavaScript
async function show_tabs(dv, info) {
|
|
let output = "~~~tabs\n";
|
|
|
|
// Tab 1: Info
|
|
output += "tab: Info\n";
|
|
output += info;
|
|
output += "\n";
|
|
|
|
// Tab 2: Locations
|
|
output += "tab: Locations\n";
|
|
output += "```dataviewjs\n";
|
|
const locationScript = "scripts/locationTable";
|
|
output += `await dv.view("${locationScript}", { arg1: dv, arg2: ["${dv.current().file.name}"] });\n`;
|
|
output += "```\n";
|
|
|
|
// Tab 3: NPCs
|
|
output += "tab: NPCs\n";
|
|
output += "```dataviewjs\n";
|
|
const npcScript = "scripts/npcTable";
|
|
output += `await dv.view("${npcScript}", { arg1: dv, arg2: ["${dv.current().file.name}"] });\n`;
|
|
output += "```\n";
|
|
|
|
// Tab 4: Item Shops
|
|
output += "tab: Item Shops\n";
|
|
output += "```dataviewjs\n";
|
|
const itemShopsScript = "scripts/magicItemShops";
|
|
output += `await dv.view("${itemShopsScript}", { arg1: dv, arg2: ["${dv.current().file.name}"], arg3: "Distribute items to stores (COT)" });\n`;
|
|
output += "```\n";
|
|
|
|
// Tab 5: Scroll Shops
|
|
output += "tab: Scroll Shops\n";
|
|
output += "```dataviewjs\n";
|
|
const scrollShopsScript = "scripts/spellScrollsShops";
|
|
output += `await dv.view("${scrollShopsScript}", { arg1: dv, arg2: ["${dv.current().file.name}"], arg3: "Distribute spell scrolls to stores (COT)" });\n`;
|
|
output += "```\n";
|
|
|
|
// Tab 6: Hiring Locations
|
|
output += "tab: Hiring Locations\n";
|
|
output += "```dataviewjs\n";
|
|
const hiringScript = "scripts/mercenariesHirePlaces";
|
|
output += `await dv.view("${hiringScript}", { arg1: dv, arg2: ["${dv.current().file.name}"], arg3: "Distribute mercenaries to hire places (COT)" });\n`;
|
|
output += "```\n";
|
|
|
|
output += "~~~\n";
|
|
|
|
// Выводим сформированный текст
|
|
await dv.paragraph(output);
|
|
}
|
|
|
|
function run_show_tabs(...args) {
|
|
let dv = args[0].arg1;
|
|
let info = args[0].arg2;
|
|
show_tabs(dv, info);
|
|
}
|
|
|
|
await run_show_tabs(input); |