2026-02-13 14:59:30 -07:00
|
|
|
|
|
|
|
|
var urls = [];
|
|
|
|
|
var titles = [];
|
|
|
|
|
|
|
|
|
|
exports.init = function () {
|
|
|
|
|
for (var i = 0; i < 5; i++) {
|
|
|
|
|
urls.push(global.apis.settings.get("app.postalpoint.customwebtools.url" + i, ""));
|
|
|
|
|
titles.push(global.apis.settings.get("app.postalpoint.customwebtools.title" + i, ""));
|
|
|
|
|
}
|
|
|
|
|
for (let i = 0; i < 5; i++) {
|
|
|
|
|
if (urls[i] == "") {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (titles[i] == "") {
|
|
|
|
|
titles[i] = urls[i];
|
|
|
|
|
}
|
|
|
|
|
global.apis.ui.addToolsPage(function () {
|
|
|
|
|
global.apis.ui.openInternalWebBrowser(urls[i]);
|
2026-03-28 17:03:35 -06:00
|
|
|
}, titles[i], "customwebtools_" + encodeURIComponent(urls[i]), (titles[i] == urls[i] ? "" : urls[i]), titles[i], "fa-duotone fa-globe-pointer", "function");
|
2026-02-13 14:59:30 -07:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var config = [];
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < 5; i++) {
|
|
|
|
|
config.push({
|
|
|
|
|
type: "text",
|
|
|
|
|
key: "app.postalpoint.customwebtools.title" + i,
|
|
|
|
|
defaultVal: "",
|
|
|
|
|
label: `Website ${i + 1} Title`,
|
|
|
|
|
placeholder: "",
|
|
|
|
|
text: ""
|
|
|
|
|
});
|
|
|
|
|
config.push({
|
|
|
|
|
type: "text",
|
|
|
|
|
key: "app.postalpoint.customwebtools.url" + i,
|
|
|
|
|
defaultVal: "",
|
|
|
|
|
label: `Website ${i + 1} Address/URL`,
|
|
|
|
|
placeholder: "https://example.com",
|
|
|
|
|
text: ""
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exports.config = config;
|