Compare commits
No commits in common. "877460d0aa616de203a0e5baeec8835714c8d886" and "c79ace2d36a9755ff8c785a630d4109eb2b7ee75" have entirely different histories.
877460d0aa
...
c79ace2d36
File diff suppressed because one or more lines are too long
|
@ -1,24 +0,0 @@
|
||||||
function copy_screenshot(el) {
|
|
||||||
html2canvas(el).then((canvas) => {
|
|
||||||
console.log("Copying image to clipboard");
|
|
||||||
let data = canvas.toDataURL();
|
|
||||||
|
|
||||||
const textArea = document.createElement("textarea");
|
|
||||||
textArea.value = data;
|
|
||||||
|
|
||||||
document.body.prepend(textArea);
|
|
||||||
textArea.select();
|
|
||||||
|
|
||||||
document.execCommand('copy');
|
|
||||||
document.body.removeChild(textArea);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function copy_screenshot_dest() {
|
|
||||||
let plate = document.getElementsByClassName("dest_plate")[0];
|
|
||||||
copy_screenshot(plate);
|
|
||||||
}
|
|
||||||
function copy_screenshot_src() {
|
|
||||||
let plate = document.getElementsByClassName("source_plate")[0];
|
|
||||||
copy_screenshot(plate);
|
|
||||||
}
|
|
|
@ -4,8 +4,6 @@
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link data-trunk rel="scss" href="assets/scss/index.scss">
|
<link data-trunk rel="scss" href="assets/scss/index.scss">
|
||||||
<link data-trunk rel="copy-dir" href="assets/fonts">
|
<link data-trunk rel="copy-dir" href="assets/fonts">
|
||||||
<script data-trunk src="assets/js/screenshot_utility.js"></script>
|
|
||||||
<script data-trunk src="assets/js/html2canvas.js"></script>
|
|
||||||
<title>Plate Tool</title>
|
<title>Plate Tool</title>
|
||||||
</head>
|
</head>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -490,7 +490,7 @@ pub fn MainWindow() -> Html {
|
||||||
<div class="dropdown-sub">
|
<div class="dropdown-sub">
|
||||||
<button>{"Styles"}</button>
|
<button>{"Styles"}</button>
|
||||||
<div>
|
<div>
|
||||||
<button onclick={toggle_in_transfer_hashes_callback}>{"Toggle transfer hashes"}</button>
|
<button onclick={toggle_in_transfer_hashes_callback}>{"Toggle in transfer hashes"}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -99,8 +99,8 @@ pub fn NewPlateDialog(props: &NewPlateDialogProps) -> Html {
|
||||||
<option value="12">{"12"}</option>
|
<option value="12">{"12"}</option>
|
||||||
<option value="24">{"24"}</option>
|
<option value="24">{"24"}</option>
|
||||||
<option value="48">{"48"}</option>
|
<option value="48">{"48"}</option>
|
||||||
<option value="96" selected={true}>{"96"}</option>
|
<option value="96">{"96"}</option>
|
||||||
<option value="384">{"384"}</option>
|
<option value="384" selected={true}>{"384"}</option>
|
||||||
<option value="1536">{"1536"}</option>
|
<option value="1536">{"1536"}</option>
|
||||||
<option value="3456">{"3456"}</option>
|
<option value="3456">{"3456"}</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -107,11 +107,6 @@ pub fn DestinationPlate(props: &DestinationPlateProps) -> Html {
|
||||||
|
|
||||||
let mouseleave_callback = Callback::clone(&mouseup_callback);
|
let mouseleave_callback = Callback::clone(&mouseup_callback);
|
||||||
|
|
||||||
|
|
||||||
let screenshot_callback = Callback::from(|_| {
|
|
||||||
let _ = js_sys::eval("copy_screenshot_dest()");
|
|
||||||
});
|
|
||||||
|
|
||||||
let column_header = {
|
let column_header = {
|
||||||
let headers = (1..=props.destination_plate.plate.size().1)
|
let headers = (1..=props.destination_plate.plate.size().1)
|
||||||
.map(|j| {
|
.map(|j| {
|
||||||
|
@ -148,8 +143,7 @@ pub fn DestinationPlate(props: &DestinationPlateProps) -> Html {
|
||||||
.collect::<Html>();
|
.collect::<Html>();
|
||||||
|
|
||||||
html! {
|
html! {
|
||||||
<div ondblclick={screenshot_callback}
|
<div class={classes!{"dest_plate",
|
||||||
class={classes!{"dest_plate",
|
|
||||||
"W".to_owned()+&props.source_plate.plate.plate_format.to_string()}}>
|
"W".to_owned()+&props.source_plate.plate.plate_format.to_string()}}>
|
||||||
<table
|
<table
|
||||||
onmouseup={move |e| {
|
onmouseup={move |e| {
|
||||||
|
|
|
@ -108,10 +108,6 @@ pub fn SourcePlate(props: &SourcePlateProps) -> Html {
|
||||||
|
|
||||||
let mouseleave_callback = Callback::clone(&mouseup_callback);
|
let mouseleave_callback = Callback::clone(&mouseup_callback);
|
||||||
|
|
||||||
let screenshot_callback = Callback::from(|_| {
|
|
||||||
let _ = js_sys::eval("copy_screenshot_src()");
|
|
||||||
});
|
|
||||||
|
|
||||||
let column_header = {
|
let column_header = {
|
||||||
let headers = (1..=props.source_plate.plate.size().1)
|
let headers = (1..=props.source_plate.plate.size().1)
|
||||||
.map(|j| {
|
.map(|j| {
|
||||||
|
@ -152,8 +148,7 @@ pub fn SourcePlate(props: &SourcePlateProps) -> Html {
|
||||||
.collect::<Html>();
|
.collect::<Html>();
|
||||||
|
|
||||||
html! {
|
html! {
|
||||||
<div ondblclick={screenshot_callback}
|
<div class={classes!{"source_plate",
|
||||||
class={classes!{"source_plate",
|
|
||||||
"W".to_owned()+&props.source_plate.plate.plate_format.to_string()}}>
|
"W".to_owned()+&props.source_plate.plate.plate_format.to_string()}}>
|
||||||
<table
|
<table
|
||||||
onmouseup={move |e| {
|
onmouseup={move |e| {
|
||||||
|
|
Loading…
Reference in New Issue