Skip to content

Commit

Permalink
chore: bump dep ver/build
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGiddyLimit committed Jan 18, 2024
1 parent 8bc1a6c commit 2d4e8c0
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 131 deletions.
2 changes: 1 addition & 1 deletion dist/betteR20-5etools.meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @name betteR20-5etools
// @namespace https://5e.tools/
// @license MIT (https://opensource.org/licenses/MIT)
// @version 1.35.7
// @version 1.35.8
// @updateURL https://github.com/TheGiddyLimit/betterR20/raw/development/dist/betteR20-5etools.meta.js
// @downloadURL https://github.com/TheGiddyLimit/betterR20/raw/development/dist/betteR20-5etools.user.js
// @description Enhance your Roll20 experience
Expand Down
126 changes: 62 additions & 64 deletions dist/betteR20-5etools.user.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/betteR20-core.meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @name betteR20-core
// @namespace https://5e.tools/
// @license MIT (https://opensource.org/licenses/MIT)
// @version 1.35.7
// @version 1.35.8
// @updateURL https://github.com/TheGiddyLimit/betterR20/raw/development/dist/betteR20-core.meta.js
// @downloadURL https://github.com/TheGiddyLimit/betterR20/raw/development/dist/betteR20-core.user.js
// @description Enhance your Roll20 experience
Expand Down
124 changes: 61 additions & 63 deletions dist/betteR20-core.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @name betteR20-core
// @namespace https://5e.tools/
// @license MIT (https://opensource.org/licenses/MIT)
// @version 1.35.7
// @version 1.35.8
// @updateURL https://github.com/TheGiddyLimit/betterR20/raw/development/dist/betteR20-core.meta.js
// @downloadURL https://github.com/TheGiddyLimit/betterR20/raw/development/dist/betteR20-core.user.js
// @description Enhance your Roll20 experience
Expand Down Expand Up @@ -227,9 +227,10 @@ function baseUtil () {
} else {
d20plus.ut.showHardDickMessage(scriptName);
}
d20plus.isOptedInNewUI && !isStreamer && d20plus.ut.sendHackerChat(`
betteR20 does not support the new UI preview at this moment!
Using it will make some betteR20 functionality unavailable.
d20plus.betaFeaturesEnabled && !isStreamer && d20plus.ut.sendHackerChat(`
betteR20 does not support the beta UI preview at this moment!
Using it will make some betteR20 or roll20 functionality unavailable.
If you experience problems with Page Settings, disable roll20 Beta Features.
`);
$boringProgress
.before(`<span><span>&gt;</span>all systems operational</span>`)
Expand Down Expand Up @@ -11947,8 +11948,8 @@ function d20plusEngine () {
};

d20plus.engine.swapTemplates = () => {
const oldToolbar = document.getElementById("floatingtoolbar");
d20plus.isOptedInNewUI = !oldToolbar;
const $betaSwitch = $("#new-toolbar-toggle");
d20plus.betaFeaturesEnabled = $betaSwitch.prop("checked");

d20plus.ut.log("Swapping templates...");
$("#tmpl_charactereditor").html($(d20plus.html.characterEditor).html());
Expand Down Expand Up @@ -12021,7 +12022,8 @@ function d20plusEngine () {
}).addTouch();
}

if (!d20plus.isOptedInNewUI) {
if (!d20plus.betaFeaturesEnabled) { // Jan 2024 beta features include the new Page Toolbar
// this should be executed only for the old Page Toolbar
overwriteDraggables();
$(`#page-toolbar`).css("top", "calc(-90vh + 40px)");

Expand All @@ -12039,7 +12041,7 @@ function d20plusEngine () {
debouncedOverwrite();
}
} else {
$(`#page-toolbar`).hide();
$(`#page-toolbar`).hide(); // hide the old Page Toolbar that pops with b20 styling
}

$(`body`).on("mouseup", "li.dl", (evt) => {
Expand All @@ -12065,7 +12067,7 @@ function d20plusEngine () {
}).on("click", ".pagedetails_navigation .nav-tabs--beta", () => {
d20plus.engine._populatePageCustomOptions();
}).on("click keyup", ".weather input, .weather .slider", () => {
d20plus.engine._updateCustomOptions();
d20plus.engine._updatePageCustomOptions();
});
};

