Compare commits

...

5 Commits

Author SHA1 Message Date
radex e801b26c10
add dockerfile 2024-02-02 21:48:39 +01:00
radex 4664a50c8a
move monochrome switch to HSWAW menu (it's a bit broken at launch) 2024-02-02 21:34:07 +01:00
radex 6eb8e4323b
Add print on Zebra 2024-02-02 21:31:18 +01:00
radex 125df83f99
Default to monochrome 2024-02-02 21:19:06 +01:00
radex d6f0dc39a0
Change default canvas size 2024-02-02 21:18:34 +01:00
4 changed files with 58 additions and 5 deletions

18
Dockerfile Normal file
View File

@ -0,0 +1,18 @@
# runtime image (static server)
FROM nginxinc/nginx-unprivileged:latest as runtime
WORKDIR /usr/share/nginx/html/
COPY audio audio
COPY help help
COPY images images
COPY lib lib
COPY localization localization
COPY src src
COPY styles styles
COPY about.html .
COPY browserconfig.xml .
COPY favicon.ico .
COPY index.html .
COPY manifest.webmanifest .

View File

@ -2,8 +2,8 @@
const default_magnification = 1;
const default_tool = get_tool_by_id(TOOL_PENCIL);
const default_canvas_width = 683;
const default_canvas_height = 384;
const default_canvas_width = 750;
const default_canvas_height = 500;
let my_canvas_width = default_canvas_width;
let my_canvas_height = default_canvas_height;
@ -2406,4 +2406,3 @@ $G.on("fullscreenchange webkitfullscreenchange", () => {
// $status_text.text(`fullscreen: ${fullscreen}`);
$("html").toggleClass("fullscreen", fullscreen);
});

View File

@ -1075,6 +1075,18 @@ function file_save(maybe_saved_callback = () => { }, update_from_saved = true) {
});
}
function print_zebra() {
write_image_file(main_canvas, 'image/png', (blob) => {
console.log(blob)
fetch(`print?printer=zebra`, {
method: 'POST',
body: blob,
}).then(response => {
console.log({response})
})
});
}
function file_save_as(maybe_saved_callback = () => { }, update_from_saved = true) {
deselect();
systemHooks.showSaveFileDialog({
@ -3230,7 +3242,7 @@ function image_stretch_and_skew() {
} else {
show_error_message(localize("An unknown error has occurred."), exception);
}
// @TODO: undo and clean up undoable
// @TODO: undo and clean up undoable
return;
}
$canvas_area.trigger("resize");
@ -3573,7 +3585,7 @@ function read_image_file(blob, callback) {
} else if (detected_type_id === "tiff_be" || detected_type_id === "tiff_le") {
// IFDs = image file directories
// VSNs = ???
// This code is based on UTIF.bufferToURI
// This code is based on UTIF.bufferToURI
var ifds = UTIF.decode(arrayBuffer);
//console.log(ifds);
var vsns = ifds, ma = 0, page = vsns[0];

View File

@ -232,6 +232,30 @@
description: localize("Quits Paint."),
}
],
[localize("HSWAW")]: [
{
item: "Switch to monochrome",
speech_recognition: [],
action: () => {
// lmao
image_attributes();
$("#attribute-monochrome").click();
setTimeout(() => {
$(".attributes-window button[type=submit]").click();
}, 100);
},
description: '',
},
MENU_DIVIDER,
{
item: localize("Print on Zebra (large label)"),
speech_recognition: [],
action: () => {
print_zebra()
},
description: '',
},
],
[localize("&Edit")]: [
{
item: localize("&Undo"),