Compare commits
No commits in common. "559c22f6269b2a3035fa1d4d27dc6501ffb2b42b" and "68664c1bf3ca5b42637113920732e6af7fa4918c" have entirely different histories.
559c22f626
...
68664c1bf3
@ -21,11 +21,9 @@ func (f *FinderApplication) PublicRoutes(routes *gin.RouterGroup) {
|
||||
ctx.HTML(http.StatusOK, "finder/app.tmpl", f.Render(appCtx))
|
||||
})
|
||||
|
||||
//Obsolete
|
||||
routes.GET("renderMobileDesktop", func(ctx *gin.Context) {
|
||||
ctx.HTML(http.StatusOK, "finder/mobile-desktop.tmpl", gin.H{})
|
||||
})
|
||||
|
||||
routes.POST("renderDesktop", func(ctx *gin.Context) {
|
||||
path := ctx.Query("path")
|
||||
if path == "" {
|
||||
|
@ -98,9 +98,9 @@ export default class FinderWindow{
|
||||
() => { this.ReRenderDir() },
|
||||
this.#wde)
|
||||
|
||||
newWindow.querySelector("#closeWindowButton").addEventListener('click', () => {
|
||||
this.#wde.Decorat.CloseWindow(newWindow)
|
||||
})
|
||||
// newWindow.querySelector("#closeWindowButton").addEventListener('click', () => {
|
||||
// this.#wde.Decorat.CloseWindow(newWindow)
|
||||
// })
|
||||
|
||||
// newWindow.querySelector("#RootButton").addEventListener('click', () =>{
|
||||
// this.RenderDir('/')
|
||||
@ -126,6 +126,7 @@ export default class FinderWindow{
|
||||
* @returns
|
||||
*/
|
||||
async CreateMobileView(args, runContext){
|
||||
|
||||
const params = new URLSearchParams({isMobile: false}) //FIXME
|
||||
const response = await fetch(`/app/${this.#appId}/render?` + params,
|
||||
{
|
||||
@ -134,41 +135,14 @@ export default class FinderWindow{
|
||||
})
|
||||
if (response.status != 200){
|
||||
const error = await response.json()
|
||||
this.#finder.WDE().Alert(error.message)
|
||||
this.#wde.Alert(error.message)
|
||||
return
|
||||
}
|
||||
const html = await response.text()
|
||||
// console.log(html)
|
||||
// console.log(this.#finder.WDE())
|
||||
let newView = this.#finder.WDE().Decorat.CreateNewView(this.#appId)
|
||||
console.log(this.#wde)
|
||||
let newView = this.#wde.Decorat.CreateNewView(this.#appId)
|
||||
newView.innerHTML = html
|
||||
|
||||
this.fileView = new this.#wde.FileView(
|
||||
newView.querySelector(".FileTileView"),
|
||||
(event) => { this.Click(event) },
|
||||
(event) => { this.RightClick(event) },
|
||||
(event, draggedElem) => { this.DropEvent(event, draggedElem)},
|
||||
() => { this.ReRenderDir() },
|
||||
this.#wde)
|
||||
|
||||
// newView.querySelector("#closeWindowButton").addEventListener('click', () => {
|
||||
// this.#wde.Decorat.CloseWindow(newView)
|
||||
// })
|
||||
|
||||
// newView.querySelector("#RootButton").addEventListener('click', () =>{
|
||||
// this.RenderDir('/')
|
||||
// })
|
||||
|
||||
// newView.querySelector("#HomeButton").addEventListener('click', () =>{
|
||||
// this.RenderDir('/home/user')
|
||||
// })
|
||||
|
||||
// let scrollBar = new this.#wde.ScrollBar(newView.querySelector(".scrollbar-place"), newView.querySelector(".FileTileView"))
|
||||
|
||||
this.windowElem = newView
|
||||
this.RenderDir(args[0])
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} path
|
||||
*/
|
||||
@ -330,30 +304,30 @@ export default class FinderWindow{
|
||||
let res = false
|
||||
switch (event.target.children[0].getAttribute("action")) {
|
||||
case "createPathLink":
|
||||
res = await this.#finder.WDE().WebFS().CreatePathLink(`${this.curPath}/${fileName}`, `${this.curPath}/Link to ${fileName}` )
|
||||
res = await WebFS.CreatePathLink(`${this.curPath}/${fileName}`, `${this.curPath}/Link to ${fileName}` )
|
||||
if (res){
|
||||
this.ReRenderDir()
|
||||
}
|
||||
break
|
||||
case "createDir":
|
||||
res = await this.#finder.WDE().WebFS().CreateDirectory(`${this.curPath}`)
|
||||
// console.log(res)
|
||||
res = await WebFS.CreateDirectory(`${this.curPath}`)
|
||||
console.log(res)
|
||||
if (res){
|
||||
this.ReRenderDir()
|
||||
}
|
||||
break
|
||||
case "deleteFile":
|
||||
res = await this.#finder.WDE().WebFS().DeleteFile(`${this.curPath}/${fileName}`)
|
||||
// console.log(res)
|
||||
res = await WebFS.DeleteFile(`${this.curPath}/${fileName}`)
|
||||
console.log(res)
|
||||
if (res){
|
||||
this.ReRenderDir()
|
||||
}
|
||||
break
|
||||
case "getInfo":
|
||||
this.#finder.RenderProperites(path)
|
||||
Finder.RenderProperites(path)
|
||||
break
|
||||
case "openAsDir":
|
||||
this.#finder.WDE().Open(`/Applications/${this.#appId}.app`,[`${this.curPath}/${fileName}`])
|
||||
this.#wde.Open(`/Applications/${this.#appId}.app`,[`${this.curPath}/${fileName}`])
|
||||
break
|
||||
default:
|
||||
break;
|
||||
|
@ -41,6 +41,7 @@ export default class Finder extends WDEApplication{
|
||||
* @returns {boolean}
|
||||
*/
|
||||
async RenderProperites(path){
|
||||
// return
|
||||
if (path == null || path ==""){
|
||||
return
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import WDEApplication from "./application.js"
|
||||
import WebFS from "../web-fs/web-fs.js"
|
||||
|
||||
export default class AbstractWebDesktopEnvironment{
|
||||
/** @type {string} */
|
||||
#apiAddress
|
||||
@ -7,19 +7,12 @@ export default class AbstractWebDesktopEnvironment{
|
||||
_applications = {}
|
||||
/** @type {AbstractWebDesktopEnvironment} */
|
||||
#wde
|
||||
/** @type {WebFS} */
|
||||
#webFS
|
||||
|
||||
/** @constructor */
|
||||
constructor(apiAddress){
|
||||
this.#apiAddress = apiAddress
|
||||
this.#webFS = WebFS
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @returns {string}
|
||||
*/
|
||||
/** @returns {string} */
|
||||
GetApiAddress(){
|
||||
return `${location.protocol}//${this.#apiAddress}`
|
||||
}
|
||||
@ -92,11 +85,6 @@ export default class AbstractWebDesktopEnvironment{
|
||||
// console.log(appId)
|
||||
return this._applications[appId]
|
||||
}
|
||||
|
||||
/** @returns {WebFS} */
|
||||
WebFS(){
|
||||
return this.#webFS
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -126,10 +126,10 @@ export default class WDEFileView{
|
||||
const params = new URLSearchParams({
|
||||
path: path
|
||||
})
|
||||
const response = await fetch(`/system/wde/widgets/file-tile-view?` + params)
|
||||
const response = await fetch(`${this.#wde.GetApiAddress()}/system/wde/widgets/file-tile-view?` + params)
|
||||
if (response.status != 200){
|
||||
//TODO Error text message
|
||||
WebDesktopEnvironment.Alert("TODO") //TODO
|
||||
WebDesktopEnvironment.Alert("TODO")
|
||||
return
|
||||
}
|
||||
let html = await response.text()
|
||||
|
@ -3,7 +3,7 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
// background-color: @col-white;
|
||||
background-color: @col-white;
|
||||
|
||||
|
||||
|
||||
@ -65,13 +65,13 @@
|
||||
/* background-image: url("./icons/folder.png"); */
|
||||
background-size: cover;
|
||||
|
||||
// image-rendering: optimizeSpeed; /* STOP SMOOTHING, GIVE ME SPEED */
|
||||
// image-rendering: -moz-crisp-edges; /* Firefox */
|
||||
// image-rendering: -o-crisp-edges; /* Opera */
|
||||
// image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */
|
||||
// image-rendering: pixelated; /* Universal support since 2021 */
|
||||
// image-rendering: optimize-contrast; /* CSS3 Proposed */
|
||||
// -ms-interpolation-mode: nearest-neighbor; /* IE8+ */
|
||||
image-rendering: optimizeSpeed; /* STOP SMOOTHING, GIVE ME SPEED */
|
||||
image-rendering: -moz-crisp-edges; /* Firefox */
|
||||
image-rendering: -o-crisp-edges; /* Opera */
|
||||
image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */
|
||||
image-rendering: pixelated; /* Universal support since 2021 */
|
||||
image-rendering: optimize-contrast; /* CSS3 Proposed */
|
||||
-ms-interpolation-mode: nearest-neighbor; /* IE8+ */
|
||||
}
|
||||
|
||||
.FileTileView .Selected .Icon{
|
||||
|
@ -3,7 +3,7 @@ export default class WebFS{
|
||||
* @param {string} path
|
||||
* @returns {boolean}
|
||||
*/
|
||||
static async CreateDirectory(path){
|
||||
static async CreateDirectory(path){
|
||||
if (path == undefined){
|
||||
WebDesktopEnvironment.Alert("Path is undefined")
|
||||
return false
|
||||
|
@ -1,13 +1,13 @@
|
||||
{{ define "finder/props.tmpl" }}
|
||||
<div class="title-bar DragArea">
|
||||
<button id="closeWindowButton" class="button" title="Close Window"></button>
|
||||
<div id="Drag" class="visual-drag-area"></div>
|
||||
<div class="lable">
|
||||
Properties
|
||||
<div class="TitleBar DragArea">
|
||||
<button id="closeWindowButton" class="Button" title="Close Window"></button>
|
||||
<div id="Drag" class="VisualDragArea"></div>
|
||||
<div class="Lable">
|
||||
File Properties
|
||||
</div>
|
||||
<div id="Drag" class="visual-drag-area"></div>
|
||||
<div id="Drag" class="VisualDragArea"></div>
|
||||
</div>
|
||||
<div class="content-border">
|
||||
<div class="ContentBorder">
|
||||
<div class="PropertiesList">
|
||||
<div class="Personal-properties-bio">
|
||||
<!-- <img src="data:{{ .headerProps.Icon.Header }},{{ .headerProps.Icon.Base64 }}" alt="File Icon" style="width: 48px;height: 48px;"> -->
|
Loading…
Reference in New Issue
Block a user