Expand Down Expand Up @@ -12155,17 +12157,17 @@ function d20plusEngine () {
$overlay.remove();
}
$saveBtn.before(templateApply);
$(`.btn-apply`).on("click", d20plus.engine.applySettings);
$(`.btn-apply`).on("click", d20plus.engine.applyPageSettings);
}
// process options within open dialog
if ($dialog[0]) {
const $pageTitle = $dialog.find(`.ui-dialog-title:visible`);
d20plus.engine._preserveCustomOptions(page);
d20plus.engine._populateCustomOptions(page, $dialog.find(`.dialog .tab-content`));
d20plus.engine._preservePageCustomOptions(page);
d20plus.engine._populatePageCustomOptions(page, $dialog.find(`.dialog .tab-content`));
if ($pageTitle[0] && !$(".ui-dialog-pagename:visible")[0]) {
$pageTitle.after(`<span class="ui-dialog-pagename">${page.get("name")}</span>`);
$saveBtn.off("click");
$saveBtn.on("click", d20plus.engine.applySettings);
$saveBtn.on("click", d20plus.engine.applyPageSettings);
// closed editors behave strangely, so replace Close with Cancel
$dialog.find(`.ui-dialog-titlebar-close:visible`).on("mousedown", () => {
$dialog.find(`.ui-dialog-buttonpane .btn:not(.btn-apply):not(.btn-primary)`).click();
Expand All @@ -12184,7 +12186,7 @@ function d20plusEngine () {
}
}

d20plus.engine.applySettings = (evt) => {
d20plus.engine.applyPageSettings = (evt) => {
evt.stopPropagation();
evt.preventDefault();
const page = d20.Campaign.pages.get(d20plus.engine._lastSettingsPageId);
Expand All @@ -12197,8 +12199,8 @@ function d20plusEngine () {
const activeTabScroll = $dialog.find(`.ui-dialog-content`).scrollTop();
const $settings = $dialog.find(`.dialog .tab-content`);

d20plus.engine._saveCustomOptions(page);
d20plus.engine._saveNativeOptions(page, $settings);
d20plus.engine._savePageCustomOptions(page);
d20plus.engine._savePageNativeOptions(page, $settings);

page.save();

Expand All @@ -12209,7 +12211,7 @@ function d20plusEngine () {
// page.save resets current dialog, so we need to restore status quo
$(`.nav-tabs:visible [data-tab=${activeTab}]`).click();
$(`.ui-dialog-content:visible`).scrollTop(activeTabScroll);
d20plus.engine._populateCustomOptions();
d20plus.engine._populatePageCustomOptions();
}
}

Expand Down Expand Up @@ -12249,7 +12251,7 @@ function d20plusEngine () {
lightglobalillum: {class: ".lightglobalillum"},
};

d20plus.engine._saveNativeOptions = (page, dialog) => {
d20plus.engine._savePageNativeOptions = (page, dialog) => {
if (!page || !page.get) return;
const getSlider = (el) => {
if (el.style.left?.search("%") > 0) return el.style.left.slice(0, -1) / 100;
Expand All @@ -12274,23 +12276,23 @@ function d20plusEngine () {
});
}

d20plus.engine._preserveCustomOptions = (page) => {
d20plus.engine._preservePageCustomOptions = (page) => {
if (!page || !page.get) return;
d20plus.engine._customOptions = d20plus.engine._customOptions || {};
d20plus.engine._customOptions[page.id] = { _defaults: {} };
d20plus.engine._customPageOptions = d20plus.engine._customPageOptions || {};
d20plus.engine._customPageOptions[page.id] = { _defaults: {} };
[
"weather",
].forEach(category => Object.entries(d20plus[category].props).forEach(([name, deflt]) => {
d20plus.engine._customOptions[page.id][name] = page.get(`bR20cfg_${name}`) || deflt;
d20plus.engine._customOptions[page.id]._defaults[name] = deflt;
d20plus.engine._customPageOptions[page.id][name] = page.get(`bR20cfg_${name}`) || deflt;
d20plus.engine._customPageOptions[page.id]._defaults[name] = deflt;
}));
}

d20plus.engine._populatePageCustomOptions = (page, dialog) => {
dialog = dialog || $(`.pagedetails_navigation:visible`).closest(".ui-dialog");
page = page || d20.Campaign.pages.get(d20plus.engine._lastSettingsPageId);
if (!d20plus.engine._customOptions[page.id]) return;
Object.entries(d20plus.engine._customOptions[page.id]).forEach(([name, val]) => {
if (!d20plus.engine._customPageOptions[page.id]) return;
Object.entries(d20plus.engine._customPageOptions[page.id]).forEach(([name, val]) => {
dialog.find(`[name="${name}"]`).each((i, e) => {
const $e = $(e);
if ($e.is(":checkbox")) {
Expand All @@ -12304,24 +12306,24 @@ function d20plusEngine () {
});
});
// ensure all Select elements will update options on change
$(".weather select").each((a, b) => { b.onchange = () => d20plus.engine._updateCustomOptions() });
$(".weather select").each((a, b) => { b.onchange = () => d20plus.engine._updatePageCustomOptions() });
}

d20plus.engine._updateCustomOptions = (page, dialog) => {
d20plus.engine._updatePageCustomOptions = (page, dialog) => {
dialog = dialog || $(`.pagedetails_navigation:visible`).closest(".ui-dialog");
page = page || d20.Campaign.pages.get(d20plus.engine._lastSettingsPageId);
if (!d20plus.engine._customOptions[page.id]) return;
Object.entries(d20plus.engine._customOptions[page.id]).forEach(([name, val]) => {
if (!d20plus.engine._customPageOptions[page.id]) return;
Object.entries(d20plus.engine._customPageOptions[page.id]).forEach(([name, val]) => {
dialog.find(`[name="${name}"]`).each((i, e) => {
const $e = $(e);
const val = $e.is(":checkbox") ? !!$e.prop("checked") : $e.val();
d20plus.engine._customOptions[page.id][name] = val;
d20plus.engine._customPageOptions[page.id][name] = val;
});
});
}

d20plus.engine._saveCustomOptions = (page) => {
const values = d20plus.engine._customOptions[page.id];
d20plus.engine._savePageCustomOptions = (page) => {
const values = d20plus.engine._customPageOptions[page.id];
Object.entries(values).forEach(([name, val]) => {
if (name === "_defaults") return;
if (val && val !== values._defaults[name]) {
Expand Down Expand Up @@ -12515,43 +12517,39 @@ function d20plusEngine () {
/* eslint-disable */

// BEGIN ROLL20 CODE
window.Markdown.parse = function(e) {
{
var t = e
, n = []
, i = [];
-1 != t.indexOf("\r\n") ? "\r\n" : -1 != t.indexOf("\n") ? "\n" : ""
}
return t = t.replace(/{{{([\s\S]*?)}}}/g, function(e) {
return n.push(e.substring(3, e.length - 3)),
"{{{}}}"
window.Markdown.parse = function(x) {
var g = x, l, t = [], m = [], v = g.indexOf(`\r\n`) != -1 ? `\r\n` : g.indexOf(`\n`) != -1 ? `\n` : "";
return g = g.replace(/{{{([\s\S]*?)}}}/g, function(h) {
return t.push(h.substring(3, h.length - 3)),
"{{{}}}"
}),
t = t.replace(new RegExp("<pre>([\\s\\S]*?)</pre>","gi"), function(e) {
return i.push(e.substring(5, e.length - 6)),
"<pre></pre>"
}),
// BEGIN MOD
t = t.replace(/~~(.*?)~~/g, OUT_STRIKE),
// END MOD
t = t.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>"),
t = t.replace(/\*(.*?)\*/g, "<em>$1</em>"),
t = t.replace(/``(.*?)``/g, "<code>$1</code>"),
t = t.replace(/\[([^\]]+)\]\(([^)]+(\.png|\.gif|\.jpg|\.jpeg))\)/g, '<a href="$2"><img src="$2" alt="$1" /></a>'),
t = t.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2">$1</a>'),
t = t.replace(new RegExp("<pre></pre>","g"), function() {
return "<pre>" + i.shift() + "</pre>"
}),
t = t.replace(/{{{}}}/g, function() {
return n.shift()
})
};
g = g.replace(new RegExp("<pre>([\\s\\S]*?)</pre>","gi"), function(h) {
return m.push(h.substring(5, h.length - 6)),
"<pre></pre>"
}),
// BEGIN MOD
g = g.replace(/~~(.*?)~~/g, OUT_STRIKE),
// END MOD
g = g.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>"),
g = g.replace(/\*(.*?)\*/g, "<em>$1</em>"),
g = g.replace(/``(.*?)``/g, "<code>$1</code>"),
g = g.replace(/\[([^\]]+)\]\(([^)]+(\.png|\.gif|\.jpg|\.jpeg))\)/g, '<a href="$2"><img src="$2" alt="$1" /></a>'),
g = g.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2">$1</a>'),
g = g.replace(new RegExp("<pre></pre>","g"), function(h) {
return "<pre>" + m.shift() + "</pre>"
}),
g = g.replace(/{{{}}}/g, function(h) {
return t.shift()
}),
g
},
// END ROLL20 CODE

/* eslint-enable */

// after a short delay, replace any old content in the chat
setTimeout(() => {
$(`.message`).each(function () {
$(`.message.general`).each(function () {
$(this).html($(this).html().replace(/~~(.*?)~~/g, OUT_STRIKE))
})
}, 2500);
Expand Down Expand Up @@ -12668,7 +12666,7 @@ function d20plusEngine () {
};

d20plus.engine.fixPolygonTool = () => {
if (d20plus.isOptedInNewUI) return;
if (!d20plus.newUIDisabled) return; // as of January 2024 newUI is always ON, so the below block is not needed
$("#editor-wrapper").on("pointerdown", x => { d20plus.engine.leftClicked = x.which === 1 });
$("#editor-wrapper").on("pointerup", x => { d20plus.engine.leftClicked = false });
d20plus.ut.injectCode(d20.engine, "finishCurrentPolygon", (finishDrawing, params) => {
Expand Down
2 changes: 1 addition & 1 deletion dist/betteR20-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.35.7
1.35.8
2 changes: 1 addition & 1 deletion node/build-scripts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require("fs");

const SCRIPT_VERSION = "1.35.7";
const SCRIPT_VERSION = "1.35.8";

const matchString = `
// @match https://app.roll20.net/editor
Expand Down

0 comments on commit 2d4e8c0

Please sign in to comment.