-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
369 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
class UpdaterUI extends NeutronWindow{ | ||
static UI_STATES := ["pre-update", "during-update", "post-update"] | ||
|
||
__New(){ | ||
base.__New() | ||
this.load(resources_obj.htmlFile.Updater) | ||
this.loadCss() | ||
updater_obj:= new Updater(arg_installPath, ObjBindMethod(this, "onUpdateState")) | ||
this.show() | ||
} | ||
|
||
loadCss(){ | ||
this.doc.getElementById("MicMute_icon").setAttribute("src", resources_obj.pngIcon) | ||
for i, css in resources_obj.cssFile { | ||
if(!this.doc.getElementById("css_" css.name)) | ||
this.doc.head.insertAdjacentHTML("beforeend",Format(template_link, css.name, css.file)) | ||
} | ||
RegRead, isLightTheme, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize, AppsUseLightTheme | ||
if(isLightTheme) | ||
this.doc.getElementById("css_dark").setAttribute("disabled","1") | ||
} | ||
|
||
show(){ | ||
this.setUIState("pre-update") | ||
this.resetDetail() | ||
this.appendDetail("Current version: " A_Version) | ||
this.appendDetail("Latest version: " updater_obj.getLatestVersion()) | ||
this.appendDetail("Installation method: " updater_obj.installationMethod) | ||
base.Gui("+LabelUpdaterUI_ +MinSize780x510 -Resize") | ||
base.Show("Center w780 h510","MicMute Updater") | ||
} | ||
|
||
setUIState(currentState){ | ||
for i, state in this.UI_STATES { | ||
for i, elem in this.Each(this.qsa("." state)) { | ||
elem.classList.add("is-hidden") | ||
} | ||
} | ||
for i, elem in this.Each(this.qsa("." currentState)) { | ||
elem.classList.remove("is-hidden") | ||
} | ||
} | ||
|
||
onUpdateState(str, updaterStatus:=0){ | ||
this.appendDetail(str) | ||
this.doc.getElementById("current_status").innerText := str | ||
if(updaterStatus) | ||
this.setUIState("post-update") | ||
} | ||
|
||
onClickUpdate(){ | ||
this.setUIState("during-update") | ||
this.resetDetail() | ||
updater_obj.update() | ||
} | ||
|
||
onClickExit(restart:=0){ | ||
if(restart) | ||
Run, % arg_installPath "\MicMute.exe" , % arg_installPath, UseErrorLevel | ||
ExitApp, 0 | ||
} | ||
|
||
resetDetail(){ | ||
this.doc.getElementById("details").innerHTML := "" | ||
} | ||
|
||
appendDetail(str){ | ||
detailBox := this.doc.getElementById("details") | ||
detailBox.insertAdjacentHTML("beforeend", "<p>" str "</p>") | ||
detailBox.scrollTop := detailBox.scrollHeight | ||
} | ||
|
||
Close(){ | ||
ExitApp, -2 | ||
} | ||
} | ||
|
||
UpdaterUI_Close(){ | ||
ExitApp, -2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<link rel="stylesheet" href="../css/bulma.css"> | ||
<link rel="stylesheet" href="../css/base.css"> | ||
<!-- <link rel="stylesheet" href="../css/dark.css"> --> | ||
<style> | ||
header { | ||
height: 30px; | ||
} | ||
|
||
body { | ||
overflow: hidden; | ||
font-family: 'Segoe UI Variable Display', 'Segoe UI'; | ||
} | ||
|
||
|
||
#MicMute_icon { | ||
width: 38px; | ||
height: 38px; | ||
border-radius: 23%; | ||
box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.02); | ||
transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1); | ||
} | ||
|
||
img#MicMute_icon:hover, | ||
label:hover>img#MicMute_icon { | ||
box-shadow: 0px 11px 15px -7px rgba(0, 0, 0, 0.055), 0px 0px 20px 0px rgba(255, 87, 45, 0.63), 0px 9px 46px 8px rgba(0, 0, 0, 0.055); | ||
} | ||
|
||
.container { | ||
top: 20%; | ||
left: 50%; | ||
transform: translate(-50%, -15%); | ||
max-width: 700px !important | ||
} | ||
|
||
#label { | ||
font-size: 2rem; | ||
font-weight: 600; | ||
cursor: default; | ||
margin-bottom: 5% !important; | ||
} | ||
|
||
.card-content { | ||
height: 250px; | ||
} | ||
|
||
.card { | ||
width: 800% !important; | ||
} | ||
|
||
#current_status { | ||
cursor: default; | ||
} | ||
|
||
#details { | ||
margin-top: 20px; | ||
padding-top: 0; | ||
height: 7.5em; | ||
overflow-y: scroll; | ||
box-sizing: content-box; | ||
line-height: 2em; | ||
} | ||
|
||
#current_status { | ||
color: #ff6920; | ||
} | ||
|
||
.progress { | ||
width: 80%; | ||
margin-left: auto; | ||
margin-right: auto; | ||
margin-top: 1.5rem; | ||
} | ||
|
||
.single-item { | ||
border-right-width: 0 !important; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body class="noselect" oncontextmenu="return false"> | ||
<header class="title-bar-header"> | ||
<span class="title-bar" onmousedown="neutron.DragTitleBar()"></span> | ||
<span class="title-btn title-btn-close" onclick="neutron.Close()">r</span> | ||
</header> | ||
<div class="container"> | ||
<div id='label'> | ||
<label> | ||
<img id='MicMute_icon' src='../../../resources/MicMute.png' /> MicMute | ||
</label> | ||
</div> | ||
<div class="card"> | ||
<div class="card-content"> | ||
<p id="heading" class="pre-update ">An update for MicMute is available, click on 'Update' to start updating</p> | ||
<p id="status_heading" class="post-update during-update is-hidden">Current status: <span id="current_status"></span></p> | ||
<div class="box" id="details"> | ||
</div> | ||
</div> | ||
<footer class="card-footer"> | ||
<progress class="progress is-small is-primary during-update is-hidden" max="100">100%</progress> | ||
<a onclick="neutron.onClickUpdate()" class="card-footer-item pre-update is-hidden single-item">Update</a> | ||
<a onclick="neutron.onClickExit(0)" class="card-footer-item post-update is-hidden">Exit</a> | ||
<a onclick="neutron.onClickExit(1)" class="card-footer-item post-update is-hidden">Exit & restart MicMute</a> | ||
</footer> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.