Add initial alert ui window
This commit is contained in:
parent
17dbd6249b
commit
70bcc60edd
@ -133,7 +133,8 @@ class Finder{
|
||||
WebDesktopEnvironment.Open("img-viewer", [this.path + "/" + fileName])
|
||||
break;
|
||||
default:
|
||||
console.log("Unsupported file type")
|
||||
// console.log("Unsupported file type")
|
||||
WebDesktopEnvironment.Alert("Unsupported file type")
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
BIN
resources/sys/wde/icons/ohno.png
(Stored with Git LFS)
Normal file
BIN
resources/sys/wde/icons/ohno.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -184,7 +184,37 @@ class WebDesktopEnvironment{
|
||||
* @param {string} alertText
|
||||
*/
|
||||
static Alert(alertText){
|
||||
console.log(alertText)
|
||||
WebDesktopEnvironment.CreateAlertWindow(alertText)
|
||||
// console.log(alertText)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} alertText
|
||||
*/
|
||||
static CreateAlertWindow(alertText){
|
||||
console.log("alertWinfdo")
|
||||
let newWindow = document.createElement("div")
|
||||
newWindow.setAttribute("class", "WindowFrameless")
|
||||
newWindow.setAttribute("windowId", "SuperUniqUUID") //TODO:
|
||||
newWindow.style.cssText = "postiton:absolute;width:450px;height:116px; margin-left: 225px; margin-top:58px; left: 50%;top: 50%;background-color:#FFFFFF;border: 1px solid #000000;box-shadow: 2px 2px 0px #000000;"
|
||||
|
||||
let alertImage = document.createElement("img")
|
||||
alertImage.setAttribute("src", "http://localhost:8080/res/sys/wde/icons/ohno.png")
|
||||
alertImage.style.cssText = "position:relative;width:64px;height:64px;top:15px;left:15px"
|
||||
newWindow.appendChild(alertImage)
|
||||
|
||||
let errorText = document.createElement("div")
|
||||
errorText.style.cssText = "position:relative; left:128px; top:-30px;font-family: 'Virtue';"
|
||||
errorText.innerHTML = alertText
|
||||
newWindow.appendChild(errorText)
|
||||
|
||||
let closeButton = document.createElement("button")
|
||||
closeButton.style.cssText = "position:relative; left: 382px; bottom: -5px; background-color:#FFFFFF; width: 55px; height:18px; font-family: 'Virtue'; border-radius:4px;border: 1px solid #000000;"
|
||||
closeButton.innerHTML = "Close"
|
||||
closeButton.addEventListener('click', console.log('aaaaa'))
|
||||
newWindow.appendChild(closeButton)
|
||||
|
||||
document.body.querySelector('#windows-layer').appendChild(newWindow)
|
||||
}
|
||||
|
||||
static CheckMobile(){
|
||||
|
Loading…
Reference in New Issue
Block a user