-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
7 changed files
with
331 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
$mol_file_demo $mol_example | ||
title \Webdav demo | ||
actual_url? \ | ||
sub / | ||
<= Left $mol_page | ||
title \Webdav controls | ||
body / | ||
<= Form $mol_form | ||
body / | ||
<= Webdav_url_field $mol_form_field | ||
name \WebDav url | ||
Content <= Webdav_url_control $mol_string | ||
hint \http:// | ||
value? <=> webdav_url? \ | ||
submit? <=> refresh? null | ||
buttons / | ||
<= Update $mol_button_major | ||
title \Update | ||
click? <=> refresh? null | ||
<= Right $mol_page | ||
title \Files | ||
body / <= Files $mol_list | ||
minimal_width 320 | ||
rows <= file_list /$mol_view | ||
<= File*0 $mol_card | ||
title <= file_name* \ | ||
status <= file_type* \file | ||
tags / | ||
\$mol_button | ||
\form | ||
\file upload | ||
\webdav | ||
aspects / | ||
\Widget/Form |
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,26 @@ | ||
namespace $.$$ { | ||
export class $mol_file_demo extends $.$mol_file_demo { | ||
@ $mol_mem | ||
root() { | ||
if (! this.actual_url().match(/^https?:\/\/.+/)) return null | ||
return this.$.$mol_file.absolute(this.actual_url()) | ||
} | ||
|
||
@ $mol_mem | ||
override file_list() { | ||
return this.root()?.sub().map(file => this.File(file.path())) ?? [] | ||
} | ||
|
||
@ $mol_mem | ||
override refresh(e?: Event) { | ||
this.actual_url(this.webdav_url()) | ||
} | ||
|
||
file_name(path: string) { | ||
return this.$.$mol_file.absolute(path).relate() | ||
} | ||
file_type(path: string) { | ||
return this.$.$mol_file.absolute(path).type() | ||
} | ||
} | ||
} |
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,17 @@ | ||
<!-- Disable quirks mode --> | ||
<!doctype html> | ||
|
||
<!-- Allow height:100% in body --> | ||
<html style=" height: 100% "> | ||
|
||
<!-- Force utf-8 encoding --> | ||
<meta charset="utf-8" /> | ||
|
||
<!-- Disable mobile browser auto zoom, $mol is adaptive --> | ||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1"> | ||
|
||
<!-- autobind component to element on load --> | ||
<body mol_view_root="$mol_file_demo"> | ||
|
||
<!-- link to autogenerated test js bundle --> | ||
<script src="web.js"></script> |
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
Oops, something went wrong.