Skip to content

Commit

Permalink
Update toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
lkwq007 committed Oct 23, 2022
1 parent 9f41463 commit 180a93b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<meta charset="utf-8">
<link rel="icon" type="image/x-icon" href="./favicon.png">

<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/lkwq007/stablediffusion-infinity@v0.1.1/css/w2ui.min.css">
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/lkwq007/stablediffusion-infinity@v0.1.1/js/w2ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/lkwq007/stablediffusion-infinity@v0.1.2/css/w2ui.min.css">
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/lkwq007/stablediffusion-infinity@v0.1.2/js/w2ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css">
<script src="https://cdn.jsdelivr.net/gh/lkwq007/stablediffusion-infinity@v0.1.1/js/fabric.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/gh/lkwq007/stablediffusion-infinity@v0.1.1/js/toolbar.js"></script>
<script src="https://cdn.jsdelivr.net/gh/lkwq007/stablediffusion-infinity@v0.1.2/js/fabric.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/gh/lkwq007/stablediffusion-infinity@v0.1.2/js/toolbar.js"></script>

<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
Expand Down
27 changes: 15 additions & 12 deletions js/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,24 +406,27 @@ var toolbar=new w2toolbar({
this.refresh();
break;
case "enable_history":
let target=this.get(event.target);
if(!target.checked)
{
w2utils.notify("Enable canvas history might increase resource usage / slow down the canvas ", {error:true,timeout:3000,where:query("#container")})
window.postMessage(["click","history"],"*");
}
else
{
window.undo_redo_state.undo=false;
window.undo_redo_state.redo=false;
this.disable("undo","redo");
}
case "enable_img2img":
case "use_correction":
case "resize_check":
case "enable_safety":
case "use_seed":
case "square_selection":
let target=this.get(event.target);
if(event.target=="enable_history")
{
if(!target.checked)
{
w2utils.notify("Enable canvas history might increase resource usage / slow down the canvas ", {error:true,timeout:3000,where:query("#container")})
window.postMessage(["click","history"],"*");
}
else
{
window.undo_redo_state.undo=false;
window.undo_redo_state.redo=false;
this.disable("undo","redo");
}
}
target.icon=target.checked?"fa-regular fa-square":"fa-solid fa-square-check";
this.config_obj[event.target]=!target.checked;
parent.config_obj=this.config_obj;
Expand Down

0 comments on commit 180a93b

Please sign in to comment.