fix param type issue

Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
Victor Seiji Hariki 2023-01-21 13:06:21 -03:00
parent 025d50a10e
commit 13e29898a3
3 changed files with 18 additions and 12 deletions

View file

@ -372,7 +372,7 @@
<!-- Base Libs -->
<script src="js/lib/util.js?v=e82dd04" type="text/javascript"></script>
<script src="js/lib/events.js?v=2ab7933" type="text/javascript"></script>
<script src="js/lib/input.js?v=aa14afc" type="text/javascript"></script>
<script src="js/lib/input.js?v=769485c" type="text/javascript"></script>
<script src="js/lib/layers.js?v=a1f8aea" type="text/javascript"></script>
<script src="js/lib/commands.js?v=bf23c83" type="text/javascript"></script>
@ -403,7 +403,7 @@
src="js/ui/tool/generic.js?v=3e678e0"
type="text/javascript"></script>
<script src="js/ui/tool/dream.js?v=e5adb06" type="text/javascript"></script>
<script src="js/ui/tool/dream.js?v=307a9ca" type="text/javascript"></script>
<script
src="js/ui/tool/maskbrush.js?v=1e8a893"
type="text/javascript"></script>

View file

@ -529,9 +529,9 @@ const keyboard = {
this.shortcuts[shortcut.key] = [];
this.shortcuts[shortcut.key].push({
ctrl: !!shortcut.ctrl,
alt: !!shortcut.alt,
shift: !!shortcut.shift,
ctrl: shortcut.ctrl,
alt: shortcut.alt,
shift: shortcut.shift,
id: guid(),
callback,
});
@ -610,11 +610,16 @@ window.onkeydown = (evn) => {
if (callbacks)
callbacks.forEach((callback) => {
if (
!!callback.ctrl === evn.ctrlKey &&
!!callback.alt === evn.altKey &&
!!callback.shift === evn.shiftKey
) {
let activate = true;
if (callback.ctrl !== null && !!callback.ctrl !== evn.ctrlKey)
activate = false;
if (callback.shift !== null && !!callback.shift !== evn.shiftKey)
activate = false;
if (callback.alt !== null && !!callback.alt !== evn.altKey)
activate = false;
if (activate) {
evn.preventDefault();
// onshortcut event
keyboard.listen.onshortcut.emit({

View file

@ -100,8 +100,9 @@ const _dream = async (endpoint, request) => {
var scriptName = document.getElementById("script-name-input").value;
var scriptArgs = document.getElementById("script-args-input").value;
if (scriptName.trim() != "" && scriptArgs.trim() != "") {
request.script_name = scriptName;
request.script_args = scriptArgs.split(",");
request.script_name = scriptName.trim();
// This is necessary so types can be properly specified
request.script_args = JSON.parse(scriptArgs.trim() || "[]");
}
// Debugging is enabled